@flamingo-stack/openframe-frontend-core 0.0.503 → 0.0.504-snapshot.20260801181709

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 (191) hide show
  1. package/dist/{chunk-SGWPW2AO.cjs → chunk-2A74VRAF.cjs} +18 -18
  2. package/dist/{chunk-SGWPW2AO.cjs.map → chunk-2A74VRAF.cjs.map} +1 -1
  3. package/dist/{chunk-LILQJ3UZ.cjs → chunk-3ENGUBJP.cjs} +1 -1
  4. package/dist/chunk-3ENGUBJP.cjs.map +1 -0
  5. package/dist/{chunk-AWDHRIL3.cjs → chunk-4ST2BOWJ.cjs} +75 -75
  6. package/dist/{chunk-AWDHRIL3.cjs.map → chunk-4ST2BOWJ.cjs.map} +1 -1
  7. package/dist/{chunk-SFJRMBJC.js → chunk-5SVNA7IU.js} +2 -2
  8. package/dist/{chunk-OAWFYZZT.js → chunk-7DOSAJDK.js} +3 -3
  9. package/dist/{chunk-J4T5ZBWG.cjs → chunk-BZRP54IO.cjs} +19 -19
  10. package/dist/{chunk-J4T5ZBWG.cjs.map → chunk-BZRP54IO.cjs.map} +1 -1
  11. package/dist/{chunk-BZF63JXP.js → chunk-CRJVO4KO.js} +6 -6
  12. package/dist/{chunk-5RIHLXEP.cjs → chunk-DDVQ5NKK.cjs} +33 -33
  13. package/dist/{chunk-5RIHLXEP.cjs.map → chunk-DDVQ5NKK.cjs.map} +1 -1
  14. package/dist/{chunk-HR6F6IP4.js → chunk-DIKJLAMY.js} +78 -43
  15. package/dist/chunk-DIKJLAMY.js.map +1 -0
  16. package/dist/{chunk-VO2ZONMR.js → chunk-FNTFWP2A.js} +3 -3
  17. package/dist/{chunk-2OXJ6NHI.cjs → chunk-GJZ42TTG.cjs} +7 -7
  18. package/dist/{chunk-2OXJ6NHI.cjs.map → chunk-GJZ42TTG.cjs.map} +1 -1
  19. package/dist/{chunk-JIZJDAXI.cjs → chunk-GXRVBKYX.cjs} +12 -12
  20. package/dist/{chunk-JIZJDAXI.cjs.map → chunk-GXRVBKYX.cjs.map} +1 -1
  21. package/dist/{chunk-F7AD5CUU.js → chunk-H3N4P3CG.js} +3 -3
  22. package/dist/chunk-H3N4P3CG.js.map +1 -0
  23. package/dist/{chunk-VCPTU4IW.js → chunk-HWER6KGU.js} +7 -7
  24. package/dist/{chunk-4SR2QHMB.js → chunk-ITVWX5HX.js} +3 -3
  25. package/dist/{chunk-FFXNRJ5S.cjs → chunk-LOBR7IC6.cjs} +6 -6
  26. package/dist/chunk-LOBR7IC6.cjs.map +1 -0
  27. package/dist/{chunk-72DF3QTA.cjs → chunk-MJQ263KS.cjs} +14 -14
  28. package/dist/{chunk-72DF3QTA.cjs.map → chunk-MJQ263KS.cjs.map} +1 -1
  29. package/dist/{chunk-FTOVZ7O2.js → chunk-NPO6CHCR.js} +7 -7
  30. package/dist/{chunk-XV5SXALY.js → chunk-NT5FX7GZ.js} +3 -3
  31. package/dist/{chunk-UCV4LFUG.cjs → chunk-NY75FKN6.cjs} +40 -40
  32. package/dist/{chunk-UCV4LFUG.cjs.map → chunk-NY75FKN6.cjs.map} +1 -1
  33. package/dist/{chunk-4UNQMYP7.cjs → chunk-O32Y4E4R.cjs} +3 -3
  34. package/dist/{chunk-4UNQMYP7.cjs.map → chunk-O32Y4E4R.cjs.map} +1 -1
  35. package/dist/{chunk-CLQEBWV7.js → chunk-QE55ROZW.js} +4 -4
  36. package/dist/{chunk-WHJGRRK2.js → chunk-QW7SW5HY.js} +52 -43
  37. package/dist/chunk-QW7SW5HY.js.map +1 -0
  38. package/dist/{chunk-JGXAVNZQ.js → chunk-R6CKL7IR.js} +2464 -1886
  39. package/dist/chunk-R6CKL7IR.js.map +1 -0
  40. package/dist/{chunk-L5CI57RM.cjs → chunk-T3BF6JTQ.cjs} +52 -43
  41. package/dist/chunk-T3BF6JTQ.cjs.map +1 -0
  42. package/dist/{chunk-G43CEISB.js → chunk-TA3VJ2QO.js} +4 -4
  43. package/dist/{chunk-7L2RVINX.cjs → chunk-TRS4CIAS.cjs} +35 -35
  44. package/dist/{chunk-7L2RVINX.cjs.map → chunk-TRS4CIAS.cjs.map} +1 -1
  45. package/dist/{chunk-DMXB3VE2.cjs → chunk-U3YLML53.cjs} +1837 -1259
  46. package/dist/chunk-U3YLML53.cjs.map +1 -0
  47. package/dist/{chunk-3T4SMJM5.cjs → chunk-VDKNUC3N.cjs} +181 -146
  48. package/dist/chunk-VDKNUC3N.cjs.map +1 -0
  49. package/dist/{chunk-RR3Z52X5.cjs → chunk-W3QCFQ56.cjs} +42 -42
  50. package/dist/{chunk-RR3Z52X5.cjs.map → chunk-W3QCFQ56.cjs.map} +1 -1
  51. package/dist/{chunk-VYEDTVIZ.js → chunk-XJPMTJAR.js} +4 -4
  52. package/dist/{chunk-6GT557KN.js → chunk-XKIA4XVE.js} +1 -1
  53. package/dist/chunk-XKIA4XVE.js.map +1 -0
  54. package/dist/components/case-studies/index.cjs +11 -11
  55. package/dist/components/case-studies/index.js +5 -5
  56. package/dist/components/chat/index.cjs +5 -5
  57. package/dist/components/chat/index.js +4 -4
  58. package/dist/components/contact/index.cjs +6 -6
  59. package/dist/components/contact/index.js +5 -5
  60. package/dist/components/docs/index.cjs +8 -8
  61. package/dist/components/docs/index.js +7 -7
  62. package/dist/components/embeds/index.cjs +6 -6
  63. package/dist/components/embeds/index.js +5 -5
  64. package/dist/components/faq/index.cjs +7 -7
  65. package/dist/components/faq/index.js +6 -6
  66. package/dist/components/features/index.cjs +5 -5
  67. package/dist/components/features/index.js +4 -4
  68. package/dist/components/help-center-pages/index.cjs +24 -24
  69. package/dist/components/help-center-pages/index.js +15 -15
  70. package/dist/components/index.cjs +169 -165
  71. package/dist/components/index.cjs.map +1 -1
  72. package/dist/components/index.js +17 -13
  73. package/dist/components/index.js.map +1 -1
  74. package/dist/components/navigation/app-header.d.ts +8 -0
  75. package/dist/components/navigation/app-header.d.ts.map +1 -1
  76. package/dist/components/navigation/header-button.d.ts +5 -1
  77. package/dist/components/navigation/header-button.d.ts.map +1 -1
  78. package/dist/components/navigation/header.d.ts.map +1 -1
  79. package/dist/components/navigation/index.cjs +9 -5
  80. package/dist/components/navigation/index.cjs.map +1 -1
  81. package/dist/components/navigation/index.d.ts +4 -0
  82. package/dist/components/navigation/index.d.ts.map +1 -1
  83. package/dist/components/navigation/index.js +8 -4
  84. package/dist/components/navigation/mingo-ai-button.d.ts.map +1 -1
  85. package/dist/components/navigation/navigation-sidebar-item.d.ts.map +1 -1
  86. package/dist/components/navigation/ticket-alerts-button.d.ts +29 -0
  87. package/dist/components/navigation/ticket-alerts-button.d.ts.map +1 -0
  88. package/dist/components/navigation/top-navigation.d.ts +5 -1
  89. package/dist/components/navigation/top-navigation.d.ts.map +1 -1
  90. package/dist/components/navigation/unread-dot.d.ts +19 -0
  91. package/dist/components/navigation/unread-dot.d.ts.map +1 -0
  92. package/dist/components/onboarding-guides/index.cjs +9 -9
  93. package/dist/components/onboarding-guides/index.js +8 -8
  94. package/dist/components/related-content/index.cjs +7 -7
  95. package/dist/components/related-content/index.js +6 -6
  96. package/dist/components/tickets/help-center-card.d.ts.map +1 -1
  97. package/dist/components/tickets/hooks/use-ticket-actions.d.ts.map +1 -1
  98. package/dist/components/tickets/hooks/use-ticket-engagements.d.ts +1 -9
  99. package/dist/components/tickets/hooks/use-ticket-engagements.d.ts.map +1 -1
  100. package/dist/components/tickets/hooks/use-tickets-list.d.ts +0 -7
  101. package/dist/components/tickets/hooks/use-tickets-list.d.ts.map +1 -1
  102. package/dist/components/tickets/index.cjs +15 -8
  103. package/dist/components/tickets/index.cjs.map +1 -1
  104. package/dist/components/tickets/index.d.ts +2 -1
  105. package/dist/components/tickets/index.d.ts.map +1 -1
  106. package/dist/components/tickets/index.js +14 -7
  107. package/dist/components/tickets/ticket-detail-drawer.d.ts.map +1 -1
  108. package/dist/components/tickets/ticket-live-provider.d.ts +58 -0
  109. package/dist/components/tickets/ticket-live-provider.d.ts.map +1 -0
  110. package/dist/components/tickets/types.d.ts +58 -11
  111. package/dist/components/tickets/types.d.ts.map +1 -1
  112. package/dist/components/ui/button/button.d.ts +6 -5
  113. package/dist/components/ui/button/button.d.ts.map +1 -1
  114. package/dist/components/ui/file-manager/index.cjs +50 -50
  115. package/dist/components/ui/file-manager/index.js +1 -1
  116. package/dist/components/ui/index.cjs +5 -5
  117. package/dist/components/ui/index.js +4 -4
  118. package/dist/contexts/chat-runtime-context.d.ts +8 -0
  119. package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
  120. package/dist/contexts/index.cjs +2 -2
  121. package/dist/contexts/index.js +1 -1
  122. package/dist/hooks/index.cjs +3 -3
  123. package/dist/hooks/index.js +2 -2
  124. package/dist/hooks/ui/use-header-height.d.ts.map +1 -1
  125. package/dist/index.cjs +11 -5
  126. package/dist/index.cjs.map +1 -1
  127. package/dist/index.js +10 -4
  128. package/dist/types/navigation.d.ts +10 -0
  129. package/dist/types/navigation.d.ts.map +1 -1
  130. package/dist/utils/index.cjs +171 -0
  131. package/dist/utils/index.cjs.map +1 -1
  132. package/dist/utils/index.d.ts +1 -0
  133. package/dist/utils/index.d.ts.map +1 -1
  134. package/dist/utils/index.js +171 -1
  135. package/dist/utils/index.js.map +1 -1
  136. package/dist/utils/sse-subscription.d.ts +60 -0
  137. package/dist/utils/sse-subscription.d.ts.map +1 -0
  138. package/package.json +1 -1
  139. package/src/components/features/time-tracker/time-tracker-header-button.tsx +1 -1
  140. package/src/components/navigation/app-header.tsx +36 -20
  141. package/src/components/navigation/header-button.tsx +18 -2
  142. package/src/components/navigation/header-mingo-button.tsx +2 -2
  143. package/src/components/navigation/header-skeleton.tsx +4 -4
  144. package/src/components/navigation/header.tsx +41 -21
  145. package/src/components/navigation/index.ts +4 -0
  146. package/src/components/navigation/mingo-ai-button.tsx +23 -22
  147. package/src/components/navigation/mobile-burger-menu.tsx +3 -3
  148. package/src/components/navigation/navigation-sidebar-item.tsx +2 -3
  149. package/src/components/navigation/ticket-alerts-button.tsx +61 -0
  150. package/src/components/navigation/top-navigation.tsx +17 -1
  151. package/src/components/navigation/unread-dot.tsx +34 -0
  152. package/src/components/tickets/.types.md +1 -2
  153. package/src/components/tickets/help-center-card.tsx +16 -0
  154. package/src/components/tickets/help-center-list.tsx +6 -6
  155. package/src/components/tickets/hooks/.use-ticket-engagements.md +3 -12
  156. package/src/components/tickets/hooks/.use-tickets-list.md +0 -2
  157. package/src/components/tickets/hooks/use-ticket-actions.ts +9 -0
  158. package/src/components/tickets/hooks/use-ticket-engagements.ts +4 -13
  159. package/src/components/tickets/hooks/use-tickets-list.ts +2 -13
  160. package/src/components/tickets/index.ts +10 -0
  161. package/src/components/tickets/ticket-detail-drawer.tsx +45 -13
  162. package/src/components/tickets/ticket-live-provider.tsx +474 -0
  163. package/src/components/tickets/types.ts +62 -11
  164. package/src/components/ui/button/button.tsx +165 -133
  165. package/src/contexts/chat-runtime-context.tsx +8 -0
  166. package/src/hooks/ui/use-header-height.ts +3 -1
  167. package/src/stories/TopNavigation.stories.tsx +20 -1
  168. package/src/types/navigation.ts +10 -0
  169. package/src/utils/index.ts +12 -0
  170. package/src/utils/sse-subscription.ts +276 -0
  171. package/dist/chunk-3T4SMJM5.cjs.map +0 -1
  172. package/dist/chunk-6GT557KN.js.map +0 -1
  173. package/dist/chunk-DMXB3VE2.cjs.map +0 -1
  174. package/dist/chunk-F7AD5CUU.js.map +0 -1
  175. package/dist/chunk-FFXNRJ5S.cjs.map +0 -1
  176. package/dist/chunk-HR6F6IP4.js.map +0 -1
  177. package/dist/chunk-JGXAVNZQ.js.map +0 -1
  178. package/dist/chunk-L5CI57RM.cjs.map +0 -1
  179. package/dist/chunk-LILQJ3UZ.cjs.map +0 -1
  180. package/dist/chunk-WHJGRRK2.js.map +0 -1
  181. /package/dist/{chunk-SFJRMBJC.js.map → chunk-5SVNA7IU.js.map} +0 -0
  182. /package/dist/{chunk-OAWFYZZT.js.map → chunk-7DOSAJDK.js.map} +0 -0
  183. /package/dist/{chunk-BZF63JXP.js.map → chunk-CRJVO4KO.js.map} +0 -0
  184. /package/dist/{chunk-VO2ZONMR.js.map → chunk-FNTFWP2A.js.map} +0 -0
  185. /package/dist/{chunk-VCPTU4IW.js.map → chunk-HWER6KGU.js.map} +0 -0
  186. /package/dist/{chunk-4SR2QHMB.js.map → chunk-ITVWX5HX.js.map} +0 -0
  187. /package/dist/{chunk-FTOVZ7O2.js.map → chunk-NPO6CHCR.js.map} +0 -0
  188. /package/dist/{chunk-XV5SXALY.js.map → chunk-NT5FX7GZ.js.map} +0 -0
  189. /package/dist/{chunk-CLQEBWV7.js.map → chunk-QE55ROZW.js.map} +0 -0
  190. /package/dist/{chunk-G43CEISB.js.map → chunk-TA3VJ2QO.js.map} +0 -0
  191. /package/dist/{chunk-VYEDTVIZ.js.map → chunk-XJPMTJAR.js.map} +0 -0
@@ -3112,6 +3112,176 @@ function assertSameOrigin(url) {
3112
3112
  }
3113
3113
  }
3114
3114
 
3115
+ // src/utils/sse-subscription.ts
3116
+ var DEFAULT_SILENCE_TIMEOUT_MS = 45e3;
3117
+ var DEFAULT_MAX_BACKOFF_MS = 3e4;
3118
+ var DEFAULT_INITIAL_BACKOFF_MS = 1e3;
3119
+ function createSseSubscription(options) {
3120
+ const {
3121
+ url,
3122
+ fetchImpl = embedAuthedFetch,
3123
+ onEvent,
3124
+ onStatusChange,
3125
+ silenceTimeoutMs = DEFAULT_SILENCE_TIMEOUT_MS,
3126
+ maxBackoffMs = DEFAULT_MAX_BACKOFF_MS,
3127
+ initialBackoffMs = DEFAULT_INITIAL_BACKOFF_MS
3128
+ } = options;
3129
+ let closed = false;
3130
+ let attempt = 0;
3131
+ let generation = 0;
3132
+ let abortController = null;
3133
+ let retryTimerId = null;
3134
+ let silenceTimerId = null;
3135
+ const setStatus = (status) => {
3136
+ if (closed && status !== "closed") return;
3137
+ onStatusChange?.(status);
3138
+ };
3139
+ const clearTimers = () => {
3140
+ if (retryTimerId) {
3141
+ clearTimeout(retryTimerId);
3142
+ retryTimerId = null;
3143
+ }
3144
+ if (silenceTimerId) {
3145
+ clearTimeout(silenceTimerId);
3146
+ silenceTimerId = null;
3147
+ }
3148
+ };
3149
+ const armSilenceTimer = () => {
3150
+ if (silenceTimerId) clearTimeout(silenceTimerId);
3151
+ silenceTimerId = setTimeout(() => {
3152
+ abortController?.abort();
3153
+ }, silenceTimeoutMs);
3154
+ };
3155
+ const scheduleReconnect = () => {
3156
+ if (closed || retryTimerId) return;
3157
+ setStatus("reconnecting");
3158
+ const backoff = Math.min(maxBackoffMs, initialBackoffMs * 2 ** attempt);
3159
+ const jitter = backoff * 0.25 * Math.random();
3160
+ attempt += 1;
3161
+ retryTimerId = setTimeout(() => {
3162
+ retryTimerId = null;
3163
+ void connect();
3164
+ }, backoff + jitter);
3165
+ };
3166
+ const parseFrame = (rawFrame) => {
3167
+ let eventName = "message";
3168
+ const dataLines = [];
3169
+ for (const line of rawFrame.split("\n")) {
3170
+ if (line.startsWith(":")) continue;
3171
+ if (line.startsWith("event:")) {
3172
+ eventName = line.slice(6).trim() || "message";
3173
+ } else if (line.startsWith("data:")) {
3174
+ dataLines.push(line.slice(5).trimStart());
3175
+ }
3176
+ }
3177
+ if (dataLines.length === 0) return;
3178
+ const rawData = dataLines.join("\n");
3179
+ let data = rawData;
3180
+ try {
3181
+ data = JSON.parse(rawData);
3182
+ } catch {
3183
+ }
3184
+ try {
3185
+ onEvent(eventName, data);
3186
+ } catch (err) {
3187
+ console.error("[sse-subscription] onEvent handler threw:", err);
3188
+ }
3189
+ };
3190
+ const connect = async () => {
3191
+ if (closed) return;
3192
+ const gen = ++generation;
3193
+ setStatus("connecting");
3194
+ abortController = new AbortController();
3195
+ let response;
3196
+ try {
3197
+ response = await fetchImpl(url, {
3198
+ method: "GET",
3199
+ // Explicit Accept — embedAuthedFetch otherwise injects
3200
+ // `Content-Type: application/json` defaults meant for POSTs.
3201
+ headers: { Accept: "text/event-stream" },
3202
+ signal: abortController.signal
3203
+ });
3204
+ } catch {
3205
+ if (!closed && gen === generation) scheduleReconnect();
3206
+ return;
3207
+ }
3208
+ if (closed || gen !== generation) return;
3209
+ if (response.status === 204) {
3210
+ setStatus("no-stream");
3211
+ return;
3212
+ }
3213
+ if (!response.ok) {
3214
+ const retryable = response.status === 408 || response.status === 429 || response.status >= 500;
3215
+ if (retryable) {
3216
+ scheduleReconnect();
3217
+ return;
3218
+ }
3219
+ const blockLayer = response.headers.get("x-block-layer");
3220
+ console.warn(
3221
+ `[sse-subscription] terminal ${response.status} for ${url}${blockLayer ? ` (x-block-layer: ${blockLayer})` : ""} \u2014 not retrying`
3222
+ );
3223
+ setStatus("terminal");
3224
+ return;
3225
+ }
3226
+ if (!response.body) {
3227
+ scheduleReconnect();
3228
+ return;
3229
+ }
3230
+ attempt = 0;
3231
+ setStatus("open");
3232
+ armSilenceTimer();
3233
+ const reader = response.body.getReader();
3234
+ const decoder = new TextDecoder();
3235
+ let buffer = "";
3236
+ try {
3237
+ for (; ; ) {
3238
+ const { done, value } = await reader.read();
3239
+ if (closed || gen !== generation) return;
3240
+ if (done) break;
3241
+ armSilenceTimer();
3242
+ buffer += decoder.decode(value, { stream: true });
3243
+ for (; ; ) {
3244
+ const boundary = buffer.indexOf("\n\n");
3245
+ if (boundary === -1) break;
3246
+ const rawFrame = buffer.slice(0, boundary);
3247
+ buffer = buffer.slice(boundary + 2);
3248
+ parseFrame(rawFrame);
3249
+ }
3250
+ }
3251
+ } catch {
3252
+ } finally {
3253
+ if (silenceTimerId) {
3254
+ clearTimeout(silenceTimerId);
3255
+ silenceTimerId = null;
3256
+ }
3257
+ try {
3258
+ reader.releaseLock();
3259
+ } catch {
3260
+ }
3261
+ }
3262
+ if (!closed && gen === generation) scheduleReconnect();
3263
+ };
3264
+ void connect();
3265
+ return {
3266
+ close: () => {
3267
+ if (closed) return;
3268
+ closed = true;
3269
+ generation += 1;
3270
+ clearTimers();
3271
+ abortController?.abort();
3272
+ onStatusChange?.("closed");
3273
+ },
3274
+ reconnectNow: () => {
3275
+ if (closed) return;
3276
+ generation += 1;
3277
+ clearTimers();
3278
+ attempt = 0;
3279
+ abortController?.abort();
3280
+ void connect();
3281
+ }
3282
+ };
3283
+ }
3284
+
3115
3285
  // src/utils/sse-decision-frame.ts
3116
3286
  async function readLeadingDecisionFrame(response) {
3117
3287
  const reader = response.body?.getReader();
@@ -4277,6 +4447,7 @@ exports.clearWalkthroughDismissal = clearWalkthroughDismissal;
4277
4447
  exports.clickupTaskUrl = clickupTaskUrl;
4278
4448
  exports.cn = cn;
4279
4449
  exports.consumeAccessCode = consumeAccessCode;
4450
+ exports.createSseSubscription = createSseSubscription;
4280
4451
  exports.createUTCTimestamp = createUTCTimestamp;
4281
4452
  exports.deepClone = deepClone;
4282
4453
  exports.delay = delay;