@flamingo-stack/openframe-frontend-core 0.0.678-snapshot.20260928203735 → 0.0.678

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 (101) hide show
  1. package/dist/{chunk-UAPSU6YW.cjs → chunk-2752B3YY.cjs} +3 -3
  2. package/dist/{chunk-UAPSU6YW.cjs.map → chunk-2752B3YY.cjs.map} +1 -1
  3. package/dist/{chunk-6LN7ZNHT.js → chunk-33HTSSCG.js} +3 -3
  4. package/dist/{chunk-HLMMG6Q7.js → chunk-7IYDTCKE.js} +5 -5
  5. package/dist/{chunk-HA3SBMR2.cjs → chunk-CPJ7QBIV.cjs} +4 -4
  6. package/dist/{chunk-HA3SBMR2.cjs.map → chunk-CPJ7QBIV.cjs.map} +1 -1
  7. package/dist/{chunk-UKZAW4FE.js → chunk-CUGM36ZU.js} +3 -3
  8. package/dist/{chunk-FUBOKAYO.js → chunk-D5FLAQQH.js} +5 -5
  9. package/dist/{chunk-KNPUHPIF.cjs → chunk-DZR47TRO.cjs} +33 -33
  10. package/dist/{chunk-KNPUHPIF.cjs.map → chunk-DZR47TRO.cjs.map} +1 -1
  11. package/dist/{chunk-2YMFBKYR.js → chunk-EPH3FGIF.js} +3 -3
  12. package/dist/{chunk-ZRN244JV.js → chunk-EWNKYH2D.js} +2 -2
  13. package/dist/{chunk-25Y3UR3R.cjs → chunk-EXQPK67M.cjs} +10 -10
  14. package/dist/{chunk-25Y3UR3R.cjs.map → chunk-EXQPK67M.cjs.map} +1 -1
  15. package/dist/{chunk-QU7SDFKO.cjs → chunk-FBQSQRUY.cjs} +71 -71
  16. package/dist/{chunk-QU7SDFKO.cjs.map → chunk-FBQSQRUY.cjs.map} +1 -1
  17. package/dist/{chunk-ZB34GLOZ.cjs → chunk-G4EXCWR4.cjs} +45 -45
  18. package/dist/{chunk-ZB34GLOZ.cjs.map → chunk-G4EXCWR4.cjs.map} +1 -1
  19. package/dist/{chunk-ICGGFQQU.js → chunk-GNOCB662.js} +4 -4
  20. package/dist/{chunk-H27EHTLX.cjs → chunk-GPSL3KFX.cjs} +3 -3
  21. package/dist/{chunk-H27EHTLX.cjs.map → chunk-GPSL3KFX.cjs.map} +1 -1
  22. package/dist/{chunk-FQDHQNSU.js → chunk-HEPOYA2M.js} +10 -31
  23. package/dist/{chunk-FQDHQNSU.js.map → chunk-HEPOYA2M.js.map} +1 -1
  24. package/dist/{chunk-NQCID4VF.js → chunk-J7VFEMTJ.js} +6 -6
  25. package/dist/{chunk-T7GIFC5Y.cjs → chunk-JHSDZI3D.cjs} +10 -31
  26. package/dist/chunk-JHSDZI3D.cjs.map +1 -0
  27. package/dist/{chunk-TKL5JKZS.cjs → chunk-K7YEA2LO.cjs} +10 -10
  28. package/dist/{chunk-TKL5JKZS.cjs.map → chunk-K7YEA2LO.cjs.map} +1 -1
  29. package/dist/{chunk-GZIYE35W.cjs → chunk-L3O2HPOO.cjs} +15 -15
  30. package/dist/{chunk-GZIYE35W.cjs.map → chunk-L3O2HPOO.cjs.map} +1 -1
  31. package/dist/{chunk-4ZKZSWX4.js → chunk-MB5JXDJK.js} +3 -3
  32. package/dist/{chunk-XSSYG7KU.js → chunk-MP2UTOLN.js} +5 -5
  33. package/dist/{chunk-L4NLXAET.js → chunk-N4HJDYMG.js} +2 -2
  34. package/dist/{chunk-HTNUTEXN.cjs → chunk-OAS4JLF4.cjs} +22 -22
  35. package/dist/{chunk-HTNUTEXN.cjs.map → chunk-OAS4JLF4.cjs.map} +1 -1
  36. package/dist/{chunk-RJYYGWJL.cjs → chunk-R5B4T26B.cjs} +22 -22
  37. package/dist/{chunk-RJYYGWJL.cjs.map → chunk-R5B4T26B.cjs.map} +1 -1
  38. package/dist/{chunk-CY3XHQM3.cjs → chunk-RBBFGN6B.cjs} +5 -5
  39. package/dist/{chunk-CY3XHQM3.cjs.map → chunk-RBBFGN6B.cjs.map} +1 -1
  40. package/dist/{chunk-3LW6AJMJ.cjs → chunk-RI44VAGW.cjs} +338 -338
  41. package/dist/{chunk-3LW6AJMJ.cjs.map → chunk-RI44VAGW.cjs.map} +1 -1
  42. package/dist/{chunk-7WGUMITJ.js → chunk-S3NK47ZJ.js} +2 -2
  43. package/dist/{chunk-EEL4RGHX.js → chunk-STVG6WV4.js} +2 -2
  44. package/dist/{chunk-MGSWL3L3.cjs → chunk-THWEZULI.cjs} +26 -26
  45. package/dist/{chunk-MGSWL3L3.cjs.map → chunk-THWEZULI.cjs.map} +1 -1
  46. package/dist/{chunk-CDMZOXS7.js → chunk-UBAXZQKE.js} +3 -3
  47. package/dist/{chunk-IPZCEAAH.js → chunk-X2ORWRBO.js} +2 -2
  48. package/dist/{chunk-CGYFCEHM.cjs → chunk-XZG2NZLL.cjs} +10 -10
  49. package/dist/{chunk-CGYFCEHM.cjs.map → chunk-XZG2NZLL.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.map +1 -1
  53. package/dist/components/chat/hooks/use-chat-attachments.d.ts.map +1 -1
  54. package/dist/components/chat/index.cjs +2 -2
  55. package/dist/components/chat/index.js +1 -1
  56. package/dist/components/contact/index.cjs +4 -4
  57. package/dist/components/contact/index.js +3 -3
  58. package/dist/components/docs/index.cjs +7 -7
  59. package/dist/components/docs/index.js +6 -6
  60. package/dist/components/embeds/index.cjs +4 -4
  61. package/dist/components/embeds/index.js +3 -3
  62. package/dist/components/faq/index.cjs +4 -4
  63. package/dist/components/faq/index.js +3 -3
  64. package/dist/components/features/index.cjs +3 -3
  65. package/dist/components/features/index.js +2 -2
  66. package/dist/components/help-center-pages/index.cjs +73 -73
  67. package/dist/components/help-center-pages/index.js +14 -14
  68. package/dist/components/index.cjs +39 -39
  69. package/dist/components/index.js +13 -13
  70. package/dist/components/meeting-scheduler/index.cjs +25 -25
  71. package/dist/components/meeting-scheduler/index.js +2 -2
  72. package/dist/components/navigation/index.cjs +6 -6
  73. package/dist/components/navigation/index.js +5 -5
  74. package/dist/components/onboarding-guides/index.cjs +6 -6
  75. package/dist/components/onboarding-guides/index.js +5 -5
  76. package/dist/components/tickets/index.cjs +7 -7
  77. package/dist/components/tickets/index.js +6 -6
  78. package/dist/components/ui/index.cjs +3 -3
  79. package/dist/components/ui/index.js +2 -2
  80. package/dist/index.cjs +7 -7
  81. package/dist/index.js +6 -6
  82. package/package.json +1 -1
  83. package/src/components/chat/embeddable-chat.tsx +18 -63
  84. package/src/components/chat/hooks/use-chat-attachments.ts +1 -4
  85. package/dist/chunk-T7GIFC5Y.cjs.map +0 -1
  86. package/src/components/chat/__tests__/embeddable-chat-composer-scope.test.tsx +0 -234
  87. /package/dist/{chunk-6LN7ZNHT.js.map → chunk-33HTSSCG.js.map} +0 -0
  88. /package/dist/{chunk-HLMMG6Q7.js.map → chunk-7IYDTCKE.js.map} +0 -0
  89. /package/dist/{chunk-UKZAW4FE.js.map → chunk-CUGM36ZU.js.map} +0 -0
  90. /package/dist/{chunk-FUBOKAYO.js.map → chunk-D5FLAQQH.js.map} +0 -0
  91. /package/dist/{chunk-2YMFBKYR.js.map → chunk-EPH3FGIF.js.map} +0 -0
  92. /package/dist/{chunk-ZRN244JV.js.map → chunk-EWNKYH2D.js.map} +0 -0
  93. /package/dist/{chunk-ICGGFQQU.js.map → chunk-GNOCB662.js.map} +0 -0
  94. /package/dist/{chunk-NQCID4VF.js.map → chunk-J7VFEMTJ.js.map} +0 -0
  95. /package/dist/{chunk-4ZKZSWX4.js.map → chunk-MB5JXDJK.js.map} +0 -0
  96. /package/dist/{chunk-XSSYG7KU.js.map → chunk-MP2UTOLN.js.map} +0 -0
  97. /package/dist/{chunk-L4NLXAET.js.map → chunk-N4HJDYMG.js.map} +0 -0
  98. /package/dist/{chunk-7WGUMITJ.js.map → chunk-S3NK47ZJ.js.map} +0 -0
  99. /package/dist/{chunk-EEL4RGHX.js.map → chunk-STVG6WV4.js.map} +0 -0
  100. /package/dist/{chunk-CDMZOXS7.js.map → chunk-UBAXZQKE.js.map} +0 -0
  101. /package/dist/{chunk-IPZCEAAH.js.map → chunk-X2ORWRBO.js.map} +0 -0
@@ -95,11 +95,7 @@ import { SourceActionButton } from './source-action-button';
95
95
  import type { ChatInputRef, SlashCommandActionId } from './types/component.types';
96
96
  import type { ChatContextItem, ChatContextPickerConfig } from './types/context-item.types';
97
97
  import type { MessageSegment, Message } from './types/message.types';
98
- import type {
99
- ChatDialogCapabilities,
100
- UnifiedChatState,
101
- UnifiedSendMessageOptions,
102
- } from './types/unified-chat-state.types';
98
+ import type { ChatDialogCapabilities, UnifiedChatState } from './types/unified-chat-state.types';
103
99
  import { formatChatAttachmentMarkdownForBubble } from './utils/chat-attachment-markdown';
104
100
  import { resolveHrefForRuntime } from './utils/chat-nav-resolution';
105
101
  import { chatChipClass } from './utils/chip-styles';
@@ -1219,7 +1215,7 @@ function EmbeddableChatInner({
1219
1215
  const {
1220
1216
  messages: rawMessages,
1221
1217
  isLoading: chatLoading,
1222
- sendMessage: sendMessageRaw,
1218
+ sendMessage,
1223
1219
  discussRef,
1224
1220
  stopMessage,
1225
1221
  clearMessages,
@@ -1261,29 +1257,6 @@ function EmbeddableChatInner({
1261
1257
  // adapters already know whether they own a list. Absent = single-thread.
1262
1258
  const historyListMode = dialogCapabilities !== undefined;
1263
1259
 
1264
- // A send from the new-chat surface asks the host to create the dialog, and
1265
- // the id the panel then lands on is THIS conversation being named — not the
1266
- // user leaving it. The editor stays typable while the first turn streams, so
1267
- // a follow-up already being typed has to survive that transition; the
1268
- // composer-scope reset below reads this flag to tell the two apart. Armed in
1269
- // the send's own event (one batch with the composer's own clear, so it is
1270
- // set by the render the id lands in) and dropped once the send settles either
1271
- // way: a create that failed would otherwise leave it armed for the next real
1272
- // switch. Every send path goes through here — the composer, a clarification
1273
- // card, a quick-action chip, the Guide launcher prompt.
1274
- const [namingNewChat, setNamingNewChat] = useState(false);
1275
- const sendMessage = useCallback(
1276
- async (text: string, options?: UnifiedSendMessageOptions) => {
1277
- if (activeDialogId == null) setNamingNewChat(true);
1278
- try {
1279
- return await sendMessageRaw(text, options);
1280
- } finally {
1281
- setNamingNewChat(false);
1282
- }
1283
- },
1284
- [activeDialogId, sendMessageRaw],
1285
- );
1286
-
1287
1260
  // Non-optional view of the same object for the JSX below. `canRename` /
1288
1261
  // `canArchive` default OFF: the ⋯ menu must never advertise an action
1289
1262
  // nothing has wired.
@@ -1360,42 +1333,25 @@ function EmbeddableChatInner({
1360
1333
  // Source of truth = the input text — deleting a token's chip drops its item.
1361
1334
  const mentionKeysRef = useRef<Set<string>>(new Set());
1362
1335
 
1363
- // The composer belongs to the conversation on screen. Leaving it — another
1364
- // dialog opened from the list, a notification or a link, back to the list, a
1365
- // new chat, the Mingo ⇄ Guide toggle — drops everything unsent: the draft
1366
- // text (and with it the slash-command menu that text keeps open), the staged
1367
- // context chips and the `@` / `+` picker, and the staged uploads. Nothing
1368
- // typed for one conversation may bleed into another — or into a Guide send,
1369
- // where the SSE transport silently drops `contextItems`. Mirrors the
1370
- // post-send reset in `handleSend`.
1371
- // The draft lives in an UNCONTROLLED contenteditable, so it is dropped the
1372
- // React way: `composerKey` remounts the composer subtree, in the same commit
1373
- // the new conversation renders in. An effect-time `clear()` painted one frame
1374
- // of the old draft — menu open — under the new conversation, and so did
1375
- // clearing the chips from an effect. So the STATE halves are adjusted while
1376
- // rendering (React's documented pattern for a reset the render already has
1377
- // the answer to); the ref and attachment bookkeeping stays in an effect: a ref
1378
- // must not be written during render, and aborting uploads is a side effect.
1379
- // The one id change that is NOT a switch: `null → id` while a send from the
1380
- // new-chat surface is naming it (`namingNewChat` above).
1381
- const scopeDialogId = activeDialogId ?? null;
1382
- const [composerScope, setComposerScope] = useState({ dialogId: scopeDialogId, mode: activeMode });
1383
- const [composerKey, setComposerKey] = useState(0);
1384
- if (composerScope.dialogId !== scopeDialogId || composerScope.mode !== activeMode) {
1385
- const named =
1386
- namingNewChat && composerScope.dialogId == null && scopeDialogId != null && composerScope.mode === activeMode;
1387
- setComposerScope({ dialogId: scopeDialogId, mode: activeMode });
1388
- if (!named) {
1389
- setComposerKey(k => k + 1);
1390
- setContextItems(NO_CONTEXT_ITEMS);
1391
- setContextPickerOpen(false);
1392
- setMentionQuery(null);
1393
- }
1336
+ // Staged picker selection is per-conversation and Mingo-only. Clear it (and the
1337
+ // mention bookkeeping) whenever the active dialog changes or the mode toggles,
1338
+ // so unsent chips can't bleed into another conversation — or into a Guide send,
1339
+ // where the SSE transport silently drops `contextItems`. Mirrors the post-send
1340
+ // reset in `handleSend`.
1341
+ // The two STATE halves are adjusted while rendering (React's documented
1342
+ // pattern for a reset the render already has the answer to) — the composer
1343
+ // draws its chips from `contextItems`, so clearing from an effect committed
1344
+ // one frame of the previous conversation's chips under the new one. The ref
1345
+ // bookkeeping stays in an effect: a ref must not be written during render.
1346
+ const [contextClearedFor, setContextClearedFor] = useState({ activeDialogId, activeMode });
1347
+ if (contextClearedFor.activeDialogId !== activeDialogId || contextClearedFor.activeMode !== activeMode) {
1348
+ setContextClearedFor({ activeDialogId, activeMode });
1349
+ setContextItems(NO_CONTEXT_ITEMS);
1350
+ setMentionQuery(null);
1394
1351
  }
1395
1352
  useEffect(() => {
1396
1353
  mentionKeysRef.current.clear();
1397
- clearAttachments();
1398
- }, [composerKey, clearAttachments]);
1354
+ }, [activeDialogId, activeMode]);
1399
1355
 
1400
1356
  // Map each entity type to its backend mention marker (host-declared on the
1401
1357
  // entity type). Drives the committed `@marker:id` token; missing markers fall
@@ -2705,7 +2661,6 @@ function EmbeddableChatInner({
2705
2661
  />
2706
2662
 
2707
2663
  <ChatComposer
2708
- key={composerKey}
2709
2664
  archived={isViewingArchived}
2710
2665
  lock={composerLock}
2711
2666
  inputRef={chatInputRef}
@@ -204,10 +204,7 @@ export function useChatAttachments(): UseChatAttachmentsApi {
204
204
  const clear = useCallback(() => {
205
205
  for (const ctrl of controllersRef.current.values()) ctrl.abort();
206
206
  controllersRef.current.clear();
207
- // Same array back when there is nothing staged, so React bails out of the
208
- // update: the composer-scope effect calls this on mount and on every
209
- // conversation switch, and an empty strip must not cost a render.
210
- setAttachments(prev => (prev.length === 0 ? prev : []));
207
+ setAttachments([]);
211
208
  }, []);
212
209
 
213
210
  const uploadOne = useCallback(