@flamingo-stack/openframe-frontend-core 0.0.690 → 0.0.691-snapshot.20261001154617

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 (186) hide show
  1. package/dist/{chunk-22RSJ57Z.js → chunk-2YVTGPM7.js} +2 -2
  2. package/dist/{chunk-QNWQQ4RT.cjs → chunk-53O6PQ3F.cjs} +7 -7
  3. package/dist/{chunk-QNWQQ4RT.cjs.map → chunk-53O6PQ3F.cjs.map} +1 -1
  4. package/dist/{chunk-54X75QTC.cjs → chunk-5XPK2QGU.cjs} +14 -14
  5. package/dist/{chunk-54X75QTC.cjs.map → chunk-5XPK2QGU.cjs.map} +1 -1
  6. package/dist/{chunk-4HBYEZ3I.cjs → chunk-7BNWMOPM.cjs} +82 -82
  7. package/dist/{chunk-4HBYEZ3I.cjs.map → chunk-7BNWMOPM.cjs.map} +1 -1
  8. package/dist/{chunk-HLEXYTOE.js → chunk-7EPGJOKN.js} +4 -4
  9. package/dist/{chunk-XRSJER2B.js → chunk-A5NHAHV6.js} +4 -4
  10. package/dist/{chunk-P27OGSQL.cjs → chunk-ATREVNIN.cjs} +37 -37
  11. package/dist/{chunk-P27OGSQL.cjs.map → chunk-ATREVNIN.cjs.map} +1 -1
  12. package/dist/{chunk-S5M5SEW2.js → chunk-AVAZ6BD6.js} +5 -5
  13. package/dist/{chunk-DLRE5Y3G.js → chunk-C2SVJVEB.js} +2 -2
  14. package/dist/{chunk-KZXKT5AX.cjs → chunk-CG7OWW7X.cjs} +14 -14
  15. package/dist/{chunk-KZXKT5AX.cjs.map → chunk-CG7OWW7X.cjs.map} +1 -1
  16. package/dist/{chunk-AIXPQT3G.js → chunk-CKO6NKNE.js} +801 -222
  17. package/dist/chunk-CKO6NKNE.js.map +1 -0
  18. package/dist/{chunk-UFXV64WQ.cjs → chunk-CKUPANVU.cjs} +9 -9
  19. package/dist/{chunk-UFXV64WQ.cjs.map → chunk-CKUPANVU.cjs.map} +1 -1
  20. package/dist/{chunk-3ZAIHRQH.cjs → chunk-DKJDO7YM.cjs} +35 -35
  21. package/dist/{chunk-3ZAIHRQH.cjs.map → chunk-DKJDO7YM.cjs.map} +1 -1
  22. package/dist/{chunk-D7BFS7N6.cjs → chunk-DUURFYGS.cjs} +3 -3
  23. package/dist/{chunk-D7BFS7N6.cjs.map → chunk-DUURFYGS.cjs.map} +1 -1
  24. package/dist/{chunk-NMXL34Z2.cjs → chunk-DVSPRY2V.cjs} +3 -3
  25. package/dist/{chunk-NMXL34Z2.cjs.map → chunk-DVSPRY2V.cjs.map} +1 -1
  26. package/dist/{chunk-VLWUKFQE.cjs → chunk-EXWS2QSD.cjs} +1301 -722
  27. package/dist/chunk-EXWS2QSD.cjs.map +1 -0
  28. package/dist/{chunk-5CBQBTGN.cjs → chunk-F6LXGP6S.cjs} +7 -7
  29. package/dist/{chunk-5CBQBTGN.cjs.map → chunk-F6LXGP6S.cjs.map} +1 -1
  30. package/dist/{chunk-MDYTAKJ5.cjs → chunk-FTK3S57R.cjs} +22 -22
  31. package/dist/{chunk-MDYTAKJ5.cjs.map → chunk-FTK3S57R.cjs.map} +1 -1
  32. package/dist/{chunk-UAKWSR3U.js → chunk-GDZ7IC5B.js} +2 -2
  33. package/dist/{chunk-OD2WMUAO.cjs → chunk-GZRU2A4L.cjs} +197 -197
  34. package/dist/{chunk-OD2WMUAO.cjs.map → chunk-GZRU2A4L.cjs.map} +1 -1
  35. package/dist/{chunk-Q76YVNCQ.js → chunk-HM7ZGABI.js} +2 -2
  36. package/dist/{chunk-YCKGUQA2.cjs → chunk-I27PWVWE.cjs} +17 -12
  37. package/dist/chunk-I27PWVWE.cjs.map +1 -0
  38. package/dist/{chunk-TSENCZUL.js → chunk-IQTQIBZ3.js} +11 -11
  39. package/dist/{chunk-QUGV2GT3.cjs → chunk-KDCIYRZV.cjs} +34 -34
  40. package/dist/{chunk-QUGV2GT3.cjs.map → chunk-KDCIYRZV.cjs.map} +1 -1
  41. package/dist/{chunk-2MGTNYHW.cjs → chunk-KQZMM3QJ.cjs} +100 -100
  42. package/dist/{chunk-2MGTNYHW.cjs.map → chunk-KQZMM3QJ.cjs.map} +1 -1
  43. package/dist/{chunk-BJHM2OEY.cjs → chunk-LNKLB7GM.cjs} +17 -17
  44. package/dist/{chunk-BJHM2OEY.cjs.map → chunk-LNKLB7GM.cjs.map} +1 -1
  45. package/dist/{chunk-Z622ACFD.js → chunk-LYJJH4D6.js} +5 -5
  46. package/dist/{chunk-42RQ4NIL.js → chunk-LYQULSK4.js} +6 -6
  47. package/dist/{chunk-TBJWPNHU.js → chunk-MCNQKS6I.js} +4 -4
  48. package/dist/chunk-MCNQKS6I.js.map +1 -0
  49. package/dist/{chunk-JGVJRUGB.cjs → chunk-MIZU2OTO.cjs} +4 -4
  50. package/dist/{chunk-JGVJRUGB.cjs.map → chunk-MIZU2OTO.cjs.map} +1 -1
  51. package/dist/{chunk-BOM6MMWB.cjs → chunk-N3526CTH.cjs} +3 -3
  52. package/dist/{chunk-BOM6MMWB.cjs.map → chunk-N3526CTH.cjs.map} +1 -1
  53. package/dist/{chunk-2PQKZWWP.js → chunk-PKZGXRU2.js} +6 -6
  54. package/dist/{chunk-FCQR6VY4.cjs → chunk-Q25VYAEL.cjs} +26 -26
  55. package/dist/{chunk-FCQR6VY4.cjs.map → chunk-Q25VYAEL.cjs.map} +1 -1
  56. package/dist/{chunk-25X43LSD.js → chunk-RK47E3PP.js} +4 -4
  57. package/dist/{chunk-V5NOURSR.js → chunk-RLNNV46K.js} +5 -5
  58. package/dist/{chunk-ZBQZJAC7.cjs → chunk-RTKF5AYA.cjs} +7 -7
  59. package/dist/chunk-RTKF5AYA.cjs.map +1 -0
  60. package/dist/{chunk-RF2EYX3B.js → chunk-SC44YJCF.js} +2 -2
  61. package/dist/{chunk-2OD2PPNO.cjs → chunk-SDORFSFK.cjs} +37 -37
  62. package/dist/{chunk-2OD2PPNO.cjs.map → chunk-SDORFSFK.cjs.map} +1 -1
  63. package/dist/{chunk-5A3WSWZD.js → chunk-TEIHEFXP.js} +8 -8
  64. package/dist/{chunk-U4OJCJTH.js → chunk-TXFGG47A.js} +4 -4
  65. package/dist/{chunk-DMXI5D2Q.cjs → chunk-USKQURNF.cjs} +3 -3
  66. package/dist/{chunk-DMXI5D2Q.cjs.map → chunk-USKQURNF.cjs.map} +1 -1
  67. package/dist/{chunk-2KILTCND.js → chunk-UVUNBXS6.js} +6 -1
  68. package/dist/chunk-UVUNBXS6.js.map +1 -0
  69. package/dist/{chunk-X4WBGDNW.cjs → chunk-WTYQCT4A.cjs} +18 -18
  70. package/dist/{chunk-X4WBGDNW.cjs.map → chunk-WTYQCT4A.cjs.map} +1 -1
  71. package/dist/{chunk-OC3QH5WG.js → chunk-X5XFKI6N.js} +2 -2
  72. package/dist/{chunk-2V4KPBNZ.js → chunk-XAOAYDGR.js} +3 -3
  73. package/dist/{chunk-4BUPMSLY.js → chunk-Y7ZEVTLC.js} +3 -3
  74. package/dist/{chunk-DOUG4UEZ.js → chunk-Z7QCNCBN.js} +11 -11
  75. package/dist/{chunk-OQVHGPHA.js → chunk-ZAV2F4VX.js} +3 -3
  76. package/dist/components/case-studies/index.cjs +20 -20
  77. package/dist/components/case-studies/index.js +7 -7
  78. package/dist/components/chat/index.cjs +4 -4
  79. package/dist/components/chat/index.js +3 -3
  80. package/dist/components/contact/index.cjs +8 -8
  81. package/dist/components/contact/index.js +7 -7
  82. package/dist/components/docs/index.cjs +11 -11
  83. package/dist/components/docs/index.js +10 -10
  84. package/dist/components/embeds/index.cjs +8 -8
  85. package/dist/components/embeds/index.js +7 -7
  86. package/dist/components/faq/index.cjs +9 -9
  87. package/dist/components/faq/index.js +8 -8
  88. package/dist/components/features/index.cjs +39 -7
  89. package/dist/components/features/index.cjs.map +1 -1
  90. package/dist/components/features/index.d.ts +1 -0
  91. package/dist/components/features/index.d.ts.map +1 -1
  92. package/dist/components/features/index.js +38 -6
  93. package/dist/components/features/remote-session/index.d.ts +13 -0
  94. package/dist/components/features/remote-session/index.d.ts.map +1 -0
  95. package/dist/components/features/remote-session/remote-access-request-card.d.ts +19 -0
  96. package/dist/components/features/remote-session/remote-access-request-card.d.ts.map +1 -0
  97. package/dist/components/features/remote-session/remote-session-block.d.ts +41 -0
  98. package/dist/components/features/remote-session/remote-session-block.d.ts.map +1 -0
  99. package/dist/components/features/remote-session/remote-session-chat-panel.d.ts +23 -0
  100. package/dist/components/features/remote-session/remote-session-chat-panel.d.ts.map +1 -0
  101. package/dist/components/features/remote-session/remote-session-dialog.d.ts +15 -0
  102. package/dist/components/features/remote-session/remote-session-dialog.d.ts.map +1 -0
  103. package/dist/components/features/remote-session/remote-session-overlay.d.ts +12 -0
  104. package/dist/components/features/remote-session/remote-session-overlay.d.ts.map +1 -0
  105. package/dist/components/features/remote-session/remote-session-parts.d.ts +34 -0
  106. package/dist/components/features/remote-session/remote-session-parts.d.ts.map +1 -0
  107. package/dist/components/features/remote-session/types.d.ts +33 -0
  108. package/dist/components/features/remote-session/types.d.ts.map +1 -0
  109. package/dist/components/help-center-pages/index.cjs +101 -101
  110. package/dist/components/help-center-pages/index.js +21 -21
  111. package/dist/components/index.cjs +97 -65
  112. package/dist/components/index.cjs.map +1 -1
  113. package/dist/components/index.js +53 -21
  114. package/dist/components/index.js.map +1 -1
  115. package/dist/components/meeting-scheduler/index.cjs +58 -58
  116. package/dist/components/meeting-scheduler/index.js +8 -8
  117. package/dist/components/navigation/index.cjs +10 -10
  118. package/dist/components/navigation/index.js +9 -9
  119. package/dist/components/onboarding-guides/index.cjs +11 -11
  120. package/dist/components/onboarding-guides/index.js +10 -10
  121. package/dist/components/related-content/index.cjs +6 -6
  122. package/dist/components/related-content/index.js +5 -5
  123. package/dist/components/tickets/index.cjs +12 -12
  124. package/dist/components/tickets/index.js +11 -11
  125. package/dist/components/tickets/ticket-live-provider.d.ts.map +1 -1
  126. package/dist/components/ui/index.cjs +7 -7
  127. package/dist/components/ui/index.js +6 -6
  128. package/dist/hooks/index.cjs +4 -4
  129. package/dist/hooks/index.js +3 -3
  130. package/dist/index.cjs +44 -12
  131. package/dist/index.cjs.map +1 -1
  132. package/dist/index.js +42 -10
  133. package/dist/index.js.map +1 -1
  134. package/dist/utils/embed-authed-fetch.d.ts +18 -0
  135. package/dist/utils/embed-authed-fetch.d.ts.map +1 -1
  136. package/dist/utils/index.cjs +50 -6
  137. package/dist/utils/index.cjs.map +1 -1
  138. package/dist/utils/index.js +50 -6
  139. package/dist/utils/index.js.map +1 -1
  140. package/dist/utils/sse-subscription.d.ts +29 -11
  141. package/dist/utils/sse-subscription.d.ts.map +1 -1
  142. package/package.json +1 -1
  143. package/src/components/features/__tests__/remote-session.test.tsx +97 -0
  144. package/src/components/features/index.ts +1 -0
  145. package/src/components/features/remote-session/index.ts +36 -0
  146. package/src/components/features/remote-session/remote-access-request-card.tsx +102 -0
  147. package/src/components/features/remote-session/remote-session-block.tsx +182 -0
  148. package/src/components/features/remote-session/remote-session-chat-panel.tsx +178 -0
  149. package/src/components/features/remote-session/remote-session-dialog.tsx +77 -0
  150. package/src/components/features/remote-session/remote-session-overlay.tsx +33 -0
  151. package/src/components/features/remote-session/remote-session-parts.tsx +138 -0
  152. package/src/components/features/remote-session/types.ts +41 -0
  153. package/src/components/tickets/ticket-live-provider.tsx +14 -12
  154. package/src/stories/RemoteSessionAccessRequest.stories.tsx +71 -0
  155. package/src/stories/RemoteSessionBlock.stories.tsx +164 -0
  156. package/src/stories/RemoteSessionDialog.stories.tsx +49 -0
  157. package/src/stories/RemoteSessionIndicator.stories.tsx +44 -0
  158. package/src/utils/embed-authed-fetch.ts +21 -0
  159. package/src/utils/sse-subscription.ts +107 -20
  160. package/dist/chunk-2KILTCND.js.map +0 -1
  161. package/dist/chunk-AIXPQT3G.js.map +0 -1
  162. package/dist/chunk-TBJWPNHU.js.map +0 -1
  163. package/dist/chunk-VLWUKFQE.cjs.map +0 -1
  164. package/dist/chunk-YCKGUQA2.cjs.map +0 -1
  165. package/dist/chunk-ZBQZJAC7.cjs.map +0 -1
  166. /package/dist/{chunk-22RSJ57Z.js.map → chunk-2YVTGPM7.js.map} +0 -0
  167. /package/dist/{chunk-HLEXYTOE.js.map → chunk-7EPGJOKN.js.map} +0 -0
  168. /package/dist/{chunk-XRSJER2B.js.map → chunk-A5NHAHV6.js.map} +0 -0
  169. /package/dist/{chunk-S5M5SEW2.js.map → chunk-AVAZ6BD6.js.map} +0 -0
  170. /package/dist/{chunk-DLRE5Y3G.js.map → chunk-C2SVJVEB.js.map} +0 -0
  171. /package/dist/{chunk-UAKWSR3U.js.map → chunk-GDZ7IC5B.js.map} +0 -0
  172. /package/dist/{chunk-Q76YVNCQ.js.map → chunk-HM7ZGABI.js.map} +0 -0
  173. /package/dist/{chunk-TSENCZUL.js.map → chunk-IQTQIBZ3.js.map} +0 -0
  174. /package/dist/{chunk-Z622ACFD.js.map → chunk-LYJJH4D6.js.map} +0 -0
  175. /package/dist/{chunk-42RQ4NIL.js.map → chunk-LYQULSK4.js.map} +0 -0
  176. /package/dist/{chunk-2PQKZWWP.js.map → chunk-PKZGXRU2.js.map} +0 -0
  177. /package/dist/{chunk-25X43LSD.js.map → chunk-RK47E3PP.js.map} +0 -0
  178. /package/dist/{chunk-V5NOURSR.js.map → chunk-RLNNV46K.js.map} +0 -0
  179. /package/dist/{chunk-RF2EYX3B.js.map → chunk-SC44YJCF.js.map} +0 -0
  180. /package/dist/{chunk-5A3WSWZD.js.map → chunk-TEIHEFXP.js.map} +0 -0
  181. /package/dist/{chunk-U4OJCJTH.js.map → chunk-TXFGG47A.js.map} +0 -0
  182. /package/dist/{chunk-OC3QH5WG.js.map → chunk-X5XFKI6N.js.map} +0 -0
  183. /package/dist/{chunk-2V4KPBNZ.js.map → chunk-XAOAYDGR.js.map} +0 -0
  184. /package/dist/{chunk-4BUPMSLY.js.map → chunk-Y7ZEVTLC.js.map} +0 -0
  185. /package/dist/{chunk-DOUG4UEZ.js.map → chunk-Z7QCNCBN.js.map} +0 -0
  186. /package/dist/{chunk-OQVHGPHA.js.map → chunk-ZAV2F4VX.js.map} +0 -0
@@ -16,11 +16,26 @@
16
16
  * (INCLUDING `: keepalive` comment lines — they reset the timer
17
17
  * before frame parsing drops them) count as life. Silence beyond
18
18
  * `silenceTimeoutMs` (default 45s = 3× keepalive) aborts + reconnects.
19
- * - Terminal responses (NO retry): any 4xx except 408/429 — the
20
- * `x-block-layer` header, when readable, is logged for attribution
21
- * only, never used as a retry gate (proxies may strip it); and
22
- * 204 → a distinct `no-stream` status (the caller decides when to
23
- * try again). Backoff-retry is for transport errors, 408/429, and 5xx.
19
+ * - Terminal responses: any 4xx except 408/429 — the `x-block-layer`
20
+ * header, when readable, is logged for attribution only, never used
21
+ * as a retry gate (proxies may strip it); and 204 → a distinct
22
+ * `no-stream` status (the caller decides when to try again).
23
+ * Backoff-retry is for transport errors, 408/429, and 5xx.
24
+ * - Long-lived streams (`pauseWhenHidden`) never stay terminal, because
25
+ * a page a desktop shell keeps open for days would otherwise stay
26
+ * dead until reloaded:
27
+ * · 401 is retried on a slow timer (30s doubling to 5min, plus
28
+ * jitter). The default fetch already refreshed + retried once, so
29
+ * this is a session the host could not renew yet — and every
30
+ * attempt makes it try again, which rotates a refresh token. So
31
+ * visible / focus do NOT shortcut this timer. What does: a new
32
+ * credential reported by the host (`EmbedAuthAdapter.subscribe`,
33
+ * default fetch only), plus the unconditional reconnect paths
34
+ * (`online`, resuming after a suspend, `reconnectNow()`).
35
+ * · Any other terminal 4xx is retried on visible / window focus, no
36
+ * sooner than 30s after the last connect attempt.
37
+ * Finite streams keep the terminal behavior: their monitors have no
38
+ * auth adapter to recover with and must reach a final state.
24
39
  *
25
40
  * THE common SSE client for lib + hosts — exported from the `utils`
26
41
  * barrel. Consumers: `TicketLiveProvider` (lib) and the hub's
@@ -31,7 +46,8 @@
31
46
  * never-terminating reconnect loop re-opens the finished stream.
32
47
  */
33
48
  /** Transport-level status. `suspended` = paused by `pauseWhenHidden`
34
- * after the hidden grace elapsed (resumes automatically on visible). */
49
+ * after the hidden grace elapsed (resumes automatically on visible).
50
+ * `terminal` is final only without `pauseWhenHidden`. */
35
51
  export type SseTransportStatus = 'connecting' | 'open' | 'reconnecting' | 'no-stream' | 'terminal' | 'suspended' | 'closed';
36
52
  export interface SseSubscriptionOptions {
37
53
  url: string;
@@ -59,10 +75,11 @@ export interface SseSubscriptionOptions {
59
75
  /**
60
76
  * Pause the subscription while the tab is hidden (45s grace so
61
77
  * Cmd-Tab thrash doesn't churn connections), resume + reconnect on
62
- * visible, and reconnect on `online`. OPT-IN — short-lived streams
63
- * (workflow/invocation monitors) must keep running in background
64
- * tabs. Long-lived per-user streams should enable it (scale relief:
65
- * a hidden tab holds no server invocation).
78
+ * visible, and reconnect on `online`. Also makes the stream
79
+ * self-healing after a 401 or terminal 4xx (see the module header).
80
+ * OPT-IN — short-lived streams (workflow/invocation monitors) must
81
+ * keep running in background tabs. Long-lived per-user streams should
82
+ * enable it (scale relief: a hidden tab holds no server invocation).
66
83
  */
67
84
  pauseWhenHidden?: boolean;
68
85
  /** Silence threshold before the connection is presumed dead. MUST be
@@ -76,7 +93,8 @@ export interface SseSubscription {
76
93
  /** Permanently stop — no further reconnects, no callbacks. */
77
94
  close: () => void;
78
95
  /** Drop the current connection (if any) and reconnect immediately,
79
- * resetting backoff. No-op after `close()`. */
96
+ * resetting the transport backoff (a 401 backoff carries over until a
97
+ * successful open). No-op after `close()`. */
80
98
  reconnectNow: () => void;
81
99
  }
82
100
  export declare function createSseSubscription(options: SseSubscriptionOptions): SseSubscription;
@@ -1 +1 @@
1
- {"version":3,"file":"sse-subscription.d.ts","sourceRoot":"","sources":["../../src/utils/sse-subscription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH;yEACyE;AACzE,MAAM,MAAM,kBAAkB,GAC5B,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE7F,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnE;;;2EAGuE;IACvE,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACtD;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;2DAEuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,8DAA8D;IAC9D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;oDACgD;IAChD,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAmBD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CA6WtF"}
1
+ {"version":3,"file":"sse-subscription.d.ts","sourceRoot":"","sources":["../../src/utils/sse-subscription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAIH;;0DAE0D;AAC1D,MAAM,MAAM,kBAAkB,GAC5B,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE7F,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnE;;;2EAGuE;IACvE,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACtD;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;2DAEuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,8DAA8D;IAC9D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;mDAE+C;IAC/C,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AA0BD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CA2atF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flamingo-stack/openframe-frontend-core",
3
- "version": "0.0.690",
3
+ "version": "0.0.691-snapshot.20261001154617",
4
4
  "description": "Shared design system and components for all Flamingo platforms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Remote session widgets: the elapsed format, the consent card's https-only
3
+ * site link and its decision lock, and the chat composer's send.
4
+ */
5
+
6
+ import { fireEvent, render, screen } from '@testing-library/react';
7
+ import { describe, expect, it, vi } from 'vitest';
8
+ import {
9
+ formatRemoteSessionElapsed,
10
+ RemoteAccessRequestCard,
11
+ RemoteSessionChatPanel,
12
+ RemoteSessionMinimizedChip,
13
+ } from '../remote-session';
14
+
15
+ const party = { organizationName: 'TechFlow Solutions', organizationSiteUrl: 'https://www.techflow.com' };
16
+
17
+ describe('formatRemoteSessionElapsed', () => {
18
+ it('counts minutes and seconds, then hours', () => {
19
+ expect(formatRemoteSessionElapsed(0)).toBe('0:00');
20
+ expect(formatRemoteSessionElapsed(323_000)).toBe('5:23');
21
+ expect(formatRemoteSessionElapsed(3_723_000)).toBe('1:02:03');
22
+ });
23
+
24
+ it('never goes negative when the clock is behind the server', () => {
25
+ expect(formatRemoteSessionElapsed(-5_000)).toBe('0:00');
26
+ });
27
+ });
28
+
29
+ describe('RemoteAccessRequestCard', () => {
30
+ it('offers the site only when it is https', () => {
31
+ const onOpenSite = vi.fn();
32
+ const { rerender } = render(<RemoteAccessRequestCard party={party} onDecide={() => {}} onOpenSite={onOpenSite} />);
33
+ fireEvent.click(screen.getByRole('button', { name: 'Open website' }));
34
+ expect(onOpenSite).toHaveBeenCalledWith('https://www.techflow.com');
35
+
36
+ rerender(
37
+ <RemoteAccessRequestCard
38
+ party={{ ...party, organizationSiteUrl: 'http://techflow.local' }}
39
+ onDecide={() => {}}
40
+ onOpenSite={onOpenSite}
41
+ />,
42
+ );
43
+ expect(screen.getByText('techflow.local')).toBeInTheDocument();
44
+ expect(screen.queryByRole('button', { name: 'Open website' })).toBeNull();
45
+ });
46
+
47
+ it('reports the decision, and locks both buttons while one is in flight', () => {
48
+ const onDecide = vi.fn();
49
+ const { rerender } = render(<RemoteAccessRequestCard party={party} onDecide={onDecide} />);
50
+ fireEvent.click(screen.getByRole('button', { name: 'Allow Access' }));
51
+ expect(onDecide).toHaveBeenCalledWith('APPROVED');
52
+
53
+ rerender(<RemoteAccessRequestCard party={party} onDecide={onDecide} deciding="APPROVED" />);
54
+ expect(screen.getByRole('button', { name: 'Decline' })).toBeDisabled();
55
+ });
56
+
57
+ it('shows the recording notice only when asked to', () => {
58
+ const { rerender } = render(<RemoteAccessRequestCard party={party} onDecide={() => {}} />);
59
+ expect(screen.queryByText(/will be recorded/)).toBeNull();
60
+ rerender(<RemoteAccessRequestCard party={party} onDecide={() => {}} showRecordingNotice />);
61
+ expect(screen.getByText(/will be recorded/)).toBeInTheDocument();
62
+ });
63
+ });
64
+
65
+ describe('RemoteSessionChatPanel', () => {
66
+ it('sends the trimmed draft and clears it; a blank draft sends nothing', () => {
67
+ const onSend = vi.fn();
68
+ const onDraftChange = vi.fn();
69
+ const props = {
70
+ party,
71
+ elapsed: '1:00',
72
+ messages: [],
73
+ onDraftChange,
74
+ onSend,
75
+ onCloseChat: () => {},
76
+ onEndSession: () => {},
77
+ };
78
+ const { rerender } = render(<RemoteSessionChatPanel {...props} draft=" hello " />);
79
+ fireEvent.click(screen.getByRole('button', { name: 'Send message' }));
80
+ expect(onSend).toHaveBeenCalledWith('hello');
81
+ expect(onDraftChange).toHaveBeenCalledWith('');
82
+
83
+ onSend.mockClear();
84
+ rerender(<RemoteSessionChatPanel {...props} draft=" " />);
85
+ fireEvent.click(screen.getByRole('button', { name: 'Send message' }));
86
+ expect(onSend).not.toHaveBeenCalled();
87
+ });
88
+ });
89
+
90
+ describe('RemoteSessionMinimizedChip', () => {
91
+ it('expands on click', () => {
92
+ const onExpand = vi.fn();
93
+ render(<RemoteSessionMinimizedChip party={{ ...party, technicianName: 'Mike Rodriguez' }} onExpand={onExpand} />);
94
+ fireEvent.click(screen.getByRole('button', { name: 'Show session block' }));
95
+ expect(onExpand).toHaveBeenCalledTimes(1);
96
+ });
97
+ });
@@ -92,6 +92,7 @@ export * from './policy-configuration-panel';
92
92
  export * from './waitlist-form';
93
93
  export * from './notifications';
94
94
  export * from './time-tracker';
95
+ export * from './remote-session';
95
96
  export * from './board';
96
97
  export * from './sortable-list';
97
98
  export * from './ticket-status-config-list';
@@ -0,0 +1,36 @@
1
+ export { RemoteAccessRequestCard } from './remote-access-request-card';
2
+ export type { RemoteAccessRequestCardProps } from './remote-access-request-card';
3
+ export {
4
+ RemoteSessionBlockFrame,
5
+ RemoteSessionEndButton,
6
+ RemoteSessionMinimizedChip,
7
+ RemoteSessionSummary,
8
+ } from './remote-session-block';
9
+ export type {
10
+ RemoteSessionBlockFrameProps,
11
+ RemoteSessionMinimizedChipProps,
12
+ RemoteSessionSummaryProps,
13
+ } from './remote-session-block';
14
+ export { RemoteSessionChatPanel } from './remote-session-chat-panel';
15
+ export type { RemoteSessionChatPanelProps } from './remote-session-chat-panel';
16
+ export { RemoteSessionDialog } from './remote-session-dialog';
17
+ export type { RemoteSessionDialogProps } from './remote-session-dialog';
18
+ export { RemoteSessionBorder, RemoteSessionPill } from './remote-session-overlay';
19
+ export {
20
+ REMOTE_SESSION_DRAG_HANDLE_CLASS,
21
+ RemoteSessionDragger,
22
+ RemoteSessionOrgLogo,
23
+ RemoteSessionRecordingTag,
24
+ RemoteSessionScope,
25
+ formatRemoteSessionElapsed,
26
+ useRemoteSessionTimer,
27
+ } from './remote-session-parts';
28
+ export type { RemoteSessionOrgLogoProps, RemoteSessionScopeProps } from './remote-session-parts';
29
+ export type {
30
+ RemoteAccessDecision,
31
+ RemoteSessionChatAuthor,
32
+ RemoteSessionChatMessage,
33
+ RemoteSessionDialogVariant,
34
+ RemoteSessionDragHandlers,
35
+ RemoteSessionParty,
36
+ } from './types';
@@ -0,0 +1,102 @@
1
+ 'use client';
2
+
3
+ import { ExternalLinkIcon, InfoCircleIcon } from '../../icons-v2-generated';
4
+ import { Button } from '../../ui/button/button';
5
+ import { RemoteSessionOrgLogo } from './remote-session-parts';
6
+ import type { RemoteAccessDecision, RemoteSessionParty } from './types';
7
+
8
+ export interface RemoteAccessRequestCardProps {
9
+ party: RemoteSessionParty;
10
+ /** The notice that the session will be recorded. */
11
+ showRecordingNotice?: boolean;
12
+ /** The decision in flight, if any; both buttons lock while it is set. */
13
+ deciding?: RemoteAccessDecision | null;
14
+ /** Replaces the "you can end the session" line, e.g. when the decision could not be sent. */
15
+ error?: string | null;
16
+ onDecide: (decision: RemoteAccessDecision) => void;
17
+ /**
18
+ * Opens the organization's site. The button only shows for an https URL:
19
+ * the URL comes from the server, so no other scheme is ever handed out.
20
+ */
21
+ onOpenSite?: (url: string) => void;
22
+ }
23
+
24
+ /** `https://www.techflow.com/` -> `www.techflow.com`. */
25
+ function displaySiteUrl(url: string): string {
26
+ return url.replace(/^https?:\/\//, '').replace(/\/$/, '');
27
+ }
28
+
29
+ /** The end user's consent dialog for a remote access request: who is asking, what they get, Decline / Allow Access. */
30
+ export function RemoteAccessRequestCard({
31
+ party,
32
+ showRecordingNotice = false,
33
+ deciding = null,
34
+ error,
35
+ onDecide,
36
+ onOpenSite,
37
+ }: RemoteAccessRequestCardProps) {
38
+ const { organizationName } = party;
39
+ const siteUrl = party.organizationSiteUrl ?? undefined;
40
+ const openableSite = siteUrl?.startsWith('https://') ? siteUrl : undefined;
41
+
42
+ return (
43
+ <div className="flex w-full flex-col gap-[var(--spacing-system-l)] rounded-md border border-ods-border bg-ods-card p-[var(--spacing-system-xl)]">
44
+ <h1 className="w-full text-ods-text-primary text-h2">Your IT support team is requesting remote access</h1>
45
+
46
+ <div className="flex w-full items-center gap-[var(--spacing-system-m)] rounded-md border border-ods-border bg-ods-bg p-[var(--spacing-system-m)]">
47
+ <RemoteSessionOrgLogo name={organizationName} logoUrl={party.organizationLogoUrl} sizePx={64} />
48
+ <div className="flex min-w-0 flex-1 flex-col">
49
+ <p className="w-full truncate text-ods-text-primary text-h3">{organizationName}</p>
50
+ {siteUrl && <p className="w-full truncate text-ods-text-secondary text-h4">{displaySiteUrl(siteUrl)}</p>}
51
+ </div>
52
+ {openableSite && onOpenSite && (
53
+ <Button variant="outline" size="icon" aria-label="Open website" onClick={() => onOpenSite(openableSite)}>
54
+ <ExternalLinkIcon size={24} color="currentColor" />
55
+ </Button>
56
+ )}
57
+ </div>
58
+
59
+ <p className="w-full text-ods-text-primary text-h4">
60
+ A technician from <span className="text-ods-accent">{organizationName}</span> will be able to view your screen
61
+ and control your mouse and keyboard during this session.
62
+ </p>
63
+
64
+ <div className="flex w-full flex-col gap-[var(--spacing-system-xs)]">
65
+ {showRecordingNotice && (
66
+ <div className="flex w-full items-center gap-[var(--spacing-system-xs)] rounded-md border border-ods-border bg-ods-bg p-[var(--spacing-system-s)]">
67
+ <InfoCircleIcon size={24} color="currentColor" className="shrink-0 text-ods-accent" />
68
+ <p className="min-w-0 flex-1 text-ods-text-primary text-h6">
69
+ This session will be recorded and available upon request.
70
+ </p>
71
+ </div>
72
+ )}
73
+ {error ? (
74
+ <p className="w-full text-ods-text-primary text-h6">{error}</p>
75
+ ) : (
76
+ <p className="w-full text-ods-text-secondary text-h6">You can end the session at any time.</p>
77
+ )}
78
+ </div>
79
+
80
+ <div className="flex w-full items-stretch gap-[var(--spacing-system-l)]">
81
+ <Button
82
+ variant="outline"
83
+ fullWidth
84
+ loading={deciding === 'DENIED'}
85
+ disabled={deciding !== null}
86
+ onClick={() => onDecide('DENIED')}
87
+ >
88
+ Decline
89
+ </Button>
90
+ <Button
91
+ variant="accent"
92
+ fullWidth
93
+ loading={deciding === 'APPROVED'}
94
+ disabled={deciding !== null}
95
+ onClick={() => onDecide('APPROVED')}
96
+ >
97
+ Allow Access
98
+ </Button>
99
+ </div>
100
+ </div>
101
+ );
102
+ }
@@ -0,0 +1,182 @@
1
+ 'use client';
2
+
3
+ import { forwardRef, type ReactNode } from 'react';
4
+ import { cn } from '../../../utils/cn';
5
+ import { ChatsIcon, Chevrons03LeftIcon, Chevrons03RightIcon, MonitorOffIcon } from '../../icons-v2-generated';
6
+ import { OpenFrameLogo } from '../../icons/openframe-logo';
7
+ import { Button } from '../../ui/button/button';
8
+ import { SquareAvatar } from '../../ui/square-avatar';
9
+ import {
10
+ REMOTE_SESSION_DRAG_HANDLE_CLASS,
11
+ RemoteSessionDragger,
12
+ RemoteSessionOrgLogo,
13
+ RemoteSessionRecordingTag,
14
+ } from './remote-session-parts';
15
+ import type { RemoteSessionDragHandlers, RemoteSessionParty } from './types';
16
+
17
+ export interface RemoteSessionBlockFrameProps {
18
+ /** The summary or the chat panel. */
19
+ children: ReactNode;
20
+ /** The chat panel has a fixed height; the summary hugs its content. */
21
+ expanded?: boolean;
22
+ onHide: () => void;
23
+ className?: string;
24
+ }
25
+
26
+ /**
27
+ * The session block's card: 440 px wide, the open panel on top and the
28
+ * "Hide this Block" bar at the bottom. The ref is the rendered surface, which
29
+ * a desktop host sizes its window to.
30
+ */
31
+ export const RemoteSessionBlockFrame = forwardRef<HTMLDivElement, RemoteSessionBlockFrameProps>(
32
+ ({ children, expanded = false, onHide, className }, ref) => {
33
+ return (
34
+ <div
35
+ ref={ref}
36
+ className={cn(
37
+ 'flex w-[440px] shrink-0 flex-col overflow-hidden rounded-md border border-ods-border bg-ods-bg',
38
+ expanded && 'h-[680px]',
39
+ className,
40
+ )}
41
+ >
42
+ {children}
43
+ <button
44
+ type="button"
45
+ className="flex h-12 w-full shrink-0 items-center gap-[var(--spacing-system-xs)] border-t border-ods-border bg-ods-card px-[var(--spacing-system-m)]"
46
+ onClick={onHide}
47
+ >
48
+ <Chevrons03RightIcon size={24} />
49
+ <span className="min-w-0 flex-1 truncate text-left text-ods-text-secondary text-h4">Hide this Block</span>
50
+ <OpenFrameLogo className="size-6 shrink-0" />
51
+ </button>
52
+ </div>
53
+ );
54
+ },
55
+ );
56
+ RemoteSessionBlockFrame.displayName = 'RemoteSessionBlockFrame';
57
+
58
+ /** The red End Session action shared by the summary and the chat panel. */
59
+ export function RemoteSessionEndButton({ onEndSession }: { onEndSession: () => void }) {
60
+ return (
61
+ <Button
62
+ variant="outline"
63
+ fullWidth
64
+ leftIcon={<MonitorOffIcon size={24} color="currentColor" className="text-ods-error" />}
65
+ onClick={onEndSession}
66
+ >
67
+ End Session
68
+ </Button>
69
+ );
70
+ }
71
+
72
+ export interface RemoteSessionSummaryProps {
73
+ party: RemoteSessionParty;
74
+ /** Elapsed session time, e.g. from `useRemoteSessionTimer`. */
75
+ elapsed: string;
76
+ showRecordingTag?: boolean;
77
+ onOpenChat: () => void;
78
+ onEndSession: () => void;
79
+ /** Makes the header row and the dragger move the window. */
80
+ dragHandlers?: RemoteSessionDragHandlers;
81
+ }
82
+
83
+ /** The compact block: who is connected and for how long, Open Chat / End Session. */
84
+ export function RemoteSessionSummary({
85
+ party,
86
+ elapsed,
87
+ showRecordingTag = false,
88
+ onOpenChat,
89
+ onEndSession,
90
+ dragHandlers,
91
+ }: RemoteSessionSummaryProps) {
92
+ const technician = party.technicianName;
93
+ return (
94
+ <div className="relative flex flex-col gap-[var(--spacing-system-m)] p-[var(--spacing-system-m)]">
95
+ <RemoteSessionDragger dragHandlers={dragHandlers} />
96
+ <div
97
+ className={cn(
98
+ 'flex w-full items-center gap-[var(--spacing-system-xs)] pr-[var(--spacing-system-mf)]',
99
+ dragHandlers && REMOTE_SESSION_DRAG_HANDLE_CLASS,
100
+ )}
101
+ {...dragHandlers}
102
+ >
103
+ {technician ? (
104
+ <SquareAvatar
105
+ variant="round"
106
+ sizePx={48}
107
+ src={party.technicianAvatarUrl ?? undefined}
108
+ fallback={technician}
109
+ />
110
+ ) : (
111
+ <RemoteSessionOrgLogo name={party.organizationName} logoUrl={party.organizationLogoUrl} sizePx={48} />
112
+ )}
113
+ <div className="flex min-w-0 flex-1 flex-col">
114
+ <p className="w-full truncate text-ods-text-primary text-h4">
115
+ {technician ? `${technician} connected` : 'IT support team is connected'}{' '}
116
+ <span className="text-ods-text-secondary">({elapsed})</span>
117
+ </p>
118
+ <p className="w-full truncate text-ods-text-secondary text-h4">{party.organizationName}</p>
119
+ </div>
120
+ </div>
121
+ {showRecordingTag && <RemoteSessionRecordingTag />}
122
+ <div className="flex w-full items-stretch gap-[var(--spacing-system-m)]">
123
+ <Button
124
+ variant="outline"
125
+ fullWidth
126
+ leftIcon={<ChatsIcon size={24} color="currentColor" />}
127
+ onClick={onOpenChat}
128
+ >
129
+ Open Chat
130
+ </Button>
131
+ <RemoteSessionEndButton onEndSession={onEndSession} />
132
+ </div>
133
+ </div>
134
+ );
135
+ }
136
+
137
+ export interface RemoteSessionMinimizedChipProps {
138
+ party: RemoteSessionParty;
139
+ onExpand: () => void;
140
+ /** Lets the chip move the window too; the host tells a drag from a click. */
141
+ dragHandlers?: RemoteSessionDragHandlers;
142
+ }
143
+
144
+ /** The hidden block: the technician's avatar (or the organization's logo) and a chevron to bring it back. */
145
+ export const RemoteSessionMinimizedChip = forwardRef<HTMLButtonElement, RemoteSessionMinimizedChipProps>(
146
+ ({ party, onExpand, dragHandlers }, ref) => {
147
+ const technician = party.technicianName;
148
+ return (
149
+ <button
150
+ ref={ref}
151
+ type="button"
152
+ aria-label="Show session block"
153
+ className={cn(
154
+ 'flex shrink-0 flex-col overflow-hidden rounded-md border border-ods-border',
155
+ dragHandlers && REMOTE_SESSION_DRAG_HANDLE_CLASS,
156
+ )}
157
+ onClick={onExpand}
158
+ {...dragHandlers}
159
+ >
160
+ {technician ? (
161
+ <SquareAvatar
162
+ sizePx={48}
163
+ src={party.technicianAvatarUrl ?? undefined}
164
+ fallback={technician}
165
+ className="rounded-none"
166
+ />
167
+ ) : (
168
+ <RemoteSessionOrgLogo
169
+ name={party.organizationName}
170
+ logoUrl={party.organizationLogoUrl}
171
+ sizePx={48}
172
+ className="rounded-none border-0"
173
+ />
174
+ )}
175
+ <span className="flex h-9 w-12 items-center justify-center border-t border-ods-border bg-ods-card">
176
+ <Chevrons03LeftIcon size={24} />
177
+ </span>
178
+ </button>
179
+ );
180
+ },
181
+ );
182
+ RemoteSessionMinimizedChip.displayName = 'RemoteSessionMinimizedChip';