@flamingo-stack/openframe-frontend-core 0.0.274 → 0.0.275
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.
- package/dist/{chunk-XDGDCO3I.cjs → chunk-5LOLBUZG.cjs} +45 -44
- package/dist/chunk-5LOLBUZG.cjs.map +1 -0
- package/dist/{chunk-4YKGXZ7W.js → chunk-7AH75KFQ.js} +1 -1
- package/dist/chunk-7AH75KFQ.js.map +1 -0
- package/dist/{chunk-CYMMGPPV.js → chunk-CTBL56EC.js} +41 -5
- package/dist/chunk-CTBL56EC.js.map +1 -0
- package/dist/{chunk-2KHFSSFZ.cjs → chunk-DBJZF2OV.cjs} +15 -15
- package/dist/{chunk-2KHFSSFZ.cjs.map → chunk-DBJZF2OV.cjs.map} +1 -1
- package/dist/{chunk-4DYXV3E7.cjs → chunk-DEAWHNYW.cjs} +1177 -1223
- package/dist/chunk-DEAWHNYW.cjs.map +1 -0
- package/dist/{chunk-WU6PMH5L.cjs → chunk-E6RCVOQG.cjs} +41 -43
- package/dist/chunk-E6RCVOQG.cjs.map +1 -0
- package/dist/{chunk-FLIWL6V4.js → chunk-EINXNG5D.js} +4 -4
- package/dist/{chunk-OPSZNW3I.js → chunk-EKWPIEHH.js} +3031 -3077
- package/dist/chunk-EKWPIEHH.js.map +1 -0
- package/dist/{chunk-N5MCKGAB.js → chunk-FDHKJJPK.js} +34 -33
- package/dist/{chunk-N5MCKGAB.js.map → chunk-FDHKJJPK.js.map} +1 -1
- package/dist/{chunk-BSOHVQ7X.js → chunk-GHWOQUB4.js} +366 -391
- package/dist/chunk-GHWOQUB4.js.map +1 -0
- package/dist/{chunk-T7AJBKZP.cjs → chunk-GVSTRN36.cjs} +5 -2
- package/dist/chunk-GVSTRN36.cjs.map +1 -0
- package/dist/{chunk-L4LAAA5Q.js → chunk-IMNGGLKL.js} +5 -2
- package/dist/chunk-IMNGGLKL.js.map +1 -0
- package/dist/{chunk-VASNLWPZ.js → chunk-NY7OG2OJ.js} +5 -7
- package/dist/{chunk-VASNLWPZ.js.map → chunk-NY7OG2OJ.js.map} +1 -1
- package/dist/{chunk-5QJQAFTP.cjs → chunk-OKDCUJOZ.cjs} +48 -12
- package/dist/chunk-OKDCUJOZ.cjs.map +1 -0
- package/dist/{chunk-MEAR2WHS.cjs → chunk-PC7YOZ4I.cjs} +1 -1
- package/dist/chunk-PC7YOZ4I.cjs.map +1 -0
- package/dist/{chunk-QLWBBCI5.cjs → chunk-Q2ITV3NY.cjs} +5 -4
- package/dist/chunk-Q2ITV3NY.cjs.map +1 -0
- package/dist/chunk-RGALV4UX.js +433 -0
- package/dist/chunk-RGALV4UX.js.map +1 -0
- package/dist/{chunk-W5KBDFCR.cjs → chunk-SA4ZTD3G.cjs} +30 -30
- package/dist/{chunk-W5KBDFCR.cjs.map → chunk-SA4ZTD3G.cjs.map} +1 -1
- package/dist/{chunk-GL5X6VVC.js → chunk-T4XXYAYY.js} +4 -4
- package/dist/{chunk-ZMFT5XOB.js → chunk-UXJCZOLA.js} +4 -3
- package/dist/chunk-UXJCZOLA.js.map +1 -0
- package/dist/{chunk-7NJUPRN6.cjs → chunk-XCPBD2PG.cjs} +183 -208
- package/dist/chunk-XCPBD2PG.cjs.map +1 -0
- package/dist/chunk-ZSUNQJRO.cjs +433 -0
- package/dist/chunk-ZSUNQJRO.cjs.map +1 -0
- package/dist/components/chat/chat-message-row.d.ts +1 -1
- package/dist/components/chat/chat-message-row.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +10 -11
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.js +12 -13
- package/dist/components/contact/index.cjs +7 -9
- package/dist/components/contact/index.cjs.map +1 -1
- package/dist/components/contact/index.js +6 -8
- package/dist/components/faq/faq-document-page.d.ts +21 -0
- package/dist/components/faq/faq-document-page.d.ts.map +1 -0
- package/dist/components/faq/index.cjs +22 -5
- package/dist/components/faq/index.cjs.map +1 -1
- package/dist/components/faq/index.d.ts +1 -0
- package/dist/components/faq/index.d.ts.map +1 -1
- package/dist/components/faq/index.js +21 -4
- package/dist/components/features/index.cjs +6 -8
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +5 -7
- package/dist/components/index.cjs +304 -309
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +249 -254
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/article-detail-layout.d.ts +21 -9
- package/dist/components/layout/article-detail-layout.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +6 -8
- package/dist/components/navigation/index.cjs.map +1 -1
- package/dist/components/navigation/index.js +5 -7
- package/dist/components/onboarding-guides/index.cjs +33 -46
- package/dist/components/onboarding-guides/index.cjs.map +1 -1
- package/dist/components/onboarding-guides/index.js +11 -24
- package/dist/components/onboarding-guides/index.js.map +1 -1
- package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts.map +1 -1
- package/dist/components/related-content/index.cjs +8 -10
- package/dist/components/related-content/index.cjs.map +1 -1
- package/dist/components/related-content/index.js +7 -9
- package/dist/components/shared/delivery/delivery-lists.d.ts.map +1 -1
- package/dist/components/shared/detail-page-skeleton.d.ts +6 -1
- package/dist/components/shared/detail-page-skeleton.d.ts.map +1 -1
- package/dist/components/shared/legal-document/use-legal-docs.d.ts.map +1 -1
- package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
- package/dist/components/shared/roadmap/roadmap-grid.d.ts.map +1 -1
- package/dist/components/shared/roadmap/use-roadmap-voting.d.ts.map +1 -1
- package/dist/components/tickets/help-center-list.d.ts +9 -1
- package/dist/components/tickets/help-center-list.d.ts.map +1 -1
- package/dist/components/tickets/hooks/use-ticket-actions.d.ts.map +1 -1
- package/dist/components/tickets/hooks/use-ticket-engagements.d.ts.map +1 -1
- package/dist/components/tickets/hooks/use-tickets-list.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +81 -76
- package/dist/components/tickets/index.cjs.map +1 -1
- package/dist/components/tickets/index.js +27 -22
- package/dist/components/tickets/index.js.map +1 -1
- package/dist/components/ui/index.cjs +12 -15
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +24 -27
- package/dist/contexts/chat-runtime-context.d.ts +9 -0
- package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
- package/dist/contexts/index.cjs +2 -2
- package/dist/contexts/index.js +1 -1
- package/dist/hooks/index.cjs +3 -3
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/use-contact-submission.d.ts.map +1 -1
- package/dist/hooks/use-self-fetch.d.ts.map +1 -1
- package/dist/index.cjs +11 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -36
- package/dist/utils/embed-authed-fetch.d.ts +7 -0
- package/dist/utils/embed-authed-fetch.d.ts.map +1 -1
- package/dist/utils/embed-content-fetch.d.ts +2 -0
- package/dist/utils/embed-content-fetch.d.ts.map +1 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/chat-message-row.tsx +12 -2
- package/src/components/faq/faq-document-page.tsx +69 -0
- package/src/components/faq/index.ts +1 -0
- package/src/components/layout/article-detail-layout.tsx +24 -11
- package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +21 -16
- package/src/components/shared/delivery/delivery-lists.tsx +3 -2
- package/src/components/shared/detail-page-skeleton.tsx +18 -10
- package/src/components/shared/legal-document/use-legal-docs.ts +2 -1
- package/src/components/shared/product-release/release-detail-page.tsx +27 -17
- package/src/components/shared/roadmap/roadmap-grid.tsx +2 -1
- package/src/components/shared/roadmap/use-roadmap-voting.ts +3 -2
- package/src/components/tickets/help-center-list.tsx +12 -4
- package/src/components/tickets/hooks/use-ticket-actions.ts +7 -2
- package/src/components/tickets/hooks/use-ticket-engagements.ts +6 -1
- package/src/components/tickets/hooks/use-tickets-list.ts +7 -1
- package/src/components/tickets/ticket-detail-drawer.tsx +1 -0
- package/src/contexts/chat-runtime-context.tsx +9 -0
- package/src/hooks/use-contact-submission.ts +2 -1
- package/src/hooks/use-self-fetch.ts +2 -1
- package/src/styles/index.css +1 -0
- package/src/styles/ods-page-shell.css +29 -0
- package/src/utils/embed-authed-fetch.ts +10 -0
- package/src/utils/embed-content-fetch.ts +30 -0
- package/dist/chunk-4DYXV3E7.cjs.map +0 -1
- package/dist/chunk-4YKGXZ7W.js.map +0 -1
- package/dist/chunk-5QJQAFTP.cjs.map +0 -1
- package/dist/chunk-722TTRIJ.cjs +0 -29
- package/dist/chunk-722TTRIJ.cjs.map +0 -1
- package/dist/chunk-7NJUPRN6.cjs.map +0 -1
- package/dist/chunk-BSOHVQ7X.js.map +0 -1
- package/dist/chunk-CYMMGPPV.js.map +0 -1
- package/dist/chunk-DAAFVOTL.cjs +0 -172
- package/dist/chunk-DAAFVOTL.cjs.map +0 -1
- package/dist/chunk-L4LAAA5Q.js.map +0 -1
- package/dist/chunk-MEAR2WHS.cjs.map +0 -1
- package/dist/chunk-OO4ZGDRO.js +0 -29
- package/dist/chunk-OO4ZGDRO.js.map +0 -1
- package/dist/chunk-OPSZNW3I.js.map +0 -1
- package/dist/chunk-QLWBBCI5.cjs.map +0 -1
- package/dist/chunk-T2URJAX2.js +0 -169
- package/dist/chunk-T2URJAX2.js.map +0 -1
- package/dist/chunk-T7AJBKZP.cjs.map +0 -1
- package/dist/chunk-WU6PMH5L.cjs.map +0 -1
- package/dist/chunk-XDGDCO3I.cjs.map +0 -1
- package/dist/chunk-Y2B6WDU6.cjs +0 -169
- package/dist/chunk-Y2B6WDU6.cjs.map +0 -1
- package/dist/chunk-ZMFT5XOB.js.map +0 -1
- package/dist/chunk-ZXZJSTNV.js +0 -172
- package/dist/chunk-ZXZJSTNV.js.map +0 -1
- /package/dist/{chunk-FLIWL6V4.js.map → chunk-EINXNG5D.js.map} +0 -0
- /package/dist/{chunk-GL5X6VVC.js.map → chunk-T4XXYAYY.js.map} +0 -0
|
@@ -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"
|
|
@@ -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
|
|
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
|
|
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) {
|
package/src/styles/index.css
CHANGED
|
@@ -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
|
+
}
|