Skip to content

Commit b480ced

Browse files
update to chakra v2 (#28)
* change d with display, update readme * add github actions
1 parent ad98470 commit b480ced

File tree

5 files changed

+43
-8
lines changed

5 files changed

+43
-8
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish to NPM
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v3
11+
- name: Setup Node
12+
uses: actions/setup-node@v3
13+
with:
14+
node-version: '14.x'
15+
cache: 'yarn'
16+
registry-url: 'https://registry.npmjs.org'
17+
- name: Install dependencies and build 🔧
18+
run: yarn install && yarn build
19+
- name: Publish package on NPM 📦
20+
run: yarn publish
21+
env:
22+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [4.1.0] - 2022-06-23
6+
7+
- Allows `react-markdown v8` and `chakra-ui v2` (#27, thanks [@baartch](https://github.com/baartch))
8+
- Updates deprecated `d=...` property to `display=...` property.
9+
- Changes type definition of first parameter. `heading` is not accepted as a property anymore since it isn't used anywhere. Use `h1, h2, h3, h4, h5, h6` instead.
10+
511
## [4.0.0] - 2021-11-19
612

713
### 🔥💥 Breaking Changes

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ This package is created for people who using [Chakra-UI's](https://chakra-ui.com
1010

1111
CSSReset component is turning down every default style of elements that provided by browser. HTML elements like h1, h2, h3... aren't get default styles but Markdown need them for rendering purposes. This package is solving the problem by changing renderer defaults with chakra-ui's components.
1212

13-
For example, when you want to render level 2 heading component, it is rendering: `<Heading as="h2" size="xl">Your Header Title</Heading>`.
14-
1513
### Install
1614

17-
Make @chakra-ui/react installation how they tell you on their [Getting Started - Chakra UI](https://chakra-ui.com/docs/getting-started) page.
15+
- Install @chakra-ui/react by following their [Getting Started - Chakra UI](https://chakra-ui.com/getting-started) guide.
16+
- Install [react-markdown](https://github.com/remarkjs/react-markdown).
17+
- Install `chakra-ui-markdown-renderer`.
1818

1919
```sh
20-
$ yarn add @chakra-ui/react @emotion/react @emotion/styled framer-motion chakra-ui-markdown-renderer
20+
$ yarn add chakra-ui-markdown-renderer
2121

2222
# or
2323

24-
$ npm i @chakra-ui/react @emotion/react @emotion/styled framer-motion chakra-ui-markdown-renderer
24+
$ npm i chakra-ui-markdown-renderer
2525
```
2626

2727
### Usage
@@ -56,3 +56,7 @@ const newTheme = {
5656
skipHtml
5757
/>;
5858
```
59+
60+
#### Alternative ways
61+
62+
[@nikolovlazar/chakra-ui-prose](https://www.npmjs.com/package/@nikolovlazar/chakra-ui-prose) might also work depends on your needs.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "dist/index.cjs.js",
44
"module": "dist/index.esm.js",
55
"source": "src/index.tsx",
6-
"version": "4.0.0",
6+
"version": "4.1.0",
77
"private": false,
88
"types": "./dist/index.d.ts",
99
"license": "MIT",
@@ -42,7 +42,7 @@
4242
"scripts": {
4343
"prepare": "install-peers",
4444
"build": "rollup -c",
45-
"build-watch": "rollup -c -w"
45+
"build:watch": "rollup -c -w"
4646
},
4747
"eslintConfig": {
4848
"extends": "react-app"

src/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ function getCoreProps(props: GetCoreProps): any {
2828
}
2929

3030
interface Defaults extends Components {
31+
/**
32+
* @deprecated Use `h1, h2, h3, h4, h5, h6` instead.
33+
*/
3134
heading?: Components['h1'];
3235
}
3336

@@ -59,7 +62,7 @@ export const defaults: Defaults = {
5962
<Code
6063
className={className}
6164
whiteSpace="break-spaces"
62-
d="block"
65+
display="block"
6366
w="full"
6467
p={2}
6568
children={children}

0 commit comments

Comments
 (0)