@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
package/dist/kbd/keys.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The words and glyphs a chord is drawn with, per platform.
|
|
3
|
-
*
|
|
4
|
-
* Beside the family's `index.ts`, because which label a key gets is a table
|
|
5
|
-
* and a rule, and not the key's template.
|
|
6
|
-
*/
|
|
7
|
-
/** A chord's keys as they are shown, and what is shown between two of them. */
|
|
8
|
-
export interface KeyNames {
|
|
9
|
-
/** Each key's label, in the order the chord names them. */
|
|
10
|
-
keys: string[];
|
|
11
|
-
/** What goes between two keys: `+`, a hyphen, or nothing. */
|
|
12
|
-
separator: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* The labels of a chord's keys on a platform, with `own` labels in place of
|
|
16
|
-
* the platform's, and what goes between two keys.
|
|
17
|
-
*
|
|
18
|
-
* `parts` are the chord's names as `chordParts` splits them. A name `own`
|
|
19
|
-
* holds takes that label, a name the platform knows takes its glyph or word,
|
|
20
|
-
* and any other single character is shown in capitals.
|
|
21
|
-
*
|
|
22
|
-
* **On an Apple keyboard glyphs run together and words are joined with a
|
|
23
|
-
* hyphen**, as Apple writes `Command-K`. A label of more than one character
|
|
24
|
-
* from `own` is a word, so `{"mod": "Command"}` shows `Command-K` there, where
|
|
25
|
-
* nothing between the two ran them into `CommandK`. The platform's own `Esc`
|
|
26
|
-
* and `Space` keep running on from a glyph, as `⌘Esc` always has. Everywhere
|
|
27
|
-
* else keys are joined with `+`.
|
|
28
|
-
*/
|
|
29
|
-
export declare const keyNames: (parts: readonly string[], apple: boolean, own?: Readonly<Record<string, string>>) => KeyNames;
|
package/dist/kbd/keys.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
const APPLE = {
|
|
2
|
-
alt: '⌥',
|
|
3
|
-
backspace: '⌫',
|
|
4
|
-
cmd: '⌘',
|
|
5
|
-
ctrl: '⌃',
|
|
6
|
-
del: '⌦',
|
|
7
|
-
down: '↓',
|
|
8
|
-
enter: '↵',
|
|
9
|
-
esc: 'Esc',
|
|
10
|
-
left: '←',
|
|
11
|
-
meta: '⌘',
|
|
12
|
-
mod: '⌘',
|
|
13
|
-
opt: '⌥',
|
|
14
|
-
right: '→',
|
|
15
|
-
shift: '⇧',
|
|
16
|
-
space: 'Space',
|
|
17
|
-
tab: '⇥',
|
|
18
|
-
up: '↑',
|
|
19
|
-
};
|
|
20
|
-
const ELSEWHERE = {
|
|
21
|
-
alt: 'Alt',
|
|
22
|
-
backspace: 'Backspace',
|
|
23
|
-
cmd: 'Win',
|
|
24
|
-
ctrl: 'Ctrl',
|
|
25
|
-
del: 'Del',
|
|
26
|
-
down: '↓',
|
|
27
|
-
enter: 'Enter',
|
|
28
|
-
esc: 'Esc',
|
|
29
|
-
left: '←',
|
|
30
|
-
meta: 'Win',
|
|
31
|
-
mod: 'Ctrl',
|
|
32
|
-
opt: 'Alt',
|
|
33
|
-
right: '→',
|
|
34
|
-
shift: 'Shift',
|
|
35
|
-
space: 'Space',
|
|
36
|
-
tab: 'Tab',
|
|
37
|
-
up: '↑',
|
|
38
|
-
};
|
|
39
|
-
export const keyNames = (parts, apple, own = {}) => {
|
|
40
|
-
const names = apple ? APPLE : ELSEWHERE;
|
|
41
|
-
let worded = false;
|
|
42
|
-
const keys = parts.map((part) => {
|
|
43
|
-
const name = part.toLowerCase();
|
|
44
|
-
const mine = own[name];
|
|
45
|
-
if (mine !== undefined) {
|
|
46
|
-
worded ||= [...mine].length > 1;
|
|
47
|
-
return mine;
|
|
48
|
-
}
|
|
49
|
-
return names[name] ?? (part.length === 1 ? part.toUpperCase() : part);
|
|
50
|
-
});
|
|
51
|
-
return { keys, separator: apple ? (worded ? '-' : '') : '+' };
|
|
52
|
-
};
|
package/dist/toast/hotkey.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type ChordPress } from '@fusion.dev/helix-core';
|
|
2
|
-
/** A key and the modifiers held with it. */
|
|
3
|
-
export interface Chord {
|
|
4
|
-
alt: boolean;
|
|
5
|
-
ctrl: boolean;
|
|
6
|
-
key: string;
|
|
7
|
-
meta: boolean;
|
|
8
|
-
shift: boolean;
|
|
9
|
-
}
|
|
10
|
-
/** What a key press carries that a chord is compared against. */
|
|
11
|
-
export type Pressed = ChordPress;
|
|
12
|
-
/**
|
|
13
|
-
* Reads a chord written as keys joined by `+`, such as `F8` or `Alt+T`, case
|
|
14
|
-
* aside. The last part is the key. Empty, or a chord with no key, is none.
|
|
15
|
-
*
|
|
16
|
-
* Split as core's `chordParts` splits every chord, and read more strictly than
|
|
17
|
-
* Kbd reads one: four modifiers by their own names, no `mod`, and Shift held
|
|
18
|
-
* exactly as written, so the key that moves to the stack is the one written.
|
|
19
|
-
*/
|
|
20
|
-
export declare const parseHotkey: (text: string) => Chord | null;
|
|
21
|
-
/** Whether a press is the chord: the same key, case aside, and exactly its modifiers. */
|
|
22
|
-
export declare const matchesHotkey: (pressed: Pressed, chord: Chord | null) => boolean;
|
package/dist/toast/hotkey.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { chordParts } from '@fusion.dev/helix-core';
|
|
2
|
-
const MODIFIERS = new Set(['alt', 'ctrl', 'meta', 'shift']);
|
|
3
|
-
export const parseHotkey = (text) => {
|
|
4
|
-
const parts = chordParts(text);
|
|
5
|
-
const key = parts.pop();
|
|
6
|
-
if (!key || MODIFIERS.has(key.toLowerCase())) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
const held = new Set(parts.map((one) => one.toLowerCase()));
|
|
10
|
-
return {
|
|
11
|
-
alt: held.has('alt'),
|
|
12
|
-
ctrl: held.has('ctrl'),
|
|
13
|
-
key,
|
|
14
|
-
meta: held.has('meta'),
|
|
15
|
-
shift: held.has('shift'),
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export const matchesHotkey = (pressed, chord) => chord !== null &&
|
|
19
|
-
pressed.key.toLowerCase() === chord.key.toLowerCase() &&
|
|
20
|
-
pressed.altKey === chord.alt &&
|
|
21
|
-
pressed.ctrlKey === chord.ctrl &&
|
|
22
|
-
pressed.metaKey === chord.meta &&
|
|
23
|
-
pressed.shiftKey === chord.shift;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The element focus lands on when a trigger is focused: the trigger itself,
|
|
3
|
-
* or, for a component that delegates focus, the control inside its shadow root,
|
|
4
|
-
* followed down through any component nested there.
|
|
5
|
-
*/
|
|
6
|
-
export declare const focusTarget: (trigger: Element) => Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const CONTROL = 'a[href], button, input, select, textarea, [contenteditable], [tabindex]:not([tabindex="-1"])';
|
|
2
|
-
export const focusTarget = (trigger) => {
|
|
3
|
-
const root = trigger.shadowRoot;
|
|
4
|
-
if (!root?.delegatesFocus) {
|
|
5
|
-
return trigger;
|
|
6
|
-
}
|
|
7
|
-
const inner = root.querySelector(CONTROL);
|
|
8
|
-
return inner ? focusTarget(inner) : trigger;
|
|
9
|
-
};
|