@lostgradient/cinder 0.15.0 → 0.16.0
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/CHANGELOG.md +6 -0
- package/README.md +3 -3
- package/components.json +2 -143
- package/dist/components/access-gate/index.js +379 -327
- package/dist/components/alert-dialog/index.js +170 -172
- package/dist/components/confirm-dialog/index.js +170 -172
- package/dist/components/drawer/index.js +11 -11
- package/dist/components/focus-trap/index.d.ts +1 -0
- package/dist/components/focus-trap/index.js +171 -1
- package/dist/components/icons/index.d.ts +80 -1
- package/dist/components/icons/index.js +1256 -0
- package/dist/components/markdown-editor/index.js +170 -170
- package/dist/components/modal/index.js +20 -20
- package/dist/components/review-editor/index.js +170 -187
- package/dist/components/sheet/index.js +11 -11
- package/dist/components/sidebar/index.js +37 -37
- package/dist/index.d.ts +0 -8
- package/dist/index.js +23202 -30173
- package/dist/server/components/access-gate/index.js +7 -10
- package/dist/server/components/alert-dialog/index.js +4 -4
- package/dist/server/components/approval-card/index.js +6 -6
- package/dist/server/components/autocomplete/index.js +4 -4
- package/dist/server/components/choice-grid/index.js +2 -2
- package/dist/server/components/color-field/index.js +2 -2
- package/dist/server/components/combobox/index.js +3 -3
- package/dist/server/components/command-item/index.js +3 -5
- package/dist/server/components/command-menu/index.js +3 -5
- package/dist/server/components/confirm-dialog/index.js +4 -4
- package/dist/server/components/context-menu/index.js +7 -7
- package/dist/server/components/data-table/index.js +3 -3
- package/dist/server/components/date-picker/index.js +4 -4
- package/dist/server/components/date-range-field/index.js +4 -4
- package/dist/server/components/diff-viewer/index.js +9 -11
- package/dist/server/components/drawer/index.js +4 -4
- package/dist/server/components/dropdown/index.js +7 -7
- package/dist/server/components/faceted-filter-bar/index.js +2 -2
- package/dist/server/components/focus-trap/index.js +7 -2
- package/dist/server/components/icons/index.js +156 -0
- package/dist/server/components/inline-loading/index.js +1 -1
- package/dist/server/components/json-schema-editor/index.js +11 -13
- package/dist/server/components/load-more/index.js +2 -3
- package/dist/server/components/markdown-editor/index.js +13 -12
- package/dist/server/components/menu-bar/index.js +4 -4
- package/dist/server/components/modal/index.js +4 -4
- package/dist/server/components/popover/index.js +3 -3
- package/dist/server/components/review-editor/index.js +169 -122
- package/dist/server/components/schedule-builder/index.js +5 -5
- package/dist/server/components/schema-form/index.js +1 -1
- package/dist/server/components/segment/index.js +3 -3
- package/dist/server/components/segmented-control/index.js +4 -4
- package/dist/server/components/selection-popover/index.js +3 -3
- package/dist/server/components/sheet/index.js +3 -3
- package/dist/server/components/sidebar/index.js +4 -4
- package/dist/server/components/table/index.js +3 -3
- package/dist/server/components/tag-input/index.js +2 -2
- package/dist/server/index.js +272 -316
- package/dist/server/{index.server-dwwqssey.js → index.server-0qh3v3nq.js} +1 -1
- package/dist/server/index.server-25wmev4e.js +2 -0
- package/dist/server/{index.server-zdm63dt8.js → index.server-2c56kqws.js} +107 -25
- package/dist/server/{index.server-y4n8vc08.js → index.server-2pc5cv6c.js} +1 -1
- package/dist/server/{index.server-1vsv7ngz.js → index.server-3g76h7z7.js} +12 -2
- package/dist/server/{index.server-xz99aed4.js → index.server-45n4s30n.js} +12 -12
- package/dist/server/{index.server-zzd5wpbw.js → index.server-4dfs3xwn.js} +1 -1
- package/dist/server/{index.server-vhyjjx9z.js → index.server-4jkqgp17.js} +7 -9
- package/dist/server/{index.server-bmxbsk4y.js → index.server-51sxnete.js} +18 -18
- package/dist/server/{index.server-1bwvsnjk.js → index.server-6rv1rfwq.js} +37 -14
- package/dist/server/{index.server-np3c7kx0.js → index.server-7798gc22.js} +1 -1
- package/dist/server/{index.server-2m1kenak.js → index.server-7kjw6qw5.js} +1 -1
- package/dist/server/{index.server-tfftb7hs.js → index.server-7zpzspk6.js} +1 -1
- package/dist/server/{index.server-7yvpb6z7.js → index.server-894t97kv.js} +4 -4
- package/dist/server/{index.server-47v2fhp4.js → index.server-8b35ekqg.js} +1 -1
- package/dist/server/{index.server-j5hn2qds.js → index.server-8nm871y8.js} +80 -30
- package/dist/server/{index.server-h0cvwvhy.js → index.server-9drzqktm.js} +1 -1
- package/dist/server/{index.server-x9s4m9eg.js → index.server-agsdwg53.js} +1 -1
- package/dist/server/{index.server-hpeavvnq.js → index.server-b4gp066a.js} +1 -1
- package/dist/server/{index.server-gkazv439.js → index.server-bf7d81b4.js} +7 -7
- package/dist/server/{index.server-krqvnt6p.js → index.server-d4ft97bx.js} +4 -2
- package/dist/server/{index.server-t1x9h8cb.js → index.server-dg19y3m7.js} +1 -1
- package/dist/server/{index.server-jt1twhgk.js → index.server-dq0k0qf6.js} +10 -10
- package/dist/server/{index.server-pxq277t5.js → index.server-frb9e55d.js} +1 -1
- package/dist/server/{index.server-9kz37z89.js → index.server-g3726bja.js} +1 -1
- package/dist/server/index.server-gyzmkrnz.js +2 -0
- package/dist/server/{index.server-mr68brd6.js → index.server-jgdtsvz2.js} +1 -1
- package/dist/server/{index.server-p56xxef1.js → index.server-m8ya4p7w.js} +1 -1
- package/dist/server/{index.server-1nq7z1qw.js → index.server-mda2y5g6.js} +1 -1
- package/dist/server/{index.server-jdcq5zza.js → index.server-mehav5vs.js} +7 -7
- package/dist/server/{index.server-e89qfamd.js → index.server-mknhgg07.js} +4 -4
- package/dist/server/{index.server-j570vb03.js → index.server-mvjzcna5.js} +1 -1
- package/dist/server/index.server-n4jxy52q.js +2 -0
- package/dist/server/{index.server-h89zk5ev.js → index.server-ne4gzxvz.js} +7 -7
- package/dist/server/{index.server-eftvmq3f.js → index.server-pfbzz3x7.js} +1 -1
- package/dist/server/{index.server-zrh23kty.js → index.server-pyjzfjfn.js} +1 -1
- package/dist/server/{index.server-rga8sc7j.js → index.server-q1d48s9t.js} +40 -36
- package/dist/server/{index.server-46cjwcqw.js → index.server-qv0kkre4.js} +5 -5
- package/dist/server/{index.server-yhzydqxe.js → index.server-r82zjq88.js} +5 -5
- package/dist/server/{index.server-9ykk1kbg.js → index.server-rbd5ys4z.js} +1 -1
- package/dist/server/{index.server-tcay903b.js → index.server-tnecnach.js} +4 -4
- package/dist/server/{index.server-9ra3xv88.js → index.server-x66zvjfc.js} +9 -9
- package/dist/server/{index.server-6sh11ap6.js → index.server-y4kfz0er.js} +1 -1
- package/dist/server/{index.server-n82rcv0m.js → index.server-z721a5gp.js} +4 -4
- package/dist/server/{index.server-mm1xa3kr.js → index.server-zdhv33ph.js} +51 -20
- package/dist/server/{index.server-t3hknp1c.js → index.server-zm04d9eq.js} +4 -4
- package/dist/server/{index.server-nx9c2ep1.js → index.server-zncgb7mw.js} +2 -2
- package/package.json +10 -130
- package/src/components/focus-trap/index.ts +1 -0
- package/src/components/icons/index.ts +82 -40
- package/src/index.ts +0 -34
- package/src/styles/components.css +0 -4
- package/dist/components/chat/adapter/chat-adapter.d.ts +0 -123
- package/dist/components/chat/adapter/index.d.ts +0 -8
- package/dist/components/chat/artifact/artifact-panel.svelte.d.ts +0 -15
- package/dist/components/chat/artifact/artifact-viewer.svelte.d.ts +0 -10
- package/dist/components/chat/artifact/chat-artifact-layout.svelte.d.ts +0 -23
- package/dist/components/chat/artifact/index.d.ts +0 -3
- package/dist/components/chat/builders.d.ts +0 -25
- package/dist/components/chat/chat.css +0 -16
- package/dist/components/chat/chat.css.d.ts +0 -1
- package/dist/components/chat/chat.schema.d.ts +0 -3
- package/dist/components/chat/chat.schema.js +0 -366
- package/dist/components/chat/chat.svelte.d.ts +0 -31
- package/dist/components/chat/chat.types.d.ts +0 -268
- package/dist/components/chat/chat.variables.d.ts +0 -2
- package/dist/components/chat/chat.variables.js +0 -61
- package/dist/components/chat/container/chat-events.d.ts +0 -22
- package/dist/components/chat/container/chat-history-trigger.svelte.d.ts +0 -15
- package/dist/components/chat/container/chat-jump-controls.svelte.d.ts +0 -24
- package/dist/components/chat/container/chat-participant-typing.svelte.d.ts +0 -31
- package/dist/components/chat/container/chat-search-bar.svelte.d.ts +0 -38
- package/dist/components/chat/container/chat-status-announcer.svelte.d.ts +0 -21
- package/dist/components/chat/container/chat.svelte.d.ts +0 -17
- package/dist/components/chat/container/index.d.ts +0 -12
- package/dist/components/chat/container/scroll-utilities.d.ts +0 -119
- package/dist/components/chat/container/use-chat-disclosure-state.svelte.d.ts +0 -58
- package/dist/components/chat/container/use-chat-keyboard-nav.svelte.d.ts +0 -57
- package/dist/components/chat/container/use-chat-message-groups.svelte.d.ts +0 -74
- package/dist/components/chat/container/use-chat-read-receipts.svelte.d.ts +0 -51
- package/dist/components/chat/container/use-chat-scroll-state.svelte.d.ts +0 -111
- package/dist/components/chat/container/use-chat-search.svelte.d.ts +0 -82
- package/dist/components/chat/container/use-chat-typing-indicator.svelte.d.ts +0 -76
- package/dist/components/chat/container/use-chat-unread-state.svelte.d.ts +0 -80
- package/dist/components/chat/container/use-chat-virtualizer.svelte.d.ts +0 -47
- package/dist/components/chat/conversation-model.d.ts +0 -16
- package/dist/components/chat/export/conversation-export-actions.svelte.d.ts +0 -17
- package/dist/components/chat/export/index.d.ts +0 -8
- package/dist/components/chat/index.d.ts +0 -25
- package/dist/components/chat/index.js +0 -11319
- package/dist/components/chat/input/attachment-kind.d.ts +0 -10
- package/dist/components/chat/input/chat-attachment-preview.svelte.d.ts +0 -8
- package/dist/components/chat/input/chat-attachment-serialization.d.ts +0 -9
- package/dist/components/chat/input/chat-attachment.d.ts +0 -11
- package/dist/components/chat/input/chat-input.svelte.d.ts +0 -79
- package/dist/components/chat/input/index.d.ts +0 -5
- package/dist/components/chat/message/chat-date-separator.svelte.d.ts +0 -12
- package/dist/components/chat/message/chat-message-parts-renderer.svelte.d.ts +0 -4
- package/dist/components/chat/message/chat-message-parts.d.ts +0 -96
- package/dist/components/chat/message/chat-message.svelte.d.ts +0 -91
- package/dist/components/chat/message/chat-read-receipt.svelte.d.ts +0 -27
- package/dist/components/chat/message/image-lightbox.svelte.d.ts +0 -17
- package/dist/components/chat/message/index.d.ts +0 -6
- package/dist/components/chat/message/markdown-preview.svelte.d.ts +0 -8
- package/dist/components/chat/message/message-attachments.svelte.d.ts +0 -17
- package/dist/components/chat/message/message-content.svelte.d.ts +0 -18
- package/dist/components/chat/message/parts/image-part.svelte.d.ts +0 -17
- package/dist/components/chat/message/parts/markdown-part.svelte.d.ts +0 -8
- package/dist/components/chat/message/parts/reasoning-part.svelte.d.ts +0 -12
- package/dist/components/chat/message/parts/step-part.svelte.d.ts +0 -8
- package/dist/components/chat/message/parts/suggestion-part.svelte.d.ts +0 -18
- package/dist/components/chat/message/parts/tool-approval-part.svelte.d.ts +0 -12
- package/dist/components/chat/message/parts/tool-call-part.svelte.d.ts +0 -12
- package/dist/components/chat/message/parts/tool-result-part.svelte.d.ts +0 -8
- package/dist/components/chat/message/tool-call-group.svelte.d.ts +0 -15
- package/dist/components/chat/message/tool-payload-code.svelte.d.ts +0 -9
- package/dist/components/chat/utilities/conversation.d.ts +0 -12
- package/dist/components/chat/utilities/index.d.ts +0 -9
- package/dist/components/chat/utilities/types.d.ts +0 -262
- package/dist/components/chat/utilities/utilities.d.ts +0 -140
- package/dist/components/chat-composer-popover/chat-composer-popover-filter.d.ts +0 -11
- package/dist/components/chat-composer-popover/chat-composer-popover.css +0 -7
- package/dist/components/chat-composer-popover/chat-composer-popover.css.d.ts +0 -1
- package/dist/components/chat-composer-popover/chat-composer-popover.schema.d.ts +0 -3
- package/dist/components/chat-composer-popover/chat-composer-popover.schema.js +0 -150
- package/dist/components/chat-composer-popover/chat-composer-popover.svelte.d.ts +0 -46
- package/dist/components/chat-composer-popover/chat-composer-popover.types.d.ts +0 -77
- package/dist/components/chat-composer-popover/chat-composer-popover.variables.d.ts +0 -2
- package/dist/components/chat-composer-popover/chat-composer-popover.variables.js +0 -61
- package/dist/components/chat-composer-popover/index.d.ts +0 -6
- package/dist/components/chat-composer-popover/index.js +0 -3285
- package/dist/components/chat-conversation-header/chat-conversation-header.css +0 -51
- package/dist/components/chat-conversation-header/chat-conversation-header.css.d.ts +0 -1
- package/dist/components/chat-conversation-header/chat-conversation-header.schema.d.ts +0 -3
- package/dist/components/chat-conversation-header/chat-conversation-header.schema.js +0 -94
- package/dist/components/chat-conversation-header/chat-conversation-header.svelte.d.ts +0 -19
- package/dist/components/chat-conversation-header/chat-conversation-header.types.d.ts +0 -18
- package/dist/components/chat-conversation-header/chat-conversation-header.variables.d.ts +0 -2
- package/dist/components/chat-conversation-header/chat-conversation-header.variables.js +0 -61
- package/dist/components/chat-conversation-header/index.d.ts +0 -5
- package/dist/components/chat-conversation-header/index.js +0 -4278
- package/dist/components/chat-conversation-list/chat-conversation-list.css +0 -127
- package/dist/components/chat-conversation-list/chat-conversation-list.css.d.ts +0 -1
- package/dist/components/chat-conversation-list/chat-conversation-list.schema.d.ts +0 -3
- package/dist/components/chat-conversation-list/chat-conversation-list.schema.js +0 -105
- package/dist/components/chat-conversation-list/chat-conversation-list.svelte.d.ts +0 -21
- package/dist/components/chat-conversation-list/chat-conversation-list.types.d.ts +0 -17
- package/dist/components/chat-conversation-list/chat-conversation-list.variables.d.ts +0 -2
- package/dist/components/chat-conversation-list/chat-conversation-list.variables.js +0 -61
- package/dist/components/chat-conversation-list/conversation-summary.d.ts +0 -30
- package/dist/components/chat-conversation-list/index.d.ts +0 -6
- package/dist/components/chat-conversation-list/index.js +0 -536
- package/dist/server/components/chat/index.js +0 -131
- package/dist/server/components/chat-composer-popover/index.js +0 -26
- package/dist/server/components/chat-conversation-header/index.js +0 -41
- package/dist/server/components/chat-conversation-list/index.js +0 -19
- package/dist/server/index.server-2bbwajb2.js +0 -54
- package/dist/server/index.server-2hqrv7ca.js +0 -9
- package/dist/server/index.server-67qgdypc.js +0 -9
- package/dist/server/index.server-6hnfzc7f.js +0 -263
- package/dist/server/index.server-8rmtb8vx.js +0 -175
- package/dist/server/index.server-a59y47rw.js +0 -59
- package/dist/server/index.server-bfkka7x4.js +0 -2
- package/dist/server/index.server-czf35aba.js +0 -4241
- package/dist/server/index.server-kb6w1a7c.js +0 -27
- package/dist/server/index.server-nphtb2ey.js +0 -76
- package/dist/server/index.server-qkfd0qa7.js +0 -2
- package/dist/server/index.server-rf67m8v5.js +0 -2
- package/dist/server/index.server-rqe5bqgm.js +0 -37
- package/dist/server/index.server-xtjjmsyq.js +0 -315
- package/dist/server/index.server-yq9evnp4.js +0 -38
- package/dist/server/index.server-z1qvwaem.js +0 -74
- package/dist/server/index.server-z7hxtqs1.js +0 -83
- package/src/components/chat/adapter/chat-adapter.ts +0 -132
- package/src/components/chat/adapter/index.ts +0 -15
- package/src/components/chat/artifact/artifact-panel.svelte +0 -112
- package/src/components/chat/artifact/artifact-viewer.svelte +0 -101
- package/src/components/chat/artifact/chat-artifact-layout.svelte +0 -56
- package/src/components/chat/artifact/index.ts +0 -3
- package/src/components/chat/builders.ts +0 -464
- package/src/components/chat/chat.css +0 -16
- package/src/components/chat/chat.examples.json +0 -67
- package/src/components/chat/chat.schema.json +0 -290
- package/src/components/chat/chat.schema.ts +0 -335
- package/src/components/chat/chat.svelte +0 -67
- package/src/components/chat/chat.types.ts +0 -284
- package/src/components/chat/chat.variables.json +0 -1
- package/src/components/chat/chat.variables.ts +0 -3
- package/src/components/chat/container/chat-events.ts +0 -26
- package/src/components/chat/container/chat-history-trigger.svelte +0 -95
- package/src/components/chat/container/chat-jump-controls.svelte +0 -191
- package/src/components/chat/container/chat-participant-typing.svelte +0 -128
- package/src/components/chat/container/chat-search-bar.svelte +0 -219
- package/src/components/chat/container/chat-status-announcer.svelte +0 -22
- package/src/components/chat/container/chat.svelte +0 -1879
- package/src/components/chat/container/index.ts +0 -64
- package/src/components/chat/container/scroll-utilities.ts +0 -204
- package/src/components/chat/container/use-chat-disclosure-state.svelte.ts +0 -62
- package/src/components/chat/container/use-chat-keyboard-nav.svelte.ts +0 -153
- package/src/components/chat/container/use-chat-message-groups.svelte.ts +0 -146
- package/src/components/chat/container/use-chat-read-receipts.svelte.ts +0 -62
- package/src/components/chat/container/use-chat-scroll-state.svelte.ts +0 -292
- package/src/components/chat/container/use-chat-search.svelte.ts +0 -116
- package/src/components/chat/container/use-chat-typing-indicator.svelte.ts +0 -153
- package/src/components/chat/container/use-chat-unread-state.svelte.ts +0 -170
- package/src/components/chat/container/use-chat-virtualizer.svelte.ts +0 -260
- package/src/components/chat/conversation-model.ts +0 -56
- package/src/components/chat/export/conversation-export-actions.svelte +0 -174
- package/src/components/chat/export/index.ts +0 -9
- package/src/components/chat/index.ts +0 -160
- package/src/components/chat/input/attachment-kind.ts +0 -28
- package/src/components/chat/input/chat-attachment-preview.svelte +0 -223
- package/src/components/chat/input/chat-attachment-serialization.ts +0 -63
- package/src/components/chat/input/chat-attachment.ts +0 -12
- package/src/components/chat/input/chat-input.svelte +0 -810
- package/src/components/chat/input/index.ts +0 -9
- package/src/components/chat/message/chat-date-separator.svelte +0 -87
- package/src/components/chat/message/chat-message-parts-renderer.svelte +0 -139
- package/src/components/chat/message/chat-message-parts.ts +0 -163
- package/src/components/chat/message/chat-message.svelte +0 -861
- package/src/components/chat/message/chat-read-receipt.svelte +0 -85
- package/src/components/chat/message/image-lightbox.svelte +0 -255
- package/src/components/chat/message/index.ts +0 -6
- package/src/components/chat/message/markdown-preview.svelte +0 -77
- package/src/components/chat/message/message-attachments.svelte +0 -178
- package/src/components/chat/message/message-content.svelte +0 -132
- package/src/components/chat/message/parts/image-part.svelte +0 -11
- package/src/components/chat/message/parts/markdown-part.svelte +0 -17
- package/src/components/chat/message/parts/reasoning-part.svelte +0 -274
- package/src/components/chat/message/parts/step-part.svelte +0 -127
- package/src/components/chat/message/parts/suggestion-part.svelte +0 -83
- package/src/components/chat/message/parts/tool-approval-part.svelte +0 -298
- package/src/components/chat/message/parts/tool-call-part.svelte +0 -19
- package/src/components/chat/message/parts/tool-result-part.svelte +0 -65
- package/src/components/chat/message/tool-call-group.svelte +0 -274
- package/src/components/chat/message/tool-payload-code.svelte +0 -35
- package/src/components/chat/utilities/conversation.ts +0 -44
- package/src/components/chat/utilities/index.ts +0 -33
- package/src/components/chat/utilities/types.ts +0 -288
- package/src/components/chat/utilities/utilities.ts +0 -507
- package/src/components/chat-composer-popover/chat-composer-popover-filter.ts +0 -68
- package/src/components/chat-composer-popover/chat-composer-popover.css +0 -7
- package/src/components/chat-composer-popover/chat-composer-popover.examples.json +0 -13
- package/src/components/chat-composer-popover/chat-composer-popover.schema.json +0 -90
- package/src/components/chat-composer-popover/chat-composer-popover.schema.ts +0 -95
- package/src/components/chat-composer-popover/chat-composer-popover.svelte +0 -234
- package/src/components/chat-composer-popover/chat-composer-popover.types.ts +0 -88
- package/src/components/chat-composer-popover/chat-composer-popover.variables.json +0 -1
- package/src/components/chat-composer-popover/chat-composer-popover.variables.ts +0 -3
- package/src/components/chat-composer-popover/index.ts +0 -19
- package/src/components/chat-conversation-header/chat-conversation-header.css +0 -51
- package/src/components/chat-conversation-header/chat-conversation-header.examples.json +0 -13
- package/src/components/chat-conversation-header/chat-conversation-header.schema.json +0 -34
- package/src/components/chat-conversation-header/chat-conversation-header.schema.ts +0 -38
- package/src/components/chat-conversation-header/chat-conversation-header.svelte +0 -49
- package/src/components/chat-conversation-header/chat-conversation-header.types.ts +0 -20
- package/src/components/chat-conversation-header/chat-conversation-header.variables.json +0 -1
- package/src/components/chat-conversation-header/chat-conversation-header.variables.ts +0 -3
- package/src/components/chat-conversation-header/index.ts +0 -9
- package/src/components/chat-conversation-list/chat-conversation-list.css +0 -127
- package/src/components/chat-conversation-list/chat-conversation-list.examples.json +0 -13
- package/src/components/chat-conversation-list/chat-conversation-list.schema.json +0 -45
- package/src/components/chat-conversation-list/chat-conversation-list.schema.ts +0 -52
- package/src/components/chat-conversation-list/chat-conversation-list.svelte +0 -75
- package/src/components/chat-conversation-list/chat-conversation-list.types.ts +0 -18
- package/src/components/chat-conversation-list/chat-conversation-list.variables.json +0 -1
- package/src/components/chat-conversation-list/chat-conversation-list.variables.ts +0 -3
- package/src/components/chat-conversation-list/conversation-summary.ts +0 -88
- package/src/components/chat-conversation-list/index.ts +0 -11
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { ComponentSchema } from '../../schema-types';
|
|
2
|
-
|
|
3
|
-
const schema = {
|
|
4
|
-
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
5
|
-
type: 'object',
|
|
6
|
-
properties: {
|
|
7
|
-
id: {
|
|
8
|
-
type: 'string',
|
|
9
|
-
description: 'Unique identifier used for the listbox and item ids.',
|
|
10
|
-
},
|
|
11
|
-
value: {
|
|
12
|
-
type: 'string',
|
|
13
|
-
description: 'Current composer value. Bind this to the same value as ChatInput.',
|
|
14
|
-
},
|
|
15
|
-
triggers: {
|
|
16
|
-
type: 'array',
|
|
17
|
-
items: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
},
|
|
20
|
-
description: "Trigger characters that open the popover. Default `['/', '@']`.",
|
|
21
|
-
},
|
|
22
|
-
label: {
|
|
23
|
-
type: 'string',
|
|
24
|
-
description: "Accessible listbox label. Default `'Composer suggestions'`.",
|
|
25
|
-
},
|
|
26
|
-
placement: {
|
|
27
|
-
enum: [
|
|
28
|
-
'top',
|
|
29
|
-
'bottom',
|
|
30
|
-
'left',
|
|
31
|
-
'right',
|
|
32
|
-
'top-start',
|
|
33
|
-
'top-end',
|
|
34
|
-
'bottom-start',
|
|
35
|
-
'bottom-end',
|
|
36
|
-
],
|
|
37
|
-
description: "Caret-relative placement. Default `'bottom-start'`.",
|
|
38
|
-
},
|
|
39
|
-
offset: {
|
|
40
|
-
type: 'number',
|
|
41
|
-
description: 'Distance in px between the caret and popover. Default `6`.',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
additionalProperties: false,
|
|
45
|
-
required: ['id'],
|
|
46
|
-
metadata: {
|
|
47
|
-
unsupportedProps: [
|
|
48
|
-
{
|
|
49
|
-
name: 'composer',
|
|
50
|
-
reason: 'function-or-snippet',
|
|
51
|
-
required: true,
|
|
52
|
-
description: 'Render the ChatInput or compatible composer with the provided overlay props.',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'detectTrigger',
|
|
56
|
-
reason: 'function-or-snippet',
|
|
57
|
-
description: 'Override trigger detection.',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'empty',
|
|
61
|
-
reason: 'function-or-snippet',
|
|
62
|
-
description: 'Optional empty state rendered when filtering produces no matching rows.',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'filter',
|
|
66
|
-
reason: 'function-or-snippet',
|
|
67
|
-
description: 'Override filtering.',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'item',
|
|
71
|
-
reason: 'function-or-snippet',
|
|
72
|
-
description: 'Optional custom row contents. Defaults to the item label and description.',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: 'items',
|
|
76
|
-
reason: 'generic-type-parameter',
|
|
77
|
-
required: true,
|
|
78
|
-
description: 'Consumer-owned command or mention definitions.',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: 'ondismiss',
|
|
82
|
-
reason: 'function-or-snippet',
|
|
83
|
-
description:
|
|
84
|
-
'Invoked when Escape, trigger loss, or outside pointerdown dismisses the popover.',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: 'onselect',
|
|
88
|
-
reason: 'function-or-snippet',
|
|
89
|
-
description: 'Invoked when an enabled item is selected by keyboard or pointer.',
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
},
|
|
93
|
-
} satisfies ComponentSchema;
|
|
94
|
-
|
|
95
|
-
export default schema as ComponentSchema;
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
export { filterFuzzySubsequence, fuzzySubsequenceScore, } from './chat-composer-popover-filter.ts';
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<script lang="ts" generics="TItem extends ChatComposerPopoverItem">
|
|
6
|
-
import CommandItem from '../command-item/command-item.svelte';
|
|
7
|
-
import CommandMenu from '../command-menu/command-menu.svelte';
|
|
8
|
-
import { onDestroy } from 'svelte';
|
|
9
|
-
import { detectTrigger as detectCommandTrigger } from '../command-menu/command-menu-trigger.ts';
|
|
10
|
-
import { filterFuzzySubsequence } from './chat-composer-popover-filter.ts';
|
|
11
|
-
let { id, value = $bindable(''), items, triggers = ['/', '@'], label = 'Composer suggestions', placement = 'bottom-start', offset = 6, composer, item, empty, detectTrigger, filter = filterFuzzySubsequence, onselect, ondismiss, } = $props();
|
|
12
|
-
let open = $state(false);
|
|
13
|
-
let anchor = $state(null);
|
|
14
|
-
let caretIndex = $state(0);
|
|
15
|
-
const listboxId = $derived(`${id}-listbox`);
|
|
16
|
-
let activeItemId = $state(null);
|
|
17
|
-
let activeMatch = $state(null);
|
|
18
|
-
let composerSyncTimer = null;
|
|
19
|
-
let lastSyncedValue = $state(value);
|
|
20
|
-
let suppressNextValueSync = false;
|
|
21
|
-
const emptyContent = $derived(empty);
|
|
22
|
-
const query = $derived(activeMatch?.query ?? '');
|
|
23
|
-
const trigger = $derived(activeMatch?.trigger ?? triggers[0] ?? '/');
|
|
24
|
-
const filteredItems = $derived.by(() => {
|
|
25
|
-
if (!activeMatch)
|
|
26
|
-
return [];
|
|
27
|
-
return [...filter(items, activeMatch.query, activeMatch.trigger)];
|
|
28
|
-
});
|
|
29
|
-
const composerProps = $derived({
|
|
30
|
-
composerRole: 'combobox',
|
|
31
|
-
composerAriaExpanded: open,
|
|
32
|
-
composerAriaControls: open ? listboxId : undefined,
|
|
33
|
-
composerAriaActiveDescendant: open ? (activeItemId ?? undefined) : undefined,
|
|
34
|
-
composerAriaAutocomplete: 'list',
|
|
35
|
-
oncomposerinput: handleComposerInput,
|
|
36
|
-
oncomposerkeydown: handleComposerKeydown,
|
|
37
|
-
oncomposerselectionchange: handleComposerSelectionChange,
|
|
38
|
-
oncomposerblur: handleComposerBlur,
|
|
39
|
-
});
|
|
40
|
-
function getComposerElement(event) {
|
|
41
|
-
const target = event.currentTarget ?? event.target;
|
|
42
|
-
if (target instanceof HTMLTextAreaElement || target instanceof HTMLInputElement) {
|
|
43
|
-
return target;
|
|
44
|
-
}
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
function findTriggerMatch(text, selectionStart, selectionEnd) {
|
|
48
|
-
if (detectTrigger)
|
|
49
|
-
return detectTrigger(text, selectionStart, selectionEnd);
|
|
50
|
-
for (const triggerChar of triggers) {
|
|
51
|
-
const match = detectCommandTrigger({ text, selectionStart, selectionEnd, triggerChar });
|
|
52
|
-
if (match) {
|
|
53
|
-
return { ...match, trigger: triggerChar };
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
function updateFromComposer(composerElement, nextValue) {
|
|
59
|
-
if (composerElement)
|
|
60
|
-
anchor = composerElement;
|
|
61
|
-
const selectionStart = composerElement?.selectionStart ?? nextValue.length;
|
|
62
|
-
const selectionEnd = composerElement?.selectionEnd ?? selectionStart;
|
|
63
|
-
lastSyncedValue = nextValue;
|
|
64
|
-
value = nextValue;
|
|
65
|
-
caretIndex = selectionEnd;
|
|
66
|
-
activeMatch = findTriggerMatch(nextValue, selectionStart, selectionEnd);
|
|
67
|
-
const wasOpen = open;
|
|
68
|
-
open = activeMatch !== null && anchor !== null;
|
|
69
|
-
if (!open) {
|
|
70
|
-
activeItemId = null;
|
|
71
|
-
if (wasOpen)
|
|
72
|
-
ondismiss?.();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function dismiss({ restoreFocus = true } = {}) {
|
|
76
|
-
if (!open && !activeMatch && !activeItemId)
|
|
77
|
-
return;
|
|
78
|
-
clearComposerSyncTimer();
|
|
79
|
-
open = false;
|
|
80
|
-
activeItemId = null;
|
|
81
|
-
activeMatch = null;
|
|
82
|
-
if (restoreFocus)
|
|
83
|
-
anchor?.focus();
|
|
84
|
-
ondismiss?.();
|
|
85
|
-
}
|
|
86
|
-
function handleComposerInput(nextValue, event) {
|
|
87
|
-
suppressNextValueSync = false;
|
|
88
|
-
updateFromComposer(event ? getComposerElement(event) : anchor, nextValue);
|
|
89
|
-
}
|
|
90
|
-
function handleComposerSelectionChange(event) {
|
|
91
|
-
suppressNextValueSync = false;
|
|
92
|
-
const composerElement = getComposerElement(event);
|
|
93
|
-
if (!composerElement)
|
|
94
|
-
return;
|
|
95
|
-
syncComposerSelectionAfterNativeNavigation(composerElement);
|
|
96
|
-
}
|
|
97
|
-
function handleComposerBlur(event) {
|
|
98
|
-
if (event.currentTarget === anchor) {
|
|
99
|
-
dismiss({ restoreFocus: false });
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
function syncComposerSelectionAfterNativeNavigation(composerElement) {
|
|
103
|
-
clearComposerSyncTimer();
|
|
104
|
-
composerSyncTimer = setTimeout(() => {
|
|
105
|
-
composerSyncTimer = null;
|
|
106
|
-
updateFromComposer(composerElement, composerElement.value);
|
|
107
|
-
}, 0);
|
|
108
|
-
}
|
|
109
|
-
function clearComposerSyncTimer() {
|
|
110
|
-
if (composerSyncTimer === null)
|
|
111
|
-
return;
|
|
112
|
-
clearTimeout(composerSyncTimer);
|
|
113
|
-
composerSyncTimer = null;
|
|
114
|
-
}
|
|
115
|
-
function handleComposerKeydown(event) {
|
|
116
|
-
const composerElement = event.currentTarget instanceof HTMLTextAreaElement ||
|
|
117
|
-
event.currentTarget instanceof HTMLInputElement
|
|
118
|
-
? event.currentTarget
|
|
119
|
-
: null;
|
|
120
|
-
if (composerElement) {
|
|
121
|
-
anchor = composerElement;
|
|
122
|
-
caretIndex = composerElement.selectionEnd ?? value.length;
|
|
123
|
-
}
|
|
124
|
-
if (!open || event.isComposing || event.keyCode === 229)
|
|
125
|
-
return;
|
|
126
|
-
if (event.key === 'Escape') {
|
|
127
|
-
event.preventDefault();
|
|
128
|
-
event.stopPropagation();
|
|
129
|
-
dismiss();
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
const isNavigationKey = event.key === 'ArrowDown' ||
|
|
133
|
-
event.key === 'ArrowUp' ||
|
|
134
|
-
event.key === 'ArrowLeft' ||
|
|
135
|
-
event.key === 'ArrowRight' ||
|
|
136
|
-
event.key === 'Home' ||
|
|
137
|
-
event.key === 'End';
|
|
138
|
-
const isMenuNavigationKey = event.key === 'ArrowDown' ||
|
|
139
|
-
event.key === 'ArrowUp' ||
|
|
140
|
-
event.key === 'Home' ||
|
|
141
|
-
event.key === 'End';
|
|
142
|
-
const isModifiedNavigation = isNavigationKey && (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);
|
|
143
|
-
if ((isMenuNavigationKey && !isModifiedNavigation) || (event.key === 'Enter' && activeItemId)) {
|
|
144
|
-
event.preventDefault();
|
|
145
|
-
}
|
|
146
|
-
if (composerElement && isNavigationKey && (isModifiedNavigation || !isMenuNavigationKey)) {
|
|
147
|
-
syncComposerSelectionAfterNativeNavigation(composerElement);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
onDestroy(() => {
|
|
151
|
-
clearComposerSyncTimer();
|
|
152
|
-
});
|
|
153
|
-
$effect(() => {
|
|
154
|
-
if (value === lastSyncedValue)
|
|
155
|
-
return;
|
|
156
|
-
if (suppressNextValueSync) {
|
|
157
|
-
suppressNextValueSync = false;
|
|
158
|
-
lastSyncedValue = value;
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
updateFromComposer(anchor, value);
|
|
162
|
-
});
|
|
163
|
-
function handleStateChange(state) {
|
|
164
|
-
activeItemId = state.activeItemId;
|
|
165
|
-
}
|
|
166
|
-
function handleSelect(selection) {
|
|
167
|
-
const selectedItem = filteredItems.find((candidate) => candidate.value === selection.value);
|
|
168
|
-
if (!selectedItem || !activeMatch)
|
|
169
|
-
return;
|
|
170
|
-
const detail = {
|
|
171
|
-
item: selectedItem,
|
|
172
|
-
value: selection.value,
|
|
173
|
-
query: activeMatch.query,
|
|
174
|
-
trigger: activeMatch.trigger,
|
|
175
|
-
range: {
|
|
176
|
-
start: activeMatch.start,
|
|
177
|
-
end: activeMatch.end,
|
|
178
|
-
},
|
|
179
|
-
};
|
|
180
|
-
open = false;
|
|
181
|
-
activeItemId = null;
|
|
182
|
-
activeMatch = null;
|
|
183
|
-
anchor?.focus();
|
|
184
|
-
suppressNextValueSync = true;
|
|
185
|
-
queueMicrotask(() => {
|
|
186
|
-
suppressNextValueSync = false;
|
|
187
|
-
});
|
|
188
|
-
onselect?.(detail);
|
|
189
|
-
}
|
|
190
|
-
</script>
|
|
191
|
-
|
|
192
|
-
{@render composer(composerProps)}
|
|
193
|
-
|
|
194
|
-
<CommandMenu
|
|
195
|
-
bind:open
|
|
196
|
-
{anchor}
|
|
197
|
-
{caretIndex}
|
|
198
|
-
{query}
|
|
199
|
-
{placement}
|
|
200
|
-
{offset}
|
|
201
|
-
{label}
|
|
202
|
-
{listboxId}
|
|
203
|
-
onselect={handleSelect}
|
|
204
|
-
ondismiss={() => dismiss({ restoreFocus: false })}
|
|
205
|
-
onstatechange={handleStateChange}
|
|
206
|
-
>
|
|
207
|
-
{#snippet items()}
|
|
208
|
-
{#each filteredItems as command (command.value)}
|
|
209
|
-
<CommandItem
|
|
210
|
-
value={command.value}
|
|
211
|
-
disabled={command.disabled === true}
|
|
212
|
-
description={item ? '' : (command.description ?? '')}
|
|
213
|
-
accessibleLabel={command.description
|
|
214
|
-
? `${command.label}, ${command.description}`
|
|
215
|
-
: command.label}
|
|
216
|
-
selectionMode="parent"
|
|
217
|
-
>
|
|
218
|
-
{#if item}
|
|
219
|
-
{@render item({ item: command, query, trigger })}
|
|
220
|
-
{:else}
|
|
221
|
-
{command.label}
|
|
222
|
-
{/if}
|
|
223
|
-
</CommandItem>
|
|
224
|
-
{/each}
|
|
225
|
-
{/snippet}
|
|
226
|
-
|
|
227
|
-
{#snippet empty()}
|
|
228
|
-
{#if emptyContent}
|
|
229
|
-
{@render emptyContent()}
|
|
230
|
-
{:else}
|
|
231
|
-
No suggestions
|
|
232
|
-
{/if}
|
|
233
|
-
{/snippet}
|
|
234
|
-
</CommandMenu>
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
|
|
3
|
-
import type { PopoverPlacement } from '../popover/popover.types.ts';
|
|
4
|
-
|
|
5
|
-
export type ChatComposerPopoverItem = {
|
|
6
|
-
/** Stable submitted value surfaced through onselect. */
|
|
7
|
-
value: string;
|
|
8
|
-
/** Default visible and accessible label for the command row. */
|
|
9
|
-
label: string;
|
|
10
|
-
/** Optional secondary text for the command row. */
|
|
11
|
-
description?: string | undefined;
|
|
12
|
-
/** Optional fuzzy-search aliases. */
|
|
13
|
-
keywords?: readonly string[] | undefined;
|
|
14
|
-
/** Whether this row is skipped by keyboard navigation and activation. */
|
|
15
|
-
disabled?: boolean | undefined;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export type ChatComposerPopoverTriggerMatch = {
|
|
19
|
-
active: true;
|
|
20
|
-
trigger: string;
|
|
21
|
-
query: string;
|
|
22
|
-
start: number;
|
|
23
|
-
end: number;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type ChatComposerPopoverSelection<TItem extends ChatComposerPopoverItem> = {
|
|
27
|
-
item: TItem;
|
|
28
|
-
value: string;
|
|
29
|
-
query: string;
|
|
30
|
-
trigger: string;
|
|
31
|
-
range: {
|
|
32
|
-
start: number;
|
|
33
|
-
end: number;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type ChatComposerPopoverComposerProps = {
|
|
38
|
-
composerRole: 'combobox';
|
|
39
|
-
composerAriaExpanded: boolean;
|
|
40
|
-
composerAriaControls: string | undefined;
|
|
41
|
-
composerAriaActiveDescendant: string | undefined;
|
|
42
|
-
composerAriaAutocomplete: 'list';
|
|
43
|
-
oncomposerinput: (value: string, event?: Event) => void;
|
|
44
|
-
oncomposerkeydown: (event: KeyboardEvent) => void;
|
|
45
|
-
oncomposerselectionchange: (event: Event) => void;
|
|
46
|
-
oncomposerblur: (event: FocusEvent) => void;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export type ChatComposerPopoverItemSnippetContext<TItem extends ChatComposerPopoverItem> = {
|
|
50
|
-
item: TItem;
|
|
51
|
-
query: string;
|
|
52
|
-
trigger: string;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export type ChatComposerPopoverProps<TItem extends ChatComposerPopoverItem> = {
|
|
56
|
-
/** Unique identifier used for the listbox and item ids. */
|
|
57
|
-
id: string;
|
|
58
|
-
/** Current composer value. Bind this to the same value as ChatInput. */
|
|
59
|
-
value?: string;
|
|
60
|
-
/** Consumer-owned command or mention definitions. */
|
|
61
|
-
items: readonly TItem[];
|
|
62
|
-
/** Trigger characters that open the popover. Default `['/', '@']`. */
|
|
63
|
-
triggers?: readonly string[];
|
|
64
|
-
/** Accessible listbox label. Default `'Composer suggestions'`. */
|
|
65
|
-
label?: string;
|
|
66
|
-
/** Caret-relative placement. Default `'bottom-start'`. */
|
|
67
|
-
placement?: PopoverPlacement;
|
|
68
|
-
/** Distance in px between the caret and popover. Default `6`. */
|
|
69
|
-
offset?: number;
|
|
70
|
-
/** Render the ChatInput or compatible composer with the provided overlay props. */
|
|
71
|
-
composer: Snippet<[ChatComposerPopoverComposerProps]>;
|
|
72
|
-
/** Optional custom row contents. Defaults to the item label and description. */
|
|
73
|
-
item?: Snippet<[ChatComposerPopoverItemSnippetContext<TItem>]>;
|
|
74
|
-
/** Optional empty state rendered when filtering produces no matching rows. */
|
|
75
|
-
empty?: Snippet;
|
|
76
|
-
/** Override trigger detection. */
|
|
77
|
-
detectTrigger?: (
|
|
78
|
-
value: string,
|
|
79
|
-
selectionStart: number,
|
|
80
|
-
selectionEnd: number,
|
|
81
|
-
) => ChatComposerPopoverTriggerMatch | null;
|
|
82
|
-
/** Override filtering. */
|
|
83
|
-
filter?: (items: readonly TItem[], query: string, trigger: string) => readonly TItem[];
|
|
84
|
-
/** Invoked when an enabled item is selected by keyboard or pointer. */
|
|
85
|
-
onselect?: (selection: ChatComposerPopoverSelection<TItem>) => void;
|
|
86
|
-
/** Invoked when Escape, trigger loss, or outside pointerdown dismisses the popover. */
|
|
87
|
-
ondismiss?: () => void;
|
|
88
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[]
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import './chat-composer-popover.css';
|
|
2
|
-
import ChatComposerPopover from './chat-composer-popover.svelte';
|
|
3
|
-
|
|
4
|
-
export default ChatComposerPopover;
|
|
5
|
-
export {
|
|
6
|
-
filterFuzzySubsequence,
|
|
7
|
-
fuzzySubsequenceScore,
|
|
8
|
-
type FuzzyFilterItem,
|
|
9
|
-
type FuzzyFilterResult,
|
|
10
|
-
} from './chat-composer-popover-filter.ts';
|
|
11
|
-
export type {
|
|
12
|
-
ChatComposerPopoverComposerProps,
|
|
13
|
-
ChatComposerPopoverItem,
|
|
14
|
-
ChatComposerPopoverItemSnippetContext,
|
|
15
|
-
ChatComposerPopoverProps,
|
|
16
|
-
ChatComposerPopoverSelection,
|
|
17
|
-
ChatComposerPopoverTriggerMatch,
|
|
18
|
-
} from './chat-composer-popover.types.ts';
|
|
19
|
-
export { ChatComposerPopover };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
|
|
2
|
-
/* ChatConversationHeader renders ConversationExportActions, which composes Dropdown
|
|
3
|
-
* leaves. Keep the header style subpath self-sufficient for a-la-carte imports. */
|
|
4
|
-
@import '../dropdown/dropdown.css';
|
|
5
|
-
|
|
6
|
-
@layer cinder.components {
|
|
7
|
-
.cinder-chat-conversation-header {
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: space-between;
|
|
11
|
-
gap: var(--cinder-space-4);
|
|
12
|
-
min-width: 0;
|
|
13
|
-
padding: var(--cinder-space-3) var(--cinder-space-4);
|
|
14
|
-
border-bottom: 1px solid var(--cinder-border);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.cinder-chat-conversation-header__main {
|
|
18
|
-
min-width: 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.cinder-chat-conversation-header__title {
|
|
22
|
-
margin: 0;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
color: var(--cinder-text);
|
|
25
|
-
font-size: var(--cinder-text-lg);
|
|
26
|
-
font-weight: var(--cinder-font-semibold);
|
|
27
|
-
line-height: var(--cinder-leading-tight);
|
|
28
|
-
text-overflow: ellipsis;
|
|
29
|
-
white-space: nowrap;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.cinder-chat-conversation-header__meta {
|
|
33
|
-
margin: var(--cinder-space-0-5) 0 0;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
color: var(--cinder-text-muted);
|
|
36
|
-
font-size: var(--cinder-text-sm);
|
|
37
|
-
text-overflow: ellipsis;
|
|
38
|
-
white-space: nowrap;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.cinder-chat-conversation-header__status {
|
|
42
|
-
text-transform: capitalize;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.cinder-chat-conversation-header__actions {
|
|
46
|
-
display: inline-flex;
|
|
47
|
-
flex-shrink: 0;
|
|
48
|
-
align-items: center;
|
|
49
|
-
gap: var(--cinder-space-2);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../schemas/examples.schema.json",
|
|
3
|
-
"component": "chat-conversation-header",
|
|
4
|
-
"import": "@lostgradient/cinder/chat-conversation-header",
|
|
5
|
-
"examples": [
|
|
6
|
-
{
|
|
7
|
-
"id": "basic",
|
|
8
|
-
"title": "Basic conversation header",
|
|
9
|
-
"description": "A header derived from the active compatible conversation snapshot.",
|
|
10
|
-
"code": "<script lang=\"ts\">\n import { ChatConversationHeader } from '@lostgradient/cinder';\n import { appendAssistantMessage, createConversation } from '@lostgradient/cinder/chat';\n\n let conversation = createConversation({\n id: 'launch-support',\n title: 'Launch support',\n });\n\n conversation = {\n ...appendAssistantMessage(conversation, 'I drafted the launch checklist.'),\n metadata: { _participantNames: ['Ada', 'Grace', 'Lin'] },\n };\n</script>\n\n<ChatConversationHeader {conversation} />\n"
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"headingLevel": {
|
|
6
|
-
"enum": [2, 3, 4],
|
|
7
|
-
"description": "Heading level for the conversation title. Default `2`."
|
|
8
|
-
},
|
|
9
|
-
"showExportActions": {
|
|
10
|
-
"type": "boolean",
|
|
11
|
-
"description": "Whether to render the built-in conversation export actions. Default `true`."
|
|
12
|
-
},
|
|
13
|
-
"class": {
|
|
14
|
-
"type": "string",
|
|
15
|
-
"description": "Additional class name merged with `.cinder-chat-conversation-header`."
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"additionalProperties": false,
|
|
19
|
-
"metadata": {
|
|
20
|
-
"unsupportedProps": [
|
|
21
|
-
{
|
|
22
|
-
"name": "actions",
|
|
23
|
-
"reason": "function-or-snippet",
|
|
24
|
-
"description": "Additional action controls rendered after the built-in export actions."
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"name": "conversation",
|
|
28
|
-
"reason": "unknown-shape",
|
|
29
|
-
"required": true,
|
|
30
|
-
"description": "Active compatible conversation snapshot."
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { ComponentSchema } from '../../schema-types';
|
|
2
|
-
|
|
3
|
-
const schema = {
|
|
4
|
-
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
5
|
-
type: 'object',
|
|
6
|
-
properties: {
|
|
7
|
-
headingLevel: {
|
|
8
|
-
enum: [2, 3, 4],
|
|
9
|
-
description: 'Heading level for the conversation title. Default `2`.',
|
|
10
|
-
},
|
|
11
|
-
showExportActions: {
|
|
12
|
-
type: 'boolean',
|
|
13
|
-
description: 'Whether to render the built-in conversation export actions. Default `true`.',
|
|
14
|
-
},
|
|
15
|
-
class: {
|
|
16
|
-
type: 'string',
|
|
17
|
-
description: 'Additional class name merged with `.cinder-chat-conversation-header`.',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
additionalProperties: false,
|
|
21
|
-
metadata: {
|
|
22
|
-
unsupportedProps: [
|
|
23
|
-
{
|
|
24
|
-
name: 'actions',
|
|
25
|
-
reason: 'function-or-snippet',
|
|
26
|
-
description: 'Additional action controls rendered after the built-in export actions.',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'conversation',
|
|
30
|
-
reason: 'unknown-shape',
|
|
31
|
-
required: true,
|
|
32
|
-
description: 'Active compatible conversation snapshot.',
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
} satisfies ComponentSchema;
|
|
37
|
-
|
|
38
|
-
export default schema as ComponentSchema;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
export {};
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
import { classNames } from '../../utilities/class-names.ts';
|
|
7
|
-
import ConversationExportActions from '../chat/export/conversation-export-actions.svelte';
|
|
8
|
-
import { deriveConversationSummary } from '../chat-conversation-list/conversation-summary.ts';
|
|
9
|
-
let { conversation, headingLevel = 2, showExportActions = true, class: className, actions, ...rest } = $props();
|
|
10
|
-
const summary = $derived(deriveConversationSummary(conversation));
|
|
11
|
-
const headingTag = $derived(`h${headingLevel}`);
|
|
12
|
-
const participantLabel = $derived(summary.participantNames.length === 0
|
|
13
|
-
? undefined
|
|
14
|
-
: summary.participantNames.length <= 2
|
|
15
|
-
? summary.participantNames.join(', ')
|
|
16
|
-
: `${summary.participantNames.slice(0, 2).join(', ')} +${summary.participantNames.length - 2}`);
|
|
17
|
-
const fullParticipantLabel = $derived(summary.participantNames.join(', '));
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<header class={classNames('cinder-chat-conversation-header', className)} {...rest}>
|
|
21
|
-
<div class="cinder-chat-conversation-header__main">
|
|
22
|
-
<svelte:element this={headingTag} class="cinder-chat-conversation-header__title">
|
|
23
|
-
{summary.title}
|
|
24
|
-
</svelte:element>
|
|
25
|
-
<p class="cinder-chat-conversation-header__meta">
|
|
26
|
-
{summary.messageCount}
|
|
27
|
-
{summary.messageCount === 1 ? 'message' : 'messages'}
|
|
28
|
-
<span aria-hidden="true"> · </span>
|
|
29
|
-
<span class="cinder-chat-conversation-header__status">{summary.status}</span>
|
|
30
|
-
{#if participantLabel}
|
|
31
|
-
<span aria-hidden="true"> · </span>
|
|
32
|
-
<span title={fullParticipantLabel} aria-label={fullParticipantLabel}>
|
|
33
|
-
{participantLabel}
|
|
34
|
-
</span>
|
|
35
|
-
{/if}
|
|
36
|
-
</p>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
{#if showExportActions || actions}
|
|
40
|
-
<div class="cinder-chat-conversation-header__actions">
|
|
41
|
-
{#if showExportActions}
|
|
42
|
-
<ConversationExportActions id={`${conversation.id}-export-actions`} {conversation} />
|
|
43
|
-
{/if}
|
|
44
|
-
{#if actions}
|
|
45
|
-
{@render actions(summary)}
|
|
46
|
-
{/if}
|
|
47
|
-
</div>
|
|
48
|
-
{/if}
|
|
49
|
-
</header>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
import type { ConversationSummary } from '../chat-conversation-list/conversation-summary.ts';
|
|
4
|
-
import type { ConversationHistory } from '../chat/conversation-model.ts';
|
|
5
|
-
|
|
6
|
-
export type ChatConversationHeaderHeadingLevel = 2 | 3 | 4;
|
|
7
|
-
|
|
8
|
-
/** Props for the ChatConversationHeader component. */
|
|
9
|
-
export type ChatConversationHeaderProps = Omit<HTMLAttributes<HTMLElement>, 'class'> & {
|
|
10
|
-
/** Active compatible conversation snapshot. */
|
|
11
|
-
conversation: ConversationHistory;
|
|
12
|
-
/** Heading level for the conversation title. Default `2`. */
|
|
13
|
-
headingLevel?: ChatConversationHeaderHeadingLevel;
|
|
14
|
-
/** Whether to render the built-in conversation export actions. Default `true`. */
|
|
15
|
-
showExportActions?: boolean;
|
|
16
|
-
/** Additional class name merged with `.cinder-chat-conversation-header`. */
|
|
17
|
-
class?: string;
|
|
18
|
-
/** Additional action controls rendered after the built-in export actions. */
|
|
19
|
-
actions?: Snippet<[ConversationSummary]>;
|
|
20
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[]
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import './chat-conversation-header.css';
|
|
2
|
-
import ChatConversationHeader from './chat-conversation-header.svelte';
|
|
3
|
-
|
|
4
|
-
export default ChatConversationHeader;
|
|
5
|
-
export type {
|
|
6
|
-
ChatConversationHeaderHeadingLevel,
|
|
7
|
-
ChatConversationHeaderProps,
|
|
8
|
-
} from './chat-conversation-header.types.ts';
|
|
9
|
-
export { ChatConversationHeader };
|