@flamingo-stack/openframe-frontend-core 0.0.693 → 0.0.694-2513.7695.1

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 (165) hide show
  1. package/dist/{chunk-GDZ7IC5B.js → chunk-234IIQIS.js} +2 -2
  2. package/dist/{chunk-DVEFZ5DU.cjs → chunk-2EQED5SZ.cjs} +34 -34
  3. package/dist/{chunk-DVEFZ5DU.cjs.map → chunk-2EQED5SZ.cjs.map} +1 -1
  4. package/dist/{chunk-JUNOY5HK.js → chunk-2HX6AADM.js} +15 -17
  5. package/dist/chunk-2HX6AADM.js.map +1 -0
  6. package/dist/{chunk-EZFSUHNP.js → chunk-33L2IR62.js} +3 -3
  7. package/dist/{chunk-TFSRPBVT.js → chunk-42LIHMRA.js} +4 -4
  8. package/dist/{chunk-MIZU2OTO.cjs → chunk-63BLVGXZ.cjs} +4 -4
  9. package/dist/{chunk-MIZU2OTO.cjs.map → chunk-63BLVGXZ.cjs.map} +1 -1
  10. package/dist/{chunk-BFV4L3D7.js → chunk-6ZSDKDOV.js} +8 -8
  11. package/dist/{chunk-UVUNBXS6.js → chunk-7IINE3MK.js} +48 -5
  12. package/dist/chunk-7IINE3MK.js.map +1 -0
  13. package/dist/{chunk-N3526CTH.cjs → chunk-7TO3CWPM.cjs} +3 -3
  14. package/dist/{chunk-N3526CTH.cjs.map → chunk-7TO3CWPM.cjs.map} +1 -1
  15. package/dist/{chunk-WJAMBSMW.js → chunk-7VO6NC67.js} +4 -4
  16. package/dist/{chunk-SC44YJCF.js → chunk-A7RKT5SO.js} +2 -2
  17. package/dist/{chunk-ID5QPM3X.js → chunk-BW6YBATM.js} +102 -69
  18. package/dist/chunk-BW6YBATM.js.map +1 -0
  19. package/dist/{chunk-CMA74BXW.cjs → chunk-C27F6GBZ.cjs} +751 -718
  20. package/dist/{chunk-CMA74BXW.cjs.map → chunk-C27F6GBZ.cjs.map} +1 -1
  21. package/dist/{chunk-DVSPRY2V.cjs → chunk-ESMDIJIN.cjs} +3 -3
  22. package/dist/{chunk-DVSPRY2V.cjs.map → chunk-ESMDIJIN.cjs.map} +1 -1
  23. package/dist/{chunk-FMPH6G3E.cjs → chunk-FNGX5WZM.cjs} +497 -474
  24. package/dist/chunk-FNGX5WZM.cjs.map +1 -0
  25. package/dist/{chunk-5NUOZZRR.js → chunk-GWQCUC53.js} +4 -4
  26. package/dist/{chunk-XI2BAIKJ.js → chunk-HBMGSGZY.js} +6 -6
  27. package/dist/{chunk-HM7ZGABI.js → chunk-HEBLLLLD.js} +2 -2
  28. package/dist/{chunk-HRGG56GC.cjs → chunk-HJZ3UTUE.cjs} +83 -83
  29. package/dist/{chunk-HRGG56GC.cjs.map → chunk-HJZ3UTUE.cjs.map} +1 -1
  30. package/dist/{chunk-3HGVRJTC.cjs → chunk-JB25CCOB.cjs} +47 -47
  31. package/dist/{chunk-3HGVRJTC.cjs.map → chunk-JB25CCOB.cjs.map} +1 -1
  32. package/dist/{chunk-BDGNKIHU.cjs → chunk-JISKS7RJ.cjs} +26 -26
  33. package/dist/{chunk-BDGNKIHU.cjs.map → chunk-JISKS7RJ.cjs.map} +1 -1
  34. package/dist/{chunk-DDCQG3WO.cjs → chunk-K5GSLGV2.cjs} +18 -18
  35. package/dist/{chunk-DDCQG3WO.cjs.map → chunk-K5GSLGV2.cjs.map} +1 -1
  36. package/dist/{chunk-SG57SBYG.cjs → chunk-K5K2FRQK.cjs} +19 -19
  37. package/dist/{chunk-SG57SBYG.cjs.map → chunk-K5K2FRQK.cjs.map} +1 -1
  38. package/dist/{chunk-WSYCPIRG.cjs → chunk-KBSL4FCL.cjs} +9 -9
  39. package/dist/{chunk-WSYCPIRG.cjs.map → chunk-KBSL4FCL.cjs.map} +1 -1
  40. package/dist/{chunk-SDORFSFK.cjs → chunk-KDUDL4PB.cjs} +37 -37
  41. package/dist/{chunk-SDORFSFK.cjs.map → chunk-KDUDL4PB.cjs.map} +1 -1
  42. package/dist/{chunk-RKIMG67Q.cjs → chunk-KJHIFF6H.cjs} +16 -16
  43. package/dist/{chunk-RKIMG67Q.cjs.map → chunk-KJHIFF6H.cjs.map} +1 -1
  44. package/dist/{chunk-QDH62H4N.js → chunk-LHYOESIQ.js} +4 -4
  45. package/dist/{chunk-6H5PPQWP.cjs → chunk-LPFU6U7O.cjs} +5 -5
  46. package/dist/{chunk-6H5PPQWP.cjs.map → chunk-LPFU6U7O.cjs.map} +1 -1
  47. package/dist/{chunk-I72FRMF6.js → chunk-N7HFUBOV.js} +3 -3
  48. package/dist/{chunk-53O6PQ3F.cjs → chunk-NDLFK57D.cjs} +7 -7
  49. package/dist/{chunk-53O6PQ3F.cjs.map → chunk-NDLFK57D.cjs.map} +1 -1
  50. package/dist/{chunk-XWAT6ZP5.js → chunk-O4RDXDVS.js} +12 -12
  51. package/dist/{chunk-4KM5MVBM.cjs → chunk-Q2B2MGFU.cjs} +7 -7
  52. package/dist/{chunk-4KM5MVBM.cjs.map → chunk-Q2B2MGFU.cjs.map} +1 -1
  53. package/dist/{chunk-5CZZ4JLE.js → chunk-QP54LMXJ.js} +38 -15
  54. package/dist/{chunk-5CZZ4JLE.js.map → chunk-QP54LMXJ.js.map} +1 -1
  55. package/dist/{chunk-QRA2JXE4.cjs → chunk-RE6PGOSS.cjs} +6 -8
  56. package/dist/chunk-RE6PGOSS.cjs.map +1 -0
  57. package/dist/{chunk-C2SVJVEB.js → chunk-SH5GPYSV.js} +2 -2
  58. package/dist/{chunk-UWJZRI5J.cjs → chunk-SJFB4Z4L.cjs} +105 -105
  59. package/dist/{chunk-UWJZRI5J.cjs.map → chunk-SJFB4Z4L.cjs.map} +1 -1
  60. package/dist/{chunk-7EPGJOKN.js → chunk-TA3JJFEO.js} +4 -4
  61. package/dist/{chunk-PPRD3PTW.js → chunk-TBR3UTFY.js} +6 -6
  62. package/dist/{chunk-USKQURNF.cjs → chunk-TG3VBMDG.cjs} +3 -3
  63. package/dist/{chunk-USKQURNF.cjs.map → chunk-TG3VBMDG.cjs.map} +1 -1
  64. package/dist/{chunk-F2ZBNRTF.js → chunk-TV5SZJ3N.js} +12 -12
  65. package/dist/{chunk-GVMVPMDE.js → chunk-TXSQLORA.js} +6 -6
  66. package/dist/{chunk-INVP4WLX.js → chunk-UCXZRJIE.js} +7 -7
  67. package/dist/{chunk-I27PWVWE.cjs → chunk-WT4HURQN.cjs} +46 -3
  68. package/dist/chunk-WT4HURQN.cjs.map +1 -0
  69. package/dist/{chunk-XAOAYDGR.js → chunk-WZJWIZVH.js} +4 -4
  70. package/dist/{chunk-IC2SDW6U.js → chunk-XKNKGBUX.js} +10 -8
  71. package/dist/{chunk-IC2SDW6U.js.map → chunk-XKNKGBUX.js.map} +1 -1
  72. package/dist/{chunk-LNKLB7GM.cjs → chunk-XNTQHC26.cjs} +28 -28
  73. package/dist/{chunk-LNKLB7GM.cjs.map → chunk-XNTQHC26.cjs.map} +1 -1
  74. package/dist/{chunk-2YVTGPM7.js → chunk-XZILGCXJ.js} +2 -2
  75. package/dist/{chunk-JAQK3GQJ.cjs → chunk-Y5AFMYYN.cjs} +46 -44
  76. package/dist/chunk-Y5AFMYYN.cjs.map +1 -0
  77. package/dist/{chunk-7BC3NJAV.cjs → chunk-ZCPMWXIB.cjs} +25 -25
  78. package/dist/{chunk-7BC3NJAV.cjs.map → chunk-ZCPMWXIB.cjs.map} +1 -1
  79. package/dist/{chunk-S54QA2VE.cjs → chunk-ZUGAHQDB.cjs} +7 -7
  80. package/dist/{chunk-S54QA2VE.cjs.map → chunk-ZUGAHQDB.cjs.map} +1 -1
  81. package/dist/components/case-studies/index.cjs +21 -21
  82. package/dist/components/case-studies/index.js +8 -8
  83. package/dist/components/chat/chat-message-list.d.ts.map +1 -1
  84. package/dist/components/chat/chat-typing-indicator.d.ts.map +1 -1
  85. package/dist/components/chat/cycling-phrase.d.ts.map +1 -1
  86. package/dist/components/chat/index.cjs +5 -5
  87. package/dist/components/chat/index.js +4 -4
  88. package/dist/components/contact/index.cjs +9 -9
  89. package/dist/components/contact/index.js +8 -8
  90. package/dist/components/docs/index.cjs +12 -12
  91. package/dist/components/docs/index.js +11 -11
  92. package/dist/components/embeds/index.cjs +9 -9
  93. package/dist/components/embeds/index.js +8 -8
  94. package/dist/components/faq/index.cjs +10 -10
  95. package/dist/components/faq/index.js +9 -9
  96. package/dist/components/features/index.cjs +8 -8
  97. package/dist/components/features/index.js +7 -7
  98. package/dist/components/help-center-pages/index.cjs +107 -107
  99. package/dist/components/help-center-pages/index.js +22 -22
  100. package/dist/components/index.cjs +69 -69
  101. package/dist/components/index.js +22 -22
  102. package/dist/components/meeting-scheduler/index.cjs +59 -59
  103. package/dist/components/meeting-scheduler/index.js +9 -9
  104. package/dist/components/navigation/app-layout-drawer.d.ts.map +1 -1
  105. package/dist/components/navigation/index.cjs +11 -11
  106. package/dist/components/navigation/index.js +10 -10
  107. package/dist/components/onboarding-guides/index.cjs +12 -12
  108. package/dist/components/onboarding-guides/index.js +11 -11
  109. package/dist/components/related-content/index.cjs +6 -6
  110. package/dist/components/related-content/index.js +5 -5
  111. package/dist/components/tickets/index.cjs +13 -13
  112. package/dist/components/tickets/index.js +12 -12
  113. package/dist/components/ui/index.cjs +8 -8
  114. package/dist/components/ui/index.js +7 -7
  115. package/dist/components/ui/markdown/engine.d.ts +0 -21
  116. package/dist/components/ui/markdown/engine.d.ts.map +1 -1
  117. package/dist/hooks/index.cjs +6 -6
  118. package/dist/hooks/index.cjs.map +1 -1
  119. package/dist/hooks/index.js +5 -5
  120. package/dist/hooks/use-authed-asset-src.d.ts.map +1 -1
  121. package/dist/index.cjs +15 -15
  122. package/dist/index.cjs.map +1 -1
  123. package/dist/index.js +12 -12
  124. package/dist/tailwind.config.cjs +14 -1
  125. package/dist/tailwind.config.cjs.map +1 -1
  126. package/dist/tailwind.config.js +14 -1
  127. package/dist/tailwind.config.js.map +1 -1
  128. package/package.json +1 -1
  129. package/src/components/chat/chat-message-enhanced.tsx +1 -1
  130. package/src/components/chat/chat-message-list.tsx +55 -14
  131. package/src/components/chat/chat-typing-indicator.tsx +18 -29
  132. package/src/components/chat/cycling-phrase.tsx +1 -11
  133. package/src/components/chat/embeddable-chat.tsx +9 -6
  134. package/src/components/navigation/app-layout-drawer.tsx +53 -7
  135. package/src/components/ui/__tests__/__snapshots__/markdown-parity.test.tsx.snap +29 -29
  136. package/src/components/ui/markdown/engine.tsx +56 -12
  137. package/src/hooks/use-authed-asset-src.ts +58 -6
  138. package/tailwind.config.ts +13 -0
  139. package/dist/chunk-FMPH6G3E.cjs.map +0 -1
  140. package/dist/chunk-I27PWVWE.cjs.map +0 -1
  141. package/dist/chunk-ID5QPM3X.js.map +0 -1
  142. package/dist/chunk-JAQK3GQJ.cjs.map +0 -1
  143. package/dist/chunk-JUNOY5HK.js.map +0 -1
  144. package/dist/chunk-QRA2JXE4.cjs.map +0 -1
  145. package/dist/chunk-UVUNBXS6.js.map +0 -1
  146. /package/dist/{chunk-GDZ7IC5B.js.map → chunk-234IIQIS.js.map} +0 -0
  147. /package/dist/{chunk-EZFSUHNP.js.map → chunk-33L2IR62.js.map} +0 -0
  148. /package/dist/{chunk-TFSRPBVT.js.map → chunk-42LIHMRA.js.map} +0 -0
  149. /package/dist/{chunk-BFV4L3D7.js.map → chunk-6ZSDKDOV.js.map} +0 -0
  150. /package/dist/{chunk-WJAMBSMW.js.map → chunk-7VO6NC67.js.map} +0 -0
  151. /package/dist/{chunk-SC44YJCF.js.map → chunk-A7RKT5SO.js.map} +0 -0
  152. /package/dist/{chunk-5NUOZZRR.js.map → chunk-GWQCUC53.js.map} +0 -0
  153. /package/dist/{chunk-XI2BAIKJ.js.map → chunk-HBMGSGZY.js.map} +0 -0
  154. /package/dist/{chunk-HM7ZGABI.js.map → chunk-HEBLLLLD.js.map} +0 -0
  155. /package/dist/{chunk-QDH62H4N.js.map → chunk-LHYOESIQ.js.map} +0 -0
  156. /package/dist/{chunk-I72FRMF6.js.map → chunk-N7HFUBOV.js.map} +0 -0
  157. /package/dist/{chunk-XWAT6ZP5.js.map → chunk-O4RDXDVS.js.map} +0 -0
  158. /package/dist/{chunk-C2SVJVEB.js.map → chunk-SH5GPYSV.js.map} +0 -0
  159. /package/dist/{chunk-7EPGJOKN.js.map → chunk-TA3JJFEO.js.map} +0 -0
  160. /package/dist/{chunk-PPRD3PTW.js.map → chunk-TBR3UTFY.js.map} +0 -0
  161. /package/dist/{chunk-F2ZBNRTF.js.map → chunk-TV5SZJ3N.js.map} +0 -0
  162. /package/dist/{chunk-GVMVPMDE.js.map → chunk-TXSQLORA.js.map} +0 -0
  163. /package/dist/{chunk-INVP4WLX.js.map → chunk-UCXZRJIE.js.map} +0 -0
  164. /package/dist/{chunk-XAOAYDGR.js.map → chunk-WZJWIZVH.js.map} +0 -0
  165. /package/dist/{chunk-2YVTGPM7.js.map → chunk-XZILGCXJ.js.map} +0 -0
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { useEffect, useReducer } from 'react';
4
4
  import { embedAuthedFetch, needsBearerAssetFetch } from '../utils/embed-authed-fetch';
5
+ import { useIsomorphicLayoutEffect } from './ui/use-isomorphic-layout-effect';
5
6
 
6
7
  /**
7
8
  * Resolve ANY asset URL the browser would load natively — `<img src>`,
@@ -21,18 +22,56 @@ import { embedAuthedFetch, needsBearerAssetFetch } from '../utils/embed-authed-f
21
22
  * callers show their existing placeholder / "no captions" branch instead of a
22
23
  * broken asset; a failed fetch retries on the next mount.
23
24
  *
24
- * Cache: module-level, session-lifetime, keyed by full URL — so the two
25
- * `<track>` URLs of one player, or the same avatar in twenty rows, cost one
26
- * request. Gateway URLs carry a `?v=<content-hash>` cache-buster, so changed
27
- * content is a new key; entries are never revoked (a VTT / avatar is a few KB
28
- * — refcount churn isn't worth it) and are dropped wholesale at session end
29
- * via `clearAuthedAssetCache`.
25
+ * Cache: module-level, keyed by full URL — so the two `<track>` URLs of one
26
+ * player, or the same avatar in twenty rows, cost one request. Gateway URLs
27
+ * carry a `?v=<content-hash>` cache-buster, so changed content is a new key.
28
+ * Entries are reference-counted by the mounted hooks using them and revoked
29
+ * RELEASE_DELAY_MS after the last one unmounts (a remount inside that window
30
+ * keeps the blob). They used to live for the whole session, and chat images,
31
+ * org logos and avatars are not "a few KB": in a desktop shell open for days
32
+ * every distinct image ever shown stayed in memory. `clearAuthedAssetCache`
33
+ * still drops everything at session end.
30
34
  */
31
35
 
32
36
  const resolvedCache = new Map<string, string>();
33
37
  const inFlight = new Map<string, Promise<void>>();
34
38
  let cacheGeneration = 0;
35
39
 
40
+ /** How long an unused blob is kept before it is revoked, in ms. */
41
+ const RELEASE_DELAY_MS = 60_000;
42
+ const refCounts = new Map<string, number>();
43
+ const releaseTimers = new Map<string, ReturnType<typeof setTimeout>>();
44
+
45
+ function scheduleRelease(src: string): void {
46
+ clearTimeout(releaseTimers.get(src));
47
+ releaseTimers.set(
48
+ src,
49
+ setTimeout(() => {
50
+ releaseTimers.delete(src);
51
+ if (refCounts.has(src)) return;
52
+ const blobUrl = resolvedCache.get(src);
53
+ if (blobUrl) URL.revokeObjectURL(blobUrl);
54
+ resolvedCache.delete(src);
55
+ }, RELEASE_DELAY_MS),
56
+ );
57
+ }
58
+
59
+ function acquire(src: string): void {
60
+ clearTimeout(releaseTimers.get(src));
61
+ releaseTimers.delete(src);
62
+ refCounts.set(src, (refCounts.get(src) ?? 0) + 1);
63
+ }
64
+
65
+ function release(src: string): void {
66
+ const remaining = (refCounts.get(src) ?? 1) - 1;
67
+ if (remaining > 0) {
68
+ refCounts.set(src, remaining);
69
+ return;
70
+ }
71
+ refCounts.delete(src);
72
+ scheduleRelease(src);
73
+ }
74
+
36
75
  /**
37
76
  * Drop every cached blob and revoke its object URL. Hosts call this at
38
77
  * session end (logout / forced re-login) so a follow-on login as a
@@ -45,6 +84,8 @@ export function clearAuthedAssetCache(): void {
45
84
  for (const url of resolvedCache.values()) URL.revokeObjectURL(url);
46
85
  resolvedCache.clear();
47
86
  inFlight.clear();
87
+ for (const timer of releaseTimers.values()) clearTimeout(timer);
88
+ releaseTimers.clear();
48
89
  }
49
90
 
50
91
  function fetchAsBlobUrl(src: string, accept: string): Promise<void> {
@@ -57,6 +98,8 @@ function fetchAsBlobUrl(src: string, accept: string): Promise<void> {
57
98
  const blobUrl = URL.createObjectURL(await response.blob());
58
99
  if (startedGeneration === cacheGeneration) {
59
100
  resolvedCache.set(src, blobUrl);
101
+ // Everyone who asked for it unmounted while it was loading.
102
+ if (!refCounts.has(src)) scheduleRelease(src);
60
103
  } else {
61
104
  URL.revokeObjectURL(blobUrl);
62
105
  }
@@ -79,6 +122,15 @@ export function useAuthedAssetSrc(src?: string | null, accept = '*/*'): string |
79
122
  const bearerSrc = src && needsBearerAssetFetch(src) ? src : null;
80
123
  const [, rerender] = useReducer((c: number) => c + 1, 0);
81
124
 
125
+ // Layout, not passive: this render hands out the cached blob URL, and a
126
+ // release timer firing before a passive effect ran would revoke it under
127
+ // the committed <img>.
128
+ useIsomorphicLayoutEffect(() => {
129
+ if (!bearerSrc) return undefined;
130
+ acquire(bearerSrc);
131
+ return () => release(bearerSrc);
132
+ }, [bearerSrc]);
133
+
82
134
  useEffect(() => {
83
135
  if (!bearerSrc || resolvedCache.has(bearerSrc)) return undefined;
84
136
  let cancelled = false;
@@ -402,11 +402,24 @@ const config: Config = {
402
402
  from: { opacity: '0' },
403
403
  to: { opacity: '1' },
404
404
  },
405
+ // Chat streaming affordances. Defined here, not in an inline <style>
406
+ // the component renders: those tags were rewritten on every render,
407
+ // i.e. every streamed chunk, and each rewrite made WebKit restyle and
408
+ // relayout the whole document.
409
+ 'cursor-blink': {
410
+ '50%': { opacity: '0' },
411
+ },
412
+ 'dot-pulse': {
413
+ '0%, 80%, 100%': { transform: 'scale(1)', opacity: '0.7' },
414
+ '40%': { transform: 'scale(1.5)', opacity: '1' },
415
+ },
405
416
  },
406
417
  animation: {
407
418
  'accordion-down': 'accordion-down 0.2s ease-out',
408
419
  'accordion-up': 'accordion-up 0.2s ease-out',
409
420
  'fade-in': 'fade-in 0.3s ease-out',
421
+ 'cursor-blink': 'cursor-blink 1s steps(1) infinite',
422
+ 'dot-pulse': 'dot-pulse 1.4s ease-in-out infinite',
410
423
  },
411
424
  },
412
425
  },