@fusion.dev/helix-headless 0.0.0-dev
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/LICENSE +21 -0
- package/custom-elements.json +75202 -0
- package/dist/accordion/index.d.ts +2 -0
- package/dist/accordion/index.js +2 -0
- package/dist/accordion/item/accordion-item.d.ts +141 -0
- package/dist/accordion/item/accordion-item.js +214 -0
- package/dist/accordion/root/accordion-root.d.ts +57 -0
- package/dist/accordion/root/accordion-root.js +96 -0
- package/dist/announcement/index.d.ts +1 -0
- package/dist/announcement/index.js +1 -0
- package/dist/announcement/root/announcement-root.d.ts +106 -0
- package/dist/announcement/root/announcement-root.js +144 -0
- package/dist/app-header/index.d.ts +1 -0
- package/dist/app-header/index.js +1 -0
- package/dist/app-header/root/app-header-root.d.ts +113 -0
- package/dist/app-header/root/app-header-root.js +147 -0
- package/dist/avatar/group/avatar-group.d.ts +116 -0
- package/dist/avatar/group/avatar-group.js +136 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar/root/avatar-root.d.ts +71 -0
- package/dist/avatar/root/avatar-root.js +147 -0
- package/dist/badge/index.d.ts +1 -0
- package/dist/badge/index.js +1 -0
- package/dist/badge/root/badge-root.d.ts +61 -0
- package/dist/badge/root/badge-root.js +121 -0
- package/dist/bar-chart/index.d.ts +1 -0
- package/dist/bar-chart/index.js +1 -0
- package/dist/bar-chart/root/bar-chart-root.d.ts +266 -0
- package/dist/bar-chart/root/bar-chart-root.js +515 -0
- package/dist/blockquote/index.d.ts +1 -0
- package/dist/blockquote/index.js +1 -0
- package/dist/blockquote/root/blockquote-root.d.ts +51 -0
- package/dist/blockquote/root/blockquote-root.js +84 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +104 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +137 -0
- package/dist/breadcrumbs/index.d.ts +2 -0
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +77 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.js +94 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/button/index.js +1 -0
- package/dist/button/root/button-root.d.ts +251 -0
- package/dist/button/root/button-root.js +401 -0
- package/dist/button-group/index.d.ts +1 -0
- package/dist/button-group/index.js +1 -0
- package/dist/button-group/root/button-group-root.d.ts +62 -0
- package/dist/button-group/root/button-group-root.js +62 -0
- package/dist/callout/index.d.ts +1 -0
- package/dist/callout/index.js +1 -0
- package/dist/callout/root/callout-root.d.ts +72 -0
- package/dist/callout/root/callout-root.js +90 -0
- package/dist/card/index.d.ts +1 -0
- package/dist/card/index.js +1 -0
- package/dist/card/root/card-root.d.ts +54 -0
- package/dist/card/root/card-root.js +71 -0
- package/dist/carousel/index.d.ts +1 -0
- package/dist/carousel/index.js +1 -0
- package/dist/carousel/root/carousel-root.d.ts +399 -0
- package/dist/carousel/root/carousel-root.js +723 -0
- package/dist/chat/composer/chat-composer.d.ts +160 -0
- package/dist/chat/composer/chat-composer.js +273 -0
- package/dist/chat/index.d.ts +3 -0
- package/dist/chat/index.js +3 -0
- package/dist/chat/message/chat-message.d.ts +170 -0
- package/dist/chat/message/chat-message.js +271 -0
- package/dist/chat/root/chat-root.d.ts +216 -0
- package/dist/chat/root/chat-root.js +389 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/index.js +1 -0
- package/dist/checkbox/root/checkbox-root.d.ts +108 -0
- package/dist/checkbox/root/checkbox-root.js +207 -0
- package/dist/checkbox-group/index.d.ts +1 -0
- package/dist/checkbox-group/index.js +1 -0
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +155 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +293 -0
- package/dist/code/index.d.ts +1 -0
- package/dist/code/index.js +1 -0
- package/dist/code/root/code-root.d.ts +36 -0
- package/dist/code/root/code-root.js +43 -0
- package/dist/code-block/index.d.ts +1 -0
- package/dist/code-block/index.js +1 -0
- package/dist/code-block/root/code-block-root.d.ts +112 -0
- package/dist/code-block/root/code-block-root.js +155 -0
- package/dist/color-input/index.d.ts +1 -0
- package/dist/color-input/index.js +1 -0
- package/dist/color-input/root/color-input-root.d.ts +227 -0
- package/dist/color-input/root/color-input-root.js +456 -0
- package/dist/color-picker/color.d.ts +74 -0
- package/dist/color-picker/color.js +238 -0
- package/dist/color-picker/index.d.ts +2 -0
- package/dist/color-picker/index.js +2 -0
- package/dist/color-picker/root/color-picker-root.d.ts +303 -0
- package/dist/color-picker/root/color-picker-root.js +576 -0
- package/dist/combobox/index.d.ts +1 -0
- package/dist/combobox/index.js +1 -0
- package/dist/combobox/root/combobox-root.d.ts +396 -0
- package/dist/combobox/root/combobox-root.js +808 -0
- package/dist/command/index.d.ts +1 -0
- package/dist/command/index.js +1 -0
- package/dist/command/root/command-root.d.ts +166 -0
- package/dist/command/root/command-root.js +353 -0
- package/dist/copy-button/index.d.ts +1 -0
- package/dist/copy-button/index.js +1 -0
- package/dist/copy-button/root/copy-button-root.d.ts +154 -0
- package/dist/copy-button/root/copy-button-root.js +225 -0
- package/dist/data-table/index.d.ts +2 -0
- package/dist/data-table/index.js +2 -0
- package/dist/data-table/root/data-table-root.d.ts +392 -0
- package/dist/data-table/root/data-table-root.js +729 -0
- package/dist/data-table/root/order.d.ts +116 -0
- package/dist/data-table/root/order.js +175 -0
- package/dist/date-input/index.d.ts +1 -0
- package/dist/date-input/index.js +1 -0
- package/dist/date-input/root/date-input-root.d.ts +361 -0
- package/dist/date-input/root/date-input-root.js +791 -0
- package/dist/date-picker/index.d.ts +1 -0
- package/dist/date-picker/index.js +1 -0
- package/dist/date-picker/root/date-picker-root.d.ts +361 -0
- package/dist/date-picker/root/date-picker-root.js +837 -0
- package/dist/dialog/index.d.ts +1 -0
- package/dist/dialog/index.js +1 -0
- package/dist/dialog/root/dialog-root.d.ts +185 -0
- package/dist/dialog/root/dialog-root.js +319 -0
- package/dist/divider/index.d.ts +1 -0
- package/dist/divider/index.js +1 -0
- package/dist/divider/root/divider-root.d.ts +68 -0
- package/dist/divider/root/divider-root.js +116 -0
- package/dist/donut-chart/index.d.ts +1 -0
- package/dist/donut-chart/index.js +1 -0
- package/dist/donut-chart/root/donut-chart-root.d.ts +209 -0
- package/dist/donut-chart/root/donut-chart-root.js +395 -0
- package/dist/drawer/index.d.ts +1 -0
- package/dist/drawer/index.js +1 -0
- package/dist/drawer/root/drawer-root.d.ts +144 -0
- package/dist/drawer/root/drawer-root.js +222 -0
- package/dist/drilldown/index.d.ts +2 -0
- package/dist/drilldown/index.js +2 -0
- package/dist/drilldown/item/drilldown-item.d.ts +87 -0
- package/dist/drilldown/item/drilldown-item.js +152 -0
- package/dist/drilldown/root/drilldown-root.d.ts +115 -0
- package/dist/drilldown/root/drilldown-root.js +263 -0
- package/dist/element-events.generated.d.ts +1 -0
- package/dist/element-events.generated.js +125 -0
- package/dist/empty/index.d.ts +1 -0
- package/dist/empty/index.js +1 -0
- package/dist/empty/root/empty-root.d.ts +47 -0
- package/dist/empty/root/empty-root.js +68 -0
- package/dist/file-input/index.d.ts +1 -0
- package/dist/file-input/index.js +1 -0
- package/dist/file-input/root/file-input-root.d.ts +196 -0
- package/dist/file-input/root/file-input-root.js +488 -0
- package/dist/format-date/index.d.ts +1 -0
- package/dist/format-date/index.js +1 -0
- package/dist/format-date/root/format-date-root.d.ts +151 -0
- package/dist/format-date/root/format-date-root.js +266 -0
- package/dist/heatmap/index.d.ts +2 -0
- package/dist/heatmap/index.js +2 -0
- package/dist/heatmap/root/buckets.d.ts +62 -0
- package/dist/heatmap/root/buckets.js +85 -0
- package/dist/heatmap/root/heatmap-root.d.ts +330 -0
- package/dist/heatmap/root/heatmap-root.js +526 -0
- package/dist/icon/index.d.ts +1 -0
- package/dist/icon/index.js +1 -0
- package/dist/icon/root/icon-root.d.ts +53 -0
- package/dist/icon/root/icon-root.js +93 -0
- package/dist/icon-button/index.d.ts +1 -0
- package/dist/icon-button/index.js +1 -0
- package/dist/icon-button/root/icon-button-root.d.ts +40 -0
- package/dist/icon-button/root/icon-button-root.js +46 -0
- package/dist/image/index.d.ts +1 -0
- package/dist/image/index.js +1 -0
- package/dist/image/root/image-root.d.ts +213 -0
- package/dist/image/root/image-root.js +335 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.js +99 -0
- package/dist/input/index.d.ts +1 -0
- package/dist/input/index.js +1 -0
- package/dist/input/root/input-root.d.ts +281 -0
- package/dist/input/root/input-root.js +472 -0
- package/dist/kbd/index.d.ts +1 -0
- package/dist/kbd/index.js +1 -0
- package/dist/kbd/root/kbd-root.d.ts +98 -0
- package/dist/kbd/root/kbd-root.js +230 -0
- package/dist/legend/index.d.ts +1 -0
- package/dist/legend/index.js +1 -0
- package/dist/legend/root/legend-root.d.ts +83 -0
- package/dist/legend/root/legend-root.js +125 -0
- package/dist/line-chart/index.d.ts +1 -0
- package/dist/line-chart/index.js +1 -0
- package/dist/line-chart/root/line-chart-root.d.ts +238 -0
- package/dist/line-chart/root/line-chart-root.js +365 -0
- package/dist/list/index.d.ts +2 -0
- package/dist/list/index.js +2 -0
- package/dist/list/item/list-item.d.ts +95 -0
- package/dist/list/item/list-item.js +148 -0
- package/dist/list/root/list-root.d.ts +72 -0
- package/dist/list/root/list-root.js +61 -0
- package/dist/listbox/index.d.ts +1 -0
- package/dist/listbox/index.js +1 -0
- package/dist/listbox/root/listbox-root.d.ts +357 -0
- package/dist/listbox/root/listbox-root.js +890 -0
- package/dist/loader/index.d.ts +1 -0
- package/dist/loader/index.js +1 -0
- package/dist/loader/root/loader-root.d.ts +52 -0
- package/dist/loader/root/loader-root.js +74 -0
- package/dist/megamenu/index.d.ts +1 -0
- package/dist/megamenu/index.js +1 -0
- package/dist/megamenu/root/megamenu-root.d.ts +254 -0
- package/dist/megamenu/root/megamenu-root.js +526 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu/item/menu-item.d.ts +231 -0
- package/dist/menu/item/menu-item.js +405 -0
- package/dist/menu/root/menu-root.d.ts +158 -0
- package/dist/menu/root/menu-root.js +422 -0
- package/dist/meter/index.d.ts +1 -0
- package/dist/meter/index.js +1 -0
- package/dist/meter/root/meter-root.d.ts +234 -0
- package/dist/meter/root/meter-root.js +316 -0
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.js +1 -0
- package/dist/navigation/root/navigation-root.d.ts +55 -0
- package/dist/navigation/root/navigation-root.js +130 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.js +2 -0
- package/dist/notifications/notification/notification.d.ts +181 -0
- package/dist/notifications/notification/notification.js +305 -0
- package/dist/notifications/root/notifications-root.d.ts +168 -0
- package/dist/notifications/root/notifications-root.js +291 -0
- package/dist/number-input/index.d.ts +1 -0
- package/dist/number-input/index.js +1 -0
- package/dist/number-input/root/number-input-root.d.ts +282 -0
- package/dist/number-input/root/number-input-root.js +592 -0
- package/dist/option/group/option-group.d.ts +38 -0
- package/dist/option/group/option-group.js +58 -0
- package/dist/option/index.d.ts +2 -0
- package/dist/option/index.js +2 -0
- package/dist/option/root/option-root.d.ts +194 -0
- package/dist/option/root/option-root.js +247 -0
- package/dist/outline/index.d.ts +1 -0
- package/dist/outline/index.js +1 -0
- package/dist/outline/root/outline-root.d.ts +237 -0
- package/dist/outline/root/outline-root.js +519 -0
- package/dist/pagination/index.d.ts +3 -0
- package/dist/pagination/index.js +3 -0
- package/dist/pagination/root/pagination-root.d.ts +390 -0
- package/dist/pagination/root/pagination-root.js +695 -0
- package/dist/pagination/size/pagination-size.d.ts +127 -0
- package/dist/pagination/size/pagination-size.js +232 -0
- package/dist/pagination/summary/pagination-summary.d.ts +90 -0
- package/dist/pagination/summary/pagination-summary.js +145 -0
- package/dist/pin-input/index.d.ts +1 -0
- package/dist/pin-input/index.js +1 -0
- package/dist/pin-input/root/pin-input-root.d.ts +292 -0
- package/dist/pin-input/root/pin-input-root.js +553 -0
- package/dist/popover/index.d.ts +1 -0
- package/dist/popover/index.js +1 -0
- package/dist/popover/root/popover-root.d.ts +108 -0
- package/dist/popover/root/popover-root.js +231 -0
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/index.js +1 -0
- package/dist/progress/root/progress-root.d.ts +125 -0
- package/dist/progress/root/progress-root.js +212 -0
- package/dist/qr-code/index.d.ts +1 -0
- package/dist/qr-code/index.js +1 -0
- package/dist/qr-code/root/qr-code-root.d.ts +93 -0
- package/dist/qr-code/root/qr-code-root.js +233 -0
- package/dist/quote/index.d.ts +1 -0
- package/dist/quote/index.js +1 -0
- package/dist/quote/root/quote-root.d.ts +36 -0
- package/dist/quote/root/quote-root.js +50 -0
- package/dist/radio/group/radio-group.d.ts +84 -0
- package/dist/radio/group/radio-group.js +170 -0
- package/dist/radio/index.d.ts +2 -0
- package/dist/radio/index.js +2 -0
- package/dist/radio/root/radio-root.d.ts +102 -0
- package/dist/radio/root/radio-root.js +151 -0
- package/dist/rating/index.d.ts +1 -0
- package/dist/rating/index.js +1 -0
- package/dist/rating/root/rating-root.d.ts +242 -0
- package/dist/rating/root/rating-root.js +484 -0
- package/dist/scroll-area/index.d.ts +1 -0
- package/dist/scroll-area/index.js +1 -0
- package/dist/scroll-area/root/scroll-area-root.d.ts +96 -0
- package/dist/scroll-area/root/scroll-area-root.js +215 -0
- package/dist/select/index.d.ts +1 -0
- package/dist/select/index.js +1 -0
- package/dist/select/root/select-root.d.ts +170 -0
- package/dist/select/root/select-root.js +419 -0
- package/dist/skeleton/index.d.ts +1 -0
- package/dist/skeleton/index.js +1 -0
- package/dist/skeleton/root/skeleton-root.d.ts +31 -0
- package/dist/skeleton/root/skeleton-root.js +42 -0
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +1 -0
- package/dist/slider/root/slider-root.d.ts +235 -0
- package/dist/slider/root/slider-root.js +488 -0
- package/dist/sparkline/index.d.ts +1 -0
- package/dist/sparkline/index.js +1 -0
- package/dist/sparkline/root/sparkline-root.d.ts +147 -0
- package/dist/sparkline/root/sparkline-root.js +278 -0
- package/dist/speed-dial/index.d.ts +2 -0
- package/dist/speed-dial/index.js +2 -0
- package/dist/speed-dial/item/speed-dial-item.d.ts +71 -0
- package/dist/speed-dial/item/speed-dial-item.js +113 -0
- package/dist/speed-dial/root/speed-dial-root.d.ts +122 -0
- package/dist/speed-dial/root/speed-dial-root.js +251 -0
- package/dist/splitter/index.d.ts +1 -0
- package/dist/splitter/index.js +1 -0
- package/dist/splitter/root/splitter-root.d.ts +491 -0
- package/dist/splitter/root/splitter-root.js +1030 -0
- package/dist/stat/group/stat-group.d.ts +30 -0
- package/dist/stat/group/stat-group.js +47 -0
- package/dist/stat/index.d.ts +2 -0
- package/dist/stat/index.js +2 -0
- package/dist/stat/root/stat-root.d.ts +62 -0
- package/dist/stat/root/stat-root.js +51 -0
- package/dist/steps/index.d.ts +2 -0
- package/dist/steps/index.js +2 -0
- package/dist/steps/root/steps-root.d.ts +110 -0
- package/dist/steps/root/steps-root.js +130 -0
- package/dist/steps/step/step.d.ts +139 -0
- package/dist/steps/step/step.js +215 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +1 -0
- package/dist/switch/root/switch-root.d.ts +74 -0
- package/dist/switch/root/switch-root.js +153 -0
- package/dist/table/cell/table-cell.d.ts +34 -0
- package/dist/table/cell/table-cell.js +52 -0
- package/dist/table/column/table-column.d.ts +165 -0
- package/dist/table/column/table-column.js +222 -0
- package/dist/table/index.d.ts +4 -0
- package/dist/table/index.js +4 -0
- package/dist/table/root/table-root.d.ts +98 -0
- package/dist/table/root/table-root.js +161 -0
- package/dist/table/row/table-row.d.ts +27 -0
- package/dist/table/row/table-row.js +42 -0
- package/dist/tabs/index.d.ts +3 -0
- package/dist/tabs/index.js +3 -0
- package/dist/tabs/panel/tab-panel.d.ts +67 -0
- package/dist/tabs/panel/tab-panel.js +98 -0
- package/dist/tabs/root/tabs-root.d.ts +123 -0
- package/dist/tabs/root/tabs-root.js +217 -0
- package/dist/tabs/tab/tab.d.ts +64 -0
- package/dist/tabs/tab/tab.js +116 -0
- package/dist/tag/index.d.ts +1 -0
- package/dist/tag/index.js +1 -0
- package/dist/tag/root/tag-root.d.ts +41 -0
- package/dist/tag/root/tag-root.js +67 -0
- package/dist/textarea/index.d.ts +1 -0
- package/dist/textarea/index.js +1 -0
- package/dist/textarea/root/textarea-root.d.ts +215 -0
- package/dist/textarea/root/textarea-root.js +380 -0
- package/dist/time-input/index.d.ts +1 -0
- package/dist/time-input/index.js +1 -0
- package/dist/time-input/root/time-input-root.d.ts +322 -0
- package/dist/time-input/root/time-input-root.js +661 -0
- package/dist/time-picker/index.d.ts +1 -0
- package/dist/time-picker/index.js +1 -0
- package/dist/time-picker/root/time-picker-root.d.ts +380 -0
- package/dist/time-picker/root/time-picker-root.js +669 -0
- package/dist/timeline/index.d.ts +2 -0
- package/dist/timeline/index.js +2 -0
- package/dist/timeline/item/timeline-item.d.ts +81 -0
- package/dist/timeline/item/timeline-item.js +128 -0
- package/dist/timeline/root/timeline-root.d.ts +52 -0
- package/dist/timeline/root/timeline-root.js +72 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/index.js +2 -0
- package/dist/toast/item/toast-item.d.ts +183 -0
- package/dist/toast/item/toast-item.js +345 -0
- package/dist/toast/root/toast-root.d.ts +72 -0
- package/dist/toast/root/toast-root.js +87 -0
- package/dist/toggle/group/toggle-group.d.ts +140 -0
- package/dist/toggle/group/toggle-group.js +278 -0
- package/dist/toggle/index.d.ts +2 -0
- package/dist/toggle/index.js +2 -0
- package/dist/toggle/root/toggle-root.d.ts +99 -0
- package/dist/toggle/root/toggle-root.js +146 -0
- package/dist/toolbar/index.d.ts +1 -0
- package/dist/toolbar/index.js +1 -0
- package/dist/toolbar/root/toolbar-root.d.ts +105 -0
- package/dist/toolbar/root/toolbar-root.js +260 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/tooltip/root/tooltip-root.d.ts +388 -0
- package/dist/tooltip/root/tooltip-root.js +707 -0
- package/dist/tour/index.d.ts +2 -0
- package/dist/tour/index.js +2 -0
- package/dist/tour/root/tour-root.d.ts +161 -0
- package/dist/tour/root/tour-root.js +351 -0
- package/dist/tour/stop/tour-stop.d.ts +131 -0
- package/dist/tour/stop/tour-stop.js +249 -0
- package/dist/tree/index.d.ts +2 -0
- package/dist/tree/index.js +2 -0
- package/dist/tree/item/tree-item.d.ts +208 -0
- package/dist/tree/item/tree-item.js +381 -0
- package/dist/tree/root/tree-root.d.ts +88 -0
- package/dist/tree/root/tree-root.js +287 -0
- package/dist/trend/index.d.ts +1 -0
- package/dist/trend/index.js +1 -0
- package/dist/trend/root/trend-root.d.ts +67 -0
- package/dist/trend/root/trend-root.js +106 -0
- package/dist/video/index.d.ts +1 -0
- package/dist/video/index.js +1 -0
- package/dist/video/root/video-root.d.ts +711 -0
- package/dist/video/root/video-root.js +1821 -0
- package/dist/video-playlist/index.d.ts +3 -0
- package/dist/video-playlist/index.js +3 -0
- package/dist/video-playlist/item/video-playlist-item.d.ts +101 -0
- package/dist/video-playlist/item/video-playlist-item.js +162 -0
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +121 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +237 -0
- package/dist/video-playlist/root/video-playlist-root.d.ts +108 -0
- package/dist/video-playlist/root/video-playlist-root.js +218 -0
- package/dist/virtual-list/index.d.ts +1 -0
- package/dist/virtual-list/index.js +1 -0
- package/dist/virtual-list/root/virtual-list-root.d.ts +121 -0
- package/dist/virtual-list/root/virtual-list-root.js +221 -0
- package/jsx.d.ts +49767 -0
- package/package.json +77 -0
- package/svelte.d.ts +129 -0
- package/vue.d.ts +9242 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, HelixElement, HelixSendEvent, hostAria, relativeTime, slotFilled, TONE_MARKS, } from '@fusion.dev/helix-core';
|
|
8
|
+
import { html, nothing } from 'lit';
|
|
9
|
+
import { property, state } from 'lit/decorators.js';
|
|
10
|
+
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
11
|
+
/**
|
|
12
|
+
* @summary One turn in a conversation, and what has happened to it.
|
|
13
|
+
*
|
|
14
|
+
* @description
|
|
15
|
+
* **The states are the component.** Bubbles are paint; what a chat message has
|
|
16
|
+
* to carry is whether it is on its way, arrived, still arriving, or failed, and
|
|
17
|
+
* a failed message needs a retry that is a real action rather than a toast the
|
|
18
|
+
* reader has to catch.
|
|
19
|
+
*
|
|
20
|
+
* `streaming` is the state everything else is arranged around. A message
|
|
21
|
+
* arriving token by token changes height on every frame, so it is marked
|
|
22
|
+
* `aria-busy` while it arrives and announced once when it settles: a screen
|
|
23
|
+
* reader reading a stream character by character is unusable, and announcing on
|
|
24
|
+
* completion is the only version of this that works.
|
|
25
|
+
*
|
|
26
|
+
* @since 0.1.0
|
|
27
|
+
* @status experimental
|
|
28
|
+
* @category feedback
|
|
29
|
+
* @aliases Message, Bubble, Turn
|
|
30
|
+
* @documentation https://helix.fusion.dev/components/chat
|
|
31
|
+
*
|
|
32
|
+
* @slot - What was said.
|
|
33
|
+
* @slot actions - What can be done with it: copy, retry, react.
|
|
34
|
+
* @slot avatar - Who said it.
|
|
35
|
+
* @slot sources - What it was said from: citations, documents, a retrieved page.
|
|
36
|
+
*
|
|
37
|
+
* @event {HelixSendEvent} helix-send - Fired when the reader asks to send a failed message again, and cancelable.
|
|
38
|
+
*
|
|
39
|
+
* @csspart actions - The controls offered on the turn, beside its time.
|
|
40
|
+
* @csspart avatar - The leading slot's box.
|
|
41
|
+
* @csspart body - What was said, and the line under it.
|
|
42
|
+
* @csspart content - The consumer's own markup.
|
|
43
|
+
* @csspart mark - The status glyph beside a failure.
|
|
44
|
+
* @csspart message - The whole turn.
|
|
45
|
+
* @csspart meta - The line under a turn: its time, its state, and its controls.
|
|
46
|
+
* @csspart retry - The control offered on a failed message.
|
|
47
|
+
* @csspart sources - What the turn was drawn from, under it and outside the bubble.
|
|
48
|
+
* @csspart state - What has happened to it, where that is worth saying.
|
|
49
|
+
* @csspart time - When it was said.
|
|
50
|
+
*/
|
|
51
|
+
let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixElement {
|
|
52
|
+
constructor() {
|
|
53
|
+
super(...arguments);
|
|
54
|
+
/**
|
|
55
|
+
* When it was said, as anything `Date` parses.
|
|
56
|
+
*/
|
|
57
|
+
this.at = '';
|
|
58
|
+
/**
|
|
59
|
+
* Locale for the timestamp.
|
|
60
|
+
*
|
|
61
|
+
* Empty is the runtime's own.
|
|
62
|
+
*/
|
|
63
|
+
this.locale = '';
|
|
64
|
+
/**
|
|
65
|
+
* What to call each state, for a reader who cannot see it.
|
|
66
|
+
*/
|
|
67
|
+
this.sendingLabel = 'Sending';
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
this.failedLabel = 'Not sent';
|
|
72
|
+
/**
|
|
73
|
+
* Label for the control offered on a failed message.
|
|
74
|
+
*/
|
|
75
|
+
this.retryLabel = 'Try again';
|
|
76
|
+
/**
|
|
77
|
+
* @internal Read by the transcript to identify its children across the light
|
|
78
|
+
* DOM, which is cheaper than `instanceof`. Not a consumer's to read or set.
|
|
79
|
+
*/
|
|
80
|
+
this.isChatMessage = true;
|
|
81
|
+
this.clock = undefined;
|
|
82
|
+
/**
|
|
83
|
+
* A turn's own content arrives and changes no property here.
|
|
84
|
+
*
|
|
85
|
+
* It is the streaming case that needs this rather than a tidiness one: the
|
|
86
|
+
* first token of an answer is a light-DOM child appearing under an element
|
|
87
|
+
* nothing else told to look again, and it is exactly the moment the typing
|
|
88
|
+
* indicator has to stop being drawn.
|
|
89
|
+
*/
|
|
90
|
+
this.handleFill = () => {
|
|
91
|
+
this.markEmpty();
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Retry is `helix-send` again, from the message rather than the composer.
|
|
95
|
+
*
|
|
96
|
+
* **Not an event of its own**, because a retry is the same request: the reader
|
|
97
|
+
* is offering what they wrote, and the only difference is which element is
|
|
98
|
+
* offering it. A listener that wants to tell them apart has `event.target`,
|
|
99
|
+
* which is the message on a retry and the composer on a first send, and that
|
|
100
|
+
* is a distinction the DOM already makes without a second name for it.
|
|
101
|
+
*/
|
|
102
|
+
this.handleRetry = (event) => {
|
|
103
|
+
event.stopPropagation();
|
|
104
|
+
this.dispatchEvent(new HelixSendEvent({ value: this.textContent?.trim() ?? '' }));
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** The timestamp, or nothing where there is not one to read. */
|
|
108
|
+
get moment() {
|
|
109
|
+
if (this.at === '') {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
const parsed = new Date(this.at);
|
|
113
|
+
return Number.isNaN(parsed.getTime()) ? undefined : parsed;
|
|
114
|
+
}
|
|
115
|
+
willUpdate(changed) {
|
|
116
|
+
super.willUpdate(changed);
|
|
117
|
+
if (changed.has('at')) {
|
|
118
|
+
this.clock = Date.now();
|
|
119
|
+
}
|
|
120
|
+
/* `article` rather than `listitem`, because the transcript is a `log` and a
|
|
121
|
+
log's children are not list items: a turn is a self-contained thing a
|
|
122
|
+
reader can be moved to, which is what an article is for.
|
|
123
|
+
|
|
124
|
+
`aria-busy` while it arrives is the whole of the streaming contract on
|
|
125
|
+
this side: the live region above it holds its announcement until the flag
|
|
126
|
+
clears, so the message is read once, whole, rather than per token. */
|
|
127
|
+
hostAria(this.internals, { role: 'article' });
|
|
128
|
+
this.toggleAttribute('aria-busy', this.state === 'streaming');
|
|
129
|
+
}
|
|
130
|
+
renderTime() {
|
|
131
|
+
const moment = this.moment;
|
|
132
|
+
if (!moment) {
|
|
133
|
+
return nothing;
|
|
134
|
+
}
|
|
135
|
+
const { text } = relativeTime(this.locale)(moment, new Date(this.clock ?? Date.now()));
|
|
136
|
+
return html `<time part="time" datetime=${moment.toISOString()}>${text}</time>`;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The status glyph, behind a seam so a tier can draw its own.
|
|
140
|
+
*
|
|
141
|
+
* `TONE_MARKS.danger` rather than a glyph chosen here: the library has one
|
|
142
|
+
* status vocabulary, `Callout`, `Toast.Item` and `Announcement` all read from
|
|
143
|
+
* it, and a reader meets these four marks in a passage, in a message and now
|
|
144
|
+
* on a turn and has to read them as the same four things. It carries the
|
|
145
|
+
* accessible name with it, which is the half that matters: `danger` is the
|
|
146
|
+
* word the API uses and "Error" is the word a reader understands.
|
|
147
|
+
*/
|
|
148
|
+
renderMark() {
|
|
149
|
+
const { icon, label } = TONE_MARKS.danger;
|
|
150
|
+
return html `<svg
|
|
151
|
+
part="mark"
|
|
152
|
+
fill="currentColor"
|
|
153
|
+
viewBox=${icon.viewBox}
|
|
154
|
+
role="img"
|
|
155
|
+
aria-label=${label}
|
|
156
|
+
>
|
|
157
|
+
${unsafeSVG(icon.content)}
|
|
158
|
+
</svg>`;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* What has happened to it, in words, and the way back from a failure.
|
|
162
|
+
*
|
|
163
|
+
* A seam of its own, because the styled tier draws a failure as an icon and a
|
|
164
|
+
* consumer may want neither. `sent` says nothing: every settled message is
|
|
165
|
+
* sent, and a transcript that labels each one is a transcript of the word
|
|
166
|
+
* "sent".
|
|
167
|
+
*/
|
|
168
|
+
renderState() {
|
|
169
|
+
if (this.state === 'sending') {
|
|
170
|
+
return html `<span part="state">${this.sendingLabel}</span>`;
|
|
171
|
+
}
|
|
172
|
+
if (this.state !== 'failed') {
|
|
173
|
+
return nothing;
|
|
174
|
+
}
|
|
175
|
+
/* **The mark, and not because color needs a second carrier here.** "Not
|
|
176
|
+
sent" is words, so the meaning survives without it. It is here because a
|
|
177
|
+
failure is the one state that has to be *found* rather than noticed, and a
|
|
178
|
+
shape is what a reader scanning a transcript finds. */
|
|
179
|
+
return html `<span part="state"
|
|
180
|
+
>${this.renderMark()} ${this.failedLabel}
|
|
181
|
+
<button part="retry" type="button" @click=${this.handleRetry}>${this.retryLabel}</button>
|
|
182
|
+
</span>`;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Says on each region whether anything is in it.
|
|
186
|
+
*
|
|
187
|
+
* Three of them need the answer and no selector can give it: a slot's assigned
|
|
188
|
+
* nodes are not its DOM children, so `:empty` and `:has(*)` both describe the
|
|
189
|
+
* fallback rather than the fill. `sources` and `actions` are regions that cost
|
|
190
|
+
* a gap when they are boxes at all, which most turns should not pay. `content`
|
|
191
|
+
* is the one that is not about space: a turn that is `streaming` with nothing
|
|
192
|
+
* in it yet is what the typing indicator is drawn for, and "nothing in it yet"
|
|
193
|
+
* is exactly this question.
|
|
194
|
+
*/
|
|
195
|
+
markEmpty() {
|
|
196
|
+
for (const name of ['content', 'sources', 'actions']) {
|
|
197
|
+
const region = this.renderRoot?.querySelector(`[part="${name}"]`);
|
|
198
|
+
const slot = name === 'content'
|
|
199
|
+
? this.renderRoot?.querySelector('slot:not([name])')
|
|
200
|
+
: this.renderRoot?.querySelector(`slot[name="${name}"]`);
|
|
201
|
+
const empty = !slotFilled(slot);
|
|
202
|
+
region?.toggleAttribute('data-empty', empty);
|
|
203
|
+
/* `content` keeps its box when empty, because the typing indicator is
|
|
204
|
+
painted into it. The other two are gaps nobody asked for. */
|
|
205
|
+
if (name !== 'content') {
|
|
206
|
+
region?.toggleAttribute('hidden', empty);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
updated(changed) {
|
|
211
|
+
super.updated(changed);
|
|
212
|
+
this.markEmpty();
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* The turn: who said it, what was said, what it was drawn from, and its line.
|
|
216
|
+
*
|
|
217
|
+
* **`sources` and `actions` are inside the body rather than beside it**, and
|
|
218
|
+
* the second of those moved twice. `actions` was a third grid column, so a
|
|
219
|
+
* copy control on a fifteen-word turn sat at the container's trailing edge
|
|
220
|
+
* with a hundred and fifty pixels of nothing between it and the bubble it
|
|
221
|
+
* acted on, on both sides of the conversation. Moved into the body as a
|
|
222
|
+
* column of its own it was no better: a bubble spanning two auto tracks
|
|
223
|
+
* inflates both, so the controls landed under the middle of the turn.
|
|
224
|
+
*
|
|
225
|
+
* So they are inside `meta`, which is the line under a turn rather than only
|
|
226
|
+
* its timestamp, and that line is one flex row: time, state, controls, all
|
|
227
|
+
* hugging whichever edge the turn is against. Nothing has to be sized against
|
|
228
|
+
* anything else for that to hold at every width.
|
|
229
|
+
*/
|
|
230
|
+
render() {
|
|
231
|
+
return html `<div part="message">
|
|
232
|
+
<span part="avatar"><slot name="avatar"></slot></span>
|
|
233
|
+
<div part="body">
|
|
234
|
+
<div part="content"><slot @slotchange=${this.handleFill}></slot></div>
|
|
235
|
+
<div part="sources"><slot name="sources" @slotchange=${this.handleFill}></slot></div>
|
|
236
|
+
<span part="meta"
|
|
237
|
+
>${this.renderTime()} ${this.renderState()}
|
|
238
|
+
<span part="actions"><slot name="actions" @slotchange=${this.handleFill}></slot></span>
|
|
239
|
+
</span>
|
|
240
|
+
</div>
|
|
241
|
+
</div>`;
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
__decorate([
|
|
245
|
+
property({ reflect: true })
|
|
246
|
+
], HelixHeadlessChatMessage.prototype, "author", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
property({ reflect: true })
|
|
249
|
+
], HelixHeadlessChatMessage.prototype, "state", void 0);
|
|
250
|
+
__decorate([
|
|
251
|
+
property()
|
|
252
|
+
], HelixHeadlessChatMessage.prototype, "at", void 0);
|
|
253
|
+
__decorate([
|
|
254
|
+
property()
|
|
255
|
+
], HelixHeadlessChatMessage.prototype, "locale", void 0);
|
|
256
|
+
__decorate([
|
|
257
|
+
property({ attribute: 'sending-label' })
|
|
258
|
+
], HelixHeadlessChatMessage.prototype, "sendingLabel", void 0);
|
|
259
|
+
__decorate([
|
|
260
|
+
property({ attribute: 'failed-label' })
|
|
261
|
+
], HelixHeadlessChatMessage.prototype, "failedLabel", void 0);
|
|
262
|
+
__decorate([
|
|
263
|
+
property({ attribute: 'retry-label' })
|
|
264
|
+
], HelixHeadlessChatMessage.prototype, "retryLabel", void 0);
|
|
265
|
+
__decorate([
|
|
266
|
+
state()
|
|
267
|
+
], HelixHeadlessChatMessage.prototype, "clock", void 0);
|
|
268
|
+
HelixHeadlessChatMessage = __decorate([
|
|
269
|
+
customElement('helix-headless-chat-message')
|
|
270
|
+
], HelixHeadlessChatMessage);
|
|
271
|
+
export { HelixHeadlessChatMessage };
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
import type { HelixHeadlessChatMessage } from '../message/chat-message.js';
|
|
4
|
+
declare const HelixHeadlessChat_base: (new (...args: any[]) => import("@fusion.dev/helix-core").CollectionElement) & typeof HelixElement;
|
|
5
|
+
/**
|
|
6
|
+
* @summary A conversation: the turns, and where the reader is in them.
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* **It has no opinion about where it sits.** A chat is asked for as a floating
|
|
10
|
+
* button, a page, a palette, a sidebar, a modal and an inline block, and none of
|
|
11
|
+
* those is a variant of a conversation: they are containers a conversation is
|
|
12
|
+
* put in, and the containers already exist. `Popover` and `SpeedDial` make the
|
|
13
|
+
* floating one, `Drawer` the sidebar, `Dialog` the modal, `Command` the palette,
|
|
14
|
+
* and a page is a page. Nothing here is positioned, nothing here has a backdrop,
|
|
15
|
+
* and nothing here owns a trigger, because a trigger opens a container and
|
|
16
|
+
* containers own their own. If a form factor needs a mode on this element, the
|
|
17
|
+
* split is wrong.
|
|
18
|
+
*
|
|
19
|
+
* **Scroll ownership is the behavior everything else depends on, and it is the
|
|
20
|
+
* most-got-wrong thing in the category.** A transcript that grows wants to stay
|
|
21
|
+
* at the bottom, except when the reader has scrolled up to read, where pinning
|
|
22
|
+
* is hostile. The rule: pin while the reader is within `threshold` of the
|
|
23
|
+
* bottom, release the moment they leave it, and offer a way back. **Never scroll
|
|
24
|
+
* a reader who is reading.**
|
|
25
|
+
*
|
|
26
|
+
* The element owns it, because it is the only party that knows a message arrived
|
|
27
|
+
* and where the viewport was when it did. `pinned` is a controlled property like
|
|
28
|
+
* any other, so a consumer who wants to own it can.
|
|
29
|
+
*
|
|
30
|
+
* **The live region announces on completion, not on arrival.** The transcript is
|
|
31
|
+
* `role="log"` with `aria-live="polite"`, and a streaming message carries
|
|
32
|
+
* `aria-busy` while it arrives: a screen reader reading a stream token by token
|
|
33
|
+
* is unusable, and holding the announcement until the flag clears is the only
|
|
34
|
+
* arrangement that works. Somebody typing is a separate status region, so it
|
|
35
|
+
* never interleaves with what was said.
|
|
36
|
+
*
|
|
37
|
+
* **Not a client.** No transport, no protocol, no model. It renders a
|
|
38
|
+
* conversation and reports what the reader did.
|
|
39
|
+
*
|
|
40
|
+
* @since 0.1.0
|
|
41
|
+
* @status experimental
|
|
42
|
+
* @category feedback
|
|
43
|
+
* @aliases Conversation, Transcript, Thread, Messages
|
|
44
|
+
* @documentation https://helix.fusion.dev/components/chat
|
|
45
|
+
*
|
|
46
|
+
* @slot - The turns, as `helix-chat-message` children.
|
|
47
|
+
* @slot actions - Beside the header: what can be done to the conversation itself.
|
|
48
|
+
* @slot composer - Below the transcript, where the reader writes.
|
|
49
|
+
* @slot header - Above the transcript: what this conversation is.
|
|
50
|
+
* @slot resume - The way back to the bottom, shown while the reader has scrolled away.
|
|
51
|
+
* @slot status - Beside the composer: somebody typing, connection lost.
|
|
52
|
+
*
|
|
53
|
+
* @event {HelixBeforePinEvent} helix-before-pin - Fired when the reader pins or unpins the transcript by scrolling. Cancelable.
|
|
54
|
+
*
|
|
55
|
+
* @csspart actions - The controls for the conversation, at the header's trailing edge.
|
|
56
|
+
* @csspart composer - The region the composer sits in.
|
|
57
|
+
* @csspart empty - Shown when the conversation has no turns.
|
|
58
|
+
* @csspart header - The region above the transcript.
|
|
59
|
+
* @csspart loading - Shown while the history is still on its way.
|
|
60
|
+
* @csspart log - The transcript, which is the thing that scrolls.
|
|
61
|
+
* @csspart resume - The affordance offered while the reader is away from the bottom.
|
|
62
|
+
* @csspart status - The status region, which is not part of the log.
|
|
63
|
+
*/
|
|
64
|
+
export declare class HelixHeadlessChat extends HelixHeadlessChat_base {
|
|
65
|
+
/**
|
|
66
|
+
* Nothing is assigned by name, so the turns land in the log and the rest does not.
|
|
67
|
+
*
|
|
68
|
+
* The messages are ordinary children a consumer writes with no `slot`, and a
|
|
69
|
+
* `role="log"` whose turns are somewhere else is a log of nothing. Manual
|
|
70
|
+
* assignment is the only way to wrap them without editing the consumer's
|
|
71
|
+
* markup, which is a change a React consumer's hydration reports and does not
|
|
72
|
+
* patch up.
|
|
73
|
+
*/
|
|
74
|
+
static shadowRootOptions: ShadowRootInit;
|
|
75
|
+
/**
|
|
76
|
+
* Accessible name for the conversation.
|
|
77
|
+
*/
|
|
78
|
+
label: string;
|
|
79
|
+
/**
|
|
80
|
+
* How near the bottom still counts as being at it, in pixels.
|
|
81
|
+
*
|
|
82
|
+
* A hook rather than a constant, because the right number depends on how tall
|
|
83
|
+
* a turn is: a transcript of one-line replies wants a smaller threshold than
|
|
84
|
+
* one of paragraphs, and a reader who has scrolled up by half a message has
|
|
85
|
+
* not left.
|
|
86
|
+
*/
|
|
87
|
+
threshold: number;
|
|
88
|
+
/**
|
|
89
|
+
* Whether the transcript follows new turns to the bottom.
|
|
90
|
+
*
|
|
91
|
+
* Set it and this element defers: the reader's scrolling fires `helix-change`
|
|
92
|
+
* and moves nothing until a new value arrives. `default-pinned` seeds a state
|
|
93
|
+
* this element then owns, and it defaults to pinned because a conversation
|
|
94
|
+
* opens at its most recent turn.
|
|
95
|
+
*
|
|
96
|
+
* **Not reflected, and the default is why.** A reflected property that
|
|
97
|
+
* defaults to true writes its attribute on upgrade whether or not the
|
|
98
|
+
* consumer wrote one, so the server serves `<helix-chat label="x">` and the
|
|
99
|
+
* client turns it into `<helix-chat label="x" pinned>`: a hydration mismatch a
|
|
100
|
+
* React consumer reports and does not patch up. Nothing needs the attribute
|
|
101
|
+
* either, because the one thing that changes with the pin is the way back, and
|
|
102
|
+
* that is a part inside the shadow tree where a stylesheet can already reach
|
|
103
|
+
* it. Measured rather than assumed: `label, pinned` after upgrade against
|
|
104
|
+
* `label` from the server.
|
|
105
|
+
*
|
|
106
|
+
*
|
|
107
|
+
*/
|
|
108
|
+
get pinned(): boolean;
|
|
109
|
+
set pinned(next: boolean);
|
|
110
|
+
/**
|
|
111
|
+
* Whether to open pinned, where nothing declared it.
|
|
112
|
+
*/
|
|
113
|
+
defaultPinned: boolean;
|
|
114
|
+
private pinnedState;
|
|
115
|
+
/** Watches for turns arriving, since a manual slot hears nothing about them. */
|
|
116
|
+
private watcher;
|
|
117
|
+
/**
|
|
118
|
+
* Which regions were given something, or undefined where nobody has counted.
|
|
119
|
+
*
|
|
120
|
+
* **A slot that is assigned by hand has no children, so no stylesheet can ask
|
|
121
|
+
* whether it was filled.** `[part="header"]:not(:has(> slot:has(*)))` is the
|
|
122
|
+
* rule every other collection here hides an empty region with, and `:has()`
|
|
123
|
+
* walks the DOM tree: with `slotAssignment: 'manual'` the assigned elements
|
|
124
|
+
* are children of this host and never of the slot, so the test was false for
|
|
125
|
+
* a filled header exactly as often as for an empty one and the rule never
|
|
126
|
+
* matched. Measured on a chat with nothing slotted at all: the header was 25
|
|
127
|
+
* pixels tall and drew its hairline under nothing, and so did the composer.
|
|
128
|
+
*
|
|
129
|
+
* Undefined rather than empty on the way in, for `MixinCollection`'s reason:
|
|
130
|
+
* the server has no children to count, and an unknown answer is not "empty".
|
|
131
|
+
* It serves every region and the first assignment on the client settles them,
|
|
132
|
+
* which is a shadow-root attribute rather than a host one and so is nothing a
|
|
133
|
+
* consumer's hydration compares.
|
|
134
|
+
*/
|
|
135
|
+
private filled;
|
|
136
|
+
/** Whether a region has something in it, taking unknown for yes. */
|
|
137
|
+
private has;
|
|
138
|
+
/** The turns declared as children, in the order they are written. */
|
|
139
|
+
get messages(): HelixHeadlessChatMessage[];
|
|
140
|
+
/** The element that scrolls, once there is one. */
|
|
141
|
+
private get log();
|
|
142
|
+
/** Whether the reader is within `threshold` of the bottom right now. */
|
|
143
|
+
private get atBottom();
|
|
144
|
+
/**
|
|
145
|
+
* Puts the transcript back at its most recent turn.
|
|
146
|
+
*
|
|
147
|
+
* Public because the way back is a slot, so the control offering it is the
|
|
148
|
+
* consumer's and needs something to call. Pins again on the way, which is what
|
|
149
|
+
* a reader asking to go to the bottom means.
|
|
150
|
+
*/
|
|
151
|
+
resume(): void;
|
|
152
|
+
/**
|
|
153
|
+
* Asks to pin or unpin, and reports whether the request stood.
|
|
154
|
+
*
|
|
155
|
+
* Announced before it is applied, so a consumer owning the pin hears the
|
|
156
|
+
* reader's scroll and decides. `property` names it, which is what
|
|
157
|
+
* `helix-before-pin`'s detail is for: a listener switching on the name is
|
|
158
|
+
* switching on something with one meaning.
|
|
159
|
+
*/
|
|
160
|
+
private requestPinned;
|
|
161
|
+
private assign;
|
|
162
|
+
/**
|
|
163
|
+
* A press anywhere in the way back takes the reader back.
|
|
164
|
+
*
|
|
165
|
+
* **The affordance was inert, in the component and in every example.** The
|
|
166
|
+
* control is slotted so the consumer picks the words, and `resume()` was
|
|
167
|
+
* public "because the control offering it is the consumer's and needs
|
|
168
|
+
* something to call". True, and it left a button this element positions, lifts
|
|
169
|
+
* and shows and hides doing nothing at all until somebody wired it, which none
|
|
170
|
+
* of the five examples did: the one control whose whole job is to undo a
|
|
171
|
+
* scroll shipped as decoration.
|
|
172
|
+
*
|
|
173
|
+
* The region exists for exactly one purpose, so a press inside it has exactly
|
|
174
|
+
* one meaning and this element is entitled to act on it. `resume()` stays
|
|
175
|
+
* public for the other callers it was always for: a keyboard shortcut, or a
|
|
176
|
+
* consumer's own control somewhere else on the page.
|
|
177
|
+
*/
|
|
178
|
+
private readonly handleResume;
|
|
179
|
+
connectedCallback(): void;
|
|
180
|
+
disconnectedCallback(): void;
|
|
181
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
182
|
+
protected updated(changed: PropertyValues): void;
|
|
183
|
+
private readonly handleSlotChange;
|
|
184
|
+
/**
|
|
185
|
+
* The reader's own scrolling, which is the only thing that unpins.
|
|
186
|
+
*
|
|
187
|
+
* **Bound to the transcript in the template, and it has to be.** This was a
|
|
188
|
+
* capture listener on the host, on the reasoning that `scroll` does not bubble
|
|
189
|
+
* so the capture phase is the only phase that reaches it. Not bubbling is not
|
|
190
|
+
* the problem: `scroll` is not *composed*, and a non-composed event's
|
|
191
|
+
* propagation path stops at the shadow root and never includes the host, in
|
|
192
|
+
* any phase. So the listener never ran once, the pin never released, and a
|
|
193
|
+
* reader who scrolled up to re-read was pulled back to the bottom by the next
|
|
194
|
+
* turn to arrive, which this element's own description calls the most
|
|
195
|
+
* got-wrong thing in the category.
|
|
196
|
+
*
|
|
197
|
+
* Measured by dispatching both shapes at the transcript: with
|
|
198
|
+
* `composed: false`, which is what the platform sends, the host saw zero and
|
|
199
|
+
* `pinned` stayed true; with `composed: true` the host saw one and `pinned`
|
|
200
|
+
* went false. Bound here, the phase and the bubbling never come up.
|
|
201
|
+
*
|
|
202
|
+
* **The scroll this element does itself must not unpin it**, which is the
|
|
203
|
+
* subtle half: `scrollTop = scrollHeight` fires the same event a reader's
|
|
204
|
+
* wheel does. Reading the position rather than counting events is what makes
|
|
205
|
+
* that harmless, since after a programmatic scroll the position is the bottom
|
|
206
|
+
* and the answer is the one that was already true.
|
|
207
|
+
*/
|
|
208
|
+
private readonly handleScroll;
|
|
209
|
+
protected render(): TemplateResult;
|
|
210
|
+
}
|
|
211
|
+
declare global {
|
|
212
|
+
interface HTMLElementTagNameMap {
|
|
213
|
+
'helix-headless-chat': HelixHeadlessChat;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
export {};
|