@knocklabs/react 0.11.6 → 0.11.7

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js +2 -0
  4. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js.map +1 -0
  5. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js +1 -1
  6. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js.map +1 -1
  7. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js +1 -1
  8. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js.map +1 -1
  9. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js +2 -0
  10. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js.map +1 -0
  11. package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js +1 -1
  12. package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js.map +1 -1
  13. package/dist/cjs/modules/guide/components/Toolbar/V2/useDraggable.js +1 -1
  14. package/dist/cjs/modules/guide/components/Toolbar/V2/useDraggable.js.map +1 -1
  15. package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js +1 -1
  16. package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js.map +1 -1
  17. package/dist/esm/index.mjs +98 -99
  18. package/dist/esm/index.mjs.map +1 -1
  19. package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs +18 -0
  20. package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs.map +1 -0
  21. package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs +15 -29
  22. package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs.map +1 -1
  23. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs +167 -49
  24. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs.map +1 -1
  25. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs +51 -0
  26. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs.map +1 -0
  27. package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs +128 -66
  28. package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs.map +1 -1
  29. package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs +35 -32
  30. package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs.map +1 -1
  31. package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs +65 -54
  32. package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs.map +1 -1
  33. package/dist/types/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.d.ts +6 -0
  34. package/dist/types/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.d.ts.map +1 -0
  35. package/dist/types/modules/guide/components/Toolbar/V2/GuideContextDetails.d.ts.map +1 -1
  36. package/dist/types/modules/guide/components/Toolbar/V2/GuideRow.d.ts +3 -1
  37. package/dist/types/modules/guide/components/Toolbar/V2/GuideRow.d.ts.map +1 -1
  38. package/dist/types/modules/guide/components/Toolbar/V2/GuideRowDetails.d.ts +5 -0
  39. package/dist/types/modules/guide/components/Toolbar/V2/GuideRowDetails.d.ts.map +1 -0
  40. package/dist/types/modules/guide/components/Toolbar/V2/V2.d.ts.map +1 -1
  41. package/dist/types/modules/guide/components/Toolbar/V2/useDraggable.d.ts +2 -0
  42. package/dist/types/modules/guide/components/Toolbar/V2/useDraggable.d.ts.map +1 -1
  43. package/dist/types/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.d.ts +9 -3
  44. package/dist/types/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.d.ts.map +1 -1
  45. package/package.json +3 -1
  46. package/dist/cjs/modules/guide/components/Toolbar/V2/DragHandle.js +0 -2
  47. package/dist/cjs/modules/guide/components/Toolbar/V2/DragHandle.js.map +0 -1
  48. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideHoverCard.js +0 -2
  49. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideHoverCard.js.map +0 -1
  50. package/dist/cjs/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.js +0 -2
  51. package/dist/cjs/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.js.map +0 -1
  52. package/dist/esm/modules/guide/components/Toolbar/V2/DragHandle.mjs +0 -20
  53. package/dist/esm/modules/guide/components/Toolbar/V2/DragHandle.mjs.map +0 -1
  54. package/dist/esm/modules/guide/components/Toolbar/V2/GuideHoverCard.mjs +0 -57
  55. package/dist/esm/modules/guide/components/Toolbar/V2/GuideHoverCard.mjs.map +0 -1
  56. package/dist/esm/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.mjs +0 -17
  57. package/dist/esm/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.mjs.map +0 -1
  58. package/dist/types/modules/guide/components/Toolbar/V2/DragHandle.d.ts +0 -9
  59. package/dist/types/modules/guide/components/Toolbar/V2/DragHandle.d.ts.map +0 -1
  60. package/dist/types/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.d.ts +0 -8
  61. package/dist/types/modules/guide/components/Toolbar/V2/GuidesListDisplaySelect.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 838b1fd: [guides] designs update for guide toolbar v2
8
+
3
9
  ## 0.11.6
4
10
 
5
11
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const o=require("./modules/core/components/Button/Button.js"),i=require("./modules/core/components/Button/ButtonGroup.js"),u=require("./modules/core/components/Icons/Bell.js"),a=require("./modules/core/components/Icons/CheckmarkCircle.js"),c=require("./modules/core/components/Icons/ChevronDown.js"),s=require("./modules/core/components/Icons/CloseCircle.js"),l=require("./modules/core/components/Spinner/Spinner.js"),d=require("./modules/core/hooks/useOnBottomScroll.js"),b=require("./modules/feed/components/EmptyFeed/EmptyFeed.js"),m=require("./modules/feed/components/NotificationCell/NotificationCell.js"),C=require("./modules/feed/components/NotificationCell/Avatar.js"),f=require("./modules/feed/components/NotificationFeed/NotificationFeed.js"),P=require("./modules/feed/components/NotificationFeed/NotificationFeedHeader.js"),k=require("./modules/feed/components/NotificationFeed/MarkAsRead.js"),p=require("./modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.js"),g=require("./modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js"),y=require("./modules/feed/components/NotificationIconButton/NotificationIconButton.js"),O=require("./modules/feed/components/UnseenBadge/UnseenBadge.js"),t=require("./modules/guide/components/Banner/Banner.js"),r=require("./modules/guide/components/Card/Card.js");require("react");const e=require("@knocklabs/react-core");require("@telegraph/button");require("@telegraph/layout");require("@telegraph/tag");require("@telegraph/typography");require("lucide-react");;/* empty css */require("@telegraph/icon");require("@telegraph/tooltip");require("@radix-ui/react-hover-card");require("@knocklabs/client");require("@telegraph/select");const n=require("./modules/guide/components/Modal/Modal.js"),S=require("./modules/guide/providers/KnockGuideProvider.js"),j=require("./modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js"),q=require("./modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js"),h=require("./modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js"),B=require("./modules/slack/components/SlackAuthButton/SlackAuthButton.js"),K=require("./modules/slack/components/SlackAuthContainer/SlackAuthContainer.js"),M=require("./modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js");exports.Button=o.Button;exports.ButtonGroup=i.ButtonGroup;exports.BellIcon=u.BellIcon;exports.CheckmarkCircle=a.CheckmarkCircle;exports.ChevronDown=c.ChevronDown;exports.CloseCircle=s.CloseCircle;exports.Spinner=l.Spinner;exports.useOnBottomScroll=d;exports.EmptyFeed=b.EmptyFeed;exports.NotificationCell=m.NotificationCell;exports.Avatar=C.Avatar;exports.NotificationFeed=f.NotificationFeed;exports.NotificationFeedHeader=P.NotificationFeedHeader;exports.MarkAsRead=k.MarkAsRead;exports.NotificationFeedContainer=p.NotificationFeedContainer;exports.NotificationFeedPopover=g.NotificationFeedPopover;exports.NotificationIconButton=y.NotificationIconButton;exports.UnseenBadge=O.UnseenBadge;exports.Banner=t.Banner;exports.BannerView=t.BannerView;exports.Card=r.Card;exports.CardView=r.CardView;Object.defineProperty(exports,"FilterStatus",{enumerable:!0,get:()=>e.FilterStatus});Object.defineProperty(exports,"I18nContext",{enumerable:!0,get:()=>e.I18nContext});Object.defineProperty(exports,"KnockFeedProvider",{enumerable:!0,get:()=>e.KnockFeedProvider});Object.defineProperty(exports,"KnockGuideContext",{enumerable:!0,get:()=>e.KnockGuideContext});Object.defineProperty(exports,"KnockI18nProvider",{enumerable:!0,get:()=>e.KnockI18nProvider});Object.defineProperty(exports,"KnockMsTeamsProvider",{enumerable:!0,get:()=>e.KnockMsTeamsProvider});Object.defineProperty(exports,"KnockProvider",{enumerable:!0,get:()=>e.KnockProvider});Object.defineProperty(exports,"KnockSlackProvider",{enumerable:!0,get:()=>e.KnockSlackProvider});Object.defineProperty(exports,"feedProviderKey",{enumerable:!0,get:()=>e.feedProviderKey});Object.defineProperty(exports,"formatBadgeCount",{enumerable:!0,get:()=>e.formatBadgeCount});Object.defineProperty(exports,"formatTimestamp",{enumerable:!0,get:()=>e.formatTimestamp});Object.defineProperty(exports,"getBadgeAriaLabel",{enumerable:!0,get:()=>e.getBadgeAriaLabel});Object.defineProperty(exports,"locales",{enumerable:!0,get:()=>e.locales});Object.defineProperty(exports,"msTeamsProviderKey",{enumerable:!0,get:()=>e.msTeamsProviderKey});Object.defineProperty(exports,"renderNodeOrFallback",{enumerable:!0,get:()=>e.renderNodeOrFallback});Object.defineProperty(exports,"slackProviderKey",{enumerable:!0,get:()=>e.slackProviderKey});Object.defineProperty(exports,"toSentenceCase",{enumerable:!0,get:()=>e.toSentenceCase});Object.defineProperty(exports,"useAuthenticatedKnockClient",{enumerable:!0,get:()=>e.useAuthenticatedKnockClient});Object.defineProperty(exports,"useConnectedMsTeamsChannels",{enumerable:!0,get:()=>e.useConnectedMsTeamsChannels});Object.defineProperty(exports,"useConnectedSlackChannels",{enumerable:!0,get:()=>e.useConnectedSlackChannels});Object.defineProperty(exports,"useCreateNotificationStore",{enumerable:!0,get:()=>e.useCreateNotificationStore});Object.defineProperty(exports,"useFeedSettings",{enumerable:!0,get:()=>e.useFeedSettings});Object.defineProperty(exports,"useGuide",{enumerable:!0,get:()=>e.useGuide});Object.defineProperty(exports,"useGuideContext",{enumerable:!0,get:()=>e.useGuideContext});Object.defineProperty(exports,"useGuides",{enumerable:!0,get:()=>e.useGuides});Object.defineProperty(exports,"useKnockClient",{enumerable:!0,get:()=>e.useKnockClient});Object.defineProperty(exports,"useKnockFeed",{enumerable:!0,get:()=>e.useKnockFeed});Object.defineProperty(exports,"useKnockMsTeamsClient",{enumerable:!0,get:()=>e.useKnockMsTeamsClient});Object.defineProperty(exports,"useKnockSlackClient",{enumerable:!0,get:()=>e.useKnockSlackClient});Object.defineProperty(exports,"useMsTeamsAuth",{enumerable:!0,get:()=>e.useMsTeamsAuth});Object.defineProperty(exports,"useMsTeamsChannels",{enumerable:!0,get:()=>e.useMsTeamsChannels});Object.defineProperty(exports,"useMsTeamsConnectionStatus",{enumerable:!0,get:()=>e.useMsTeamsConnectionStatus});Object.defineProperty(exports,"useMsTeamsTeams",{enumerable:!0,get:()=>e.useMsTeamsTeams});Object.defineProperty(exports,"useNotificationStore",{enumerable:!0,get:()=>e.useNotificationStore});Object.defineProperty(exports,"useNotifications",{enumerable:!0,get:()=>e.useNotifications});Object.defineProperty(exports,"usePreferences",{enumerable:!0,get:()=>e.usePreferences});Object.defineProperty(exports,"useSlackAuth",{enumerable:!0,get:()=>e.useSlackAuth});Object.defineProperty(exports,"useSlackChannels",{enumerable:!0,get:()=>e.useSlackChannels});Object.defineProperty(exports,"useSlackConnectionStatus",{enumerable:!0,get:()=>e.useSlackConnectionStatus});Object.defineProperty(exports,"useStableOptions",{enumerable:!0,get:()=>e.useStableOptions});Object.defineProperty(exports,"useTranslations",{enumerable:!0,get:()=>e.useTranslations});exports.Modal=n.Modal;exports.ModalView=n.ModalView;exports.KnockGuideProvider=S.KnockGuideProvider;exports.MsTeamsAuthButton=j.MsTeamsAuthButton;exports.MsTeamsAuthContainer=q.MsTeamsAuthContainer;exports.MsTeamsChannelCombobox=h;exports.SlackAuthButton=B.SlackAuthButton;exports.SlackAuthContainer=K.SlackAuthContainer;exports.SlackChannelCombobox=M.SlackChannelCombobox;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const o=require("./modules/core/components/Button/Button.js"),i=require("./modules/core/components/Button/ButtonGroup.js"),u=require("./modules/core/components/Icons/Bell.js"),a=require("./modules/core/components/Icons/CheckmarkCircle.js"),c=require("./modules/core/components/Icons/ChevronDown.js"),s=require("./modules/core/components/Icons/CloseCircle.js"),l=require("./modules/core/components/Spinner/Spinner.js"),d=require("./modules/core/hooks/useOnBottomScroll.js"),b=require("./modules/feed/components/EmptyFeed/EmptyFeed.js"),m=require("./modules/feed/components/NotificationCell/NotificationCell.js"),C=require("./modules/feed/components/NotificationCell/Avatar.js"),f=require("./modules/feed/components/NotificationFeed/NotificationFeed.js"),P=require("./modules/feed/components/NotificationFeed/NotificationFeedHeader.js"),k=require("./modules/feed/components/NotificationFeed/MarkAsRead.js"),p=require("./modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.js"),g=require("./modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js"),y=require("./modules/feed/components/NotificationIconButton/NotificationIconButton.js"),O=require("./modules/feed/components/UnseenBadge/UnseenBadge.js"),t=require("./modules/guide/components/Banner/Banner.js"),r=require("./modules/guide/components/Card/Card.js");require("react");const e=require("@knocklabs/react-core");require("@telegraph/button");require("@telegraph/layout");require("@telegraph/tag");require("@telegraph/typography");require("lucide-react");;/* empty css */require("@telegraph/icon");require("@telegraph/segmented-control");require("@telegraph/tooltip");require("@knocklabs/client");const n=require("./modules/guide/components/Modal/Modal.js"),S=require("./modules/guide/providers/KnockGuideProvider.js"),j=require("./modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js"),q=require("./modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js"),h=require("./modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js"),B=require("./modules/slack/components/SlackAuthButton/SlackAuthButton.js"),K=require("./modules/slack/components/SlackAuthContainer/SlackAuthContainer.js"),M=require("./modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js");exports.Button=o.Button;exports.ButtonGroup=i.ButtonGroup;exports.BellIcon=u.BellIcon;exports.CheckmarkCircle=a.CheckmarkCircle;exports.ChevronDown=c.ChevronDown;exports.CloseCircle=s.CloseCircle;exports.Spinner=l.Spinner;exports.useOnBottomScroll=d;exports.EmptyFeed=b.EmptyFeed;exports.NotificationCell=m.NotificationCell;exports.Avatar=C.Avatar;exports.NotificationFeed=f.NotificationFeed;exports.NotificationFeedHeader=P.NotificationFeedHeader;exports.MarkAsRead=k.MarkAsRead;exports.NotificationFeedContainer=p.NotificationFeedContainer;exports.NotificationFeedPopover=g.NotificationFeedPopover;exports.NotificationIconButton=y.NotificationIconButton;exports.UnseenBadge=O.UnseenBadge;exports.Banner=t.Banner;exports.BannerView=t.BannerView;exports.Card=r.Card;exports.CardView=r.CardView;Object.defineProperty(exports,"FilterStatus",{enumerable:!0,get:()=>e.FilterStatus});Object.defineProperty(exports,"I18nContext",{enumerable:!0,get:()=>e.I18nContext});Object.defineProperty(exports,"KnockFeedProvider",{enumerable:!0,get:()=>e.KnockFeedProvider});Object.defineProperty(exports,"KnockGuideContext",{enumerable:!0,get:()=>e.KnockGuideContext});Object.defineProperty(exports,"KnockI18nProvider",{enumerable:!0,get:()=>e.KnockI18nProvider});Object.defineProperty(exports,"KnockMsTeamsProvider",{enumerable:!0,get:()=>e.KnockMsTeamsProvider});Object.defineProperty(exports,"KnockProvider",{enumerable:!0,get:()=>e.KnockProvider});Object.defineProperty(exports,"KnockSlackProvider",{enumerable:!0,get:()=>e.KnockSlackProvider});Object.defineProperty(exports,"feedProviderKey",{enumerable:!0,get:()=>e.feedProviderKey});Object.defineProperty(exports,"formatBadgeCount",{enumerable:!0,get:()=>e.formatBadgeCount});Object.defineProperty(exports,"formatTimestamp",{enumerable:!0,get:()=>e.formatTimestamp});Object.defineProperty(exports,"getBadgeAriaLabel",{enumerable:!0,get:()=>e.getBadgeAriaLabel});Object.defineProperty(exports,"locales",{enumerable:!0,get:()=>e.locales});Object.defineProperty(exports,"msTeamsProviderKey",{enumerable:!0,get:()=>e.msTeamsProviderKey});Object.defineProperty(exports,"renderNodeOrFallback",{enumerable:!0,get:()=>e.renderNodeOrFallback});Object.defineProperty(exports,"slackProviderKey",{enumerable:!0,get:()=>e.slackProviderKey});Object.defineProperty(exports,"toSentenceCase",{enumerable:!0,get:()=>e.toSentenceCase});Object.defineProperty(exports,"useAuthenticatedKnockClient",{enumerable:!0,get:()=>e.useAuthenticatedKnockClient});Object.defineProperty(exports,"useConnectedMsTeamsChannels",{enumerable:!0,get:()=>e.useConnectedMsTeamsChannels});Object.defineProperty(exports,"useConnectedSlackChannels",{enumerable:!0,get:()=>e.useConnectedSlackChannels});Object.defineProperty(exports,"useCreateNotificationStore",{enumerable:!0,get:()=>e.useCreateNotificationStore});Object.defineProperty(exports,"useFeedSettings",{enumerable:!0,get:()=>e.useFeedSettings});Object.defineProperty(exports,"useGuide",{enumerable:!0,get:()=>e.useGuide});Object.defineProperty(exports,"useGuideContext",{enumerable:!0,get:()=>e.useGuideContext});Object.defineProperty(exports,"useGuides",{enumerable:!0,get:()=>e.useGuides});Object.defineProperty(exports,"useKnockClient",{enumerable:!0,get:()=>e.useKnockClient});Object.defineProperty(exports,"useKnockFeed",{enumerable:!0,get:()=>e.useKnockFeed});Object.defineProperty(exports,"useKnockMsTeamsClient",{enumerable:!0,get:()=>e.useKnockMsTeamsClient});Object.defineProperty(exports,"useKnockSlackClient",{enumerable:!0,get:()=>e.useKnockSlackClient});Object.defineProperty(exports,"useMsTeamsAuth",{enumerable:!0,get:()=>e.useMsTeamsAuth});Object.defineProperty(exports,"useMsTeamsChannels",{enumerable:!0,get:()=>e.useMsTeamsChannels});Object.defineProperty(exports,"useMsTeamsConnectionStatus",{enumerable:!0,get:()=>e.useMsTeamsConnectionStatus});Object.defineProperty(exports,"useMsTeamsTeams",{enumerable:!0,get:()=>e.useMsTeamsTeams});Object.defineProperty(exports,"useNotificationStore",{enumerable:!0,get:()=>e.useNotificationStore});Object.defineProperty(exports,"useNotifications",{enumerable:!0,get:()=>e.useNotifications});Object.defineProperty(exports,"usePreferences",{enumerable:!0,get:()=>e.usePreferences});Object.defineProperty(exports,"useSlackAuth",{enumerable:!0,get:()=>e.useSlackAuth});Object.defineProperty(exports,"useSlackChannels",{enumerable:!0,get:()=>e.useSlackChannels});Object.defineProperty(exports,"useSlackConnectionStatus",{enumerable:!0,get:()=>e.useSlackConnectionStatus});Object.defineProperty(exports,"useStableOptions",{enumerable:!0,get:()=>e.useStableOptions});Object.defineProperty(exports,"useTranslations",{enumerable:!0,get:()=>e.useTranslations});exports.Modal=n.Modal;exports.ModalView=n.ModalView;exports.KnockGuideProvider=S.KnockGuideProvider;exports.MsTeamsAuthButton=j.MsTeamsAuthButton;exports.MsTeamsAuthContainer=q.MsTeamsAuthContainer;exports.MsTeamsChannelCombobox=h;exports.SlackAuthButton=B.SlackAuthButton;exports.SlackAuthContainer=K.SlackAuthContainer;exports.SlackChannelCombobox=M.SlackChannelCombobox;
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),l=require("@telegraph/layout"),i=require("@telegraph/tooltip"),n=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=n(r),o={blue:e.default.createElement("svg",{width:"8",height:"8",viewBox:"0 0 8 8","aria-hidden":!0},e.default.createElement("circle",{cx:"4",cy:"4",r:"4",fill:"var(--tgph-blue-9)"})),yellow:e.default.createElement("svg",{width:"8",height:"8",viewBox:"0 0 8 8","aria-hidden":!0},e.default.createElement("polygon",{points:"4,0.5 7.5,7.5 0.5,7.5",fill:"var(--tgph-yellow-9)"})),gray:e.default.createElement("svg",{width:"8",height:"8",viewBox:"0 0 8 8","aria-hidden":!0},e.default.createElement("circle",{cx:"4",cy:"4",r:"2.75",fill:"none",stroke:"var(--tgph-gray-9)",strokeWidth:"2.5"})),red:e.default.createElement("svg",{width:"8",height:"8",viewBox:"0 0 8 8","aria-hidden":!0},e.default.createElement("line",{x1:"1.5",y1:"1.5",x2:"6.5",y2:"6.5",stroke:"var(--tgph-red-9)",strokeWidth:"2",strokeLinecap:"round"}),e.default.createElement("line",{x1:"6.5",y1:"1.5",x2:"1.5",y2:"6.5",stroke:"var(--tgph-red-9)",strokeWidth:"2",strokeLinecap:"round"}))},d=({color:t,tooltip:a})=>e.default.createElement(i.Tooltip,{label:a},e.default.createElement(l.Stack,{as:"span",align:"center",justify:"center",display:"inline-flex",p:"0_5",style:{flexShrink:0}},o[t]));exports.GuideAnnotatedStatusDot=d;
2
+ //# sourceMappingURL=GuideAnnotatedStatusDot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuideAnnotatedStatusDot.js","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":"uOAMMA,EAAsD,CAC1DC,6BACG,MAAI,CAAA,MAAM,IAAI,OAAO,IAAI,QAAQ,UAAU,cAAW,IACpDC,EAAA,QAAA,cAAA,SAAA,CAAO,GAAG,IAAI,GAAG,IAAI,EAAE,IAAI,KAAK,oBAAoB,CAAA,CACvD,EAEFC,OACGD,EAAAA,QAAA,cAAA,MAAA,CAAI,MAAM,IAAI,OAAO,IAAI,QAAQ,UAAU,cAAW,IACpDA,UAAA,cAAA,UAAA,CAAQ,OAAO,wBAAwB,KAAK,uBAAsB,CACrE,EAEFE,KACGF,EAAAA,QAAA,cAAA,MAAA,CAAI,MAAM,IAAI,OAAO,IAAI,QAAQ,UAAU,cAAW,EACrD,EAAAA,EAAAA,QAAA,cAAC,UACC,GAAG,IACH,GAAG,IACH,EAAE,OACF,KAAK,OACL,OAAO,qBACP,YAAY,KAAK,CAAA,CAErB,EAEFG,4BACG,MAAI,CAAA,MAAM,IAAI,OAAO,IAAI,QAAQ,UAAU,cAAW,IACpDH,UAAA,cAAA,OAAA,CACC,GAAG,MACH,GAAG,MACH,GAAG,MACH,GAAG,MACH,OAAO,oBACP,YAAY,IACZ,cAAc,OAAO,CAAA,0BAEtB,OACC,CAAA,GAAG,MACH,GAAG,MACH,GAAG,MACH,GAAG,MACH,OAAO,oBACP,YAAY,IACZ,cAAc,QAAO,CAEzB,CAEJ,EAEaI,EAA0BA,CAAC,CACtCC,MAAAA,EACAC,QAAAA,CAIF,4BAEKC,EAAAA,QAAQ,CAAA,MAAOD,GACdN,EAAAA,QAAA,cAACQ,SACC,GAAG,OACH,MAAM,SACN,QAAQ,SACR,QAAQ,cACR,EAAE,MACF,MAAO,CAAEC,WAAY,CAAA,GAEpBX,EAAcO,CAAK,CACtB,CACF"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@knocklabs/react-core"),u=require("@telegraph/button"),p=require("@telegraph/icon"),n=require("@telegraph/layout"),d=require("@telegraph/tooltip"),a=require("@telegraph/typography"),s=require("lucide-react"),E=require("react");function y(t){if(t&&typeof t=="object"&&"default"in t)return t;const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const c=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(o,i,c.get?c:{enumerable:!0,get:()=>t[i]})}}return o.default=t,Object.freeze(o)}const e=y(E),x=()=>{const{client:t}=m.useGuideContext(),[o,i]=e.useState(!1),{defaultGroup:c,debugSettings:r}=m.useStore(t.store,l=>({defaultGroup:l.guideGroups[0],debugSettings:l.debug||{}})),g=(c==null?void 0:c.display_interval)??null;return e.createElement(n.Stack,{direction:"column",borderTop:"px"},e.createElement(n.Stack,{h:"5",px:"2",bg:"gray-3",align:"center",gap:"1",style:{cursor:"pointer"},onClick:()=>i(l=>!l)},e.createElement(a.Text,{as:"span",size:"0",weight:"medium"},"More"),o?e.createElement(s.ChevronDown,{size:12}):e.createElement(s.ChevronRight,{size:12})),o&&e.createElement(n.Stack,{direction:"column"},e.createElement(n.Stack,{align:"center",justify:"space-between",py:"1",px:"2",borderTop:"px"},e.createElement(n.Stack,{align:"center",gap:"1"},e.createElement(a.Text,{as:"span",size:"0",weight:"medium"},"Client-only engagement"),e.createElement(d.Tooltip,{label:"Contain engagement actions to the client side only while in preview without sending engagement events to the API"},e.createElement(p.Icon,{icon:s.Info,size:"0",color:"gray","aria-hidden":!0}))),e.createElement(u.Button,{size:"0",variant:"soft",color:r.skipEngagementTracking?"green":"gray",onClick:()=>t.setDebug({...r,skipEngagementTracking:!r.skipEngagementTracking})},r.skipEngagementTracking?"On":"Off")),e.createElement(n.Stack,{direction:"column",py:"1",px:"2"},e.createElement(n.Stack,{align:"center",justify:"space-between"},e.createElement(n.Stack,{align:"center",gap:"1"},e.createElement(a.Text,{as:"span",size:"0",weight:"medium"},"Suspend throttling"),e.createElement(d.Tooltip,{label:"Suspend throttling during preview, and show next guide immediately"},e.createElement(p.Icon,{icon:s.Info,size:"0",color:"gray","aria-hidden":!0}))),e.createElement(u.Button,{size:"0",variant:"soft",color:r.ignoreDisplayInterval?"green":"gray",onClick:()=>t.setDebug({...r,ignoreDisplayInterval:!r.ignoreDisplayInterval})},r.ignoreDisplayInterval?"On":"Off")),e.createElement(n.Stack,{direction:"row",gap:"0_5",py:"1"},e.createElement(a.Text,{as:"span",size:"0",color:"gray"},"Throttle:"," ",r.ignoreDisplayInterval?"(ignored)":g===null?"(none)":`Every ${g}s`))),e.createElement(n.Stack,{direction:"column",py:"1",px:"2",borderTop:"px"},e.createElement(a.Text,{as:"span",size:"0",weight:"medium"},"Target params"),e.createElement(n.Stack,{direction:"column",gap:"0_5",mt:"1"},e.createElement(a.Text,{as:"span",size:"0",color:"gray"},"Tenant"),e.createElement(a.Text,{as:"code",size:"0"},t.targetParams.tenant?e.createElement(n.Box,{rounded:"2",overflow:"auto",backgroundColor:"gray-2",border:"px",style:{maxHeight:"200px"}},e.createElement("pre",{style:{fontSize:"11px",margin:0}},e.createElement("code",null,t.targetParams.tenant))):e.createElement(a.Text,{as:"code",size:"0"},"-"))),e.createElement(n.Stack,{direction:"column",gap:"0_5"},e.createElement(a.Text,{as:"span",size:"0",color:"gray"},"Data"),t.targetParams.data?e.createElement(n.Box,{rounded:"2",overflow:"auto",backgroundColor:"gray-2",border:"px",style:{maxHeight:"200px"}},e.createElement("pre",{style:{fontSize:"11px",margin:0}},e.createElement("code",null,JSON.stringify(t.targetParams.data,null,2)))):e.createElement(a.Text,{as:"code",size:"0"},"-")))))};exports.GuideContextDetails=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),n=require("@knocklabs/react-core"),a=require("@telegraph/layout"),r=require("@telegraph/typography"),o=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=o(l),i=()=>{const{client:t}=n.useGuideContext();return e.default.createElement(a.Box,{py:"3",px:"3"},e.default.createElement(r.Text,{as:"span",size:"1",weight:"medium"},"Target params"),e.default.createElement(a.Stack,{direction:"column",gap:"2",mt:"2"},e.default.createElement(a.Stack,{direction:"row",gap:"2",align:"center"},e.default.createElement(r.Text,{as:"span",size:"1",weight:"medium",color:"gray",width:"36",mt:"1"},"Tenant"),e.default.createElement(a.Box,{rounded:"2",overflow:"auto",backgroundColor:"surface-2",border:"px",p:"1",style:{flex:1,minWidth:0}},e.default.createElement("pre",{style:{fontSize:"11px",margin:0}},e.default.createElement("code",null,t.targetParams.tenant||"-")))),e.default.createElement(a.Stack,{direction:"row",gap:"2",align:"flex-start"},e.default.createElement(r.Text,{as:"span",size:"1",weight:"medium",color:"gray",width:"36",mt:"1"},"Data"),e.default.createElement(a.Box,{rounded:"2",overflow:"auto",backgroundColor:"surface-2",border:"px",p:"1",style:{flex:1,minWidth:0,minHeight:"50px",maxHeight:"200px"}},e.default.createElement("pre",{style:{fontSize:"11px",margin:0}},e.default.createElement("code",null,t.targetParams.data?JSON.stringify(t.targetParams.data,null,2):"-"))))))};exports.GuideContextDetails=i;
2
2
  //# sourceMappingURL=GuideContextDetails.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GuideContextDetails.js","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":"+oBASaA,EAAsBA,IAAM,CACjC,KAAA,CAAEC,OAAAA,GAAWC,kBAAgB,EAC7B,CAACC,EAAYC,CAAa,EAAIC,EAAMC,SAAS,EAAK,E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AO4B,aAAaC,OAClBzB,EAAA,cAAA0B,EAAAA,IAAA,CACC,QAAQ,IACR,SAAS,OACT,gBAAgB,SAChB,OAAO,KACP,MAAO,CAAEC,UAAW,OAAQ,CAAA,EAE3B3B,EAAA,cAAA,MAAA,CAAI,MAAO,CAAE4B,SAAU,OAAQC,OAAQ,CAAE,CAAA,kBACvC,OAAMjC,KAAAA,EAAO4B,aAAaC,MAAO,CACpC,CACF,EAECzB,EAAA,cAAAc,EAAAA,KAAA,CAAK,GAAG,OAAO,KAAK,KAAG,GAExB,CAEJ,CACF,EAEAd,EAAA,cAACW,EAAAA,MAAM,CAAA,UAAU,SAAS,IAAI,OAC3BX,EAAA,cAAAc,EAAAA,KAAA,CAAK,GAAG,OAAO,KAAK,IAAI,MAAM,MAAA,EAAM,MAErC,EACClB,EAAO4B,aAAaM,KAClB9B,EAAA,cAAA0B,MAAA,CACC,QAAQ,IACR,SAAS,OACT,gBAAgB,SAChB,OAAO,KACP,MAAO,CAAEC,UAAW,OAAQ,CAAA,EAE3B3B,EAAA,cAAA,MAAA,CAAI,MAAO,CAAE4B,SAAU,OAAQC,OAAQ,CAAE,CAAA,EACvC7B,EAAA,cAAA,OAAA,KACE+B,KAAKC,UAAUpC,EAAO4B,aAAaM,KAAM,KAAM,CAAC,CACnD,CACF,CACF,EAEA9B,EAAA,cAACc,EAAAA,KAAK,CAAA,GAAG,OAAO,KAAK,KAAG,GAExB,CAEJ,CACF,CACF,CAEJ,CAEJ"}
1
+ {"version":3,"file":"GuideContextDetails.js","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideContextDetails.tsx"],"sourcesContent":["import { useGuideContext } from \"@knocklabs/react-core\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Text } from \"@telegraph/typography\";\n\nexport const GuideContextDetails = () => {\n const { client } = useGuideContext();\n\n return (\n <Box py=\"3\" px=\"3\">\n <Text as=\"span\" size=\"1\" weight=\"medium\">\n Target params\n </Text>\n <Stack direction=\"column\" gap=\"2\" mt=\"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 </Box>\n );\n};\n"],"names":["GuideContextDetails","client","useGuideContext","React","Box","Text","Stack","flex","minWidth","fontSize","margin","targetParams","tenant","minHeight","maxHeight","data","JSON","stringify"],"mappings":"6QAIaA,EAAsBA,IAAM,CACjC,KAAA,CAAEC,OAAAA,GAAWC,kBAAgB,EAEnC,OACGC,EAAAA,QAAA,cAAAC,EAAA,IAAA,CAAI,GAAG,IAAI,GAAG,GAAA,EACZD,EAAAA,QAAA,cAAAE,EAAAA,KAAA,CAAK,GAAG,OAAO,KAAK,IAAI,OAAO,QAAA,EAAQ,eAExC,EACCF,UAAA,cAAAG,EAAAA,MAAA,CAAM,UAAU,SAAS,IAAI,IAAI,GAAG,KAClCH,EAAAA,QAAA,cAAAG,EAAA,MAAA,CAAM,UAAU,MAAM,IAAI,IAAI,MAAM,QAAA,EAClCH,EAAA,QAAA,cAAAE,EAAA,KAAA,CACC,GAAG,OACH,KAAK,IACL,OAAO,SACP,MAAM,OACN,MAAM,KACN,GAAG,GAAA,EAAG,QAGR,EACCF,EAAA,QAAA,cAAAC,EAAA,IAAA,CACC,QAAQ,IACR,SAAS,OACT,gBAAgB,YAChB,OAAO,KACP,EAAE,IACF,MAAO,CAAEG,KAAM,EAAGC,SAAU,CAAE,CAAA,EAE7BL,EAAAA,QAAA,cAAA,MAAA,CAAI,MAAO,CAAEM,SAAU,OAAQC,OAAQ,CAAE,CAAA,0BACvC,OAAMT,KAAAA,EAAOU,aAAaC,QAAU,GAAI,CAC3C,CACF,CACF,EACCT,EAAAA,QAAA,cAAAG,EAAA,MAAA,CAAM,UAAU,MAAM,IAAI,IAAI,MAAM,YAAA,EAClCH,EAAAA,QAAA,cAAAE,EAAA,KAAA,CACC,GAAG,OACH,KAAK,IACL,OAAO,SACP,MAAM,OACN,MAAM,KACN,GAAG,KAAG,MAGR,EACAF,EAAA,QAAA,cAACC,EAAAA,KACC,QAAQ,IACR,SAAS,OACT,gBAAgB,YAChB,OAAO,KACP,EAAE,IACF,MAAO,CACLG,KAAM,EACNC,SAAU,EACVK,UAAW,OACXC,UAAW,OACb,CAAA,EAECX,EAAAA,QAAA,cAAA,MAAA,CAAI,MAAO,CAAEM,SAAU,OAAQC,OAAQ,CAAA,GACrCP,EAAAA,QAAA,cAAA,OAAA,KACEF,EAAOU,aAAaI,KACjBC,KAAKC,UAAUhB,EAAOU,aAAaI,KAAM,KAAM,CAAC,EAChD,GACN,CACF,CACF,CACF,CACF,CACF,CAEJ"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@knocklabs/react-core"),r=require("@telegraph/button"),a=require("@telegraph/layout"),g=require("@telegraph/tag"),c=require("@telegraph/tooltip"),h=require("@telegraph/typography"),o=require("lucide-react"),y=require("react"),f=require("./GuideHoverCard.js"),u=require("./useInspectGuideClientStore.js");function E(e){if(e&&typeof e=="object"&&"default"in e)return e;const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return i.default=e,Object.freeze(i)}const t=E(y),v=({children:e})=>t.createElement(a.Stack,{h:"7",px:"2",borderTop:"px",justify:"space-between",align:"center"},e),T=({guide:e,orderIndex:i})=>{const{client:n}=m.useGuideContext(),{debugSettings:s}=m.useStore(n.store,p=>({debugSettings:p.debug||{}})),d=s.focusedGuideKeys||{},b=Object.keys(d).length>0,l=!!d[e.key];return t.createElement(v,null,t.createElement(f.GuideHoverCard,{guide:e},t.createElement(a.Stack,{h:"6",justify:"flex-start",align:"center",gap:"2"},t.createElement(g.Tag,{size:"0",variant:"soft",color:e.bypass_global_group_limit?"blue":"default"},i+1),t.createElement(h.Text,{as:"code",size:"1",color:b?l?"blue":"disabled":"default"},e.key))),t.createElement(a.Stack,{justify:"flex-end"},!u.isUnknownGuide(e)&&t.createElement(t.Fragment,null,e.annotation.selectable.status!==void 0&&(!b||l)&&t.createElement(t.Fragment,null,t.createElement(c.Tooltip,{label:l?"Unfocus this guide":"Focus on this guide"},t.createElement(r.Button,{size:"1",variant:"ghost",color:l?"blue":"gray",leadingIcon:{icon:o.Pin,alt:"Focus"},onClick:()=>n.setDebug({...s,focusedGuideKeys:l?{}:{[e.key]:!0}})})),t.createElement(a.Stack,{px:"2",align:"center"},t.createElement(a.Box,{h:"3",borderLeft:"px",borderColor:"gray-6"}))),t.createElement(a.Stack,{gap:"1"},t.createElement(c.Tooltip,{label:e.annotation.selectable.status==="returned"?"This guide was queried and can display":e.annotation.selectable.status==="queried"?"This guide was queried but cannot display":e.annotation.selectable.status==="throttled"?"This guide was queried and can display but is throttled currently":"No component is present in the current location to display this guide"},t.createElement(r.Button,{px:"1",size:"1",variant:"soft",color:e.annotation.selectable.status==="returned"?"green":e.annotation.selectable.status==="queried"?"gray":e.annotation.selectable.status==="throttled"?"yellow":"red",leadingIcon:{icon:o.Code2,alt:"Render"}})),t.createElement(c.Tooltip,{label:e.annotation.activatable.status?"This guide can be activated at the current location":"This guide cannot be activated at the current location"},t.createElement(r.Button,{px:"1",size:"1",variant:"soft",color:e.annotation.activatable.status?"green":"red",leadingIcon:{icon:o.LocateFixed,alt:"Target"}}))),t.createElement(a.Stack,{px:"2",align:"center"},t.createElement(a.Box,{h:"3",borderLeft:"px",borderColor:"gray-6"}))),t.createElement(a.Stack,{gap:"1"},!u.isUnknownGuide(e)&&t.createElement(t.Fragment,null,t.createElement(c.Tooltip,{label:e.annotation.targetable.status?"This user is being targeted":e.annotation.targetable.message},t.createElement(r.Button,{px:"1",size:"1",variant:"soft",color:e.annotation.targetable.status?"green":"red",leadingIcon:{icon:o.UserCircle2,alt:"Target"}})),t.createElement(c.Tooltip,{label:e.annotation.archived.status?"User has already dismissed this guide":"User has not dismissed this guide"},t.createElement(r.Button,{px:"1",size:"1",variant:"soft",color:e.annotation.archived.status?"red":"green",leadingIcon:{icon:o.Eye,alt:"Not archived"}}))),t.createElement(c.Tooltip,{label:u.isUnknownGuide(e)?"This guide has never been committed and published yet":e.active?"This guide is active":"This guide is not active"},t.createElement(r.Button,{px:"1",size:"1",variant:"soft",color:e.active?"green":"red",leadingIcon:e.active?{icon:o.CheckCircle2,alt:"Active"}:{icon:o.CircleDashed,alt:"Inactive"}})))))};exports.GuideRow=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("@knocklabs/react-core"),S=require("@telegraph/button"),E=require("@telegraph/icon"),i=require("@telegraph/layout"),G=require("@telegraph/tag"),g=require("@telegraph/tooltip"),f=require("@telegraph/typography"),q=require("lucide-react"),T=require("react"),u=require("./GuideAnnotatedStatusDot.js"),_=require("./GuideRowDetails.js"),c=require("./useInspectGuideClientStore.js");function x(e){if(e&&typeof e=="object"&&"default"in e)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const o=x(T),w=({label:e,color:t="gray",children:a})=>o.createElement(i.Stack,{direction:"row",align:"center",gap:"0_5",px:"1",height:"5",bg:"surface-2",rounded:"full",border:"px",borderColor:"gray-4"},o.createElement(f.Text,{as:"span",size:"0",color:t,weight:"medium"},e),a),D=e=>{if(c.isUnknownGuide(e))return{color:"red",label:"Inactive",tooltip:"This guide has never been committed and published yet"};const{annotation:t}=e;return t.active.status?t.archived.status?{color:"red",label:"Archived",tooltip:"User has already dismissed this guide"}:t.targetable.status?t.selectable.status===void 0?{color:"red",label:"Not found",tooltip:"No component that can query this guide was found"}:t.activatable.status?t.selectable.status==="queried"?{color:"gray",label:"Queued",tooltip:"This guide is queried but is not ready to display"}:t.selectable.status==="throttled"?{color:"yellow",label:"Throttled",tooltip:"This guide is queried and ready to display, but throttled currently"}:t.selectable.status==="returned"?{color:"blue",label:"Display",tooltip:"This guide is queried and ready to display"}:{color:"red",label:"Unknown status",tooltip:"Unknown status"}:{color:"red",label:"Not activated",tooltip:"This guide cannot be activated in the current location"}:{color:"red",label:"Not targeted",tooltip:t.targetable.message}:{color:"red",label:"Inactive",tooltip:"This guide is inactive"}},N=e=>{if(c.isUnknownGuide(e))return{active:{color:"gray"},archived:{color:"gray"},targetable:{color:"gray"},activatable:{color:"gray"},selectable:{color:"gray"}};const{annotation:t}=e,a={color:t.active.status?"blue":"red",tooltip:`Active: ${t.active.status?"Yes":"No"}`},n={color:t.archived.status?"red":"blue",tooltip:`Not archived: ${t.archived.status?"No":"Yes"}`},d={color:t.targetable.status?"blue":"red",tooltip:`Targeted: ${t.targetable.status?"Yes":"No"}`},b={color:t.activatable.status?"blue":"red",tooltip:`Activated: ${t.activatable.status?"Yes":"No"}`};let l;switch(t.selectable.status){case"returned":l={color:"blue",tooltip:"Ready for display"};break;case"throttled":l={color:"yellow",tooltip:"Throttled"};break;case"queried":l={color:"gray",tooltip:"Queued"};break;case void 0:default:l={color:"red",tooltip:"Not found"};break}return{active:a,archived:n,targetable:d,activatable:b,selectable:l}},j=({guide:e,orderIndex:t,isExpanded:a,onClick:n})=>{const{client:d}=v.useGuideContext(),{debugSettings:b}=v.useStore(d.store,y=>({debugSettings:y.debug||{}})),[l,h]=o.useState(!1),m=b.focusedGuideKeys||{},k=Object.keys(m).length>0,s=!!m[e.key],r=N(e),p=D(e);return o.createElement(i.Box,{rounded:"3",overflow:"hidden",border:"px",borderStyle:"solid",borderColor:a?"gray-6":"transparent",onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{cursor:"pointer"}},o.createElement(i.Stack,{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:()=>n(e.key)},o.createElement(i.Stack,{align:"center",gap:"1_5",style:{minWidth:0,flex:1}},o.createElement(i.Stack,{w:"7",justify:"space-between",align:"center",gap:"0_5"},o.createElement(i.Box,{w:"3"},!e.bypass_global_group_limit&&o.createElement(E.Icon,{icon:q.Gauge,size:"0",color:"gray",alt:"Subject to throttling"})),o.createElement(f.Text,{as:"span",size:"1",weight:"medium",color:e.bypass_global_group_limit?"blue":"default",style:{flexShrink:0}},t+1)),o.createElement(g.Tooltip,{label:`${e.key}${e.bypass_global_group_limit?" (unthrottled)":""}`},o.createElement(f.Text,{as:"code",size:"1",weight:"medium",color:"default",style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},e.key))),o.createElement(i.Stack,{align:"center",gap:"1_5",style:{flexShrink:0}},!k&&o.createElement(g.Tooltip,{label:p.tooltip},o.createElement(G.Tag,{size:"0",variant:"soft",color:p.color},p.label)),o.createElement(w,{label:"Elig:",color:c.isUnknownGuide(e)?"disabled":e.annotation.isEligible?"blue":"gray"},o.createElement(u.GuideAnnotatedStatusDot,{color:r.active.color,tooltip:r.active.tooltip}),o.createElement(u.GuideAnnotatedStatusDot,{color:r.archived.color,tooltip:r.archived.tooltip}),o.createElement(u.GuideAnnotatedStatusDot,{color:r.targetable.color,tooltip:r.targetable.tooltip})),o.createElement(w,{label:"Vis:",color:c.isUnknownGuide(e)?"disabled":e.annotation.isQualified&&e.annotation.selectable.status==="returned"?"blue":"gray"},o.createElement(u.GuideAnnotatedStatusDot,{color:r.activatable.color,tooltip:r.activatable.tooltip}),o.createElement(u.GuideAnnotatedStatusDot,{color:r.selectable.color,tooltip:r.selectable.tooltip})),o.createElement(g.Tooltip,{label:c.isUnknownGuide(e)||e.annotation.selectable.status===void 0?"No component found that can render this guide":s?"Unfocus this guide":"Focus on this guide"},o.createElement(S.Button,{size:"0",variant:s?"solid":"outline",color:s?"blue":"gray",disabled:c.isUnknownGuide(e)||e.annotation.selectable.status===void 0,onClick:y=>{y.stopPropagation(),d.setDebug({...b,focusedGuideKeys:s?{}:{[e.key]:!0}})}},"Focus")))),a&&o.createElement(_.GuideRowDetails,{guide:e}))};exports.GuideRow=j;
2
2
  //# sourceMappingURL=GuideRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GuideRow.js","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideRow.tsx"],"sourcesContent":["import { useGuideContext, useStore } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Tag } from \"@telegraph/tag\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport {\n CheckCircle2,\n CircleDashed,\n Code2,\n Eye,\n LocateFixed,\n Pin,\n UserCircle2,\n} from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { GuideHoverCard } from \"./GuideHoverCard\";\nimport {\n AnnotatedGuide,\n UnknownGuide,\n isUnknownGuide,\n} from \"./useInspectGuideClientStore\";\n\nconst Row = ({ children }: React.PropsWithChildren) => (\n <Stack h=\"7\" px=\"2\" borderTop=\"px\" justify=\"space-between\" align=\"center\">\n {children}\n </Stack>\n);\n\ntype Props = {\n guide: UnknownGuide | AnnotatedGuide;\n orderIndex: number;\n};\n\nexport const GuideRow = ({ guide, orderIndex }: Props) => {\n const { client } = useGuideContext();\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug || {},\n }));\n\n const focusedGuideKeys = debugSettings.focusedGuideKeys || {};\n const hasFocus = Object.keys(focusedGuideKeys).length > 0;\n const isFocused = !!focusedGuideKeys[guide.key];\n\n return (\n <Row>\n <GuideHoverCard guide={guide}>\n <Stack h=\"6\" justify=\"flex-start\" align=\"center\" gap=\"2\">\n <Tag\n size=\"0\"\n variant=\"soft\"\n color={guide.bypass_global_group_limit ? \"blue\" : \"default\"}\n >\n {orderIndex + 1}\n </Tag>\n <Text\n as=\"code\"\n size=\"1\"\n color={!hasFocus ? \"default\" : isFocused ? \"blue\" : \"disabled\"}\n >\n {guide.key}\n </Text>\n </Stack>\n </GuideHoverCard>\n\n <Stack justify=\"flex-end\">\n {!isUnknownGuide(guide) && (\n <>\n {guide.annotation.selectable.status !== undefined &&\n (!hasFocus || isFocused) && (\n <>\n <Tooltip\n label={\n isFocused ? \"Unfocus this guide\" : \"Focus on this guide\"\n }\n >\n <Button\n size=\"1\"\n variant=\"ghost\"\n color={isFocused ? \"blue\" : \"gray\"}\n leadingIcon={{ icon: Pin, alt: \"Focus\" }}\n onClick={() =>\n client.setDebug({\n ...debugSettings,\n focusedGuideKeys: isFocused\n ? {}\n : { [guide.key]: true },\n })\n }\n />\n </Tooltip>\n <Stack px=\"2\" align=\"center\">\n <Box h=\"3\" borderLeft=\"px\" borderColor=\"gray-6\" />\n </Stack>\n </>\n )}\n <Stack gap=\"1\">\n <Tooltip\n label={\n guide.annotation.selectable.status === \"returned\"\n ? \"This guide was queried and can display\"\n : guide.annotation.selectable.status === \"queried\"\n ? \"This guide was queried but cannot display\"\n : guide.annotation.selectable.status === \"throttled\"\n ? \"This guide was queried and can display but is throttled currently\"\n : \"No component is present in the current location to display this guide\"\n }\n >\n <Button\n px=\"1\"\n size=\"1\"\n variant=\"soft\"\n color={\n guide.annotation.selectable.status === \"returned\"\n ? \"green\"\n : guide.annotation.selectable.status === \"queried\"\n ? \"gray\"\n : guide.annotation.selectable.status === \"throttled\"\n ? \"yellow\"\n : \"red\"\n }\n leadingIcon={{ icon: Code2, alt: \"Render\" }}\n />\n </Tooltip>\n <Tooltip\n label={\n guide.annotation.activatable.status\n ? \"This guide can be activated at the current location\"\n : \"This guide cannot be activated at the current location\"\n }\n >\n <Button\n px=\"1\"\n size=\"1\"\n variant=\"soft\"\n color={guide.annotation.activatable.status ? \"green\" : \"red\"}\n leadingIcon={{ icon: LocateFixed, alt: \"Target\" }}\n />\n </Tooltip>\n </Stack>\n <Stack px=\"2\" align=\"center\">\n <Box h=\"3\" borderLeft=\"px\" borderColor=\"gray-6\" />\n </Stack>\n </>\n )}\n <Stack gap=\"1\">\n {!isUnknownGuide(guide) && (\n <>\n <Tooltip\n label={\n guide.annotation.targetable.status\n ? \"This user is being targeted\"\n : guide.annotation.targetable.message\n }\n >\n <Button\n px=\"1\"\n size=\"1\"\n variant=\"soft\"\n color={guide.annotation.targetable.status ? \"green\" : \"red\"}\n leadingIcon={{ icon: UserCircle2, alt: \"Target\" }}\n />\n </Tooltip>\n <Tooltip\n label={\n guide.annotation.archived.status\n ? \"User has already dismissed this guide\"\n : \"User has not dismissed this guide\"\n }\n >\n <Button\n px=\"1\"\n size=\"1\"\n variant=\"soft\"\n color={guide.annotation.archived.status ? \"red\" : \"green\"}\n leadingIcon={{ icon: Eye, alt: \"Not archived\" }}\n />\n </Tooltip>\n </>\n )}\n <Tooltip\n label={\n isUnknownGuide(guide)\n ? \"This guide has never been committed and published yet\"\n : !guide.active\n ? \"This guide is not active\"\n : \"This guide is active\"\n }\n >\n <Button\n px=\"1\"\n size=\"1\"\n variant=\"soft\"\n color={guide.active ? \"green\" : \"red\"}\n leadingIcon={\n guide.active\n ? { icon: CheckCircle2, alt: \"Active\" }\n : { icon: CircleDashed, alt: \"Inactive\" }\n }\n />\n </Tooltip>\n </Stack>\n </Stack>\n </Row>\n );\n};\n"],"names":["Row","children","React","Stack","GuideRow","guide","orderIndex","client","useGuideContext","debugSettings","useStore","store","state","debug","focusedGuideKeys","hasFocus","Object","keys","length","isFocused","key","GuideHoverCard","Tag","bypass_global_group_limit","Text","isUnknownGuide","annotation","selectable","status","undefined","Tooltip","Button","icon","Pin","alt","setDebug","Box","Code2","activatable","LocateFixed","targetable","message","UserCircle2","archived","Eye","active","CheckCircle2","CircleDashed"],"mappings":"4tBAwBMA,EAAMA,CAAC,CAAEC,SAAAA,CAAkC,IAC9CC,EAAA,cAAAC,EAAAA,MAAA,CAAM,EAAE,IAAI,GAAG,IAAI,UAAU,KAAK,QAAQ,gBAAgB,MAAM,QAAA,EAC9DF,CACH,EAQWG,EAAWA,CAAC,CAAEC,MAAAA,EAAOC,WAAAA,CAAkB,IAAM,CAClD,KAAA,CAAEC,OAAAA,GAAWC,kBAAgB,EAC7B,CAAEC,cAAAA,CAAkBC,EAAAA,WAASH,EAAOI,MAAmBC,IAAA,CAC3DH,cAAeG,EAAMC,OAAS,CAAA,CAAC,EAC/B,EAEIC,EAAmBL,EAAcK,kBAAoB,CAAC,EACtDC,EAAWC,OAAOC,KAAKH,CAAgB,EAAEI,OAAS,EAClDC,EAAY,CAAC,CAACL,EAAiBT,EAAMe,GAAG,EAE9C,uBACGpB,EACC,KAAAE,EAAA,cAACmB,EAAAA,eAAe,CAAA,MAAAhB,mBACbF,EAAAA,MAAM,CAAA,EAAE,IAAI,QAAQ,aAAa,MAAM,SAAS,IAAI,GACnD,EAAAD,EAAA,cAACoB,EAAAA,KACC,KAAK,IACL,QAAQ,OACR,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,CACF,EAEDhC,EAAA,cAAA4B,EAAAA,QAAA,CACC,MACEL,EAAAA,eAAepB,CAAK,EAChB,wDACCA,EAAMwC,OAEL,uBADA,4BAIR3C,EAAA,cAAC6B,EAAAA,OACC,CAAA,GAAG,IACH,KAAK,IACL,QAAQ,OACR,MAAO1B,EAAMwC,OAAS,QAAU,MAChC,YACExC,EAAMwC,OACF,CAAEb,KAAMc,EAAAA,aAAcZ,IAAK,QAAA,EAC3B,CAAEF,KAAMe,EAAAA,aAAcb,IAAK,UAAA,CAChC,CAAA,CAEL,CACF,CACF,CACF,CAEJ"}
1
+ {"version":3,"file":"GuideRow.js","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 { GuideRowDetails } from \"./GuideRowDetails\";\nimport {\n AnnotatedGuide,\n AnnotatedStatuses,\n UnknownGuide,\n isUnknownGuide,\n} from \"./useInspectGuideClientStore\";\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\ntype StatusSummary = {\n color: StatusColor;\n label: string;\n tooltip: string;\n};\n\nconst getStatusSummary = (\n guide: AnnotatedGuide | UnknownGuide,\n): StatusSummary => {\n if (isUnknownGuide(guide)) {\n return {\n color: \"red\",\n label: \"Inactive\",\n tooltip: \"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 tooltip: \"This guide is inactive\",\n };\n }\n if (annotation.archived.status) {\n return {\n color: \"red\",\n label: \"Archived\",\n tooltip: \"User has already dismissed this guide\",\n };\n }\n if (!annotation.targetable.status) {\n return {\n color: \"red\",\n label: \"Not targeted\",\n tooltip: annotation.targetable.message,\n };\n }\n if (annotation.selectable.status === undefined) {\n return {\n color: \"red\",\n label: \"Not found\",\n tooltip: \"No component that can query this guide was found\",\n };\n }\n if (!annotation.activatable.status) {\n return {\n color: \"red\",\n label: \"Not activated\",\n tooltip: \"This guide cannot be activated in the current location\",\n };\n }\n if (annotation.selectable.status === \"queried\") {\n return {\n color: \"gray\",\n label: \"Queued\",\n tooltip: \"This guide is queried but is not ready to display\",\n };\n }\n if (annotation.selectable.status === \"throttled\") {\n return {\n color: \"yellow\",\n label: \"Throttled\",\n tooltip:\n \"This guide is queried and ready to display, but throttled currently\",\n };\n }\n if (annotation.selectable.status === \"returned\") {\n return {\n color: \"blue\",\n label: \"Display\",\n tooltip: \"This guide is queried and ready to display\",\n };\n }\n // Should never happen though.\n return { color: \"red\", label: \"Unknown status\", tooltip: \"Unknown status\" };\n};\n\ntype StatusDot = {\n color: StatusColor;\n tooltip?: string;\n};\n\nconst getStatusDots = (\n guide: AnnotatedGuide | UnknownGuide,\n): Record<keyof AnnotatedStatuses, StatusDot> => {\n if (isUnknownGuide(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 ? \"blue\" : \"red\",\n tooltip: `Not archived: ${!annotation.archived.status ? \"Yes\" : \"No\"}`,\n };\n\n const targetable: StatusDot = {\n color: annotation.targetable.status ? \"blue\" : \"red\",\n tooltip: `Targeted: ${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 let selectable: StatusDot;\n switch (annotation.selectable.status) {\n case \"returned\":\n selectable = { color: \"blue\", tooltip: \"Ready for display\" };\n break;\n\n case \"throttled\":\n selectable = { color: \"yellow\", tooltip: \"Throttled\" };\n break;\n\n case \"queried\":\n selectable = { color: \"gray\", tooltip: \"Queued\" };\n break;\n\n case undefined:\n default:\n selectable = { color: \"red\", tooltip: \"Not found\" };\n break;\n }\n\n return { active, archived, targetable, activatable, selectable };\n};\n\ntype Props = {\n guide: UnknownGuide | 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\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 >\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.tooltip}>\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 isUnknownGuide(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 isUnknownGuide(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 isUnknownGuide(guide) ||\n guide.annotation.selectable.status === undefined\n ? \"No component found that can render this guide\"\n : isFocused\n ? \"Unfocus this guide\"\n : \"Focus on this guide\"\n }\n >\n <Button\n size=\"0\"\n variant={isFocused ? \"solid\" : \"outline\"}\n color={isFocused ? \"blue\" : \"gray\"}\n disabled={\n isUnknownGuide(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":["Pill","label","color","children","React","Stack","Text","getStatusSummary","guide","isUnknownGuide","tooltip","annotation","active","status","archived","targetable","selectable","undefined","activatable","message","getStatusDots","GuideRow","orderIndex","isExpanded","onClick","client","useGuideContext","debugSettings","useStore","store","state","debug","isHovered","setIsHovered","useState","focusedGuideKeys","hasFocus","Object","keys","length","isFocused","key","dots","summary","Box","cursor","minWidth","flex","bypass_global_group_limit","Icon","Gauge","flexShrink","Tooltip","display","overflow","textOverflow","whiteSpace","maxWidth","Tag","isEligible","StatusDot","isQualified","Button","e","stopPropagation","setDebug","GuideRowDetails"],"mappings":"oyBA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KxB,YAAYhB,MACxB,QAASwC,EAAKxB,YAAYR,OAAS,CAAA,kBAEpCkD,EAAAA,wBACC,CAAA,MAAOlB,EAAK1B,WAAWd,MACvB,QAASwC,EAAK1B,WAAWN,OAAAA,CAAS,CAEtC,EAEAN,EAAA,cAACgD,EAAAA,QACC,CAAA,MACE3C,EAAAA,eAAeD,CAAK,GACpBA,EAAMG,WAAWK,WAAWH,SAAWI,OACnC,gDACAuB,EACE,qBACA,qBAAA,EAGPpC,EAAA,cAAA0D,EAAAA,OAAA,CACC,KAAK,IACL,QAAStB,EAAY,QAAU,UAC/B,MAAOA,EAAY,OAAS,OAC5B,SACE/B,EAAeD,eAAAA,CAAK,GACpBA,EAAMG,WAAWK,WAAWH,SAAWI,OAEzC,QAAU8C,GAAwB,CAChCA,EAAEC,gBAAgB,EAClBvC,EAAOwC,SAAS,CACd,GAAGtC,EACHQ,iBAAkBK,EAAY,GAAK,CAAE,CAAChC,EAAMiC,GAAG,EAAG,EAAA,CAAK,CACxD,CACH,CAAA,EAAE,OAGJ,CACF,CACF,CACF,EAEClB,GAAcnB,EAAA,cAAC8D,EAAgB,gBAAA,CAAA,MAAA1D,CAAA,CAAgB,CAClD,CAEJ"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=require("@telegraph/layout"),o=require("@telegraph/typography"),c=require("./GuideAnnotatedStatusDot.js"),i=require("./useInspectGuideClientStore.js"),d=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=d(n),s=({title:t,children:a})=>e.default.createElement(u.Stack,{direction:"column",justify:"flex-start",gap:"1",px:"1_5",py:"1",rounded:"2",bg:"surface-1",border:"px",borderColor:"gray-4",style:{flex:1}},e.default.createElement(o.Text,{as:"span",size:"0",color:"gray",weight:"medium"},t),e.default.createElement(u.Stack,{direction:"column",gap:"1",mt:"1"},a)),r=({label:t,value:a,color:l})=>e.default.createElement(u.Stack,{align:"center",gap:"1"},e.default.createElement(c.GuideAnnotatedStatusDot,{color:l,tooltip:`${t}: ${a}`}),e.default.createElement(o.Text,{as:"span",size:"1",weight:"medium"},t,":"),e.default.createElement(o.Text,{as:"span",size:"1",weight:"medium",color:l},a)),f=t=>{switch(t){case"returned":return{value:"Ready to display",color:"blue"};case"throttled":return{value:"Throttled",color:"yellow"};case"queried":return{value:"Queued",color:"gray"};default:return{value:"Not found",color:"red"}}},m=({guide:t})=>{if(i.isUnknownGuide(t))return e.default.createElement(u.Box,{px:"3",py:"2"},e.default.createElement(o.Text,{as:"span",size:"1",color:"gray"},"This guide has never been committed and published."));const{annotation:a}=t,l=f(a.selectable.status);return e.default.createElement(u.Stack,{px:"3",py:"2",gap:"2",direction:"row",align:"flex-start"},e.default.createElement(s,{title:"Eligibility"},e.default.createElement(r,{label:"Active",value:a.active.status?"Yes":"No",color:a.active.status?"blue":"red"}),e.default.createElement(r,{label:"Not archived",value:a.archived.status?"No":"Yes",color:a.archived.status?"red":"blue"}),e.default.createElement(r,{label:"Targeting",value:a.targetable.status?"Yes":"No",color:a.targetable.status?"blue":"red"})),e.default.createElement(s,{title:"Visibility"},e.default.createElement(r,{label:"Activation",value:a.activatable.status?"Yes":"No",color:a.activatable.status?"blue":"red"}),e.default.createElement(r,{label:"Display",value:l.value,color:l.color})))};exports.GuideRowDetails=m;
2
+ //# sourceMappingURL=GuideRowDetails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuideRowDetails.js","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx"],"sourcesContent":["import { Box, Stack } from \"@telegraph/layout\";\nimport { Text } from \"@telegraph/typography\";\n\nimport {\n StatusColor,\n GuideAnnotatedStatusDot as StatusDot,\n} from \"./GuideAnnotatedStatusDot\";\nimport {\n AnnotatedGuide,\n UnknownGuide,\n isUnknownGuide,\n} from \"./useInspectGuideClientStore\";\n\nconst CardContainer = ({\n title,\n children,\n}: {\n title: string;\n children: React.ReactNode;\n}) => (\n <Stack\n direction=\"column\"\n justify=\"flex-start\"\n gap=\"1\"\n px=\"1_5\"\n py=\"1\"\n rounded=\"2\"\n bg=\"surface-1\"\n border=\"px\"\n borderColor=\"gray-4\"\n style={{ flex: 1 }}\n >\n <Text as=\"span\" size=\"0\" color=\"gray\" weight=\"medium\">\n {title}\n </Text>\n <Stack direction=\"column\" gap=\"1\" mt=\"1\">\n {children}\n </Stack>\n </Stack>\n);\n\nconst StatusRow = ({\n label,\n value,\n color,\n}: {\n label: string;\n value: string;\n color: StatusColor;\n}) => (\n <Stack align=\"center\" gap=\"1\">\n <StatusDot color={color} tooltip={`${label}: ${value}`} />\n <Text as=\"span\" size=\"1\" weight=\"medium\">\n {label}:\n </Text>\n <Text as=\"span\" size=\"1\" weight=\"medium\" color={color}>\n {value}\n </Text>\n </Stack>\n);\n\nconst getDisplayValue = (\n status: \"returned\" | \"throttled\" | \"queried\" | undefined,\n): { value: string; color: StatusColor } => {\n switch (status) {\n case \"returned\":\n return { value: \"Ready to display\", color: \"blue\" };\n case \"throttled\":\n return { value: \"Throttled\", color: \"yellow\" };\n case \"queried\":\n return { value: \"Queued\", color: \"gray\" };\n default:\n return { value: \"Not found\", color: \"red\" };\n }\n};\n\nexport const GuideRowDetails = ({\n guide,\n}: {\n guide: AnnotatedGuide | UnknownGuide;\n}) => {\n if (isUnknownGuide(guide)) {\n return (\n <Box px=\"3\" py=\"2\">\n <Text as=\"span\" size=\"1\" color=\"gray\">\n This guide has never been committed and published.\n </Text>\n </Box>\n );\n }\n\n const { annotation } = guide;\n const display = getDisplayValue(annotation.selectable.status);\n\n return (\n <Stack px=\"3\" py=\"2\" gap=\"2\" direction=\"row\" align=\"flex-start\">\n <CardContainer title=\"Eligibility\">\n <StatusRow\n label=\"Active\"\n value={annotation.active.status ? \"Yes\" : \"No\"}\n color={annotation.active.status ? \"blue\" : \"red\"}\n />\n <StatusRow\n label=\"Not archived\"\n value={!annotation.archived.status ? \"Yes\" : \"No\"}\n color={!annotation.archived.status ? \"blue\" : \"red\"}\n />\n <StatusRow\n label=\"Targeting\"\n value={annotation.targetable.status ? \"Yes\" : \"No\"}\n color={annotation.targetable.status ? \"blue\" : \"red\"}\n />\n </CardContainer>\n\n <CardContainer title=\"Visibility\">\n <StatusRow\n label=\"Activation\"\n value={annotation.activatable.status ? \"Yes\" : \"No\"}\n color={annotation.activatable.status ? \"blue\" : \"red\"}\n />\n <StatusRow\n label=\"Display\"\n value={display.value}\n color={display.color}\n />\n </CardContainer>\n </Stack>\n );\n};\n"],"names":["CardContainer","title","children","React","Stack","flex","Text","StatusRow","label","value","color","StatusDot","getDisplayValue","status","GuideRowDetails","guide","isUnknownGuide","Box","annotation","display","selectable","active","archived","targetable","activatable"],"mappings":"iUAaMA,EAAgBA,CAAC,CACrBC,MAAAA,EACAC,SAAAA,CAIF,IACEC,UAAA,cAACC,SACC,UAAU,SACV,QAAQ,aACR,IAAI,IACJ,GAAG,MACH,GAAG,IACH,QAAQ,IACR,GAAG,YACH,OAAO,KACP,YAAY,SACZ,MAAO,CAAEC,KAAM,CAAE,CAEjB,EAAAF,EAAA,QAAA,cAACG,EAAAA,MAAK,GAAG,OAAO,KAAK,IAAI,MAAM,OAAO,OAAO,QAAA,EAC1CL,CACH,EACAE,EAAAA,QAAA,cAACC,SAAM,UAAU,SAAS,IAAI,IAAI,GAAG,GAClCF,EAAAA,CACH,CACF,EAGIK,EAAYA,CAAC,CACjBC,MAAAA,EACAC,MAAAA,EACAC,MAAAA,CAKF,4BACGN,EAAAA,MAAM,CAAA,MAAM,SAAS,IAAI,KACvBD,EAAAA,QAAA,cAAAQ,EAAA,wBAAA,CAAU,MAAAD,EAAc,QAAS,GAAGF,CAAK,KAAKC,CAAK,EAAA,CAAG,EACtDN,EAAAA,QAAA,cAAAG,EAAA,KAAA,CAAK,GAAG,OAAO,KAAK,IAAI,OAAO,UAC7BE,EAAM,GACT,EACAL,EAAA,QAAA,cAACG,EAAAA,KAAK,CAAA,GAAG,OAAO,KAAK,IAAI,OAAO,S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M,aACN,MAAOW,EAAWM,YAAYX,OAAS,MAAQ,KAC/C,MAAOK,EAAWM,YAAYX,OAAS,OAAS,MAAM,EAEvDV,EAAA,QAAA,cAAAI,EAAA,CACC,MAAM,UACN,MAAOY,EAAQV,MACf,MAAOU,EAAQT,KAAM,CAAA,CAEzB,CACF,CAEJ"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("@knocklabs/react-core"),p=require("@telegraph/button"),i=require("@telegraph/layout"),q=require("@telegraph/typography"),b=require("lucide-react"),R=require("react"),G=require("../KnockButton.js"),S=require("../shared.js");;/* empty css */const m=require("./DragHandle.js"),w=require("./GuideContextDetails.js"),k=require("./GuideRow.js"),B=require("./GuidesListDisplaySelect.js"),D=require("./helpers.js"),I=require("./useDraggable.js"),L=require("./useInspectGuideClientStore.js"),_=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=_(R),z=({guides:t,displayOption:l})=>t.map((s,n)=>{const{isEligible:a,isQualified:u,selectable:c}=s.annotation,o=a&&u,d=o&&c.status==="returned";return l==="only-displaying"&&!d||l==="only-displayable"&&!o||l==="all-eligible"&&!a?null:e.default.createElement(k.GuideRow,{key:s.key,guide:s,orderIndex:n})}),V=()=>{const{client:t}=h.useGuideContext(),[l,s]=e.default.useState("all-guides"),[n,a]=e.default.useState(()=>D.getRunConfig()),[u,c]=e.default.useState(!1);e.default.useEffect(()=>{var g;const{isVisible:r=!1,focusedGuideKeys:x={}}=n||{},C=(g=t.store.state.debug)==null?void 0:g.debugging;return r&&!C&&t.setDebug({focusedGuideKeys:x}),()=>{t.unsetDebug()}},[n,t]);const o=e.default.useRef(null),{position:d,isDragging:y,handlePointerDown:E}=I.useDraggable({elementRef:o,reclampDeps:[u],rightPadding:m.DRAG_HANDLE_OVERHANG,initialPosition:{top:16,right:16}}),f=L.useInspectGuideClientStore(n);return!f||!(n!=null&&n.isVisible)?null:e.default.createElement(i.Box,{tgphRef:o,position:"fixed",style:{top:d.top+"px",right:d.right+"px",zIndex:S.TOOLBAR_Z_INDEX}},e.default.createElement(m.DragHandle,{onPointerDown:E,isDragging:y}),u?e.default.createElement(G.KnockButton,{onClick:()=>c(!1),positioned:!1}):e.default.createElement(i.Stack,{direction:"column",backgroundColor:"surface-2",shadow:"2",rounded:"3",border:"px",overflow:"hidden",style:{width:"400px"}},e.default.createElement(i.Stack,{w:"full",p:"2",justify:"space-between",direction:"row",style:{boxSizing:"border-box"}},e.default.createElement(i.Box,{style:{width:"220px"}},e.default.createElement(B.GuidesListDisplaySelect,{value:l,onChange:r=>s(r)})),e.default.createElement(i.Stack,{gap:"2"},e.default.createElement(p.Button,{onClick:()=>{a(r=>({...r,isVisible:!1})),D.clearRunConfigLS(),t.unsetDebug()},size:"1",variant:"soft",trailingIcon:{icon:b.Undo2,"aria-hidden":!0}},"Exit"),e.default.createElement(p.Button,{onClick:()=>c(!0),size:"1",variant:"soft",leadingIcon:{icon:b.Minimize2,alt:"Collapse guide toolbar"}}))),e.default.createElement(i.Box,{w:"full"},e.default.createElement(w.GuideContextDetails,null),f.error&&e.default.createElement(i.Box,{px:"2",pb:"1"},e.default.createElement(q.Text,{as:"span",size:"0",weight:"medium",color:"red"},f.error)),e.default.createElement(z,{guides:f.guides,displayOption:l}))))};exports.V2=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("@knocklabs/react-core"),f=require("@telegraph/button"),R=require("@telegraph/icon"),o=require("@telegraph/layout"),m=require("@telegraph/segmented-control"),b=require("@telegraph/tooltip"),q=require("@telegraph/typography"),r=require("lucide-react"),B=require("react"),z=require("../KnockButton.js"),O=require("../shared.js");;/* empty css */const G=require("./GuideContextDetails.js"),P=require("./GuideRow.js"),w=require("./helpers.js"),T=require("./useDraggable.js"),_=require("./useInspectGuideClientStore.js"),V=n=>n&&typeof n=="object"&&"default"in n?n:{default:n},e=V(B),A="540px",j=({guides:n,displayOption:s})=>{const[c,l]=e.default.useState();return e.default.useEffect(()=>{l(void 0)},[s]),n.map((i,p)=>{const{isEligible:d,isQualified:u}=i.annotation;return s==="only-displayable"&&!(d&&u)||s==="only-eligible"&&!d?null:e.default.createElement(P.GuideRow,{key:i.key,guide:i,orderIndex:p,isExpanded:i.key===c,onClick:()=>{l(a=>a&&a===i.key?void 0:i.key)}})})},K=()=>{const{client:n}=D.useGuideContext(),[s,c]=e.default.useState("only-eligible"),[l,i]=e.default.useState(()=>w.getRunConfig()),[p,d]=e.default.useState(!1),[u,x]=e.default.useState(!1),{debugSettings:a}=D.useStore(n.store,t=>({debugSettings:t.debug||{}}));e.default.useEffect(()=>{var C;const{isVisible:t=!1,focusedGuideKeys:k={}}=l||{},I=(C=n.store.state.debug)==null?void 0:C.debugging;return t&&!I&&(n.setDebug({focusedGuideKeys:k}),Object.keys(k).length>0&&c("all-guides")),()=>{n.unsetDebug()}},[l,n,c]);const h=e.default.useRef(null),{position:S,isDragging:y,handlePointerDown:E,hasDraggedRef:v}=T.useDraggable({elementRef:h,reclampDeps:[p],initialPosition:{top:16,right:16}}),g=_.useInspectGuideClientStore(l);return!g||!(l!=null&&l.isVisible)?null:e.default.createElement(o.Box,{tgphRef:h,position:"fixed",style:{top:S.top+"px",right:S.right+"px",zIndex:O.TOOLBAR_Z_INDEX}},p?e.default.createElement(o.Stack,{border:"px",rounded:"4",align:"center",justify:"center",w:"10",h:"10",onPointerDown:E,backgroundColor:"surface-1",style:{cursor:y?"grabbing":"grab",touchAction:"none",userSelect:"none"}},e.default.createElement(o.Box,{style:{transform:"scale(0.7)",transformOrigin:"center center"}},e.default.createElement(z.KnockButton,{onClick:()=>{v.current||d(!1)},positioned:!1}))):e.default.createElement(o.Stack,{direction:"column",backgroundColor:"surface-1",rounded:"4",border:"px",overflow:"hidden",style:{width:A,boxShadow:"0 8px 32px var(--tgph-gray-5)"}},e.default.createElement(o.Stack,{w:"full",p:"2",justify:"space-between",direction:"row",align:"center",gap:"2",borderBottom:"px",onPointerDown:E,style:{boxSizing:"border-box",cursor:y?"grabbing":"grab",touchAction:"none",userSelect:"none"}},e.default.createElement(o.Stack,{align:"center",gap:"1_5",style:{minWidth:0,flex:1}},e.default.createElement(o.Stack,{display:"inline-flex",align:"center",style:{cursor:y?"grabbing":"grab",touchAction:"none",userSelect:"none"},onPointerDown:t=>{t.stopPropagation(),E(t)}},e.default.createElement(R.Icon,{color:"gray",size:"1",icon:r.GripVertical,"aria-hidden":!0})),e.default.createElement(o.Stack,{align:"center",gap:"1_5",onPointerDown:t=>t.stopPropagation()},e.default.createElement(m.SegmentedControl.Root,{size:"1",type:"single",value:s,onValueChange:t=>{t&&c(t)}},e.default.createElement(m.SegmentedControl.Option,{value:"all-guides"},"All guides"),e.default.createElement(m.SegmentedControl.Option,{value:"only-eligible"},"Eligible"),e.default.createElement(m.SegmentedControl.Option,{value:"only-displayable"},"On this page")),e.default.createElement(b.Tooltip,{label:"Sandbox: Contain engagement actions to client side only"},e.default.createElement(f.Button,{size:"1",variant:a.skipEngagementTracking?"outline":"ghost",color:a.skipEngagementTracking?"blue":"gray",icon:{icon:r.Box,alt:"Sandbox mode"},onClick:()=>{n.setDebug({...a,skipEngagementTracking:!a.skipEngagementTracking})}})),e.default.createElement(b.Tooltip,{label:"Ignore throttle: Show next guide immediately"},e.default.createElement(f.Button,{size:"1",variant:a.ignoreDisplayInterval?"outline":"ghost",color:a.ignoreDisplayInterval?"blue":"gray",icon:{icon:r.Gauge,alt:"Ignore throttle"},onClick:()=>{n.setDebug({...a,ignoreDisplayInterval:!a.ignoreDisplayInterval})}})),e.default.createElement(b.Tooltip,{label:"Inspect target params"},e.default.createElement(f.Button,{size:"1",variant:u?"outline":"ghost",color:u?"blue":"gray",leadingIcon:{icon:r.SlidersHorizontal,alt:"Inspect target params"},trailingIcon:u?{icon:r.ChevronDown,alt:"Hide context data"}:{icon:r.ChevronRight,alt:"Show context data"},onClick:()=>x(t=>!t)})))),e.default.createElement(o.Stack,{align:"center",gap:"1_5",style:{flexShrink:0},onPointerDown:t=>t.stopPropagation()},e.default.createElement(o.Stack,{align:"center",gap:"1_5"},e.default.createElement(f.Button,{size:"1",variant:"outline",leadingIcon:{icon:r.LogOut,alt:"Exit"},onClick:()=>{i(t=>({...t,isVisible:!1})),w.clearRunConfigLS(),n.unsetDebug()}},"Exit"),e.default.createElement(b.Tooltip,{label:"Minimize toolbar"},e.default.createElement(f.Button,{size:"1",variant:"outline",leadingIcon:{icon:r.Minimize2,alt:"Minimize"},onClick:()=>d(!0)}))))),u&&e.default.createElement(o.Box,{borderBottom:"px"},e.default.createElement(G.GuideContextDetails,null)),e.default.createElement(o.Box,{p:"1",overflow:"auto",style:{maxHeight:"calc(80vh - 96px)"}},g.status==="error"?e.default.createElement(o.Box,{px:"2",pb:"1"},e.default.createElement(q.Text,{as:"span",size:"1",weight:"medium",color:g.error==="no_guides_fetched"?"default":"red"},g.message)):e.default.createElement(j,{guides:g.guides,displayOption:s}))))};exports.V2=K;
2
2
  //# sourceMappingURL=V2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"V2.js","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/V2.tsx"],"sourcesContent":["import { useGuideContext } from \"@knocklabs/react-core\";\nimport { Button } from \"@telegraph/button\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { Text } from \"@telegraph/typography\";\nimport { Minimize2, Undo2 } from \"lucide-react\";\nimport React from \"react\";\n\nimport { KnockButton } from \"../KnockButton\";\nimport { TOOLBAR_Z_INDEX } from \"../shared\";\nimport \"../styles.css\";\n\nimport { DRAG_HANDLE_OVERHANG, DragHandle } from \"./DragHandle\";\nimport { GuideContextDetails } from \"./GuideContextDetails\";\nimport { GuideRow } from \"./GuideRow\";\nimport {\n DisplayOption,\n GuidesListDisplaySelect,\n} from \"./GuidesListDisplaySelect\";\nimport { clearRunConfigLS, getRunConfig } from \"./helpers\";\nimport { useDraggable } from \"./useDraggable\";\nimport {\n InspectionResult,\n useInspectGuideClientStore,\n} from \"./useInspectGuideClientStore\";\n\nconst GuidesList = ({\n guides,\n displayOption,\n}: {\n guides: InspectionResult[\"guides\"];\n displayOption: DisplayOption;\n}) => {\n return guides.map((guide, idx) => {\n const { isEligible, isQualified, selectable } = guide.annotation;\n const isDisplayable = isEligible && isQualified;\n const isDisplaying = isDisplayable && selectable.status === \"returned\";\n\n if (displayOption === \"only-displaying\" && !isDisplaying) {\n return null;\n }\n if (displayOption === \"only-displayable\" && !isDisplayable) {\n return null;\n }\n if (displayOption === \"all-eligible\" && !isEligible) {\n return null;\n }\n\n return <GuideRow key={guide.key} guide={guide} orderIndex={idx} />;\n });\n};\n\nexport const V2 = () => {\n const { client } = useGuideContext();\n\n const [guidesListDisplayOption, setGuidesListDisplayOption] =\n React.useState<DisplayOption>(\"all-guides\");\n\n const [runConfig, setRunConfig] = React.useState(() => getRunConfig());\n const [isCollapsed, setIsCollapsed] = React.useState(false);\n\n React.useEffect(() => {\n const { isVisible = false, focusedGuideKeys = {} } = runConfig || {};\n const isDebugging = client.store.state.debug?.debugging;\n if (isVisible && !isDebugging) {\n client.setDebug({ focusedGuideKeys });\n }\n\n return () => {\n client.unsetDebug();\n };\n }, [runConfig, client]);\n\n const containerRef = React.useRef<HTMLDivElement>(null);\n const { position, isDragging, handlePointerDown } = useDraggable({\n elementRef: containerRef,\n reclampDeps: [isCollapsed],\n rightPadding: DRAG_HANDLE_OVERHANG,\n initialPosition: { top: 16, right: 16 },\n });\n\n const result = useInspectGuideClientStore(runConfig);\n if (!result || !runConfig?.isVisible) {\n return null;\n }\n\n return (\n <Box\n tgphRef={containerRef}\n position=\"fixed\"\n style={{\n top: position.top + \"px\",\n right: position.right + \"px\",\n zIndex: TOOLBAR_Z_INDEX,\n }}\n >\n <DragHandle onPointerDown={handlePointerDown} isDragging={isDragging} />\n {isCollapsed ? (\n <KnockButton onClick={() => setIsCollapsed(false)} positioned={false} />\n ) : (\n <Stack\n direction=\"column\"\n backgroundColor=\"surface-2\"\n shadow=\"2\"\n rounded=\"3\"\n border=\"px\"\n overflow=\"hidden\"\n style={{ width: \"400px\" }}\n >\n <Stack\n w=\"full\"\n p=\"2\"\n justify=\"space-between\"\n direction=\"row\"\n style={{ boxSizing: \"border-box\" }}\n >\n <Box style={{ width: \"220px\" }}>\n <GuidesListDisplaySelect\n value={guidesListDisplayOption}\n onChange={(opt) => setGuidesListDisplayOption(opt)}\n />\n </Box>\n\n <Stack gap=\"2\">\n <Button\n onClick={() => {\n setRunConfig((curr) => ({ ...curr, isVisible: false }));\n clearRunConfigLS();\n client.unsetDebug();\n }}\n size=\"1\"\n variant=\"soft\"\n trailingIcon={{ icon: Undo2, \"aria-hidden\": true }}\n >\n Exit\n </Button>\n <Button\n onClick={() => setIsCollapsed(true)}\n size=\"1\"\n variant=\"soft\"\n leadingIcon={{ icon: Minimize2, alt: \"Collapse guide toolbar\" }}\n />\n </Stack>\n </Stack>\n\n <Box w=\"full\">\n <GuideContextDetails />\n {result.error && (\n <Box px=\"2\" pb=\"1\">\n <Text as=\"span\" size=\"0\" weight=\"medium\" color=\"red\">\n {result.error}\n </Text>\n </Box>\n )}\n <GuidesList\n guides={result.guides}\n displayOption={guidesListDisplayOption}\n />\n </Box>\n </Stack>\n )}\n </Box>\n );\n};\n"],"names":["GuidesList","guides","displayOption","map","guide","idx","isEligible","isQualified","selectable","annotation","isDisplayable","isDisplaying","status","GuideRow","key","V2","client","useGuideContext","guidesListDisplayOption","setGuidesListDisplayOption","React","useState","runConfig","setRunConfig","getRunConfig","isCollapsed","setIsCollapsed","useEffect","isVisible","focusedGuideKeys","isDebugging","store","state","debug","debugging","setDebug","unsetDebug","containerRef","useRef","position","isDragging","handlePointerDown","useDraggable","elementRef","reclampDeps","rightPadding","DRAG_HANDLE_OVERHANG","initialPosition","top","right","result","useInspectGuideClientStore","Box","zIndex","TOOLBAR_Z_INDEX","DragHandle","KnockButton","Stack","width","boxSizing","GuidesListDisplaySelect","opt","Button","curr","clearRunConfigLS","icon","Undo2","Minimize2","alt","GuideContextDetails","error","Text"],"m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EAClC,KAAK,IACL,QAAQ,OACR,YAAa,CAAEuC,KAAME,EAAAA,UAAWC,IAAK,0BAA2B,CAEpE,CACF,EAEChD,EAAA,QAAA,cAAAgC,EAAAA,IAAA,CAAI,EAAE,MACL,EAAAhC,EAAA,QAAA,cAACiD,0BAAmB,EACnBnB,EAAOoB,OACLlD,EAAA,QAAA,cAAAgC,EAAAA,IAAA,CAAI,GAAG,IAAI,GAAG,KACZhC,EAAA,QAAA,cAAAmD,EAAAA,KAAA,CAAK,GAAG,OAAO,KAAK,IAAI,OAAO,SAAS,MAAM,KAAA,EAC5CrB,EAAOoB,KACV,CACF,EAEDlD,UAAA,cAAApB,EAAA,CACC,OAAQkD,EAAOjD,OACf,cAAeiB,CAAwB,CAAA,CAE3C,CACF,CAEJ,CAEJ"}
1
+ {"version":3,"file":"V2.js","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/V2.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 { SegmentedControl } from \"@telegraph/segmented-control\";\nimport { Tooltip } from \"@telegraph/tooltip\";\nimport { Text } from \"@telegraph/typography\";\nimport {\n Box as BoxIcon,\n ChevronDown,\n ChevronRight,\n Gauge,\n GripVertical,\n LogOut,\n Minimize2,\n SlidersHorizontal,\n} from \"lucide-react\";\nimport React from \"react\";\n\nimport { KnockButton } from \"../KnockButton\";\nimport { TOOLBAR_Z_INDEX } from \"../shared\";\nimport \"../styles.css\";\n\nimport { GuideContextDetails } from \"./GuideContextDetails\";\nimport { GuideRow } from \"./GuideRow\";\nimport { clearRunConfigLS, getRunConfig } from \"./helpers\";\nimport { useDraggable } from \"./useDraggable\";\nimport {\n InspectionResultOk,\n useInspectGuideClientStore,\n} from \"./useInspectGuideClientStore\";\n\nconst TOOLBAR_WIDTH = \"540px\";\n\ntype DisplayOption = \"all-guides\" | \"only-eligible\" | \"only-displayable\";\n\nconst GuidesList = ({\n guides,\n displayOption,\n}: {\n guides: InspectionResultOk[\"guides\"];\n displayOption: DisplayOption;\n}) => {\n const [expandedGuideRowKey, setExpandedGuideRowKey] = React.useState<\n string | undefined\n >();\n\n React.useEffect(() => {\n setExpandedGuideRowKey(undefined);\n }, [displayOption]);\n\n return guides.map((guide, idx) => {\n const { isEligible, isQualified } = guide.annotation;\n const isDisplayable = isEligible && isQualified;\n\n if (displayOption === \"only-displayable\" && !isDisplayable) {\n return null;\n }\n if (displayOption === \"only-eligible\" && !isEligible) {\n return null;\n }\n return (\n <GuideRow\n key={guide.key}\n guide={guide}\n orderIndex={idx}\n isExpanded={guide.key === expandedGuideRowKey}\n onClick={() => {\n setExpandedGuideRowKey((k) =>\n k && k === guide.key ? undefined : guide.key,\n );\n }}\n />\n );\n });\n};\n\nexport const V2 = () => {\n const { client } = useGuideContext();\n\n const [displayOption, setDisplayOption] =\n React.useState<DisplayOption>(\"only-eligible\");\n const [runConfig, setRunConfig] = React.useState(() => getRunConfig());\n const [isCollapsed, setIsCollapsed] = React.useState(false);\n const [isContextPanelOpen, setIsContextPanelOpen] = React.useState(false);\n\n const { debugSettings } = useStore(client.store, (state) => ({\n debugSettings: state.debug || {},\n }));\n\n React.useEffect(() => {\n const { isVisible = false, focusedGuideKeys = {} } = runConfig || {};\n const isDebugging = client.store.state.debug?.debugging;\n if (isVisible && !isDebugging) {\n client.setDebug({ focusedGuideKeys });\n\n // If focused, switch to all guides so you can see in the list.\n if (Object.keys(focusedGuideKeys).length > 0) {\n setDisplayOption(\"all-guides\");\n }\n }\n\n return () => {\n client.unsetDebug();\n };\n }, [runConfig, client, setDisplayOption]);\n\n const containerRef = React.useRef<HTMLDivElement>(null);\n const { position, isDragging, handlePointerDown, hasDraggedRef } =\n useDraggable({\n elementRef: containerRef,\n reclampDeps: [isCollapsed],\n initialPosition: { top: 16, right: 16 },\n });\n\n const result = useInspectGuideClientStore(runConfig);\n if (!result || !runConfig?.isVisible) {\n return null;\n }\n\n return (\n <Box\n tgphRef={containerRef}\n position=\"fixed\"\n style={{\n top: position.top + \"px\",\n right: position.right + \"px\",\n zIndex: TOOLBAR_Z_INDEX,\n }}\n >\n {isCollapsed ? (\n <Stack\n border=\"px\"\n rounded=\"4\"\n align=\"center\"\n justify=\"center\"\n w=\"10\"\n h=\"10\"\n onPointerDown={handlePointerDown}\n backgroundColor=\"surface-1\"\n style={{\n cursor: isDragging ? \"grabbing\" : \"grab\",\n touchAction: \"none\",\n userSelect: \"none\",\n }}\n >\n <Box\n style={{\n transform: \"scale(0.7)\",\n transformOrigin: \"center center\",\n }}\n >\n <KnockButton\n onClick={() => {\n if (!hasDraggedRef.current) {\n setIsCollapsed(false);\n }\n }}\n positioned={false}\n />\n </Box>\n </Stack>\n ) : (\n <Stack\n direction=\"column\"\n backgroundColor=\"surface-1\"\n rounded=\"4\"\n border=\"px\"\n overflow=\"hidden\"\n style={{\n width: TOOLBAR_WIDTH,\n boxShadow: \"0 8px 32px var(--tgph-gray-5)\",\n }}\n >\n {/* Header — also acts as drag handle area */}\n <Stack\n w=\"full\"\n p=\"2\"\n justify=\"space-between\"\n direction=\"row\"\n align=\"center\"\n gap=\"2\"\n borderBottom=\"px\"\n onPointerDown={handlePointerDown}\n style={{\n boxSizing: \"border-box\",\n cursor: isDragging ? \"grabbing\" : \"grab\",\n touchAction: \"none\",\n userSelect: \"none\",\n }}\n >\n {/* Left: drag icon + segmented control + settings */}\n <Stack align=\"center\" gap=\"1_5\" style={{ minWidth: 0, flex: 1 }}>\n <Stack\n display=\"inline-flex\"\n align=\"center\"\n style={{\n cursor: isDragging ? \"grabbing\" : \"grab\",\n touchAction: \"none\",\n userSelect: \"none\",\n }}\n onPointerDown={(e: React.PointerEvent) => {\n // Already handled by parent, prevent double-fire\n e.stopPropagation();\n handlePointerDown(e);\n }}\n >\n <Icon color=\"gray\" size=\"1\" icon={GripVertical} aria-hidden />\n </Stack>\n <Stack\n align=\"center\"\n gap=\"1_5\"\n onPointerDown={(e: React.PointerEvent) => e.stopPropagation()}\n >\n <SegmentedControl.Root\n size=\"1\"\n type=\"single\"\n value={displayOption}\n onValueChange={(val: DisplayOption) => {\n if (!val) return;\n setDisplayOption(val);\n }}\n >\n <SegmentedControl.Option value=\"all-guides\">\n All guides\n </SegmentedControl.Option>\n <SegmentedControl.Option value=\"only-eligible\">\n Eligible\n </SegmentedControl.Option>\n <SegmentedControl.Option value=\"only-displayable\">\n On this page\n </SegmentedControl.Option>\n </SegmentedControl.Root>\n\n <Tooltip label=\"Sandbox: Contain engagement actions to client side only\">\n <Button\n size=\"1\"\n variant={\n debugSettings.skipEngagementTracking ? \"outline\" : \"ghost\"\n }\n color={\n debugSettings.skipEngagementTracking ? \"blue\" : \"gray\"\n }\n icon={{ icon: BoxIcon, alt: \"Sandbox mode\" }}\n onClick={() => {\n client.setDebug({\n ...debugSettings,\n skipEngagementTracking:\n !debugSettings.skipEngagementTracking,\n });\n }}\n />\n </Tooltip>\n\n <Tooltip label=\"Ignore throttle: Show next guide immediately\">\n <Button\n size=\"1\"\n variant={\n debugSettings.ignoreDisplayInterval ? \"outline\" : \"ghost\"\n }\n color={\n debugSettings.ignoreDisplayInterval ? \"blue\" : \"gray\"\n }\n icon={{ icon: Gauge, alt: \"Ignore throttle\" }}\n onClick={() => {\n client.setDebug({\n ...debugSettings,\n ignoreDisplayInterval:\n !debugSettings.ignoreDisplayInterval,\n });\n }}\n />\n </Tooltip>\n\n <Tooltip label=\"Inspect target params\">\n <Button\n size=\"1\"\n variant={isContextPanelOpen ? \"outline\" : \"ghost\"}\n color={isContextPanelOpen ? \"blue\" : \"gray\"}\n leadingIcon={{\n icon: SlidersHorizontal,\n alt: \"Inspect target params\",\n }}\n trailingIcon={\n isContextPanelOpen\n ? { icon: ChevronDown, alt: \"Hide context data\" }\n : { icon: ChevronRight, alt: \"Show context data\" }\n }\n onClick={() => setIsContextPanelOpen((v) => !v)}\n />\n </Tooltip>\n </Stack>\n </Stack>\n\n {/* Right: exit + minimize buttons */}\n <Stack\n align=\"center\"\n gap=\"1_5\"\n style={{ flexShrink: 0 }}\n onPointerDown={(e: React.PointerEvent) => e.stopPropagation()}\n >\n <Stack align=\"center\" gap=\"1_5\">\n <Button\n size=\"1\"\n variant=\"outline\"\n leadingIcon={{ icon: LogOut, alt: \"Exit\" }}\n onClick={() => {\n setRunConfig((curr) => ({ ...curr, isVisible: false }));\n clearRunConfigLS();\n client.unsetDebug();\n }}\n >\n Exit\n </Button>\n <Tooltip label=\"Minimize toolbar\">\n <Button\n size=\"1\"\n variant=\"outline\"\n leadingIcon={{ icon: Minimize2, alt: \"Minimize\" }}\n onClick={() => setIsCollapsed(true)}\n />\n </Tooltip>\n </Stack>\n </Stack>\n </Stack>\n\n {/* Collapsible panel to show context data */}\n {isContextPanelOpen && (\n <Box borderBottom=\"px\">\n <GuideContextDetails />\n </Box>\n )}\n\n {/* Guide list content area */}\n <Box p=\"1\" overflow=\"auto\" style={{ maxHeight: \"calc(80vh - 96px)\" }}>\n {result.status === \"error\" ? (\n <Box px=\"2\" pb=\"1\">\n <Text\n as=\"span\"\n size=\"1\"\n weight=\"medium\"\n color={\n result.error === \"no_guides_fetched\" ? \"default\" : \"red\"\n }\n >\n {result.message}\n </Text>\n </Box>\n ) : (\n <GuidesList\n guides={result.guides}\n displayOption={displayOption}\n />\n )}\n </Box>\n </Stack>\n )}\n </Box>\n );\n};\n"],"names":["TOOLBAR_WIDTH","GuidesList","guides","displayOption","expandedGuideRowKey","setExpandedGuideRowKey","React","useState","useEffect","undefined","map","guide","idx","isEligible","isQualified","annotation","GuideRow","key","k","V2","client","useGuideContext","setDisplayOption","runConfig","setRunConfig","getRunConfig","isCollapsed","setIsCollapsed","isContextPanelOpen","setIsContextPanelOpen","debugSettings","useStore","store","state","debug","isVisible","focusedGuideKeys","isDebugging","debugging","setDebug","Object","keys","length","unsetDebug","containerRef","useRef","position","isDragging","handlePointerDown","hasDraggedRef","useDraggable","elementRef","reclampDeps","initialPosition","top","right","result","useInspectGuideClientStore","Box","zIndex","TOOLBAR_Z_INDEX","Stack","cursor","touchAction","userSelect","transform","transformOrigin","KnockButton","current","width","boxShadow","boxSizing","minWidth","flex","e","stopPropagation","Icon","GripVertical","SegmentedControl","val","Tooltip","Button","skipEngagementTracking","icon","BoxIcon","alt","ignoreDisplayInterval","Gauge","SlidersHorizontal","ChevronDown","ChevronRight","v","flexShrink","LogOut","curr","clearRunConfigLS","Minimize2","GuideContextDetails","maxHeight","status","Text","error","message"],"mappings":"+qBAgCMA,EAAgB,QAIhBC,EAAaA,CAAC,CAClBC,OAAAA,EACAC,cAAAA,CAIF,IAAM,CACJ,KAAM,CAACC,EAAqBC,CAAsB,EAAIC,EAAAA,QAAMC,SAE1D,EAEFD,OAAAA,EAAAA,QAAME,UAAU,IAAM,CACpBH,EAAuBI,MAAS,CAAA,EAC/B,CAACN,CAAa,CAAC,EAEXD,EAAOQ,IAAI,CAACC,EAAOC,IAAQ,CAC1B,KAAA,CAAEC,WAAAA,EAAYC,YAAAA,GAAgBH,EAAMI,WAMtCZ,OAHAA,IAAkB,oBAAsB,EAFtBU,GAAcC,IAKhCX,IAAkB,iBAAmB,CAACU,EACjC,KAGNP,EAAAA,QAAA,cAAAU,EAAAA,SAAA,CACC,IAAKL,EAAMM,IACX,MAAAN,EACA,WAAYC,EACZ,WAAYD,EAAMM,MAAQb,EAC1B,QAAS,IAAM,CACbC,KACEa,GAAKA,IAAMP,EAAMM,IAAMR,OAAYE,EAAMM,GAC3C,CAAA,EAEF,CAAA,CAEL,CACH,EAEaE,EAAKA,IAAM,CAChB,KAAA,CAAEC,OAAAA,GAAWC,kBAAgB,EAE7B,CAAClB,EAAemB,CAAgB,EACpChB,EAAAA,QAAMC,SAAwB,eAAe,EACzC,CAACgB,EAAWC,CAAY,EAAIlB,UAAMC,SAAS,IAAMkB,EAAAA,cAAc,EAC/D,CAACC,EAAaC,CAAc,EAAIrB,EAAAA,QAAMC,SAAS,EAAK,EACpD,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,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),F=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},n=F(C),S={top:16,right:16};function R(e,u,h,o=0){const r=window.innerWidth,f=window.innerHeight,v=u+o,d=r-e.right-u,p=Math.max(0,Math.min(d,r-v)),i=Math.max(0,Math.min(e.top,f-h)),s=r-p-u;return{top:i,right:s}}function I({elementRef:e,initialPosition:u=S,reclampDeps:h=[],rightPadding:o=0}){const[r,f]=n.default.useState(u),[v,d]=n.default.useState(!1),p=n.default.useRef(r);p.current=r;const i=n.default.useRef({x:0,y:0}),s=n.default.useRef({top:0,right:0}),c=n.default.useRef(null),g=n.default.useRef(!1),a=n.default.useRef(null),w=n.default.useCallback(()=>{const t=e.current;if(!t)return;const l=t.getBoundingClientRect();f(m=>R(m,l.width,l.height,o))},[e,o]),y=n.default.useCallback(t=>{t.preventDefault(),i.current={x:t.clientX,y:t.clientY},s.current={...p.current},g.current=!0,d(!0);const l=E=>{g.current&&c.current===null&&(c.current=requestAnimationFrame(()=>{if(c.current=null,!g.current)return;const L=E.clientX-i.current.x,x=E.clientY-i.current.y,M={top:s.current.top+x,right:s.current.right-L},P=e.current;if(!P)return;const b=P.getBoundingClientRect(),A=R(M,b.width,b.height,o);f(A)}))},m=()=>{g.current=!1,d(!1),c.current!==null&&(cancelAnimationFrame(c.current),c.current=null),document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",D),a.current=null},D=()=>m();document.addEventListener("pointermove",l),document.addEventListener("pointerup",D),a.current=m},[e,o]);return n.default.useEffect(()=>()=>{var t;(t=a.current)==null||t.call(a)},[]),n.default.useEffect(()=>{const t=()=>w();return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[w]),n.default.useEffect(()=>{const t=requestAnimationFrame(()=>w());return()=>cancelAnimationFrame(t)},h),{position:r,isDragging:v,handlePointerDown:y}}exports.clampPosition=R;exports.useDraggable=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),_=n=>n&&typeof n=="object"&&"default"in n?n:{default:n},e=_(T),H={top:16,right:16},I=5;function y(n,i,w,o=0){const r=window.innerWidth,f=window.innerHeight,D=i+o,d=r-n.right-i,p=Math.max(0,Math.min(d,r-D)),c=Math.max(0,Math.min(n.top,f-w)),s=r-p-i;return{top:c,right:s}}function O({elementRef:n,initialPosition:i=H,reclampDeps:w=[],rightPadding:o=0}){const[r,f]=e.default.useState(i),[D,d]=e.default.useState(!1),p=e.default.useRef(r);p.current=r;const c=e.default.useRef({x:0,y:0}),s=e.default.useRef({top:0,right:0}),u=e.default.useRef(null),g=e.default.useRef(!1),m=e.default.useRef(!1),a=e.default.useRef(null),v=e.default.useCallback(()=>{const t=n.current;if(!t)return;const l=t.getBoundingClientRect();f(h=>y(h,l.width,l.height,o))},[n,o]),P=e.default.useCallback(t=>{t.preventDefault(),c.current={x:t.clientX,y:t.clientY},s.current={...p.current},g.current=!0,m.current=!1,d(!0);const l=R=>{if(!g.current)return;const b=R.clientX-c.current.x,M=R.clientY-c.current.y;!m.current&&Math.hypot(b,M)>=I&&(m.current=!0),u.current===null&&(u.current=requestAnimationFrame(()=>{if(u.current=null,!g.current)return;const A=R.clientX-c.current.x,S=R.clientY-c.current.y,C={top:s.current.top+S,right:s.current.right-A},E=n.current;if(!E)return;const L=E.getBoundingClientRect(),F=y(C,L.width,L.height,o);f(F)}))},h=()=>{g.current=!1,d(!1),u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",x),a.current=null},x=()=>h();document.addEventListener("pointermove",l),document.addEventListener("pointerup",x),a.current=h},[n,o]);return e.default.useEffect(()=>()=>{var t;(t=a.current)==null||t.call(a)},[]),e.default.useEffect(()=>{const t=()=>v();return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[v]),e.default.useEffect(()=>{const t=requestAnimationFrame(()=>v());return()=>cancelAnimationFrame(t)},w),{position:r,isDragging:D,handlePointerDown:P,hasDraggedRef:m}}exports.clampPosition=y;exports.useDraggable=O;
2
2
  //# sourceMappingURL=useDraggable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDraggable.js","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/useDraggable.ts"],"sourcesContent":["import React from \"react\";\n\n// NOTE: This hook was generated entirely with Claude then lightly touched up,\n// and the behavior works correctly from testing it manually in the browser.\n\ntype Position = { top: number; right: number };\n\ntype UseDraggableOptions = {\n elementRef: React.RefObject<HTMLElement | null>;\n initialPosition?: Position;\n reclampDeps?: React.DependencyList;\n /** Extra space to reserve beyond the element's right edge (px). */\n rightPadding?: number;\n};\n\ntype UseDraggableReturn = {\n position: Position;\n isDragging: boolean;\n handlePointerDown: (e: React.PointerEvent) => void;\n};\n\nconst DEFAULT_POSITION: Position = { top: 16, right: 16 };\n\n/**\n * @param rightPadding Extra space to reserve on the right edge (e.g. for a\n * drag handle that protrudes beyond the element). The element's left edge\n * is clamped so that `elementWidth + rightPadding` stays within the viewport.\n */\nexport function clampPosition(\n pos: Position,\n elementWidth: number,\n elementHeight: number,\n rightPadding = 0,\n): Position {\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n const totalWidth = elementWidth + rightPadding;\n const left = viewportWidth - pos.right - elementWidth;\n const clampedLeft = Math.max(0, Math.min(left, viewportWidth - totalWidth));\n const clampedTop = Math.max(\n 0,\n Math.min(pos.top, viewportHeight - elementHeight),\n );\n const clampedRight = viewportWidth - clampedLeft - elementWidth;\n\n return { top: clampedTop, right: clampedRight };\n}\n\nexport function useDraggable({\n elementRef,\n initialPosition = DEFAULT_POSITION,\n reclampDeps = [],\n rightPadding = 0,\n}: UseDraggableOptions): UseDraggableReturn {\n const [position, setPosition] = React.useState<Position>(initialPosition);\n const [isDragging, setIsDragging] = React.useState(false);\n\n const positionRef = React.useRef(position);\n positionRef.current = position;\n\n const startPointerRef = React.useRef({ x: 0, y: 0 });\n const startPositionRef = React.useRef<Position>({ top: 0, right: 0 });\n const rafIdRef = React.useRef<number | null>(null);\n const isDraggingRef = React.useRef(false);\n const cleanupListenersRef = React.useRef<(() => void) | null>(null);\n\n const reclamp = React.useCallback(() => {\n const el = elementRef.current;\n if (!el) return;\n const rect = el.getBoundingClientRect();\n setPosition((prev) =>\n clampPosition(prev, rect.width, rect.height, rightPadding),\n );\n }, [elementRef, rightPadding]);\n\n // Stable pointerdown handler\n const handlePointerDown = React.useCallback(\n (e: React.PointerEvent) => {\n e.preventDefault();\n startPointerRef.current = { x: e.clientX, y: e.clientY };\n startPositionRef.current = { ...positionRef.current };\n isDraggingRef.current = true;\n setIsDragging(true);\n\n const onPointerMove = (moveEvent: PointerEvent) => {\n if (!isDraggingRef.current) return;\n\n if (rafIdRef.current !== null) return;\n\n rafIdRef.current = requestAnimationFrame(() => {\n rafIdRef.current = null;\n if (!isDraggingRef.current) return;\n\n const dx = moveEvent.clientX - startPointerRef.current.x;\n const dy = moveEvent.clientY - startPointerRef.current.y;\n\n const newPos: Position = {\n top: startPositionRef.current.top + dy,\n right: startPositionRef.current.right - dx,\n };\n\n const el = elementRef.current;\n if (!el) return;\n const rect = el.getBoundingClientRect();\n const clamped = clampPosition(\n newPos,\n rect.width,\n rect.height,\n rightPadding,\n );\n setPosition(clamped);\n });\n };\n\n const cleanup = () => {\n isDraggingRef.current = false;\n setIsDragging(false);\n if (rafIdRef.current !== null) {\n cancelAnimationFrame(rafIdRef.current);\n rafIdRef.current = null;\n }\n document.removeEventListener(\"pointermove\", onPointerMove);\n document.removeEventListener(\"pointerup\", onPointerUp);\n cleanupListenersRef.current = null;\n };\n\n const onPointerUp = () => cleanup();\n\n document.addEventListener(\"pointermove\", onPointerMove);\n document.addEventListener(\"pointerup\", onPointerUp);\n cleanupListenersRef.current = cleanup;\n },\n [elementRef, rightPadding],\n );\n\n // Cleanup on unmount\n React.useEffect(() => {\n return () => {\n cleanupListenersRef.current?.();\n };\n }, []);\n\n // Re-clamp on window resize\n React.useEffect(() => {\n const onResize = () => reclamp();\n window.addEventListener(\"resize\", onResize);\n return () => window.removeEventListener(\"resize\", onResize);\n }, [reclamp]);\n\n // Re-clamp when deps change (e.g. collapse toggle)\n React.useEffect(() => {\n const id = requestAnimationFrame(() => reclamp());\n return () => cancelAnimationFrame(id);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, reclampDeps);\n\n return { position, isDragging, handlePointerDown };\n}\n"],"names":["DEFAULT_POSITION","top","right","clampPosition","pos","elementWidth","elementHeight","rightPadding","viewportWidth","window","innerWidth","viewportHeight","innerHeight","totalWidth","left","clampedLeft","Math","max","min","clampedTop","clampedRight","useDraggable","elementRef","initialPosition","reclampDeps","position","setPosition","React","useState","isDragging","setIsDragging","positionRef","useRef","current","startPointerRef","x","y","startPositionRef","rafIdRef","isDraggingRef","cleanupListenersRef","reclamp","useCallback","el","rect","getBoundingClientRect","prev","width","height","handlePointerDown","e","preventDefault","clientX","clientY","onPointerMove","moveEvent","requestAnimationFrame","dx","dy","newPos","clamped","cleanup","cancelAnimationFrame","removeEventListener","onPointerUp","addEventListener","useEffect","onResize","id"],"mappings":"wKAqBMA,EAA6B,CAAEC,IAAK,GAAIC,MAAO,EAAG,EAOjD,SAASC,EACdC,EACAC,EACAC,EACAC,EAAe,EACL,CACV,MAAMC,EAAgBC,OAAOC,WACvBC,EAAiBF,OAAOG,YAExBC,EAAaR,EAAeE,EAC5BO,EAAON,EAAgBJ,EAAIF,MAAQG,EACnCU,EAAcC,KAAKC,IAAI,EAAGD,KAAKE,IAAIJ,EAAMN,EAAgBK,CAAU,CAAC,EACpEM,EAAaH,KAAKC,IACtB,EACAD,KAAKE,IAAId,EAAIH,IAAKU,EAAiBL,CAAa,CAClD,EACMc,EAAeZ,EAAgBO,EAAcV,EAE5C,MAAA,CAAEJ,IAAKkB,EAAYjB,MAAOkB,CAAa,CAChD,CAEO,SAASC,EAAa,CAC3BC,WAAAA,EACAC,gBAAAA,EAAkBvB,EAClBwB,YAAAA,EAAc,CAAE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raggable.js","sources":["../../../../../../../src/modules/guide/components/Toolbar/V2/useDraggable.ts"],"sourcesContent":["import React from \"react\";\n\n// NOTE: This hook was generated entirely with Claude then lightly touched up,\n// and the behavior works correctly from testing it manually in the browser.\n\ntype Position = { top: number; right: number };\n\ntype UseDraggableOptions = {\n elementRef: React.RefObject<HTMLElement | null>;\n initialPosition?: Position;\n reclampDeps?: React.DependencyList;\n /** Extra space to reserve beyond the element's right edge (px). */\n rightPadding?: number;\n};\n\ntype UseDraggableReturn = {\n position: Position;\n isDragging: boolean;\n handlePointerDown: (e: React.PointerEvent) => void;\n /** True if the pointer moved beyond a small threshold during the last interaction. */\n hasDraggedRef: React.RefObject<boolean>;\n};\n\nconst DEFAULT_POSITION: Position = { top: 16, right: 16 };\nconst DRAG_THRESHOLD = 5;\n\n/**\n * @param rightPadding Extra space to reserve on the right edge (e.g. for a\n * drag handle that protrudes beyond the element). The element's left edge\n * is clamped so that `elementWidth + rightPadding` stays within the viewport.\n */\nexport function clampPosition(\n pos: Position,\n elementWidth: number,\n elementHeight: number,\n rightPadding = 0,\n): Position {\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n const totalWidth = elementWidth + rightPadding;\n const left = viewportWidth - pos.right - elementWidth;\n const clampedLeft = Math.max(0, Math.min(left, viewportWidth - totalWidth));\n const clampedTop = Math.max(\n 0,\n Math.min(pos.top, viewportHeight - elementHeight),\n );\n const clampedRight = viewportWidth - clampedLeft - elementWidth;\n\n return { top: clampedTop, right: clampedRight };\n}\n\nexport function useDraggable({\n elementRef,\n initialPosition = DEFAULT_POSITION,\n reclampDeps = [],\n rightPadding = 0,\n}: UseDraggableOptions): UseDraggableReturn {\n const [position, setPosition] = React.useState<Position>(initialPosition);\n const [isDragging, setIsDragging] = React.useState(false);\n\n const positionRef = React.useRef(position);\n positionRef.current = position;\n\n const startPointerRef = React.useRef({ x: 0, y: 0 });\n const startPositionRef = React.useRef<Position>({ top: 0, right: 0 });\n const rafIdRef = React.useRef<number | null>(null);\n const isDraggingRef = React.useRef(false);\n const hasDraggedRef = React.useRef(false);\n const cleanupListenersRef = React.useRef<(() => void) | null>(null);\n\n const reclamp = React.useCallback(() => {\n const el = elementRef.current;\n if (!el) return;\n const rect = el.getBoundingClientRect();\n setPosition((prev) =>\n clampPosition(prev, rect.width, rect.height, rightPadding),\n );\n }, [elementRef, rightPadding]);\n\n // Stable pointerdown handler\n const handlePointerDown = React.useCallback(\n (e: React.PointerEvent) => {\n e.preventDefault();\n startPointerRef.current = { x: e.clientX, y: e.clientY };\n startPositionRef.current = { ...positionRef.current };\n isDraggingRef.current = true;\n hasDraggedRef.current = false;\n setIsDragging(true);\n\n const onPointerMove = (moveEvent: PointerEvent) => {\n if (!isDraggingRef.current) return;\n\n const dx = moveEvent.clientX - startPointerRef.current.x;\n const dy = moveEvent.clientY - startPointerRef.current.y;\n if (!hasDraggedRef.current && Math.hypot(dx, dy) >= DRAG_THRESHOLD) {\n hasDraggedRef.current = true;\n }\n\n if (rafIdRef.current !== null) return;\n\n rafIdRef.current = requestAnimationFrame(() => {\n rafIdRef.current = null;\n if (!isDraggingRef.current) return;\n\n const dx = moveEvent.clientX - startPointerRef.current.x;\n const dy = moveEvent.clientY - startPointerRef.current.y;\n\n const newPos: Position = {\n top: startPositionRef.current.top + dy,\n right: startPositionRef.current.right - dx,\n };\n\n const el = elementRef.current;\n if (!el) return;\n const rect = el.getBoundingClientRect();\n const clamped = clampPosition(\n newPos,\n rect.width,\n rect.height,\n rightPadding,\n );\n setPosition(clamped);\n });\n };\n\n const cleanup = () => {\n isDraggingRef.current = false;\n setIsDragging(false);\n if (rafIdRef.current !== null) {\n cancelAnimationFrame(rafIdRef.current);\n rafIdRef.current = null;\n }\n document.removeEventListener(\"pointermove\", onPointerMove);\n document.removeEventListener(\"pointerup\", onPointerUp);\n cleanupListenersRef.current = null;\n };\n\n const onPointerUp = () => cleanup();\n\n document.addEventListener(\"pointermove\", onPointerMove);\n document.addEventListener(\"pointerup\", onPointerUp);\n cleanupListenersRef.current = cleanup;\n },\n [elementRef, rightPadding],\n );\n\n // Cleanup on unmount\n React.useEffect(() => {\n return () => {\n cleanupListenersRef.current?.();\n };\n }, []);\n\n // Re-clamp on window resize\n React.useEffect(() => {\n const onResize = () => reclamp();\n window.addEventListener(\"resize\", onResize);\n return () => window.removeEventListener(\"resize\", onResize);\n }, [reclamp]);\n\n // Re-clamp when deps change (e.g. collapse toggle)\n React.useEffect(() => {\n const id = requestAnimationFrame(() => reclamp());\n return () => cancelAnimationFrame(id);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, reclampDeps);\n\n return { position, isDragging, handlePointerDown, hasDraggedRef };\n}\n"],"names":["DEFAULT_POSITION","top","right","DRAG_THRESHOLD","clampPosition","pos","elementWidth","elementHeight","rightPadding","viewportWidth","window","innerWidth","viewportHeight","innerHeight","totalWidth","left","clampedLeft","Math","max","min","clampedTop","clampedRight","useDraggable","elementRef","initialPosition","reclampDeps","position","setPosition","React","useState","isDragging","setIsDragging","positionRef","useRef","current","startPointerRef","x","y","startPositionRef","rafIdRef","isDraggingRef","hasDraggedRef","cleanupListenersRef","reclamp","useCallback","el","rect","getBoundingClientRect","prev","width","height","handlePointerDown","e","preventDefault","clientX","clientY","onPointerMove","moveEvent","dx","dy","hypot","requestAnimationFrame","newPos","clamped","cleanup","cancelAnimationFrame","removeEventListener","onPointerUp","addEventListener","useEffect","onResize","id"],"mappings":"wKAuBMA,EAA6B,CAAEC,IAAK,GAAIC,MAAO,EAAG,EAClDC,EAAiB,EAOhB,SAASC,EACdC,EACAC,EACAC,EACAC,EAAe,EACL,CACV,MAAMC,EAAgBC,OAAOC,WACvBC,EAAiBF,OAAOG,YAExBC,EAAaR,EAAeE,EAC5BO,EAAON,EAAgBJ,EAAIH,MAAQI,EACnCU,EAAcC,KAAKC,IAAI,EAAGD,KAAKE,IAAIJ,EAAMN,EAAgBK,CAAU,CAAC,EACpEM,EAAaH,KAAKC,IACtB,EACAD,KAAKE,IAAId,E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ACP,IAAM,QACX3B,EAAAA,EAAoBR,UAApBQ,MAAAA,EAAAA,KAAAA,EACF,EACC,EAAE,EAGLd,EAAAA,QAAMyC,UAAU,IAAM,CACdC,MAAAA,EAAWA,IAAM3B,EAAQ,EACxByB,cAAAA,iBAAiB,SAAUE,CAAQ,EACnC,IAAM5D,OAAOwD,oBAAoB,SAAUI,CAAQ,CAAA,EACzD,CAAC3B,CAAO,CAAC,EAGZf,EAAAA,QAAMyC,UAAU,IAAM,CACpB,MAAME,EAAKV,sBAAsB,IAAMlB,GAAS,EACzC,MAAA,IAAMsB,qBAAqBM,CAAE,GAEnC9C,CAAW,EAEP,CAAEC,SAAAA,EAAUI,WAAAA,EAAYqB,kBAAAA,EAAmBV,cAAAA,CAAc,CAClE"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@knocklabs/client"),y=require("@knocklabs/react-core"),b=e=>e.reduce((t,s)=>({...t,[s.key]:s}),{}),v=(e,t,s,n)=>{var o,r,u,l,a,c,d,f;const i=!!((l=(u=(r=(o=n.key)==null?void 0:o.one)==null?void 0:r.metadata)==null?void 0:u.opts)!=null&&l.includeThrottled)||!!((f=(d=(c=(a=n.key)==null?void 0:a.all)==null?void 0:c.metadata)==null?void 0:d.opts)!=null&&f.includeThrottled);return e.bypass_global_group_limit?"returned":e.key===s.resolved?t.throttled&&!i?"throttled":"returned":"queried"},g=(e,t,s,n)=>{var r,u,l,a;const i=!!((a=(l=(u=(r=n.type)==null?void 0:r.one)==null?void 0:u.metadata)==null?void 0:l.opts)!=null&&a.includeThrottled),o=n.type.one;if(o.size===0)return"queried";if(e.bypass_global_group_limit){const d=[...o.values()][0];return e.key!==d.key?"queried":"returned"}return e.key===s.resolved?t.throttled&&!i?"throttled":"returned":"queried"},h=(e,t,s,n)=>{var a,c,d,f;const i=n.type.all;if(i.size===0)return"queried";const o=[...i.values()],r=o[0],u=b(o);return(f=(d=(c=(a=n.type)==null?void 0:a.all)==null?void 0:c.metadata)==null?void 0:d.opts)!=null&&f.includeThrottled?u[e.key]?"returned":"queried":(r.bypass_global_group_limit||r.key===s.resolved)&&u[e.key]?t.throttled?e.bypass_global_group_limit?"returned":"throttled":"returned":"queried"},G=(e,t,s,n)=>{var i,o;if(n.key)return v(e,t,s,n);if((i=n.type)!=null&&i.all)return h(e,t,s,n);if((o=n.type)!=null&&o.one)return g(e,t,s,n)},S=(e,t,s)=>{if(!s||s.status==="open")return{status:void 0};const n={key:(s.results.key||{})[e.key],type:(s.results.type||{})[e.type]};if(!!!(n.key||n.type))return{status:void 0};const o=G(e,t,s,n);return o?{status:o,query:n}:{status:void 0}},T=(e,t)=>{const s={};return((t==null?void 0:t.reason)==="not_in_target_audience"||(t==null?void 0:t.reason)==="target_conditions_not_met")&&(s.targetable={status:!1,reason:t.reason,message:t.message}),((t==null?void 0:t.reason)==="marked_as_archived"||(e.steps||[]).every(n=>!!n.message.archived_at))&&(s.archived={status:!0}),(t==null?void 0:t.reason)==="guide_not_active"&&(s.active={status:!1}),s},I=({active:e,targetable:t,archived:s})=>!(!e.status||!t.status||s.status),_=({activatable:e,selectable:t})=>!(!e.status||!t.status),q=(e,t,s)=>{const{ineligibleGuides:n,location:i}=t,o=n[e.key],r=T(e,o),u={active:(r==null?void 0:r.active)||{status:!0},targetable:(r==null?void 0:r.targetable)||{status:!0},archived:(r==null?void 0:r.archived)||{status:!1},activatable:{status:p.checkActivatable(e,i)},selectable:S(e,t,s)},l={...u,isEligible:I(u),isQualified:_(u)};return{...e,annotation:l}},w=e=>({__typename:"UnknownGuide",key:e,active:!1,bypass_global_group_limit:!1,annotation:{isEligible:!1,isQualified:!1,selectable:{status:void 0}}}),k=e=>{var r;const{client:t}=y.useGuideContext(),s=y.useStore(t.store,u=>{const l=p.checkStateIfThrottled(u);return{location:u.location,guides:u.guides,guideGroups:u.guideGroups,ineligibleGuides:u.ineligibleGuides,debug:u.debug,counter:u.counter,throttled:l}});if(!((r=s.debug)!=null&&r.debugging))return;const n=s.guideGroups[0];if(!n)return{error:"no_guide_group",guides:[]};const i=t.getStage(),o=n.display_sequence.map(u=>{const l=s.guides[u];return l?q(l,s,i):w(u)});return(i==null?void 0:i.status)==="closed"&&e.focusedGuideKeys&&!o.find(l=>e.focusedGuideKeys[l.key]&&l.annotation.selectable.status)?{error:"no_guide_present",guides:[]}:{guides:o}},B=e=>typeof e=="object"&&e!==null&&"__typename"in e&&e.__typename==="UnknownGuide";exports.isUnknownGuide=B;exports.resolveIsQualified=_;exports.useInspectGuideClientStore=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@knocklabs/client"),y=require("@knocklabs/react-core"),b=e=>e.reduce((t,s)=>({...t,[s.key]:s}),{}),g=(e,t,s,n)=>{var r,u,i,d,o,a,c,f;const l=!!((d=(i=(u=(r=n.key)==null?void 0:r.one)==null?void 0:u.metadata)==null?void 0:i.opts)!=null&&d.includeThrottled)||!!((f=(c=(a=(o=n.key)==null?void 0:o.all)==null?void 0:a.metadata)==null?void 0:c.opts)!=null&&f.includeThrottled);return e.bypass_global_group_limit?"returned":e.key===s.resolved?t.throttled&&!l?"throttled":"returned":"queried"},v=(e,t,s,n)=>{var u,i,d,o;const l=!!((o=(d=(i=(u=n.type)==null?void 0:u.one)==null?void 0:i.metadata)==null?void 0:d.opts)!=null&&o.includeThrottled),r=n.type.one;if(r.size===0)return"queried";if(e.bypass_global_group_limit){const c=[...r.values()][0];return e.key!==c.key?"queried":"returned"}return e.key===s.resolved?t.throttled&&!l?"throttled":"returned":"queried"},h=(e,t,s,n)=>{var o,a,c,f;const l=n.type.all;if(l.size===0)return"queried";const r=[...l.values()],u=r[0],i=b(r);return(f=(c=(a=(o=n.type)==null?void 0:o.all)==null?void 0:a.metadata)==null?void 0:c.opts)!=null&&f.includeThrottled?i[e.key]?"returned":"queried":(u.bypass_global_group_limit||u.key===s.resolved)&&i[e.key]?t.throttled?e.bypass_global_group_limit?"returned":"throttled":"returned":"queried"},G=(e,t,s,n)=>{var l,r;if(n.key)return g(e,t,s,n);if((l=n.type)!=null&&l.all)return h(e,t,s,n);if((r=n.type)!=null&&r.one)return v(e,t,s,n)},S=(e,t,s)=>{if(!s||s.status==="open")return{status:void 0};const n={key:(s.results.key||{})[e.key],type:(s.results.type||{})[e.type]};if(!!!(n.key||n.type))return{status:void 0};const r=G(e,t,s,n);return r?{status:r,query:n}:{status:void 0}},T=(e,t)=>{const s={};return((t==null?void 0:t.reason)==="not_in_target_audience"||(t==null?void 0:t.reason)==="target_conditions_not_met")&&(s.targetable={status:!1,reason:t.reason,message:t.message}),((t==null?void 0:t.reason)==="marked_as_archived"||(e.steps||[]).every(n=>!!n.message.archived_at))&&(s.archived={status:!0}),(t==null?void 0:t.reason)==="guide_not_active"&&(s.active={status:!1}),s},q=({active:e,targetable:t,archived:s})=>!(!e.status||!t.status||s.status),_=({activatable:e,selectable:t})=>!(!e.status||!t.status),k=(e,t,s)=>{const{ineligibleGuides:n,location:l}=t,r=n[e.key],u=T(e,r),i={active:(u==null?void 0:u.active)||{status:!0},targetable:(u==null?void 0:u.targetable)||{status:!0},archived:(u==null?void 0:u.archived)||{status:!1},activatable:{status:p.checkActivatable(e,l)},selectable:S(e,t,s)},d={...i,isEligible:q(i),isQualified:_(i)};return{...e,annotation:d}},w=e=>({__typename:"UnknownGuide",key:e,active:!1,bypass_global_group_limit:!1,annotation:{isEligible:!1,isQualified:!1,selectable:{status:void 0}}}),I=e=>{var d;const{client:t}=y.useGuideContext(),s=y.useStore(t.store,o=>{const a=p.checkStateIfThrottled(o);return{location:o.location,guides:o.guides,guideGroups:o.guideGroups,ineligibleGuides:o.ineligibleGuides,debug:o.debug,counter:o.counter,queries:o.queries,throttled:a}});if(!((d=s.debug)!=null&&d.debugging))return;const n=Object.entries(s.queries)[0];if(!n||n[1].status==="loading")return{status:"error",error:"no_guides_fetched",message:"Loading..."};const l=s.guideGroups[0];if(!l)return{status:"error",error:"no_guide_group",message:"No guide group found"};const r=t.getStage(),u=l.display_sequence.map(o=>{const a=s.guides[o];return a?k(a,s,r):w(o)}),i=Object.keys(e.focusedGuideKeys||{})[0];return(r==null?void 0:r.status)==="closed"&&i&&!u.find(a=>a.key===i&&a.annotation.selectable.status)?{status:"error",error:"no_guide_present",message:`No component that can render \`${i}\` was found`}:{status:"ok",guides:u}},B=e=>typeof e=="object"&&e!==null&&"__typename"in e&&e.__typename==="UnknownGuide";exports.isUnknownGuide=B;exports.resolveIsQualified=_;exports.useInspectGuideClientStore=I;
2
2
  //# sourceMappingURL=useInspectGuideClientStore.js.map