@limetech/lime-elements 40.18.3 → 40.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/cjs/controlled-element-Ajn5eA-q.js +26 -0
- package/dist/cjs/{index-zZvs6xK-.js → index-DIiA99Er.js} +271 -71
- package/dist/cjs/keyboard-navigation-VyqkMDKy.js +152 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +1 -1
- package/dist/cjs/limel-action-bar_3.cjs.entry.js +4 -4
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +2 -2
- package/dist/cjs/{limel-breadcrumbs_6.cjs.entry.js → limel-badge_7.cjs.entry.js} +98 -12
- package/dist/cjs/limel-banner.cjs.entry.js +1 -1
- package/dist/cjs/limel-button-group.cjs.entry.js +1 -1
- package/dist/cjs/limel-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-callout.cjs.entry.js +2 -2
- package/dist/cjs/limel-card.cjs.entry.js +1 -1
- package/dist/cjs/limel-chart.cjs.entry.js +51362 -270
- package/dist/cjs/limel-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip-set.cjs.entry.js +23 -4
- package/dist/cjs/limel-chip_2.cjs.entry.js +2 -2
- package/dist/cjs/limel-circular-progress.cjs.entry.js +1 -1
- package/dist/cjs/limel-code-diff.cjs.entry.js +2 -2
- package/dist/cjs/limel-code-editor.cjs.entry.js +2 -2
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -2
- package/dist/cjs/limel-color-picker-palette.cjs.entry.js +2 -2
- package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-dialog.cjs.entry.js +2 -2
- package/dist/cjs/limel-dock.cjs.entry.js +3 -3
- package/dist/cjs/limel-drag-handle_2.cjs.entry.js +4 -4
- package/dist/cjs/limel-email-viewer.cjs.entry.js +2 -2
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +2 -2
- package/dist/cjs/limel-file-viewer.cjs.entry.js +2 -2
- package/dist/cjs/limel-file.cjs.entry.js +2 -2
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +2 -2
- package/dist/cjs/limel-flex-container.cjs.entry.js +1 -1
- package/dist/cjs/limel-form-header.cjs.entry.js +1 -1
- package/dist/cjs/limel-form.cjs.entry.js +1 -1
- package/dist/cjs/limel-grid.cjs.entry.js +1 -1
- package/dist/cjs/limel-header.cjs.entry.js +1 -1
- package/dist/cjs/limel-help_2.cjs.entry.js +3 -3
- package/dist/cjs/limel-helper-line_3.cjs.entry.js +6 -5
- package/dist/cjs/limel-hotkey_4.cjs.entry.js +5 -5
- package/dist/cjs/limel-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-icon.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +2 -2
- package/dist/cjs/limel-list-item.cjs.entry.js +3 -3
- package/dist/cjs/limel-markdown.cjs.entry.js +4 -4
- package/dist/cjs/limel-masonry-layout.cjs.entry.js +1 -1
- package/dist/cjs/limel-menu-item-meta.cjs.entry.js +1 -1
- package/dist/cjs/limel-pagination-jump.cjs.entry.js +1 -1
- package/dist/cjs/limel-pagination.cjs.entry.js +2 -2
- package/dist/cjs/limel-picker.cjs.entry.js +51 -24
- package/dist/cjs/limel-popover_2.cjs.entry.js +4 -11
- package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +4 -4
- package/dist/cjs/limel-radio-button-group.cjs.entry.js +1 -1
- package/dist/cjs/limel-radio-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-resize-handle.cjs.entry.js +2 -2
- package/dist/cjs/limel-select.cjs.entry.js +1 -1
- package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
- package/dist/cjs/limel-side-panel.cjs.entry.js +2 -2
- package/dist/cjs/limel-slider.cjs.entry.js +4 -4
- package/dist/cjs/limel-snackbar.cjs.entry.js +3 -3
- package/dist/cjs/limel-split-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-switch.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-bar.cjs.entry.js +7 -150
- package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +3 -3
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +4 -4
- package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
- package/dist/cjs/live-message-BNl3Ihcz.js +65 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{markdown-exporter-VtX_2D1d.js → markdown-exporter-BWS2EBxq.js} +2 -2
- package/dist/cjs/{markdown-parser-BYtTHL4W.js → markdown-parser-toAp9-Eq.js} +1 -1
- package/dist/cjs/{translations-CLSqfR3x.js → translations-CqJEWcfw.js} +8 -0
- package/dist/collection/components/3d-hover-effect-glow/3d-hover-effect-glow.js +1 -1
- package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +1 -1
- package/dist/collection/components/action-bar/action-bar.js +2 -2
- package/dist/collection/components/ai-avatar/ai-avatar.js +1 -1
- package/dist/collection/components/badge/badge.js +2 -2
- package/dist/collection/components/banner/banner.js +1 -1
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/collection/components/button/button.js +2 -2
- package/dist/collection/components/button-group/button-group.js +1 -1
- package/dist/collection/components/callout/callout.js +1 -1
- package/dist/collection/components/card/card.js +1 -1
- package/dist/collection/components/chart/chart.css +63 -927
- package/dist/collection/components/chart/chart.js +330 -288
- package/dist/collection/components/chart/options.js +572 -0
- package/dist/collection/components/chart/scale.js +193 -0
- package/dist/collection/components/chart/theme.js +133 -0
- package/dist/collection/components/checkbox/checkbox.js +1 -1
- package/dist/collection/components/chip/chip.js +1 -1
- package/dist/collection/components/chip-set/chip-set.js +66 -3
- package/dist/collection/components/circular-progress/circular-progress.js +1 -1
- package/dist/collection/components/code-diff/code-diff.js +1 -1
- package/dist/collection/components/code-editor/code-editor.js +1 -1
- package/dist/collection/components/collapsible-section/collapsible-section.js +1 -1
- package/dist/collection/components/color-picker/color-picker-palette.js +2 -2
- package/dist/collection/components/color-picker/color-picker.js +1 -1
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +1 -1
- package/dist/collection/components/dialog/dialog.js +2 -2
- package/dist/collection/components/dock/dock.js +2 -2
- package/dist/collection/components/drag-handle/drag-handle.js +1 -1
- package/dist/collection/components/email-viewer/email-viewer.js +1 -1
- package/dist/collection/components/file/file.js +1 -1
- package/dist/collection/components/file-dropzone/file-dropzone.js +1 -1
- package/dist/collection/components/file-input/file-input.js +1 -1
- package/dist/collection/components/flex-container/flex-container.js +1 -1
- package/dist/collection/components/form/form.js +1 -1
- package/dist/collection/components/form-header/form-header.js +1 -1
- package/dist/collection/components/grid/grid.js +1 -1
- package/dist/collection/components/header/header.js +1 -1
- package/dist/collection/components/help/help-content.js +1 -1
- package/dist/collection/components/help/help.js +2 -2
- package/dist/collection/components/helper-line/helper-line.js +2 -2
- package/dist/collection/components/hotkey/hotkey.js +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon-button/icon-button.js +1 -1
- package/dist/collection/components/info-tile/info-tile.js +2 -2
- package/dist/collection/components/input-field/input-field.css +13 -0
- package/dist/collection/components/input-field/input-field.js +86 -5
- package/dist/collection/components/list/list-renderer.js +1 -1
- package/dist/collection/components/list/list.js +22 -1
- package/dist/collection/components/list-item/list-item.js +2 -2
- package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.js +1 -1
- package/dist/collection/components/markdown/markdown.js +1 -1
- package/dist/collection/components/masonry-layout/masonry-layout.js +1 -1
- package/dist/collection/components/menu/menu.js +1 -1
- package/dist/collection/components/menu-list/menu-list.js +1 -1
- package/dist/collection/components/menu-surface/menu-surface.js +1 -1
- package/dist/collection/components/notched-outline/notched-outline.js +1 -1
- package/dist/collection/components/pagination/pagination.js +1 -1
- package/dist/collection/components/picker/picker.css +112 -0
- package/dist/collection/components/picker/picker.js +49 -20
- package/dist/collection/components/popover/popover.js +3 -10
- package/dist/collection/components/popover-surface/popover-surface.js +1 -1
- package/dist/collection/components/portal/portal.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button.js +2 -2
- package/dist/collection/components/resize-handle/resize-handle.js +1 -1
- package/dist/collection/components/scroller/scroller.js +3 -3
- package/dist/collection/components/select/select.js +1 -1
- package/dist/collection/components/shortcut/shortcut.js +1 -1
- package/dist/collection/components/side-panel/side-panel.js +1 -1
- package/dist/collection/components/slider/slider.js +3 -3
- package/dist/collection/components/snackbar/snackbar.js +2 -2
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/split-button/split-button.js +2 -2
- package/dist/collection/components/switch/switch.js +1 -1
- package/dist/collection/components/tab-bar/tab-bar.js +1 -1
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/table/table.js +2 -2
- package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +3 -3
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +1 -1
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/tooltip/tooltip-content.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/translations/da.js +1 -0
- package/dist/collection/translations/de.js +1 -0
- package/dist/collection/translations/en.js +1 -0
- package/dist/collection/translations/fi.js +1 -0
- package/dist/collection/translations/fr.js +1 -0
- package/dist/collection/translations/nl.js +1 -0
- package/dist/collection/translations/no.js +1 -0
- package/dist/collection/translations/sv.js +1 -0
- package/dist/collection/util/controlled-element.js +22 -0
- package/dist/collection/util/live-message.js +30 -0
- package/dist/esm/controlled-element-ByOXsysp.js +24 -0
- package/dist/esm/{index-BN64nlbO.js → index-CofmbCdQ.js} +271 -71
- package/dist/esm/keyboard-navigation-BF7IKmnG.js +147 -0
- package/dist/esm/{keycodes-Bu6-QXrA.js → keycodes-DQ5DmW_Y.js} +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-3d-hover-effect-glow.entry.js +1 -1
- package/dist/esm/limel-action-bar_3.entry.js +4 -4
- package/dist/esm/limel-ai-avatar.entry.js +2 -2
- package/dist/esm/{limel-breadcrumbs_6.entry.js → limel-badge_7.entry.js} +100 -15
- package/dist/esm/limel-banner.entry.js +1 -1
- package/dist/esm/limel-button-group.entry.js +1 -1
- package/dist/esm/limel-button.entry.js +2 -2
- package/dist/esm/limel-callout.entry.js +2 -2
- package/dist/esm/limel-card.entry.js +1 -1
- package/dist/esm/limel-chart.entry.js +51363 -271
- package/dist/esm/limel-checkbox.entry.js +1 -1
- package/dist/esm/limel-chip-set.entry.js +24 -5
- package/dist/esm/limel-chip_2.entry.js +3 -3
- package/dist/esm/limel-circular-progress.entry.js +1 -1
- package/dist/esm/limel-code-diff.entry.js +2 -2
- package/dist/esm/limel-code-editor.entry.js +2 -2
- package/dist/esm/limel-collapsible-section.entry.js +2 -2
- package/dist/esm/limel-color-picker-palette.entry.js +2 -2
- package/dist/esm/limel-color-picker.entry.js +1 -1
- package/dist/esm/limel-dialog.entry.js +2 -2
- package/dist/esm/limel-dock.entry.js +3 -3
- package/dist/esm/limel-drag-handle_2.entry.js +4 -4
- package/dist/esm/limel-email-viewer.entry.js +2 -2
- package/dist/esm/limel-file-dropzone_2.entry.js +2 -2
- package/dist/esm/limel-file-viewer.entry.js +2 -2
- package/dist/esm/limel-file.entry.js +2 -2
- package/dist/esm/limel-flatpickr-adapter.entry.js +2 -2
- package/dist/esm/limel-flex-container.entry.js +1 -1
- package/dist/esm/limel-form-header.entry.js +1 -1
- package/dist/esm/limel-form.entry.js +1 -1
- package/dist/esm/limel-grid.entry.js +1 -1
- package/dist/esm/limel-header.entry.js +1 -1
- package/dist/esm/limel-help_2.entry.js +3 -3
- package/dist/esm/limel-helper-line_3.entry.js +6 -5
- package/dist/esm/limel-hotkey_4.entry.js +5 -5
- package/dist/esm/limel-icon-button.entry.js +1 -1
- package/dist/esm/limel-icon.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js +2 -2
- package/dist/esm/limel-list-item.entry.js +3 -3
- package/dist/esm/limel-markdown.entry.js +4 -4
- package/dist/esm/limel-masonry-layout.entry.js +1 -1
- package/dist/esm/limel-menu-item-meta.entry.js +1 -1
- package/dist/esm/limel-pagination-jump.entry.js +2 -2
- package/dist/esm/limel-pagination.entry.js +2 -2
- package/dist/esm/limel-picker.entry.js +52 -25
- package/dist/esm/limel-popover_2.entry.js +5 -12
- package/dist/esm/limel-profile-picture.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +4 -4
- package/dist/esm/limel-radio-button-group.entry.js +1 -1
- package/dist/esm/limel-radio-button.entry.js +2 -2
- package/dist/esm/limel-resize-handle.entry.js +3 -3
- package/dist/esm/limel-select.entry.js +3 -3
- package/dist/esm/limel-shortcut.entry.js +1 -1
- package/dist/esm/limel-side-panel.entry.js +3 -3
- package/dist/esm/limel-slider.entry.js +4 -4
- package/dist/esm/limel-snackbar.entry.js +3 -3
- package/dist/esm/limel-split-button.entry.js +2 -2
- package/dist/esm/limel-switch.entry.js +1 -1
- package/dist/esm/limel-tab-bar.entry.js +3 -146
- package/dist/esm/limel-tab-panel.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +3 -3
- package/dist/esm/limel-text-editor-link-menu.entry.js +5 -5
- package/dist/esm/limel-text-editor.entry.js +1 -1
- package/dist/esm/live-message-BQAYeNiX.js +62 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{markdown-exporter-tb8ft8Gq.js → markdown-exporter-B2vFxSLw.js} +2 -2
- package/dist/esm/{markdown-parser-DFP65EFu.js → markdown-parser-Cw8iW5R9.js} +1 -1
- package/dist/esm/{translations-Drl5LNAD.js → translations-kct5Kybu.js} +8 -0
- package/dist/esm/{typeahead-DOlnT3wh.js → typeahead-B4PwrlM3.js} +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-a608ebe3.entry.js → p-0319f07f.entry.js} +1 -1
- package/dist/lime-elements/{p-300f80e7.entry.js → p-07f3565b.entry.js} +1 -1
- package/dist/lime-elements/{p-a7a84633.entry.js → p-1a7d1d2b.entry.js} +1 -1
- package/dist/lime-elements/{p-f8566c5b.entry.js → p-1d9bc526.entry.js} +1 -1
- package/dist/lime-elements/{p-e0ab0046.entry.js → p-1e0ced6a.entry.js} +1 -1
- package/dist/lime-elements/{p-dd383c12.entry.js → p-22e9e327.entry.js} +1 -1
- package/dist/lime-elements/{p-65eafc85.entry.js → p-23067836.entry.js} +1 -1
- package/dist/lime-elements/{p-5f2a34ed.entry.js → p-28957b5c.entry.js} +1 -1
- package/dist/lime-elements/{p-3ae5fb67.entry.js → p-39d1e157.entry.js} +1 -1
- package/dist/lime-elements/{p-d0908a85.entry.js → p-3ac39bd5.entry.js} +2 -2
- package/dist/lime-elements/{p-7f1a1ed5.entry.js → p-3f7fa772.entry.js} +1 -1
- package/dist/lime-elements/{p-b80433be.entry.js → p-40940a6c.entry.js} +1 -1
- package/dist/lime-elements/{p-7235d147.entry.js → p-438fe49b.entry.js} +1 -1
- package/dist/lime-elements/{p-0c314c3c.entry.js → p-47fe76a8.entry.js} +1 -1
- package/dist/lime-elements/{p-22c44279.entry.js → p-48a412ed.entry.js} +1 -1
- package/dist/lime-elements/{p-eb5a18ff.entry.js → p-496b2437.entry.js} +1 -1
- package/dist/lime-elements/{p-5d9a2877.entry.js → p-4c080cd9.entry.js} +1 -1
- package/dist/lime-elements/{p-be0a8125.entry.js → p-54537c85.entry.js} +1 -1
- package/dist/lime-elements/{p-2c29c27f.entry.js → p-55fa19ae.entry.js} +1 -1
- package/dist/lime-elements/{p-fad7a3fa.entry.js → p-56e2fa48.entry.js} +1 -1
- package/dist/lime-elements/{p-da4b4a81.entry.js → p-5dce791c.entry.js} +1 -1
- package/dist/lime-elements/{p-67acf39d.entry.js → p-5e408c27.entry.js} +1 -1
- package/dist/lime-elements/{p-b983531f.entry.js → p-6053608a.entry.js} +1 -1
- package/dist/lime-elements/{p-164e1ad0.entry.js → p-6ae093c8.entry.js} +1 -1
- package/dist/lime-elements/{p-29815107.entry.js → p-6d2d25b9.entry.js} +1 -1
- package/dist/lime-elements/{p-9e30d206.entry.js → p-6d9b89db.entry.js} +1 -1
- package/dist/lime-elements/{p-be2b8c1e.entry.js → p-6e9eeb0a.entry.js} +1 -1
- package/dist/lime-elements/{p-68129487.entry.js → p-764d2f86.entry.js} +1 -1
- package/dist/lime-elements/{p-49a53f0b.entry.js → p-7ab726c2.entry.js} +1 -1
- package/dist/lime-elements/{p-cced022b.entry.js → p-7b87e547.entry.js} +1 -1
- package/dist/lime-elements/{p-586ee40c.entry.js → p-7d0ffc60.entry.js} +1 -1
- package/dist/lime-elements/p-7fcd48c6.entry.js +1 -0
- package/dist/lime-elements/{p-7d27d572.entry.js → p-814b4934.entry.js} +1 -1
- package/dist/lime-elements/p-8514480b.entry.js +56 -0
- package/dist/lime-elements/p-8d602078.entry.js +1 -0
- package/dist/lime-elements/p-8fe28845.entry.js +1 -0
- package/dist/lime-elements/{p-f35880ef.entry.js → p-909466b8.entry.js} +1 -1
- package/dist/lime-elements/{p-545c087b.entry.js → p-933ffaa8.entry.js} +1 -1
- package/dist/lime-elements/{p-cc8d6198.entry.js → p-95a486c8.entry.js} +1 -1
- package/dist/lime-elements/{p-565c85ac.entry.js → p-9b2623fe.entry.js} +1 -1
- package/dist/lime-elements/{p-C0wwdPYT.js → p-Bd37Vplf.js} +2 -2
- package/dist/lime-elements/p-ByOXsysp.js +1 -0
- package/dist/lime-elements/{p-_UXAljNc.js → p-CbPYnlF-.js} +1 -1
- package/dist/lime-elements/{p-Bgn2bikC.js → p-CvHpvp0f.js} +1 -1
- package/dist/lime-elements/p-Cw7VQSGU.js +1 -0
- package/dist/lime-elements/{p-fYs7n6yY.js → p-DNYOwOWu.js} +1 -1
- package/dist/lime-elements/{p-Bu6-QXrA.js → p-DQ5DmW_Y.js} +1 -1
- package/dist/lime-elements/p-Dzp8dXTo.js +1 -0
- package/dist/lime-elements/p-_1yBt1pG.js +1 -0
- package/dist/lime-elements/{p-565e5ea7.entry.js → p-a6387dc7.entry.js} +1 -1
- package/dist/lime-elements/{p-40a48f70.entry.js → p-a6c6a31b.entry.js} +1 -1
- package/dist/lime-elements/{p-e8255f0b.entry.js → p-a7be03e1.entry.js} +1 -1
- package/dist/lime-elements/p-a807a45f.entry.js +159 -0
- package/dist/lime-elements/{p-707d4b28.entry.js → p-bffb5ed2.entry.js} +1 -1
- package/dist/lime-elements/{p-7035d93d.entry.js → p-c0ebf7cc.entry.js} +1 -1
- package/dist/lime-elements/{p-7aae3d13.entry.js → p-c2056ebc.entry.js} +1 -1
- package/dist/lime-elements/{p-19681a98.entry.js → p-c2f993cc.entry.js} +1 -1
- package/dist/lime-elements/{p-c73f4160.entry.js → p-c61e9b83.entry.js} +1 -1
- package/dist/lime-elements/{p-519603f5.entry.js → p-c6b3448c.entry.js} +1 -1
- package/dist/lime-elements/p-c8a34cef.entry.js +1 -0
- package/dist/lime-elements/p-cd479c23.entry.js +1 -0
- package/dist/lime-elements/{p-153e91e1.entry.js → p-ce71c5b9.entry.js} +1 -1
- package/dist/lime-elements/p-cf2d43c7.entry.js +1 -0
- package/dist/lime-elements/{p-2a375a65.entry.js → p-d35d2859.entry.js} +1 -1
- package/dist/lime-elements/{p-26347009.entry.js → p-d3f13124.entry.js} +1 -1
- package/dist/lime-elements/{p-a2dc6645.entry.js → p-d8559847.entry.js} +1 -1
- package/dist/lime-elements/{p-c8f09dd5.entry.js → p-db9cb7ef.entry.js} +1 -1
- package/dist/lime-elements/{p-05c1f5a0.entry.js → p-e5abe390.entry.js} +1 -1
- package/dist/lime-elements/p-f036ad27.entry.js +1 -0
- package/dist/lime-elements/{p-c1678d3a.entry.js → p-f3b93ce8.entry.js} +2 -2
- package/dist/lime-elements/{p-2f5face5.entry.js → p-f59447bf.entry.js} +1 -1
- package/dist/lime-elements/{p-a81f6962.entry.js → p-f5bb17eb.entry.js} +1 -1
- package/dist/types/components/chart/chart.d.ts +51 -52
- package/dist/types/components/chart/chart.types.d.ts +5 -0
- package/dist/types/components/chart/options.d.ts +88 -0
- package/dist/types/components/chart/scale.d.ts +101 -0
- package/dist/types/components/chart/theme.d.ts +52 -0
- package/dist/types/components/chip-set/chip-set.d.ts +15 -0
- package/dist/types/components/input-field/input-field.d.ts +13 -0
- package/dist/types/components/list/list-renderer-config.d.ts +1 -0
- package/dist/types/components/list/list.d.ts +6 -0
- package/dist/types/components/picker/picker.d.ts +12 -5
- package/dist/types/components/popover/popover.d.ts +0 -1
- package/dist/types/components.d.ts +53 -38
- package/dist/types/translations/da.d.ts +1 -0
- package/dist/types/translations/de.d.ts +1 -0
- package/dist/types/translations/en.d.ts +1 -0
- package/dist/types/translations/fi.d.ts +1 -0
- package/dist/types/translations/fr.d.ts +1 -0
- package/dist/types/translations/nl.d.ts +1 -0
- package/dist/types/translations/no.d.ts +1 -0
- package/dist/types/translations/sv.d.ts +1 -0
- package/dist/types/util/controlled-element.d.ts +11 -0
- package/dist/types/util/live-message.d.ts +17 -0
- package/package.json +3 -2
- package/dist/cjs/dom-BWMDM6En.js +0 -32
- package/dist/cjs/limel-badge.cjs.entry.js +0 -37
- package/dist/esm/dom-B9Ofc5RB.js +0 -30
- package/dist/esm/limel-badge.entry.js +0 -35
- package/dist/lime-elements/p-513d2a5e.entry.js +0 -1
- package/dist/lime-elements/p-55abec82.entry.js +0 -1
- package/dist/lime-elements/p-55f7c9f5.entry.js +0 -1
- package/dist/lime-elements/p-70272ea2.entry.js +0 -1
- package/dist/lime-elements/p-813cb15c.entry.js +0 -1
- package/dist/lime-elements/p-895a68c5.entry.js +0 -1
- package/dist/lime-elements/p-93a2d3b3.entry.js +0 -159
- package/dist/lime-elements/p-9bbf2612.entry.js +0 -1
- package/dist/lime-elements/p-B26k4gw8.js +0 -1
- package/dist/lime-elements/p-B9Ofc5RB.js +0 -1
- package/dist/lime-elements/p-ea11f365.entry.js +0 -1
- package/dist/lime-elements/p-fdc7da58.entry.js +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Says that `owner` controls the element with the given id, for example the
|
|
3
|
+
* list that a field opens. An id only finds elements in the same DOM tree, so
|
|
4
|
+
* where the browser allows it, the element itself is referenced instead.
|
|
5
|
+
*
|
|
6
|
+
* @param owner - The element that controls the other one.
|
|
7
|
+
* @param id - The id of the controlled element, which may not exist yet.
|
|
8
|
+
* `null` says that nothing is controlled.
|
|
9
|
+
*/
|
|
10
|
+
export const setControlledElement = (owner, id) => {
|
|
11
|
+
if ('ariaControlsElements' in owner) {
|
|
12
|
+
// eslint-disable-next-line unicorn/prefer-query-selector
|
|
13
|
+
const controlled = id ? document.getElementById(id) : null;
|
|
14
|
+
owner.ariaControlsElements = controlled ? [controlled] : null;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (id) {
|
|
18
|
+
owner.setAttribute('aria-controls', id);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
owner.removeAttribute('aria-controls');
|
|
22
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { debounce } from "lodash-es";
|
|
2
|
+
const LIVE_MESSAGE_DELAY = 500;
|
|
3
|
+
/**
|
|
4
|
+
* Creates what a component needs to speak a message through a visually hidden
|
|
5
|
+
* element with `aria-live`. The text is written straight into that element
|
|
6
|
+
* and not through the state of the component, so speaking costs no render.
|
|
7
|
+
* It is written a short while after the last update, so that a screen reader
|
|
8
|
+
* does not read out every change while the user is typing.
|
|
9
|
+
*
|
|
10
|
+
* @param getMessage - Returns the text to speak. An empty text clears the
|
|
11
|
+
* element, so that the same message is spoken again the next time.
|
|
12
|
+
* @returns `setElement`, to be used as the `ref` of the live element, and
|
|
13
|
+
* `update`, to be called when the message may have changed.
|
|
14
|
+
*/
|
|
15
|
+
export const createLiveMessage = (getMessage) => {
|
|
16
|
+
let element;
|
|
17
|
+
const setElement = (liveElement) => {
|
|
18
|
+
element = liveElement;
|
|
19
|
+
};
|
|
20
|
+
const update = debounce(() => {
|
|
21
|
+
if (!element) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const message = getMessage();
|
|
25
|
+
if (element.textContent !== message) {
|
|
26
|
+
element.textContent = message;
|
|
27
|
+
}
|
|
28
|
+
}, LIVE_MESSAGE_DELAY);
|
|
29
|
+
return { setElement, update };
|
|
30
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Says that `owner` controls the element with the given id, for example the
|
|
3
|
+
* list that a field opens. An id only finds elements in the same DOM tree, so
|
|
4
|
+
* where the browser allows it, the element itself is referenced instead.
|
|
5
|
+
*
|
|
6
|
+
* @param owner - The element that controls the other one.
|
|
7
|
+
* @param id - The id of the controlled element, which may not exist yet.
|
|
8
|
+
* `null` says that nothing is controlled.
|
|
9
|
+
*/
|
|
10
|
+
const setControlledElement = (owner, id) => {
|
|
11
|
+
if ('ariaControlsElements' in owner) {
|
|
12
|
+
// eslint-disable-next-line unicorn/prefer-query-selector
|
|
13
|
+
const controlled = id ? document.getElementById(id) : null;
|
|
14
|
+
owner.ariaControlsElements = controlled ? [controlled] : null;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (id) {
|
|
18
|
+
owner.setAttribute('aria-controls', id);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
owner.removeAttribute('aria-controls');
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { setControlledElement as s };
|
|
@@ -214,7 +214,7 @@ function trough() {
|
|
|
214
214
|
|
|
215
215
|
// Next or done.
|
|
216
216
|
if (fn) {
|
|
217
|
-
wrap(fn, next)(...output);
|
|
217
|
+
wrap$1(fn, next)(...output);
|
|
218
218
|
} else {
|
|
219
219
|
callback(null, ...output);
|
|
220
220
|
}
|
|
@@ -242,7 +242,7 @@ function trough() {
|
|
|
242
242
|
* @param {Middleware} middleware
|
|
243
243
|
* @param {Callback} callback
|
|
244
244
|
*/
|
|
245
|
-
function wrap(middleware, callback) {
|
|
245
|
+
function wrap$1(middleware, callback) {
|
|
246
246
|
/** @type {boolean} */
|
|
247
247
|
let called;
|
|
248
248
|
|
|
@@ -19931,16 +19931,19 @@ function looksLikeANode(value) {
|
|
|
19931
19931
|
}
|
|
19932
19932
|
|
|
19933
19933
|
/**
|
|
19934
|
+
* Color a string.
|
|
19935
|
+
*
|
|
19934
19936
|
* @param {string} d
|
|
19937
|
+
* Value.
|
|
19935
19938
|
* @returns {string}
|
|
19939
|
+
* Colored value.
|
|
19936
19940
|
*/
|
|
19937
19941
|
function color(d) {
|
|
19938
19942
|
return d
|
|
19939
19943
|
}
|
|
19940
19944
|
|
|
19941
19945
|
/**
|
|
19942
|
-
* @
|
|
19943
|
-
* @typedef {import('unist').Parent} UnistParent
|
|
19946
|
+
* @import {Node as UnistNode, Parent as UnistParent} from 'unist'
|
|
19944
19947
|
*/
|
|
19945
19948
|
|
|
19946
19949
|
|
|
@@ -19959,6 +19962,7 @@ const EXIT = false;
|
|
|
19959
19962
|
|
|
19960
19963
|
/**
|
|
19961
19964
|
* Do not traverse this node’s children.
|
|
19965
|
+
* Only works when entering a node.
|
|
19962
19966
|
*/
|
|
19963
19967
|
const SKIP = 'skip';
|
|
19964
19968
|
|
|
@@ -19966,10 +19970,13 @@ const SKIP = 'skip';
|
|
|
19966
19970
|
* Visit nodes, with ancestral information.
|
|
19967
19971
|
*
|
|
19968
19972
|
* This algorithm performs *depth-first* *tree traversal* in *preorder*
|
|
19969
|
-
* (**NLR**) or if `reverse` is given,
|
|
19973
|
+
* (**NLR**) or if `reverse` is given,
|
|
19974
|
+
* in *reverse preorder* (**NRL**).
|
|
19975
|
+
* An `exit` visitor is called in *postorder* (**LRN**)
|
|
19976
|
+
* or if `reverse` is given, in *reverse postorder* (**RLN**).
|
|
19970
19977
|
*
|
|
19971
|
-
* You can choose
|
|
19972
|
-
* For complex tests, you should test yourself in
|
|
19978
|
+
* You can choose which nodes are visited by passing a `test`.
|
|
19979
|
+
* For complex tests, you should test yourself in a visitor, as it will be
|
|
19973
19980
|
* faster and will have improved type information.
|
|
19974
19981
|
*
|
|
19975
19982
|
* Walking the tree is an intensive task.
|
|
@@ -19978,29 +19985,72 @@ const SKIP = 'skip';
|
|
|
19978
19985
|
* to check if a node matches, and then perform different operations.
|
|
19979
19986
|
*
|
|
19980
19987
|
* You can change the tree.
|
|
19981
|
-
*
|
|
19988
|
+
* Changes inside a node made when entering it are walked,
|
|
19989
|
+
* changes made when exiting it are not.
|
|
19990
|
+
* See `Visitor` and `VisitorExit` for more info.
|
|
19982
19991
|
*
|
|
19983
19992
|
* @overload
|
|
19984
19993
|
* @param {Tree} tree
|
|
19994
|
+
* Tree to traverse.
|
|
19985
19995
|
* @param {Check} check
|
|
19986
|
-
*
|
|
19996
|
+
* `unist-util-is`-compatible test.
|
|
19997
|
+
* @param {BuildVisitor<Tree, Check>} enter
|
|
19998
|
+
* Handle each node when entering it.
|
|
19999
|
+
* @param {boolean | null | undefined} [reverse]
|
|
20000
|
+
* Walk children from last to first;
|
|
20001
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20002
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20003
|
+
* @returns {undefined}
|
|
20004
|
+
* Nothing.
|
|
20005
|
+
*
|
|
20006
|
+
* @overload
|
|
20007
|
+
* @param {Tree} tree
|
|
20008
|
+
* Tree to traverse.
|
|
20009
|
+
* @param {Check} check
|
|
20010
|
+
* `unist-util-is`-compatible test.
|
|
20011
|
+
* @param {BuildVisitors<Tree, Check>} visitors
|
|
20012
|
+
* Handle each node when exiting it, and optionally when entering it.
|
|
20013
|
+
* @param {boolean | null | undefined} [reverse]
|
|
20014
|
+
* Walk children from last to first;
|
|
20015
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20016
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20017
|
+
* @returns {undefined}
|
|
20018
|
+
* Nothing.
|
|
20019
|
+
*
|
|
20020
|
+
* @overload
|
|
20021
|
+
* @param {Tree} tree
|
|
20022
|
+
* Tree to traverse.
|
|
20023
|
+
* @param {BuildVisitor<Tree>} enter
|
|
20024
|
+
* Handle each node when entering it.
|
|
19987
20025
|
* @param {boolean | null | undefined} [reverse]
|
|
20026
|
+
* Walk children from last to first;
|
|
20027
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20028
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
19988
20029
|
* @returns {undefined}
|
|
20030
|
+
* Nothing.
|
|
19989
20031
|
*
|
|
19990
20032
|
* @overload
|
|
19991
20033
|
* @param {Tree} tree
|
|
19992
|
-
*
|
|
20034
|
+
* Tree to traverse.
|
|
20035
|
+
* @param {BuildVisitors<Tree>} visitors
|
|
20036
|
+
* Handle each node when exiting it, and optionally when entering it.
|
|
19993
20037
|
* @param {boolean | null | undefined} [reverse]
|
|
20038
|
+
* Walk children from last to first;
|
|
20039
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20040
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
19994
20041
|
* @returns {undefined}
|
|
20042
|
+
* Nothing.
|
|
19995
20043
|
*
|
|
19996
20044
|
* @param {UnistNode} tree
|
|
19997
20045
|
* Tree to traverse.
|
|
19998
|
-
* @param {Visitor | Test}
|
|
19999
|
-
* `unist-util-is`-compatible test
|
|
20000
|
-
* @param {Visitor | boolean | null | undefined} [
|
|
20001
|
-
*
|
|
20046
|
+
* @param {Visitor | Visitors | Test} testOrEnterOrVisitors
|
|
20047
|
+
* `unist-util-is`-compatible test, `enter`, or `visitors`.
|
|
20048
|
+
* @param {Visitor | Visitors | boolean | null | undefined} [enterOrVisitorsOrReverse]
|
|
20049
|
+
* `enter`, `visitors`, or `reverse` after a test.
|
|
20002
20050
|
* @param {boolean | null | undefined} [reverse]
|
|
20003
|
-
*
|
|
20051
|
+
* Walk children from last to first;
|
|
20052
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20053
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20004
20054
|
* @returns {undefined}
|
|
20005
20055
|
* Nothing.
|
|
20006
20056
|
*
|
|
@@ -20009,28 +20059,87 @@ const SKIP = 'skip';
|
|
|
20009
20059
|
* @template {Test} Check
|
|
20010
20060
|
* `unist-util-is`-compatible test.
|
|
20011
20061
|
*/
|
|
20012
|
-
function visitParents(
|
|
20062
|
+
function visitParents(
|
|
20063
|
+
tree,
|
|
20064
|
+
testOrEnterOrVisitors,
|
|
20065
|
+
enterOrVisitorsOrReverse,
|
|
20066
|
+
reverse
|
|
20067
|
+
) {
|
|
20068
|
+
if (!tree || typeof tree !== 'object') {
|
|
20069
|
+
throw new Error('Unexpected value `' + tree + '` for `tree`, expected node')
|
|
20070
|
+
}
|
|
20071
|
+
|
|
20072
|
+
let preorder = true;
|
|
20013
20073
|
/** @type {Test} */
|
|
20014
20074
|
let check;
|
|
20075
|
+
/** @type {Visitors | Visitor} */
|
|
20076
|
+
let visitors;
|
|
20077
|
+
/** @type {Visitor | null | undefined} */
|
|
20078
|
+
let enter;
|
|
20079
|
+
/** @type {VisitorExit | null | undefined} */
|
|
20080
|
+
let exit;
|
|
20081
|
+
|
|
20082
|
+
// Third parameter is an enter visitor or a visitors object, so expect a `test` too.
|
|
20083
|
+
if (
|
|
20084
|
+
typeof enterOrVisitorsOrReverse === 'function' ||
|
|
20085
|
+
(enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === 'object')
|
|
20086
|
+
) {
|
|
20087
|
+
check = /** @type {Test} */ (testOrEnterOrVisitors);
|
|
20088
|
+
visitors = enterOrVisitorsOrReverse;
|
|
20089
|
+
if (reverse) preorder = false;
|
|
20090
|
+
}
|
|
20091
|
+
// Assume no test.
|
|
20092
|
+
else {
|
|
20093
|
+
visitors = /** @type {Visitors | Visitor} */ (testOrEnterOrVisitors);
|
|
20094
|
+
if (enterOrVisitorsOrReverse) preorder = false;
|
|
20095
|
+
}
|
|
20096
|
+
|
|
20097
|
+
if (typeof visitors === 'function') {
|
|
20098
|
+
enter = visitors;
|
|
20099
|
+
} else if (visitors && typeof visitors === 'object') {
|
|
20100
|
+
if (visitors.enter === null || visitors.enter === undefined) ; else if (typeof visitors.enter === 'function') {
|
|
20101
|
+
enter = visitors.enter;
|
|
20102
|
+
} else {
|
|
20103
|
+
throw new Error(
|
|
20104
|
+
'Unexpected value `' +
|
|
20105
|
+
visitors.enter +
|
|
20106
|
+
'` for `visitors.enter`, expected optional visitor'
|
|
20107
|
+
)
|
|
20108
|
+
}
|
|
20015
20109
|
|
|
20016
|
-
|
|
20017
|
-
|
|
20018
|
-
|
|
20019
|
-
|
|
20110
|
+
if (typeof visitors.exit === 'function') {
|
|
20111
|
+
exit = visitors.exit;
|
|
20112
|
+
} else {
|
|
20113
|
+
throw new Error(
|
|
20114
|
+
'Unexpected value `' +
|
|
20115
|
+
visitors.exit +
|
|
20116
|
+
'` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)'
|
|
20117
|
+
)
|
|
20118
|
+
}
|
|
20020
20119
|
} else {
|
|
20021
|
-
|
|
20022
|
-
|
|
20120
|
+
throw new Error(
|
|
20121
|
+
'Unexpected value `' +
|
|
20122
|
+
visitors +
|
|
20123
|
+
'` for `enter` or `visitors`, expected visitor or object with visitors'
|
|
20124
|
+
)
|
|
20023
20125
|
}
|
|
20024
20126
|
|
|
20025
20127
|
const is = convert(check);
|
|
20026
|
-
const step =
|
|
20128
|
+
const step = preorder ? 1 : -1;
|
|
20027
20129
|
|
|
20028
20130
|
factory(tree, undefined, [])();
|
|
20029
20131
|
|
|
20030
20132
|
/**
|
|
20133
|
+
* Create a function to visit a node.
|
|
20134
|
+
*
|
|
20031
20135
|
* @param {UnistNode} node
|
|
20136
|
+
* Node to visit.
|
|
20032
20137
|
* @param {number | undefined} index
|
|
20138
|
+
* Index of `node` in its parent.
|
|
20033
20139
|
* @param {Array<UnistParent>} parents
|
|
20140
|
+
* Ancestors of `node`.
|
|
20141
|
+
* @returns {() => Readonly<ActionTuple>}
|
|
20142
|
+
* Visit `node`.
|
|
20034
20143
|
*/
|
|
20035
20144
|
function factory(node, index, parents) {
|
|
20036
20145
|
const value = /** @type {Record<string, unknown>} */ (
|
|
@@ -20043,9 +20152,9 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
20043
20152
|
typeof value.tagName === 'string'
|
|
20044
20153
|
? value.tagName
|
|
20045
20154
|
: // `xast`
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20155
|
+
typeof value.name === 'string'
|
|
20156
|
+
? value.name
|
|
20157
|
+
: undefined;
|
|
20049
20158
|
|
|
20050
20159
|
Object.defineProperty(visit, 'name', {
|
|
20051
20160
|
value:
|
|
@@ -20056,18 +20165,13 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
20056
20165
|
return visit
|
|
20057
20166
|
|
|
20058
20167
|
function visit() {
|
|
20168
|
+
const matches =
|
|
20169
|
+
!check || is(node, index, parents[parents.length - 1] || undefined);
|
|
20059
20170
|
/** @type {Readonly<ActionTuple>} */
|
|
20060
20171
|
let result = empty;
|
|
20061
|
-
/** @type {Readonly<ActionTuple>} */
|
|
20062
|
-
let subresult;
|
|
20063
|
-
/** @type {number} */
|
|
20064
|
-
let offset;
|
|
20065
|
-
/** @type {Array<UnistParent>} */
|
|
20066
|
-
let grandparents;
|
|
20067
20172
|
|
|
20068
|
-
if (
|
|
20069
|
-
|
|
20070
|
-
result = toResult(visitor(node, parents));
|
|
20173
|
+
if (enter && matches) {
|
|
20174
|
+
result = toResult(enter(node, parents, index));
|
|
20071
20175
|
|
|
20072
20176
|
if (result[0] === EXIT) {
|
|
20073
20177
|
return result
|
|
@@ -20078,13 +20182,13 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
20078
20182
|
const nodeAsParent = /** @type {UnistParent} */ (node);
|
|
20079
20183
|
|
|
20080
20184
|
if (nodeAsParent.children && result[0] !== SKIP) {
|
|
20081
|
-
offset = (
|
|
20082
|
-
grandparents = parents
|
|
20185
|
+
let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
|
|
20186
|
+
const grandparents = [...parents, nodeAsParent];
|
|
20083
20187
|
|
|
20084
20188
|
while (offset > -1 && offset < nodeAsParent.children.length) {
|
|
20085
20189
|
const child = nodeAsParent.children[offset];
|
|
20086
20190
|
|
|
20087
|
-
subresult = factory(child, offset, grandparents)();
|
|
20191
|
+
const subresult = factory(child, offset, grandparents)();
|
|
20088
20192
|
|
|
20089
20193
|
if (subresult[0] === EXIT) {
|
|
20090
20194
|
return subresult
|
|
@@ -20096,6 +20200,23 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
20096
20200
|
}
|
|
20097
20201
|
}
|
|
20098
20202
|
|
|
20203
|
+
if (exit && matches) {
|
|
20204
|
+
const exitResult = toResult(exit(node, parents, index));
|
|
20205
|
+
|
|
20206
|
+
if (exitResult[0] === SKIP) {
|
|
20207
|
+
throw new Error(
|
|
20208
|
+
'Unexpected value `' +
|
|
20209
|
+
exitResult[0] +
|
|
20210
|
+
'` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing'
|
|
20211
|
+
)
|
|
20212
|
+
}
|
|
20213
|
+
|
|
20214
|
+
// Prefer a result from `exit` over `enter`.
|
|
20215
|
+
if (exitResult[0] === EXIT || typeof exitResult[1] === 'number') {
|
|
20216
|
+
return exitResult
|
|
20217
|
+
}
|
|
20218
|
+
}
|
|
20219
|
+
|
|
20099
20220
|
return result
|
|
20100
20221
|
}
|
|
20101
20222
|
}
|
|
@@ -20123,7 +20244,13 @@ function toResult(value) {
|
|
|
20123
20244
|
|
|
20124
20245
|
/**
|
|
20125
20246
|
* @import {Node as UnistNode, Parent as UnistParent} from 'unist'
|
|
20126
|
-
* @import {
|
|
20247
|
+
* @import {
|
|
20248
|
+
* InclusiveDescendant,
|
|
20249
|
+
* Matches,
|
|
20250
|
+
* Visitors as ParentsVisitors,
|
|
20251
|
+
* VisitorResult,
|
|
20252
|
+
* VisitorResultExit
|
|
20253
|
+
* } from 'unist-util-visit-parents'
|
|
20127
20254
|
*/
|
|
20128
20255
|
|
|
20129
20256
|
|
|
@@ -20131,10 +20258,13 @@ function toResult(value) {
|
|
|
20131
20258
|
* Visit nodes.
|
|
20132
20259
|
*
|
|
20133
20260
|
* This algorithm performs *depth-first* *tree traversal* in *preorder*
|
|
20134
|
-
* (**NLR**) or if `reverse` is given,
|
|
20261
|
+
* (**NLR**) or if `reverse` is given,
|
|
20262
|
+
* in *reverse preorder* (**NRL**).
|
|
20263
|
+
* An `exit` visitor is called in *postorder* (**LRN**)
|
|
20264
|
+
* or if `reverse` is given, in *reverse postorder* (**RLN**).
|
|
20135
20265
|
*
|
|
20136
|
-
* You can choose
|
|
20137
|
-
* For complex tests, you should test yourself in
|
|
20266
|
+
* You can choose which nodes are visited by passing a `test`.
|
|
20267
|
+
* For complex tests, you should test yourself in a visitor, as it will be
|
|
20138
20268
|
* faster and will have improved type information.
|
|
20139
20269
|
*
|
|
20140
20270
|
* Walking the tree is an intensive task.
|
|
@@ -20143,29 +20273,48 @@ function toResult(value) {
|
|
|
20143
20273
|
* to check if a node matches, and then perform different operations.
|
|
20144
20274
|
*
|
|
20145
20275
|
* You can change the tree.
|
|
20146
|
-
*
|
|
20276
|
+
* Changes inside a node made when entering it are walked,
|
|
20277
|
+
* changes made when exiting it are not.
|
|
20278
|
+
* See `Visitor` and `VisitorExit` for more info.
|
|
20147
20279
|
*
|
|
20148
20280
|
* @overload
|
|
20149
20281
|
* @param {Tree} tree
|
|
20282
|
+
* Tree to traverse.
|
|
20150
20283
|
* @param {Check} check
|
|
20151
|
-
*
|
|
20284
|
+
* `unist-util-is`-compatible test.
|
|
20285
|
+
* @param {BuildVisitor<Tree, Check> | BuildVisitors<Tree, Check>} visitors
|
|
20286
|
+
* Handle each node when entering it,
|
|
20287
|
+
* or `{enter, exit}` to also handle it when exiting it.
|
|
20152
20288
|
* @param {boolean | null | undefined} [reverse]
|
|
20289
|
+
* Walk children from last to first;
|
|
20290
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20291
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20153
20292
|
* @returns {undefined}
|
|
20293
|
+
* Nothing.
|
|
20154
20294
|
*
|
|
20155
20295
|
* @overload
|
|
20156
20296
|
* @param {Tree} tree
|
|
20157
|
-
*
|
|
20297
|
+
* Tree to traverse.
|
|
20298
|
+
* @param {BuildVisitor<Tree> | BuildVisitors<Tree>} visitors
|
|
20299
|
+
* Handle each node when entering it,
|
|
20300
|
+
* or `{enter, exit}` to also handle it when exiting it.
|
|
20158
20301
|
* @param {boolean | null | undefined} [reverse]
|
|
20302
|
+
* Walk children from last to first;
|
|
20303
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20304
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20159
20305
|
* @returns {undefined}
|
|
20306
|
+
* Nothing.
|
|
20160
20307
|
*
|
|
20161
20308
|
* @param {UnistNode} tree
|
|
20162
20309
|
* Tree to traverse.
|
|
20163
|
-
* @param {Visitor | Test}
|
|
20164
|
-
* `unist-util-is`-compatible test
|
|
20165
|
-
* @param {Visitor | boolean | null | undefined} [
|
|
20166
|
-
*
|
|
20167
|
-
* @param {boolean | null | undefined} [maybeReverse
|
|
20168
|
-
*
|
|
20310
|
+
* @param {Visitor | Visitors | Test} testOrEnterOrVisitors
|
|
20311
|
+
* `unist-util-is`-compatible test, `enter`, or `visitors`.
|
|
20312
|
+
* @param {Visitor | Visitors | boolean | null | undefined} [enterOrVisitorsOrReverse]
|
|
20313
|
+
* `enter`, `visitors`, or `reverse` after a test.
|
|
20314
|
+
* @param {boolean | null | undefined} [maybeReverse]
|
|
20315
|
+
* Walk children from last to first;
|
|
20316
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20317
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20169
20318
|
* @returns {undefined}
|
|
20170
20319
|
* Nothing.
|
|
20171
20320
|
*
|
|
@@ -20174,39 +20323,90 @@ function toResult(value) {
|
|
|
20174
20323
|
* @template {Test} Check
|
|
20175
20324
|
* `unist-util-is`-compatible test.
|
|
20176
20325
|
*/
|
|
20177
|
-
function visit(
|
|
20326
|
+
function visit(
|
|
20327
|
+
tree,
|
|
20328
|
+
testOrEnterOrVisitors,
|
|
20329
|
+
enterOrVisitorsOrReverse,
|
|
20330
|
+
maybeReverse
|
|
20331
|
+
) {
|
|
20332
|
+
/** @type {Test} */
|
|
20333
|
+
let check;
|
|
20334
|
+
/** @type {Visitor | Visitors} */
|
|
20335
|
+
let visitors;
|
|
20178
20336
|
/** @type {boolean | null | undefined} */
|
|
20179
20337
|
let reverse;
|
|
20180
|
-
/** @type {Test} */
|
|
20181
|
-
let test;
|
|
20182
|
-
/** @type {Visitor} */
|
|
20183
|
-
let visitor;
|
|
20184
20338
|
|
|
20339
|
+
// Third parameter is an enter visitor or a visitors object, so expect a `test` too.
|
|
20185
20340
|
if (
|
|
20186
|
-
typeof
|
|
20187
|
-
typeof
|
|
20341
|
+
typeof enterOrVisitorsOrReverse === 'function' ||
|
|
20342
|
+
(enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === 'object')
|
|
20188
20343
|
) {
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
reverse = visitorOrReverse;
|
|
20192
|
-
} else {
|
|
20193
|
-
// @ts-expect-error: assume the overload with test was given.
|
|
20194
|
-
test = testOrVisitor;
|
|
20195
|
-
// @ts-expect-error: assume the overload with test was given.
|
|
20196
|
-
visitor = visitorOrReverse;
|
|
20344
|
+
check = /** @type {Test} */ (testOrEnterOrVisitors);
|
|
20345
|
+
visitors = enterOrVisitorsOrReverse;
|
|
20197
20346
|
reverse = maybeReverse;
|
|
20198
20347
|
}
|
|
20348
|
+
// Assume no test.
|
|
20349
|
+
else {
|
|
20350
|
+
visitors = /** @type {Visitor | Visitors} */ (testOrEnterOrVisitors);
|
|
20351
|
+
reverse = enterOrVisitorsOrReverse;
|
|
20352
|
+
}
|
|
20199
20353
|
|
|
20200
|
-
|
|
20354
|
+
if (typeof visitors === 'function') {
|
|
20355
|
+
visitParents(tree, check, wrap(visitors), reverse);
|
|
20356
|
+
} else {
|
|
20357
|
+
visitParents(tree, check, wrapVisitors(visitors), reverse);
|
|
20358
|
+
}
|
|
20359
|
+
}
|
|
20360
|
+
|
|
20361
|
+
/**
|
|
20362
|
+
* Turn `visit` visitors into `visitParents` visitors.
|
|
20363
|
+
*
|
|
20364
|
+
* @param {Visitors} visitors
|
|
20365
|
+
* Visitors for `visit`.
|
|
20366
|
+
* @returns {ParentsVisitors}
|
|
20367
|
+
* Visitors for `visitParents`.
|
|
20368
|
+
*/
|
|
20369
|
+
function wrapVisitors(visitors) {
|
|
20370
|
+
// Pass anything else straight to `visitParents` to get its errors.
|
|
20371
|
+
if (!visitors || typeof visitors !== 'object') return visitors
|
|
20372
|
+
|
|
20373
|
+
return {
|
|
20374
|
+
enter:
|
|
20375
|
+
typeof visitors.enter === 'function'
|
|
20376
|
+
? wrap(visitors.enter)
|
|
20377
|
+
: visitors.enter,
|
|
20378
|
+
exit:
|
|
20379
|
+
typeof visitors.exit === 'function' ? wrap(visitors.exit) : visitors.exit
|
|
20380
|
+
}
|
|
20381
|
+
}
|
|
20382
|
+
|
|
20383
|
+
/**
|
|
20384
|
+
* Turn a `visit` visitor into a `visitParents` one.
|
|
20385
|
+
*
|
|
20386
|
+
* @template {VisitorResult} Result
|
|
20387
|
+
* Result type.
|
|
20388
|
+
* @param {(node: UnistNode, index: number | undefined, parent: UnistParent | undefined) => Result} visitor
|
|
20389
|
+
* Visitor for `visit`.
|
|
20390
|
+
* @returns {(node: UnistNode, parents: Array<UnistParent>, index: number | undefined) => Result}
|
|
20391
|
+
* Visitor for `visitParents`.
|
|
20392
|
+
*/
|
|
20393
|
+
function wrap(visitor) {
|
|
20394
|
+
return overload
|
|
20201
20395
|
|
|
20202
20396
|
/**
|
|
20397
|
+
* Call `visitor` with `index` and `parent` instead of `parents`.
|
|
20398
|
+
*
|
|
20203
20399
|
* @param {UnistNode} node
|
|
20400
|
+
* Visited node.
|
|
20204
20401
|
* @param {Array<UnistParent>} parents
|
|
20402
|
+
* Ancestors of `node`.
|
|
20403
|
+
* @param {number | undefined} index
|
|
20404
|
+
* Index of `node` in its parent.
|
|
20405
|
+
* @returns {Result}
|
|
20406
|
+
* What to do next.
|
|
20205
20407
|
*/
|
|
20206
|
-
function overload(node, parents) {
|
|
20207
|
-
|
|
20208
|
-
const index = parent ? parent.children.indexOf(node) : undefined;
|
|
20209
|
-
return visitor(node, index, parent)
|
|
20408
|
+
function overload(node, parents, index) {
|
|
20409
|
+
return visitor(node, index, parents[parents.length - 1])
|
|
20210
20410
|
}
|
|
20211
20411
|
}
|
|
20212
20412
|
|