@knocklabs/react 0.11.12 → 0.11.14
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 +22 -0
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/FocusChin.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/FocusChin.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js.map +1 -1
- 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 +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/FocusChin.mjs +32 -31
- package/dist/esm/modules/guide/components/Toolbar/V2/FocusChin.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs +6 -5
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs +14 -13
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs +37 -37
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs +39 -29
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs +83 -77
- package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs +5 -48
- package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs.map +1 -1
- package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs +12 -10
- package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/types/modules/guide/components/Toolbar/V2/FocusChin.d.ts.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.d.ts.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/V2/GuideContextDetails.d.ts.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/V2/GuideRow.d.ts.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/V2/GuideRowDetails.d.ts.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/V2/V2.d.ts +5 -1
- package/dist/types/modules/guide/components/Toolbar/V2/V2.d.ts.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/V2/helpers.d.ts +3 -7
- package/dist/types/modules/guide/components/Toolbar/V2/helpers.d.ts.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.d.ts +1 -2
- package/dist/types/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.d.ts.map +1 -1
- package/dist/types/modules/guide/providers/KnockGuideProvider.d.ts.map +1 -1
- package/package.json +15 -14
|
@@ -1,79 +1,80 @@
|
|
|
1
|
-
import { useGuideContext as
|
|
1
|
+
import { useGuideContext as h, useStore as y } from "@knocklabs/react-core";
|
|
2
2
|
import { Button as d } from "@telegraph/button";
|
|
3
|
-
import { Box as
|
|
3
|
+
import { Box as x, Stack as f } from "@telegraph/layout";
|
|
4
4
|
import { Tooltip as m } from "@telegraph/tooltip";
|
|
5
|
-
import { Text as
|
|
6
|
-
import { ChevronLeft as
|
|
5
|
+
import { Text as E } from "@telegraph/typography";
|
|
6
|
+
import { ChevronLeft as v, ChevronRight as k, X as C } from "lucide-react";
|
|
7
7
|
import * as t from "react";
|
|
8
|
-
import { GUIDE_ROW_DATA_SELECTOR as
|
|
9
|
-
|
|
8
|
+
import { GUIDE_ROW_DATA_SELECTOR as T } from "./GuideRow.mjs";
|
|
9
|
+
import { sharedTooltipProps as p } from "./helpers.mjs";
|
|
10
|
+
const b = 60, g = (o, i) => {
|
|
10
11
|
requestAnimationFrame(() => {
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
13
|
-
const e = o.getBoundingClientRect(), c =
|
|
12
|
+
const r = o.querySelector(`[${T}="${CSS.escape(i)}"]`);
|
|
13
|
+
if (!r || !(r instanceof HTMLElement)) return;
|
|
14
|
+
const e = o.getBoundingClientRect(), c = r.getBoundingClientRect();
|
|
14
15
|
c.top < e.top ? o.scrollTo({
|
|
15
|
-
top: o.scrollTop - (e.top - c.top) -
|
|
16
|
+
top: o.scrollTop - (e.top - c.top) - b,
|
|
16
17
|
behavior: "smooth"
|
|
17
18
|
}) : c.bottom > e.bottom && o.scrollTo({
|
|
18
|
-
top: o.scrollTop + (c.bottom - e.bottom) +
|
|
19
|
+
top: o.scrollTop + (c.bottom - e.bottom) + b,
|
|
19
20
|
behavior: "smooth"
|
|
20
21
|
});
|
|
21
22
|
});
|
|
22
|
-
},
|
|
23
|
+
}, z = ({
|
|
23
24
|
guides: o,
|
|
24
25
|
guideListRef: i
|
|
25
26
|
}) => {
|
|
26
27
|
const {
|
|
27
|
-
client:
|
|
28
|
-
} =
|
|
28
|
+
client: r
|
|
29
|
+
} = h(), {
|
|
29
30
|
debugSettings: e
|
|
30
|
-
} = y(
|
|
31
|
-
debugSettings:
|
|
31
|
+
} = y(r.store, (n) => ({
|
|
32
|
+
debugSettings: n.debug
|
|
32
33
|
})), c = Object.keys((e == null ? void 0 : e.focusedGuideKeys) || {});
|
|
33
34
|
if (!(c.length > 0))
|
|
34
35
|
return null;
|
|
35
36
|
const a = c[0];
|
|
36
|
-
return /* @__PURE__ */ t.createElement(
|
|
37
|
+
return /* @__PURE__ */ t.createElement(x, { borderTop: "px", px: "3", py: "1", overflow: "hidden", backgroundColor: "blue-2" }, /* @__PURE__ */ t.createElement(f, { align: "center", justify: "space-between", gap: "4" }, /* @__PURE__ */ t.createElement(E, { as: "span", size: "1", weight: "medium", color: "blue", style: {
|
|
37
38
|
display: "block",
|
|
38
39
|
overflow: "hidden",
|
|
39
40
|
textOverflow: "ellipsis",
|
|
40
41
|
whiteSpace: "nowrap",
|
|
41
42
|
minWidth: 0
|
|
42
|
-
} }, "Focus mode: ", a), /* @__PURE__ */ t.createElement(
|
|
43
|
+
} }, "Focus mode: ", a), /* @__PURE__ */ t.createElement(f, { align: "center", gap: "1", style: {
|
|
43
44
|
flexShrink: 0
|
|
44
|
-
} }, /* @__PURE__ */ t.createElement(m, { label: "Focus previous guide" }, /* @__PURE__ */ t.createElement(d, { size: "0", variant: "ghost", color: "blue", leadingIcon: {
|
|
45
|
-
icon:
|
|
45
|
+
} }, /* @__PURE__ */ t.createElement(m, { label: "Focus previous guide", ...p }, /* @__PURE__ */ t.createElement(d, { size: "0", variant: "ghost", color: "blue", leadingIcon: {
|
|
46
|
+
icon: v,
|
|
46
47
|
alt: "Previous guide"
|
|
47
48
|
}, onClick: () => {
|
|
48
|
-
const
|
|
49
|
-
l && (
|
|
49
|
+
const n = o.filter((s) => !!s.annotation.selectable.status), u = n.findIndex((s) => s.key === a), l = u <= 0 ? void 0 : n[u - 1];
|
|
50
|
+
l && (r.setDebug({
|
|
50
51
|
...e,
|
|
51
52
|
focusedGuideKeys: {
|
|
52
53
|
[l.key]: !0
|
|
53
54
|
}
|
|
54
|
-
}), i.current &&
|
|
55
|
-
} })), /* @__PURE__ */ t.createElement(m, { label: "Focus next guide" }, /* @__PURE__ */ t.createElement(d, { size: "0", variant: "ghost", color: "blue", leadingIcon: {
|
|
55
|
+
}), i.current && g(i.current, l.key));
|
|
56
|
+
} })), /* @__PURE__ */ t.createElement(m, { label: "Focus next guide", ...p }, /* @__PURE__ */ t.createElement(d, { size: "0", variant: "ghost", color: "blue", leadingIcon: {
|
|
56
57
|
icon: k,
|
|
57
58
|
alt: "Next guide"
|
|
58
59
|
}, onClick: () => {
|
|
59
|
-
const
|
|
60
|
-
l && (
|
|
60
|
+
const n = o.filter((s) => !!s.annotation.selectable.status), u = n.findIndex((s) => s.key === a), l = u < 0 || u + 1 > n.length - 1 ? void 0 : n[u + 1];
|
|
61
|
+
l && (r.setDebug({
|
|
61
62
|
...e,
|
|
62
63
|
focusedGuideKeys: {
|
|
63
64
|
[l.key]: !0
|
|
64
65
|
}
|
|
65
|
-
}), i.current &&
|
|
66
|
-
} })), /* @__PURE__ */ t.createElement(m, { label: "Exit focus
|
|
67
|
-
icon:
|
|
66
|
+
}), i.current && g(i.current, l.key));
|
|
67
|
+
} })), /* @__PURE__ */ t.createElement(m, { label: "Exit focus mode", ...p }, /* @__PURE__ */ t.createElement(d, { size: "0", variant: "ghost", color: "blue", leadingIcon: {
|
|
68
|
+
icon: C,
|
|
68
69
|
alt: "Clear focus"
|
|
69
70
|
}, onClick: () => {
|
|
70
|
-
|
|
71
|
+
r.setDebug({
|
|
71
72
|
...e,
|
|
72
73
|
focusedGuideKeys: {}
|
|
73
74
|
});
|
|
74
75
|
} })))));
|
|
75
76
|
};
|
|
76
77
|
export {
|
|
77
|
-
|
|
78
|
+
z as FocusChin
|
|
78
79
|
};
|
|
79
80
|
//# sourceMappingURL=FocusChin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusChin.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/FocusChin.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport { ChevronLeft, ChevronRight, X } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { GUIDE_ROW_DATA_SELECTOR } from \"./GuideRow\";\nimport { InspectionResultOk } from \"./useInspectGuideClientStore\";\n\n// Extra scroll overshoot so the focused guide plus ~1-2 neighbors are visible,\n// reducing how often consecutive next/prev clicks trigger a scroll.\nconst SCROLL_OVERSHOOT = 60;\n\nconst maybeScrollGuideIntoView = (container: HTMLElement, guideKey: string) => {\n requestAnimationFrame(() => {\n const el = container.querySelector(\n `[${GUIDE_ROW_DATA_SELECTOR}=\"${CSS.escape(guideKey)}\"]`,\n );\n if (!el || !(el instanceof HTMLElement)) return;\n\n const containerRect = container.getBoundingClientRect();\n const elRect = el.getBoundingClientRect();\n\n if (elRect.top < containerRect.top) {\n container.scrollTo({\n top:\n container.scrollTop -\n (containerRect.top - elRect.top) -\n SCROLL_OVERSHOOT,\n behavior: \"smooth\",\n });\n } else if (elRect.bottom > containerRect.bottom) {\n container.scrollTo({\n top:\n container.scrollTop +\n (elRect.bottom - containerRect.bottom) +\n SCROLL_OVERSHOOT,\n behavior: \"smooth\",\n });\n }\n });\n};\n\ntype Props = {\n guides: InspectionResultOk[\"guides\"];\n guideListRef: React.RefObject<HTMLDivElement | null>;\n};\n\nexport const FocusChin = ({ guides, guideListRef }: Props) => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug,\n }));\n\n const focusedKeys = Object.keys(debugSettings?.focusedGuideKeys || {});\n\n const isFocused = focusedKeys.length > 0;\n if (!isFocused) {\n return null;\n }\n\n const currentKey = focusedKeys[0]!;\n\n return (\n <Box\n borderTop=\"px\"\n px=\"3\"\n py=\"1\"\n overflow=\"hidden\"\n backgroundColor=\"blue-2\"\n >\n <Stack align=\"center\" justify=\"space-between\" gap=\"4\">\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color=\"blue\"\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n minWidth: 0,\n }}\n >\n Focus mode: {currentKey}\n </Text>\n <Stack align=\"center\" gap=\"1\" style={{ flexShrink: 0 }}>\n <Tooltip label=\"Focus previous guide\">\n <Button\n size=\"0\"\n variant=\"ghost\"\n color=\"blue\"\n leadingIcon={{ icon: ChevronLeft, alt: \"Previous guide\" }}\n onClick={() => {\n const selectableGuides = guides.filter(\n (g) => !!g.annotation.selectable.status,\n );\n const currIndex = selectableGuides.findIndex(\n (g) => g.key === currentKey,\n );\n const prevGuide =\n currIndex <= 0 ? undefined : selectableGuides[currIndex - 1];\n\n if (!prevGuide) return;\n\n client.setDebug({\n ...debugSettings,\n focusedGuideKeys: { [prevGuide.key]: true },\n });\n\n if (guideListRef.current) {\n maybeScrollGuideIntoView(guideListRef.current, prevGuide.key);\n }\n }}\n />\n </Tooltip>\n <Tooltip label=\"Focus next guide\">\n <Button\n size=\"0\"\n variant=\"ghost\"\n color=\"blue\"\n leadingIcon={{ icon: ChevronRight, alt: \"Next guide\" }}\n onClick={() => {\n const selectableGuides = guides.filter(\n (g) => !!g.annotation.selectable.status,\n );\n const currIndex = selectableGuides.findIndex(\n (g) => g.key === currentKey,\n );\n const nextGuide =\n currIndex < 0 || currIndex + 1 > selectableGuides.length - 1\n ? undefined\n : selectableGuides[currIndex + 1];\n\n if (!nextGuide) return;\n\n client.setDebug({\n ...debugSettings,\n focusedGuideKeys: { [nextGuide.key]: true },\n });\n\n if (guideListRef.current) {\n maybeScrollGuideIntoView(guideListRef.current, nextGuide.key);\n }\n }}\n />\n </Tooltip>\n <Tooltip label=\"Exit focus
|
|
1
|
+
{"version":3,"file":"FocusChin.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/FocusChin.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport { ChevronLeft, ChevronRight, X } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { GUIDE_ROW_DATA_SELECTOR } from \"./GuideRow\";\nimport { sharedTooltipProps } from \"./helpers\";\nimport { InspectionResultOk } from \"./useInspectGuideClientStore\";\n\n// Extra scroll overshoot so the focused guide plus ~1-2 neighbors are visible,\n// reducing how often consecutive next/prev clicks trigger a scroll.\nconst SCROLL_OVERSHOOT = 60;\n\nconst maybeScrollGuideIntoView = (container: HTMLElement, guideKey: string) => {\n requestAnimationFrame(() => {\n const el = container.querySelector(\n `[${GUIDE_ROW_DATA_SELECTOR}=\"${CSS.escape(guideKey)}\"]`,\n );\n if (!el || !(el instanceof HTMLElement)) return;\n\n const containerRect = container.getBoundingClientRect();\n const elRect = el.getBoundingClientRect();\n\n if (elRect.top < containerRect.top) {\n container.scrollTo({\n top:\n container.scrollTop -\n (containerRect.top - elRect.top) -\n SCROLL_OVERSHOOT,\n behavior: \"smooth\",\n });\n } else if (elRect.bottom > containerRect.bottom) {\n container.scrollTo({\n top:\n container.scrollTop +\n (elRect.bottom - containerRect.bottom) +\n SCROLL_OVERSHOOT,\n behavior: \"smooth\",\n });\n }\n });\n};\n\ntype Props = {\n guides: InspectionResultOk[\"guides\"];\n guideListRef: React.RefObject<HTMLDivElement | null>;\n};\n\nexport const FocusChin = ({ guides, guideListRef }: Props) => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug,\n }));\n\n const focusedKeys = Object.keys(debugSettings?.focusedGuideKeys || {});\n\n const isFocused = focusedKeys.length > 0;\n if (!isFocused) {\n return null;\n }\n\n const currentKey = focusedKeys[0]!;\n\n return (\n <Box\n borderTop=\"px\"\n px=\"3\"\n py=\"1\"\n overflow=\"hidden\"\n backgroundColor=\"blue-2\"\n >\n <Stack align=\"center\" justify=\"space-between\" gap=\"4\">\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color=\"blue\"\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n minWidth: 0,\n }}\n >\n Focus mode: {currentKey}\n </Text>\n <Stack align=\"center\" gap=\"1\" style={{ flexShrink: 0 }}>\n <Tooltip label=\"Focus previous guide\" {...sharedTooltipProps}>\n <Button\n size=\"0\"\n variant=\"ghost\"\n color=\"blue\"\n leadingIcon={{ icon: ChevronLeft, alt: \"Previous guide\" }}\n onClick={() => {\n const selectableGuides = guides.filter(\n (g) => !!g.annotation.selectable.status,\n );\n const currIndex = selectableGuides.findIndex(\n (g) => g.key === currentKey,\n );\n const prevGuide =\n currIndex <= 0 ? undefined : selectableGuides[currIndex - 1];\n\n if (!prevGuide) return;\n\n client.setDebug({\n ...debugSettings,\n focusedGuideKeys: { [prevGuide.key]: true },\n });\n\n if (guideListRef.current) {\n maybeScrollGuideIntoView(guideListRef.current, prevGuide.key);\n }\n }}\n />\n </Tooltip>\n <Tooltip label=\"Focus next guide\" {...sharedTooltipProps}>\n <Button\n size=\"0\"\n variant=\"ghost\"\n color=\"blue\"\n leadingIcon={{ icon: ChevronRight, alt: \"Next guide\" }}\n onClick={() => {\n const selectableGuides = guides.filter(\n (g) => !!g.annotation.selectable.status,\n );\n const currIndex = selectableGuides.findIndex(\n (g) => g.key === currentKey,\n );\n const nextGuide =\n currIndex < 0 || currIndex + 1 > selectableGuides.length - 1\n ? undefined\n : selectableGuides[currIndex + 1];\n\n if (!nextGuide) return;\n\n client.setDebug({\n ...debugSettings,\n focusedGuideKeys: { [nextGuide.key]: true },\n });\n\n if (guideListRef.current) {\n maybeScrollGuideIntoView(guideListRef.current, nextGuide.key);\n }\n }}\n />\n </Tooltip>\n <Tooltip label=\"Exit focus mode\" {...sharedTooltipProps}>\n <Button\n size=\"0\"\n variant=\"ghost\"\n color=\"blue\"\n leadingIcon={{ icon: X, alt: \"Clear focus\" }}\n onClick={() => {\n client.setDebug({ ...debugSettings, focusedGuideKeys: {} });\n }}\n />\n </Tooltip>\n </Stack>\n </Stack>\n </Box>\n );\n};\n"],"names":["SCROLL_OVERSHOOT","maybeScrollGuideIntoView","container","guideKey","requestAnimationFrame","el","querySelector","GUIDE_ROW_DATA_SELECTOR","CSS","escape","HTMLElement","containerRect","getBoundingClientRect","elRect","top","scrollTo","scrollTop","behavior","bottom","FocusChin","guides","guideListRef","client","useGuideContext","debugSettings","useStore","store","state","debug","focusedKeys","Object","keys","focusedGuideKeys","length","currentKey","React","Box","Stack","Text","display","overflow","textOverflow","whiteSpace","minWidth","flexShrink","Tooltip","sharedTooltipProps","Button","icon","ChevronLeft","alt","selectableGuides","filter","g","annotation","selectable","status","currIndex","findIndex","key","prevGuide","undefined","setDebug","current","ChevronRight","nextGuide","X"],"mappings":";;;;;;;;;AAcA,MAAMA,IAAmB,IAEnBC,IAA2BA,CAACC,GAAwBC,MAAqB;AAC7EC,wBAAsB,MAAM;AACpBC,UAAAA,IAAKH,EAAUI,cACnB,IAAIC,CAAuB,KAAKC,IAAIC,OAAON,CAAQ,CAAC,IACtD;AACA,QAAI,CAACE,KAAM,EAAEA,aAAcK,aAAc;AAEnCC,UAAAA,IAAgBT,EAAUU,sBAAsB,GAChDC,IAASR,EAAGO,sBAAsB;AAEpCC,IAAAA,EAAOC,MAAMH,EAAcG,MAC7BZ,EAAUa,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SAASE,EAAUN,GAAG;AAAA,EAC9D,GACA,CAEN,GACC,gBAAAxB,EAAA,cAAAU,GAAA,EAAQ,OAAM,mBAAsBC,GAAAA,EACnC,GAAA,gBAAAX,EAAA,cAACY,KACC,MAAK,KACL,SAAQ,SACR,OAAM,QACN,aAAa;AAAA,IAAEC,MAAMkB;AAAAA,IAAGhB,KAAK;AAAA,EAAc,GAC3C,SAAS,MAAM;AACb5B,IAAAA,EAAOwC,SAAS;AAAA,MAAE,GAAGtC;AAAAA,MAAeQ,kBAAkB,CAAA;AAAA,IAAC,CAAG;AAAA,EAAA,EAC1D,CAAA,CAEN,CACF,CACF,CACF;AAEJ;"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import e from "react";
|
|
2
2
|
import { Stack as i } from "@telegraph/layout";
|
|
3
3
|
import { Tooltip as a } from "@telegraph/tooltip";
|
|
4
|
-
|
|
4
|
+
import { sharedTooltipProps as l } from "./helpers.mjs";
|
|
5
|
+
const o = {
|
|
5
6
|
blue: /* @__PURE__ */ e.createElement("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": !0 }, /* @__PURE__ */ e.createElement("circle", { cx: "4", cy: "4", r: "4", fill: "var(--tgph-blue-9)" })),
|
|
6
7
|
yellow: /* @__PURE__ */ e.createElement("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": !0 }, /* @__PURE__ */ e.createElement("polygon", { points: "4,0.5 7.5,7.5 0.5,7.5", fill: "var(--tgph-yellow-9)" })),
|
|
7
8
|
gray: /* @__PURE__ */ e.createElement("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": !0 }, /* @__PURE__ */ e.createElement("circle", { cx: "4", cy: "4", r: "2.75", fill: "none", stroke: "var(--tgph-gray-9)", strokeWidth: "2.5" })),
|
|
8
9
|
red: /* @__PURE__ */ e.createElement("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": !0 }, /* @__PURE__ */ e.createElement("line", { x1: "1.5", y1: "1.5", x2: "6.5", y2: "6.5", stroke: "var(--tgph-red-9)", strokeWidth: "2", strokeLinecap: "round" }), /* @__PURE__ */ e.createElement("line", { x1: "6.5", y1: "1.5", x2: "1.5", y2: "6.5", stroke: "var(--tgph-red-9)", strokeWidth: "2", strokeLinecap: "round" }))
|
|
9
|
-
},
|
|
10
|
+
}, s = ({
|
|
10
11
|
color: t,
|
|
11
12
|
tooltip: r
|
|
12
|
-
}) => /* @__PURE__ */ e.createElement(a, { label: r }, /* @__PURE__ */ e.createElement(i, { as: "span", align: "center", justify: "center", display: "inline-flex", p: "0_5", style: {
|
|
13
|
+
}) => /* @__PURE__ */ e.createElement(a, { label: r, ...l }, /* @__PURE__ */ e.createElement(i, { as: "span", align: "center", justify: "center", display: "inline-flex", p: "0_5", style: {
|
|
13
14
|
flexShrink: 0
|
|
14
|
-
} },
|
|
15
|
+
} }, o[t]));
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
+
s as GuideAnnotatedStatusDot
|
|
17
18
|
};
|
|
18
19
|
//# sourceMappingURL=GuideAnnotatedStatusDot.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuideAnnotatedStatusDot.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.tsx"],"sourcesContent":["import { Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\n\nexport type StatusColor = \"blue\" | \"red\" | \"yellow\" | \"gray\";\n\n// Directly copied from the design prototype.\nconst STATUS_SHAPES: Record<StatusColor, React.ReactNode> = {\n blue: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <circle cx=\"4\" cy=\"4\" r=\"4\" fill=\"var(--tgph-blue-9)\" />\n </svg>\n ),\n yellow: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <polygon points=\"4,0.5 7.5,7.5 0.5,7.5\" fill=\"var(--tgph-yellow-9)\" />\n </svg>\n ),\n gray: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <circle\n cx=\"4\"\n cy=\"4\"\n r=\"2.75\"\n fill=\"none\"\n stroke=\"var(--tgph-gray-9)\"\n strokeWidth=\"2.5\"\n />\n </svg>\n ),\n red: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <line\n x1=\"1.5\"\n y1=\"1.5\"\n x2=\"6.5\"\n y2=\"6.5\"\n stroke=\"var(--tgph-red-9)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n <line\n x1=\"6.5\"\n y1=\"1.5\"\n x2=\"1.5\"\n y2=\"6.5\"\n stroke=\"var(--tgph-red-9)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n </svg>\n ),\n};\n\nexport const GuideAnnotatedStatusDot = ({\n color,\n tooltip,\n}: {\n color: StatusColor;\n tooltip: string;\n}) => {\n return (\n <Tooltip label={tooltip}>\n <Stack\n as=\"span\"\n align=\"center\"\n justify=\"center\"\n display=\"inline-flex\"\n p=\"0_5\"\n style={{ flexShrink: 0 }}\n >\n {STATUS_SHAPES[color]}\n </Stack>\n </Tooltip>\n );\n};\n"],"names":["STATUS_SHAPES","blue","React","yellow","gray","red","GuideAnnotatedStatusDot","color","tooltip","Tooltip","Stack","flexShrink"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GuideAnnotatedStatusDot.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.tsx"],"sourcesContent":["import { Stack } from \"@telegraph/layout\";\nimport { Tooltip } from \"@telegraph/tooltip\";\n\nimport { sharedTooltipProps } from \"./helpers\";\n\nexport type StatusColor = \"blue\" | \"red\" | \"yellow\" | \"gray\";\n\n// Directly copied from the design prototype.\nconst STATUS_SHAPES: Record<StatusColor, React.ReactNode> = {\n blue: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <circle cx=\"4\" cy=\"4\" r=\"4\" fill=\"var(--tgph-blue-9)\" />\n </svg>\n ),\n yellow: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <polygon points=\"4,0.5 7.5,7.5 0.5,7.5\" fill=\"var(--tgph-yellow-9)\" />\n </svg>\n ),\n gray: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <circle\n cx=\"4\"\n cy=\"4\"\n r=\"2.75\"\n fill=\"none\"\n stroke=\"var(--tgph-gray-9)\"\n strokeWidth=\"2.5\"\n />\n </svg>\n ),\n red: (\n <svg width=\"8\" height=\"8\" viewBox=\"0 0 8 8\" aria-hidden>\n <line\n x1=\"1.5\"\n y1=\"1.5\"\n x2=\"6.5\"\n y2=\"6.5\"\n stroke=\"var(--tgph-red-9)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n <line\n x1=\"6.5\"\n y1=\"1.5\"\n x2=\"1.5\"\n y2=\"6.5\"\n stroke=\"var(--tgph-red-9)\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n </svg>\n ),\n};\n\nexport const GuideAnnotatedStatusDot = ({\n color,\n tooltip,\n}: {\n color: StatusColor;\n tooltip: string;\n}) => {\n return (\n <Tooltip label={tooltip} {...sharedTooltipProps}>\n <Stack\n as=\"span\"\n align=\"center\"\n justify=\"center\"\n display=\"inline-flex\"\n p=\"0_5\"\n style={{ flexShrink: 0 }}\n >\n {STATUS_SHAPES[color]}\n </Stack>\n </Tooltip>\n );\n};\n"],"names":["STATUS_SHAPES","blue","React","yellow","gray","red","GuideAnnotatedStatusDot","color","tooltip","Tooltip","sharedTooltipProps","Stack","flexShrink"],"mappings":";;;;AAQA,MAAMA,IAAsD;AAAA,EAC1DC,sCACG,OAAI,EAAA,OAAM,KAAI,QAAO,KAAI,SAAQ,WAAU,eAAW,MACpDC,gBAAAA,EAAA,cAAA,UAAA,EAAO,IAAG,KAAI,IAAG,KAAI,GAAE,KAAI,MAAK,qBAAoB,CAAA,CACvD;AAAA,EAEFC,QACGD,gBAAAA,EAAA,cAAA,OAAA,EAAI,OAAM,KAAI,QAAO,KAAI,SAAQ,WAAU,eAAW,MACpDA,gBAAAA,EAAA,cAAA,WAAA,EAAQ,QAAO,yBAAwB,MAAK,wBAAsB,CACrE;AAAA,EAEFE,MACGF,gBAAAA,EAAA,cAAA,OAAA,EAAI,OAAM,KAAI,QAAO,KAAI,SAAQ,WAAU,eAAW,GACrD,GAAAA,gBAAAA,EAAA,cAAC,YACC,IAAG,KACH,IAAG,KACH,GAAE,QACF,MAAK,QACL,QAAO,sBACP,aAAY,MAAK,CAAA,CAErB;AAAA,EAEFG,qCACG,OAAI,EAAA,OAAM,KAAI,QAAO,KAAI,SAAQ,WAAU,eAAW,MACpDH,gBAAAA,EAAA,cAAA,QAAA,EACC,IAAG,OACH,IAAG,OACH,IAAG,OACH,IAAG,OACH,QAAO,qBACP,aAAY,KACZ,eAAc,QAAO,CAAA,mCAEtB,QACC,EAAA,IAAG,OACH,IAAG,OACH,IAAG,OACH,IAAG,OACH,QAAO,qBACP,aAAY,KACZ,eAAc,SAAO,CAEzB;AAEJ,GAEaI,IAA0BA,CAAC;AAAA,EACtCC,OAAAA;AAAAA,EACAC,SAAAA;AAIF,sCAEKC,GAAQ,EAAA,OAAOD,GAAaE,GAAAA,EAAAA,mCAC1BC,GACC,EAAA,IAAG,QACH,OAAM,UACN,SAAQ,UACR,SAAQ,eACR,GAAE,OACF,OAAO;AAAA,EAAEC,YAAY;AAAA,KAEpBZ,EAAcO,CAAK,CACtB,CACF;"}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import e from "react";
|
|
2
|
-
import { useGuideContext as
|
|
2
|
+
import { useGuideContext as d, useStore as s } from "@knocklabs/react-core";
|
|
3
3
|
import { Box as o, Stack as t } from "@telegraph/layout";
|
|
4
|
-
import { Toggle as
|
|
5
|
-
import { Tooltip as
|
|
4
|
+
import { Toggle as c } from "@telegraph/toggle";
|
|
5
|
+
import { Tooltip as l } from "@telegraph/tooltip";
|
|
6
6
|
import { Text as a } from "@telegraph/typography";
|
|
7
|
-
|
|
7
|
+
import { sharedTooltipProps as m } from "./helpers.mjs";
|
|
8
|
+
const w = () => {
|
|
8
9
|
const {
|
|
9
10
|
client: r
|
|
10
|
-
} =
|
|
11
|
-
debugSettings:
|
|
12
|
-
} =
|
|
11
|
+
} = d(), {
|
|
12
|
+
debugSettings: i
|
|
13
|
+
} = s(r.store, (n) => ({
|
|
13
14
|
debugSettings: n.debug || {}
|
|
14
15
|
}));
|
|
15
|
-
return /* @__PURE__ */ e.createElement(o, { py: "3", px: "3" }, /* @__PURE__ */ e.createElement(t, { direction: "column", gap: "1", width: "full" }, /* @__PURE__ */ e.createElement(a, { as: "span", size: "1", weight: "medium", display: "block" }, "Toolbar settings"), /* @__PURE__ */ e.createElement(t, { direction: "column", gap: "1" }, /* @__PURE__ */ e.createElement(t, { direction: "row", gap: "2", align: "center", h: "7" }, /* @__PURE__ */ e.createElement(
|
|
16
|
+
return /* @__PURE__ */ e.createElement(o, { py: "3", px: "3" }, /* @__PURE__ */ e.createElement(t, { direction: "column", gap: "1", width: "full" }, /* @__PURE__ */ e.createElement(a, { as: "span", size: "1", weight: "medium", display: "block" }, "Toolbar settings"), /* @__PURE__ */ e.createElement(t, { direction: "column", gap: "1" }, /* @__PURE__ */ e.createElement(t, { direction: "row", gap: "2", align: "center", h: "7" }, /* @__PURE__ */ e.createElement(l, { label: "When enabled, engagement actions are not sent to Knock.", ...m }, /* @__PURE__ */ e.createElement(o, { width: "36", mt: "1" }, /* @__PURE__ */ e.createElement(a, { as: "span", size: "1", weight: "medium", color: "gray", borderBottom: "px", borderStyle: "dashed" }, "Sandbox engagement"))), /* @__PURE__ */ e.createElement(c.Default, { size: "1", pt: "1_5", value: !!i.skipEngagementTracking, onValueChange: (n) => {
|
|
16
17
|
r.setDebug({
|
|
17
|
-
...
|
|
18
|
+
...i,
|
|
18
19
|
skipEngagementTracking: n
|
|
19
20
|
});
|
|
20
|
-
} })), /* @__PURE__ */ e.createElement(t, { direction: "row", gap: "2", align: "center", h: "7" }, /* @__PURE__ */ e.createElement(
|
|
21
|
+
} })), /* @__PURE__ */ e.createElement(t, { direction: "row", gap: "2", align: "center", h: "7" }, /* @__PURE__ */ e.createElement(l, { label: "Ignore throttle and show next guide immediately", ...m }, /* @__PURE__ */ e.createElement(o, { width: "36", mt: "1" }, /* @__PURE__ */ e.createElement(a, { as: "span", size: "1", weight: "medium", color: "gray", borderBottom: "px", borderStyle: "dashed" }, "Ignore throttle"))), /* @__PURE__ */ e.createElement(c.Default, { size: "1", pt: "1_5", value: !!i.ignoreDisplayInterval, onValueChange: (n) => {
|
|
21
22
|
r.setDebug({
|
|
22
|
-
...
|
|
23
|
+
...i,
|
|
23
24
|
ignoreDisplayInterval: n
|
|
24
25
|
});
|
|
25
|
-
} })))), /* @__PURE__ */ e.createElement(t, { direction: "column", gap: "1", width: "full" }, /* @__PURE__ */ e.createElement(
|
|
26
|
+
} })))), /* @__PURE__ */ e.createElement(t, { direction: "column", gap: "1", width: "full" }, /* @__PURE__ */ e.createElement(l, { label: /* @__PURE__ */ e.createElement(a, { as: "span", size: "1" }, "The tenant and data payload passed to KnockGuideProvider. Available for use in runtime conditions."), ...m }, /* @__PURE__ */ e.createElement(a, { as: "span", size: "1", weight: "medium", borderBottom: "px", borderStyle: "dashed", mt: "4", style: {
|
|
26
27
|
whiteSpace: "nowrap",
|
|
27
28
|
width: "fit-content"
|
|
28
29
|
} }, "Target params")), /* @__PURE__ */ e.createElement(t, { direction: "column", gap: "2" }, /* @__PURE__ */ e.createElement(t, { direction: "row", gap: "2", align: "center" }, /* @__PURE__ */ e.createElement(a, { as: "span", size: "1", weight: "medium", color: "gray", width: "36", mt: "1" }, "Tenant"), /* @__PURE__ */ e.createElement(o, { rounded: "2", overflow: "auto", backgroundColor: "surface-2", border: "px", p: "1", style: {
|
|
@@ -42,6 +43,6 @@ const f = () => {
|
|
|
42
43
|
} }, /* @__PURE__ */ e.createElement("code", null, r.targetParams.data ? JSON.stringify(r.targetParams.data, null, 2) : "-")))))));
|
|
43
44
|
};
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
w as GuideContextDetails
|
|
46
47
|
};
|
|
47
48
|
//# sourceMappingURL=GuideContextDetails.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuideContextDetails.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideContextDetails.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Toggle } from \"@telegraph/toggle\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\n\nexport const GuideContextDetails = () => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug || {},\n }));\n\n return (\n <Box py=\"3\" px=\"3\">\n <Stack direction=\"column\" gap=\"1\" width=\"full\">\n <Text as=\"span\" size=\"1\" weight=\"medium\" display=\"block\">\n Toolbar settings\n </Text>\n <Stack direction=\"column\" gap=\"1\">\n <Stack direction=\"row\" gap=\"2\" align=\"center\" h=\"7\">\n <Tooltip
|
|
1
|
+
{"version":3,"file":"GuideContextDetails.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideContextDetails.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Toggle } from \"@telegraph/toggle\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\n\nimport { sharedTooltipProps } from \"./helpers\";\n\nexport const GuideContextDetails = () => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug || {},\n }));\n\n return (\n <Box py=\"3\" px=\"3\">\n <Stack direction=\"column\" gap=\"1\" width=\"full\">\n <Text as=\"span\" size=\"1\" weight=\"medium\" display=\"block\">\n Toolbar settings\n </Text>\n <Stack direction=\"column\" gap=\"1\">\n <Stack direction=\"row\" gap=\"2\" align=\"center\" h=\"7\">\n <Tooltip\n label=\"When enabled, engagement actions are not sent to Knock.\"\n {...sharedTooltipProps}\n >\n <Box width=\"36\" mt=\"1\">\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color=\"gray\"\n borderBottom=\"px\"\n borderStyle=\"dashed\"\n >\n Sandbox engagement\n </Text>\n </Box>\n </Tooltip>\n <Toggle.Default\n size=\"1\"\n pt=\"1_5\"\n value={!!debugSettings.skipEngagementTracking}\n onValueChange={(value: boolean) => {\n client.setDebug({\n ...debugSettings,\n skipEngagementTracking: value,\n });\n }}\n />\n </Stack>\n <Stack direction=\"row\" gap=\"2\" align=\"center\" h=\"7\">\n <Tooltip\n label=\"Ignore throttle and show next guide immediately\"\n {...sharedTooltipProps}\n >\n <Box width=\"36\" mt=\"1\">\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color=\"gray\"\n borderBottom=\"px\"\n borderStyle=\"dashed\"\n >\n Ignore throttle\n </Text>\n </Box>\n </Tooltip>\n <Toggle.Default\n size=\"1\"\n pt=\"1_5\"\n value={!!debugSettings.ignoreDisplayInterval}\n onValueChange={(value: boolean) => {\n client.setDebug({\n ...debugSettings,\n ignoreDisplayInterval: value,\n });\n }}\n />\n </Stack>\n </Stack>\n </Stack>\n <Stack direction=\"column\" gap=\"1\" width=\"full\">\n <Tooltip\n label={\n <Text as=\"span\" size=\"1\">\n The tenant and data payload passed to KnockGuideProvider.\n Available for use in runtime conditions.\n </Text>\n }\n {...sharedTooltipProps}\n >\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n borderBottom=\"px\"\n borderStyle=\"dashed\"\n mt=\"4\"\n style={{\n whiteSpace: \"nowrap\",\n width: \"fit-content\",\n }}\n >\n Target params\n </Text>\n </Tooltip>\n <Stack direction=\"column\" gap=\"2\">\n <Stack direction=\"row\" gap=\"2\" align=\"center\">\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color=\"gray\"\n width=\"36\"\n mt=\"1\"\n >\n Tenant\n </Text>\n <Box\n rounded=\"2\"\n overflow=\"auto\"\n backgroundColor=\"surface-2\"\n border=\"px\"\n p=\"1\"\n style={{ flex: 1, minWidth: 0 }}\n >\n <pre style={{ fontSize: \"11px\", margin: 0 }}>\n <code>{client.targetParams.tenant || \"-\"}</code>\n </pre>\n </Box>\n </Stack>\n <Stack direction=\"row\" gap=\"2\" align=\"flex-start\">\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color=\"gray\"\n width=\"36\"\n mt=\"1\"\n >\n Data\n </Text>\n <Box\n rounded=\"2\"\n overflow=\"auto\"\n backgroundColor=\"surface-2\"\n border=\"px\"\n p=\"1\"\n style={{\n flex: 1,\n minWidth: 0,\n minHeight: \"50px\",\n maxHeight: \"200px\",\n }}\n >\n <pre style={{ fontSize: \"11px\", margin: 0 }}>\n <code>\n {client.targetParams.data\n ? JSON.stringify(client.targetParams.data, null, 2)\n : \"-\"}\n </code>\n </pre>\n </Box>\n </Stack>\n </Stack>\n </Stack>\n </Box>\n );\n};\n"],"names":["GuideContextDetails","client","useGuideContext","debugSettings","useStore","store","state","debug","Box","Stack","Text","React","Tooltip","sharedTooltipProps","Toggle","skipEngagementTracking","value","setDebug","ignoreDisplayInterval","whiteSpace","width","flex","minWidth","fontSize","margin","targetParams","tenant","minHeight","maxHeight","data","JSON","stringify"],"mappings":";;;;;;;AAQO,MAAMA,IAAsBA,MAAM;AACjC,QAAA;AAAA,IAAEC,QAAAA;AAAAA,MAAWC,EAAgB,GAC7B;AAAA,IAAEC,eAAAA;AAAAA,EAAkBC,IAAAA,EAASH,EAAOI,OAAQC,CAAWA,OAAA;AAAA,IAC3DH,eAAeG,EAAMC,SAAS,CAAA;AAAA,EAAC,EAC/B;AAEF,yCACGC,GAAI,EAAA,IAAG,KAAI,IAA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AQ,KACR,UAAS,QACT,iBAAgB,aAChB,QAAO,MACP,GAAE,KACF,OAAO;AAAA,IACLa,MAAM;AAAA,IACNC,UAAU;AAAA,IACVK,WAAW;AAAA,IACXC,WAAW;AAAA,EACb,EAAA,GAECjB,gBAAAA,EAAA,cAAA,OAAA,EAAI,OAAO;AAAA,IAAEY,UAAU;AAAA,IAAQC,QAAQ;AAAA,EAAA,qCACrC,QACEvB,MAAAA,EAAOwB,aAAaI,OACjBC,KAAKC,UAAU9B,EAAOwB,aAAaI,MAAM,MAAM,CAAC,IAChD,GACN,CACF,CACF,CACF,CACF,CACF,CACF;AAEJ;"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { useGuideContext as x, useStore as G } from "@knocklabs/react-core";
|
|
2
|
-
import { Button as
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { Box as
|
|
5
|
-
import { Tag as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { Text as
|
|
8
|
-
import { Gauge as
|
|
2
|
+
import { Button as T } from "@telegraph/button";
|
|
3
|
+
import { Icon as A } from "@telegraph/icon";
|
|
4
|
+
import { Box as f, Stack as i } from "@telegraph/layout";
|
|
5
|
+
import { Tag as C } from "@telegraph/tag";
|
|
6
|
+
import { Tooltip as h } from "@telegraph/tooltip";
|
|
7
|
+
import { Text as y } from "@telegraph/typography";
|
|
8
|
+
import { Gauge as D } from "lucide-react";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import { GuideAnnotatedStatusDot as
|
|
11
|
-
import { GuideRowDetails as
|
|
12
|
-
import {
|
|
13
|
-
import { isUncommittedGuide as
|
|
14
|
-
const
|
|
10
|
+
import { GuideAnnotatedStatusDot as c } from "./GuideAnnotatedStatusDot.mjs";
|
|
11
|
+
import { GuideRowDetails as z, getSelectableStatusSummary as w } from "./GuideRowDetails.mjs";
|
|
12
|
+
import { sharedTooltipProps as E } from "./helpers.mjs";
|
|
13
|
+
import { isUncommittedGuide as n } from "./useInspectGuideClientStore.mjs";
|
|
14
|
+
const N = "data-kgt-guide-row-key", S = ({
|
|
15
15
|
label: e,
|
|
16
16
|
color: o = "gray",
|
|
17
17
|
children: a
|
|
18
|
-
}) => /* @__PURE__ */ t.createElement(
|
|
19
|
-
if (
|
|
18
|
+
}) => /* @__PURE__ */ t.createElement(i, { direction: "row", align: "center", gap: "0_5", px: "1", height: "5", bg: "surface-2", rounded: "full", border: "px", borderColor: "gray-4" }, /* @__PURE__ */ t.createElement(y, { as: "span", size: "0", color: o, weight: "medium" }, e), a), $ = (e) => {
|
|
19
|
+
if (n(e))
|
|
20
20
|
return {
|
|
21
21
|
color: "red",
|
|
22
22
|
label: "Inactive",
|
|
@@ -55,8 +55,8 @@ const z = "data-kgt-guide-row-key", S = ({
|
|
|
55
55
|
label: "Not activated",
|
|
56
56
|
description: "This guide cannot be activated in the current location"
|
|
57
57
|
};
|
|
58
|
-
},
|
|
59
|
-
if (
|
|
58
|
+
}, I = (e) => {
|
|
59
|
+
if (n(e))
|
|
60
60
|
return {
|
|
61
61
|
active: {
|
|
62
62
|
color: "gray"
|
|
@@ -85,21 +85,21 @@ const z = "data-kgt-guide-row-key", S = ({
|
|
|
85
85
|
}, u = {
|
|
86
86
|
color: o.targetable.status ? "blue" : "red",
|
|
87
87
|
tooltip: `Targeting: ${o.targetable.status ? "Yes" : "No"}`
|
|
88
|
-
},
|
|
88
|
+
}, d = {
|
|
89
89
|
color: o.activatable.status ? "blue" : "red",
|
|
90
90
|
tooltip: `Activated: ${o.activatable.status ? "Yes" : "No"}`
|
|
91
|
-
},
|
|
92
|
-
color:
|
|
93
|
-
tooltip:
|
|
91
|
+
}, l = w(o.selectable.status), b = {
|
|
92
|
+
color: l.color,
|
|
93
|
+
tooltip: l.label
|
|
94
94
|
};
|
|
95
95
|
return {
|
|
96
96
|
active: a,
|
|
97
97
|
archived: m,
|
|
98
98
|
targetable: u,
|
|
99
|
-
activatable:
|
|
100
|
-
selectable:
|
|
99
|
+
activatable: d,
|
|
100
|
+
selectable: b
|
|
101
101
|
};
|
|
102
|
-
},
|
|
102
|
+
}, M = ({
|
|
103
103
|
guide: e,
|
|
104
104
|
orderIndex: o,
|
|
105
105
|
isExpanded: a,
|
|
@@ -108,38 +108,38 @@ const z = "data-kgt-guide-row-key", S = ({
|
|
|
108
108
|
const {
|
|
109
109
|
client: u
|
|
110
110
|
} = x(), {
|
|
111
|
-
debugSettings:
|
|
111
|
+
debugSettings: d
|
|
112
112
|
} = G(u.store, (g) => ({
|
|
113
113
|
debugSettings: g.debug || {}
|
|
114
|
-
})), [
|
|
115
|
-
[
|
|
114
|
+
})), [l, b] = t.useState(!1), v = d.focusedGuideKeys || {}, k = Object.keys(v).length > 0, s = !!v[e.key], r = I(e), p = $(e), _ = {
|
|
115
|
+
[N]: e.key
|
|
116
116
|
};
|
|
117
|
-
return /* @__PURE__ */ t.createElement(
|
|
117
|
+
return /* @__PURE__ */ t.createElement(f, { rounded: "3", overflow: "hidden", border: "px", borderStyle: "solid", borderColor: a ? "gray-6" : "transparent", onMouseEnter: () => b(!0), onMouseLeave: () => b(!1), style: {
|
|
118
118
|
cursor: "pointer"
|
|
119
|
-
}, ...
|
|
119
|
+
}, ..._ }, /* @__PURE__ */ t.createElement(i, { h: "7", px: "1", gap: "1", align: "center", justify: "space-between", rounded: "3", overflow: "hidden", border: "px", borderStyle: "solid", borderColor: a ? "transparent" : s ? "gray-6" : l ? "gray-4" : "transparent", backgroundColor: a ? "surface-2" : s ? "gray-2" : l ? "surface-2" : "transparent", onClick: () => m(e.key) }, /* @__PURE__ */ t.createElement(i, { align: "center", gap: "1_5", style: {
|
|
120
120
|
minWidth: 0,
|
|
121
121
|
flex: 1
|
|
122
|
-
} }, /* @__PURE__ */ t.createElement(
|
|
122
|
+
} }, /* @__PURE__ */ t.createElement(i, { w: "7", justify: "space-between", align: "center", gap: "0_5" }, /* @__PURE__ */ t.createElement(f, { w: "3" }, !e.bypass_global_group_limit && /* @__PURE__ */ t.createElement(A, { icon: D, size: "0", color: "gray", alt: "Subject to throttling" })), /* @__PURE__ */ t.createElement(y, { as: "span", size: "1", weight: "medium", color: e.bypass_global_group_limit ? "blue" : "default", style: {
|
|
123
123
|
flexShrink: 0
|
|
124
|
-
} }, o + 1)), /* @__PURE__ */ t.createElement(
|
|
124
|
+
} }, o + 1)), /* @__PURE__ */ t.createElement(h, { label: `${e.key}${e.bypass_global_group_limit ? " (unthrottled)" : ""}`, ...E }, /* @__PURE__ */ t.createElement(y, { as: "code", size: "1", weight: "medium", color: "default", style: {
|
|
125
125
|
display: "block",
|
|
126
126
|
overflow: "hidden",
|
|
127
127
|
textOverflow: "ellipsis",
|
|
128
128
|
whiteSpace: "nowrap",
|
|
129
129
|
maxWidth: "200px"
|
|
130
|
-
} }, e.key))), /* @__PURE__ */ t.createElement(
|
|
130
|
+
} }, e.key))), /* @__PURE__ */ t.createElement(i, { align: "center", gap: "1_5", style: {
|
|
131
131
|
flexShrink: 0
|
|
132
|
-
} }, !
|
|
132
|
+
} }, !k && /* @__PURE__ */ t.createElement(h, { label: p.description, ...E }, /* @__PURE__ */ t.createElement(C, { size: "0", variant: "soft", color: p.color }, p.label)), /* @__PURE__ */ t.createElement(S, { label: "Elig:", color: n(e) ? "disabled" : e.annotation.isEligible ? "blue" : "gray" }, /* @__PURE__ */ t.createElement(c, { color: r.active.color, tooltip: r.active.tooltip }), /* @__PURE__ */ t.createElement(c, { color: r.archived.color, tooltip: r.archived.tooltip }), /* @__PURE__ */ t.createElement(c, { color: r.targetable.color, tooltip: r.targetable.tooltip })), /* @__PURE__ */ t.createElement(S, { label: "Vis:", color: n(e) ? "disabled" : e.annotation.isQualified && e.annotation.selectable.status === "returned" ? "blue" : "gray" }, /* @__PURE__ */ t.createElement(c, { color: r.activatable.color, tooltip: r.activatable.tooltip }), /* @__PURE__ */ t.createElement(c, { color: r.selectable.color, tooltip: r.selectable.tooltip })), /* @__PURE__ */ t.createElement(T, { size: "0", variant: s ? "solid" : "outline", color: s ? "blue" : "gray", disabled: n(e) || e.annotation.selectable.status === void 0, onClick: (g) => {
|
|
133
133
|
g.stopPropagation(), u.setDebug({
|
|
134
|
-
...
|
|
135
|
-
focusedGuideKeys:
|
|
134
|
+
...d,
|
|
135
|
+
focusedGuideKeys: s ? {} : {
|
|
136
136
|
[e.key]: !0
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
-
} }, "Focus")))
|
|
139
|
+
} }, "Focus"))), a && /* @__PURE__ */ t.createElement(z, { guide: e }));
|
|
140
140
|
};
|
|
141
141
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
N as GUIDE_ROW_DATA_SELECTOR,
|
|
143
|
+
M as GuideRow
|
|
144
144
|
};
|
|
145
145
|
//# sourceMappingURL=GuideRow.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuideRow.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideRow.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Icon } from \"@telegraph/icon\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Tag } from \"@telegraph/tag\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport { Gauge } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport {\n StatusColor,\n GuideAnnotatedStatusDot as StatusDot,\n} from \"./GuideAnnotatedStatusDot\";\nimport {\n GuideRowDetails,\n StatusSummary,\n getSelectableStatusSummary,\n} from \"./GuideRowDetails\";\nimport { FOCUS_ERRORS } from \"./helpers\";\nimport {\n AnnotatedGuide,\n AnnotatedStatuses,\n UncommittedGuide,\n isUncommittedGuide,\n} from \"./useInspectGuideClientStore\";\n\nexport const GUIDE_ROW_DATA_SELECTOR = \"data-kgt-guide-row-key\";\n\nconst Pill = ({\n label,\n color = \"gray\",\n children,\n}: {\n label: string;\n color?: StatusColor | \"disabled\";\n children: React.ReactNode;\n}) => {\n return (\n <Stack\n direction=\"row\"\n align=\"center\"\n gap=\"0_5\"\n px=\"1\"\n height=\"5\"\n bg=\"surface-2\"\n rounded=\"full\"\n border=\"px\"\n borderColor=\"gray-4\"\n >\n <Text as=\"span\" size=\"0\" color={color} weight=\"medium\">\n {label}\n </Text>\n {children}\n </Stack>\n );\n};\n\nconst getStatusSummary = (\n guide: AnnotatedGuide | UncommittedGuide,\n): StatusSummary => {\n if (isUncommittedGuide(guide)) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide has never been committed and published yet\",\n };\n }\n\n const { annotation } = guide;\n\n if (!annotation.active.status) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide is inactive\",\n };\n }\n if (annotation.archived.status) {\n return {\n color: \"red\",\n label: \"Archived\",\n description: \"User has already dismissed this guide\",\n };\n }\n if (!annotation.targetable.status) {\n return {\n color: \"red\",\n label: \"Not targeted\",\n description: annotation.targetable.message,\n };\n }\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n // Prioritize an undefined selectable status ahead of activatable status.\n if (annotation.selectable.status === undefined) {\n return selectableStatusSummary;\n }\n\n if (!annotation.activatable.status) {\n return {\n color: \"red\",\n label: \"Not activated\",\n description: \"This guide cannot be activated in the current location\",\n };\n }\n\n return {\n ...selectableStatusSummary,\n\n // Shorten the label we display here for space.\n ...(annotation.selectable.status === \"returned\"\n ? { label: \"Display\" }\n : undefined),\n };\n};\n\ntype StatusDot = {\n color: StatusColor;\n tooltip?: string;\n};\n\nconst getStatusDots = (\n guide: AnnotatedGuide | UncommittedGuide,\n): Record<keyof AnnotatedStatuses, StatusDot> => {\n if (isUncommittedGuide(guide)) {\n return {\n active: { color: \"gray\" },\n archived: { color: \"gray\" },\n targetable: { color: \"gray\" },\n activatable: { color: \"gray\" },\n selectable: { color: \"gray\" },\n };\n }\n\n const { annotation } = guide;\n\n const active: StatusDot = {\n color: annotation.active.status ? \"blue\" : \"red\",\n tooltip: `Active: ${annotation.active.status ? \"Yes\" : \"No\"}`,\n };\n\n const archived: StatusDot = {\n color: annotation.archived.status ? \"red\" : \"blue\",\n tooltip: `Archived: ${annotation.archived.status ? \"Yes\" : \"No\"}`,\n };\n\n const targetable: StatusDot = {\n color: annotation.targetable.status ? \"blue\" : \"red\",\n tooltip: `Targeting: ${annotation.targetable.status ? \"Yes\" : \"No\"}`,\n };\n\n const activatable: StatusDot = {\n color: annotation.activatable.status ? \"blue\" : \"red\",\n tooltip: `Activated: ${annotation.activatable.status ? \"Yes\" : \"No\"}`,\n };\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n const selectable = {\n color: selectableStatusSummary.color,\n tooltip: selectableStatusSummary.label,\n };\n\n return { active, archived, targetable, activatable, selectable };\n};\n\ntype Props = {\n guide: UncommittedGuide | AnnotatedGuide;\n orderIndex: number;\n isExpanded: boolean;\n onClick: (guideKey: string) => void;\n};\n\nexport const GuideRow = ({ guide, orderIndex, isExpanded, onClick }: Props) => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug || {},\n }));\n const [isHovered, setIsHovered] = React.useState(false);\n\n const focusedGuideKeys = debugSettings.focusedGuideKeys || {};\n const hasFocus = Object.keys(focusedGuideKeys).length > 0;\n const isFocused = !!focusedGuideKeys[guide.key];\n\n const dots = getStatusDots(guide);\n const summary = getStatusSummary(guide);\n const dataAttrs = { [GUIDE_ROW_DATA_SELECTOR]: guide.key };\n\n return (\n <Box\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={isExpanded ? \"gray-6\" : \"transparent\"}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{ cursor: \"pointer\" }}\n {...dataAttrs}\n >\n <Stack\n h=\"7\"\n px=\"1\"\n gap=\"1\"\n align=\"center\"\n justify=\"space-between\"\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={\n isExpanded\n ? \"transparent\"\n : isFocused\n ? \"gray-6\"\n : isHovered\n ? \"gray-4\"\n : \"transparent\"\n }\n backgroundColor={\n isExpanded\n ? \"surface-2\"\n : isFocused\n ? \"gray-2\"\n : isHovered\n ? \"surface-2\"\n : \"transparent\"\n }\n onClick={() => onClick(guide.key)}\n >\n {/* Left section: order + key */}\n <Stack align=\"center\" gap=\"1_5\" style={{ minWidth: 0, flex: 1 }}>\n <Stack w=\"7\" justify=\"space-between\" align=\"center\" gap=\"0_5\">\n <Box w=\"3\">\n {!guide.bypass_global_group_limit && (\n <Icon\n icon={Gauge}\n size=\"0\"\n color=\"gray\"\n alt=\"Subject to throttling\"\n />\n )}\n </Box>\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color={guide.bypass_global_group_limit ? \"blue\" : \"default\"}\n style={{ flexShrink: 0 }}\n >\n {orderIndex + 1}\n </Text>\n </Stack>\n <Tooltip\n label={`${guide.key}${guide.bypass_global_group_limit ? \" (unthrottled)\" : \"\"}`}\n >\n <Text\n as=\"code\"\n size=\"1\"\n weight=\"medium\"\n color=\"default\"\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n maxWidth: \"200px\",\n }}\n >\n {guide.key}\n </Text>\n </Tooltip>\n </Stack>\n\n {/* Right section: verdict + pills + focus */}\n <Stack align=\"center\" gap=\"1_5\" style={{ flexShrink: 0 }}>\n {!hasFocus && (\n <Tooltip label={summary.description}>\n <Tag size=\"0\" variant=\"soft\" color={summary.color}>\n {summary.label}\n </Tag>\n </Tooltip>\n )}\n\n <Pill\n label=\"Elig:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isEligible\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.active.color}\n tooltip={dots.active.tooltip!}\n />\n <StatusDot\n color={dots.archived.color}\n tooltip={dots.archived.tooltip!}\n />\n <StatusDot\n color={dots.targetable.color}\n tooltip={dots.targetable.tooltip!}\n />\n </Pill>\n <Pill\n label=\"Vis:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isQualified &&\n guide.annotation.selectable.status === \"returned\"\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.activatable.color}\n tooltip={dots.activatable.tooltip!}\n />\n <StatusDot\n color={dots.selectable.color}\n tooltip={dots.selectable.tooltip!}\n />\n </Pill>\n\n <Tooltip\n label={\n isUncommittedGuide(guide)\n ? FOCUS_ERRORS.focusUncommittedGuide\n : guide.annotation.selectable.status === undefined\n ? FOCUS_ERRORS.focusUnselectableGuide\n : \"\"\n }\n enabled={\n isUncommittedGuide(guide) ||\n guide.annotation.selectable.status === undefined\n }\n >\n <Button\n size=\"0\"\n variant={isFocused ? \"solid\" : \"outline\"}\n color={isFocused ? \"blue\" : \"gray\"}\n disabled={\n isUncommittedGuide(guide) ||\n guide.annotation.selectable.status === undefined\n }\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n client.setDebug({\n ...debugSettings,\n focusedGuideKeys: isFocused ? {} : { [guide.key]: true },\n });\n }}\n >\n Focus\n </Button>\n </Tooltip>\n </Stack>\n </Stack>\n\n {isExpanded && <GuideRowDetails guide={guide} />}\n </Box>\n );\n};\n"],"names":["GUIDE_ROW_DATA_SELECTOR","Pill","label","color","children","React","Stack","Text","getStatusSummary","guide","isUncommittedGuide","description","annotation","active","status","archived","targetable","message","selectableStatusSummary","getSelectableStatusSummary","selectable","undefined","activatable","getStatusDots","tooltip","GuideRow","orderIndex","isExpanded","onClick","client","useGuideContext","debugSettings","useStore","store","state","debug","isHovered","setIsHovered","useState","focusedGuideKeys","hasFocus","Object","keys","length","isFocused","key","dots","summary","dataAttrs","Box","cursor","minWidth","flex","bypass_global_group_limit","Icon","Gauge","flexShrink","Tooltip","display","overflow","textOverflow","whiteSpace","maxWidth","Tag","isEligible","StatusDot","isQualified","FOCUS_ERRORS","focusUncommittedGu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,CACF,CACF,CACF,GAEClB,KAAc,gBAAAtB,EAAA,cAACqE,GAAgB,EAAA,OAAAjE,EAAA,CAAgB,CAClD;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"GuideRow.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideRow.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Icon } from \"@telegraph/icon\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Tag } from \"@telegraph/tag\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport { Gauge } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport {\n StatusColor,\n GuideAnnotatedStatusDot as StatusDot,\n} from \"./GuideAnnotatedStatusDot\";\nimport {\n GuideRowDetails,\n StatusSummary,\n getSelectableStatusSummary,\n} from \"./GuideRowDetails\";\nimport { sharedTooltipProps } from \"./helpers\";\nimport {\n AnnotatedGuide,\n AnnotatedStatuses,\n UncommittedGuide,\n isUncommittedGuide,\n} from \"./useInspectGuideClientStore\";\n\nexport const GUIDE_ROW_DATA_SELECTOR = \"data-kgt-guide-row-key\";\n\nconst Pill = ({\n label,\n color = \"gray\",\n children,\n}: {\n label: string;\n color?: StatusColor | \"disabled\";\n children: React.ReactNode;\n}) => {\n return (\n <Stack\n direction=\"row\"\n align=\"center\"\n gap=\"0_5\"\n px=\"1\"\n height=\"5\"\n bg=\"surface-2\"\n rounded=\"full\"\n border=\"px\"\n borderColor=\"gray-4\"\n >\n <Text as=\"span\" size=\"0\" color={color} weight=\"medium\">\n {label}\n </Text>\n {children}\n </Stack>\n );\n};\n\nconst getStatusSummary = (\n guide: AnnotatedGuide | UncommittedGuide,\n): StatusSummary => {\n if (isUncommittedGuide(guide)) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide has never been committed and published yet\",\n };\n }\n\n const { annotation } = guide;\n\n if (!annotation.active.status) {\n return {\n color: \"red\",\n label: \"Inactive\",\n description: \"This guide is inactive\",\n };\n }\n if (annotation.archived.status) {\n return {\n color: \"red\",\n label: \"Archived\",\n description: \"User has already dismissed this guide\",\n };\n }\n if (!annotation.targetable.status) {\n return {\n color: \"red\",\n label: \"Not targeted\",\n description: annotation.targetable.message,\n };\n }\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n // Prioritize an undefined selectable status ahead of activatable status.\n if (annotation.selectable.status === undefined) {\n return selectableStatusSummary;\n }\n\n if (!annotation.activatable.status) {\n return {\n color: \"red\",\n label: \"Not activated\",\n description: \"This guide cannot be activated in the current location\",\n };\n }\n\n return {\n ...selectableStatusSummary,\n\n // Shorten the label we display here for space.\n ...(annotation.selectable.status === \"returned\"\n ? { label: \"Display\" }\n : undefined),\n };\n};\n\ntype StatusDot = {\n color: StatusColor;\n tooltip?: string;\n};\n\nconst getStatusDots = (\n guide: AnnotatedGuide | UncommittedGuide,\n): Record<keyof AnnotatedStatuses, StatusDot> => {\n if (isUncommittedGuide(guide)) {\n return {\n active: { color: \"gray\" },\n archived: { color: \"gray\" },\n targetable: { color: \"gray\" },\n activatable: { color: \"gray\" },\n selectable: { color: \"gray\" },\n };\n }\n\n const { annotation } = guide;\n\n const active: StatusDot = {\n color: annotation.active.status ? \"blue\" : \"red\",\n tooltip: `Active: ${annotation.active.status ? \"Yes\" : \"No\"}`,\n };\n\n const archived: StatusDot = {\n color: annotation.archived.status ? \"red\" : \"blue\",\n tooltip: `Archived: ${annotation.archived.status ? \"Yes\" : \"No\"}`,\n };\n\n const targetable: StatusDot = {\n color: annotation.targetable.status ? \"blue\" : \"red\",\n tooltip: `Targeting: ${annotation.targetable.status ? \"Yes\" : \"No\"}`,\n };\n\n const activatable: StatusDot = {\n color: annotation.activatable.status ? \"blue\" : \"red\",\n tooltip: `Activated: ${annotation.activatable.status ? \"Yes\" : \"No\"}`,\n };\n\n const selectableStatusSummary = getSelectableStatusSummary(\n annotation.selectable.status,\n );\n\n const selectable = {\n color: selectableStatusSummary.color,\n tooltip: selectableStatusSummary.label,\n };\n\n return { active, archived, targetable, activatable, selectable };\n};\n\ntype Props = {\n guide: UncommittedGuide | AnnotatedGuide;\n orderIndex: number;\n isExpanded: boolean;\n onClick: (guideKey: string) => void;\n};\n\nexport const GuideRow = ({ guide, orderIndex, isExpanded, onClick }: Props) => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug || {},\n }));\n const [isHovered, setIsHovered] = React.useState(false);\n\n const focusedGuideKeys = debugSettings.focusedGuideKeys || {};\n const hasFocus = Object.keys(focusedGuideKeys).length > 0;\n const isFocused = !!focusedGuideKeys[guide.key];\n\n const dots = getStatusDots(guide);\n const summary = getStatusSummary(guide);\n const dataAttrs = { [GUIDE_ROW_DATA_SELECTOR]: guide.key };\n\n return (\n <Box\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={isExpanded ? \"gray-6\" : \"transparent\"}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{ cursor: \"pointer\" }}\n {...dataAttrs}\n >\n <Stack\n h=\"7\"\n px=\"1\"\n gap=\"1\"\n align=\"center\"\n justify=\"space-between\"\n rounded=\"3\"\n overflow=\"hidden\"\n border=\"px\"\n borderStyle=\"solid\"\n borderColor={\n isExpanded\n ? \"transparent\"\n : isFocused\n ? \"gray-6\"\n : isHovered\n ? \"gray-4\"\n : \"transparent\"\n }\n backgroundColor={\n isExpanded\n ? \"surface-2\"\n : isFocused\n ? \"gray-2\"\n : isHovered\n ? \"surface-2\"\n : \"transparent\"\n }\n onClick={() => onClick(guide.key)}\n >\n {/* Left section: order + key */}\n <Stack align=\"center\" gap=\"1_5\" style={{ minWidth: 0, flex: 1 }}>\n <Stack w=\"7\" justify=\"space-between\" align=\"center\" gap=\"0_5\">\n <Box w=\"3\">\n {!guide.bypass_global_group_limit && (\n <Icon\n icon={Gauge}\n size=\"0\"\n color=\"gray\"\n alt=\"Subject to throttling\"\n />\n )}\n </Box>\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color={guide.bypass_global_group_limit ? \"blue\" : \"default\"}\n style={{ flexShrink: 0 }}\n >\n {orderIndex + 1}\n </Text>\n </Stack>\n <Tooltip\n label={`${guide.key}${guide.bypass_global_group_limit ? \" (unthrottled)\" : \"\"}`}\n {...sharedTooltipProps}\n >\n <Text\n as=\"code\"\n size=\"1\"\n weight=\"medium\"\n color=\"default\"\n style={{\n display: \"block\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n maxWidth: \"200px\",\n }}\n >\n {guide.key}\n </Text>\n </Tooltip>\n </Stack>\n\n {/* Right section: verdict + pills + focus */}\n <Stack align=\"center\" gap=\"1_5\" style={{ flexShrink: 0 }}>\n {!hasFocus && (\n <Tooltip label={summary.description} {...sharedTooltipProps}>\n <Tag size=\"0\" variant=\"soft\" color={summary.color}>\n {summary.label}\n </Tag>\n </Tooltip>\n )}\n\n <Pill\n label=\"Elig:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isEligible\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.active.color}\n tooltip={dots.active.tooltip!}\n />\n <StatusDot\n color={dots.archived.color}\n tooltip={dots.archived.tooltip!}\n />\n <StatusDot\n color={dots.targetable.color}\n tooltip={dots.targetable.tooltip!}\n />\n </Pill>\n <Pill\n label=\"Vis:\"\n color={\n isUncommittedGuide(guide)\n ? \"disabled\"\n : guide.annotation.isQualified &&\n guide.annotation.selectable.status === \"returned\"\n ? \"blue\"\n : \"gray\"\n }\n >\n <StatusDot\n color={dots.activatable.color}\n tooltip={dots.activatable.tooltip!}\n />\n <StatusDot\n color={dots.selectable.color}\n tooltip={dots.selectable.tooltip!}\n />\n </Pill>\n\n <Button\n size=\"0\"\n variant={isFocused ? \"solid\" : \"outline\"}\n color={isFocused ? \"blue\" : \"gray\"}\n disabled={\n isUncommittedGuide(guide) ||\n guide.annotation.selectable.status === undefined\n }\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n client.setDebug({\n ...debugSettings,\n focusedGuideKeys: isFocused ? {} : { [guide.key]: true },\n });\n }}\n >\n Focus\n </Button>\n </Stack>\n </Stack>\n\n {isExpanded && <GuideRowDetails guide={guide} />}\n </Box>\n );\n};\n"],"names":["GUIDE_ROW_DATA_SELECTOR","Pill","label","color","children","React","Stack","Text","getStatusSummary","guide","isUncommittedGuide","description","annotation","active","status","archived","targetable","message","selectableStatusSummary","getSelectableStatusSummary","selectable","undefined","activatable","getStatusDots","tooltip","GuideRow","orderIndex","isExpanded","onClick","client","useGuideContext","debugSettings","useStore","store","state","debug","isHovered","setIsHovered","useState","focusedGuideKeys","hasFocus","Object","keys","length","isFocused","key","dots","summary","dataAttrs","Box","cursor","minWidth","flex","bypass_global_group_limit","Icon","Gauge","flexShrink","Tooltip","sharedTooltipProps","display","overflow","textOverflow","whiteSpace","maxWidth","Tag","isEligible","StatusDot","isQualified","Button","e","stopPropagation","setDebug","GuideRowDetails"],"mappings":";;;;;;;;;;;;;AA2BO,MAAMA,IAA0B,0BAEjCC,IAAOA,CAAC;AAAA,EACZC,OAAAA;AAAAA,EACAC,OAAAA,IAAQ;AAAA,EACRC,UAAAA;AAKF,MAEK,gBAAAC,EAAA,cAAAC,GAAA,EACC,WAAU,OACV,OAAM,UACN,KAAI,OACJ,IAAG,KACH,QAAO,KACP,IAAG,aACH,SAAQ,QACR,QAAO,MACP,aAAY,SAEZ,GAAA,gBAAAD,EAAA,cAACE,KAAK,IAAG,QAAO,MAAK,KAAI,OAAAJ,GAAc,QAAO,YAC3CD,CACH,GACCE,CACH,GAIEI,IAAmBA,CACvBC,MACkB;AACdC,MAAAA,EAAmBD,CAAK;AACnB,WAAA;AAAA,MACLN,OAAO;AAAA,MACPD,OAAO;AAAA,MACPS,aAAa;AAAA,IACf;AAGI,QAAA;AAA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