@flamingo-stack/openframe-frontend-core 0.0.710 → 0.0.711

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 (75) hide show
  1. package/dist/{chunk-36BCTE7D.js → chunk-2JTGK64G.js} +4 -4
  2. package/dist/{chunk-YBUT4AMG.cjs → chunk-3UNL26CD.cjs} +2 -2
  3. package/dist/{chunk-4L6XCMOU.js → chunk-5HB7FLCV.js} +1 -1
  4. package/dist/{chunk-6IW7TWPV.js → chunk-62KNLDXK.js} +1 -1
  5. package/dist/{chunk-AOWDNSTM.cjs → chunk-6AMIRXKM.cjs} +40 -40
  6. package/dist/{chunk-LNW45N2C.js → chunk-6GLQLTJI.js} +5 -5
  7. package/dist/{chunk-QAOFMK2A.cjs → chunk-6K7QZDA6.cjs} +3 -3
  8. package/dist/{chunk-SEXWHIMS.cjs → chunk-7AM6C6XH.cjs} +42 -37
  9. package/dist/{chunk-CNWOMQQJ.js → chunk-AGDVEUVL.js} +1 -1
  10. package/dist/{chunk-3AHTOSXJ.cjs → chunk-C4HRRB3V.cjs} +9 -9
  11. package/dist/{chunk-NSGXARGJ.cjs → chunk-CDM7OSFB.cjs} +70 -70
  12. package/dist/{chunk-4UM2ETLM.js → chunk-EQWD4IJE.js} +2 -2
  13. package/dist/{chunk-6I4ZAFO2.cjs → chunk-EX6GGCAC.cjs} +9 -9
  14. package/dist/{chunk-L6Y6OOKG.cjs → chunk-FEMAJES4.cjs} +20 -20
  15. package/dist/{chunk-P42V6N34.cjs → chunk-FYOKS5RI.cjs} +313 -313
  16. package/dist/{chunk-B73373AG.cjs → chunk-G47AP6LX.cjs} +20 -20
  17. package/dist/{chunk-I3ST4PLM.js → chunk-IFWLJ66M.js} +1 -1
  18. package/dist/{chunk-F5FF4DME.js → chunk-K4PTDK34.js} +3 -3
  19. package/dist/{chunk-ZCLBYT2V.cjs → chunk-K6Y5NX6L.cjs} +24 -24
  20. package/dist/{chunk-6YKAT7NV.js → chunk-NF7GNGYG.js} +2 -2
  21. package/dist/{chunk-2G7UYK35.cjs → chunk-P6G3JZNC.cjs} +32 -32
  22. package/dist/{chunk-JRU2CXLB.cjs → chunk-PRX7HVLE.cjs} +2 -2
  23. package/dist/{chunk-CZSZSDD4.js → chunk-Q6B35Y7O.js} +4 -4
  24. package/dist/{chunk-2KXTOP6G.cjs → chunk-QA6TROME.cjs} +14 -14
  25. package/dist/{chunk-LFFB6EMB.js → chunk-QGZPZ3RL.js} +2 -2
  26. package/dist/{chunk-PO33GZVY.js → chunk-SMAAV3HL.js} +8 -3
  27. package/dist/{chunk-DA5UDTLG.js → chunk-TKZXHVBG.js} +2 -2
  28. package/dist/{chunk-SS5MBHDP.js → chunk-VMMHJFHG.js} +2 -2
  29. package/dist/{chunk-MR3A4MZV.js → chunk-VWFZRMQR.js} +1 -1
  30. package/dist/{chunk-TDYIREDJ.js → chunk-WJUIXU6Y.js} +4 -4
  31. package/dist/{chunk-2RNB5DTN.cjs → chunk-XWEBHS7O.cjs} +7 -7
  32. package/dist/{chunk-OJLR5MEO.cjs → chunk-YD4LJZV4.cjs} +4 -4
  33. package/dist/components/case-studies/index.cjs +14 -14
  34. package/dist/components/case-studies/index.js +3 -3
  35. package/dist/components/chat/hooks/use-chat-dialog-manager.d.ts +4 -1
  36. package/dist/components/chat/hooks/use-chat-dialog-manager.d.ts.map +1 -1
  37. package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -1
  38. package/dist/components/chat/index.cjs +2 -2
  39. package/dist/components/chat/index.js +1 -1
  40. package/dist/components/chat/types/component.types.d.ts +4 -0
  41. package/dist/components/chat/types/component.types.d.ts.map +1 -1
  42. package/dist/components/chat/types/unified-chat-state.types.d.ts +12 -0
  43. package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
  44. package/dist/components/contact/index.cjs +4 -4
  45. package/dist/components/contact/index.js +3 -3
  46. package/dist/components/docs/index.cjs +7 -7
  47. package/dist/components/docs/index.js +6 -6
  48. package/dist/components/embeds/index.cjs +4 -4
  49. package/dist/components/embeds/index.js +3 -3
  50. package/dist/components/faq/index.cjs +4 -4
  51. package/dist/components/faq/index.js +3 -3
  52. package/dist/components/features/index.cjs +3 -3
  53. package/dist/components/features/index.js +2 -2
  54. package/dist/components/help-center-pages/index.cjs +70 -70
  55. package/dist/components/help-center-pages/index.js +14 -14
  56. package/dist/components/index.cjs +36 -36
  57. package/dist/components/index.js +13 -13
  58. package/dist/components/meeting-scheduler/index.cjs +25 -25
  59. package/dist/components/meeting-scheduler/index.js +2 -2
  60. package/dist/components/navigation/index.cjs +6 -6
  61. package/dist/components/navigation/index.js +5 -5
  62. package/dist/components/onboarding-guides/index.cjs +6 -6
  63. package/dist/components/onboarding-guides/index.js +5 -5
  64. package/dist/components/tickets/index.cjs +7 -7
  65. package/dist/components/tickets/index.js +6 -6
  66. package/dist/components/ui/index.cjs +3 -3
  67. package/dist/components/ui/index.js +2 -2
  68. package/dist/index.cjs +7 -7
  69. package/dist/index.js +6 -6
  70. package/package.json +1 -1
  71. package/src/components/chat/embeddable-chat.tsx +2 -0
  72. package/src/components/chat/hooks/use-chat-dialog-manager.ts +22 -4
  73. package/src/components/chat/hooks/use-unified-chat.ts +1 -0
  74. package/src/components/chat/types/component.types.ts +4 -0
  75. package/src/components/chat/types/unified-chat-state.types.ts +13 -0
@@ -1300,6 +1300,7 @@ function EmbeddableChatInner({
1300
1300
  // ─── Dialog management (Mingo-mode inline history) ───
1301
1301
  dialogs,
1302
1302
  activeDialogId,
1303
+ activeDialog: hostActiveDialog,
1303
1304
  selectDialog,
1304
1305
  renameDialog,
1305
1306
  archiveDialog,
@@ -1819,6 +1820,7 @@ function EmbeddableChatInner({
1819
1820
  } = useChatDialogManager({
1820
1821
  dialogs,
1821
1822
  activeDialogId,
1823
+ activeDialog: hostActiveDialog,
1822
1824
  selectDialog,
1823
1825
  clearMessages,
1824
1826
  renameDialog,
@@ -9,6 +9,9 @@ export interface UseChatDialogManagerArgs {
9
9
  dialogs: ReadonlyArray<DialogItem>;
10
10
  /** Currently-open dialog id. */
11
11
  activeDialogId: string | null | undefined;
12
+ /** The host's own record of the open conversation (`UnifiedChatState.activeDialog`):
13
+ * resolves a conversation that is not in `dialogs`, and says when it is archived. */
14
+ activeDialog?: DialogItem | null;
12
15
  /** Open a dialog by id. */
13
16
  selectDialog: (id: string | null) => void;
14
17
  /** Reset the open conversation (drops back to the list / empty state). */
@@ -37,6 +40,7 @@ export interface UseChatDialogManagerArgs {
37
40
  export function useChatDialogManager({
38
41
  dialogs,
39
42
  activeDialogId,
43
+ activeDialog: hostActiveDialog,
40
44
  selectDialog,
41
45
  clearMessages,
42
46
  renameDialog,
@@ -196,7 +200,18 @@ export function useChatDialogManager({
196
200
  setRestoreTarget(null);
197
201
  }, [restoreTarget, unarchiveDialog]);
198
202
 
199
- const isViewingArchived = viewingArchivedId != null && viewingArchivedId === activeDialogId;
203
+ // The host's record of the open conversation - only when it is about THIS
204
+ // conversation: a host may hand over the previous dialog's record for a
205
+ // render while the new one loads.
206
+ const hostDialog = hostActiveDialog != null && hostActiveDialog.id === activeDialogId ? hostActiveDialog : undefined;
207
+
208
+ // Read-only when the conversation was opened from the archive page, OR when
209
+ // the host's record says it is archived. The click is the only signal this
210
+ // panel has, and a conversation that arrived by link, notification or reload
211
+ // was never clicked here: without the host's record it opened writable and
212
+ // the backend refused the message.
213
+ const isViewingArchived =
214
+ (viewingArchivedId != null && viewingArchivedId === activeDialogId) || hostDialog?.archived === true;
200
215
 
201
216
  // Header back-chevron: from an archived chat, return to the Chat Archive
202
217
  // page (not the current-chats list); otherwise reset to the list.
@@ -228,10 +243,13 @@ export function useChatDialogManager({
228
243
 
229
244
  // Active-conversation dialog — resolved from the active list, or the
230
245
  // archived list when an archived chat is open (archived dialogs aren't in
231
- // `dialogs`, so the header title and ⋯ / restore actions need this).
246
+ // `dialogs`, so the header title and ⋯ / restore actions need this), or the
247
+ // host's record when it is in neither: reached by link, notification or
248
+ // reload, where no list was clicked.
232
249
  const activeDialog = useMemo(
233
- () => dialogs.find(d => d.id === activeDialogId) ?? archivedDialogs.find(d => d.id === activeDialogId),
234
- [dialogs, archivedDialogs, activeDialogId],
250
+ () =>
251
+ dialogs.find(d => d.id === activeDialogId) ?? archivedDialogs.find(d => d.id === activeDialogId) ?? hostDialog,
252
+ [dialogs, archivedDialogs, activeDialogId, hostDialog],
235
253
  );
236
254
 
237
255
  return {
@@ -230,6 +230,7 @@ export function useUnifiedChat(options: UseUnifiedChatOptions): UnifiedChatState
230
230
  // Dialog management (forwarded from active adapter)
231
231
  dialogs: activeState.dialogs,
232
232
  activeDialogId: activeState.activeDialogId,
233
+ activeDialog: activeState.activeDialog,
233
234
  selectDialog,
234
235
  startNewDialog,
235
236
  deleteDialog,
@@ -714,6 +714,10 @@ export interface DialogItem {
714
714
  /** Absolute avatar URL; falls back to initials when absent or failing. */
715
715
  avatarUrl?: string | null;
716
716
  };
717
+ /** The conversation is archived - read-only until restored. Read off
718
+ * `UnifiedChatState.activeDialog`, the host's own record of the open
719
+ * conversation; rows of the active list never carry it. */
720
+ archived?: boolean;
717
721
  }
718
722
 
719
723
  // ========== Chat Sidebar Props ==========
@@ -430,6 +430,19 @@ export interface UnifiedChatState {
430
430
  * (draft state — "start a new conversation"). */
431
431
  activeDialogId: string | null;
432
432
 
433
+ /**
434
+ * The open conversation's own record, when the host resolves one. A
435
+ * conversation reached by link, notification or reload is not necessarily in
436
+ * `dialogs` - it may be archived, or past the pages loaded so far - and
437
+ * without its record the panel has no title, owner or restore action for it,
438
+ * and no way to know it is archived: `archived` on it makes the conversation
439
+ * read-only exactly as opening it from the Chat Archive does. Keyed on `id`:
440
+ * a record for another dialog than `activeDialogId` is ignored. The host
441
+ * keeps it current - once its `unarchiveDialog` resolves, the record must no
442
+ * longer say archived.
443
+ */
444
+ activeDialog?: DialogItem | null;
445
+
433
446
  /** Switch the panel to an existing dialog. Idempotent — selecting the
434
447
  * active id is a no-op. Pass `null` to drop back to draft state. */
435
448
  selectDialog: (id: string | null) => void;