@knocklabs/react 0.11.0 → 0.11.2
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 +21 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/modules/feed/components/NotificationIconButton/NotificationIconButton.js.map +1 -1
- package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js +1 -1
- package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/V1/V1.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/V1/V1.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideHoverCard.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideHoverCard.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/shared.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/shared.js.map +1 -0
- package/dist/cjs/modules/guide/providers/KnockGuideProvider.js +1 -1
- package/dist/cjs/modules/guide/providers/KnockGuideProvider.js.map +1 -1
- package/dist/esm/index.mjs +112 -102
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/modules/feed/components/NotificationIconButton/NotificationIconButton.mjs.map +1 -1
- package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs +5 -5
- package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs +18 -0
- package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/V1/V1.mjs +42 -0
- package/dist/esm/modules/guide/components/Toolbar/V1/V1.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs +27 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideHoverCard.mjs +27 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideHoverCard.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs +37 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.mjs +17 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs +54 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs +13 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs +166 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/shared.mjs +5 -0
- package/dist/esm/modules/guide/components/Toolbar/shared.mjs.map +1 -0
- package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs +16 -6
- package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/feed/components/NotificationIconButton/NotificationIconButton.d.ts +1 -1
- package/dist/types/modules/feed/components/NotificationIconButton/NotificationIconButton.d.ts.map +1 -1
- package/dist/types/modules/feed/components/UnseenBadge/UnseenBadge.d.ts +1 -1
- package/dist/types/modules/feed/components/UnseenBadge/UnseenBadge.d.ts.map +1 -1
- package/dist/types/modules/feed/components/UnseenBadge/index.d.ts +1 -1
- package/dist/types/modules/feed/components/UnseenBadge/index.d.ts.map +1 -1
- package/dist/types/modules/feed/index.d.ts +1 -1
- package/dist/types/modules/feed/index.d.ts.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/KnockButton.d.ts +6 -0
- package/dist/types/modules/guide/components/Toolbar/KnockButton.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V1/V1.d.ts +2 -0
- package/dist/types/modules/guide/components/Toolbar/V1/V1.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V1/index.d.ts +2 -0
- package/dist/types/modules/guide/components/Toolbar/V1/index.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V2/GuideContextDetails.d.ts +2 -0
- package/dist/types/modules/guide/components/Toolbar/V2/GuideContextDetails.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V2/GuideHoverCard.d.ts +8 -0
- package/dist/types/modules/guide/components/Toolbar/V2/GuideHoverCard.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V2/GuideRow.d.ts +8 -0
- package/dist/types/modules/guide/components/Toolbar/V2/GuideRow.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.d.ts +8 -0
- package/dist/types/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V2/V2.d.ts +2 -0
- package/dist/types/modules/guide/components/Toolbar/V2/V2.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V2/helpers.d.ts +2 -0
- package/dist/types/modules/guide/components/Toolbar/V2/helpers.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V2/index.d.ts +2 -0
- package/dist/types/modules/guide/components/Toolbar/V2/index.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.d.ts +79 -0
- package/dist/types/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/index.d.ts +3 -0
- package/dist/types/modules/guide/components/Toolbar/index.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/shared.d.ts +2 -0
- package/dist/types/modules/guide/components/Toolbar/shared.d.ts.map +1 -0
- package/dist/types/modules/guide/components/index.d.ts +1 -1
- package/dist/types/modules/guide/components/index.d.ts.map +1 -1
- package/dist/types/modules/guide/index.d.ts +1 -1
- package/dist/types/modules/guide/index.d.ts.map +1 -1
- package/dist/types/modules/guide/providers/KnockGuideProvider.d.ts +5 -1
- package/dist/types/modules/guide/providers/KnockGuideProvider.d.ts.map +1 -1
- package/package.json +6 -4
- package/dist/cjs/modules/guide/components/GuideToolbar/GuideToolbar.js +0 -2
- package/dist/cjs/modules/guide/components/GuideToolbar/GuideToolbar.js.map +0 -1
- package/dist/esm/modules/guide/components/GuideToolbar/GuideToolbar.mjs +0 -47
- package/dist/esm/modules/guide/components/GuideToolbar/GuideToolbar.mjs.map +0 -1
- package/dist/types/modules/guide/components/GuideToolbar/GuideToolbar.d.ts +0 -2
- package/dist/types/modules/guide/components/GuideToolbar/GuideToolbar.d.ts.map +0 -1
- package/dist/types/modules/guide/components/GuideToolbar/index.d.ts +0 -2
- package/dist/types/modules/guide/components/GuideToolbar/index.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/V2.tsx"],"sourcesContent":["import { useGuideContext } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Minimize2, Undo2 } from \"lucide-react\";\nimport React from \"react\";\n\nimport { KnockButton } from \"../KnockButton\";\nimport { TOOLBAR_Z_INDEX } from \"../shared\";\nimport \"../styles.css\";\n\nimport { GuideContextDetails } from \"./GuideContextDetails\";\nimport { GuideRow } from \"./GuideRow\";\nimport {\n DisplayOption,\n GuidesListDisplaySelect,\n} from \"./GuidesListDisplaySelect\";\nimport { detectToolbarParam } from \"./helpers\";\nimport {\n InspectionResult,\n useInspectGuideClientStore,\n} from \"./useInspectGuideClientStore\";\n\nconst GuidesList = ({\n guides,\n displayOption,\n}: {\n guides: InspectionResult[\"guides\"];\n displayOption: DisplayOption;\n}) => {\n return guides.map((guide, idx) => {\n const { isEligible, isQualified, selectable } = guide.annotation;\n const isDisplayable = isEligible && isQualified;\n const isDisplaying = isDisplayable && selectable.status === \"returned\";\n\n if (displayOption === \"only-displaying\" && !isDisplaying) {\n return null;\n }\n if (displayOption === \"only-displayable\" && !isDisplayable) {\n return null;\n }\n if (displayOption === \"all-eligible\" && !isEligible) {\n return null;\n }\n\n return <GuideRow key={guide.key} guide={guide} orderIndex={idx} />;\n });\n};\n\nexport const V2 = () => {\n const { client } = useGuideContext();\n\n const [guidesListDisplayOption, setGuidesListDisplayOption] =\n React.useState<DisplayOption>(\"only-displayable\");\n\n const [isVisible, setIsVisible] = React.useState(detectToolbarParam());\n const [isCollapsed, setIsCollapsed] = React.useState(true);\n\n React.useEffect(() => {\n if (!isVisible) {\n return;\n }\n\n client.setDebug();\n\n return () => {\n client.unsetDebug();\n };\n }, [isVisible, client]);\n\n const result = useInspectGuideClientStore();\n if (!result) {\n return null;\n }\n\n return (\n <Box position=\"fixed\" top=\"4\" right=\"4\" style={{ zIndex: TOOLBAR_Z_INDEX }}>\n {isCollapsed ? (\n <KnockButton onClick={() => setIsCollapsed(false)} />\n ) : (\n <Stack\n direction=\"column\"\n backgroundColor=\"surface-2\"\n shadow=\"2\"\n rounded=\"3\"\n border=\"px\"\n overflow=\"hidden\"\n style={{ width: \"400px\" }}\n >\n <Stack\n w=\"full\"\n p=\"2\"\n justify=\"space-between\"\n direction=\"row\"\n style={{ boxSizing: \"border-box\" }}\n >\n <Box style={{ width: \"220px\" }}>\n <GuidesListDisplaySelect\n value={guidesListDisplayOption}\n onChange={(opt) => setGuidesListDisplayOption(opt)}\n />\n </Box>\n\n <Stack gap=\"2\">\n <Button\n onClick={() => setIsVisible(false)}\n size=\"1\"\n variant=\"soft\"\n trailingIcon={{ icon: Undo2, \"aria-hidden\": true }}\n >\n Exit\n </Button>\n <Button\n onClick={() => setIsCollapsed(true)}\n size=\"1\"\n variant=\"soft\"\n leadingIcon={{ icon: Minimize2, alt: \"Collapse guide toolbar\" }}\n />\n </Stack>\n </Stack>\n\n <Box w=\"full\">\n {result.error && <Box>{result.error}</Box>}\n <GuideContextDetails />\n <GuidesList\n guides={result.guides}\n displayOption={guidesListDisplayOption}\n />\n </Box>\n </Stack>\n )}\n </Box>\n );\n};\n"],"names":["GuidesList","guides","displayOption","map","guide","idx","isEligible","isQualified","selectable","annotation","isDisplayable","isDisplaying","status","GuideRow","key","V2","client","useGuideContext","guidesListDisplayOption","setGuidesListDisplayOption","React","useState","isVisible","setIsVisible","detectToolbarParam","isCollapsed","setIsCollapsed","useEffect","setDebug","unsetDebug","result","useInspectGuideClientStore","Box","zIndex","TOOLBAR_Z_INDEX","KnockButton","Stack","width","boxSizing","GuidesListDisplaySelect","opt","Button","icon","Undo2","Minimize2","alt","error","GuideContextD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ACP,UAAS,UACT,OAAO;AAAA,IAAEC,OAAO;AAAA,EAAQ,EAAA,GAEvBjB,gBAAAA,EAAA,cAAAgB,GAAA,EACC,GAAE,QACF,GAAE,KACF,SAAQ,iBACR,WAAU,OACV,OAAO;AAAA,IAAEE,WAAW;AAAA,EAAa,EAAA,GAEhClB,gBAAAA,EAAA,cAAAY,GAAA,EAAI,OAAO;AAAA,IAAEK,OAAO;AAAA,EAAA,EAAQ,GAC1BjB,gBAAAA,EAAA,cAAAmB,GAAA,EACC,OAAOrB,GACP,UAAWsB,CAAAA,MAAQrB,EAA2BqB,CAAG,EAAE,CAAA,CAEvD,GAEApB,gBAAAA,EAAA,cAACgB,GAAM,EAAA,KAAI,IACT,GAAAhB,gBAAAA,EAAA,cAACqB,GACC,EAAA,SAAS,MAAMlB,EAAa,EAAK,GACjC,MAAK,KACL,SAAQ,QACR,cAAc;AAAA,IAAEmB,MAAMC;AAAAA,IAAO,eAAe;AAAA,EAAA,EAAO,GAAA,MAGrD,GACAvB,gBAAAA,EAAA,cAACqB,KACC,SAAS,MAAMf,EAAe,EAAI,GAClC,MAAK,KACL,SAAQ,QACR,aAAa;AAAA,IAAEgB,MAAME;AAAAA,IAAWC,KAAK;AAAA,EAAA,EAA2B,CAAA,CAEpE,CACF,GAEAzB,gBAAAA,EAAA,cAACY,GAAI,EAAA,GAAE,OACJF,GAAAA,EAAOgB,SAAS1B,gBAAAA,EAAA,cAACY,GAAKF,MAAAA,EAAOgB,KAAM,GACnC1B,gBAAAA,EAAA,cAAA2B,GAAA,IAAmB,GACpB3B,gBAAAA,EAAA,cAACpB,GACC,EAAA,QAAQ8B,EAAO7B,QACf,eAAeiB,EAAAA,CAAwB,CAE3C,CACF,CAEJ,IA3DO;AA6DX;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "@knocklabs/react-core";
|
|
2
|
+
import "react";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import "lodash.debounce";
|
|
5
|
+
import { checkForWindow as o } from "../../../../core/utils.mjs";
|
|
6
|
+
const a = "knock_guide_toolbar", l = () => {
|
|
7
|
+
const r = o();
|
|
8
|
+
return !r || !r.location ? !1 : new URLSearchParams(r.location.search).get(a) === "true";
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
l as detectToolbarParam
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=helpers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/helpers.ts"],"sourcesContent":["import { checkForWindow } from \"../../../../../modules/core\";\n\n// Use this param to start Toolbar and enter into a debugging session when\n// it is present and set to true.\nconst TOOLBAR_QUERY_PARAM = \"knock_guide_toolbar\";\n\nexport const detectToolbarParam = () => {\n const win = checkForWindow();\n if (!win || !win.location) {\n return false;\n }\n\n const urlSearchParams = new URLSearchParams(win.location.search);\n const hasToolbarParam = urlSearchParams.get(TOOLBAR_QUERY_PARAM) === \"true\";\n\n return hasToolbarParam;\n};\n"],"names":["TOOLBAR_QUERY_PARAM","detectToolbarParam","win","checkForWindow","location","URLSearchParams","search","get"],"mappings":";;;;;AAIA,MAAMA,IAAsB,uBAEfC,IAAqBA,MAAM;AACtC,QAAMC,IAAMC,EAAe;AAC3B,SAAI,CAACD,KAAO,CAACA,EAAIE,WACR,KAGe,IAAIC,gBAAgBH,EAAIE,SAASE,MAAM,EACvBC,IAAIP,CAAmB,MAAM;AAGvE;"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { checkStateIfThrottled as p, checkActivatable as y } from "@knocklabs/client";
|
|
2
|
+
import { useGuideContext as _, useStore as b } from "@knocklabs/react-core";
|
|
3
|
+
const g = (e) => e.reduce((r, s) => ({
|
|
4
|
+
...r,
|
|
5
|
+
[s.key]: s
|
|
6
|
+
}), {}), v = (e, r, s, n) => {
|
|
7
|
+
var u, t, o, a, l, c, d, f;
|
|
8
|
+
const i = !!((a = (o = (t = (u = n.key) == null ? void 0 : u.one) == null ? void 0 : t.metadata) == null ? void 0 : o.opts) != null && a.includeThrottled) || !!((f = (d = (c = (l = n.key) == null ? void 0 : l.all) == null ? void 0 : c.metadata) == null ? void 0 : d.opts) != null && f.includeThrottled);
|
|
9
|
+
return e.bypass_global_group_limit ? "returned" : e.key === s.resolved ? r.throttled && !i ? "throttled" : "returned" : "queried";
|
|
10
|
+
}, k = (e, r, s, n) => {
|
|
11
|
+
var t, o, a, l;
|
|
12
|
+
const i = !!((l = (a = (o = (t = n.type) == null ? void 0 : t.one) == null ? void 0 : o.metadata) == null ? void 0 : a.opts) != null && l.includeThrottled), u = n.type.one;
|
|
13
|
+
if (u.size === 0)
|
|
14
|
+
return "queried";
|
|
15
|
+
if (e.bypass_global_group_limit) {
|
|
16
|
+
const d = [...u.values()][0];
|
|
17
|
+
return e.key !== d.key ? "queried" : "returned";
|
|
18
|
+
}
|
|
19
|
+
return e.key === s.resolved ? r.throttled && !i ? "throttled" : "returned" : "queried";
|
|
20
|
+
}, h = (e, r, s, n) => {
|
|
21
|
+
var l, c, d, f;
|
|
22
|
+
const i = n.type.all;
|
|
23
|
+
if (i.size === 0)
|
|
24
|
+
return "queried";
|
|
25
|
+
const u = [...i.values()], t = u[0], o = g(u);
|
|
26
|
+
return (f = (d = (c = (l = n.type) == null ? void 0 : l.all) == null ? void 0 : c.metadata) == null ? void 0 : d.opts) != null && f.includeThrottled ? o[e.key] ? "returned" : "queried" : (t.bypass_global_group_limit || t.key === s.resolved) && o[e.key] ? r.throttled ? e.bypass_global_group_limit ? "returned" : "throttled" : "returned" : "queried";
|
|
27
|
+
}, m = (e, r, s, n) => {
|
|
28
|
+
var i, u;
|
|
29
|
+
if (n.key)
|
|
30
|
+
return v(e, r, s, n);
|
|
31
|
+
if ((i = n.type) != null && i.all)
|
|
32
|
+
return h(e, r, s, n);
|
|
33
|
+
if ((u = n.type) != null && u.one)
|
|
34
|
+
return k(e, r, s, n);
|
|
35
|
+
}, G = (e, r, s) => {
|
|
36
|
+
if (!s || s.status === "open")
|
|
37
|
+
return {
|
|
38
|
+
status: void 0
|
|
39
|
+
};
|
|
40
|
+
const n = {
|
|
41
|
+
key: (s.results.key || {})[e.key],
|
|
42
|
+
type: (s.results.type || {})[e.type]
|
|
43
|
+
};
|
|
44
|
+
if (!!!(n.key || n.type))
|
|
45
|
+
return {
|
|
46
|
+
status: void 0
|
|
47
|
+
};
|
|
48
|
+
const u = m(e, r, s, n);
|
|
49
|
+
return u ? {
|
|
50
|
+
status: u,
|
|
51
|
+
query: n
|
|
52
|
+
} : {
|
|
53
|
+
status: void 0
|
|
54
|
+
};
|
|
55
|
+
}, S = (e) => {
|
|
56
|
+
switch (e.reason) {
|
|
57
|
+
case "not_in_target_audience":
|
|
58
|
+
case "target_conditions_not_met":
|
|
59
|
+
return {
|
|
60
|
+
targetable: {
|
|
61
|
+
status: !1,
|
|
62
|
+
reason: e.reason,
|
|
63
|
+
message: e.message
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
case "marked_as_archived":
|
|
67
|
+
return {
|
|
68
|
+
archived: {
|
|
69
|
+
status: !0
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
case "guide_not_active":
|
|
73
|
+
return {
|
|
74
|
+
active: {
|
|
75
|
+
status: !1
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
default:
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
}, T = ({
|
|
82
|
+
active: e,
|
|
83
|
+
targetable: r,
|
|
84
|
+
archived: s
|
|
85
|
+
}) => !(!e.status || !r.status || s.status), w = ({
|
|
86
|
+
activatable: e,
|
|
87
|
+
selectable: r
|
|
88
|
+
}) => !(!e.status || !r.status), B = (e, r, s) => {
|
|
89
|
+
const {
|
|
90
|
+
ineligibleGuides: n,
|
|
91
|
+
location: i
|
|
92
|
+
} = r, u = n[e.key], t = u ? S(u) : void 0, o = {
|
|
93
|
+
// isEligible:
|
|
94
|
+
active: (t == null ? void 0 : t.active) || {
|
|
95
|
+
status: !0
|
|
96
|
+
},
|
|
97
|
+
targetable: (t == null ? void 0 : t.targetable) || {
|
|
98
|
+
status: !0
|
|
99
|
+
},
|
|
100
|
+
archived: (t == null ? void 0 : t.archived) || {
|
|
101
|
+
status: !1
|
|
102
|
+
},
|
|
103
|
+
// isQualified:
|
|
104
|
+
activatable: {
|
|
105
|
+
status: y(e, i)
|
|
106
|
+
},
|
|
107
|
+
selectable: G(e, r, s)
|
|
108
|
+
}, a = {
|
|
109
|
+
...o,
|
|
110
|
+
isEligible: T(o),
|
|
111
|
+
isQualified: w(o)
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
...e,
|
|
115
|
+
annotation: a
|
|
116
|
+
};
|
|
117
|
+
}, I = (e) => ({
|
|
118
|
+
__typename: "UnknownGuide",
|
|
119
|
+
key: e,
|
|
120
|
+
active: !1,
|
|
121
|
+
bypass_global_group_limit: !1,
|
|
122
|
+
annotation: {
|
|
123
|
+
isEligible: !1,
|
|
124
|
+
isQualified: !1,
|
|
125
|
+
selectable: {
|
|
126
|
+
status: void 0
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}), U = () => {
|
|
130
|
+
var u;
|
|
131
|
+
const {
|
|
132
|
+
client: e
|
|
133
|
+
} = _(), r = b(e.store, (t) => {
|
|
134
|
+
const o = p(t);
|
|
135
|
+
return {
|
|
136
|
+
location: t.location,
|
|
137
|
+
guides: t.guides,
|
|
138
|
+
guideGroups: t.guideGroups,
|
|
139
|
+
ineligibleGuides: t.ineligibleGuides,
|
|
140
|
+
debug: t.debug,
|
|
141
|
+
counter: t.counter,
|
|
142
|
+
throttled: o
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
if (!((u = r.debug) != null && u.debugging))
|
|
146
|
+
return;
|
|
147
|
+
const s = r.guideGroups[0];
|
|
148
|
+
if (!s)
|
|
149
|
+
return {
|
|
150
|
+
error: "no_guide_group",
|
|
151
|
+
guides: []
|
|
152
|
+
};
|
|
153
|
+
const n = e.getStage();
|
|
154
|
+
return {
|
|
155
|
+
guides: s.display_sequence.map((t) => {
|
|
156
|
+
const o = r.guides[t];
|
|
157
|
+
return o ? B(o, r, n) : I(t);
|
|
158
|
+
})
|
|
159
|
+
};
|
|
160
|
+
}, E = (e) => typeof e == "object" && e !== null && "__typename" in e && e.__typename === "UnknownGuide";
|
|
161
|
+
export {
|
|
162
|
+
E as isUnknownGuide,
|
|
163
|
+
w as resolveIsQualified,
|
|
164
|
+
U as useInspectGuideClientStore
|
|
165
|
+
};
|
|
166
|
+
//# sourceMappingURL=useInspectGuideClientStore.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInspectGuideClientStore.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.ts"],"sourcesContent":["import {\n KnockGuide,\n KnockGuideClientGroupStage,\n KnockGuideClientStoreState,\n KnockGuideIneligibilityMarker,\n KnockGuideSelectionResult,\n checkActivatable,\n checkStateIfThrottled,\n} from \"@knocklabs/client\";\nimport { useGuideContext, useStore } from \"@knocklabs/react-core\";\n\nconst byKey = <T extends { key: string }>(items: T[]) => {\n return items.reduce((acc, item) => ({ ...acc, [item.key]: item }), {});\n};\n\n/**\n * This is the main module that will house core logic for the toolbar. It hooks\n * into the guide client state store, extracts relevant data for debugging, and\n * transforms it into easily consumable data for the toolbar - namely\n * \"annotating\" guides for its various statuses to display.\n */\n\n// Active: `true` status = good\ntype ActiveStatus = {\n status: boolean;\n};\n\n// Targetable: `true` status = good\ntype TargetableStatusTrue = {\n status: true;\n};\ntype TargetableStatusFalse = {\n status: false;\n reason: string;\n message: string;\n};\ntype TargetableStatus = TargetableStatusTrue | TargetableStatusFalse;\n\ntype ActivatableStatus = {\n status: boolean;\n};\n\n// Archived: `false` status = good\ntype ArchivedStatus = {\n status: boolean;\n};\n\n// Selectable:\n// - \"returned\": Queried and resolved to return the guide from useGuide(s).\n// - \"throttled\": Queried and resolved but being throttled, so not yet returned.\n// - \"queried\": Queried but not resolved, because there are other higher\n// priority guides that are ahead of this guide in the query result.\n// - undefined: Not reachable with any of the given queries and filters.\ntype SelectionResultByLimit = {\n one?: KnockGuideSelectionResult;\n all?: KnockGuideSelectionResult;\n};\ntype SelectionResultByQuery = {\n key?: SelectionResultByLimit;\n type?: SelectionResultByLimit;\n};\ntype SelectableStatusPresent = {\n status: \"returned\" | \"throttled\" | \"queried\";\n query: SelectionResultByQuery;\n};\ntype SelectableStatusAbsent = {\n status: undefined;\n};\ntype SelectableStatus = SelectableStatusPresent | SelectableStatusAbsent;\n\ntype AnnotatedStatuses = {\n // Individual eligibility statuses:\n active: ActiveStatus;\n targetable: TargetableStatus;\n archived: ArchivedStatus;\n // Individual qualified statuses:\n activatable: ActivatableStatus;\n selectable: SelectableStatus;\n};\n\ntype GuideAnnotation = AnnotatedStatuses & {\n // Resolved eligibility based on active, targetable and archived statuses,\n // which are backend driven evaluation results that are exposed for debugging.\n isEligible: boolean;\n\n // Resolved display qualification based on an activatable status, which\n // informs \"when\" and \"where\" an eligible guide can be displayed to user.\n isQualified: boolean;\n};\n\nexport type AnnotatedGuide = KnockGuide & {\n annotation: GuideAnnotation;\n\n // Legacy fields, typed only to make tsc happy when we prune these out.\n activation_location_rules?: KnockGuide[\"activation_url_patterns\"];\n priority?: number;\n};\n\n// Exists and ordered in control but absent in switchboard (therefore not\n// included in the api response), which implies a newly created guide that has\n// never been published to switchboard.\nexport type UnknownGuide = {\n __typename: \"UnknownGuide\";\n key: KnockGuide[\"key\"];\n active: false;\n bypass_global_group_limit: false;\n annotation: {\n isEligible: false;\n isQualified: false;\n selectable: {\n status: undefined;\n };\n };\n};\n\nexport type InspectionResult = {\n guides: (AnnotatedGuide | UnknownGuide)[];\n error?: \"no_guide_group\";\n};\n\ntype StoreStateSnapshot = Pick<\n KnockGuideClientStoreState,\n | \"location\"\n | \"guides\"\n | \"guideGroups\"\n | \"ineligibleGuides\"\n | \"debug\"\n | \"counter\"\n> & {\n throttled: boolean;\n};\n\nconst inferSelectByKeyReturnStatus = (\n guide: KnockGuide,\n snapshot: StoreStateSnapshot,\n stage: KnockGuideClientGroupStage,\n query: SelectionResultByQuery,\n): SelectableStatusPresent[\"status\"] => {\n const includeThrottled =\n !!query.key?.one?.metadata?.opts?.includeThrottled ||\n !!query.key?.all?.metadata?.opts?.includeThrottled;\n\n // If unthrottled, then it should always be returned.\n if (guide.bypass_global_group_limit) {\n return \"returned\";\n }\n\n // If resolved, expect this guide to be returned unless being throttled.\n if (guide.key === stage.resolved) {\n if (snapshot.throttled && !includeThrottled) {\n return \"throttled\";\n }\n return \"returned\";\n }\n\n // If queried but not resolved, it means this guide is being shadowed by\n // another guide with higher priority because throttled guides can be\n // displayed only one at a time.\n return \"queried\";\n};\n\nconst inferSelectOneByTypeReturnStatus = (\n guide: KnockGuide,\n snapshot: StoreStateSnapshot,\n stage: KnockGuideClientGroupStage,\n query: SelectionResultByQuery,\n): SelectableStatusPresent[\"status\"] => {\n const includeThrottled = !!query.type?.one?.metadata?.opts?.includeThrottled;\n\n const result = query.type!.one!;\n if (result.size === 0) {\n return \"queried\";\n }\n\n // There may be multiple unthrottled guides of the same type, being queried\n // by type to return a single guide, for example: useGuide({ type: \"card\" }).\n //\n // So it is possible for an unthrottled guide to be shadowed by another\n // unthrottled guide of the same type with higher priority, so we need to\n // look at the query result to determine its return status.\n if (guide.bypass_global_group_limit) {\n const guides = [...result.values()];\n const first = guides[0]!;\n\n if (guide.key !== first.key) {\n // Being shadowed by another guide with higher priority.\n return \"queried\";\n }\n return \"returned\";\n }\n\n // If resolved, expect this guide to be returned unless being throttled.\n if (guide.key === stage.resolved) {\n if (snapshot.throttled && !includeThrottled) {\n return \"throttled\";\n }\n return \"returned\";\n }\n\n // If queried but not resolved, it means this guide is being shadowed by\n // another guide with higher priority because throttled guides can be\n // displayed only one at a time.\n return \"queried\";\n};\n\nconst inferSelectAllByTypeReturnStatus = (\n guide: KnockGuide,\n snapshot: StoreStateSnapshot,\n stage: KnockGuideClientGroupStage,\n query: SelectionResultByQuery,\n): SelectableStatusPresent[\"status\"] => {\n const result = query.type!.all!;\n if (result.size === 0) {\n return \"queried\";\n }\n\n const guides = [...result.values()];\n const first = guides[0]!;\n\n // Might want to consider moving this up to do once.\n const guidesByKey: Record<KnockGuide[\"key\"], KnockGuide> = byKey(guides);\n\n // If includeThrottled given, then expect all selected guides to be returned.\n const includeThrottled = !!query.type?.all?.metadata?.opts?.includeThrottled;\n if (includeThrottled) {\n return guidesByKey[guide.key] ? \"returned\" : \"queried\";\n }\n\n // If the first selected guide is unthrottled or resolved, then we should\n // have at minimum one guide to return, and potentially more based on whether\n // we are throttling currently and which other guides are unthrottled.\n if (first.bypass_global_group_limit || first.key === stage.resolved) {\n if (!guidesByKey[guide.key]) {\n return \"queried\";\n }\n if (snapshot.throttled) {\n return guide.bypass_global_group_limit ? \"returned\" : \"throttled\";\n }\n return \"returned\";\n }\n\n return \"queried\";\n};\n\nconst inferSelectReturnStatus = (\n guide: KnockGuide,\n snapshot: StoreStateSnapshot,\n stage: KnockGuideClientGroupStage,\n query: SelectionResultByQuery,\n) => {\n // Querying by key can only return up to a max of one guide, regardless of\n // useGuide or useGuides, and should take precedence in status designation.\n if (query.key) {\n return inferSelectByKeyReturnStatus(guide, snapshot, stage, query);\n }\n\n if (query.type?.all) {\n return inferSelectAllByTypeReturnStatus(guide, snapshot, stage, query);\n }\n if (query.type?.one) {\n return inferSelectOneByTypeReturnStatus(guide, snapshot, stage, query);\n }\n\n // Should not happen but just for completeness.\n return undefined;\n};\n\nconst toSelectableStatus = (\n guide: KnockGuide,\n snapshot: StoreStateSnapshot,\n stage: KnockGuideClientGroupStage | undefined,\n): SelectableStatus => {\n if (!stage || stage.status === \"open\") {\n return { status: undefined };\n }\n\n const query = {\n key: (stage.results.key || {})[guide.key],\n type: (stage.results.type || {})[guide.type],\n };\n\n const queried = Boolean(query.key || query.type);\n if (!queried) {\n // No present query in the current location can select this guide.\n return { status: undefined };\n }\n\n const status = inferSelectReturnStatus(guide, snapshot, stage, query);\n if (!status) {\n return { status: undefined };\n }\n\n return { status, query };\n};\n\nconst toIneligibilityStatus = (\n marker: KnockGuideIneligibilityMarker,\n): Partial<AnnotatedStatuses> | undefined => {\n switch (marker.reason) {\n case \"not_in_target_audience\":\n case \"target_conditions_not_met\":\n return {\n targetable: {\n status: false,\n reason: marker.reason,\n message: marker.message,\n },\n };\n\n case \"marked_as_archived\":\n return {\n archived: {\n status: true,\n },\n };\n\n case \"guide_not_active\":\n return {\n active: {\n status: false,\n },\n };\n\n default:\n return undefined;\n }\n};\n\nconst resolveIsEligible = ({\n active,\n targetable,\n archived,\n}: AnnotatedStatuses) => {\n if (!active.status) return false;\n if (!targetable.status) return false;\n if (archived.status) return false;\n return true;\n};\n\nexport const resolveIsQualified = ({\n activatable,\n selectable,\n}: AnnotatedStatuses) => {\n if (!activatable.status) return false;\n if (!selectable.status) return false;\n return true;\n};\n\nconst annotateGuide = (\n guide: KnockGuide,\n snapshot: StoreStateSnapshot,\n stage: KnockGuideClientGroupStage | undefined,\n): AnnotatedGuide => {\n const { ineligibleGuides, location } = snapshot;\n const marker = ineligibleGuides[guide.key];\n const ineligiblity = marker ? toIneligibilityStatus(marker) : undefined;\n\n const statuses: AnnotatedStatuses = {\n // isEligible:\n active: ineligiblity?.active || { status: true },\n targetable: ineligiblity?.targetable || { status: true },\n archived: ineligiblity?.archived || { status: false },\n // isQualified:\n activatable: { status: checkActivatable(guide, location) },\n selectable: toSelectableStatus(guide, snapshot, stage),\n };\n\n const annotation: GuideAnnotation = {\n ...statuses,\n isEligible: resolveIsEligible(statuses),\n isQualified: resolveIsQualified(statuses),\n };\n\n return {\n ...guide,\n annotation,\n };\n};\n\nconst newUnknownGuide = (key: KnockGuide[\"key\"]) =>\n ({\n __typename: \"UnknownGuide\",\n key,\n active: false,\n bypass_global_group_limit: false,\n annotation: {\n isEligible: false,\n isQualified: false,\n selectable: {\n status: undefined,\n },\n },\n }) as UnknownGuide;\n\nexport const useInspectGuideClientStore = (): InspectionResult | undefined => {\n const { client } = useGuideContext();\n\n // Extract a snapshot of the client store state for debugging.\n const snapshot: StoreStateSnapshot = useStore(client.store, (state) => {\n const throttled = checkStateIfThrottled(state);\n\n return {\n location: state.location,\n guides: state.guides,\n guideGroups: state.guideGroups,\n ineligibleGuides: state.ineligibleGuides,\n debug: state.debug,\n counter: state.counter,\n throttled,\n };\n });\n\n // Not in debugging session, so noop.\n if (!snapshot.debug?.debugging) {\n return undefined;\n }\n\n // Only for completeness, as there should always be a default group so this\n // should never happen.\n const defaultGroup = snapshot.guideGroups[0];\n if (!defaultGroup) {\n return {\n error: \"no_guide_group\",\n guides: [],\n };\n }\n\n const groupStage = client.getStage();\n\n // Annotate guides for various eligibility, activation and query statuses\n // that are useful for debugging purposes.\n const orderedGuides = defaultGroup.display_sequence.map((guideKey) => {\n const guide = snapshot.guides[guideKey];\n if (!guide) {\n return newUnknownGuide(guideKey);\n }\n\n return annotateGuide(guide, snapshot, groupStage);\n });\n\n return {\n guides: orderedGuides,\n };\n};\n\nexport const isUnknownGuide = (input: unknown): input is UnknownGuide =>\n typeof input === \"object\" &&\n input !== null &&\n \"__typename\" in input &&\n (input as UnknownGuide).__typename === \"UnknownGuide\";\n"],"names":["byKey","items","reduce","acc","item","key","inferSelectByKeyReturnStatus","guide","snapshot","stage","query","includeThrottled","one","metadata","opts","all","bypass_global_group_limit","resolved","throttled","inferSelectOneByTypeReturnStatus","type","result","size","first","values","inferSelectAllByTypeReturnStatus","guides","guidesByKey","inferSelectReturnStatus","toSelectableStatus","status","undefined","results","Boolean","toIneligibilityStatus","marker","reason","targetable","message","archived","active","resolveIsEligible","resolveIsQualified","activatable","selectable","annotateGuide","ineligibleGuides","location","ineligiblity","statuses","checkActivatable","annotation","isEligible","isQualified","newUnknownGuide","__typename","useInspectGuideClientStore","client","useGuideContext","useStore","store","state","checkStateIfThrottled","guideGroups","debug","counter","debugging","defaultGroup","error","groupStage","getStage","display_sequence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A,MACLC,OAAO;AAAA,MACP1C,QAAQ,CAAA;AAAA,IACV;AAGI2C,QAAAA,IAAaZ,EAAOa,SAAS;AAa5B,SAAA;AAAA,IACL5C,QAVoByC,EAAaI,iBAAiBC,IAAKC,CAAaA,MAAA;AAC9DlE,YAAAA,IAAQC,EAASkB,OAAO+C,CAAQ;AACtC,aAAKlE,IAIEsC,EAActC,GAAOC,GAAU6D,CAAU,IAHvCf,EAAgBmB,CAAQ;AAAA,IAGe,CACjD;AAAA,EAID;AACF,GAEaC,IAAiBA,CAACC,MAC7B,OAAOA,KAAU,YACjBA,MAAU,QACV,gBAAgBA,KACfA,EAAuBpB,eAAe;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.mjs","sources":["../../../../../../src/modules/guide/components/Toolbar/shared.ts"],"sourcesContent":["// Match the hardcoded z-index value in the telegraph tooltip package for now\n// to ensure everything within a toolbar is visible.\nexport const TOOLBAR_Z_INDEX = \"var(--tgph-zIndex-tooltip)\";\n"],"names":["TOOLBAR_Z_INDEX"],"mappings":"AAEO,MAAMA,IAAkB;"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import { KnockGuideProvider as
|
|
1
|
+
import { KnockGuideProvider as m } from "@knocklabs/react-core";
|
|
2
2
|
import r from "react";
|
|
3
3
|
import "../components/Banner/Banner.mjs";
|
|
4
4
|
import "../components/Card/Card.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { V1 as i } from "../components/Toolbar/V1/V1.mjs";
|
|
6
|
+
import { V2 as n } from "../components/Toolbar/V2/V2.mjs";
|
|
6
7
|
import "../components/Modal/Modal.mjs";
|
|
7
|
-
const
|
|
8
|
-
children:
|
|
8
|
+
const f = ({
|
|
9
|
+
children: t,
|
|
10
|
+
toolbar: e = "v1",
|
|
9
11
|
...o
|
|
10
|
-
}) => /* @__PURE__ */ r.createElement(
|
|
12
|
+
}) => /* @__PURE__ */ r.createElement(
|
|
13
|
+
m,
|
|
14
|
+
{
|
|
15
|
+
...o,
|
|
16
|
+
trackDebugParams: e === "v1"
|
|
17
|
+
},
|
|
18
|
+
t,
|
|
19
|
+
e === "v2" ? /* @__PURE__ */ r.createElement(n, null) : /* @__PURE__ */ r.createElement(i, null)
|
|
20
|
+
);
|
|
11
21
|
export {
|
|
12
|
-
|
|
22
|
+
f as KnockGuideProvider
|
|
13
23
|
};
|
|
14
24
|
//# sourceMappingURL=KnockGuideProvider.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnockGuideProvider.mjs","sources":["../../../../../src/modules/guide/providers/KnockGuideProvider.tsx"],"sourcesContent":["import {\n KnockGuideProvider as KnockGuideProviderCore,\n type KnockGuideProviderProps,\n} from \"@knocklabs/react-core\";\nimport React from \"react\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"KnockGuideProvider.mjs","sources":["../../../../../src/modules/guide/providers/KnockGuideProvider.tsx"],"sourcesContent":["import {\n KnockGuideProvider as KnockGuideProviderCore,\n type KnockGuideProviderProps,\n} from \"@knocklabs/react-core\";\nimport React from \"react\";\n\nimport { ToolbarV1, ToolbarV2 } from \"../components\";\n\ntype Props = KnockGuideProviderProps & {\n toolbar?: \"v1\" | \"v2\";\n};\n\n// Re-export the core KnockGuideProvider, so we can add React specific\n// functionality like the Toolbar component which shouldn't be included in other\n// contexts (e.g. React Native).\nexport const KnockGuideProvider: React.FC<React.PropsWithChildren<Props>> = ({\n children,\n toolbar = \"v1\",\n ...props\n}) => {\n return (\n <KnockGuideProviderCore\n {...props}\n // For backward compatibility with toolbar v1. Remove once v2 ships.\n trackDebugParams={toolbar === \"v1\"}\n >\n {children}\n {toolbar === \"v2\" ? <ToolbarV2 /> : <ToolbarV1 />}\n </KnockGuideProviderCore>\n );\n};\n"],"names":["KnockGuideProvider","children","toolbar","props","React","KnockGuideProviderCore","ToolbarV2","ToolbarV1"],"mappings":";;;;;;;AAeO,MAAMA,IAA+DA,CAAC;AAAA,EAC3EC,UAAAA;AAAAA,EACAC,SAAAA,IAAU;AAAA,EACV,GAAGC;AACL,MAEIC,gBAAAA,EAAA;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,GAAIF;AAAAA,IAEJ,kBAAkBD,MAAY;AAAA,EAAA;AAAA,EAE7BD;AAAAA,EACAC,MAAY,OAAOE,gBAAAA,EAAA,cAACE,GAAY,IAAA,oCAAIC,GAAY,IAAA;AACnD;"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { BellIcon, Button, ButtonGroup, CheckmarkCircle, ChevronDown, CloseCircle, Spinner, useOnBottomScroll, type ButtonProps, type SpinnerProps, } from './modules/core';
|
|
2
|
-
export { Avatar, EmptyFeed, MarkAsRead, NotificationCell, NotificationFeed, NotificationFeedContainer, NotificationFeedHeader, NotificationFeedPopover, NotificationIconButton, UnseenBadge, type AvatarProps, type
|
|
3
|
-
export { Banner, BannerView, Card, CardView, KnockGuideProvider,
|
|
2
|
+
export { Avatar, EmptyFeed, MarkAsRead, NotificationCell, NotificationFeed, NotificationFeedContainer, NotificationFeedHeader, NotificationFeedPopover, NotificationIconButton, UnseenBadge, type AvatarProps, type MarkAsReadProps, type NotificationCellProps, type NotificationFeedHeaderProps, type NotificationFeedPopoverProps, type NotificationFeedProps, type NotificationIconButtonProps, type RenderItem, type RenderItemProps, type UnseenBadgeProps, } from './modules/feed';
|
|
3
|
+
export { Banner, BannerView, Card, CardView, KnockGuideProvider, Modal, ModalView, } from './modules/guide';
|
|
4
4
|
export { MsTeamsAuthButton, MsTeamsAuthContainer, MsTeamsChannelCombobox, type MsTeamsAuthButtonProps, type MsTeamsAuthContainerProps, } from './modules/ms-teams';
|
|
5
5
|
export { SlackAuthButton, SlackAuthContainer, SlackChannelCombobox, type SlackAuthButtonProps, type SlackAuthContainerProps, type SlackChannelComboboxInputMessages, type SlackChannelComboboxProps, } from './modules/slack';
|
|
6
|
-
export { FilterStatus, KnockProvider, feedProviderKey, formatBadgeCount, formatTimestamp, msTeamsProviderKey, renderNodeOrFallback, slackProviderKey, toSentenceCase, type ColorMode, type KnockProviderProps, type KnockProviderState, useAuthenticatedKnockClient, useKnockClient, useStableOptions, KnockFeedProvider, type KnockFeedProviderProps, type KnockFeedProviderState, type Selector, useCreateNotificationStore, useFeedSettings, useKnockFeed, useNotificationStore, useNotifications, KnockGuideContext, useGuide, useGuides, useGuideContext, type MsTeamsChannelQueryOptions, type MsTeamsTeamQueryOptions, KnockMsTeamsProvider, type KnockMsTeamsProviderProps, type KnockMsTeamsProviderState, useConnectedMsTeamsChannels, useKnockMsTeamsClient, useMsTeamsAuth, useMsTeamsChannels, useMsTeamsConnectionStatus, useMsTeamsTeams, KnockSlackProvider, type ContainerObject, type KnockSlackProviderProps, type KnockSlackProviderState, type SlackChannelQueryOptions, useConnectedSlackChannels, useKnockSlackClient, useSlackAuth, useSlackChannels, useSlackConnectionStatus, I18nContext, KnockI18nProvider, locales, type I18nContent, type KnockI18nProviderProps, type Translations, useTranslations, type RecipientObject, usePreferences, } from '@knocklabs/react-core';
|
|
6
|
+
export { type BadgeCountType, FilterStatus, KnockProvider, feedProviderKey, formatBadgeCount, getBadgeAriaLabel, formatTimestamp, msTeamsProviderKey, renderNodeOrFallback, slackProviderKey, toSentenceCase, type ColorMode, type KnockProviderProps, type KnockProviderState, useAuthenticatedKnockClient, useKnockClient, useStableOptions, KnockFeedProvider, type KnockFeedProviderProps, type KnockFeedProviderState, type Selector, useCreateNotificationStore, useFeedSettings, useKnockFeed, useNotificationStore, useNotifications, KnockGuideContext, useGuide, useGuides, useGuideContext, type MsTeamsChannelQueryOptions, type MsTeamsTeamQueryOptions, KnockMsTeamsProvider, type KnockMsTeamsProviderProps, type KnockMsTeamsProviderState, useConnectedMsTeamsChannels, useKnockMsTeamsClient, useMsTeamsAuth, useMsTeamsChannels, useMsTeamsConnectionStatus, useMsTeamsTeams, KnockSlackProvider, type ContainerObject, type KnockSlackProviderProps, type KnockSlackProviderState, type SlackChannelQueryOptions, useConnectedSlackChannels, useKnockSlackClient, useSlackAuth, useSlackChannels, useSlackConnectionStatus, I18nContext, KnockI18nProvider, locales, type I18nContent, type KnockI18nProviderProps, type Translations, useTranslations, type RecipientObject, usePreferences, } from '@knocklabs/react-core';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAErB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,eAAe,EACf,WAAW,EACX,WAAW,EACX,OAAO,EACP,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,MAAM,EACN,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAErB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,eAAe,EACf,WAAW,EACX,WAAW,EACX,OAAO,EACP,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,MAAM,EACN,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK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wBAAwB,EACxB,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,eAAe,EACf,KAAK,eAAe,EACpB,cAAc,GACf,MAAM,uBAAuB,CAAC"}
|
package/dist/types/modules/feed/components/NotificationIconButton/NotificationIconButton.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { BadgeCountType } from '@knocklabs/react-core';
|
|
1
2
|
import { default as React, SyntheticEvent } from 'react';
|
|
2
|
-
import { BadgeCountType } from '../UnseenBadge';
|
|
3
3
|
export interface NotificationIconButtonProps {
|
|
4
4
|
badgeCountType?: BadgeCountType;
|
|
5
5
|
onClick: (e: SyntheticEvent) => void;
|
package/dist/types/modules/feed/components/NotificationIconButton/NotificationIconButton.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationIconButton.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/feed/components/NotificationIconButton/NotificationIconButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotificationIconButton.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/feed/components/NotificationIconButton/NotificationIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK9C,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,2BAA2B;IAE1C,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,OAAO,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,sBAAsB,uGAiBjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnseenBadge.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/feed/components/UnseenBadge/UnseenBadge.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UnseenBadge.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/feed/components/UnseenBadge/UnseenBadge.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,CAAC;AAEtB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAgBF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAmBlD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { UnseenBadge, type UnseenBadgeProps
|
|
1
|
+
export { UnseenBadge, type UnseenBadgeProps } from './UnseenBadge';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/feed/components/UnseenBadge/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/feed/components/UnseenBadge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -4,5 +4,5 @@ export { NotificationFeed, NotificationFeedHeader, MarkAsRead, type Notification
|
|
|
4
4
|
export { NotificationFeedContainer } from './components/NotificationFeedContainer';
|
|
5
5
|
export { NotificationFeedPopover, type NotificationFeedPopoverProps, } from './components/NotificationFeedPopover';
|
|
6
6
|
export { NotificationIconButton, type NotificationIconButtonProps, } from './components/NotificationIconButton';
|
|
7
|
-
export { UnseenBadge, type UnseenBadgeProps
|
|
7
|
+
export { UnseenBadge, type UnseenBadgeProps } from './components/UnseenBadge';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/feed/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,MAAM,EACN,KAAK,qBAAqB,EAC1B,KAAK,WAAW,GACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,2BAA2B,EAChC,KAAK,eAAe,GACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/feed/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,MAAM,EACN,KAAK,qBAAqB,EAC1B,KAAK,WAAW,GACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,2BAA2B,EAChC,KAAK,eAAe,GACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KnockButton.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/guide/components/Toolbar/KnockButton.tsx"],"names":[],"mappings":"AAGA,OAAO,cAAc,CAAC;AAEtB,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,aAAa,KAAK,4CAyC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/guide/components/Toolbar/V1/V1.tsx"],"names":[],"mappings":"AAUA,OAAO,eAAe,CAAC;AAEvB,eAAO,MAAM,EAAE,sDAgFd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/guide/components/Toolbar/V1/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuideContextDetails.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideContextDetails.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,+CA6F/B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnnotatedGuide, UnknownGuide } from './useInspectGuideClientStore';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
type Props = {
|
|
4
|
+
guide: AnnotatedGuide | UnknownGuide;
|
|
5
|
+
};
|
|
6
|
+
export declare const GuideHoverCard: ({ children, guide, }: React.PropsWithChildren<Props>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=GuideHoverCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuideHoverCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideHoverCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EACd,YAAY,EAEb,MAAM,8BAA8B,CAAC;AAEtC,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,cAAc,GAAG,YAAY,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,sBAG5B,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,4CA6ChC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnnotatedGuide, UnknownGuide } from './useInspectGuideClientStore';
|
|
2
|
+
type Props = {
|
|
3
|
+
guide: UnknownGuide | AnnotatedGuide;
|
|
4
|
+
orderIndex: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const GuideRow: ({ guide, orderIndex }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=GuideRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuideRow.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideRow.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACL,cAAc,EACd,YAAY,EAEb,MAAM,8BAA8B,CAAC;AAQtC,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,YAAY,GAAG,cAAc,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,uBAAuB,KAAK,4CAkIpD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type DisplayOption = "only-displaying" | "only-displayable" | "all-eligible" | "all-guides";
|
|
2
|
+
type Props = {
|
|
3
|
+
value: DisplayOption;
|
|
4
|
+
onChange: (option: DisplayOption) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const GuidesListDisplaySelect: ({ value, onChange }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=GuidesListDisplaySelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuidesListDisplaySelect.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,kBAAkB,GAClB,cAAc,GACd,YAAY,CAAC;AAEjB,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,qBAAqB,KAAK,4CA2BjE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/V2.tsx"],"names":[],"mappings":"AAQA,OAAO,eAAe,CAAC;AAwCvB,eAAO,MAAM,EAAE,sDAoFd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/helpers.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,eAU9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { KnockGuide, KnockGuideSelectionResult } from '@knocklabs/client';
|
|
2
|
+
/**
|
|
3
|
+
* This is the main module that will house core logic for the toolbar. It hooks
|
|
4
|
+
* into the guide client state store, extracts relevant data for debugging, and
|
|
5
|
+
* transforms it into easily consumable data for the toolbar - namely
|
|
6
|
+
* "annotating" guides for its various statuses to display.
|
|
7
|
+
*/
|
|
8
|
+
type ActiveStatus = {
|
|
9
|
+
status: boolean;
|
|
10
|
+
};
|
|
11
|
+
type TargetableStatusTrue = {
|
|
12
|
+
status: true;
|
|
13
|
+
};
|
|
14
|
+
type TargetableStatusFalse = {
|
|
15
|
+
status: false;
|
|
16
|
+
reason: string;
|
|
17
|
+
message: string;
|
|
18
|
+
};
|
|
19
|
+
type TargetableStatus = TargetableStatusTrue | TargetableStatusFalse;
|
|
20
|
+
type ActivatableStatus = {
|
|
21
|
+
status: boolean;
|
|
22
|
+
};
|
|
23
|
+
type ArchivedStatus = {
|
|
24
|
+
status: boolean;
|
|
25
|
+
};
|
|
26
|
+
type SelectionResultByLimit = {
|
|
27
|
+
one?: KnockGuideSelectionResult;
|
|
28
|
+
all?: KnockGuideSelectionResult;
|
|
29
|
+
};
|
|
30
|
+
type SelectionResultByQuery = {
|
|
31
|
+
key?: SelectionResultByLimit;
|
|
32
|
+
type?: SelectionResultByLimit;
|
|
33
|
+
};
|
|
34
|
+
type SelectableStatusPresent = {
|
|
35
|
+
status: "returned" | "throttled" | "queried";
|
|
36
|
+
query: SelectionResultByQuery;
|
|
37
|
+
};
|
|
38
|
+
type SelectableStatusAbsent = {
|
|
39
|
+
status: undefined;
|
|
40
|
+
};
|
|
41
|
+
type SelectableStatus = SelectableStatusPresent | SelectableStatusAbsent;
|
|
42
|
+
type AnnotatedStatuses = {
|
|
43
|
+
active: ActiveStatus;
|
|
44
|
+
targetable: TargetableStatus;
|
|
45
|
+
archived: ArchivedStatus;
|
|
46
|
+
activatable: ActivatableStatus;
|
|
47
|
+
selectable: SelectableStatus;
|
|
48
|
+
};
|
|
49
|
+
type GuideAnnotation = AnnotatedStatuses & {
|
|
50
|
+
isEligible: boolean;
|
|
51
|
+
isQualified: boolean;
|
|
52
|
+
};
|
|
53
|
+
export type AnnotatedGuide = KnockGuide & {
|
|
54
|
+
annotation: GuideAnnotation;
|
|
55
|
+
activation_location_rules?: KnockGuide["activation_url_patterns"];
|
|
56
|
+
priority?: number;
|
|
57
|
+
};
|
|
58
|
+
export type UnknownGuide = {
|
|
59
|
+
__typename: "UnknownGuide";
|
|
60
|
+
key: KnockGuide["key"];
|
|
61
|
+
active: false;
|
|
62
|
+
bypass_global_group_limit: false;
|
|
63
|
+
annotation: {
|
|
64
|
+
isEligible: false;
|
|
65
|
+
isQualified: false;
|
|
66
|
+
selectable: {
|
|
67
|
+
status: undefined;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export type InspectionResult = {
|
|
72
|
+
guides: (AnnotatedGuide | UnknownGuide)[];
|
|
73
|
+
error?: "no_guide_group";
|
|
74
|
+
};
|
|
75
|
+
export declare const resolveIsQualified: ({ activatable, selectable, }: AnnotatedStatuses) => boolean;
|
|
76
|
+
export declare const useInspectGuideClientStore: () => InspectionResult | undefined;
|
|
77
|
+
export declare const isUnknownGuide: (input: unknown) => input is UnknownGuide;
|
|
78
|
+
export {};
|
|
79
|
+
//# sourceMappingURL=useInspectGuideClientStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInspectGuideClientStore.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIV,yBAAyB,EAG1B,MAAM,mBAAmB,CAAC;AAO3B;;;;;GAKG;AAGH,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAGF,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AACF,KAAK,qBAAqB,GAAG;IA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Q,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAKF,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,cAAc,CAAC;IAC3B,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACvB,MAAM,EAAE,KAAK,CAAC;IACd,yBAAyB,EAAE,KAAK,CAAC;IACjC,UAAU,EAAE;QACV,UAAU,EAAE,KAAK,CAAC;QAClB,WAAW,EAAE,KAAK,CAAC;QACnB,UAAU,EAAE;YACV,MAAM,EAAE,SAAS,CAAC;SACnB,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,CAAC,cAAc,GAAG,YAAY,CAAC,EAAE,CAAC;IAC1C,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AA6NF,eAAO,MAAM,kBAAkB,GAAI,8BAGhC,iBAAiB,YAInB,CAAC;AAgDF,eAAO,MAAM,0BAA0B,QAAO,gBAAgB,GAAG,SAiDhE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,YAIF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/guide/components/Toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/guide/components/Toolbar/shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,+BAA+B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Banner, BannerView } from './Banner';
|
|
2
2
|
export { Card, CardView } from './Card';
|
|
3
|
-
export {
|
|
3
|
+
export { ToolbarV1, ToolbarV2 } from './Toolbar';
|
|
4
4
|
export { Modal, ModalView } from './Modal';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/guide/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/guide/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|