@flamingo-stack/openframe-frontend-core 0.0.210-snapshot.20260528032637 → 0.0.210

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 (72) hide show
  1. package/dist/{chunk-P5EE2VJX.cjs → chunk-6RZYJICV.cjs} +1 -1
  2. package/dist/chunk-6RZYJICV.cjs.map +1 -0
  3. package/dist/{chunk-ZG2YY5E7.js → chunk-7L4DWM7P.js} +1 -1
  4. package/dist/chunk-7L4DWM7P.js.map +1 -0
  5. package/dist/{chunk-QKFBZLIR.js → chunk-ATEUJQKU.js} +2 -2
  6. package/dist/{chunk-VTUIMMHO.cjs → chunk-MDTIOPVS.cjs} +24 -24
  7. package/dist/{chunk-VTUIMMHO.cjs.map → chunk-MDTIOPVS.cjs.map} +1 -1
  8. package/dist/{chunk-3E5ANY55.js → chunk-R5RNRH62.js} +5 -14
  9. package/dist/chunk-R5RNRH62.js.map +1 -0
  10. package/dist/{chunk-WI76ZUBE.cjs → chunk-TWKPYZNQ.cjs} +17 -26
  11. package/dist/chunk-TWKPYZNQ.cjs.map +1 -0
  12. package/dist/{chunk-ZFBLC5GV.cjs → chunk-VBFOCTMD.cjs} +17 -17
  13. package/dist/{chunk-ZFBLC5GV.cjs.map → chunk-VBFOCTMD.cjs.map} +1 -1
  14. package/dist/{chunk-5BNWGK6D.js → chunk-WJBPLMBX.js} +2 -2
  15. package/dist/components/chat/hooks/use-chat-identity.d.ts +3 -3
  16. package/dist/components/chat/hooks/use-chat-identity.d.ts.map +1 -1
  17. package/dist/components/chat/index.cjs +3 -3
  18. package/dist/components/chat/index.js +2 -2
  19. package/dist/components/contact/index.cjs +4 -4
  20. package/dist/components/contact/index.js +3 -3
  21. package/dist/components/features/index.cjs +3 -3
  22. package/dist/components/features/index.js +2 -2
  23. package/dist/components/footer-waitlist-button.d.ts +2 -21
  24. package/dist/components/footer-waitlist-button.d.ts.map +1 -1
  25. package/dist/components/index.cjs +91 -87
  26. package/dist/components/index.cjs.map +1 -1
  27. package/dist/components/index.js +16 -12
  28. package/dist/components/index.js.map +1 -1
  29. package/dist/components/navigation/index.cjs +3 -3
  30. package/dist/components/navigation/index.js +2 -2
  31. package/dist/components/navigation/sticky-section-nav.d.ts.map +1 -1
  32. package/dist/components/tickets/help-center-card.d.ts.map +1 -1
  33. package/dist/components/tickets/index.cjs +98 -139
  34. package/dist/components/tickets/index.cjs.map +1 -1
  35. package/dist/components/tickets/index.js +54 -95
  36. package/dist/components/tickets/index.js.map +1 -1
  37. package/dist/components/tickets/ticket-row.d.ts.map +1 -1
  38. package/dist/components/ui/index.cjs +3 -3
  39. package/dist/components/ui/index.js +2 -2
  40. package/dist/contexts/chat-runtime-context.d.ts +3 -6
  41. package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
  42. package/dist/contexts/index.cjs +2 -2
  43. package/dist/contexts/index.js +1 -1
  44. package/dist/index.cjs +3 -5
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.js +2 -4
  47. package/dist/utils/index.cjs +0 -10
  48. package/dist/utils/index.cjs.map +1 -1
  49. package/dist/utils/index.d.ts +0 -1
  50. package/dist/utils/index.d.ts.map +1 -1
  51. package/dist/utils/index.js +1 -10
  52. package/dist/utils/index.js.map +1 -1
  53. package/package.json +1 -1
  54. package/src/components/chat/hooks/use-chat-identity.ts +7 -8
  55. package/src/components/footer-waitlist-button.tsx +16 -33
  56. package/src/components/navigation/sticky-section-nav.tsx +4 -6
  57. package/src/components/tickets/help-center-card.tsx +1 -55
  58. package/src/components/tickets/help-center-list.tsx +1 -9
  59. package/src/components/tickets/ticket-detail-drawer.tsx +4 -19
  60. package/src/components/tickets/ticket-row.tsx +19 -30
  61. package/src/contexts/chat-runtime-context.tsx +3 -6
  62. package/src/stories/EmbeddableChat.stories.tsx +1 -1
  63. package/src/utils/index.ts +0 -12
  64. package/dist/chunk-3E5ANY55.js.map +0 -1
  65. package/dist/chunk-P5EE2VJX.cjs.map +0 -1
  66. package/dist/chunk-WI76ZUBE.cjs.map +0 -1
  67. package/dist/chunk-ZG2YY5E7.js.map +0 -1
  68. package/dist/utils/scroll-into-view.d.ts +0 -63
  69. package/dist/utils/scroll-into-view.d.ts.map +0 -1
  70. package/src/utils/scroll-into-view.ts +0 -74
  71. /package/dist/{chunk-QKFBZLIR.js.map → chunk-ATEUJQKU.js.map} +0 -0
  72. /package/dist/{chunk-5BNWGK6D.js.map → chunk-WJBPLMBX.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-P5EE2VJX.cjs","../src/contexts/chat-runtime-context.tsx"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACiCA,8BAA0D;AAiGnD,IAAM,mBAAA,EAAqB,kCAAA,IAAsC,CAAA;AAQjE,SAAS,cAAA,CAAA,EAAqC;AACnD,EAAA,OAAO,+BAAA,kBAA6B,CAAA;AACtC;AAUO,SAAS,sBAAA,CAAA,EAAsC;AACpD,EAAA,MAAM,EAAA,EAAI,+BAAA,kBAA6B,CAAA;AACvC,EAAA,GAAA,CAAI,CAAC,CAAA,EAAG;AACN,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,IAMF,CAAA;AAAA,EACF;AACA,EAAA,OAAO,CAAA;AACT;ADpJA;AACA;AACE;AACA;AACA;AACF,kJAAC","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-P5EE2VJX.cjs","sourcesContent":[null,"'use client'\n\n/**\n * Chat runtime context — single seam for embedding the chat panel in a\n * different host (e.g. user1.openframe.ai reverse-proxying API calls\n * under /api/mingo-guide/* to hub.openframe.ai/api/*).\n *\n * Three concerns, one context:\n * 1. API endpoints: chatStreamUrl / approvalToolUrl / commandsUrl /\n * buildListUrl + attachment endpoints + chat-identity. The chat\n * reads them from runtime; hub vs embedded app supply different\n * strings via different providers.\n * 2. Navigation mode + callbacks: 'host' or 'embed' mode. Host wires\n * its own router/docNav via the optional `navigate` callback\n * (plain function, NOT a hook); embed forces new-tab via\n * `defaultContentOrigin` + lib's `resolveExternalNavigation`.\n * 3. Identity context: only `source` (required for localStorage\n * namespacing). The display identity (greeting first-name etc.)\n * comes from the server via `useChatIdentity()` — never injected\n * client-side, so it always matches the server-resolved auth.\n *\n * Sibling of EndpointsRuntimeContext (announcement bar, contact form,\n * access codes). Each runtime stays an independent React context so\n * embedders can opt into either feature without forcing the other.\n *\n * IMPORTANT for embedders: memoize the value passed to\n * `<ChatRuntimeContext.Provider value={...}>` (e.g. via React.useMemo).\n * Every change to its reference identity invalidates downstream\n * `useMemo` consumers (the chat input's slash-commands binding,\n * useNavLink's embed-resolution memo, useDocChat's streamFn factory).\n * The hub's `<HubRuntimeProvider>` already memoizes correctly with\n * stable deps. Embedded apps that build the value inline on each render\n * will pay an avoidable re-render cost across the entire chat tree.\n */\n\nimport { createContext, useContext, type ReactNode } from 'react'\n\n/**\n * Runtime config consumed by the chat panel.\n */\nexport interface ChatRuntime {\n endpoints: {\n /** POST streaming chat. Hub: '/api/docs/chat'. */\n chatStreamUrl: string\n /** POST agent approve/reject. Hub: '/api/chat/agent/confirm-tool'. */\n approvalToolUrl: string\n /** GET slash-command catalog. Hub: '/api/docs/commands'. */\n commandsUrl: string\n /** Build entity-card list URL for a content type + ids. Hub delegates\n * to the rag-table-config registry; embedded app provides its own\n * per-type URL builder against the reverse proxy. Returns null when\n * the type has no list endpoint (caller skips rendering). */\n buildListUrl: (type: string, ids: string[]) => string | null\n /** Chat-attachment endpoints — added for the v2 attachment feature.\n *\n * Three concerns:\n * - `attachmentUploadUrl` — POSTed by the chat-attachment hook\n * to mint a Supabase signed-upload-URL + HMAC view token.\n * - `attachmentViewUrlPrefix` — embedded in markdown URLs the\n * chat hosts in user message bubbles (`![]()` / `[Attached]`).\n * Stored in chat history; chosen at SEND time. In host mode the\n * relative `/api/storage/view/chat-attachments/` is sufficient\n * (same-origin); embedders supply an absolute hub URL so the\n * browser can fetch cross-origin.\n * - `identityUrl` — GET endpoint the `useChatIdentity` hook\n * hits to learn the `{authTier, source, attachmentsEnabled}`\n * capability bag for the current session. Used beyond chat\n * (tickets / contact form / any embedded surface that needs\n * to identify the proxied customer), so the name has no\n * \"chat\" prefix even though the consuming hook still does. */\n attachmentUploadUrl: string\n attachmentViewUrlPrefix: string\n identityUrl: string\n /** Optional URL prefix for the image proxy (`<prefix>?url=<external>`).\n * When unset, lib's `getProxiedImageUrl` returns the original URL\n * unchanged. Hub default: '/api/image-proxy'. Embedders that don't\n * host an image-proxy route leave this undefined → images load\n * directly cross-origin (CORS-permitting). */\n imageProxyUrlPrefix?: string\n /** Optional list of hostnames that should bypass the image proxy\n * (rendered direct). Hub uses ['openmsp.ai']; embedders typically\n * leave it unset. Matches the `skipDomains` parameter of\n * `getProxiedImageUrl`. */\n imageProxySkipDomains?: string[]\n }\n navigation: {\n /** ONE knob, two behaviors:\n * - 'host' = use the host page's existing click-routing untouched.\n * The chat panel calls `navigate?.()` for in-app routing.\n * - 'embed' = guest inside another app: short-circuit at the top\n * of click handlers to force new-tab + absolutize via\n * resolveExternalNavigation. */\n mode: 'host' | 'embed'\n /** Embed-only fallback origin for relative URLs whose target platform\n * can't be inferred. Used by resolveExternalNavigation when\n * `targetPlatform` is null — without this, a relative `/foo` href would\n * window.open against the embedder's origin, which is WRONG.\n * Set to your content host (e.g. 'https://hub.openframe.ai').\n * Required by the embedded app whenever mode='embed'. */\n defaultContentOrigin?: string\n /** Override for opening external URLs. MUST BE SYNCHRONOUS —\n * Safari/Firefox block popups opened outside a direct user gesture.\n * Default: window.open(href, '_blank', 'noopener,noreferrer'). */\n openExternal?: (href: string) => void\n /** Optional in-app navigation callback (host-mode only).\n * Returns `true` if the host handled the click in-app\n * (router.push + docNav.navigate); returns `false`, `undefined`,\n * or `void` → lib falls back to window.location.assign(href).\n * Hub wires this via HubRuntimeProvider's HubNavigationWiring;\n * embedders not in Next.js leave it undefined. */\n navigate?: (input: { href: string; path?: string | null; targetPlatform?: string | null }) => boolean | void\n /** Optional new-tab decision callback. Returns true → lib opens in\n * new tab; false → same tab via `navigate`. Hub wires the existing\n * `decideNewTab` logic from use-nav-link.tsx (re-imports the pure\n * helper from lib). Embedders may omit; lib defaults to:\n * same-origin/same-platform → same tab, else new tab. */\n decideNewTab?: (args: { href: string; targetPlatform?: string | null }) => boolean\n }\n /** Chat source identifier — REQUIRED. Used for localStorage\n * namespacing (`mingo-chat-<source>-v1`). Hub sets via\n * `currentPlatform()`; embedders set explicitly.\n * `useEmbeddedChat()` throws if source is empty/missing. */\n source: string\n // NOTE: No `user` field. The chat's display identity (greeting\n // first-name, etc.) comes from the SERVER-resolved auth via\n // `useChatIdentity()` — the same identity the server uses to\n // authorize requests. Letting embedders pass a client-side `user`\n // would let it desync from the actual auth tier, causing greetings\n // like \"Hey Bob\" while the server treats the session as\n // alice@example.com. Single source of truth: the server.\n}\n\nexport const ChatRuntimeContext = createContext<ChatRuntime | null>(null)\n\n/**\n * Returns the active runtime, or null when no provider is mounted.\n * NULL is a first-class value — it signals \"no chat runtime configured.\"\n * Optional consumers fall back to no-op behavior; strict consumers\n * use `useRequiredChatRuntime` (below).\n */\nexport function useChatRuntime(): ChatRuntime | null {\n return useContext(ChatRuntimeContext)\n}\n\n/**\n * Strict variant used INSIDE the chat panel. Throws if no provider.\n * The hub guarantees one exists by mounting `<HubRuntimeProvider>` at\n * root; the embedded app mounts its own `<ChatRuntimeContext.Provider>`\n * at the tree root. In Jest / Storybook tests that render chat\n * internals directly, wrap with `<HubRuntimeProvider>` (hub defaults)\n * or supply `<ChatRuntimeContext.Provider value={mockedRuntime}>`.\n */\nexport function useRequiredChatRuntime(): ChatRuntime {\n const v = useContext(ChatRuntimeContext)\n if (!v) {\n throw new Error(\n '[chat-runtime] hook called outside a <ChatRuntimeContext.Provider>. ' +\n 'The hub mounts <HubRuntimeProvider> at root — this only fires when ' +\n 'chat internals are rendered above the provider tree. ' +\n 'Fix: ensure the rendering subtree descends from the runtime provider. ' +\n 'In tests/Storybook: wrap with <HubRuntimeProvider> or supply ' +\n 'a <ChatRuntimeContext.Provider value={mockedRuntime}>.',\n )\n }\n return v\n}\n"]}