@flamingo-stack/openframe-frontend-core 0.0.646-2223.6379.1 → 0.0.646

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 (102) hide show
  1. package/dist/{chunk-5FRPBI4W.cjs → chunk-2V7SCIOG.cjs} +33 -33
  2. package/dist/{chunk-5FRPBI4W.cjs.map → chunk-2V7SCIOG.cjs.map} +1 -1
  3. package/dist/{chunk-BA3AKKBR.js → chunk-4GOJFHJY.js} +2 -2
  4. package/dist/{chunk-27XARNHK.js → chunk-5C7GMRJU.js} +5 -5
  5. package/dist/{chunk-Z33CMA7B.cjs → chunk-5JVN3EVT.cjs} +71 -71
  6. package/dist/{chunk-Z33CMA7B.cjs.map → chunk-5JVN3EVT.cjs.map} +1 -1
  7. package/dist/{chunk-N6UK3OIG.js → chunk-5MZZFTME.js} +5 -5
  8. package/dist/{chunk-3J7YNAYI.cjs → chunk-7UWJMWDH.cjs} +32 -2
  9. package/dist/chunk-7UWJMWDH.cjs.map +1 -0
  10. package/dist/{chunk-WLTWJIXE.cjs → chunk-AYAZU3BO.cjs} +5 -5
  11. package/dist/{chunk-WLTWJIXE.cjs.map → chunk-AYAZU3BO.cjs.map} +1 -1
  12. package/dist/{chunk-QXOPORQZ.cjs → chunk-C6QUB6IS.cjs} +22 -22
  13. package/dist/{chunk-QXOPORQZ.cjs.map → chunk-C6QUB6IS.cjs.map} +1 -1
  14. package/dist/{chunk-X7LGHPH5.js → chunk-DULSS7R6.js} +32 -2
  15. package/dist/{chunk-X7LGHPH5.js.map → chunk-DULSS7R6.js.map} +1 -1
  16. package/dist/{chunk-GMF53HTC.js → chunk-ETEM2ZD4.js} +3 -3
  17. package/dist/{chunk-NPOKQG7G.js → chunk-GBZ3IR3S.js} +2 -2
  18. package/dist/{chunk-7M7Z7ETX.cjs → chunk-H4FQRA5O.cjs} +3 -3
  19. package/dist/{chunk-7M7Z7ETX.cjs.map → chunk-H4FQRA5O.cjs.map} +1 -1
  20. package/dist/{chunk-IFMYWRZM.cjs → chunk-JFBUXYDK.cjs} +15 -15
  21. package/dist/{chunk-IFMYWRZM.cjs.map → chunk-JFBUXYDK.cjs.map} +1 -1
  22. package/dist/{chunk-GOE2OAXW.cjs → chunk-LDJ4TIDC.cjs} +9 -9
  23. package/dist/{chunk-GOE2OAXW.cjs.map → chunk-LDJ4TIDC.cjs.map} +1 -1
  24. package/dist/{chunk-ODHVC24E.js → chunk-LLT5XMP2.js} +3 -3
  25. package/dist/{chunk-J27IFCHW.cjs → chunk-N2E26OD6.cjs} +45 -45
  26. package/dist/{chunk-J27IFCHW.cjs.map → chunk-N2E26OD6.cjs.map} +1 -1
  27. package/dist/{chunk-TW5YFJN4.js → chunk-NKMXFBV5.js} +4 -4
  28. package/dist/{chunk-PFSSUTAP.cjs → chunk-NWYSHZG7.cjs} +22 -22
  29. package/dist/{chunk-PFSSUTAP.cjs.map → chunk-NWYSHZG7.cjs.map} +1 -1
  30. package/dist/{chunk-DKMWLD7A.cjs → chunk-NZ66W56D.cjs} +10 -10
  31. package/dist/{chunk-DKMWLD7A.cjs.map → chunk-NZ66W56D.cjs.map} +1 -1
  32. package/dist/{chunk-XSVEAHHJ.js → chunk-PD47DDHS.js} +3 -3
  33. package/dist/{chunk-L4DWWSBN.js → chunk-QS55P2TA.js} +2 -2
  34. package/dist/{chunk-DKLXPUP7.cjs → chunk-RRSR2XHJ.cjs} +163 -163
  35. package/dist/{chunk-DKLXPUP7.cjs.map → chunk-RRSR2XHJ.cjs.map} +1 -1
  36. package/dist/{chunk-2Q5BWCH7.cjs → chunk-TZO743LD.cjs} +3 -3
  37. package/dist/{chunk-2Q5BWCH7.cjs.map → chunk-TZO743LD.cjs.map} +1 -1
  38. package/dist/{chunk-NTANKYPD.js → chunk-UR7BC74V.js} +3 -3
  39. package/dist/{chunk-LWZHHCQF.cjs → chunk-WJ7PDBPK.cjs} +4 -4
  40. package/dist/{chunk-LWZHHCQF.cjs.map → chunk-WJ7PDBPK.cjs.map} +1 -1
  41. package/dist/{chunk-W4G2GB4N.cjs → chunk-X2VTQ3TL.cjs} +10 -10
  42. package/dist/{chunk-W4G2GB4N.cjs.map → chunk-X2VTQ3TL.cjs.map} +1 -1
  43. package/dist/{chunk-W56OZVQI.js → chunk-XATBOM3X.js} +5 -5
  44. package/dist/{chunk-6JLPGIIH.js → chunk-XJH5M2B7.js} +6 -6
  45. package/dist/{chunk-7GP6WZKN.js → chunk-XPPGI7SD.js} +2 -2
  46. package/dist/{chunk-HNFEWZ26.js → chunk-ZDIDA4QG.js} +2 -2
  47. package/dist/{chunk-GJIUKN73.js → chunk-ZGWXD2S3.js} +3 -3
  48. package/dist/{chunk-WE4IT2AS.cjs → chunk-ZW2BEEX2.cjs} +25 -25
  49. package/dist/{chunk-WE4IT2AS.cjs.map → chunk-ZW2BEEX2.cjs.map} +1 -1
  50. package/dist/components/case-studies/index.cjs +14 -14
  51. package/dist/components/case-studies/index.js +3 -3
  52. package/dist/components/chat/embeddable-chat.d.ts +13 -0
  53. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  54. package/dist/components/chat/index.cjs +2 -2
  55. package/dist/components/chat/index.d.ts +1 -1
  56. package/dist/components/chat/index.d.ts.map +1 -1
  57. package/dist/components/chat/index.js +1 -1
  58. package/dist/components/contact/index.cjs +4 -4
  59. package/dist/components/contact/index.js +3 -3
  60. package/dist/components/docs/index.cjs +7 -7
  61. package/dist/components/docs/index.js +6 -6
  62. package/dist/components/embeds/index.cjs +4 -4
  63. package/dist/components/embeds/index.js +3 -3
  64. package/dist/components/faq/index.cjs +4 -4
  65. package/dist/components/faq/index.js +3 -3
  66. package/dist/components/features/index.cjs +3 -3
  67. package/dist/components/features/index.js +2 -2
  68. package/dist/components/help-center-pages/index.cjs +23 -23
  69. package/dist/components/help-center-pages/index.js +14 -14
  70. package/dist/components/index.cjs +39 -39
  71. package/dist/components/index.js +13 -13
  72. package/dist/components/meeting-scheduler/index.cjs +24 -24
  73. package/dist/components/meeting-scheduler/index.js +2 -2
  74. package/dist/components/navigation/index.cjs +6 -6
  75. package/dist/components/navigation/index.js +5 -5
  76. package/dist/components/onboarding-guides/index.cjs +6 -6
  77. package/dist/components/onboarding-guides/index.js +5 -5
  78. package/dist/components/tickets/index.cjs +7 -7
  79. package/dist/components/tickets/index.js +6 -6
  80. package/dist/components/ui/index.cjs +3 -3
  81. package/dist/components/ui/index.js +2 -2
  82. package/dist/index.cjs +7 -7
  83. package/dist/index.js +6 -6
  84. package/package.json +1 -1
  85. package/src/components/chat/embeddable-chat.tsx +63 -1
  86. package/src/components/chat/index.ts +6 -1
  87. package/dist/chunk-3J7YNAYI.cjs.map +0 -1
  88. /package/dist/{chunk-BA3AKKBR.js.map → chunk-4GOJFHJY.js.map} +0 -0
  89. /package/dist/{chunk-27XARNHK.js.map → chunk-5C7GMRJU.js.map} +0 -0
  90. /package/dist/{chunk-N6UK3OIG.js.map → chunk-5MZZFTME.js.map} +0 -0
  91. /package/dist/{chunk-GMF53HTC.js.map → chunk-ETEM2ZD4.js.map} +0 -0
  92. /package/dist/{chunk-NPOKQG7G.js.map → chunk-GBZ3IR3S.js.map} +0 -0
  93. /package/dist/{chunk-ODHVC24E.js.map → chunk-LLT5XMP2.js.map} +0 -0
  94. /package/dist/{chunk-TW5YFJN4.js.map → chunk-NKMXFBV5.js.map} +0 -0
  95. /package/dist/{chunk-XSVEAHHJ.js.map → chunk-PD47DDHS.js.map} +0 -0
  96. /package/dist/{chunk-L4DWWSBN.js.map → chunk-QS55P2TA.js.map} +0 -0
  97. /package/dist/{chunk-NTANKYPD.js.map → chunk-UR7BC74V.js.map} +0 -0
  98. /package/dist/{chunk-W56OZVQI.js.map → chunk-XATBOM3X.js.map} +0 -0
  99. /package/dist/{chunk-6JLPGIIH.js.map → chunk-XJH5M2B7.js.map} +0 -0
  100. /package/dist/{chunk-7GP6WZKN.js.map → chunk-XPPGI7SD.js.map} +0 -0
  101. /package/dist/{chunk-HNFEWZ26.js.map → chunk-ZDIDA4QG.js.map} +0 -0
  102. /package/dist/{chunk-GJIUKN73.js.map → chunk-ZGWXD2S3.js.map} +0 -0
@@ -882,6 +882,12 @@ function SourceChips({
882
882
  * EmbeddableChat — the floating "Ask AI" button + Mingo chat panel.
883
883
  * Lib-portable port of the hub's `<GlobalAskAI>`.
884
884
  */
885
+ /** What a host hands `EmbeddableChatHandle.prefillDraft`: the composer text plus the context items to attach. */
886
+ export interface ChatPrefillDraft {
887
+ text: string;
888
+ mentions?: ChatContextItem[];
889
+ }
890
+
885
891
  /**
886
892
  * Imperative escape hatch for the ONE thing a host can't express as a prop:
887
893
  * "put the panel on a new chat, now". Everything else the host drives is state
@@ -899,6 +905,14 @@ export interface EmbeddableChatHandle {
899
905
  * the compose flag is inert.
900
906
  */
901
907
  startNewChat: () => void;
908
+ /**
909
+ * A new chat with the composer PREFILLED and nothing sent: the host has a
910
+ * suggested message (e.g. "Fix with Mingo" on an incident) and the user
911
+ * decides whether to send it. `mentions` are attached as context items up
912
+ * front, each committed as an inline `@marker:id` chip exactly as if picked
913
+ * from the `@` picker, and `text` follows them in the draft.
914
+ */
915
+ prefillDraft: (draft: ChatPrefillDraft) => void;
902
916
  }
903
917
 
904
918
  export const EmbeddableChat = React.forwardRef<EmbeddableChatHandle, EmbeddableChatProps>(
@@ -2025,6 +2039,43 @@ function EmbeddableChatInner({
2025
2039
  resetToNewChat();
2026
2040
  }, [resetToNewChat]);
2027
2041
 
2042
+ // Host prefill (`prefillDraft`) — staged, not written at once. The composer
2043
+ // it goes into may only mount on the commit `resetToNewChat` +
2044
+ // `setComposeOpen(true)` produce (narrow layout: list → compose; or the
2045
+ // archive closing), and those are ordinary updates React commits on its own
2046
+ // schedule — a frame-timed write raced them and lost on a phone. So the
2047
+ // draft waits in state: the context strip is seeded while rendering (AFTER
2048
+ // the dialog-change reset above, which would otherwise wipe it), and the
2049
+ // effect writes the chips + text once `chatInputRef` is attached, re-running
2050
+ // on each layout change until it is. `mentionKeysRef` is cleared by the
2051
+ // dialog-change effect above, so this one must stay declared after it.
2052
+ const [pendingDraft, setPendingDraft] = useState<Required<ChatPrefillDraft> | null>(null);
2053
+ const [seededDraft, setSeededDraft] = useState<Required<ChatPrefillDraft> | null>(null);
2054
+ if (pendingDraft && seededDraft !== pendingDraft) {
2055
+ setSeededDraft(pendingDraft);
2056
+ setContextItems(pendingDraft.mentions);
2057
+ }
2058
+ const appliedDraftRef = useRef<Required<ChatPrefillDraft> | null>(null);
2059
+ useEffect(() => {
2060
+ const draft = pendingDraft;
2061
+ if (!draft || appliedDraftRef.current === draft) return;
2062
+ const input = chatInputRef.current;
2063
+ if (!input) return;
2064
+ appliedDraftRef.current = draft;
2065
+ input.clear();
2066
+ for (const item of draft.mentions) {
2067
+ const key = `${item.type}:${item.id}`;
2068
+ input.commitMention(mentionTokenOf(key, mentionMarkerByType), {
2069
+ label: item.label,
2070
+ icon: resolveContextIcon(item),
2071
+ });
2072
+ mentionKeysRef.current.add(key);
2073
+ }
2074
+ // The text starts on its own line — its first line is a heading, not a
2075
+ // continuation of the chip run.
2076
+ if (draft.text) input.setValue(`${input.getValue()}${draft.mentions.length > 0 ? '\n' : ''}${draft.text}`);
2077
+ }, [pendingDraft, composeOpen, activeDialogId, activeMode, archiveOpen, mentionMarkerByType, resolveContextIcon]);
2078
+
2028
2079
  // Host-driven "Start New Chat" (see EmbeddableChatHandle). Same reset as the
2029
2080
  // rail button, plus the narrow layout's list→compose navigation that the
2030
2081
  // in-panel button gets from the list itself — a host has no other way in.
@@ -2035,8 +2086,19 @@ function EmbeddableChatInner({
2035
2086
  resetToNewChat();
2036
2087
  setComposeOpen(true);
2037
2088
  },
2089
+ prefillDraft: ({ text, mentions = [] }) => {
2090
+ resetToNewChat();
2091
+ setComposeOpen(true);
2092
+ // The effect below clears the draft, which invalidates every key held
2093
+ // here. Dropped now rather than there: with no dialog change nothing
2094
+ // else clears them, and a composer mounting on this commit reports
2095
+ // `onValueChange('')` before that effect runs — a stale key equal to
2096
+ // one of the new mentions would strip the freshly seeded item.
2097
+ mentionKeysRef.current.clear();
2098
+ setPendingDraft({ text, mentions: mentions.slice(0, contextMaxItems) });
2099
+ },
2038
2100
  }),
2039
- [resetToNewChat],
2101
+ [resetToNewChat, contextMaxItems],
2040
2102
  );
2041
2103
 
2042
2104
  // Desktop split header ⋯ menu (active, non-archived conversation only).
@@ -84,4 +84,9 @@ export * from './utils';
84
84
  // EmbeddableChat — full chat orchestrator (lib-portable port of hub's
85
85
  // `<GlobalAskAI>`). Hosts mount it once at the root after providing a
86
86
  // <ChatRuntimeContext.Provider>.
87
- export { EmbeddableChat, type EmbeddableChatHandle, type EmbeddableChatProps } from './embeddable-chat';
87
+ export {
88
+ type ChatPrefillDraft,
89
+ EmbeddableChat,
90
+ type EmbeddableChatHandle,
91
+ type EmbeddableChatProps,
92
+ } from './embeddable-chat';