@flamingo-stack/openframe-frontend-core 0.0.579-1952.5335.1 → 0.0.579

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 (236) hide show
  1. package/dist/chat-protocol/decode.d.ts.map +1 -1
  2. package/dist/chat-protocol/events.d.ts +47 -1
  3. package/dist/chat-protocol/events.d.ts.map +1 -1
  4. package/dist/chat-protocol/index.cjs +51 -0
  5. package/dist/chat-protocol/index.cjs.map +1 -1
  6. package/dist/chat-protocol/index.js +48 -1
  7. package/dist/chat-protocol/index.js.map +1 -1
  8. package/dist/chat-protocol/leading-frames.d.ts +9 -3
  9. package/dist/chat-protocol/leading-frames.d.ts.map +1 -1
  10. package/dist/chat-protocol/nats-decoder.d.ts +41 -0
  11. package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
  12. package/dist/{chunk-3B42TFEE.cjs → chunk-36TJYCF3.cjs} +27 -27
  13. package/dist/{chunk-3B42TFEE.cjs.map → chunk-36TJYCF3.cjs.map} +1 -1
  14. package/dist/{chunk-YYEVFC3K.cjs → chunk-37XJYOAY.cjs} +17 -17
  15. package/dist/{chunk-YYEVFC3K.cjs.map → chunk-37XJYOAY.cjs.map} +1 -1
  16. package/dist/{chunk-DBP7S75Q.js → chunk-3AX3ZEY3.js} +1481 -1318
  17. package/dist/chunk-3AX3ZEY3.js.map +1 -0
  18. package/dist/{chunk-DGB2FLFH.cjs → chunk-4FJSN2XW.cjs} +10 -10
  19. package/dist/{chunk-DGB2FLFH.cjs.map → chunk-4FJSN2XW.cjs.map} +1 -1
  20. package/dist/{chunk-WHSSI3S7.cjs → chunk-4HGRXFQP.cjs} +3 -3
  21. package/dist/{chunk-WHSSI3S7.cjs.map → chunk-4HGRXFQP.cjs.map} +1 -1
  22. package/dist/{chunk-SY5HCZZO.cjs → chunk-4LZ7B5H5.cjs} +5 -5
  23. package/dist/{chunk-SY5HCZZO.cjs.map → chunk-4LZ7B5H5.cjs.map} +1 -1
  24. package/dist/{chunk-XJ45MHWI.js → chunk-4WSKSNXL.js} +9 -9
  25. package/dist/{chunk-ZCEQLHU3.js → chunk-5Y6TPFW7.js} +5 -5
  26. package/dist/{chunk-EVTRRDIH.cjs → chunk-A6C5HOD7.cjs} +23 -23
  27. package/dist/{chunk-EVTRRDIH.cjs.map → chunk-A6C5HOD7.cjs.map} +1 -1
  28. package/dist/{chunk-RXZWUJEB.js → chunk-AKPLEWMH.js} +2 -2
  29. package/dist/{chunk-7WKFLOC7.cjs → chunk-BCJQ7CJE.cjs} +11 -11
  30. package/dist/{chunk-7WKFLOC7.cjs.map → chunk-BCJQ7CJE.cjs.map} +1 -1
  31. package/dist/{chunk-C4KL7OQI.js → chunk-BW4WDUSI.js} +3 -3
  32. package/dist/{chunk-L66XBQM6.js → chunk-CP5EYMNL.js} +276 -160
  33. package/dist/chunk-CP5EYMNL.js.map +1 -0
  34. package/dist/{chunk-QOPQ6BCA.js → chunk-D44S2QLI.js} +3 -3
  35. package/dist/{chunk-CGVPUA4X.js → chunk-DB3TV4CW.js} +6 -6
  36. package/dist/{chunk-PITZMTGE.cjs → chunk-FEVLXRTC.cjs} +506 -390
  37. package/dist/chunk-FEVLXRTC.cjs.map +1 -0
  38. package/dist/{chunk-TYJITV3H.js → chunk-H4BPHGU5.js} +3 -3
  39. package/dist/{chunk-C7Q2PVHD.cjs → chunk-H54EPP3P.cjs} +7 -7
  40. package/dist/{chunk-C7Q2PVHD.cjs.map → chunk-H54EPP3P.cjs.map} +1 -1
  41. package/dist/{chunk-NWAUHBYH.js → chunk-HGA74X35.js} +4 -4
  42. package/dist/{chunk-4C3MS2G6.cjs → chunk-HHJVIHVR.cjs} +81 -81
  43. package/dist/{chunk-4C3MS2G6.cjs.map → chunk-HHJVIHVR.cjs.map} +1 -1
  44. package/dist/{chunk-3XFMM34I.cjs → chunk-IFYQ7DHV.cjs} +48 -48
  45. package/dist/{chunk-3XFMM34I.cjs.map → chunk-IFYQ7DHV.cjs.map} +1 -1
  46. package/dist/{chunk-QYQXAXVR.cjs → chunk-IKDC3R7V.cjs} +4 -3
  47. package/dist/chunk-IKDC3R7V.cjs.map +1 -0
  48. package/dist/{chunk-W6JA6SFD.js → chunk-JRYS4VMV.js} +45 -45
  49. package/dist/chunk-JRYS4VMV.js.map +1 -0
  50. package/dist/{chunk-AT4WAFJO.js → chunk-L2CF2QZW.js} +7 -7
  51. package/dist/{chunk-2BFZHTSD.cjs → chunk-LEISUAHF.cjs} +18 -8
  52. package/dist/chunk-LEISUAHF.cjs.map +1 -0
  53. package/dist/{chunk-AAHKPPGQ.cjs → chunk-M5GWCMYE.cjs} +42 -42
  54. package/dist/{chunk-AAHKPPGQ.cjs.map → chunk-M5GWCMYE.cjs.map} +1 -1
  55. package/dist/{chunk-PQETCTJ4.js → chunk-MXOSTJAG.js} +4 -3
  56. package/dist/chunk-MXOSTJAG.js.map +1 -0
  57. package/dist/{chunk-653A7FPP.cjs → chunk-NPVDKOGD.cjs} +22 -22
  58. package/dist/{chunk-653A7FPP.cjs.map → chunk-NPVDKOGD.cjs.map} +1 -1
  59. package/dist/{chunk-2ML5QEDH.js → chunk-O2FTVZOD.js} +5 -5
  60. package/dist/{chunk-OCSAB6NT.cjs → chunk-OGZAFM6M.cjs} +5 -5
  61. package/dist/{chunk-OCSAB6NT.cjs.map → chunk-OGZAFM6M.cjs.map} +1 -1
  62. package/dist/{chunk-CSBNQJSI.js → chunk-PMENIZXI.js} +6 -6
  63. package/dist/{chunk-PFTEG6L7.js → chunk-PWOYEUIQ.js} +7 -7
  64. package/dist/{chunk-KXLJT5U5.js → chunk-QCP2KV7P.js} +5 -5
  65. package/dist/{chunk-6QDW4CDG.js → chunk-QGJYWLF4.js} +2 -2
  66. package/dist/{chunk-VLRXLTR4.cjs → chunk-RKGOVTXZ.cjs} +377 -214
  67. package/dist/chunk-RKGOVTXZ.cjs.map +1 -0
  68. package/dist/{chunk-HM2R5MDR.js → chunk-T5HDPHN6.js} +13 -3
  69. package/dist/chunk-T5HDPHN6.js.map +1 -0
  70. package/dist/{chunk-GP2QLZIN.cjs → chunk-YW4WBNYV.cjs} +37 -37
  71. package/dist/{chunk-GP2QLZIN.cjs.map → chunk-YW4WBNYV.cjs.map} +1 -1
  72. package/dist/{chunk-36NFJULV.cjs → chunk-ZI27ALYX.cjs} +41 -41
  73. package/dist/chunk-ZI27ALYX.cjs.map +1 -0
  74. package/dist/components/case-studies/index.cjs +12 -12
  75. package/dist/components/case-studies/index.js +6 -6
  76. package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
  77. package/dist/components/chat/guide-display.d.ts +14 -0
  78. package/dist/components/chat/guide-display.d.ts.map +1 -0
  79. package/dist/components/chat/index.cjs +11 -3
  80. package/dist/components/chat/index.cjs.map +1 -1
  81. package/dist/components/chat/index.d.ts +1 -0
  82. package/dist/components/chat/index.d.ts.map +1 -1
  83. package/dist/components/chat/index.js +10 -2
  84. package/dist/components/chat/stream/chat-stream-reducer.d.ts +9 -0
  85. package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
  86. package/dist/components/chat/stream/delta-batcher.d.ts +3 -3
  87. package/dist/components/chat/stream/delta-batcher.d.ts.map +1 -1
  88. package/dist/components/chat/stream/message-mutations.d.ts.map +1 -1
  89. package/dist/components/chat/types/component.types.d.ts +6 -0
  90. package/dist/components/chat/types/component.types.d.ts.map +1 -1
  91. package/dist/components/chat/types/message.types.d.ts +30 -2
  92. package/dist/components/chat/types/message.types.d.ts.map +1 -1
  93. package/dist/components/chat/types/network.types.d.ts +3 -1
  94. package/dist/components/chat/types/network.types.d.ts.map +1 -1
  95. package/dist/components/chat/types/processing.types.d.ts +4 -1
  96. package/dist/components/chat/types/processing.types.d.ts.map +1 -1
  97. package/dist/components/chat/utils/approval-display.d.ts +36 -8
  98. package/dist/components/chat/utils/approval-display.d.ts.map +1 -1
  99. package/dist/components/chat/utils/extract-incomplete-message-state.d.ts.map +1 -1
  100. package/dist/components/chat/utils/index.d.ts +1 -1
  101. package/dist/components/chat/utils/index.d.ts.map +1 -1
  102. package/dist/components/chat/utils/message-segment-accumulator.d.ts +16 -4
  103. package/dist/components/chat/utils/message-segment-accumulator.d.ts.map +1 -1
  104. package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
  105. package/dist/components/chat/utils/resolve-fetched-card-href.d.ts +1 -1
  106. package/dist/components/contact/index.cjs +7 -7
  107. package/dist/components/contact/index.js +6 -6
  108. package/dist/components/docs/index.cjs +10 -10
  109. package/dist/components/docs/index.js +9 -9
  110. package/dist/components/embeds/index.cjs +7 -7
  111. package/dist/components/embeds/index.js +6 -6
  112. package/dist/components/faq/index.cjs +7 -7
  113. package/dist/components/faq/index.js +6 -6
  114. package/dist/components/features/board/board.d.ts.map +1 -1
  115. package/dist/components/features/index.cjs +8 -6
  116. package/dist/components/features/index.cjs.map +1 -1
  117. package/dist/components/features/index.js +7 -5
  118. package/dist/components/features/sortable-list/index.d.ts +2 -1
  119. package/dist/components/features/sortable-list/index.d.ts.map +1 -1
  120. package/dist/components/features/sortable-list/sortable-list.d.ts +8 -1
  121. package/dist/components/features/sortable-list/sortable-list.d.ts.map +1 -1
  122. package/dist/components/features/sortable-list/sortable-move-buttons.d.ts +24 -0
  123. package/dist/components/features/sortable-list/sortable-move-buttons.d.ts.map +1 -0
  124. package/dist/components/features/sortable-list/use-sortable-item.d.ts +12 -4
  125. package/dist/components/features/sortable-list/use-sortable-item.d.ts.map +1 -1
  126. package/dist/components/features/ticket-status-config-list/ticket-status-config-list.d.ts +21 -5
  127. package/dist/components/features/ticket-status-config-list/ticket-status-config-list.d.ts.map +1 -1
  128. package/dist/components/help-center-pages/index.cjs +26 -26
  129. package/dist/components/help-center-pages/index.js +17 -17
  130. package/dist/components/index.cjs +139 -129
  131. package/dist/components/index.cjs.map +1 -1
  132. package/dist/components/index.js +26 -16
  133. package/dist/components/index.js.map +1 -1
  134. package/dist/components/meeting-scheduler/index.cjs +37 -37
  135. package/dist/components/meeting-scheduler/index.js +5 -5
  136. package/dist/components/navigation/index.cjs +9 -9
  137. package/dist/components/navigation/index.js +8 -8
  138. package/dist/components/onboarding-guides/index.cjs +9 -9
  139. package/dist/components/onboarding-guides/index.js +8 -8
  140. package/dist/components/tickets/index.cjs +10 -10
  141. package/dist/components/tickets/index.js +9 -9
  142. package/dist/components/ui/file-manager/index.cjs +4 -4
  143. package/dist/components/ui/file-manager/index.js +1 -1
  144. package/dist/components/ui/index.cjs +14 -6
  145. package/dist/components/ui/index.cjs.map +1 -1
  146. package/dist/components/ui/index.js +13 -5
  147. package/dist/components/ui/input.d.ts +2 -0
  148. package/dist/components/ui/input.d.ts.map +1 -1
  149. package/dist/components/ui/textarea.d.ts +2 -0
  150. package/dist/components/ui/textarea.d.ts.map +1 -1
  151. package/dist/components/ui/ticket-status-config-row.d.ts +10 -4
  152. package/dist/components/ui/ticket-status-config-row.d.ts.map +1 -1
  153. package/dist/hooks/index.cjs +7 -3
  154. package/dist/hooks/index.cjs.map +1 -1
  155. package/dist/hooks/index.js +6 -2
  156. package/dist/hooks/ui/index.d.ts +1 -0
  157. package/dist/hooks/ui/index.d.ts.map +1 -1
  158. package/dist/hooks/ui/use-drag-and-drop-enabled.d.ts +31 -0
  159. package/dist/hooks/ui/use-drag-and-drop-enabled.d.ts.map +1 -0
  160. package/dist/hooks/ui/use-media-query.d.ts.map +1 -1
  161. package/dist/index.cjs +25 -11
  162. package/dist/index.cjs.map +1 -1
  163. package/dist/index.js +23 -9
  164. package/dist/index.js.map +1 -1
  165. package/dist/utils/index.cjs.map +1 -1
  166. package/dist/utils/index.js.map +1 -1
  167. package/package.json +1 -4
  168. package/src/chat-protocol/__tests__/__snapshots__/nats-decoder-golden.test.ts.snap +80 -0
  169. package/src/chat-protocol/__tests__/nats-decoder-golden.test.ts +118 -1
  170. package/src/chat-protocol/decode.ts +4 -3
  171. package/src/chat-protocol/events.ts +51 -0
  172. package/src/chat-protocol/leading-frames.ts +9 -3
  173. package/src/chat-protocol/nats-decoder.ts +110 -1
  174. package/src/components/chat/__tests__/chat-pending-turn.test.tsx +19 -0
  175. package/src/components/chat/chat-message-enhanced.tsx +13 -1
  176. package/src/components/chat/guide-display.tsx +42 -0
  177. package/src/components/chat/index.ts +1 -0
  178. package/src/components/chat/stream/__tests__/chat-stream-reducer.test.ts +90 -0
  179. package/src/components/chat/stream/chat-dialog-store.ts +1 -1
  180. package/src/components/chat/stream/chat-stream-reducer.ts +49 -11
  181. package/src/components/chat/stream/delta-batcher.ts +9 -4
  182. package/src/components/chat/stream/message-mutations.ts +2 -0
  183. package/src/components/chat/types/component.types.ts +9 -0
  184. package/src/components/chat/types/message.types.ts +32 -0
  185. package/src/components/chat/types/network.types.ts +3 -1
  186. package/src/components/chat/types/processing.types.ts +4 -1
  187. package/src/components/chat/utils/__tests__/process-historical-messages-approvals.test.ts +93 -0
  188. package/src/components/chat/utils/__tests__/process-historical-messages-golden.test.ts +78 -1
  189. package/src/components/chat/utils/approval-display.ts +53 -8
  190. package/src/components/chat/utils/extract-incomplete-message-state.ts +1 -0
  191. package/src/components/chat/utils/index.ts +6 -1
  192. package/src/components/chat/utils/message-segment-accumulator.ts +37 -3
  193. package/src/components/chat/utils/process-historical-messages.ts +44 -7
  194. package/src/components/chat/utils/resolve-fetched-card-href.ts +1 -1
  195. package/src/components/features/board/.board.md +1 -0
  196. package/src/components/features/board/board.tsx +11 -1
  197. package/src/components/features/sortable-list/.sortable-list.md +23 -12
  198. package/src/components/features/sortable-list/index.ts +2 -1
  199. package/src/components/features/sortable-list/sortable-list.tsx +16 -5
  200. package/src/components/features/sortable-list/sortable-move-buttons.tsx +81 -0
  201. package/src/components/features/sortable-list/use-sortable-item.ts +25 -13
  202. package/src/components/features/ticket-status-config-list/ticket-status-config-list.tsx +55 -62
  203. package/src/components/ui/.ticket-status-config-row.md +11 -9
  204. package/src/components/ui/input.tsx +5 -2
  205. package/src/components/ui/textarea.tsx +5 -2
  206. package/src/components/ui/ticket-status-config-row.tsx +162 -70
  207. package/src/hooks/ui/.index.md +1 -0
  208. package/src/hooks/ui/.use-drag-and-drop-enabled.md +32 -0
  209. package/src/hooks/ui/index.ts +1 -0
  210. package/src/hooks/ui/use-drag-and-drop-enabled.ts +37 -0
  211. package/src/hooks/ui/use-media-query.ts +3 -2
  212. package/src/stories/ChatMessageEnhanced.stories.tsx +7 -3
  213. package/dist/chunk-2BFZHTSD.cjs.map +0 -1
  214. package/dist/chunk-36NFJULV.cjs.map +0 -1
  215. package/dist/chunk-DBP7S75Q.js.map +0 -1
  216. package/dist/chunk-HM2R5MDR.js.map +0 -1
  217. package/dist/chunk-L66XBQM6.js.map +0 -1
  218. package/dist/chunk-PITZMTGE.cjs.map +0 -1
  219. package/dist/chunk-PQETCTJ4.js.map +0 -1
  220. package/dist/chunk-QYQXAXVR.cjs.map +0 -1
  221. package/dist/chunk-VLRXLTR4.cjs.map +0 -1
  222. package/dist/chunk-W6JA6SFD.js.map +0 -1
  223. /package/dist/{chunk-XJ45MHWI.js.map → chunk-4WSKSNXL.js.map} +0 -0
  224. /package/dist/{chunk-ZCEQLHU3.js.map → chunk-5Y6TPFW7.js.map} +0 -0
  225. /package/dist/{chunk-RXZWUJEB.js.map → chunk-AKPLEWMH.js.map} +0 -0
  226. /package/dist/{chunk-C4KL7OQI.js.map → chunk-BW4WDUSI.js.map} +0 -0
  227. /package/dist/{chunk-QOPQ6BCA.js.map → chunk-D44S2QLI.js.map} +0 -0
  228. /package/dist/{chunk-CGVPUA4X.js.map → chunk-DB3TV4CW.js.map} +0 -0
  229. /package/dist/{chunk-TYJITV3H.js.map → chunk-H4BPHGU5.js.map} +0 -0
  230. /package/dist/{chunk-NWAUHBYH.js.map → chunk-HGA74X35.js.map} +0 -0
  231. /package/dist/{chunk-AT4WAFJO.js.map → chunk-L2CF2QZW.js.map} +0 -0
  232. /package/dist/{chunk-2ML5QEDH.js.map → chunk-O2FTVZOD.js.map} +0 -0
  233. /package/dist/{chunk-CSBNQJSI.js.map → chunk-PMENIZXI.js.map} +0 -0
  234. /package/dist/{chunk-PFTEG6L7.js.map → chunk-PWOYEUIQ.js.map} +0 -0
  235. /package/dist/{chunk-KXLJT5U5.js.map → chunk-QCP2KV7P.js.map} +0 -0
  236. /package/dist/{chunk-6QDW4CDG.js.map → chunk-QGJYWLF4.js.map} +0 -0
@@ -0,0 +1,32 @@
1
+ <!-- source-hash: manual -->
2
+ The one rule for whether drag-and-drop is initialized anywhere in the UI. `SortableList` and
3
+ `Board` consume it themselves, so hosts get correct touch behavior without wiring anything.
4
+
5
+ ## Key Components
6
+
7
+ | Export | Type | Description |
8
+ |---|---|---|
9
+ | `useDragAndDropEnabled` | Hook | `true` only when `(pointer: fine) and (hover: hover) and (min-width: 800px)` matches |
10
+ | `DRAG_AND_DROP_MEDIA_QUERY` | Const | The query itself, composed from `breakpoints.md` — no new breakpoint |
11
+
12
+ ## Why pointer type AND breakpoint
13
+
14
+ - A breakpoint alone fails on tablets: an iPad in landscape is 1024-1366px wide and would pass any
15
+ sane `min-width` — exactly the case being excluded, because the HTML5 drag-and-drop API Pragmatic
16
+ builds on does not fire under touch.
17
+ - `pointer: coarse` alone fails the other way: a touchscreen laptop with a trackpad reports
18
+ `pointer: fine` and should keep DnD, but in a narrow window its lists collapse to the mobile
19
+ layout where a drag handle is out of place.
20
+ - No `'ontouchstart' in window`, no UA sniffing: the first is true on touch laptops, the second is
21
+ neither accurate nor reactive. A media query re-evaluates live when a mouse is attached or the
22
+ window resizes.
23
+
24
+ ## SSR
25
+
26
+ Returns `false` during SSR and the first client render (`useMediaQuery` is still `undefined`):
27
+ DnD off means no dead drag handle in server HTML, and the layout effect settles the real answer
28
+ before first paint, so a desktop user never sees the touch fallback flash.
29
+
30
+ ## Source
31
+
32
+ [`use-drag-and-drop-enabled.ts`](https://github.com/flamingo-stack/openframe-oss-lib/blob/main/use-drag-and-drop-enabled.ts)
@@ -2,6 +2,7 @@
2
2
  export * from './use-auto-limit-tags';
3
3
  export * from './use-debounce';
4
4
  export * from './use-deferred-error';
5
+ export * from './use-drag-and-drop-enabled';
5
6
  export * from './use-focus-trap';
6
7
  export * from './use-header-height';
7
8
  export * from './use-horizontal-scrollbar';
@@ -0,0 +1,37 @@
1
+ 'use client';
2
+
3
+ import { breakpoints, useMediaQuery } from './use-media-query';
4
+
5
+ /**
6
+ * The one rule for whether drag-and-drop is initialized at all.
7
+ *
8
+ * Pointer type AND breakpoint, never either alone:
9
+ * - A breakpoint alone fails on tablets: an iPad in landscape is 1024-1366px
10
+ * wide and would pass any sane `min-width` — exactly the case being excluded,
11
+ * because the HTML5 drag-and-drop API Pragmatic builds on does not fire under
12
+ * touch.
13
+ * - `pointer: coarse` alone fails the other way: a touchscreen laptop with a
14
+ * trackpad reports `pointer: fine` and should keep DnD, but in a narrow
15
+ * window its lists collapse to the mobile layout where a drag handle is out
16
+ * of place.
17
+ * - No `'ontouchstart' in window`, no UA sniffing: the first is true on touch
18
+ * laptops, the second is neither accurate nor reactive. A media query
19
+ * re-evaluates live when a mouse is attached or the window resizes.
20
+ *
21
+ * `breakpoints.md` (800px) is the existing tablet step — no new breakpoint.
22
+ */
23
+ export const DRAG_AND_DROP_MEDIA_QUERY = `(pointer: fine) and (hover: hover) and ${breakpoints.md}`;
24
+
25
+ /**
26
+ * Whether drag-and-drop should be available on this device/viewport.
27
+ *
28
+ * `false` on touch/narrow screens — there the reordering surfaces render
29
+ * explicit controls (`SortableMoveButtons`) instead of a drag handle, and no
30
+ * DnD is initialized at all. Also `false` during SSR and the first client
31
+ * render (`useMediaQuery` is still `undefined`): defaulting to "off" renders
32
+ * no dead drag handle, and the underlying layout effect settles the real
33
+ * answer before first paint, so a desktop user never sees the fallback flash.
34
+ */
35
+ export function useDragAndDropEnabled(): boolean {
36
+ return useMediaQuery(DRAG_AND_DROP_MEDIA_QUERY) ?? false;
37
+ }
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
- import { useLayoutEffect, useState } from 'react';
3
+ import { useState } from 'react';
4
+ import { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect';
4
5
 
5
6
  /**
6
7
  * Hook to check if a media query matches
@@ -10,7 +11,7 @@ import { useLayoutEffect, useState } from 'react';
10
11
  export function useMediaQuery(query: string): boolean | undefined {
11
12
  const [matches, setMatches] = useState<boolean | undefined>(undefined);
12
13
 
13
- useLayoutEffect(() => {
14
+ useIsomorphicLayoutEffect(() => {
14
15
  const matchMedia = window.matchMedia(query);
15
16
 
16
17
  const handleChange = () => {
@@ -210,18 +210,18 @@ export const GuideWithEntityCards: Story = {
210
210
  ) : null,
211
211
  content: [
212
212
  {
213
- type: 'text',
213
+ type: 'guide',
214
214
  text: "Here's how to create a monitoring policy (check) in OpenFrame:\n\n[card://onboarding_guide:first-check]\n\nStep-by-step:\n\n1. Go to Monitoring → Policies → Add Policy\n2. Write your osquery SQL query\n3. Save the policy",
215
215
  },
216
216
  {
217
217
  type: 'text',
218
- text: 'A second text segment renders its own marker identically:\n\n[card://onboarding_guide:add-devices]',
218
+ text: 'A plain text segment renders its own marker identically:\n\n[card://onboarding_guide:add-devices]',
219
219
  },
220
220
  ] satisfies MessageSegment[],
221
221
  },
222
222
  };
223
223
 
224
- /** Every remaining segment type in one message — thinking, tool execution, context compaction, error. */
224
+ /** Every remaining segment type in one message — thinking, guide, tool execution, context compaction, error. */
225
225
  export const AllSegmentTypes: Story = {
226
226
  args: {
227
227
  role: 'assistant',
@@ -233,6 +233,10 @@ export const AllSegmentTypes: Story = {
233
233
  text: 'The user wants Slack installed. Homebrew is present on the endpoint, so `brew install --cask slack` is the cleanest path.',
234
234
  },
235
235
  { type: 'text', text: 'Installing Slack now.' },
236
+ {
237
+ type: 'guide',
238
+ text: "Here's how to create a monitoring policy (check) in OpenFrame:\n\nStep-by-step:\n\n1. Go to Monitoring → Policies → Add Policy\n2. Give it a Name (something descriptive)\n3. Write your osquery SQL query — the query should return rows for devices that fail the check\n4. Set the interval — how often each device runs the check\n5. Save the policy",
239
+ },
236
240
  {
237
241
  type: 'tool_execution',
238
242
  data: {