@knocklabs/react 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/modules/guide/providers/KnockGuideProvider.js +1 -1
  4. package/dist/cjs/modules/guide/providers/KnockGuideProvider.js.map +1 -1
  5. package/dist/cjs/next/KnockGuideLocationSensor.js +2 -0
  6. package/dist/cjs/next/KnockGuideLocationSensor.js.map +1 -0
  7. package/dist/cjs/next.js +2 -0
  8. package/dist/cjs/next.js.map +1 -0
  9. package/dist/esm/index.mjs +86 -90
  10. package/dist/esm/index.mjs.map +1 -1
  11. package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs +5 -7
  12. package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs.map +1 -1
  13. package/dist/esm/next/KnockGuideLocationSensor.mjs +39 -0
  14. package/dist/esm/next/KnockGuideLocationSensor.mjs.map +1 -0
  15. package/dist/esm/next.mjs +5 -0
  16. package/dist/esm/next.mjs.map +1 -0
  17. package/dist/types/index.d.ts +1 -1
  18. package/dist/types/index.d.ts.map +1 -1
  19. package/dist/types/modules/guide/components/index.d.ts +0 -1
  20. package/dist/types/modules/guide/components/index.d.ts.map +1 -1
  21. package/dist/types/modules/guide/index.d.ts +1 -1
  22. package/dist/types/modules/guide/index.d.ts.map +1 -1
  23. package/dist/types/next/KnockGuideLocationSensor.d.ts +6 -0
  24. package/dist/types/next/KnockGuideLocationSensor.d.ts.map +1 -0
  25. package/dist/types/next/index.d.ts +2 -0
  26. package/dist/types/next/index.d.ts.map +1 -0
  27. package/package.json +10 -4
  28. package/dist/cjs/modules/guide/components/LocationSensor/NextAppRouter.js +0 -2
  29. package/dist/cjs/modules/guide/components/LocationSensor/NextAppRouter.js.map +0 -1
  30. package/dist/cjs/modules/guide/components/LocationSensor/NextPagesRouter.js +0 -2
  31. package/dist/cjs/modules/guide/components/LocationSensor/NextPagesRouter.js.map +0 -1
  32. package/dist/esm/modules/guide/components/LocationSensor/NextAppRouter.mjs +0 -20
  33. package/dist/esm/modules/guide/components/LocationSensor/NextAppRouter.mjs.map +0 -1
  34. package/dist/esm/modules/guide/components/LocationSensor/NextPagesRouter.mjs +0 -24
  35. package/dist/esm/modules/guide/components/LocationSensor/NextPagesRouter.mjs.map +0 -1
  36. package/dist/types/modules/guide/components/LocationSensor/NextAppRouter.d.ts +0 -2
  37. package/dist/types/modules/guide/components/LocationSensor/NextAppRouter.d.ts.map +0 -1
  38. package/dist/types/modules/guide/components/LocationSensor/NextPagesRouter.d.ts +0 -2
  39. package/dist/types/modules/guide/components/LocationSensor/NextPagesRouter.d.ts.map +0 -1
  40. package/dist/types/modules/guide/components/LocationSensor/index.d.ts +0 -3
  41. package/dist/types/modules/guide/components/LocationSensor/index.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 1e538b9: [guide] add a secondary entry point for nextjs specific helpers for guide location detection
8
+ - Updated dependencies [1e538b9]
9
+ - @knocklabs/client@0.19.2
10
+ - @knocklabs/react-core@0.11.2
11
+
12
+ ## 0.9.1
13
+
14
+ ### Patch Changes
15
+
16
+ - c4e67da: revert 4b888c4 to remove nextjs helper components and fix module resolution error
17
+ - Updated dependencies [c4e67da]
18
+ - @knocklabs/client@0.19.1
19
+ - @knocklabs/react-core@0.11.1
20
+
3
21
  ## 0.9.0
4
22
 
5
23
  ### Minor 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"),p=require("./modules/feed/components/NotificationFeed/MarkAsRead.js"),k=require("./modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.js"),g=require("./modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js"),y=require("./modules/feed/components/NotificationIconButton/NotificationIconButton.js"),S=require("./modules/feed/components/UnseenBadge/UnseenBadge.js"),t=require("./modules/guide/components/Banner/Banner.js"),r=require("./modules/guide/components/Card/Card.js"),O=require("./modules/guide/components/GuideToolbar/GuideToolbar.js"),j=require("./modules/guide/components/LocationSensor/NextAppRouter.js"),h=require("./modules/guide/components/LocationSensor/NextPagesRouter.js"),n=require("./modules/guide/components/Modal/Modal.js"),K=require("./modules/guide/providers/KnockGuideProvider.js"),T=require("./modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js"),q=require("./modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js"),N=require("./modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js"),M=require("./modules/slack/components/SlackAuthButton/SlackAuthButton.js"),B=require("./modules/slack/components/SlackAuthContainer/SlackAuthContainer.js"),v=require("./modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js"),e=require("@knocklabs/react-core");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=p.MarkAsRead;exports.NotificationFeedContainer=k.NotificationFeedContainer;exports.NotificationFeedPopover=g.NotificationFeedPopover;exports.NotificationIconButton=y.NotificationIconButton;exports.UnseenBadge=S.UnseenBadge;exports.Banner=t.Banner;exports.BannerView=t.BannerView;exports.Card=r.Card;exports.CardView=r.CardView;exports.KnockGuideToolbar=O.GuideToolbar;exports.KnockGuideLocationSensorNextAppRouter=j.LocationSensorNextAppRouter;exports.KnockGuideLocationSensorNextPagesRouter=h.LocationSensorNextPagesRouter;exports.Modal=n.Modal;exports.ModalView=n.ModalView;exports.KnockGuideProvider=K.KnockGuideProvider;exports.MsTeamsAuthButton=T.MsTeamsAuthButton;exports.MsTeamsAuthContainer=q.MsTeamsAuthContainer;exports.MsTeamsChannelCombobox=N;exports.SlackAuthButton=M.SlackAuthButton;exports.SlackAuthContainer=B.SlackAuthContainer;exports.SlackChannelCombobox=v.SlackChannelCombobox;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,"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});
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"),y=require("./modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js"),g=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"),S=require("./modules/guide/components/GuideToolbar/GuideToolbar.js"),n=require("./modules/guide/components/Modal/Modal.js"),j=require("./modules/guide/providers/KnockGuideProvider.js"),h=require("./modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js"),T=require("./modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js"),K=require("./modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js"),q=require("./modules/slack/components/SlackAuthButton/SlackAuthButton.js"),M=require("./modules/slack/components/SlackAuthContainer/SlackAuthContainer.js"),B=require("./modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js"),e=require("@knocklabs/react-core");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=y.NotificationFeedPopover;exports.NotificationIconButton=g.NotificationIconButton;exports.UnseenBadge=O.UnseenBadge;exports.Banner=t.Banner;exports.BannerView=t.BannerView;exports.Card=r.Card;exports.CardView=r.CardView;exports.KnockGuideToolbar=S.GuideToolbar;exports.Modal=n.Modal;exports.ModalView=n.ModalView;exports.KnockGuideProvider=j.KnockGuideProvider;exports.MsTeamsAuthButton=h.MsTeamsAuthButton;exports.MsTeamsAuthContainer=T.MsTeamsAuthContainer;exports.MsTeamsChannelCombobox=K;exports.SlackAuthButton=q.SlackAuthButton;exports.SlackAuthContainer=M.SlackAuthContainer;exports.SlackChannelCombobox=B.SlackChannelCombobox;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,"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});
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@knocklabs/react-core"),u=require("react");require("../components/Banner/Banner.js");require("../components/Card/Card.js");const i=require("../components/GuideToolbar/GuideToolbar.js");require("next/navigation");require("next/router");require("../components/Modal/Modal.js");const c=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},r=c(u),n=({children:e,...t})=>r.default.createElement(o.KnockGuideProvider,{...t},e,r.default.createElement(i.GuideToolbar,null));exports.KnockGuideProvider=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@knocklabs/react-core"),u=require("react");require("../components/Banner/Banner.js");require("../components/Card/Card.js");const i=require("../components/GuideToolbar/GuideToolbar.js");require("../components/Modal/Modal.js");const c=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},r=c(u),n=({children:e,...t})=>r.default.createElement(o.KnockGuideProvider,{...t},e,r.default.createElement(i.GuideToolbar,null));exports.KnockGuideProvider=n;
2
2
  //# sourceMappingURL=KnockGuideProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"KnockGuideProvider.js","sources":["../../../../../src/modules/guide/providers/KnockGuideProvider.tsx"],"sourcesContent":["import {\n KnockGuideProvider as KnockGuideProviderCore,\n type KnockGuideProviderProps,\n} from \"@knocklabs/react-core\";\nimport React from \"react\";\n\nimport { GuideToolbar } from \"../components\";\n\n// Re-export the core KnockGuideProvider, so we can add React specific functionality\n// like the GuideToolbar component which shouldn't be included in other contexts (e.g. React Native).\nexport const KnockGuideProvider: React.FC<\n React.PropsWithChildren<KnockGuideProviderProps>\n> = ({ children, ...props }) => {\n return (\n <KnockGuideProviderCore {...props}>\n {children}\n <GuideToolbar />\n </KnockGuideProviderCore>\n );\n};\n"],"names":["KnockGuideProvider","children","props","KnockGuideProviderCore","React","GuideToolbar"],"mappings":"ybAUaA,EAETA,CAAC,CAAEC,SAAAA,EAAU,GAAGC,CAAM,4BAErBC,EAAuB,mBAAA,CAAA,GAAID,GACzBD,EACDG,UAAA,cAACC,mBAAY,CACf"}
1
+ {"version":3,"file":"KnockGuideProvider.js","sources":["../../../../../src/modules/guide/providers/KnockGuideProvider.tsx"],"sourcesContent":["import {\n KnockGuideProvider as KnockGuideProviderCore,\n type KnockGuideProviderProps,\n} from \"@knocklabs/react-core\";\nimport React from \"react\";\n\nimport { GuideToolbar } from \"../components\";\n\n// Re-export the core KnockGuideProvider, so we can add React specific functionality\n// like the GuideToolbar component which shouldn't be included in other contexts (e.g. React Native).\nexport const KnockGuideProvider: React.FC<\n React.PropsWithChildren<KnockGuideProviderProps>\n> = ({ children, ...props }) => {\n return (\n <KnockGuideProviderCore {...props}>\n {children}\n <GuideToolbar />\n </KnockGuideProviderCore>\n );\n};\n"],"names":["KnockGuideProvider","children","props","KnockGuideProviderCore","React","GuideToolbar"],"mappings":"uYAUaA,EAETA,CAAC,CAAEC,SAAAA,EAAU,GAAGC,CAAM,4BAErBC,EAAuB,mBAAA,CAAA,GAAID,GACzBD,EACDG,UAAA,cAACC,mBAAY,CACf"}
@@ -0,0 +1,2 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@knocklabs/react-core"),c=require("next/navigation.js"),i=require("next/router.js"),l=require("react"),u=require("../modules/core/utils.js"),f=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},s=f(l),d=()=>{const e=i.useRouter(),{client:o}=a.useGuideContext();return s.default.useEffect(()=>{const n=u.checkForWindow();if(!n)return;o.store.state.location||o.setLocation(n.location.href),o.removeLocationChangeEventListeners();const t=r=>{o.setLocation(n.location.origin+r)};return e.events.on("routeChangeComplete",t),()=>{e.events.off("routeChangeComplete",t)}},[o]),null},h=()=>{const e=c.usePathname(),n=c.useSearchParams().toString(),{client:t}=a.useGuideContext();return s.default.useEffect(()=>{t.removeLocationChangeEventListeners()},[t]),s.default.useEffect(()=>{const r=u.checkForWindow();r&&t.setLocation(r.location.href)},[t,e,n]),null},m={PagesRouter:d,AppRouter:h};exports.KnockGuideLocationSensor=m;
2
+ //# sourceMappingURL=KnockGuideLocationSensor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KnockGuideLocationSensor.js","sources":["../../../src/next/KnockGuideLocationSensor.tsx"],"sourcesContent":["\"use client\";\n\nimport { useGuideContext } from \"@knocklabs/react-core\";\n// Note the .js suffix for Next 15 ESM friendliness:\nimport { usePathname, useSearchParams } from \"next/navigation.js\";\nimport { useRouter } from \"next/router.js\";\nimport React from \"react\";\n\nimport { checkForWindow } from \"../modules/core/utils\";\n\nconst PagesRouter: React.FC = () => {\n const router = useRouter();\n const { client } = useGuideContext();\n\n React.useEffect(() => {\n const win = checkForWindow();\n if (!win) return;\n\n // Set the initial location if not yet set.\n if (!client.store.state.location) {\n client.setLocation(win.location.href);\n }\n\n // If you are using this helper module, then that means we are detecting\n // route changes from next's router rather than from the global history\n // object which the guide client does by default, so ensure we don't have\n // any event listeners hanging around unnecessarily.\n client.removeLocationChangeEventListeners();\n\n // Attach a route change event listener to the nextjs router. Note, here url\n // is the pathname and any query parameters of the new route but does not\n // include the domain or origin.\n const handleRouteChangeComplete = (url: string) => {\n client.setLocation(win.location.origin + url);\n };\n router.events.on(\"routeChangeComplete\", handleRouteChangeComplete);\n\n return () => {\n router.events.off(\"routeChangeComplete\", handleRouteChangeComplete);\n };\n // We want to run this effect once per client instance and `router` is not\n // guaranteed to be referentially stable.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [client]);\n\n return null;\n};\n\nconst AppRouter: React.FC = () => {\n const pathname = usePathname();\n const searchParams = useSearchParams();\n const queryStr = searchParams.toString();\n\n const { client } = useGuideContext();\n\n React.useEffect(() => {\n // Same here, remove any location change event listeners on the window\n // object in case they are attached.\n client.removeLocationChangeEventListeners();\n }, [client]);\n\n React.useEffect(() => {\n const win = checkForWindow();\n if (!win) return;\n\n client.setLocation(win.location.href);\n }, [client, pathname, queryStr]);\n\n return null;\n};\n\nexport const KnockGuideLocationSensor = {\n PagesRouter,\n AppRouter,\n};\n"],"names":["PagesRouter","router","useRouter","client","useGuideContext","React","useEffect","win","checkForWindow","store","state","location","setLocation","href","removeLocationChangeEventListeners","handleRouteChangeComplete","url","origin","events","on","off","AppRouter","pathname","usePathname","queryStr","useSearchParams","toString","KnockGuideLocationSensor"],"mappings":"0TAUMA,EAAwBA,IAAM,CAClC,MAAMC,EAASC,EAAAA,UAAU,EACnB,CAAEC,OAAAA,GAAWC,kBAAgB,EAEnCC,OAAAA,EAAAA,QAAMC,UAAU,IAAM,CACpB,MAAMC,EAAMC,EAAAA,eAAe,EAC3B,GAAI,CAACD,EAAK,OAGLJ,EAAOM,MAAMC,MAAMC,UACfC,EAAAA,YAAYL,EAAII,SAASE,IAAI,EAOtCV,EAAOW,mCAAmC,EAKpCC,MAAAA,EAA6BC,GAAgB,CACjDb,EAAOS,YAAYL,EAAII,SAASM,OAASD,CAAG,CAC9C,EACOE,OAAAA,EAAAA,OAAOC,GAAG,sBAAuBJ,CAAyB,EAE1D,IAAM,CACJG,EAAAA,OAAOE,IAAI,sBAAuBL,CAAyB,CACpE,CAAA,EAIC,CAACZ,CAAM,CAAC,EAEJ,IACT,EAEMkB,EAAsBA,IAAM,CAChC,MAAMC,EAAWC,EAAAA,YAAY,EAEvBC,EADeC,EAAAA,gBAAgB,EACPC,SAAS,EAEjC,CAAEvB,OAAAA,GAAWC,kBAAgB,EAEnCC,OAAAA,EAAAA,QAAMC,UAAU,IAAM,CAGpBH,EAAOW,mCAAmC,CAAA,EACzC,CAACX,CAAM,CAAC,EAEXE,EAAAA,QAAMC,UAAU,IAAM,CACpB,MAAMC,EAAMC,EAAAA,eAAe,EACtBD,GAEEK,EAAAA,YAAYL,EAAII,SAASE,IAAI,CACnC,EAAA,CAACV,EAAQmB,EAAUE,CAAQ,CAAC,EAExB,IACT,EAEaG,EAA2B,CACtC3B,YAAAA,EACAqB,UAAAA,CACF"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./next/KnockGuideLocationSensor.js");exports.KnockGuideLocationSensor=o.KnockGuideLocationSensor;
2
+ //# sourceMappingURL=next.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -3,109 +3,105 @@
3
3
  import { Button as r } from "./modules/core/components/Button/Button.mjs";
4
4
  import { ButtonGroup as a } from "./modules/core/components/Button/ButtonGroup.mjs";
5
5
  import { BellIcon as i } from "./modules/core/components/Icons/Bell.mjs";
6
- import { CheckmarkCircle as m } from "./modules/core/components/Icons/CheckmarkCircle.mjs";
6
+ import { CheckmarkCircle as u } from "./modules/core/components/Icons/CheckmarkCircle.mjs";
7
7
  import { ChevronDown as f } from "./modules/core/components/Icons/ChevronDown.mjs";
8
- import { CloseCircle as p } from "./modules/core/components/Icons/CloseCircle.mjs";
8
+ import { CloseCircle as d } from "./modules/core/components/Icons/CloseCircle.mjs";
9
9
  import { Spinner as x } from "./modules/core/components/Spinner/Spinner.mjs";
10
10
  import { default as k } from "./modules/core/hooks/useOnBottomScroll.mjs";
11
11
  import { EmptyFeed as K } from "./modules/feed/components/EmptyFeed/EmptyFeed.mjs";
12
12
  import { NotificationCell as h } from "./modules/feed/components/NotificationCell/NotificationCell.mjs";
13
- import { Avatar as M } from "./modules/feed/components/NotificationCell/Avatar.mjs";
14
- import { NotificationFeed as v } from "./modules/feed/components/NotificationFeed/NotificationFeed.mjs";
15
- import { NotificationFeedHeader as B } from "./modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs";
16
- import { MarkAsRead as G } from "./modules/feed/components/NotificationFeed/MarkAsRead.mjs";
17
- import { NotificationFeedContainer as g } from "./modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.mjs";
18
- import { NotificationFeedPopover as w } from "./modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs";
19
- import { NotificationIconButton as I } from "./modules/feed/components/NotificationIconButton/NotificationIconButton.mjs";
20
- import { UnseenBadge as O } from "./modules/feed/components/UnseenBadge/UnseenBadge.mjs";
21
- import { Banner as D, BannerView as E } from "./modules/guide/components/Banner/Banner.mjs";
22
- import { Card as U, CardView as j } from "./modules/guide/components/Card/Card.mjs";
23
- import { GuideToolbar as z } from "./modules/guide/components/GuideToolbar/GuideToolbar.mjs";
24
- import { LocationSensorNextAppRouter as Q } from "./modules/guide/components/LocationSensor/NextAppRouter.mjs";
25
- import { LocationSensorNextPagesRouter as X } from "./modules/guide/components/LocationSensor/NextPagesRouter.mjs";
26
- import { Modal as Z, ModalView as _ } from "./modules/guide/components/Modal/Modal.mjs";
27
- import { KnockGuideProvider as ee } from "./modules/guide/providers/KnockGuideProvider.mjs";
28
- import { MsTeamsAuthButton as te } from "./modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs";
29
- import { MsTeamsAuthContainer as ne } from "./modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs";
30
- import { default as se } from "./modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.mjs";
31
- import { SlackAuthButton as ue } from "./modules/slack/components/SlackAuthButton/SlackAuthButton.mjs";
32
- import { SlackAuthContainer as ce } from "./modules/slack/components/SlackAuthContainer/SlackAuthContainer.mjs";
33
- import { SlackChannelCombobox as le } from "./modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.mjs";
34
- import { FilterStatus as de, I18nContext as xe, KnockFeedProvider as Ce, KnockGuideContext as ke, KnockI18nProvider as Se, KnockMsTeamsProvider as Ke, KnockProvider as Te, KnockSlackProvider as he, feedProviderKey as Ne, formatBadgeCount as Me, formatTimestamp as Pe, locales as ve, msTeamsProviderKey as Ae, renderNodeOrFallback as Be, slackProviderKey as Fe, toSentenceCase as Ge, useAuthenticatedKnockClient as be, useConnectedMsTeamsChannels as ge, useConnectedSlackChannels as Re, useCreateNotificationStore as we, useFeedSettings as ye, useGuide as Ie, useGuideContext as Le, useGuides as Oe, useKnockClient as Ve, useKnockFeed as De, useKnockMsTeamsClient as Ee, useKnockSlackClient as He, useMsTeamsAuth as Ue, useMsTeamsChannels as je, useMsTeamsConnectionStatus as qe, useMsTeamsTeams as ze, useNotificationStore as Je, useNotifications as Qe, usePreferences as We, useSlackAuth as Xe, useSlackChannels as Ye, useSlackConnectionStatus as Ze, useStableOptions as _e, useTranslations as $e } from "@knocklabs/react-core";
13
+ import { Avatar as v } from "./modules/feed/components/NotificationCell/Avatar.mjs";
14
+ import { NotificationFeed as P } from "./modules/feed/components/NotificationFeed/NotificationFeed.mjs";
15
+ import { NotificationFeedHeader as N } from "./modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs";
16
+ import { MarkAsRead as b } from "./modules/feed/components/NotificationFeed/MarkAsRead.mjs";
17
+ import { NotificationFeedContainer as w } from "./modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.mjs";
18
+ import { NotificationFeedPopover as I } from "./modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs";
19
+ import { NotificationIconButton as O } from "./modules/feed/components/NotificationIconButton/NotificationIconButton.mjs";
20
+ import { UnseenBadge as D } from "./modules/feed/components/UnseenBadge/UnseenBadge.mjs";
21
+ import { Banner as H, BannerView as R } from "./modules/guide/components/Banner/Banner.mjs";
22
+ import { Card as j, CardView as q } from "./modules/guide/components/Card/Card.mjs";
23
+ import { GuideToolbar as J } from "./modules/guide/components/GuideToolbar/GuideToolbar.mjs";
24
+ import { Modal as Q, ModalView as W } from "./modules/guide/components/Modal/Modal.mjs";
25
+ import { KnockGuideProvider as Y } from "./modules/guide/providers/KnockGuideProvider.mjs";
26
+ import { MsTeamsAuthButton as _ } from "./modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs";
27
+ import { MsTeamsAuthContainer as ee } from "./modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs";
28
+ import { default as te } from "./modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.mjs";
29
+ import { SlackAuthButton as ne } from "./modules/slack/components/SlackAuthButton/SlackAuthButton.mjs";
30
+ import { SlackAuthContainer as se } from "./modules/slack/components/SlackAuthContainer/SlackAuthContainer.mjs";
31
+ import { SlackChannelCombobox as me } from "./modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.mjs";
32
+ import { FilterStatus as ce, I18nContext as fe, KnockFeedProvider as le, KnockGuideContext as de, KnockI18nProvider as pe, KnockMsTeamsProvider as xe, KnockProvider as Ce, KnockSlackProvider as ke, feedProviderKey as Se, formatBadgeCount as Ke, formatTimestamp as Te, locales as he, msTeamsProviderKey as Me, renderNodeOrFallback as ve, slackProviderKey as Be, toSentenceCase as Pe, useAuthenticatedKnockClient as Fe, useConnectedMsTeamsChannels as Ne, useConnectedSlackChannels as Ae, useCreateNotificationStore as be, useFeedSettings as Ge, useGuide as we, useGuideContext as ye, useGuides as Ie, useKnockClient as ge, useKnockFeed as Oe, useKnockMsTeamsClient as Ve, useKnockSlackClient as De, useMsTeamsAuth as Ee, useMsTeamsChannels as He, useMsTeamsConnectionStatus as Re, useMsTeamsTeams as Ue, useNotificationStore as je, useNotifications as qe, usePreferences as ze, useSlackAuth as Je, useSlackChannels as Le, useSlackConnectionStatus as Qe, useStableOptions as We, useTranslations as Xe } from "@knocklabs/react-core";
35
33
  export {
36
- M as Avatar,
37
- D as Banner,
38
- E as BannerView,
34
+ v as Avatar,
35
+ H as Banner,
36
+ R as BannerView,
39
37
  i as BellIcon,
40
38
  r as Button,
41
39
  a as ButtonGroup,
42
- U as Card,
43
- j as CardView,
44
- m as CheckmarkCircle,
40
+ j as Card,
41
+ q as CardView,
42
+ u as CheckmarkCircle,
45
43
  f as ChevronDown,
46
- p as CloseCircle,
44
+ d as CloseCircle,
47
45
  K as EmptyFeed,
48
- de as FilterStatus,
49
- xe as I18nContext,
50
- Ce as KnockFeedProvider,
51
- ke as KnockGuideContext,
52
- Q as KnockGuideLocationSensorNextAppRouter,
53
- X as KnockGuideLocationSensorNextPagesRouter,
54
- ee as KnockGuideProvider,
55
- z as KnockGuideToolbar,
56
- Se as KnockI18nProvider,
57
- Ke as KnockMsTeamsProvider,
58
- Te as KnockProvider,
59
- he as KnockSlackProvider,
60
- G as MarkAsRead,
61
- Z as Modal,
62
- _ as ModalView,
63
- te as MsTeamsAuthButton,
64
- ne as MsTeamsAuthContainer,
65
- se as MsTeamsChannelCombobox,
46
+ ce as FilterStatus,
47
+ fe as I18nContext,
48
+ le as KnockFeedProvider,
49
+ de as KnockGuideContext,
50
+ Y as KnockGuideProvider,
51
+ J as KnockGuideToolbar,
52
+ pe as KnockI18nProvider,
53
+ xe as KnockMsTeamsProvider,
54
+ Ce as KnockProvider,
55
+ ke as KnockSlackProvider,
56
+ b as MarkAsRead,
57
+ Q as Modal,
58
+ W as ModalView,
59
+ _ as MsTeamsAuthButton,
60
+ ee as MsTeamsAuthContainer,
61
+ te as MsTeamsChannelCombobox,
66
62
  h as NotificationCell,
67
- v as NotificationFeed,
68
- g as NotificationFeedContainer,
69
- B as NotificationFeedHeader,
70
- w as NotificationFeedPopover,
71
- I as NotificationIconButton,
72
- ue as SlackAuthButton,
73
- ce as SlackAuthContainer,
74
- le as SlackChannelCombobox,
63
+ P as NotificationFeed,
64
+ w as NotificationFeedContainer,
65
+ N as NotificationFeedHeader,
66
+ I as NotificationFeedPopover,
67
+ O as NotificationIconButton,
68
+ ne as SlackAuthButton,
69
+ se as SlackAuthContainer,
70
+ me as SlackChannelCombobox,
75
71
  x as Spinner,
76
- O as UnseenBadge,
77
- Ne as feedProviderKey,
78
- Me as formatBadgeCount,
79
- Pe as formatTimestamp,
80
- ve as locales,
81
- Ae as msTeamsProviderKey,
82
- Be as renderNodeOrFallback,
83
- Fe as slackProviderKey,
84
- Ge as toSentenceCase,
85
- be as useAuthenticatedKnockClient,
86
- ge as useConnectedMsTeamsChannels,
87
- Re as useConnectedSlackChannels,
88
- we as useCreateNotificationStore,
89
- ye as useFeedSettings,
90
- Ie as useGuide,
91
- Le as useGuideContext,
92
- Oe as useGuides,
93
- Ve as useKnockClient,
94
- De as useKnockFeed,
95
- Ee as useKnockMsTeamsClient,
96
- He as useKnockSlackClient,
97
- Ue as useMsTeamsAuth,
98
- je as useMsTeamsChannels,
99
- qe as useMsTeamsConnectionStatus,
100
- ze as useMsTeamsTeams,
101
- Je as useNotificationStore,
102
- Qe as useNotifications,
72
+ D as UnseenBadge,
73
+ Se as feedProviderKey,
74
+ Ke as formatBadgeCount,
75
+ Te as formatTimestamp,
76
+ he as locales,
77
+ Me as msTeamsProviderKey,
78
+ ve as renderNodeOrFallback,
79
+ Be as slackProviderKey,
80
+ Pe as toSentenceCase,
81
+ Fe as useAuthenticatedKnockClient,
82
+ Ne as useConnectedMsTeamsChannels,
83
+ Ae as useConnectedSlackChannels,
84
+ be as useCreateNotificationStore,
85
+ Ge as useFeedSettings,
86
+ we as useGuide,
87
+ ye as useGuideContext,
88
+ Ie as useGuides,
89
+ ge as useKnockClient,
90
+ Oe as useKnockFeed,
91
+ Ve as useKnockMsTeamsClient,
92
+ De as useKnockSlackClient,
93
+ Ee as useMsTeamsAuth,
94
+ He as useMsTeamsChannels,
95
+ Re as useMsTeamsConnectionStatus,
96
+ Ue as useMsTeamsTeams,
97
+ je as useNotificationStore,
98
+ qe as useNotifications,
103
99
  k as useOnBottomScroll,
104
- We as usePreferences,
105
- Xe as useSlackAuth,
106
- Ye as useSlackChannels,
107
- Ze as useSlackConnectionStatus,
108
- _e as useStableOptions,
109
- $e as useTranslations
100
+ ze as usePreferences,
101
+ Je as useSlackAuth,
102
+ Le as useSlackChannels,
103
+ Qe as useSlackConnectionStatus,
104
+ We as useStableOptions,
105
+ Xe as useTranslations
110
106
  };
111
107
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,14 +3,12 @@ import r from "react";
3
3
  import "../components/Banner/Banner.mjs";
4
4
  import "../components/Card/Card.mjs";
5
5
  import { GuideToolbar as i } from "../components/GuideToolbar/GuideToolbar.mjs";
6
- import "next/navigation";
7
- import "next/router";
8
6
  import "../components/Modal/Modal.mjs";
9
- const f = ({
10
- children: o,
11
- ...e
12
- }) => /* @__PURE__ */ r.createElement(t, { ...e }, o, /* @__PURE__ */ r.createElement(i, null));
7
+ const a = ({
8
+ children: e,
9
+ ...o
10
+ }) => /* @__PURE__ */ r.createElement(t, { ...o }, e, /* @__PURE__ */ r.createElement(i, null));
13
11
  export {
14
- f as KnockGuideProvider
12
+ a as KnockGuideProvider
15
13
  };
16
14
  //# sourceMappingURL=KnockGuideProvider.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"KnockGuideProvider.mjs","sources":["../../../../../src/modules/guide/providers/KnockGuideProvider.tsx"],"sourcesContent":["import {\n KnockGuideProvider as KnockGuideProviderCore,\n type KnockGuideProviderProps,\n} from \"@knocklabs/react-core\";\nimport React from \"react\";\n\nimport { GuideToolbar } from \"../components\";\n\n// Re-export the core KnockGuideProvider, so we can add React specific functionality\n// like the GuideToolbar component which shouldn't be included in other contexts (e.g. React Native).\nexport const KnockGuideProvider: React.FC<\n React.PropsWithChildren<KnockGuideProviderProps>\n> = ({ children, ...props }) => {\n return (\n <KnockGuideProviderCore {...props}>\n {children}\n <GuideToolbar />\n </KnockGuideProviderCore>\n );\n};\n"],"names":["KnockGuideProvider","children","props","KnockGuideProviderCore","React","GuideToolbar"],"mappings":";;;;;;;;AAUO,MAAMA,IAETA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAU,GAAGC;AAAM,sCAErBC,GAAuB,EAAA,GAAID,KACzBD,GACDG,gBAAAA,EAAA,cAACC,OAAY,CACf;"}
1
+ {"version":3,"file":"KnockGuideProvider.mjs","sources":["../../../../../src/modules/guide/providers/KnockGuideProvider.tsx"],"sourcesContent":["import {\n KnockGuideProvider as KnockGuideProviderCore,\n type KnockGuideProviderProps,\n} from \"@knocklabs/react-core\";\nimport React from \"react\";\n\nimport { GuideToolbar } from \"../components\";\n\n// Re-export the core KnockGuideProvider, so we can add React specific functionality\n// like the GuideToolbar component which shouldn't be included in other contexts (e.g. React Native).\nexport const KnockGuideProvider: React.FC<\n React.PropsWithChildren<KnockGuideProviderProps>\n> = ({ children, ...props }) => {\n return (\n <KnockGuideProviderCore {...props}>\n {children}\n <GuideToolbar />\n </KnockGuideProviderCore>\n );\n};\n"],"names":["KnockGuideProvider","children","props","KnockGuideProviderCore","React","GuideToolbar"],"mappings":";;;;;;AAUO,MAAMA,IAETA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAU,GAAGC;AAAM,sCAErBC,GAAuB,EAAA,GAAID,KACzBD,GACDG,gBAAAA,EAAA,cAACC,OAAY,CACf;"}
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { useGuideContext as c } from "@knocklabs/react-core";
3
+ import { usePathname as i, useSearchParams as u } from "next/navigation.js";
4
+ import { useRouter as m } from "next/router.js";
5
+ import s from "react";
6
+ import { checkForWindow as a } from "../modules/core/utils.mjs";
7
+ const f = () => {
8
+ const n = m(), {
9
+ client: t
10
+ } = c();
11
+ return s.useEffect(() => {
12
+ const o = a();
13
+ if (!o) return;
14
+ t.store.state.location || t.setLocation(o.location.href), t.removeLocationChangeEventListeners();
15
+ const e = (r) => {
16
+ t.setLocation(o.location.origin + r);
17
+ };
18
+ return n.events.on("routeChangeComplete", e), () => {
19
+ n.events.off("routeChangeComplete", e);
20
+ };
21
+ }, [t]), null;
22
+ }, l = () => {
23
+ const n = i(), o = u().toString(), {
24
+ client: e
25
+ } = c();
26
+ return s.useEffect(() => {
27
+ e.removeLocationChangeEventListeners();
28
+ }, [e]), s.useEffect(() => {
29
+ const r = a();
30
+ r && e.setLocation(r.location.href);
31
+ }, [e, n, o]), null;
32
+ }, v = {
33
+ PagesRouter: f,
34
+ AppRouter: l
35
+ };
36
+ export {
37
+ v as KnockGuideLocationSensor
38
+ };
39
+ //# sourceMappingURL=KnockGuideLocationSensor.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KnockGuideLocationSensor.mjs","sources":["../../../src/next/KnockGuideLocationSensor.tsx"],"sourcesContent":["\"use client\";\n\nimport { useGuideContext } from \"@knocklabs/react-core\";\n// Note the .js suffix for Next 15 ESM friendliness:\nimport { usePathname, useSearchParams } from \"next/navigation.js\";\nimport { useRouter } from \"next/router.js\";\nimport React from \"react\";\n\nimport { checkForWindow } from \"../modules/core/utils\";\n\nconst PagesRouter: React.FC = () => {\n const router = useRouter();\n const { client } = useGuideContext();\n\n React.useEffect(() => {\n const win = checkForWindow();\n if (!win) return;\n\n // Set the initial location if not yet set.\n if (!client.store.state.location) {\n client.setLocation(win.location.href);\n }\n\n // If you are using this helper module, then that means we are detecting\n // route changes from next's router rather than from the global history\n // object which the guide client does by default, so ensure we don't have\n // any event listeners hanging around unnecessarily.\n client.removeLocationChangeEventListeners();\n\n // Attach a route change event listener to the nextjs router. Note, here url\n // is the pathname and any query parameters of the new route but does not\n // include the domain or origin.\n const handleRouteChangeComplete = (url: string) => {\n client.setLocation(win.location.origin + url);\n };\n router.events.on(\"routeChangeComplete\", handleRouteChangeComplete);\n\n return () => {\n router.events.off(\"routeChangeComplete\", handleRouteChangeComplete);\n };\n // We want to run this effect once per client instance and `router` is not\n // guaranteed to be referentially stable.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [client]);\n\n return null;\n};\n\nconst AppRouter: React.FC = () => {\n const pathname = usePathname();\n const searchParams = useSearchParams();\n const queryStr = searchParams.toString();\n\n const { client } = useGuideContext();\n\n React.useEffect(() => {\n // Same here, remove any location change event listeners on the window\n // object in case they are attached.\n client.removeLocationChangeEventListeners();\n }, [client]);\n\n React.useEffect(() => {\n const win = checkForWindow();\n if (!win) return;\n\n client.setLocation(win.location.href);\n }, [client, pathname, queryStr]);\n\n return null;\n};\n\nexport const KnockGuideLocationSensor = {\n PagesRouter,\n AppRouter,\n};\n"],"names":["PagesRouter","router","useRouter","client","useGuideContext","React","useEffect","win","checkForWindow","store","state","location","setLocation","href","removeLocationChangeEventListeners","handleRouteChangeComplete","url","origin","events","on","off","AppRouter","pathname","usePathname","queryStr","useSearchParams","toString","KnockGuideLocationSensor"],"mappings":";;;;;;AAUA,MAAMA,IAAwBA,MAAM;AAClC,QAAMC,IAASC,EAAU,GACnB;AAAA,IAAEC,QAAAA;AAAAA,MAAWC,EAAgB;AAEnCC,SAAAA,EAAMC,UAAU,MAAM;AACpB,UAAMC,IAAMC,EAAe;AAC3B,QAAI,CAACD,EAAK;AAGV,IAAKJ,EAAOM,MAAMC,MAAMC,YACfC,EAAAA,YAAYL,EAAII,SAASE,IAAI,GAOtCV,EAAOW,mCAAmC;AAKpCC,UAAAA,IAA4BA,CAACC,MAAgB;AACjDb,MAAAA,EAAOS,YAAYL,EAAII,SAASM,SAASD,CAAG;AAAA,IAC9C;AACOE,WAAAA,EAAAA,OAAOC,GAAG,uBAAuBJ,CAAyB,GAE1D,MAAM;AACJG,MAAAA,EAAAA,OAAOE,IAAI,uBAAuBL,CAAyB;AAAA,IACpE;AAAA,EAAA,GAIC,CAACZ,CAAM,CAAC,GAEJ;AACT,GAEMkB,IAAsBA,MAAM;AAChC,QAAMC,IAAWC,EAAY,GAEvBC,IADeC,EAAgB,EACPC,SAAS,GAEjC;AAAA,IAAEvB,QAAAA;AAAAA,MAAWC,EAAgB;AAEnCC,SAAAA,EAAMC,UAAU,MAAM;AAGpBH,IAAAA,EAAOW,mCAAmC;AAAA,EAAA,GACzC,CAACX,CAAM,CAAC,GAEXE,EAAMC,UAAU,MAAM;AACpB,UAAMC,IAAMC,EAAe;AAC3B,IAAKD,KAEEK,EAAAA,YAAYL,EAAII,SAASE,IAAI;AAAA,EACnC,GAAA,CAACV,GAAQmB,GAAUE,CAAQ,CAAC,GAExB;AACT,GAEaG,IAA2B;AAAA,EACtC3B,aAAAA;AAAAA,EACAqB,WAAAA;AACF;"}
@@ -0,0 +1,5 @@
1
+ import { KnockGuideLocationSensor as n } from "./next/KnockGuideLocationSensor.mjs";
2
+ export {
3
+ n as KnockGuideLocationSensor
4
+ };
5
+ //# sourceMappingURL=next.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,6 +1,6 @@
1
1
  export { BellIcon, Button, ButtonGroup, CheckmarkCircle, ChevronDown, CloseCircle, Spinner, useOnBottomScroll, type ButtonProps, type SpinnerProps, } from './modules/core';
2
2
  export { Avatar, EmptyFeed, MarkAsRead, NotificationCell, NotificationFeed, NotificationFeedContainer, NotificationFeedHeader, NotificationFeedPopover, NotificationIconButton, UnseenBadge, type AvatarProps, type BadgeCountType, type MarkAsReadProps, type NotificationCellProps, type NotificationFeedHeaderProps, type NotificationFeedPopoverProps, type NotificationFeedProps, type NotificationIconButtonProps, type RenderItem, type RenderItemProps, type UnseenBadgeProps, } from './modules/feed';
3
- export { Banner, BannerView, Card, CardView, KnockGuideProvider, GuideToolbar as KnockGuideToolbar, LocationSensorNextPagesRouter as KnockGuideLocationSensorNextPagesRouter, LocationSensorNextAppRouter as KnockGuideLocationSensorNextAppRouter, Modal, ModalView, } from './modules/guide';
3
+ export { Banner, BannerView, Card, CardView, KnockGuideProvider, GuideToolbar as KnockGuideToolbar, Modal, ModalView, } from './modules/guide';
4
4
  export { MsTeamsAuthButton, MsTeamsAuthContainer, MsTeamsChannelCombobox, type MsTeamsAuthButtonProps, type MsTeamsAuthContainerProps, } from './modules/ms-teams';
5
5
  export { SlackAuthButton, SlackAuthContainer, SlackChannelCombobox, type SlackAuthButtonProps, type SlackAuthContainerProps, type SlackChannelComboboxInputMessages, type SlackChannelComboboxProps, } from './modules/slack';
6
6
  export { FilterStatus, KnockProvider, feedProviderKey, formatBadgeCount, formatTimestamp, msTeamsProviderKey, renderNodeOrFallback, slackProviderKey, toSentenceCase, type ColorMode, type KnockProviderProps, type KnockProviderState, useAuthenticatedKnockClient, useKnockClient, useStableOptions, KnockFeedProvider, type KnockFeedProviderProps, type KnockFeedProviderState, type Selector, useCreateNotificationStore, useFeedSettings, useKnockFeed, useNotificationStore, useNotifications, KnockGuideContext, useGuide, useGuides, useGuideContext, type MsTeamsChannelQueryOptions, type MsTeamsTeamQueryOptions, KnockMsTeamsProvider, type KnockMsTeamsProviderProps, type KnockMsTeamsProviderState, useConnectedMsTeamsChannels, useKnockMsTeamsClient, useMsTeamsAuth, useMsTeamsChannels, useMsTeamsConnectionStatus, useMsTeamsTeams, KnockSlackProvider, type ContainerObject, type KnockSlackProviderProps, type KnockSlackProviderState, type SlackChannelQueryOptions, useConnectedSlackChannels, useKnockSlackClient, useSlackAuth, useSlackChannels, useSlackConnectionStatus, I18nContext, KnockI18nProvider, locales, type I18nContent, type KnockI18nProviderProps, type Translations, useTranslations, type RecipientObject, usePreferences, } from '@knocklabs/react-core';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAErB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,eAAe,EACf,WAAW,EACX,WAAW,EACX,OAAO,EACP,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,MAAM,EACN,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,kBAAkB,EAClB,YAAY,IAAI,iBAAiB,EACjC,6BAA6B,IAAI,uCAAuC,EACxE,2BAA2B,IAAI,qCAAqC,EACpE,KAAK,EACL,SAAS,GACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,iCAAiC,EACtC,KAAK,yBAAyB,GAC/B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,2BAA2B,EAC3B,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EACb,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,eAAe,EACf,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,EACf,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,eAAe,EACf,KAAK,eAAe,EACpB,cAAc,GACf,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AAErB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,eAAe,EACf,WAAW,EACX,WAAW,EACX,OAAO,EACP,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,MAAM,EACN,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,kBAAkB,EAClB,YAAY,IAAI,iBAAiB,EACjC,KAAK,EACL,SAAS,GACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,iCAAiC,EACtC,KAAK,yBAAyB,GAC/B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,2BAA2B,EAC3B,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EACb,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,eAAe,EACf,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,EACf,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,eAAe,EACf,KAAK,eAAe,EACpB,cAAc,GACf,MAAM,uBAAuB,CAAC"}
@@ -1,6 +1,5 @@
1
1
  export { Banner, BannerView } from './Banner';
2
2
  export { Card, CardView } from './Card';
3
3
  export { GuideToolbar } from './GuideToolbar';
4
- export { LocationSensorNextAppRouter, LocationSensorNextPagesRouter, } from './LocationSensor';
5
4
  export { Modal, ModalView } from './Modal';
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/guide/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/guide/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
@@ -1,3 +1,3 @@
1
- export { Banner, BannerView, Card, CardView, Modal, ModalView, GuideToolbar, LocationSensorNextAppRouter, LocationSensorNextPagesRouter, } from './components';
1
+ export { Banner, BannerView, Card, CardView, Modal, ModalView, GuideToolbar, } from './components';
2
2
  export { KnockGuideProvider } from './providers';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/guide/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,YAAY,EACZ,2BAA2B,EAC3B,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/guide/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export declare const KnockGuideLocationSensor: {
3
+ PagesRouter: React.FC<{}>;
4
+ AppRouter: React.FC<{}>;
5
+ };
6
+ //# sourceMappingURL=KnockGuideLocationSensor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KnockGuideLocationSensor.d.ts","sourceRoot":"","sources":["../../../src/next/KnockGuideLocationSensor.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiE1B,eAAO,MAAM,wBAAwB;;;CAGpC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { KnockGuideLocationSensor } from './KnockGuideLocationSensor';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/next/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@knocklabs/react",
3
3
  "description": "A set of React components to build notification experiences powered by Knock",
4
4
  "author": "@knocklabs",
5
- "version": "0.9.0",
5
+ "version": "0.9.2",
6
6
  "license": "MIT",
7
7
  "main": "dist/cjs/index.js",
8
8
  "module": "dist/esm/index.mjs",
@@ -16,6 +16,12 @@
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "import": "./dist/esm/index.mjs",
18
18
  "default": "./dist/cjs/index.js"
19
+ },
20
+ "./next": {
21
+ "require": "./dist/cjs/next.js",
22
+ "types": "./dist/types/next/index.d.ts",
23
+ "import": "./dist/esm/next.mjs",
24
+ "default": "./dist/cjs/next.js"
19
25
  }
20
26
  },
21
27
  "files": [
@@ -56,11 +62,11 @@
56
62
  }
57
63
  },
58
64
  "dependencies": {
59
- "@knocklabs/client": "^0.19.0",
60
- "@knocklabs/react-core": "^0.11.0",
65
+ "@knocklabs/client": "^0.19.2",
66
+ "@knocklabs/react-core": "^0.11.2",
61
67
  "@popperjs/core": "^2.11.8",
62
68
  "@radix-ui/react-dialog": "^1.1.15",
63
- "@telegraph/combobox": "^0.1.15",
69
+ "@telegraph/combobox": "^0.1.16",
64
70
  "@telegraph/icon": "^0.2.7",
65
71
  "@telegraph/layout": "^0.2.3",
66
72
  "@telegraph/tokens": "^0.1.2",
@@ -1,2 +0,0 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@knocklabs/react-core"),n=require("next/navigation"),o=require("react"),a=require("../../../core/utils.js"),i=()=>{const r=n.usePathname(),s=n.useSearchParams().toString(),{client:e}=c.useGuideContext();return o.useEffect(()=>{e.removeLocationChangeEventListeners()},[e]),o.useEffect(()=>{const t=a.checkForWindow();t&&e.setLocation(t.location.href)},[e,r,s]),null};exports.LocationSensorNextAppRouter=i;
2
- //# sourceMappingURL=NextAppRouter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NextAppRouter.js","sources":["../../../../../../src/modules/guide/components/LocationSensor/NextAppRouter.tsx"],"sourcesContent":["\"use client\";\n\nimport { useGuideContext } from \"@knocklabs/react-core\";\nimport { usePathname, useSearchParams } from \"next/navigation\";\nimport { useEffect } from \"react\";\n\nimport { checkForWindow } from \"../../../core/utils\";\n\nexport const LocationSensorNextAppRouter = () => {\n const pathname = usePathname();\n const searchParams = useSearchParams();\n const queryStr = searchParams.toString();\n\n const { client } = useGuideContext();\n\n useEffect(() => {\n client.removeLocationChangeEventListeners();\n }, [client]);\n\n useEffect(() => {\n const win = checkForWindow();\n if (!win) return;\n\n client.setLocation(win.location.href);\n }, [client, pathname, queryStr]);\n\n return null;\n};\n"],"names":["LocationSensorNextAppRouter","pathname","usePathname","queryStr","useSearchParams","toString","client","useGuideContext","useEffect","removeLocationChangeEventListeners","win","checkForWindow","setLocation","location","href"],"mappings":"0NAQaA,EAA8BA,IAAM,CAC/C,MAAMC,EAAWC,EAAAA,YAAY,EAEvBC,EADeC,EAAAA,gBAAgB,EACPC,SAAS,EAEjC,CAAEC,OAAAA,GAAWC,kBAAgB,EAEnCC,OAAAA,EAAAA,UAAU,IAAM,CACdF,EAAOG,mCAAmC,CAAA,EACzC,CAACH,CAAM,CAAC,EAEXE,EAAAA,UAAU,IAAM,CACd,MAAME,EAAMC,EAAAA,eAAe,EACtBD,GAEEE,EAAAA,YAAYF,EAAIG,SAASC,IAAI,CACnC,EAAA,CAACR,EAAQL,EAAUE,CAAQ,CAAC,EAExB,IACT"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@knocklabs/react-core"),c=require("next/router"),i=require("react"),u=require("../../../core/utils.js"),a=()=>{const o=c.useRouter(),{client:e}=s.useGuideContext();return i.useEffect(()=>{const t=u.checkForWindow();if(!t)return;e.store.state.location||e.setLocation(t.location.href),e.removeLocationChangeEventListeners();const n=r=>{e.setLocation(t.location.origin+r)};return o.events.on("routeChangeComplete",n),()=>{o.events.off("routeChangeComplete",n)}},[e]),null};exports.LocationSensorNextPagesRouter=a;
2
- //# sourceMappingURL=NextPagesRouter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NextPagesRouter.js","sources":["../../../../../../src/modules/guide/components/LocationSensor/NextPagesRouter.tsx"],"sourcesContent":["import { useGuideContext } from \"@knocklabs/react-core\";\nimport { useRouter } from \"next/router\";\nimport { useEffect } from \"react\";\n\nimport { checkForWindow } from \"../../../core/utils\";\n\nexport const LocationSensorNextPagesRouter = () => {\n const router = useRouter();\n const { client } = useGuideContext();\n\n useEffect(() => {\n const win = checkForWindow();\n if (!win) return;\n\n // Set the initial location if not yet set.\n if (!client.store.state.location) {\n client.setLocation(win.location.href);\n }\n\n // Remove any location chagne event listeners on the window object in case\n // they are attached.\n client.removeLocationChangeEventListeners();\n\n // Attach a route change event listener to the nextjs router. Note, here url\n // is the pathname and any query parameters of the new route but does not\n // include the domain or origin.\n const handleRouteChangeComplete = (url: string) => {\n client.setLocation(win.location.origin + url);\n };\n router.events.on(\"routeChangeComplete\", handleRouteChangeComplete);\n\n return () => {\n router.events.off(\"routeChangeComplete\", handleRouteChangeComplete);\n };\n // We want to run this effect once per client instance and `router` is not\n // guaranteed to be referentially stable.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [client]);\n\n return null;\n};\n"],"names":["LocationSensorNextPagesRouter","router","useRouter","client","useGuideContext","useEffect","win","checkForWindow","store","state","location","setLocation","href","removeLocationChangeEventListeners","handleRouteChangeComplete","url","origin","events","on","off"],"mappings":"yMAMaA,EAAgCA,IAAM,CACjD,MAAMC,EAASC,EAAAA,UAAU,EACnB,CAAEC,OAAAA,GAAWC,kBAAgB,EAEnCC,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAMC,EAAAA,eAAe,EAC3B,GAAI,CAACD,EAAK,OAGLH,EAAOK,MAAMC,MAAMC,UACfC,EAAAA,YAAYL,EAAII,SAASE,IAAI,EAKtCT,EAAOU,mCAAmC,EAKpCC,MAAAA,EAA6BC,GAAgB,CACjDZ,EAAOQ,YAAYL,EAAII,SAASM,OAASD,CAAG,CAC9C,EACOE,OAAAA,EAAAA,OAAOC,GAAG,sBAAuBJ,CAAyB,EAE1D,IAAM,CACJG,EAAAA,OAAOE,IAAI,sBAAuBL,CAAyB,CACpE,CAAA,EAIC,CAACX,CAAM,CAAC,EAEJ,IACT"}
@@ -1,20 +0,0 @@
1
- "use client";
2
- import { useGuideContext as s } from "@knocklabs/react-core";
3
- import { usePathname as a, useSearchParams as c } from "next/navigation";
4
- import { useEffect as o } from "react";
5
- import { checkForWindow as i } from "../../../core/utils.mjs";
6
- const l = () => {
7
- const r = a(), n = c().toString(), {
8
- client: t
9
- } = s();
10
- return o(() => {
11
- t.removeLocationChangeEventListeners();
12
- }, [t]), o(() => {
13
- const e = i();
14
- e && t.setLocation(e.location.href);
15
- }, [t, r, n]), null;
16
- };
17
- export {
18
- l as LocationSensorNextAppRouter
19
- };
20
- //# sourceMappingURL=NextAppRouter.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NextAppRouter.mjs","sources":["../../../../../../src/modules/guide/components/LocationSensor/NextAppRouter.tsx"],"sourcesContent":["\"use client\";\n\nimport { useGuideContext } from \"@knocklabs/react-core\";\nimport { usePathname, useSearchParams } from \"next/navigation\";\nimport { useEffect } from \"react\";\n\nimport { checkForWindow } from \"../../../core/utils\";\n\nexport const LocationSensorNextAppRouter = () => {\n const pathname = usePathname();\n const searchParams = useSearchParams();\n const queryStr = searchParams.toString();\n\n const { client } = useGuideContext();\n\n useEffect(() => {\n client.removeLocationChangeEventListeners();\n }, [client]);\n\n useEffect(() => {\n const win = checkForWindow();\n if (!win) return;\n\n client.setLocation(win.location.href);\n }, [client, pathname, queryStr]);\n\n return null;\n};\n"],"names":["LocationSensorNextAppRouter","pathname","usePathname","queryStr","useSearchParams","toString","client","useGuideContext","useEffect","removeLocationChangeEventListeners","win","checkForWindow","setLocation","location","href"],"mappings":";;;;;AAQO,MAAMA,IAA8BA,MAAM;AAC/C,QAAMC,IAAWC,EAAY,GAEvBC,IADeC,EAAgB,EACPC,SAAS,GAEjC;AAAA,IAAEC,QAAAA;AAAAA,MAAWC,EAAgB;AAEnCC,SAAAA,EAAU,MAAM;AACdF,IAAAA,EAAOG,mCAAmC;AAAA,EAAA,GACzC,CAACH,CAAM,CAAC,GAEXE,EAAU,MAAM;AACd,UAAME,IAAMC,EAAe;AAC3B,IAAKD,KAEEE,EAAAA,YAAYF,EAAIG,SAASC,IAAI;AAAA,EACnC,GAAA,CAACR,GAAQL,GAAUE,CAAQ,CAAC,GAExB;AACT;"}
@@ -1,24 +0,0 @@
1
- import { useGuideContext as i } from "@knocklabs/react-core";
2
- import { useRouter as s } from "next/router";
3
- import { useEffect as c } from "react";
4
- import { checkForWindow as a } from "../../../core/utils.mjs";
5
- const p = () => {
6
- const t = s(), {
7
- client: e
8
- } = i();
9
- return c(() => {
10
- const o = a();
11
- if (!o) return;
12
- e.store.state.location || e.setLocation(o.location.href), e.removeLocationChangeEventListeners();
13
- const n = (r) => {
14
- e.setLocation(o.location.origin + r);
15
- };
16
- return t.events.on("routeChangeComplete", n), () => {
17
- t.events.off("routeChangeComplete", n);
18
- };
19
- }, [e]), null;
20
- };
21
- export {
22
- p as LocationSensorNextPagesRouter
23
- };
24
- //# sourceMappingURL=NextPagesRouter.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NextPagesRouter.mjs","sources":["../../../../../../src/modules/guide/components/LocationSensor/NextPagesRouter.tsx"],"sourcesContent":["import { useGuideContext } from \"@knocklabs/react-core\";\nimport { useRouter } from \"next/router\";\nimport { useEffect } from \"react\";\n\nimport { checkForWindow } from \"../../../core/utils\";\n\nexport const LocationSensorNextPagesRouter = () => {\n const router = useRouter();\n const { client } = useGuideContext();\n\n useEffect(() => {\n const win = checkForWindow();\n if (!win) return;\n\n // Set the initial location if not yet set.\n if (!client.store.state.location) {\n client.setLocation(win.location.href);\n }\n\n // Remove any location chagne event listeners on the window object in case\n // they are attached.\n client.removeLocationChangeEventListeners();\n\n // Attach a route change event listener to the nextjs router. Note, here url\n // is the pathname and any query parameters of the new route but does not\n // include the domain or origin.\n const handleRouteChangeComplete = (url: string) => {\n client.setLocation(win.location.origin + url);\n };\n router.events.on(\"routeChangeComplete\", handleRouteChangeComplete);\n\n return () => {\n router.events.off(\"routeChangeComplete\", handleRouteChangeComplete);\n };\n // We want to run this effect once per client instance and `router` is not\n // guaranteed to be referentially stable.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [client]);\n\n return null;\n};\n"],"names":["LocationSensorNextPagesRouter","router","useRouter","client","useGuideContext","useEffect","win","checkForWindow","store","state","location","setLocation","href","removeLocationChangeEventListeners","handleRouteChangeComplete","url","origin","events","on","off"],"mappings":";;;;AAMO,MAAMA,IAAgCA,MAAM;AACjD,QAAMC,IAASC,EAAU,GACnB;AAAA,IAAEC,QAAAA;AAAAA,MAAWC,EAAgB;AAEnCC,SAAAA,EAAU,MAAM;AACd,UAAMC,IAAMC,EAAe;AAC3B,QAAI,CAACD,EAAK;AAGV,IAAKH,EAAOK,MAAMC,MAAMC,YACfC,EAAAA,YAAYL,EAAII,SAASE,IAAI,GAKtCT,EAAOU,mCAAmC;AAKpCC,UAAAA,IAA4BA,CAACC,MAAgB;AACjDZ,MAAAA,EAAOQ,YAAYL,EAAII,SAASM,SAASD,CAAG;AAAA,IAC9C;AACOE,WAAAA,EAAAA,OAAOC,GAAG,uBAAuBJ,CAAyB,GAE1D,MAAM;AACJG,MAAAA,EAAAA,OAAOE,IAAI,uBAAuBL,CAAyB;AAAA,IACpE;AAAA,EAAA,GAIC,CAACX,CAAM,CAAC,GAEJ;AACT;"}
@@ -1,2 +0,0 @@
1
- export declare const LocationSensorNextAppRouter: () => null;
2
- //# sourceMappingURL=NextAppRouter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NextAppRouter.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/guide/components/LocationSensor/NextAppRouter.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,2BAA2B,YAmBvC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const LocationSensorNextPagesRouter: () => null;
2
- //# sourceMappingURL=NextPagesRouter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NextPagesRouter.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/guide/components/LocationSensor/NextPagesRouter.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,6BAA6B,YAkCzC,CAAC"}
@@ -1,3 +0,0 @@
1
- export { LocationSensorNextAppRouter } from './NextAppRouter';
2
- export { LocationSensorNextPagesRouter } from './NextPagesRouter';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/guide/components/LocationSensor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC"}