@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.
- package/dist/chat-protocol/decode.d.ts.map +1 -1
- package/dist/chat-protocol/events.d.ts +47 -1
- package/dist/chat-protocol/events.d.ts.map +1 -1
- package/dist/chat-protocol/index.cjs +51 -0
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.js +48 -1
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/chat-protocol/leading-frames.d.ts +9 -3
- package/dist/chat-protocol/leading-frames.d.ts.map +1 -1
- package/dist/chat-protocol/nats-decoder.d.ts +41 -0
- package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
- package/dist/{chunk-3B42TFEE.cjs → chunk-36TJYCF3.cjs} +27 -27
- package/dist/{chunk-3B42TFEE.cjs.map → chunk-36TJYCF3.cjs.map} +1 -1
- package/dist/{chunk-YYEVFC3K.cjs → chunk-37XJYOAY.cjs} +17 -17
- package/dist/{chunk-YYEVFC3K.cjs.map → chunk-37XJYOAY.cjs.map} +1 -1
- package/dist/{chunk-DBP7S75Q.js → chunk-3AX3ZEY3.js} +1481 -1318
- package/dist/chunk-3AX3ZEY3.js.map +1 -0
- package/dist/{chunk-DGB2FLFH.cjs → chunk-4FJSN2XW.cjs} +10 -10
- package/dist/{chunk-DGB2FLFH.cjs.map → chunk-4FJSN2XW.cjs.map} +1 -1
- package/dist/{chunk-WHSSI3S7.cjs → chunk-4HGRXFQP.cjs} +3 -3
- package/dist/{chunk-WHSSI3S7.cjs.map → chunk-4HGRXFQP.cjs.map} +1 -1
- package/dist/{chunk-SY5HCZZO.cjs → chunk-4LZ7B5H5.cjs} +5 -5
- package/dist/{chunk-SY5HCZZO.cjs.map → chunk-4LZ7B5H5.cjs.map} +1 -1
- package/dist/{chunk-XJ45MHWI.js → chunk-4WSKSNXL.js} +9 -9
- package/dist/{chunk-ZCEQLHU3.js → chunk-5Y6TPFW7.js} +5 -5
- package/dist/{chunk-EVTRRDIH.cjs → chunk-A6C5HOD7.cjs} +23 -23
- package/dist/{chunk-EVTRRDIH.cjs.map → chunk-A6C5HOD7.cjs.map} +1 -1
- package/dist/{chunk-RXZWUJEB.js → chunk-AKPLEWMH.js} +2 -2
- package/dist/{chunk-7WKFLOC7.cjs → chunk-BCJQ7CJE.cjs} +11 -11
- package/dist/{chunk-7WKFLOC7.cjs.map → chunk-BCJQ7CJE.cjs.map} +1 -1
- package/dist/{chunk-C4KL7OQI.js → chunk-BW4WDUSI.js} +3 -3
- package/dist/{chunk-L66XBQM6.js → chunk-CP5EYMNL.js} +276 -160
- package/dist/chunk-CP5EYMNL.js.map +1 -0
- package/dist/{chunk-QOPQ6BCA.js → chunk-D44S2QLI.js} +3 -3
- package/dist/{chunk-CGVPUA4X.js → chunk-DB3TV4CW.js} +6 -6
- package/dist/{chunk-PITZMTGE.cjs → chunk-FEVLXRTC.cjs} +506 -390
- package/dist/chunk-FEVLXRTC.cjs.map +1 -0
- package/dist/{chunk-TYJITV3H.js → chunk-H4BPHGU5.js} +3 -3
- package/dist/{chunk-C7Q2PVHD.cjs → chunk-H54EPP3P.cjs} +7 -7
- package/dist/{chunk-C7Q2PVHD.cjs.map → chunk-H54EPP3P.cjs.map} +1 -1
- package/dist/{chunk-NWAUHBYH.js → chunk-HGA74X35.js} +4 -4
- package/dist/{chunk-4C3MS2G6.cjs → chunk-HHJVIHVR.cjs} +81 -81
- package/dist/{chunk-4C3MS2G6.cjs.map → chunk-HHJVIHVR.cjs.map} +1 -1
- package/dist/{chunk-3XFMM34I.cjs → chunk-IFYQ7DHV.cjs} +48 -48
- package/dist/{chunk-3XFMM34I.cjs.map → chunk-IFYQ7DHV.cjs.map} +1 -1
- package/dist/{chunk-QYQXAXVR.cjs → chunk-IKDC3R7V.cjs} +4 -3
- package/dist/chunk-IKDC3R7V.cjs.map +1 -0
- package/dist/{chunk-W6JA6SFD.js → chunk-JRYS4VMV.js} +45 -45
- package/dist/chunk-JRYS4VMV.js.map +1 -0
- package/dist/{chunk-AT4WAFJO.js → chunk-L2CF2QZW.js} +7 -7
- package/dist/{chunk-2BFZHTSD.cjs → chunk-LEISUAHF.cjs} +18 -8
- package/dist/chunk-LEISUAHF.cjs.map +1 -0
- package/dist/{chunk-AAHKPPGQ.cjs → chunk-M5GWCMYE.cjs} +42 -42
- package/dist/{chunk-AAHKPPGQ.cjs.map → chunk-M5GWCMYE.cjs.map} +1 -1
- package/dist/{chunk-PQETCTJ4.js → chunk-MXOSTJAG.js} +4 -3
- package/dist/chunk-MXOSTJAG.js.map +1 -0
- package/dist/{chunk-653A7FPP.cjs → chunk-NPVDKOGD.cjs} +22 -22
- package/dist/{chunk-653A7FPP.cjs.map → chunk-NPVDKOGD.cjs.map} +1 -1
- package/dist/{chunk-2ML5QEDH.js → chunk-O2FTVZOD.js} +5 -5
- package/dist/{chunk-OCSAB6NT.cjs → chunk-OGZAFM6M.cjs} +5 -5
- package/dist/{chunk-OCSAB6NT.cjs.map → chunk-OGZAFM6M.cjs.map} +1 -1
- package/dist/{chunk-CSBNQJSI.js → chunk-PMENIZXI.js} +6 -6
- package/dist/{chunk-PFTEG6L7.js → chunk-PWOYEUIQ.js} +7 -7
- package/dist/{chunk-KXLJT5U5.js → chunk-QCP2KV7P.js} +5 -5
- package/dist/{chunk-6QDW4CDG.js → chunk-QGJYWLF4.js} +2 -2
- package/dist/{chunk-VLRXLTR4.cjs → chunk-RKGOVTXZ.cjs} +377 -214
- package/dist/chunk-RKGOVTXZ.cjs.map +1 -0
- package/dist/{chunk-HM2R5MDR.js → chunk-T5HDPHN6.js} +13 -3
- package/dist/chunk-T5HDPHN6.js.map +1 -0
- package/dist/{chunk-GP2QLZIN.cjs → chunk-YW4WBNYV.cjs} +37 -37
- package/dist/{chunk-GP2QLZIN.cjs.map → chunk-YW4WBNYV.cjs.map} +1 -1
- package/dist/{chunk-36NFJULV.cjs → chunk-ZI27ALYX.cjs} +41 -41
- package/dist/chunk-ZI27ALYX.cjs.map +1 -0
- package/dist/components/case-studies/index.cjs +12 -12
- package/dist/components/case-studies/index.js +6 -6
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/guide-display.d.ts +14 -0
- package/dist/components/chat/guide-display.d.ts.map +1 -0
- package/dist/components/chat/index.cjs +11 -3
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.d.ts +1 -0
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +10 -2
- package/dist/components/chat/stream/chat-stream-reducer.d.ts +9 -0
- package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
- package/dist/components/chat/stream/delta-batcher.d.ts +3 -3
- package/dist/components/chat/stream/delta-batcher.d.ts.map +1 -1
- package/dist/components/chat/stream/message-mutations.d.ts.map +1 -1
- package/dist/components/chat/types/component.types.d.ts +6 -0
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/chat/types/message.types.d.ts +30 -2
- package/dist/components/chat/types/message.types.d.ts.map +1 -1
- package/dist/components/chat/types/network.types.d.ts +3 -1
- package/dist/components/chat/types/network.types.d.ts.map +1 -1
- package/dist/components/chat/types/processing.types.d.ts +4 -1
- package/dist/components/chat/types/processing.types.d.ts.map +1 -1
- package/dist/components/chat/utils/approval-display.d.ts +36 -8
- package/dist/components/chat/utils/approval-display.d.ts.map +1 -1
- package/dist/components/chat/utils/extract-incomplete-message-state.d.ts.map +1 -1
- package/dist/components/chat/utils/index.d.ts +1 -1
- package/dist/components/chat/utils/index.d.ts.map +1 -1
- package/dist/components/chat/utils/message-segment-accumulator.d.ts +16 -4
- package/dist/components/chat/utils/message-segment-accumulator.d.ts.map +1 -1
- package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
- package/dist/components/chat/utils/resolve-fetched-card-href.d.ts +1 -1
- package/dist/components/contact/index.cjs +7 -7
- package/dist/components/contact/index.js +6 -6
- package/dist/components/docs/index.cjs +10 -10
- package/dist/components/docs/index.js +9 -9
- package/dist/components/embeds/index.cjs +7 -7
- package/dist/components/embeds/index.js +6 -6
- package/dist/components/faq/index.cjs +7 -7
- package/dist/components/faq/index.js +6 -6
- package/dist/components/features/board/board.d.ts.map +1 -1
- package/dist/components/features/index.cjs +8 -6
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +7 -5
- package/dist/components/features/sortable-list/index.d.ts +2 -1
- package/dist/components/features/sortable-list/index.d.ts.map +1 -1
- package/dist/components/features/sortable-list/sortable-list.d.ts +8 -1
- package/dist/components/features/sortable-list/sortable-list.d.ts.map +1 -1
- package/dist/components/features/sortable-list/sortable-move-buttons.d.ts +24 -0
- package/dist/components/features/sortable-list/sortable-move-buttons.d.ts.map +1 -0
- package/dist/components/features/sortable-list/use-sortable-item.d.ts +12 -4
- package/dist/components/features/sortable-list/use-sortable-item.d.ts.map +1 -1
- package/dist/components/features/ticket-status-config-list/ticket-status-config-list.d.ts +21 -5
- package/dist/components/features/ticket-status-config-list/ticket-status-config-list.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +26 -26
- package/dist/components/help-center-pages/index.js +17 -17
- package/dist/components/index.cjs +139 -129
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +26 -16
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +37 -37
- package/dist/components/meeting-scheduler/index.js +5 -5
- package/dist/components/navigation/index.cjs +9 -9
- package/dist/components/navigation/index.js +8 -8
- package/dist/components/onboarding-guides/index.cjs +9 -9
- package/dist/components/onboarding-guides/index.js +8 -8
- package/dist/components/tickets/index.cjs +10 -10
- package/dist/components/tickets/index.js +9 -9
- package/dist/components/ui/file-manager/index.cjs +4 -4
- package/dist/components/ui/file-manager/index.js +1 -1
- package/dist/components/ui/index.cjs +14 -6
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +13 -5
- package/dist/components/ui/input.d.ts +2 -0
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/textarea.d.ts +2 -0
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/ticket-status-config-row.d.ts +10 -4
- package/dist/components/ui/ticket-status-config-row.d.ts.map +1 -1
- package/dist/hooks/index.cjs +7 -3
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +6 -2
- package/dist/hooks/ui/index.d.ts +1 -0
- package/dist/hooks/ui/index.d.ts.map +1 -1
- package/dist/hooks/ui/use-drag-and-drop-enabled.d.ts +31 -0
- package/dist/hooks/ui/use-drag-and-drop-enabled.d.ts.map +1 -0
- package/dist/hooks/ui/use-media-query.d.ts.map +1 -1
- package/dist/index.cjs +25 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -9
- package/dist/index.js.map +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -4
- package/src/chat-protocol/__tests__/__snapshots__/nats-decoder-golden.test.ts.snap +80 -0
- package/src/chat-protocol/__tests__/nats-decoder-golden.test.ts +118 -1
- package/src/chat-protocol/decode.ts +4 -3
- package/src/chat-protocol/events.ts +51 -0
- package/src/chat-protocol/leading-frames.ts +9 -3
- package/src/chat-protocol/nats-decoder.ts +110 -1
- package/src/components/chat/__tests__/chat-pending-turn.test.tsx +19 -0
- package/src/components/chat/chat-message-enhanced.tsx +13 -1
- package/src/components/chat/guide-display.tsx +42 -0
- package/src/components/chat/index.ts +1 -0
- package/src/components/chat/stream/__tests__/chat-stream-reducer.test.ts +90 -0
- package/src/components/chat/stream/chat-dialog-store.ts +1 -1
- package/src/components/chat/stream/chat-stream-reducer.ts +49 -11
- package/src/components/chat/stream/delta-batcher.ts +9 -4
- package/src/components/chat/stream/message-mutations.ts +2 -0
- package/src/components/chat/types/component.types.ts +9 -0
- package/src/components/chat/types/message.types.ts +32 -0
- package/src/components/chat/types/network.types.ts +3 -1
- package/src/components/chat/types/processing.types.ts +4 -1
- package/src/components/chat/utils/__tests__/process-historical-messages-approvals.test.ts +93 -0
- package/src/components/chat/utils/__tests__/process-historical-messages-golden.test.ts +78 -1
- package/src/components/chat/utils/approval-display.ts +53 -8
- package/src/components/chat/utils/extract-incomplete-message-state.ts +1 -0
- package/src/components/chat/utils/index.ts +6 -1
- package/src/components/chat/utils/message-segment-accumulator.ts +37 -3
- package/src/components/chat/utils/process-historical-messages.ts +44 -7
- package/src/components/chat/utils/resolve-fetched-card-href.ts +1 -1
- package/src/components/features/board/.board.md +1 -0
- package/src/components/features/board/board.tsx +11 -1
- package/src/components/features/sortable-list/.sortable-list.md +23 -12
- package/src/components/features/sortable-list/index.ts +2 -1
- package/src/components/features/sortable-list/sortable-list.tsx +16 -5
- package/src/components/features/sortable-list/sortable-move-buttons.tsx +81 -0
- package/src/components/features/sortable-list/use-sortable-item.ts +25 -13
- package/src/components/features/ticket-status-config-list/ticket-status-config-list.tsx +55 -62
- package/src/components/ui/.ticket-status-config-row.md +11 -9
- package/src/components/ui/input.tsx +5 -2
- package/src/components/ui/textarea.tsx +5 -2
- package/src/components/ui/ticket-status-config-row.tsx +162 -70
- package/src/hooks/ui/.index.md +1 -0
- package/src/hooks/ui/.use-drag-and-drop-enabled.md +32 -0
- package/src/hooks/ui/index.ts +1 -0
- package/src/hooks/ui/use-drag-and-drop-enabled.ts +37 -0
- package/src/hooks/ui/use-media-query.ts +3 -2
- package/src/stories/ChatMessageEnhanced.stories.tsx +7 -3
- package/dist/chunk-2BFZHTSD.cjs.map +0 -1
- package/dist/chunk-36NFJULV.cjs.map +0 -1
- package/dist/chunk-DBP7S75Q.js.map +0 -1
- package/dist/chunk-HM2R5MDR.js.map +0 -1
- package/dist/chunk-L66XBQM6.js.map +0 -1
- package/dist/chunk-PITZMTGE.cjs.map +0 -1
- package/dist/chunk-PQETCTJ4.js.map +0 -1
- package/dist/chunk-QYQXAXVR.cjs.map +0 -1
- package/dist/chunk-VLRXLTR4.cjs.map +0 -1
- package/dist/chunk-W6JA6SFD.js.map +0 -1
- /package/dist/{chunk-XJ45MHWI.js.map → chunk-4WSKSNXL.js.map} +0 -0
- /package/dist/{chunk-ZCEQLHU3.js.map → chunk-5Y6TPFW7.js.map} +0 -0
- /package/dist/{chunk-RXZWUJEB.js.map → chunk-AKPLEWMH.js.map} +0 -0
- /package/dist/{chunk-C4KL7OQI.js.map → chunk-BW4WDUSI.js.map} +0 -0
- /package/dist/{chunk-QOPQ6BCA.js.map → chunk-D44S2QLI.js.map} +0 -0
- /package/dist/{chunk-CGVPUA4X.js.map → chunk-DB3TV4CW.js.map} +0 -0
- /package/dist/{chunk-TYJITV3H.js.map → chunk-H4BPHGU5.js.map} +0 -0
- /package/dist/{chunk-NWAUHBYH.js.map → chunk-HGA74X35.js.map} +0 -0
- /package/dist/{chunk-AT4WAFJO.js.map → chunk-L2CF2QZW.js.map} +0 -0
- /package/dist/{chunk-2ML5QEDH.js.map → chunk-O2FTVZOD.js.map} +0 -0
- /package/dist/{chunk-CSBNQJSI.js.map → chunk-PMENIZXI.js.map} +0 -0
- /package/dist/{chunk-PFTEG6L7.js.map → chunk-PWOYEUIQ.js.map} +0 -0
- /package/dist/{chunk-KXLJT5U5.js.map → chunk-QCP2KV7P.js.map} +0 -0
- /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)
|
package/src/hooks/ui/index.ts
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
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: '
|
|
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
|
|
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: {
|