@flamingo-stack/openframe-frontend-core 0.0.292 → 0.0.293

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 (155) hide show
  1. package/dist/{chunk-6FHO73AP.js → chunk-26PKDALD.js} +7 -79
  2. package/dist/chunk-26PKDALD.js.map +1 -0
  3. package/dist/{chunk-B2U6INNO.js → chunk-2U2M2TG2.js} +4 -4
  4. package/dist/{chunk-OXOTKEYY.cjs → chunk-4W7NYJ3B.cjs} +23 -23
  5. package/dist/{chunk-OXOTKEYY.cjs.map → chunk-4W7NYJ3B.cjs.map} +1 -1
  6. package/dist/{chunk-KBKZYJRI.cjs → chunk-5E2HOSSH.cjs} +66 -19
  7. package/dist/chunk-5E2HOSSH.cjs.map +1 -0
  8. package/dist/{chunk-PZZGDS5I.cjs → chunk-6G2INVGG.cjs} +24 -22
  9. package/dist/chunk-6G2INVGG.cjs.map +1 -0
  10. package/dist/{chunk-CUQH4SHH.js → chunk-6GCI7JOE.js} +2 -2
  11. package/dist/{chunk-N6ZM5PYZ.js → chunk-7RIYT7ZH.js} +49 -2
  12. package/dist/chunk-7RIYT7ZH.js.map +1 -0
  13. package/dist/{chunk-E2YXRSDG.js → chunk-BRNHX6C6.js} +15 -13
  14. package/dist/chunk-BRNHX6C6.js.map +1 -0
  15. package/dist/{chunk-5FK7X3EE.js → chunk-DOMJSNXW.js} +8 -7
  16. package/dist/chunk-DOMJSNXW.js.map +1 -0
  17. package/dist/{chunk-VK4B6UGU.js → chunk-E4XABBSU.js} +16 -8
  18. package/dist/{chunk-VK4B6UGU.js.map → chunk-E4XABBSU.js.map} +1 -1
  19. package/dist/{chunk-DUIWR7RQ.js → chunk-EJXHZX2E.js} +3 -3
  20. package/dist/{chunk-5PELVUFT.cjs → chunk-EYEW6PTA.cjs} +44 -36
  21. package/dist/chunk-EYEW6PTA.cjs.map +1 -0
  22. package/dist/{chunk-HTYUZXQP.js → chunk-FJDPUPXC.js} +5 -5
  23. package/dist/{chunk-SLP4KXP6.js → chunk-FQJK446R.js} +8 -2
  24. package/dist/chunk-FQJK446R.js.map +1 -0
  25. package/dist/{chunk-JC5RN7ZS.cjs → chunk-FT4FCV7L.cjs} +6 -6
  26. package/dist/{chunk-JC5RN7ZS.cjs.map → chunk-FT4FCV7L.cjs.map} +1 -1
  27. package/dist/{chunk-ZHNL2IPK.cjs → chunk-J54Z3OCR.cjs} +8 -2
  28. package/dist/chunk-J54Z3OCR.cjs.map +1 -0
  29. package/dist/{chunk-2NJ44RTT.cjs → chunk-JSOMFVEV.cjs} +30 -30
  30. package/dist/{chunk-2NJ44RTT.cjs.map → chunk-JSOMFVEV.cjs.map} +1 -1
  31. package/dist/{chunk-Z6BK4XHH.cjs → chunk-KXCRGTRN.cjs} +10 -82
  32. package/dist/chunk-KXCRGTRN.cjs.map +1 -0
  33. package/dist/{chunk-5KD3S25X.cjs → chunk-LFGGF7OT.cjs} +139 -2
  34. package/dist/chunk-LFGGF7OT.cjs.map +1 -0
  35. package/dist/{chunk-N45M3TK3.js → chunk-NSPOYUBH.js} +2 -2
  36. package/dist/{chunk-TYZEMPPH.js → chunk-OQ6X7ZOC.js} +138 -1
  37. package/dist/chunk-OQ6X7ZOC.js.map +1 -0
  38. package/dist/{chunk-MDLWEJAV.cjs → chunk-RJL6PIOK.cjs} +454 -453
  39. package/dist/chunk-RJL6PIOK.cjs.map +1 -0
  40. package/dist/{chunk-IXDTNQF4.js → chunk-SOJCR63T.js} +4 -4
  41. package/dist/{chunk-5R5OODNE.cjs → chunk-TYMUKFP2.cjs} +40 -40
  42. package/dist/{chunk-5R5OODNE.cjs.map → chunk-TYMUKFP2.cjs.map} +1 -1
  43. package/dist/{chunk-CDJOKNCS.cjs → chunk-VTY7S2QG.cjs} +25 -19
  44. package/dist/chunk-VTY7S2QG.cjs.map +1 -0
  45. package/dist/{chunk-FFP2A77V.cjs → chunk-X3TSMCKX.cjs} +12 -12
  46. package/dist/{chunk-FFP2A77V.cjs.map → chunk-X3TSMCKX.cjs.map} +1 -1
  47. package/dist/{chunk-C667P6LZ.js → chunk-YICTMMXP.js} +13 -7
  48. package/dist/{chunk-C667P6LZ.js.map → chunk-YICTMMXP.js.map} +1 -1
  49. package/dist/{chunk-2BMVBPC7.cjs → chunk-YIGPRLQY.cjs} +9 -9
  50. package/dist/{chunk-2BMVBPC7.cjs.map → chunk-YIGPRLQY.cjs.map} +1 -1
  51. package/dist/components/chat/entity-cards/roadmap-card.d.ts +7 -1
  52. package/dist/components/chat/entity-cards/roadmap-card.d.ts.map +1 -1
  53. package/dist/components/chat/index.cjs +7 -7
  54. package/dist/components/chat/index.js +6 -6
  55. package/dist/components/contact/index.cjs +8 -8
  56. package/dist/components/contact/index.js +7 -7
  57. package/dist/components/docs/index.cjs +6 -6
  58. package/dist/components/docs/index.js +5 -5
  59. package/dist/components/docs/use-document-tree.d.ts.map +1 -1
  60. package/dist/components/embeds/index.cjs +8 -8
  61. package/dist/components/embeds/index.js +7 -7
  62. package/dist/components/faq/faq-section.d.ts.map +1 -1
  63. package/dist/components/faq/index.cjs +8 -8
  64. package/dist/components/faq/index.js +7 -7
  65. package/dist/components/features/index.cjs +7 -7
  66. package/dist/components/features/index.js +6 -6
  67. package/dist/components/index.cjs +214 -193
  68. package/dist/components/index.cjs.map +1 -1
  69. package/dist/components/index.js +50 -29
  70. package/dist/components/index.js.map +1 -1
  71. package/dist/components/navigation/index.cjs +7 -7
  72. package/dist/components/navigation/index.js +6 -6
  73. package/dist/components/onboarding-guides/index.cjs +24 -24
  74. package/dist/components/onboarding-guides/index.js +4 -4
  75. package/dist/components/related-content/index.cjs +8 -8
  76. package/dist/components/related-content/index.js +7 -7
  77. package/dist/components/shared/delivery/delivery-lists.d.ts.map +1 -1
  78. package/dist/components/shared/delivery/delivery-row.d.ts +8 -1
  79. package/dist/components/shared/delivery/delivery-row.d.ts.map +1 -1
  80. package/dist/components/shared/delivery/delivery-table.d.ts.map +1 -1
  81. package/dist/components/shared/roadmap/roadmap-grid.d.ts.map +1 -1
  82. package/dist/components/shared/roadmap/roadmap-view.d.ts.map +1 -1
  83. package/dist/components/tickets/help-center-card.d.ts +7 -1
  84. package/dist/components/tickets/help-center-card.d.ts.map +1 -1
  85. package/dist/components/tickets/help-center-list.d.ts.map +1 -1
  86. package/dist/components/tickets/index.cjs +82 -73
  87. package/dist/components/tickets/index.cjs.map +1 -1
  88. package/dist/components/tickets/index.js +24 -15
  89. package/dist/components/tickets/index.js.map +1 -1
  90. package/dist/components/tickets/ticket-center.d.ts.map +1 -1
  91. package/dist/components/tickets/ticket-row.d.ts +6 -1
  92. package/dist/components/tickets/ticket-row.d.ts.map +1 -1
  93. package/dist/components/ui/index.cjs +7 -7
  94. package/dist/components/ui/index.js +6 -6
  95. package/dist/hooks/index.cjs +5 -3
  96. package/dist/hooks/index.cjs.map +1 -1
  97. package/dist/hooks/index.d.ts +1 -0
  98. package/dist/hooks/index.d.ts.map +1 -1
  99. package/dist/hooks/index.js +4 -2
  100. package/dist/hooks/use-scroll-to-hash.d.ts +17 -0
  101. package/dist/hooks/use-scroll-to-hash.d.ts.map +1 -0
  102. package/dist/index.cjs +19 -7
  103. package/dist/index.cjs.map +1 -1
  104. package/dist/index.js +19 -7
  105. package/dist/utils/dev-sections/dev-section-param-keys.d.ts +10 -0
  106. package/dist/utils/dev-sections/dev-section-param-keys.d.ts.map +1 -1
  107. package/dist/utils/index.cjs +71 -1
  108. package/dist/utils/index.cjs.map +1 -1
  109. package/dist/utils/index.d.ts +2 -1
  110. package/dist/utils/index.d.ts.map +1 -1
  111. package/dist/utils/index.js +67 -2
  112. package/dist/utils/index.js.map +1 -1
  113. package/dist/utils/same-page-hash-nav.d.ts +37 -0
  114. package/dist/utils/same-page-hash-nav.d.ts.map +1 -0
  115. package/dist/utils/source-icons.d.ts.map +1 -1
  116. package/package.json +1 -1
  117. package/src/components/chat/entity-cards/roadmap-card.tsx +8 -1
  118. package/src/components/docs/use-document-tree.ts +45 -3
  119. package/src/components/faq/faq-section.tsx +22 -9
  120. package/src/components/shared/delivery/delivery-lists.tsx +9 -0
  121. package/src/components/shared/delivery/delivery-row.tsx +15 -2
  122. package/src/components/shared/delivery/delivery-table.tsx +7 -1
  123. package/src/components/shared/roadmap/roadmap-grid.tsx +7 -0
  124. package/src/components/shared/roadmap/roadmap-view.tsx +11 -0
  125. package/src/components/tickets/help-center-card.tsx +9 -17
  126. package/src/components/tickets/help-center-list.tsx +13 -0
  127. package/src/components/tickets/ticket-center.tsx +2 -0
  128. package/src/components/tickets/ticket-row.tsx +7 -1
  129. package/src/hooks/index.ts +5 -0
  130. package/src/hooks/use-scroll-to-hash.ts +74 -0
  131. package/src/utils/.source-icons.md +1 -1
  132. package/src/utils/dev-sections/dev-section-param-keys.ts +14 -0
  133. package/src/utils/index.ts +17 -1
  134. package/src/utils/same-page-hash-nav.ts +115 -0
  135. package/src/utils/source-icons.ts +7 -1
  136. package/dist/chunk-5FK7X3EE.js.map +0 -1
  137. package/dist/chunk-5KD3S25X.cjs.map +0 -1
  138. package/dist/chunk-5PELVUFT.cjs.map +0 -1
  139. package/dist/chunk-6FHO73AP.js.map +0 -1
  140. package/dist/chunk-CDJOKNCS.cjs.map +0 -1
  141. package/dist/chunk-E2YXRSDG.js.map +0 -1
  142. package/dist/chunk-KBKZYJRI.cjs.map +0 -1
  143. package/dist/chunk-MDLWEJAV.cjs.map +0 -1
  144. package/dist/chunk-N6ZM5PYZ.js.map +0 -1
  145. package/dist/chunk-PZZGDS5I.cjs.map +0 -1
  146. package/dist/chunk-SLP4KXP6.js.map +0 -1
  147. package/dist/chunk-TYZEMPPH.js.map +0 -1
  148. package/dist/chunk-Z6BK4XHH.cjs.map +0 -1
  149. package/dist/chunk-ZHNL2IPK.cjs.map +0 -1
  150. /package/dist/{chunk-B2U6INNO.js.map → chunk-2U2M2TG2.js.map} +0 -0
  151. /package/dist/{chunk-CUQH4SHH.js.map → chunk-6GCI7JOE.js.map} +0 -0
  152. /package/dist/{chunk-DUIWR7RQ.js.map → chunk-EJXHZX2E.js.map} +0 -0
  153. /package/dist/{chunk-HTYUZXQP.js.map → chunk-FJDPUPXC.js.map} +0 -0
  154. /package/dist/{chunk-N45M3TK3.js.map → chunk-NSPOYUBH.js.map} +0 -0
  155. /package/dist/{chunk-IXDTNQF4.js.map → chunk-SOJCR63T.js.map} +0 -0
@@ -4,22 +4,26 @@
4
4
  var _chunkD3LEFMOAcjs = require('./chunk-D3LEFMOA.cjs');
5
5
 
6
6
 
7
- var _chunkMDLWEJAVcjs = require('./chunk-MDLWEJAV.cjs');
7
+ var _chunkRJL6PIOKcjs = require('./chunk-RJL6PIOK.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
12
 
13
13
 
14
+ var _chunkKXCRGTRNcjs = require('./chunk-KXCRGTRN.cjs');
14
15
 
15
- var _chunkZ6BK4XHHcjs = require('./chunk-Z6BK4XHH.cjs');
16
16
 
17
17
 
18
18
 
19
- var _chunkOXOTKEYYcjs = require('./chunk-OXOTKEYY.cjs');
19
+ var _chunkLFGGF7OTcjs = require('./chunk-LFGGF7OT.cjs');
20
20
 
21
21
 
22
- var _chunkZHNL2IPKcjs = require('./chunk-ZHNL2IPK.cjs');
22
+
23
+ var _chunk4W7NYJ3Bcjs = require('./chunk-4W7NYJ3B.cjs');
24
+
25
+
26
+ var _chunkJ54Z3OCRcjs = require('./chunk-J54Z3OCR.cjs');
23
27
 
24
28
 
25
29
 
@@ -70,7 +74,7 @@ function FaqAccordion({ items, defaultOpenIds = [] }) {
70
74
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
71
75
  "div",
72
76
  {
73
- id: _chunkZ6BK4XHHcjs.faqItemAnchor.call(void 0, item.id),
77
+ id: _chunkKXCRGTRNcjs.faqItemAnchor.call(void 0, item.id),
74
78
  className: _chunkFIG2RKZFcjs.cn.call(void 0, "group scroll-mt-24 transition-colors hover:bg-[#1E1E1E]", isOpen ? "bg-ods-bg" : "bg-transparent"),
75
79
  children: [
76
80
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -90,7 +94,7 @@ function FaqAccordion({ items, defaultOpenIds = [] }) {
90
94
  children: [
91
95
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "min-w-0 pr-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { children: item.question }) }),
92
96
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-shrink-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
93
- _chunkMDLWEJAVcjs.ChevronButton,
97
+ _chunkRJL6PIOKcjs.ChevronButton,
94
98
  {
95
99
  "aria-label": isOpen ? "Collapse question" : "Expand question",
96
100
  size: "md",
@@ -150,7 +154,7 @@ function buildFaqJsonLdFromFaqs(faqs, opts = {}) {
150
154
 
151
155
  var DEFAULT_HEADING_TEXT = "Frequently Asked Questions";
152
156
  function buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl = "") {
153
- return _chunkZ6BK4XHHcjs.buildSuggestionUrl.call(void 0, "/api/faqs", { apiBaseUrl, entityType, entityId, count: minResults });
157
+ return _chunkKXCRGTRNcjs.buildSuggestionUrl.call(void 0, "/api/faqs", { apiBaseUrl, entityType, entityId, count: minResults });
154
158
  }
155
159
  function groupFaqsBySection(faqs) {
156
160
  const order = [];
@@ -166,7 +170,7 @@ function groupFaqsBySection(faqs) {
166
170
  }
167
171
  let group = byName.get(name);
168
172
  if (!group) {
169
- group = { section: name, slug: _chunkZ6BK4XHHcjs.faqSectionSlug.call(void 0, name), items: [] };
173
+ group = { section: name, slug: _chunkKXCRGTRNcjs.faqSectionSlug.call(void 0, name), items: [] };
170
174
  byName.set(name, group);
171
175
  order.push(name);
172
176
  }
@@ -176,7 +180,6 @@ function groupFaqsBySection(faqs) {
176
180
  if (uncategorized) groups.push(uncategorized);
177
181
  return groups;
178
182
  }
179
- var FAQ_NAV_HEADER_OFFSET = 96;
180
183
  var UNCATEGORIZED_KEY = "__uncategorized__";
181
184
  var groupKey = (g) => _nullishCoalesce(g.slug, () => ( UNCATEGORIZED_KEY));
182
185
  function GroupedFaqList({
@@ -207,7 +210,7 @@ function GroupedFaqList({
207
210
  }
208
211
  if (bestId) setActiveSlug(bestId);
209
212
  },
210
- { rootMargin: `-${FAQ_NAV_HEADER_OFFSET}px 0px -55% 0px`, threshold: 0 }
213
+ { rootMargin: `-${_chunkLFGGF7OTcjs.STICKY_HEADER_OFFSET_PX}px 0px -55% 0px`, threshold: 0 }
211
214
  );
212
215
  for (const group of navGroups) {
213
216
  const el = group.slug ? document.getElementById(group.slug) : null;
@@ -217,7 +220,7 @@ function GroupedFaqList({
217
220
  }, [slugKey]);
218
221
  const [hashTarget, setHashTarget] = _react.useState.call(void 0, null);
219
222
  _react.useEffect.call(void 0, () => {
220
- const refresh = () => setHashTarget(_chunkZ6BK4XHHcjs.parseFaqHash.call(void 0, window.location.hash));
223
+ const refresh = () => setHashTarget(_chunkKXCRGTRNcjs.parseFaqHash.call(void 0, window.location.hash));
221
224
  refresh();
222
225
  window.addEventListener("hashchange", refresh);
223
226
  return () => window.removeEventListener("hashchange", refresh);
@@ -235,19 +238,18 @@ function GroupedFaqList({
235
238
  const accordionKeySuffix = _optionalChain([hashTarget, 'optionalAccess', _8 => _8.kind]) === "item" ? `item:${hashTarget.rawId}` : "default";
236
239
  _react.useEffect.call(void 0, () => {
237
240
  if (!hashTarget) return;
238
- const elId = hashTarget.kind === "item" ? _chunkZ6BK4XHHcjs.faqItemAnchor.call(void 0, hashTarget.rawId) : hashTarget.slug;
241
+ const elId = hashTarget.kind === "item" ? _chunkKXCRGTRNcjs.faqItemAnchor.call(void 0, hashTarget.rawId) : hashTarget.slug;
239
242
  const el = document.getElementById(elId);
240
- if (el) _chunkZ6BK4XHHcjs.scrollElementIntoView.call(void 0, el, { headerOffset: FAQ_NAV_HEADER_OFFSET });
243
+ if (el) _chunkLFGGF7OTcjs.scrollElementIntoView.call(void 0, el, { headerOffset: _chunkLFGGF7OTcjs.STICKY_HEADER_OFFSET_PX });
241
244
  if (hashTarget.kind === "section") setActiveSlug(hashTarget.slug);
242
245
  }, [hashTarget]);
243
246
  const handleJump = _react.useCallback.call(void 0,
244
247
  (e, slug) => {
245
248
  e.preventDefault();
246
- setActiveSlug(slug);
247
- _chunkZ6BK4XHHcjs.scrollElementIntoView.call(void 0, document.getElementById(slug), {
248
- headerOffset: FAQ_NAV_HEADER_OFFSET
249
+ _chunkLFGGF7OTcjs.navigateSamePageHash.call(void 0, "#" + slug, {
250
+ headerOffset: _chunkLFGGF7OTcjs.STICKY_HEADER_OFFSET_PX,
251
+ history: "replace"
249
252
  });
250
- if (typeof history !== "undefined") history.replaceState(null, "", `#${slug}`);
251
253
  },
252
254
  []
253
255
  );
@@ -277,7 +279,7 @@ function GroupedFaqList({
277
279
  id: _nullishCoalesce(group.slug, () => ( void 0)),
278
280
  className: "scroll-mt-24 space-y-4",
279
281
  children: [
280
- group.section && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CategoryHeading, { className: _chunkZHNL2IPKcjs.SECTION_HEADING_CLASS, children: group.section }),
282
+ group.section && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CategoryHeading, { className: _chunkJ54Z3OCRcjs.SECTION_HEADING_CLASS, children: group.section }),
281
283
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
282
284
  FaqAccordion,
283
285
  {
@@ -321,7 +323,7 @@ function FaqSection({
321
323
  const { data, isLoading, error } = _chunkD3LEFMOAcjs.useSelfFetch.call(void 0, url, { initialData });
322
324
  const faqs = _nullishCoalesce(_optionalChain([data, 'optionalAccess', _11 => _11.faqs]), () => ( []));
323
325
  const groups = _react.useMemo.call(void 0, () => faqs.length > 0 ? groupFaqsBySection(faqs) : [], [faqs]);
324
- const headingNode = heading === void 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: _chunkZHNL2IPKcjs.SECTION_HEADING_CLASS, children: DEFAULT_HEADING_TEXT }) : heading;
326
+ const headingNode = heading === void 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: _chunkJ54Z3OCRcjs.SECTION_HEADING_CLASS, children: DEFAULT_HEADING_TEXT }) : heading;
325
327
  if (error) return null;
326
328
  if (!isLoading && faqs.length === 0) return null;
327
329
  if (isLoading && faqs.length === 0) {
@@ -337,7 +339,7 @@ function FaqSection({
337
339
  "script",
338
340
  {
339
341
  type: "application/ld+json",
340
- dangerouslySetInnerHTML: { __html: _chunkZ6BK4XHHcjs.serializeJsonLd.call(void 0, schema) }
342
+ dangerouslySetInnerHTML: { __html: _chunkKXCRGTRNcjs.serializeJsonLd.call(void 0, schema) }
341
343
  }
342
344
  )
343
345
  ] });
@@ -360,7 +362,7 @@ function FaqDocumentPage({
360
362
  label: _nullishCoalesce(_optionalChain([backButton, 'optionalAccess', _12 => _12.label]), () => ( "Back to home")),
361
363
  onClick: () => router.push(_nullishCoalesce(_optionalChain([backButton, 'optionalAccess', _13 => _13.href]), () => ( "/")))
362
364
  };
363
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOXOTKEYYcjs.PageShell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOXOTKEYYcjs.PageLayout, { title, subtitle, backButton: backCfg, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
365
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4W7NYJ3Bcjs.PageShell, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4W7NYJ3Bcjs.PageLayout, { title, subtitle, backButton: backCfg, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
364
366
  FaqSection,
365
367
  {
366
368
  heading: null,
@@ -377,4 +379,4 @@ function FaqDocumentPage({
377
379
 
378
380
 
379
381
  exports.FaqAccordion = FaqAccordion; exports.FaqSection = FaqSection; exports.FaqDocumentPage = FaqDocumentPage;
380
- //# sourceMappingURL=chunk-PZZGDS5I.cjs.map
382
+ //# sourceMappingURL=chunk-6G2INVGG.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-6G2INVGG.cjs","../src/components/faq/faq-section.tsx","../src/components/faq-accordion.tsx","../src/components/faq/json-ld.ts","../src/components/faq/faq-document-page.tsx"],"names":["jsx","jsxs"],"mappings":"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","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-6G2INVGG.cjs","sourcesContent":[null,"\"use client\"\n\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport type { Faq } from '../../types/faq'\nimport { FaqAccordion, type FaqItem } from '../faq-accordion'\nimport { useSelfFetch } from '../../hooks/use-self-fetch'\nimport { buildSuggestionUrl } from '../../utils/suggestion-url'\nimport { serializeJsonLd } from '../../utils/common'\nimport { scrollElementIntoView } from '../../utils/scroll-into-view'\nimport { navigateSamePageHash, STICKY_HEADER_OFFSET_PX } from '../../utils/same-page-hash-nav'\nimport { faqSectionSlug, faqItemAnchor, parseFaqHash, type FaqHashTarget } from '../../utils/faq-anchor'\nimport { cn } from '../../utils/cn'\nimport { buildFaqJsonLdFromFaqs, type FaqSchemaOptions } from './json-ld'\nimport { SECTION_HEADING_CLASS } from '../layout/page-heading'\n\nexport interface FaqSectionProps {\n /**\n * SSR hydrate. When provided, the hook skips the first client fetch (per\n * useSelfFetch contract). The consuming server page resolves FAQs then drills\n * them into this prop — the lib never re-fetches what the host already gated on.\n */\n initialFaqs?: Faq[]\n /** Both required together for entity-attached FAQs; partial → bare /api/faqs. */\n entityType?: string\n entityId?: number | string\n /**\n * Heading node above the grouped list. `undefined` → default\n * `<h2>`\"Frequently Asked Questions\". `null` → no heading (the host page\n * owns the `<h1>`, as the standalone /faqs surface does). A React node lets a\n * platform drill its own <PageHeading> without the lib referencing platform\n * state. Also drives category nesting so the document outline stays correct:\n * `null` → categories render `<h2>` (directly under the page `<h1>`);\n * otherwise categories render `<h3>` beneath this heading.\n */\n heading?: React.ReactNode | null\n /** Inject FAQPage schema.org JSON-LD as a <script>. Off by default so embeds\n * don't emit duplicate schema. */\n emitJsonLd?: boolean\n /** Overrides for the JSON-LD's name/description/url. */\n jsonLd?: FaqSchemaOptions\n className?: string\n /** Maps to /api/faqs `?count=` (the 5-tier fill target). Absent → param\n * not sent (server default applies). */\n minResults?: number\n /** Fetch-URL prefix for third-party embeds / reverse proxies\n * ('' = same-origin relative). */\n apiBaseUrl?: string\n}\n\nconst DEFAULT_HEADING_TEXT = 'Frequently Asked Questions'\n\n/** URL composition shared with RelatedContentSection (`buildSuggestionUrl`)\n * — byte-identical to the historical `buildFaqsUrl` output when\n * `minResults`/`apiBaseUrl` are absent. */\nfunction buildFaqsUrl(\n entityType?: string,\n entityId?: number | string,\n minResults?: number,\n apiBaseUrl = '',\n): string {\n return buildSuggestionUrl('/api/faqs', { apiBaseUrl, entityType, entityId, count: minResults })\n}\n\ninterface FaqGroup {\n /** null → the uncategorized bucket: no heading, no jump pill, rendered last. */\n section: string | null\n slug: string | null\n items: FaqItem[]\n}\n\n/** Group FAQs by `faq.section`, preserving the server's first-seen\n * (display_order) order for BOTH the section order and the rows within each\n * section. The uncategorized bucket (blank/missing section) sinks to the end\n * since it renders without a heading. Items carry NO badge here — the `<h2>`\n * IS the category, so a per-row chip would be redundant. */\nfunction groupFaqsBySection(faqs: Faq[]): FaqGroup[] {\n const order: string[] = []\n const byName = new Map<string, FaqGroup>()\n let uncategorized: FaqGroup | null = null\n for (const faq of faqs) {\n const item: FaqItem = { id: faq.id, question: faq.question, answer: faq.answer }\n const name = faq.section?.trim()\n if (!name) {\n if (!uncategorized) uncategorized = { section: null, slug: null, items: [] }\n uncategorized.items.push(item)\n continue\n }\n let group = byName.get(name)\n if (!group) {\n group = { section: name, slug: faqSectionSlug(name), items: [] }\n byName.set(name, group)\n order.push(name)\n }\n group.items.push(item)\n }\n const groups = order.map((name) => byName.get(name)!)\n if (uncategorized) groups.push(uncategorized)\n return groups\n}\n\n\n/** Map key for the uncategorized bucket — `group.slug` is null for it, so\n * every per-group map (default-open ids, accordion keys) uses this sentinel\n * to keep the lookup typed. */\nconst UNCATEGORIZED_KEY = '__uncategorized__'\nconst groupKey = (g: FaqGroup): string => g.slug ?? UNCATEGORIZED_KEY\n\n/**\n * Grouped FAQ layout: a category jump-nav above stacked `<h2>` category\n * sections (each its own accordion). Isolated into its own component so the\n * scroll-spy hooks only mount in grouped mode — `FaqSection`'s own hooks stay\n * unconditional.\n *\n * The pills are real `<a href=\"#slug\">` anchors (crawlable in-page links,\n * deep-linkable, work without JS); the click handler upgrades the jump to the\n * cancellation-proof `scrollElementIntoView` tween and syncs the URL hash.\n */\nfunction GroupedFaqList({\n groups,\n categoryHeadingAs,\n}: {\n groups: FaqGroup[]\n /** Heading tag for each category, so the document outline nests correctly\n * under whatever owns the heading above this block: `h2` on the standalone\n * page (the page owns the `<h1>`), `h3` beneath an embed's `<h2>` title.\n * The VISUAL is `SECTION_HEADING_CLASS` either way, so categories look\n * identical on every surface. */\n categoryHeadingAs: 'h2' | 'h3'\n}) {\n const CategoryHeading = categoryHeadingAs\n const navGroups = useMemo(() => groups.filter((g) => g.slug), [groups])\n const [activeSlug, setActiveSlug] = useState<string | null>(navGroups[0]?.slug ?? null)\n // Identity-stable key for the section set so the observer re-binds only when\n // the categories actually change (not on every parent re-render).\n const slugKey = navGroups.map((g) => g.slug).join('|')\n\n // Scroll-spy: mark the pill for the category currently at the top of the\n // viewport. rootMargin drops the trigger line just below the sticky header\n // and ignores the bottom ~55% so \"active\" is the section being read, not the\n // next one peeking in.\n useEffect(() => {\n if (navGroups.length < 2) return\n const tops = new Map<string, number>()\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const id = (entry.target as HTMLElement).id\n if (entry.isIntersecting) tops.set(id, entry.boundingClientRect.top)\n else tops.delete(id)\n }\n let bestId: string | null = null\n let bestTop = Number.POSITIVE_INFINITY\n for (const [id, top] of tops) {\n if (top < bestTop) {\n bestTop = top\n bestId = id\n }\n }\n if (bestId) setActiveSlug(bestId)\n },\n { rootMargin: `-${STICKY_HEADER_OFFSET_PX}px 0px -55% 0px`, threshold: 0 },\n )\n for (const group of navGroups) {\n const el = group.slug ? document.getElementById(group.slug) : null\n if (el) observer.observe(el)\n }\n return () => observer.disconnect()\n // slugKey encodes the section set; re-observe only when it changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [slugKey])\n\n // ─── Hash dispatch — `/faqs#faq-item-<id>` or `/faqs#faq-<section-slug>` ──\n // Tracks the current hash so:\n // 1. an item-kind hash seeds `defaultOpenIds` on the matching accordion\n // (auto-expands the cited question);\n // 2. either kind triggers the cancellation-proof tween scroll with the\n // sticky-header offset (native browser hash scroll runs once, ignores\n // our offset — re-running the tween puts the target in the right spot).\n // Listens to `hashchange` so back/forward replays the same behavior. SSR-\n // safe: initial null state matches the server render; the first effect\n // tick on the client updates it.\n const [hashTarget, setHashTarget] = useState<FaqHashTarget | null>(null)\n useEffect(() => {\n const refresh = () => setHashTarget(parseFaqHash(window.location.hash))\n refresh()\n window.addEventListener('hashchange', refresh)\n return () => window.removeEventListener('hashchange', refresh)\n }, [])\n\n // Per-group default-open set when the hash points at an item. The map key\n // matches `groupKey(group)` so the render-time lookup is O(1) per group.\n const defaultOpenByGroupKey = useMemo(() => {\n if (hashTarget?.kind !== 'item') return null\n const targetId = hashTarget.rawId\n const result = new Map<string, (string | number)[]>()\n for (const group of groups) {\n const hit = group.items.find((i) => String(i.id) === targetId)\n if (hit) result.set(groupKey(group), [hit.id])\n }\n return result.size > 0 ? result : null\n }, [groups, hashTarget])\n\n // Accordion is uncontrolled — `defaultOpenIds` is only consumed at mount,\n // so a new item hash needs a remount to honor it. Keying off the item-id\n // suffix triggers exactly the remount we need (and stays stable when the\n // hash points at a section, so category navigation never disturbs the\n // accordion's open state).\n const accordionKeySuffix =\n hashTarget?.kind === 'item' ? `item:${hashTarget.rawId}` : 'default'\n\n useEffect(() => {\n if (!hashTarget) return\n const elId =\n hashTarget.kind === 'item' ? faqItemAnchor(hashTarget.rawId) : hashTarget.slug\n const el = document.getElementById(elId)\n if (el) scrollElementIntoView(el, { headerOffset: STICKY_HEADER_OFFSET_PX })\n if (hashTarget.kind === 'section') setActiveSlug(hashTarget.slug)\n }, [hashTarget])\n\n // Category pill click. `navigateSamePageHash` owns the entire transition:\n // replaceState → synthetic `hashchange` → `scrollElementIntoView` tween\n // with `STICKY_HEADER_OFFSET_PX` so the section heading lands BELOW the\n // sticky category nav on the FIRST tween (covers the same-target\n // re-click case, where the `hashTarget` effect at L214 is a no-op\n // because the state reference is equal). For DIFFERENT-target clicks\n // the helper's synthetic `hashchange` re-fires that effect, which\n // re-scrolls with the same offset and cancels this tween (singleton)\n // — both paths land at the same position. The effect is still\n // required for back/forward + direct URL edits, where the helper\n // isn't in the call chain.\n //\n // `history: 'replace'` matches the pre-helper behavior: category pills\n // are a TOC, not a navigation step, so the Back button leaves the\n // FAQ page in one step regardless of how many categories the user\n // clicked through.\n const handleJump = useCallback(\n (e: React.MouseEvent<HTMLAnchorElement>, slug: string) => {\n e.preventDefault()\n navigateSamePageHash('#' + slug, {\n headerOffset: STICKY_HEADER_OFFSET_PX,\n history: 'replace',\n })\n },\n [],\n )\n\n return (\n <div className=\"space-y-8\">\n {navGroups.length > 1 && (\n <nav aria-label=\"FAQ categories\" className=\"flex flex-wrap gap-2\">\n {navGroups.map((group) => {\n const isActive = group.slug === activeSlug\n return (\n <a\n key={group.slug}\n href={`#${group.slug}`}\n aria-current={isActive ? 'true' : undefined}\n onClick={(e) => handleJump(e, group.slug as string)}\n className={cn(\n \"rounded-full border px-4 py-2 text-sm font-medium font-['DM_Sans'] transition-colors\",\n isActive\n ? 'border-ods-text-primary bg-ods-card text-ods-text-primary'\n : 'border-ods-border bg-ods-card text-ods-text-secondary hover:border-ods-text-secondary hover:text-ods-text-primary',\n )}\n >\n {group.section}\n </a>\n )\n })}\n </nav>\n )}\n <div className=\"space-y-10\">\n {groups.map((group) => {\n const key = groupKey(group)\n return (\n <section\n key={key}\n id={group.slug ?? undefined}\n className=\"scroll-mt-24 space-y-4\"\n >\n {group.section && (\n <CategoryHeading className={SECTION_HEADING_CLASS}>{group.section}</CategoryHeading>\n )}\n <FaqAccordion\n // Re-key on item-hash changes so the remount picks up the new\n // `defaultOpenIds` (the accordion is uncontrolled). Stable for\n // section hashes — category navigation doesn't disturb state.\n key={`${key}:${accordionKeySuffix}`}\n items={group.items}\n defaultOpenIds={defaultOpenByGroupKey?.get(key)}\n />\n </section>\n )\n })}\n </div>\n </div>\n )\n}\n\nfunction FaqSkeleton() {\n return (\n <div className=\"space-y-8 animate-pulse\">\n <div className=\"h-12 md:h-14 w-2/3 rounded bg-ods-border\" />\n <div className=\"rounded-3xl border border-ods-border overflow-hidden bg-ods-card divide-y divide-ods-border w-full\">\n {Array.from({ length: 8 }).map((_, idx) => (\n <div key={idx} className=\"flex items-center justify-between px-6 md:px-8 py-6\">\n <div className=\"h-6 w-5/6 rounded bg-ods-border\" />\n <div className=\"h-10 w-10 rounded-md bg-ods-border\" />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\ninterface FaqsResponse {\n faqs: Faq[]\n}\n\n/**\n * The FAQ display surface — ONE rendering on every host: the list grouped by\n * `faq.section` (each category a heading + its own accordion, with a category\n * jump-nav once there are 2+ categories). There is no flat/ungrouped mode and\n * no page-vs-embedded shell fork; the standalone /faqs page and every embed\n * render through this single path, so they cannot drift.\n *\n * - Standalone /faqs page: pass `initialFaqs` (SSR) + `heading={null}` (the\n * page owns the <h1>) + `emitJsonLd` with `jsonLd` overrides for SEO.\n * - Per-entity embed: pass `entityType` + `entityId` (no `initialFaqs`); the\n * hook self-fetches `GET /api/faqs`, and `heading` is this block's own <h2>.\n *\n * CONTRACT: the consuming app MUST implement `GET /api/faqs`. On a fetch error\n * (or zero FAQs) the component renders nothing so the host page isn't\n * disfigured. The host always supplies the page shell — this renders a bare\n * <section>.\n */\nexport function FaqSection({\n initialFaqs,\n entityType,\n entityId,\n heading,\n emitJsonLd = false,\n jsonLd,\n className,\n minResults,\n apiBaseUrl = '',\n}: FaqSectionProps) {\n const url = buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl)\n // Memoized — useSelfFetch re-syncs on [initialData]; a fresh per-render\n // wrapper object would setState-loop under re-rendering parents.\n const initialData = useMemo<FaqsResponse | undefined>(\n () => (initialFaqs ? { faqs: initialFaqs } : undefined),\n [initialFaqs],\n )\n const { data, isLoading, error } = useSelfFetch<FaqsResponse>(url, { initialData })\n\n const faqs = data?.faqs ?? []\n // Grouped before the early returns so the hook order stays stable.\n const groups = useMemo(() => (faqs.length > 0 ? groupFaqsBySection(faqs) : []), [faqs])\n\n // `undefined` → default <h2> title; `null` → the host page owns the <h1>, so\n // no title renders here. `heading === null` also makes the category headings\n // <h2> (directly under the page <h1>); otherwise they nest as <h3>.\n const headingNode =\n heading === undefined ? <h2 className={SECTION_HEADING_CLASS}>{DEFAULT_HEADING_TEXT}</h2> : heading\n\n // Degrade silently — never show an error banner or an empty section shell\n // where FAQs would be (host pages and the standalone surface both rely on it).\n if (error) return null\n if (!isLoading && faqs.length === 0) return null\n if (isLoading && faqs.length === 0) {\n return (\n <div className={className}>\n <FaqSkeleton />\n </div>\n )\n }\n\n const schema = emitJsonLd ? buildFaqJsonLdFromFaqs(faqs, jsonLd) : null\n\n return (\n <>\n <section className={className ?? 'space-y-10'}>\n {headingNode}\n <GroupedFaqList groups={groups} categoryHeadingAs={heading === null ? 'h2' : 'h3'} />\n </section>\n {schema && (\n <script\n type=\"application/ld+json\"\n // eslint-disable-next-line react/no-danger\n // serializeJsonLd, NOT raw JSON.stringify — FAQ answers are\n // admin-entered; an embedded \"</script>\" must not break the tag.\n dangerouslySetInnerHTML={{ __html: serializeJsonLd(schema) }}\n />\n )}\n </>\n )\n}\n","\"use client\"\n\nimport React, { useRef, useState, useEffect, useCallback } from 'react'\nimport { ChevronButton } from './ui/chevron-button'\nimport { cn } from \"../utils/cn\"\nimport { faqItemAnchor } from \"../utils/faq-anchor\"\n\nexport interface FaqItem {\n id: number | string\n question: string\n answer: string\n}\n\ninterface FaqAccordionProps {\n items: FaqItem[]\n defaultOpenIds?: (number | string)[]\n}\n\n// Utility to measure scrollHeight outside render cycle\nconst useMeasuredHeight = (isOpen: boolean) => {\n const ref = useRef<HTMLDivElement | null>(null)\n const [maxHeight, setMaxHeight] = useState<string>('0px')\n\n const measure = useCallback(() => {\n if (ref.current) {\n const height = ref.current.scrollHeight\n setMaxHeight(`${height}px`)\n }\n }, [])\n\n // Update height only when section is open\n useEffect(() => {\n if (isOpen) {\n measure()\n } else {\n setMaxHeight('0px')\n }\n }, [isOpen, measure])\n\n return { ref, maxHeight }\n}\n\nexport function FaqAccordion({ items, defaultOpenIds = [] }: FaqAccordionProps) {\n const [openSet, setOpenSet] = useState<Set<string | number>>(new Set(defaultOpenIds))\n\n const toggle = (id: string | number) => {\n setOpenSet(prev => {\n const next = new Set(prev)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n return next\n })\n }\n\n return (\n <div className=\"rounded-3xl border border-ods-border divide-y divide-ods-border bg-ods-card overflow-hidden\">\n {items.map(item => {\n const isOpen = openSet.has(item.id)\n const { ref, maxHeight } = useMeasuredHeight(isOpen)\n\n return (\n <div\n key={item.id}\n // Per-row anchor — chat citation chips (`/faqs#faq-item-<id>`) land\n // here via native browser hash scroll AND via `FaqSection`'s tween\n // dispatch. `scroll-mt-24` keeps the row header below the 96px\n // sticky nav offset (matches `<section>`'s scroll-margin for\n // category anchors).\n id={faqItemAnchor(item.id)}\n className={cn('group scroll-mt-24 transition-colors hover:bg-[#1E1E1E]', isOpen ? 'bg-ods-bg' : 'bg-transparent')}\n >\n {/* Header */}\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => toggle(item.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n toggle(item.id);\n }\n }}\n aria-expanded={isOpen}\n className=\"flex w-full items-center justify-between px-6 md:px-8 py-6 text-left focus:outline-none transition-colors cursor-pointer\"\n >\n <div className=\"min-w-0 pr-4\">\n <h3>\n {item.question}\n </h3>\n </div>\n <div className=\"flex-shrink-0\">\n <ChevronButton\n aria-label={isOpen ? 'Collapse question' : 'Expand question'}\n size=\"md\"\n isExpanded={isOpen}\n backgroundColor=\"transparent\"\n borderColor=\"#3A3A3A\"\n />\n </div>\n </div>\n {/* Content wrapper with max-height animation */}\n <div\n style={{ maxHeight, transition: 'max-height 0.35s ease-in-out, opacity 0.35s ease-in-out', opacity: isOpen ? 1 : 0 }}\n className=\"overflow-hidden group-hover:bg-[#1E1E1E]/30\"\n >\n <div ref={ref} className=\"px-6 md:px-8 pb-6 text-ods-text-primary text-h4\">\n {item.answer}\n </div>\n </div>\n </div>\n )\n })}\n </div>\n )\n} ","/**\n * Pure FAQ JSON-LD builder. No React, no client-only deps — safe to import from\n * Server Components via the `./components/faq` subpath export. (Do NOT import\n * through the root `./components` barrel — that barrel is `\"use client\"` and\n * dragging it into a Server Component would force the client graph into the\n * server.)\n *\n * The hub used to harcode `name`/`description` here for OpenMSP; in the lib we\n * accept overrides so every embedder can supply its own platform branding.\n */\nimport type { Faq } from '../../types/faq'\n\nexport interface FaqSchemaOptions {\n name?: string\n description?: string\n url?: string\n}\n\nconst DEFAULT_NAME = 'Frequently Asked Questions'\nconst DEFAULT_DESCRIPTION =\n 'Answers to common questions.'\n\nexport function baseFaqSchema(opts: FaqSchemaOptions = {}) {\n return {\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n name: opts.name ?? DEFAULT_NAME,\n description: opts.description ?? DEFAULT_DESCRIPTION,\n ...(opts.url ? { url: opts.url } : {}),\n } as const\n}\n\nexport function buildFaqJsonLdFromFaqs(faqs: Faq[], opts: FaqSchemaOptions = {}) {\n return {\n ...baseFaqSchema(opts),\n mainEntity: faqs.map((faq) => ({\n '@type': 'Question',\n name: faq.question,\n acceptedAnswer: {\n '@type': 'Answer',\n text: faq.answer,\n },\n })),\n } as const\n}\n","'use client';\n\n/**\n * FaqDocumentPage — the full `/faqs` page with chrome, so embedders drop in\n * ONE component instead of hand-assembling `PageShell` + `PageLayout` around the\n * bare `<FaqSection>`. Mirrors `LegalDocumentPage` / `DevSectionPage`: the\n * page-level layout lives in the lib, the host passes only config + a back button.\n *\n * `<FaqSection heading={null}>` lets `PageLayout`'s `TitleBlock` own the heading +\n * back button; it self-fetches `${apiBaseUrl}/api/faqs` via the authed\n * `useSelfFetch`, and renders nothing on a fetch error or zero FAQs.\n */\n\nimport { PageShell, PageLayout } from '../ui';\nimport { useRouter } from '../../embed-shims/next-navigation';\nimport { FaqSection } from './faq-section';\n\nexport interface FaqDocumentPageProps {\n /** Page title (PageLayout TitleBlock). Default \"FAQs\". */\n title?: string;\n /** Subtitle under the title. */\n subtitle?: string;\n /** Back-button config — same pattern as `DevSectionPage` / `LegalDocumentPage`.\n * Pass `false` to hide. Default `{ label: 'Back to home', href: '/' }`. */\n backButton?: { label?: string; href?: string } | false;\n /** Base URL `FaqSection` appends `/api/faqs` to (reverse-proxy embedders). */\n apiBaseUrl?: string;\n /** Optional entity scoping forwarded to `FaqSection`. */\n entityType?: string;\n entityId?: number | string;\n /** Minimum FAQ count before the section renders (forwarded to `FaqSection`). */\n minResults?: number;\n}\n\nexport function FaqDocumentPage({\n title = 'FAQs',\n subtitle,\n backButton,\n apiBaseUrl,\n entityType,\n entityId,\n minResults,\n}: FaqDocumentPageProps) {\n const router = useRouter();\n\n // Back-button config — mirrors LegalDocumentPage/DevSectionPage. Hide entirely\n // when the caller passes `false` (embed-mode where the host owns nav chrome).\n const backCfg =\n backButton === false\n ? undefined\n : {\n label: backButton?.label ?? 'Back to home',\n onClick: () => router.push(backButton?.href ?? '/'),\n };\n\n return (\n <PageShell>\n <PageLayout title={title} subtitle={subtitle} backButton={backCfg}>\n <FaqSection\n heading={null}\n apiBaseUrl={apiBaseUrl}\n entityType={entityType}\n entityId={entityId}\n minResults={minResults}\n />\n </PageLayout>\n </PageShell>\n );\n}\n"]}
@@ -6,7 +6,7 @@ import {
6
6
  resolveExternalNavigation,
7
7
  resolveSourceIcon,
8
8
  stripSameOriginToPath
9
- } from "./chunk-SLP4KXP6.js";
9
+ } from "./chunk-FQJK446R.js";
10
10
  import {
11
11
  useDebounce
12
12
  } from "./chunk-POKKCWKF.js";
@@ -345,4 +345,4 @@ export {
345
345
  resolveSearchResultAction,
346
346
  useDocSearch
347
347
  };
348
- //# sourceMappingURL=chunk-CUQH4SHH.js.map
348
+ //# sourceMappingURL=chunk-6GCI7JOE.js.map
@@ -4,10 +4,12 @@ import {
4
4
  HONEYPOT_FIELD,
5
5
  ToolTypeValues,
6
6
  consumeAccessCode,
7
+ normalizeHashFragment,
8
+ scrollElementIntoView,
7
9
  transformPlatformConfigsToOptions,
8
10
  validateAccessCode,
9
11
  validateAndConsumeAccessCode
10
- } from "./chunk-TYZEMPPH.js";
12
+ } from "./chunk-OQ6X7ZOC.js";
11
13
  import {
12
14
  useRequiredEndpointsRuntime
13
15
  } from "./chunk-MJNXIEV2.js";
@@ -2657,6 +2659,50 @@ function useAccessCodeIntegration() {
2657
2659
  };
2658
2660
  }
2659
2661
 
2662
+ // src/hooks/use-scroll-to-hash.ts
2663
+ import { useEffect as useEffect16 } from "react";
2664
+ var MAX_POLL_FRAMES = 60;
2665
+ function useScrollToHash(readyDep = true, options) {
2666
+ const headerOffset = options?.headerOffset ?? 0;
2667
+ useEffect16(() => {
2668
+ if (typeof window === "undefined") return;
2669
+ if (readyDep === null || readyDep === false) return;
2670
+ let rafId = null;
2671
+ const cancelPoll = () => {
2672
+ if (rafId !== null) {
2673
+ cancelAnimationFrame(rafId);
2674
+ rafId = null;
2675
+ }
2676
+ };
2677
+ const tryScrollToHash = () => {
2678
+ const hash = normalizeHashFragment(window.location.hash).slice(1);
2679
+ if (!hash) return;
2680
+ cancelPoll();
2681
+ let frames = 0;
2682
+ const tick = () => {
2683
+ const el = document.getElementById(hash);
2684
+ if (el) {
2685
+ rafId = null;
2686
+ scrollElementIntoView(el, { headerOffset });
2687
+ return;
2688
+ }
2689
+ if (frames++ < MAX_POLL_FRAMES) {
2690
+ rafId = requestAnimationFrame(tick);
2691
+ } else {
2692
+ rafId = null;
2693
+ }
2694
+ };
2695
+ tick();
2696
+ };
2697
+ tryScrollToHash();
2698
+ window.addEventListener("hashchange", tryScrollToHash);
2699
+ return () => {
2700
+ window.removeEventListener("hashchange", tryScrollToHash);
2701
+ cancelPoll();
2702
+ };
2703
+ }, [readyDep, headerOffset]);
2704
+ }
2705
+
2660
2706
  // src/hooks/use-humanity-signals.ts
2661
2707
  import { useCallback as useCallback12, useRef as useRef10 } from "react";
2662
2708
  function useHumanitySignals() {
@@ -2739,6 +2785,7 @@ export {
2739
2785
  useCursorPaginationState,
2740
2786
  useNatsClient,
2741
2787
  useAccessCodeIntegration,
2788
+ useScrollToHash,
2742
2789
  useHumanitySignals
2743
2790
  };
2744
- //# sourceMappingURL=chunk-N6ZM5PYZ.js.map
2791
+ //# sourceMappingURL=chunk-7RIYT7ZH.js.map