@fusion.dev/helix-headless 0.147.0 → 0.149.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +11222 -2332
- package/dist/accordion/item/accordion-item.d.ts +5 -2
- package/dist/accordion/item/accordion-item.js +11 -7
- package/dist/accordion/root/accordion-root.js +4 -6
- package/dist/announcement/root/announcement-root.d.ts +61 -5
- package/dist/announcement/root/announcement-root.js +126 -20
- package/dist/area-chart/root/area-chart-root.d.ts +11 -0
- package/dist/area-chart/root/area-chart-root.js +21 -9
- package/dist/avatar/group/avatar-group.d.ts +10 -2
- package/dist/avatar/group/avatar-group.js +10 -5
- package/dist/badge/count.d.ts +19 -0
- package/dist/badge/count.js +20 -0
- package/dist/badge/root/badge-root.d.ts +6 -2
- package/dist/badge/root/badge-root.js +8 -22
- package/dist/bar-chart/root/bar-chart-root.d.ts +13 -1
- package/dist/bar-chart/root/bar-chart-root.js +17 -4
- package/dist/blockquote/root/blockquote-root.d.ts +66 -8
- package/dist/blockquote/root/blockquote-root.js +85 -8
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +2 -2
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +8 -1
- package/dist/breadcrumbs/root/breadcrumbs-root.js +5 -2
- package/dist/button/root/button-root.d.ts +10 -1
- package/dist/button/root/button-root.js +3 -2
- package/dist/button-group/arrows.d.ts +14 -0
- package/dist/button-group/arrows.js +10 -0
- package/dist/button-group/root/button-group-root.d.ts +144 -3
- package/dist/button-group/root/button-group-root.js +142 -2
- package/dist/callout/root/callout-root.d.ts +16 -2
- package/dist/callout/root/callout-root.js +16 -4
- package/dist/canvas/describe.d.ts +10 -0
- package/dist/canvas/describe.js +9 -0
- package/dist/canvas/edge-pan.d.ts +61 -0
- package/dist/canvas/edge-pan.js +63 -0
- package/dist/canvas/neighbor.d.ts +17 -0
- package/dist/canvas/neighbor.js +1 -0
- package/dist/canvas/node/canvas-node.d.ts +12 -2
- package/dist/canvas/node/canvas-node.js +8 -3
- package/dist/canvas/root/canvas-document.d.ts +10 -0
- package/dist/canvas/root/canvas-document.js +1 -0
- package/dist/canvas/root/canvas-root.d.ts +168 -9
- package/dist/canvas/root/canvas-root.js +239 -69
- package/dist/canvas/snap.d.ts +42 -0
- package/dist/canvas/snap.js +32 -0
- package/dist/carousel/root/carousel-root.d.ts +9 -3
- package/dist/carousel/root/carousel-root.js +17 -10
- package/dist/chat/composer/chat-composer.d.ts +5 -0
- package/dist/chat/composer/chat-composer.js +4 -1
- package/dist/chat/message/chat-message.d.ts +9 -5
- package/dist/chat/message/chat-message.js +8 -4
- package/dist/chat/naming.js +2 -2
- package/dist/chat/root/chat-root.d.ts +40 -4
- package/dist/chat/root/chat-root.js +38 -14
- package/dist/checkbox/root/checkbox-root.d.ts +11 -0
- package/dist/checkbox/root/checkbox-root.js +8 -2
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +24 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +28 -12
- package/dist/checkbox-group/select-all.d.ts +11 -0
- package/dist/checkbox-group/select-all.js +5 -0
- package/dist/code-block/root/code-block-root.d.ts +20 -8
- package/dist/code-block/root/code-block-root.js +16 -5
- package/dist/color-input/root/color-input-root.d.ts +13 -0
- package/dist/color-input/root/color-input-root.js +18 -5
- package/dist/color-picker/root/color-picker-root.d.ts +19 -3
- package/dist/color-picker/root/color-picker-root.js +52 -24
- package/dist/color-picker/wheel.d.ts +11 -0
- package/dist/color-picker/wheel.js +9 -0
- package/dist/combobox/root/combobox-root.d.ts +106 -18
- package/dist/combobox/root/combobox-root.js +101 -26
- package/dist/command/root/command-root.d.ts +19 -9
- package/dist/command/root/command-root.js +9 -4
- package/dist/copy-button/root/copy-button-root.d.ts +5 -0
- package/dist/copy-button/root/copy-button-root.js +7 -2
- package/dist/data-table/root/data-table-root.d.ts +171 -29
- package/dist/data-table/root/data-table-root.js +284 -161
- package/dist/date-input/root/date-input-root.d.ts +32 -9
- package/dist/date-input/root/date-input-root.js +66 -44
- package/dist/date-picker/root/date-picker-root.d.ts +38 -15
- package/dist/date-picker/root/date-picker-root.js +52 -33
- package/dist/description-list/item/description-list-item.d.ts +4 -0
- package/dist/description-list/item/description-list-item.js +7 -1
- package/dist/dialog/root/dialog-root.d.ts +12 -1
- package/dist/dialog/root/dialog-root.js +11 -4
- package/dist/divider/root/divider-root.d.ts +45 -16
- package/dist/divider/root/divider-root.js +28 -4
- package/dist/donut-chart/root/donut-chart-root.d.ts +5 -0
- package/dist/donut-chart/root/donut-chart-root.js +8 -5
- package/dist/drawer/root/drawer-root.d.ts +12 -1
- package/dist/drawer/root/drawer-root.js +9 -2
- package/dist/drilldown/item/drilldown-item.js +3 -4
- package/dist/drilldown/root/drilldown-root.d.ts +5 -0
- package/dist/drilldown/root/drilldown-root.js +4 -1
- package/dist/element-events.generated.js +26 -3
- package/dist/empty/root/empty-root.d.ts +17 -3
- package/dist/empty/root/empty-root.js +29 -5
- package/dist/file-input/root/file-input-root.d.ts +18 -3
- package/dist/file-input/root/file-input-root.js +34 -18
- package/dist/file-input/status.js +2 -1
- package/dist/filter-input/chip/filter-chip.d.ts +13 -0
- package/dist/filter-input/chip/filter-chip.js +7 -3
- package/dist/filter-input/menu/filter-menu.d.ts +5 -0
- package/dist/filter-input/menu/filter-menu.js +3 -1
- package/dist/filter-input/root/filter-input-root.d.ts +20 -3
- package/dist/filter-input/root/filter-input-root.js +8 -4
- package/dist/format-date/fields.d.ts +20 -0
- package/dist/format-date/fields.js +14 -0
- package/dist/format-date/options.d.ts +2 -1
- package/dist/format-date/options.js +9 -38
- package/dist/format-date/root/format-date-root.d.ts +55 -5
- package/dist/format-date/root/format-date-root.js +29 -34
- package/dist/graph/root/graph-model.d.ts +11 -0
- package/dist/graph/root/graph-model.js +4 -0
- package/dist/graph/root/graph-root.d.ts +101 -14
- package/dist/graph/root/graph-root.js +140 -46
- package/dist/heatmap/root/heatmap-root.d.ts +37 -4
- package/dist/heatmap/root/heatmap-root.js +51 -16
- package/dist/icon-button/root/icon-button-root.d.ts +5 -0
- package/dist/icon-button/root/icon-button-root.js +1 -0
- package/dist/image/root/image-root.d.ts +11 -0
- package/dist/input/root/input-root.d.ts +5 -0
- package/dist/input/root/input-root.js +4 -1
- package/dist/kbd/root/kbd-root.js +1 -2
- package/dist/legend/root/legend-root.js +4 -17
- package/dist/lightbox/root/lightbox-root.d.ts +14 -4
- package/dist/lightbox/root/lightbox-root.js +25 -7
- package/dist/line-chart/root/line-chart-root.d.ts +5 -0
- package/dist/line-chart/root/line-chart-root.js +4 -2
- package/dist/list/item/list-item.d.ts +32 -0
- package/dist/list/item/list-item.js +34 -7
- package/dist/list/root/list-root.d.ts +87 -0
- package/dist/list/root/list-root.js +119 -23
- package/dist/listbox/reorder/index.d.ts +1 -0
- package/dist/listbox/reorder/index.js +4 -0
- package/dist/listbox/reorder/listbox-reorder.d.ts +83 -0
- package/dist/listbox/reorder/listbox-reorder.js +151 -0
- package/dist/listbox/root/listbox-root.d.ts +185 -33
- package/dist/listbox/root/listbox-root.js +166 -136
- package/dist/loader/root/loader-root.d.ts +5 -0
- package/dist/loader/root/loader-root.js +3 -1
- package/dist/map/area/map-area.d.ts +5 -0
- package/dist/map/area/map-area.js +3 -1
- package/dist/map/buildings/map-buildings.d.ts +5 -0
- package/dist/map/buildings/map-buildings.js +3 -1
- package/dist/map/contours/map-contours.d.ts +5 -0
- package/dist/map/contours/map-contours.js +3 -1
- package/dist/map/landcover/map-landcover.d.ts +5 -0
- package/dist/map/landcover/map-landcover.js +3 -1
- package/dist/map/marker/map-marker.d.ts +18 -2
- package/dist/map/marker/map-marker.js +13 -5
- package/dist/map/points/map-points.d.ts +5 -0
- package/dist/map/points/map-points.js +6 -4
- package/dist/map/position/map-position.d.ts +5 -0
- package/dist/map/position/map-position.js +3 -1
- package/dist/map/raster/map-raster.d.ts +5 -0
- package/dist/map/raster/map-raster.js +3 -1
- package/dist/map/root/map-root.d.ts +73 -16
- package/dist/map/root/map-root.js +122 -44
- package/dist/map/route/map-route.d.ts +5 -0
- package/dist/map/route/map-route.js +3 -1
- package/dist/map/terrain/map-terrain.d.ts +5 -0
- package/dist/map/terrain/map-terrain.js +3 -1
- package/dist/megamenu/root/megamenu-root.js +4 -11
- package/dist/menu/root/menu-root.d.ts +7 -2
- package/dist/menu/root/menu-root.js +3 -1
- package/dist/meter/root/meter-root.d.ts +16 -3
- package/dist/meter/root/meter-root.js +12 -5
- package/dist/navigation/root/navigation-root.d.ts +5 -0
- package/dist/navigation/root/navigation-root.js +7 -8
- package/dist/notifications/group/notification-group.d.ts +8 -1
- package/dist/notifications/group/notification-group.js +12 -6
- package/dist/notifications/notification/notification.d.ts +17 -1
- package/dist/notifications/notification/notification.js +6 -2
- package/dist/notifications/root/notifications-root.d.ts +49 -5
- package/dist/notifications/root/notifications-root.js +36 -8
- package/dist/number-input/root/number-input-root.d.ts +21 -8
- package/dist/number-input/root/number-input-root.js +26 -11
- package/dist/object-inspector/root/object-inspector-root.d.ts +56 -13
- package/dist/object-inspector/root/object-inspector-root.js +41 -30
- package/dist/outline/root/outline-root.d.ts +5 -0
- package/dist/outline/root/outline-root.js +3 -1
- package/dist/pagination/root/pagination-root.d.ts +7 -1
- package/dist/pagination/root/pagination-root.js +16 -7
- package/dist/pagination/size/pagination-size.d.ts +8 -3
- package/dist/pagination/size/pagination-size.js +5 -3
- package/dist/pagination/summary/pagination-summary.d.ts +8 -6
- package/dist/pagination/summary/pagination-summary.js +4 -9
- package/dist/pin-input/code.d.ts +23 -0
- package/dist/pin-input/code.js +21 -0
- package/dist/pin-input/root/pin-input-root.d.ts +9 -3
- package/dist/pin-input/root/pin-input-root.js +13 -23
- package/dist/popover/root/popover-root.d.ts +12 -2
- package/dist/popover/root/popover-root.js +10 -4
- package/dist/progress/root/progress-root.d.ts +7 -2
- package/dist/progress/root/progress-root.js +5 -2
- package/dist/qr-code/name.d.ts +3 -2
- package/dist/qr-code/name.js +2 -2
- package/dist/qr-code/root/qr-code-root.d.ts +26 -5
- package/dist/qr-code/root/qr-code-root.js +27 -6
- package/dist/radio/group/radio-group.d.ts +11 -0
- package/dist/radio/group/radio-group.js +8 -2
- package/dist/rating/root/rating-root.d.ts +12 -1
- package/dist/rating/root/rating-root.js +10 -3
- package/dist/scatter-chart/measures.d.ts +22 -0
- package/dist/scatter-chart/measures.js +11 -0
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +22 -8
- package/dist/scatter-chart/root/scatter-chart-root.js +25 -23
- package/dist/select/root/select-root.d.ts +67 -8
- package/dist/select/root/select-root.js +45 -11
- package/dist/skip-link/root/skip-link-root.d.ts +5 -0
- package/dist/skip-link/root/skip-link-root.js +3 -1
- package/dist/slider/root/slider-root.d.ts +7 -2
- package/dist/slider/root/slider-root.js +11 -5
- package/dist/sparkline/readings.d.ts +15 -5
- package/dist/sparkline/readings.js +3 -3
- package/dist/sparkline/root/sparkline-root.d.ts +9 -4
- package/dist/sparkline/root/sparkline-root.js +9 -3
- package/dist/speed-dial/group/speed-dial-group.d.ts +48 -0
- package/dist/speed-dial/group/speed-dial-group.js +43 -0
- package/dist/speed-dial/index.d.ts +1 -0
- package/dist/speed-dial/index.js +1 -0
- package/dist/speed-dial/item/speed-dial-item.d.ts +26 -1
- package/dist/speed-dial/item/speed-dial-item.js +41 -3
- package/dist/speed-dial/long-press.d.ts +50 -0
- package/dist/speed-dial/long-press.js +48 -0
- package/dist/speed-dial/root/speed-dial-root.d.ts +85 -1
- package/dist/speed-dial/root/speed-dial-root.js +117 -5
- package/dist/splitter/root/splitter-root.d.ts +12 -3
- package/dist/splitter/root/splitter-root.js +22 -4
- package/dist/steps/root/steps-root.d.ts +9 -2
- package/dist/steps/root/steps-root.js +6 -3
- package/dist/steps/step/step.d.ts +12 -0
- package/dist/steps/step/step.js +11 -2
- package/dist/switch/root/switch-root.d.ts +11 -0
- package/dist/switch/root/switch-root.js +8 -2
- package/dist/table/cell/table-cell.d.ts +8 -1
- package/dist/table/cell/table-cell.js +6 -2
- package/dist/table/column/table-column.d.ts +11 -4
- package/dist/table/column/table-column.js +15 -10
- package/dist/table/grid-controller.d.ts +122 -0
- package/dist/table/grid-controller.js +299 -0
- package/dist/table/root/table-root.d.ts +154 -8
- package/dist/table/root/table-root.js +197 -38
- package/dist/table/row/table-row.d.ts +55 -1
- package/dist/table/row/table-row.js +60 -7
- package/dist/tabs/root/tabs-root.d.ts +5 -0
- package/dist/tabs/root/tabs-root.js +3 -1
- package/dist/tag/group/tag-group.d.ts +5 -0
- package/dist/tag/group/tag-group.js +8 -15
- package/dist/tag/root/tag-root.d.ts +14 -1
- package/dist/tag/root/tag-root.js +11 -8
- package/dist/textarea/root/textarea-root.d.ts +5 -0
- package/dist/textarea/root/textarea-root.js +3 -1
- package/dist/time-input/root/time-input-root.d.ts +14 -7
- package/dist/time-input/root/time-input-root.js +43 -32
- package/dist/time-picker/root/time-picker-root.d.ts +16 -7
- package/dist/time-picker/root/time-picker-root.js +28 -12
- package/dist/toast/item/toast-item.d.ts +13 -3
- package/dist/toast/item/toast-item.js +2 -0
- package/dist/toast/root/toast-root.d.ts +22 -2
- package/dist/toast/root/toast-root.js +24 -17
- package/dist/toggle/group/toggle-group.js +3 -5
- package/dist/toolbar/root/toolbar-root.d.ts +36 -0
- package/dist/toolbar/root/toolbar-root.js +43 -9
- package/dist/tooltip/root/tooltip-root.d.ts +27 -17
- package/dist/tooltip/root/tooltip-root.js +1 -2
- package/dist/tour/root/tour-root.d.ts +8 -2
- package/dist/tour/root/tour-root.js +4 -2
- package/dist/tour/stop/tour-stop.d.ts +5 -0
- package/dist/tour/stop/tour-stop.js +6 -1
- package/dist/tree/grip.d.ts +5 -0
- package/dist/tree/grip.js +1 -0
- package/dist/tree/item/tree-item.d.ts +24 -0
- package/dist/tree/item/tree-item.js +27 -5
- package/dist/tree/root/tree-root.d.ts +66 -1
- package/dist/tree/root/tree-root.js +77 -5
- package/dist/trend/root/trend-root.d.ts +20 -4
- package/dist/trend/root/trend-root.js +20 -5
- package/dist/video/root/video-root.d.ts +23 -3
- package/dist/video/root/video-root.js +56 -15
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
- package/dist/video-playlist/root/video-playlist-root.d.ts +5 -0
- package/dist/video-playlist/root/video-playlist-root.js +3 -1
- package/dist/virtual-list/root/virtual-list-root.d.ts +19 -3
- package/dist/virtual-list/root/virtual-list-root.js +10 -19
- package/lint.json +1 -1
- package/package.json +7 -6
- package/types/jsx.d.ts +6005 -2114
- package/types/svelte.d.ts +1 -0
- package/types/vue.d.ts +1594 -676
- package/types/words.d.ts +3280 -0
- package/dist/kbd/keys.d.ts +0 -29
- package/dist/kbd/keys.js +0 -52
- package/dist/toast/hotkey.d.ts +0 -22
- package/dist/toast/hotkey.js +0 -23
- package/dist/tooltip/focus-target.d.ts +0 -6
- package/dist/tooltip/focus-target.js +0 -9
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a card lands on a board that snaps: the arithmetic of a ruling, kept
|
|
3
|
+
* apart from the board that applies it.
|
|
4
|
+
*
|
|
5
|
+
* Every value is in the document's own units, and a step of nothing, zero or
|
|
6
|
+
* less is no snapping at all, so a board without `snap` moves exactly as it
|
|
7
|
+
* did before there was one.
|
|
8
|
+
*/
|
|
9
|
+
/** A box on the board, in the document's own units. */
|
|
10
|
+
export interface SnapBox {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A value at the nearest multiple of `step`, or the value as it is where there
|
|
18
|
+
* is no step. A drag lets go wherever the hand is, and lands on the line
|
|
19
|
+
* nearest it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const snapTo: (value: number, step: number | undefined) => number;
|
|
22
|
+
/**
|
|
23
|
+
* The next multiple of `step` from `value`, the way a key points: `way` is `1`
|
|
24
|
+
* or `-1`.
|
|
25
|
+
*
|
|
26
|
+
* **On to the next line, and never back onto the same one.** A card sitting
|
|
27
|
+
* between two lines goes to the line ahead of it, and one on a line goes a
|
|
28
|
+
* whole step, so every press moves the card and every press lands on a line.
|
|
29
|
+
*/
|
|
30
|
+
export declare const stepTo: (value: number, way: number, step: number) => number;
|
|
31
|
+
/**
|
|
32
|
+
* A box resized from a corner, with the edges that corner moves snapped, and
|
|
33
|
+
* held to a least size.
|
|
34
|
+
*
|
|
35
|
+
* Only the moving edges: the corner opposite the one in hand stays where it
|
|
36
|
+
* was, as it does without a ruling. Where the line nearest is inside the least
|
|
37
|
+
* size, the box stays at the least size rather than turning inside out.
|
|
38
|
+
*/
|
|
39
|
+
export declare const snapBox: (box: SnapBox, start: SnapBox, corner: string, step: number | undefined, least: {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
}) => SnapBox;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const snaps = (step) => step !== undefined && Number.isFinite(step) && step > 0;
|
|
2
|
+
export const snapTo = (value, step) => snaps(step) ? Math.round(value / step) * step : value;
|
|
3
|
+
export const stepTo = (value, way, step) => {
|
|
4
|
+
if (way === 0) {
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
const at = value / step;
|
|
8
|
+
const near = Math.round(at);
|
|
9
|
+
const on = Math.abs(at - near) < 1e-9 ? near : at;
|
|
10
|
+
return (way > 0 ? Math.floor(on) + 1 : Math.ceil(on) - 1) * step;
|
|
11
|
+
};
|
|
12
|
+
export const snapBox = (box, start, corner, step, least) => {
|
|
13
|
+
if (!snaps(step)) {
|
|
14
|
+
return box;
|
|
15
|
+
}
|
|
16
|
+
const left = corner.endsWith('left');
|
|
17
|
+
const top = corner.startsWith('top');
|
|
18
|
+
const right = start.x + start.width;
|
|
19
|
+
const bottom = start.y + start.height;
|
|
20
|
+
const width = left
|
|
21
|
+
? Math.max(least.width, right - snapTo(box.x, step))
|
|
22
|
+
: Math.max(least.width, snapTo(box.x + box.width, step) - start.x);
|
|
23
|
+
const height = top
|
|
24
|
+
? Math.max(least.height, bottom - snapTo(box.y, step))
|
|
25
|
+
: Math.max(least.height, snapTo(box.y + box.height, step) - start.y);
|
|
26
|
+
return {
|
|
27
|
+
height,
|
|
28
|
+
width,
|
|
29
|
+
x: left ? right - width : start.x,
|
|
30
|
+
y: top ? bottom - height : start.y,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HelixElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { ChildrenController, HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
4
|
* @summary Shows one slide of several, with controls to move between them.
|
|
@@ -94,6 +94,11 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
94
94
|
* @cssstate dragging - While a mouse drags the track, under `mouse-drag`.
|
|
95
95
|
*/
|
|
96
96
|
export declare class HelixHeadlessCarousel extends HelixElement {
|
|
97
|
+
/**
|
|
98
|
+
* The key this family's words are registered under, its styled tag:
|
|
99
|
+
* `registerWords('de', { 'helix-carousel': { nextLabel: 'Nächste Folie' } })`.
|
|
100
|
+
*/
|
|
101
|
+
static words: string;
|
|
97
102
|
/**
|
|
98
103
|
* Manual, so each slide can be wrapped without its markup being touched.
|
|
99
104
|
*
|
|
@@ -727,9 +732,10 @@ export declare class HelixHeadlessCarousel extends HelixElement {
|
|
|
727
732
|
* that changes an assignment is this component calling `assign`, so a slide
|
|
728
733
|
* appended by a consumer would reach no slot, render nowhere and be counted by
|
|
729
734
|
* nothing. A default slot needs no watcher, taking whatever is there; a manual
|
|
730
|
-
* one does. `Chat` watches for the same reason
|
|
735
|
+
* one does. `Chat` watches for the same reason, through the same core
|
|
736
|
+
* controller.
|
|
731
737
|
*/
|
|
732
|
-
|
|
738
|
+
protected readonly childWatch: ChildrenController;
|
|
733
739
|
connectedCallback(): void;
|
|
734
740
|
disconnectedCallback(): void;
|
|
735
741
|
/** Pauses without forgetting that the reader wanted it running. */
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { capturePointer, customElement,
|
|
7
|
+
import { ChildrenController, capturePointer, customElement, formatWords, HelixActivateEvent, HelixElement, HelixSelectEvent, hostAria, inlineStep, isRtl, requestChange, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { caretLeft, caretRight, play, stop } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html, nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -185,13 +185,14 @@ let HelixHeadlessCarousel = class HelixHeadlessCarousel extends HelixElement {
|
|
|
185
185
|
};
|
|
186
186
|
this.scrollFrame = 0;
|
|
187
187
|
this.stopped = false;
|
|
188
|
-
this.
|
|
188
|
+
this.childWatch = new ChildrenController(this);
|
|
189
189
|
this.pause = () => {
|
|
190
190
|
if (!this.stopped) {
|
|
191
191
|
this.rotating = false;
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
+
static { this.words = 'helix-carousel'; }
|
|
195
196
|
static { this.shadowRootOptions = {
|
|
196
197
|
...HelixElement.shadowRootOptions,
|
|
197
198
|
slotAssignment: 'manual',
|
|
@@ -388,8 +389,6 @@ let HelixHeadlessCarousel = class HelixHeadlessCarousel extends HelixElement {
|
|
|
388
389
|
super.connectedCallback();
|
|
389
390
|
this.addEventListener('focusin', this.pause);
|
|
390
391
|
this.addEventListener('pointerenter', this.pause);
|
|
391
|
-
this.watcher = new MutationObserver(() => this.requestUpdate());
|
|
392
|
-
this.watcher.observe(this, { childList: true });
|
|
393
392
|
this.watchPane();
|
|
394
393
|
if (this.hasUpdated) {
|
|
395
394
|
this.runTimer();
|
|
@@ -403,8 +402,6 @@ let HelixHeadlessCarousel = class HelixHeadlessCarousel extends HelixElement {
|
|
|
403
402
|
}
|
|
404
403
|
this.removeEventListener('focusin', this.pause);
|
|
405
404
|
this.removeEventListener('pointerenter', this.pause);
|
|
406
|
-
this.watcher?.disconnect();
|
|
407
|
-
this.watcher = undefined;
|
|
408
405
|
this.sizes?.disconnect();
|
|
409
406
|
this.sizes = undefined;
|
|
410
407
|
this.watched = undefined;
|
|
@@ -419,7 +416,7 @@ let HelixHeadlessCarousel = class HelixHeadlessCarousel extends HelixElement {
|
|
|
419
416
|
if (changed.has('index')) {
|
|
420
417
|
this.showing = undefined;
|
|
421
418
|
if (this.hasUpdated) {
|
|
422
|
-
this.said =
|
|
419
|
+
this.said = formatWords(this, 'slideLabel', {
|
|
423
420
|
count: this.slides.length,
|
|
424
421
|
index: this.index + 1,
|
|
425
422
|
});
|
|
@@ -569,7 +566,7 @@ let HelixHeadlessCarousel = class HelixHeadlessCarousel extends HelixElement {
|
|
|
569
566
|
part="slide"
|
|
570
567
|
role="group"
|
|
571
568
|
aria-roledescription=${this.slideRoleLabel || nothing}
|
|
572
|
-
aria-label=${
|
|
569
|
+
aria-label=${formatWords(this, 'slideLabel', { count: this.slides.length, index: index + 1 })}
|
|
573
570
|
style=${this.paneStyle(index, last, stops)}
|
|
574
571
|
>
|
|
575
572
|
<slot
|
|
@@ -580,14 +577,14 @@ let HelixHeadlessCarousel = class HelixHeadlessCarousel extends HelixElement {
|
|
|
580
577
|
</div>
|
|
581
578
|
${''}<span part="live" aria-live=${rotating ? 'off' : 'polite'}>${this.said}</span>
|
|
582
579
|
${this.slides.length > 1 && this.across !== undefined
|
|
583
|
-
? html `<div part="indicators" role="group" aria-label=${
|
|
580
|
+
? html `<div part="indicators" role="group" aria-label=${formatWords(this, 'indicatorsLabel', { label: this.label })}>
|
|
584
581
|
${''}
|
|
585
582
|
${stops.map((stop, at) => {
|
|
586
583
|
const current = at === showing;
|
|
587
584
|
return html `<button
|
|
588
585
|
part="indicator${current ? ' indicator-current' : ''}"
|
|
589
586
|
type="button"
|
|
590
|
-
aria-label=${
|
|
587
|
+
aria-label=${formatWords(this, 'indicatorLabel', { index: at + 1 })}
|
|
591
588
|
aria-current=${at === place ? 'true' : nothing}
|
|
592
589
|
tabindex=${at === place ? '0' : '-1'}
|
|
593
590
|
?data-current=${current}
|
|
@@ -612,15 +609,18 @@ __decorate([
|
|
|
612
609
|
property({ type: Number })
|
|
613
610
|
], HelixHeadlessCarousel.prototype, "index", null);
|
|
614
611
|
__decorate([
|
|
612
|
+
words,
|
|
615
613
|
property({ attribute: 'indicator-label' })
|
|
616
614
|
], HelixHeadlessCarousel.prototype, "indicatorLabel", void 0);
|
|
617
615
|
__decorate([
|
|
616
|
+
words,
|
|
618
617
|
property({ attribute: 'indicators-label' })
|
|
619
618
|
], HelixHeadlessCarousel.prototype, "indicatorsLabel", void 0);
|
|
620
619
|
__decorate([
|
|
621
620
|
property({ type: Number })
|
|
622
621
|
], HelixHeadlessCarousel.prototype, "interval", void 0);
|
|
623
622
|
__decorate([
|
|
623
|
+
words,
|
|
624
624
|
property()
|
|
625
625
|
], HelixHeadlessCarousel.prototype, "label", void 0);
|
|
626
626
|
__decorate([
|
|
@@ -630,6 +630,7 @@ __decorate([
|
|
|
630
630
|
property({ attribute: 'mouse-drag', reflect: true, type: Boolean })
|
|
631
631
|
], HelixHeadlessCarousel.prototype, "mouseDrag", void 0);
|
|
632
632
|
__decorate([
|
|
633
|
+
words,
|
|
633
634
|
property({ attribute: 'next-label' })
|
|
634
635
|
], HelixHeadlessCarousel.prototype, "nextLabel", void 0);
|
|
635
636
|
__decorate([
|
|
@@ -642,24 +643,30 @@ __decorate([
|
|
|
642
643
|
property({ attribute: 'per-view', converter: COUNT_OR_AUTO, reflect: true })
|
|
643
644
|
], HelixHeadlessCarousel.prototype, "perView", void 0);
|
|
644
645
|
__decorate([
|
|
646
|
+
words,
|
|
645
647
|
property({ attribute: 'previous-label' })
|
|
646
648
|
], HelixHeadlessCarousel.prototype, "previousLabel", void 0);
|
|
647
649
|
__decorate([
|
|
650
|
+
words,
|
|
648
651
|
property({ attribute: 'role-label' })
|
|
649
652
|
], HelixHeadlessCarousel.prototype, "roleLabel", void 0);
|
|
650
653
|
__decorate([
|
|
654
|
+
words,
|
|
651
655
|
property({ attribute: 'slide-label' })
|
|
652
656
|
], HelixHeadlessCarousel.prototype, "slideLabel", void 0);
|
|
653
657
|
__decorate([
|
|
658
|
+
words,
|
|
654
659
|
property({ attribute: 'slide-role-label' })
|
|
655
660
|
], HelixHeadlessCarousel.prototype, "slideRoleLabel", void 0);
|
|
656
661
|
__decorate([
|
|
657
662
|
property({ attribute: 'slides-per-move', type: Number })
|
|
658
663
|
], HelixHeadlessCarousel.prototype, "slidesPerMove", void 0);
|
|
659
664
|
__decorate([
|
|
665
|
+
words,
|
|
660
666
|
property({ attribute: 'start-label' })
|
|
661
667
|
], HelixHeadlessCarousel.prototype, "startLabel", void 0);
|
|
662
668
|
__decorate([
|
|
669
|
+
words,
|
|
663
670
|
property({ attribute: 'stop-label' })
|
|
664
671
|
], HelixHeadlessCarousel.prototype, "stopLabel", void 0);
|
|
665
672
|
__decorate([
|
|
@@ -47,6 +47,11 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
47
47
|
* @csspart tools - The row under the field.
|
|
48
48
|
*/
|
|
49
49
|
export declare class HelixHeadlessChatComposer extends HelixFormElement {
|
|
50
|
+
/**
|
|
51
|
+
* The key this part's words are registered under, its styled tag:
|
|
52
|
+
* `registerWords('de', { 'helix-chat-composer': { sendLabel: 'Senden' } })`.
|
|
53
|
+
*/
|
|
54
|
+
static words: string;
|
|
50
55
|
/**
|
|
51
56
|
* The field's name, read by screen readers.
|
|
52
57
|
*/
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement, DelayController, HelixFormElement, HelixSendEvent, HelixTypingEvent, hostAria, markRegion, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, DelayController, HelixFormElement, HelixSendEvent, HelixTypingEvent, hostAria, markRegion, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { arrowElbowDownLeft } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html } from 'lit';
|
|
10
10
|
import { property } from 'lit/decorators.js';
|
|
@@ -43,6 +43,7 @@ let HelixHeadlessChatComposer = class HelixHeadlessChatComposer extends HelixFor
|
|
|
43
43
|
this.send();
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
+
static { this.words = 'helix-chat-composer'; }
|
|
46
47
|
get typing() {
|
|
47
48
|
return this.writing;
|
|
48
49
|
}
|
|
@@ -136,6 +137,7 @@ let HelixHeadlessChatComposer = class HelixHeadlessChatComposer extends HelixFor
|
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
139
|
__decorate([
|
|
140
|
+
words,
|
|
139
141
|
property()
|
|
140
142
|
], HelixHeadlessChatComposer.prototype, "label", void 0);
|
|
141
143
|
__decorate([
|
|
@@ -145,6 +147,7 @@ __decorate([
|
|
|
145
147
|
property({ type: Number })
|
|
146
148
|
], HelixHeadlessChatComposer.prototype, "rows", void 0);
|
|
147
149
|
__decorate([
|
|
150
|
+
words,
|
|
148
151
|
property({ attribute: 'send-label' })
|
|
149
152
|
], HelixHeadlessChatComposer.prototype, "sendLabel", void 0);
|
|
150
153
|
__decorate([
|
|
@@ -3,8 +3,8 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
3
3
|
/**
|
|
4
4
|
* What a turn that did not send is called, where nobody said otherwise.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* @deprecated The English of `failed-label`, which is now a word property:
|
|
7
|
+
* register its words with `registerWords`. Removed in the next major version.
|
|
8
8
|
*/
|
|
9
9
|
export declare const FAILED_LABEL = "Not sent";
|
|
10
10
|
/**
|
|
@@ -55,6 +55,11 @@ export declare const FAILED_LABEL = "Not sent";
|
|
|
55
55
|
* @csspart time - The turn's time.
|
|
56
56
|
*/
|
|
57
57
|
export declare class HelixHeadlessChatMessage extends HelixElement {
|
|
58
|
+
/**
|
|
59
|
+
* The key this part's words are registered under, its styled tag:
|
|
60
|
+
* `registerWords('de', { 'helix-chat-message': { retryLabel: 'Erneut versuchen' } })`.
|
|
61
|
+
*/
|
|
62
|
+
static words: string;
|
|
58
63
|
/**
|
|
59
64
|
* The turn's time, in any format `Date` parses.
|
|
60
65
|
*/
|
|
@@ -82,9 +87,8 @@ export declare class HelixHeadlessChatMessage extends HelixElement {
|
|
|
82
87
|
*/
|
|
83
88
|
failedLabel: string;
|
|
84
89
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* Empty is the runtime's own.
|
|
90
|
+
* The locale the timestamp and the words are in, as a BCP 47 tag such as
|
|
91
|
+
* `de`. Empty reads the nearest `lang`, then the browser's language.
|
|
88
92
|
*/
|
|
89
93
|
locale: string;
|
|
90
94
|
/**
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement, HelixElement, HelixSendEvent, hostAria, markRegion, RelativeClockController, relativeTime, requestChange, TONE_MARKS, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, HelixElement, HelixSendEvent, hostAria, markRegion, RelativeClockController, relativeTime, requestChange, TONE_MARKS, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
@@ -15,7 +15,7 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
|
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.at = '';
|
|
17
17
|
this.authorLabel = '';
|
|
18
|
-
this.failedLabel =
|
|
18
|
+
this.failedLabel = 'Not sent';
|
|
19
19
|
this.locale = '';
|
|
20
20
|
this.retryLabel = 'Try again';
|
|
21
21
|
this.sendingLabel = 'Sending';
|
|
@@ -24,7 +24,7 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
|
|
|
24
24
|
this.clock = new RelativeClockController(this, {
|
|
25
25
|
expires: (now) => {
|
|
26
26
|
const moment = this.moment;
|
|
27
|
-
return moment ? relativeTime(this
|
|
27
|
+
return moment ? relativeTime(wordsLocale(this))(moment, now).next : undefined;
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
this.handleFill = () => {
|
|
@@ -49,6 +49,7 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
|
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
static { this.words = 'helix-chat-message'; }
|
|
52
53
|
get moment() {
|
|
53
54
|
if (this.at === '') {
|
|
54
55
|
return undefined;
|
|
@@ -66,7 +67,7 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
|
|
|
66
67
|
}
|
|
67
68
|
get reading() {
|
|
68
69
|
const moment = this.moment;
|
|
69
|
-
return moment ? relativeTime(this
|
|
70
|
+
return moment ? relativeTime(wordsLocale(this))(moment, new Date(this.clock.now)).text : '';
|
|
70
71
|
}
|
|
71
72
|
get name() {
|
|
72
73
|
return turnName(authorWords(this.author, this.authorLabel, this.turnWords), this.reading, this.turnWords);
|
|
@@ -142,15 +143,18 @@ __decorate([
|
|
|
142
143
|
property({ attribute: 'author-label' })
|
|
143
144
|
], HelixHeadlessChatMessage.prototype, "authorLabel", void 0);
|
|
144
145
|
__decorate([
|
|
146
|
+
words,
|
|
145
147
|
property({ attribute: 'failed-label' })
|
|
146
148
|
], HelixHeadlessChatMessage.prototype, "failedLabel", void 0);
|
|
147
149
|
__decorate([
|
|
148
150
|
property()
|
|
149
151
|
], HelixHeadlessChatMessage.prototype, "locale", void 0);
|
|
150
152
|
__decorate([
|
|
153
|
+
words,
|
|
151
154
|
property({ attribute: 'retry-label' })
|
|
152
155
|
], HelixHeadlessChatMessage.prototype, "retryLabel", void 0);
|
|
153
156
|
__decorate([
|
|
157
|
+
words,
|
|
154
158
|
property({ attribute: 'sending-label' })
|
|
155
159
|
], HelixHeadlessChatMessage.prototype, "sendingLabel", void 0);
|
|
156
160
|
__decorate([
|
package/dist/chat/naming.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { formatMessage } from '@fusion.dev/helix-core';
|
|
2
2
|
export const TURN_WORDS = { me: 'You', sentence: '{author}, {time}', turn: 'Message' };
|
|
3
3
|
export const authorWords = (author, authorLabel, words) => {
|
|
4
4
|
if (authorLabel !== '') {
|
|
@@ -10,5 +10,5 @@ export const authorWords = (author, authorLabel, words) => {
|
|
|
10
10
|
return author === undefined || author === 'them' ? '' : author;
|
|
11
11
|
};
|
|
12
12
|
export const turnName = (author, time, words) => author !== '' && time !== ''
|
|
13
|
-
?
|
|
13
|
+
? formatMessage(words.sentence, { author, time }, '')
|
|
14
14
|
: author || time || words.turn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HelixElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { ChildrenController, HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
-
import {
|
|
3
|
+
import type { HelixHeadlessChatMessage } from '../message/chat-message.js';
|
|
4
4
|
/** One turn handed over as data, which is what `turns` holds. */
|
|
5
5
|
export interface ChatTurn {
|
|
6
6
|
/** When it was said, as anything `Date` parses. */
|
|
@@ -128,6 +128,11 @@ declare const HelixHeadlessChat_base: (new (...args: any[]) => import("@fusion.d
|
|
|
128
128
|
* @csspart typing - The words that say who is typing, in the status band, while `typing` names someone.
|
|
129
129
|
*/
|
|
130
130
|
export declare class HelixHeadlessChat extends HelixHeadlessChat_base {
|
|
131
|
+
/**
|
|
132
|
+
* The key this family's words are registered under, its styled tag:
|
|
133
|
+
* `registerWords('de', { 'helix-chat': { typingLabel: '{author} schreibt' } })`.
|
|
134
|
+
*/
|
|
135
|
+
static words: string;
|
|
131
136
|
/**
|
|
132
137
|
* Slots are assigned manually, so only the turns go into the log.
|
|
133
138
|
*
|
|
@@ -159,6 +164,19 @@ export declare class HelixHeadlessChat extends HelixHeadlessChat_base {
|
|
|
159
164
|
* so a default of true had no attribute that turned it off.
|
|
160
165
|
*/
|
|
161
166
|
defaultPinned: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* What a turn from `turns` that did not send says, and what a screen reader
|
|
169
|
+
* hears before its words. A turn you write as a child says its own
|
|
170
|
+
* `failed-label`.
|
|
171
|
+
*/
|
|
172
|
+
failedLabel: string;
|
|
173
|
+
/**
|
|
174
|
+
* What a screen reader hears for a turn that did not send. `{failed}` is the
|
|
175
|
+
* turn's `failed-label` and `{text}` is its words.
|
|
176
|
+
*/
|
|
177
|
+
failedTurnLabel: string;
|
|
178
|
+
/** The conversation's name, read by screen readers, where `label` is empty. */
|
|
179
|
+
fallbackLabel: string;
|
|
162
180
|
/**
|
|
163
181
|
* Whether there are older turns to load, and whether they are loading.
|
|
164
182
|
*
|
|
@@ -253,8 +271,18 @@ export declare class HelixHeadlessChat extends HelixHeadlessChat_base {
|
|
|
253
271
|
* a turn is told again only when they change.
|
|
254
272
|
*/
|
|
255
273
|
private words;
|
|
256
|
-
/**
|
|
257
|
-
|
|
274
|
+
/**
|
|
275
|
+
* Watches for turns arriving, since a manual slot hears nothing about them.
|
|
276
|
+
*
|
|
277
|
+
* **A turn that arrives after first paint reaches nothing on its own.**
|
|
278
|
+
* Slots are assigned by hand here, so appending a child assigns it to
|
|
279
|
+
* nothing, fires no `slotchange`, and schedules no render: the transcript
|
|
280
|
+
* went on showing "Nothing to show" over six children it already had, and
|
|
281
|
+
* the one thing a conversation does is grow. Measured with
|
|
282
|
+
* `assignedElements()` at zero against `children` at nine. Children only,
|
|
283
|
+
* never a turn's own text, which a streaming turn rewrites every frame.
|
|
284
|
+
*/
|
|
285
|
+
protected readonly childWatch: ChildrenController;
|
|
258
286
|
/** Watches the turns' own `state`, which is when one of them settles. */
|
|
259
287
|
private settling;
|
|
260
288
|
/** Watches the turns and the log for size, which scrolling does not report. */
|
|
@@ -366,6 +394,14 @@ export declare class HelixHeadlessChat extends HelixHeadlessChat_base {
|
|
|
366
394
|
* turn; what they were reading is the one fixed point. It is also idempotent,
|
|
367
395
|
* which is what lets it run beside the browser's own scroll anchoring where
|
|
368
396
|
* there is some: a turn the browser already put back has not moved.
|
|
397
|
+
*
|
|
398
|
+
* **A transcript fed as data writes no scroll offset while the reader
|
|
399
|
+
* scrolls.** Turns drawn above the reader for the first time come out taller
|
|
400
|
+
* or shorter than the estimate, and a write to `scrollTop` to make up for
|
|
401
|
+
* them ends a fling on iOS. While the reader scrolls, the controller holds
|
|
402
|
+
* them instead, in its spacer above the window, and squares the scroll offset
|
|
403
|
+
* once the log is still. The turn noted before a scroll whose event has not
|
|
404
|
+
* arrived is out of date, so that counts as scrolling too.
|
|
369
405
|
*/
|
|
370
406
|
private restore;
|
|
371
407
|
/** Fires `helix-history` once for each time the reader reaches the top. */
|