@knocklabs/react-core 0.6.0-rc.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -4
- package/dist/cjs/modules/guide/hooks/useGuide.js.map +1 -1
- package/dist/esm/modules/guide/hooks/useGuide.mjs.map +1 -1
- package/dist/types/modules/guide/hooks/useGuide.d.ts +3 -3
- package/dist/types/modules/guide/hooks/useGuide.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/modules/guide/hooks/useGuide.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.6.
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [4c41841]
|
|
8
|
+
- @knocklabs/client@0.14.1
|
|
9
|
+
|
|
10
|
+
## 0.6.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
6
13
|
|
|
7
|
-
-
|
|
14
|
+
- 711948c: feat: add guide client, hooks, provider, and components
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [711948c]
|
|
19
|
+
- @knocklabs/client@0.14.0
|
|
20
|
+
|
|
21
|
+
## 0.5.2
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [187abc1]
|
|
26
|
+
- @knocklabs/client@0.13.1
|
|
27
|
+
|
|
28
|
+
## 0.5.1
|
|
8
29
|
|
|
9
30
|
### Patch Changes
|
|
10
31
|
|
|
11
|
-
- Updated dependencies [
|
|
12
|
-
- @knocklabs/client@0.13.0
|
|
32
|
+
- Updated dependencies [4cd1b1e]
|
|
33
|
+
- @knocklabs/client@0.13.0
|
|
13
34
|
|
|
14
35
|
## 0.5.0
|
|
15
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGuide.js","sources":["../../../../../src/modules/guide/hooks/useGuide.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"file":"useGuide.js","sources":["../../../../../src/modules/guide/hooks/useGuide.ts"],"sourcesContent":["import {\n KnockGuide,\n KnockGuideFilterParams,\n KnockGuideStep,\n} from \"@knocklabs/client\";\nimport { useStore } from \"@tanstack/react-store\";\n\nimport { UseGuideContextReturn, useGuideContext } from \"./useGuideContext\";\n\ninterface UseGuideReturn extends UseGuideContextReturn {\n guide: KnockGuide | undefined;\n step: KnockGuideStep | undefined;\n}\n\nexport const useGuide = (filters: KnockGuideFilterParams): UseGuideReturn => {\n const context = useGuideContext();\n\n if (!filters.key && !filters.type) {\n throw new Error(\n \"useGuide must be used with at least one filter: either a guide key or a guide type\",\n );\n }\n\n const { client, colorMode } = context;\n\n const [guide] = useStore(client.store, (state) =>\n client.select(state, filters),\n );\n\n const step = guide && guide.steps.find((s) => !s.message.archived_at);\n\n return { client, colorMode, guide, step };\n};\n"],"names":["useGuide","filters","context","useGuideContext","key","type","Error","client","colorMode","guide","useStore","store","state","select","step","steps","find","s","message","archived_at"],"mappings":"2JAcaA,EAAYC,GAAoD,CAC3E,MAAMC,EAAUC,EAAAA,gBAAgB,EAEhC,GAAI,CAACF,EAAQG,KAAO,CAACH,EAAQI,KACrB,MAAA,IAAIC,MACR,oFACF,EAGI,KAAA,CAAEC,OAAAA,EAAQC,UAAAA,CAAAA,EAAcN,EAExB,CAACO,CAAK,EAAIC,EAASH,SAAAA,EAAOI,MAAQC,GACtCL,EAAOM,OAAOD,EAAOX,CAAO,CAC9B,EAEMa,EAAOL,GAASA,EAAMM,MAAMC,KAAY,GAAA,CAACC,EAAEC,QAAQC,WAAW,EAE7D,MAAA,CAAEZ,OAAAA,EAAQC,UAAAA,EAAWC,MAAAA,EAAOK,KAAAA,CAAK,CAC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGuide.mjs","sources":["../../../../../src/modules/guide/hooks/useGuide.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"file":"useGuide.mjs","sources":["../../../../../src/modules/guide/hooks/useGuide.ts"],"sourcesContent":["import {\n KnockGuide,\n KnockGuideFilterParams,\n KnockGuideStep,\n} from \"@knocklabs/client\";\nimport { useStore } from \"@tanstack/react-store\";\n\nimport { UseGuideContextReturn, useGuideContext } from \"./useGuideContext\";\n\ninterface UseGuideReturn extends UseGuideContextReturn {\n guide: KnockGuide | undefined;\n step: KnockGuideStep | undefined;\n}\n\nexport const useGuide = (filters: KnockGuideFilterParams): UseGuideReturn => {\n const context = useGuideContext();\n\n if (!filters.key && !filters.type) {\n throw new Error(\n \"useGuide must be used with at least one filter: either a guide key or a guide type\",\n );\n }\n\n const { client, colorMode } = context;\n\n const [guide] = useStore(client.store, (state) =>\n client.select(state, filters),\n );\n\n const step = guide && guide.steps.find((s) => !s.message.archived_at);\n\n return { client, colorMode, guide, step };\n};\n"],"names":["useGuide","filters","context","useGuideContext","key","type","Error","client","colorMode","guide","useStore","store","state","select","step","steps","find","s","message","archived_at"],"mappings":";;AAcaA,MAAAA,IAAWA,CAACC,MAAoD;AAC3E,QAAMC,IAAUC,EAAgB;AAEhC,MAAI,CAACF,EAAQG,OAAO,CAACH,EAAQI;AACrB,UAAA,IAAIC,MACR,oFACF;AAGI,QAAA;AAAA,IAAEC,QAAAA;AAAAA,IAAQC,WAAAA;AAAAA,EAAAA,IAAcN,GAExB,CAACO,CAAK,IAAIC,EAASH,EAAOI,OAAQC,CAAAA,MACtCL,EAAOM,OAAOD,GAAOX,CAAO,CAC9B,GAEMa,IAAOL,KAASA,EAAMM,MAAMC,KAAMC,CAAM,MAAA,CAACA,EAAEC,QAAQC,WAAW;AAE7D,SAAA;AAAA,IAAEZ,QAAAA;AAAAA,IAAQC,WAAAA;AAAAA,IAAWC,OAAAA;AAAAA,IAAOK,MAAAA;AAAAA,EAAK;AAC1C;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KnockGuide, KnockGuideFilterParams, KnockGuideStep } from '@knocklabs/client';
|
|
2
2
|
import { UseGuideContextReturn } from './useGuideContext';
|
|
3
3
|
interface UseGuideReturn extends UseGuideContextReturn {
|
|
4
|
-
guide:
|
|
5
|
-
step:
|
|
4
|
+
guide: KnockGuide | undefined;
|
|
5
|
+
step: KnockGuideStep | undefined;
|
|
6
6
|
}
|
|
7
7
|
export declare const useGuide: (filters: KnockGuideFilterParams) => UseGuideReturn;
|
|
8
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGuide.d.ts","sourceRoot":"","sources":["../../../../../src/modules/guide/hooks/useGuide.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"useGuide.d.ts","sourceRoot":"","sources":["../../../../../src/modules/guide/hooks/useGuide.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,qBAAqB,EAAmB,MAAM,mBAAmB,CAAC;AAE3E,UAAU,cAAe,SAAQ,qBAAqB;IACpD,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,QAAQ,GAAI,SAAS,sBAAsB,KAAG,cAkB1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@knocklabs/react-core",
|
|
3
3
|
"description": "A set of React components to build notification experiences powered by Knock",
|
|
4
4
|
"author": "@knocklabs",
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.1",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
8
8
|
"module": "dist/esm/index.mjs",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@knocklabs/client": "^0.
|
|
52
|
+
"@knocklabs/client": "^0.14.1",
|
|
53
53
|
"@tanstack/react-store": "^0.5.5",
|
|
54
54
|
"date-fns": "^4.0.0",
|
|
55
55
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@testing-library/react": "^16.2.0",
|
|
62
62
|
"@types/react": "^18.3.6",
|
|
63
63
|
"@typescript-eslint/eslint-plugin": "^8.19.1",
|
|
64
|
-
"@typescript-eslint/parser": "^8.
|
|
64
|
+
"@typescript-eslint/parser": "^8.27.0",
|
|
65
65
|
"@vitejs/plugin-react": "^4.3.4",
|
|
66
66
|
"babel-plugin-react-require": "^4.0.3",
|
|
67
67
|
"eslint": "^8.56.0",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
+
KnockGuide,
|
|
2
3
|
KnockGuideFilterParams,
|
|
3
|
-
|
|
4
|
-
KnockGuideWithHandlers,
|
|
4
|
+
KnockGuideStep,
|
|
5
5
|
} from "@knocklabs/client";
|
|
6
6
|
import { useStore } from "@tanstack/react-store";
|
|
7
7
|
|
|
8
8
|
import { UseGuideContextReturn, useGuideContext } from "./useGuideContext";
|
|
9
9
|
|
|
10
10
|
interface UseGuideReturn extends UseGuideContextReturn {
|
|
11
|
-
guide:
|
|
12
|
-
step:
|
|
11
|
+
guide: KnockGuide | undefined;
|
|
12
|
+
step: KnockGuideStep | undefined;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const useGuide = (filters: KnockGuideFilterParams): UseGuideReturn => {
|