@knocklabs/react 0.11.4 → 0.11.5
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 +16 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js.map +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/DragHandle.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/DragHandle.js.map +1 -0
- 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/GuideHoverCard.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/GuideHoverCard.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/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/useDraggable.js +2 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/useDraggable.js.map +1 -0
- package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js +1 -1
- package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js.map +1 -1
- package/dist/esm/index.mjs +98 -97
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs +14 -8
- package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/DragHandle.mjs +20 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/DragHandle.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs +26 -11
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideHoverCard.mjs +46 -16
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideHoverCard.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs +48 -30
- package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs +53 -36
- package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs.map +1 -1
- package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs +74 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs.map +1 -0
- package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs +73 -88
- package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/KnockButton.d.ts +2 -1
- package/dist/types/modules/guide/components/Toolbar/KnockButton.d.ts.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/V2/DragHandle.d.ts +9 -0
- package/dist/types/modules/guide/components/Toolbar/V2/DragHandle.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V2/GuideContextDetails.d.ts.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/V2/GuideHoverCard.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/V2.d.ts.map +1 -1
- package/dist/types/modules/guide/components/Toolbar/V2/useDraggable.d.ts +26 -0
- package/dist/types/modules/guide/components/Toolbar/V2/useDraggable.d.ts.map +1 -0
- package/dist/types/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.d.ts.map +1 -1
- package/package.json +4 -3
package/dist/esm/index.mjs
CHANGED
|
@@ -1,117 +1,118 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { Button as
|
|
4
|
-
import { ButtonGroup as
|
|
5
|
-
import { BellIcon as
|
|
6
|
-
import { CheckmarkCircle as
|
|
7
|
-
import { ChevronDown as
|
|
8
|
-
import { CloseCircle as
|
|
9
|
-
import { Spinner as
|
|
10
|
-
import { default as
|
|
11
|
-
import { EmptyFeed as
|
|
12
|
-
import { NotificationCell as
|
|
13
|
-
import { Avatar as
|
|
14
|
-
import { NotificationFeed as
|
|
15
|
-
import { NotificationFeedHeader as
|
|
16
|
-
import { MarkAsRead as
|
|
17
|
-
import { NotificationFeedContainer as
|
|
18
|
-
import { NotificationFeedPopover as
|
|
19
|
-
import { NotificationIconButton as
|
|
20
|
-
import { UnseenBadge as
|
|
21
|
-
import { Banner as
|
|
22
|
-
import { Card as
|
|
3
|
+
import { Button as x } from "./modules/core/components/Button/Button.mjs";
|
|
4
|
+
import { ButtonGroup as k } from "./modules/core/components/Button/ButtonGroup.mjs";
|
|
5
|
+
import { BellIcon as h } from "./modules/core/components/Icons/Bell.mjs";
|
|
6
|
+
import { CheckmarkCircle as T } from "./modules/core/components/Icons/CheckmarkCircle.mjs";
|
|
7
|
+
import { ChevronDown as v } from "./modules/core/components/Icons/ChevronDown.mjs";
|
|
8
|
+
import { CloseCircle as P } from "./modules/core/components/Icons/CloseCircle.mjs";
|
|
9
|
+
import { Spinner as F } from "./modules/core/components/Spinner/Spinner.mjs";
|
|
10
|
+
import { default as b } from "./modules/core/hooks/useOnBottomScroll.mjs";
|
|
11
|
+
import { EmptyFeed as g } from "./modules/feed/components/EmptyFeed/EmptyFeed.mjs";
|
|
12
|
+
import { NotificationCell as y } from "./modules/feed/components/NotificationCell/NotificationCell.mjs";
|
|
13
|
+
import { Avatar as O } from "./modules/feed/components/NotificationCell/Avatar.mjs";
|
|
14
|
+
import { NotificationFeed as D } from "./modules/feed/components/NotificationFeed/NotificationFeed.mjs";
|
|
15
|
+
import { NotificationFeedHeader as H } from "./modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs";
|
|
16
|
+
import { MarkAsRead as R } from "./modules/feed/components/NotificationFeed/MarkAsRead.mjs";
|
|
17
|
+
import { NotificationFeedContainer as j } from "./modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.mjs";
|
|
18
|
+
import { NotificationFeedPopover as z } from "./modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs";
|
|
19
|
+
import { NotificationIconButton as Q } from "./modules/feed/components/NotificationIconButton/NotificationIconButton.mjs";
|
|
20
|
+
import { UnseenBadge as X } from "./modules/feed/components/UnseenBadge/UnseenBadge.mjs";
|
|
21
|
+
import { Banner as Z, BannerView as _ } from "./modules/guide/components/Banner/Banner.mjs";
|
|
22
|
+
import { Card as ee, CardView as oe } from "./modules/guide/components/Card/Card.mjs";
|
|
23
23
|
import "react";
|
|
24
|
-
import { FilterStatus as
|
|
24
|
+
import { FilterStatus as re, I18nContext as ne, KnockFeedProvider as ie, KnockGuideContext as ae, KnockI18nProvider as se, KnockMsTeamsProvider as me, KnockProvider as ue, KnockSlackProvider as pe, feedProviderKey as ce, formatBadgeCount as fe, formatTimestamp as le, getBadgeAriaLabel as de, locales as xe, msTeamsProviderKey as Ce, renderNodeOrFallback as ke, slackProviderKey as Se, toSentenceCase as he, useAuthenticatedKnockClient as Ke, useConnectedMsTeamsChannels as Te, useConnectedSlackChannels as Me, useCreateNotificationStore as ve, useFeedSettings as Be, useGuide as Pe, useGuideContext as Ae, useGuides as Fe, useKnockClient as Ne, useKnockFeed as be, useKnockMsTeamsClient as Ge, useKnockSlackClient as ge, useMsTeamsAuth as we, useMsTeamsChannels as ye, useMsTeamsConnectionStatus as Ie, useMsTeamsTeams as Oe, useNotificationStore as Ve, useNotifications as De, usePreferences as Ee, useSlackAuth as He, useSlackChannels as Le, useSlackConnectionStatus as Re, useStableOptions as Ue, useTranslations as je } from "@knocklabs/react-core";
|
|
25
25
|
import "@telegraph/button";
|
|
26
26
|
import "@telegraph/layout";
|
|
27
27
|
import "@telegraph/tag";
|
|
28
28
|
import "@telegraph/typography";
|
|
29
29
|
import "lucide-react";
|
|
30
30
|
/* empty css */
|
|
31
|
+
import "@telegraph/icon";
|
|
31
32
|
import "@telegraph/tooltip";
|
|
32
33
|
import "@radix-ui/react-hover-card";
|
|
33
34
|
import "@knocklabs/client";
|
|
34
35
|
import "@telegraph/select";
|
|
35
|
-
import { Modal as
|
|
36
|
-
import { KnockGuideProvider as
|
|
37
|
-
import { MsTeamsAuthButton as
|
|
38
|
-
import { MsTeamsAuthContainer as
|
|
39
|
-
import { default as
|
|
40
|
-
import { SlackAuthButton as
|
|
41
|
-
import { SlackAuthContainer as
|
|
36
|
+
import { Modal as ze, ModalView as Je } from "./modules/guide/components/Modal/Modal.mjs";
|
|
37
|
+
import { KnockGuideProvider as We } from "./modules/guide/providers/KnockGuideProvider.mjs";
|
|
38
|
+
import { MsTeamsAuthButton as Ye } from "./modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs";
|
|
39
|
+
import { MsTeamsAuthContainer as _e } from "./modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs";
|
|
40
|
+
import { default as eo } from "./modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.mjs";
|
|
41
|
+
import { SlackAuthButton as to } from "./modules/slack/components/SlackAuthButton/SlackAuthButton.mjs";
|
|
42
|
+
import { SlackAuthContainer as no } from "./modules/slack/components/SlackAuthContainer/SlackAuthContainer.mjs";
|
|
42
43
|
import { SlackChannelCombobox as ao } from "./modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.mjs";
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
O as Avatar,
|
|
46
|
+
Z as Banner,
|
|
47
|
+
_ as BannerView,
|
|
48
|
+
h as BellIcon,
|
|
49
|
+
x as Button,
|
|
50
|
+
k as ButtonGroup,
|
|
51
|
+
ee as Card,
|
|
52
|
+
oe as CardView,
|
|
53
|
+
T as CheckmarkCircle,
|
|
54
|
+
v as ChevronDown,
|
|
55
|
+
P as CloseCircle,
|
|
56
|
+
g as EmptyFeed,
|
|
57
|
+
re as FilterStatus,
|
|
58
|
+
ne as I18nContext,
|
|
59
|
+
ie as KnockFeedProvider,
|
|
59
60
|
ae as KnockGuideContext,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
61
|
+
We as KnockGuideProvider,
|
|
62
|
+
se as KnockI18nProvider,
|
|
63
|
+
me as KnockMsTeamsProvider,
|
|
64
|
+
ue as KnockProvider,
|
|
65
|
+
pe as KnockSlackProvider,
|
|
66
|
+
R as MarkAsRead,
|
|
67
|
+
ze as Modal,
|
|
68
|
+
Je as ModalView,
|
|
69
|
+
Ye as MsTeamsAuthButton,
|
|
70
|
+
_e as MsTeamsAuthContainer,
|
|
71
|
+
eo as MsTeamsChannelCombobox,
|
|
72
|
+
y as NotificationCell,
|
|
73
|
+
D as NotificationFeed,
|
|
74
|
+
j as NotificationFeedContainer,
|
|
75
|
+
H as NotificationFeedHeader,
|
|
76
|
+
z as NotificationFeedPopover,
|
|
77
|
+
Q as NotificationIconButton,
|
|
78
|
+
to as SlackAuthButton,
|
|
79
|
+
no as SlackAuthContainer,
|
|
79
80
|
ao as SlackChannelCombobox,
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
F as Spinner,
|
|
82
|
+
X as UnseenBadge,
|
|
82
83
|
ce as feedProviderKey,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
84
|
+
fe as formatBadgeCount,
|
|
85
|
+
le as formatTimestamp,
|
|
86
|
+
de as getBadgeAriaLabel,
|
|
87
|
+
xe as locales,
|
|
88
|
+
Ce as msTeamsProviderKey,
|
|
89
|
+
ke as renderNodeOrFallback,
|
|
90
|
+
Se as slackProviderKey,
|
|
91
|
+
he as toSentenceCase,
|
|
92
|
+
Ke as useAuthenticatedKnockClient,
|
|
93
|
+
Te as useConnectedMsTeamsChannels,
|
|
94
|
+
Me as useConnectedSlackChannels,
|
|
95
|
+
ve as useCreateNotificationStore,
|
|
96
|
+
Be as useFeedSettings,
|
|
97
|
+
Pe as useGuide,
|
|
98
|
+
Ae as useGuideContext,
|
|
99
|
+
Fe as useGuides,
|
|
100
|
+
Ne as useKnockClient,
|
|
101
|
+
be as useKnockFeed,
|
|
102
|
+
Ge as useKnockMsTeamsClient,
|
|
103
|
+
ge as useKnockSlackClient,
|
|
104
|
+
we as useMsTeamsAuth,
|
|
105
|
+
ye as useMsTeamsChannels,
|
|
106
|
+
Ie as useMsTeamsConnectionStatus,
|
|
107
|
+
Oe as useMsTeamsTeams,
|
|
108
|
+
Ve as useNotificationStore,
|
|
109
|
+
De as useNotifications,
|
|
110
|
+
b as useOnBottomScroll,
|
|
111
|
+
Ee as usePreferences,
|
|
112
|
+
He as useSlackAuth,
|
|
113
|
+
Le as useSlackChannels,
|
|
114
|
+
Re as useSlackConnectionStatus,
|
|
115
|
+
Ue as useStableOptions,
|
|
116
|
+
je as useTranslations
|
|
116
117
|
};
|
|
117
118
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import t from "react";
|
|
2
|
-
import { Button as
|
|
3
|
-
import { TOOLBAR_Z_INDEX as
|
|
2
|
+
import { Button as a } from "@telegraph/button";
|
|
3
|
+
import { TOOLBAR_Z_INDEX as r } from "./shared.mjs";
|
|
4
4
|
/* empty css */
|
|
5
|
-
const
|
|
6
|
-
onClick: e
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const s = ({
|
|
6
|
+
onClick: e,
|
|
7
|
+
positioned: o = !0
|
|
8
|
+
}) => /* @__PURE__ */ t.createElement(a, { onClick: e, ...o && {
|
|
9
|
+
position: "fixed",
|
|
10
|
+
top: "4",
|
|
11
|
+
right: "4",
|
|
12
|
+
style: {
|
|
13
|
+
zIndex: r
|
|
14
|
+
}
|
|
15
|
+
}, bg: "surface-2", shadow: "3", rounded: "3", w: "10", h: "10", variant: "soft", "data-tgph-appearance": "dark", "aria-label": "Expand guide toolbar" }, /* @__PURE__ */ t.createElement("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: {
|
|
10
16
|
position: "absolute",
|
|
11
17
|
top: "50%",
|
|
12
18
|
left: "50%",
|
|
13
19
|
transform: "translate(-50%, -50%)"
|
|
14
20
|
} }, /* @__PURE__ */ t.createElement("path", { d: "M11.6001 32.4V7.59998H16.6365V21.8219H16.7774L22.3067 14.8525H27.9418L21.8138 22.0696L28.4001 32.4H22.7996L18.8555 25.572L16.6365 28.0839V32.4H11.6001Z", fill: "#EDEEEF" }), /* @__PURE__ */ t.createElement("path", { d: "M28.4 10.4C28.4 11.9464 27.1467 13.2 25.6 13.2C24.0534 13.2 22.8 11.9464 22.8 10.4C22.8 8.85358 24.0534 7.59998 25.6 7.59998C27.1467 7.59998 28.4 8.85358 28.4 10.4Z", fill: "#FF573A" })));
|
|
15
21
|
export {
|
|
16
|
-
|
|
22
|
+
s as KnockButton
|
|
17
23
|
};
|
|
18
24
|
//# sourceMappingURL=KnockButton.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnockButton.mjs","sources":["../../../../../../src/modules/guide/components/Toolbar/KnockButton.tsx"],"sourcesContent":["import { Button } from \"@telegraph/button\";\n\nimport { TOOLBAR_Z_INDEX } from \"./shared\";\nimport \"./styles.css\";\n\ntype Props = {\n onClick: () => void;\n};\n\nexport const KnockButton = ({ onClick }: Props) => {\n return (\n <Button\n onClick={onClick}\n position
|
|
1
|
+
{"version":3,"file":"KnockButton.mjs","sources":["../../../../../../src/modules/guide/components/Toolbar/KnockButton.tsx"],"sourcesContent":["import { Button } from \"@telegraph/button\";\n\nimport { TOOLBAR_Z_INDEX } from \"./shared\";\nimport \"./styles.css\";\n\ntype Props = {\n onClick: () => void;\n positioned?: boolean;\n};\n\nexport const KnockButton = ({ onClick, positioned = true }: Props) => {\n return (\n <Button\n onClick={onClick}\n {...(positioned && {\n position: \"fixed\" as const,\n top: \"4\" as const,\n right: \"4\" as const,\n style: { zIndex: TOOLBAR_Z_INDEX },\n })}\n bg=\"surface-2\"\n shadow=\"3\"\n rounded=\"3\"\n w=\"10\"\n h=\"10\"\n variant=\"soft\"\n data-tgph-appearance=\"dark\"\n aria-label=\"Expand guide toolbar\"\n >\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={{\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n }}\n >\n <path\n d=\"M11.6001 32.4V7.59998H16.6365V21.8219H16.7774L22.3067 14.8525H27.9418L21.8138 22.0696L28.4001 32.4H22.7996L18.8555 25.572L16.6365 28.0839V32.4H11.6001Z\"\n fill=\"#EDEEEF\"\n />\n <path\n d=\"M28.4 10.4C28.4 11.9464 27.1467 13.2 25.6 13.2C24.0534 13.2 22.8 11.9464 22.8 10.4C22.8 8.85358 24.0534 7.59998 25.6 7.59998C27.1467 7.59998 28.4 8.85358 28.4 10.4Z\"\n fill=\"#FF573A\"\n />\n </svg>\n </Button>\n );\n};\n"],"names":["KnockButton","onClick","positioned","React","Button","position","top","right","style","zIndex","TOOLBAR_Z_INDEX","left","transform"],"mappings":";;;;AAUO,MAAMA,IAAcA,CAAC;AAAA,EAAEC,SAAAA;AAAAA,EAASC,YAAAA,IAAa;AAAY,MAE3DC,gBAAAA,EAAA,cAAAC,GAAA,EACC,SAAAH,GACKC,GAAAA,KAAc;AAAA,EACjBG,UAAU;AAAA,EACVC,KAAK;AAAA,EACLC,OAAO;AAAA,EACPC,OAAO;AAAA,IAAEC,QAAQC;AAAAA,EAAAA;AAAgB,GAEnC,IAAG,aACH,QAAO,KACP,SAAQ,KACR,GAAE,MACF,GAAE,MACF,SAAQ,QACR,wBAAqB,QACrB,cAAW,uBAEX,GAAAP,gBAAAA,EAAA,cAAC,OACC,EAAA,OAAM,MACN,QAAO,MACP,SAAQ,aACR,MAAK,QACL,OAAM,8BACN,OAAO;AAAA,EACLE,UAAU;AAAA,EACVC,KAAK;AAAA,EACLK,MAAM;AAAA,EACNC,WAAW;AAAA,KAGbT,gBAAAA,EAAA,cAAC,QACC,EAAA,GAAE,2JACF,MAAK,UAAS,CAAA,GAEhBA,gBAAAA,EAAA,cAAC,UACC,GAAE,wKACF,MAAK,UAAS,CAAA,CAElB,CACF;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Icon as o } from "@telegraph/icon";
|
|
2
|
+
import { Box as a } from "@telegraph/layout";
|
|
3
|
+
import { GripVertical as i } from "lucide-react";
|
|
4
|
+
import r from "react";
|
|
5
|
+
const n = 16, s = ({
|
|
6
|
+
onPointerDown: e,
|
|
7
|
+
isDragging: t
|
|
8
|
+
}) => /* @__PURE__ */ r.createElement(a, { "data-tgph-appearance": "dark", onPointerDown: e, borderRadius: "2", position: "absolute", style: {
|
|
9
|
+
top: "9px",
|
|
10
|
+
right: `-${n}px`,
|
|
11
|
+
height: "24px",
|
|
12
|
+
cursor: t ? "grabbing" : "grab",
|
|
13
|
+
touchAction: "none",
|
|
14
|
+
userSelect: "none"
|
|
15
|
+
} }, /* @__PURE__ */ r.createElement(o, { color: "gray", size: "1", icon: i, "aria-hidden": !0 }));
|
|
16
|
+
export {
|
|
17
|
+
n as DRAG_HANDLE_OVERHANG,
|
|
18
|
+
s as DragHandle
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=DragHandle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DragHandle.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/DragHandle.tsx"],"sourcesContent":["import { Icon } from \"@telegraph/icon\";\nimport { Box } from \"@telegraph/layout\";\nimport { GripVertical } from \"lucide-react\";\nimport React from \"react\";\n\n// How far the drag handle protrudes beyond the toolbar's right edge (px)\nexport const DRAG_HANDLE_OVERHANG = 16;\n\ntype DragHandleProps = {\n onPointerDown: (e: React.PointerEvent) => void;\n isDragging: boolean;\n};\n\nexport const DragHandle = ({ onPointerDown, isDragging }: DragHandleProps) => {\n return (\n <Box\n data-tgph-appearance=\"dark\"\n onPointerDown={onPointerDown}\n borderRadius=\"2\"\n position=\"absolute\"\n style={{\n top: \"9px\",\n right: `-${DRAG_HANDLE_OVERHANG}px`,\n height: \"24px\",\n cursor: isDragging ? \"grabbing\" : \"grab\",\n touchAction: \"none\",\n userSelect: \"none\",\n }}\n >\n <Icon color=\"gray\" size=\"1\" icon={GripVertical} aria-hidden />\n </Box>\n );\n};\n"],"names":["DRAG_HANDLE_OVERHANG","DragHandle","onPointerDown","isDragging","React","Box","top","right","height","cursor","touchAction","userSelect","Icon","GripVertical"],"mappings":";;;;AAMO,MAAMA,IAAuB,IAOvBC,IAAaA,CAAC;AAAA,EAAEC,eAAAA;AAAAA,EAAeC,YAAAA;AAA4B,MAEpEC,gBAAAA,EAAA,cAACC,KACC,wBAAqB,QACrB,eAAAH,GACA,cAAa,KACb,UAAS,YACT,OAAO;AAAA,EACLI,KAAK;AAAA,EACLC,OAAO,IAAIP,CAAoB;AAAA,EAC/BQ,QAAQ;AAAA,EACRC,QAAQN,IAAa,aAAa;AAAA,EAClCO,aAAa;AAAA,EACbC,YAAY;AACd,EAAA,GAECP,gBAAAA,EAAA,cAAAQ,GAAA,EAAK,OAAM,QAAO,MAAK,KAAI,MAAMC,GAAc,eAAW,GAAA,CAAA,CAC7D;"}
|
|
@@ -1,27 +1,42 @@
|
|
|
1
|
-
import { useGuideContext as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useGuideContext as E, useStore as y } from "@knocklabs/react-core";
|
|
2
|
+
import { Button as s } from "@telegraph/button";
|
|
3
|
+
import { Icon as m } from "@telegraph/icon";
|
|
4
|
+
import { Stack as t, Box as g } from "@telegraph/layout";
|
|
5
|
+
import { Tooltip as p } from "@telegraph/tooltip";
|
|
6
|
+
import { Text as n } from "@telegraph/typography";
|
|
7
|
+
import { ChevronDown as f, ChevronRight as x, Info as d } from "lucide-react";
|
|
5
8
|
import * as e from "react";
|
|
6
|
-
const
|
|
9
|
+
const C = () => {
|
|
7
10
|
const {
|
|
8
11
|
client: a
|
|
9
|
-
} =
|
|
10
|
-
|
|
12
|
+
} = E(), [l, u] = e.useState(!1), {
|
|
13
|
+
defaultGroup: o,
|
|
14
|
+
debugSettings: r
|
|
15
|
+
} = y(a.store, (i) => ({
|
|
16
|
+
defaultGroup: i.guideGroups[0],
|
|
17
|
+
debugSettings: i.debug || {}
|
|
18
|
+
})), c = (o == null ? void 0 : o.display_interval) ?? null;
|
|
19
|
+
return /* @__PURE__ */ e.createElement(t, { direction: "column", borderTop: "px" }, /* @__PURE__ */ e.createElement(t, { h: "5", px: "2", bg: "gray-3", align: "center", gap: "1", style: {
|
|
11
20
|
cursor: "pointer"
|
|
12
|
-
}, onClick: () =>
|
|
21
|
+
}, onClick: () => u((i) => !i) }, /* @__PURE__ */ e.createElement(n, { as: "span", size: "0", weight: "medium" }, "More"), l ? /* @__PURE__ */ e.createElement(f, { size: 12 }) : /* @__PURE__ */ e.createElement(x, { size: 12 })), l && /* @__PURE__ */ e.createElement(t, { direction: "column" }, /* @__PURE__ */ e.createElement(t, { align: "center", justify: "space-between", py: "1", px: "2", borderTop: "px" }, /* @__PURE__ */ e.createElement(t, { align: "center", gap: "1" }, /* @__PURE__ */ e.createElement(n, { as: "span", size: "0", weight: "medium" }, "Client-only engagement"), /* @__PURE__ */ e.createElement(p, { label: "Contain engagement actions to the client side only while in preview without sending engagement events to the API" }, /* @__PURE__ */ e.createElement(m, { icon: d, size: "0", color: "gray", "aria-hidden": !0 }))), /* @__PURE__ */ e.createElement(s, { size: "0", variant: "soft", color: r.skipEngagementTracking ? "green" : "gray", onClick: () => a.setDebug({
|
|
22
|
+
...r,
|
|
23
|
+
skipEngagementTracking: !r.skipEngagementTracking
|
|
24
|
+
}) }, r.skipEngagementTracking ? "On" : "Off")), /* @__PURE__ */ e.createElement(t, { direction: "column", py: "1", px: "2" }, /* @__PURE__ */ e.createElement(t, { align: "center", justify: "space-between" }, /* @__PURE__ */ e.createElement(t, { align: "center", gap: "1" }, /* @__PURE__ */ e.createElement(n, { as: "span", size: "0", weight: "medium" }, "Suspend throttling"), /* @__PURE__ */ e.createElement(p, { label: "Suspend throttling during preview, and show next guide immediately" }, /* @__PURE__ */ e.createElement(m, { icon: d, size: "0", color: "gray", "aria-hidden": !0 }))), /* @__PURE__ */ e.createElement(s, { size: "0", variant: "soft", color: r.ignoreDisplayInterval ? "green" : "gray", onClick: () => a.setDebug({
|
|
25
|
+
...r,
|
|
26
|
+
ignoreDisplayInterval: !r.ignoreDisplayInterval
|
|
27
|
+
}) }, r.ignoreDisplayInterval ? "On" : "Off")), /* @__PURE__ */ e.createElement(t, { direction: "row", gap: "0_5", py: "1" }, /* @__PURE__ */ e.createElement(n, { as: "span", size: "0", color: "gray" }, "Throttle:", " ", r.ignoreDisplayInterval ? "(ignored)" : c === null ? "(none)" : `Every ${c}s`))), /* @__PURE__ */ e.createElement(t, { direction: "column", py: "1", px: "2", borderTop: "px" }, /* @__PURE__ */ e.createElement(n, { as: "span", size: "0", weight: "medium" }, "Target params"), /* @__PURE__ */ e.createElement(t, { direction: "column", gap: "0_5", mt: "1" }, /* @__PURE__ */ e.createElement(n, { as: "span", size: "0", color: "gray" }, "Tenant"), /* @__PURE__ */ e.createElement(n, { as: "code", size: "0" }, a.targetParams.tenant ? /* @__PURE__ */ e.createElement(g, { rounded: "2", overflow: "auto", backgroundColor: "gray-2", border: "px", style: {
|
|
13
28
|
maxHeight: "200px"
|
|
14
29
|
} }, /* @__PURE__ */ e.createElement("pre", { style: {
|
|
15
30
|
fontSize: "11px",
|
|
16
31
|
margin: 0
|
|
17
|
-
} }, /* @__PURE__ */ e.createElement("code", null, a.targetParams.tenant))) : /* @__PURE__ */ e.createElement(
|
|
32
|
+
} }, /* @__PURE__ */ e.createElement("code", null, a.targetParams.tenant))) : /* @__PURE__ */ e.createElement(n, { as: "code", size: "0" }, "-"))), /* @__PURE__ */ e.createElement(t, { direction: "column", gap: "0_5" }, /* @__PURE__ */ e.createElement(n, { as: "span", size: "0", color: "gray" }, "Data"), a.targetParams.data ? /* @__PURE__ */ e.createElement(g, { rounded: "2", overflow: "auto", backgroundColor: "gray-2", border: "px", style: {
|
|
18
33
|
maxHeight: "200px"
|
|
19
34
|
} }, /* @__PURE__ */ e.createElement("pre", { style: {
|
|
20
35
|
fontSize: "11px",
|
|
21
36
|
margin: 0
|
|
22
|
-
} }, /* @__PURE__ */ e.createElement("code", null, JSON.stringify(a.targetParams.data, null, 2)))) : /* @__PURE__ */ e.createElement(
|
|
37
|
+
} }, /* @__PURE__ */ e.createElement("code", null, JSON.stringify(a.targetParams.data, null, 2)))) : /* @__PURE__ */ e.createElement(n, { as: "code", size: "0" }, "-")))));
|
|
23
38
|
};
|
|
24
39
|
export {
|
|
25
|
-
|
|
40
|
+
C as GuideContextDetails
|
|
26
41
|
};
|
|
27
42
|
//# 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 { Text } from \"@telegraph/typography\";\nimport { ChevronDown, ChevronRight } from \"lucide-react\";\nimport * as React from \"react\";\n\nexport const GuideContextDetails = () => {\n const { client } = useGuideContext();\n const [isExpanded, setIsExpanded] = React.useState(false);\n\n const defaultGroup = useStore(client.store, (state) => state.guideGroups[0]);\n const displayInterval = defaultGroup?.display_interval ?? null;\n\n return (\n <Stack direction=\"column\" borderTop=\"px\">\n <Stack\n h=\"5\"\n px=\"2\"\n bg=\"gray-3\"\n align=\"center\"\n gap=\"1\"\n style={{ cursor: \"pointer\" }}\n onClick={() => setIsExpanded((prev) => !prev)}\n >\n <Text as=\"span\" size=\"0\" weight=\"medium\">\n
|
|
1
|
+
{"version":3,"file":"GuideContextDetails.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideContextDetails.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 { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport { ChevronDown, ChevronRight, Info } from \"lucide-react\";\nimport * as React from \"react\";\n\nexport const GuideContextDetails = () => {\n const { client } = useGuideContext();\n const [isExpanded, setIsExpanded] = React.useState(false);\n\n const { defaultGroup, debugSettings } = useStore(client.store, (state) => {\n return {\n defaultGroup: state.guideGroups[0],\n debugSettings: state.debug || {},\n };\n });\n const displayInterval = defaultGroup?.display_interval ?? null;\n\n return (\n <Stack direction=\"column\" borderTop=\"px\">\n <Stack\n h=\"5\"\n px=\"2\"\n bg=\"gray-3\"\n align=\"center\"\n gap=\"1\"\n style={{ cursor: \"pointer\" }}\n onClick={() => setIsExpanded((prev) => !prev)}\n >\n <Text as=\"span\" size=\"0\" weight=\"medium\">\n More\n </Text>\n {isExpanded ? <ChevronDown size={12} /> : <ChevronRight size={12} />}\n </Stack>\n\n {isExpanded && (\n <Stack direction=\"column\">\n <Stack\n align=\"center\"\n justify=\"space-between\"\n py=\"1\"\n px=\"2\"\n borderTop=\"px\"\n >\n <Stack align=\"center\" gap=\"1\">\n <Text as=\"span\" size=\"0\" weight=\"medium\">\n Client-only engagement\n </Text>\n <Tooltip label=\"Contain engagement actions to the client side only while in preview without sending engagement events to the API\">\n <Icon icon={Info} size=\"0\" color=\"gray\" aria-hidden />\n </Tooltip>\n </Stack>\n <Button\n size=\"0\"\n variant=\"soft\"\n color={debugSettings.skipEngagementTracking ? \"green\" : \"gray\"}\n onClick={() =>\n client.setDebug({\n ...debugSettings,\n skipEngagementTracking: !debugSettings.skipEngagementTracking,\n })\n }\n >\n {debugSettings.skipEngagementTracking ? \"On\" : \"Off\"}\n </Button>\n </Stack>\n\n <Stack direction=\"column\" py=\"1\" px=\"2\">\n <Stack align=\"center\" justify=\"space-between\">\n <Stack align=\"center\" gap=\"1\">\n <Text as=\"span\" size=\"0\" weight=\"medium\">\n Suspend throttling\n </Text>\n <Tooltip label=\"Suspend throttling during preview, and show next guide immediately\">\n <Icon icon={Info} size=\"0\" color=\"gray\" aria-hidden />\n </Tooltip>\n </Stack>\n <Button\n size=\"0\"\n variant=\"soft\"\n color={debugSettings.ignoreDisplayInterval ? \"green\" : \"gray\"}\n onClick={() =>\n client.setDebug({\n ...debugSettings,\n ignoreDisplayInterval: !debugSettings.ignoreDisplayInterval,\n })\n }\n >\n {debugSettings.ignoreDisplayInterval ? \"On\" : \"Off\"}\n </Button>\n </Stack>\n <Stack direction=\"row\" gap=\"0_5\" py=\"1\">\n <Text as=\"span\" size=\"0\" color=\"gray\">\n Throttle:{\" \"}\n {debugSettings.ignoreDisplayInterval\n ? \"(ignored)\"\n : displayInterval === null\n ? \"(none)\"\n : `Every ${displayInterval}s`}\n </Text>\n </Stack>\n </Stack>\n\n <Stack direction=\"column\" py=\"1\" px=\"2\" borderTop=\"px\">\n <Text as=\"span\" size=\"0\" weight=\"medium\">\n Target params\n </Text>\n <Stack direction=\"column\" gap=\"0_5\" mt=\"1\">\n <Text as=\"span\" size=\"0\" color=\"gray\">\n Tenant\n </Text>\n <Text as=\"code\" size=\"0\">\n {client.targetParams.tenant ? (\n <Box\n rounded=\"2\"\n overflow=\"auto\"\n backgroundColor=\"gray-2\"\n border=\"px\"\n style={{ maxHeight: \"200px\" }}\n >\n <pre style={{ fontSize: \"11px\", margin: 0 }}>\n <code>{client.targetParams.tenant}</code>\n </pre>\n </Box>\n ) : (\n <Text as=\"code\" size=\"0\">\n -\n </Text>\n )}\n </Text>\n </Stack>\n\n <Stack direction=\"column\" gap=\"0_5\">\n <Text as=\"span\" size=\"0\" color=\"gray\">\n Data\n </Text>\n {client.targetParams.data ? (\n <Box\n rounded=\"2\"\n overflow=\"auto\"\n backgroundColor=\"gray-2\"\n border=\"px\"\n style={{ maxHeight: \"200px\" }}\n >\n <pre style={{ fontSize: \"11px\", margin: 0 }}>\n <code>\n {JSON.stringify(client.targetParams.data, null, 2)}\n </code>\n </pre>\n </Box>\n ) : (\n <Text as=\"code\" size=\"0\">\n -\n </Text>\n )}\n </Stack>\n </Stack>\n </Stack>\n )}\n </Stack>\n );\n};\n"],"names":["GuideContextDetails","client","useGuideContext","isExpanded","setIsExpanded","React","useState","defaultGroup","debugSettings","useStore","store","state","guideGroups","debug","displayInterval","display_interval","Stack","cursor","prev","Text","ChevronDown","ChevronRight","Tooltip","Icon","Info","Button","skipEngagementTracking","setDebug","ignoreDisplayInterval","targetParams","tenant","Box","maxHeight","fontSize","margin","data","JSON","stringify"],"mappings":";;;;;;;;AASO,MAAMA,IAAsBA,MAAM;AACjC,QAAA;AAAA,IAAEC,QAAAA;AAAAA,MAAWC,EAAgB,GAC7B,CAACC,GAAYC,CAAa,IAAIC,EAAMC,SAAS,EAAK,GAElD;AAAA,IAAEC,cAAAA;AAAAA,IAAcC,eAAAA;AAAAA,EAAkBC,IAAAA,EAASR,EAAOS,OAAQC,CAAUA,OACjE;AAAA,IACLJ,cAAcI,EAAMC,YAAY,CAAC;AAAA,IACjCJ,eAAeG,EAAME,SAAS,CAAA;AAAA,EAChC,EACD,GACKC,KAAkBP,KAAAA,gBAAAA,EAAcQ,qBAAoB;AAE1D,yCACGC,GAAM,EAAA,WAAU,UAAS,WAAU,KAAA,mCACjCA,GACC,EAAA,GAAE,KACF,IAAG,KACH,IAAG,UACH,OAAM,UACN,KAAI,KACJ,OAAO;AAAA,IAAEC,QAAQ;AAAA,EAAU,GAC3B,SAAS,MAAMb,EAAec,OAAS,CAACA,CAAI,KAE3C,gBAAAb,EAAA,cAAAc,GAAA,EAAK,IAAG,QAAO,MAAK,KAAI,QAAO,YAAQ,MAExC,GACChB,oCAAciB,GAAY,EAAA,MAAM,GAAM,CAAA,IAAG,gBAAAf,EAAA,cAACgB,KAAa,MAAM,GAAM,CAAA,CACtE,GAEClB,qCACEa,GAAM,EAAA,WAAU,YACd,gBAAAX,EAAA,cAAAW,GAAA,EACC,OAAM,UACN,SAAQ,iBACR,IAAG,KACH,IAAG,KACH,WAAU,KAAA,mCAETA,GAAM,EAA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A3B,EAAA,cAAA,OAAA,EAAI,OAAO;AAAA,IAAE4B,UAAU;AAAA,IAAQC,QAAQ;AAAA,EAAE,EAAA,GACvC,gBAAA7B,EAAA,cAAA,QAAA,MACE+B,KAAKC,UAAUpC,EAAO4B,aAAaM,MAAM,MAAM,CAAC,CACnD,CACF,CACF,IAEA,gBAAA9B,EAAA,cAACc,GAAK,EAAA,IAAG,QAAO,MAAK,OAAG,GAExB,CAEJ,CACF,CACF,CAEJ;AAEJ;"}
|
|
@@ -1,27 +1,57 @@
|
|
|
1
1
|
import * as t from "@radix-ui/react-hover-card";
|
|
2
|
-
import {
|
|
2
|
+
import { Button as a } from "@telegraph/button";
|
|
3
|
+
import { Stack as o, Box as i } from "@telegraph/layout";
|
|
4
|
+
import { RotateCcw as c, ExternalLink as m } from "lucide-react";
|
|
3
5
|
import * as e from "react";
|
|
4
|
-
import { isUnknownGuide as
|
|
5
|
-
const
|
|
6
|
-
children:
|
|
7
|
-
guide:
|
|
6
|
+
import { isUnknownGuide as s } from "./useInspectGuideClientStore.mjs";
|
|
7
|
+
const v = ({
|
|
8
|
+
children: n,
|
|
9
|
+
guide: r
|
|
8
10
|
}) => {
|
|
9
|
-
if (
|
|
10
|
-
return /* @__PURE__ */ e.createElement(
|
|
11
|
+
if (s(r))
|
|
12
|
+
return /* @__PURE__ */ e.createElement(o, { align: "center" }, n);
|
|
11
13
|
const {
|
|
12
|
-
annotation:
|
|
13
|
-
activation_location_rules:
|
|
14
|
-
priority:
|
|
15
|
-
...
|
|
16
|
-
} =
|
|
17
|
-
return /* @__PURE__ */ e.createElement(t.Root, null, /* @__PURE__ */ e.createElement(t.Trigger, null, /* @__PURE__ */ e.createElement(
|
|
14
|
+
annotation: d,
|
|
15
|
+
activation_location_rules: f,
|
|
16
|
+
priority: u,
|
|
17
|
+
...l
|
|
18
|
+
} = r;
|
|
19
|
+
return /* @__PURE__ */ e.createElement(t.Root, null, /* @__PURE__ */ e.createElement(t.Trigger, null, /* @__PURE__ */ e.createElement(o, { align: "center" }, n)), /* @__PURE__ */ e.createElement(t.Portal, null, /* @__PURE__ */ e.createElement(t.Content, { sideOffset: 16, side: "left" }, /* @__PURE__ */ e.createElement(i, { px: "2", shadow: "2", rounded: "3", border: "px", overflow: "auto", backgroundColor: "surface-2", style: {
|
|
18
20
|
width: "450px",
|
|
19
21
|
maxHeight: "600px"
|
|
20
|
-
} }, /* @__PURE__ */ e.createElement("
|
|
22
|
+
} }, /* @__PURE__ */ e.createElement(o, { justify: "flex-end", gap: "1", pt: "2" }, /* @__PURE__ */ e.createElement(
|
|
23
|
+
a,
|
|
24
|
+
{
|
|
25
|
+
size: "0",
|
|
26
|
+
variant: "soft",
|
|
27
|
+
color: "default",
|
|
28
|
+
leadingIcon: {
|
|
29
|
+
icon: c,
|
|
30
|
+
alt: "Reset engagement"
|
|
31
|
+
},
|
|
32
|
+
onClick: () => {
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"Reset engagement"
|
|
36
|
+
), /* @__PURE__ */ e.createElement(
|
|
37
|
+
a,
|
|
38
|
+
{
|
|
39
|
+
size: "0",
|
|
40
|
+
variant: "soft",
|
|
41
|
+
color: "default",
|
|
42
|
+
leadingIcon: {
|
|
43
|
+
icon: m,
|
|
44
|
+
alt: "Go to dashboard"
|
|
45
|
+
},
|
|
46
|
+
onClick: () => {
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"Go to dashboard"
|
|
50
|
+
)), /* @__PURE__ */ e.createElement("pre", { style: {
|
|
21
51
|
fontSize: "11px"
|
|
22
|
-
} }, /* @__PURE__ */ e.createElement("code", null, JSON.stringify(
|
|
52
|
+
} }, /* @__PURE__ */ e.createElement("code", null, JSON.stringify(l, null, 2)))), /* @__PURE__ */ e.createElement(t.Arrow, null))));
|
|
23
53
|
};
|
|
24
54
|
export {
|
|
25
|
-
|
|
55
|
+
v as GuideHoverCard
|
|
26
56
|
};
|
|
27
57
|
//# sourceMappingURL=GuideHoverCard.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuideHoverCard.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideHoverCard.tsx"],"sourcesContent":["import * as HoverCard from \"@radix-ui/react-hover-card\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport * as React from \"react\";\n\nimport {\n AnnotatedGuide,\n UnknownGuide,\n isUnknownGuide,\n} from \"./useInspectGuideClientStore\";\n\ntype Props = {\n guide: AnnotatedGuide | UnknownGuide;\n};\n\nexport const GuideHoverCard = ({\n children,\n guide,\n}: React.PropsWithChildren<Props>) => {\n if (isUnknownGuide(guide)) {\n return <Stack align=\"center\">{children}</Stack>;\n }\n\n // Prune out internal or legacy fields.\n const {\n annotation: _annotation,\n activation_location_rules: _activation_location_rules,\n priority: _priority,\n ...rest\n } = guide;\n\n return (\n <HoverCard.Root>\n <HoverCard.Trigger>\n <Stack align=\"center\">{children}</Stack>\n </HoverCard.Trigger>\n <HoverCard.Portal>\n <HoverCard.Content sideOffset={16} side=\"left\">\n <Box\n px=\"2\"\n shadow=\"2\"\n rounded=\"3\"\n border=\"px\"\n overflow=\"auto\"\n backgroundColor=\"surface-2\"\n style={{\n width: \"450px\",\n maxHeight: \"600px\",\n }}\n >\n <pre\n style={{\n fontSize: \"11px\",\n }}\n >\n <code>{JSON.stringify(rest, null, 2)}</code>\n </pre>\n </Box>\n <HoverCard.Arrow />\n </HoverCard.Content>\n </HoverCard.Portal>\n </HoverCard.Root>\n );\n};\n"],"names":["GuideHoverCard","children","guide","isUnknownGuide","React","Stack","annotation","_annotation","activation_location_rules","_activation_location_rules","priority","_priority","rest","HoverCard","Box","width","maxHeight","fontSize","JSON","stringify"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GuideHoverCard.mjs","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideHoverCard.tsx"],"sourcesContent":["import * as HoverCard from \"@radix-ui/react-hover-card\";\nimport { Button } from \"@telegraph/button\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { ExternalLink, RotateCcw } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport {\n AnnotatedGuide,\n UnknownGuide,\n isUnknownGuide,\n} from \"./useInspectGuideClientStore\";\n\ntype Props = {\n guide: AnnotatedGuide | UnknownGuide;\n};\n\nexport const GuideHoverCard = ({\n children,\n guide,\n}: React.PropsWithChildren<Props>) => {\n if (isUnknownGuide(guide)) {\n return <Stack align=\"center\">{children}</Stack>;\n }\n\n // Prune out internal or legacy fields.\n const {\n annotation: _annotation,\n activation_location_rules: _activation_location_rules,\n priority: _priority,\n ...rest\n } = guide;\n\n return (\n <HoverCard.Root>\n <HoverCard.Trigger>\n <Stack align=\"center\">{children}</Stack>\n </HoverCard.Trigger>\n <HoverCard.Portal>\n <HoverCard.Content sideOffset={16} side=\"left\">\n <Box\n px=\"2\"\n shadow=\"2\"\n rounded=\"3\"\n border=\"px\"\n overflow=\"auto\"\n backgroundColor=\"surface-2\"\n style={{\n width: \"450px\",\n maxHeight: \"600px\",\n }}\n >\n <Stack justify=\"flex-end\" gap=\"1\" pt=\"2\">\n <Button\n size=\"0\"\n variant=\"soft\"\n color=\"default\"\n leadingIcon={{ icon: RotateCcw, alt: \"Reset engagement\" }}\n // TODO(KNO-11468): Placeholder button\n onClick={() => {}}\n >\n Reset engagement\n </Button>\n <Button\n size=\"0\"\n variant=\"soft\"\n color=\"default\"\n leadingIcon={{ icon: ExternalLink, alt: \"Go to dashboard\" }}\n // TODO(KNO-11819): Placeholder button\n onClick={() => {}}\n >\n Go to dashboard\n </Button>\n </Stack>\n <pre\n style={{\n fontSize: \"11px\",\n }}\n >\n <code>{JSON.stringify(rest, null, 2)}</code>\n </pre>\n </Box>\n <HoverCard.Arrow />\n </HoverCard.Content>\n </HoverCard.Portal>\n </HoverCard.Root>\n );\n};\n"],"names":["GuideHoverCard","children","guide","isUnknownGuide","React","Stack","annotation","_annotation","activation_location_rules","_activation_location_rules","priority","_priority","rest","HoverCard","Box","width","maxHeight","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