@lostgradient/cinder 0.15.0 → 0.16.1
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 +12 -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/data-table/index.js +88 -31
- 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/components/table/index.js +85 -28
- package/dist/components/table/table.css +11 -0
- package/dist/components/table/table.schema.js +10 -1
- package/dist/components/table/table.types.d.ts +24 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.js +23266 -30180
- 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 +4 -4
- 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 +4 -4
- 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-jdcq5zza.js → index.server-gwgm8gqg.js} +8 -8
- 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-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-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-h89zk5ev.js → index.server-wasj5rbh.js} +8 -8
- package/dist/server/{index.server-9ra3xv88.js → index.server-x66zvjfc.js} +9 -9
- package/dist/server/index.server-xanq9ppe.js +119 -0
- 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/components/table/table.css +11 -0
- package/src/components/table/table.examples.json +3 -3
- package/src/components/table/table.schema.json +9 -0
- package/src/components/table/table.schema.ts +11 -0
- package/src/components/table/table.svelte +58 -14
- package/src/components/table/table.types.ts +27 -1
- 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-mzj20rfz.js +0 -77
- 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,366 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
function __accessProp(key) {
|
|
7
|
-
return this[key];
|
|
8
|
-
}
|
|
9
|
-
var __toESMCache_node;
|
|
10
|
-
var __toESMCache_esm;
|
|
11
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
12
|
-
var canCache = mod != null && typeof mod === "object";
|
|
13
|
-
if (canCache) {
|
|
14
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
15
|
-
var cached = cache.get(mod);
|
|
16
|
-
if (cached)
|
|
17
|
-
return cached;
|
|
18
|
-
}
|
|
19
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
20
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
21
|
-
for (let key of __getOwnPropNames(mod))
|
|
22
|
-
if (!__hasOwnProp.call(to, key))
|
|
23
|
-
__defProp(to, key, {
|
|
24
|
-
get: __accessProp.bind(mod, key),
|
|
25
|
-
enumerable: true
|
|
26
|
-
});
|
|
27
|
-
if (canCache)
|
|
28
|
-
cache.set(mod, to);
|
|
29
|
-
return to;
|
|
30
|
-
};
|
|
31
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
32
|
-
var __returnValue = (v) => v;
|
|
33
|
-
function __exportSetter(name, newValue) {
|
|
34
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
35
|
-
}
|
|
36
|
-
var __export = (target, all) => {
|
|
37
|
-
for (var name in all)
|
|
38
|
-
__defProp(target, name, {
|
|
39
|
-
get: all[name],
|
|
40
|
-
enumerable: true,
|
|
41
|
-
configurable: true,
|
|
42
|
-
set: __exportSetter.bind(all, name)
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
46
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
47
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
48
|
-
}) : x)(function(x) {
|
|
49
|
-
if (typeof require !== "undefined")
|
|
50
|
-
return require.apply(this, arguments);
|
|
51
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// src/components/chat/chat.schema.ts
|
|
55
|
-
var schema = {
|
|
56
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
57
|
-
type: "object",
|
|
58
|
-
properties: {
|
|
59
|
-
id: {
|
|
60
|
-
type: "string",
|
|
61
|
-
description: "Unique identifier used to scope accessibility attributes across the chat surface."
|
|
62
|
-
},
|
|
63
|
-
atBottom: {
|
|
64
|
-
type: "boolean",
|
|
65
|
-
description: "Whether the message viewport is scrolled to the bottom. Bindable; updated automatically as the user scrolls. Default `true`."
|
|
66
|
-
},
|
|
67
|
-
unreadCount: {
|
|
68
|
-
type: "number",
|
|
69
|
-
description: "Number of messages received while the viewport was scrolled away from the bottom. Bindable; resets to `0` when the user scrolls to the bottom. Default `0`."
|
|
70
|
-
},
|
|
71
|
-
newMessageIndicatorVisible: {
|
|
72
|
-
type: "boolean",
|
|
73
|
-
description: 'Whether the "new messages" indicator is currently visible above the composer. Bindable; cleared automatically when the viewport reaches the bottom. Default `false`.'
|
|
74
|
-
},
|
|
75
|
-
class: {
|
|
76
|
-
type: "string",
|
|
77
|
-
description: "Additional class name merged onto the `.chat-container` root element."
|
|
78
|
-
},
|
|
79
|
-
surfaceMode: {
|
|
80
|
-
enum: ["default", "transparent"],
|
|
81
|
-
description: "Controls the background of the chat surface. Use `'transparent'` to inherit the host element's background when embedding chat inside a card or panel. Default `'default'`."
|
|
82
|
-
},
|
|
83
|
-
density: {
|
|
84
|
-
enum: ["comfortable", "compact"],
|
|
85
|
-
description: "Controls spacing density of the message timeline.\n- `'comfortable'` (default): standard padding and gap.\n- `'compact'`: tighter spacing for data-dense contexts (e.g., embedded panels).\n Action buttons keep `min-height: var(--cinder-touch-target-min)` regardless."
|
|
86
|
-
},
|
|
87
|
-
variant: {
|
|
88
|
-
enum: ["bubble", "flat"],
|
|
89
|
-
description: "Visual treatment for message bubbles.\n- `'bubble'` (default): colored backgrounds differentiate user from assistant.\n- `'flat'`: no bubble backgrounds; role is communicated via alignment and role label.\n Text-on-surface contrast meets WCAG AA via `--cinder-text` on `--cinder-surface-inset`."
|
|
90
|
-
},
|
|
91
|
-
bottomThreshold: {
|
|
92
|
-
type: "number",
|
|
93
|
-
description: 'Distance in pixels from the bottom of the scroll viewport within which the chat is considered "at bottom" and will auto-scroll on new messages. Default `150`.'
|
|
94
|
-
},
|
|
95
|
-
jumpThreshold: {
|
|
96
|
-
type: "number",
|
|
97
|
-
description: "Distance in pixels scrolled up from the bottom required before the jump-to-latest button appears. Must be greater than `bottomThreshold` to prevent button flickering. Default `200`."
|
|
98
|
-
},
|
|
99
|
-
streaming: {
|
|
100
|
-
type: "boolean",
|
|
101
|
-
description: "Whether a streaming response is currently in progress. When `true`, the composer is disabled and a stop-generating button is shown. Default `false`."
|
|
102
|
-
},
|
|
103
|
-
streamingStatus: {
|
|
104
|
-
type: "string",
|
|
105
|
-
description: 'Optional status label displayed in the typing indicator while `streaming` is `true` and no streaming content has arrived yet (e.g. `"Thinking…"` or `"Analyzing file…"`). When omitted, three animated dots are shown.'
|
|
106
|
-
},
|
|
107
|
-
composerRole: {
|
|
108
|
-
type: "string",
|
|
109
|
-
description: "Explicit role for the composer textarea, for overlay patterns such as ARIA comboboxes."
|
|
110
|
-
},
|
|
111
|
-
composerAriaExpanded: {
|
|
112
|
-
enum: [false, true, "true", "false"],
|
|
113
|
-
description: "`aria-expanded` passed to the composer textarea for overlays such as slash-command menus."
|
|
114
|
-
},
|
|
115
|
-
composerAriaControls: {
|
|
116
|
-
type: "string",
|
|
117
|
-
description: "`aria-controls` passed to the composer textarea for overlays such as slash-command menus."
|
|
118
|
-
},
|
|
119
|
-
composerAriaActiveDescendant: {
|
|
120
|
-
type: "string",
|
|
121
|
-
description: "`aria-activedescendant` passed to the composer textarea for overlays such as slash-command menus."
|
|
122
|
-
},
|
|
123
|
-
composerAriaAutocomplete: {
|
|
124
|
-
enum: ["none", "inline", "list", "both"],
|
|
125
|
-
description: "`aria-autocomplete` passed to the composer textarea for overlays such as slash-command menus."
|
|
126
|
-
},
|
|
127
|
-
virtualized: {
|
|
128
|
-
type: "boolean",
|
|
129
|
-
description: "Use the virtualized message render path for long transcripts. The complete `ConversationHistory` remains unchanged; only the DOM window is reduced. Default `false`."
|
|
130
|
-
},
|
|
131
|
-
virtualizationEstimatedRowHeight: {
|
|
132
|
-
type: "number",
|
|
133
|
-
description: "Estimated row height in pixels for virtualized message rows. Default `88`."
|
|
134
|
-
},
|
|
135
|
-
virtualizationOverscan: {
|
|
136
|
-
type: "number",
|
|
137
|
-
description: "Number of extra virtual rows rendered before and after the viewport. Default `3`."
|
|
138
|
-
},
|
|
139
|
-
virtualizationInitialHeight: {
|
|
140
|
-
type: "number",
|
|
141
|
-
description: "Initial virtualized viewport height used before measurement. Default `640`."
|
|
142
|
-
},
|
|
143
|
-
moreHistoryAvailable: {
|
|
144
|
-
type: "boolean",
|
|
145
|
-
description: 'Whether the explicit "Load earlier messages" trigger is shown when a load handler exists. Default `true`.'
|
|
146
|
-
},
|
|
147
|
-
loadEarlierLabel: {
|
|
148
|
-
type: "string",
|
|
149
|
-
description: 'Label for the history pagination trigger. Default `"Load earlier messages"`.'
|
|
150
|
-
},
|
|
151
|
-
loadingEarlierLabel: {
|
|
152
|
-
type: "string",
|
|
153
|
-
description: 'Status text while older messages are loading. Default `"Loading earlier messages"`.'
|
|
154
|
-
},
|
|
155
|
-
emptyPrompts: {
|
|
156
|
-
type: "array",
|
|
157
|
-
items: {
|
|
158
|
-
type: "string"
|
|
159
|
-
},
|
|
160
|
-
description: "List of suggested starter prompt strings shown as clickable buttons in the default empty state. Clicking a prompt submits it immediately as a user message. Has no effect when a custom `empty` snippet is provided."
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
additionalProperties: false,
|
|
164
|
-
required: ["id"],
|
|
165
|
-
metadata: {
|
|
166
|
-
unsupportedProps: [
|
|
167
|
-
{
|
|
168
|
-
name: "adapter",
|
|
169
|
-
reason: "unknown-shape",
|
|
170
|
-
description: "Optional command/transport boundary around `conversation`. Its methods take\nprecedence over the matching callback props (e.g. `sendMessage` over\n`onsubmit`); omit it and Chat behaves exactly as with plain callbacks."
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
name: "capabilities",
|
|
174
|
-
reason: "unknown-shape",
|
|
175
|
-
description: "Feature-capability flags. Pass a `ChatCapabilities` object to enable or disable\nindividual Chat features (attachments, search, copy, editing, retry) as a group\nrather than as five separate boolean props."
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
name: "conversation",
|
|
179
|
-
reason: "unknown-shape",
|
|
180
|
-
required: true,
|
|
181
|
-
description: "The conversation transcript to render. Pass a {@link ConversationHistory}\nsnapshot; consumers holding a stateful conversation object pass its current\nsnapshot (e.g. `conversation.current`)."
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
name: "empty",
|
|
185
|
-
reason: "function-or-snippet"
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
name: "header",
|
|
189
|
-
reason: "function-or-snippet"
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
name: "messageActions",
|
|
193
|
-
reason: "function-or-snippet"
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
name: "messagePart",
|
|
197
|
-
reason: "function-or-snippet",
|
|
198
|
-
description: `Per-message-part override. Replaces the rendering of an individual body part
|
|
199
|
-
(markdown, tool call, tool result) while delegating the rest to the built-ins
|
|
200
|
-
via the \`renderDefault\` snippet it receives. Image parts are excluded — they
|
|
201
|
-
render through the grouped attachment grid, not this override.`
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
name: "messageReasoning",
|
|
205
|
-
reason: "function-or-snippet",
|
|
206
|
-
description: "Override or supplement the reasoning text for a message. Called per-message;\nreturn a non-empty string to show a reasoning block, `undefined` to fall back\nto `message.metadata['cinder:reasoning']`, empty string to suppress reasoning."
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
name: "messageStatus",
|
|
210
|
-
reason: "function-or-snippet"
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
name: "messageSteps",
|
|
214
|
-
reason: "function-or-snippet",
|
|
215
|
-
description: "Override or supplement the step list for a message. Called per-message;\nreturn an array to show step indicators, `undefined` to fall back to\n`message.metadata['cinder:steps']`. An empty array suppresses steps."
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
name: "messageSuggestions",
|
|
219
|
-
reason: "function-or-snippet",
|
|
220
|
-
description: "Override or supplement the suggestion list for a message. Called\nper-message; return an array of label strings to show suggestion chips,\n`undefined` to fall back to `message.metadata['cinder:suggestions']`. An\nempty array suppresses suggestions."
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
name: "onadaptererror",
|
|
224
|
-
reason: "function-or-snippet",
|
|
225
|
-
description: "Called when an adapter command fails — either a rejected promise or a synchronous throw from the method."
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
name: "onapprove",
|
|
229
|
-
reason: "function-or-snippet",
|
|
230
|
-
description: `Called when the user approves an action-required tool call. The
|
|
231
|
-
consumer is responsible for updating its transcript (e.g. calling
|
|
232
|
-
conversationalist to unblock the pending tool) and triggering a new
|
|
233
|
-
generation. When an adapter is also wired, Chat calls
|
|
234
|
-
\`adapter.approveToolCall(toolCallId)\` first and then this callback.`
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
name: "onattachmentadd",
|
|
238
|
-
reason: "function-or-snippet"
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
name: "onattachmentfailure",
|
|
242
|
-
reason: "function-or-snippet"
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
name: "onattachmentremove",
|
|
246
|
-
reason: "function-or-snippet"
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
name: "oncomposerblur",
|
|
250
|
-
reason: "function-or-snippet",
|
|
251
|
-
description: `Called when focus leaves the composer textarea. Overlay primitives can use
|
|
252
|
-
this to dismiss without preventing native focus movement.`
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
name: "oncomposerinput",
|
|
256
|
-
reason: "function-or-snippet",
|
|
257
|
-
description: "Called with the composer's current plain-text value on every composer\ninput event. The optional event exposes the textarea for composer-bound\noverlays without reaching into `.chat-input-editor` DOM directly."
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
name: "oncomposerkeydown",
|
|
261
|
-
reason: "function-or-snippet",
|
|
262
|
-
description: `Called before Chat's internal composer key handling when a keydown
|
|
263
|
-
originates from the composer textarea. Call \`event.preventDefault()\` to
|
|
264
|
-
let an overlay consume Arrow keys, Enter, or Escape before Enter-to-send.
|
|
265
|
-
Chat does not call this hook during IME composition, so Enter can still
|
|
266
|
-
confirm the active candidate instead of sending.`
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
name: "oncomposerselectionchange",
|
|
270
|
-
reason: "function-or-snippet",
|
|
271
|
-
description: `Called after pointer or selection activity may have moved the composer
|
|
272
|
-
caret without changing text. Overlay primitives can resync their active
|
|
273
|
-
token from the textarea selection.`
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
name: "ondeny",
|
|
277
|
-
reason: "function-or-snippet",
|
|
278
|
-
description: "Called when the user denies an action-required tool call. When an\nadapter is also wired, Chat calls `adapter.denyToolCall(toolCallId)` first\nand then this callback."
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
name: "onedit",
|
|
282
|
-
reason: "function-or-snippet"
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
name: "onexpandedchange",
|
|
286
|
-
reason: "function-or-snippet"
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
name: "onjumptolatest",
|
|
290
|
-
reason: "function-or-snippet"
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
name: "onloadhistory",
|
|
294
|
-
reason: "function-or-snippet",
|
|
295
|
-
description: "Called when the explicit history trigger is activated. The consumer prepends compatible messages into `conversation`."
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
name: "onpushmessage",
|
|
299
|
-
reason: "function-or-snippet",
|
|
300
|
-
description: "Forwarded from the adapter's real-time `onMessage` push (consumer owns the transcript)."
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
name: "onreadreceipt",
|
|
304
|
-
reason: "function-or-snippet",
|
|
305
|
-
description: "Forwarded from the adapter's real-time `onReadReceipt` push."
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
name: "onretry",
|
|
309
|
-
reason: "function-or-snippet"
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
name: "onscrollstatechange",
|
|
313
|
-
reason: "function-or-snippet"
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
name: "onstopgenerating",
|
|
317
|
-
reason: "function-or-snippet"
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
name: "onsubmit",
|
|
321
|
-
reason: "function-or-snippet"
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
name: "onsuggestionselect",
|
|
325
|
-
reason: "function-or-snippet",
|
|
326
|
-
description: `Called when the user selects a suggestion chip. The label string is
|
|
327
|
-
passed back. The consumer is responsible for submitting it as a new user
|
|
328
|
-
message.`
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
name: "ontypingchange",
|
|
332
|
-
reason: "function-or-snippet",
|
|
333
|
-
description: "Forwarded from the adapter's real-time `onTypingChange` push."
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
name: "onunreadindicatorchange",
|
|
337
|
-
reason: "function-or-snippet"
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
name: "readReceipts",
|
|
341
|
-
reason: "unknown-shape",
|
|
342
|
-
description: "Per-message read receipt state. Out-of-band UI state — NOT stored on `Message`.\nPass a `Map` keyed by message id with a {@link ReadReceipt} value; the\ncomponent renders a receipt badge on USER messages only. The adapter's\n`onReadReceipt` push handler populates the same state when an adapter is wired.\nDefault `undefined` (no receipts shown)."
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
name: "row",
|
|
346
|
-
reason: "function-or-snippet",
|
|
347
|
-
description: "Full-row override. Renders an entire message row; receives the message and\na `renderDefault` snippet for the built-in row (inversion of control), so a\nconsumer can wrap or fully replace specific rows."
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
name: "typingParticipants",
|
|
351
|
-
reason: "unknown-shape",
|
|
352
|
-
description: "Participants who are currently typing. Out-of-band UI state — NOT stored on\n`Message`. Pass an array of {@link TypingParticipant} objects; the component\nrenders a per-participant typing indicator above the input. The adapter's\n`onTypingChange` push handler feeds the same indicator when an adapter is\nwired. Default `undefined` (indicator hidden)."
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
name: "viewportAttachment",
|
|
356
|
-
reason: "function-or-snippet"
|
|
357
|
-
}
|
|
358
|
-
]
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
var chat_schema_default = schema;
|
|
362
|
-
export {
|
|
363
|
-
chat_schema_default as default
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
//# debugId=F47E899530612A1264756E2164756E21
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @cinder
|
|
3
|
-
* @category domain
|
|
4
|
-
* @status domain-suite
|
|
5
|
-
* @purpose Opinionated conversation surface bundling message list, composer, attachments, and scroll affordances for AI or support transcripts.
|
|
6
|
-
* @tag chat
|
|
7
|
-
* @tag conversation
|
|
8
|
-
* @tag domain-suite
|
|
9
|
-
* @useWhen Shipping a full chat surface with composer, scroll-anchor, unread indicator, and attachments bundled as one heavyweight drop-in.
|
|
10
|
-
* @useWhen Building an AI assistant or support thread where conversation state is modeled as a transcript of role-tagged messages.
|
|
11
|
-
* @useWhen Embedding Chat in a definite-height flex or grid region where its internal transcript should own scrolling.
|
|
12
|
-
* @avoidWhen Rendering a one-off message list — compose lighter primitives directly instead of pulling the full suite.
|
|
13
|
-
* @avoidWhen The transcript is read-only and needs no composer — a simple list of message bubbles is a better fit.
|
|
14
|
-
* @related markdown-editor
|
|
15
|
-
*/
|
|
16
|
-
export type { ChatAnnounceLevel, ChatProps } from './chat.types.ts';
|
|
17
|
-
import type { ChatAnnounceLevel, ChatProps } from './chat.types.ts';
|
|
18
|
-
declare const Chat: import("svelte").Component<ChatProps, {
|
|
19
|
-
beginStreaming: (messageId: string) => void;
|
|
20
|
-
pushToken: (token: string) => void;
|
|
21
|
-
endStreaming: () => void;
|
|
22
|
-
announce: (message: string, level?: ChatAnnounceLevel) => void;
|
|
23
|
-
scrollToBottom: () => void;
|
|
24
|
-
scrollToTop: () => void;
|
|
25
|
-
focusInput: () => void;
|
|
26
|
-
clearInput: () => void;
|
|
27
|
-
getComposerValue: () => string;
|
|
28
|
-
getEditorElement: () => HTMLTextAreaElement | null;
|
|
29
|
-
}, "">;
|
|
30
|
-
type Chat = ReturnType<typeof Chat>;
|
|
31
|
-
export default Chat;
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { Attachment } from 'svelte/attachments';
|
|
3
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
-
import type { ChatAdapter, ChatAdapterErrorEvent, ChatReadReceiptEvent } from './adapter/chat-adapter.ts';
|
|
5
|
-
import type { ChatScrollStateChangeEvent, ChatStopGeneratingEvent, ChatSubmitEvent, ChatUnreadIndicatorChangeEvent } from './container/chat-events.ts';
|
|
6
|
-
import type { ConversationHistory, Message } from './conversation-model.ts';
|
|
7
|
-
import type { ChatAttachment } from './input/chat-attachment.ts';
|
|
8
|
-
import type { MessagePartOverride } from './message/chat-message-parts.ts';
|
|
9
|
-
import type { StepInfo } from './utilities/types.ts';
|
|
10
|
-
/**
|
|
11
|
-
* A participant who is currently typing. Out-of-band UI state — NOT stored on
|
|
12
|
-
* `Message` or `ConversationHistory`. Flows in as a plain (non-bindable) prop or
|
|
13
|
-
* via the adapter's `onTypingChange` push handler.
|
|
14
|
-
*/
|
|
15
|
-
export type TypingParticipant = {
|
|
16
|
-
/** Unique identifier for the participant (e.g. user id). */
|
|
17
|
-
id: string;
|
|
18
|
-
/** Display name shown in the typing indicator label. */
|
|
19
|
-
name: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Read-receipt state for a single message. Out-of-band UI state — NOT stored on
|
|
23
|
-
* `Message`. Flows in as a plain (non-bindable) `readReceipts` prop keyed by
|
|
24
|
-
* message id, or accumulated from the adapter's `onReadReceipt` push handler.
|
|
25
|
-
*
|
|
26
|
-
* Render rules: shown only on `user` messages; color alone never conveys state
|
|
27
|
-
* (icon + text label always present).
|
|
28
|
-
*/
|
|
29
|
-
export type ReadReceipt = {
|
|
30
|
-
/** Delivery/read status for this message. */
|
|
31
|
-
status: 'sent' | 'delivered' | 'read';
|
|
32
|
-
/**
|
|
33
|
-
* Names of participants who have read the message. Used to compose the
|
|
34
|
-
* accessible text (e.g. "Read by Alice, Bob"). May be empty when status is
|
|
35
|
-
* `sent` or `delivered`.
|
|
36
|
-
*/
|
|
37
|
-
readBy?: string[];
|
|
38
|
-
};
|
|
39
|
-
/** Live-region channel for imperative Chat announcements. */
|
|
40
|
-
export type ChatAnnounceLevel = 'polite' | 'assertive';
|
|
41
|
-
/**
|
|
42
|
-
* Full-row override snippet. Inversion of control: receives the message AND a
|
|
43
|
-
* `renderDefault` snippet that renders the built-in row, so a consumer can wrap
|
|
44
|
-
* or replace a row while still delegating to the default when it chooses.
|
|
45
|
-
*/
|
|
46
|
-
export type ChatRowOverride = Snippet<[message: Message, renderDefault: Snippet]>;
|
|
47
|
-
/**
|
|
48
|
-
* Feature-capability flags for the Chat component. Grouped here so consumers
|
|
49
|
-
* pass a single object instead of five scattered boolean props.
|
|
50
|
-
*
|
|
51
|
-
* All flags default to `true` when the `capabilities` prop is omitted or when
|
|
52
|
-
* an individual key is absent from the object.
|
|
53
|
-
*/
|
|
54
|
-
export type ChatCapabilities = {
|
|
55
|
-
/** Whether file attachments are enabled in the composer. When `false`, the attachment button is hidden and drag-and-drop onto the chat surface is suppressed. Default `true`. */
|
|
56
|
-
attachments?: boolean;
|
|
57
|
-
/** Whether in-conversation search is enabled. When `true`, pressing Ctrl+F / Cmd+F opens a search bar that highlights matching messages. Default `true`. */
|
|
58
|
-
search?: boolean;
|
|
59
|
-
/** Whether per-message copy buttons are shown in the message action bar. Default `true`. */
|
|
60
|
-
copy?: boolean;
|
|
61
|
-
/** Whether user messages can be edited inline. Default `true`. */
|
|
62
|
-
editing?: boolean;
|
|
63
|
-
/** Whether failed assistant messages show a retry button. Default `true`. */
|
|
64
|
-
retry?: boolean;
|
|
65
|
-
};
|
|
66
|
-
/** Props for the Chat component. */
|
|
67
|
-
export type ChatProps = Omit<HTMLAttributes<HTMLElement>, 'class' | 'onsubmit'> & {
|
|
68
|
-
/** Unique identifier used to scope accessibility attributes across the chat surface. */
|
|
69
|
-
id: string;
|
|
70
|
-
/**
|
|
71
|
-
* The conversation transcript to render. Pass a {@link ConversationHistory}
|
|
72
|
-
* snapshot; consumers holding a stateful conversation object pass its current
|
|
73
|
-
* snapshot (e.g. `conversation.current`).
|
|
74
|
-
*/
|
|
75
|
-
conversation: ConversationHistory;
|
|
76
|
-
/** Whether the message viewport is scrolled to the bottom. Bindable; updated automatically as the user scrolls. Default `true`. */
|
|
77
|
-
atBottom?: boolean;
|
|
78
|
-
/** Number of messages received while the viewport was scrolled away from the bottom. Bindable; resets to `0` when the user scrolls to the bottom. Default `0`. */
|
|
79
|
-
unreadCount?: number;
|
|
80
|
-
/** Whether the "new messages" indicator is currently visible above the composer. Bindable; cleared automatically when the viewport reaches the bottom. Default `false`. */
|
|
81
|
-
newMessageIndicatorVisible?: boolean;
|
|
82
|
-
/** Additional class name merged onto the `.chat-container` root element. */
|
|
83
|
-
class?: string;
|
|
84
|
-
/** Controls the background of the chat surface. Use `'transparent'` to inherit the host element's background when embedding chat inside a card or panel. Default `'default'`. */
|
|
85
|
-
surfaceMode?: 'default' | 'transparent';
|
|
86
|
-
/**
|
|
87
|
-
* Controls spacing density of the message timeline.
|
|
88
|
-
* - `'comfortable'` (default): standard padding and gap.
|
|
89
|
-
* - `'compact'`: tighter spacing for data-dense contexts (e.g., embedded panels).
|
|
90
|
-
* Action buttons keep `min-height: var(--cinder-touch-target-min)` regardless.
|
|
91
|
-
*/
|
|
92
|
-
density?: 'comfortable' | 'compact';
|
|
93
|
-
/**
|
|
94
|
-
* Visual treatment for message bubbles.
|
|
95
|
-
* - `'bubble'` (default): colored backgrounds differentiate user from assistant.
|
|
96
|
-
* - `'flat'`: no bubble backgrounds; role is communicated via alignment and role label.
|
|
97
|
-
* Text-on-surface contrast meets WCAG AA via `--cinder-text` on `--cinder-surface-inset`.
|
|
98
|
-
*/
|
|
99
|
-
variant?: 'bubble' | 'flat';
|
|
100
|
-
/** Distance in pixels from the bottom of the scroll viewport within which the chat is considered "at bottom" and will auto-scroll on new messages. Default `150`. */
|
|
101
|
-
bottomThreshold?: number;
|
|
102
|
-
/** Distance in pixels scrolled up from the bottom required before the jump-to-latest button appears. Must be greater than `bottomThreshold` to prevent button flickering. Default `200`. */
|
|
103
|
-
jumpThreshold?: number;
|
|
104
|
-
/** Whether a streaming response is currently in progress. When `true`, the composer is disabled and a stop-generating button is shown. Default `false`. */
|
|
105
|
-
streaming?: boolean;
|
|
106
|
-
/** Optional status label displayed in the typing indicator while `streaming` is `true` and no streaming content has arrived yet (e.g. `"Thinking…"` or `"Analyzing file…"`). When omitted, three animated dots are shown. */
|
|
107
|
-
streamingStatus?: string;
|
|
108
|
-
/**
|
|
109
|
-
* Feature-capability flags. Pass a `ChatCapabilities` object to enable or disable
|
|
110
|
-
* individual Chat features (attachments, search, copy, editing, retry) as a group
|
|
111
|
-
* rather than as five separate boolean props.
|
|
112
|
-
*/
|
|
113
|
-
capabilities?: ChatCapabilities;
|
|
114
|
-
/** Explicit role for the composer textarea, for overlay patterns such as ARIA comboboxes. */
|
|
115
|
-
composerRole?: string | undefined;
|
|
116
|
-
/** `aria-expanded` passed to the composer textarea for overlays such as slash-command menus. */
|
|
117
|
-
composerAriaExpanded?: boolean | 'true' | 'false' | undefined;
|
|
118
|
-
/** `aria-controls` passed to the composer textarea for overlays such as slash-command menus. */
|
|
119
|
-
composerAriaControls?: string | undefined;
|
|
120
|
-
/** `aria-activedescendant` passed to the composer textarea for overlays such as slash-command menus. */
|
|
121
|
-
composerAriaActiveDescendant?: string | undefined;
|
|
122
|
-
/** `aria-autocomplete` passed to the composer textarea for overlays such as slash-command menus. */
|
|
123
|
-
composerAriaAutocomplete?: 'none' | 'inline' | 'list' | 'both' | undefined;
|
|
124
|
-
/** Use the virtualized message render path for long transcripts. The complete `ConversationHistory` remains unchanged; only the DOM window is reduced. Default `false`. */
|
|
125
|
-
virtualized?: boolean;
|
|
126
|
-
/** Estimated row height in pixels for virtualized message rows. Default `88`. */
|
|
127
|
-
virtualizationEstimatedRowHeight?: number;
|
|
128
|
-
/** Number of extra virtual rows rendered before and after the viewport. Default `3`. */
|
|
129
|
-
virtualizationOverscan?: number;
|
|
130
|
-
/** Initial virtualized viewport height used before measurement. Default `640`. */
|
|
131
|
-
virtualizationInitialHeight?: number;
|
|
132
|
-
/** Whether the explicit "Load earlier messages" trigger is shown when a load handler exists. Default `true`. */
|
|
133
|
-
moreHistoryAvailable?: boolean;
|
|
134
|
-
/** Label for the history pagination trigger. Default `"Load earlier messages"`. */
|
|
135
|
-
loadEarlierLabel?: string;
|
|
136
|
-
/** Status text while older messages are loading. Default `"Loading earlier messages"`. */
|
|
137
|
-
loadingEarlierLabel?: string;
|
|
138
|
-
header?: Snippet;
|
|
139
|
-
empty?: Snippet;
|
|
140
|
-
/** List of suggested starter prompt strings shown as clickable buttons in the default empty state. Clicking a prompt submits it immediately as a user message. Has no effect when a custom `empty` snippet is provided. */
|
|
141
|
-
emptyPrompts?: string[];
|
|
142
|
-
messageActions?: Snippet<[Message]>;
|
|
143
|
-
messageStatus?: Snippet<[Message]>;
|
|
144
|
-
/**
|
|
145
|
-
* Full-row override. Renders an entire message row; receives the message and
|
|
146
|
-
* a `renderDefault` snippet for the built-in row (inversion of control), so a
|
|
147
|
-
* consumer can wrap or fully replace specific rows.
|
|
148
|
-
*/
|
|
149
|
-
row?: ChatRowOverride;
|
|
150
|
-
/**
|
|
151
|
-
* Per-message-part override. Replaces the rendering of an individual body part
|
|
152
|
-
* (markdown, tool call, tool result) while delegating the rest to the built-ins
|
|
153
|
-
* via the `renderDefault` snippet it receives. Image parts are excluded — they
|
|
154
|
-
* render through the grouped attachment grid, not this override.
|
|
155
|
-
*/
|
|
156
|
-
messagePart?: MessagePartOverride;
|
|
157
|
-
viewportAttachment?: Attachment<HTMLElement>;
|
|
158
|
-
/**
|
|
159
|
-
* Participants who are currently typing. Out-of-band UI state — NOT stored on
|
|
160
|
-
* `Message`. Pass an array of {@link TypingParticipant} objects; the component
|
|
161
|
-
* renders a per-participant typing indicator above the input. The adapter's
|
|
162
|
-
* `onTypingChange` push handler feeds the same indicator when an adapter is
|
|
163
|
-
* wired. Default `undefined` (indicator hidden).
|
|
164
|
-
*/
|
|
165
|
-
typingParticipants?: TypingParticipant[];
|
|
166
|
-
/**
|
|
167
|
-
* Per-message read receipt state. Out-of-band UI state — NOT stored on `Message`.
|
|
168
|
-
* Pass a `Map` keyed by message id with a {@link ReadReceipt} value; the
|
|
169
|
-
* component renders a receipt badge on USER messages only. The adapter's
|
|
170
|
-
* `onReadReceipt` push handler populates the same state when an adapter is wired.
|
|
171
|
-
* Default `undefined` (no receipts shown).
|
|
172
|
-
*/
|
|
173
|
-
readReceipts?: Map<string, ReadReceipt>;
|
|
174
|
-
/**
|
|
175
|
-
* Optional command/transport boundary around `conversation`. Its methods take
|
|
176
|
-
* precedence over the matching callback props (e.g. `sendMessage` over
|
|
177
|
-
* `onsubmit`); omit it and Chat behaves exactly as with plain callbacks.
|
|
178
|
-
*/
|
|
179
|
-
adapter?: ChatAdapter;
|
|
180
|
-
/** Called when an adapter command fails — either a rejected promise or a synchronous throw from the method. */
|
|
181
|
-
onadaptererror?: (event: ChatAdapterErrorEvent) => void;
|
|
182
|
-
/** Forwarded from the adapter's real-time `onMessage` push (consumer owns the transcript). */
|
|
183
|
-
onpushmessage?: (message: Message) => void;
|
|
184
|
-
/** Forwarded from the adapter's real-time `onTypingChange` push. */
|
|
185
|
-
ontypingchange?: (isTyping: boolean) => void;
|
|
186
|
-
/** Forwarded from the adapter's real-time `onReadReceipt` push. */
|
|
187
|
-
onreadreceipt?: (event: ChatReadReceiptEvent) => void;
|
|
188
|
-
onsubmit?: (event: ChatSubmitEvent) => void;
|
|
189
|
-
onretry?: (messageId: string) => void;
|
|
190
|
-
onedit?: (event: {
|
|
191
|
-
messageId: string;
|
|
192
|
-
content: string;
|
|
193
|
-
}) => void;
|
|
194
|
-
/**
|
|
195
|
-
* Called when the user approves an action-required tool call. The
|
|
196
|
-
* consumer is responsible for updating its transcript (e.g. calling
|
|
197
|
-
* conversationalist to unblock the pending tool) and triggering a new
|
|
198
|
-
* generation. When an adapter is also wired, Chat calls
|
|
199
|
-
* `adapter.approveToolCall(toolCallId)` first and then this callback.
|
|
200
|
-
*/
|
|
201
|
-
onapprove?: (toolCallId: string) => void;
|
|
202
|
-
/**
|
|
203
|
-
* Called when the user denies an action-required tool call. When an
|
|
204
|
-
* adapter is also wired, Chat calls `adapter.denyToolCall(toolCallId)` first
|
|
205
|
-
* and then this callback.
|
|
206
|
-
*/
|
|
207
|
-
ondeny?: (toolCallId: string) => void;
|
|
208
|
-
/**
|
|
209
|
-
* Override or supplement the reasoning text for a message. Called per-message;
|
|
210
|
-
* return a non-empty string to show a reasoning block, `undefined` to fall back
|
|
211
|
-
* to `message.metadata['cinder:reasoning']`, empty string to suppress reasoning.
|
|
212
|
-
*/
|
|
213
|
-
messageReasoning?: (message: Message) => string | undefined;
|
|
214
|
-
/**
|
|
215
|
-
* Override or supplement the step list for a message. Called per-message;
|
|
216
|
-
* return an array to show step indicators, `undefined` to fall back to
|
|
217
|
-
* `message.metadata['cinder:steps']`. An empty array suppresses steps.
|
|
218
|
-
*/
|
|
219
|
-
messageSteps?: (message: Message) => StepInfo[] | undefined;
|
|
220
|
-
/**
|
|
221
|
-
* Override or supplement the suggestion list for a message. Called
|
|
222
|
-
* per-message; return an array of label strings to show suggestion chips,
|
|
223
|
-
* `undefined` to fall back to `message.metadata['cinder:suggestions']`. An
|
|
224
|
-
* empty array suppresses suggestions.
|
|
225
|
-
*/
|
|
226
|
-
messageSuggestions?: (message: Message) => string[] | undefined;
|
|
227
|
-
/**
|
|
228
|
-
* Called when the user selects a suggestion chip. The label string is
|
|
229
|
-
* passed back. The consumer is responsible for submitting it as a new user
|
|
230
|
-
* message.
|
|
231
|
-
*/
|
|
232
|
-
onsuggestionselect?: (label: string) => void;
|
|
233
|
-
/** Called when the explicit history trigger is activated. The consumer prepends compatible messages into `conversation`. */
|
|
234
|
-
onloadhistory?: () => void | Promise<void>;
|
|
235
|
-
onstopgenerating?: (event: ChatStopGeneratingEvent) => void;
|
|
236
|
-
onjumptolatest?: () => void;
|
|
237
|
-
onscrollstatechange?: (event: ChatScrollStateChangeEvent) => void;
|
|
238
|
-
onunreadindicatorchange?: (event: ChatUnreadIndicatorChangeEvent) => void;
|
|
239
|
-
onexpandedchange?: (expanded: boolean) => void;
|
|
240
|
-
onattachmentadd?: (attachment: ChatAttachment) => void;
|
|
241
|
-
onattachmentremove?: (attachment: ChatAttachment) => void;
|
|
242
|
-
onattachmentfailure?: (file: File, error: string) => void;
|
|
243
|
-
/**
|
|
244
|
-
* Called with the composer's current plain-text value on every composer
|
|
245
|
-
* input event. The optional event exposes the textarea for composer-bound
|
|
246
|
-
* overlays without reaching into `.chat-input-editor` DOM directly.
|
|
247
|
-
*/
|
|
248
|
-
oncomposerinput?: (value: string, event?: Event) => void;
|
|
249
|
-
/**
|
|
250
|
-
* Called before Chat's internal composer key handling when a keydown
|
|
251
|
-
* originates from the composer textarea. Call `event.preventDefault()` to
|
|
252
|
-
* let an overlay consume Arrow keys, Enter, or Escape before Enter-to-send.
|
|
253
|
-
* Chat does not call this hook during IME composition, so Enter can still
|
|
254
|
-
* confirm the active candidate instead of sending.
|
|
255
|
-
*/
|
|
256
|
-
oncomposerkeydown?: (event: KeyboardEvent) => void;
|
|
257
|
-
/**
|
|
258
|
-
* Called after pointer or selection activity may have moved the composer
|
|
259
|
-
* caret without changing text. Overlay primitives can resync their active
|
|
260
|
-
* token from the textarea selection.
|
|
261
|
-
*/
|
|
262
|
-
oncomposerselectionchange?: (event: Event) => void;
|
|
263
|
-
/**
|
|
264
|
-
* Called when focus leaves the composer textarea. Overlay primitives can use
|
|
265
|
-
* this to dismiss without preventing native focus movement.
|
|
266
|
-
*/
|
|
267
|
-
oncomposerblur?: (event: FocusEvent) => void;
|
|
268
|
-
};
|