@fluid-app/portal-sdk 0.1.493 → 0.1.495

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 (133) hide show
  1. package/dist/{AnnouncementWidget-CNP37JUB.cjs → AnnouncementWidget--nRHRrQH.cjs} +3 -3
  2. package/dist/{AnnouncementWidget-93a322Pl.mjs → AnnouncementWidget-BND76Ojg.mjs} +2 -2
  3. package/dist/{AnnouncementWidget-93a322Pl.mjs.map → AnnouncementWidget-BND76Ojg.mjs.map} +1 -1
  4. package/dist/{AnnouncementWidget-BIFJ7E6o.cjs → AnnouncementWidget-Dh6nKAqT.cjs} +2 -2
  5. package/dist/{AnnouncementWidget-BIFJ7E6o.cjs.map → AnnouncementWidget-Dh6nKAqT.cjs.map} +1 -1
  6. package/dist/{CarouselWidget-fft3Aibh.cjs → CarouselWidget-BETNqs_K.cjs} +3 -3
  7. package/dist/{CarouselWidget-fft3Aibh.cjs.map → CarouselWidget-BETNqs_K.cjs.map} +1 -1
  8. package/dist/{CarouselWidget-COavwXvx.mjs → CarouselWidget-CU1oj0q4.mjs} +3 -3
  9. package/dist/{CarouselWidget-COavwXvx.mjs.map → CarouselWidget-CU1oj0q4.mjs.map} +1 -1
  10. package/dist/{CarouselWidget-DDKKVEan.cjs → CarouselWidget-D3BODbpO.cjs} +3 -3
  11. package/dist/{CatchUpWidget-C3HdLA5t.mjs → CatchUpWidget-BtwG2-JD.mjs} +2 -2
  12. package/dist/{CatchUpWidget-BNEEQNcr.mjs → CatchUpWidget-CLwHp30X.mjs} +5 -4
  13. package/dist/CatchUpWidget-CLwHp30X.mjs.map +1 -0
  14. package/dist/{CatchUpWidget-G4txAfv3.cjs → CatchUpWidget-CqAHpCJP.cjs} +5 -4
  15. package/dist/CatchUpWidget-CqAHpCJP.cjs.map +1 -0
  16. package/dist/{CatchUpWidget-g9GtsvCy.cjs → CatchUpWidget-ak-oFdKY.cjs} +2 -2
  17. package/dist/{FluidProvider-B7bYw1AY.cjs → FluidProvider-53Us6Wck.cjs} +3 -3
  18. package/dist/{FluidProvider-B7bYw1AY.cjs.map → FluidProvider-53Us6Wck.cjs.map} +1 -1
  19. package/dist/{FluidProvider-DxwbLpfX.mjs → FluidProvider-DP6sHwZs.mjs} +3 -3
  20. package/dist/{FluidProvider-DxwbLpfX.mjs.map → FluidProvider-DP6sHwZs.mjs.map} +1 -1
  21. package/dist/{ImageWidget-B3IlWnKJ.cjs → ImageWidget-CksrA9rH.cjs} +2 -2
  22. package/dist/{ImageWidget-B3IlWnKJ.cjs.map → ImageWidget-CksrA9rH.cjs.map} +1 -1
  23. package/dist/{ImageWidget-DiWlWvKm.cjs → ImageWidget-DmO84AYo.cjs} +3 -3
  24. package/dist/{ImageWidget-CovwH8bp.mjs → ImageWidget-I8F34YlI.mjs} +2 -2
  25. package/dist/{ImageWidget-CovwH8bp.mjs.map → ImageWidget-I8F34YlI.mjs.map} +1 -1
  26. package/dist/{LinkWidget-StpP6gPq.mjs → LinkWidget-Dg0tHfgD.mjs} +2 -2
  27. package/dist/{LinkWidget-StpP6gPq.mjs.map → LinkWidget-Dg0tHfgD.mjs.map} +1 -1
  28. package/dist/{LinkWidget-BTIsGyc5.cjs → LinkWidget-Dvp6-Dow.cjs} +2 -2
  29. package/dist/{LinkWidget-BTIsGyc5.cjs.map → LinkWidget-Dvp6-Dow.cjs.map} +1 -1
  30. package/dist/{LinkWidget-ZVFlL178.cjs → LinkWidget-N6yz6w-U.cjs} +3 -3
  31. package/dist/{ListWidget-ddhJLwxZ.mjs → ListWidget-BAS3SGpD.mjs} +3 -3
  32. package/dist/{ListWidget-ddhJLwxZ.mjs.map → ListWidget-BAS3SGpD.mjs.map} +1 -1
  33. package/dist/{ListWidget-6TkLyp00.cjs → ListWidget-CH-zz3sb.cjs} +3 -3
  34. package/dist/{ListWidget-6TkLyp00.cjs.map → ListWidget-CH-zz3sb.cjs.map} +1 -1
  35. package/dist/{ListWidget-BNAED5xZ.cjs → ListWidget-vG31UVVS.cjs} +3 -3
  36. package/dist/{MessagingScreen-Q0BSmRuJ.mjs → MessagingScreen-BDU6-95p.mjs} +2 -2
  37. package/dist/{MessagingScreen-Q0BSmRuJ.mjs.map → MessagingScreen-BDU6-95p.mjs.map} +1 -1
  38. package/dist/{MessagingScreen-DDVflwCT.cjs → MessagingScreen-BHIdW4zb.cjs} +19 -19
  39. package/dist/{MessagingScreen-D7Yuy_Rn.cjs → MessagingScreen-CrlbbYnh.cjs} +2 -2
  40. package/dist/{MessagingScreen-D7Yuy_Rn.cjs.map → MessagingScreen-CrlbbYnh.cjs.map} +1 -1
  41. package/dist/{MessagingScreen-CZje-9-C.mjs → MessagingScreen-D3MBcqOK.mjs} +19 -19
  42. package/dist/{NestedWidget-orTqukJD.cjs → NestedWidget-B24yMkV4.cjs} +2 -2
  43. package/dist/{NestedWidget-orTqukJD.cjs.map → NestedWidget-B24yMkV4.cjs.map} +1 -1
  44. package/dist/{NestedWidget-DMhmCZT6.mjs → NestedWidget-D31rZhTR.mjs} +2 -2
  45. package/dist/{NestedWidget-DMhmCZT6.mjs.map → NestedWidget-D31rZhTR.mjs.map} +1 -1
  46. package/dist/{NestedWidget-BZZqukZw.cjs → NestedWidget-DqM5HGFl.cjs} +2 -2
  47. package/dist/{OrdersScreen-CXxGN6RY.mjs → OrdersScreen-C8ObD3qC.mjs} +3 -3
  48. package/dist/{OrdersScreen-CXxGN6RY.mjs.map → OrdersScreen-C8ObD3qC.mjs.map} +1 -1
  49. package/dist/{OrdersScreen-C0TzmZCl.cjs → OrdersScreen-CPab3qey.cjs} +3 -3
  50. package/dist/{OrdersScreen-C0TzmZCl.cjs.map → OrdersScreen-CPab3qey.cjs.map} +1 -1
  51. package/dist/{OrdersScreen-vAO6E8EM.cjs → OrdersScreen-ClsetoAd.cjs} +19 -19
  52. package/dist/{OrdersScreen-DOBWnf_w.mjs → OrdersScreen-u0JHPiqt.mjs} +19 -19
  53. package/dist/{ProfileScreen-DWFXnUUU.mjs → ProfileScreen-B-n-A15K.mjs} +20 -20
  54. package/dist/{ProfileScreen-tq1DJ71b.cjs → ProfileScreen-BnxYqSJx.cjs} +3 -3
  55. package/dist/{ProfileScreen-tq1DJ71b.cjs.map → ProfileScreen-BnxYqSJx.cjs.map} +1 -1
  56. package/dist/{ProfileScreen-BGLpyuef.mjs → ProfileScreen-CPs27Mm9.mjs} +3 -3
  57. package/dist/{ProfileScreen-BGLpyuef.mjs.map → ProfileScreen-CPs27Mm9.mjs.map} +1 -1
  58. package/dist/{ProfileScreen-B9NHS4A_.cjs → ProfileScreen-D8GmN99O.cjs} +20 -20
  59. package/dist/{QuickLinksWidget-DIkDVuvE.mjs → QuickLinksWidget-BiEUvm_J.mjs} +2 -2
  60. package/dist/{QuickLinksWidget-DIkDVuvE.mjs.map → QuickLinksWidget-BiEUvm_J.mjs.map} +1 -1
  61. package/dist/{QuickLinksWidget-DDFtIKqs.cjs → QuickLinksWidget-CLBvaogv.cjs} +2 -2
  62. package/dist/{QuickLinksWidget-DDFtIKqs.cjs.map → QuickLinksWidget-CLBvaogv.cjs.map} +1 -1
  63. package/dist/{QuickLinksWidget-HvMQHOkz.cjs → QuickLinksWidget-DzAL_wuz.cjs} +3 -3
  64. package/dist/{QuickShareWidget-BNf1Un61.cjs → QuickShareWidget-B7mlqgW8.cjs} +2 -2
  65. package/dist/{QuickShareWidget-lysi8Dhh.mjs → QuickShareWidget-Dzpzis1d.mjs} +2 -2
  66. package/dist/{QuickShareWidget-lysi8Dhh.mjs.map → QuickShareWidget-Dzpzis1d.mjs.map} +1 -1
  67. package/dist/{QuickShareWidget-mxiy1zdd.cjs → QuickShareWidget-wxRcBUkf.cjs} +2 -2
  68. package/dist/{QuickShareWidget-mxiy1zdd.cjs.map → QuickShareWidget-wxRcBUkf.cjs.map} +1 -1
  69. package/dist/{RecentActivityWidget-DGtKC_9F.mjs → RecentActivityWidget-BzmV4G8e.mjs} +2 -2
  70. package/dist/{RecentActivityWidget-DGtKC_9F.mjs.map → RecentActivityWidget-BzmV4G8e.mjs.map} +1 -1
  71. package/dist/{RecentActivityWidget-DcgOzvHx.cjs → RecentActivityWidget-DQcy41-I.cjs} +2 -2
  72. package/dist/{RecentActivityWidget-Cr1G82Cd.cjs → RecentActivityWidget-zBOY0c_B.cjs} +2 -2
  73. package/dist/{RecentActivityWidget-Cr1G82Cd.cjs.map → RecentActivityWidget-zBOY0c_B.cjs.map} +1 -1
  74. package/dist/{ShopWidget-C5hjVwsY.cjs → ShopWidget-CCITGTSs.cjs} +2 -2
  75. package/dist/{ShopWidget-C5hjVwsY.cjs.map → ShopWidget-CCITGTSs.cjs.map} +1 -1
  76. package/dist/{ShopWidget-BYQKWyri.mjs → ShopWidget-D98tmUgG.mjs} +2 -2
  77. package/dist/{ShopWidget-B80w-Drk.mjs → ShopWidget-DHM86LM3.mjs} +2 -2
  78. package/dist/{ShopWidget-B80w-Drk.mjs.map → ShopWidget-DHM86LM3.mjs.map} +1 -1
  79. package/dist/{ShopWidget-CoOK6Ctd.cjs → ShopWidget-DXVsF1Jh.cjs} +2 -2
  80. package/dist/{SubscriptionsScreen-Cy7RtO5K.cjs → SubscriptionsScreen--FWQpJ50.cjs} +4 -4
  81. package/dist/{SubscriptionsScreen-Cy7RtO5K.cjs.map → SubscriptionsScreen--FWQpJ50.cjs.map} +1 -1
  82. package/dist/{SubscriptionsScreen-BEzmLp01.cjs → SubscriptionsScreen-D2aqGKLC.cjs} +20 -20
  83. package/dist/{SubscriptionsScreen-C7OOGlBt.mjs → SubscriptionsScreen-D61Y6viw.mjs} +4 -4
  84. package/dist/{SubscriptionsScreen-C7OOGlBt.mjs.map → SubscriptionsScreen-D61Y6viw.mjs.map} +1 -1
  85. package/dist/{SubscriptionsScreen-BwcpTAn5.mjs → SubscriptionsScreen-Y8tSHKCd.mjs} +20 -20
  86. package/dist/{TableWidget-lXrvBX6U.cjs → TableWidget-B8F_uQ92.cjs} +2 -2
  87. package/dist/{TableWidget-Bxwn3QYs.mjs → TableWidget-CDGdl71J.mjs} +2 -2
  88. package/dist/{TableWidget-Bxwn3QYs.mjs.map → TableWidget-CDGdl71J.mjs.map} +1 -1
  89. package/dist/{TableWidget-uoeYCPzf.cjs → TableWidget-DNjUA2Il.cjs} +2 -2
  90. package/dist/{TableWidget-uoeYCPzf.cjs.map → TableWidget-DNjUA2Il.cjs.map} +1 -1
  91. package/dist/{VideoWidget-D8FAjnvj.cjs → VideoWidget-UQQoRmwC.cjs} +3 -3
  92. package/dist/{VideoWidget-DQzYOcFF.mjs → VideoWidget-Wca2-So_.mjs} +2 -2
  93. package/dist/{VideoWidget-DQzYOcFF.mjs.map → VideoWidget-Wca2-So_.mjs.map} +1 -1
  94. package/dist/{VideoWidget-BhN4oTGG.cjs → VideoWidget-bf-gkCfx.cjs} +2 -2
  95. package/dist/{VideoWidget-BhN4oTGG.cjs.map → VideoWidget-bf-gkCfx.cjs.map} +1 -1
  96. package/dist/{WidgetInteractionContext-Bjy4P_YP.cjs → WidgetInteractionContext-D9dBJ-39.cjs} +5 -3
  97. package/dist/WidgetInteractionContext-D9dBJ-39.cjs.map +1 -0
  98. package/dist/{WidgetInteractionContext-Ba_G5sDP.mjs → WidgetInteractionContext-IsMo73Ka.mjs} +5 -3
  99. package/dist/WidgetInteractionContext-IsMo73Ka.mjs.map +1 -0
  100. package/dist/{build-widget-registry-BZeMOKCj.cjs → build-widget-registry-DpPMWfL5.cjs} +50 -28
  101. package/dist/build-widget-registry-DpPMWfL5.cjs.map +1 -0
  102. package/dist/{build-widget-registry-DAOb4Muk.mjs → build-widget-registry-m79ilpcM.mjs} +50 -28
  103. package/dist/build-widget-registry-m79ilpcM.mjs.map +1 -0
  104. package/dist/index.cjs +55 -34
  105. package/dist/index.cjs.map +1 -1
  106. package/dist/index.d.cts.map +1 -1
  107. package/dist/index.d.mts.map +1 -1
  108. package/dist/index.mjs +55 -34
  109. package/dist/index.mjs.map +1 -1
  110. package/dist/styles/remote-widget-shadow.css +2 -2
  111. package/dist/{use-internal-link-WJcYzKsi.mjs → use-internal-link-CKMpGvvs.mjs} +2 -2
  112. package/dist/{use-internal-link-WJcYzKsi.mjs.map → use-internal-link-CKMpGvvs.mjs.map} +1 -1
  113. package/dist/{use-internal-link-BTIkbJYg.cjs → use-internal-link-IcDHjPGp.cjs} +2 -2
  114. package/dist/{use-internal-link-BTIkbJYg.cjs.map → use-internal-link-IcDHjPGp.cjs.map} +1 -1
  115. package/dist/{use-link-action-C32zrsI0.mjs → use-link-action-CtVnC_2G.mjs} +2 -2
  116. package/dist/{use-link-action-C32zrsI0.mjs.map → use-link-action-CtVnC_2G.mjs.map} +1 -1
  117. package/dist/{use-link-action-rBy0j6go.cjs → use-link-action-DzA9AQsE.cjs} +2 -2
  118. package/dist/{use-link-action-rBy0j6go.cjs.map → use-link-action-DzA9AQsE.cjs.map} +1 -1
  119. package/dist/{use-portal-card-add-3ds-flow-DUBFzvAB.cjs → use-portal-card-add-3ds-flow-BNc0Hrsk.cjs} +3 -3
  120. package/dist/{use-portal-card-add-3ds-flow-DUBFzvAB.cjs.map → use-portal-card-add-3ds-flow-BNc0Hrsk.cjs.map} +1 -1
  121. package/dist/{use-portal-card-add-3ds-flow-DhfOxgMV.mjs → use-portal-card-add-3ds-flow-DAvzNIZN.mjs} +3 -3
  122. package/dist/{use-portal-card-add-3ds-flow-DhfOxgMV.mjs.map → use-portal-card-add-3ds-flow-DAvzNIZN.mjs.map} +1 -1
  123. package/dist/utils/build-remote-widget-plugin-manifests.cjs +17 -17
  124. package/dist/utils/build-remote-widget-plugin-manifests.mjs +17 -17
  125. package/dist/utils/build-widget-registry.cjs +17 -17
  126. package/dist/utils/build-widget-registry.mjs +17 -17
  127. package/package.json +20 -20
  128. package/dist/CatchUpWidget-BNEEQNcr.mjs.map +0 -1
  129. package/dist/CatchUpWidget-G4txAfv3.cjs.map +0 -1
  130. package/dist/WidgetInteractionContext-Ba_G5sDP.mjs.map +0 -1
  131. package/dist/WidgetInteractionContext-Bjy4P_YP.cjs.map +0 -1
  132. package/dist/build-widget-registry-BZeMOKCj.cjs.map +0 -1
  133. package/dist/build-widget-registry-DAOb4Muk.mjs.map +0 -1
@@ -9,8 +9,8 @@
9
9
  @source "../ResponsiveDialog-CquyCSKL.mjs";
10
10
  @source "../SearchSort-BFE4vK5I.cjs";
11
11
  @source "../SearchSort-Bff2iTtF.mjs";
12
- @source "../build-widget-registry-BZeMOKCj.cjs";
13
- @source "../build-widget-registry-DAOb4Muk.mjs";
12
+ @source "../build-widget-registry-DpPMWfL5.cjs";
13
+ @source "../build-widget-registry-m79ilpcM.mjs";
14
14
  @source "../src-B6YzMK6y.cjs";
15
15
  @source "../src-BfINy9nC.mjs";
16
16
  /* Standalone Tailwind root for host-owned UI inside widget shadow roots. */
@@ -1,4 +1,4 @@
1
- import { n as useWidgetInteraction } from "./WidgetInteractionContext-Ba_G5sDP.mjs";
1
+ import { n as useWidgetInteraction } from "./WidgetInteractionContext-IsMo73Ka.mjs";
2
2
  import { t as isBrowserHandledClick } from "./browser-click-DtHzsdH8.mjs";
3
3
  import { useCallback } from "react";
4
4
  //#region ../widgets/src/hooks/use-internal-link.ts
@@ -29,4 +29,4 @@ function useInternalLinks() {
29
29
  //#endregion
30
30
  export { useInternalLinks as t };
31
31
 
32
- //# sourceMappingURL=use-internal-link-WJcYzKsi.mjs.map
32
+ //# sourceMappingURL=use-internal-link-CKMpGvvs.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-internal-link-WJcYzKsi.mjs","names":[],"sources":["../../widgets/src/hooks/use-internal-link.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport { isBrowserHandledClick } from \"../lib/browser-click\";\n\nexport interface InternalLink {\n /**\n * Click handler for the anchor. Navigates in-app when the href points at a\n * screen in this portal, and does nothing otherwise so the browser follows\n * the link as authored — including for Cmd/Ctrl/Shift/Alt and middle clicks,\n * which asked for a new tab or window.\n *\n * Returns whether the click was handled in-app, so a caller with follow-up of\n * its own (closing a modal, say) only runs it when the user is actually\n * staying on this page.\n */\n followInternally: (e: React.MouseEvent) => boolean;\n}\n\n/**\n * Resolve links that widget authors typed as plain URLs but that point back\n * into this portal (e.g. \"/profile\"). Following them as real links reloads the\n * document — or worse, opens a new tab — which throws away the in-session\n * referrer the mobile header's back button is derived from, stranding the user\n * on the destination screen. Navigating in-app instead keeps a way back.\n *\n * Returns a resolver rather than the link itself so widgets can call it per\n * item while rendering a list (carousel slides, link rows), where a hook can't\n * go. Pass undefined to opt a link out, e.g. one the author set to open in a\n * new tab.\n */\nexport function useInternalLinks(): (href: string | undefined) => InternalLink {\n const { onNavigate, resolveInternalSlug } = useWidgetInteraction();\n\n return useCallback(\n (href: string | undefined) => {\n const slug = href ? resolveInternalSlug?.(href) : undefined;\n\n return {\n followInternally: (e: React.MouseEvent) => {\n if (!slug || !onNavigate || isBrowserHandledClick(e)) return false;\n e.preventDefault();\n onNavigate(slug);\n return true;\n },\n };\n },\n [onNavigate, resolveInternalSlug],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,SAAgB,mBAA+D;CAC7E,MAAM,EAAE,YAAY,wBAAwB,sBAAsB;AAElE,QAAO,aACJ,SAA6B;EAC5B,MAAM,OAAO,OAAO,sBAAsB,KAAK,GAAG,KAAA;AAElD,SAAO,EACL,mBAAmB,MAAwB;AACzC,OAAI,CAAC,QAAQ,CAAC,cAAc,sBAAsB,EAAE,CAAE,QAAO;AAC7D,KAAE,gBAAgB;AAClB,cAAW,KAAK;AAChB,UAAO;KAEV;IAEH,CAAC,YAAY,oBAAoB,CAClC"}
1
+ {"version":3,"file":"use-internal-link-CKMpGvvs.mjs","names":[],"sources":["../../widgets/src/hooks/use-internal-link.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport { isBrowserHandledClick } from \"../lib/browser-click\";\n\nexport interface InternalLink {\n /**\n * Click handler for the anchor. Navigates in-app when the href points at a\n * screen in this portal, and does nothing otherwise so the browser follows\n * the link as authored — including for Cmd/Ctrl/Shift/Alt and middle clicks,\n * which asked for a new tab or window.\n *\n * Returns whether the click was handled in-app, so a caller with follow-up of\n * its own (closing a modal, say) only runs it when the user is actually\n * staying on this page.\n */\n followInternally: (e: React.MouseEvent) => boolean;\n}\n\n/**\n * Resolve links that widget authors typed as plain URLs but that point back\n * into this portal (e.g. \"/profile\"). Following them as real links reloads the\n * document — or worse, opens a new tab — which throws away the in-session\n * referrer the mobile header's back button is derived from, stranding the user\n * on the destination screen. Navigating in-app instead keeps a way back.\n *\n * Returns a resolver rather than the link itself so widgets can call it per\n * item while rendering a list (carousel slides, link rows), where a hook can't\n * go. Pass undefined to opt a link out, e.g. one the author set to open in a\n * new tab.\n */\nexport function useInternalLinks(): (href: string | undefined) => InternalLink {\n const { onNavigate, resolveInternalSlug } = useWidgetInteraction();\n\n return useCallback(\n (href: string | undefined) => {\n const slug = href ? resolveInternalSlug?.(href) : undefined;\n\n return {\n followInternally: (e: React.MouseEvent) => {\n if (!slug || !onNavigate || isBrowserHandledClick(e)) return false;\n e.preventDefault();\n onNavigate(slug);\n return true;\n },\n };\n },\n [onNavigate, resolveInternalSlug],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,SAAgB,mBAA+D;CAC7E,MAAM,EAAE,YAAY,wBAAwB,sBAAsB;AAElE,QAAO,aACJ,SAA6B;EAC5B,MAAM,OAAO,OAAO,sBAAsB,KAAK,GAAG,KAAA;AAElD,SAAO,EACL,mBAAmB,MAAwB;AACzC,OAAI,CAAC,QAAQ,CAAC,cAAc,sBAAsB,EAAE,CAAE,QAAO;AAC7D,KAAE,gBAAgB;AAClB,cAAW,KAAK;AAChB,UAAO;KAEV;IAEH,CAAC,YAAY,oBAAoB,CAClC"}
@@ -1,5 +1,5 @@
1
1
  require("./chunk-9hOWP6kD.cjs");
2
- const require_WidgetInteractionContext = require("./WidgetInteractionContext-Bjy4P_YP.cjs");
2
+ const require_WidgetInteractionContext = require("./WidgetInteractionContext-D9dBJ-39.cjs");
3
3
  const require_browser_click = require("./browser-click-BNB0wXZI.cjs");
4
4
  let react = require("react");
5
5
  //#region ../widgets/src/hooks/use-internal-link.ts
@@ -35,4 +35,4 @@ Object.defineProperty(exports, "useInternalLinks", {
35
35
  }
36
36
  });
37
37
 
38
- //# sourceMappingURL=use-internal-link-BTIkbJYg.cjs.map
38
+ //# sourceMappingURL=use-internal-link-IcDHjPGp.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-internal-link-BTIkbJYg.cjs","names":["useWidgetInteraction","isBrowserHandledClick"],"sources":["../../widgets/src/hooks/use-internal-link.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport { isBrowserHandledClick } from \"../lib/browser-click\";\n\nexport interface InternalLink {\n /**\n * Click handler for the anchor. Navigates in-app when the href points at a\n * screen in this portal, and does nothing otherwise so the browser follows\n * the link as authored — including for Cmd/Ctrl/Shift/Alt and middle clicks,\n * which asked for a new tab or window.\n *\n * Returns whether the click was handled in-app, so a caller with follow-up of\n * its own (closing a modal, say) only runs it when the user is actually\n * staying on this page.\n */\n followInternally: (e: React.MouseEvent) => boolean;\n}\n\n/**\n * Resolve links that widget authors typed as plain URLs but that point back\n * into this portal (e.g. \"/profile\"). Following them as real links reloads the\n * document — or worse, opens a new tab — which throws away the in-session\n * referrer the mobile header's back button is derived from, stranding the user\n * on the destination screen. Navigating in-app instead keeps a way back.\n *\n * Returns a resolver rather than the link itself so widgets can call it per\n * item while rendering a list (carousel slides, link rows), where a hook can't\n * go. Pass undefined to opt a link out, e.g. one the author set to open in a\n * new tab.\n */\nexport function useInternalLinks(): (href: string | undefined) => InternalLink {\n const { onNavigate, resolveInternalSlug } = useWidgetInteraction();\n\n return useCallback(\n (href: string | undefined) => {\n const slug = href ? resolveInternalSlug?.(href) : undefined;\n\n return {\n followInternally: (e: React.MouseEvent) => {\n if (!slug || !onNavigate || isBrowserHandledClick(e)) return false;\n e.preventDefault();\n onNavigate(slug);\n return true;\n },\n };\n },\n [onNavigate, resolveInternalSlug],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA8BA,SAAgB,mBAA+D;CAC7E,MAAM,EAAE,YAAY,wBAAwBA,iCAAAA,sBAAsB;AAElE,SAAA,GAAA,MAAA,cACG,SAA6B;EAC5B,MAAM,OAAO,OAAO,sBAAsB,KAAK,GAAG,KAAA;AAElD,SAAO,EACL,mBAAmB,MAAwB;AACzC,OAAI,CAAC,QAAQ,CAAC,cAAcC,sBAAAA,sBAAsB,EAAE,CAAE,QAAO;AAC7D,KAAE,gBAAgB;AAClB,cAAW,KAAK;AAChB,UAAO;KAEV;IAEH,CAAC,YAAY,oBAAoB,CAClC"}
1
+ {"version":3,"file":"use-internal-link-IcDHjPGp.cjs","names":["useWidgetInteraction","isBrowserHandledClick"],"sources":["../../widgets/src/hooks/use-internal-link.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport { isBrowserHandledClick } from \"../lib/browser-click\";\n\nexport interface InternalLink {\n /**\n * Click handler for the anchor. Navigates in-app when the href points at a\n * screen in this portal, and does nothing otherwise so the browser follows\n * the link as authored — including for Cmd/Ctrl/Shift/Alt and middle clicks,\n * which asked for a new tab or window.\n *\n * Returns whether the click was handled in-app, so a caller with follow-up of\n * its own (closing a modal, say) only runs it when the user is actually\n * staying on this page.\n */\n followInternally: (e: React.MouseEvent) => boolean;\n}\n\n/**\n * Resolve links that widget authors typed as plain URLs but that point back\n * into this portal (e.g. \"/profile\"). Following them as real links reloads the\n * document — or worse, opens a new tab — which throws away the in-session\n * referrer the mobile header's back button is derived from, stranding the user\n * on the destination screen. Navigating in-app instead keeps a way back.\n *\n * Returns a resolver rather than the link itself so widgets can call it per\n * item while rendering a list (carousel slides, link rows), where a hook can't\n * go. Pass undefined to opt a link out, e.g. one the author set to open in a\n * new tab.\n */\nexport function useInternalLinks(): (href: string | undefined) => InternalLink {\n const { onNavigate, resolveInternalSlug } = useWidgetInteraction();\n\n return useCallback(\n (href: string | undefined) => {\n const slug = href ? resolveInternalSlug?.(href) : undefined;\n\n return {\n followInternally: (e: React.MouseEvent) => {\n if (!slug || !onNavigate || isBrowserHandledClick(e)) return false;\n e.preventDefault();\n onNavigate(slug);\n return true;\n },\n };\n },\n [onNavigate, resolveInternalSlug],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA8BA,SAAgB,mBAA+D;CAC7E,MAAM,EAAE,YAAY,wBAAwBA,iCAAAA,sBAAsB;AAElE,SAAA,GAAA,MAAA,cACG,SAA6B;EAC5B,MAAM,OAAO,OAAO,sBAAsB,KAAK,GAAG,KAAA;AAElD,SAAO,EACL,mBAAmB,MAAwB;AACzC,OAAI,CAAC,QAAQ,CAAC,cAAcC,sBAAAA,sBAAsB,EAAE,CAAE,QAAO;AAC7D,KAAE,gBAAgB;AAClB,cAAW,KAAK;AAChB,UAAO;KAEV;IAEH,CAAC,YAAY,oBAAoB,CAClC"}
@@ -1,4 +1,4 @@
1
- import { n as useWidgetInteraction } from "./WidgetInteractionContext-Ba_G5sDP.mjs";
1
+ import { n as useWidgetInteraction } from "./WidgetInteractionContext-IsMo73Ka.mjs";
2
2
  import { r as useRepUser } from "./WidgetRenderStateContext-Bax78KoX.mjs";
3
3
  import { n as sanitizeHref, r as triggerShare, t as decoratedHref } from "./link-type-utils-DJBBqvOF.mjs";
4
4
  import { t as isBrowserHandledClick } from "./browser-click-DtHzsdH8.mjs";
@@ -81,4 +81,4 @@ function useLinkAction(options) {
81
81
  //#endregion
82
82
  export { useLinkAction as t };
83
83
 
84
- //# sourceMappingURL=use-link-action-C32zrsI0.mjs.map
84
+ //# sourceMappingURL=use-link-action-CtVnC_2G.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-link-action-C32zrsI0.mjs","names":[],"sources":["../../widgets/src/hooks/use-link-action.ts"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport type { ShareableItem } from \"@fluid-app/portal-core/types\";\nimport { useRepUser } from \"../contexts/RepUserContext\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport { isBrowserHandledClick } from \"../lib/browser-click\";\nimport {\n type LinkType,\n type ShareSource,\n decoratedHref,\n sanitizeHref,\n triggerShare,\n} from \"../lib/link-type-utils\";\n\nexport interface UseLinkActionOptions {\n linkType?: LinkType | undefined;\n href?: string | undefined;\n openInNewTab?: boolean | undefined;\n screenSlug?: string | undefined;\n shareSource?: ShareSource | undefined;\n shareResource?: ShareableItem | undefined;\n shareUrl?: string | undefined;\n}\n\nexport interface LinkAction {\n /** The resolved href for anchor elements (URL and Screen modes). */\n resolvedHref: string | undefined;\n /** Click handler — use for screen navigation and share actions. */\n handleClick: (e: React.MouseEvent) => void;\n /** Whether the link target is valid and should be interactive. */\n hasTarget: boolean;\n /** Props to spread on an anchor element for URL mode. */\n anchorProps: Record<string, string> | undefined;\n}\n\nexport function useLinkAction(options: UseLinkActionOptions): LinkAction {\n const {\n linkType = \"url\",\n href = \"\",\n openInNewTab = true,\n screenSlug,\n shareSource,\n shareResource,\n shareUrl,\n } = options;\n\n const { onNavigate, buildHref, resolveInternalSlug } = useWidgetInteraction();\n const repUser = useRepUser();\n const publicId = repUser?.publicId;\n\n // A URL-mode link may still point at a screen in this portal (e.g.\n // \"/profile\"). Follow it in-app rather than as a document load, which would\n // drop the in-session referrer and leave the destination with no back button.\n // \"Open in new tab\" is the author's explicit choice and stays a real link.\n const internalSlug = useMemo(() => {\n if (linkType !== \"url\" || openInNewTab) return undefined;\n return resolveInternalSlug?.(href);\n }, [linkType, openInNewTab, href, resolveInternalSlug]);\n\n const resolvedHref = useMemo(() => {\n if (linkType === \"url\") {\n // Keep the authored URL as the href so long-press/copy-link still work,\n // but skip the rep public_id — that decorates outbound affiliate links,\n // not our own routes.\n if (internalSlug) return sanitizeHref(href.trim());\n return decoratedHref(href, publicId);\n }\n if (linkType === \"screen\" && screenSlug)\n return buildHref?.(screenSlug) ?? screenSlug;\n return undefined;\n }, [linkType, href, publicId, screenSlug, buildHref, internalSlug]);\n\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n const navigationSlug = linkType === \"screen\" ? screenSlug : internalSlug;\n\n // Cmd/Ctrl/Shift/Alt and middle clicks asked for a new tab or window —\n // the anchor's href already points at the destination, so step aside.\n if (navigationSlug && isBrowserHandledClick(e)) return;\n\n if (navigationSlug && onNavigate) {\n e.preventDefault();\n onNavigate(navigationSlug);\n } else if (linkType === \"share\") {\n e.preventDefault();\n void triggerShare({ shareSource, shareResource, shareUrl });\n }\n },\n [\n linkType,\n onNavigate,\n screenSlug,\n internalSlug,\n shareSource,\n shareResource,\n shareUrl,\n ],\n );\n\n const hasTarget = useMemo(() => {\n if (linkType === \"url\") {\n return Boolean(internalSlug) || Boolean(decoratedHref(href, publicId));\n }\n if (linkType === \"screen\") return Boolean(screenSlug);\n if (linkType === \"share\") {\n const shareIsResource = shareSource === \"resource\" || shareSource == null;\n return shareIsResource\n ? Boolean(shareResource?.share_link)\n : Boolean(shareUrl);\n }\n return false;\n }, [\n linkType,\n href,\n publicId,\n screenSlug,\n internalSlug,\n shareSource,\n shareResource,\n shareUrl,\n ]);\n\n const anchorProps = useMemo(() => {\n if (linkType === \"url\" && openInNewTab) {\n return { target: \"_blank\", rel: \"noopener noreferrer\" };\n }\n return undefined;\n }, [linkType, openInNewTab]);\n\n return { resolvedHref, handleClick, hasTarget, anchorProps };\n}\n"],"mappings":";;;;;;AAkCA,SAAgB,cAAc,SAA2C;CACvE,MAAM,EACJ,WAAW,OACX,OAAO,IACP,eAAe,MACf,YACA,aACA,eACA,aACE;CAEJ,MAAM,EAAE,YAAY,WAAW,wBAAwB,sBAAsB;CAE7E,MAAM,WADU,YAAY,EACF;CAM1B,MAAM,eAAe,cAAc;AACjC,MAAI,aAAa,SAAS,aAAc,QAAO,KAAA;AAC/C,SAAO,sBAAsB,KAAK;IACjC;EAAC;EAAU;EAAc;EAAM;EAAoB,CAAC;AAwEvD,QAAO;EAAE,cAtEY,cAAc;AACjC,OAAI,aAAa,OAAO;AAItB,QAAI,aAAc,QAAO,aAAa,KAAK,MAAM,CAAC;AAClD,WAAO,cAAc,MAAM,SAAS;;AAEtC,OAAI,aAAa,YAAY,WAC3B,QAAO,YAAY,WAAW,IAAI;KAEnC;GAAC;GAAU;GAAM;GAAU;GAAY;GAAW;GAAa,CAAC;EA2D5C,aAzDH,aACjB,MAAwB;GACvB,MAAM,iBAAiB,aAAa,WAAW,aAAa;AAI5D,OAAI,kBAAkB,sBAAsB,EAAE,CAAE;AAEhD,OAAI,kBAAkB,YAAY;AAChC,MAAE,gBAAgB;AAClB,eAAW,eAAe;cACjB,aAAa,SAAS;AAC/B,MAAE,gBAAgB;AACb,iBAAa;KAAE;KAAa;KAAe;KAAU,CAAC;;KAG/D;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CACF;EAgCmC,WA9BlB,cAAc;AAC9B,OAAI,aAAa,MACf,QAAO,QAAQ,aAAa,IAAI,QAAQ,cAAc,MAAM,SAAS,CAAC;AAExE,OAAI,aAAa,SAAU,QAAO,QAAQ,WAAW;AACrD,OAAI,aAAa,QAEf,QADwB,gBAAgB,cAAc,eAAe,OAEjE,QAAQ,eAAe,WAAW,GAClC,QAAQ,SAAS;AAEvB,UAAO;KACN;GACD;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;EAS6C,aAP3B,cAAc;AAChC,OAAI,aAAa,SAAS,aACxB,QAAO;IAAE,QAAQ;IAAU,KAAK;IAAuB;KAGxD,CAAC,UAAU,aAAa,CAAC;EAEgC"}
1
+ {"version":3,"file":"use-link-action-CtVnC_2G.mjs","names":[],"sources":["../../widgets/src/hooks/use-link-action.ts"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport type { ShareableItem } from \"@fluid-app/portal-core/types\";\nimport { useRepUser } from \"../contexts/RepUserContext\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport { isBrowserHandledClick } from \"../lib/browser-click\";\nimport {\n type LinkType,\n type ShareSource,\n decoratedHref,\n sanitizeHref,\n triggerShare,\n} from \"../lib/link-type-utils\";\n\nexport interface UseLinkActionOptions {\n linkType?: LinkType | undefined;\n href?: string | undefined;\n openInNewTab?: boolean | undefined;\n screenSlug?: string | undefined;\n shareSource?: ShareSource | undefined;\n shareResource?: ShareableItem | undefined;\n shareUrl?: string | undefined;\n}\n\nexport interface LinkAction {\n /** The resolved href for anchor elements (URL and Screen modes). */\n resolvedHref: string | undefined;\n /** Click handler — use for screen navigation and share actions. */\n handleClick: (e: React.MouseEvent) => void;\n /** Whether the link target is valid and should be interactive. */\n hasTarget: boolean;\n /** Props to spread on an anchor element for URL mode. */\n anchorProps: Record<string, string> | undefined;\n}\n\nexport function useLinkAction(options: UseLinkActionOptions): LinkAction {\n const {\n linkType = \"url\",\n href = \"\",\n openInNewTab = true,\n screenSlug,\n shareSource,\n shareResource,\n shareUrl,\n } = options;\n\n const { onNavigate, buildHref, resolveInternalSlug } = useWidgetInteraction();\n const repUser = useRepUser();\n const publicId = repUser?.publicId;\n\n // A URL-mode link may still point at a screen in this portal (e.g.\n // \"/profile\"). Follow it in-app rather than as a document load, which would\n // drop the in-session referrer and leave the destination with no back button.\n // \"Open in new tab\" is the author's explicit choice and stays a real link.\n const internalSlug = useMemo(() => {\n if (linkType !== \"url\" || openInNewTab) return undefined;\n return resolveInternalSlug?.(href);\n }, [linkType, openInNewTab, href, resolveInternalSlug]);\n\n const resolvedHref = useMemo(() => {\n if (linkType === \"url\") {\n // Keep the authored URL as the href so long-press/copy-link still work,\n // but skip the rep public_id — that decorates outbound affiliate links,\n // not our own routes.\n if (internalSlug) return sanitizeHref(href.trim());\n return decoratedHref(href, publicId);\n }\n if (linkType === \"screen\" && screenSlug)\n return buildHref?.(screenSlug) ?? screenSlug;\n return undefined;\n }, [linkType, href, publicId, screenSlug, buildHref, internalSlug]);\n\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n const navigationSlug = linkType === \"screen\" ? screenSlug : internalSlug;\n\n // Cmd/Ctrl/Shift/Alt and middle clicks asked for a new tab or window —\n // the anchor's href already points at the destination, so step aside.\n if (navigationSlug && isBrowserHandledClick(e)) return;\n\n if (navigationSlug && onNavigate) {\n e.preventDefault();\n onNavigate(navigationSlug);\n } else if (linkType === \"share\") {\n e.preventDefault();\n void triggerShare({ shareSource, shareResource, shareUrl });\n }\n },\n [\n linkType,\n onNavigate,\n screenSlug,\n internalSlug,\n shareSource,\n shareResource,\n shareUrl,\n ],\n );\n\n const hasTarget = useMemo(() => {\n if (linkType === \"url\") {\n return Boolean(internalSlug) || Boolean(decoratedHref(href, publicId));\n }\n if (linkType === \"screen\") return Boolean(screenSlug);\n if (linkType === \"share\") {\n const shareIsResource = shareSource === \"resource\" || shareSource == null;\n return shareIsResource\n ? Boolean(shareResource?.share_link)\n : Boolean(shareUrl);\n }\n return false;\n }, [\n linkType,\n href,\n publicId,\n screenSlug,\n internalSlug,\n shareSource,\n shareResource,\n shareUrl,\n ]);\n\n const anchorProps = useMemo(() => {\n if (linkType === \"url\" && openInNewTab) {\n return { target: \"_blank\", rel: \"noopener noreferrer\" };\n }\n return undefined;\n }, [linkType, openInNewTab]);\n\n return { resolvedHref, handleClick, hasTarget, anchorProps };\n}\n"],"mappings":";;;;;;AAkCA,SAAgB,cAAc,SAA2C;CACvE,MAAM,EACJ,WAAW,OACX,OAAO,IACP,eAAe,MACf,YACA,aACA,eACA,aACE;CAEJ,MAAM,EAAE,YAAY,WAAW,wBAAwB,sBAAsB;CAE7E,MAAM,WADU,YAAY,EACF;CAM1B,MAAM,eAAe,cAAc;AACjC,MAAI,aAAa,SAAS,aAAc,QAAO,KAAA;AAC/C,SAAO,sBAAsB,KAAK;IACjC;EAAC;EAAU;EAAc;EAAM;EAAoB,CAAC;AAwEvD,QAAO;EAAE,cAtEY,cAAc;AACjC,OAAI,aAAa,OAAO;AAItB,QAAI,aAAc,QAAO,aAAa,KAAK,MAAM,CAAC;AAClD,WAAO,cAAc,MAAM,SAAS;;AAEtC,OAAI,aAAa,YAAY,WAC3B,QAAO,YAAY,WAAW,IAAI;KAEnC;GAAC;GAAU;GAAM;GAAU;GAAY;GAAW;GAAa,CAAC;EA2D5C,aAzDH,aACjB,MAAwB;GACvB,MAAM,iBAAiB,aAAa,WAAW,aAAa;AAI5D,OAAI,kBAAkB,sBAAsB,EAAE,CAAE;AAEhD,OAAI,kBAAkB,YAAY;AAChC,MAAE,gBAAgB;AAClB,eAAW,eAAe;cACjB,aAAa,SAAS;AAC/B,MAAE,gBAAgB;AACb,iBAAa;KAAE;KAAa;KAAe;KAAU,CAAC;;KAG/D;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CACF;EAgCmC,WA9BlB,cAAc;AAC9B,OAAI,aAAa,MACf,QAAO,QAAQ,aAAa,IAAI,QAAQ,cAAc,MAAM,SAAS,CAAC;AAExE,OAAI,aAAa,SAAU,QAAO,QAAQ,WAAW;AACrD,OAAI,aAAa,QAEf,QADwB,gBAAgB,cAAc,eAAe,OAEjE,QAAQ,eAAe,WAAW,GAClC,QAAQ,SAAS;AAEvB,UAAO;KACN;GACD;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;EAS6C,aAP3B,cAAc;AAChC,OAAI,aAAa,SAAS,aACxB,QAAO;IAAE,QAAQ;IAAU,KAAK;IAAuB;KAGxD,CAAC,UAAU,aAAa,CAAC;EAEgC"}
@@ -1,5 +1,5 @@
1
1
  require("./chunk-9hOWP6kD.cjs");
2
- const require_WidgetInteractionContext = require("./WidgetInteractionContext-Bjy4P_YP.cjs");
2
+ const require_WidgetInteractionContext = require("./WidgetInteractionContext-D9dBJ-39.cjs");
3
3
  const require_WidgetRenderStateContext = require("./WidgetRenderStateContext-C6wVdsJR.cjs");
4
4
  const require_link_type_utils = require("./link-type-utils-BLFQIFXy.cjs");
5
5
  const require_browser_click = require("./browser-click-BNB0wXZI.cjs");
@@ -87,4 +87,4 @@ Object.defineProperty(exports, "useLinkAction", {
87
87
  }
88
88
  });
89
89
 
90
- //# sourceMappingURL=use-link-action-rBy0j6go.cjs.map
90
+ //# sourceMappingURL=use-link-action-DzA9AQsE.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-link-action-rBy0j6go.cjs","names":["useWidgetInteraction","useRepUser","sanitizeHref","decoratedHref","isBrowserHandledClick","triggerShare"],"sources":["../../widgets/src/hooks/use-link-action.ts"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport type { ShareableItem } from \"@fluid-app/portal-core/types\";\nimport { useRepUser } from \"../contexts/RepUserContext\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport { isBrowserHandledClick } from \"../lib/browser-click\";\nimport {\n type LinkType,\n type ShareSource,\n decoratedHref,\n sanitizeHref,\n triggerShare,\n} from \"../lib/link-type-utils\";\n\nexport interface UseLinkActionOptions {\n linkType?: LinkType | undefined;\n href?: string | undefined;\n openInNewTab?: boolean | undefined;\n screenSlug?: string | undefined;\n shareSource?: ShareSource | undefined;\n shareResource?: ShareableItem | undefined;\n shareUrl?: string | undefined;\n}\n\nexport interface LinkAction {\n /** The resolved href for anchor elements (URL and Screen modes). */\n resolvedHref: string | undefined;\n /** Click handler — use for screen navigation and share actions. */\n handleClick: (e: React.MouseEvent) => void;\n /** Whether the link target is valid and should be interactive. */\n hasTarget: boolean;\n /** Props to spread on an anchor element for URL mode. */\n anchorProps: Record<string, string> | undefined;\n}\n\nexport function useLinkAction(options: UseLinkActionOptions): LinkAction {\n const {\n linkType = \"url\",\n href = \"\",\n openInNewTab = true,\n screenSlug,\n shareSource,\n shareResource,\n shareUrl,\n } = options;\n\n const { onNavigate, buildHref, resolveInternalSlug } = useWidgetInteraction();\n const repUser = useRepUser();\n const publicId = repUser?.publicId;\n\n // A URL-mode link may still point at a screen in this portal (e.g.\n // \"/profile\"). Follow it in-app rather than as a document load, which would\n // drop the in-session referrer and leave the destination with no back button.\n // \"Open in new tab\" is the author's explicit choice and stays a real link.\n const internalSlug = useMemo(() => {\n if (linkType !== \"url\" || openInNewTab) return undefined;\n return resolveInternalSlug?.(href);\n }, [linkType, openInNewTab, href, resolveInternalSlug]);\n\n const resolvedHref = useMemo(() => {\n if (linkType === \"url\") {\n // Keep the authored URL as the href so long-press/copy-link still work,\n // but skip the rep public_id — that decorates outbound affiliate links,\n // not our own routes.\n if (internalSlug) return sanitizeHref(href.trim());\n return decoratedHref(href, publicId);\n }\n if (linkType === \"screen\" && screenSlug)\n return buildHref?.(screenSlug) ?? screenSlug;\n return undefined;\n }, [linkType, href, publicId, screenSlug, buildHref, internalSlug]);\n\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n const navigationSlug = linkType === \"screen\" ? screenSlug : internalSlug;\n\n // Cmd/Ctrl/Shift/Alt and middle clicks asked for a new tab or window —\n // the anchor's href already points at the destination, so step aside.\n if (navigationSlug && isBrowserHandledClick(e)) return;\n\n if (navigationSlug && onNavigate) {\n e.preventDefault();\n onNavigate(navigationSlug);\n } else if (linkType === \"share\") {\n e.preventDefault();\n void triggerShare({ shareSource, shareResource, shareUrl });\n }\n },\n [\n linkType,\n onNavigate,\n screenSlug,\n internalSlug,\n shareSource,\n shareResource,\n shareUrl,\n ],\n );\n\n const hasTarget = useMemo(() => {\n if (linkType === \"url\") {\n return Boolean(internalSlug) || Boolean(decoratedHref(href, publicId));\n }\n if (linkType === \"screen\") return Boolean(screenSlug);\n if (linkType === \"share\") {\n const shareIsResource = shareSource === \"resource\" || shareSource == null;\n return shareIsResource\n ? Boolean(shareResource?.share_link)\n : Boolean(shareUrl);\n }\n return false;\n }, [\n linkType,\n href,\n publicId,\n screenSlug,\n internalSlug,\n shareSource,\n shareResource,\n shareUrl,\n ]);\n\n const anchorProps = useMemo(() => {\n if (linkType === \"url\" && openInNewTab) {\n return { target: \"_blank\", rel: \"noopener noreferrer\" };\n }\n return undefined;\n }, [linkType, openInNewTab]);\n\n return { resolvedHref, handleClick, hasTarget, anchorProps };\n}\n"],"mappings":";;;;;;;AAkCA,SAAgB,cAAc,SAA2C;CACvE,MAAM,EACJ,WAAW,OACX,OAAO,IACP,eAAe,MACf,YACA,aACA,eACA,aACE;CAEJ,MAAM,EAAE,YAAY,WAAW,wBAAwBA,iCAAAA,sBAAsB;CAE7E,MAAM,WADUC,iCAAAA,YAAY,EACF;CAM1B,MAAM,gBAAA,GAAA,MAAA,eAA6B;AACjC,MAAI,aAAa,SAAS,aAAc,QAAO,KAAA;AAC/C,SAAO,sBAAsB,KAAK;IACjC;EAAC;EAAU;EAAc;EAAM;EAAoB,CAAC;AAwEvD,QAAO;EAAE,eAAA,GAAA,MAAA,eAtE0B;AACjC,OAAI,aAAa,OAAO;AAItB,QAAI,aAAc,QAAOC,wBAAAA,aAAa,KAAK,MAAM,CAAC;AAClD,WAAOC,wBAAAA,cAAc,MAAM,SAAS;;AAEtC,OAAI,aAAa,YAAY,WAC3B,QAAO,YAAY,WAAW,IAAI;KAEnC;GAAC;GAAU;GAAM;GAAU;GAAY;GAAW;GAAa,CAAC;EA2D5C,cAAA,GAAA,MAAA,cAxDpB,MAAwB;GACvB,MAAM,iBAAiB,aAAa,WAAW,aAAa;AAI5D,OAAI,kBAAkBC,sBAAAA,sBAAsB,EAAE,CAAE;AAEhD,OAAI,kBAAkB,YAAY;AAChC,MAAE,gBAAgB;AAClB,eAAW,eAAe;cACjB,aAAa,SAAS;AAC/B,MAAE,gBAAgB;AACbC,4BAAAA,aAAa;KAAE;KAAa;KAAe;KAAU,CAAC;;KAG/D;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CACF;EAgCmC,YAAA,GAAA,MAAA,eA9BJ;AAC9B,OAAI,aAAa,MACf,QAAO,QAAQ,aAAa,IAAI,QAAQF,wBAAAA,cAAc,MAAM,SAAS,CAAC;AAExE,OAAI,aAAa,SAAU,QAAO,QAAQ,WAAW;AACrD,OAAI,aAAa,QAEf,QADwB,gBAAgB,cAAc,eAAe,OAEjE,QAAQ,eAAe,WAAW,GAClC,QAAQ,SAAS;AAEvB,UAAO;KACN;GACD;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;EAS6C,cAAA,GAAA,MAAA,eAPb;AAChC,OAAI,aAAa,SAAS,aACxB,QAAO;IAAE,QAAQ;IAAU,KAAK;IAAuB;KAGxD,CAAC,UAAU,aAAa,CAAC;EAEgC"}
1
+ {"version":3,"file":"use-link-action-DzA9AQsE.cjs","names":["useWidgetInteraction","useRepUser","sanitizeHref","decoratedHref","isBrowserHandledClick","triggerShare"],"sources":["../../widgets/src/hooks/use-link-action.ts"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport type { ShareableItem } from \"@fluid-app/portal-core/types\";\nimport { useRepUser } from \"../contexts/RepUserContext\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport { isBrowserHandledClick } from \"../lib/browser-click\";\nimport {\n type LinkType,\n type ShareSource,\n decoratedHref,\n sanitizeHref,\n triggerShare,\n} from \"../lib/link-type-utils\";\n\nexport interface UseLinkActionOptions {\n linkType?: LinkType | undefined;\n href?: string | undefined;\n openInNewTab?: boolean | undefined;\n screenSlug?: string | undefined;\n shareSource?: ShareSource | undefined;\n shareResource?: ShareableItem | undefined;\n shareUrl?: string | undefined;\n}\n\nexport interface LinkAction {\n /** The resolved href for anchor elements (URL and Screen modes). */\n resolvedHref: string | undefined;\n /** Click handler — use for screen navigation and share actions. */\n handleClick: (e: React.MouseEvent) => void;\n /** Whether the link target is valid and should be interactive. */\n hasTarget: boolean;\n /** Props to spread on an anchor element for URL mode. */\n anchorProps: Record<string, string> | undefined;\n}\n\nexport function useLinkAction(options: UseLinkActionOptions): LinkAction {\n const {\n linkType = \"url\",\n href = \"\",\n openInNewTab = true,\n screenSlug,\n shareSource,\n shareResource,\n shareUrl,\n } = options;\n\n const { onNavigate, buildHref, resolveInternalSlug } = useWidgetInteraction();\n const repUser = useRepUser();\n const publicId = repUser?.publicId;\n\n // A URL-mode link may still point at a screen in this portal (e.g.\n // \"/profile\"). Follow it in-app rather than as a document load, which would\n // drop the in-session referrer and leave the destination with no back button.\n // \"Open in new tab\" is the author's explicit choice and stays a real link.\n const internalSlug = useMemo(() => {\n if (linkType !== \"url\" || openInNewTab) return undefined;\n return resolveInternalSlug?.(href);\n }, [linkType, openInNewTab, href, resolveInternalSlug]);\n\n const resolvedHref = useMemo(() => {\n if (linkType === \"url\") {\n // Keep the authored URL as the href so long-press/copy-link still work,\n // but skip the rep public_id — that decorates outbound affiliate links,\n // not our own routes.\n if (internalSlug) return sanitizeHref(href.trim());\n return decoratedHref(href, publicId);\n }\n if (linkType === \"screen\" && screenSlug)\n return buildHref?.(screenSlug) ?? screenSlug;\n return undefined;\n }, [linkType, href, publicId, screenSlug, buildHref, internalSlug]);\n\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n const navigationSlug = linkType === \"screen\" ? screenSlug : internalSlug;\n\n // Cmd/Ctrl/Shift/Alt and middle clicks asked for a new tab or window —\n // the anchor's href already points at the destination, so step aside.\n if (navigationSlug && isBrowserHandledClick(e)) return;\n\n if (navigationSlug && onNavigate) {\n e.preventDefault();\n onNavigate(navigationSlug);\n } else if (linkType === \"share\") {\n e.preventDefault();\n void triggerShare({ shareSource, shareResource, shareUrl });\n }\n },\n [\n linkType,\n onNavigate,\n screenSlug,\n internalSlug,\n shareSource,\n shareResource,\n shareUrl,\n ],\n );\n\n const hasTarget = useMemo(() => {\n if (linkType === \"url\") {\n return Boolean(internalSlug) || Boolean(decoratedHref(href, publicId));\n }\n if (linkType === \"screen\") return Boolean(screenSlug);\n if (linkType === \"share\") {\n const shareIsResource = shareSource === \"resource\" || shareSource == null;\n return shareIsResource\n ? Boolean(shareResource?.share_link)\n : Boolean(shareUrl);\n }\n return false;\n }, [\n linkType,\n href,\n publicId,\n screenSlug,\n internalSlug,\n shareSource,\n shareResource,\n shareUrl,\n ]);\n\n const anchorProps = useMemo(() => {\n if (linkType === \"url\" && openInNewTab) {\n return { target: \"_blank\", rel: \"noopener noreferrer\" };\n }\n return undefined;\n }, [linkType, openInNewTab]);\n\n return { resolvedHref, handleClick, hasTarget, anchorProps };\n}\n"],"mappings":";;;;;;;AAkCA,SAAgB,cAAc,SAA2C;CACvE,MAAM,EACJ,WAAW,OACX,OAAO,IACP,eAAe,MACf,YACA,aACA,eACA,aACE;CAEJ,MAAM,EAAE,YAAY,WAAW,wBAAwBA,iCAAAA,sBAAsB;CAE7E,MAAM,WADUC,iCAAAA,YAAY,EACF;CAM1B,MAAM,gBAAA,GAAA,MAAA,eAA6B;AACjC,MAAI,aAAa,SAAS,aAAc,QAAO,KAAA;AAC/C,SAAO,sBAAsB,KAAK;IACjC;EAAC;EAAU;EAAc;EAAM;EAAoB,CAAC;AAwEvD,QAAO;EAAE,eAAA,GAAA,MAAA,eAtE0B;AACjC,OAAI,aAAa,OAAO;AAItB,QAAI,aAAc,QAAOC,wBAAAA,aAAa,KAAK,MAAM,CAAC;AAClD,WAAOC,wBAAAA,cAAc,MAAM,SAAS;;AAEtC,OAAI,aAAa,YAAY,WAC3B,QAAO,YAAY,WAAW,IAAI;KAEnC;GAAC;GAAU;GAAM;GAAU;GAAY;GAAW;GAAa,CAAC;EA2D5C,cAAA,GAAA,MAAA,cAxDpB,MAAwB;GACvB,MAAM,iBAAiB,aAAa,WAAW,aAAa;AAI5D,OAAI,kBAAkBC,sBAAAA,sBAAsB,EAAE,CAAE;AAEhD,OAAI,kBAAkB,YAAY;AAChC,MAAE,gBAAgB;AAClB,eAAW,eAAe;cACjB,aAAa,SAAS;AAC/B,MAAE,gBAAgB;AACbC,4BAAAA,aAAa;KAAE;KAAa;KAAe;KAAU,CAAC;;KAG/D;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CACF;EAgCmC,YAAA,GAAA,MAAA,eA9BJ;AAC9B,OAAI,aAAa,MACf,QAAO,QAAQ,aAAa,IAAI,QAAQF,wBAAAA,cAAc,MAAM,SAAS,CAAC;AAExE,OAAI,aAAa,SAAU,QAAO,QAAQ,WAAW;AACrD,OAAI,aAAa,QAEf,QADwB,gBAAgB,cAAc,eAAe,OAEjE,QAAQ,eAAe,WAAW,GAClC,QAAQ,SAAS;AAEvB,UAAO;KACN;GACD;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC;EAS6C,cAAA,GAAA,MAAA,eAPb;AAChC,OAAI,aAAa,SAAS,aACxB,QAAO;IAAE,QAAQ;IAAU,KAAK;IAAuB;KAGxD,CAAC,UAAU,aAAa,CAAC;EAEgC"}
@@ -1,7 +1,7 @@
1
1
  require("./chunk-9hOWP6kD.cjs");
2
- const require_build_widget_registry = require("./build-widget-registry-BZeMOKCj.cjs");
2
+ const require_build_widget_registry = require("./build-widget-registry-DpPMWfL5.cjs");
3
3
  const require_Combobox = require("./Combobox-B_-Ka9B4.cjs");
4
- const require_FluidProvider = require("./FluidProvider-B7bYw1AY.cjs");
4
+ const require_FluidProvider = require("./FluidProvider-53Us6Wck.cjs");
5
5
  const require_MobileBottomSheet = require("./MobileBottomSheet-DDGmDuV6.cjs");
6
6
  const require_static_dict_adapter = require("./static-dict-adapter-BCgoKiVT.cjs");
7
7
  const require_translation_api_context_factory = require("./translation-api-context-factory-mbsJk2UU.cjs");
@@ -3101,4 +3101,4 @@ Object.defineProperty(exports, "useProfileTranslation", {
3101
3101
  }
3102
3102
  });
3103
3103
 
3104
- //# sourceMappingURL=use-portal-card-add-3ds-flow-DUBFzvAB.cjs.map
3104
+ //# sourceMappingURL=use-portal-card-add-3ds-flow-BNc0Hrsk.cjs.map