@lostgradient/cinder 0.19.0 → 0.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 +334 -0
- package/README.md +6 -3
- package/components.json +219 -121
- package/dist/_internal/anchored-overlay.svelte.d.ts +11 -1
- package/dist/_internal/date-value.d.ts +22 -0
- package/dist/_internal/form-field-context.d.ts +1 -1
- package/dist/_internal/form-field-frame.svelte.d.ts +43 -0
- package/dist/_internal/form-field-provider.svelte.d.ts +9 -0
- package/dist/_internal/overlay.d.ts +2 -1
- package/dist/_internal/text-direction-container.d.ts +14 -0
- package/dist/_internal/text-direction-css.d.ts +7 -0
- package/dist/_internal/text-direction.d.ts +6 -1
- package/dist/_internal/tree-autoscroll.svelte.d.ts +27 -0
- package/dist/_internal/tree-filter.svelte.d.ts +37 -0
- package/dist/cli/index.js +63 -414
- package/dist/cli/knowledge.js +391 -0
- package/dist/components/_internal/chart-data-table.svelte.d.ts +15 -0
- package/dist/components/_internal/checkbox-indicator-shell.svelte.d.ts +8 -0
- package/dist/components/_internal/create-command-list-state.svelte.d.ts +24 -2
- package/dist/components/_internal/person-byline.css +29 -0
- package/dist/components/_internal/person-byline.svelte.d.ts +9 -0
- package/dist/components/_internal/section-skeleton.css +45 -0
- package/dist/components/_radio/radio.types.d.ts +1 -1
- package/dist/components/access-gate/access-gate.css +55 -6
- package/dist/components/access-gate/index.js +681 -427
- package/dist/components/accordion-item/accordion-item.css +8 -6
- package/dist/components/alert/alert.schema.js +2 -2
- package/dist/components/alert/alert.types.d.ts +1 -1
- package/dist/components/alert/index.js +3 -3
- package/dist/components/alert-dialog/alert-dialog.schema.js +3 -3
- package/dist/components/alert-dialog/alert-dialog.svelte.d.ts +1 -1
- package/dist/components/alert-dialog/alert-dialog.types.d.ts +2 -2
- package/dist/components/alert-dialog/index.js +294 -13
- package/dist/components/approval-card/approval-card.css +6 -2
- package/dist/components/approval-card/approval-card.schema.js +6 -4
- package/dist/components/approval-card/approval-card.types.d.ts +4 -4
- package/dist/components/approval-card/index.js +2307 -1351
- package/dist/components/area-chart/area-chart.css +4 -3
- package/dist/components/area-chart/area-chart.svelte.d.ts +1 -1
- package/dist/components/area-chart/index.d.ts +1 -0
- package/dist/components/area-chart/index.js +1000 -391
- package/dist/components/autocomplete/autocomplete.css +2 -49
- package/dist/components/autocomplete/autocomplete.schema.js +2 -2
- package/dist/components/autocomplete/autocomplete.types.d.ts +3 -3
- package/dist/components/autocomplete/index.js +1672 -551
- package/dist/components/avatar/avatar.css +0 -2
- package/dist/components/avatar/avatar.schema.js +6 -11
- package/dist/components/avatar/avatar.types.d.ts +1 -1
- package/dist/components/avatar-group/avatar-group.css +3 -1
- package/dist/components/avatar-group/index.js +1142 -319
- package/dist/components/backdrop/backdrop.schema.js +3 -3
- package/dist/components/backdrop/backdrop.types.d.ts +2 -2
- package/dist/components/backdrop/index.js +18 -6
- package/dist/components/badge/badge.css +2 -2
- package/dist/components/badge/badge.schema.js +2 -2
- package/dist/components/badge/badge.types.d.ts +3 -3
- package/dist/components/badge/index.js +296 -77
- package/dist/components/banner/banner.schema.js +6 -4
- package/dist/components/banner/banner.types.d.ts +3 -3
- package/dist/components/banner/index.js +3 -3
- package/dist/components/bar-chart/bar-chart.css +4 -3
- package/dist/components/bar-chart/bar-chart.svelte.d.ts +1 -1
- package/dist/components/bar-chart/index.d.ts +1 -0
- package/dist/components/bar-chart/index.js +982 -377
- package/dist/components/bento-cell/bento-cell.schema.js +103 -3
- package/dist/components/bento-cell/bento-cell.types.d.ts +3 -2
- package/dist/components/bento-cell/index.js +3 -3
- package/dist/components/bento-grid/bento-grid.css +7 -17
- package/dist/components/bento-grid/bento-grid.schema.js +104 -4
- package/dist/components/bento-grid/bento-grid.types.d.ts +4 -3
- package/dist/components/bento-grid/index.js +44 -98
- package/dist/components/blog-section/blog-section.css +4 -47
- package/dist/components/blog-section/index.js +139 -242
- package/dist/components/breadcrumbs/breadcrumbs.types.d.ts +2 -1
- package/dist/components/breadcrumbs/index.js +14 -10
- package/dist/components/button/button.css +2 -2
- package/dist/components/button/index.js +5 -5
- package/dist/components/button-group/button-group.schema.js +3 -2
- package/dist/components/button-group/button-group.svelte.d.ts +13 -0
- package/dist/components/button-group/button-group.types.d.ts +1 -1
- package/dist/components/button-group/index.js +4 -5
- package/dist/components/calendar/calendar.schema.js +9 -5
- package/dist/components/calendar/calendar.types.d.ts +4 -4
- package/dist/components/calendar/index.js +104 -46
- package/dist/components/{cta-section/cta-section.css → call-to-action-section/call-to-action-section.css} +11 -11
- package/dist/components/{cta-section/cta-section.schema.js → call-to-action-section/call-to-action-section.schema.js} +5 -5
- package/dist/components/{cta-section/cta-section.svelte.d.ts → call-to-action-section/call-to-action-section.svelte.d.ts} +5 -5
- package/dist/components/{cta-section/cta-section.types.d.ts → call-to-action-section/call-to-action-section.types.d.ts} +23 -11
- package/dist/components/{floating-action-button/floating-action-button.variables.js → call-to-action-section/call-to-action-section.variables.js} +4 -4
- package/dist/components/call-to-action-section/index.d.ts +5 -0
- package/dist/components/{cta-section → call-to-action-section}/index.js +20 -18
- package/dist/components/callout/callout.css +5 -0
- package/dist/components/capability-gate/capability-gate.schema.js +4 -4
- package/dist/components/capability-gate/capability-gate.types.d.ts +9 -6
- package/dist/components/capability-gate/index.js +8 -8
- package/dist/components/card/card.css +25 -7
- package/dist/components/card/card.schema.js +7 -7
- package/dist/components/card/card.svelte.d.ts +2 -2
- package/dist/components/card/card.types.d.ts +4 -3
- package/dist/components/card/index.js +2 -2
- package/dist/components/carousel/carousel.css +45 -5
- package/dist/components/carousel/index.js +585 -265
- package/dist/components/checkbox/checkbox.css +62 -28
- package/dist/components/checkbox/checkbox.schema.js +7 -7
- package/dist/components/checkbox/checkbox.types.d.ts +4 -4
- package/dist/components/checkbox/index.js +409 -101
- package/dist/components/checkbox-group/checkbox-group.css +6 -8
- package/dist/components/checkbox-group/checkbox-group.types.d.ts +2 -1
- package/dist/components/checkbox-group/index.js +31 -16
- package/dist/components/chip/chip.schema.js +3 -3
- package/dist/components/chip/chip.types.d.ts +6 -6
- package/dist/components/chip/index.js +7 -7
- package/dist/components/choice-grid/choice-grid.css +2 -9
- package/dist/components/choice-grid/choice-grid.schema.js +5 -6
- package/dist/components/choice-grid/choice-grid.types.d.ts +1 -22
- package/dist/components/choice-grid/index.js +41 -19
- package/dist/components/choice-grid-item/choice-grid-item.svelte.d.ts +1 -1
- package/dist/components/click-away-listener/click-away-listener.schema.js +3 -3
- package/dist/components/click-away-listener/click-away-listener.types.d.ts +3 -3
- package/dist/components/click-away-listener/index.js +3 -3
- package/dist/components/code-block/code-block.css +1 -0
- package/dist/components/code-block/code-block.schema.js +2 -2
- package/dist/components/code-block/code-block.types.d.ts +1 -1
- package/dist/components/code-block/index.js +11 -7
- package/dist/components/collapsible/collapsible.css +16 -8
- package/dist/components/collapsible/collapsible.schema.js +2 -2
- package/dist/components/collapsible/collapsible.types.d.ts +1 -1
- package/dist/components/collapsible/index.js +3 -3
- package/dist/components/color-field/color-field.css +2 -0
- package/dist/components/color-field/color-field.schema.js +2 -6
- package/dist/components/color-field/color-field.svelte.d.ts +1 -1
- package/dist/components/color-field/color-field.types.d.ts +2 -5
- package/dist/components/color-field/index.js +763 -338
- package/dist/components/color-picker/color-picker.schema.js +1 -5
- package/dist/components/color-picker/color-picker.types.d.ts +0 -2
- package/dist/components/color-picker/index.js +16 -28
- package/dist/components/color-swatch-picker/color-swatch-picker.schema.js +2 -6
- package/dist/components/color-swatch-picker/color-swatch-picker.svelte.d.ts +1 -1
- package/dist/components/color-swatch-picker/color-swatch-picker.types.d.ts +1 -3
- package/dist/components/color-swatch-picker/index.js +5 -6
- package/dist/components/combobox/combobox.css +16 -17
- package/dist/components/combobox/combobox.schema.js +3 -3
- package/dist/components/combobox/combobox.svelte.d.ts +2 -2
- package/dist/components/combobox/combobox.types.d.ts +3 -3
- package/dist/components/combobox/index.js +2342 -593
- package/dist/components/command-item/command-item.schema.js +3 -3
- package/dist/components/command-item/command-item.types.d.ts +13 -5
- package/dist/components/command-item/index.js +4 -4
- package/dist/components/command-menu/command-menu-inline-completion.svelte.d.ts +89 -0
- package/dist/components/command-menu/command-menu.css +28 -10
- package/dist/components/command-menu/command-menu.schema.js +14 -6
- package/dist/components/command-menu/command-menu.svelte.d.ts +1 -1
- package/dist/components/command-menu/command-menu.types.d.ts +33 -5
- package/dist/components/command-menu/index.d.ts +1 -1
- package/dist/components/command-menu/index.js +2754 -249
- package/dist/components/command-palette/command-palette.css +4 -2
- package/dist/components/command-palette/command-palette.schema.js +3 -3
- package/dist/components/command-palette/command-palette.types.d.ts +2 -2
- package/dist/components/command-palette/index.js +325 -6
- package/dist/components/confirm-dialog/confirm-dialog.schema.js +3 -3
- package/dist/components/confirm-dialog/confirm-dialog.svelte.d.ts +1 -1
- package/dist/components/confirm-dialog/confirm-dialog.types.d.ts +2 -2
- package/dist/components/confirm-dialog/index.js +1011 -301
- package/dist/components/connection-indicator/connection-indicator.css +2 -2
- package/dist/components/container/container.schema.js +4 -4
- package/dist/components/context-menu/context-menu.schema.js +2 -2
- package/dist/components/context-menu/context-menu.types.d.ts +1 -1
- package/dist/components/context-menu/index.js +2734 -482
- package/dist/components/copy-button/copy-button.schema.js +6 -1
- package/dist/components/copy-button/copy-button.types.d.ts +2 -0
- package/dist/components/copy-button/index.js +16 -3
- package/dist/components/data-grid/_internal/geometry.d.ts +3 -5
- package/dist/components/data-grid/_internal/selection-model-test-support.svelte.d.ts +4 -0
- package/dist/components/data-grid/_internal/selection-model.svelte.d.ts +4 -2
- package/dist/components/data-grid/data-grid.css +5 -2
- package/dist/components/data-grid/data-grid.schema.js +3 -3
- package/dist/components/data-grid/data-grid.types.d.ts +2 -2
- package/dist/components/data-grid/index.js +53 -33
- package/dist/components/data-table/data-table.svelte.d.ts +1 -1
- package/dist/components/data-table/index.js +781 -462
- package/dist/components/date-picker/date-picker.css +7 -2
- package/dist/components/date-picker/date-picker.schema.js +5 -1
- package/dist/components/date-picker/date-picker.svelte.d.ts +1 -1
- package/dist/components/date-picker/date-picker.types.d.ts +2 -0
- package/dist/components/date-picker/index.js +2205 -636
- package/dist/components/date-range-field/date-range-field.css +0 -11
- package/dist/components/date-range-field/date-range-field.schema.js +3 -2
- package/dist/components/date-range-field/date-range-field.types.d.ts +10 -13
- package/dist/components/date-range-field/index.js +2306 -835
- package/dist/components/diff-statistics/diff-statistics.css +1 -1
- package/dist/components/diff-statistics/index.js +17 -1
- package/dist/components/drawer/drawer.css +14 -9
- package/dist/components/drawer/index.js +282 -1
- package/dist/components/dropdown/dropdown.css +1 -1
- package/dist/components/dropdown/index.js +2556 -579
- package/dist/components/dropdown-item/index.js +2 -2
- package/dist/components/dropdown-menu/index.js +2244 -273
- package/dist/components/dropdown-trigger/dropdown-trigger.schema.js +2 -2
- package/dist/components/dropdown-trigger/dropdown-trigger.types.d.ts +1 -1
- package/dist/components/dropdown-trigger/index.js +12 -6
- package/dist/components/event-stream-viewer/event-stream-viewer.css +8 -7
- package/dist/components/event-stream-viewer/event-stream-viewer.schema.js +4 -4
- package/dist/components/event-stream-viewer/event-stream-viewer.svelte.d.ts +2 -1
- package/dist/components/event-stream-viewer/event-stream-viewer.types.d.ts +6 -6
- package/dist/components/event-stream-viewer/index.js +749 -634
- package/dist/components/event-timeline/event-timeline-modal.d.ts +5 -0
- package/dist/components/event-timeline/event-timeline.css +189 -5
- package/dist/components/event-timeline/event-timeline.svelte.d.ts +4 -2
- package/dist/components/event-timeline/index.js +3775 -111
- package/dist/components/faceted-filter-bar/faceted-filter-bar.css +1 -1
- package/dist/components/faceted-filter-bar/faceted-filter-bar.schema.js +6 -6
- package/dist/components/faceted-filter-bar/faceted-filter-bar.types.d.ts +5 -5
- package/dist/components/faceted-filter-bar/index.js +146 -156
- package/dist/components/feature-section/feature-section.css +18 -3
- package/dist/components/feature-section/feature-section.types.d.ts +7 -2
- package/dist/components/feature-section/index.js +3 -3
- package/dist/components/feed/feed.svelte.d.ts +4 -2
- package/dist/components/file-upload/file-upload.schema.js +6 -7
- package/dist/components/file-upload/file-upload.types.d.ts +2 -2
- package/dist/components/file-upload/index.js +3 -3
- package/dist/components/{floating-action-button/floating-action-button.css → floating-action/floating-action.css} +61 -49
- package/dist/components/{floating-action-button/floating-action-button.schema.js → floating-action/floating-action.schema.js} +7 -7
- package/dist/components/{floating-action-button/floating-action-button.svelte.d.ts → floating-action/floating-action.svelte.d.ts} +5 -5
- package/dist/components/{floating-action-button/floating-action-button.types.d.ts → floating-action/floating-action.types.d.ts} +25 -25
- package/dist/components/{stats-section/stats-section.variables.js → floating-action/floating-action.variables.js} +4 -4
- package/dist/components/floating-action/index.d.ts +5 -0
- package/dist/components/{floating-action-button → floating-action}/index.js +18 -18
- package/dist/components/focus-trap/index.js +282 -1
- package/dist/components/footer/footer.css +17 -5
- package/dist/components/form-field/form-field.schema.js +7 -3
- package/dist/components/form-field/form-field.types.d.ts +8 -6
- package/dist/components/form-field/index.js +272 -69
- package/dist/components/form-section/form-section.schema.js +2 -2
- package/dist/components/grid/grid.css +21 -0
- package/dist/components/grid/grid.schema.js +108 -2
- package/dist/components/grid/grid.types.d.ts +12 -5
- package/dist/components/grid/index.js +4 -2
- package/dist/components/grid-item/grid-item.schema.js +92 -2
- package/dist/components/grid-item/grid-item.types.d.ts +2 -1
- package/dist/components/grid-list/grid-list.css +2 -11
- package/dist/components/grid-list/grid-list.types.d.ts +1 -1
- package/dist/components/grid-list/grid-list.variables.js +2 -2
- package/dist/components/grid-list/index.js +24 -14
- package/dist/components/hero-section/hero-section.css +88 -5
- package/dist/components/hero-section/hero-section.svelte.d.ts +2 -2
- package/dist/components/hero-section/index.js +119 -70
- package/dist/components/hover-card/hover-card.css +4 -4
- package/dist/components/hover-card/hover-card.schema.js +11 -7
- package/dist/components/hover-card/hover-card.types.d.ts +6 -6
- package/dist/components/hover-card/index.js +1050 -224
- package/dist/components/image/image.schema.js +7 -8
- package/dist/components/image/image.types.d.ts +3 -3
- package/dist/components/image/index.js +5 -5
- package/dist/components/input/index.js +600 -171
- package/dist/components/input/input.css +10 -8
- package/dist/components/input/input.schema.js +18 -4
- package/dist/components/input/input.types.d.ts +13 -4
- package/dist/components/invocation-rule-builder/index.js +2905 -1052
- package/dist/components/invocation-rule-builder/invocation-rule-builder.css +5 -5
- package/dist/components/json-editor/index.js +441 -147
- package/dist/components/json-editor/json-editor.css +35 -4
- package/dist/components/json-editor/json-editor.schema.js +8 -5
- package/dist/components/json-editor/json-editor.types.d.ts +4 -4
- package/dist/components/json-schema-editor/form-view.svelte.d.ts +1 -1
- package/dist/components/json-schema-editor/index.js +3891 -2332
- package/dist/components/json-schema-editor/json-schema-editor-impl.svelte.d.ts +2 -2
- package/dist/components/json-schema-editor/json-schema-editor-state.types.d.ts +2 -2
- package/dist/components/json-schema-editor/json-schema-editor.css +7 -9
- package/dist/components/json-schema-editor/json-schema-editor.schema.js +3 -3
- package/dist/components/json-schema-editor/json-schema-editor.svelte.d.ts +1 -0
- package/dist/components/json-schema-editor/json-schema-editor.types.d.ts +2 -2
- package/dist/components/json-schema-editor/property-editor.svelte.d.ts +1 -1
- package/dist/components/json-schema-editor/property-list.svelte.d.ts +1 -1
- package/dist/components/json-viewer/json-viewer.css +1 -1
- package/dist/components/kanban-board/index.js +673 -527
- package/dist/components/kanban-board/kanban-board-column-reorder.svelte.d.ts +30 -0
- package/dist/components/kanban-board/kanban-board-helpers.d.ts +18 -0
- package/dist/components/kanban-board/kanban-board.css +22 -11
- package/dist/components/kanban-board/kanban-board.schema.js +5 -3
- package/dist/components/kanban-board/kanban-board.types.d.ts +2 -2
- package/dist/components/kanban-board/kanban-board.variables.js +2 -1
- package/dist/components/keyboard-shortcuts/index.js +8 -8
- package/dist/components/keyboard-shortcuts/keyboard-shortcuts.css +2 -1
- package/dist/components/label/label.schema.js +5 -6
- package/dist/components/label/label.types.d.ts +1 -1
- package/dist/components/line-chart/index.d.ts +1 -0
- package/dist/components/line-chart/index.js +1020 -411
- package/dist/components/line-chart/line-chart.css +4 -3
- package/dist/components/line-chart/line-chart.svelte.d.ts +1 -1
- package/dist/components/load-more/index.js +71 -18
- package/dist/components/load-more/load-more.schema.js +12 -8
- package/dist/components/load-more/load-more.types.d.ts +7 -7
- package/dist/components/locale-provider/locale-provider.svelte.d.ts +1 -1
- package/dist/components/logo-cloud/index.js +46 -35
- package/dist/components/logo-cloud/logo-cloud.css +6 -23
- package/dist/components/logo-cloud/logo-cloud.variables.js +2 -2
- package/dist/components/marquee/index.js +16 -3
- package/dist/components/matrix-chart/index.d.ts +1 -0
- package/dist/components/matrix-chart/index.js +819 -262
- package/dist/components/matrix-chart/matrix-chart.css +1 -0
- package/dist/components/matrix-chart/matrix-chart.schema.js +12 -7
- package/dist/components/matrix-chart/matrix-chart.types.d.ts +7 -7
- package/dist/components/media-controls/index.js +7 -8
- package/dist/components/media-controls/media-controls.css +2 -2
- package/dist/components/media-controls/media-controls.schema.js +4 -4
- package/dist/components/media-controls/media-controls.types.d.ts +6 -6
- package/dist/components/mega-menu/index.js +2041 -318
- package/dist/components/mega-menu/mega-menu-content.svelte.d.ts +16 -0
- package/dist/components/mega-menu/mega-menu.css +24 -5
- package/dist/components/mega-menu/mega-menu.schema.js +15 -7
- package/dist/components/mega-menu/mega-menu.types.d.ts +9 -7
- package/dist/components/menu-bar/index.js +2949 -864
- package/dist/components/menu-bar/menu-bar.css +8 -2
- package/dist/components/menu-bar/menu-bar.schema.js +3 -2
- package/dist/components/menu-bar/menu-bar.types.d.ts +1 -1
- package/dist/components/meter/index.js +36 -18
- package/dist/components/meter/meter.svelte.d.ts +1 -1
- package/dist/components/meter/meter.types.d.ts +2 -1
- package/dist/components/modal/index.js +287 -6
- package/dist/components/modal/modal.css +17 -11
- package/dist/components/modal/modal.schema.js +3 -3
- package/dist/components/modal/modal.types.d.ts +2 -2
- package/dist/components/multi-select/index.js +1071 -486
- package/dist/components/multi-select/multi-select.css +73 -12
- package/dist/components/multi-select/multi-select.schema.js +2 -2
- package/dist/components/multi-select/multi-select.types.d.ts +1 -1
- package/dist/components/navigation-bar/index.js +3743 -91
- package/dist/components/navigation-bar/navigation-bar-focus.d.ts +16 -0
- package/dist/components/navigation-bar/navigation-bar.css +93 -48
- package/dist/components/navigation-bar/navigation-bar.schema.js +4 -3
- package/dist/components/navigation-bar/navigation-bar.types.d.ts +5 -3
- package/dist/components/navigation-item/index.js +2 -2
- package/dist/components/newsletter-section/index.js +663 -234
- package/dist/components/newsletter-section/newsletter-section.css +1 -1
- package/dist/components/newsletter-section/newsletter-section.svelte.d.ts +2 -2
- package/dist/components/number-input/index.js +341 -294
- package/dist/components/number-input/number-input.css +10 -58
- package/dist/components/number-input/number-input.schema.js +10 -16
- package/dist/components/number-input/number-input.types.d.ts +5 -3
- package/dist/components/page-header/index.js +83 -29
- package/dist/components/page-header/page-header.css +18 -9
- package/dist/components/page-header/page-header.schema.js +10 -5
- package/dist/components/page-header/page-header.svelte.d.ts +2 -2
- package/dist/components/page-header/page-header.types.d.ts +21 -7
- package/dist/components/payload-inspector/index.js +632 -476
- package/dist/components/payload-inspector/payload-inspector.css +2 -2
- package/dist/components/permission-matrix/index.js +3 -5
- package/dist/components/permission-matrix/permission-matrix.css +7 -4
- package/dist/components/permission-matrix/permission-matrix.svelte.d.ts +24 -3
- package/dist/components/phone-input/index.js +172 -76
- package/dist/components/phone-input/phone-input.css +36 -55
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/popover/index.js +1387 -240
- package/dist/components/popover/popover.css +9 -9
- package/dist/components/popover/popover.schema.js +16 -2
- package/dist/components/popover/popover.types.d.ts +7 -1
- package/dist/components/portal/index.d.ts +1 -1
- package/dist/components/portal/index.js +830 -57
- package/dist/components/portal/portal.utilities.svelte.d.ts +31 -1
- package/dist/components/pricing-card/index.js +7 -7
- package/dist/components/pricing-card/pricing-card.css +1 -1
- package/dist/components/pricing-card/pricing-card.schema.js +2 -2
- package/dist/components/pricing-card/pricing-card.svelte.d.ts +2 -2
- package/dist/components/pricing-card/pricing-card.types.d.ts +1 -1
- package/dist/components/pricing-section/index.js +8 -8
- package/dist/components/pricing-section/pricing-section.svelte.d.ts +2 -2
- package/dist/components/radio-group/index.js +406 -124
- package/dist/components/radio-group/radio-group.css +42 -15
- package/dist/components/rating/index.js +69 -57
- package/dist/components/resizable-panels/index.d.ts +1 -1
- package/dist/components/resizable-panels/index.js +11 -9
- package/dist/components/resizable-panels/resizable-panels.schema.js +3 -3
- package/dist/components/resizable-panels/resizable-panels.types.d.ts +4 -4
- package/dist/components/run-step-timeline/index.js +818 -597
- package/dist/components/schedule-builder/index.js +1765 -1260
- package/dist/components/schema-form/index.js +1955 -1317
- package/dist/components/schema-form/schema-form-body.svelte.d.ts +3 -24
- package/dist/components/schema-form/schema-form-state.svelte.d.ts +74 -0
- package/dist/components/schema-form/schema-form.schema.js +3 -3
- package/dist/components/schema-form/schema-form.svelte.d.ts +3 -24
- package/dist/components/schema-form/schema-form.types.d.ts +3 -3
- package/dist/components/search-field/index.js +95 -104
- package/dist/components/search-field/search-field.css +3 -85
- package/dist/components/search-field/search-field.schema.js +7 -12
- package/dist/components/search-field/search-field.svelte.d.ts +1 -1
- package/dist/components/search-field/search-field.types.d.ts +4 -7
- package/dist/components/secret-value-field/index.js +324 -123
- package/dist/components/secret-value-field/secret-value-field.schema.js +3 -3
- package/dist/components/secret-value-field/secret-value-field.types.d.ts +2 -2
- package/dist/components/segment/index.d.ts +1 -1
- package/dist/components/select/index.js +370 -120
- package/dist/components/select/select.schema.js +9 -6
- package/dist/components/select/select.types.d.ts +3 -1
- package/dist/components/selectable-row/selectable-row.css +2 -1
- package/dist/components/selection-popover/index.js +1261 -222
- package/dist/components/selection-popover/selection-popover.css +1 -1
- package/dist/components/selection-popover/selection-popover.schema.js +5 -5
- package/dist/components/selection-popover/selection-popover.types.d.ts +4 -4
- package/dist/components/selection-popover/virtual-keyboard-dismissal.svelte.d.ts +20 -0
- package/dist/components/share-card/index.js +5 -5
- package/dist/components/share-card/share-card.schema.js +7 -4
- package/dist/components/share-card/share-card.types.d.ts +5 -5
- package/dist/components/sheet/index.js +285 -4
- package/dist/components/sheet/sheet.css +17 -10
- package/dist/components/sheet/sheet.schema.js +3 -3
- package/dist/components/sheet/sheet.types.d.ts +2 -2
- package/dist/components/shortcut-hint/index.js +3 -3
- package/dist/components/side-navigation/index.js +15 -4
- package/dist/components/side-navigation/side-navigation.svelte.d.ts +5 -3
- package/dist/components/side-navigation-group/index.js +12 -2
- package/dist/components/side-navigation-group/side-navigation-group.schema.js +5 -6
- package/dist/components/side-navigation-group/side-navigation-group.types.d.ts +1 -1
- package/dist/components/side-navigation-item/index.js +2 -2
- package/dist/components/sidebar/index.js +295 -3
- package/dist/components/sidebar/sidebar.css +1 -1
- package/dist/components/slider/index.js +1226 -77
- package/dist/components/slider/slider.css +2 -0
- package/dist/components/slider/slider.schema.js +1 -5
- package/dist/components/slider/slider.svelte.d.ts +1 -1
- package/dist/components/slider/slider.types.d.ts +6 -9
- package/dist/components/sortable-list/index.js +16 -10
- package/dist/components/sortable-list/sortable-list.css +14 -3
- package/dist/components/sortable-list/sortable-list.schema.js +2 -2
- package/dist/components/sortable-list/sortable-list.svelte.d.ts +1 -1
- package/dist/components/sortable-list/sortable-list.types.d.ts +1 -1
- package/dist/components/source-diff-viewer/index.d.ts +2 -1
- package/dist/components/source-diff-viewer/index.js +133 -125
- package/dist/components/source-diff-viewer/source-diff-viewer.binary-notice.d.ts +4 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.css +1 -1
- package/dist/components/source-diff-viewer/source-diff-viewer.git-header-parser.d.ts +8 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.labels.d.ts +3 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.path-normalization.d.ts +11 -0
- package/dist/components/source-diff-viewer/source-diff-viewer.schema.js +2 -2
- package/dist/components/source-diff-viewer/source-diff-viewer.svelte.d.ts +2 -1
- package/dist/components/source-diff-viewer/source-diff-viewer.types.d.ts +1 -1
- package/dist/components/source-diff-viewer/source-diff-viewer.utilities.d.ts +1 -3
- package/dist/components/spectrogram/index.d.ts +1 -0
- package/dist/components/spectrogram/index.js +17 -9
- package/dist/components/spectrum-chart/index.d.ts +1 -0
- package/dist/components/spectrum-chart/index.js +7 -5
- package/dist/components/speed-dial/index.js +3922 -175
- package/dist/components/speed-dial/speed-dial-exit.d.ts +1 -0
- package/dist/components/speed-dial/speed-dial-focus.d.ts +21 -0
- package/dist/components/speed-dial/speed-dial.css +45 -25
- package/dist/components/speed-dial/speed-dial.schema.js +2 -2
- package/dist/components/speed-dial/speed-dial.svelte.d.ts +2 -2
- package/dist/components/speed-dial/speed-dial.types.d.ts +1 -1
- package/dist/components/speed-dial-action/index.js +986 -45
- package/dist/components/speed-dial-action/speed-dial-action.svelte.d.ts +2 -2
- package/dist/components/speed-dial-action/speed-dial-action.types.d.ts +3 -3
- package/dist/components/stacked-list-item/stacked-list-item.css +9 -0
- package/dist/components/statistic/index.d.ts +5 -0
- package/dist/components/{stat → statistic}/index.js +15 -15
- package/dist/components/statistic/statistic.css +81 -0
- package/dist/components/{stat/stat.schema.js → statistic/statistic.schema.js} +6 -6
- package/dist/components/statistic/statistic.svelte.d.ts +18 -0
- package/dist/components/{stat/stat.types.d.ts → statistic/statistic.types.d.ts} +11 -11
- package/dist/components/{stat/stat.variables.js → statistic/statistic.variables.js} +12 -12
- package/dist/components/statistic-group/index.d.ts +12 -0
- package/dist/components/{stat-group → statistic-group}/index.js +20 -20
- package/{src/components/stat-group/stat-group.css → dist/components/statistic-group/statistic-group.css} +25 -24
- package/dist/components/{stat-group/stat-group.schema.js → statistic-group/statistic-group.schema.js} +9 -9
- package/dist/components/statistic-group/statistic-group.svelte.d.ts +18 -0
- package/dist/components/{stat-group/stat-group.types.d.ts → statistic-group/statistic-group.types.d.ts} +14 -14
- package/dist/components/{stat-group/stat-group.variables.js → statistic-group/statistic-group.variables.js} +7 -7
- package/dist/components/statistics-section/index.d.ts +5 -0
- package/dist/components/{stats-section → statistics-section}/index.js +29 -29
- package/dist/components/{stats-section/stats-section.css → statistics-section/statistics-section.css} +7 -7
- package/dist/components/{stats-section/stats-section.schema.js → statistics-section/statistics-section.schema.js} +9 -9
- package/dist/components/statistics-section/statistics-section.svelte.d.ts +19 -0
- package/dist/components/statistics-section/statistics-section.types.d.ts +63 -0
- package/dist/components/{cta-section/cta-section.variables.js → statistics-section/statistics-section.variables.js} +4 -4
- package/dist/components/status-dot/index.js +4 -4
- package/dist/components/status-dot/status-dot.css +1 -1
- package/dist/components/status-dot/status-dot.schema.js +3 -3
- package/dist/components/status-dot/status-dot.types.d.ts +4 -4
- package/dist/components/steps/index.js +20 -7
- package/dist/components/steps/steps.css +1 -0
- package/dist/components/steps/steps.schema.js +9 -5
- package/dist/components/steps/steps.types.d.ts +6 -3
- package/dist/components/tab/index.js +40 -25
- package/dist/components/tab/tab.schema.js +3 -2
- package/dist/components/tab/tab.types.d.ts +3 -2
- package/dist/components/tab-list/index.js +21 -9
- package/dist/components/tab-list/tab-list.types.d.ts +2 -1
- package/dist/components/tab-panel/index.js +21 -8
- package/dist/components/tab-panel/tab-panel.types.d.ts +2 -1
- package/dist/components/table/index.js +44 -33
- package/dist/components/table/table.css +3 -2
- package/dist/components/table/table.schema.js +9 -5
- package/dist/components/table/table.svelte.d.ts +1 -1
- package/dist/components/table/table.types.d.ts +7 -4
- package/dist/components/table-body/index.js +4 -4
- package/dist/components/table-body/table-body.types.d.ts +2 -1
- package/dist/components/table-cell/table-cell.schema.js +5 -3
- package/dist/components/table-cell/table-cell.types.d.ts +2 -1
- package/dist/components/table-header/index.js +18 -9
- package/dist/components/table-header/table-header.schema.js +9 -9
- package/dist/components/table-header/table-header.types.d.ts +41 -13
- package/dist/components/table-header-cell/index.js +2 -2
- package/dist/components/table-header-cell/table-header-cell.schema.js +7 -4
- package/dist/components/table-header-cell/table-header-cell.types.d.ts +3 -2
- package/dist/components/table-of-contents/index.js +271 -233
- package/dist/components/table-of-contents/table-of-contents-active-heading.svelte.d.ts +16 -0
- package/dist/components/table-of-contents/table-of-contents-heading-registry.svelte.d.ts +19 -0
- package/dist/components/table-of-contents/table-of-contents.css +13 -1
- package/dist/components/table-of-contents/table-of-contents.schema.js +3 -2
- package/dist/components/table-of-contents/table-of-contents.svelte.d.ts +2 -1
- package/dist/components/table-of-contents/table-of-contents.types.d.ts +4 -1
- package/dist/components/table-row/index.js +7 -7
- package/dist/components/table-row/table-row.schema.js +3 -3
- package/dist/components/table-row/table-row.types.d.ts +6 -6
- package/dist/components/tabs/index.js +113 -61
- package/dist/components/tabs/tabs.schema.js +10 -3
- package/dist/components/tabs/tabs.types.d.ts +9 -10
- package/dist/components/tag-input/index.js +21 -19
- package/dist/components/tag-input/tag-input.schema.js +9 -13
- package/dist/components/tag-input/tag-input.svelte.d.ts +8 -1
- package/dist/components/tag-input/tag-input.types.d.ts +8 -12
- package/dist/components/team-section/index.js +1435 -569
- package/dist/components/team-section/team-section.css +2 -43
- package/dist/components/team-section/team-section.schema.js +2 -2
- package/dist/components/team-section/team-section.types.d.ts +2 -2
- package/dist/components/testimonial-section/index.js +236 -331
- package/dist/components/testimonial-section/testimonial-section.css +2 -47
- package/dist/components/textarea/index.js +407 -106
- package/dist/components/textarea/textarea.schema.js +7 -8
- package/dist/components/textarea/textarea.types.d.ts +3 -3
- package/dist/components/time-field/index.js +497 -220
- package/dist/components/time-field/time-field.css +29 -7
- package/dist/components/time-field/time-field.schema.js +1 -4
- package/dist/components/time-field/time-field.types.d.ts +0 -3
- package/dist/components/timeline/timeline.svelte.d.ts +6 -5
- package/dist/components/toast-region/index.js +341 -173
- package/dist/components/toggle/index.js +104 -44
- package/dist/components/toggle/toggle.schema.js +6 -1
- package/dist/components/toggle/toggle.types.d.ts +3 -1
- package/dist/components/toolbar/index.js +18 -7
- package/dist/components/tooltip/index.js +1030 -207
- package/dist/components/tooltip/tooltip.css +1 -1
- package/dist/components/tooltip/tooltip.schema.js +3 -2
- package/dist/components/tooltip/tooltip.types.d.ts +1 -1
- package/dist/components/transfer-list/index.js +365 -189
- package/dist/components/transfer-list/transfer-list.css +15 -1
- package/dist/components/tree/index.d.ts +1 -0
- package/dist/components/tree/index.js +1242 -1019
- package/dist/components/tree/tree.schema.js +4 -4
- package/dist/components/tree/tree.svelte.d.ts +3 -1
- package/dist/components/tree/tree.types.d.ts +3 -3
- package/dist/components/tree-item/index.d.ts +1 -0
- package/dist/components/tree-item/index.js +665 -530
- package/dist/components/tree-item/tree-item-async-load.svelte.d.ts +23 -0
- package/dist/components/tree-item/tree-item-drag.svelte.d.ts +35 -0
- package/dist/components/tree-item/tree-item-label-highlight.d.ts +11 -0
- package/dist/components/tree-item/tree-item-rename.svelte.d.ts +43 -0
- package/dist/components/tree-item/tree-item.schema.js +5 -5
- package/dist/components/tree-item/tree-item.types.d.ts +4 -4
- package/dist/components/typography/index.js +3 -3
- package/dist/components/typography/typography.schema.js +2 -2
- package/dist/components/typography/typography.types.d.ts +7 -6
- package/dist/components/virtual-list/index.js +7 -5
- package/dist/components/waveform/index.d.ts +1 -0
- package/dist/components/waveform/index.js +7 -5
- package/dist/index.d.ts +24 -24
- package/dist/index.js +30865 -24672
- package/dist/manifest.meta.d.ts +1 -0
- package/dist/schema-types.d.ts +3 -2
- package/dist/server/components/access-gate/index.js +17 -5
- package/dist/server/components/alert/index.js +2 -2
- package/dist/server/components/alert-dialog/index.js +5 -5
- package/dist/server/components/approval-card/index.js +21 -13
- package/dist/server/components/area-chart/index.js +14 -2
- package/dist/server/components/autocomplete/index.js +8 -6
- package/dist/server/components/avatar-group/index.js +8 -6
- package/dist/server/components/backdrop/index.js +1 -1
- package/dist/server/components/badge/index.js +11 -3
- package/dist/server/components/banner/index.js +1 -1
- package/dist/server/components/bar-chart/index.js +14 -2
- package/dist/server/components/bento-cell/index.js +2 -2
- package/dist/server/components/bento-grid/index.js +3 -4
- package/dist/server/components/blog-section/index.js +3 -4
- package/dist/server/components/breadcrumbs/index.js +1 -1
- package/dist/server/components/button/index.js +2 -2
- package/dist/server/components/button-group/index.js +1 -1
- package/dist/server/components/calendar/index.js +2 -2
- package/dist/server/components/call-to-action-section/index.js +16 -0
- package/dist/server/components/capability-gate/index.js +1 -1
- package/dist/server/components/card/index.js +2 -2
- package/dist/server/components/carousel/index.js +3 -2
- package/dist/server/components/checkbox/index.js +6 -4
- package/dist/server/components/checkbox-group/index.js +1 -1
- package/dist/server/components/chip/index.js +2 -2
- package/dist/server/components/choice-grid/index.js +1 -1
- package/dist/server/components/click-away-listener/index.js +1 -1
- package/dist/server/components/code-block/index.js +3 -3
- package/dist/server/components/collapsible/index.js +2 -2
- package/dist/server/components/color-field/index.js +5 -4
- package/dist/server/components/color-picker/index.js +3 -3
- package/dist/server/components/color-swatch-picker/index.js +3 -3
- package/dist/server/components/combobox/index.js +12 -7
- package/dist/server/components/command-item/index.js +1 -1
- package/dist/server/components/command-menu/index.js +9 -5
- package/dist/server/components/command-palette/index.js +3 -3
- package/dist/server/components/confirm-dialog/index.js +9 -8
- package/dist/server/components/connection-indicator/index.js +5 -3
- package/dist/server/components/context-menu/index.js +10 -8
- package/dist/server/components/copy-button/index.js +5 -3
- package/dist/server/components/data-grid/index.js +1 -1
- package/dist/server/components/data-table/index.js +12 -10
- package/dist/server/components/date-picker/index.js +14 -8
- package/dist/server/components/date-range-field/index.js +13 -8
- package/dist/server/components/diff-statistics/index.js +4 -2
- package/dist/server/components/drawer/index.js +5 -5
- package/dist/server/components/dropdown/index.js +10 -8
- package/dist/server/components/dropdown-item/index.js +2 -2
- package/dist/server/components/dropdown-menu/index.js +8 -6
- package/dist/server/components/dropdown-trigger/index.js +2 -2
- package/dist/server/components/event-stream-viewer/index.js +7 -4
- package/dist/server/components/event-timeline/index.js +12 -2
- package/dist/server/components/faceted-filter-bar/index.js +5 -6
- package/dist/server/components/feature-section/index.js +1 -1
- package/dist/server/components/file-upload/index.js +1 -1
- package/dist/server/components/floating-action/index.js +16 -0
- package/dist/server/components/focus-trap/index.js +2 -2
- package/dist/server/components/form-field/index.js +3 -2
- package/dist/server/components/grid/index.js +1 -1
- package/dist/server/components/grid-list/index.js +1 -1
- package/dist/server/components/hero-section/index.js +3 -2
- package/dist/server/components/hover-card/index.js +6 -4
- package/dist/server/components/icons/index.js +22 -7
- package/dist/server/components/image/index.js +1 -1
- package/dist/server/components/input/index.js +5 -4
- package/dist/server/components/invocation-rule-builder/index.js +15 -7
- package/dist/server/components/json-editor/index.js +5 -2
- package/dist/server/components/json-schema-editor/index.js +32 -19
- package/dist/server/components/kanban-board/index.js +6 -3
- package/dist/server/components/line-chart/index.js +14 -2
- package/dist/server/components/load-more/index.js +1 -1
- package/dist/server/components/logo-cloud/index.js +1 -1
- package/dist/server/components/matrix-chart/index.js +14 -3
- package/dist/server/components/media-controls/index.js +1 -1
- package/dist/server/components/mega-menu/index.js +10 -2
- package/dist/server/components/menu-bar/index.js +12 -7
- package/dist/server/components/meter/index.js +1 -1
- package/dist/server/components/modal/index.js +4 -4
- package/dist/server/components/multi-select/index.js +9 -2
- package/dist/server/components/navigation-bar/index.js +9 -2
- package/dist/server/components/navigation-item/index.js +2 -2
- package/dist/server/components/newsletter-section/index.js +6 -5
- package/dist/server/components/number-input/index.js +8 -4
- package/dist/server/components/page-header/index.js +1 -1
- package/dist/server/components/payload-inspector/index.js +14 -5
- package/dist/server/components/permission-matrix/index.js +5 -3
- package/dist/server/components/phone-input/index.js +1 -1
- package/dist/server/components/popover/index.js +8 -6
- package/dist/server/components/portal/index.js +10 -3
- package/dist/server/components/pricing-card/index.js +3 -3
- package/dist/server/components/pricing-section/index.js +3 -3
- package/dist/server/components/radio-group/index.js +5 -2
- package/dist/server/components/rating/index.js +1 -1
- package/dist/server/components/resizable-panels/index.js +2 -2
- package/dist/server/components/run-step-timeline/index.js +13 -5
- package/dist/server/components/schedule-builder/index.js +14 -8
- package/dist/server/components/schema-form/index.js +15 -8
- package/dist/server/components/search-field/index.js +3 -4
- package/dist/server/components/secret-value-field/index.js +8 -2
- package/dist/server/components/select/index.js +4 -3
- package/dist/server/components/selection-popover/index.js +6 -4
- package/dist/server/components/share-card/index.js +1 -1
- package/dist/server/components/sheet/index.js +4 -4
- package/dist/server/components/side-navigation/index.js +7 -5
- package/dist/server/components/side-navigation-group/index.js +5 -3
- package/dist/server/components/side-navigation-item/index.js +3 -3
- package/dist/server/components/sidebar/index.js +8 -6
- package/dist/server/components/slider/index.js +2 -2
- package/dist/server/components/sortable-list/index.js +2 -2
- package/dist/server/components/source-diff-viewer/index.js +1 -1
- package/dist/server/components/spectrogram/index.js +2 -2
- package/dist/server/components/spectrum-chart/index.js +2 -2
- package/dist/server/components/speed-dial/index.js +10 -4
- package/dist/server/components/speed-dial-action/index.js +7 -4
- package/dist/server/components/{stat → statistic}/index.js +7 -7
- package/dist/server/components/statistic-group/index.js +17 -0
- package/dist/server/components/statistics-section/index.js +18 -0
- package/dist/server/components/status-dot/index.js +2 -2
- package/dist/server/components/steps/index.js +1 -1
- package/dist/server/components/tab/index.js +2 -2
- package/dist/server/components/tab-list/index.js +2 -2
- package/dist/server/components/tab-panel/index.js +2 -2
- package/dist/server/components/table/index.js +7 -7
- package/dist/server/components/table-body/index.js +2 -2
- package/dist/server/components/table-header/index.js +2 -2
- package/dist/server/components/table-header-cell/index.js +2 -2
- package/dist/server/components/table-of-contents/index.js +1 -1
- package/dist/server/components/table-row/index.js +2 -2
- package/dist/server/components/tabs/index.js +6 -6
- package/dist/server/components/tag-input/index.js +1 -1
- package/dist/server/components/team-section/index.js +10 -7
- package/dist/server/components/testimonial-section/index.js +4 -5
- package/dist/server/components/textarea/index.js +4 -3
- package/dist/server/components/time-field/index.js +4 -3
- package/dist/server/components/toast-region/index.js +8 -2
- package/dist/server/components/toggle/index.js +2 -2
- package/dist/server/components/toolbar/index.js +1 -1
- package/dist/server/components/tooltip/index.js +7 -5
- package/dist/server/components/transfer-list/index.js +8 -2
- package/dist/server/components/tree/index.js +2 -2
- package/dist/server/components/tree-item/index.js +2 -2
- package/dist/server/components/typography/index.js +1 -1
- package/dist/server/components/virtual-list/index.js +2 -2
- package/dist/server/components/waveform/index.js +2 -2
- package/dist/server/index.js +264 -235
- package/dist/server/{index.server-jnyznmzv.js → index.server-0154rjj6.js} +2 -2
- package/dist/server/{index.server-mz7sqkya.js → index.server-0380jykf.js} +7 -7
- package/dist/server/{index.server-ez5hp0ya.js → index.server-0j8ttfb3.js} +24 -23
- package/dist/server/{index.server-vg8t3dkb.js → index.server-0qa6j0gt.js} +4 -4
- package/dist/server/{index.server-4cbqjf14.js → index.server-0qqjq4dh.js} +3 -3
- package/dist/server/{index.server-8gv0tm3r.js → index.server-0qvwymqd.js} +2 -2
- package/dist/server/index.server-0rqytc2f.js +53 -0
- package/dist/server/{index.server-dz1r9xw5.js → index.server-1233sspt.js} +63 -36
- package/dist/server/index.server-1br18a82.js +369 -0
- package/dist/server/{index.server-mvhf8b7g.js → index.server-1dk15yd2.js} +3 -3
- package/dist/server/{index.server-6zgzghtm.js → index.server-1g3bqz6w.js} +1 -1
- package/dist/server/index.server-1hr2nnvq.js +67 -0
- package/dist/server/{index.server-0qh3v3nq.js → index.server-1p7b8y48.js} +50 -15
- package/dist/server/{index.server-q5gvb174.js → index.server-1qr1qkjb.js} +10 -10
- package/dist/server/{index.server-hxveaqg1.js → index.server-1xq7j9dj.js} +10 -10
- package/dist/server/index.server-1zhe1vwe.js +70 -0
- package/dist/server/{index.server-49m5nntq.js → index.server-20rc21x2.js} +19 -3
- package/dist/server/{index.server-zfx4magq.js → index.server-29sg0ywf.js} +59 -25
- package/dist/server/index.server-2bvasys0.js +27 -0
- package/dist/server/{index.server-d5a5ccz7.js → index.server-2mwr7vjg.js} +24 -25
- package/dist/server/index.server-2n185esx.js +410 -0
- package/dist/server/{index.server-2cyn5sjd.js → index.server-2pst4wcx.js} +1 -1
- package/dist/server/{index.server-0svdq2kq.js → index.server-2s7btgxx.js} +9 -10
- package/dist/server/{index.server-frb9e55d.js → index.server-32p6dz3e.js} +9 -9
- package/dist/server/{index.server-h90pjrez.js → index.server-36rjvy9e.js} +1 -1
- package/dist/server/{index.server-s0vmsxhj.js → index.server-3f43g1z6.js} +1 -1
- package/dist/server/index.server-3gm8s994.js +390 -0
- package/dist/server/index.server-3ne3ekqq.js +147 -0
- package/dist/server/{index.server-3f2jzg7q.js → index.server-3tscwcse.js} +15 -18
- package/dist/server/{index.server-0jhra85x.js → index.server-3wekb2fb.js} +8 -4
- package/dist/server/index.server-429t1qje.js +447 -0
- package/dist/server/{index.server-dbne33pa.js → index.server-47bbxz3a.js} +10 -3
- package/dist/server/{index.server-m80kp6tm.js → index.server-49g0pm4w.js} +73 -22
- package/dist/server/{index.server-kvdrhzr3.js → index.server-4bdnshs1.js} +14 -7
- package/dist/server/index.server-4efnbtq1.js +2 -0
- package/dist/server/{index.server-d6j2jmqg.js → index.server-4h8c8xh7.js} +1 -1
- package/dist/server/{index.server-fe98ezq1.js → index.server-4jw1fkcg.js} +6 -6
- package/dist/server/{index.server-szgghcdh.js → index.server-4kqjwvrq.js} +106 -214
- package/dist/server/{index.server-zm04d9eq.js → index.server-4nh4arvs.js} +6 -6
- package/dist/server/index.server-4sg50xfn.js +27 -0
- package/dist/server/{index.server-nq2r5m1r.js → index.server-4ywb3qcm.js} +92 -41
- package/dist/server/{index.server-fe41fvr4.js → index.server-52e4m6b5.js} +1 -1
- package/dist/server/{index.server-nbrd998e.js → index.server-54yr0y08.js} +1 -1
- package/dist/server/index.server-55ehgem8.js +2 -0
- package/dist/server/{index.server-ap53z0a0.js → index.server-5j7v41gy.js} +18 -9
- package/dist/server/{index.server-9w7k8wwk.js → index.server-5p5r6t6n.js} +179 -143
- package/dist/server/{index.server-1vfhzhkj.js → index.server-5schb2vt.js} +4 -4
- package/dist/server/{index.server-kt0ncrqs.js → index.server-6c9144ex.js} +1 -1
- package/dist/server/{index.server-9w7qdn8h.js → index.server-6gzzpcyd.js} +1 -4
- package/dist/server/index.server-6n5grdb2.js +78 -0
- package/dist/server/{index.server-51t6yebn.js → index.server-70j8j998.js} +12 -2
- package/dist/server/index.server-71zvvayv.js +234 -0
- package/dist/server/index.server-74c0gw8e.js +12 -0
- package/dist/server/{index.server-2pc5cv6c.js → index.server-74g52t91.js} +1 -1
- package/dist/server/{index.server-ks49bprh.js → index.server-79bg6rad.js} +4 -4
- package/dist/server/{index.server-k2tmp4j0.js → index.server-7ae3f1sh.js} +1 -1
- package/dist/server/{index.server-62593nnh.js → index.server-7cwcqhqd.js} +9 -9
- package/dist/server/{index.server-2qdzkapm.js → index.server-7he4va6w.js} +3 -3
- package/dist/server/{index.server-gf20dp5p.js → index.server-7mhk40r3.js} +1 -1
- package/dist/server/index.server-7r9d6g1c.js +397 -0
- package/dist/server/{index.server-5c8qde3q.js → index.server-7ssngbpa.js} +1 -1
- package/dist/server/{index.server-8sybstcc.js → index.server-7wtntdet.js} +230 -156
- package/dist/server/{index.server-pyjzfjfn.js → index.server-85dr75be.js} +8 -8
- package/dist/server/index.server-86hdc1jx.js +12 -0
- package/dist/server/{index.server-b2jaw4ng.js → index.server-8bmwna5v.js} +5 -5
- package/dist/server/{index.server-k1fyyae7.js → index.server-8n17dgbq.js} +1 -1
- package/dist/server/{index.server-8dt36sdm.js → index.server-8s33z1q7.js} +2 -2
- package/dist/server/{index.server-ng8y854r.js → index.server-8wb8g3w1.js} +49 -39
- package/dist/server/{index.server-4maxbgsj.js → index.server-91t9mbkx.js} +3 -3
- package/dist/server/{index.server-zp4hjjym.js → index.server-91yqn19v.js} +27 -16
- package/dist/server/{index.server-n0rbn5yf.js → index.server-92sweseg.js} +2 -1
- package/dist/server/index.server-93943z3e.js +9 -0
- package/dist/server/{index.server-cch0eed5.js → index.server-9pgjw8dv.js} +10 -39
- package/dist/server/{index.server-0chhpkg7.js → index.server-a2zfb135.js} +46 -5
- package/dist/server/{index.server-003t81xk.js → index.server-abqbstkt.js} +4 -4
- package/dist/server/{index.server-vd302sxz.js → index.server-aerjcjgw.js} +73 -72
- package/dist/server/index.server-ak9pqjfw.js +424 -0
- package/dist/server/{index.server-4rdkwmfb.js → index.server-ampgmpq8.js} +2 -2
- package/dist/server/{index.server-txnxnbd6.js → index.server-b36zkjsr.js} +5 -3
- package/dist/server/index.server-b8m7ej8c.js +477 -0
- package/dist/server/{index.server-9fyy0j4c.js → index.server-bfmd7nf6.js} +16 -25
- package/dist/server/{index.server-x1xxzfvg.js → index.server-bmgnba9v.js} +7 -3
- package/dist/server/{index.server-xanq9ppe.js → index.server-bprjmaxb.js} +4 -4
- package/dist/server/{index.server-y2ncgt7p.js → index.server-bsm39gpy.js} +15 -9
- package/dist/server/{index.server-2752sd9e.js → index.server-c2xgjbj7.js} +6 -2
- package/dist/server/{index.server-thp81fc0.js → index.server-c51n35c3.js} +1 -1
- package/dist/server/{index.server-d146g8pr.js → index.server-casqzp4h.js} +61 -66
- package/dist/server/{index.server-nzgjr724.js → index.server-cepvcyxn.js} +8 -8
- package/dist/server/{index.server-38aywdk1.js → index.server-cvc44t4m.js} +5 -5
- package/dist/server/{index.server-7ygdwxre.js → index.server-d04axnt4.js} +18 -7
- package/dist/server/{index.server-thedzn9z.js → index.server-d26jzn2m.js} +34 -38
- package/dist/server/{index.server-rtk7fhjy.js → index.server-d9z0psxj.js} +29 -19
- package/dist/server/{index.server-dmmvwy6p.js → index.server-dfp8jvrr.js} +1 -1
- package/dist/server/index.server-dpe08kr7.js +252 -0
- package/dist/server/{index.server-8grn4zd3.js → index.server-dpyw7nad.js} +122 -55
- package/dist/server/index.server-dqt9we67.js +53 -0
- package/dist/server/{index.server-0hjcds3y.js → index.server-dvd8t7ds.js} +15 -6
- package/dist/server/index.server-dx5b28qh.js +27 -0
- package/dist/server/index.server-e4f105cg.js +31 -0
- package/dist/server/index.server-e65x21yr.js +2 -0
- package/dist/server/{index.server-z1q7qnb8.js → index.server-e97zrck0.js} +9 -2
- package/dist/server/{index.server-tww47bb6.js → index.server-ec9anf8e.js} +53 -33
- package/dist/server/{index.server-mewms9dg.js → index.server-edx404az.js} +82 -75
- package/dist/server/index.server-epvxcafz.js +2 -0
- package/dist/server/{index.server-d4e6afc0.js → index.server-evrfgzwn.js} +6 -3
- package/dist/server/{index.server-jtgw9d23.js → index.server-eyta8yd2.js} +4 -5
- package/dist/server/{index.server-veastatv.js → index.server-f02vwrw5.js} +1 -1
- package/dist/server/{index.server-v73af5rk.js → index.server-f4pxscq5.js} +48 -37
- package/dist/server/{index.server-t859hsx1.js → index.server-fdpe3vky.js} +5 -5
- package/dist/server/{index.server-nwzrpjc9.js → index.server-ff9zfw15.js} +13 -13
- package/dist/server/{index.server-7scshbcm.js → index.server-fgtqpnva.js} +1 -1
- package/dist/server/{index.server-6mnbznbt.js → index.server-fphvzcfb.js} +2 -2
- package/dist/server/{index.server-ahtaqav5.js → index.server-fv23h844.js} +1 -1
- package/dist/server/{index.server-ezpdsg81.js → index.server-fymevt3c.js} +133 -125
- package/dist/server/{index.server-be9bpqeh.js → index.server-fys5yj23.js} +5 -3
- package/dist/server/{index.server-a9de6h0d.js → index.server-g1z2zgwk.js} +8 -8
- package/dist/server/{index.server-xjnge1yw.js → index.server-g38yys7a.js} +30 -23
- package/dist/server/{index.server-rbpvcrr3.js → index.server-g8j7wnpa.js} +1 -1
- package/dist/server/{index.server-7yq1jgt3.js → index.server-gbj2zt1q.js} +1 -1
- package/dist/server/index.server-gdtg1xg7.js +302 -0
- package/dist/server/{index.server-2qd56bzw.js → index.server-gme23wnx.js} +9 -12
- package/dist/server/{index.server-8tr30fpp.js → index.server-gp0jh4cx.js} +1 -1
- package/dist/server/index.server-gse6hc5s.js +9 -0
- package/dist/server/{index.server-apyaqxfw.js → index.server-gvk55r2z.js} +1 -1
- package/dist/server/{index.server-v90d8593.js → index.server-h6c6b4sq.js} +14 -8
- package/dist/server/index.server-h6qhx8mw.js +1214 -0
- package/dist/server/index.server-haws3fsj.js +2 -0
- package/dist/server/{index.server-ncdt0xb7.js → index.server-hcpq0x8d.js} +1 -1
- package/dist/server/{index.server-bs4tyzxz.js → index.server-hfccqkjw.js} +1 -1
- package/dist/server/{index.server-9nac5z11.js → index.server-hzf509s2.js} +32 -16
- package/dist/server/{index.server-wg6ddzpa.js → index.server-j15z5xn7.js} +9 -4
- package/dist/server/index.server-jepjmrcp.js +40 -0
- package/dist/server/{index.server-8b35ekqg.js → index.server-jj0tkfqp.js} +4 -4
- package/dist/server/{index.server-7qak74fg.js → index.server-jnp8yqgj.js} +20 -25
- package/dist/server/{index.server-5npa16n7.js → index.server-jw63k15t.js} +1 -1
- package/dist/server/{index.server-pfbzz3x7.js → index.server-jwrnsnxk.js} +1 -1
- package/dist/server/{index.server-c8pmq1tm.js → index.server-jxy33axv.js} +7 -5
- package/dist/server/{index.server-r82zjq88.js → index.server-k1625sfw.js} +60 -50
- package/dist/server/{index.server-xb9cj0bp.js → index.server-kbtw4pxm.js} +1 -1
- package/dist/server/index.server-kd5bmzfj.js +2 -0
- package/dist/server/{index.server-8xrzkve2.js → index.server-kfem5020.js} +6 -6
- package/dist/server/{index.server-9599zs05.js → index.server-kjv6v7jm.js} +1 -1
- package/dist/server/{index.server-z721a5gp.js → index.server-km7pzejr.js} +23 -14
- package/dist/server/{index.server-tnbaknbp.js → index.server-kmn9zrqn.js} +1 -1
- package/dist/server/index.server-kr3wrv13.js +38 -0
- package/dist/server/index.server-krwbxm8x.js +36 -0
- package/dist/server/{index.server-9drzqktm.js → index.server-ktwnf9vg.js} +15 -67
- package/dist/server/{index.server-a2hz77tt.js → index.server-m1r7jk3n.js} +9 -20
- package/dist/server/{index.server-2ffw6am1.js → index.server-m9p9vfj1.js} +3 -3
- package/dist/server/{index.server-ww54rv4y.js → index.server-mgvey6vx.js} +118 -105
- package/dist/server/index.server-mhw6yp2x.js +27 -0
- package/dist/server/index.server-mrjns5eb.js +41 -0
- package/dist/server/{index.server-3axwhvt7.js → index.server-msdm0gyk.js} +18 -4
- package/dist/server/{index.server-j150jxcq.js → index.server-msp145ky.js} +1 -1
- package/dist/server/{index.server-9xrqh29s.js → index.server-mvcsfqs9.js} +17 -2
- package/dist/server/{index.server-d3pqthtp.js → index.server-mw3z3nfz.js} +6 -6
- package/dist/server/{index.server-8tkwdtna.js → index.server-mxgakpfj.js} +6 -6
- package/dist/server/{index.server-64r048av.js → index.server-n63d1ssb.js} +4 -2
- package/dist/server/{index.server-d77c4vae.js → index.server-ne3hnn6e.js} +3 -3
- package/dist/server/{index.server-0gwr59yw.js → index.server-nj8kk5bv.js} +1 -1
- package/dist/server/{index.server-0gg1njz4.js → index.server-nprmntcb.js} +3 -3
- package/dist/server/{index.server-6rv1rfwq.js → index.server-nqkfm3m7.js} +46 -13
- package/dist/server/{index.server-kvn6cj65.js → index.server-nqz2nrgp.js} +1 -1
- package/dist/server/{index.server-vz9hqkdq.js → index.server-nsqx19rk.js} +20 -8
- package/dist/server/{index.server-zngmm4tg.js → index.server-p36e1472.js} +3 -3
- package/dist/server/{index.server-894t97kv.js → index.server-pctqr0zf.js} +53 -48
- package/dist/server/{index.server-0yfgpazx.js → index.server-pwxe9s42.js} +19 -19
- package/dist/server/{index.server-b6jr01st.js → index.server-qjh3vsj8.js} +5 -5
- package/dist/server/index.server-qycjqq8v.js +179 -0
- package/dist/server/{index.server-032p855q.js → index.server-r147w5z4.js} +5 -5
- package/dist/server/index.server-r2z5ds34.js +54 -0
- package/dist/server/{index.server-agsdwg53.js → index.server-r5emexd4.js} +1 -1
- package/dist/server/{index.server-geq56xaz.js → index.server-r5y5t888.js} +28 -12
- package/dist/server/{index.server-zvrew616.js → index.server-r60akntz.js} +1 -1
- package/dist/server/{index.server-20km2ga0.js → index.server-rd908evp.js} +21 -20
- package/dist/server/{index.server-jxseyx33.js → index.server-rgcepyhr.js} +1 -1
- package/dist/server/index.server-rjx8m9en.js +27 -0
- package/dist/server/{index.server-tnecnach.js → index.server-rvaw3nks.js} +8 -12
- package/dist/server/{index.server-jtytqppy.js → index.server-rxvbt0y3.js} +9 -4
- package/dist/server/index.server-s6kgtjhh.js +35 -0
- package/dist/server/{index.server-m4wc0170.js → index.server-s6stvh7k.js} +1 -1
- package/dist/server/{index.server-mda2y5g6.js → index.server-sqtgjjc3.js} +1 -1
- package/dist/server/{index.server-pe929n15.js → index.server-sy0vfg2g.js} +11 -3
- package/dist/server/index.server-t2p901p7.js +527 -0
- package/dist/server/{index.server-rbd5ys4z.js → index.server-t6dkkfxk.js} +1 -1
- package/dist/server/{index.server-66nm5gd5.js → index.server-t8dts351.js} +388 -342
- package/dist/server/{index.server-gmd6gbwb.js → index.server-tj2erfba.js} +4 -1
- package/dist/server/index.server-tmfcgx1j.js +136 -0
- package/dist/server/{index.server-v3vnmjat.js → index.server-trc6xj4s.js} +1 -1
- package/dist/server/{index.server-n85yz1tm.js → index.server-v12jk4c9.js} +3 -3
- package/dist/server/{index.server-rxzp610y.js → index.server-v3t6v21s.js} +22 -4
- package/dist/server/index.server-v576qshz.js +2 -0
- package/dist/server/index.server-v6b3k6cq.js +15 -0
- package/dist/server/{index.server-94b7tjs5.js → index.server-vb58jd7c.js} +2 -1
- package/dist/server/{index.server-g95bk8rc.js → index.server-vcfv93bg.js} +30 -8
- package/dist/server/index.server-vke078fx.js +745 -0
- package/dist/server/{index.server-s4wm4g2a.js → index.server-vqb9m9hq.js} +3 -3
- package/dist/server/{index.server-hrq85wvg.js → index.server-w96rfs8f.js} +2 -2
- package/dist/server/index.server-w9tnnse5.js +611 -0
- package/dist/server/{index.server-0sx92swg.js → index.server-wbe0dskj.js} +1 -1
- package/dist/server/{index.server-ny0z50m0.js → index.server-wm3t5yw7.js} +21 -3
- package/dist/server/{index.server-8bm66pm4.js → index.server-wm8957be.js} +10 -10
- package/dist/server/{index.server-yf2jn8cr.js → index.server-wqe8pzw1.js} +8 -7
- package/dist/server/{index.server-y4kfz0er.js → index.server-wsbwydct.js} +1 -1
- package/dist/server/{index.server-c42b462p.js → index.server-wxs2c5d0.js} +92 -65
- package/dist/server/index.server-x93qnzqm.js +100 -0
- package/dist/server/index.server-xa8kjs78.js +111 -0
- package/dist/server/{index.server-egzx2kh5.js → index.server-xanhe43k.js} +8 -6
- package/dist/server/{index.server-8ak2cftv.js → index.server-xap17cfh.js} +1 -1
- package/dist/server/{index.server-xbx230ec.js → index.server-xn6qg9pk.js} +1 -1
- package/dist/server/{index.server-9eccb2fc.js → index.server-xtx9sey2.js} +73 -66
- package/dist/server/{index.server-nz6jpmkx.js → index.server-y7017ygc.js} +4 -4
- package/dist/server/{index.server-bqjv32nb.js → index.server-y86zyqa9.js} +10 -4
- package/dist/server/index.server-yase1x1a.js +23 -0
- package/dist/server/{index.server-fhrqsg97.js → index.server-yd9shwqq.js} +1 -1
- package/dist/server/{index.server-3qf60xx4.js → index.server-yevngyp5.js} +1 -1
- package/dist/server/{index.server-6gbhg9gp.js → index.server-ynt74xb3.js} +9 -2
- package/dist/server/{index.server-d4ft97bx.js → index.server-yvcrg99d.js} +4 -4
- package/dist/server/{index.server-k4mpevmq.js → index.server-ywvrf5rd.js} +1 -1
- package/dist/server/index.server-yyarp1ny.js +2 -0
- package/dist/server/{index.server-yqhww50r.js → index.server-z2fdg8dg.js} +4 -4
- package/dist/server/{index.server-sf3nk3j2.js → index.server-z53avp9h.js} +28 -19
- package/dist/server/{index.server-hx91ng7z.js → index.server-z6cygsgg.js} +1 -1
- package/dist/server/index.server-zf0221kw.js +73 -0
- package/dist/server/{index.server-hcsd5gdb.js → index.server-zgvrg9rm.js} +23 -3
- package/dist/server/{index.server-x4a15jpm.js → index.server-znrr9zve.js} +1 -1
- package/dist/server/{index.server-ft1xvwqd.js → index.server-zt8d7yer.js} +1 -1
- package/dist/utilities/focus.d.ts +81 -0
- package/dist/utilities/html-element-types.d.ts +19 -0
- package/dist/utilities/sortable-controller.svelte.d.ts +2 -2
- package/dist/utilities/value-change.d.ts +3 -2
- package/package.json +165 -168
- package/src/_internal/anchored-overlay.svelte.ts +74 -15
- package/src/_internal/date-value.ts +71 -0
- package/src/_internal/form-field-context.ts +1 -1
- package/src/_internal/form-field-frame.svelte +88 -0
- package/src/_internal/form-field-provider.svelte +7 -0
- package/src/_internal/overlay.ts +2 -1
- package/src/_internal/text-direction-container.ts +317 -0
- package/src/_internal/text-direction-css.ts +1437 -0
- package/src/_internal/text-direction.ts +102 -107
- package/src/_internal/tree-autoscroll.svelte.ts +77 -0
- package/src/_internal/tree-filter.svelte.ts +91 -0
- package/src/components/_internal/chart-data-table.svelte +30 -0
- package/src/components/_internal/checkbox-indicator-shell.svelte +9 -0
- package/src/components/_internal/create-command-list-state.svelte.ts +58 -4
- package/src/components/_internal/person-byline.css +29 -0
- package/src/components/_internal/person-byline.svelte +14 -0
- package/src/components/_internal/section-skeleton.css +45 -0
- package/src/components/_radio/radio.svelte +21 -20
- package/src/components/_radio/radio.types.ts +1 -1
- package/src/components/_sortable-item.svelte +3 -0
- package/src/components/access-gate/access-gate-inline.svelte +22 -0
- package/src/components/access-gate/access-gate.css +55 -6
- package/src/components/access-gate/access-gate.svelte +5 -1
- package/src/components/accordion-item/accordion-item.css +8 -6
- package/src/components/alert/alert.examples.json +2 -2
- package/src/components/alert/alert.schema.json +1 -1
- package/src/components/alert/alert.schema.ts +1 -1
- package/src/components/alert/alert.svelte +2 -2
- package/src/components/alert/alert.types.ts +1 -1
- package/src/components/alert-dialog/alert-dialog.examples.json +2 -2
- package/src/components/alert-dialog/alert-dialog.schema.json +2 -2
- package/src/components/alert-dialog/alert-dialog.schema.ts +2 -2
- package/src/components/alert-dialog/alert-dialog.svelte +4 -4
- package/src/components/alert-dialog/alert-dialog.types.ts +2 -2
- package/src/components/approval-card/approval-card-actions.svelte +4 -3
- package/src/components/approval-card/approval-card.css +6 -2
- package/src/components/approval-card/approval-card.examples.json +2 -2
- package/src/components/approval-card/approval-card.schema.json +5 -3
- package/src/components/approval-card/approval-card.schema.ts +3 -1
- package/src/components/approval-card/approval-card.svelte +8 -8
- package/src/components/approval-card/approval-card.types.ts +4 -4
- package/src/components/area-chart/area-chart.css +4 -3
- package/src/components/area-chart/area-chart.examples.json +6 -0
- package/src/components/area-chart/area-chart.svelte +156 -155
- package/src/components/area-chart/index.ts +1 -0
- package/src/components/autocomplete/autocomplete.css +2 -49
- package/src/components/autocomplete/autocomplete.schema.json +1 -1
- package/src/components/autocomplete/autocomplete.schema.ts +1 -1
- package/src/components/autocomplete/autocomplete.svelte +25 -33
- package/src/components/autocomplete/autocomplete.types.ts +17 -3
- package/src/components/avatar/avatar.css +0 -2
- package/src/components/avatar/avatar.schema.json +5 -10
- package/src/components/avatar/avatar.schema.ts +4 -9
- package/src/components/avatar/avatar.types.ts +1 -1
- package/src/components/avatar-group/avatar-group.css +3 -1
- package/src/components/backdrop/backdrop.schema.json +2 -2
- package/src/components/backdrop/backdrop.schema.ts +2 -2
- package/src/components/backdrop/backdrop.svelte +16 -4
- package/src/components/backdrop/backdrop.types.ts +2 -2
- package/src/components/badge/badge.css +2 -2
- package/src/components/badge/badge.schema.json +1 -1
- package/src/components/badge/badge.schema.ts +1 -1
- package/src/components/badge/badge.svelte +20 -37
- package/src/components/badge/badge.types.ts +3 -3
- package/src/components/banner/banner.examples.json +1 -1
- package/src/components/banner/banner.schema.json +5 -3
- package/src/components/banner/banner.schema.ts +3 -1
- package/src/components/banner/banner.svelte +2 -2
- package/src/components/banner/banner.types.ts +3 -3
- package/src/components/bar-chart/bar-chart.css +4 -3
- package/src/components/bar-chart/bar-chart.examples.json +6 -0
- package/src/components/bar-chart/bar-chart.svelte +141 -145
- package/src/components/bar-chart/index.ts +1 -0
- package/src/components/bento-cell/bento-cell.schema.json +102 -2
- package/src/components/bento-cell/bento-cell.schema.ts +102 -2
- package/src/components/bento-cell/bento-cell.svelte +2 -2
- package/src/components/bento-cell/bento-cell.types.ts +3 -2
- package/src/components/bento-grid/bento-grid.css +7 -17
- package/src/components/bento-grid/bento-grid.examples.json +1 -1
- package/src/components/bento-grid/bento-grid.schema.json +102 -2
- package/src/components/bento-grid/bento-grid.schema.ts +102 -2
- package/src/components/bento-grid/bento-grid.svelte +16 -48
- package/src/components/bento-grid/bento-grid.types.ts +4 -3
- package/src/components/blog-section/blog-section.css +4 -47
- package/src/components/blog-section/blog-section.svelte +14 -17
- package/src/components/breadcrumbs/breadcrumbs.svelte +11 -3
- package/src/components/breadcrumbs/breadcrumbs.types.ts +2 -1
- package/src/components/button/button.css +2 -2
- package/src/components/button/button.svelte +3 -4
- package/src/components/button-group/button-group.schema.json +2 -1
- package/src/components/button-group/button-group.schema.ts +1 -0
- package/src/components/button-group/button-group.svelte +3 -17
- package/src/components/button-group/button-group.types.ts +1 -1
- package/src/components/calendar/calendar.schema.json +8 -4
- package/src/components/calendar/calendar.schema.ts +4 -0
- package/src/components/calendar/calendar.svelte +113 -46
- package/src/components/calendar/calendar.types.ts +4 -4
- package/src/components/{cta-section/cta-section.css → call-to-action-section/call-to-action-section.css} +11 -11
- package/src/components/call-to-action-section/call-to-action-section.examples.json +13 -0
- package/src/components/{cta-section/cta-section.schema.json → call-to-action-section/call-to-action-section.schema.json} +1 -1
- package/src/components/{cta-section/cta-section.schema.ts → call-to-action-section/call-to-action-section.schema.ts} +1 -1
- package/src/components/{cta-section/cta-section.svelte → call-to-action-section/call-to-action-section.svelte} +6 -6
- package/src/components/{cta-section/cta-section.types.ts → call-to-action-section/call-to-action-section.types.ts} +23 -11
- package/src/components/call-to-action-section/index.ts +10 -0
- package/src/components/callout/callout.css +5 -0
- package/src/components/capability-gate/capability-gate.examples.json +1 -1
- package/src/components/capability-gate/capability-gate.schema.json +3 -3
- package/src/components/capability-gate/capability-gate.schema.ts +3 -3
- package/src/components/capability-gate/capability-gate.svelte +6 -6
- package/src/components/capability-gate/capability-gate.types.ts +9 -6
- package/src/components/card/card.css +25 -7
- package/src/components/card/card.examples.json +3 -3
- package/src/components/card/card.schema.json +6 -6
- package/src/components/card/card.schema.ts +6 -6
- package/src/components/card/card.svelte +1 -1
- package/src/components/card/card.types.ts +4 -3
- package/src/components/carousel/carousel.css +45 -5
- package/src/components/carousel/carousel.svelte +370 -41
- package/src/components/checkbox/checkbox.css +62 -28
- package/src/components/checkbox/checkbox.examples.json +1 -1
- package/src/components/checkbox/checkbox.schema.json +6 -6
- package/src/components/checkbox/checkbox.schema.ts +6 -6
- package/src/components/checkbox/checkbox.svelte +55 -39
- package/src/components/checkbox/checkbox.types.ts +4 -4
- package/src/components/checkbox-group/checkbox-group.css +6 -8
- package/src/components/checkbox-group/checkbox-group.examples.json +6 -0
- package/src/components/checkbox-group/checkbox-group.svelte +9 -2
- package/src/components/checkbox-group/checkbox-group.types.ts +2 -1
- package/src/components/chip/chip.examples.json +1 -1
- package/src/components/chip/chip.schema.json +2 -2
- package/src/components/chip/chip.schema.ts +2 -2
- package/src/components/chip/chip.svelte +7 -7
- package/src/components/chip/chip.types.ts +6 -6
- package/src/components/choice-grid/choice-grid.css +2 -9
- package/src/components/choice-grid/choice-grid.schema.json +4 -5
- package/src/components/choice-grid/choice-grid.schema.ts +4 -5
- package/src/components/choice-grid/choice-grid.svelte +12 -9
- package/src/components/choice-grid/choice-grid.types.ts +1 -27
- package/src/components/click-away-listener/click-away-listener.examples.json +1 -1
- package/src/components/click-away-listener/click-away-listener.schema.json +2 -2
- package/src/components/click-away-listener/click-away-listener.schema.ts +2 -2
- package/src/components/click-away-listener/click-away-listener.svelte +2 -2
- package/src/components/click-away-listener/click-away-listener.types.ts +3 -3
- package/src/components/code-block/code-block.css +1 -0
- package/src/components/code-block/code-block.schema.json +1 -1
- package/src/components/code-block/code-block.schema.ts +1 -1
- package/src/components/code-block/code-block.svelte +4 -3
- package/src/components/code-block/code-block.types.ts +1 -1
- package/src/components/collapsible/collapsible.css +16 -8
- package/src/components/collapsible/collapsible.schema.json +1 -1
- package/src/components/collapsible/collapsible.schema.ts +1 -1
- package/src/components/collapsible/collapsible.svelte +2 -2
- package/src/components/collapsible/collapsible.types.ts +1 -1
- package/src/components/color-field/color-field.css +2 -0
- package/src/components/color-field/color-field.examples.json +1 -1
- package/src/components/color-field/color-field.schema.json +1 -5
- package/src/components/color-field/color-field.schema.ts +1 -5
- package/src/components/color-field/color-field.svelte +58 -81
- package/src/components/color-field/color-field.types.ts +2 -5
- package/src/components/color-picker/color-picker.examples.json +3 -3
- package/src/components/color-picker/color-picker.schema.json +0 -4
- package/src/components/color-picker/color-picker.schema.ts +0 -4
- package/src/components/color-picker/color-picker.svelte +12 -24
- package/src/components/color-picker/color-picker.types.ts +0 -2
- package/src/components/color-swatch-picker/color-swatch-picker.schema.json +1 -5
- package/src/components/color-swatch-picker/color-swatch-picker.schema.ts +1 -5
- package/src/components/color-swatch-picker/color-swatch-picker.svelte +4 -7
- package/src/components/color-swatch-picker/color-swatch-picker.types.ts +1 -3
- package/src/components/combobox/combobox.css +16 -17
- package/src/components/combobox/combobox.schema.json +2 -2
- package/src/components/combobox/combobox.schema.ts +2 -2
- package/src/components/combobox/combobox.svelte +190 -84
- package/src/components/combobox/combobox.types.ts +3 -3
- package/src/components/command-item/command-item.schema.json +2 -2
- package/src/components/command-item/command-item.schema.ts +3 -2
- package/src/components/command-item/command-item.svelte +3 -3
- package/src/components/command-item/command-item.types.ts +13 -5
- package/src/components/command-menu/command-menu-inline-completion.svelte.ts +184 -0
- package/src/components/command-menu/command-menu.css +28 -10
- package/src/components/command-menu/command-menu.examples.json +1 -1
- package/src/components/command-menu/command-menu.schema.json +9 -5
- package/src/components/command-menu/command-menu.schema.ts +11 -5
- package/src/components/command-menu/command-menu.svelte +231 -7
- package/src/components/command-menu/command-menu.types.ts +34 -5
- package/src/components/command-menu/index.ts +1 -0
- package/src/components/command-palette/command-palette.css +4 -2
- package/src/components/command-palette/command-palette.examples.json +3 -3
- package/src/components/command-palette/command-palette.schema.json +2 -2
- package/src/components/command-palette/command-palette.schema.ts +2 -2
- package/src/components/command-palette/command-palette.svelte +2 -2
- package/src/components/command-palette/command-palette.types.ts +2 -2
- package/src/components/confirm-dialog/confirm-dialog.examples.json +2 -2
- package/src/components/confirm-dialog/confirm-dialog.schema.json +2 -2
- package/src/components/confirm-dialog/confirm-dialog.schema.ts +2 -2
- package/src/components/confirm-dialog/confirm-dialog.svelte +4 -4
- package/src/components/confirm-dialog/confirm-dialog.types.ts +2 -2
- package/src/components/connection-indicator/connection-indicator.css +2 -2
- package/src/components/container/container.schema.json +3 -3
- package/src/components/container/container.schema.ts +3 -3
- package/src/components/context-menu/context-menu.schema.json +1 -1
- package/src/components/context-menu/context-menu.schema.ts +1 -1
- package/src/components/context-menu/context-menu.svelte +2 -2
- package/src/components/context-menu/context-menu.types.ts +1 -1
- package/src/components/copy-button/copy-button.schema.json +5 -0
- package/src/components/copy-button/copy-button.schema.ts +6 -0
- package/src/components/copy-button/copy-button.svelte +6 -2
- package/src/components/copy-button/copy-button.types.ts +2 -0
- package/src/components/data-grid/_internal/geometry.ts +32 -19
- package/src/components/data-grid/_internal/selection-model-test-support.svelte.ts +15 -0
- package/src/components/data-grid/_internal/selection-model.svelte.ts +15 -12
- package/src/components/data-grid/data-grid.css +5 -2
- package/src/components/data-grid/data-grid.schema.json +2 -2
- package/src/components/data-grid/data-grid.schema.ts +2 -2
- package/src/components/data-grid/data-grid.svelte +3 -3
- package/src/components/data-grid/data-grid.types.ts +2 -2
- package/src/components/date-picker/date-picker.css +7 -2
- package/src/components/date-picker/date-picker.schema.json +4 -0
- package/src/components/date-picker/date-picker.schema.ts +4 -0
- package/src/components/date-picker/date-picker.svelte +101 -73
- package/src/components/date-picker/date-picker.types.ts +2 -0
- package/src/components/date-range-field/date-range-field.css +0 -11
- package/src/components/date-range-field/date-range-field.schema.json +2 -1
- package/src/components/date-range-field/date-range-field.schema.ts +2 -1
- package/src/components/date-range-field/date-range-field.svelte +11 -76
- package/src/components/date-range-field/date-range-field.types.ts +10 -13
- package/src/components/diff-statistics/diff-statistics.css +1 -1
- package/src/components/diff-statistics/diff-statistics.svelte +8 -0
- package/src/components/drawer/drawer.css +14 -9
- package/src/components/dropdown/dropdown.css +1 -1
- package/src/components/dropdown-item/dropdown-item.svelte +1 -1
- package/src/components/dropdown-menu/dropdown-menu.svelte +11 -4
- package/src/components/dropdown-trigger/dropdown-trigger.schema.json +1 -1
- package/src/components/dropdown-trigger/dropdown-trigger.schema.ts +1 -1
- package/src/components/dropdown-trigger/dropdown-trigger.svelte +11 -3
- package/src/components/dropdown-trigger/dropdown-trigger.types.ts +1 -1
- package/src/components/event-stream-viewer/event-stream-viewer.css +8 -7
- package/src/components/event-stream-viewer/event-stream-viewer.examples.json +2 -2
- package/src/components/event-stream-viewer/event-stream-viewer.schema.json +3 -3
- package/src/components/event-stream-viewer/event-stream-viewer.schema.ts +3 -3
- package/src/components/event-stream-viewer/event-stream-viewer.svelte +59 -54
- package/src/components/event-stream-viewer/event-stream-viewer.types.ts +6 -6
- package/src/components/event-timeline/event-timeline-modal.ts +64 -0
- package/src/components/event-timeline/event-timeline.css +189 -5
- package/src/components/event-timeline/event-timeline.examples.json +6 -0
- package/src/components/event-timeline/event-timeline.svelte +397 -35
- package/src/components/faceted-filter-bar/faceted-filter-bar.css +1 -1
- package/src/components/faceted-filter-bar/faceted-filter-bar.examples.json +2 -2
- package/src/components/faceted-filter-bar/faceted-filter-bar.schema.json +5 -5
- package/src/components/faceted-filter-bar/faceted-filter-bar.schema.ts +5 -5
- package/src/components/faceted-filter-bar/faceted-filter-bar.svelte +18 -19
- package/src/components/faceted-filter-bar/faceted-filter-bar.types.ts +5 -5
- package/src/components/feature-section/feature-section.css +18 -3
- package/src/components/feature-section/feature-section.svelte +1 -1
- package/src/components/feature-section/feature-section.types.ts +10 -2
- package/src/components/feed/feed.svelte +1 -0
- package/src/components/file-upload/file-upload.examples.json +1 -1
- package/src/components/file-upload/file-upload.schema.json +5 -6
- package/src/components/file-upload/file-upload.schema.ts +5 -6
- package/src/components/file-upload/file-upload.svelte +10 -2
- package/src/components/file-upload/file-upload.types.ts +2 -2
- package/src/components/{floating-action-button/floating-action-button.css → floating-action/floating-action.css} +61 -49
- package/src/components/floating-action/floating-action.examples.json +13 -0
- package/src/components/{floating-action-button/floating-action-button.schema.json → floating-action/floating-action.schema.json} +3 -3
- package/src/components/{floating-action-button/floating-action-button.schema.ts → floating-action/floating-action.schema.ts} +3 -3
- package/src/components/{floating-action-button/floating-action-button.svelte → floating-action/floating-action.svelte} +21 -12
- package/src/components/{floating-action-button/floating-action-button.types.ts → floating-action/floating-action.types.ts} +25 -25
- package/src/components/floating-action/index.ts +11 -0
- package/src/components/footer/footer.css +17 -5
- package/src/components/form-field/form-field.schema.json +6 -2
- package/src/components/form-field/form-field.schema.ts +6 -2
- package/src/components/form-field/form-field.svelte +13 -60
- package/src/components/form-field/form-field.types.ts +8 -6
- package/src/components/form-section/form-section.schema.json +1 -1
- package/src/components/form-section/form-section.schema.ts +1 -1
- package/src/components/grid/grid.css +21 -0
- package/src/components/grid/grid.examples.json +6 -0
- package/src/components/grid/grid.schema.json +106 -1
- package/src/components/grid/grid.schema.ts +107 -1
- package/src/components/grid/grid.svelte +2 -1
- package/src/components/grid/grid.types.ts +12 -5
- package/src/components/grid-item/grid-item.schema.json +91 -1
- package/src/components/grid-item/grid-item.schema.ts +91 -1
- package/src/components/grid-item/grid-item.types.ts +2 -1
- package/src/components/grid-list/grid-list.css +2 -11
- package/src/components/grid-list/grid-list.svelte +8 -5
- package/src/components/grid-list/grid-list.types.ts +1 -1
- package/src/components/grid-list/grid-list.variables.json +1 -1
- package/src/components/grid-list/grid-list.variables.ts +1 -1
- package/src/components/hero-section/hero-section.css +88 -5
- package/src/components/hero-section/hero-section.svelte +4 -1
- package/src/components/hover-card/hover-card.css +4 -4
- package/src/components/hover-card/hover-card.schema.json +10 -6
- package/src/components/hover-card/hover-card.schema.ts +6 -2
- package/src/components/hover-card/hover-card.svelte +4 -4
- package/src/components/hover-card/hover-card.types.ts +6 -6
- package/src/components/image/image.schema.json +6 -7
- package/src/components/image/image.schema.ts +6 -7
- package/src/components/image/image.svelte +3 -3
- package/src/components/image/image.types.ts +3 -3
- package/src/components/input/input.css +10 -8
- package/src/components/input/input.schema.json +17 -3
- package/src/components/input/input.schema.ts +18 -3
- package/src/components/input/input.svelte +95 -27
- package/src/components/input/input.types.ts +15 -4
- package/src/components/invocation-rule-builder/invocation-rule-builder.css +5 -5
- package/src/components/invocation-rule-builder/invocation-rule-builder.svelte +8 -4
- package/src/components/json-editor/json-editor.css +35 -4
- package/src/components/json-editor/json-editor.schema.json +7 -4
- package/src/components/json-editor/json-editor.schema.ts +4 -1
- package/src/components/json-editor/json-editor.svelte +30 -8
- package/src/components/json-editor/json-editor.types.ts +4 -4
- package/src/components/json-schema-editor/form-view.svelte +2 -2
- package/src/components/json-schema-editor/json-schema-editor-impl.svelte +5 -5
- package/src/components/json-schema-editor/json-schema-editor-state.svelte.ts +4 -4
- package/src/components/json-schema-editor/json-schema-editor-state.types.ts +2 -2
- package/src/components/json-schema-editor/json-schema-editor.css +7 -9
- package/src/components/json-schema-editor/json-schema-editor.schema.json +2 -2
- package/src/components/json-schema-editor/json-schema-editor.schema.ts +2 -2
- package/src/components/json-schema-editor/json-schema-editor.types.ts +2 -2
- package/src/components/json-schema-editor/property-editor.svelte +6 -6
- package/src/components/json-schema-editor/property-list.svelte +12 -6
- package/src/components/json-viewer/json-viewer.css +1 -1
- package/src/components/kanban-board/kanban-board-column-reorder.svelte.ts +108 -0
- package/src/components/kanban-board/kanban-board-helpers.ts +91 -0
- package/src/components/kanban-board/kanban-board.css +22 -11
- package/src/components/kanban-board/kanban-board.schema.json +4 -2
- package/src/components/kanban-board/kanban-board.schema.ts +2 -0
- package/src/components/kanban-board/kanban-board.svelte +45 -169
- package/src/components/kanban-board/kanban-board.types.ts +2 -2
- package/src/components/kanban-board/kanban-board.variables.json +1 -0
- package/src/components/kanban-board/kanban-board.variables.ts +1 -0
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.css +2 -1
- package/src/components/keyboard-shortcuts/keyboard-shortcuts.svelte +2 -2
- package/src/components/label/label.schema.json +4 -5
- package/src/components/label/label.schema.ts +4 -5
- package/src/components/label/label.types.ts +1 -1
- package/src/components/line-chart/index.ts +1 -0
- package/src/components/line-chart/line-chart.css +4 -3
- package/src/components/line-chart/line-chart.svelte +163 -164
- package/src/components/load-more/load-more.examples.json +2 -2
- package/src/components/load-more/load-more.schema.json +11 -7
- package/src/components/load-more/load-more.schema.ts +7 -3
- package/src/components/load-more/load-more.svelte +77 -15
- package/src/components/load-more/load-more.types.ts +7 -7
- package/src/components/logo-cloud/logo-cloud.css +6 -23
- package/src/components/logo-cloud/logo-cloud.svelte +3 -2
- package/src/components/logo-cloud/logo-cloud.variables.json +1 -1
- package/src/components/logo-cloud/logo-cloud.variables.ts +1 -1
- package/src/components/marquee/marquee.svelte +20 -2
- package/src/components/matrix-chart/index.ts +1 -0
- package/src/components/matrix-chart/matrix-chart.css +1 -0
- package/src/components/matrix-chart/matrix-chart.schema.json +11 -6
- package/src/components/matrix-chart/matrix-chart.schema.ts +6 -1
- package/src/components/matrix-chart/matrix-chart.svelte +18 -24
- package/src/components/matrix-chart/matrix-chart.types.ts +7 -7
- package/src/components/media-controls/media-controls.css +2 -2
- package/src/components/media-controls/media-controls.examples.json +1 -1
- package/src/components/media-controls/media-controls.schema.json +3 -3
- package/src/components/media-controls/media-controls.schema.ts +3 -3
- package/src/components/media-controls/media-controls.svelte +4 -5
- package/src/components/media-controls/media-controls.types.ts +6 -6
- package/src/components/mega-menu/mega-menu-content.svelte +224 -0
- package/src/components/mega-menu/mega-menu.css +24 -5
- package/src/components/mega-menu/mega-menu.examples.json +1 -1
- package/src/components/mega-menu/mega-menu.schema.json +14 -6
- package/src/components/mega-menu/mega-menu.schema.ts +10 -2
- package/src/components/mega-menu/mega-menu.svelte +188 -113
- package/src/components/mega-menu/mega-menu.types.ts +9 -7
- package/src/components/menu-bar/menu-bar.css +8 -2
- package/src/components/menu-bar/menu-bar.schema.json +2 -1
- package/src/components/menu-bar/menu-bar.schema.ts +1 -0
- package/src/components/menu-bar/menu-bar.svelte +30 -6
- package/src/components/menu-bar/menu-bar.types.ts +1 -1
- package/src/components/meter/meter.svelte +2 -1
- package/src/components/meter/meter.types.ts +3 -1
- package/src/components/modal/modal.css +17 -11
- package/src/components/modal/modal.schema.json +2 -2
- package/src/components/modal/modal.schema.ts +1 -1
- package/src/components/modal/modal.svelte +8 -6
- package/src/components/modal/modal.types.ts +2 -2
- package/src/components/multi-select/multi-select.css +73 -12
- package/src/components/multi-select/multi-select.schema.json +1 -1
- package/src/components/multi-select/multi-select.schema.ts +1 -1
- package/src/components/multi-select/multi-select.svelte +102 -131
- package/src/components/multi-select/multi-select.types.ts +1 -1
- package/src/components/navigation-bar/navigation-bar-focus.ts +117 -0
- package/src/components/navigation-bar/navigation-bar.css +93 -48
- package/src/components/navigation-bar/navigation-bar.examples.json +1 -1
- package/src/components/navigation-bar/navigation-bar.schema.json +3 -2
- package/src/components/navigation-bar/navigation-bar.schema.ts +2 -1
- package/src/components/navigation-bar/navigation-bar.svelte +314 -18
- package/src/components/navigation-bar/navigation-bar.types.ts +5 -3
- package/src/components/navigation-item/navigation-item.svelte +1 -1
- package/src/components/newsletter-section/newsletter-section.css +1 -1
- package/src/components/newsletter-section/newsletter-section.svelte +1 -1
- package/src/components/number-input/number-input.css +10 -58
- package/src/components/number-input/number-input.schema.json +9 -15
- package/src/components/number-input/number-input.schema.ts +9 -16
- package/src/components/number-input/number-input.svelte +70 -86
- package/src/components/number-input/number-input.types.ts +5 -2
- package/src/components/page-header/page-header.css +18 -9
- package/src/components/page-header/page-header.examples.json +2 -2
- package/src/components/page-header/page-header.schema.json +9 -4
- package/src/components/page-header/page-header.schema.ts +11 -4
- package/src/components/page-header/page-header.svelte +31 -11
- package/src/components/page-header/page-header.types.ts +25 -7
- package/src/components/payload-inspector/payload-inspector.css +2 -2
- package/src/components/permission-matrix/permission-matrix.css +7 -4
- package/src/components/permission-matrix/permission-matrix.svelte +6 -6
- package/src/components/phone-input/phone-input.css +36 -55
- package/src/components/phone-input/phone-input.svelte +96 -29
- package/src/components/popover/index.ts +7 -1
- package/src/components/popover/popover.css +9 -9
- package/src/components/popover/popover.examples.json +1 -1
- package/src/components/popover/popover.schema.json +15 -1
- package/src/components/popover/popover.schema.ts +16 -1
- package/src/components/popover/popover.svelte +63 -13
- package/src/components/popover/popover.types.ts +7 -1
- package/src/components/portal/index.ts +5 -1
- package/src/components/portal/portal.svelte +9 -11
- package/src/components/portal/portal.utilities.svelte.ts +885 -31
- package/src/components/pricing-card/pricing-card.css +1 -1
- package/src/components/pricing-card/pricing-card.examples.json +2 -2
- package/src/components/pricing-card/pricing-card.schema.json +1 -1
- package/src/components/pricing-card/pricing-card.schema.ts +1 -1
- package/src/components/pricing-card/pricing-card.svelte +2 -2
- package/src/components/pricing-card/pricing-card.types.ts +1 -1
- package/src/components/pricing-section/pricing-section.svelte +1 -1
- package/src/components/radio-group/radio-group.css +42 -15
- package/src/components/rating/rating.svelte +3 -0
- package/src/components/resizable-panels/index.ts +1 -0
- package/src/components/resizable-panels/resizable-panels.schema.json +2 -2
- package/src/components/resizable-panels/resizable-panels.schema.ts +2 -2
- package/src/components/resizable-panels/resizable-panels.svelte +3 -3
- package/src/components/resizable-panels/resizable-panels.types.ts +4 -4
- package/src/components/run-step-timeline/run-step-timeline.svelte +7 -5
- package/src/components/schedule-builder/schedule-builder.svelte +47 -36
- package/src/components/schema-form/schema-form-body.svelte +59 -328
- package/src/components/schema-form/schema-form-state.svelte.ts +353 -0
- package/src/components/schema-form/schema-form.examples.json +1 -1
- package/src/components/schema-form/schema-form.schema.json +2 -2
- package/src/components/schema-form/schema-form.schema.ts +2 -2
- package/src/components/schema-form/schema-form.svelte +2 -2
- package/src/components/schema-form/schema-form.types.ts +3 -6
- package/src/components/scroll-area/scroll-area.examples.json +1 -1
- package/src/components/search-field/search-field.css +3 -85
- package/src/components/search-field/search-field.examples.json +1 -1
- package/src/components/search-field/search-field.schema.json +6 -11
- package/src/components/search-field/search-field.schema.ts +6 -11
- package/src/components/search-field/search-field.svelte +45 -42
- package/src/components/search-field/search-field.types.ts +4 -7
- package/src/components/secret-value-field/secret-value-field.examples.json +2 -2
- package/src/components/secret-value-field/secret-value-field.schema.json +2 -2
- package/src/components/secret-value-field/secret-value-field.schema.ts +2 -2
- package/src/components/secret-value-field/secret-value-field.svelte +19 -65
- package/src/components/secret-value-field/secret-value-field.types.ts +2 -2
- package/src/components/segment/index.ts +1 -1
- package/src/components/select/select.schema.json +8 -5
- package/src/components/select/select.schema.ts +8 -5
- package/src/components/select/select.svelte +28 -24
- package/src/components/select/select.types.ts +3 -1
- package/src/components/selectable-row/selectable-row.css +2 -1
- package/src/components/selection-popover/selection-popover.css +1 -1
- package/src/components/selection-popover/selection-popover.examples.json +5 -5
- package/src/components/selection-popover/selection-popover.schema.json +4 -4
- package/src/components/selection-popover/selection-popover.schema.ts +4 -4
- package/src/components/selection-popover/selection-popover.svelte +50 -10
- package/src/components/selection-popover/selection-popover.types.ts +4 -4
- package/src/components/selection-popover/virtual-keyboard-dismissal.svelte.ts +248 -0
- package/src/components/share-card/share-card.schema.json +6 -3
- package/src/components/share-card/share-card.schema.ts +3 -0
- package/src/components/share-card/share-card.svelte +6 -6
- package/src/components/share-card/share-card.types.ts +5 -5
- package/src/components/sheet/sheet.css +17 -10
- package/src/components/sheet/sheet.examples.json +1 -1
- package/src/components/sheet/sheet.schema.json +2 -2
- package/src/components/sheet/sheet.schema.ts +2 -2
- package/src/components/sheet/sheet.svelte +2 -2
- package/src/components/sheet/sheet.types.ts +2 -2
- package/src/components/shortcut-hint/shortcut-hint.svelte +1 -1
- package/src/components/side-navigation/side-navigation.svelte +3 -1
- package/src/components/side-navigation-group/side-navigation-group.schema.json +4 -5
- package/src/components/side-navigation-group/side-navigation-group.schema.ts +4 -5
- package/src/components/side-navigation-group/side-navigation-group.svelte +3 -1
- package/src/components/side-navigation-group/side-navigation-group.types.ts +1 -1
- package/src/components/sidebar/sidebar.css +1 -1
- package/src/components/sidebar/sidebar.svelte +12 -2
- package/src/components/slider/slider.css +2 -0
- package/src/components/slider/slider.examples.json +1 -1
- package/src/components/slider/slider.schema.json +0 -4
- package/src/components/slider/slider.schema.ts +0 -4
- package/src/components/slider/slider.svelte +19 -18
- package/src/components/slider/slider.types.ts +6 -9
- package/src/components/sortable-list/sortable-list.css +14 -3
- package/src/components/sortable-list/sortable-list.examples.json +1 -1
- package/src/components/sortable-list/sortable-list.schema.json +1 -1
- package/src/components/sortable-list/sortable-list.schema.ts +1 -1
- package/src/components/sortable-list/sortable-list.svelte +12 -4
- package/src/components/sortable-list/sortable-list.types.ts +1 -1
- package/src/components/source-diff-viewer/index.ts +2 -5
- package/src/components/source-diff-viewer/source-diff-viewer.binary-notice.ts +116 -0
- package/src/components/source-diff-viewer/source-diff-viewer.css +1 -1
- package/src/components/source-diff-viewer/source-diff-viewer.git-header-parser.ts +85 -0
- package/src/components/source-diff-viewer/source-diff-viewer.labels.ts +34 -0
- package/src/components/source-diff-viewer/source-diff-viewer.path-normalization.ts +145 -0
- package/src/components/source-diff-viewer/source-diff-viewer.schema.json +1 -1
- package/src/components/source-diff-viewer/source-diff-viewer.schema.ts +1 -1
- package/src/components/source-diff-viewer/source-diff-viewer.svelte +4 -2
- package/src/components/source-diff-viewer/source-diff-viewer.types.ts +1 -1
- package/src/components/source-diff-viewer/source-diff-viewer.utilities.ts +6 -362
- package/src/components/spectrogram/index.ts +1 -0
- package/src/components/spectrogram/spectrogram.svelte +19 -4
- package/src/components/spectrum-chart/index.ts +1 -0
- package/src/components/speed-dial/speed-dial-exit.ts +121 -0
- package/src/components/speed-dial/speed-dial-focus.ts +96 -0
- package/src/components/speed-dial/speed-dial.css +45 -25
- package/src/components/speed-dial/speed-dial.examples.json +1 -1
- package/src/components/speed-dial/speed-dial.schema.json +1 -1
- package/src/components/speed-dial/speed-dial.schema.ts +1 -1
- package/src/components/speed-dial/speed-dial.svelte +303 -20
- package/src/components/speed-dial/speed-dial.types.ts +1 -1
- package/src/components/speed-dial-action/speed-dial-action.svelte +7 -11
- package/src/components/speed-dial-action/speed-dial-action.types.ts +3 -3
- package/src/components/stacked-list-item/stacked-list-item.css +9 -0
- package/src/components/statistic/index.ts +10 -0
- package/src/components/statistic/statistic.css +81 -0
- package/src/components/{stat/stat.schema.json → statistic/statistic.schema.json} +2 -2
- package/src/components/{stat/stat.schema.ts → statistic/statistic.schema.ts} +2 -2
- package/src/components/{stat/stat.svelte → statistic/statistic.svelte} +10 -8
- package/src/components/{stat/stat.types.ts → statistic/statistic.types.ts} +11 -11
- package/src/components/statistic/statistic.variables.json +10 -0
- package/src/components/statistic/statistic.variables.ts +12 -0
- package/src/components/statistic-group/index.ts +20 -0
- package/{dist/components/stat-group/stat-group.css → src/components/statistic-group/statistic-group.css} +25 -24
- package/src/components/statistic-group/statistic-group.examples.json +37 -0
- package/src/components/{stat-group/stat-group.schema.json → statistic-group/statistic-group.schema.json} +5 -5
- package/src/components/{stat-group/stat-group.schema.ts → statistic-group/statistic-group.schema.ts} +5 -5
- package/src/components/{stat-group/stat-group.svelte → statistic-group/statistic-group.svelte} +1 -1
- package/src/components/{stat-group/stat-group.types.ts → statistic-group/statistic-group.types.ts} +14 -14
- package/src/components/statistic-group/statistic-group.variables.json +5 -0
- package/src/components/statistic-group/statistic-group.variables.ts +7 -0
- package/src/components/statistics-section/index.ts +6 -0
- package/src/components/{stats-section/stats-section.css → statistics-section/statistics-section.css} +7 -7
- package/src/components/statistics-section/statistics-section.examples.json +13 -0
- package/src/components/{stats-section/stats-section.schema.json → statistics-section/statistics-section.schema.json} +5 -5
- package/src/components/{stats-section/stats-section.schema.ts → statistics-section/statistics-section.schema.ts} +5 -5
- package/src/components/{stats-section/stats-section.svelte → statistics-section/statistics-section.svelte} +11 -11
- package/src/components/statistics-section/statistics-section.types.ts +72 -0
- package/src/components/status-dot/status-dot.css +1 -1
- package/src/components/status-dot/status-dot.examples.json +1 -1
- package/src/components/status-dot/status-dot.schema.json +2 -2
- package/src/components/status-dot/status-dot.schema.ts +2 -2
- package/src/components/status-dot/status-dot.svelte +2 -2
- package/src/components/status-dot/status-dot.types.ts +4 -4
- package/src/components/steps/steps.css +1 -0
- package/src/components/steps/steps.schema.json +8 -4
- package/src/components/steps/steps.schema.ts +4 -0
- package/src/components/steps/steps.svelte +2 -1
- package/src/components/steps/steps.types.ts +7 -3
- package/src/components/tab/tab.schema.json +2 -1
- package/src/components/tab/tab.schema.ts +1 -0
- package/src/components/tab/tab.svelte +30 -11
- package/src/components/tab/tab.types.ts +14 -2
- package/src/components/tab-list/tab-list.svelte +2 -1
- package/src/components/tab-list/tab-list.types.ts +2 -1
- package/src/components/tab-panel/tab-panel.svelte +2 -1
- package/src/components/tab-panel/tab-panel.types.ts +2 -1
- package/src/components/table/table.css +3 -2
- package/src/components/table/table.examples.json +1 -1
- package/src/components/table/table.schema.json +8 -4
- package/src/components/table/table.schema.ts +4 -0
- package/src/components/table/table.svelte +2 -2
- package/src/components/table/table.types.ts +7 -4
- package/src/components/table-body/table-body.svelte +2 -2
- package/src/components/table-body/table-body.types.ts +2 -1
- package/src/components/table-cell/table-cell.schema.json +4 -2
- package/src/components/table-cell/table-cell.schema.ts +2 -0
- package/src/components/table-cell/table-cell.types.ts +2 -1
- package/src/components/table-header/table-header.schema.json +8 -8
- package/src/components/table-header/table-header.schema.ts +9 -9
- package/src/components/table-header/table-header.svelte +6 -6
- package/src/components/table-header/table-header.types.ts +48 -13
- package/src/components/table-header-cell/table-header-cell.schema.json +6 -3
- package/src/components/table-header-cell/table-header-cell.schema.ts +3 -0
- package/src/components/table-header-cell/table-header-cell.svelte +1 -1
- package/src/components/table-header-cell/table-header-cell.types.ts +3 -2
- package/src/components/table-of-contents/table-of-contents-active-heading.svelte.ts +158 -0
- package/src/components/table-of-contents/table-of-contents-heading-registry.svelte.ts +253 -0
- package/src/components/table-of-contents/table-of-contents.css +13 -1
- package/src/components/table-of-contents/table-of-contents.schema.json +1 -1
- package/src/components/table-of-contents/table-of-contents.schema.ts +2 -1
- package/src/components/table-of-contents/table-of-contents.svelte +11 -380
- package/src/components/table-of-contents/table-of-contents.types.ts +4 -1
- package/src/components/table-row/table-row.schema.json +2 -2
- package/src/components/table-row/table-row.schema.ts +2 -2
- package/src/components/table-row/table-row.svelte +6 -6
- package/src/components/table-row/table-row.types.ts +6 -6
- package/src/components/tabs/tabs.schema.json +9 -2
- package/src/components/tabs/tabs.schema.ts +7 -0
- package/src/components/tabs/tabs.svelte +71 -25
- package/src/components/tabs/tabs.types.ts +9 -10
- package/src/components/tag-input/tag-input.examples.json +3 -3
- package/src/components/tag-input/tag-input.schema.json +8 -12
- package/src/components/tag-input/tag-input.schema.ts +5 -9
- package/src/components/tag-input/tag-input.svelte +20 -17
- package/src/components/tag-input/tag-input.types.ts +8 -12
- package/src/components/team-section/team-section.css +2 -43
- package/src/components/team-section/team-section.examples.json +1 -1
- package/src/components/team-section/team-section.schema.json +1 -1
- package/src/components/team-section/team-section.schema.ts +1 -1
- package/src/components/team-section/team-section.svelte +20 -18
- package/src/components/team-section/team-section.types.ts +2 -2
- package/src/components/testimonial-section/testimonial-section.css +2 -47
- package/src/components/testimonial-section/testimonial-section.svelte +19 -20
- package/src/components/textarea/textarea.examples.json +2 -2
- package/src/components/textarea/textarea.schema.json +6 -7
- package/src/components/textarea/textarea.schema.ts +6 -7
- package/src/components/textarea/textarea.svelte +50 -17
- package/src/components/textarea/textarea.types.ts +3 -3
- package/src/components/time-field/time-field.css +29 -7
- package/src/components/time-field/time-field.schema.json +0 -3
- package/src/components/time-field/time-field.schema.ts +0 -3
- package/src/components/time-field/time-field.svelte +37 -20
- package/src/components/time-field/time-field.types.ts +0 -3
- package/src/components/timeline/timeline.svelte +1 -0
- package/src/components/toast-region/toast-region.svelte +12 -32
- package/src/components/toggle/toggle.schema.json +5 -0
- package/src/components/toggle/toggle.schema.ts +5 -0
- package/src/components/toggle/toggle.svelte +41 -24
- package/src/components/toggle/toggle.types.ts +3 -1
- package/src/components/toolbar/toolbar.svelte +26 -6
- package/src/components/tooltip/tooltip.css +1 -1
- package/src/components/tooltip/tooltip.schema.json +2 -1
- package/src/components/tooltip/tooltip.schema.ts +1 -0
- package/src/components/tooltip/tooltip.svelte +2 -5
- package/src/components/tooltip/tooltip.types.ts +1 -1
- package/src/components/transfer-list/transfer-list.css +15 -1
- package/src/components/transfer-list/transfer-list.svelte +14 -10
- package/src/components/tree/index.ts +1 -0
- package/src/components/tree/tree.examples.json +1 -1
- package/src/components/tree/tree.schema.json +3 -3
- package/src/components/tree/tree.schema.ts +3 -3
- package/src/components/tree/tree.svelte +50 -146
- package/src/components/tree/tree.types.ts +3 -3
- package/src/components/tree-item/index.ts +1 -0
- package/src/components/tree-item/tree-item-async-load.svelte.ts +64 -0
- package/src/components/tree-item/tree-item-drag.svelte.ts +129 -0
- package/src/components/tree-item/tree-item-label-highlight.ts +32 -0
- package/src/components/tree-item/tree-item-rename.svelte.ts +154 -0
- package/src/components/tree-item/tree-item.schema.json +4 -4
- package/src/components/tree-item/tree-item.schema.ts +4 -4
- package/src/components/tree-item/tree-item.svelte +75 -336
- package/src/components/tree-item/tree-item.types.ts +4 -4
- package/src/components/typography/typography.examples.json +1 -1
- package/src/components/typography/typography.schema.json +1 -1
- package/src/components/typography/typography.schema.ts +1 -1
- package/src/components/typography/typography.svelte +3 -3
- package/src/components/typography/typography.types.ts +7 -22
- package/src/components/waveform/index.ts +1 -0
- package/src/index.ts +71 -28
- package/src/schema-types.ts +10 -2
- package/src/styles/components/_floating-surface.css +0 -55
- package/src/styles/components/_row-item.css +53 -0
- package/src/styles/components.css +7 -5
- package/src/styles/index.css +1 -0
- package/src/styles/tokens-base.css +53 -20
- package/src/styles/utilities.css +1 -1
- package/src/utilities/focus.ts +530 -0
- package/src/utilities/html-element-types.ts +48 -0
- package/src/utilities/sortable-controller.svelte.ts +2 -2
- package/src/utilities/use-intersection.svelte.ts +4 -3
- package/src/utilities/use-resize-observer.svelte.ts +8 -4
- package/src/utilities/value-change.ts +7 -3
- package/dist/cli/mcp-dependencies.d.ts +0 -4
- package/dist/cli/mcp.d.ts +0 -2
- package/dist/components/copy-button/__test-helpers__/copy-state-wrapper.svelte.d.ts +0 -6
- package/dist/components/copy-button/use-copy-state.svelte.d.ts +0 -57
- package/dist/components/cta-section/index.d.ts +0 -5
- package/dist/components/floating-action-button/index.d.ts +0 -5
- package/dist/components/stat/index.d.ts +0 -5
- package/dist/components/stat/stat.css +0 -81
- package/dist/components/stat/stat.svelte.d.ts +0 -18
- package/dist/components/stat-group/index.d.ts +0 -12
- package/dist/components/stat-group/stat-group.svelte.d.ts +0 -18
- package/dist/components/stats-section/index.d.ts +0 -5
- package/dist/components/stats-section/stats-section.svelte.d.ts +0 -19
- package/dist/components/stats-section/stats-section.types.d.ts +0 -58
- package/dist/server/components/cta-section/index.js +0 -16
- package/dist/server/components/floating-action-button/index.js +0 -16
- package/dist/server/components/stat-group/index.js +0 -17
- package/dist/server/components/stats-section/index.js +0 -18
- package/dist/server/index.server-42qeekwc.js +0 -10
- package/dist/server/index.server-435sj5m6.js +0 -125
- package/dist/server/index.server-4wx0qven.js +0 -221
- package/dist/server/index.server-62mtrvr7.js +0 -111
- package/dist/server/index.server-8c6cck0y.js +0 -247
- package/dist/server/index.server-8s3qm06c.js +0 -15
- package/dist/server/index.server-8xvc73zh.js +0 -169
- package/dist/server/index.server-8zazgeyc.js +0 -95
- package/dist/server/index.server-b4gp066a.js +0 -222
- package/dist/server/index.server-dj47xy3x.js +0 -400
- package/dist/server/index.server-dpw9dc92.js +0 -149
- package/dist/server/index.server-egk5q7aj.js +0 -148
- package/dist/server/index.server-ex3ea9z0.js +0 -109
- package/dist/server/index.server-hess6rtb.js +0 -45
- package/dist/server/index.server-psnzdn2g.js +0 -9
- package/dist/server/index.server-r70ezssy.js +0 -145
- package/dist/server/index.server-rsqa7q4a.js +0 -90
- package/dist/server/index.server-sd68dmej.js +0 -169
- package/dist/server/index.server-smw54qtg.js +0 -22
- package/dist/server/index.server-tbyd4re7.js +0 -203
- package/dist/server/index.server-tkrsxwye.js +0 -307
- package/dist/server/index.server-w7a9knxq.js +0 -666
- package/dist/server/index.server-wcadkrpf.js +0 -239
- package/dist/server/index.server-y35dk7yx.js +0 -9
- package/dist/server/index.server-zsjf8enc.js +0 -53
- package/dist/server/index.server-zwjp26z8.js +0 -21
- package/src/components/copy-button/__test-helpers__/copy-state-wrapper.svelte +0 -21
- package/src/components/copy-button/use-copy-state.svelte.ts +0 -76
- package/src/components/cta-section/cta-section.examples.json +0 -13
- package/src/components/cta-section/index.ts +0 -6
- package/src/components/floating-action-button/floating-action-button.examples.json +0 -13
- package/src/components/floating-action-button/index.ts +0 -11
- package/src/components/stat/index.ts +0 -6
- package/src/components/stat/stat.css +0 -81
- package/src/components/stat/stat.variables.json +0 -10
- package/src/components/stat/stat.variables.ts +0 -12
- package/src/components/stat-group/index.ts +0 -16
- package/src/components/stat-group/stat-group.examples.json +0 -37
- package/src/components/stat-group/stat-group.variables.json +0 -5
- package/src/components/stat-group/stat-group.variables.ts +0 -7
- package/src/components/stats-section/index.ts +0 -6
- package/src/components/stats-section/stats-section.examples.json +0 -13
- package/src/components/stats-section/stats-section.types.ts +0 -61
- /package/dist/components/{cta-section/cta-section.css.d.ts → call-to-action-section/call-to-action-section.css.d.ts} +0 -0
- /package/dist/components/{cta-section/cta-section.schema.d.ts → call-to-action-section/call-to-action-section.schema.d.ts} +0 -0
- /package/dist/components/{cta-section/cta-section.variables.d.ts → call-to-action-section/call-to-action-section.variables.d.ts} +0 -0
- /package/dist/components/{floating-action-button/floating-action-button.css.d.ts → floating-action/floating-action.css.d.ts} +0 -0
- /package/dist/components/{floating-action-button/floating-action-button.schema.d.ts → floating-action/floating-action.schema.d.ts} +0 -0
- /package/dist/components/{floating-action-button/floating-action-button.variables.d.ts → floating-action/floating-action.variables.d.ts} +0 -0
- /package/dist/components/{stat/stat.css.d.ts → statistic/statistic.css.d.ts} +0 -0
- /package/dist/components/{stat/stat.schema.d.ts → statistic/statistic.schema.d.ts} +0 -0
- /package/dist/components/{stat/stat.variables.d.ts → statistic/statistic.variables.d.ts} +0 -0
- /package/dist/components/{stat-group/stat-group.css.d.ts → statistic-group/statistic-group.css.d.ts} +0 -0
- /package/dist/components/{stat-group/stat-group.schema.d.ts → statistic-group/statistic-group.schema.d.ts} +0 -0
- /package/dist/components/{stat-group/stat-group.variables.d.ts → statistic-group/statistic-group.variables.d.ts} +0 -0
- /package/dist/components/{stats-section/stats-section.css.d.ts → statistics-section/statistics-section.css.d.ts} +0 -0
- /package/dist/components/{stats-section/stats-section.schema.d.ts → statistics-section/statistics-section.schema.d.ts} +0 -0
- /package/dist/components/{stats-section/stats-section.variables.d.ts → statistics-section/statistics-section.variables.d.ts} +0 -0
- /package/src/components/{cta-section/cta-section.variables.json → call-to-action-section/call-to-action-section.variables.json} +0 -0
- /package/src/components/{cta-section/cta-section.variables.ts → call-to-action-section/call-to-action-section.variables.ts} +0 -0
- /package/src/components/{floating-action-button/floating-action-button.variables.json → floating-action/floating-action.variables.json} +0 -0
- /package/src/components/{floating-action-button/floating-action-button.variables.ts → floating-action/floating-action.variables.ts} +0 -0
- /package/src/components/{stats-section/stats-section.variables.json → statistics-section/statistics-section.variables.json} +0 -0
- /package/src/components/{stats-section/stats-section.variables.ts → statistics-section/statistics-section.variables.ts} +0 -0
|
@@ -241,7 +241,7 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
241
241
|
}
|
|
242
242
|
return coords;
|
|
243
243
|
}
|
|
244
|
-
async function detectOverflow(
|
|
244
|
+
async function detectOverflow(state4, options) {
|
|
245
245
|
var _await$platform$isEle;
|
|
246
246
|
if (options === undefined) {
|
|
247
247
|
options = {};
|
|
@@ -253,14 +253,14 @@ async function detectOverflow(state2, options) {
|
|
|
253
253
|
rects,
|
|
254
254
|
elements,
|
|
255
255
|
strategy
|
|
256
|
-
} =
|
|
256
|
+
} = state4;
|
|
257
257
|
const {
|
|
258
258
|
boundary = "clippingAncestors",
|
|
259
259
|
rootBoundary = "viewport",
|
|
260
260
|
elementContext = "floating",
|
|
261
261
|
altBoundary = false,
|
|
262
262
|
padding = 0
|
|
263
|
-
} = evaluate(options,
|
|
263
|
+
} = evaluate(options, state4);
|
|
264
264
|
const paddingObject = getPaddingObject(padding);
|
|
265
265
|
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
266
266
|
const element = elements[altBoundary ? altContext : elementContext];
|
|
@@ -344,19 +344,19 @@ function getRectsByLine(rects) {
|
|
|
344
344
|
}
|
|
345
345
|
return groups.map((rect) => rectToClientRect(getBoundingRect(rect)));
|
|
346
346
|
}
|
|
347
|
-
async function convertValueToCoords(
|
|
347
|
+
async function convertValueToCoords(state4, options) {
|
|
348
348
|
const {
|
|
349
349
|
placement,
|
|
350
350
|
platform,
|
|
351
351
|
elements
|
|
352
|
-
} =
|
|
352
|
+
} = state4;
|
|
353
353
|
const rtl = await (platform.isRTL == null ? undefined : platform.isRTL(elements.floating));
|
|
354
354
|
const side = getSide(placement);
|
|
355
355
|
const alignment = getAlignment(placement);
|
|
356
356
|
const isVertical = getSideAxis(placement) === "y";
|
|
357
357
|
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
358
358
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
359
|
-
const rawValue = evaluate(options,
|
|
359
|
+
const rawValue = evaluate(options, state4);
|
|
360
360
|
let {
|
|
361
361
|
mainAxis,
|
|
362
362
|
crossAxis,
|
|
@@ -470,7 +470,7 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
470
470
|
}, arrow = (options) => ({
|
|
471
471
|
name: "arrow",
|
|
472
472
|
options,
|
|
473
|
-
async fn(
|
|
473
|
+
async fn(state4) {
|
|
474
474
|
const {
|
|
475
475
|
x,
|
|
476
476
|
y,
|
|
@@ -479,11 +479,11 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
479
479
|
platform,
|
|
480
480
|
elements,
|
|
481
481
|
middlewareData
|
|
482
|
-
} =
|
|
482
|
+
} = state4;
|
|
483
483
|
const {
|
|
484
484
|
element,
|
|
485
485
|
padding = 0
|
|
486
|
-
} = evaluate(options,
|
|
486
|
+
} = evaluate(options, state4) || {};
|
|
487
487
|
if (element == null) {
|
|
488
488
|
return {};
|
|
489
489
|
}
|
|
@@ -535,7 +535,7 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
535
535
|
return {
|
|
536
536
|
name: "autoPlacement",
|
|
537
537
|
options,
|
|
538
|
-
async fn(
|
|
538
|
+
async fn(state4) {
|
|
539
539
|
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
|
|
540
540
|
const {
|
|
541
541
|
rects,
|
|
@@ -543,16 +543,16 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
543
543
|
placement,
|
|
544
544
|
platform,
|
|
545
545
|
elements
|
|
546
|
-
} =
|
|
546
|
+
} = state4;
|
|
547
547
|
const {
|
|
548
548
|
crossAxis = false,
|
|
549
549
|
alignment,
|
|
550
550
|
allowedPlacements = placements,
|
|
551
551
|
autoAlignment = true,
|
|
552
552
|
...detectOverflowOptions
|
|
553
|
-
} = evaluate(options,
|
|
553
|
+
} = evaluate(options, state4);
|
|
554
554
|
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
555
|
-
const overflow = await platform.detectOverflow(
|
|
555
|
+
const overflow = await platform.detectOverflow(state4, detectOverflowOptions);
|
|
556
556
|
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? undefined : _middlewareData$autoP.index) || 0;
|
|
557
557
|
const currentPlacement = placements$1[currentIndex];
|
|
558
558
|
if (currentPlacement == null) {
|
|
@@ -610,7 +610,7 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
610
610
|
return {
|
|
611
611
|
name: "flip",
|
|
612
612
|
options,
|
|
613
|
-
async fn(
|
|
613
|
+
async fn(state4) {
|
|
614
614
|
var _middlewareData$arrow, _middlewareData$flip;
|
|
615
615
|
const {
|
|
616
616
|
placement,
|
|
@@ -619,7 +619,7 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
619
619
|
initialPlacement,
|
|
620
620
|
platform,
|
|
621
621
|
elements
|
|
622
|
-
} =
|
|
622
|
+
} = state4;
|
|
623
623
|
const {
|
|
624
624
|
mainAxis: checkMainAxis = true,
|
|
625
625
|
crossAxis: checkCrossAxis = true,
|
|
@@ -628,7 +628,7 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
628
628
|
fallbackAxisSideDirection = "none",
|
|
629
629
|
flipAlignment = true,
|
|
630
630
|
...detectOverflowOptions
|
|
631
|
-
} = evaluate(options,
|
|
631
|
+
} = evaluate(options, state4);
|
|
632
632
|
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
633
633
|
return {};
|
|
634
634
|
}
|
|
@@ -642,7 +642,7 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
642
642
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
643
643
|
}
|
|
644
644
|
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
645
|
-
const overflow = await platform.detectOverflow(
|
|
645
|
+
const overflow = await platform.detectOverflow(state4, detectOverflowOptions);
|
|
646
646
|
const overflows = [];
|
|
647
647
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? undefined : _middlewareData$flip.overflows) || [];
|
|
648
648
|
if (checkMainAxis) {
|
|
@@ -714,18 +714,18 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
714
714
|
return {
|
|
715
715
|
name: "hide",
|
|
716
716
|
options,
|
|
717
|
-
async fn(
|
|
717
|
+
async fn(state4) {
|
|
718
718
|
const {
|
|
719
719
|
rects,
|
|
720
720
|
platform
|
|
721
|
-
} =
|
|
721
|
+
} = state4;
|
|
722
722
|
const {
|
|
723
723
|
strategy = "referenceHidden",
|
|
724
724
|
...detectOverflowOptions
|
|
725
|
-
} = evaluate(options,
|
|
725
|
+
} = evaluate(options, state4);
|
|
726
726
|
switch (strategy) {
|
|
727
727
|
case "referenceHidden": {
|
|
728
|
-
const overflow = await platform.detectOverflow(
|
|
728
|
+
const overflow = await platform.detectOverflow(state4, {
|
|
729
729
|
...detectOverflowOptions,
|
|
730
730
|
elementContext: "reference"
|
|
731
731
|
});
|
|
@@ -738,7 +738,7 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
738
738
|
};
|
|
739
739
|
}
|
|
740
740
|
case "escaped": {
|
|
741
|
-
const overflow = await platform.detectOverflow(
|
|
741
|
+
const overflow = await platform.detectOverflow(state4, {
|
|
742
742
|
...detectOverflowOptions,
|
|
743
743
|
altBoundary: true
|
|
744
744
|
});
|
|
@@ -763,19 +763,19 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
763
763
|
return {
|
|
764
764
|
name: "inline",
|
|
765
765
|
options,
|
|
766
|
-
async fn(
|
|
766
|
+
async fn(state4) {
|
|
767
767
|
const {
|
|
768
768
|
placement,
|
|
769
769
|
elements,
|
|
770
770
|
rects,
|
|
771
771
|
platform,
|
|
772
772
|
strategy
|
|
773
|
-
} =
|
|
773
|
+
} = state4;
|
|
774
774
|
const {
|
|
775
775
|
padding = 2,
|
|
776
776
|
x,
|
|
777
777
|
y
|
|
778
|
-
} = evaluate(options,
|
|
778
|
+
} = evaluate(options, state4);
|
|
779
779
|
const nativeClientRects = Array.from(await (platform.getClientRects == null ? undefined : platform.getClientRects(elements.reference)) || []);
|
|
780
780
|
const clientRects = getRectsByLine(nativeClientRects);
|
|
781
781
|
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
|
|
@@ -853,15 +853,15 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
853
853
|
return {
|
|
854
854
|
name: "offset",
|
|
855
855
|
options,
|
|
856
|
-
async fn(
|
|
856
|
+
async fn(state4) {
|
|
857
857
|
var _middlewareData$offse, _middlewareData$arrow;
|
|
858
858
|
const {
|
|
859
859
|
x,
|
|
860
860
|
y,
|
|
861
861
|
placement,
|
|
862
862
|
middlewareData
|
|
863
|
-
} =
|
|
864
|
-
const diffCoords = await convertValueToCoords(
|
|
863
|
+
} = state4;
|
|
864
|
+
const diffCoords = await convertValueToCoords(state4, options);
|
|
865
865
|
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? undefined : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
866
866
|
return {};
|
|
867
867
|
}
|
|
@@ -882,13 +882,13 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
882
882
|
return {
|
|
883
883
|
name: "shift",
|
|
884
884
|
options,
|
|
885
|
-
async fn(
|
|
885
|
+
async fn(state4) {
|
|
886
886
|
const {
|
|
887
887
|
x,
|
|
888
888
|
y,
|
|
889
889
|
placement,
|
|
890
890
|
platform
|
|
891
|
-
} =
|
|
891
|
+
} = state4;
|
|
892
892
|
const {
|
|
893
893
|
mainAxis: checkMainAxis = true,
|
|
894
894
|
crossAxis: checkCrossAxis = false,
|
|
@@ -905,12 +905,12 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
905
905
|
}
|
|
906
906
|
},
|
|
907
907
|
...detectOverflowOptions
|
|
908
|
-
} = evaluate(options,
|
|
908
|
+
} = evaluate(options, state4);
|
|
909
909
|
const coords = {
|
|
910
910
|
x,
|
|
911
911
|
y
|
|
912
912
|
};
|
|
913
|
-
const overflow = await platform.detectOverflow(
|
|
913
|
+
const overflow = await platform.detectOverflow(state4, detectOverflowOptions);
|
|
914
914
|
const crossAxis = getSideAxis(getSide(placement));
|
|
915
915
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
916
916
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -930,7 +930,7 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
930
930
|
crossAxisCoord = clamp(min2, crossAxisCoord, max2);
|
|
931
931
|
}
|
|
932
932
|
const limitedCoords = limiter.fn({
|
|
933
|
-
...
|
|
933
|
+
...state4,
|
|
934
934
|
[mainAxis]: mainAxisCoord,
|
|
935
935
|
[crossAxis]: crossAxisCoord
|
|
936
936
|
});
|
|
@@ -953,19 +953,19 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
953
953
|
}
|
|
954
954
|
return {
|
|
955
955
|
options,
|
|
956
|
-
fn(
|
|
956
|
+
fn(state4) {
|
|
957
957
|
const {
|
|
958
958
|
x,
|
|
959
959
|
y,
|
|
960
960
|
placement,
|
|
961
961
|
rects,
|
|
962
962
|
middlewareData
|
|
963
|
-
} =
|
|
963
|
+
} = state4;
|
|
964
964
|
const {
|
|
965
965
|
offset: offset2 = 0,
|
|
966
966
|
mainAxis: checkMainAxis = true,
|
|
967
967
|
crossAxis: checkCrossAxis = true
|
|
968
|
-
} = evaluate(options,
|
|
968
|
+
} = evaluate(options, state4);
|
|
969
969
|
const coords = {
|
|
970
970
|
x,
|
|
971
971
|
y
|
|
@@ -974,7 +974,7 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
974
974
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
975
975
|
let mainAxisCoord = coords[mainAxis];
|
|
976
976
|
let crossAxisCoord = coords[crossAxis];
|
|
977
|
-
const rawOffset = evaluate(offset2,
|
|
977
|
+
const rawOffset = evaluate(offset2, state4);
|
|
978
978
|
const computedOffset = typeof rawOffset === "number" ? {
|
|
979
979
|
mainAxis: rawOffset,
|
|
980
980
|
crossAxis: 0
|
|
@@ -1018,19 +1018,19 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
1018
1018
|
return {
|
|
1019
1019
|
name: "size",
|
|
1020
1020
|
options,
|
|
1021
|
-
async fn(
|
|
1021
|
+
async fn(state4) {
|
|
1022
1022
|
var _state$middlewareData, _state$middlewareData2;
|
|
1023
1023
|
const {
|
|
1024
1024
|
placement,
|
|
1025
1025
|
rects,
|
|
1026
1026
|
platform,
|
|
1027
1027
|
elements
|
|
1028
|
-
} =
|
|
1028
|
+
} = state4;
|
|
1029
1029
|
const {
|
|
1030
1030
|
apply = () => {},
|
|
1031
1031
|
...detectOverflowOptions
|
|
1032
|
-
} = evaluate(options,
|
|
1033
|
-
const overflow = await platform.detectOverflow(
|
|
1032
|
+
} = evaluate(options, state4);
|
|
1033
|
+
const overflow = await platform.detectOverflow(state4, detectOverflowOptions);
|
|
1034
1034
|
const side = getSide(placement);
|
|
1035
1035
|
const alignment = getAlignment(placement);
|
|
1036
1036
|
const isYAxis = getSideAxis(placement) === "y";
|
|
@@ -1051,13 +1051,13 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
1051
1051
|
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
1052
1052
|
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
1053
1053
|
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
1054
|
-
const noShift = !
|
|
1054
|
+
const noShift = !state4.middlewareData.shift;
|
|
1055
1055
|
let availableHeight = overflowAvailableHeight;
|
|
1056
1056
|
let availableWidth = overflowAvailableWidth;
|
|
1057
|
-
if ((_state$middlewareData =
|
|
1057
|
+
if ((_state$middlewareData = state4.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
|
|
1058
1058
|
availableWidth = maximumClippingWidth;
|
|
1059
1059
|
}
|
|
1060
|
-
if ((_state$middlewareData2 =
|
|
1060
|
+
if ((_state$middlewareData2 = state4.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
|
|
1061
1061
|
availableHeight = maximumClippingHeight;
|
|
1062
1062
|
}
|
|
1063
1063
|
if (noShift && !alignment) {
|
|
@@ -1072,7 +1072,7 @@ var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config)
|
|
|
1072
1072
|
}
|
|
1073
1073
|
}
|
|
1074
1074
|
await apply({
|
|
1075
|
-
...
|
|
1075
|
+
...state4,
|
|
1076
1076
|
availableWidth,
|
|
1077
1077
|
availableHeight
|
|
1078
1078
|
});
|
|
@@ -1292,10 +1292,10 @@ function getScale(element) {
|
|
|
1292
1292
|
const {
|
|
1293
1293
|
width,
|
|
1294
1294
|
height,
|
|
1295
|
-
$: $
|
|
1295
|
+
$: $6
|
|
1296
1296
|
} = getCssDimensions(domElement);
|
|
1297
|
-
let x = ($
|
|
1298
|
-
let y = ($
|
|
1297
|
+
let x = ($6 ? round(rect.width) : rect.width) / width;
|
|
1298
|
+
let y = ($6 ? round(rect.height) : rect.height) / height;
|
|
1299
1299
|
if (!x || !Number.isFinite(x)) {
|
|
1300
1300
|
x = 1;
|
|
1301
1301
|
}
|
|
@@ -1884,7 +1884,7 @@ var init_floating_ui_dom = __esm(() => {
|
|
|
1884
1884
|
|
|
1885
1885
|
// src/components/portal/portal.svelte
|
|
1886
1886
|
import"svelte/internal/disclose-version";
|
|
1887
|
-
import * as $
|
|
1887
|
+
import * as $3 from "svelte/internal/client";
|
|
1888
1888
|
|
|
1889
1889
|
// src/utilities/class-names.ts
|
|
1890
1890
|
function classNames(...parts) {
|
|
@@ -1892,7 +1892,8 @@ function classNames(...parts) {
|
|
|
1892
1892
|
}
|
|
1893
1893
|
|
|
1894
1894
|
// src/components/portal/portal.utilities.svelte.ts
|
|
1895
|
-
import * as $ from "svelte/internal/client";
|
|
1895
|
+
import * as $2 from "svelte/internal/client";
|
|
1896
|
+
import { untrack } from "svelte";
|
|
1896
1897
|
|
|
1897
1898
|
// ../../node_modules/esm-env/true.js
|
|
1898
1899
|
var true_default = true;
|
|
@@ -1911,6 +1912,21 @@ function readOption(value) {
|
|
|
1911
1912
|
return isOptionGetter(value) ? value() : value;
|
|
1912
1913
|
}
|
|
1913
1914
|
|
|
1915
|
+
// src/utilities/use-reduced-motion.svelte.ts
|
|
1916
|
+
import * as $ from "svelte/internal/client";
|
|
1917
|
+
import { MediaQuery } from "svelte/reactivity";
|
|
1918
|
+
function useReducedMotion() {
|
|
1919
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
1920
|
+
return { current: false };
|
|
1921
|
+
}
|
|
1922
|
+
const query = new MediaQuery("(prefers-reduced-motion: reduce)", false);
|
|
1923
|
+
return {
|
|
1924
|
+
get current() {
|
|
1925
|
+
return query.current;
|
|
1926
|
+
}
|
|
1927
|
+
};
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1914
1930
|
// src/components/portal/portal.utilities.svelte.ts
|
|
1915
1931
|
function resolvePortalTarget(target) {
|
|
1916
1932
|
if (typeof document === "undefined")
|
|
@@ -1928,21 +1944,202 @@ function resolvePortalTarget(target) {
|
|
|
1928
1944
|
return { kind: "unresolved", key: target };
|
|
1929
1945
|
}
|
|
1930
1946
|
}
|
|
1947
|
+
function findNearestOpenTopLayer(source, isModalDialog = (element) => element.matches(":modal")) {
|
|
1948
|
+
const selfTrigger = closestAcrossShadow(source, ".cinder-popover__trigger");
|
|
1949
|
+
let candidate = source;
|
|
1950
|
+
while (candidate) {
|
|
1951
|
+
try {
|
|
1952
|
+
if (candidate.matches("dialog") && isModalDialog(candidate) || candidate.matches("[popover]") && candidate.matches(":popover-open"))
|
|
1953
|
+
return candidate;
|
|
1954
|
+
} catch {}
|
|
1955
|
+
if (candidate !== selfTrigger) {
|
|
1956
|
+
const ownerId = candidate.dataset["cinderPortalOwner"];
|
|
1957
|
+
if (ownerId) {
|
|
1958
|
+
const root = candidate.getRootNode();
|
|
1959
|
+
const localOwner = root instanceof ShadowRoot ? Array.from(root.querySelectorAll("[id]")).find((element) => element.id === ownerId) : root instanceof Document ? root.getElementById(ownerId) : null;
|
|
1960
|
+
const owner = localOwner ?? document.getElementById(ownerId);
|
|
1961
|
+
if (owner instanceof HTMLElement)
|
|
1962
|
+
return owner;
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
const rootNode = candidate.getRootNode();
|
|
1966
|
+
const shadowHost = rootNode instanceof ShadowRoot ? rootNode.host : null;
|
|
1967
|
+
candidate = candidate.parentElement ?? (shadowHost instanceof HTMLElement ? shadowHost : null);
|
|
1968
|
+
}
|
|
1969
|
+
return null;
|
|
1970
|
+
}
|
|
1971
|
+
function getInheritedPortalStyle(source) {
|
|
1972
|
+
if (!source || typeof window === "undefined")
|
|
1973
|
+
return "";
|
|
1974
|
+
const computed = getComputedStyle(source);
|
|
1975
|
+
const hasDirectTypography = source.tagName === "NAV" || source.parentElement === null && [
|
|
1976
|
+
"font-family",
|
|
1977
|
+
"font-size",
|
|
1978
|
+
"font-weight",
|
|
1979
|
+
"line-height",
|
|
1980
|
+
"letter-spacing"
|
|
1981
|
+
].some((property) => source.style.getPropertyValue(property) !== "");
|
|
1982
|
+
const typographySource = hasDirectTypography ? source : source.parentElement ?? source;
|
|
1983
|
+
const typography = getComputedStyle(typographySource);
|
|
1984
|
+
const inherited = document.createElement("div").style;
|
|
1985
|
+
const customPropertyNames = new Set;
|
|
1986
|
+
let customPropertySource = source;
|
|
1987
|
+
while (customPropertySource) {
|
|
1988
|
+
for (const property of Array.from(customPropertySource.style)) {
|
|
1989
|
+
if (property.startsWith("--cinder-"))
|
|
1990
|
+
customPropertyNames.add(property);
|
|
1991
|
+
}
|
|
1992
|
+
customPropertySource = customPropertySource.parentElement ?? getShadowHost(customPropertySource);
|
|
1993
|
+
}
|
|
1994
|
+
for (let index = 0;index < computed.length; index += 1) {
|
|
1995
|
+
const property = computed.item(index);
|
|
1996
|
+
if (property.startsWith("--cinder-"))
|
|
1997
|
+
customPropertyNames.add(property);
|
|
1998
|
+
}
|
|
1999
|
+
for (const property of customPropertyNames) {
|
|
2000
|
+
const value = computed.getPropertyValue(property);
|
|
2001
|
+
if (value)
|
|
2002
|
+
inherited.setProperty(property, value);
|
|
2003
|
+
}
|
|
2004
|
+
const colorScheme = computed.colorScheme || source.style.colorScheme;
|
|
2005
|
+
if (colorScheme) {
|
|
2006
|
+
inherited.setProperty("color-scheme", colorScheme);
|
|
2007
|
+
}
|
|
2008
|
+
if (!source.hasAttribute("dir") && computed.direction) {
|
|
2009
|
+
inherited.setProperty("direction", computed.direction);
|
|
2010
|
+
}
|
|
2011
|
+
for (const property of [
|
|
2012
|
+
"font-family",
|
|
2013
|
+
"font-size",
|
|
2014
|
+
"font-weight",
|
|
2015
|
+
"line-height",
|
|
2016
|
+
"letter-spacing"
|
|
2017
|
+
]) {
|
|
2018
|
+
const value = typography.getPropertyValue(property);
|
|
2019
|
+
if (value)
|
|
2020
|
+
inherited.setProperty(property, value);
|
|
2021
|
+
}
|
|
2022
|
+
for (const property of Array.from(source.style)) {
|
|
2023
|
+
if (!property.startsWith("--cinder-"))
|
|
2024
|
+
continue;
|
|
2025
|
+
const rawValue = source.style.getPropertyValue(property);
|
|
2026
|
+
if (!rawValue.includes("var("))
|
|
2027
|
+
inherited.setProperty(property, rawValue);
|
|
2028
|
+
}
|
|
2029
|
+
if (source.style.colorScheme)
|
|
2030
|
+
inherited.setProperty("color-scheme", source.style.colorScheme);
|
|
2031
|
+
return inherited.cssText;
|
|
2032
|
+
}
|
|
2033
|
+
function createInheritedPortalStyle(source, active) {
|
|
2034
|
+
let style = $2.state("");
|
|
2035
|
+
const reducedMotion = useReducedMotion();
|
|
2036
|
+
$2.user_effect(() => {
|
|
2037
|
+
reducedMotion.current;
|
|
2038
|
+
if (!active()) {
|
|
2039
|
+
$2.set(style, "");
|
|
2040
|
+
return;
|
|
2041
|
+
}
|
|
2042
|
+
const inheritanceSource = source();
|
|
2043
|
+
const syncStyle = () => {
|
|
2044
|
+
$2.set(style, getInheritedPortalStyle(inheritanceSource), true);
|
|
2045
|
+
};
|
|
2046
|
+
syncStyle();
|
|
2047
|
+
const stopObserving = observeInheritedPortalAttributes(inheritanceSource, true, syncStyle);
|
|
2048
|
+
if (typeof window === "undefined")
|
|
2049
|
+
return stopObserving ?? undefined;
|
|
2050
|
+
const mediaQueries = [
|
|
2051
|
+
"(prefers-color-scheme: dark)",
|
|
2052
|
+
"(prefers-contrast: more)",
|
|
2053
|
+
"(forced-colors: active)"
|
|
2054
|
+
].map((query) => window.matchMedia(query));
|
|
2055
|
+
const onMediaChange = () => syncStyle();
|
|
2056
|
+
for (const mediaQuery of mediaQueries)
|
|
2057
|
+
mediaQuery.addEventListener("change", onMediaChange);
|
|
2058
|
+
window.addEventListener("resize", onMediaChange);
|
|
2059
|
+
return () => {
|
|
2060
|
+
stopObserving?.();
|
|
2061
|
+
for (const mediaQuery of mediaQueries)
|
|
2062
|
+
mediaQuery.removeEventListener("change", onMediaChange);
|
|
2063
|
+
window.removeEventListener("resize", onMediaChange);
|
|
2064
|
+
};
|
|
2065
|
+
});
|
|
2066
|
+
return {
|
|
2067
|
+
get style() {
|
|
2068
|
+
return $2.get(style);
|
|
2069
|
+
}
|
|
2070
|
+
};
|
|
2071
|
+
}
|
|
1931
2072
|
function copyInheritedPortalAttributes(element, source, inheritAttributes, fallbackAttributes = {
|
|
1932
2073
|
dir: element.getAttribute("dir"),
|
|
2074
|
+
lang: element.getAttribute("lang"),
|
|
1933
2075
|
dataTheme: element.getAttribute("data-theme"),
|
|
1934
2076
|
theme: element.getAttribute("data-cinder-theme")
|
|
1935
2077
|
}) {
|
|
2078
|
+
const inheritedDirectionAttribute = "data-cinder-portal-inherited-direction";
|
|
1936
2079
|
const preservesExplicitDirection = fallbackAttributes.preserveDirection || element.dataset["cinderExplicitDirection"] === "true";
|
|
1937
|
-
|
|
2080
|
+
let inheritedDir = null;
|
|
2081
|
+
let generatedDirectionFallback = null;
|
|
2082
|
+
if (inheritAttributes && source && !preservesExplicitDirection) {
|
|
2083
|
+
let computedDirection = null;
|
|
2084
|
+
let hasReadComputedDirection = false;
|
|
2085
|
+
const readComputedDirection = () => {
|
|
2086
|
+
if (!hasReadComputedDirection) {
|
|
2087
|
+
computedDirection = typeof getComputedStyle === "function" ? getComputedStyle(source).direction : null;
|
|
2088
|
+
hasReadComputedDirection = true;
|
|
2089
|
+
}
|
|
2090
|
+
return computedDirection;
|
|
2091
|
+
};
|
|
2092
|
+
let directionSource = source;
|
|
2093
|
+
let crossedGeneratedDirectionBoundary = false;
|
|
2094
|
+
while (directionSource) {
|
|
2095
|
+
const matchingDirection = closestAcrossShadow(directionSource, "[dir]");
|
|
2096
|
+
if (!matchingDirection) {
|
|
2097
|
+
directionSource = getShadowHost(directionSource);
|
|
2098
|
+
continue;
|
|
2099
|
+
}
|
|
2100
|
+
if (!matchingDirection.hasAttribute(inheritedDirectionAttribute)) {
|
|
2101
|
+
const explicitDirection = matchingDirection.getAttribute("dir");
|
|
2102
|
+
const normalizedExplicitDirection = explicitDirection?.toLowerCase();
|
|
2103
|
+
if (crossedGeneratedDirectionBoundary) {
|
|
2104
|
+
if (normalizedExplicitDirection === "auto")
|
|
2105
|
+
inheritedDir = "auto";
|
|
2106
|
+
break;
|
|
2107
|
+
}
|
|
2108
|
+
const documentComputedDirection = matchingDirection === document.documentElement && normalizedExplicitDirection !== "auto" ? readComputedDirection() : null;
|
|
2109
|
+
inheritedDir = normalizedExplicitDirection === "auto" ? normalizedExplicitDirection : documentComputedDirection || explicitDirection;
|
|
2110
|
+
break;
|
|
2111
|
+
}
|
|
2112
|
+
const generatedDirection = matchingDirection.getAttribute("dir");
|
|
2113
|
+
generatedDirectionFallback ??= generatedDirection;
|
|
2114
|
+
crossedGeneratedDirectionBoundary = true;
|
|
2115
|
+
directionSource = matchingDirection.parentElement ?? getShadowHost(matchingDirection);
|
|
2116
|
+
}
|
|
2117
|
+
if (inheritedDir === null) {
|
|
2118
|
+
inheritedDir = readComputedDirection() || generatedDirectionFallback;
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
1938
2121
|
const nextDir = inheritedDir ?? fallbackAttributes.dir;
|
|
1939
2122
|
if (nextDir) {
|
|
1940
2123
|
element.setAttribute("dir", nextDir);
|
|
2124
|
+
if (!preservesExplicitDirection && inheritedDir !== null) {
|
|
2125
|
+
element.setAttribute(inheritedDirectionAttribute, "true");
|
|
2126
|
+
} else {
|
|
2127
|
+
element.removeAttribute(inheritedDirectionAttribute);
|
|
2128
|
+
}
|
|
1941
2129
|
} else {
|
|
1942
2130
|
element.removeAttribute("dir");
|
|
2131
|
+
element.removeAttribute(inheritedDirectionAttribute);
|
|
2132
|
+
}
|
|
2133
|
+
const preservesExplicitLanguage = fallbackAttributes.preserveLanguage ?? fallbackAttributes.lang !== null;
|
|
2134
|
+
const inheritedLanguage = inheritAttributes && source && !preservesExplicitLanguage ? closestAcrossShadow(source, "[lang]")?.getAttribute("lang") : null;
|
|
2135
|
+
const nextLanguage = inheritedLanguage ?? fallbackAttributes.lang;
|
|
2136
|
+
if (nextLanguage !== null && nextLanguage !== undefined) {
|
|
2137
|
+
element.setAttribute("lang", nextLanguage);
|
|
2138
|
+
} else {
|
|
2139
|
+
element.removeAttribute("lang");
|
|
1943
2140
|
}
|
|
1944
2141
|
const preservesExplicitDataTheme = fallbackAttributes.preserveDataTheme === true;
|
|
1945
|
-
const inheritedDataTheme = inheritAttributes && source && !preservesExplicitDataTheme && fallbackAttributes.dataTheme === null ? source
|
|
2142
|
+
const inheritedDataTheme = inheritAttributes && source && !preservesExplicitDataTheme && fallbackAttributes.dataTheme === null ? closestAcrossShadow(source, "[data-theme]")?.getAttribute("data-theme") : null;
|
|
1946
2143
|
const nextDataTheme = inheritedDataTheme ?? fallbackAttributes.dataTheme;
|
|
1947
2144
|
if (nextDataTheme) {
|
|
1948
2145
|
element.setAttribute("data-theme", nextDataTheme);
|
|
@@ -1950,7 +2147,7 @@ function copyInheritedPortalAttributes(element, source, inheritAttributes, fallb
|
|
|
1950
2147
|
element.removeAttribute("data-theme");
|
|
1951
2148
|
}
|
|
1952
2149
|
const preservesExplicitTheme = fallbackAttributes.preserveTheme === true;
|
|
1953
|
-
const inheritedTheme = inheritAttributes && source && !preservesExplicitTheme && fallbackAttributes.theme === null ? source
|
|
2150
|
+
const inheritedTheme = inheritAttributes && source && !preservesExplicitTheme && fallbackAttributes.theme === null ? closestAcrossShadow(source, "[data-cinder-theme]")?.getAttribute("data-cinder-theme") : null;
|
|
1954
2151
|
const nextTheme = inheritedTheme ?? fallbackAttributes.theme;
|
|
1955
2152
|
if (nextTheme) {
|
|
1956
2153
|
element.setAttribute("data-cinder-theme", nextTheme);
|
|
@@ -1959,33 +2156,585 @@ function copyInheritedPortalAttributes(element, source, inheritAttributes, fallb
|
|
|
1959
2156
|
}
|
|
1960
2157
|
return {
|
|
1961
2158
|
dir: inheritedDir ?? null,
|
|
2159
|
+
lang: inheritedLanguage ?? null,
|
|
1962
2160
|
dataTheme: inheritedDataTheme ?? null,
|
|
1963
2161
|
theme: inheritedTheme ?? null
|
|
1964
2162
|
};
|
|
1965
2163
|
}
|
|
2164
|
+
function redispatchPortaledEvent(event, sourceTarget) {
|
|
2165
|
+
if (!sourceTarget)
|
|
2166
|
+
return false;
|
|
2167
|
+
const originalTarget = event.target;
|
|
2168
|
+
const originalComposedPath = event.composedPath();
|
|
2169
|
+
const eventInit = {
|
|
2170
|
+
bubbles: event.bubbles,
|
|
2171
|
+
cancelable: event.cancelable,
|
|
2172
|
+
composed: event.composed
|
|
2173
|
+
};
|
|
2174
|
+
for (const property of [
|
|
2175
|
+
"view",
|
|
2176
|
+
"key",
|
|
2177
|
+
"code",
|
|
2178
|
+
"location",
|
|
2179
|
+
"repeat",
|
|
2180
|
+
"isComposing",
|
|
2181
|
+
"button",
|
|
2182
|
+
"buttons",
|
|
2183
|
+
"movementX",
|
|
2184
|
+
"movementY",
|
|
2185
|
+
"which",
|
|
2186
|
+
"clientX",
|
|
2187
|
+
"clientY",
|
|
2188
|
+
"screenX",
|
|
2189
|
+
"screenY",
|
|
2190
|
+
"ctrlKey",
|
|
2191
|
+
"shiftKey",
|
|
2192
|
+
"altKey",
|
|
2193
|
+
"metaKey",
|
|
2194
|
+
"relatedTarget",
|
|
2195
|
+
"pointerId",
|
|
2196
|
+
"pointerType",
|
|
2197
|
+
"isPrimary",
|
|
2198
|
+
"detail",
|
|
2199
|
+
"data",
|
|
2200
|
+
"inputType",
|
|
2201
|
+
"dataTransfer",
|
|
2202
|
+
"pressure",
|
|
2203
|
+
"tiltX",
|
|
2204
|
+
"tiltY",
|
|
2205
|
+
"twist",
|
|
2206
|
+
"tangentialPressure",
|
|
2207
|
+
"width",
|
|
2208
|
+
"height"
|
|
2209
|
+
]) {
|
|
2210
|
+
if (property in event)
|
|
2211
|
+
eventInit[property] = Reflect.get(event, property);
|
|
2212
|
+
}
|
|
2213
|
+
let bridgedEvent;
|
|
2214
|
+
try {
|
|
2215
|
+
bridgedEvent = Reflect.construct(event.constructor, [event.type, eventInit]);
|
|
2216
|
+
} catch {
|
|
2217
|
+
bridgedEvent = new Event(event.type, eventInit);
|
|
2218
|
+
}
|
|
2219
|
+
for (const property of ["movementX", "movementY", "which", "width", "height"]) {
|
|
2220
|
+
if (!(property in event))
|
|
2221
|
+
continue;
|
|
2222
|
+
const value = Reflect.get(event, property);
|
|
2223
|
+
if (Reflect.get(bridgedEvent, property) === value)
|
|
2224
|
+
continue;
|
|
2225
|
+
try {
|
|
2226
|
+
Object.defineProperty(bridgedEvent, property, { configurable: true, value });
|
|
2227
|
+
} catch {}
|
|
2228
|
+
}
|
|
2229
|
+
redispatchedPortalEvents.add(bridgedEvent);
|
|
2230
|
+
Object.defineProperty(bridgedEvent, "target", { configurable: true, value: originalTarget });
|
|
2231
|
+
const nativeComposedPath = bridgedEvent.composedPath.bind(bridgedEvent);
|
|
2232
|
+
let dispatchComplete = false;
|
|
2233
|
+
Object.defineProperty(bridgedEvent, "composedPath", {
|
|
2234
|
+
configurable: true,
|
|
2235
|
+
value: () => {
|
|
2236
|
+
return dispatchComplete ? [...originalComposedPath] : nativeComposedPath();
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
2239
|
+
if (event.defaultPrevented)
|
|
2240
|
+
bridgedEvent.preventDefault();
|
|
2241
|
+
event.stopPropagation();
|
|
2242
|
+
const dispatched = sourceTarget.dispatchEvent(bridgedEvent);
|
|
2243
|
+
dispatchComplete = true;
|
|
2244
|
+
if (!dispatched) {
|
|
2245
|
+
event.preventDefault();
|
|
2246
|
+
}
|
|
2247
|
+
return true;
|
|
2248
|
+
}
|
|
2249
|
+
var redispatchedPortalEvents = new WeakSet;
|
|
2250
|
+
function getShadowHost(element) {
|
|
2251
|
+
const root = element.getRootNode();
|
|
2252
|
+
return root instanceof ShadowRoot && root.host instanceof HTMLElement ? root.host : null;
|
|
2253
|
+
}
|
|
2254
|
+
function closestAcrossShadow(element, selector) {
|
|
2255
|
+
let current = element;
|
|
2256
|
+
while (current) {
|
|
2257
|
+
const match = current.closest(selector);
|
|
2258
|
+
if (match)
|
|
2259
|
+
return match;
|
|
2260
|
+
current = getShadowHost(current);
|
|
2261
|
+
}
|
|
2262
|
+
return null;
|
|
2263
|
+
}
|
|
2264
|
+
function isRedispatchedPortaledEvent(event) {
|
|
2265
|
+
return redispatchedPortalEvents.has(event);
|
|
2266
|
+
}
|
|
2267
|
+
function isEffectivelyDisabled(source) {
|
|
2268
|
+
if (source.matches(":disabled"))
|
|
2269
|
+
return true;
|
|
2270
|
+
const disabledFieldset = source.closest("fieldset[disabled]");
|
|
2271
|
+
if (!disabledFieldset)
|
|
2272
|
+
return false;
|
|
2273
|
+
const firstLegend = disabledFieldset.querySelector(":scope > legend");
|
|
2274
|
+
return !firstLegend?.contains(source);
|
|
2275
|
+
}
|
|
2276
|
+
function isPortalSourceUnavailable(source) {
|
|
2277
|
+
if (isEffectivelyDisabled(source))
|
|
2278
|
+
return true;
|
|
2279
|
+
if (closestAcrossShadow(source, '[hidden], [inert], [aria-hidden="true"]'))
|
|
2280
|
+
return true;
|
|
2281
|
+
if (typeof window === "undefined" || typeof getComputedStyle !== "function")
|
|
2282
|
+
return false;
|
|
2283
|
+
let ancestor = source;
|
|
2284
|
+
while (ancestor) {
|
|
2285
|
+
const computed = getComputedStyle(ancestor);
|
|
2286
|
+
if (computed.display === "none" || computed.visibility === "hidden")
|
|
2287
|
+
return true;
|
|
2288
|
+
ancestor = ancestor.parentElement ?? getShadowHost(ancestor);
|
|
2289
|
+
}
|
|
2290
|
+
return false;
|
|
2291
|
+
}
|
|
2292
|
+
function observePortalSourceAvailability(source, onChange) {
|
|
2293
|
+
if (!source)
|
|
2294
|
+
return () => {};
|
|
2295
|
+
const syncAvailability = () => {
|
|
2296
|
+
onChange(isPortalSourceUnavailable(source));
|
|
2297
|
+
};
|
|
2298
|
+
if (typeof MutationObserver === "undefined") {
|
|
2299
|
+
syncAvailability();
|
|
2300
|
+
return () => {};
|
|
2301
|
+
}
|
|
2302
|
+
const observer = new MutationObserver(syncAvailability);
|
|
2303
|
+
let ancestor = source;
|
|
2304
|
+
while (ancestor) {
|
|
2305
|
+
observer.observe(ancestor, {
|
|
2306
|
+
attributes: true,
|
|
2307
|
+
attributeFilter: [
|
|
2308
|
+
"hidden",
|
|
2309
|
+
"inert",
|
|
2310
|
+
"aria-hidden",
|
|
2311
|
+
"disabled",
|
|
2312
|
+
"class",
|
|
2313
|
+
"style"
|
|
2314
|
+
]
|
|
2315
|
+
});
|
|
2316
|
+
ancestor = ancestor.parentElement ?? getShadowHost(ancestor);
|
|
2317
|
+
}
|
|
2318
|
+
syncAvailability();
|
|
2319
|
+
const resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(syncAvailability);
|
|
2320
|
+
resizeObserver?.observe(source);
|
|
2321
|
+
return () => {
|
|
2322
|
+
observer.disconnect();
|
|
2323
|
+
resizeObserver?.disconnect();
|
|
2324
|
+
};
|
|
2325
|
+
}
|
|
1966
2326
|
function observeInheritedPortalAttributes(source, inheritAttributes, syncAttributes) {
|
|
1967
|
-
if (!inheritAttributes || !source
|
|
2327
|
+
if (!inheritAttributes || !source)
|
|
1968
2328
|
return null;
|
|
1969
|
-
const observer = new MutationObserver(() => {
|
|
2329
|
+
const observer = typeof MutationObserver === "undefined" ? null : new MutationObserver(() => {
|
|
1970
2330
|
syncAttributes();
|
|
1971
2331
|
});
|
|
2332
|
+
const observedElements = [];
|
|
1972
2333
|
function observe(elementToObserve) {
|
|
1973
|
-
if (!elementToObserve || observedElements.includes(elementToObserve))
|
|
2334
|
+
if (!observer || !elementToObserve || observedElements.includes(elementToObserve))
|
|
1974
2335
|
return;
|
|
1975
2336
|
observedElements.push(elementToObserve);
|
|
1976
2337
|
observer.observe(elementToObserve, {
|
|
1977
2338
|
attributes: true,
|
|
1978
|
-
attributeFilter: [
|
|
2339
|
+
attributeFilter: [
|
|
2340
|
+
"class",
|
|
2341
|
+
"style",
|
|
2342
|
+
"dir",
|
|
2343
|
+
"lang",
|
|
2344
|
+
"data-theme",
|
|
2345
|
+
"data-cinder-theme"
|
|
2346
|
+
]
|
|
1979
2347
|
});
|
|
1980
2348
|
}
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
2349
|
+
function rebindObservedElements() {
|
|
2350
|
+
const nextElements = [];
|
|
2351
|
+
let ancestor = source ?? null;
|
|
2352
|
+
while (ancestor) {
|
|
2353
|
+
nextElements.push(ancestor);
|
|
2354
|
+
ancestor = ancestor.parentElement ?? getShadowHost(ancestor);
|
|
2355
|
+
}
|
|
2356
|
+
if (!nextElements.includes(document.documentElement)) {
|
|
2357
|
+
nextElements.push(document.documentElement);
|
|
2358
|
+
}
|
|
2359
|
+
if (observedElements.length === nextElements.length && observedElements.every((element, index) => element === nextElements[index])) {
|
|
2360
|
+
return;
|
|
2361
|
+
}
|
|
2362
|
+
observer?.disconnect();
|
|
2363
|
+
observedElements.length = 0;
|
|
2364
|
+
for (const element of nextElements)
|
|
2365
|
+
observe(element);
|
|
1986
2366
|
}
|
|
1987
|
-
|
|
1988
|
-
|
|
2367
|
+
rebindObservedElements();
|
|
2368
|
+
const resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(syncAttributes);
|
|
2369
|
+
resizeObserver?.observe(source);
|
|
2370
|
+
const stopObservingComputedDirection = observeComputedDirection(source, syncAttributes, rebindObservedElements);
|
|
2371
|
+
return () => {
|
|
2372
|
+
observer?.disconnect();
|
|
2373
|
+
resizeObserver?.disconnect();
|
|
2374
|
+
stopObservingComputedDirection();
|
|
2375
|
+
};
|
|
2376
|
+
}
|
|
2377
|
+
var computedDirectionObservations = new Set;
|
|
2378
|
+
var observedMediaQueries = new Map;
|
|
2379
|
+
var directionInvalidationRoots = new Map;
|
|
2380
|
+
var directionInvalidationEvents = [
|
|
2381
|
+
"focusin",
|
|
2382
|
+
"focusout",
|
|
2383
|
+
"pointerover",
|
|
2384
|
+
"pointerout",
|
|
2385
|
+
"input",
|
|
2386
|
+
"change",
|
|
2387
|
+
"toggle",
|
|
2388
|
+
"pointerdown",
|
|
2389
|
+
"pointerup",
|
|
2390
|
+
"pointercancel",
|
|
2391
|
+
"keydown",
|
|
2392
|
+
"keyup"
|
|
2393
|
+
];
|
|
2394
|
+
var directionInvalidationObserver = null;
|
|
2395
|
+
var directionInvalidationFrame = null;
|
|
2396
|
+
var directionInvalidationDocument = null;
|
|
2397
|
+
var directionInvalidationStarted = false;
|
|
2398
|
+
function invalidateComputedDirections() {
|
|
2399
|
+
if (directionInvalidationFrame !== null || typeof window === "undefined")
|
|
2400
|
+
return;
|
|
2401
|
+
if (typeof window.requestAnimationFrame !== "function") {
|
|
2402
|
+
syncComputedDirections();
|
|
2403
|
+
return;
|
|
2404
|
+
}
|
|
2405
|
+
directionInvalidationFrame = window.requestAnimationFrame(() => {
|
|
2406
|
+
directionInvalidationFrame = null;
|
|
2407
|
+
syncComputedDirections();
|
|
2408
|
+
});
|
|
2409
|
+
}
|
|
2410
|
+
function invalidatePortalDirection() {
|
|
2411
|
+
if (computedDirectionObservations.size === 0)
|
|
2412
|
+
return;
|
|
2413
|
+
refreshMediaQueryObservers();
|
|
2414
|
+
invalidateComputedDirections();
|
|
2415
|
+
}
|
|
2416
|
+
function syncComputedDirections() {
|
|
2417
|
+
const topologyChanges = new Set;
|
|
2418
|
+
for (const current of computedDirectionObservations) {
|
|
2419
|
+
if (!rebindComputedDirectionObservation(current))
|
|
2420
|
+
continue;
|
|
2421
|
+
topologyChanges.add(current);
|
|
2422
|
+
current.rebindInheritedAttributes();
|
|
2423
|
+
}
|
|
2424
|
+
if (topologyChanges.size > 0)
|
|
2425
|
+
refreshMediaQueryObservers();
|
|
2426
|
+
if (typeof getComputedStyle !== "function")
|
|
2427
|
+
return;
|
|
2428
|
+
for (const current of computedDirectionObservations) {
|
|
2429
|
+
const direction = getComputedStyle(current.source).direction;
|
|
2430
|
+
if (direction === current.direction && !topologyChanges.has(current))
|
|
2431
|
+
continue;
|
|
2432
|
+
current.direction = direction;
|
|
2433
|
+
current.sync();
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
function collectMediaQueries(rules, queries) {
|
|
2437
|
+
for (const rule of Array.from(rules)) {
|
|
2438
|
+
const conditionText = Reflect.get(rule, "conditionText");
|
|
2439
|
+
const media = Reflect.get(rule, "media");
|
|
2440
|
+
if (typeof conditionText === "string" && media && typeof media === "object") {
|
|
2441
|
+
queries.add(conditionText);
|
|
2442
|
+
}
|
|
2443
|
+
const mediaText = media && Reflect.get(media, "mediaText");
|
|
2444
|
+
if (typeof mediaText === "string" && mediaText)
|
|
2445
|
+
queries.add(mediaText);
|
|
2446
|
+
const importedStylesheet = Reflect.get(rule, "styleSheet");
|
|
2447
|
+
if (importedStylesheet) {
|
|
2448
|
+
try {
|
|
2449
|
+
const importedMedia = Reflect.get(importedStylesheet, "media");
|
|
2450
|
+
const importedMediaText = importedMedia && Reflect.get(importedMedia, "mediaText");
|
|
2451
|
+
if (typeof importedMediaText === "string" && importedMediaText)
|
|
2452
|
+
queries.add(importedMediaText);
|
|
2453
|
+
const importedRules = Reflect.get(importedStylesheet, "cssRules");
|
|
2454
|
+
if (isCssRuleCollection(importedRules))
|
|
2455
|
+
collectMediaQueries(importedRules, queries);
|
|
2456
|
+
} catch {}
|
|
2457
|
+
}
|
|
2458
|
+
const nestedRules = Reflect.get(rule, "cssRules");
|
|
2459
|
+
if (isCssRuleCollection(nestedRules)) {
|
|
2460
|
+
try {
|
|
2461
|
+
collectMediaQueries(nestedRules, queries);
|
|
2462
|
+
} catch {}
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
function addMediaQueryListener(mediaQuery) {
|
|
2467
|
+
if (typeof mediaQuery.addEventListener === "function") {
|
|
2468
|
+
mediaQuery.addEventListener("change", invalidateComputedDirections);
|
|
2469
|
+
} else {
|
|
2470
|
+
mediaQuery.addListener?.(invalidateComputedDirections);
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
function removeMediaQueryListener(mediaQuery) {
|
|
2474
|
+
if (typeof mediaQuery.removeEventListener === "function") {
|
|
2475
|
+
mediaQuery.removeEventListener("change", invalidateComputedDirections);
|
|
2476
|
+
} else {
|
|
2477
|
+
mediaQuery.removeListener?.(invalidateComputedDirections);
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
function isCssRuleCollection(value) {
|
|
2481
|
+
if (typeof CSSRuleList !== "undefined" && value instanceof CSSRuleList)
|
|
2482
|
+
return true;
|
|
2483
|
+
return typeof value === "object" && value !== null && Symbol.iterator in value;
|
|
2484
|
+
}
|
|
2485
|
+
function refreshMediaQueryObservers() {
|
|
2486
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function")
|
|
2487
|
+
return;
|
|
2488
|
+
const queries = new Set;
|
|
2489
|
+
const roots = new Set([document]);
|
|
2490
|
+
for (const current of computedDirectionObservations) {
|
|
2491
|
+
const root = current.source.getRootNode();
|
|
2492
|
+
if (root instanceof ShadowRoot)
|
|
2493
|
+
roots.add(root);
|
|
2494
|
+
for (const observedRoot of current.roots)
|
|
2495
|
+
roots.add(observedRoot);
|
|
2496
|
+
}
|
|
2497
|
+
for (const root of roots) {
|
|
2498
|
+
const stylesheets = [
|
|
2499
|
+
...Array.from(root.styleSheets ?? []),
|
|
2500
|
+
...Array.from(root.adoptedStyleSheets ?? [])
|
|
2501
|
+
];
|
|
2502
|
+
for (const stylesheet of stylesheets) {
|
|
2503
|
+
try {
|
|
2504
|
+
const mediaText = stylesheet.media?.mediaText;
|
|
2505
|
+
if (mediaText)
|
|
2506
|
+
queries.add(mediaText);
|
|
2507
|
+
collectMediaQueries(stylesheet.cssRules, queries);
|
|
2508
|
+
} catch {}
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2511
|
+
for (const [query, mediaQuery] of observedMediaQueries) {
|
|
2512
|
+
if (queries.has(query))
|
|
2513
|
+
continue;
|
|
2514
|
+
removeMediaQueryListener(mediaQuery);
|
|
2515
|
+
observedMediaQueries.delete(query);
|
|
2516
|
+
}
|
|
2517
|
+
for (const query of queries) {
|
|
2518
|
+
if (observedMediaQueries.has(query))
|
|
2519
|
+
continue;
|
|
2520
|
+
const mediaQuery = window.matchMedia(query);
|
|
2521
|
+
addMediaQueryListener(mediaQuery);
|
|
2522
|
+
observedMediaQueries.set(query, mediaQuery);
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
function startDirectionInvalidationObservers() {
|
|
2526
|
+
if (directionInvalidationStarted || typeof document === "undefined")
|
|
2527
|
+
return;
|
|
2528
|
+
directionInvalidationStarted = true;
|
|
2529
|
+
directionInvalidationDocument = document;
|
|
2530
|
+
directionInvalidationObserver = typeof MutationObserver === "undefined" ? null : new MutationObserver((mutations) => {
|
|
2531
|
+
if (mutations.some(isStylesheetMutation)) {
|
|
2532
|
+
refreshMediaQueryObservers();
|
|
2533
|
+
}
|
|
2534
|
+
invalidateComputedDirections();
|
|
2535
|
+
});
|
|
2536
|
+
directionInvalidationObserver?.observe(document.documentElement, {
|
|
2537
|
+
attributes: true,
|
|
2538
|
+
characterData: true,
|
|
2539
|
+
childList: true,
|
|
2540
|
+
subtree: true
|
|
2541
|
+
});
|
|
2542
|
+
document.addEventListener("load", handleStylesheetLoad, true);
|
|
2543
|
+
if (typeof window !== "undefined" && typeof window.addEventListener === "function") {
|
|
2544
|
+
window.addEventListener("resize", invalidateComputedDirections);
|
|
2545
|
+
window.addEventListener("orientationchange", invalidateComputedDirections);
|
|
2546
|
+
window.addEventListener("hashchange", invalidateComputedDirections);
|
|
2547
|
+
for (const event of directionInvalidationEvents) {
|
|
2548
|
+
document.addEventListener(event, invalidateComputedDirections, true);
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
refreshMediaQueryObservers();
|
|
2552
|
+
}
|
|
2553
|
+
function isStylesheetMutation(mutation) {
|
|
2554
|
+
if (mutation.type === "attributes") {
|
|
2555
|
+
return (mutation.target instanceof HTMLStyleElement || isStylesheetLink(mutation.target)) && (mutation.attributeName === "media" || mutation.attributeName === "disabled");
|
|
2556
|
+
}
|
|
2557
|
+
if (mutation.type === "characterData") {
|
|
2558
|
+
return mutation.target.parentElement instanceof HTMLStyleElement;
|
|
2559
|
+
}
|
|
2560
|
+
if (mutation.type !== "childList")
|
|
2561
|
+
return false;
|
|
2562
|
+
if (mutation.target instanceof HTMLStyleElement)
|
|
2563
|
+
return true;
|
|
2564
|
+
return [...mutation.addedNodes, ...mutation.removedNodes].some(containsStylesheetNode);
|
|
2565
|
+
}
|
|
2566
|
+
function containsStylesheetNode(node) {
|
|
2567
|
+
if (node instanceof HTMLStyleElement || isStylesheetLink(node))
|
|
2568
|
+
return true;
|
|
2569
|
+
if (!(node instanceof Element || node instanceof DocumentFragment))
|
|
2570
|
+
return false;
|
|
2571
|
+
return node.querySelector("style") !== null || [...node.querySelectorAll("link")].some(isStylesheetLink);
|
|
2572
|
+
}
|
|
2573
|
+
function isStylesheetLink(node) {
|
|
2574
|
+
return node instanceof HTMLLinkElement && node.rel.split(/\s+/).some((relationship) => relationship.toLowerCase() === "stylesheet");
|
|
2575
|
+
}
|
|
2576
|
+
function observeDirectionShadowRoots(source) {
|
|
2577
|
+
const roots = [];
|
|
2578
|
+
let current = source;
|
|
2579
|
+
while (current) {
|
|
2580
|
+
const root = current.getRootNode();
|
|
2581
|
+
if (root instanceof ShadowRoot) {
|
|
2582
|
+
roots.push(root);
|
|
2583
|
+
const existing = directionInvalidationRoots.get(root);
|
|
2584
|
+
if (existing)
|
|
2585
|
+
existing.count += 1;
|
|
2586
|
+
else {
|
|
2587
|
+
const observer = typeof MutationObserver === "undefined" ? null : new MutationObserver((mutations) => {
|
|
2588
|
+
if (mutations.some(isStylesheetMutation))
|
|
2589
|
+
refreshMediaQueryObservers();
|
|
2590
|
+
invalidateComputedDirections();
|
|
2591
|
+
});
|
|
2592
|
+
observer?.observe(root, {
|
|
2593
|
+
attributes: true,
|
|
2594
|
+
characterData: true,
|
|
2595
|
+
childList: true,
|
|
2596
|
+
subtree: true
|
|
2597
|
+
});
|
|
2598
|
+
root.addEventListener("load", handleStylesheetLoad, true);
|
|
2599
|
+
for (const event of directionInvalidationEvents) {
|
|
2600
|
+
root.addEventListener(event, invalidateComputedDirections, true);
|
|
2601
|
+
}
|
|
2602
|
+
directionInvalidationRoots.set(root, { observer, count: 1 });
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
current = getShadowHost(current);
|
|
2606
|
+
}
|
|
2607
|
+
return roots;
|
|
2608
|
+
}
|
|
2609
|
+
function releaseDirectionShadowRoot(root) {
|
|
2610
|
+
const existing = directionInvalidationRoots.get(root);
|
|
2611
|
+
if (!existing)
|
|
2612
|
+
return;
|
|
2613
|
+
existing.count -= 1;
|
|
2614
|
+
if (existing.count > 0)
|
|
2615
|
+
return;
|
|
2616
|
+
existing.observer?.disconnect();
|
|
2617
|
+
root.removeEventListener("load", handleStylesheetLoad, true);
|
|
2618
|
+
for (const event of directionInvalidationEvents) {
|
|
2619
|
+
root.removeEventListener(event, invalidateComputedDirections, true);
|
|
2620
|
+
}
|
|
2621
|
+
directionInvalidationRoots.delete(root);
|
|
2622
|
+
}
|
|
2623
|
+
function stopDirectionInvalidationObservers() {
|
|
2624
|
+
if (computedDirectionObservations.size > 0)
|
|
2625
|
+
return;
|
|
2626
|
+
directionInvalidationStarted = false;
|
|
2627
|
+
directionInvalidationObserver?.disconnect();
|
|
2628
|
+
directionInvalidationObserver = null;
|
|
2629
|
+
directionInvalidationDocument?.removeEventListener("load", handleStylesheetLoad, true);
|
|
2630
|
+
if (typeof window !== "undefined") {
|
|
2631
|
+
window.removeEventListener("resize", invalidateComputedDirections);
|
|
2632
|
+
window.removeEventListener("orientationchange", invalidateComputedDirections);
|
|
2633
|
+
window.removeEventListener("hashchange", invalidateComputedDirections);
|
|
2634
|
+
}
|
|
2635
|
+
for (const event of directionInvalidationEvents) {
|
|
2636
|
+
directionInvalidationDocument?.removeEventListener(event, invalidateComputedDirections, true);
|
|
2637
|
+
}
|
|
2638
|
+
for (const mediaQuery of observedMediaQueries.values()) {
|
|
2639
|
+
removeMediaQueryListener(mediaQuery);
|
|
2640
|
+
}
|
|
2641
|
+
observedMediaQueries.clear();
|
|
2642
|
+
for (const [root, { observer }] of directionInvalidationRoots) {
|
|
2643
|
+
observer?.disconnect();
|
|
2644
|
+
root.removeEventListener("load", handleStylesheetLoad, true);
|
|
2645
|
+
for (const event of directionInvalidationEvents) {
|
|
2646
|
+
root.removeEventListener(event, invalidateComputedDirections, true);
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
directionInvalidationRoots.clear();
|
|
2650
|
+
if (directionInvalidationFrame !== null) {
|
|
2651
|
+
if (typeof window !== "undefined")
|
|
2652
|
+
window.cancelAnimationFrame(directionInvalidationFrame);
|
|
2653
|
+
directionInvalidationFrame = null;
|
|
2654
|
+
}
|
|
2655
|
+
directionInvalidationDocument = null;
|
|
2656
|
+
}
|
|
2657
|
+
function handleStylesheetLoad(event) {
|
|
2658
|
+
const target = event.target;
|
|
2659
|
+
if (target instanceof HTMLStyleElement || target instanceof Node && isStylesheetLink(target)) {
|
|
2660
|
+
refreshMediaQueryObservers();
|
|
2661
|
+
invalidateComputedDirections();
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
function observeComputedDirection(source, sync, rebindInheritedAttributes) {
|
|
2665
|
+
if (typeof getComputedStyle !== "function" || typeof window === "undefined" || typeof document === "undefined") {
|
|
2666
|
+
return () => {};
|
|
2667
|
+
}
|
|
2668
|
+
const observation = {
|
|
2669
|
+
source,
|
|
2670
|
+
direction: getComputedStyle(source).direction,
|
|
2671
|
+
sync,
|
|
2672
|
+
rebindInheritedAttributes,
|
|
2673
|
+
roots: [],
|
|
2674
|
+
resizeObserver: null,
|
|
2675
|
+
resizeObservedElements: []
|
|
2676
|
+
};
|
|
2677
|
+
computedDirectionObservations.add(observation);
|
|
2678
|
+
startDirectionInvalidationObservers();
|
|
2679
|
+
observation.roots = observeDirectionShadowRoots(source);
|
|
2680
|
+
refreshMediaQueryObservers();
|
|
2681
|
+
rebindResizeObservation(observation, collectResizeObservedElements(source));
|
|
2682
|
+
return () => {
|
|
2683
|
+
computedDirectionObservations.delete(observation);
|
|
2684
|
+
observation.resizeObserver?.disconnect();
|
|
2685
|
+
for (const root of observation.roots)
|
|
2686
|
+
releaseDirectionShadowRoot(root);
|
|
2687
|
+
if (computedDirectionObservations.size === 0) {
|
|
2688
|
+
stopDirectionInvalidationObservers();
|
|
2689
|
+
} else {
|
|
2690
|
+
refreshMediaQueryObservers();
|
|
2691
|
+
}
|
|
2692
|
+
};
|
|
2693
|
+
}
|
|
2694
|
+
function collectDirectionShadowRoots(source) {
|
|
2695
|
+
const roots = [];
|
|
2696
|
+
let current = source;
|
|
2697
|
+
while (current) {
|
|
2698
|
+
const root = current.getRootNode();
|
|
2699
|
+
if (root instanceof ShadowRoot && !roots.includes(root))
|
|
2700
|
+
roots.push(root);
|
|
2701
|
+
current = getShadowHost(current);
|
|
2702
|
+
}
|
|
2703
|
+
return roots;
|
|
2704
|
+
}
|
|
2705
|
+
function collectResizeObservedElements(source) {
|
|
2706
|
+
const elements = [];
|
|
2707
|
+
let current = source;
|
|
2708
|
+
while (current) {
|
|
2709
|
+
elements.push(current);
|
|
2710
|
+
current = current.parentElement ?? getShadowHost(current);
|
|
2711
|
+
}
|
|
2712
|
+
return elements;
|
|
2713
|
+
}
|
|
2714
|
+
function rebindResizeObservation(observation, nextElements) {
|
|
2715
|
+
if (observation.resizeObservedElements.length === nextElements.length && observation.resizeObservedElements.every((element, index) => element === nextElements[index]))
|
|
2716
|
+
return false;
|
|
2717
|
+
observation.resizeObserver?.disconnect();
|
|
2718
|
+
observation.resizeObserver = null;
|
|
2719
|
+
observation.resizeObservedElements = nextElements;
|
|
2720
|
+
if (typeof ResizeObserver === "undefined")
|
|
2721
|
+
return true;
|
|
2722
|
+
const resizeObserver = new ResizeObserver(invalidateComputedDirections);
|
|
2723
|
+
for (const element of nextElements)
|
|
2724
|
+
resizeObserver.observe(element);
|
|
2725
|
+
observation.resizeObserver = resizeObserver;
|
|
2726
|
+
return true;
|
|
2727
|
+
}
|
|
2728
|
+
function rebindComputedDirectionObservation(observation) {
|
|
2729
|
+
const nextRoots = collectDirectionShadowRoots(observation.source);
|
|
2730
|
+
const rootsChanged = nextRoots.length !== observation.roots.length || nextRoots.some((root, index) => root !== observation.roots[index]);
|
|
2731
|
+
if (rootsChanged) {
|
|
2732
|
+
for (const root of observation.roots)
|
|
2733
|
+
releaseDirectionShadowRoot(root);
|
|
2734
|
+
observation.roots = observeDirectionShadowRoots(observation.source);
|
|
2735
|
+
}
|
|
2736
|
+
const resizeChanged = rebindResizeObservation(observation, collectResizeObservedElements(observation.source));
|
|
2737
|
+
return rootsChanged || resizeChanged;
|
|
1989
2738
|
}
|
|
1990
2739
|
function createPortalAttachment(options = {}) {
|
|
1991
2740
|
let lastWarnedUnresolvedKey = null;
|
|
@@ -1993,21 +2742,27 @@ function createPortalAttachment(options = {}) {
|
|
|
1993
2742
|
const initialParent = element.parentElement;
|
|
1994
2743
|
const initialAttributes = {
|
|
1995
2744
|
dir: element.getAttribute("dir"),
|
|
2745
|
+
lang: element.getAttribute("lang"),
|
|
1996
2746
|
dataTheme: element.getAttribute("data-theme"),
|
|
1997
2747
|
theme: element.getAttribute("data-cinder-theme")
|
|
1998
2748
|
};
|
|
1999
|
-
const
|
|
2749
|
+
const preserveInitialDirection = options.explicitAttributes === undefined;
|
|
2750
|
+
const managedAttributes = { dir: null, lang: null, dataTheme: null, theme: null };
|
|
2000
2751
|
function currentFallbackAttributes() {
|
|
2001
2752
|
const explicitAttributes = readOption(options.explicitAttributes ?? {});
|
|
2002
2753
|
const explicitDirection = explicitAttributes.dir;
|
|
2754
|
+
const explicitLanguage = explicitAttributes.lang;
|
|
2003
2755
|
const explicitDataTheme = explicitAttributes.dataTheme;
|
|
2004
2756
|
const explicitTheme = explicitAttributes.theme;
|
|
2005
2757
|
const direction = element.getAttribute("dir");
|
|
2758
|
+
const language = element.getAttribute("lang");
|
|
2006
2759
|
const dataTheme = element.getAttribute("data-theme");
|
|
2007
2760
|
const theme = element.getAttribute("data-cinder-theme");
|
|
2008
2761
|
return {
|
|
2009
|
-
dir: explicitDirection !== undefined ? explicitDirection : direction !== managedAttributes.dir ? direction : initialAttributes.dir,
|
|
2010
|
-
preserveDirection: explicitDirection !== undefined,
|
|
2762
|
+
dir: explicitDirection !== undefined ? explicitDirection : direction !== managedAttributes.dir ? direction : preserveInitialDirection ? initialAttributes.dir : null,
|
|
2763
|
+
preserveDirection: explicitDirection !== undefined || preserveInitialDirection && initialAttributes.dir !== null,
|
|
2764
|
+
lang: explicitLanguage !== undefined ? explicitLanguage : language !== managedAttributes.lang ? language : null,
|
|
2765
|
+
preserveLanguage: explicitLanguage !== undefined,
|
|
2011
2766
|
dataTheme: explicitDataTheme !== undefined ? explicitDataTheme : dataTheme !== managedAttributes.dataTheme ? dataTheme : null,
|
|
2012
2767
|
preserveDataTheme: explicitDataTheme !== undefined,
|
|
2013
2768
|
theme: explicitTheme !== undefined ? explicitTheme : theme !== managedAttributes.theme ? theme : null,
|
|
@@ -2017,6 +2772,7 @@ function createPortalAttachment(options = {}) {
|
|
|
2017
2772
|
function syncInheritedAttributes(source, inheritAttributes) {
|
|
2018
2773
|
const nextManagedAttributes = copyInheritedPortalAttributes(element, source, inheritAttributes, currentFallbackAttributes());
|
|
2019
2774
|
managedAttributes.dir = nextManagedAttributes.dir;
|
|
2775
|
+
managedAttributes.lang = nextManagedAttributes.lang;
|
|
2020
2776
|
managedAttributes.dataTheme = nextManagedAttributes.dataTheme;
|
|
2021
2777
|
managedAttributes.theme = nextManagedAttributes.theme;
|
|
2022
2778
|
}
|
|
@@ -2031,38 +2787,51 @@ function createPortalAttachment(options = {}) {
|
|
|
2031
2787
|
return;
|
|
2032
2788
|
anchor.parentNode.insertBefore(element, anchor.nextSibling);
|
|
2033
2789
|
}
|
|
2034
|
-
|
|
2790
|
+
let activeAttributeSource = null;
|
|
2791
|
+
let activeInheritAttributes = false;
|
|
2792
|
+
$2.user_effect(() => {
|
|
2793
|
+
readOption(options.explicitAttributes ?? {});
|
|
2794
|
+
untrack(() => syncInheritedAttributes(activeAttributeSource, activeInheritAttributes));
|
|
2795
|
+
});
|
|
2796
|
+
$2.user_effect(() => {
|
|
2035
2797
|
let stopObservingInheritedAttributes = null;
|
|
2036
2798
|
const disabled = readOption(options.disabled ?? false);
|
|
2037
2799
|
const inheritAttributes = readOption(options.inheritAttributes ?? true);
|
|
2038
2800
|
const targetValue = readOption(options.target ?? null);
|
|
2039
2801
|
const attributeSource = readOption(options.source ?? initialParent) ?? initialParent;
|
|
2040
|
-
const
|
|
2802
|
+
const rawResolved = disabled ? null : resolvePortalTarget(targetValue);
|
|
2803
|
+
const resolved = rawResolved?.kind === "resolved" && (rawResolved.target === element || element.contains(rawResolved.target)) ? { kind: "unresolved", key: "own-wrapper" } : rawResolved;
|
|
2041
2804
|
if (!disabled && resolved?.kind === "resolved") {
|
|
2042
|
-
|
|
2805
|
+
activeAttributeSource = attributeSource;
|
|
2806
|
+
activeInheritAttributes = inheritAttributes;
|
|
2807
|
+
untrack(() => syncInheritedAttributes(attributeSource, inheritAttributes));
|
|
2043
2808
|
stopObservingInheritedAttributes = observeInheritedPortalAttributes(attributeSource, inheritAttributes, () => syncInheritedAttributes(attributeSource, inheritAttributes));
|
|
2044
|
-
resolved.target
|
|
2809
|
+
if (element.parentElement !== resolved.target) {
|
|
2810
|
+
resolved.target.appendChild(element);
|
|
2811
|
+
}
|
|
2045
2812
|
lastWarnedUnresolvedKey = null;
|
|
2046
2813
|
} else if (!disabled && resolved?.kind === "unresolved") {
|
|
2047
2814
|
restoreInline();
|
|
2048
|
-
|
|
2815
|
+
activeAttributeSource = null;
|
|
2816
|
+
activeInheritAttributes = false;
|
|
2817
|
+
untrack(() => syncInheritedAttributes(null, false));
|
|
2049
2818
|
if (lastWarnedUnresolvedKey !== resolved.key) {
|
|
2050
2819
|
devWarn(`[cinder/portal] could not resolve portal target ${JSON.stringify(resolved.key)}.`);
|
|
2051
2820
|
lastWarnedUnresolvedKey = resolved.key;
|
|
2052
2821
|
}
|
|
2053
2822
|
} else if (disabled) {
|
|
2054
2823
|
restoreInline();
|
|
2055
|
-
|
|
2824
|
+
activeAttributeSource = null;
|
|
2825
|
+
activeInheritAttributes = false;
|
|
2826
|
+
untrack(() => syncInheritedAttributes(null, false));
|
|
2056
2827
|
lastWarnedUnresolvedKey = null;
|
|
2057
2828
|
}
|
|
2058
2829
|
return () => {
|
|
2059
2830
|
stopObservingInheritedAttributes?.();
|
|
2060
|
-
if (element.isConnected) {
|
|
2061
|
-
element.remove();
|
|
2062
|
-
}
|
|
2063
2831
|
};
|
|
2064
2832
|
});
|
|
2065
2833
|
return () => {
|
|
2834
|
+
element.remove();
|
|
2066
2835
|
if (anchor && anchor.parentNode) {
|
|
2067
2836
|
anchor.parentNode.removeChild(anchor);
|
|
2068
2837
|
}
|
|
@@ -2081,44 +2850,46 @@ var rest_excludes = new Set([
|
|
|
2081
2850
|
"inheritAttributes",
|
|
2082
2851
|
"children"
|
|
2083
2852
|
]);
|
|
2084
|
-
var root = $
|
|
2853
|
+
var root = $3.from_html(`<div><!></div>`);
|
|
2085
2854
|
function Portal($$anchor, $$props) {
|
|
2086
|
-
$
|
|
2087
|
-
let target = $
|
|
2088
|
-
let hasHydrated = $
|
|
2089
|
-
$
|
|
2090
|
-
$
|
|
2855
|
+
$3.push($$props, true);
|
|
2856
|
+
let target = $3.prop($$props, "target", 3, null), disabled = $3.prop($$props, "disabled", 3, false), inheritAttributes = $3.prop($$props, "inheritAttributes", 3, true), rest = $3.rest_props($$props, rest_excludes);
|
|
2857
|
+
let hasHydrated = $3.state(false);
|
|
2858
|
+
$3.user_effect(() => {
|
|
2859
|
+
$3.set(hasHydrated, true);
|
|
2091
2860
|
});
|
|
2092
|
-
const resolvedTarget = $
|
|
2093
|
-
const shouldRenderChildren = $
|
|
2094
|
-
|
|
2095
|
-
$2.attribute_effect(div, ($0) => ({ class: $0, ...rest }), [() => classNames($$props.class)]);
|
|
2096
|
-
var node = $2.child(div);
|
|
2097
|
-
{
|
|
2098
|
-
var consequent = ($$anchor2) => {
|
|
2099
|
-
var fragment = $2.comment();
|
|
2100
|
-
var node_1 = $2.first_child(fragment);
|
|
2101
|
-
$2.snippet(node_1, () => $$props.children);
|
|
2102
|
-
$2.append($$anchor2, fragment);
|
|
2103
|
-
};
|
|
2104
|
-
$2.if(node, ($$render) => {
|
|
2105
|
-
if ($2.get(shouldRenderChildren))
|
|
2106
|
-
$$render(consequent);
|
|
2107
|
-
});
|
|
2108
|
-
}
|
|
2109
|
-
$2.reset(div);
|
|
2110
|
-
$2.attach(div, () => createPortalAttachment({
|
|
2861
|
+
const resolvedTarget = $3.derived(() => !disabled() ? resolvePortalTarget(target()) : null);
|
|
2862
|
+
const shouldRenderChildren = $3.derived(() => disabled() || $3.get(hasHydrated) && $3.get(resolvedTarget) !== null);
|
|
2863
|
+
const portalAttachment = createPortalAttachment({
|
|
2111
2864
|
target: () => target(),
|
|
2112
2865
|
disabled: () => disabled(),
|
|
2113
2866
|
inheritAttributes: () => inheritAttributes(),
|
|
2114
2867
|
explicitAttributes: () => ({
|
|
2115
2868
|
dir: $$props.dir,
|
|
2869
|
+
lang: $$props.lang,
|
|
2116
2870
|
dataTheme: rest["data-theme"],
|
|
2117
2871
|
theme: rest["data-cinder-theme"]
|
|
2118
2872
|
})
|
|
2119
|
-
})
|
|
2120
|
-
|
|
2121
|
-
$
|
|
2873
|
+
});
|
|
2874
|
+
var div = root();
|
|
2875
|
+
$3.attribute_effect(div, ($0) => ({ class: $0, ...rest }), [() => classNames($$props.class)]);
|
|
2876
|
+
var node = $3.child(div);
|
|
2877
|
+
{
|
|
2878
|
+
var consequent = ($$anchor2) => {
|
|
2879
|
+
var fragment = $3.comment();
|
|
2880
|
+
var node_1 = $3.first_child(fragment);
|
|
2881
|
+
$3.snippet(node_1, () => $$props.children);
|
|
2882
|
+
$3.append($$anchor2, fragment);
|
|
2883
|
+
};
|
|
2884
|
+
$3.if(node, ($$render) => {
|
|
2885
|
+
if ($3.get(shouldRenderChildren))
|
|
2886
|
+
$$render(consequent);
|
|
2887
|
+
});
|
|
2888
|
+
}
|
|
2889
|
+
$3.reset(div);
|
|
2890
|
+
$3.attach(div, () => portalAttachment);
|
|
2891
|
+
$3.append($$anchor, div);
|
|
2892
|
+
$3.pop();
|
|
2122
2893
|
}
|
|
2123
2894
|
|
|
2124
2895
|
// src/components/portal/index.ts
|
|
@@ -2128,10 +2899,10 @@ import"@lostgradient/cinder/command-menu/styles";
|
|
|
2128
2899
|
|
|
2129
2900
|
// src/components/command-menu/command-menu.svelte
|
|
2130
2901
|
import"svelte/internal/disclose-version";
|
|
2131
|
-
import * as $
|
|
2902
|
+
import * as $8 from "svelte/internal/client";
|
|
2132
2903
|
|
|
2133
2904
|
// src/components/command-menu/caret-rect.svelte.ts
|
|
2134
|
-
import * as $
|
|
2905
|
+
import * as $4 from "svelte/internal/client";
|
|
2135
2906
|
var MIRROR_STYLE_PROPERTIES = [
|
|
2136
2907
|
"box-sizing",
|
|
2137
2908
|
"width",
|
|
@@ -2211,11 +2982,115 @@ function getCaretRect(field, caretIndex) {
|
|
|
2211
2982
|
return rect;
|
|
2212
2983
|
}
|
|
2213
2984
|
|
|
2985
|
+
// src/components/command-menu/command-menu-inline-completion.svelte.ts
|
|
2986
|
+
import * as $5 from "svelte/internal/client";
|
|
2987
|
+
function computeGhostRemainder(query, activeValue) {
|
|
2988
|
+
if (!activeValue)
|
|
2989
|
+
return "";
|
|
2990
|
+
if (!activeValue.toLowerCase().startsWith(query.toLowerCase()))
|
|
2991
|
+
return "";
|
|
2992
|
+
return activeValue.slice(query.length);
|
|
2993
|
+
}
|
|
2994
|
+
function computeGhostOverlayFontStyle(element) {
|
|
2995
|
+
if (typeof getComputedStyle !== "function")
|
|
2996
|
+
return "";
|
|
2997
|
+
const computed = getComputedStyle(element);
|
|
2998
|
+
return [
|
|
2999
|
+
`font-family: ${computed.fontFamily};`,
|
|
3000
|
+
`font-size: ${computed.fontSize};`,
|
|
3001
|
+
`font-weight: ${computed.fontWeight};`,
|
|
3002
|
+
`font-style: ${computed.fontStyle};`,
|
|
3003
|
+
`line-height: ${computed.lineHeight};`,
|
|
3004
|
+
`letter-spacing: ${computed.letterSpacing};`
|
|
3005
|
+
].join(" ");
|
|
3006
|
+
}
|
|
3007
|
+
function createInlineCompletionState(options) {
|
|
3008
|
+
let dismissed = $5.state(false);
|
|
3009
|
+
let queryShrank = $5.state(false);
|
|
3010
|
+
let previousQueryForShrink;
|
|
3011
|
+
$5.user_effect(() => {
|
|
3012
|
+
const currentQuery = options.query();
|
|
3013
|
+
if (!options.open()) {
|
|
3014
|
+
$5.set(queryShrank, false);
|
|
3015
|
+
previousQueryForShrink = undefined;
|
|
3016
|
+
return;
|
|
3017
|
+
}
|
|
3018
|
+
$5.set(queryShrank, previousQueryForShrink !== undefined && currentQuery.length < previousQueryForShrink.length, true);
|
|
3019
|
+
previousQueryForShrink = currentQuery;
|
|
3020
|
+
});
|
|
3021
|
+
let previousQueryForDismiss;
|
|
3022
|
+
let previousCaretIndexForDismiss;
|
|
3023
|
+
let previousActiveItemIdForDismiss;
|
|
3024
|
+
$5.user_effect(() => {
|
|
3025
|
+
if (!options.open()) {
|
|
3026
|
+
$5.set(dismissed, false);
|
|
3027
|
+
previousQueryForDismiss = undefined;
|
|
3028
|
+
previousCaretIndexForDismiss = undefined;
|
|
3029
|
+
previousActiveItemIdForDismiss = undefined;
|
|
3030
|
+
return;
|
|
3031
|
+
}
|
|
3032
|
+
const currentQuery = options.query();
|
|
3033
|
+
const currentCaretIndex = options.caretIndex();
|
|
3034
|
+
const currentActiveItemId = options.activeItemId();
|
|
3035
|
+
if (currentQuery !== previousQueryForDismiss || currentCaretIndex !== previousCaretIndexForDismiss || currentActiveItemId !== previousActiveItemIdForDismiss) {
|
|
3036
|
+
$5.set(dismissed, false);
|
|
3037
|
+
}
|
|
3038
|
+
previousQueryForDismiss = currentQuery;
|
|
3039
|
+
previousCaretIndexForDismiss = currentCaretIndex;
|
|
3040
|
+
previousActiveItemIdForDismiss = currentActiveItemId;
|
|
3041
|
+
});
|
|
3042
|
+
const remainder = $5.derived(() => {
|
|
3043
|
+
if (!options.enabled())
|
|
3044
|
+
return "";
|
|
3045
|
+
if (!options.open())
|
|
3046
|
+
return "";
|
|
3047
|
+
if (options.composing())
|
|
3048
|
+
return "";
|
|
3049
|
+
if ($5.get(queryShrank))
|
|
3050
|
+
return "";
|
|
3051
|
+
if ($5.get(dismissed))
|
|
3052
|
+
return "";
|
|
3053
|
+
if (!options.caretAtFieldEnd())
|
|
3054
|
+
return "";
|
|
3055
|
+
if (options.rightToLeft())
|
|
3056
|
+
return "";
|
|
3057
|
+
return computeGhostRemainder(options.query(), options.activeValue());
|
|
3058
|
+
});
|
|
3059
|
+
const visible = $5.derived(() => $5.get(remainder).length > 0);
|
|
3060
|
+
function acceptCompletion() {
|
|
3061
|
+
if (!$5.get(visible))
|
|
3062
|
+
return null;
|
|
3063
|
+
const value = options.activeValue();
|
|
3064
|
+
if (value === null)
|
|
3065
|
+
return null;
|
|
3066
|
+
const acceptedRemainder = $5.get(remainder);
|
|
3067
|
+
const acceptedQuery = options.query();
|
|
3068
|
+
$5.set(dismissed, true);
|
|
3069
|
+
return { value, query: acceptedQuery, remainder: acceptedRemainder };
|
|
3070
|
+
}
|
|
3071
|
+
function dismissGhostText() {
|
|
3072
|
+
if (!$5.get(visible))
|
|
3073
|
+
return false;
|
|
3074
|
+
$5.set(dismissed, true);
|
|
3075
|
+
return true;
|
|
3076
|
+
}
|
|
3077
|
+
return {
|
|
3078
|
+
get remainder() {
|
|
3079
|
+
return $5.get(remainder);
|
|
3080
|
+
},
|
|
3081
|
+
get visible() {
|
|
3082
|
+
return $5.get(visible);
|
|
3083
|
+
},
|
|
3084
|
+
acceptCompletion,
|
|
3085
|
+
dismissGhostText
|
|
3086
|
+
};
|
|
3087
|
+
}
|
|
3088
|
+
|
|
2214
3089
|
// src/components/command-menu/command-menu.svelte
|
|
2215
3090
|
import { on } from "svelte/events";
|
|
2216
3091
|
|
|
2217
3092
|
// src/_internal/anchored-overlay.svelte.ts
|
|
2218
|
-
import * as $
|
|
3093
|
+
import * as $6 from "svelte/internal/client";
|
|
2219
3094
|
var DEFAULT_PLACEMENT = "bottom-start";
|
|
2220
3095
|
var DEFAULT_OFFSET = 8;
|
|
2221
3096
|
var DEFAULT_SHIFT_PADDING = 8;
|
|
@@ -2245,6 +3120,20 @@ function getAnchoredOverlayWidthStyle(widthMode, anchorRect) {
|
|
|
2245
3120
|
}
|
|
2246
3121
|
return "max-inline-size: min(28rem, calc(100vw - var(--cinder-space-4)));";
|
|
2247
3122
|
}
|
|
3123
|
+
function getAnchoredOverlayAvailableHeightStyle(availableHeight) {
|
|
3124
|
+
return `${Math.max(0, availableHeight)}px`;
|
|
3125
|
+
}
|
|
3126
|
+
function getAnchoredOverlayMaxBlockSizeStyle(availableHeight, maximumBlockSize) {
|
|
3127
|
+
return `min(${maximumBlockSize}, ${getAnchoredOverlayAvailableHeightStyle(availableHeight)})`;
|
|
3128
|
+
}
|
|
3129
|
+
function applyAnchoredOverlayMaxBlockSize(panel, availableHeight, maximumBlockSize) {
|
|
3130
|
+
const value = getAnchoredOverlayMaxBlockSizeStyle(availableHeight, maximumBlockSize);
|
|
3131
|
+
panel.style.maxBlockSize = value;
|
|
3132
|
+
return value;
|
|
3133
|
+
}
|
|
3134
|
+
function isAnchoredOverlayWriteCurrent(positioningGeneration, latestGeneration, cancelled) {
|
|
3135
|
+
return !cancelled && positioningGeneration === latestGeneration;
|
|
3136
|
+
}
|
|
2248
3137
|
function getArrowStyle(placement, data) {
|
|
2249
3138
|
if (!data)
|
|
2250
3139
|
return "";
|
|
@@ -2266,24 +3155,27 @@ function reportAnchoredOverlaySetupError(error) {
|
|
|
2266
3155
|
}, 0);
|
|
2267
3156
|
}
|
|
2268
3157
|
function createAnchoredOverlay(options) {
|
|
2269
|
-
let positionReady = $
|
|
2270
|
-
let positionStyle = $
|
|
2271
|
-
let
|
|
2272
|
-
let
|
|
2273
|
-
$
|
|
3158
|
+
let positionReady = $6.state(false);
|
|
3159
|
+
let positionStyle = $6.state("");
|
|
3160
|
+
let availableHeightStyle = $6.state("");
|
|
3161
|
+
let resolvedPlacement = $6.state($6.proxy(options.placement?.() ?? DEFAULT_PLACEMENT));
|
|
3162
|
+
let arrowStyle = $6.state("");
|
|
3163
|
+
$6.user_effect(() => {
|
|
2274
3164
|
if (!options.open()) {
|
|
2275
|
-
$
|
|
2276
|
-
$
|
|
2277
|
-
$
|
|
2278
|
-
$
|
|
3165
|
+
$6.set(positionReady, false);
|
|
3166
|
+
$6.set(positionStyle, "");
|
|
3167
|
+
$6.set(availableHeightStyle, "");
|
|
3168
|
+
$6.set(arrowStyle, "");
|
|
3169
|
+
$6.set(resolvedPlacement, options.placement?.() ?? DEFAULT_PLACEMENT, true);
|
|
2279
3170
|
return;
|
|
2280
3171
|
}
|
|
2281
3172
|
const anchor = options.anchor();
|
|
2282
3173
|
const panel = options.panel();
|
|
2283
3174
|
if (!anchor || !panel) {
|
|
2284
|
-
$
|
|
2285
|
-
$
|
|
2286
|
-
$
|
|
3175
|
+
$6.set(positionReady, false);
|
|
3176
|
+
$6.set(positionStyle, "");
|
|
3177
|
+
$6.set(availableHeightStyle, "");
|
|
3178
|
+
$6.set(arrowStyle, "");
|
|
2287
3179
|
return;
|
|
2288
3180
|
}
|
|
2289
3181
|
const placement = options.placement?.() ?? DEFAULT_PLACEMENT;
|
|
@@ -2292,11 +3184,16 @@ function createAnchoredOverlay(options) {
|
|
|
2292
3184
|
const shiftCrossAxis = options.shiftCrossAxis?.() ?? false;
|
|
2293
3185
|
const arrowPadding = options.arrowPadding?.() ?? DEFAULT_ARROW_PADDING;
|
|
2294
3186
|
const arrow3 = options.arrow?.();
|
|
2295
|
-
const
|
|
3187
|
+
const arrowVisible = options.arrowVisible?.() ?? Boolean(arrow3);
|
|
3188
|
+
const sizeEnabled = options.size?.() ?? false;
|
|
3189
|
+
const sizeMaxBlockSize = options.sizeMaxBlockSize?.() ?? "100%";
|
|
2296
3190
|
const widthMode = options.widthMode?.() ?? "content";
|
|
3191
|
+
const strategyOverride = options.strategy?.();
|
|
3192
|
+
const boundary = options.boundary?.() ?? undefined;
|
|
2297
3193
|
let cancelled = false;
|
|
2298
3194
|
let generation = 0;
|
|
2299
3195
|
let stopAutoUpdate;
|
|
3196
|
+
let boundaryResizeObserver;
|
|
2300
3197
|
(async () => {
|
|
2301
3198
|
const {
|
|
2302
3199
|
arrow: arrowMiddleware,
|
|
@@ -2304,81 +3201,1422 @@ function createAnchoredOverlay(options) {
|
|
|
2304
3201
|
computePosition: computePosition3,
|
|
2305
3202
|
flip: flip3,
|
|
2306
3203
|
offset: offsetMiddleware,
|
|
3204
|
+
size: sizeMiddleware,
|
|
2307
3205
|
shift: shift3
|
|
2308
3206
|
} = await Promise.resolve().then(() => (init_floating_ui_dom(), exports_floating_ui_dom));
|
|
2309
3207
|
if (cancelled)
|
|
2310
3208
|
return;
|
|
2311
|
-
const
|
|
2312
|
-
offsetMiddleware(offset3),
|
|
2313
|
-
flip3(),
|
|
2314
|
-
shift3({ padding: shiftPadding, crossAxis: shiftCrossAxis })
|
|
2315
|
-
];
|
|
2316
|
-
if (showArrow && arrow3) {
|
|
2317
|
-
middleware.push(arrowMiddleware({ element: arrow3, padding: arrowPadding }));
|
|
2318
|
-
}
|
|
2319
|
-
stopAutoUpdate = autoUpdate2(anchor, panel, async () => {
|
|
3209
|
+
const updatePosition = async () => {
|
|
2320
3210
|
if (cancelled)
|
|
2321
3211
|
return;
|
|
2322
3212
|
const currentGeneration = ++generation;
|
|
3213
|
+
if (!sizeEnabled) {
|
|
3214
|
+
$6.set(availableHeightStyle, "");
|
|
3215
|
+
panel.style.removeProperty("max-block-size");
|
|
3216
|
+
}
|
|
3217
|
+
const middleware = [
|
|
3218
|
+
offsetMiddleware(offset3),
|
|
3219
|
+
flip3(boundary ? { boundary } : undefined)
|
|
3220
|
+
];
|
|
3221
|
+
if (sizeEnabled) {
|
|
3222
|
+
middleware.push(sizeMiddleware({
|
|
3223
|
+
...boundary ? { boundary } : {},
|
|
3224
|
+
padding: shiftPadding,
|
|
3225
|
+
apply({ availableHeight }) {
|
|
3226
|
+
if (!isAnchoredOverlayWriteCurrent(currentGeneration, generation, cancelled))
|
|
3227
|
+
return;
|
|
3228
|
+
$6.set(availableHeightStyle, applyAnchoredOverlayMaxBlockSize(panel, availableHeight, sizeMaxBlockSize), true);
|
|
3229
|
+
}
|
|
3230
|
+
}));
|
|
3231
|
+
}
|
|
3232
|
+
middleware.push(shift3({
|
|
3233
|
+
...boundary ? { boundary } : {},
|
|
3234
|
+
padding: shiftPadding,
|
|
3235
|
+
crossAxis: shiftCrossAxis
|
|
3236
|
+
}));
|
|
3237
|
+
if (arrowVisible && arrow3) {
|
|
3238
|
+
middleware.push(arrowMiddleware({ element: arrow3, padding: arrowPadding }));
|
|
3239
|
+
}
|
|
2323
3240
|
let result;
|
|
3241
|
+
const strategy = strategyOverride ?? (panel.closest("dialog") ? "absolute" : "fixed");
|
|
2324
3242
|
try {
|
|
2325
|
-
result = await computePosition3(anchor, panel, { placement, middleware, strategy
|
|
3243
|
+
result = await computePosition3(anchor, panel, { placement, middleware, strategy });
|
|
2326
3244
|
} catch {
|
|
2327
3245
|
if (cancelled || currentGeneration !== generation)
|
|
2328
3246
|
return;
|
|
2329
|
-
$
|
|
2330
|
-
$
|
|
2331
|
-
$
|
|
2332
|
-
$
|
|
3247
|
+
$6.set(positionReady, false);
|
|
3248
|
+
$6.set(positionStyle, "");
|
|
3249
|
+
$6.set(arrowStyle, "");
|
|
3250
|
+
$6.set(resolvedPlacement, placement, true);
|
|
2333
3251
|
return;
|
|
2334
3252
|
}
|
|
2335
3253
|
if (cancelled || currentGeneration !== generation)
|
|
2336
3254
|
return;
|
|
2337
3255
|
const widthStyle = getAnchoredOverlayWidthStyle(widthMode, anchor.getBoundingClientRect());
|
|
2338
|
-
$
|
|
2339
|
-
|
|
3256
|
+
$6.set(positionStyle, [
|
|
3257
|
+
`position: ${strategy};`,
|
|
2340
3258
|
`left: ${result.x}px;`,
|
|
2341
3259
|
`top: ${result.y}px;`,
|
|
3260
|
+
$6.get(availableHeightStyle) ? `max-block-size: ${$6.get(availableHeightStyle)};` : "",
|
|
2342
3261
|
widthStyle
|
|
2343
3262
|
].filter(Boolean).join(" "), true);
|
|
2344
|
-
$
|
|
2345
|
-
$
|
|
2346
|
-
$
|
|
2347
|
-
}
|
|
3263
|
+
$6.set(resolvedPlacement, result.placement, true);
|
|
3264
|
+
$6.set(arrowStyle, arrowVisible ? getArrowStyle(result.placement, result.middlewareData.arrow) : "", true);
|
|
3265
|
+
$6.set(positionReady, true);
|
|
3266
|
+
};
|
|
3267
|
+
stopAutoUpdate = autoUpdate2(anchor, panel, updatePosition);
|
|
3268
|
+
if (boundary && boundary !== anchor && boundary !== panel && typeof ResizeObserver !== "undefined") {
|
|
3269
|
+
boundaryResizeObserver = new ResizeObserver(() => {
|
|
3270
|
+
updatePosition();
|
|
3271
|
+
});
|
|
3272
|
+
boundaryResizeObserver.observe(boundary);
|
|
3273
|
+
}
|
|
2348
3274
|
})().catch((error) => {
|
|
2349
3275
|
if (cancelled)
|
|
2350
3276
|
return;
|
|
2351
|
-
$
|
|
2352
|
-
$
|
|
2353
|
-
$
|
|
2354
|
-
$
|
|
3277
|
+
$6.set(positionReady, false);
|
|
3278
|
+
$6.set(positionStyle, "");
|
|
3279
|
+
$6.set(availableHeightStyle, "");
|
|
3280
|
+
$6.set(arrowStyle, "");
|
|
3281
|
+
$6.set(resolvedPlacement, placement, true);
|
|
2355
3282
|
reportAnchoredOverlaySetupError(error);
|
|
2356
3283
|
});
|
|
2357
3284
|
return () => {
|
|
2358
3285
|
cancelled = true;
|
|
2359
3286
|
stopAutoUpdate?.();
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
$
|
|
2363
|
-
$
|
|
3287
|
+
boundaryResizeObserver?.disconnect();
|
|
3288
|
+
panel.style.removeProperty("max-block-size");
|
|
3289
|
+
$6.set(positionReady, false);
|
|
3290
|
+
$6.set(positionStyle, "");
|
|
3291
|
+
$6.set(availableHeightStyle, "");
|
|
3292
|
+
$6.set(arrowStyle, "");
|
|
3293
|
+
$6.set(resolvedPlacement, placement, true);
|
|
2364
3294
|
};
|
|
2365
3295
|
});
|
|
2366
3296
|
return {
|
|
2367
3297
|
get positionReady() {
|
|
2368
|
-
return $
|
|
3298
|
+
return $6.get(positionReady);
|
|
2369
3299
|
},
|
|
2370
3300
|
get positionStyle() {
|
|
2371
|
-
return $
|
|
3301
|
+
return $6.get(positionStyle);
|
|
2372
3302
|
},
|
|
2373
3303
|
get resolvedPlacement() {
|
|
2374
|
-
return $
|
|
3304
|
+
return $6.get(resolvedPlacement);
|
|
2375
3305
|
},
|
|
2376
3306
|
get arrowStyle() {
|
|
2377
|
-
return $
|
|
3307
|
+
return $6.get(arrowStyle);
|
|
2378
3308
|
}
|
|
2379
3309
|
};
|
|
2380
3310
|
}
|
|
2381
3311
|
|
|
3312
|
+
// src/_internal/text-direction-container.ts
|
|
3313
|
+
function parseStyleQuery(conditionText) {
|
|
3314
|
+
const start = /style\(\s*(--[\w-]+)\s*:\s*/i.exec(conditionText);
|
|
3315
|
+
if (!start || !start[1])
|
|
3316
|
+
return;
|
|
3317
|
+
let depth = 0;
|
|
3318
|
+
for (let index = start.index + start[0].length;index < conditionText.length; index += 1) {
|
|
3319
|
+
const character = conditionText[index];
|
|
3320
|
+
if (character === "(")
|
|
3321
|
+
depth += 1;
|
|
3322
|
+
if (character === ")") {
|
|
3323
|
+
if (depth === 0)
|
|
3324
|
+
return {
|
|
3325
|
+
index: start.index,
|
|
3326
|
+
end: index + 1,
|
|
3327
|
+
name: start[1],
|
|
3328
|
+
value: conditionText.slice(start.index + start[0].length, index)
|
|
3329
|
+
};
|
|
3330
|
+
depth -= 1;
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3333
|
+
return;
|
|
3334
|
+
}
|
|
3335
|
+
function splitTopLevel(conditionText, operator) {
|
|
3336
|
+
const parts = [];
|
|
3337
|
+
let depth = 0;
|
|
3338
|
+
let start = 0;
|
|
3339
|
+
let index = 0;
|
|
3340
|
+
while (index < conditionText.length) {
|
|
3341
|
+
const character = conditionText[index];
|
|
3342
|
+
if (character === "(") {
|
|
3343
|
+
depth += 1;
|
|
3344
|
+
index += 1;
|
|
3345
|
+
continue;
|
|
3346
|
+
}
|
|
3347
|
+
if (character === ")") {
|
|
3348
|
+
depth = Math.max(0, depth - 1);
|
|
3349
|
+
index += 1;
|
|
3350
|
+
continue;
|
|
3351
|
+
}
|
|
3352
|
+
if (depth === 0 && conditionText.slice(index, index + operator.length).toLowerCase() === operator && /\s/.test(conditionText[index - 1] ?? "") && /\s/.test(conditionText[index + operator.length] ?? "")) {
|
|
3353
|
+
parts.push(conditionText.slice(start, index));
|
|
3354
|
+
index += operator.length;
|
|
3355
|
+
start = index;
|
|
3356
|
+
continue;
|
|
3357
|
+
}
|
|
3358
|
+
index += 1;
|
|
3359
|
+
}
|
|
3360
|
+
parts.push(conditionText.slice(start));
|
|
3361
|
+
return parts;
|
|
3362
|
+
}
|
|
3363
|
+
function evaluateLogicalContainerCondition(conditionText, width, remSize, inlineSize) {
|
|
3364
|
+
if (!isFullyParsedContainerCondition(conditionText))
|
|
3365
|
+
return false;
|
|
3366
|
+
return evaluateParsedLogicalContainerCondition(conditionText, width, remSize, inlineSize);
|
|
3367
|
+
}
|
|
3368
|
+
function evaluateParsedLogicalContainerCondition(conditionText, width, remSize, inlineSize) {
|
|
3369
|
+
const orParts = splitTopLevel(conditionText, "or");
|
|
3370
|
+
if (orParts.length > 1)
|
|
3371
|
+
return orParts.some((part) => evaluateParsedLogicalContainerCondition(part, width, remSize, inlineSize));
|
|
3372
|
+
const andParts = splitTopLevel(conditionText, "and");
|
|
3373
|
+
if (andParts.length > 1)
|
|
3374
|
+
return andParts.every((part) => evaluateParsedLogicalContainerCondition(part, width, remSize, inlineSize));
|
|
3375
|
+
const trimmed = conditionText.trim();
|
|
3376
|
+
const unwrapped = unwrapRedundantParentheses(trimmed);
|
|
3377
|
+
if (unwrapped !== trimmed)
|
|
3378
|
+
return evaluateParsedLogicalContainerCondition(unwrapped, width, remSize, inlineSize);
|
|
3379
|
+
const notPrefix = /^not\s+/i.exec(trimmed);
|
|
3380
|
+
if (notPrefix)
|
|
3381
|
+
return !evaluateParsedLogicalContainerCondition(trimmed.slice(notPrefix[0].length), width, remSize, inlineSize);
|
|
3382
|
+
return evaluateContainerSizeConstraints(trimmed, width, remSize, inlineSize);
|
|
3383
|
+
}
|
|
3384
|
+
var containerSizeTermPattern = /^(?:(?:min|max)-(?:width|inline-size)|(?:width|inline-size))\s*:\s*(?:\d+(?:\.\d+)?|\.\d+)(?:px|rem)$/i;
|
|
3385
|
+
var featureFirstRangePattern = /^(?:width|inline-size)\s*(?:>=|>|<=|<)\s*(?:\d+(?:\.\d+)?|\.\d+)(?:px|rem)$/i;
|
|
3386
|
+
var valueFirstRangePattern = /^(?:(?:(?:\d+(?:\.\d+)?|\.\d+)(?:px|rem)\s*(?:<=|<)\s*(?:width|inline-size))(?:\s*(?:<=|<)\s*(?:\d+(?:\.\d+)?|\.\d+)(?:px|rem))?|(?:(?:\d+(?:\.\d+)?|\.\d+)(?:px|rem)\s*(?:>=|>)\s*(?:width|inline-size))(?:\s*(?:>=|>)\s*(?:\d+(?:\.\d+)?|\.\d+)(?:px|rem))?)$/i;
|
|
3387
|
+
function isFullyParsedContainerCondition(conditionText) {
|
|
3388
|
+
const trimmed = conditionText.trim();
|
|
3389
|
+
if (!trimmed || !hasBalancedParentheses(trimmed))
|
|
3390
|
+
return false;
|
|
3391
|
+
return parseContainerCondition(trimmed);
|
|
3392
|
+
}
|
|
3393
|
+
function parseContainerCondition(conditionText, isTopLevelCondition = true) {
|
|
3394
|
+
const original = conditionText.trim();
|
|
3395
|
+
const trimmed = unwrapRedundantParentheses(original);
|
|
3396
|
+
const wasGrouped = trimmed !== original;
|
|
3397
|
+
const orParts = splitTopLevel(trimmed, "or");
|
|
3398
|
+
const andParts = splitTopLevel(trimmed, "and");
|
|
3399
|
+
if (orParts.length > 1 && andParts.length > 1)
|
|
3400
|
+
return false;
|
|
3401
|
+
if (orParts.length > 1)
|
|
3402
|
+
return orParts.every((part) => parseContainerCondition(part, false));
|
|
3403
|
+
if (andParts.length > 1)
|
|
3404
|
+
return andParts.every((part) => parseContainerCondition(part, false));
|
|
3405
|
+
const notPrefix = /^not\s+/i.exec(trimmed);
|
|
3406
|
+
if (notPrefix) {
|
|
3407
|
+
if (!isTopLevelCondition && !wasGrouped)
|
|
3408
|
+
return false;
|
|
3409
|
+
const operand = trimmed.slice(notPrefix[0].length).trim();
|
|
3410
|
+
const unwrappedOperand = unwrapRedundantParentheses(operand);
|
|
3411
|
+
return unwrappedOperand !== operand && parseContainerCondition(operand);
|
|
3412
|
+
}
|
|
3413
|
+
return wasGrouped && (containerSizeTermPattern.test(trimmed) || featureFirstRangePattern.test(trimmed) || valueFirstRangePattern.test(trimmed));
|
|
3414
|
+
}
|
|
3415
|
+
function hasBalancedParentheses(conditionText) {
|
|
3416
|
+
let depth = 0;
|
|
3417
|
+
for (const character of conditionText) {
|
|
3418
|
+
if (character === "(")
|
|
3419
|
+
depth += 1;
|
|
3420
|
+
if (character === ")") {
|
|
3421
|
+
depth -= 1;
|
|
3422
|
+
if (depth < 0)
|
|
3423
|
+
return false;
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
return depth === 0;
|
|
3427
|
+
}
|
|
3428
|
+
function unwrapRedundantParentheses(conditionText) {
|
|
3429
|
+
const trimmed = conditionText.trim();
|
|
3430
|
+
if (!trimmed.startsWith("(") || !trimmed.endsWith(")"))
|
|
3431
|
+
return trimmed;
|
|
3432
|
+
const matchingClose = new Map;
|
|
3433
|
+
const openPositions = [];
|
|
3434
|
+
let depth = 0;
|
|
3435
|
+
for (let index = 0;index < trimmed.length; index += 1) {
|
|
3436
|
+
if (trimmed[index] === "(") {
|
|
3437
|
+
openPositions.push(index);
|
|
3438
|
+
depth += 1;
|
|
3439
|
+
} else if (trimmed[index] === ")") {
|
|
3440
|
+
const open = openPositions.pop();
|
|
3441
|
+
if (open === undefined)
|
|
3442
|
+
return trimmed;
|
|
3443
|
+
matchingClose.set(open, index);
|
|
3444
|
+
depth -= 1;
|
|
3445
|
+
}
|
|
3446
|
+
}
|
|
3447
|
+
if (depth !== 0)
|
|
3448
|
+
return trimmed;
|
|
3449
|
+
let start = 0;
|
|
3450
|
+
let end = trimmed.length - 1;
|
|
3451
|
+
while (start < end && matchingClose.get(start) === end) {
|
|
3452
|
+
start += 1;
|
|
3453
|
+
end -= 1;
|
|
3454
|
+
while (/\s/.test(trimmed[start] ?? ""))
|
|
3455
|
+
start += 1;
|
|
3456
|
+
while (/\s/.test(trimmed[end] ?? ""))
|
|
3457
|
+
end -= 1;
|
|
3458
|
+
}
|
|
3459
|
+
return start === 0 ? trimmed : trimmed.slice(start, end + 1).trim();
|
|
3460
|
+
}
|
|
3461
|
+
function hasUnsupportedContainerSizeQuery(conditionText) {
|
|
3462
|
+
if (/(?:min-|max-)?(?:height|block-size)\b/i.test(conditionText))
|
|
3463
|
+
return true;
|
|
3464
|
+
if (/\baspect-ratio\b/i.test(conditionText))
|
|
3465
|
+
return true;
|
|
3466
|
+
if (/\borientation\s*:/i.test(conditionText))
|
|
3467
|
+
return true;
|
|
3468
|
+
const featureFirstUnitMatches = conditionText.matchAll(/(?:min-|max-)?(?:width|inline-size)\s*(?:>=|>|<=|<|:)\s*[\d.]+([a-z%]+)/gi);
|
|
3469
|
+
const valueFirstUnitMatches = conditionText.matchAll(/[\d.]+([a-z%]+)\s*(?:>=|>|<=|<)\s*(?:width|inline-size)/gi);
|
|
3470
|
+
return [...featureFirstUnitMatches, ...valueFirstUnitMatches].some((match) => !/^(?:px|rem)$/i.test(match[1]));
|
|
3471
|
+
}
|
|
3472
|
+
function evaluateRangeComparisons(conditionText, width, remSize) {
|
|
3473
|
+
const featureFirstPattern = /(?:width|inline-size)\s*(>=|>|<=|<)\s*([\d.]+)(px|rem)/gi;
|
|
3474
|
+
const valueFirstPattern = /([\d.]+)(px|rem)\s*(<=|<|>=|>)\s*(width|inline-size)/gi;
|
|
3475
|
+
const comparisons = [];
|
|
3476
|
+
for (const comparison of conditionText.matchAll(featureFirstPattern)) {
|
|
3477
|
+
const operator = comparison[1];
|
|
3478
|
+
const threshold = comparison[2];
|
|
3479
|
+
const unit = comparison[3];
|
|
3480
|
+
if (operator && threshold && unit)
|
|
3481
|
+
comparisons.push({ operator, threshold, unit });
|
|
3482
|
+
}
|
|
3483
|
+
for (const comparison of conditionText.matchAll(valueFirstPattern)) {
|
|
3484
|
+
const threshold = comparison[1];
|
|
3485
|
+
const unit = comparison[2];
|
|
3486
|
+
const operator = comparison[3] === "<=" ? ">=" : comparison[3] === "<" ? ">" : comparison[3] === ">=" ? "<=" : "<";
|
|
3487
|
+
if (threshold && unit)
|
|
3488
|
+
comparisons.push({ operator, threshold, unit });
|
|
3489
|
+
}
|
|
3490
|
+
if (comparisons.length === 0)
|
|
3491
|
+
return;
|
|
3492
|
+
const satisfiesAll = comparisons.every((comparison) => {
|
|
3493
|
+
const { operator } = comparison;
|
|
3494
|
+
const threshold = Number(comparison.threshold) * (comparison.unit.toLowerCase() === "rem" ? remSize : 1);
|
|
3495
|
+
if (operator === ">=")
|
|
3496
|
+
return width >= threshold;
|
|
3497
|
+
if (operator === ">")
|
|
3498
|
+
return width > threshold;
|
|
3499
|
+
if (operator === "<=")
|
|
3500
|
+
return width <= threshold;
|
|
3501
|
+
return width < threshold;
|
|
3502
|
+
});
|
|
3503
|
+
return satisfiesAll;
|
|
3504
|
+
}
|
|
3505
|
+
function evaluateEqualityComparison(conditionText, width, remSize) {
|
|
3506
|
+
const equalityPattern = /(?:^|[\s(])(?:width|inline-size)\s*:\s*([\d.]+)(px|rem)/gi;
|
|
3507
|
+
const comparisons = [...conditionText.matchAll(equalityPattern)];
|
|
3508
|
+
if (comparisons.length === 0)
|
|
3509
|
+
return;
|
|
3510
|
+
const satisfiesAll = comparisons.every((comparison) => {
|
|
3511
|
+
const threshold = Number(comparison[1]) * (comparison[2].toLowerCase() === "rem" ? remSize : 1);
|
|
3512
|
+
return width === threshold;
|
|
3513
|
+
});
|
|
3514
|
+
return satisfiesAll;
|
|
3515
|
+
}
|
|
3516
|
+
function evaluateContainerSizeConstraints(conditionText, width, remSize, inlineSize = width) {
|
|
3517
|
+
const measuredSize = /\binline-size\b/i.test(conditionText) && !/\bwidth\b/i.test(conditionText) ? inlineSize : width;
|
|
3518
|
+
if (/\bwidth\b/i.test(conditionText) && /\binline-size\b/i.test(conditionText) && /\band\b/i.test(conditionText)) {
|
|
3519
|
+
return conditionText.split(/\s+and\s+/i).every((clause) => evaluateContainerSizeConstraints(clause, /\binline-size\b/i.test(clause) ? inlineSize : width, remSize, inlineSize));
|
|
3520
|
+
}
|
|
3521
|
+
const minimum = /min-(?:width|inline-size)\s*:\s*([\d.]+)(px|rem)/i.exec(conditionText);
|
|
3522
|
+
const maximum = /max-(?:width|inline-size)\s*:\s*([\d.]+)(px|rem)/i.exec(conditionText);
|
|
3523
|
+
const toPixels = (value) => Number(value[1]) * (value[2].toLowerCase() === "rem" ? remSize : 1);
|
|
3524
|
+
const legacyMatches = (!minimum || measuredSize >= toPixels(minimum)) && (!maximum || measuredSize <= toPixels(maximum));
|
|
3525
|
+
const rangeMatches = evaluateRangeComparisons(conditionText, measuredSize, remSize) ?? true;
|
|
3526
|
+
const equalityMatches = evaluateEqualityComparison(conditionText, measuredSize, remSize) ?? true;
|
|
3527
|
+
const hasSizeFeature = /\b(?:width|inline-size)\b/i.test(conditionText);
|
|
3528
|
+
const hasRecognizedRange = /(?:width|inline-size)\s*(?:>=|>|<=|<)\s*[\d.]+(?:px|rem)/i.test(conditionText) || /[\d.]+(?:px|rem)\s*(?:<=|<|>=|>)\s*(?:width|inline-size)/i.test(conditionText);
|
|
3529
|
+
const hasRecognizedEquality = /(?:width|inline-size)\s*:\s*[\d.]+(?:px|rem)/i.test(conditionText);
|
|
3530
|
+
if (hasSizeFeature && !minimum && !maximum && !hasRecognizedRange && !hasRecognizedEquality)
|
|
3531
|
+
return false;
|
|
3532
|
+
const combinedMatches = legacyMatches && rangeMatches && equalityMatches;
|
|
3533
|
+
return /^\s*not\b/i.test(conditionText) ? !combinedMatches : combinedMatches;
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
// src/_internal/text-direction-css.ts
|
|
3537
|
+
function matchesDirectionStyleRule(element, getParentElement) {
|
|
3538
|
+
const styleSheets = new Map;
|
|
3539
|
+
for (const sheet of Array.from(element.ownerDocument.styleSheets))
|
|
3540
|
+
styleSheets.set(sheet, null);
|
|
3541
|
+
for (const sheet of Array.from(element.ownerDocument.adoptedStyleSheets ?? []))
|
|
3542
|
+
styleSheets.set(sheet, null);
|
|
3543
|
+
const root2 = element.getRootNode();
|
|
3544
|
+
if (typeof ShadowRoot !== "undefined" && root2 instanceof ShadowRoot) {
|
|
3545
|
+
for (const sheet of root2.adoptedStyleSheets)
|
|
3546
|
+
styleSheets.set(sheet, root2);
|
|
3547
|
+
for (const styleElement of root2.querySelectorAll("style")) {
|
|
3548
|
+
if (styleElement.sheet)
|
|
3549
|
+
styleSheets.set(styleElement.sheet, root2);
|
|
3550
|
+
}
|
|
3551
|
+
for (const linkElement of root2.querySelectorAll('link[rel~="stylesheet"]')) {
|
|
3552
|
+
if (linkElement.sheet)
|
|
3553
|
+
styleSheets.set(linkElement.sheet, root2);
|
|
3554
|
+
}
|
|
3555
|
+
}
|
|
3556
|
+
for (const [sheet, fallbackRoot] of styleSheets) {
|
|
3557
|
+
if (!isActiveStyleSheet(sheet))
|
|
3558
|
+
continue;
|
|
3559
|
+
let rules;
|
|
3560
|
+
try {
|
|
3561
|
+
rules = sheet.cssRules;
|
|
3562
|
+
} catch {
|
|
3563
|
+
continue;
|
|
3564
|
+
}
|
|
3565
|
+
if (matchesDirectionStyleRuleList(element, rules, getParentElement, [], getImplicitScopeRoot(sheet, fallbackRoot, element.ownerDocument.documentElement)))
|
|
3566
|
+
return true;
|
|
3567
|
+
}
|
|
3568
|
+
return false;
|
|
3569
|
+
}
|
|
3570
|
+
function isActiveStyleSheet(sheet) {
|
|
3571
|
+
if (sheet.disabled)
|
|
3572
|
+
return false;
|
|
3573
|
+
const mediaText = sheet.media?.mediaText;
|
|
3574
|
+
if (!mediaText)
|
|
3575
|
+
return true;
|
|
3576
|
+
if (typeof matchMedia !== "function")
|
|
3577
|
+
return true;
|
|
3578
|
+
return matchMedia(mediaText).matches;
|
|
3579
|
+
}
|
|
3580
|
+
function getImplicitScopeRoot(sheet, fallbackRoot, documentRoot) {
|
|
3581
|
+
const ownerNode = Reflect.get(sheet, "ownerNode");
|
|
3582
|
+
if (!(ownerNode instanceof Element) || ownerNode.localName?.toLowerCase() !== "style") {
|
|
3583
|
+
return typeof ShadowRoot !== "undefined" && fallbackRoot instanceof ShadowRoot ? fallbackRoot : documentRoot;
|
|
3584
|
+
}
|
|
3585
|
+
if (ownerNode.parentElement)
|
|
3586
|
+
return ownerNode.parentElement;
|
|
3587
|
+
const root2 = ownerNode.getRootNode();
|
|
3588
|
+
return typeof ShadowRoot !== "undefined" && root2 instanceof ShadowRoot ? root2 : typeof ShadowRoot !== "undefined" && fallbackRoot instanceof ShadowRoot ? fallbackRoot : null;
|
|
3589
|
+
}
|
|
3590
|
+
function matchesDirectionStyleRuleCached(element, cache, getParentElement) {
|
|
3591
|
+
if (!getParentElement)
|
|
3592
|
+
return false;
|
|
3593
|
+
if (!cache)
|
|
3594
|
+
return matchesDirectionStyleRule(element, getParentElement);
|
|
3595
|
+
const cached = cache.get(element);
|
|
3596
|
+
if (cached !== undefined)
|
|
3597
|
+
return cached;
|
|
3598
|
+
const matched = matchesDirectionStyleRule(element, getParentElement);
|
|
3599
|
+
cache.set(element, matched);
|
|
3600
|
+
return matched;
|
|
3601
|
+
}
|
|
3602
|
+
function matchesDirectionStyleRuleList(element, rules, getParentElement, scopes = [], implicitScopeRoot = null) {
|
|
3603
|
+
for (const rule of Array.from(rules)) {
|
|
3604
|
+
if (Reflect.get(rule, "type") === 3) {
|
|
3605
|
+
const imported = Reflect.get(rule, "styleSheet");
|
|
3606
|
+
if (imported) {
|
|
3607
|
+
try {
|
|
3608
|
+
const importedRules = Reflect.get(imported, "cssRules");
|
|
3609
|
+
if (isCssRuleCollection2(importedRules) && matchesDirectionStyleRuleList(element, importedRules, getParentElement, scopes, implicitScopeRoot))
|
|
3610
|
+
return true;
|
|
3611
|
+
} catch {}
|
|
3612
|
+
}
|
|
3613
|
+
continue;
|
|
3614
|
+
}
|
|
3615
|
+
if (isCssStyleRule(rule)) {
|
|
3616
|
+
if (!rule.style.direction) {
|
|
3617
|
+
const nestedRules2 = readNestedCssRules(rule);
|
|
3618
|
+
if (nestedRules2 && matchesDirectionStyleRuleList(element, nestedRules2, getParentElement, scopes, implicitScopeRoot))
|
|
3619
|
+
return true;
|
|
3620
|
+
continue;
|
|
3621
|
+
}
|
|
3622
|
+
try {
|
|
3623
|
+
const selectorText = resolveNestedSelector(rule);
|
|
3624
|
+
if (selectorText && matchesScopedSelector(element, selectorText, scopes))
|
|
3625
|
+
return true;
|
|
3626
|
+
} catch {
|
|
3627
|
+
continue;
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
const nestedRules = readNestedCssRules(rule);
|
|
3631
|
+
if (isScopeRule(rule)) {
|
|
3632
|
+
const scope = createActiveScope(rule, element, scopes, implicitScopeRoot);
|
|
3633
|
+
if (scope && nestedRules) {
|
|
3634
|
+
if (matchesDirectionStyleRuleList(element, nestedRules, getParentElement, [...scopes, scope], implicitScopeRoot))
|
|
3635
|
+
return true;
|
|
3636
|
+
}
|
|
3637
|
+
continue;
|
|
3638
|
+
}
|
|
3639
|
+
if (nestedRules && isConditionalRuleActive(rule, element, getParentElement) && matchesDirectionStyleRuleList(element, nestedRules, getParentElement, scopes, implicitScopeRoot)) {
|
|
3640
|
+
return true;
|
|
3641
|
+
}
|
|
3642
|
+
}
|
|
3643
|
+
return false;
|
|
3644
|
+
}
|
|
3645
|
+
function readNestedCssRules(rule) {
|
|
3646
|
+
if (!("cssRules" in rule))
|
|
3647
|
+
return;
|
|
3648
|
+
try {
|
|
3649
|
+
const nestedRules = Reflect.get(rule, "cssRules");
|
|
3650
|
+
return isCssRuleCollection2(nestedRules) ? nestedRules : undefined;
|
|
3651
|
+
} catch {
|
|
3652
|
+
return;
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
function isCssRuleCollection2(value) {
|
|
3656
|
+
if (typeof CSSRuleList !== "undefined" && value instanceof CSSRuleList)
|
|
3657
|
+
return true;
|
|
3658
|
+
if (Array.isArray(value))
|
|
3659
|
+
return value.every(isCssRule);
|
|
3660
|
+
if (typeof value !== "object" || value === null)
|
|
3661
|
+
return false;
|
|
3662
|
+
const iterator = Reflect.get(value, Symbol.iterator);
|
|
3663
|
+
return typeof iterator === "function";
|
|
3664
|
+
}
|
|
3665
|
+
function isCssRule(value) {
|
|
3666
|
+
return typeof value === "object" && value !== null && typeof Reflect.get(value, "cssText") === "string" && typeof Reflect.get(value, "type") === "number";
|
|
3667
|
+
}
|
|
3668
|
+
function isCssStyleRule(rule) {
|
|
3669
|
+
return typeof Reflect.get(rule, "selectorText") === "string" && typeof Reflect.get(rule, "style") === "object" && Reflect.get(rule, "style") !== null;
|
|
3670
|
+
}
|
|
3671
|
+
function resolveNestedSelector(rule) {
|
|
3672
|
+
let selector = rule.selectorText.trim();
|
|
3673
|
+
let parentRule = Reflect.get(rule, "parentRule");
|
|
3674
|
+
while (parentRule) {
|
|
3675
|
+
if (isCssStyleRule(parentRule)) {
|
|
3676
|
+
const parentSelector = parentRule.selectorText.trim();
|
|
3677
|
+
if (!parentSelector)
|
|
3678
|
+
return;
|
|
3679
|
+
selector = combineNestedSelectors(parentSelector, selector);
|
|
3680
|
+
if (!selector)
|
|
3681
|
+
return;
|
|
3682
|
+
}
|
|
3683
|
+
parentRule = Reflect.get(parentRule, "parentRule");
|
|
3684
|
+
}
|
|
3685
|
+
return selector;
|
|
3686
|
+
}
|
|
3687
|
+
function combineNestedSelectors(parentSelector, nestedSelector) {
|
|
3688
|
+
const parentContext = splitSelectorList(parentSelector).length > 1 ? `:is(${parentSelector})` : parentSelector;
|
|
3689
|
+
return splitSelectorList(nestedSelector).map((selector) => {
|
|
3690
|
+
const resolved = replaceNestingReferences(selector, parentContext);
|
|
3691
|
+
return resolved.replaced ? resolved.selector : `${parentContext} ${selector}`;
|
|
3692
|
+
}).join(", ");
|
|
3693
|
+
}
|
|
3694
|
+
function replaceNestingReferences(selector, parentContext) {
|
|
3695
|
+
let quote;
|
|
3696
|
+
let replaced = false;
|
|
3697
|
+
let resolved = "";
|
|
3698
|
+
for (let index = 0;index < selector.length; index += 1) {
|
|
3699
|
+
const character = selector[index];
|
|
3700
|
+
if (character === "\\") {
|
|
3701
|
+
resolved += character;
|
|
3702
|
+
if (index + 1 < selector.length)
|
|
3703
|
+
resolved += selector[++index];
|
|
3704
|
+
continue;
|
|
3705
|
+
}
|
|
3706
|
+
if (quote !== undefined) {
|
|
3707
|
+
resolved += character;
|
|
3708
|
+
if (character === quote)
|
|
3709
|
+
quote = undefined;
|
|
3710
|
+
continue;
|
|
3711
|
+
}
|
|
3712
|
+
if (character === '"' || character === "'") {
|
|
3713
|
+
quote = character;
|
|
3714
|
+
resolved += character;
|
|
3715
|
+
continue;
|
|
3716
|
+
}
|
|
3717
|
+
if (character === "&") {
|
|
3718
|
+
resolved += parentContext;
|
|
3719
|
+
replaced = true;
|
|
3720
|
+
continue;
|
|
3721
|
+
}
|
|
3722
|
+
resolved += character;
|
|
3723
|
+
}
|
|
3724
|
+
return { selector: resolved, replaced };
|
|
3725
|
+
}
|
|
3726
|
+
function splitSelectorList(selectorText) {
|
|
3727
|
+
const selectors = [];
|
|
3728
|
+
let parenthesesDepth = 0;
|
|
3729
|
+
let bracketDepth = 0;
|
|
3730
|
+
let quote;
|
|
3731
|
+
let start = 0;
|
|
3732
|
+
for (let index = 0;index < selectorText.length; index += 1) {
|
|
3733
|
+
const character = selectorText[index];
|
|
3734
|
+
if (character === "\\") {
|
|
3735
|
+
index += 1;
|
|
3736
|
+
continue;
|
|
3737
|
+
}
|
|
3738
|
+
if (quote !== undefined) {
|
|
3739
|
+
if (character === quote)
|
|
3740
|
+
quote = undefined;
|
|
3741
|
+
continue;
|
|
3742
|
+
}
|
|
3743
|
+
if (character === '"' || character === "'") {
|
|
3744
|
+
quote = character;
|
|
3745
|
+
continue;
|
|
3746
|
+
}
|
|
3747
|
+
if (character === "(")
|
|
3748
|
+
parenthesesDepth += 1;
|
|
3749
|
+
if (character === ")")
|
|
3750
|
+
parenthesesDepth = Math.max(0, parenthesesDepth - 1);
|
|
3751
|
+
if (character === "[")
|
|
3752
|
+
bracketDepth += 1;
|
|
3753
|
+
if (character === "]")
|
|
3754
|
+
bracketDepth = Math.max(0, bracketDepth - 1);
|
|
3755
|
+
if (character === "," && parenthesesDepth === 0 && bracketDepth === 0) {
|
|
3756
|
+
const selector2 = selectorText.slice(start, index).trim();
|
|
3757
|
+
if (selector2)
|
|
3758
|
+
selectors.push(selector2);
|
|
3759
|
+
start = index + 1;
|
|
3760
|
+
}
|
|
3761
|
+
}
|
|
3762
|
+
const selector = selectorText.slice(start).trim();
|
|
3763
|
+
if (selector)
|
|
3764
|
+
selectors.push(selector);
|
|
3765
|
+
return selectors;
|
|
3766
|
+
}
|
|
3767
|
+
function isConditionalRuleActive(rule, element, getParentElement) {
|
|
3768
|
+
const conditionText = Reflect.get(rule, "conditionText");
|
|
3769
|
+
if (typeof conditionText !== "string" || !conditionText.trim())
|
|
3770
|
+
return true;
|
|
3771
|
+
if (isContainerRule(rule))
|
|
3772
|
+
return isContainerQueryActive(conditionText, element, rule, getParentElement);
|
|
3773
|
+
if (isMediaRule(rule) && typeof matchMedia === "function") {
|
|
3774
|
+
return matchMedia(conditionText).matches;
|
|
3775
|
+
}
|
|
3776
|
+
if (isSupportsRule(rule) && typeof CSS !== "undefined" && typeof CSS.supports === "function")
|
|
3777
|
+
return CSS.supports(conditionText);
|
|
3778
|
+
return true;
|
|
3779
|
+
}
|
|
3780
|
+
function isScopeRule(rule) {
|
|
3781
|
+
if (rule.constructor.name === "CSSScopeRule")
|
|
3782
|
+
return true;
|
|
3783
|
+
const cssText = Reflect.get(rule, "cssText");
|
|
3784
|
+
return typeof cssText === "string" && /^\s*@scope\b/i.test(cssText);
|
|
3785
|
+
}
|
|
3786
|
+
function createActiveScope(rule, element, parentScopes, implicitScopeRoot) {
|
|
3787
|
+
const cssText = Reflect.get(rule, "cssText");
|
|
3788
|
+
if (typeof cssText !== "string")
|
|
3789
|
+
return null;
|
|
3790
|
+
const prelude = parseScopePrelude(cssText);
|
|
3791
|
+
if (!prelude)
|
|
3792
|
+
return null;
|
|
3793
|
+
const roots = findActiveScopeRoots(element, prelude, parentScopes, implicitScopeRoot);
|
|
3794
|
+
return roots === null ? null : { roots };
|
|
3795
|
+
}
|
|
3796
|
+
function scopePseudoRootCandidates(parentScopes, implicitScopeRoot) {
|
|
3797
|
+
if (parentScopes.length > 0)
|
|
3798
|
+
return parentScopes.at(-1).roots;
|
|
3799
|
+
return implicitScopeRoot ? [implicitScopeRoot] : [];
|
|
3800
|
+
}
|
|
3801
|
+
function findActiveScopeRoots(element, prelude, parentScopes, implicitScopeRoot) {
|
|
3802
|
+
if (!selectorsAreValid(element, prelude.rootSelectors))
|
|
3803
|
+
return null;
|
|
3804
|
+
if (prelude.limitSelectors && !selectorsAreValid(element, prelude.limitSelectors))
|
|
3805
|
+
return null;
|
|
3806
|
+
if (prelude.rootSelectors.length === 0) {
|
|
3807
|
+
const candidates = scopePseudoRootCandidates(parentScopes, implicitScopeRoot);
|
|
3808
|
+
const roots2 = candidates.length > 0 ? candidates : [implicitScopeRoot ?? element.ownerDocument.documentElement];
|
|
3809
|
+
return finalizeActiveScopeRoots(roots2.filter((root2) => root2.contains(element)), element, prelude, parentScopes);
|
|
3810
|
+
}
|
|
3811
|
+
const scopeRootSelectors = prelude.rootSelectors.filter(hasScopePseudoClass);
|
|
3812
|
+
const ordinaryRootSelectors = prelude.rootSelectors.filter((selector) => !hasScopePseudoClass(selector));
|
|
3813
|
+
const scopeRootCandidates = scopePseudoRootCandidates(parentScopes, implicitScopeRoot);
|
|
3814
|
+
const roots = [
|
|
3815
|
+
...findRelativeScopeRootMatches(element, scopeRootSelectors, scopeRootCandidates),
|
|
3816
|
+
...findScopeMatches(element, ordinaryRootSelectors)
|
|
3817
|
+
];
|
|
3818
|
+
return finalizeActiveScopeRoots(roots, element, prelude, parentScopes);
|
|
3819
|
+
}
|
|
3820
|
+
function findRelativeScopeRootMatches(element, selectors, scopeRootCandidates) {
|
|
3821
|
+
if (selectors.length === 0 || scopeRootCandidates.length === 0)
|
|
3822
|
+
return [];
|
|
3823
|
+
const parentScope = { roots: [...scopeRootCandidates] };
|
|
3824
|
+
const hasExactScopeSelector = selectors.some(isExactScopeSelector);
|
|
3825
|
+
const matches = [];
|
|
3826
|
+
let current = element;
|
|
3827
|
+
while (current) {
|
|
3828
|
+
const currentElement = current;
|
|
3829
|
+
if (selectors.some((selector) => matchesScopedSelector(currentElement, selector, [parentScope])))
|
|
3830
|
+
matches.push(currentElement);
|
|
3831
|
+
const parent = currentElement.parentElement;
|
|
3832
|
+
if (parent) {
|
|
3833
|
+
current = parent;
|
|
3834
|
+
continue;
|
|
3835
|
+
}
|
|
3836
|
+
const root2 = currentElement.getRootNode();
|
|
3837
|
+
if (typeof ShadowRoot !== "undefined" && root2 instanceof ShadowRoot && hasExactScopeSelector && scopeRootCandidates.includes(root2))
|
|
3838
|
+
matches.push(root2);
|
|
3839
|
+
current = null;
|
|
3840
|
+
}
|
|
3841
|
+
return matches;
|
|
3842
|
+
}
|
|
3843
|
+
function isExactScopeSelector(selector) {
|
|
3844
|
+
return selector.trim().toLowerCase() === ":scope";
|
|
3845
|
+
}
|
|
3846
|
+
function finalizeActiveScopeRoots(roots, element, prelude, parentScopes) {
|
|
3847
|
+
const activeRoots = [];
|
|
3848
|
+
for (const root2 of roots) {
|
|
3849
|
+
if (!isWithinParentScopes(root2, parentScopes))
|
|
3850
|
+
continue;
|
|
3851
|
+
if (prelude.limitSelectors && isWithinScopeLimit(element, root2, prelude.limitSelectors)) {
|
|
3852
|
+
continue;
|
|
3853
|
+
}
|
|
3854
|
+
activeRoots.push(root2);
|
|
3855
|
+
}
|
|
3856
|
+
return activeRoots.length === 0 ? null : activeRoots;
|
|
3857
|
+
}
|
|
3858
|
+
function selectorsAreValid(element, selectors) {
|
|
3859
|
+
try {
|
|
3860
|
+
for (const selector of selectors)
|
|
3861
|
+
element.matches(selector);
|
|
3862
|
+
return true;
|
|
3863
|
+
} catch {
|
|
3864
|
+
return false;
|
|
3865
|
+
}
|
|
3866
|
+
}
|
|
3867
|
+
function isWithinParentScopes(root2, parentScopes) {
|
|
3868
|
+
return parentScopes.every((scope) => scope.roots.some((parentRoot) => parentRoot.contains(root2)));
|
|
3869
|
+
}
|
|
3870
|
+
function isWithinScopeLimit(element, root2, limitSelectors) {
|
|
3871
|
+
let current = element;
|
|
3872
|
+
while (current) {
|
|
3873
|
+
if (current === root2)
|
|
3874
|
+
break;
|
|
3875
|
+
if (limitSelectors.some((selector) => hasScopePseudoClass(selector) ? matchesScopedSelector(current, selector, [{ roots: [root2] }]) : matchesSelectorSafely(current, selector)))
|
|
3876
|
+
return true;
|
|
3877
|
+
current = current.parentElement;
|
|
3878
|
+
}
|
|
3879
|
+
return false;
|
|
3880
|
+
}
|
|
3881
|
+
function matchesSelectorSafely(element, selector) {
|
|
3882
|
+
try {
|
|
3883
|
+
return element.matches(selector);
|
|
3884
|
+
} catch {
|
|
3885
|
+
return false;
|
|
3886
|
+
}
|
|
3887
|
+
}
|
|
3888
|
+
function normalizeScopeRelativeSelector(selector) {
|
|
3889
|
+
return splitSelectorList(selector).map((part) => {
|
|
3890
|
+
if (!part.includes("&") && !/^\s*[>+~]/.test(part))
|
|
3891
|
+
return part;
|
|
3892
|
+
const withScopeAlias = replaceNestingReferences(part, ":scope").selector;
|
|
3893
|
+
return /^\s*[>+~]/.test(withScopeAlias) ? `:scope ${withScopeAlias}` : withScopeAlias;
|
|
3894
|
+
}).join(", ");
|
|
3895
|
+
}
|
|
3896
|
+
function matchesScopedSelector(element, selector, scopes) {
|
|
3897
|
+
const normalizedSelector = scopes.length > 0 ? normalizeScopeRelativeSelector(selector) : selector;
|
|
3898
|
+
return splitSelectorList(normalizedSelector).some((item) => matchesScopedSelectorItem(element, item, scopes));
|
|
3899
|
+
}
|
|
3900
|
+
function matchesScopedSelectorItem(element, selector, scopes) {
|
|
3901
|
+
if (!hasScopePseudoClass(selector))
|
|
3902
|
+
return matchesSelectorSafely(element, selector);
|
|
3903
|
+
if (scopes.length === 0)
|
|
3904
|
+
return false;
|
|
3905
|
+
const scope = scopes.at(-1);
|
|
3906
|
+
if (!scope)
|
|
3907
|
+
return false;
|
|
3908
|
+
const outsideContext = splitScopeOutsideContext(selector);
|
|
3909
|
+
const remainderSelector = outsideContext ? outsideContext.remainder : selector;
|
|
3910
|
+
for (const root2 of scope.roots) {
|
|
3911
|
+
try {
|
|
3912
|
+
if (outsideContext) {
|
|
3913
|
+
if (!(root2 instanceof Element))
|
|
3914
|
+
continue;
|
|
3915
|
+
if (!matchesOutsideScopeContext(root2, outsideContext.before, outsideContext.combinator))
|
|
3916
|
+
continue;
|
|
3917
|
+
}
|
|
3918
|
+
if (matchesRemainderAgainstScopeRoot(element, remainderSelector, root2))
|
|
3919
|
+
return true;
|
|
3920
|
+
} catch {}
|
|
3921
|
+
}
|
|
3922
|
+
return false;
|
|
3923
|
+
}
|
|
3924
|
+
function splitScopeOutsideContext(selector) {
|
|
3925
|
+
const scopeIndex = findScopePseudoClassIndex(selector, { topLevelOnly: true });
|
|
3926
|
+
if (scopeIndex === null)
|
|
3927
|
+
return null;
|
|
3928
|
+
const beforeRaw = selector.slice(0, scopeIndex);
|
|
3929
|
+
if (!beforeRaw.trim())
|
|
3930
|
+
return null;
|
|
3931
|
+
const trimmedEnd = beforeRaw.replace(/\s+$/, "");
|
|
3932
|
+
const lastCharacter = trimmedEnd.at(-1);
|
|
3933
|
+
if (lastCharacter === ">" || lastCharacter === "+" || lastCharacter === "~") {
|
|
3934
|
+
const before2 = trimmedEnd.slice(0, -1).trim();
|
|
3935
|
+
return before2 ? { before: before2, combinator: lastCharacter, remainder: selector.slice(scopeIndex) } : null;
|
|
3936
|
+
}
|
|
3937
|
+
if (!/\s$/.test(beforeRaw))
|
|
3938
|
+
return null;
|
|
3939
|
+
const before = trimmedEnd.trim();
|
|
3940
|
+
return before ? { before, combinator: " ", remainder: selector.slice(scopeIndex) } : null;
|
|
3941
|
+
}
|
|
3942
|
+
function matchesOutsideScopeContext(root2, before, combinator) {
|
|
3943
|
+
if (combinator === " ")
|
|
3944
|
+
return root2.parentElement?.closest(before) != null;
|
|
3945
|
+
if (combinator === ">")
|
|
3946
|
+
return root2.parentElement !== null && matchesSelectorSafely(root2.parentElement, before);
|
|
3947
|
+
if (combinator === "+") {
|
|
3948
|
+
const sibling2 = root2.previousElementSibling;
|
|
3949
|
+
return sibling2 !== null && matchesSelectorSafely(sibling2, before);
|
|
3950
|
+
}
|
|
3951
|
+
let sibling = root2.previousElementSibling;
|
|
3952
|
+
while (sibling) {
|
|
3953
|
+
if (matchesSelectorSafely(sibling, before))
|
|
3954
|
+
return true;
|
|
3955
|
+
sibling = sibling.previousElementSibling;
|
|
3956
|
+
}
|
|
3957
|
+
return false;
|
|
3958
|
+
}
|
|
3959
|
+
function matchesRemainderAgainstScopeRoot(element, selector, root2) {
|
|
3960
|
+
if (root2.querySelector(":scope") === root2) {
|
|
3961
|
+
return Array.from(root2.querySelectorAll(selector)).includes(element);
|
|
3962
|
+
}
|
|
3963
|
+
const clone = typeof ShadowRoot !== "undefined" && root2 instanceof ShadowRoot ? null : root2.cloneNode(true);
|
|
3964
|
+
const cloneElement = clone instanceof Element ? clone : typeof ShadowRoot !== "undefined" && root2 instanceof ShadowRoot ? (() => {
|
|
3965
|
+
const wrapper = root2.ownerDocument.createElement("div");
|
|
3966
|
+
wrapper.append(...Array.from(root2.children, (child2) => child2.cloneNode(true)));
|
|
3967
|
+
return wrapper;
|
|
3968
|
+
})() : null;
|
|
3969
|
+
if (!cloneElement)
|
|
3970
|
+
return false;
|
|
3971
|
+
const marker = "data-cinder-scope-root";
|
|
3972
|
+
const replacedSelector = replaceScopePseudoClass(selector, `[${marker}]`);
|
|
3973
|
+
if (typeof ShadowRoot !== "undefined" && root2 instanceof ShadowRoot && /^\[[^\]]+\][^\s>+~]/.test(replacedSelector))
|
|
3974
|
+
return false;
|
|
3975
|
+
cloneElement.setAttribute(marker, "true");
|
|
3976
|
+
const path = [];
|
|
3977
|
+
let current = element;
|
|
3978
|
+
while (current && current !== root2) {
|
|
3979
|
+
const parent = current.parentElement;
|
|
3980
|
+
if (!parent) {
|
|
3981
|
+
if (typeof ShadowRoot !== "undefined" && root2 instanceof ShadowRoot && current.getRootNode() === root2)
|
|
3982
|
+
path.unshift(Array.prototype.indexOf.call(root2.children, current));
|
|
3983
|
+
break;
|
|
3984
|
+
}
|
|
3985
|
+
path.unshift(Array.prototype.indexOf.call(parent.children, current));
|
|
3986
|
+
current = parent;
|
|
3987
|
+
}
|
|
3988
|
+
if (current !== root2 && !(typeof ShadowRoot !== "undefined" && root2 instanceof ShadowRoot && current?.getRootNode() === root2))
|
|
3989
|
+
return false;
|
|
3990
|
+
let matchedCloneElement = cloneElement;
|
|
3991
|
+
for (const index of path) {
|
|
3992
|
+
const child2 = matchedCloneElement.children[index];
|
|
3993
|
+
if (!child2)
|
|
3994
|
+
break;
|
|
3995
|
+
matchedCloneElement = child2;
|
|
3996
|
+
}
|
|
3997
|
+
return matchedCloneElement === cloneElement && cloneElement.matches(replacedSelector) || Array.from(cloneElement.querySelectorAll(replacedSelector)).includes(matchedCloneElement);
|
|
3998
|
+
}
|
|
3999
|
+
function replaceScopePseudoClass(selector, replacement) {
|
|
4000
|
+
let result = "";
|
|
4001
|
+
let quote = null;
|
|
4002
|
+
let escaped = false;
|
|
4003
|
+
let brackets = 0;
|
|
4004
|
+
for (let index = 0;index < selector.length; index += 1) {
|
|
4005
|
+
const character = selector[index];
|
|
4006
|
+
if (escaped) {
|
|
4007
|
+
result += character;
|
|
4008
|
+
escaped = false;
|
|
4009
|
+
continue;
|
|
4010
|
+
}
|
|
4011
|
+
if (character === "\\") {
|
|
4012
|
+
result += character;
|
|
4013
|
+
escaped = true;
|
|
4014
|
+
continue;
|
|
4015
|
+
}
|
|
4016
|
+
if (quote) {
|
|
4017
|
+
result += character;
|
|
4018
|
+
if (character === quote)
|
|
4019
|
+
quote = null;
|
|
4020
|
+
continue;
|
|
4021
|
+
}
|
|
4022
|
+
if (character === '"' || character === "'") {
|
|
4023
|
+
result += character;
|
|
4024
|
+
quote = character;
|
|
4025
|
+
continue;
|
|
4026
|
+
}
|
|
4027
|
+
if (character === "[") {
|
|
4028
|
+
brackets += 1;
|
|
4029
|
+
result += character;
|
|
4030
|
+
continue;
|
|
4031
|
+
}
|
|
4032
|
+
if (character === "]") {
|
|
4033
|
+
brackets = Math.max(0, brackets - 1);
|
|
4034
|
+
result += character;
|
|
4035
|
+
continue;
|
|
4036
|
+
}
|
|
4037
|
+
if (brackets === 0 && character === ":" && selector.slice(index + 1, index + 6).toLowerCase() === "scope" && !/[\w-]/.test(selector[index + 6] ?? "")) {
|
|
4038
|
+
result += replacement;
|
|
4039
|
+
index += 5;
|
|
4040
|
+
continue;
|
|
4041
|
+
}
|
|
4042
|
+
result += character;
|
|
4043
|
+
}
|
|
4044
|
+
return result;
|
|
4045
|
+
}
|
|
4046
|
+
function findScopePseudoClassIndex(selector, options = {}) {
|
|
4047
|
+
let quote = null;
|
|
4048
|
+
let brackets = 0;
|
|
4049
|
+
let parentheses = 0;
|
|
4050
|
+
let escaped = false;
|
|
4051
|
+
for (let index = 0;index < selector.length; index += 1) {
|
|
4052
|
+
const character = selector[index];
|
|
4053
|
+
if (escaped) {
|
|
4054
|
+
escaped = false;
|
|
4055
|
+
continue;
|
|
4056
|
+
}
|
|
4057
|
+
if (character === "\\") {
|
|
4058
|
+
escaped = true;
|
|
4059
|
+
continue;
|
|
4060
|
+
}
|
|
4061
|
+
if (quote) {
|
|
4062
|
+
if (character === quote)
|
|
4063
|
+
quote = null;
|
|
4064
|
+
continue;
|
|
4065
|
+
}
|
|
4066
|
+
if (character === '"' || character === "'") {
|
|
4067
|
+
quote = character;
|
|
4068
|
+
continue;
|
|
4069
|
+
}
|
|
4070
|
+
if (character === "[") {
|
|
4071
|
+
brackets += 1;
|
|
4072
|
+
continue;
|
|
4073
|
+
}
|
|
4074
|
+
if (character === "]") {
|
|
4075
|
+
brackets = Math.max(0, brackets - 1);
|
|
4076
|
+
continue;
|
|
4077
|
+
}
|
|
4078
|
+
if (character === "(") {
|
|
4079
|
+
parentheses += 1;
|
|
4080
|
+
continue;
|
|
4081
|
+
}
|
|
4082
|
+
if (character === ")") {
|
|
4083
|
+
parentheses = Math.max(0, parentheses - 1);
|
|
4084
|
+
continue;
|
|
4085
|
+
}
|
|
4086
|
+
if (brackets === 0 && (!options.topLevelOnly || parentheses === 0) && character === ":" && selector.slice(index + 1, index + 6).toLowerCase() === "scope" && !/[\w-]/.test(selector[index + 6] ?? ""))
|
|
4087
|
+
return index;
|
|
4088
|
+
}
|
|
4089
|
+
return null;
|
|
4090
|
+
}
|
|
4091
|
+
function hasScopePseudoClass(selector) {
|
|
4092
|
+
return findScopePseudoClassIndex(selector) !== null;
|
|
4093
|
+
}
|
|
4094
|
+
function parseScopePrelude(cssText) {
|
|
4095
|
+
const match = /^\s*@scope\b/i.exec(cssText);
|
|
4096
|
+
if (!match)
|
|
4097
|
+
return null;
|
|
4098
|
+
const start = match[0].length;
|
|
4099
|
+
let quote = null;
|
|
4100
|
+
let escaped = false;
|
|
4101
|
+
let parentheses = 0;
|
|
4102
|
+
let brackets = 0;
|
|
4103
|
+
let end = -1;
|
|
4104
|
+
for (let index = start;index < cssText.length; index += 1) {
|
|
4105
|
+
const character = cssText[index];
|
|
4106
|
+
if (escaped) {
|
|
4107
|
+
escaped = false;
|
|
4108
|
+
continue;
|
|
4109
|
+
}
|
|
4110
|
+
if (character === "\\") {
|
|
4111
|
+
escaped = true;
|
|
4112
|
+
continue;
|
|
4113
|
+
}
|
|
4114
|
+
if (quote) {
|
|
4115
|
+
if (character === quote)
|
|
4116
|
+
quote = null;
|
|
4117
|
+
continue;
|
|
4118
|
+
}
|
|
4119
|
+
if (character === '"' || character === "'")
|
|
4120
|
+
quote = character;
|
|
4121
|
+
else if (character === "(")
|
|
4122
|
+
parentheses += 1;
|
|
4123
|
+
else if (character === ")")
|
|
4124
|
+
parentheses -= 1;
|
|
4125
|
+
else if (character === "[")
|
|
4126
|
+
brackets += 1;
|
|
4127
|
+
else if (character === "]")
|
|
4128
|
+
brackets -= 1;
|
|
4129
|
+
else if (character === "{" && parentheses === 0 && brackets === 0) {
|
|
4130
|
+
end = index;
|
|
4131
|
+
break;
|
|
4132
|
+
}
|
|
4133
|
+
if (parentheses < 0 || brackets < 0)
|
|
4134
|
+
return null;
|
|
4135
|
+
}
|
|
4136
|
+
if (end < 0 || quote || escaped || parentheses !== 0 || brackets !== 0)
|
|
4137
|
+
return null;
|
|
4138
|
+
const prelude = cssText.slice(start, end).trim();
|
|
4139
|
+
const limitIndex = findScopeLimitKeyword(prelude);
|
|
4140
|
+
const rootText = (limitIndex === null ? prelude : prelude.slice(0, limitIndex)).trim();
|
|
4141
|
+
const limitText = limitIndex === null ? null : prelude.slice(limitIndex + 2).trim();
|
|
4142
|
+
const rootSelectorText = unwrapScopeGroup(rootText);
|
|
4143
|
+
if (rootSelectorText === null)
|
|
4144
|
+
return null;
|
|
4145
|
+
const rootSelectors = rootSelectorText ? splitScopeSelectors(rootSelectorText) : [];
|
|
4146
|
+
if (rootSelectorText && rootSelectors.length === 0)
|
|
4147
|
+
return null;
|
|
4148
|
+
if (limitText === null)
|
|
4149
|
+
return { rootSelectors, limitSelectors: null };
|
|
4150
|
+
const limitSelectorText = unwrapScopeGroup(limitText);
|
|
4151
|
+
if (limitSelectorText === null || !limitSelectorText)
|
|
4152
|
+
return null;
|
|
4153
|
+
const limitSelectors = splitScopeSelectors(limitSelectorText);
|
|
4154
|
+
return limitSelectors.length > 0 ? { rootSelectors, limitSelectors } : null;
|
|
4155
|
+
}
|
|
4156
|
+
function findScopeLimitKeyword(prelude) {
|
|
4157
|
+
let quote = null;
|
|
4158
|
+
let escaped = false;
|
|
4159
|
+
let parentheses = 0;
|
|
4160
|
+
let brackets = 0;
|
|
4161
|
+
for (let index = 0;index < prelude.length; index += 1) {
|
|
4162
|
+
const character = prelude[index];
|
|
4163
|
+
if (escaped) {
|
|
4164
|
+
escaped = false;
|
|
4165
|
+
continue;
|
|
4166
|
+
}
|
|
4167
|
+
if (character === "\\") {
|
|
4168
|
+
escaped = true;
|
|
4169
|
+
continue;
|
|
4170
|
+
}
|
|
4171
|
+
if (quote) {
|
|
4172
|
+
if (character === quote)
|
|
4173
|
+
quote = null;
|
|
4174
|
+
continue;
|
|
4175
|
+
}
|
|
4176
|
+
if (character === '"' || character === "'")
|
|
4177
|
+
quote = character;
|
|
4178
|
+
else if (character === "(")
|
|
4179
|
+
parentheses += 1;
|
|
4180
|
+
else if (character === ")")
|
|
4181
|
+
parentheses -= 1;
|
|
4182
|
+
else if (character === "[")
|
|
4183
|
+
brackets += 1;
|
|
4184
|
+
else if (character === "]")
|
|
4185
|
+
brackets -= 1;
|
|
4186
|
+
if (parentheses < 0 || brackets < 0)
|
|
4187
|
+
return null;
|
|
4188
|
+
if (parentheses === 0 && brackets === 0 && prelude.slice(index, index + 2).toLowerCase() === "to" && !/[\w-]/.test(prelude[index - 1] ?? "") && !/[\w-]/.test(prelude[index + 2] ?? "")) {
|
|
4189
|
+
const remainder = prelude.slice(index + 2);
|
|
4190
|
+
const opening = remainder.search(/\S/);
|
|
4191
|
+
if (opening >= 0 && remainder[opening] === "(")
|
|
4192
|
+
return index;
|
|
4193
|
+
}
|
|
4194
|
+
}
|
|
4195
|
+
return null;
|
|
4196
|
+
}
|
|
4197
|
+
function unwrapScopeGroup(value) {
|
|
4198
|
+
if (!value)
|
|
4199
|
+
return "";
|
|
4200
|
+
if (value[0] !== "(")
|
|
4201
|
+
return value;
|
|
4202
|
+
const end = findScopeGroupEnd(value);
|
|
4203
|
+
if (end < 0 || value.slice(end + 1).trim())
|
|
4204
|
+
return null;
|
|
4205
|
+
return value.slice(1, end).trim();
|
|
4206
|
+
}
|
|
4207
|
+
function findScopeGroupEnd(value) {
|
|
4208
|
+
let depth = 0;
|
|
4209
|
+
let brackets = 0;
|
|
4210
|
+
let quote = null;
|
|
4211
|
+
let escaped = false;
|
|
4212
|
+
for (let index = 0;index < value.length; index += 1) {
|
|
4213
|
+
const character = value[index];
|
|
4214
|
+
if (escaped) {
|
|
4215
|
+
escaped = false;
|
|
4216
|
+
continue;
|
|
4217
|
+
}
|
|
4218
|
+
if (character === "\\") {
|
|
4219
|
+
escaped = true;
|
|
4220
|
+
continue;
|
|
4221
|
+
}
|
|
4222
|
+
if (quote) {
|
|
4223
|
+
if (character === quote)
|
|
4224
|
+
quote = null;
|
|
4225
|
+
continue;
|
|
4226
|
+
}
|
|
4227
|
+
if (character === '"' || character === "'")
|
|
4228
|
+
quote = character;
|
|
4229
|
+
else if (character === "[")
|
|
4230
|
+
brackets += 1;
|
|
4231
|
+
else if (character === "]")
|
|
4232
|
+
brackets -= 1;
|
|
4233
|
+
else if (character === "(" && brackets === 0)
|
|
4234
|
+
depth += 1;
|
|
4235
|
+
else if (character === ")" && brackets === 0) {
|
|
4236
|
+
depth -= 1;
|
|
4237
|
+
if (depth === 0)
|
|
4238
|
+
return index;
|
|
4239
|
+
}
|
|
4240
|
+
if (brackets < 0)
|
|
4241
|
+
return -1;
|
|
4242
|
+
}
|
|
4243
|
+
return -1;
|
|
4244
|
+
}
|
|
4245
|
+
function findScopeMatches(element, selectors) {
|
|
4246
|
+
if (selectors.length === 0)
|
|
4247
|
+
return [];
|
|
4248
|
+
const matches = [];
|
|
4249
|
+
let current = element;
|
|
4250
|
+
while (current) {
|
|
4251
|
+
const currentElement = current;
|
|
4252
|
+
if (selectors.some((selector) => matchesSelectorSafely(currentElement, selector)))
|
|
4253
|
+
matches.push(currentElement);
|
|
4254
|
+
current = currentElement.parentElement;
|
|
4255
|
+
}
|
|
4256
|
+
return matches;
|
|
4257
|
+
}
|
|
4258
|
+
function splitScopeSelectors(value) {
|
|
4259
|
+
const selectors = [];
|
|
4260
|
+
let parentheses = 0;
|
|
4261
|
+
let brackets = 0;
|
|
4262
|
+
let quote = null;
|
|
4263
|
+
let escaped = false;
|
|
4264
|
+
let start = 0;
|
|
4265
|
+
for (let index = 0;index < value.length; index += 1) {
|
|
4266
|
+
const character = value[index];
|
|
4267
|
+
if (escaped) {
|
|
4268
|
+
escaped = false;
|
|
4269
|
+
continue;
|
|
4270
|
+
}
|
|
4271
|
+
if (character === "\\") {
|
|
4272
|
+
escaped = true;
|
|
4273
|
+
continue;
|
|
4274
|
+
}
|
|
4275
|
+
if (quote) {
|
|
4276
|
+
if (character === quote)
|
|
4277
|
+
quote = null;
|
|
4278
|
+
continue;
|
|
4279
|
+
}
|
|
4280
|
+
if (character === '"' || character === "'")
|
|
4281
|
+
quote = character;
|
|
4282
|
+
else if (character === "(")
|
|
4283
|
+
parentheses += 1;
|
|
4284
|
+
else if (character === ")")
|
|
4285
|
+
parentheses -= 1;
|
|
4286
|
+
else if (character === "[")
|
|
4287
|
+
brackets += 1;
|
|
4288
|
+
else if (character === "]")
|
|
4289
|
+
brackets -= 1;
|
|
4290
|
+
else if (character === "," && parentheses === 0 && brackets === 0) {
|
|
4291
|
+
const selector2 = value.slice(start, index).trim();
|
|
4292
|
+
if (!selector2)
|
|
4293
|
+
return [];
|
|
4294
|
+
selectors.push(selector2);
|
|
4295
|
+
start = index + 1;
|
|
4296
|
+
}
|
|
4297
|
+
if (parentheses < 0 || brackets < 0)
|
|
4298
|
+
return [];
|
|
4299
|
+
}
|
|
4300
|
+
if (escaped || quote || parentheses !== 0 || brackets !== 0)
|
|
4301
|
+
return [];
|
|
4302
|
+
const selector = value.slice(start).trim();
|
|
4303
|
+
if (!selector)
|
|
4304
|
+
return [];
|
|
4305
|
+
selectors.push(selector);
|
|
4306
|
+
return selectors;
|
|
4307
|
+
}
|
|
4308
|
+
function resolveContainerQueryText(conditionText, rule, containerName) {
|
|
4309
|
+
const containerQuery = Reflect.get(rule, "containerQuery");
|
|
4310
|
+
if (typeof containerQuery === "string")
|
|
4311
|
+
return containerQuery;
|
|
4312
|
+
if (typeof containerName !== "string" || !containerName)
|
|
4313
|
+
return conditionText;
|
|
4314
|
+
if (!conditionText.startsWith(containerName))
|
|
4315
|
+
return conditionText;
|
|
4316
|
+
const rest = conditionText.slice(containerName.length);
|
|
4317
|
+
if (!/^\s/.test(rest))
|
|
4318
|
+
return conditionText;
|
|
4319
|
+
return rest.trimStart();
|
|
4320
|
+
}
|
|
4321
|
+
function isContainerConditionList(value) {
|
|
4322
|
+
if (!Array.isArray(value) || value.length === 0)
|
|
4323
|
+
return false;
|
|
4324
|
+
return value.every((entry) => typeof entry === "object" && entry !== null && typeof Reflect.get(entry, "name") === "string" && typeof Reflect.get(entry, "query") === "string");
|
|
4325
|
+
}
|
|
4326
|
+
function isContainerQueryActive(conditionText, element, rule, getParentElement) {
|
|
4327
|
+
if (typeof getComputedStyle !== "function")
|
|
4328
|
+
return false;
|
|
4329
|
+
const conditions = Reflect.get(rule, "conditions");
|
|
4330
|
+
if (isContainerConditionList(conditions))
|
|
4331
|
+
return conditions.some((condition) => isSingleContainerConditionActive(condition.query, condition.name, element, getParentElement));
|
|
4332
|
+
const containerName = Reflect.get(rule, "containerName");
|
|
4333
|
+
const queryText = resolveContainerQueryText(conditionText, rule, containerName);
|
|
4334
|
+
return isSingleContainerConditionActive(queryText, containerName, element, getParentElement);
|
|
4335
|
+
}
|
|
4336
|
+
function isSingleContainerConditionActive(queryText, containerName, element, getParentElement) {
|
|
4337
|
+
if (!queryText.trim())
|
|
4338
|
+
return false;
|
|
4339
|
+
const styleQuery = parseStyleQuery(queryText);
|
|
4340
|
+
if (styleQuery) {
|
|
4341
|
+
const remainder = (queryText.slice(0, styleQuery.index) + queryText.slice(styleQuery.end)).replace(/^\s*(?:and|or|not)\b/i, "").replace(/^\(|\)$/g, "").trim();
|
|
4342
|
+
if (remainder)
|
|
4343
|
+
return false;
|
|
4344
|
+
let ancestor = getParentElement(element);
|
|
4345
|
+
while (ancestor) {
|
|
4346
|
+
if (typeof containerName === "string" && containerName) {
|
|
4347
|
+
const computedStyle = getComputedStyle(ancestor);
|
|
4348
|
+
const name = computedStyle.containerName || computedStyle.getPropertyValue("container-name") || ancestor.style.containerName || ancestor.style.getPropertyValue("container-name");
|
|
4349
|
+
if (!name.split(/\s+/).includes(containerName)) {
|
|
4350
|
+
ancestor = getParentElement(ancestor);
|
|
4351
|
+
continue;
|
|
4352
|
+
}
|
|
4353
|
+
}
|
|
4354
|
+
const value = getComputedStyle(ancestor).getPropertyValue(styleQuery.name).trim() || ancestor.style.getPropertyValue(styleQuery.name).trim();
|
|
4355
|
+
return /^\s*not\b/i.test(queryText) ? value !== styleQuery.value.trim() : value === styleQuery.value.trim();
|
|
4356
|
+
}
|
|
4357
|
+
return false;
|
|
4358
|
+
}
|
|
4359
|
+
const queriesPhysicalWidth = /(?:^|[\s(])(?:width|min-width|max-width)\s*[:<>=]/i.test(queryText) || /[\d.]+(?:px|rem)\s*(?:<=|<|>=|>)\s*width\b/i.test(queryText);
|
|
4360
|
+
let container = getParentElement(element);
|
|
4361
|
+
while (container) {
|
|
4362
|
+
const computedStyle = getComputedStyle(container);
|
|
4363
|
+
const type = computedStyle.containerType || computedStyle.getPropertyValue("container-type") || container.style.containerType || container.style.getPropertyValue("container-type");
|
|
4364
|
+
const name = computedStyle.containerName || computedStyle.getPropertyValue("container-name") || container.style.containerName || container.style.getPropertyValue("container-name");
|
|
4365
|
+
const writingMode2 = computedStyle.writingMode || computedStyle.getPropertyValue("writing-mode") || container.style.writingMode || container.style.getPropertyValue("writing-mode");
|
|
4366
|
+
if ((typeof containerName !== "string" || !containerName || name.split(/\s+/).includes(containerName)) && type && type !== "normal" && !(queriesPhysicalWidth && /^(?:vertical|sideways)-/i.test(writingMode2) && type === "inline-size")) {
|
|
4367
|
+
break;
|
|
4368
|
+
}
|
|
4369
|
+
container = getParentElement(container);
|
|
4370
|
+
}
|
|
4371
|
+
if (!container)
|
|
4372
|
+
return false;
|
|
4373
|
+
const computedContainerStyle = getComputedStyle(container);
|
|
4374
|
+
const readInset = (property, fallbackProperty) => {
|
|
4375
|
+
const camel = property.replace(/-([a-z])/g, (_, character) => character.toUpperCase());
|
|
4376
|
+
const fallbackCamel = fallbackProperty.replace(/-([a-z])/g, (_, character) => character.toUpperCase());
|
|
4377
|
+
const value = Reflect.get(computedContainerStyle, camel) || Reflect.get(container.style, camel) || computedContainerStyle.getPropertyValue(property).trim() || container.style.getPropertyValue(property).trim() || Reflect.get(computedContainerStyle, fallbackCamel) || Reflect.get(container.style, fallbackCamel) || computedContainerStyle.getPropertyValue(fallbackProperty).trim() || container.style.getPropertyValue(fallbackProperty).trim();
|
|
4378
|
+
const parsed = Number.parseFloat(value);
|
|
4379
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : 0;
|
|
4380
|
+
};
|
|
4381
|
+
const writingMode = computedContainerStyle.writingMode || computedContainerStyle.getPropertyValue("writing-mode") || container.style.writingMode || container.style.getPropertyValue("writing-mode");
|
|
4382
|
+
const usesInlineSize = /(?:inline-size|min-inline-size|max-inline-size)/i.test(queryText);
|
|
4383
|
+
const isVerticalWritingMode = /^(?:vertical|sideways)-/i.test(writingMode);
|
|
4384
|
+
const verticalInlineAxis = usesInlineSize && isVerticalWritingMode;
|
|
4385
|
+
const physicalInsets = readInset("padding-left", "padding-inline-start") + readInset("padding-right", "padding-inline-end");
|
|
4386
|
+
const physicalBorders = readInset("border-left-width", "border-inline-start-width") + readInset("border-right-width", "border-inline-end-width");
|
|
4387
|
+
const inlineInsets = verticalInlineAxis ? readInset("padding-inline-start", "padding-top") + readInset("padding-inline-end", "padding-bottom") : physicalInsets;
|
|
4388
|
+
const inlineBorders = verticalInlineAxis ? readInset("border-inline-start-width", "border-top-width") + readInset("border-inline-end-width", "border-bottom-width") : physicalBorders;
|
|
4389
|
+
const readUsedContentSize = (axis, fallback, insets, borders) => {
|
|
4390
|
+
const parsed = Number.parseFloat(computedContainerStyle[axis]);
|
|
4391
|
+
if (!Number.isFinite(parsed))
|
|
4392
|
+
return fallback;
|
|
4393
|
+
const boxSizing = computedContainerStyle.boxSizing || container.style.boxSizing;
|
|
4394
|
+
return boxSizing === "border-box" ? Math.max(0, parsed - insets - borders) : parsed;
|
|
4395
|
+
};
|
|
4396
|
+
const physicalClientSize = container.clientWidth;
|
|
4397
|
+
const inlineClientSize = verticalInlineAxis ? container.clientHeight : physicalClientSize;
|
|
4398
|
+
const width = Math.max(0, readUsedContentSize("width", physicalClientSize > 0 ? physicalClientSize - physicalInsets : container.offsetWidth - physicalBorders - physicalInsets, physicalInsets, physicalBorders));
|
|
4399
|
+
const inlineSize = Math.max(0, readUsedContentSize(verticalInlineAxis ? "height" : "width", inlineClientSize > 0 ? inlineClientSize - inlineInsets : (verticalInlineAxis ? container.offsetHeight : container.offsetWidth) - inlineBorders - inlineInsets, inlineInsets, inlineBorders));
|
|
4400
|
+
const rootFontSize = Number.parseFloat(getComputedStyle(element.ownerDocument.documentElement).fontSize);
|
|
4401
|
+
const remSize = Number.isFinite(rootFontSize) && rootFontSize > 0 ? rootFontSize : 16;
|
|
4402
|
+
if (hasUnsupportedContainerSizeQuery(queryText))
|
|
4403
|
+
return false;
|
|
4404
|
+
return evaluateLogicalContainerCondition(queryText, width, remSize, inlineSize);
|
|
4405
|
+
}
|
|
4406
|
+
function isContainerRule(rule) {
|
|
4407
|
+
if (rule.constructor.name === "CSSContainerRule")
|
|
4408
|
+
return true;
|
|
4409
|
+
if (Reflect.get(rule, "type") !== 0)
|
|
4410
|
+
return false;
|
|
4411
|
+
const cssText = Reflect.get(rule, "cssText");
|
|
4412
|
+
return typeof cssText === "string" && /^\s*@container\b/i.test(cssText);
|
|
4413
|
+
}
|
|
4414
|
+
function isMediaRule(rule) {
|
|
4415
|
+
return typeof Reflect.get(rule, "media") === "object" && Reflect.get(rule, "media") !== null;
|
|
4416
|
+
}
|
|
4417
|
+
function isSupportsRule(rule) {
|
|
4418
|
+
return rule.constructor.name === "CSSSupportsRule" || Reflect.get(rule, "type") === 12;
|
|
4419
|
+
}
|
|
4420
|
+
function observeTextDirectionMediaQueries(element, onChange) {
|
|
4421
|
+
if (!element || typeof matchMedia !== "function")
|
|
4422
|
+
return;
|
|
4423
|
+
const sheets = new Set(Array.from(element.ownerDocument.styleSheets));
|
|
4424
|
+
for (const sheet of element.ownerDocument.adoptedStyleSheets ?? [])
|
|
4425
|
+
sheets.add(sheet);
|
|
4426
|
+
const root2 = element.getRootNode();
|
|
4427
|
+
if (typeof ShadowRoot !== "undefined" && root2 instanceof ShadowRoot) {
|
|
4428
|
+
for (const sheet of root2.adoptedStyleSheets)
|
|
4429
|
+
sheets.add(sheet);
|
|
4430
|
+
for (const style of root2.querySelectorAll('style,link[rel~="stylesheet"]')) {
|
|
4431
|
+
const sheet = style.sheet;
|
|
4432
|
+
if (sheet)
|
|
4433
|
+
sheets.add(sheet);
|
|
4434
|
+
}
|
|
4435
|
+
}
|
|
4436
|
+
const queries = new Set;
|
|
4437
|
+
const visitedSheets = new Set;
|
|
4438
|
+
const visit = (rules) => {
|
|
4439
|
+
for (const rule of Array.from(rules)) {
|
|
4440
|
+
if (Reflect.get(rule, "type") === 3) {
|
|
4441
|
+
try {
|
|
4442
|
+
const media = Reflect.get(rule, "media");
|
|
4443
|
+
const condition = media && Reflect.get(media, "mediaText");
|
|
4444
|
+
if (typeof condition === "string" && condition)
|
|
4445
|
+
queries.add(condition);
|
|
4446
|
+
} catch {}
|
|
4447
|
+
let imported;
|
|
4448
|
+
try {
|
|
4449
|
+
imported = Reflect.get(rule, "styleSheet");
|
|
4450
|
+
} catch {
|
|
4451
|
+
continue;
|
|
4452
|
+
}
|
|
4453
|
+
if (imported && !visitedSheets.has(imported)) {
|
|
4454
|
+
visitedSheets.add(imported);
|
|
4455
|
+
try {
|
|
4456
|
+
const importedRules = Reflect.get(imported, "cssRules");
|
|
4457
|
+
if (isCssRuleCollection2(importedRules))
|
|
4458
|
+
visit(importedRules);
|
|
4459
|
+
} catch {}
|
|
4460
|
+
}
|
|
4461
|
+
continue;
|
|
4462
|
+
}
|
|
4463
|
+
if (isMediaRule(rule)) {
|
|
4464
|
+
const condition = Reflect.get(rule, "conditionText");
|
|
4465
|
+
if (typeof condition === "string" && condition)
|
|
4466
|
+
queries.add(condition);
|
|
4467
|
+
}
|
|
4468
|
+
const nested = readNestedCssRules(rule);
|
|
4469
|
+
if (nested)
|
|
4470
|
+
visit(nested);
|
|
4471
|
+
}
|
|
4472
|
+
};
|
|
4473
|
+
for (const sheet of sheets) {
|
|
4474
|
+
if (visitedSheets.has(sheet))
|
|
4475
|
+
continue;
|
|
4476
|
+
visitedSheets.add(sheet);
|
|
4477
|
+
try {
|
|
4478
|
+
visit(sheet.cssRules);
|
|
4479
|
+
} catch {}
|
|
4480
|
+
}
|
|
4481
|
+
const mediaQueries = [...queries].map((query) => matchMedia(query));
|
|
4482
|
+
const handler = () => onChange();
|
|
4483
|
+
for (const mediaQuery of mediaQueries)
|
|
4484
|
+
mediaQuery.addEventListener?.("change", handler);
|
|
4485
|
+
return () => {
|
|
4486
|
+
for (const mediaQuery of mediaQueries)
|
|
4487
|
+
mediaQuery.removeEventListener?.("change", handler);
|
|
4488
|
+
};
|
|
4489
|
+
}
|
|
4490
|
+
|
|
4491
|
+
// src/_internal/text-direction.ts
|
|
4492
|
+
function elementDirectionStyleOverride(element) {
|
|
4493
|
+
if (!element)
|
|
4494
|
+
return;
|
|
4495
|
+
if (element.style.direction)
|
|
4496
|
+
return readComputedTextDirection(element);
|
|
4497
|
+
if (!matchesDirectionStyleRuleCached(element, undefined, composedParentElement))
|
|
4498
|
+
return;
|
|
4499
|
+
return readComputedTextDirection(element);
|
|
4500
|
+
}
|
|
4501
|
+
function resolveTextDirection(element, fallback, options) {
|
|
4502
|
+
const ignoreElementDirectionAttribute = options?.ignoreElementDirectionAttribute ?? false;
|
|
4503
|
+
const directionStyleRuleCache = new WeakMap;
|
|
4504
|
+
if (ignoreElementDirectionAttribute && element) {
|
|
4505
|
+
const styledDirection = readComputedTextDirection(element);
|
|
4506
|
+
const rootComputedDirection2 = readComputedTextDirection(element.ownerDocument.documentElement);
|
|
4507
|
+
const elementDirectionAttribute = element.getAttribute("dir")?.toLowerCase();
|
|
4508
|
+
const differsFromRootViaStyling = styledDirection !== rootComputedDirection2 && styledDirection !== elementDirectionAttribute;
|
|
4509
|
+
if (styledDirection && (hasElementDirectionStylingHint(element, directionStyleRuleCache) || differsFromRootViaStyling))
|
|
4510
|
+
return styledDirection;
|
|
4511
|
+
}
|
|
4512
|
+
let currentElement = ignoreElementDirectionAttribute ? element ? composedParentElement(element) : null : element ?? null;
|
|
4513
|
+
let documentDirection;
|
|
4514
|
+
let styledDirectionElement = null;
|
|
4515
|
+
while (currentElement) {
|
|
4516
|
+
if (!styledDirectionElement && currentElement !== currentElement.ownerDocument.documentElement && (Boolean(currentElement.style.direction) || matchesDirectionStyleRuleCached(currentElement, directionStyleRuleCache, composedParentElement))) {
|
|
4517
|
+
styledDirectionElement = currentElement;
|
|
4518
|
+
}
|
|
4519
|
+
const direction = currentElement.getAttribute("dir")?.toLowerCase();
|
|
4520
|
+
if (direction === "rtl" || direction === "ltr") {
|
|
4521
|
+
if (typeof getComputedStyle === "function" && styledDirectionElement) {
|
|
4522
|
+
const styledDirection2 = getComputedStyle(styledDirectionElement).direction;
|
|
4523
|
+
if (styledDirection2 === "rtl" || styledDirection2 === "ltr")
|
|
4524
|
+
return styledDirection2;
|
|
4525
|
+
}
|
|
4526
|
+
if (currentElement === currentElement.ownerDocument.documentElement) {
|
|
4527
|
+
documentDirection = direction;
|
|
4528
|
+
break;
|
|
4529
|
+
}
|
|
4530
|
+
return direction;
|
|
4531
|
+
}
|
|
4532
|
+
if (direction === "auto" && typeof getComputedStyle === "function") {
|
|
4533
|
+
const computedDirection2 = getComputedStyle(currentElement).direction;
|
|
4534
|
+
if (computedDirection2 === "rtl" || computedDirection2 === "ltr")
|
|
4535
|
+
return computedDirection2;
|
|
4536
|
+
}
|
|
4537
|
+
const styledDirection = currentElement.style.direction;
|
|
4538
|
+
if (!styledDirectionElement && (styledDirection === "rtl" || styledDirection === "ltr")) {
|
|
4539
|
+
styledDirectionElement = currentElement;
|
|
4540
|
+
}
|
|
4541
|
+
currentElement = composedParentElement(currentElement);
|
|
4542
|
+
}
|
|
4543
|
+
if (typeof getComputedStyle === "function" && styledDirectionElement) {
|
|
4544
|
+
const direction = getComputedStyle(styledDirectionElement).direction;
|
|
4545
|
+
if (direction === "rtl" || direction === "ltr")
|
|
4546
|
+
return direction;
|
|
4547
|
+
}
|
|
4548
|
+
const computedDirection = readComputedTextDirection(element);
|
|
4549
|
+
const rootComputedDirection = readComputedTextDirection(element?.ownerDocument.documentElement);
|
|
4550
|
+
if (!ignoreElementDirectionAttribute && computedDirection && computedDirection !== rootComputedDirection)
|
|
4551
|
+
return computedDirection;
|
|
4552
|
+
if (computedDirection && fallback && computedDirection !== fallback && hasDirectionStylingHint(element, false, directionStyleRuleCache)) {
|
|
4553
|
+
return computedDirection;
|
|
4554
|
+
}
|
|
4555
|
+
if (!fallback && computedDirection === "rtl")
|
|
4556
|
+
return computedDirection;
|
|
4557
|
+
if (fallback)
|
|
4558
|
+
return fallback;
|
|
4559
|
+
if (documentDirection)
|
|
4560
|
+
return documentDirection;
|
|
4561
|
+
return;
|
|
4562
|
+
}
|
|
4563
|
+
function hasElementDirectionStylingHint(element, cache) {
|
|
4564
|
+
return Boolean(element.style.direction) || matchesDirectionStyleRuleCached(element, cache, composedParentElement);
|
|
4565
|
+
}
|
|
4566
|
+
function readComputedTextDirection(element) {
|
|
4567
|
+
if (!element || typeof getComputedStyle !== "function")
|
|
4568
|
+
return;
|
|
4569
|
+
const direction = getComputedStyle(element).direction;
|
|
4570
|
+
return direction === "rtl" || direction === "ltr" ? direction : undefined;
|
|
4571
|
+
}
|
|
4572
|
+
function hasDirectionStylingHint(element, includeElement = false, cache) {
|
|
4573
|
+
let currentElement = includeElement ? element : element ? composedParentElement(element) : null;
|
|
4574
|
+
while (currentElement && currentElement !== currentElement.ownerDocument.documentElement) {
|
|
4575
|
+
if (currentElement.style.direction)
|
|
4576
|
+
return true;
|
|
4577
|
+
if (matchesDirectionStyleRuleCached(currentElement, cache, composedParentElement))
|
|
4578
|
+
return true;
|
|
4579
|
+
currentElement = composedParentElement(currentElement);
|
|
4580
|
+
}
|
|
4581
|
+
return false;
|
|
4582
|
+
}
|
|
4583
|
+
function composedParentElement(element) {
|
|
4584
|
+
if (element.parentElement)
|
|
4585
|
+
return element.parentElement;
|
|
4586
|
+
const root2 = element.getRootNode();
|
|
4587
|
+
return typeof ShadowRoot !== "undefined" && typeof HTMLElement !== "undefined" && root2 instanceof ShadowRoot && root2.host instanceof HTMLElement ? root2.host : null;
|
|
4588
|
+
}
|
|
4589
|
+
function isRightToLeftElement(element) {
|
|
4590
|
+
return resolveTextDirection(element) === "rtl";
|
|
4591
|
+
}
|
|
4592
|
+
function observeTextDirection(element, onChange) {
|
|
4593
|
+
if (!element || typeof MutationObserver === "undefined")
|
|
4594
|
+
return;
|
|
4595
|
+
const observedElement = element;
|
|
4596
|
+
const observer = new MutationObserver((mutations) => {
|
|
4597
|
+
if (mutations.some((mutation) => mutation.type === "attributes" && mutation.attributeName === "dir" || mutation.type === "childList")) {
|
|
4598
|
+
observeDirectionChain();
|
|
4599
|
+
}
|
|
4600
|
+
onChange();
|
|
4601
|
+
});
|
|
4602
|
+
function observeDirectionChain() {
|
|
4603
|
+
observer.disconnect();
|
|
4604
|
+
let currentElement = observedElement;
|
|
4605
|
+
while (currentElement) {
|
|
4606
|
+
const isAutoDirection = currentElement.getAttribute("dir")?.toLowerCase() === "auto";
|
|
4607
|
+
observer.observe(currentElement, {
|
|
4608
|
+
attributes: true,
|
|
4609
|
+
childList: true,
|
|
4610
|
+
characterData: isAutoDirection,
|
|
4611
|
+
subtree: isAutoDirection
|
|
4612
|
+
});
|
|
4613
|
+
currentElement = composedParentElement(currentElement);
|
|
4614
|
+
}
|
|
4615
|
+
}
|
|
4616
|
+
observeDirectionChain();
|
|
4617
|
+
return () => observer.disconnect();
|
|
4618
|
+
}
|
|
4619
|
+
|
|
2382
4620
|
// src/components/_internal/command-list-context.ts
|
|
2383
4621
|
import { createContext } from "svelte";
|
|
2384
4622
|
var [getCommandListContextStrict, setCommandListContextRaw] = createContext();
|
|
@@ -2398,7 +4636,67 @@ function hasCommandListContext() {
|
|
|
2398
4636
|
}
|
|
2399
4637
|
|
|
2400
4638
|
// src/components/_internal/create-command-list-state.svelte.ts
|
|
2401
|
-
import * as $
|
|
4639
|
+
import * as $7 from "svelte/internal/client";
|
|
4640
|
+
|
|
4641
|
+
// src/_internal/overlay.ts
|
|
4642
|
+
var escapeStack = [];
|
|
4643
|
+
function pushEscapeHandler(handler) {
|
|
4644
|
+
escapeStack.push(handler);
|
|
4645
|
+
if (escapeStack.length === 1 && typeof window !== "undefined") {
|
|
4646
|
+
window.addEventListener("keydown", onEscapeKeydown, { capture: true });
|
|
4647
|
+
}
|
|
4648
|
+
let released = false;
|
|
4649
|
+
return () => {
|
|
4650
|
+
if (released)
|
|
4651
|
+
return;
|
|
4652
|
+
released = true;
|
|
4653
|
+
const index = escapeStack.lastIndexOf(handler);
|
|
4654
|
+
if (index !== -1)
|
|
4655
|
+
escapeStack.splice(index, 1);
|
|
4656
|
+
if (escapeStack.length === 0 && typeof window !== "undefined") {
|
|
4657
|
+
window.removeEventListener("keydown", onEscapeKeydown, { capture: true });
|
|
4658
|
+
}
|
|
4659
|
+
};
|
|
4660
|
+
}
|
|
4661
|
+
function onEscapeKeydown(event) {
|
|
4662
|
+
if (event.key !== "Escape")
|
|
4663
|
+
return;
|
|
4664
|
+
const handler = escapeStack.at(-1);
|
|
4665
|
+
if (!handler)
|
|
4666
|
+
return;
|
|
4667
|
+
handler(event);
|
|
4668
|
+
}
|
|
4669
|
+
var scrollLockCount = 0;
|
|
4670
|
+
var originalBodyOverflow = null;
|
|
4671
|
+
function lockBodyScroll() {
|
|
4672
|
+
if (typeof document === "undefined")
|
|
4673
|
+
return () => {};
|
|
4674
|
+
if (scrollLockCount === 0) {
|
|
4675
|
+
originalBodyOverflow = document.body.style.overflow;
|
|
4676
|
+
document.body.style.overflow = "hidden";
|
|
4677
|
+
}
|
|
4678
|
+
scrollLockCount += 1;
|
|
4679
|
+
let released = false;
|
|
4680
|
+
return () => {
|
|
4681
|
+
if (released)
|
|
4682
|
+
return;
|
|
4683
|
+
released = true;
|
|
4684
|
+
scrollLockCount = Math.max(0, scrollLockCount - 1);
|
|
4685
|
+
if (scrollLockCount === 0) {
|
|
4686
|
+
document.body.style.overflow = originalBodyOverflow ?? "";
|
|
4687
|
+
originalBodyOverflow = null;
|
|
4688
|
+
}
|
|
4689
|
+
};
|
|
4690
|
+
}
|
|
4691
|
+
function captureFocus() {
|
|
4692
|
+
if (typeof document === "undefined")
|
|
4693
|
+
return null;
|
|
4694
|
+
const active = document.activeElement;
|
|
4695
|
+
if (active && active !== document.body && active instanceof HTMLElement) {
|
|
4696
|
+
return active;
|
|
4697
|
+
}
|
|
4698
|
+
return null;
|
|
4699
|
+
}
|
|
2402
4700
|
|
|
2403
4701
|
// src/utilities/document-order.ts
|
|
2404
4702
|
var DOCUMENT_POSITION_PRECEDING = 2;
|
|
@@ -2421,53 +4719,55 @@ function inDocumentOrder(items) {
|
|
|
2421
4719
|
// src/components/_internal/create-command-list-state.svelte.ts
|
|
2422
4720
|
class CommandListState {
|
|
2423
4721
|
#getListboxId;
|
|
2424
|
-
#
|
|
2425
|
-
#
|
|
4722
|
+
#autoActivateFirst = true;
|
|
4723
|
+
#registeredListboxId = $7.state("");
|
|
4724
|
+
#registrations = $7.state($7.proxy([]));
|
|
2426
4725
|
get registrations() {
|
|
2427
|
-
return $
|
|
4726
|
+
return $7.get(this.#registrations);
|
|
2428
4727
|
}
|
|
2429
4728
|
set registrations(value) {
|
|
2430
|
-
$
|
|
4729
|
+
$7.set(this.#registrations, value, true);
|
|
2431
4730
|
}
|
|
2432
|
-
#registrationsReady = $
|
|
4731
|
+
#registrationsReady = $7.state(false);
|
|
2433
4732
|
get registrationsReady() {
|
|
2434
|
-
return $
|
|
4733
|
+
return $7.get(this.#registrationsReady);
|
|
2435
4734
|
}
|
|
2436
4735
|
set registrationsReady(value) {
|
|
2437
|
-
$
|
|
4736
|
+
$7.set(this.#registrationsReady, value, true);
|
|
2438
4737
|
}
|
|
2439
4738
|
#itemCounter = 0;
|
|
2440
4739
|
#readyCycle = 0;
|
|
2441
|
-
#intendedActiveId = $
|
|
2442
|
-
#enabledIds = $
|
|
4740
|
+
#intendedActiveId = $7.state(null);
|
|
4741
|
+
#enabledIds = $7.derived(() => {
|
|
2443
4742
|
return inDocumentOrder(this.registrations).filter((registration) => !registration.getDisabled()).map((registration) => registration.id);
|
|
2444
4743
|
});
|
|
2445
4744
|
get enabledIds() {
|
|
2446
|
-
return $
|
|
4745
|
+
return $7.get(this.#enabledIds);
|
|
2447
4746
|
}
|
|
2448
4747
|
set enabledIds(value) {
|
|
2449
|
-
$
|
|
4748
|
+
$7.set(this.#enabledIds, value);
|
|
2450
4749
|
}
|
|
2451
|
-
#activeItemId = $
|
|
4750
|
+
#activeItemId = $7.derived(() => $7.get(this.#intendedActiveId) !== null && this.enabledIds.includes($7.get(this.#intendedActiveId)) ? $7.get(this.#intendedActiveId) : this.#autoActivateFirst ? this.enabledIds[0] ?? null : null);
|
|
2452
4751
|
get activeItemId() {
|
|
2453
|
-
return $
|
|
4752
|
+
return $7.get(this.#activeItemId);
|
|
2454
4753
|
}
|
|
2455
4754
|
set activeItemId(value) {
|
|
2456
|
-
$
|
|
4755
|
+
$7.set(this.#activeItemId, value);
|
|
2457
4756
|
}
|
|
2458
|
-
constructor(listboxId) {
|
|
4757
|
+
constructor(listboxId, options = {}) {
|
|
2459
4758
|
this.#getListboxId = typeof listboxId === "function" ? listboxId : () => listboxId;
|
|
2460
|
-
$
|
|
4759
|
+
$7.set(this.#registeredListboxId, this.#getListboxId(), true);
|
|
4760
|
+
this.#autoActivateFirst = options.autoActivateFirst ?? true;
|
|
2461
4761
|
}
|
|
2462
4762
|
get listboxId() {
|
|
2463
|
-
return $
|
|
4763
|
+
return $7.get(this.#registeredListboxId);
|
|
2464
4764
|
}
|
|
2465
4765
|
syncListboxId(nextListboxId = this.#getListboxId()) {
|
|
2466
4766
|
const listboxId = nextListboxId;
|
|
2467
|
-
if ($
|
|
4767
|
+
if ($7.get(this.#registeredListboxId) === listboxId)
|
|
2468
4768
|
return;
|
|
2469
|
-
$
|
|
2470
|
-
$
|
|
4769
|
+
$7.set(this.#registeredListboxId, listboxId, true);
|
|
4770
|
+
$7.set(this.#intendedActiveId, null);
|
|
2471
4771
|
this.registrations = this.registrations.map((registration, index) => ({
|
|
2472
4772
|
...registration,
|
|
2473
4773
|
id: updateRegistrationHandleId(registration, `${listboxId}-item-${index + 1}`)
|
|
@@ -2476,7 +4776,7 @@ class CommandListState {
|
|
|
2476
4776
|
this.refreshRegistrationsReady();
|
|
2477
4777
|
}
|
|
2478
4778
|
resetActiveItem() {
|
|
2479
|
-
$
|
|
4779
|
+
$7.set(this.#intendedActiveId, null);
|
|
2480
4780
|
}
|
|
2481
4781
|
refreshRegistrationsReady() {
|
|
2482
4782
|
this.registrationsReady = false;
|
|
@@ -2492,13 +4792,42 @@ class CommandListState {
|
|
|
2492
4792
|
const record = this.registrations.find((registration) => registration.id === this.activeItemId);
|
|
2493
4793
|
record?.node.scrollIntoView({ block: "nearest" });
|
|
2494
4794
|
}
|
|
4795
|
+
bindDismissal(options) {
|
|
4796
|
+
const releaseEscape = pushEscapeHandler((event) => {
|
|
4797
|
+
if (!options.isOpen() || event?.key !== "Escape")
|
|
4798
|
+
return;
|
|
4799
|
+
event.preventDefault();
|
|
4800
|
+
options.onDismiss(true);
|
|
4801
|
+
});
|
|
4802
|
+
const handlePointerDown = (event) => {
|
|
4803
|
+
const target = event.target;
|
|
4804
|
+
if (options.isOpen() && target instanceof Node && !options.isInside(target)) {
|
|
4805
|
+
options.onDismiss(false);
|
|
4806
|
+
}
|
|
4807
|
+
};
|
|
4808
|
+
const handleFocusIn = (event) => {
|
|
4809
|
+
const target = event.target;
|
|
4810
|
+
if (options.isOpen() && target instanceof Node && !options.isInside(target)) {
|
|
4811
|
+
options.onDismiss(false);
|
|
4812
|
+
}
|
|
4813
|
+
};
|
|
4814
|
+
if (typeof document === "undefined")
|
|
4815
|
+
return releaseEscape;
|
|
4816
|
+
document.addEventListener("mousedown", handlePointerDown, true);
|
|
4817
|
+
document.addEventListener("focusin", handleFocusIn, true);
|
|
4818
|
+
return () => {
|
|
4819
|
+
releaseEscape();
|
|
4820
|
+
document.removeEventListener("mousedown", handlePointerDown, true);
|
|
4821
|
+
document.removeEventListener("focusin", handleFocusIn, true);
|
|
4822
|
+
};
|
|
4823
|
+
}
|
|
2495
4824
|
setActiveById(id) {
|
|
2496
|
-
$
|
|
4825
|
+
$7.set(this.#intendedActiveId, id, true);
|
|
2497
4826
|
}
|
|
2498
4827
|
register(input, node) {
|
|
2499
4828
|
this.syncListboxId();
|
|
2500
4829
|
const id = `${this.listboxId}-item-${++this.#itemCounter}`;
|
|
2501
|
-
const handle = $
|
|
4830
|
+
const handle = $7.proxy({
|
|
2502
4831
|
id,
|
|
2503
4832
|
unregister: () => {
|
|
2504
4833
|
const index = this.registrations.findIndex((registeredItem) => registeredItem.node === node);
|
|
@@ -2517,6 +4846,13 @@ class CommandListState {
|
|
|
2517
4846
|
this.registrations.push(registration);
|
|
2518
4847
|
return handle;
|
|
2519
4848
|
}
|
|
4849
|
+
syncItems(items) {
|
|
4850
|
+
const previousActiveId = $7.get(this.#intendedActiveId);
|
|
4851
|
+
this.registrations = items.map((item) => ({ ...item, handle: { id: item.id, unregister: () => {} } }));
|
|
4852
|
+
this.#itemCounter = items.length;
|
|
4853
|
+
$7.set(this.#intendedActiveId, items.some((item) => item.id === previousActiveId) ? previousActiveId : null, true);
|
|
4854
|
+
this.refreshRegistrationsReady();
|
|
4855
|
+
}
|
|
2520
4856
|
activateItemById(id) {
|
|
2521
4857
|
const record = this.registrations.find((registration) => registration.id === id);
|
|
2522
4858
|
if (!record || record.getDisabled())
|
|
@@ -2542,7 +4878,7 @@ class CommandListState {
|
|
|
2542
4878
|
if (ids.length === 0)
|
|
2543
4879
|
return true;
|
|
2544
4880
|
const index = this.activeItemId === null ? -1 : ids.indexOf(this.activeItemId);
|
|
2545
|
-
$
|
|
4881
|
+
$7.set(this.#intendedActiveId, ids[(index + 1) % ids.length] ?? null, true);
|
|
2546
4882
|
return true;
|
|
2547
4883
|
}
|
|
2548
4884
|
if (event.key === "ArrowUp") {
|
|
@@ -2552,21 +4888,21 @@ class CommandListState {
|
|
|
2552
4888
|
if (ids.length === 0)
|
|
2553
4889
|
return true;
|
|
2554
4890
|
const index = this.activeItemId === null ? 0 : ids.indexOf(this.activeItemId);
|
|
2555
|
-
$
|
|
4891
|
+
$7.set(this.#intendedActiveId, ids[index <= 0 ? ids.length - 1 : index - 1] ?? null, true);
|
|
2556
4892
|
return true;
|
|
2557
4893
|
}
|
|
2558
4894
|
if (event.key === "Home") {
|
|
2559
4895
|
if (ignoreModifiedNavigation && isModified)
|
|
2560
4896
|
return false;
|
|
2561
4897
|
event.preventDefault();
|
|
2562
|
-
$
|
|
4898
|
+
$7.set(this.#intendedActiveId, ids[0] ?? null, true);
|
|
2563
4899
|
return true;
|
|
2564
4900
|
}
|
|
2565
4901
|
if (event.key === "End") {
|
|
2566
4902
|
if (ignoreModifiedNavigation && isModified)
|
|
2567
4903
|
return false;
|
|
2568
4904
|
event.preventDefault();
|
|
2569
|
-
$
|
|
4905
|
+
$7.set(this.#intendedActiveId, ids[ids.length - 1] ?? null, true);
|
|
2570
4906
|
return true;
|
|
2571
4907
|
}
|
|
2572
4908
|
if (event.key === "Enter") {
|
|
@@ -2607,8 +4943,8 @@ class CommandListState {
|
|
|
2607
4943
|
};
|
|
2608
4944
|
}
|
|
2609
4945
|
}
|
|
2610
|
-
function createCommandListState(listboxId) {
|
|
2611
|
-
return new CommandListState(listboxId);
|
|
4946
|
+
function createCommandListState(listboxId, options) {
|
|
4947
|
+
return new CommandListState(listboxId, options);
|
|
2612
4948
|
}
|
|
2613
4949
|
function updateRegistrationHandleId(registration, id) {
|
|
2614
4950
|
registration.handle.id = id;
|
|
@@ -2650,26 +4986,37 @@ function detectTrigger({
|
|
|
2650
4986
|
}
|
|
2651
4987
|
|
|
2652
4988
|
// src/components/command-menu/command-menu.svelte
|
|
2653
|
-
var root2 = $
|
|
2654
|
-
var root_1 = $
|
|
4989
|
+
var root2 = $8.from_html(`<span aria-hidden="true" class="cinder-_floating-surface cinder-command-menu__ghost"> </span>`);
|
|
4990
|
+
var root_1 = $8.from_html(`<div class="cinder-command-menu__empty" role="status"><!></div>`);
|
|
4991
|
+
var root_2 = $8.from_html(`<div><ul role="listbox" class="cinder-command-menu__listbox"><!></ul> <!></div>`);
|
|
4992
|
+
var root_3 = $8.from_html(`<!> <!>`, 1);
|
|
2655
4993
|
function Command_menu($$anchor, $$props) {
|
|
2656
|
-
const fallbackListboxId = $
|
|
2657
|
-
$
|
|
2658
|
-
let listboxId = $
|
|
4994
|
+
const fallbackListboxId = $8.props_id();
|
|
4995
|
+
$8.push($$props, true);
|
|
4996
|
+
let listboxId = $8.prop($$props, "listboxId", 3, fallbackListboxId), open = $8.prop($$props, "open", 15, false), query = $8.prop($$props, "query", 11, ""), placement = $8.prop($$props, "placement", 3, "bottom-start"), offset3 = $8.prop($$props, "offset", 3, 6), label = $8.prop($$props, "label", 3, "Commands");
|
|
2659
4997
|
const portalAttachment = createPortalAttachment({
|
|
2660
4998
|
target: () => document.body,
|
|
2661
4999
|
inheritAttributes: true,
|
|
2662
5000
|
source: () => $$props.anchor
|
|
2663
5001
|
});
|
|
2664
|
-
let mounted = $
|
|
2665
|
-
let listElement = $
|
|
5002
|
+
let mounted = $8.state(false);
|
|
5003
|
+
let listElement = $8.state(undefined);
|
|
5004
|
+
let selectionGeneration = $8.state(0);
|
|
5005
|
+
let composing = $8.state(false);
|
|
5006
|
+
let dismissedTrigger = $8.state(null);
|
|
2666
5007
|
const commandList = createCommandListState(() => listboxId());
|
|
2667
|
-
const showEmpty = $
|
|
2668
|
-
const showEmptyState = $
|
|
2669
|
-
const emptyStateId = $
|
|
2670
|
-
const
|
|
5008
|
+
const showEmpty = $8.derived(() => $8.get(mounted) && open() && commandList.registrationsReady && commandList.registrations.length === 0);
|
|
5009
|
+
const showEmptyState = $8.derived(() => $8.get(showEmpty) && Boolean($$props.empty));
|
|
5010
|
+
const emptyStateId = $8.derived(() => `${commandList.listboxId}-empty`);
|
|
5011
|
+
const caretIndex = $8.derived(() => {
|
|
5012
|
+
if ($$props.caretIndex !== undefined)
|
|
5013
|
+
return $$props.caretIndex;
|
|
5014
|
+
$8.get(selectionGeneration);
|
|
5015
|
+
return $$props.anchor?.selectionEnd ?? 0;
|
|
5016
|
+
});
|
|
5017
|
+
const caretAnchor = $8.derived(() => {
|
|
2671
5018
|
const anchorElement = $$props.anchor;
|
|
2672
|
-
const currentCaretIndex =
|
|
5019
|
+
const currentCaretIndex = $8.get(caretIndex);
|
|
2673
5020
|
if (!anchorElement)
|
|
2674
5021
|
return null;
|
|
2675
5022
|
return {
|
|
@@ -2680,57 +5027,187 @@ function Command_menu($$anchor, $$props) {
|
|
|
2680
5027
|
});
|
|
2681
5028
|
const anchoredOverlay = createAnchoredOverlay({
|
|
2682
5029
|
open: () => open(),
|
|
2683
|
-
anchor: () => $
|
|
2684
|
-
panel: () => $
|
|
5030
|
+
anchor: () => $8.get(caretAnchor),
|
|
5031
|
+
panel: () => $8.get(listElement),
|
|
2685
5032
|
placement: () => placement(),
|
|
2686
5033
|
offset: () => offset3(),
|
|
2687
5034
|
widthMode: () => "content"
|
|
2688
5035
|
});
|
|
2689
|
-
$
|
|
2690
|
-
$
|
|
5036
|
+
const caretAtFieldEnd = $8.derived(() => {
|
|
5037
|
+
$8.get(selectionGeneration);
|
|
5038
|
+
query();
|
|
5039
|
+
const currentAnchor = $$props.anchor;
|
|
5040
|
+
if (!currentAnchor)
|
|
5041
|
+
return false;
|
|
5042
|
+
return currentAnchor.selectionStart === currentAnchor.selectionEnd && currentAnchor.selectionEnd === currentAnchor.value.length;
|
|
2691
5043
|
});
|
|
2692
|
-
$
|
|
5044
|
+
const activeValue = $8.derived(() => {
|
|
5045
|
+
const id = open() ? commandList.activeItemId : null;
|
|
5046
|
+
if (id === null)
|
|
5047
|
+
return null;
|
|
5048
|
+
const record = commandList.registrations.find((registration) => registration.id === id);
|
|
5049
|
+
return record?.getValue() ?? null;
|
|
5050
|
+
});
|
|
5051
|
+
const inlineCompletion = createInlineCompletionState({
|
|
5052
|
+
enabled: () => Boolean($$props.onComplete),
|
|
5053
|
+
open: () => open(),
|
|
5054
|
+
composing: () => $8.get(composing),
|
|
5055
|
+
caretAtFieldEnd: () => $8.get(caretAtFieldEnd),
|
|
5056
|
+
rightToLeft: () => isRightToLeftElement($$props.anchor),
|
|
5057
|
+
query: () => query(),
|
|
5058
|
+
caretIndex: () => $8.get(caretIndex),
|
|
5059
|
+
activeItemId: () => open() ? commandList.activeItemId : null,
|
|
5060
|
+
activeValue: () => $8.get(activeValue)
|
|
5061
|
+
});
|
|
5062
|
+
const ghostRect = $8.derived(() => {
|
|
5063
|
+
$8.get(selectionGeneration);
|
|
5064
|
+
if (!$$props.anchor || !inlineCompletion.visible)
|
|
5065
|
+
return null;
|
|
5066
|
+
return getCaretRect($$props.anchor, $$props.anchor.value.length);
|
|
5067
|
+
});
|
|
5068
|
+
const ghostStyle = $8.derived(() => {
|
|
5069
|
+
if (!$$props.anchor)
|
|
5070
|
+
return "";
|
|
5071
|
+
const rect = $8.get(ghostRect);
|
|
5072
|
+
const position = rect ? `position: fixed; left: ${rect.left}px; top: ${rect.top}px;` : "position: fixed;";
|
|
5073
|
+
return `${position} ${computeGhostOverlayFontStyle($$props.anchor)}`;
|
|
5074
|
+
});
|
|
5075
|
+
const ghostPortalAttachment = createPortalAttachment({
|
|
5076
|
+
target: () => document.body,
|
|
5077
|
+
inheritAttributes: true,
|
|
5078
|
+
source: () => $$props.anchor
|
|
5079
|
+
});
|
|
5080
|
+
$8.user_effect(() => {
|
|
5081
|
+
$8.set(mounted, true);
|
|
5082
|
+
});
|
|
5083
|
+
$8.user_effect(() => {
|
|
2693
5084
|
commandList.syncListboxId(listboxId());
|
|
2694
5085
|
});
|
|
2695
|
-
$
|
|
5086
|
+
$8.user_effect(() => {
|
|
5087
|
+
const currentAnchor = $$props.anchor;
|
|
5088
|
+
const currentValue = currentAnchor?.value;
|
|
5089
|
+
if ($8.get(dismissedTrigger) && ($8.get(dismissedTrigger).anchor !== currentAnchor || $8.get(dismissedTrigger).value !== currentValue || $8.get(dismissedTrigger).caretIndex !== $8.get(caretIndex))) {
|
|
5090
|
+
$8.set(dismissedTrigger, null);
|
|
5091
|
+
}
|
|
5092
|
+
if (open() && $8.get(dismissedTrigger) && $8.get(dismissedTrigger).anchor === currentAnchor && $8.get(dismissedTrigger).value === currentValue && $8.get(dismissedTrigger).caretIndex === $8.get(caretIndex)) {
|
|
5093
|
+
open(false);
|
|
5094
|
+
}
|
|
5095
|
+
});
|
|
5096
|
+
$8.user_effect(() => {
|
|
5097
|
+
const currentAnchor = $$props.anchor;
|
|
5098
|
+
if (!currentAnchor)
|
|
5099
|
+
return;
|
|
5100
|
+
function clearDismissalWhenSelectionMoves() {
|
|
5101
|
+
if ($8.get(dismissedTrigger)?.anchor === currentAnchor && ($8.get(dismissedTrigger).value !== currentAnchor.value || $8.get(dismissedTrigger).selectionStart !== currentAnchor.selectionStart || $8.get(dismissedTrigger).selectionEnd !== currentAnchor.selectionEnd)) {
|
|
5102
|
+
$8.set(dismissedTrigger, null);
|
|
5103
|
+
}
|
|
5104
|
+
$8.set(selectionGeneration, $8.get(selectionGeneration) + 1);
|
|
5105
|
+
}
|
|
5106
|
+
const stopSelectionchange = on(currentAnchor, "selectionchange", clearDismissalWhenSelectionMoves);
|
|
5107
|
+
const stopSelect = on(currentAnchor, "select", clearDismissalWhenSelectionMoves);
|
|
5108
|
+
const stopInput = on(currentAnchor, "input", clearDismissalWhenSelectionMoves);
|
|
5109
|
+
const stopClick = on(currentAnchor, "click", clearDismissalWhenSelectionMoves);
|
|
5110
|
+
const stopKeyup = on(currentAnchor, "keyup", clearDismissalWhenSelectionMoves);
|
|
5111
|
+
return () => {
|
|
5112
|
+
stopSelectionchange();
|
|
5113
|
+
stopSelect();
|
|
5114
|
+
stopInput();
|
|
5115
|
+
stopClick();
|
|
5116
|
+
stopKeyup();
|
|
5117
|
+
};
|
|
5118
|
+
});
|
|
5119
|
+
$8.user_effect(() => {
|
|
5120
|
+
if (!$$props.anchor || !inlineCompletion.visible)
|
|
5121
|
+
return;
|
|
5122
|
+
const currentAnchor = $$props.anchor;
|
|
5123
|
+
let pendingFrame = null;
|
|
5124
|
+
const bumpSelectionGeneration = () => {
|
|
5125
|
+
if (pendingFrame !== null)
|
|
5126
|
+
return;
|
|
5127
|
+
pendingFrame = requestAnimationFrame(() => {
|
|
5128
|
+
pendingFrame = null;
|
|
5129
|
+
$8.set(selectionGeneration, $8.get(selectionGeneration) + 1);
|
|
5130
|
+
});
|
|
5131
|
+
};
|
|
5132
|
+
const stopAnchorScroll = on(currentAnchor, "scroll", bumpSelectionGeneration);
|
|
5133
|
+
const stopWindowScroll = on(window, "scroll", bumpSelectionGeneration, { capture: true });
|
|
5134
|
+
const stopWindowResize = on(window, "resize", bumpSelectionGeneration);
|
|
5135
|
+
return () => {
|
|
5136
|
+
stopAnchorScroll();
|
|
5137
|
+
stopWindowScroll();
|
|
5138
|
+
stopWindowResize();
|
|
5139
|
+
if (pendingFrame !== null) {
|
|
5140
|
+
cancelAnimationFrame(pendingFrame);
|
|
5141
|
+
pendingFrame = null;
|
|
5142
|
+
}
|
|
5143
|
+
};
|
|
5144
|
+
});
|
|
5145
|
+
$8.user_effect(() => {
|
|
2696
5146
|
if (!open()) {
|
|
2697
5147
|
commandList.resetActiveItem();
|
|
2698
5148
|
return;
|
|
2699
5149
|
}
|
|
2700
5150
|
});
|
|
2701
|
-
$
|
|
5151
|
+
$8.user_effect(() => {
|
|
2702
5152
|
query();
|
|
2703
5153
|
commandList.refreshRegistrationsReady();
|
|
2704
5154
|
});
|
|
2705
|
-
$
|
|
2706
|
-
$$props.
|
|
5155
|
+
$8.user_effect(() => {
|
|
5156
|
+
$$props.onStateChange?.({
|
|
2707
5157
|
listboxId: commandList.listboxId,
|
|
2708
5158
|
activeItemId: open() ? commandList.activeItemId : null
|
|
2709
5159
|
});
|
|
2710
5160
|
});
|
|
2711
|
-
$
|
|
5161
|
+
$8.user_effect(() => {
|
|
2712
5162
|
commandList.scrollActiveItemIntoView();
|
|
2713
5163
|
});
|
|
2714
5164
|
function activateItemById(id) {
|
|
2715
5165
|
const record = commandList.activateItemById(id);
|
|
2716
5166
|
if (!record)
|
|
2717
5167
|
return;
|
|
2718
|
-
$$props.
|
|
5168
|
+
$$props.onSelect?.({ value: record.getValue(), query: query() });
|
|
2719
5169
|
}
|
|
2720
5170
|
setCommandListContext(commandList.createContext(activateItemById));
|
|
2721
|
-
function dismiss() {
|
|
5171
|
+
function dismiss({ latch = false } = {}) {
|
|
2722
5172
|
if (!open())
|
|
2723
5173
|
return;
|
|
5174
|
+
if (latch && $$props.anchor) {
|
|
5175
|
+
$8.set(dismissedTrigger, {
|
|
5176
|
+
anchor: $$props.anchor,
|
|
5177
|
+
value: $$props.anchor.value,
|
|
5178
|
+
caretIndex: $8.get(caretIndex),
|
|
5179
|
+
selectionStart: $$props.anchor.selectionStart,
|
|
5180
|
+
selectionEnd: $$props.anchor.selectionEnd
|
|
5181
|
+
}, true);
|
|
5182
|
+
}
|
|
2724
5183
|
open(false);
|
|
2725
|
-
$$props.
|
|
5184
|
+
$$props.onDismiss?.();
|
|
5185
|
+
}
|
|
5186
|
+
function isModifiedKey(event) {
|
|
5187
|
+
return event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
|
|
2726
5188
|
}
|
|
2727
5189
|
function handleKeydown(event) {
|
|
2728
5190
|
if (!open())
|
|
2729
5191
|
return;
|
|
5192
|
+
const isComposingEvent = event.isComposing || event.keyCode === 229;
|
|
5193
|
+
if (!isComposingEvent && event.key === "Escape" && inlineCompletion.dismissGhostText()) {
|
|
5194
|
+
event.preventDefault();
|
|
5195
|
+
event.stopPropagation();
|
|
5196
|
+
return;
|
|
5197
|
+
}
|
|
5198
|
+
if (!isComposingEvent && inlineCompletion.visible && !isModifiedKey(event) && (event.key === "ArrowRight" || event.key === "Tab")) {
|
|
5199
|
+
const completion = inlineCompletion.acceptCompletion();
|
|
5200
|
+
if (completion) {
|
|
5201
|
+
event.preventDefault();
|
|
5202
|
+
event.stopPropagation();
|
|
5203
|
+
$$props.onComplete?.(completion);
|
|
5204
|
+
return;
|
|
5205
|
+
}
|
|
5206
|
+
}
|
|
2730
5207
|
commandList.handleKeydown({
|
|
2731
5208
|
event,
|
|
2732
5209
|
onEnter: activateItemById,
|
|
2733
|
-
onEscape: dismiss,
|
|
5210
|
+
onEscape: () => dismiss({ latch: true }),
|
|
2734
5211
|
ignoreModifiedNavigation: true
|
|
2735
5212
|
});
|
|
2736
5213
|
}
|
|
@@ -2740,68 +5217,96 @@ function Command_menu($$anchor, $$props) {
|
|
|
2740
5217
|
return;
|
|
2741
5218
|
if ($$props.anchor?.contains(target))
|
|
2742
5219
|
return;
|
|
2743
|
-
if ($
|
|
5220
|
+
if ($8.get(listElement)?.contains(target))
|
|
2744
5221
|
return;
|
|
2745
5222
|
dismiss();
|
|
2746
5223
|
}
|
|
2747
|
-
$
|
|
5224
|
+
$8.user_effect(() => {
|
|
2748
5225
|
if (!open() || !$$props.anchor)
|
|
2749
5226
|
return;
|
|
2750
5227
|
const stopKeydown = on($$props.anchor, "keydown", handleKeydown);
|
|
5228
|
+
const stopCompositionStart = on($$props.anchor, "compositionstart", () => {
|
|
5229
|
+
$8.set(composing, true);
|
|
5230
|
+
});
|
|
5231
|
+
const stopCompositionEnd = on($$props.anchor, "compositionend", () => {
|
|
5232
|
+
$8.set(composing, false);
|
|
5233
|
+
});
|
|
2751
5234
|
const stopPointerdown = on(document, "pointerdown", handleDocumentPointerdown, { capture: true });
|
|
2752
5235
|
return () => {
|
|
2753
5236
|
stopKeydown();
|
|
5237
|
+
stopCompositionStart();
|
|
5238
|
+
stopCompositionEnd();
|
|
2754
5239
|
stopPointerdown();
|
|
5240
|
+
$8.set(composing, false);
|
|
2755
5241
|
};
|
|
2756
5242
|
});
|
|
2757
|
-
var fragment =
|
|
2758
|
-
var node = $
|
|
5243
|
+
var fragment = root_3();
|
|
5244
|
+
var node = $8.first_child(fragment);
|
|
5245
|
+
{
|
|
5246
|
+
var consequent = ($$anchor2) => {
|
|
5247
|
+
var span = root2();
|
|
5248
|
+
var text = $8.child(span, true);
|
|
5249
|
+
$8.reset(span);
|
|
5250
|
+
$8.attach(span, () => ghostPortalAttachment);
|
|
5251
|
+
$8.template_effect(() => {
|
|
5252
|
+
$8.set_attribute(span, "data-cinder-position-ready", $8.get(ghostRect) !== null);
|
|
5253
|
+
$8.set_style(span, $8.get(ghostStyle));
|
|
5254
|
+
$8.set_text(text, inlineCompletion.remainder);
|
|
5255
|
+
});
|
|
5256
|
+
$8.append($$anchor2, span);
|
|
5257
|
+
};
|
|
5258
|
+
$8.if(node, ($$render) => {
|
|
5259
|
+
if ($8.get(mounted) && open() && $$props.anchor && inlineCompletion.visible)
|
|
5260
|
+
$$render(consequent);
|
|
5261
|
+
});
|
|
5262
|
+
}
|
|
5263
|
+
var node_1 = $8.sibling(node, 2);
|
|
2759
5264
|
{
|
|
2760
|
-
var
|
|
2761
|
-
var div =
|
|
2762
|
-
var ul = $
|
|
2763
|
-
var
|
|
2764
|
-
$
|
|
2765
|
-
$
|
|
2766
|
-
var
|
|
5265
|
+
var consequent_2 = ($$anchor2) => {
|
|
5266
|
+
var div = root_2();
|
|
5267
|
+
var ul = $8.child(div);
|
|
5268
|
+
var node_2 = $8.child(ul);
|
|
5269
|
+
$8.snippet(node_2, () => $$props.items, () => ({ query: query() }));
|
|
5270
|
+
$8.reset(ul);
|
|
5271
|
+
var node_3 = $8.sibling(ul, 2);
|
|
2767
5272
|
{
|
|
2768
|
-
var
|
|
2769
|
-
var div_1 =
|
|
2770
|
-
var
|
|
2771
|
-
$
|
|
2772
|
-
$
|
|
2773
|
-
$
|
|
2774
|
-
$
|
|
5273
|
+
var consequent_1 = ($$anchor3) => {
|
|
5274
|
+
var div_1 = root_1();
|
|
5275
|
+
var node_4 = $8.child(div_1);
|
|
5276
|
+
$8.snippet(node_4, () => $$props.empty);
|
|
5277
|
+
$8.reset(div_1);
|
|
5278
|
+
$8.template_effect(() => $8.set_attribute(div_1, "id", $8.get(emptyStateId)));
|
|
5279
|
+
$8.append($$anchor3, div_1);
|
|
2775
5280
|
};
|
|
2776
|
-
$
|
|
2777
|
-
if ($
|
|
2778
|
-
$$render(
|
|
5281
|
+
$8.if(node_3, ($$render) => {
|
|
5282
|
+
if ($8.get(showEmptyState) && $$props.empty)
|
|
5283
|
+
$$render(consequent_1);
|
|
2779
5284
|
});
|
|
2780
5285
|
}
|
|
2781
|
-
$
|
|
2782
|
-
$
|
|
2783
|
-
$
|
|
2784
|
-
$
|
|
2785
|
-
$
|
|
2786
|
-
$
|
|
2787
|
-
$
|
|
2788
|
-
$
|
|
2789
|
-
$
|
|
2790
|
-
$
|
|
2791
|
-
$
|
|
2792
|
-
$
|
|
5286
|
+
$8.reset(div);
|
|
5287
|
+
$8.bind_this(div, ($$value) => $8.set(listElement, $$value), () => $8.get(listElement));
|
|
5288
|
+
$8.attach(div, () => portalAttachment);
|
|
5289
|
+
$8.template_effect(($0) => {
|
|
5290
|
+
$8.set_attribute(div, "aria-hidden", anchoredOverlay.positionReady ? undefined : "true");
|
|
5291
|
+
$8.set_class(div, 1, $0);
|
|
5292
|
+
$8.set_attribute(div, "data-cinder-position-ready", anchoredOverlay.positionReady);
|
|
5293
|
+
$8.set_style(div, anchoredOverlay.positionStyle);
|
|
5294
|
+
$8.set_attribute(ul, "id", commandList.listboxId);
|
|
5295
|
+
$8.set_attribute(ul, "aria-label", label());
|
|
5296
|
+
$8.set_attribute(ul, "aria-describedby", $8.get(showEmptyState) ? $8.get(emptyStateId) : undefined);
|
|
5297
|
+
$8.set_attribute(ul, "data-cinder-empty", $8.get(showEmptyState) || undefined);
|
|
2793
5298
|
}, [
|
|
2794
|
-
() => $
|
|
5299
|
+
() => $8.clsx(classNames("cinder-_floating-surface", "cinder-command-menu", $$props.class))
|
|
2795
5300
|
]);
|
|
2796
|
-
$
|
|
5301
|
+
$8.append($$anchor2, div);
|
|
2797
5302
|
};
|
|
2798
|
-
$
|
|
2799
|
-
if ($
|
|
2800
|
-
$$render(
|
|
5303
|
+
$8.if(node_1, ($$render) => {
|
|
5304
|
+
if ($8.get(mounted) && open() && $$props.anchor)
|
|
5305
|
+
$$render(consequent_2);
|
|
2801
5306
|
});
|
|
2802
5307
|
}
|
|
2803
|
-
$
|
|
2804
|
-
$
|
|
5308
|
+
$8.append($$anchor, fragment);
|
|
5309
|
+
$8.pop();
|
|
2805
5310
|
}
|
|
2806
5311
|
|
|
2807
5312
|
// src/components/command-menu/index.ts
|
|
@@ -2812,4 +5317,4 @@ export {
|
|
|
2812
5317
|
Command_menu as CommandMenu
|
|
2813
5318
|
};
|
|
2814
5319
|
|
|
2815
|
-
//# debugId=
|
|
5320
|
+
//# debugId=5634AF90DB7918E664756E2164756E21
|