Skip to content

Commit be7ff58

Browse files
Updated docz generator to use gatsby
1 parent 037d82d commit be7ff58

File tree

8 files changed

+3660
-245
lines changed

8 files changed

+3660
-245
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
node_modules
66
.cache
77
dist
8+
public
89

910
# Logs
1011
logs

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ section on the hotkeys documentation for more info.
5252
gets hit by the user. **Important:** Since version 1.5.0 this callback gets memoised inside the hook. So you don't have
5353
to do this anymore by yourself.
5454
- `options: Options = {}`
55-
- `filter: (event: KeyboardEvent): boolean` is used to enable hotkeys inside input elements. Check out [hotkeys docs](https://github.com/jaywcjlove/hotkeys/#filter) for usage. Due to constraints with the base library, `filter` is a global setting. As a result, it is currently not possible to have different filters for separate calls of `useHotkey`.
55+
- * `filter: (event: KeyboardEvent): boolean` is used to filter if a callback gets triggered depending on the keyboard event.
56+
**Breaking Change in `3.0.0`!** Prior to version `3.0.0` the filter settings was one global setting that applied to every
57+
hook. Since `3.0.0` this behavior changed. The `filter` option is now locally scoped to each call of `useHotkeys`.
5658
- * `enableOnTags: string[]` is used to enable listening to hotkeys in form fields. Available values are `INPUT`, `TEXTAREA` and `SELECT`. **IMPORTANT!** When you provide a custom `filter` implementation function this parameter will be ignored. Similar to `filter`, setting this option will enable it globally.
5759
- `splitKey: string` is used to change the splitting character inside the keys argument. Default is `+`, but if you want
5860
to listen to the `+` character, you can set `splitKey` to i.e. `-` and listen for `ctrl-+`

babel.config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"plugins": ["@babel/plugin-proposal-class-properties"]
3+
}

docs/useHotkeys.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ The options parameter is used to pass options directly to the hotkeys package. C
6868
for an overview.
6969

7070
### Parameters
71-
* `filter: (event: KeyboardEvent): boolean` is used to enable hotkeys inside input elements. Check out
72-
[hotkeys docs](https://github.com/jaywcjlove/hotkeys/#filter) for usage. Due to constraints with the base library,
73-
`filter` is a global setting. As a result, it is currently not possible to have different filters for separate calls of `useHotkey`.
71+
* `filter: (event: KeyboardEvent): boolean` is used to filter if a callback gets triggered depending on the keyboard event.
72+
**Breaking Change in `3.0.0`!** Prior to version `3.0.0` the filter settings was one global setting that applied to every
73+
hook. Since `3.0.0` this behavior changed. The `filter` option is now locally scoped to each call of `useHotkeys`.
7474
* `enableOnTags: string[]` is used to enable listening to hotkeys in form fields. Available values are `INPUT`, `TEXTAREA`
7575
and `SELECT`. Similar to `filter`, setting this option will enable it globally.
7676
**IMPORTANT!** When you provide a custom `filter` implementation function this parameter will be ignored.

doczrc.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ export default {
99
hashRouter: true,
1010
typescript: true,
1111
themeConfig: {
12-
colors: {
13-
primary: '#000000',
14-
},
12+
initialColorMode: 'dark',
1513
},
1614
};

gatsby-config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: [
3+
'gatsby-theme-docz',
4+
`gatsby-transformer-sharp`,
5+
],
6+
}

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"build": "tsdx build",
2929
"test": "jest",
3030
"publish": "np",
31-
"docz:dev": "docz dev",
32-
"docz:build": "docz build"
31+
"docz:dev": "gatsby develop",
32+
"docz:build": "gatsby build"
3333
},
3434
"babel": {
3535
"presets": [
@@ -56,10 +56,10 @@
5656
},
5757
"devDependencies": {
5858
"@babel/core": "7.12.10",
59+
"@babel/plugin-proposal-class-properties": "7.12.1",
5960
"@babel/preset-env": "7.12.11",
6061
"@babel/preset-react": "7.12.10",
6162
"@babel/preset-typescript": "7.12.7",
62-
"@emotion/core": "11.0.0",
6363
"@testing-library/react": "11.2.2",
6464
"@testing-library/react-hooks": "3.4.2",
6565
"@types/jest": "26.0.19",
@@ -68,7 +68,10 @@
6868
"@types/testing-library__react": "10.0.1",
6969
"@types/testing-library__react-hooks": "3.4.1",
7070
"docz": "2.3.1",
71-
"emotion-theming": "11.0.0",
71+
"gatsby": "2.29.1",
72+
"gatsby-plugin-sharp": "2.11.1",
73+
"gatsby-theme-docz": "2.3.1",
74+
"gatsby-transformer-sharp": "2.9.0",
7275
"eslint-plugin-prettier": "3.3.0",
7376
"gatsby-plugin-emotion": "5.1.0",
7477
"jest": "26.6.3",

yarn.lock

Lines changed: 3636 additions & 234 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)