@spinjs/components 0.1.0-preview.2 → 0.2.0-alpha.1
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/README.md +15 -5
- package/dist/angle-slider/angle-slider.events.d.ts +2 -3
- package/dist/angle-slider/angle-slider.machine.d.ts +4 -5
- package/dist/angle-slider/angle-slider.machine.js +2 -2
- package/dist/angle-slider/angle-slider.presentation.d.ts +10 -11
- package/dist/angle-slider/angle-slider.presentation.js +2 -2
- package/dist/angle-slider/angle-slider.state.d.ts +1 -2
- package/dist/angle-slider/angle-slider.state.js +1 -1
- package/dist/angle-slider/angle-slider.transitions.d.ts +2 -3
- package/dist/angle-slider/examples/basic.html +2 -2
- package/dist/angle-slider/examples/basic.html.js +5 -0
- package/dist/angle-slider/examples/knob.html +1 -1
- package/dist/angle-slider/examples/knob.html.js +5 -0
- package/dist/angle-slider/examples/labeled.html +11 -11
- package/dist/angle-slider/examples/labeled.html.js +5 -0
- package/dist/angle-slider/examples/marks.html +2 -2
- package/dist/angle-slider/examples/marks.html.js +5 -0
- package/dist/async-list/async-list.events.d.ts +2 -3
- package/dist/async-list/async-list.machine.d.ts +2 -3
- package/dist/async-list/async-list.machine.js +1 -1
- package/dist/async-list/async-list.presentation.d.ts +13 -14
- package/dist/async-list/async-list.presentation.js +2 -2
- package/dist/async-list/async-list.state.d.ts +1 -2
- package/dist/async-list/async-list.state.js +1 -1
- package/dist/async-list/async-list.transitions.d.ts +3 -4
- package/dist/async-list/examples/basic.html +7 -7
- package/dist/async-list/examples/basic.html.js +5 -0
- package/dist/avatar/avatar.events.d.ts +2 -3
- package/dist/avatar/avatar.machine.d.ts +12 -4
- package/dist/avatar/avatar.machine.js +1 -1
- package/dist/avatar/avatar.presentation.d.ts +5 -6
- package/dist/avatar/avatar.presentation.js +1 -1
- package/dist/avatar/avatar.state.d.ts +1 -2
- package/dist/avatar/avatar.state.js +1 -1
- package/dist/avatar/avatar.transitions.d.ts +2 -3
- package/dist/avatar/examples/badge.html +2 -2
- package/dist/avatar/examples/badge.html.js +5 -0
- package/dist/avatar/examples/badgeminimal.html +1 -1
- package/dist/avatar/examples/badgeminimal.html.js +5 -0
- package/dist/avatar/examples/basic.html +1 -1
- package/dist/avatar/examples/basic.html.js +5 -0
- package/dist/avatar/examples/count.html +5 -5
- package/dist/avatar/examples/count.html.js +5 -0
- package/dist/avatar/examples/fallback.html +1 -1
- package/dist/avatar/examples/fallback.html.js +5 -0
- package/dist/avatar/examples/group.html +4 -4
- package/dist/avatar/examples/group.html.js +5 -0
- package/dist/avatar/examples/icon.html +2 -2
- package/dist/avatar/examples/icon.html.js +5 -0
- package/dist/avatar/examples/multiples.html +4 -4
- package/dist/avatar/examples/multiples.html.js +5 -0
- package/dist/avatar/examples/pills.html +12 -12
- package/dist/avatar/examples/pills.html.js +5 -0
- package/dist/avatar/examples/pillsolid.html +4 -4
- package/dist/avatar/examples/pillsolid.html.js +5 -0
- package/dist/avatar/examples/rounded.html +1 -1
- package/dist/avatar/examples/rounded.html.js +5 -0
- package/dist/avatar/examples/status.html +2 -2
- package/dist/avatar/examples/status.html.js +5 -0
- package/dist/avatar/examples/statusminimal.html +1 -1
- package/dist/avatar/examples/statusminimal.html.js +5 -0
- package/dist/avatar/examples/trusted.html +6 -6
- package/dist/avatar/examples/trusted.html.js +5 -0
- package/dist/avatar/examples/verification.html +3 -3
- package/dist/avatar/examples/verification.html.js +5 -0
- package/dist/carousel/carousel.events.d.ts +2 -3
- package/dist/carousel/carousel.machine.d.ts +3 -4
- package/dist/carousel/carousel.machine.js +1 -1
- package/dist/carousel/carousel.presentation.d.ts +14 -15
- package/dist/carousel/carousel.presentation.js +2 -2
- package/dist/carousel/carousel.state.d.ts +1 -2
- package/dist/carousel/carousel.state.js +1 -1
- package/dist/carousel/carousel.transitions.d.ts +2 -3
- package/dist/carousel/examples/autoplay.html +8 -8
- package/dist/carousel/examples/autoplay.html.js +5 -0
- package/dist/carousel/examples/basic.html +7 -7
- package/dist/carousel/examples/basic.html.js +5 -0
- package/dist/carousel/examples/cards.html +8 -8
- package/dist/carousel/examples/cards.html.js +5 -0
- package/dist/carousel/examples/hero.html +6 -6
- package/dist/carousel/examples/hero.html.js +5 -0
- package/dist/carousel/examples/infinite.html +7 -7
- package/dist/carousel/examples/infinite.html.js +5 -0
- package/dist/carousel/examples/minimal.html +5 -5
- package/dist/carousel/examples/minimal.html.js +5 -0
- package/dist/carousel/examples/testimonials.html +10 -10
- package/dist/carousel/examples/testimonials.html.js +5 -0
- package/dist/carousel/examples/thumbnails.html +8 -8
- package/dist/carousel/examples/thumbnails.html.js +5 -0
- package/dist/carousel/examples/vertical.html +8 -8
- package/dist/carousel/examples/vertical.html.js +5 -0
- package/dist/cascade-select/cascade.events.d.ts +2 -3
- package/dist/cascade-select/cascade.machine.d.ts +3 -4
- package/dist/cascade-select/cascade.machine.js +1 -1
- package/dist/cascade-select/cascade.presentation.d.ts +8 -9
- package/dist/cascade-select/cascade.presentation.js +12 -12
- package/dist/cascade-select/cascade.state.d.ts +1 -2
- package/dist/cascade-select/cascade.state.js +1 -1
- package/dist/cascade-select/cascade.transitions.d.ts +2 -3
- package/dist/cascade-select/examples/basic.html +13 -11
- package/dist/cascade-select/examples/basic.html.js +5 -0
- package/dist/color-picker/color-picker.events.d.ts +3 -4
- package/dist/color-picker/color-picker.machine.d.ts +3 -3
- package/dist/color-picker/color-picker.machine.js +1 -1
- package/dist/color-picker/color-picker.presentation.d.ts +18 -19
- package/dist/color-picker/color-picker.presentation.js +4 -5
- package/dist/color-picker/color-picker.state.d.ts +2 -3
- package/dist/color-picker/color-picker.state.js +2 -2
- package/dist/color-picker/color-picker.transitions.d.ts +3 -4
- package/dist/color-picker/color.d.ts +39 -0
- package/dist/color-picker/color.js +401 -0
- package/dist/color-picker/examples/basic.html +14 -14
- package/dist/color-picker/examples/basic.html.js +5 -0
- package/dist/color-picker/examples/hue-wheel.html +9 -9
- package/dist/color-picker/examples/hue-wheel.html.js +5 -0
- package/dist/color-picker/examples/inline.html +8 -8
- package/dist/color-picker/examples/inline.html.js +5 -0
- package/dist/color-picker/examples/with-presets.html +10 -10
- package/dist/color-picker/examples/with-presets.html.js +5 -0
- package/dist/combobox/combobox.events.d.ts +2 -3
- package/dist/combobox/combobox.machine.d.ts +3 -4
- package/dist/combobox/combobox.machine.js +1 -1
- package/dist/combobox/combobox.presentation.d.ts +8 -9
- package/dist/combobox/combobox.presentation.js +3 -3
- package/dist/combobox/combobox.state.d.ts +1 -2
- package/dist/combobox/combobox.state.js +1 -1
- package/dist/combobox/combobox.transitions.d.ts +3 -4
- package/dist/combobox/examples/basic.html +7 -7
- package/dist/combobox/examples/basic.html.js +5 -0
- package/dist/combobox/examples/directory.html +7 -7
- package/dist/combobox/examples/directory.html.js +5 -0
- package/dist/combobox/examples/grouping.html +7 -7
- package/dist/combobox/examples/grouping.html.js +5 -0
- package/dist/combobox/examples/multiple.html +8 -8
- package/dist/combobox/examples/multiple.html.js +5 -0
- package/dist/compiler/emit.d.ts +6 -0
- package/dist/compiler/emit.js +217 -0
- package/dist/compiler/transform.d.ts +52 -0
- package/dist/compiler/transform.js +169 -0
- package/dist/controller.d.ts +2 -3
- package/dist/controller.js +1 -1
- package/dist/date-input/date-input.events.d.ts +2 -3
- package/dist/date-input/date-input.machine.d.ts +3 -3
- package/dist/date-input/date-input.machine.js +1 -1
- package/dist/date-input/date-input.presentation.d.ts +6 -7
- package/dist/date-input/date-input.presentation.js +1 -1
- package/dist/date-input/date-input.state.d.ts +1 -2
- package/dist/date-input/date-input.state.js +1 -1
- package/dist/date-input/date-input.transitions.d.ts +3 -4
- package/dist/date-input/examples/basic.html +3 -3
- package/dist/date-input/examples/basic.html.js +5 -0
- package/dist/date-picker/date-picker.events.d.ts +2 -3
- package/dist/date-picker/date-picker.machine.d.ts +2 -3
- package/dist/date-picker/date-picker.machine.js +1 -1
- package/dist/date-picker/date-picker.presentation.d.ts +14 -15
- package/dist/date-picker/date-picker.presentation.js +2 -2
- package/dist/date-picker/date-picker.state.d.ts +1 -2
- package/dist/date-picker/date-picker.state.js +1 -1
- package/dist/date-picker/date-picker.transitions.d.ts +3 -4
- package/dist/date-picker/examples/appointment.html +7 -7
- package/dist/date-picker/examples/appointment.html.js +5 -0
- package/dist/date-picker/examples/basic.html.js +5 -0
- package/dist/date-picker/examples/multiple.html.js +5 -0
- package/dist/date-picker/examples/pricing.html.js +5 -0
- package/dist/date-picker/examples/range.html.js +5 -0
- package/dist/date-picker/examples/unavailable.html.js +5 -0
- package/dist/editable/editable.events.d.ts +2 -3
- package/dist/editable/editable.machine.d.ts +3 -4
- package/dist/editable/editable.machine.js +1 -1
- package/dist/editable/editable.presentation.d.ts +6 -7
- package/dist/editable/editable.presentation.js +1 -1
- package/dist/editable/editable.state.d.ts +1 -2
- package/dist/editable/editable.state.js +1 -1
- package/dist/editable/editable.transitions.d.ts +3 -4
- package/dist/editable/examples/basic.html +7 -7
- package/dist/editable/examples/basic.html.js +5 -0
- package/dist/editable/examples/doubleclick.html +6 -6
- package/dist/editable/examples/doubleclick.html.js +5 -0
- package/dist/editable/examples/inline-edit.html +4 -4
- package/dist/editable/examples/inline-edit.html.js +5 -0
- package/dist/editable/examples/profile-field.html +7 -7
- package/dist/editable/examples/profile-field.html.js +5 -0
- package/dist/editable/examples/resize.html +6 -6
- package/dist/editable/examples/resize.html.js +5 -0
- package/dist/editable/examples/task-item.html +7 -7
- package/dist/editable/examples/task-item.html.js +5 -0
- package/dist/editable/examples/title-editor.html +3 -3
- package/dist/editable/examples/title-editor.html.js +5 -0
- package/dist/editable/examples/with-controls.html +4 -4
- package/dist/editable/examples/with-controls.html.js +5 -0
- package/dist/examples.d.ts +22 -0
- package/dist/examples.js +501 -0
- package/dist/file-upload/examples/avatar.html +8 -8
- package/dist/file-upload/examples/avatar.html.js +5 -0
- package/dist/file-upload/examples/basic.html +8 -8
- package/dist/file-upload/examples/basic.html.js +5 -0
- package/dist/file-upload/examples/directory.html +8 -8
- package/dist/file-upload/examples/directory.html.js +5 -0
- package/dist/file-upload/examples/dragdrop.html +8 -8
- package/dist/file-upload/examples/dragdrop.html.js +5 -0
- package/dist/file-upload/examples/files.html +9 -9
- package/dist/file-upload/examples/files.html.js +5 -0
- package/dist/file-upload/examples/images.html +8 -8
- package/dist/file-upload/examples/images.html.js +5 -0
- package/dist/file-upload/examples/paste.html +8 -8
- package/dist/file-upload/examples/paste.html.js +5 -0
- package/dist/file-upload/examples/table.html +7 -7
- package/dist/file-upload/examples/table.html.js +5 -0
- package/dist/file-upload/file-upload.events.d.ts +2 -3
- package/dist/file-upload/file-upload.machine.d.ts +5 -3
- package/dist/file-upload/file-upload.machine.js +1 -1
- package/dist/file-upload/file-upload.presentation.d.ts +10 -11
- package/dist/file-upload/file-upload.presentation.js +1 -1
- package/dist/file-upload/file-upload.state.d.ts +1 -2
- package/dist/file-upload/file-upload.state.js +1 -1
- package/dist/file-upload/file-upload.transitions.d.ts +3 -4
- package/dist/floating-panel/examples/basic.html +22 -23
- package/dist/floating-panel/examples/basic.html.js +5 -0
- package/dist/floating-panel/examples/calculator.html +41 -41
- package/dist/floating-panel/examples/calculator.html.js +5 -0
- package/dist/floating-panel/examples/chat.html +29 -29
- package/dist/floating-panel/examples/chat.html.js +5 -0
- package/dist/floating-panel/examples/media-player.html +27 -27
- package/dist/floating-panel/examples/media-player.html.js +5 -0
- package/dist/floating-panel/examples/notes.html +36 -36
- package/dist/floating-panel/examples/notes.html.js +5 -0
- package/dist/floating-panel/examples/settings.html +34 -34
- package/dist/floating-panel/examples/settings.html.js +5 -0
- package/dist/floating-panel/examples/task.html +40 -40
- package/dist/floating-panel/examples/task.html.js +5 -0
- package/dist/floating-panel/examples/video-call.html +25 -25
- package/dist/floating-panel/examples/video-call.html.js +5 -0
- package/dist/floating-panel/floating-panel.events.d.ts +2 -3
- package/dist/floating-panel/floating-panel.machine.d.ts +2 -3
- package/dist/floating-panel/floating-panel.machine.js +1 -1
- package/dist/floating-panel/floating-panel.presentation.d.ts +11 -13
- package/dist/floating-panel/floating-panel.presentation.js +3 -6
- package/dist/floating-panel/floating-panel.state.d.ts +1 -2
- package/dist/floating-panel/floating-panel.state.js +1 -1
- package/dist/floating-panel/floating-panel.transitions.d.ts +3 -4
- package/dist/hover-card/examples/basic.html +5 -5
- package/dist/hover-card/examples/basic.html.js +5 -0
- package/dist/hover-card/examples/controlled.html +9 -10
- package/dist/hover-card/examples/controlled.html.js +5 -0
- package/dist/hover-card/examples/custom-positioning.html +8 -8
- package/dist/hover-card/examples/custom-positioning.html.js +5 -0
- package/dist/hover-card/examples/link.html +2 -2
- package/dist/hover-card/examples/link.html.js +5 -0
- package/dist/hover-card/examples/product.html +9 -9
- package/dist/hover-card/examples/product.html.js +5 -0
- package/dist/hover-card/examples/user.html +11 -11
- package/dist/hover-card/examples/user.html.js +5 -0
- package/dist/hover-card/examples/with-arrow.html +9 -9
- package/dist/hover-card/examples/with-arrow.html.js +5 -0
- package/dist/hover-card/hover-card.controller-def.d.ts +2 -4
- package/dist/hover-card/hover-card.controller-def.js +1 -1
- package/dist/image-cropper/crop-geometry.d.ts +1 -2
- package/dist/image-cropper/crop-geometry.js +1 -1
- package/dist/image-cropper/examples/basic.html +3 -3
- package/dist/image-cropper/examples/basic.html.js +5 -0
- package/dist/image-cropper/examples/circle.html +3 -3
- package/dist/image-cropper/examples/circle.html.js +5 -0
- package/dist/image-cropper/image-cropper.events.d.ts +2 -3
- package/dist/image-cropper/image-cropper.machine.d.ts +3 -4
- package/dist/image-cropper/image-cropper.machine.js +2 -2
- package/dist/image-cropper/image-cropper.presentation.d.ts +7 -8
- package/dist/image-cropper/image-cropper.presentation.js +2 -2
- package/dist/image-cropper/image-cropper.state.d.ts +1 -2
- package/dist/image-cropper/image-cropper.state.js +1 -1
- package/dist/image-cropper/image-cropper.transitions.d.ts +3 -4
- package/dist/index.d.ts +28 -13
- package/dist/index.js +21 -14
- package/dist/listbox/examples/basic.html +9 -9
- package/dist/listbox/examples/basic.html.js +5 -0
- package/dist/listbox/examples/controlled.html +9 -9
- package/dist/listbox/examples/controlled.html.js +5 -0
- package/dist/listbox/examples/countries.html +9 -9
- package/dist/listbox/examples/countries.html.js +5 -0
- package/dist/listbox/examples/grouped.html +9 -9
- package/dist/listbox/examples/grouped.html.js +5 -0
- package/dist/listbox/examples/icons.html +10 -10
- package/dist/listbox/examples/icons.html.js +5 -0
- package/dist/listbox/examples/multiple.html +9 -9
- package/dist/listbox/examples/multiple.html.js +5 -0
- package/dist/listbox/examples/priority.html +9 -9
- package/dist/listbox/examples/priority.html.js +5 -0
- package/dist/listbox/examples/settings.html +9 -9
- package/dist/listbox/examples/settings.html.js +5 -0
- package/dist/listbox/listbox.events.d.ts +2 -3
- package/dist/listbox/listbox.machine.d.ts +2 -3
- package/dist/listbox/listbox.machine.js +1 -1
- package/dist/listbox/listbox.presentation.d.ts +6 -5
- package/dist/listbox/listbox.presentation.js +1 -1
- package/dist/listbox/listbox.state.d.ts +1 -2
- package/dist/listbox/listbox.state.js +1 -1
- package/dist/listbox/listbox.transitions.d.ts +3 -4
- package/dist/menu/examples/basic.html +15 -13
- package/dist/menu/examples/basic.html.js +5 -0
- package/dist/menu/examples/context.html +14 -12
- package/dist/menu/examples/context.html.js +5 -0
- package/dist/menu/examples/groups.html +15 -13
- package/dist/menu/examples/groups.html.js +5 -0
- package/dist/menu/examples/icons.html +17 -15
- package/dist/menu/examples/icons.html.js +5 -0
- package/dist/menu/examples/nested.html +15 -13
- package/dist/menu/examples/nested.html.js +5 -0
- package/dist/menu/examples/user.html +21 -19
- package/dist/menu/examples/user.html.js +5 -0
- package/dist/menu/menu.events.d.ts +2 -3
- package/dist/menu/menu.machine.d.ts +2 -3
- package/dist/menu/menu.machine.js +1 -1
- package/dist/menu/menu.presentation.d.ts +6 -8
- package/dist/menu/menu.presentation.js +4 -5
- package/dist/menu/menu.state.d.ts +1 -2
- package/dist/menu/menu.state.js +1 -1
- package/dist/mode-picker/examples/basic.html +1 -1
- package/dist/mode-picker/examples/basic.html.js +5 -0
- package/dist/mode-picker/examples/minimal.html +1 -1
- package/dist/mode-picker/examples/minimal.html.js +5 -0
- package/dist/mode-picker/examples/pill.html +1 -1
- package/dist/mode-picker/examples/pill.html.js +5 -0
- package/dist/mode-picker/mode-picker.events.d.ts +2 -3
- package/dist/mode-picker/mode-picker.machine.d.ts +3 -3
- package/dist/mode-picker/mode-picker.machine.js +1 -1
- package/dist/mode-picker/mode-picker.presentation.d.ts +7 -8
- package/dist/mode-picker/mode-picker.presentation.js +2 -2
- package/dist/mode-picker/mode-picker.state.d.ts +1 -2
- package/dist/mode-picker/mode-picker.transitions.d.ts +3 -4
- package/dist/navigation-menu/examples/basic.html +6 -6
- package/dist/navigation-menu/examples/basic.html.js +5 -0
- package/dist/navigation-menu/examples/grouped.html +14 -12
- package/dist/navigation-menu/examples/grouped.html.js +5 -0
- package/dist/navigation-menu/examples/minimal.html +7 -5
- package/dist/navigation-menu/examples/minimal.html.js +5 -0
- package/dist/navigation-menu/navigation-menu.events.d.ts +2 -3
- package/dist/navigation-menu/navigation-menu.machine.d.ts +3 -3
- package/dist/navigation-menu/navigation-menu.machine.js +1 -1
- package/dist/navigation-menu/navigation-menu.presentation.d.ts +6 -7
- package/dist/navigation-menu/navigation-menu.presentation.js +2 -2
- package/dist/navigation-menu/navigation-menu.state.d.ts +1 -2
- package/dist/navigation-menu/navigation-menu.state.js +1 -1
- package/dist/navigation-menu/navigation-menu.transitions.d.ts +3 -4
- package/dist/number-input/examples/basic.html +10 -10
- package/dist/number-input/examples/basic.html.js +5 -0
- package/dist/number-input/examples/currency.html +6 -6
- package/dist/number-input/examples/currency.html.js +5 -0
- package/dist/number-input/examples/decimal.html +4 -4
- package/dist/number-input/examples/decimal.html.js +5 -0
- package/dist/number-input/examples/limits.html +6 -6
- package/dist/number-input/examples/limits.html.js +5 -0
- package/dist/number-input/examples/percentage.html +6 -6
- package/dist/number-input/examples/percentage.html.js +5 -0
- package/dist/number-input/examples/quantity.html +6 -6
- package/dist/number-input/examples/quantity.html.js +5 -0
- package/dist/number-input/examples/scrubber.html +11 -11
- package/dist/number-input/examples/scrubber.html.js +5 -0
- package/dist/number-input/examples/wheel.html +7 -7
- package/dist/number-input/examples/wheel.html.js +5 -0
- package/dist/number-input/number-input.events.d.ts +2 -3
- package/dist/number-input/number-input.machine.d.ts +4 -4
- package/dist/number-input/number-input.machine.js +1 -1
- package/dist/number-input/number-input.presentation.d.ts +7 -8
- package/dist/number-input/number-input.presentation.js +4 -4
- package/dist/number-input/number-input.state.d.ts +1 -2
- package/dist/number-input/number-input.state.js +1 -1
- package/dist/number-input/number-input.transitions.d.ts +3 -4
- package/dist/pagination/examples/basic.html +2 -2
- package/dist/pagination/examples/basic.html.js +5 -0
- package/dist/pagination/examples/dropdown.html +2 -2
- package/dist/pagination/examples/dropdown.html.js +5 -0
- package/dist/pagination/examples/info.html +3 -3
- package/dist/pagination/examples/info.html.js +5 -0
- package/dist/pagination/examples/jump.html +2 -2
- package/dist/pagination/examples/jump.html.js +5 -0
- package/dist/pagination/examples/numbered.html +2 -2
- package/dist/pagination/examples/numbered.html.js +5 -0
- package/dist/pagination/examples/pagesize.html +4 -4
- package/dist/pagination/examples/pagesize.html.js +5 -0
- package/dist/pagination/pagination.events.d.ts +2 -3
- package/dist/pagination/pagination.machine.d.ts +4 -4
- package/dist/pagination/pagination.machine.js +1 -1
- package/dist/pagination/pagination.presentation.d.ts +4 -5
- package/dist/pagination/pagination.presentation.js +1 -1
- package/dist/pagination/pagination.state.d.ts +1 -2
- package/dist/pagination/pagination.state.js +1 -1
- package/dist/pagination/pagination.transitions.d.ts +2 -3
- package/dist/pin-input/examples/basic.html +2 -2
- package/dist/pin-input/examples/basic.html.js +5 -0
- package/dist/pin-input/examples/field.html +4 -4
- package/dist/pin-input/examples/field.html.js +5 -0
- package/dist/pin-input/examples/masked.html +3 -3
- package/dist/pin-input/examples/masked.html.js +5 -0
- package/dist/pin-input/examples/placeholder.html +3 -3
- package/dist/pin-input/examples/placeholder.html.js +5 -0
- package/dist/pin-input/examples/twofactor.html +4 -4
- package/dist/pin-input/examples/twofactor.html.js +5 -0
- package/dist/pin-input/examples/verification.html +6 -6
- package/dist/pin-input/examples/verification.html.js +5 -0
- package/dist/pin-input/pin-input.events.d.ts +2 -3
- package/dist/pin-input/pin-input.machine.d.ts +3 -3
- package/dist/pin-input/pin-input.machine.js +1 -1
- package/dist/pin-input/pin-input.presentation.d.ts +4 -5
- package/dist/pin-input/pin-input.presentation.js +2 -2
- package/dist/pin-input/pin-input.state.d.ts +1 -2
- package/dist/pin-input/pin-input.state.js +1 -1
- package/dist/pin-input/pin-input.transitions.d.ts +1 -2
- package/dist/popover/examples/basic.html +4 -4
- package/dist/popover/examples/basic.html.js +5 -0
- package/dist/popover/examples/feedback.html +5 -5
- package/dist/popover/examples/feedback.html.js +5 -0
- package/dist/popover/examples/notifications.html +5 -5
- package/dist/popover/examples/notifications.html.js +5 -0
- package/dist/popover/examples/settings.html +8 -8
- package/dist/popover/examples/settings.html.js +5 -0
- package/dist/popover/examples/share.html +5 -5
- package/dist/popover/examples/share.html.js +5 -0
- package/dist/popover/examples/user.html +10 -10
- package/dist/popover/examples/user.html.js +5 -0
- package/dist/popover/popover.controller-def.d.ts +2 -4
- package/dist/popover/popover.controller-def.js +1 -1
- package/dist/rating-group/examples/basic.html +9 -9
- package/dist/rating-group/examples/basic.html.js +5 -0
- package/dist/rating-group/examples/movie.html +11 -11
- package/dist/rating-group/examples/movie.html.js +5 -0
- package/dist/rating-group/examples/product-review.html +13 -13
- package/dist/rating-group/examples/product-review.html.js +5 -0
- package/dist/rating-group/examples/service-evaluation.html +5 -5
- package/dist/rating-group/examples/service-evaluation.html.js +5 -0
- package/dist/rating-group/rating-group.events.d.ts +2 -3
- package/dist/rating-group/rating-group.machine.d.ts +2 -3
- package/dist/rating-group/rating-group.machine.js +1 -1
- package/dist/rating-group/rating-group.presentation.d.ts +6 -7
- package/dist/rating-group/rating-group.presentation.js +2 -2
- package/dist/rating-group/rating-group.state.d.ts +1 -2
- package/dist/rating-group/rating-group.state.js +1 -1
- package/dist/rating-group/rating-group.transitions.d.ts +3 -4
- package/dist/react/react.d.ts +2 -3
- package/dist/runtime/actions/action.d.ts +64 -0
- package/dist/runtime/actions/action.js +45 -0
- package/dist/runtime/actions/anchor.d.ts +43 -0
- package/dist/runtime/actions/anchor.js +127 -0
- package/dist/runtime/actions/date-picker-focus.d.ts +19 -0
- package/dist/runtime/actions/date-picker-focus.js +16 -0
- package/dist/runtime/actions/drag.d.ts +66 -0
- package/dist/runtime/actions/drag.js +118 -0
- package/dist/runtime/actions/form-control.d.ts +18 -0
- package/dist/runtime/actions/form-control.js +41 -0
- package/dist/runtime/actions/hover-delay.d.ts +26 -0
- package/dist/runtime/actions/hover-delay.js +61 -0
- package/dist/runtime/actions/index.d.ts +113 -0
- package/dist/runtime/actions/index.js +240 -0
- package/dist/runtime/actions/infinite-scroll.d.ts +22 -0
- package/dist/runtime/actions/infinite-scroll.js +33 -0
- package/dist/runtime/actions/interact-outside.d.ts +43 -0
- package/dist/runtime/actions/interact-outside.js +72 -0
- package/dist/runtime/actions/observe.d.ts +27 -0
- package/dist/runtime/actions/observe.js +25 -0
- package/dist/runtime/actions/scroll-into-view.d.ts +32 -0
- package/dist/runtime/actions/scroll-into-view.js +36 -0
- package/dist/runtime/actions/select-focus.d.ts +17 -0
- package/dist/runtime/actions/select-focus.js +16 -0
- package/dist/runtime/actions/select-options.d.ts +25 -0
- package/dist/runtime/actions/select-options.js +27 -0
- package/dist/runtime/actions/toast-actions.d.ts +65 -0
- package/dist/runtime/actions/toast-actions.js +143 -0
- package/dist/runtime/aria.d.ts +231 -0
- package/dist/runtime/aria.js +193 -0
- package/dist/runtime/component/define.d.ts +242 -0
- package/dist/runtime/component/define.js +12 -0
- package/dist/runtime/component/ids.d.ts +14 -0
- package/dist/runtime/component/ids.js +35 -0
- package/dist/runtime/component/synthesize.d.ts +32 -0
- package/dist/runtime/component/synthesize.js +385 -0
- package/dist/runtime/core/signal.d.ts +57 -0
- package/dist/runtime/core/signal.js +100 -0
- package/dist/runtime/core/style.d.ts +14 -0
- package/dist/runtime/core/style.js +31 -0
- package/dist/runtime/directives/bind.d.ts +38 -0
- package/dist/runtime/directives/bind.js +244 -0
- package/dist/runtime/directives/for.d.ts +12 -0
- package/dist/runtime/directives/for.js +104 -0
- package/dist/runtime/directives/if.d.ts +10 -0
- package/dist/runtime/directives/if.js +45 -0
- package/dist/runtime/directives/load.d.ts +13 -0
- package/dist/runtime/directives/load.js +119 -0
- package/dist/runtime/directives/spread.d.ts +17 -0
- package/dist/runtime/directives/spread.js +121 -0
- package/dist/runtime/directives/tpl.d.ts +11 -0
- package/dist/runtime/directives/tpl.js +39 -0
- package/dist/runtime/directives/use.d.ts +13 -0
- package/dist/runtime/directives/use.js +34 -0
- package/dist/runtime/index.d.ts +101 -0
- package/dist/runtime/index.js +40 -0
- package/dist/runtime/machine/fsm/machine.d.ts +192 -0
- package/dist/runtime/machine/fsm/machine.js +248 -0
- package/dist/runtime/math/index.d.ts +2 -0
- package/dist/runtime/math/index.js +1 -0
- package/dist/runtime/math/numbers.d.ts +58 -0
- package/dist/runtime/math/numbers.js +115 -0
- package/dist/runtime/props.d.ts +61 -0
- package/dist/runtime/props.js +113 -0
- package/dist/runtime/scope/element.d.ts +86 -0
- package/dist/runtime/scope/element.js +226 -0
- package/dist/runtime/scope/table.d.ts +55 -0
- package/dist/runtime/scope/table.js +174 -0
- package/dist/runtime/syntax/braces.d.ts +2 -0
- package/dist/runtime/syntax/braces.js +35 -0
- package/dist/runtime/syntax/classes.d.ts +22 -0
- package/dist/runtime/syntax/classes.js +119 -0
- package/dist/runtime/syntax/display.d.ts +25 -0
- package/dist/runtime/syntax/display.js +344 -0
- package/dist/runtime/syntax/expand-groups.d.ts +12 -0
- package/dist/runtime/syntax/expand-groups.js +31 -0
- package/dist/runtime/syntax/ir.d.ts +76 -0
- package/dist/runtime/syntax/ir.js +11 -0
- package/dist/runtime/syntax/parse.d.ts +2 -0
- package/dist/runtime/syntax/parse.js +407 -0
- package/dist/runtime/syntax/script-block.d.ts +43 -0
- package/dist/runtime/syntax/script-block.js +190 -0
- package/dist/runtime/testing.d.ts +11 -0
- package/dist/runtime/testing.js +1 -0
- package/dist/select/examples/basic.html +9 -9
- package/dist/select/examples/basic.html.js +5 -0
- package/dist/select/examples/category.html +10 -10
- package/dist/select/examples/category.html.js +5 -0
- package/dist/select/examples/country.html +10 -10
- package/dist/select/examples/country.html.js +5 -0
- package/dist/select/examples/language.html.js +5 -0
- package/dist/select/examples/multiple.html.js +5 -0
- package/dist/select/examples/profile.html +10 -10
- package/dist/select/examples/profile.html.js +5 -0
- package/dist/select/examples/theme.html.js +5 -0
- package/dist/select/examples/with-overlapping-label.html +8 -8
- package/dist/select/examples/with-overlapping-label.html.js +5 -0
- package/dist/select/select.events.d.ts +2 -3
- package/dist/select/select.machine.d.ts +2 -3
- package/dist/select/select.machine.js +1 -1
- package/dist/select/select.presentation.d.ts +16 -20
- package/dist/select/select.presentation.js +6 -6
- package/dist/select/select.shared.d.ts +1 -2
- package/dist/select/select.state.d.ts +1 -2
- package/dist/select/select.state.js +1 -1
- package/dist/select/select.transitions.d.ts +2 -3
- package/dist/shared/keyboard.d.ts +1 -2
- package/dist/signature-pad/examples/basic.html +3 -3
- package/dist/signature-pad/examples/basic.html.js +5 -0
- package/dist/signature-pad/examples/contract.html +7 -7
- package/dist/signature-pad/examples/contract.html.js +5 -0
- package/dist/signature-pad/examples/receipt.html +8 -8
- package/dist/signature-pad/examples/receipt.html.js +5 -0
- package/dist/signature-pad/examples/with-preview.html +6 -6
- package/dist/signature-pad/examples/with-preview.html.js +5 -0
- package/dist/signature-pad/signature-pad.events.d.ts +2 -3
- package/dist/signature-pad/signature-pad.machine.d.ts +4 -4
- package/dist/signature-pad/signature-pad.machine.js +2 -2
- package/dist/signature-pad/signature-pad.presentation.d.ts +10 -11
- package/dist/signature-pad/signature-pad.presentation.js +2 -2
- package/dist/signature-pad/signature-pad.state.d.ts +1 -2
- package/dist/signature-pad/signature-pad.state.js +1 -1
- package/dist/signature-pad/signature-pad.transitions.d.ts +3 -4
- package/dist/slider/examples/basic.html +1 -1
- package/dist/slider/examples/basic.html.js +5 -0
- package/dist/slider/examples/equalizer.html +13 -13
- package/dist/slider/examples/equalizer.html.js +5 -0
- package/dist/slider/examples/fractional.html.js +5 -0
- package/dist/slider/examples/marks.html +2 -2
- package/dist/slider/examples/marks.html.js +5 -0
- package/dist/slider/examples/range.html +1 -1
- package/dist/slider/examples/range.html.js +5 -0
- package/dist/slider/examples/stepped.html.js +5 -0
- package/dist/slider/examples/ticks.html +2 -2
- package/dist/slider/examples/ticks.html.js +5 -0
- package/dist/slider/examples/vertical.html.js +5 -0
- package/dist/slider/slider.events.d.ts +2 -3
- package/dist/slider/slider.machine.d.ts +3 -3
- package/dist/slider/slider.machine.js +2 -2
- package/dist/slider/slider.presentation.d.ts +8 -9
- package/dist/slider/slider.presentation.js +2 -2
- package/dist/slider/slider.state.d.ts +1 -2
- package/dist/slider/slider.state.js +1 -1
- package/dist/slider/slider.transitions.d.ts +3 -4
- package/dist/slider/slider.transitions.js +1 -1
- package/dist/solid/solid.d.ts +2 -3
- package/dist/spin-element.d.ts +1 -2
- package/dist/spin-element.js +1 -1
- package/dist/splitter/examples/basic.html +2 -2
- package/dist/splitter/examples/basic.html.js +5 -0
- package/dist/splitter/examples/nested.html +4 -4
- package/dist/splitter/examples/nested.html.js +5 -0
- package/dist/splitter/examples/threepanels.html +2 -2
- package/dist/splitter/examples/threepanels.html.js +5 -0
- package/dist/splitter/examples/vertical.html +2 -2
- package/dist/splitter/examples/vertical.html.js +5 -0
- package/dist/splitter/splitter.events.d.ts +2 -3
- package/dist/splitter/splitter.machine.d.ts +2 -3
- package/dist/splitter/splitter.machine.js +1 -1
- package/dist/splitter/splitter.presentation.d.ts +5 -6
- package/dist/splitter/splitter.presentation.js +1 -1
- package/dist/splitter/splitter.state.d.ts +1 -2
- package/dist/splitter/splitter.state.js +1 -1
- package/dist/splitter/splitter.transitions.d.ts +2 -3
- package/dist/steps/examples/basic.html +5 -5
- package/dist/steps/examples/basic.html.js +5 -0
- package/dist/steps/examples/checkmarks.html +4 -4
- package/dist/steps/examples/checkmarks.html.js +5 -0
- package/dist/steps/examples/content.html +5 -5
- package/dist/steps/examples/content.html.js +5 -0
- package/dist/steps/examples/descriptions.html +2 -2
- package/dist/steps/examples/descriptions.html.js +5 -0
- package/dist/steps/examples/icons.html +2 -2
- package/dist/steps/examples/icons.html.js +5 -0
- package/dist/steps/examples/lines.html +2 -2
- package/dist/steps/examples/lines.html.js +5 -0
- package/dist/steps/examples/navigation.html +4 -4
- package/dist/steps/examples/navigation.html.js +5 -0
- package/dist/steps/examples/onboarding.html +4 -4
- package/dist/steps/examples/onboarding.html.js +5 -0
- package/dist/steps/examples/progress.html +3 -3
- package/dist/steps/examples/progress.html.js +5 -0
- package/dist/steps/examples/segmented.html +6 -6
- package/dist/steps/examples/segmented.html.js +5 -0
- package/dist/steps/examples/vertical.html +5 -5
- package/dist/steps/examples/vertical.html.js +5 -0
- package/dist/steps/examples/verticallabels.html +2 -2
- package/dist/steps/examples/verticallabels.html.js +5 -0
- package/dist/steps/examples/verticalnavigation.html +2 -2
- package/dist/steps/examples/verticalnavigation.html.js +5 -0
- package/dist/steps/steps.events.d.ts +2 -3
- package/dist/steps/steps.machine.d.ts +3 -3
- package/dist/steps/steps.machine.js +1 -1
- package/dist/steps/steps.presentation.d.ts +4 -5
- package/dist/steps/steps.presentation.js +1 -1
- package/dist/steps/steps.state.d.ts +1 -2
- package/dist/steps/steps.state.js +1 -1
- package/dist/steps/steps.transitions.d.ts +3 -4
- package/dist/tabs/examples/basic.html +2 -2
- package/dist/tabs/examples/basic.html.js +5 -0
- package/dist/tabs/examples/dashboard.html +42 -42
- package/dist/tabs/examples/dashboard.html.js +5 -0
- package/dist/tabs/examples/ghost.html +2 -2
- package/dist/tabs/examples/ghost.html.js +5 -0
- package/dist/tabs/examples/icon-above.html +6 -6
- package/dist/tabs/examples/icon-above.html.js +5 -0
- package/dist/tabs/examples/icon-only.html +3 -3
- package/dist/tabs/examples/icon-only.html.js +5 -0
- package/dist/tabs/examples/outline-with-icons.html +6 -6
- package/dist/tabs/examples/outline-with-icons.html.js +5 -0
- package/dist/tabs/examples/outline.html +3 -3
- package/dist/tabs/examples/outline.html.js +5 -0
- package/dist/tabs/examples/pills.html +2 -2
- package/dist/tabs/examples/pills.html.js +5 -0
- package/dist/tabs/examples/project.html +33 -33
- package/dist/tabs/examples/project.html.js +5 -0
- package/dist/tabs/examples/settings.html +35 -35
- package/dist/tabs/examples/settings.html.js +5 -0
- package/dist/tabs/examples/stack-with-icons.html +7 -7
- package/dist/tabs/examples/stack-with-icons.html.js +5 -0
- package/dist/tabs/examples/stack.html +3 -3
- package/dist/tabs/examples/stack.html.js +5 -0
- package/dist/tabs/examples/underline.html +3 -3
- package/dist/tabs/examples/underline.html.js +5 -0
- package/dist/tabs/examples/vertical-ghost.html +3 -3
- package/dist/tabs/examples/vertical-ghost.html.js +5 -0
- package/dist/tabs/examples/vertical-icons.html +5 -5
- package/dist/tabs/examples/vertical-icons.html.js +5 -0
- package/dist/tabs/examples/vertical-underline.html +4 -4
- package/dist/tabs/examples/vertical-underline.html.js +5 -0
- package/dist/tabs/examples/vertical-with-icons.html +6 -6
- package/dist/tabs/examples/vertical-with-icons.html.js +5 -0
- package/dist/tabs/examples/vertical.html +2 -2
- package/dist/tabs/examples/vertical.html.js +5 -0
- package/dist/tabs/examples/with-badges.html +3 -3
- package/dist/tabs/examples/with-badges.html.js +5 -0
- package/dist/tabs/examples/with-icons.html +4 -4
- package/dist/tabs/examples/with-icons.html.js +5 -0
- package/dist/tabs/tabs.events.d.ts +2 -3
- package/dist/tabs/tabs.machine.d.ts +3 -3
- package/dist/tabs/tabs.machine.js +1 -1
- package/dist/tabs/tabs.presentation.d.ts +6 -7
- package/dist/tabs/tabs.presentation.js +1 -1
- package/dist/tabs/tabs.state.d.ts +1 -2
- package/dist/tabs/tabs.state.js +1 -1
- package/dist/tabs/tabs.transitions.d.ts +3 -4
- package/dist/tags-input/examples/basic.html +9 -9
- package/dist/tags-input/examples/basic.html.js +5 -0
- package/dist/tags-input/examples/with-combobox.html +14 -14
- package/dist/tags-input/examples/with-combobox.html.js +5 -0
- package/dist/tags-input/tags.events.d.ts +2 -3
- package/dist/tags-input/tags.machine.d.ts +6 -4
- package/dist/tags-input/tags.machine.js +2 -2
- package/dist/tags-input/tags.presentation.d.ts +6 -7
- package/dist/tags-input/tags.presentation.js +1 -1
- package/dist/tags-input/tags.state.d.ts +1 -2
- package/dist/tags-input/tags.state.js +2 -2
- package/dist/tags-input/tags.transitions.d.ts +2 -3
- package/dist/theme-picker/examples/basic.html +6 -6
- package/dist/theme-picker/examples/basic.html.js +5 -0
- package/dist/theme-picker/examples/cards.html +4 -4
- package/dist/theme-picker/examples/cards.html.js +5 -0
- package/dist/theme-picker/examples/compact.html +3 -3
- package/dist/theme-picker/examples/compact.html.js +5 -0
- package/dist/theme-picker/examples/swatches.html +2 -2
- package/dist/theme-picker/examples/swatches.html.js +5 -0
- package/dist/theme-picker/theme-picker.events.d.ts +2 -3
- package/dist/theme-picker/theme-picker.machine.d.ts +3 -3
- package/dist/theme-picker/theme-picker.machine.js +1 -1
- package/dist/theme-picker/theme-picker.presentation.d.ts +9 -10
- package/dist/theme-picker/theme-picker.presentation.js +2 -2
- package/dist/theme-picker/theme-picker.state.d.ts +1 -2
- package/dist/theme-picker/theme-picker.transitions.d.ts +3 -4
- package/dist/timer/examples/basic.html +1 -1
- package/dist/timer/examples/basic.html.js +5 -0
- package/dist/timer/examples/card.html +4 -4
- package/dist/timer/examples/card.html.js +5 -0
- package/dist/timer/examples/compact.html +5 -5
- package/dist/timer/examples/compact.html.js +5 -0
- package/dist/timer/examples/countdown.html +3 -3
- package/dist/timer/examples/countdown.html.js +5 -0
- package/dist/timer/examples/labels.html +3 -3
- package/dist/timer/examples/labels.html.js +5 -0
- package/dist/timer/examples/large.html +2 -2
- package/dist/timer/examples/large.html.js +5 -0
- package/dist/timer/examples/minimal.html +1 -1
- package/dist/timer/examples/minimal.html.js +5 -0
- package/dist/timer/examples/pomodoro.html +3 -3
- package/dist/timer/examples/pomodoro.html.js +5 -0
- package/dist/timer/examples/workout.html +4 -4
- package/dist/timer/examples/workout.html.js +5 -0
- package/dist/timer/timer.events.d.ts +2 -3
- package/dist/timer/timer.machine.d.ts +2 -3
- package/dist/timer/timer.machine.js +1 -1
- package/dist/timer/timer.presentation.d.ts +7 -8
- package/dist/timer/timer.presentation.js +1 -1
- package/dist/timer/timer.state.d.ts +1 -2
- package/dist/timer/timer.state.js +1 -1
- package/dist/timer/timer.transitions.d.ts +2 -3
- package/dist/toast/examples/action.html +3 -3
- package/dist/toast/examples/action.html.js +5 -0
- package/dist/toast/examples/basic.html +3 -3
- package/dist/toast/examples/basic.html.js +5 -0
- package/dist/toast/examples/bottomcenter.html +3 -3
- package/dist/toast/examples/bottomcenter.html.js +5 -0
- package/dist/toast/examples/bottomleft.html +3 -3
- package/dist/toast/examples/bottomleft.html.js +5 -0
- package/dist/toast/examples/bottomright.html +3 -3
- package/dist/toast/examples/bottomright.html.js +5 -0
- package/dist/toast/examples/duration.html +3 -3
- package/dist/toast/examples/duration.html.js +5 -0
- package/dist/toast/examples/promise.html +6 -6
- package/dist/toast/examples/promise.html.js +5 -0
- package/dist/toast/examples/topcenter.html +3 -3
- package/dist/toast/examples/topcenter.html.js +5 -0
- package/dist/toast/examples/topleft.html +3 -3
- package/dist/toast/examples/topleft.html.js +5 -0
- package/dist/toast/examples/topright.html +3 -3
- package/dist/toast/examples/topright.html.js +5 -0
- package/dist/toast/examples/types.html +3 -3
- package/dist/toast/examples/types.html.js +5 -0
- package/dist/toast/examples/updatable.html.js +5 -0
- package/dist/toast/toast.events.d.ts +2 -3
- package/dist/toast/toast.machine.d.ts +4 -4
- package/dist/toast/toast.machine.js +1 -1
- package/dist/toast/toast.presentation.d.ts +5 -6
- package/dist/toast/toast.presentation.js +1 -1
- package/dist/toast/toast.state.d.ts +1 -2
- package/dist/toast/toast.state.js +3 -3
- package/dist/toast/toast.transitions.d.ts +3 -4
- package/dist/toc/examples/basic.html +31 -0
- package/dist/toc/examples/basic.html.js +5 -0
- package/dist/toc/toc.events.d.ts +19 -0
- package/dist/toc/toc.events.js +1 -0
- package/dist/toc/toc.machine.d.ts +5 -0
- package/dist/toc/toc.machine.js +59 -0
- package/dist/toc/toc.presentation.d.ts +127 -0
- package/dist/toc/toc.presentation.js +117 -0
- package/dist/toc/toc.state.d.ts +41 -0
- package/dist/toc/toc.state.js +64 -0
- package/dist/toc/toc.transitions.d.ts +8 -0
- package/dist/toc/toc.transitions.js +27 -0
- package/dist/toggle-group/examples/basic.html +2 -2
- package/dist/toggle-group/examples/basic.html.js +5 -0
- package/dist/toggle-group/examples/ghost.html +1 -1
- package/dist/toggle-group/examples/ghost.html.js +5 -0
- package/dist/toggle-group/examples/icons.html +3 -3
- package/dist/toggle-group/examples/icons.html.js +5 -0
- package/dist/toggle-group/examples/multiple.html.js +5 -0
- package/dist/toggle-group/examples/outline.html +2 -2
- package/dist/toggle-group/examples/outline.html.js +5 -0
- package/dist/toggle-group/examples/toolbar.html +3 -3
- package/dist/toggle-group/examples/toolbar.html.js +5 -0
- package/dist/toggle-group/toggle-group.events.d.ts +2 -3
- package/dist/toggle-group/toggle-group.machine.d.ts +3 -3
- package/dist/toggle-group/toggle-group.machine.js +1 -1
- package/dist/toggle-group/toggle-group.presentation.d.ts +6 -7
- package/dist/toggle-group/toggle-group.presentation.js +2 -2
- package/dist/toggle-group/toggle-group.state.d.ts +1 -2
- package/dist/toggle-group/toggle-group.state.js +1 -1
- package/dist/toggle-group/toggle-group.transitions.d.ts +3 -4
- package/dist/tooltip/examples/basic.html.js +5 -0
- package/dist/tooltip/examples/metrics.html +9 -9
- package/dist/tooltip/examples/metrics.html.js +5 -0
- package/dist/tooltip/examples/positioning.html +4 -4
- package/dist/tooltip/examples/positioning.html.js +5 -0
- package/dist/tooltip/examples/status.html +10 -10
- package/dist/tooltip/examples/status.html.js +5 -0
- package/dist/tooltip/examples/video.html +6 -6
- package/dist/tooltip/examples/video.html.js +5 -0
- package/dist/tooltip/examples/with-arrow.html +1 -1
- package/dist/tooltip/examples/with-arrow.html.js +5 -0
- package/dist/tooltip/tooltip.controller-def.d.ts +3 -5
- package/dist/tooltip/tooltip.controller-def.js +1 -1
- package/dist/tour/examples/basic.html +5 -5
- package/dist/tour/examples/basic.html.js +5 -0
- package/dist/tour/tour.events.d.ts +2 -3
- package/dist/tour/tour.machine.d.ts +7 -3
- package/dist/tour/tour.machine.js +1 -1
- package/dist/tour/tour.presentation.d.ts +6 -7
- package/dist/tour/tour.presentation.js +1 -1
- package/dist/tour/tour.state.d.ts +1 -2
- package/dist/tour/tour.state.js +1 -1
- package/dist/tour/tour.transitions.d.ts +3 -4
- package/dist/tree-view/examples/basic.html +10 -10
- package/dist/tree-view/examples/basic.html.js +5 -0
- package/dist/tree-view/examples/loading.html +11 -11
- package/dist/tree-view/examples/loading.html.js +5 -0
- package/dist/tree-view/tree-view.events.d.ts +2 -3
- package/dist/tree-view/tree-view.machine.d.ts +2 -3
- package/dist/tree-view/tree-view.machine.js +1 -1
- package/dist/tree-view/tree-view.presentation.d.ts +7 -8
- package/dist/tree-view/tree-view.presentation.js +2 -2
- package/dist/tree-view/tree-view.state.d.ts +1 -2
- package/dist/tree-view/tree-view.state.js +1 -1
- package/dist/tree-view/tree-view.transitions.d.ts +3 -4
- package/package.json +43 -8
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { scope, signal } from "../core/signal.js";
|
|
2
|
+
import { createScopeTable } from "./table.js";
|
|
3
|
+
import { coerceBool, coerceInt, coerceJsonArray, coerceObjectArrayItems, coerceString } from "../props.js";
|
|
4
|
+
// src/runtime/scope/element.ts
|
|
5
|
+
/**
|
|
6
|
+
* Custom elements: a scope per connection, and props that survive both sides.
|
|
7
|
+
*
|
|
8
|
+
* Props are properties, not attributes — an attribute is a string and a machine
|
|
9
|
+
* needs objects. Attributes are supported for the primitives that are strings,
|
|
10
|
+
* and land in the same live prop a property write would.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The scope grammar's attribute parsers, one per declared prop type. The
|
|
14
|
+
* plugin emits an `attributes` map from these so an attribute written at
|
|
15
|
+
* any time — a framework's string prop, or a later setAttribute — lands in
|
|
16
|
+
* the same live prop a property write reaches. Kept beside the element
|
|
17
|
+
* definition that consumes them, not beside the grammar that mirrors them.
|
|
18
|
+
*/
|
|
19
|
+
const attrParsers = {
|
|
20
|
+
bool: (value) => coerceBool(value, false),
|
|
21
|
+
string: (value) => coerceString(value),
|
|
22
|
+
int: (value) => coerceInt(value, void 0),
|
|
23
|
+
"string[]": (value) => coerceJsonArray(value, []),
|
|
24
|
+
"object[]": (value) => coerceJsonArray(value, [])
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Props the host actually WROTE — as a property set or an attribute — as
|
|
28
|
+
* opposed to coerced defaults. This is the distinction controlled
|
|
29
|
+
* components live on: a `defaultOpen` seeds, an authored `open` alternates.
|
|
30
|
+
* Without it every declared prop reads as "set", because coercion
|
|
31
|
+
* materializes a default for all of them, and a machine can never tell the
|
|
32
|
+
* two apart. A controlled/uncontrolled pair does this at the prop layer
|
|
33
|
+
* (`value` vs `defaultValue`); the element is where it lands here.
|
|
34
|
+
*/
|
|
35
|
+
const authoredProps = /* @__PURE__ */ new WeakMap();
|
|
36
|
+
/** Each element's connection scope, so work that runs later — a binding
|
|
37
|
+
* re-applying after the element left the build — still enters it. */
|
|
38
|
+
const elementScopes = /* @__PURE__ */ new WeakMap();
|
|
39
|
+
/** Per-element prop writers, registered at construction. `writeProp` reaches
|
|
40
|
+
* the element's own store even for names no accessor was declared for. */
|
|
41
|
+
const writers = /* @__PURE__ */ new WeakMap();
|
|
42
|
+
/**
|
|
43
|
+
* Write a prop through the element's store, marking it authored. Returns
|
|
44
|
+
* false when `el` is not a Spin element (or predates its upgrade), so the
|
|
45
|
+
* caller falls back to a plain property write the constructor picks up.
|
|
46
|
+
*/
|
|
47
|
+
function writeProp(el, name, value) {
|
|
48
|
+
const write = writers.get(el);
|
|
49
|
+
if (write === void 0) return false;
|
|
50
|
+
write(name, value);
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
/** The scope of the element that owns `node`: a recipe's markup renders
|
|
54
|
+
* inside its custom element, so a bag spread on an inner node belongs to that
|
|
55
|
+
* element's scope. */
|
|
56
|
+
function scopeOf(node) {
|
|
57
|
+
for (let current = node; current !== null; current = current.parentElement) {
|
|
58
|
+
const owner = elementScopes.get(current);
|
|
59
|
+
if (owner !== void 0) return owner;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Runs `fn` inside the owning element's scope, so what it creates is owned
|
|
63
|
+
* and disposed with the element. Outside an element (a detached fragment)
|
|
64
|
+
* there is no scope to enter, and `fn` runs as-is. */
|
|
65
|
+
function runInElement(el, fn) {
|
|
66
|
+
const owner = scopeOf(el);
|
|
67
|
+
return owner === void 0 ? fn() : owner.run(fn);
|
|
68
|
+
}
|
|
69
|
+
function authoredFor(el) {
|
|
70
|
+
let set = authoredProps.get(el);
|
|
71
|
+
if (!set) authoredProps.set(el, set = /* @__PURE__ */ new Set());
|
|
72
|
+
return set;
|
|
73
|
+
}
|
|
74
|
+
/** Per-tag counters for generated element ids. Page-load scoped: uniqueness
|
|
75
|
+
* is what part-id scoping needs, stability across loads is not. */
|
|
76
|
+
const idCounters = /* @__PURE__ */ new Map();
|
|
77
|
+
/**
|
|
78
|
+
* A unique id for a `tag` instance. Used when the author sets no `id`: the
|
|
79
|
+
* machine scopes part ids (and aria references) by its own id, so two
|
|
80
|
+
* id-less `<spin-accordion>` elements would otherwise share every part id.
|
|
81
|
+
*/
|
|
82
|
+
function uniqueId(tag) {
|
|
83
|
+
const next = (idCounters.get(tag) ?? 0) + 1;
|
|
84
|
+
idCounters.set(tag, next);
|
|
85
|
+
return `${tag}-${next}`;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Registers `tag` as a custom element built by `spec`.
|
|
89
|
+
*
|
|
90
|
+
* `build` runs inside the element's scope on every connection, so every effect
|
|
91
|
+
* it creates dies with the element.
|
|
92
|
+
*/
|
|
93
|
+
function define(tag, spec) {
|
|
94
|
+
const propNames = spec.props ?? [];
|
|
95
|
+
const parsers = spec.attributes ?? {};
|
|
96
|
+
const stores = /* @__PURE__ */ new WeakMap();
|
|
97
|
+
function storeFor(el) {
|
|
98
|
+
let store = stores.get(el);
|
|
99
|
+
if (!store) stores.set(el, store = /* @__PURE__ */ new Map());
|
|
100
|
+
return store;
|
|
101
|
+
}
|
|
102
|
+
function seedProps(el) {
|
|
103
|
+
const store = storeFor(el);
|
|
104
|
+
for (const name of propNames) if (!store.has(name)) store.set(name, signal(void 0));
|
|
105
|
+
}
|
|
106
|
+
function propFor(el, name) {
|
|
107
|
+
const store = storeFor(el);
|
|
108
|
+
let value = store.get(name);
|
|
109
|
+
if (!value) store.set(name, value = signal(void 0));
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
function propsFor(el) {
|
|
113
|
+
return new Proxy({}, {
|
|
114
|
+
get: (_target, key) => typeof key === "string" ? propFor(el, key)() : void 0,
|
|
115
|
+
has: (_target, key) => typeof key === "string" && storeFor(el).has(key),
|
|
116
|
+
ownKeys: () => {
|
|
117
|
+
const store = storeFor(el);
|
|
118
|
+
const out = [];
|
|
119
|
+
for (const name of propNames) {
|
|
120
|
+
const sig = store.get(name);
|
|
121
|
+
if (sig !== void 0 && sig() !== void 0) out.push(name);
|
|
122
|
+
}
|
|
123
|
+
for (const name of store.keys()) if (!propNames.includes(name)) out.push(name);
|
|
124
|
+
return out;
|
|
125
|
+
},
|
|
126
|
+
getOwnPropertyDescriptor: () => ({
|
|
127
|
+
configurable: true,
|
|
128
|
+
enumerable: true
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
class Component extends HTMLElement {
|
|
133
|
+
#scope;
|
|
134
|
+
#table;
|
|
135
|
+
constructor() {
|
|
136
|
+
super();
|
|
137
|
+
for (const name of propNames) {
|
|
138
|
+
const own = Object.getOwnPropertyDescriptor(this, name);
|
|
139
|
+
if (own === void 0 || own.get !== void 0 || own.set !== void 0) continue;
|
|
140
|
+
const value = own.value;
|
|
141
|
+
delete this[name];
|
|
142
|
+
authoredFor(this).add(name);
|
|
143
|
+
propFor(this, name)(coerceWrite(name, value));
|
|
144
|
+
}
|
|
145
|
+
writers.set(this, (name, next) => {
|
|
146
|
+
authoredFor(this).add(name);
|
|
147
|
+
propFor(this, name)(coerceWrite(name, next));
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
connectedCallback() {
|
|
151
|
+
if (this.#scope !== void 0) return;
|
|
152
|
+
if (this.style.display === "") {
|
|
153
|
+
const view = this.ownerDocument.defaultView;
|
|
154
|
+
if ((typeof view?.getComputedStyle === "function" ? view.getComputedStyle(this).display : "inline") === "inline") this.style.display = "block";
|
|
155
|
+
}
|
|
156
|
+
const parentScope = this.parentElement !== null ? scopeOf(this.parentElement) : void 0;
|
|
157
|
+
const owner = scope(parentScope);
|
|
158
|
+
this.#scope = owner;
|
|
159
|
+
elementScopes.set(this, owner);
|
|
160
|
+
const table = createScopeTable(owner, this);
|
|
161
|
+
this.#table = table;
|
|
162
|
+
owner.run(() => {
|
|
163
|
+
seedProps(this);
|
|
164
|
+
spec.build({
|
|
165
|
+
el: this,
|
|
166
|
+
props: propsFor(this),
|
|
167
|
+
scope: owner,
|
|
168
|
+
resolve: (handle) => table.resolve(handle),
|
|
169
|
+
watch: (handle, factory, commands, name) => {
|
|
170
|
+
const peers = table.namesOf(handle);
|
|
171
|
+
if ((name ?? "") === "" && peers.length > 0 && !peers.includes("")) throw new Error(`[spin] ${tag}: two bindings share one machine; pass a binding name`);
|
|
172
|
+
return table.watch(handle, factory, commands, name);
|
|
173
|
+
},
|
|
174
|
+
consume: (handle) => table.consume(handle),
|
|
175
|
+
authored: (name) => authoredFor(this).has(name)
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
disconnectedCallback() {
|
|
180
|
+
queueMicrotask(() => {
|
|
181
|
+
if (this.isConnected) return;
|
|
182
|
+
this.#scope?.dispose();
|
|
183
|
+
this.#scope = void 0;
|
|
184
|
+
this.#table = void 0;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
attributeChangedCallback(name, _previous, next) {
|
|
188
|
+
authoredFor(this).add(name);
|
|
189
|
+
propFor(this, name)(parsers[name]?.(next));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The property-write boundary. A host's write coerces through the runtime's
|
|
194
|
+
* prop grammar, so the store holds grammar-shaped values whichever boundary
|
|
195
|
+
* the host wrote through. String writes take the component's own parser (the
|
|
196
|
+
* attribute path's grammar, verbatim); a host-written object or array takes
|
|
197
|
+
* the object-array branch: plain objects survive, everything else is dropped.
|
|
198
|
+
*/
|
|
199
|
+
function coerceWrite(name, next) {
|
|
200
|
+
const parser = parsers[name];
|
|
201
|
+
if (parser === void 0) return next;
|
|
202
|
+
if (typeof next === "string") return parser(next);
|
|
203
|
+
if (parser !== attrParsers["object[]"]) return next;
|
|
204
|
+
return coerceObjectArrayItems(next, []);
|
|
205
|
+
}
|
|
206
|
+
for (const name of propNames) Object.defineProperty(Component.prototype, name, {
|
|
207
|
+
get() {
|
|
208
|
+
return propFor(this, name)();
|
|
209
|
+
},
|
|
210
|
+
set(next) {
|
|
211
|
+
authoredFor(this).add(name);
|
|
212
|
+
propFor(this, name)(coerceWrite(name, next));
|
|
213
|
+
},
|
|
214
|
+
configurable: true,
|
|
215
|
+
enumerable: true
|
|
216
|
+
});
|
|
217
|
+
Object.defineProperty(Component, "observedAttributes", {
|
|
218
|
+
value: Object.keys(parsers),
|
|
219
|
+
configurable: true
|
|
220
|
+
});
|
|
221
|
+
if (customElements.get(tag) !== void 0) return;
|
|
222
|
+
customElements.define(tag, Component);
|
|
223
|
+
}
|
|
224
|
+
export { attrParsers, define, runInElement, scopeOf, uniqueId, writeProp };
|
|
225
|
+
|
|
226
|
+
//# sourceMappingURL=element.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scope-local instance table with DOM-ancestor chain lookup and dispose-on-scope-death.
|
|
3
|
+
*
|
|
4
|
+
* Each element-connection scope owns a `Map<handle, instance>`. Lookup walks
|
|
5
|
+
* the DOM ancestor chain (element → parentElement → …), so a nested element
|
|
6
|
+
* consumes the nearest ancestor's instance. First `watch` instantiates via
|
|
7
|
+
* the registered factory; scope dispose destroys instances created in it.
|
|
8
|
+
*
|
|
9
|
+
* Handle = imported object reference (machine-def module export), never a
|
|
10
|
+
* string. No central registry; the module graph is the registry.
|
|
11
|
+
*/
|
|
12
|
+
import { OwnerScope } from "../core/signal.js";
|
|
13
|
+
/** A handle identifies a machine definition. It is the imported object reference, never a string. */
|
|
14
|
+
export type Handle = object;
|
|
15
|
+
/** Creates an instance from a handle. */
|
|
16
|
+
export type Factory<T> = () => T;
|
|
17
|
+
/** What an app controller can do with a component. */
|
|
18
|
+
export interface SpinController {
|
|
19
|
+
/** Imperative calls, keyed by the name the element installs them under. */
|
|
20
|
+
readonly commands: Readonly<Record<string, (...args: never[]) => unknown>>;
|
|
21
|
+
/** Reactive reads, one thunk per observable field. */
|
|
22
|
+
readonly state: Readonly<Record<string, () => unknown>>;
|
|
23
|
+
}
|
|
24
|
+
export interface ScopeTable {
|
|
25
|
+
/** Look up a handle, walking up the DOM ancestor chain. Does not instantiate. */
|
|
26
|
+
resolve<T>(handle: Handle): T | undefined;
|
|
27
|
+
/** Instantiate (on first call) and register a handle in this element's scope. */
|
|
28
|
+
watch<T>(handle: Handle, factory: Factory<T>, commands?: readonly string[], name?: string): T;
|
|
29
|
+
/** Consume a handle by walking up the DOM ancestor ScopeTable chain; throws when absent. */
|
|
30
|
+
consume<T>(handle: Handle): T;
|
|
31
|
+
/** Return the SpinController view for a handle (or the primary handle if omitted). */
|
|
32
|
+
controller(handle?: Handle): SpinController | undefined;
|
|
33
|
+
/** Destroy all instances created in this scope. */
|
|
34
|
+
dispose(): void;
|
|
35
|
+
}
|
|
36
|
+
/** The controller view of a component's api: its non-function members as
|
|
37
|
+
* reactive reads, and the declared commands as calls.
|
|
38
|
+
*
|
|
39
|
+
* The field list is a reflection of the api, not a declaration — a field the
|
|
40
|
+
* api stops carrying stops being observable, with no list to keep in step. */
|
|
41
|
+
export declare function controllerView(api: object, commands?: readonly string[]): SpinController;
|
|
42
|
+
/**
|
|
43
|
+
* Creates a scope table for the given owner scope, optionally bound to an
|
|
44
|
+
* element for DOM-ancestor chain lookup.
|
|
45
|
+
*
|
|
46
|
+
* The table is registered with the scope via `own()`, so when the scope is
|
|
47
|
+
* disposed, all instances created in it are destroyed.
|
|
48
|
+
*/
|
|
49
|
+
export declare function createScopeTable(owner: OwnerScope, el?: Element): ScopeTable;
|
|
50
|
+
/** Consume a handle from `el`'s ScopeTable chain; throws when no provider is found. */
|
|
51
|
+
export declare function consume<T>(el: Element, handle: Handle): T;
|
|
52
|
+
/** The controller `el` provides, or the nearest ancestor's when `el` is not connected. */
|
|
53
|
+
export declare function controllerOf(el: Element, handle?: Handle): SpinController | undefined;
|
|
54
|
+
/** Register a controller on `el`'s ScopeTable, creating a table when `el` is a plain host element. */
|
|
55
|
+
export declare function provideController(el: Element, build: () => SpinController, handle?: Handle): void;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { scope } from "../core/signal.js";
|
|
2
|
+
// src/runtime/scope/table.ts
|
|
3
|
+
/**
|
|
4
|
+
* Scope-local instance table with DOM-ancestor chain lookup and dispose-on-scope-death.
|
|
5
|
+
*
|
|
6
|
+
* Each element-connection scope owns a `Map<handle, instance>`. Lookup walks
|
|
7
|
+
* the DOM ancestor chain (element → parentElement → …), so a nested element
|
|
8
|
+
* consumes the nearest ancestor's instance. First `watch` instantiates via
|
|
9
|
+
* the registered factory; scope dispose destroys instances created in it.
|
|
10
|
+
*
|
|
11
|
+
* Handle = imported object reference (machine-def module export), never a
|
|
12
|
+
* string. No central registry; the module graph is the registry.
|
|
13
|
+
*/
|
|
14
|
+
/** Maps each element to its connection ScopeTable. */
|
|
15
|
+
const elementTables = /* @__PURE__ */ new WeakMap();
|
|
16
|
+
function apiOf(value) {
|
|
17
|
+
if (value !== null && typeof value === "object" && "api" in value) return value.api;
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
/** The controller view of a component's api: its non-function members as
|
|
21
|
+
* reactive reads, and the declared commands as calls.
|
|
22
|
+
*
|
|
23
|
+
* The field list is a reflection of the api, not a declaration — a field the
|
|
24
|
+
* api stops carrying stops being observable, with no list to keep in step. */
|
|
25
|
+
function controllerView(api, commands) {
|
|
26
|
+
const record = api;
|
|
27
|
+
const state = {};
|
|
28
|
+
for (const key of Object.keys(record)) if (typeof record[key] !== "function") state[key] = () => record[key];
|
|
29
|
+
const calls = {};
|
|
30
|
+
for (const name of commands ?? []) {
|
|
31
|
+
const method = record[name];
|
|
32
|
+
if (typeof method === "function") calls[name] = method;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
commands: calls,
|
|
36
|
+
state
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates a scope table for the given owner scope, optionally bound to an
|
|
41
|
+
* element for DOM-ancestor chain lookup.
|
|
42
|
+
*
|
|
43
|
+
* The table is registered with the scope via `own()`, so when the scope is
|
|
44
|
+
* disposed, all instances created in it are destroyed.
|
|
45
|
+
*/
|
|
46
|
+
function createScopeTable(owner, el) {
|
|
47
|
+
const instances = /* @__PURE__ */ new Map();
|
|
48
|
+
let primary;
|
|
49
|
+
function named(handle) {
|
|
50
|
+
let byName = instances.get(handle);
|
|
51
|
+
if (byName === void 0) instances.set(handle, byName = /* @__PURE__ */ new Map());
|
|
52
|
+
return byName;
|
|
53
|
+
}
|
|
54
|
+
function firstEntry(byName) {
|
|
55
|
+
if (byName === void 0) return void 0;
|
|
56
|
+
return byName.get("") ?? byName.values().next().value;
|
|
57
|
+
}
|
|
58
|
+
owner.own(() => {
|
|
59
|
+
if (el !== void 0) elementTables.delete(el);
|
|
60
|
+
for (const byName of instances.values()) for (const [, instance] of byName) instance.dispose?.();
|
|
61
|
+
instances.clear();
|
|
62
|
+
primary = void 0;
|
|
63
|
+
});
|
|
64
|
+
function findLocal(handle) {
|
|
65
|
+
return firstEntry(instances.get(handle));
|
|
66
|
+
}
|
|
67
|
+
function findAncestor(handle) {
|
|
68
|
+
for (let current = el?.parentElement ?? null; current !== null; current = current.parentElement) {
|
|
69
|
+
const found = elementTables.get(current)?.entry(handle);
|
|
70
|
+
if (found !== void 0) return found;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function resolve(handle) {
|
|
74
|
+
return (findLocal(handle) ?? findAncestor(handle))?.api;
|
|
75
|
+
}
|
|
76
|
+
function consume(handle) {
|
|
77
|
+
const found = resolve(handle);
|
|
78
|
+
if (found === void 0) throw new Error(`[spin] consume: no provider found for ${handle.name ?? "machine"}`);
|
|
79
|
+
return found;
|
|
80
|
+
}
|
|
81
|
+
function watch(handle, factory, commands, name) {
|
|
82
|
+
const key = name ?? "";
|
|
83
|
+
const byName = named(handle);
|
|
84
|
+
const existing = byName.get(key);
|
|
85
|
+
if (existing !== void 0) return existing.value;
|
|
86
|
+
const value = factory();
|
|
87
|
+
const entry = {
|
|
88
|
+
value,
|
|
89
|
+
api: apiOf(value),
|
|
90
|
+
commands,
|
|
91
|
+
primary: primary === void 0,
|
|
92
|
+
dispose: getDispose(value)
|
|
93
|
+
};
|
|
94
|
+
byName.set(key, entry);
|
|
95
|
+
primary ??= {
|
|
96
|
+
handle,
|
|
97
|
+
name: key
|
|
98
|
+
};
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
function entry(handle) {
|
|
102
|
+
return findLocal(handle);
|
|
103
|
+
}
|
|
104
|
+
function hasNamed(handle, name) {
|
|
105
|
+
return instances.get(handle)?.has(name) ?? false;
|
|
106
|
+
}
|
|
107
|
+
function namesOf(handle) {
|
|
108
|
+
return [...instances.get(handle)?.keys() ?? []];
|
|
109
|
+
}
|
|
110
|
+
function controller(handle) {
|
|
111
|
+
const target = handle ?? primary?.handle;
|
|
112
|
+
const found = target === void 0 ? void 0 : findLocal(target) ?? (handle === void 0 ? void 0 : findAncestor(handle));
|
|
113
|
+
if (found === void 0) return void 0;
|
|
114
|
+
const api = found.api;
|
|
115
|
+
if (api !== null && typeof api === "object" && "commands" in api && "state" in api) return api;
|
|
116
|
+
return controllerView(found.api ?? {}, found.commands);
|
|
117
|
+
}
|
|
118
|
+
function dispose() {
|
|
119
|
+
if (el !== void 0) elementTables.delete(el);
|
|
120
|
+
for (const byName of instances.values()) for (const [, instance] of byName) instance.dispose?.();
|
|
121
|
+
instances.clear();
|
|
122
|
+
primary = void 0;
|
|
123
|
+
}
|
|
124
|
+
function getDispose(value) {
|
|
125
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
126
|
+
if (!("dispose" in value)) return void 0;
|
|
127
|
+
const disposeFn = value.dispose;
|
|
128
|
+
if (typeof disposeFn !== "function") return void 0;
|
|
129
|
+
return () => disposeFn();
|
|
130
|
+
}
|
|
131
|
+
const table = {
|
|
132
|
+
resolve,
|
|
133
|
+
watch,
|
|
134
|
+
consume,
|
|
135
|
+
controller,
|
|
136
|
+
dispose,
|
|
137
|
+
entry,
|
|
138
|
+
hasNamed,
|
|
139
|
+
namesOf
|
|
140
|
+
};
|
|
141
|
+
if (el !== void 0) elementTables.set(el, table);
|
|
142
|
+
return table;
|
|
143
|
+
}
|
|
144
|
+
/** Consume a handle from `el`'s ScopeTable chain; throws when no provider is found. */
|
|
145
|
+
function consume(el, handle) {
|
|
146
|
+
for (let current = el; current !== null; current = current.parentElement) {
|
|
147
|
+
const found = elementTables.get(current)?.consume(handle);
|
|
148
|
+
if (found !== void 0) return found;
|
|
149
|
+
}
|
|
150
|
+
throw new Error(`[spin] consume: no provider found for ${handle.name ?? "machine"}`);
|
|
151
|
+
}
|
|
152
|
+
/** The controller `el` provides, or the nearest ancestor's when `el` is not connected. */
|
|
153
|
+
function controllerOf(el, handle) {
|
|
154
|
+
for (let current = el; current !== null; current = current.parentElement) {
|
|
155
|
+
const found = elementTables.get(current)?.controller(handle);
|
|
156
|
+
if (found !== void 0) return found;
|
|
157
|
+
if (handle === void 0) return void 0;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/** Register a controller on `el`'s ScopeTable, creating a table when `el` is a plain host element. */
|
|
161
|
+
function provideController(el, build, handle) {
|
|
162
|
+
let table = elementTables.get(el);
|
|
163
|
+
if (table === void 0) table = createScopeTable(scope(), el);
|
|
164
|
+
const key = handle ?? build;
|
|
165
|
+
if (table.resolve(key) !== void 0) return;
|
|
166
|
+
const built = build();
|
|
167
|
+
table.watch(key, () => ({
|
|
168
|
+
api: built,
|
|
169
|
+
dispose: void 0
|
|
170
|
+
}), Object.keys(built.commands));
|
|
171
|
+
}
|
|
172
|
+
export { consume, controllerOf, controllerView, createScopeTable, provideController };
|
|
173
|
+
|
|
174
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/runtime/syntax/braces.ts
|
|
2
|
+
function matchBrace(source, start, end) {
|
|
3
|
+
let depth = 0;
|
|
4
|
+
let j = start;
|
|
5
|
+
while (j < end) {
|
|
6
|
+
const c = source[j];
|
|
7
|
+
if (c === "\"" || c === "'" || c === "`") {
|
|
8
|
+
j = skipQuoted(source, j, end);
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
if (c === "{") depth++;
|
|
12
|
+
else if (c === "}") {
|
|
13
|
+
depth--;
|
|
14
|
+
if (depth === 0) return j;
|
|
15
|
+
}
|
|
16
|
+
j++;
|
|
17
|
+
}
|
|
18
|
+
return end;
|
|
19
|
+
}
|
|
20
|
+
function skipQuoted(source, i, end) {
|
|
21
|
+
const q = source[i];
|
|
22
|
+
let j = i + 1;
|
|
23
|
+
while (j < end) {
|
|
24
|
+
if (source[j] === "\\") {
|
|
25
|
+
j += 2;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (source[j] === q) return j + 1;
|
|
29
|
+
j++;
|
|
30
|
+
}
|
|
31
|
+
return end;
|
|
32
|
+
}
|
|
33
|
+
export { matchBrace, skipQuoted };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=braces.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** The class strings a markup file names.
|
|
2
|
+
*
|
|
3
|
+
* A class attribute is static text or an expression. A static one names
|
|
4
|
+
* its utilities outright. An expression names them in its string
|
|
5
|
+
* literals — `class={"bg-surface" + (slider.dragging ? " scale-110" : "")}`
|
|
6
|
+
* names two — and the vocabulary check has to see through it, or a
|
|
7
|
+
* misspelled utility in a dynamic class is a dead rule nobody catches.
|
|
8
|
+
*
|
|
9
|
+
* The literals are collected, not evaluated: an expression's shape is not
|
|
10
|
+
* the compiler's business, only which utilities it names.
|
|
11
|
+
*/
|
|
12
|
+
import { Attr, AttrValue, ComponentIr, Node } from "./ir.js";
|
|
13
|
+
/** The class tokens an attribute names. A variant group is one token
|
|
14
|
+
* that names several (`data-[open]:(bg-x text-y)`), so the groups are
|
|
15
|
+
* expanded before the tokens are split. */
|
|
16
|
+
export declare function classTokensOf(value: AttrValue): string[];
|
|
17
|
+
/** Every class token the markup names. */
|
|
18
|
+
export declare function classTokens(ir: ComponentIr): string[];
|
|
19
|
+
/** The class attribute of a node, if it has one. */
|
|
20
|
+
export declare function classAttrOf(node: Extract<Node, {
|
|
21
|
+
kind: "element";
|
|
22
|
+
}>): Attr | undefined;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { expandVariantGroups } from "./expand-groups.js";
|
|
2
|
+
// src/runtime/syntax/classes.ts
|
|
3
|
+
/** The string literals an expression holds. */
|
|
4
|
+
function literalsOf(expression) {
|
|
5
|
+
const out = [];
|
|
6
|
+
const pattern = /"([^"]*)"|'([^']*)'|`([^`]*)`/g;
|
|
7
|
+
let match;
|
|
8
|
+
while ((match = pattern.exec(expression)) !== null) {
|
|
9
|
+
const value = match[1] ?? match[2] ?? match[3];
|
|
10
|
+
if (value !== void 0 && value.length > 0) out.push(value);
|
|
11
|
+
}
|
|
12
|
+
return out;
|
|
13
|
+
}
|
|
14
|
+
/** The class tokens an attribute names. A variant group is one token
|
|
15
|
+
* that names several (`data-[open]:(bg-x text-y)`), so the groups are
|
|
16
|
+
* expanded before the tokens are split. */
|
|
17
|
+
function classTokensOf(value) {
|
|
18
|
+
const out = [];
|
|
19
|
+
const push = (text) => {
|
|
20
|
+
for (const token of expandVariantGroups(text).split(/\s+/)) if (token.length > 0) out.push(token);
|
|
21
|
+
};
|
|
22
|
+
if (value.kind === "static") {
|
|
23
|
+
push(value.value);
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
26
|
+
if (/^\s*[[{]/.test(value.expr)) {
|
|
27
|
+
for (const part of listPartsOf(value.expr)) if (part.kind === "string") push(part.value);
|
|
28
|
+
else for (const key of part.keys) push(key);
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
for (const literal of literalsOf(value.expr)) push(literal);
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
/** The parts of a class attribute's value: the strings it holds and the
|
|
35
|
+
* keys of the objects it holds. */
|
|
36
|
+
function listPartsOf(literal) {
|
|
37
|
+
const out = [];
|
|
38
|
+
const parts = splitTop(literal.trim().replace(/^\[/, "").replace(/\]$/, ""));
|
|
39
|
+
for (const part of parts) {
|
|
40
|
+
const text = part.trim();
|
|
41
|
+
if (text.startsWith("\"") || text.startsWith("'")) {
|
|
42
|
+
out.push({
|
|
43
|
+
kind: "string",
|
|
44
|
+
value: text.slice(1, -1)
|
|
45
|
+
});
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (text.startsWith("{")) out.push({
|
|
49
|
+
kind: "object",
|
|
50
|
+
keys: objectKeysOf(text)
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
/** The parts of a value, at its top level. */
|
|
56
|
+
function splitTop(body) {
|
|
57
|
+
const out = [];
|
|
58
|
+
let depth = 0;
|
|
59
|
+
let start = 0;
|
|
60
|
+
for (let i = 0; i <= body.length; i++) {
|
|
61
|
+
const ch = body[i];
|
|
62
|
+
if (ch === "{" || ch === "[" || ch === "(") depth++;
|
|
63
|
+
else if (ch === "}" || ch === "]" || ch === ")") depth--;
|
|
64
|
+
else if (ch === "," && depth === 0 || i === body.length) {
|
|
65
|
+
const part = body.slice(start, i).trim();
|
|
66
|
+
if (part.length > 0) out.push(part);
|
|
67
|
+
start = i + 1;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return out;
|
|
71
|
+
}
|
|
72
|
+
/** The keys of an object literal, at its top level. */
|
|
73
|
+
function objectKeysOf(literal) {
|
|
74
|
+
const out = [];
|
|
75
|
+
let depth = 0;
|
|
76
|
+
let start = 0;
|
|
77
|
+
const body = literal.trim().replace(/^\{/, "").replace(/\}$/, "");
|
|
78
|
+
for (let i = 0; i <= body.length; i++) {
|
|
79
|
+
const ch = body[i];
|
|
80
|
+
if (ch === "{" || ch === "[" || ch === "(") depth++;
|
|
81
|
+
else if (ch === "}" || ch === "]" || ch === ")") depth--;
|
|
82
|
+
else if (ch === "," && depth === 0 || i === body.length) {
|
|
83
|
+
const entry = body.slice(start, i).trim();
|
|
84
|
+
start = i + 1;
|
|
85
|
+
if (entry.length === 0) continue;
|
|
86
|
+
const colon = entry.indexOf(":");
|
|
87
|
+
const key = (colon < 0 ? entry : entry.slice(0, colon)).trim();
|
|
88
|
+
const name = /^"([^"]*)"$|^'([^']*)'$/.exec(key);
|
|
89
|
+
if (name !== null) out.push(name[1] ?? name[2] ?? "");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return out.filter((name) => name.length > 0);
|
|
93
|
+
}
|
|
94
|
+
/** Every class token a node names, in the document's order. */
|
|
95
|
+
function tokensOfNode(node, out) {
|
|
96
|
+
if (node.kind === "text") return;
|
|
97
|
+
if (node.kind === "for") {
|
|
98
|
+
for (const child of node.body) tokensOfNode(child, out);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
for (const attr of node.attrs) {
|
|
102
|
+
if (attr.name !== "class") continue;
|
|
103
|
+
for (const token of classTokensOf(attr.value)) out.push(token);
|
|
104
|
+
}
|
|
105
|
+
for (const child of node.children) tokensOfNode(child, out);
|
|
106
|
+
}
|
|
107
|
+
/** Every class token the markup names. */
|
|
108
|
+
function classTokens(ir) {
|
|
109
|
+
const out = [];
|
|
110
|
+
for (const node of ir.nodes) tokensOfNode(node, out);
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
/** The class attribute of a node, if it has one. */
|
|
114
|
+
function classAttrOf(node) {
|
|
115
|
+
return node.attrs.find((attr) => attr.name === "class");
|
|
116
|
+
}
|
|
117
|
+
export { classAttrOf, classTokens, classTokensOf };
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=classes.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One token of example markup, as the code viewer reads it.
|
|
3
|
+
*
|
|
4
|
+
* Self-contained on purpose: the reference demonstrates the styling surface,
|
|
5
|
+
* so a syntax highlighter from a dependency would be a second stylesheet the
|
|
6
|
+
* theme cannot reach. The tokenizer is a single pass over the string and
|
|
7
|
+
* nothing else — no grammar, no recovery, no recursion.
|
|
8
|
+
*/
|
|
9
|
+
export type CodeTokenType = "tag" | "attr" | "string" | "comment" | "punct" | "expr" | "text";
|
|
10
|
+
export interface CodeToken {
|
|
11
|
+
readonly type: CodeTokenType;
|
|
12
|
+
readonly value: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Example HTML, tokenized: tags, attribute names, string values, comments and
|
|
16
|
+
* the text between them. Everything the markup spells is preserved exactly,
|
|
17
|
+
* whitespace included, because the code view is the markup a consumer copies.
|
|
18
|
+
*/
|
|
19
|
+
export declare function tokenizeHtml(html: string): CodeToken[];
|
|
20
|
+
/**
|
|
21
|
+
* Example HTML, formatted. Idempotent: formatting what was formatted
|
|
22
|
+
* changes nothing, because it replaces whitespace-only runs and nothing
|
|
23
|
+
* else.
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatExampleHtml(html: string): string;
|