@flamingo-stack/openframe-frontend-core 0.0.274 → 0.0.275-snapshot.20260616145353

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 (179) hide show
  1. package/dist/{chunk-XDGDCO3I.cjs → chunk-2GLHJ7ZY.cjs} +45 -44
  2. package/dist/chunk-2GLHJ7ZY.cjs.map +1 -0
  3. package/dist/{chunk-FLIWL6V4.js → chunk-62U6DFIT.js} +4 -4
  4. package/dist/{chunk-5QJQAFTP.cjs → chunk-6IJWWLC3.cjs} +48 -12
  5. package/dist/chunk-6IJWWLC3.cjs.map +1 -0
  6. package/dist/{chunk-4YKGXZ7W.js → chunk-7AH75KFQ.js} +1 -1
  7. package/dist/chunk-7AH75KFQ.js.map +1 -0
  8. package/dist/{chunk-2KHFSSFZ.cjs → chunk-DPMW5E6Q.cjs} +15 -15
  9. package/dist/{chunk-2KHFSSFZ.cjs.map → chunk-DPMW5E6Q.cjs.map} +1 -1
  10. package/dist/{chunk-T7AJBKZP.cjs → chunk-GVSTRN36.cjs} +5 -2
  11. package/dist/chunk-GVSTRN36.cjs.map +1 -0
  12. package/dist/{chunk-4DYXV3E7.cjs → chunk-IAB7QACX.cjs} +1218 -1227
  13. package/dist/chunk-IAB7QACX.cjs.map +1 -0
  14. package/dist/{chunk-L4LAAA5Q.js → chunk-IMNGGLKL.js} +5 -2
  15. package/dist/chunk-IMNGGLKL.js.map +1 -0
  16. package/dist/{chunk-7NJUPRN6.cjs → chunk-LH7R56RR.cjs} +184 -209
  17. package/dist/chunk-LH7R56RR.cjs.map +1 -0
  18. package/dist/{chunk-WU6PMH5L.cjs → chunk-MYJKC56A.cjs} +41 -43
  19. package/dist/chunk-MYJKC56A.cjs.map +1 -0
  20. package/dist/{chunk-GL5X6VVC.js → chunk-NITJSVUM.js} +4 -4
  21. package/dist/{chunk-CYMMGPPV.js → chunk-NPKMH446.js} +41 -5
  22. package/dist/chunk-NPKMH446.js.map +1 -0
  23. package/dist/{chunk-MEAR2WHS.cjs → chunk-PC7YOZ4I.cjs} +1 -1
  24. package/dist/chunk-PC7YOZ4I.cjs.map +1 -0
  25. package/dist/{chunk-QLWBBCI5.cjs → chunk-Q2ITV3NY.cjs} +5 -4
  26. package/dist/chunk-Q2ITV3NY.cjs.map +1 -0
  27. package/dist/{chunk-VASNLWPZ.js → chunk-QNWFTSAG.js} +5 -7
  28. package/dist/{chunk-VASNLWPZ.js.map → chunk-QNWFTSAG.js.map} +1 -1
  29. package/dist/chunk-RGALV4UX.js +433 -0
  30. package/dist/chunk-RGALV4UX.js.map +1 -0
  31. package/dist/{chunk-W5KBDFCR.cjs → chunk-SITWWJWS.cjs} +30 -30
  32. package/dist/{chunk-W5KBDFCR.cjs.map → chunk-SITWWJWS.cjs.map} +1 -1
  33. package/dist/{chunk-N5MCKGAB.js → chunk-UCX75VEM.js} +34 -33
  34. package/dist/{chunk-N5MCKGAB.js.map → chunk-UCX75VEM.js.map} +1 -1
  35. package/dist/{chunk-ZMFT5XOB.js → chunk-UXJCZOLA.js} +4 -3
  36. package/dist/chunk-UXJCZOLA.js.map +1 -0
  37. package/dist/{chunk-OPSZNW3I.js → chunk-VAIPAZPJ.js} +3071 -3080
  38. package/dist/chunk-VAIPAZPJ.js.map +1 -0
  39. package/dist/{chunk-BSOHVQ7X.js → chunk-ZS4XNIZK.js} +367 -392
  40. package/dist/chunk-ZS4XNIZK.js.map +1 -0
  41. package/dist/chunk-ZSUNQJRO.cjs +433 -0
  42. package/dist/chunk-ZSUNQJRO.cjs.map +1 -0
  43. package/dist/components/chat/chat-message-row.d.ts +1 -1
  44. package/dist/components/chat/chat-message-row.d.ts.map +1 -1
  45. package/dist/components/chat/index.cjs +10 -11
  46. package/dist/components/chat/index.cjs.map +1 -1
  47. package/dist/components/chat/index.js +12 -13
  48. package/dist/components/chat/utils/history-merge.d.ts.map +1 -1
  49. package/dist/components/contact/index.cjs +7 -9
  50. package/dist/components/contact/index.cjs.map +1 -1
  51. package/dist/components/contact/index.js +6 -8
  52. package/dist/components/faq/faq-document-page.d.ts +21 -0
  53. package/dist/components/faq/faq-document-page.d.ts.map +1 -0
  54. package/dist/components/faq/index.cjs +22 -5
  55. package/dist/components/faq/index.cjs.map +1 -1
  56. package/dist/components/faq/index.d.ts +1 -0
  57. package/dist/components/faq/index.d.ts.map +1 -1
  58. package/dist/components/faq/index.js +21 -4
  59. package/dist/components/features/board/board.d.ts.map +1 -1
  60. package/dist/components/features/board/ticket-card.d.ts +2 -1
  61. package/dist/components/features/board/ticket-card.d.ts.map +1 -1
  62. package/dist/components/features/board/types.d.ts +1 -0
  63. package/dist/components/features/board/types.d.ts.map +1 -1
  64. package/dist/components/features/index.cjs +6 -8
  65. package/dist/components/features/index.cjs.map +1 -1
  66. package/dist/components/features/index.js +5 -7
  67. package/dist/components/index.cjs +304 -309
  68. package/dist/components/index.cjs.map +1 -1
  69. package/dist/components/index.js +249 -254
  70. package/dist/components/index.js.map +1 -1
  71. package/dist/components/layout/article-detail-layout.d.ts +21 -9
  72. package/dist/components/layout/article-detail-layout.d.ts.map +1 -1
  73. package/dist/components/navigation/index.cjs +6 -8
  74. package/dist/components/navigation/index.cjs.map +1 -1
  75. package/dist/components/navigation/index.js +5 -7
  76. package/dist/components/onboarding-guides/index.cjs +33 -46
  77. package/dist/components/onboarding-guides/index.cjs.map +1 -1
  78. package/dist/components/onboarding-guides/index.js +11 -24
  79. package/dist/components/onboarding-guides/index.js.map +1 -1
  80. package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts.map +1 -1
  81. package/dist/components/related-content/index.cjs +8 -10
  82. package/dist/components/related-content/index.cjs.map +1 -1
  83. package/dist/components/related-content/index.js +7 -9
  84. package/dist/components/shared/delivery/delivery-lists.d.ts.map +1 -1
  85. package/dist/components/shared/detail-page-skeleton.d.ts +6 -1
  86. package/dist/components/shared/detail-page-skeleton.d.ts.map +1 -1
  87. package/dist/components/shared/legal-document/use-legal-docs.d.ts.map +1 -1
  88. package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
  89. package/dist/components/shared/roadmap/roadmap-grid.d.ts.map +1 -1
  90. package/dist/components/shared/roadmap/use-roadmap-voting.d.ts.map +1 -1
  91. package/dist/components/tickets/help-center-list.d.ts +9 -1
  92. package/dist/components/tickets/help-center-list.d.ts.map +1 -1
  93. package/dist/components/tickets/hooks/use-ticket-actions.d.ts.map +1 -1
  94. package/dist/components/tickets/hooks/use-ticket-engagements.d.ts.map +1 -1
  95. package/dist/components/tickets/hooks/use-tickets-list.d.ts.map +1 -1
  96. package/dist/components/tickets/index.cjs +81 -76
  97. package/dist/components/tickets/index.cjs.map +1 -1
  98. package/dist/components/tickets/index.js +27 -22
  99. package/dist/components/tickets/index.js.map +1 -1
  100. package/dist/components/ui/actions-menu.d.ts +6 -0
  101. package/dist/components/ui/actions-menu.d.ts.map +1 -1
  102. package/dist/components/ui/index.cjs +12 -15
  103. package/dist/components/ui/index.cjs.map +1 -1
  104. package/dist/components/ui/index.js +24 -27
  105. package/dist/contexts/chat-runtime-context.d.ts +9 -0
  106. package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
  107. package/dist/contexts/index.cjs +2 -2
  108. package/dist/contexts/index.js +1 -1
  109. package/dist/hooks/index.cjs +3 -3
  110. package/dist/hooks/index.js +2 -2
  111. package/dist/hooks/use-contact-submission.d.ts.map +1 -1
  112. package/dist/hooks/use-self-fetch.d.ts.map +1 -1
  113. package/dist/index.cjs +11 -15
  114. package/dist/index.cjs.map +1 -1
  115. package/dist/index.js +32 -36
  116. package/dist/utils/embed-authed-fetch.d.ts +7 -0
  117. package/dist/utils/embed-authed-fetch.d.ts.map +1 -1
  118. package/dist/utils/embed-content-fetch.d.ts +2 -0
  119. package/dist/utils/embed-content-fetch.d.ts.map +1 -0
  120. package/dist/utils/index.cjs.map +1 -1
  121. package/dist/utils/index.js.map +1 -1
  122. package/package.json +1 -1
  123. package/src/components/chat/chat-message-row.tsx +12 -2
  124. package/src/components/chat/utils/history-merge.ts +27 -0
  125. package/src/components/faq/faq-document-page.tsx +69 -0
  126. package/src/components/faq/index.ts +1 -0
  127. package/src/components/features/board/board-column.tsx +1 -0
  128. package/src/components/features/board/board.tsx +6 -1
  129. package/src/components/features/board/ticket-card.tsx +23 -6
  130. package/src/components/features/board/types.ts +1 -0
  131. package/src/components/layout/article-detail-layout.tsx +24 -11
  132. package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +21 -16
  133. package/src/components/shared/delivery/delivery-lists.tsx +3 -2
  134. package/src/components/shared/detail-page-skeleton.tsx +18 -10
  135. package/src/components/shared/legal-document/use-legal-docs.ts +2 -1
  136. package/src/components/shared/product-release/release-detail-page.tsx +27 -17
  137. package/src/components/shared/roadmap/roadmap-grid.tsx +2 -1
  138. package/src/components/shared/roadmap/use-roadmap-voting.ts +3 -2
  139. package/src/components/tickets/help-center-list.tsx +12 -4
  140. package/src/components/tickets/hooks/use-ticket-actions.ts +7 -2
  141. package/src/components/tickets/hooks/use-ticket-engagements.ts +6 -1
  142. package/src/components/tickets/hooks/use-tickets-list.ts +7 -1
  143. package/src/components/tickets/ticket-detail-drawer.tsx +1 -0
  144. package/src/components/ui/actions-menu.tsx +11 -1
  145. package/src/contexts/chat-runtime-context.tsx +9 -0
  146. package/src/hooks/use-contact-submission.ts +2 -1
  147. package/src/hooks/use-self-fetch.ts +2 -1
  148. package/src/styles/index.css +1 -0
  149. package/src/styles/ods-page-shell.css +29 -0
  150. package/src/utils/embed-authed-fetch.ts +10 -0
  151. package/src/utils/embed-content-fetch.ts +30 -0
  152. package/dist/chunk-4DYXV3E7.cjs.map +0 -1
  153. package/dist/chunk-4YKGXZ7W.js.map +0 -1
  154. package/dist/chunk-5QJQAFTP.cjs.map +0 -1
  155. package/dist/chunk-722TTRIJ.cjs +0 -29
  156. package/dist/chunk-722TTRIJ.cjs.map +0 -1
  157. package/dist/chunk-7NJUPRN6.cjs.map +0 -1
  158. package/dist/chunk-BSOHVQ7X.js.map +0 -1
  159. package/dist/chunk-CYMMGPPV.js.map +0 -1
  160. package/dist/chunk-DAAFVOTL.cjs +0 -172
  161. package/dist/chunk-DAAFVOTL.cjs.map +0 -1
  162. package/dist/chunk-L4LAAA5Q.js.map +0 -1
  163. package/dist/chunk-MEAR2WHS.cjs.map +0 -1
  164. package/dist/chunk-OO4ZGDRO.js +0 -29
  165. package/dist/chunk-OO4ZGDRO.js.map +0 -1
  166. package/dist/chunk-OPSZNW3I.js.map +0 -1
  167. package/dist/chunk-QLWBBCI5.cjs.map +0 -1
  168. package/dist/chunk-T2URJAX2.js +0 -169
  169. package/dist/chunk-T2URJAX2.js.map +0 -1
  170. package/dist/chunk-T7AJBKZP.cjs.map +0 -1
  171. package/dist/chunk-WU6PMH5L.cjs.map +0 -1
  172. package/dist/chunk-XDGDCO3I.cjs.map +0 -1
  173. package/dist/chunk-Y2B6WDU6.cjs +0 -169
  174. package/dist/chunk-Y2B6WDU6.cjs.map +0 -1
  175. package/dist/chunk-ZMFT5XOB.js.map +0 -1
  176. package/dist/chunk-ZXZJSTNV.js +0 -172
  177. package/dist/chunk-ZXZJSTNV.js.map +0 -1
  178. /package/dist/{chunk-FLIWL6V4.js.map → chunk-62U6DFIT.js.map} +0 -0
  179. /package/dist/{chunk-GL5X6VVC.js.map → chunk-NITJSVUM.js.map} +0 -0
@@ -47,9 +47,14 @@ export interface HelpCenterListProps {
47
47
  /** Toast override (test-friendly). Defaults to the lib's shared
48
48
  * toast singleton. */
49
49
  toast?: typeof defaultToast
50
+ /** Back-button forwarded to the internal `DevSectionPage` chrome (same shape
51
+ * as `DevSectionPage` / `LegalDocumentPage`: `{ label?, href? }`, or `false`
52
+ * to hide). Omit ⇒ `DevSectionPage`'s default (`Back to home` → `/`), which
53
+ * embedders whose home isn't `/` MUST override. */
54
+ backButton?: { label?: string; href?: string } | false
50
55
  }
51
56
 
52
- export function HelpCenterList({ toast = defaultToast }: HelpCenterListProps = {}) {
57
+ export function HelpCenterList({ toast = defaultToast, backButton }: HelpCenterListProps = {}) {
53
58
  const identity = useChatIdentity()
54
59
  const searchParams = useSearchParams()
55
60
  const router = useRouter()
@@ -77,14 +82,14 @@ export function HelpCenterList({ toast = defaultToast }: HelpCenterListProps = {
77
82
  // mounts in the `preControls` slot.
78
83
  if (identity.isLoading) {
79
84
  return (
80
- <DevSectionPage sectionKey="tickets" preControls={<HelpCenterCreateFormSkeleton />}>
85
+ <DevSectionPage sectionKey="tickets" backButton={backButton} preControls={<HelpCenterCreateFormSkeleton />}>
81
86
  <DevCardRowSkeletonList />
82
87
  </DevSectionPage>
83
88
  )
84
89
  }
85
90
  if (identity.authTier === 'anon' || !identity.user?.email) {
86
91
  return (
87
- <DevSectionPage sectionKey="tickets">
92
+ <DevSectionPage sectionKey="tickets" backButton={backButton}>
88
93
  <EmptyState
89
94
  type="generic"
90
95
  title="Sign in to manage tickets"
@@ -119,6 +124,7 @@ export function HelpCenterList({ toast = defaultToast }: HelpCenterListProps = {
119
124
  toast={toast}
120
125
  sessionName={sessionName}
121
126
  sessionEmail={sessionEmail}
127
+ backButton={backButton}
122
128
  />
123
129
  )
124
130
  }
@@ -135,6 +141,7 @@ interface AuthedProps {
135
141
  toast: typeof defaultToast
136
142
  sessionName: string
137
143
  sessionEmail: string
144
+ backButton?: { label?: string; href?: string } | false
138
145
  }
139
146
 
140
147
  function HelpCenterListAuthed({
@@ -148,6 +155,7 @@ function HelpCenterListAuthed({
148
155
  toast,
149
156
  sessionName,
150
157
  sessionEmail,
158
+ backButton,
151
159
  }: AuthedProps) {
152
160
  const queryClient = useQueryClient()
153
161
  const [optimisticTickets, setOptimisticTickets] = useState<OptimisticTicket[]>([])
@@ -365,7 +373,7 @@ function HelpCenterListAuthed({
365
373
  )
366
374
 
367
375
  return (
368
- <DevSectionPage sectionKey="tickets" preControls={form}>
376
+ <DevSectionPage sectionKey="tickets" backButton={backButton} preControls={form}>
369
377
  {body}
370
378
  </DevSectionPage>
371
379
  )
@@ -31,6 +31,7 @@
31
31
 
32
32
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
33
33
  import { useQueryClient } from '@tanstack/react-query'
34
+ import { useRequiredChatRuntime } from '../../../contexts/chat-runtime-context'
34
35
  import { embedAuthedFetch } from '../../../utils/embed-authed-fetch'
35
36
  import type { ChatAttachment } from '../../chat/utils/chat-attachment-markdown'
36
37
  import {
@@ -149,6 +150,10 @@ export interface UseTicketActionsReturn {
149
150
 
150
151
  export function useTicketActions(options: UseTicketActionsOptions): UseTicketActionsReturn {
151
152
  const queryClient = useQueryClient()
153
+ // Endpoint from the runtime config (like every other endpoint); falls back to
154
+ // the bare hub path when unconfigured.
155
+ const ticketActionEndpoint =
156
+ useRequiredChatRuntime().endpoints.ticketActionUrl ?? TICKET_ACTION_ENDPOINT
152
157
  const { prependOptimistic, removeOptimistic, removeTicketFromCache, toast, onSupportSystemDown } = options
153
158
 
154
159
  // Form-level single-flight uses BOTH a ref (for synchronous guarding
@@ -234,7 +239,7 @@ export function useTicketActions(options: UseTicketActionsOptions): UseTicketAct
234
239
 
235
240
  const executeTicketAction = useCallback(
236
241
  async (toolName: ToolName, args: Record<string, unknown>): Promise<TicketActionResponse> => {
237
- const res = await embedAuthedFetch(TICKET_ACTION_ENDPOINT, {
242
+ const res = await embedAuthedFetch(ticketActionEndpoint, {
238
243
  method: 'POST',
239
244
  body: JSON.stringify({ tool_name: toolName, args }),
240
245
  })
@@ -248,7 +253,7 @@ export function useTicketActions(options: UseTicketActionsOptions): UseTicketAct
248
253
  }
249
254
  return body
250
255
  },
251
- [],
256
+ [ticketActionEndpoint],
252
257
  )
253
258
 
254
259
  // Mirror-sync watcher — backoff refetches when the post-create mirror
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import { useQuery } from '@tanstack/react-query'
18
+ import { useRequiredChatRuntime } from '../../../contexts/chat-runtime-context'
18
19
  import { embedAuthedFetch } from '../../../utils/embed-authed-fetch'
19
20
  import { useChatIdentity } from '../../chat/hooks/use-chat-identity'
20
21
 
@@ -87,6 +88,10 @@ export function useTicketEngagements(
87
88
  ): UseTicketEngagementsReturn {
88
89
  const identity = useChatIdentity()
89
90
  const identityKey = identity.user?.email ?? 'anon'
91
+ // Endpoint from the runtime config (like every other endpoint); falls back to
92
+ // the bare hub path when unconfigured.
93
+ const listEngagementsEndpoint =
94
+ useRequiredChatRuntime().endpoints.listEngagementsUrl ?? LIST_ENGAGEMENTS_ENDPOINT
90
95
 
91
96
  // "Will this ticket fetch its timeline once identity is ready?" — i.e. it's a
92
97
  // real, non-optimistic ticket the caller enabled. INDEPENDENT of whether
@@ -116,7 +121,7 @@ export function useTicketEngagements(
116
121
  // so polling pauses on a hidden tab.
117
122
  refetchInterval,
118
123
  queryFn: async (): Promise<TicketEngagement[]> => {
119
- const response = await embedAuthedFetch(LIST_ENGAGEMENTS_ENDPOINT, {
124
+ const response = await embedAuthedFetch(listEngagementsEndpoint, {
120
125
  method: 'POST',
121
126
  body: JSON.stringify({ ticket_id: externalTicketId }),
122
127
  })
@@ -20,6 +20,7 @@
20
20
  */
21
21
 
22
22
  import { useQuery } from '@tanstack/react-query'
23
+ import { useRequiredChatRuntime } from '../../../contexts/chat-runtime-context'
23
24
  import { embedAuthedFetch } from '../../../utils/embed-authed-fetch'
24
25
  import type { TicketData } from '../types'
25
26
 
@@ -91,6 +92,11 @@ export interface UseTicketsListReturn {
91
92
  }
92
93
 
93
94
  export function useTicketsList(filters: UseTicketsListFilters): UseTicketsListReturn {
95
+ // Endpoint from the runtime config (like every other endpoint) so embedders
96
+ // behind a reverse proxy route it through `/content/*`; falls back to the bare
97
+ // hub path when unconfigured.
98
+ const findTicketEndpoint =
99
+ useRequiredChatRuntime().endpoints.findTicketUrl ?? FIND_TICKET_ENDPOINT
94
100
  const customerEmail = filters.customerEmail
95
101
  const search = (filters.search ?? '').trim()
96
102
  const status = (filters.status ?? '').trim().toLowerCase()
@@ -135,7 +141,7 @@ export function useTicketsList(filters: UseTicketsListFilters): UseTicketsListRe
135
141
  pageSize,
136
142
  }
137
143
  if (statusFilter) body.status = statusFilter
138
- const response = await embedAuthedFetch(FIND_TICKET_ENDPOINT, {
144
+ const response = await embedAuthedFetch(findTicketEndpoint, {
139
145
  method: 'POST',
140
146
  body: JSON.stringify(body),
141
147
  })
@@ -631,6 +631,7 @@ function AssignedAgentRow({
631
631
  </span>
632
632
  {displayLabel ? (
633
633
  <span className="flex items-center gap-1.5 text-ods-text-primary font-medium">
634
+ {/* Avatar loads direct; `SquareAvatar`'s own onError falls back to initials. */}
634
635
  <SquareAvatar
635
636
  size="sm"
636
637
  variant="round"
@@ -31,6 +31,12 @@ export interface ActionsMenuItem {
31
31
  disabled?: boolean;
32
32
  type?: "item" | "checkbox" | "submenu" | "separator";
33
33
  checked?: boolean;
34
+ /**
35
+ * Keep the dropdown open after this item is clicked instead of closing it
36
+ * (e.g. multi-select add). Only affects ActionsMenuDropdown; `checkbox` and
37
+ * `submenu` items always keep the menu open regardless. Defaults to closing.
38
+ */
39
+ closeOnSelect?: boolean;
34
40
  submenu?: ActionsMenuItem[];
35
41
  /** Render the row in the error/destructive color (label + icon). */
36
42
  danger?: boolean;
@@ -373,7 +379,11 @@ export const ActionsMenuDropdown: React.FC<ActionsMenuDropdownProps> = ({
373
379
  const handleItemClick = useCallback(
374
380
  (item: ActionsMenuItem) => {
375
381
  onItemClick?.(item);
376
- if (item.type !== "checkbox" && item.type !== "submenu") {
382
+ if (
383
+ item.type !== "checkbox" &&
384
+ item.type !== "submenu" &&
385
+ item.closeOnSelect !== false
386
+ ) {
377
387
  setOpen(false);
378
388
  }
379
389
  },
@@ -46,6 +46,15 @@ export interface ChatRuntime {
46
46
  chatStreamUrl: string
47
47
  /** POST agent approve/reject. Hub: '/api/chat/agent/confirm-tool'. */
48
48
  approvalToolUrl: string
49
+ /** Customer-ticket agent endpoints (Help Center). OPTIONAL — when unset,
50
+ * the ticket hooks fall back to the bare hub paths
51
+ * (`/api/chat/agent/{find-ticket,ticket-action,list-engagements}`).
52
+ * Embedders behind a reverse proxy set these to their proxied paths
53
+ * (e.g. `/content/api/chat/agent/...`) so tickets route through the SAME
54
+ * endpoint config + proxy as every other endpoint. */
55
+ findTicketUrl?: string
56
+ ticketActionUrl?: string
57
+ listEngagementsUrl?: string
49
58
  /** GET slash-command catalog. Hub: '/api/docs/commands'. */
50
59
  commandsUrl: string
51
60
  /** Build entity-card list URL for a content type + ids. Hub delegates
@@ -2,6 +2,7 @@ import { useState, useCallback, useEffect } from 'react';
2
2
  import { useToast } from "./use-toast";
3
3
  import { useRouter } from '../embed-shims/next-navigation';
4
4
  import { useRequiredEndpointsRuntime } from '../contexts/endpoints-runtime-context';
5
+ import { contentFetch } from '../utils/embed-content-fetch';
5
6
 
6
7
  interface ContactSubmissionOptions {
7
8
  userId?: string;
@@ -57,7 +58,7 @@ export function useContactSubmission(options: ContactSubmissionOptions = {}) {
57
58
  setIsSubmitting(true);
58
59
 
59
60
  try {
60
- const response = await fetch(contactUrl, {
61
+ const response = await contentFetch(contactUrl, {
61
62
  method: 'POST',
62
63
  headers: { 'Content-Type': 'application/json' },
63
64
  body: JSON.stringify({
@@ -1,6 +1,7 @@
1
1
  'use client'
2
2
 
3
3
  import { useEffect, useRef, useState, type Dispatch, type SetStateAction } from 'react'
4
+ import { contentFetch } from '../utils/embed-content-fetch'
4
5
 
5
6
  export interface UseSelfFetchResult<T> {
6
7
  data: T | null
@@ -71,7 +72,7 @@ export function useSelfFetch<T>(
71
72
  try {
72
73
  setIsLoading(true)
73
74
  setError(false)
74
- const res = await fetch(url as string, { signal: ctrl.signal })
75
+ const res = await contentFetch(url as string, { signal: ctrl.signal })
75
76
  if (!res.ok) throw new Error(`Request failed (${res.status})`)
76
77
  const json = (await res.json()) as T
77
78
  if (!cancelled) {
@@ -5,6 +5,7 @@
5
5
  @import "./ods-responsive-tokens.css";
6
6
  @import "./app-globals.css";
7
7
  @import "./chat-animations.css";
8
+ @import "./ods-page-shell.css";
8
9
 
9
10
  /* Vendor/library style overrides */
10
11
  @import "./vendor-react-easy-crop.css";
@@ -0,0 +1,29 @@
1
+ /* PageShell outer padding.
2
+ *
3
+ * Driven by CSS custom properties so an embedder can match its host grid by
4
+ * setting the vars on ANY ancestor — no prop-threading through the lib wrappers
5
+ * (DevSectionPage / LegalDocumentPage / ReleaseDetailPage / …), no imperative
6
+ * global, no React context. The cascade scopes each override to its own subtree
7
+ * automatically and stays reactive to the media query below.
8
+ *
9
+ * Defaults reproduce the hub's canonical wide-page spacing
10
+ * (`px-6 md:px-20 py-6 md:py-10`). Override vars (all optional):
11
+ * --page-shell-px / --page-shell-px-md horizontal (default 1.5rem / 5rem)
12
+ * --page-shell-pt / --page-shell-pt-md top (default 1.5rem / 2.5rem)
13
+ * --page-shell-pb / --page-shell-pb-md bottom (default 1.5rem / 2.5rem)
14
+ */
15
+ .page-shell-content {
16
+ padding-left: var(--page-shell-px, 1.5rem);
17
+ padding-right: var(--page-shell-px, 1.5rem);
18
+ padding-top: var(--page-shell-pt, 1.5rem);
19
+ padding-bottom: var(--page-shell-pb, 1.5rem);
20
+ }
21
+
22
+ @media (min-width: 768px) {
23
+ .page-shell-content {
24
+ padding-left: var(--page-shell-px-md, 5rem);
25
+ padding-right: var(--page-shell-px-md, 5rem);
26
+ padding-top: var(--page-shell-pt-md, 2.5rem);
27
+ padding-bottom: var(--page-shell-pb-md, 2.5rem);
28
+ }
29
+ }
@@ -133,6 +133,16 @@ export function setEmbedAuthAdapter(adapter: EmbedAuthAdapter | null): void {
133
133
  storeRegisteredAuthAdapter(adapter)
134
134
  }
135
135
 
136
+ /**
137
+ * Whether a host auth adapter is currently registered. Lets sibling helpers
138
+ * (e.g. `contentFetch`) route through `embedAuthedFetch` ONLY when a host has
139
+ * opted into embedded auth, and stay a plain `fetch` otherwise — so there's a
140
+ * single auth knob (the adapter), not a second content-fetch registration.
141
+ */
142
+ export function hasEmbedAuthAdapter(): boolean {
143
+ return getRegisteredAuthAdapter() !== null
144
+ }
145
+
136
146
  /**
137
147
  * `fetch` wrapper that attaches embed-proxy bearer headers (when
138
148
  * present in sessionStorage) and forces `credentials: 'same-origin'`
@@ -0,0 +1,30 @@
1
+ 'use client'
2
+
3
+ /**
4
+ * `contentFetch` — the fetch the lib's SELF-FETCHING content surfaces use:
5
+ * roadmap (list + vote + per-task refresh), delivery, product releases,
6
+ * onboarding guides (catalog + detail), legal docs, and the release-detail
7
+ * injected roadmap/delivery sections.
8
+ *
9
+ * It deliberately reuses the SINGLE embed-auth knob — the registered
10
+ * `EmbedAuthAdapter` — instead of introducing a second registration:
11
+ * - adapter registered (host opted into embedded auth, e.g. openframe-frontend
12
+ * for its embedded chat) → route through `embedAuthedFetch`, so content GETs/
13
+ * POSTs carry the SAME bearer/cookie + 401-refresh as the chat.
14
+ * - no adapter (the public hub, or the embedding example whose proxy injects
15
+ * auth server-side) → a plain, byte-for-byte unchanged `fetch`.
16
+ *
17
+ * So a host wires auth ONCE (the chat adapter) and content inherits it; there is
18
+ * no content-specific fetcher to configure.
19
+ */
20
+
21
+ import { embedAuthedFetch, hasEmbedAuthAdapter } from './embed-authed-fetch'
22
+
23
+ export const contentFetch: typeof fetch = (input, init) => {
24
+ if (!hasEmbedAuthAdapter()) return fetch(input, init)
25
+ // embedAuthedFetch takes a string url; coerce the broader `fetch` input shape
26
+ // (content surfaces always pass strings, but handle URL/Request defensively).
27
+ const url =
28
+ typeof input === 'string' ? input : input instanceof URL ? input.href : (input as Request).url
29
+ return embedAuthedFetch(url, init)
30
+ }