@limetech/lime-elements 40.18.3 → 40.19.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 +13 -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/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-badge.cjs.entry.js +2 -2
- package/dist/cjs/limel-banner.cjs.entry.js +1 -1
- package/dist/cjs/limel-breadcrumbs_6.cjs.entry.js +65 -12
- 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 +1 -1
- 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 +1 -1
- 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/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 +2 -2
- 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/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-badge.entry.js +2 -2
- package/dist/esm/limel-banner.entry.js +1 -1
- package/dist/esm/limel-breadcrumbs_6.entry.js +64 -11
- 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 +1 -1
- package/dist/esm/limel-checkbox.entry.js +1 -1
- package/dist/esm/limel-chip-set.entry.js +23 -4
- package/dist/esm/limel-chip_2.entry.js +2 -2
- 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 +1 -1
- package/dist/esm/limel-pagination.entry.js +2 -2
- package/dist/esm/limel-picker.entry.js +50 -23
- package/dist/esm/limel-popover_2.entry.js +4 -11
- 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 +2 -2
- package/dist/esm/limel-select.entry.js +1 -1
- package/dist/esm/limel-shortcut.entry.js +1 -1
- package/dist/esm/limel-side-panel.entry.js +2 -2
- 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 +1 -1
- 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 +4 -4
- 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/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-55f7c9f5.entry.js → p-02aac2c0.entry.js} +1 -1
- package/dist/lime-elements/{p-a608ebe3.entry.js → p-0319f07f.entry.js} +1 -1
- package/dist/lime-elements/{p-dd383c12.entry.js → p-0910aefc.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-5f2a34ed.entry.js → p-28957b5c.entry.js} +1 -1
- package/dist/lime-elements/{p-fdc7da58.entry.js → p-38ab193f.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-3ca188f6.entry.js +159 -0
- 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-45572e9d.entry.js +1 -0
- package/dist/lime-elements/{p-0c314c3c.entry.js → p-47fe76a8.entry.js} +1 -1
- package/dist/lime-elements/p-4834e7c1.entry.js +1 -0
- 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-da4b4a81.entry.js → p-5dce791c.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-65eafc85.entry.js → p-7bf3bf8a.entry.js} +1 -1
- package/dist/lime-elements/{p-586ee40c.entry.js → p-7d0ffc60.entry.js} +1 -1
- package/dist/lime-elements/{p-fad7a3fa.entry.js → p-7f0743d6.entry.js} +1 -1
- package/dist/lime-elements/{p-7d27d572.entry.js → p-814b4934.entry.js} +1 -1
- package/dist/lime-elements/p-843886fe.entry.js +1 -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-c1678d3a.entry.js → p-94ae27e2.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-Dzp8dXTo.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-67acf39d.entry.js → p-af7d07fd.entry.js} +1 -1
- 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-153e91e1.entry.js → p-ce71c5b9.entry.js} +1 -1
- 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-300f80e7.entry.js → p-d4702653.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-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/lime-elements/{p-9bbf2612.entry.js → p-f7a90228.entry.js} +1 -1
- 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 +46 -0
- 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 +2 -2
- package/dist/cjs/dom-BWMDM6En.js +0 -32
- package/dist/esm/dom-B9Ofc5RB.js +0 -30
- 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-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-B26k4gw8.js +0 -1
- package/dist/lime-elements/p-B9Ofc5RB.js +0 -1
- package/dist/lime-elements/p-ea11f365.entry.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [40.19.0](https://github.com/Lundalogik/lime-elements/compare/v40.18.3...v40.19.0) (2026-11-02)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
* **input-field:** speak the suggestions in the language it is given ([98051b9](https://github.com/Lundalogik/lime-elements/commit/98051b97e5457f647b218f099ad33334dff38a0a)), closes [#4467](https://github.com/Lundalogik/lime-elements/issues/4467)
|
|
7
|
+
* **list:** let the list be given a name ([8d3e563](https://github.com/Lundalogik/lime-elements/commit/8d3e5639575286261cf7ff4fd82f024c2cc9d1b6)), closes [#4467](https://github.com/Lundalogik/lime-elements/issues/4467)
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
* **input-field:** say that the input has suggestions, and how many ([86980c1](https://github.com/Lundalogik/lime-elements/commit/86980c173fbf9b1dccbab881fc6b3c69f352f2f4)), closes [#4467](https://github.com/Lundalogik/lime-elements/issues/4467)
|
|
12
|
+
* **picker:** say that the search has suggestions, and how many ([219c193](https://github.com/Lundalogik/lime-elements/commit/219c193e8897892a03d789a12b026bfadb3228c6)), closes [#4467](https://github.com/Lundalogik/lime-elements/issues/4467)
|
|
13
|
+
|
|
1
14
|
## [40.18.3](https://github.com/Lundalogik/lime-elements/compare/v40.18.2...v40.18.3) (2026-10-30)
|
|
2
15
|
|
|
3
16
|
### Bug Fixes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Says that `owner` controls the element with the given id, for example the
|
|
5
|
+
* list that a field opens. An id only finds elements in the same DOM tree, so
|
|
6
|
+
* where the browser allows it, the element itself is referenced instead.
|
|
7
|
+
*
|
|
8
|
+
* @param owner - The element that controls the other one.
|
|
9
|
+
* @param id - The id of the controlled element, which may not exist yet.
|
|
10
|
+
* `null` says that nothing is controlled.
|
|
11
|
+
*/
|
|
12
|
+
const setControlledElement = (owner, id) => {
|
|
13
|
+
if ('ariaControlsElements' in owner) {
|
|
14
|
+
// eslint-disable-next-line unicorn/prefer-query-selector
|
|
15
|
+
const controlled = id ? document.getElementById(id) : null;
|
|
16
|
+
owner.ariaControlsElements = controlled ? [controlled] : null;
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (id) {
|
|
20
|
+
owner.setAttribute('aria-controls', id);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
owner.removeAttribute('aria-controls');
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.setControlledElement = setControlledElement;
|
|
@@ -216,7 +216,7 @@ function trough() {
|
|
|
216
216
|
|
|
217
217
|
// Next or done.
|
|
218
218
|
if (fn) {
|
|
219
|
-
wrap(fn, next)(...output);
|
|
219
|
+
wrap$1(fn, next)(...output);
|
|
220
220
|
} else {
|
|
221
221
|
callback(null, ...output);
|
|
222
222
|
}
|
|
@@ -244,7 +244,7 @@ function trough() {
|
|
|
244
244
|
* @param {Middleware} middleware
|
|
245
245
|
* @param {Callback} callback
|
|
246
246
|
*/
|
|
247
|
-
function wrap(middleware, callback) {
|
|
247
|
+
function wrap$1(middleware, callback) {
|
|
248
248
|
/** @type {boolean} */
|
|
249
249
|
let called;
|
|
250
250
|
|
|
@@ -19933,16 +19933,19 @@ function looksLikeANode(value) {
|
|
|
19933
19933
|
}
|
|
19934
19934
|
|
|
19935
19935
|
/**
|
|
19936
|
+
* Color a string.
|
|
19937
|
+
*
|
|
19936
19938
|
* @param {string} d
|
|
19939
|
+
* Value.
|
|
19937
19940
|
* @returns {string}
|
|
19941
|
+
* Colored value.
|
|
19938
19942
|
*/
|
|
19939
19943
|
function color(d) {
|
|
19940
19944
|
return d
|
|
19941
19945
|
}
|
|
19942
19946
|
|
|
19943
19947
|
/**
|
|
19944
|
-
* @
|
|
19945
|
-
* @typedef {import('unist').Parent} UnistParent
|
|
19948
|
+
* @import {Node as UnistNode, Parent as UnistParent} from 'unist'
|
|
19946
19949
|
*/
|
|
19947
19950
|
|
|
19948
19951
|
|
|
@@ -19961,6 +19964,7 @@ const EXIT = false;
|
|
|
19961
19964
|
|
|
19962
19965
|
/**
|
|
19963
19966
|
* Do not traverse this node’s children.
|
|
19967
|
+
* Only works when entering a node.
|
|
19964
19968
|
*/
|
|
19965
19969
|
const SKIP = 'skip';
|
|
19966
19970
|
|
|
@@ -19968,10 +19972,13 @@ const SKIP = 'skip';
|
|
|
19968
19972
|
* Visit nodes, with ancestral information.
|
|
19969
19973
|
*
|
|
19970
19974
|
* This algorithm performs *depth-first* *tree traversal* in *preorder*
|
|
19971
|
-
* (**NLR**) or if `reverse` is given,
|
|
19975
|
+
* (**NLR**) or if `reverse` is given,
|
|
19976
|
+
* in *reverse preorder* (**NRL**).
|
|
19977
|
+
* An `exit` visitor is called in *postorder* (**LRN**)
|
|
19978
|
+
* or if `reverse` is given, in *reverse postorder* (**RLN**).
|
|
19972
19979
|
*
|
|
19973
|
-
* You can choose
|
|
19974
|
-
* For complex tests, you should test yourself in
|
|
19980
|
+
* You can choose which nodes are visited by passing a `test`.
|
|
19981
|
+
* For complex tests, you should test yourself in a visitor, as it will be
|
|
19975
19982
|
* faster and will have improved type information.
|
|
19976
19983
|
*
|
|
19977
19984
|
* Walking the tree is an intensive task.
|
|
@@ -19980,29 +19987,72 @@ const SKIP = 'skip';
|
|
|
19980
19987
|
* to check if a node matches, and then perform different operations.
|
|
19981
19988
|
*
|
|
19982
19989
|
* You can change the tree.
|
|
19983
|
-
*
|
|
19990
|
+
* Changes inside a node made when entering it are walked,
|
|
19991
|
+
* changes made when exiting it are not.
|
|
19992
|
+
* See `Visitor` and `VisitorExit` for more info.
|
|
19984
19993
|
*
|
|
19985
19994
|
* @overload
|
|
19986
19995
|
* @param {Tree} tree
|
|
19996
|
+
* Tree to traverse.
|
|
19987
19997
|
* @param {Check} check
|
|
19988
|
-
*
|
|
19998
|
+
* `unist-util-is`-compatible test.
|
|
19999
|
+
* @param {BuildVisitor<Tree, Check>} enter
|
|
20000
|
+
* Handle each node when entering it.
|
|
20001
|
+
* @param {boolean | null | undefined} [reverse]
|
|
20002
|
+
* Walk children from last to first;
|
|
20003
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20004
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20005
|
+
* @returns {undefined}
|
|
20006
|
+
* Nothing.
|
|
20007
|
+
*
|
|
20008
|
+
* @overload
|
|
20009
|
+
* @param {Tree} tree
|
|
20010
|
+
* Tree to traverse.
|
|
20011
|
+
* @param {Check} check
|
|
20012
|
+
* `unist-util-is`-compatible test.
|
|
20013
|
+
* @param {BuildVisitors<Tree, Check>} visitors
|
|
20014
|
+
* Handle each node when exiting it, and optionally when entering it.
|
|
20015
|
+
* @param {boolean | null | undefined} [reverse]
|
|
20016
|
+
* Walk children from last to first;
|
|
20017
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20018
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20019
|
+
* @returns {undefined}
|
|
20020
|
+
* Nothing.
|
|
20021
|
+
*
|
|
20022
|
+
* @overload
|
|
20023
|
+
* @param {Tree} tree
|
|
20024
|
+
* Tree to traverse.
|
|
20025
|
+
* @param {BuildVisitor<Tree>} enter
|
|
20026
|
+
* Handle each node when entering it.
|
|
19989
20027
|
* @param {boolean | null | undefined} [reverse]
|
|
20028
|
+
* Walk children from last to first;
|
|
20029
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20030
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
19990
20031
|
* @returns {undefined}
|
|
20032
|
+
* Nothing.
|
|
19991
20033
|
*
|
|
19992
20034
|
* @overload
|
|
19993
20035
|
* @param {Tree} tree
|
|
19994
|
-
*
|
|
20036
|
+
* Tree to traverse.
|
|
20037
|
+
* @param {BuildVisitors<Tree>} visitors
|
|
20038
|
+
* Handle each node when exiting it, and optionally when entering it.
|
|
19995
20039
|
* @param {boolean | null | undefined} [reverse]
|
|
20040
|
+
* Walk children from last to first;
|
|
20041
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20042
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
19996
20043
|
* @returns {undefined}
|
|
20044
|
+
* Nothing.
|
|
19997
20045
|
*
|
|
19998
20046
|
* @param {UnistNode} tree
|
|
19999
20047
|
* Tree to traverse.
|
|
20000
|
-
* @param {Visitor | Test}
|
|
20001
|
-
* `unist-util-is`-compatible test
|
|
20002
|
-
* @param {Visitor | boolean | null | undefined} [
|
|
20003
|
-
*
|
|
20048
|
+
* @param {Visitor | Visitors | Test} testOrEnterOrVisitors
|
|
20049
|
+
* `unist-util-is`-compatible test, `enter`, or `visitors`.
|
|
20050
|
+
* @param {Visitor | Visitors | boolean | null | undefined} [enterOrVisitorsOrReverse]
|
|
20051
|
+
* `enter`, `visitors`, or `reverse` after a test.
|
|
20004
20052
|
* @param {boolean | null | undefined} [reverse]
|
|
20005
|
-
*
|
|
20053
|
+
* Walk children from last to first;
|
|
20054
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20055
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20006
20056
|
* @returns {undefined}
|
|
20007
20057
|
* Nothing.
|
|
20008
20058
|
*
|
|
@@ -20011,28 +20061,87 @@ const SKIP = 'skip';
|
|
|
20011
20061
|
* @template {Test} Check
|
|
20012
20062
|
* `unist-util-is`-compatible test.
|
|
20013
20063
|
*/
|
|
20014
|
-
function visitParents(
|
|
20064
|
+
function visitParents(
|
|
20065
|
+
tree,
|
|
20066
|
+
testOrEnterOrVisitors,
|
|
20067
|
+
enterOrVisitorsOrReverse,
|
|
20068
|
+
reverse
|
|
20069
|
+
) {
|
|
20070
|
+
if (!tree || typeof tree !== 'object') {
|
|
20071
|
+
throw new Error('Unexpected value `' + tree + '` for `tree`, expected node')
|
|
20072
|
+
}
|
|
20073
|
+
|
|
20074
|
+
let preorder = true;
|
|
20015
20075
|
/** @type {Test} */
|
|
20016
20076
|
let check;
|
|
20077
|
+
/** @type {Visitors | Visitor} */
|
|
20078
|
+
let visitors;
|
|
20079
|
+
/** @type {Visitor | null | undefined} */
|
|
20080
|
+
let enter;
|
|
20081
|
+
/** @type {VisitorExit | null | undefined} */
|
|
20082
|
+
let exit;
|
|
20083
|
+
|
|
20084
|
+
// Third parameter is an enter visitor or a visitors object, so expect a `test` too.
|
|
20085
|
+
if (
|
|
20086
|
+
typeof enterOrVisitorsOrReverse === 'function' ||
|
|
20087
|
+
(enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === 'object')
|
|
20088
|
+
) {
|
|
20089
|
+
check = /** @type {Test} */ (testOrEnterOrVisitors);
|
|
20090
|
+
visitors = enterOrVisitorsOrReverse;
|
|
20091
|
+
if (reverse) preorder = false;
|
|
20092
|
+
}
|
|
20093
|
+
// Assume no test.
|
|
20094
|
+
else {
|
|
20095
|
+
visitors = /** @type {Visitors | Visitor} */ (testOrEnterOrVisitors);
|
|
20096
|
+
if (enterOrVisitorsOrReverse) preorder = false;
|
|
20097
|
+
}
|
|
20098
|
+
|
|
20099
|
+
if (typeof visitors === 'function') {
|
|
20100
|
+
enter = visitors;
|
|
20101
|
+
} else if (visitors && typeof visitors === 'object') {
|
|
20102
|
+
if (visitors.enter === null || visitors.enter === undefined) ; else if (typeof visitors.enter === 'function') {
|
|
20103
|
+
enter = visitors.enter;
|
|
20104
|
+
} else {
|
|
20105
|
+
throw new Error(
|
|
20106
|
+
'Unexpected value `' +
|
|
20107
|
+
visitors.enter +
|
|
20108
|
+
'` for `visitors.enter`, expected optional visitor'
|
|
20109
|
+
)
|
|
20110
|
+
}
|
|
20017
20111
|
|
|
20018
|
-
|
|
20019
|
-
|
|
20020
|
-
|
|
20021
|
-
|
|
20112
|
+
if (typeof visitors.exit === 'function') {
|
|
20113
|
+
exit = visitors.exit;
|
|
20114
|
+
} else {
|
|
20115
|
+
throw new Error(
|
|
20116
|
+
'Unexpected value `' +
|
|
20117
|
+
visitors.exit +
|
|
20118
|
+
'` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)'
|
|
20119
|
+
)
|
|
20120
|
+
}
|
|
20022
20121
|
} else {
|
|
20023
|
-
|
|
20024
|
-
|
|
20122
|
+
throw new Error(
|
|
20123
|
+
'Unexpected value `' +
|
|
20124
|
+
visitors +
|
|
20125
|
+
'` for `enter` or `visitors`, expected visitor or object with visitors'
|
|
20126
|
+
)
|
|
20025
20127
|
}
|
|
20026
20128
|
|
|
20027
20129
|
const is = convert(check);
|
|
20028
|
-
const step =
|
|
20130
|
+
const step = preorder ? 1 : -1;
|
|
20029
20131
|
|
|
20030
20132
|
factory(tree, undefined, [])();
|
|
20031
20133
|
|
|
20032
20134
|
/**
|
|
20135
|
+
* Create a function to visit a node.
|
|
20136
|
+
*
|
|
20033
20137
|
* @param {UnistNode} node
|
|
20138
|
+
* Node to visit.
|
|
20034
20139
|
* @param {number | undefined} index
|
|
20140
|
+
* Index of `node` in its parent.
|
|
20035
20141
|
* @param {Array<UnistParent>} parents
|
|
20142
|
+
* Ancestors of `node`.
|
|
20143
|
+
* @returns {() => Readonly<ActionTuple>}
|
|
20144
|
+
* Visit `node`.
|
|
20036
20145
|
*/
|
|
20037
20146
|
function factory(node, index, parents) {
|
|
20038
20147
|
const value = /** @type {Record<string, unknown>} */ (
|
|
@@ -20045,9 +20154,9 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
20045
20154
|
typeof value.tagName === 'string'
|
|
20046
20155
|
? value.tagName
|
|
20047
20156
|
: // `xast`
|
|
20048
|
-
|
|
20049
|
-
|
|
20050
|
-
|
|
20157
|
+
typeof value.name === 'string'
|
|
20158
|
+
? value.name
|
|
20159
|
+
: undefined;
|
|
20051
20160
|
|
|
20052
20161
|
Object.defineProperty(visit, 'name', {
|
|
20053
20162
|
value:
|
|
@@ -20058,18 +20167,13 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
20058
20167
|
return visit
|
|
20059
20168
|
|
|
20060
20169
|
function visit() {
|
|
20170
|
+
const matches =
|
|
20171
|
+
!check || is(node, index, parents[parents.length - 1] || undefined);
|
|
20061
20172
|
/** @type {Readonly<ActionTuple>} */
|
|
20062
20173
|
let result = empty;
|
|
20063
|
-
/** @type {Readonly<ActionTuple>} */
|
|
20064
|
-
let subresult;
|
|
20065
|
-
/** @type {number} */
|
|
20066
|
-
let offset;
|
|
20067
|
-
/** @type {Array<UnistParent>} */
|
|
20068
|
-
let grandparents;
|
|
20069
20174
|
|
|
20070
|
-
if (
|
|
20071
|
-
|
|
20072
|
-
result = toResult(visitor(node, parents));
|
|
20175
|
+
if (enter && matches) {
|
|
20176
|
+
result = toResult(enter(node, parents, index));
|
|
20073
20177
|
|
|
20074
20178
|
if (result[0] === EXIT) {
|
|
20075
20179
|
return result
|
|
@@ -20080,13 +20184,13 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
20080
20184
|
const nodeAsParent = /** @type {UnistParent} */ (node);
|
|
20081
20185
|
|
|
20082
20186
|
if (nodeAsParent.children && result[0] !== SKIP) {
|
|
20083
|
-
offset = (
|
|
20084
|
-
grandparents = parents
|
|
20187
|
+
let offset = (preorder ? -1 : nodeAsParent.children.length) + step;
|
|
20188
|
+
const grandparents = [...parents, nodeAsParent];
|
|
20085
20189
|
|
|
20086
20190
|
while (offset > -1 && offset < nodeAsParent.children.length) {
|
|
20087
20191
|
const child = nodeAsParent.children[offset];
|
|
20088
20192
|
|
|
20089
|
-
subresult = factory(child, offset, grandparents)();
|
|
20193
|
+
const subresult = factory(child, offset, grandparents)();
|
|
20090
20194
|
|
|
20091
20195
|
if (subresult[0] === EXIT) {
|
|
20092
20196
|
return subresult
|
|
@@ -20098,6 +20202,23 @@ function visitParents(tree, test, visitor, reverse) {
|
|
|
20098
20202
|
}
|
|
20099
20203
|
}
|
|
20100
20204
|
|
|
20205
|
+
if (exit && matches) {
|
|
20206
|
+
const exitResult = toResult(exit(node, parents, index));
|
|
20207
|
+
|
|
20208
|
+
if (exitResult[0] === SKIP) {
|
|
20209
|
+
throw new Error(
|
|
20210
|
+
'Unexpected value `' +
|
|
20211
|
+
exitResult[0] +
|
|
20212
|
+
'` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing'
|
|
20213
|
+
)
|
|
20214
|
+
}
|
|
20215
|
+
|
|
20216
|
+
// Prefer a result from `exit` over `enter`.
|
|
20217
|
+
if (exitResult[0] === EXIT || typeof exitResult[1] === 'number') {
|
|
20218
|
+
return exitResult
|
|
20219
|
+
}
|
|
20220
|
+
}
|
|
20221
|
+
|
|
20101
20222
|
return result
|
|
20102
20223
|
}
|
|
20103
20224
|
}
|
|
@@ -20125,7 +20246,13 @@ function toResult(value) {
|
|
|
20125
20246
|
|
|
20126
20247
|
/**
|
|
20127
20248
|
* @import {Node as UnistNode, Parent as UnistParent} from 'unist'
|
|
20128
|
-
* @import {
|
|
20249
|
+
* @import {
|
|
20250
|
+
* InclusiveDescendant,
|
|
20251
|
+
* Matches,
|
|
20252
|
+
* Visitors as ParentsVisitors,
|
|
20253
|
+
* VisitorResult,
|
|
20254
|
+
* VisitorResultExit
|
|
20255
|
+
* } from 'unist-util-visit-parents'
|
|
20129
20256
|
*/
|
|
20130
20257
|
|
|
20131
20258
|
|
|
@@ -20133,10 +20260,13 @@ function toResult(value) {
|
|
|
20133
20260
|
* Visit nodes.
|
|
20134
20261
|
*
|
|
20135
20262
|
* This algorithm performs *depth-first* *tree traversal* in *preorder*
|
|
20136
|
-
* (**NLR**) or if `reverse` is given,
|
|
20263
|
+
* (**NLR**) or if `reverse` is given,
|
|
20264
|
+
* in *reverse preorder* (**NRL**).
|
|
20265
|
+
* An `exit` visitor is called in *postorder* (**LRN**)
|
|
20266
|
+
* or if `reverse` is given, in *reverse postorder* (**RLN**).
|
|
20137
20267
|
*
|
|
20138
|
-
* You can choose
|
|
20139
|
-
* For complex tests, you should test yourself in
|
|
20268
|
+
* You can choose which nodes are visited by passing a `test`.
|
|
20269
|
+
* For complex tests, you should test yourself in a visitor, as it will be
|
|
20140
20270
|
* faster and will have improved type information.
|
|
20141
20271
|
*
|
|
20142
20272
|
* Walking the tree is an intensive task.
|
|
@@ -20145,29 +20275,48 @@ function toResult(value) {
|
|
|
20145
20275
|
* to check if a node matches, and then perform different operations.
|
|
20146
20276
|
*
|
|
20147
20277
|
* You can change the tree.
|
|
20148
|
-
*
|
|
20278
|
+
* Changes inside a node made when entering it are walked,
|
|
20279
|
+
* changes made when exiting it are not.
|
|
20280
|
+
* See `Visitor` and `VisitorExit` for more info.
|
|
20149
20281
|
*
|
|
20150
20282
|
* @overload
|
|
20151
20283
|
* @param {Tree} tree
|
|
20284
|
+
* Tree to traverse.
|
|
20152
20285
|
* @param {Check} check
|
|
20153
|
-
*
|
|
20286
|
+
* `unist-util-is`-compatible test.
|
|
20287
|
+
* @param {BuildVisitor<Tree, Check> | BuildVisitors<Tree, Check>} visitors
|
|
20288
|
+
* Handle each node when entering it,
|
|
20289
|
+
* or `{enter, exit}` to also handle it when exiting it.
|
|
20154
20290
|
* @param {boolean | null | undefined} [reverse]
|
|
20291
|
+
* Walk children from last to first;
|
|
20292
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20293
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20155
20294
|
* @returns {undefined}
|
|
20295
|
+
* Nothing.
|
|
20156
20296
|
*
|
|
20157
20297
|
* @overload
|
|
20158
20298
|
* @param {Tree} tree
|
|
20159
|
-
*
|
|
20299
|
+
* Tree to traverse.
|
|
20300
|
+
* @param {BuildVisitor<Tree> | BuildVisitors<Tree>} visitors
|
|
20301
|
+
* Handle each node when entering it,
|
|
20302
|
+
* or `{enter, exit}` to also handle it when exiting it.
|
|
20160
20303
|
* @param {boolean | null | undefined} [reverse]
|
|
20304
|
+
* Walk children from last to first;
|
|
20305
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20306
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20161
20307
|
* @returns {undefined}
|
|
20308
|
+
* Nothing.
|
|
20162
20309
|
*
|
|
20163
20310
|
* @param {UnistNode} tree
|
|
20164
20311
|
* Tree to traverse.
|
|
20165
|
-
* @param {Visitor | Test}
|
|
20166
|
-
* `unist-util-is`-compatible test
|
|
20167
|
-
* @param {Visitor | boolean | null | undefined} [
|
|
20168
|
-
*
|
|
20169
|
-
* @param {boolean | null | undefined} [maybeReverse
|
|
20170
|
-
*
|
|
20312
|
+
* @param {Visitor | Visitors | Test} testOrEnterOrVisitors
|
|
20313
|
+
* `unist-util-is`-compatible test, `enter`, or `visitors`.
|
|
20314
|
+
* @param {Visitor | Visitors | boolean | null | undefined} [enterOrVisitorsOrReverse]
|
|
20315
|
+
* `enter`, `visitors`, or `reverse` after a test.
|
|
20316
|
+
* @param {boolean | null | undefined} [maybeReverse]
|
|
20317
|
+
* Walk children from last to first;
|
|
20318
|
+
* for `enter`, reverse preorder (NRL) instead of preorder (NLR);
|
|
20319
|
+
* for `exit`, reverse postorder (RLN) instead of postorder (LRN).
|
|
20171
20320
|
* @returns {undefined}
|
|
20172
20321
|
* Nothing.
|
|
20173
20322
|
*
|
|
@@ -20176,39 +20325,90 @@ function toResult(value) {
|
|
|
20176
20325
|
* @template {Test} Check
|
|
20177
20326
|
* `unist-util-is`-compatible test.
|
|
20178
20327
|
*/
|
|
20179
|
-
function visit(
|
|
20328
|
+
function visit(
|
|
20329
|
+
tree,
|
|
20330
|
+
testOrEnterOrVisitors,
|
|
20331
|
+
enterOrVisitorsOrReverse,
|
|
20332
|
+
maybeReverse
|
|
20333
|
+
) {
|
|
20334
|
+
/** @type {Test} */
|
|
20335
|
+
let check;
|
|
20336
|
+
/** @type {Visitor | Visitors} */
|
|
20337
|
+
let visitors;
|
|
20180
20338
|
/** @type {boolean | null | undefined} */
|
|
20181
20339
|
let reverse;
|
|
20182
|
-
/** @type {Test} */
|
|
20183
|
-
let test;
|
|
20184
|
-
/** @type {Visitor} */
|
|
20185
|
-
let visitor;
|
|
20186
20340
|
|
|
20341
|
+
// Third parameter is an enter visitor or a visitors object, so expect a `test` too.
|
|
20187
20342
|
if (
|
|
20188
|
-
typeof
|
|
20189
|
-
typeof
|
|
20343
|
+
typeof enterOrVisitorsOrReverse === 'function' ||
|
|
20344
|
+
(enterOrVisitorsOrReverse && typeof enterOrVisitorsOrReverse === 'object')
|
|
20190
20345
|
) {
|
|
20191
|
-
|
|
20192
|
-
|
|
20193
|
-
reverse = visitorOrReverse;
|
|
20194
|
-
} else {
|
|
20195
|
-
// @ts-expect-error: assume the overload with test was given.
|
|
20196
|
-
test = testOrVisitor;
|
|
20197
|
-
// @ts-expect-error: assume the overload with test was given.
|
|
20198
|
-
visitor = visitorOrReverse;
|
|
20346
|
+
check = /** @type {Test} */ (testOrEnterOrVisitors);
|
|
20347
|
+
visitors = enterOrVisitorsOrReverse;
|
|
20199
20348
|
reverse = maybeReverse;
|
|
20200
20349
|
}
|
|
20350
|
+
// Assume no test.
|
|
20351
|
+
else {
|
|
20352
|
+
visitors = /** @type {Visitor | Visitors} */ (testOrEnterOrVisitors);
|
|
20353
|
+
reverse = enterOrVisitorsOrReverse;
|
|
20354
|
+
}
|
|
20201
20355
|
|
|
20202
|
-
|
|
20356
|
+
if (typeof visitors === 'function') {
|
|
20357
|
+
visitParents(tree, check, wrap(visitors), reverse);
|
|
20358
|
+
} else {
|
|
20359
|
+
visitParents(tree, check, wrapVisitors(visitors), reverse);
|
|
20360
|
+
}
|
|
20361
|
+
}
|
|
20362
|
+
|
|
20363
|
+
/**
|
|
20364
|
+
* Turn `visit` visitors into `visitParents` visitors.
|
|
20365
|
+
*
|
|
20366
|
+
* @param {Visitors} visitors
|
|
20367
|
+
* Visitors for `visit`.
|
|
20368
|
+
* @returns {ParentsVisitors}
|
|
20369
|
+
* Visitors for `visitParents`.
|
|
20370
|
+
*/
|
|
20371
|
+
function wrapVisitors(visitors) {
|
|
20372
|
+
// Pass anything else straight to `visitParents` to get its errors.
|
|
20373
|
+
if (!visitors || typeof visitors !== 'object') return visitors
|
|
20374
|
+
|
|
20375
|
+
return {
|
|
20376
|
+
enter:
|
|
20377
|
+
typeof visitors.enter === 'function'
|
|
20378
|
+
? wrap(visitors.enter)
|
|
20379
|
+
: visitors.enter,
|
|
20380
|
+
exit:
|
|
20381
|
+
typeof visitors.exit === 'function' ? wrap(visitors.exit) : visitors.exit
|
|
20382
|
+
}
|
|
20383
|
+
}
|
|
20384
|
+
|
|
20385
|
+
/**
|
|
20386
|
+
* Turn a `visit` visitor into a `visitParents` one.
|
|
20387
|
+
*
|
|
20388
|
+
* @template {VisitorResult} Result
|
|
20389
|
+
* Result type.
|
|
20390
|
+
* @param {(node: UnistNode, index: number | undefined, parent: UnistParent | undefined) => Result} visitor
|
|
20391
|
+
* Visitor for `visit`.
|
|
20392
|
+
* @returns {(node: UnistNode, parents: Array<UnistParent>, index: number | undefined) => Result}
|
|
20393
|
+
* Visitor for `visitParents`.
|
|
20394
|
+
*/
|
|
20395
|
+
function wrap(visitor) {
|
|
20396
|
+
return overload
|
|
20203
20397
|
|
|
20204
20398
|
/**
|
|
20399
|
+
* Call `visitor` with `index` and `parent` instead of `parents`.
|
|
20400
|
+
*
|
|
20205
20401
|
* @param {UnistNode} node
|
|
20402
|
+
* Visited node.
|
|
20206
20403
|
* @param {Array<UnistParent>} parents
|
|
20404
|
+
* Ancestors of `node`.
|
|
20405
|
+
* @param {number | undefined} index
|
|
20406
|
+
* Index of `node` in its parent.
|
|
20407
|
+
* @returns {Result}
|
|
20408
|
+
* What to do next.
|
|
20207
20409
|
*/
|
|
20208
|
-
function overload(node, parents) {
|
|
20209
|
-
|
|
20210
|
-
const index = parent ? parent.children.indexOf(node) : undefined;
|
|
20211
|
-
return visitor(node, index, parent)
|
|
20410
|
+
function overload(node, parents, index) {
|
|
20411
|
+
return visitor(node, index, parents[parents.length - 1])
|
|
20212
20412
|
}
|
|
20213
20413
|
}
|
|
20214
20414
|
|