@spinjs/components 0.1.0-preview.1 → 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 +11 -12
- 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 +20 -21
- 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 +7 -8
- 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 +9 -10
- 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,385 @@
|
|
|
1
|
+
import { interpret } from "../machine/fsm/machine.js";
|
|
2
|
+
import { computed, effect, scope, untrack } from "../core/signal.js";
|
|
3
|
+
import { dataAttr } from "./define.js";
|
|
4
|
+
import { focuser, ids, measurer } from "./ids.js";
|
|
5
|
+
import { resolveTwins } from "../props.js";
|
|
6
|
+
// src/runtime/component/synthesize.ts
|
|
7
|
+
/**
|
|
8
|
+
* The props the host actually wrote, as a predicate.
|
|
9
|
+
* Controlled components live on the authored/written split: a host that
|
|
10
|
+
* writes `value` owns it, and the element marks the write so the bridge can
|
|
11
|
+
* tell a live prop from a coerced default.
|
|
12
|
+
*/
|
|
13
|
+
function authoredProps(props) {
|
|
14
|
+
return (name) => {
|
|
15
|
+
const predicate = props()["@@authored"];
|
|
16
|
+
return typeof predicate === "function" ? predicate(name) : false;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** A callback prop, when the host wrote a function for it. */
|
|
20
|
+
function pickCallback(props, name) {
|
|
21
|
+
const value = props[name];
|
|
22
|
+
return typeof value === "function" ? value : void 0;
|
|
23
|
+
}
|
|
24
|
+
/** A text prop, or empty when the host wrote anything else. */
|
|
25
|
+
function textProp(raw) {
|
|
26
|
+
return typeof raw === "string" ? raw : "";
|
|
27
|
+
}
|
|
28
|
+
function applyContract(svc, fields, props, authored, cursor, send) {
|
|
29
|
+
if (Object.keys(fields).length === 0) return {
|
|
30
|
+
moved: false,
|
|
31
|
+
events: []
|
|
32
|
+
};
|
|
33
|
+
const parsed = props();
|
|
34
|
+
const context = svc.state.context;
|
|
35
|
+
const events = [];
|
|
36
|
+
let moved = false;
|
|
37
|
+
for (const [field, contract] of Object.entries(fields)) {
|
|
38
|
+
const raw = parsed[field];
|
|
39
|
+
if (raw === void 0 || raw === null) continue;
|
|
40
|
+
if (!authored(field)) continue;
|
|
41
|
+
if (Object.is(cursor.get(field), raw)) continue;
|
|
42
|
+
cursor.set(field, raw);
|
|
43
|
+
if (contract.event === void 0) {
|
|
44
|
+
const value = contract.parse === void 0 ? raw : contract.parse(raw);
|
|
45
|
+
if (context[field] !== value) {
|
|
46
|
+
svc.setContext({ [field]: value });
|
|
47
|
+
moved = true;
|
|
48
|
+
}
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const event = {
|
|
52
|
+
type: contract.event,
|
|
53
|
+
[field]: raw
|
|
54
|
+
};
|
|
55
|
+
events.push(event);
|
|
56
|
+
moved = true;
|
|
57
|
+
send(event);
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
moved,
|
|
61
|
+
events
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const sameWatch = (a, b) => a.length === b.length && a.every((value, index) => value === b[index]);
|
|
65
|
+
function defineComponent(def) {
|
|
66
|
+
const segments = /* @__PURE__ */ new Map();
|
|
67
|
+
for (const [key, partDef] of Object.entries(def.parts)) segments.set(key, partDef.id ?? key);
|
|
68
|
+
for (const [key, slotDef] of Object.entries(def.slots ?? {})) segments.set(key, slotDef.id ?? key);
|
|
69
|
+
const createBridge = (props, root = () => {
|
|
70
|
+
throw new Error("[spin] bridge needs a root element");
|
|
71
|
+
}, id) => {
|
|
72
|
+
if (def.machine === void 0) throw new Error(`[spin] ${def.name} has no machine`);
|
|
73
|
+
const owner = scope();
|
|
74
|
+
const lastContract = /* @__PURE__ */ new Map();
|
|
75
|
+
const lastWatched = /* @__PURE__ */ new Map();
|
|
76
|
+
const authored = authoredProps(props);
|
|
77
|
+
const names = ids(def.name, id);
|
|
78
|
+
const resolveId = (part, slot) => names(segments.get(part) ?? part, slot);
|
|
79
|
+
const focusPart = focuser(names);
|
|
80
|
+
const measurePart = measurer(names);
|
|
81
|
+
let machine;
|
|
82
|
+
const machineOf = () => {
|
|
83
|
+
if (machine !== void 0) return machine;
|
|
84
|
+
const resolved = resolveTwins(props(), authored);
|
|
85
|
+
const args = def.args === void 0 ? resolved : def.args(resolved);
|
|
86
|
+
machine = def.machine(args, authored);
|
|
87
|
+
return machine;
|
|
88
|
+
};
|
|
89
|
+
const refresh = (svc) => {
|
|
90
|
+
if (def.scalars === void 0 && def.scalarsOf === void 0) return false;
|
|
91
|
+
const parsed = props();
|
|
92
|
+
const writable = svc.state.context;
|
|
93
|
+
const patch = {};
|
|
94
|
+
if (def.scalarsOf !== void 0) {
|
|
95
|
+
const merge = def.scalarsOf(parsed, authored);
|
|
96
|
+
for (const [key, value] of Object.entries(merge)) if (writable[key] !== value) patch[key] = value;
|
|
97
|
+
} else for (const name of def.scalars ?? []) {
|
|
98
|
+
if (parsed[name] === null || parsed[name] === void 0) continue;
|
|
99
|
+
if (writable[name] !== parsed[name]) patch[name] = parsed[name];
|
|
100
|
+
}
|
|
101
|
+
if (Object.keys(patch).length === 0) return false;
|
|
102
|
+
svc.setContext(patch);
|
|
103
|
+
return true;
|
|
104
|
+
};
|
|
105
|
+
const readCallbacks = () => {
|
|
106
|
+
const raw = props();
|
|
107
|
+
const out = {};
|
|
108
|
+
for (const event of Object.values(def.events)) {
|
|
109
|
+
const found = pickCallback(raw, event.prop);
|
|
110
|
+
if (found !== void 0) out[event.prop] = found;
|
|
111
|
+
}
|
|
112
|
+
return out;
|
|
113
|
+
};
|
|
114
|
+
const notify = (svc, callbacks, kind, event, beforeSnapshot, parsed, source) => {
|
|
115
|
+
const context = svc.state.context;
|
|
116
|
+
const state = svc.state.value;
|
|
117
|
+
for (const [name, defEvent] of Object.entries(def.events)) {
|
|
118
|
+
if (defEvent.on === "commit" && kind !== "commit") continue;
|
|
119
|
+
const watched = defEvent.watch(context, state);
|
|
120
|
+
const last = lastWatched.get(name);
|
|
121
|
+
lastWatched.set(name, watched);
|
|
122
|
+
if (defEvent.select !== void 0) {
|
|
123
|
+
const before = beforeSnapshot?.context;
|
|
124
|
+
if (event === void 0 || before === void 0) continue;
|
|
125
|
+
const beforeState = beforeSnapshot?.state ?? state;
|
|
126
|
+
const payload = defEvent.select(event, before, context, {
|
|
127
|
+
was: beforeState,
|
|
128
|
+
is: state
|
|
129
|
+
}, source);
|
|
130
|
+
if (payload !== null) {
|
|
131
|
+
if (Array.isArray(payload)) for (const report of payload) callbacks[defEvent.prop]?.(report);
|
|
132
|
+
else callbacks[defEvent.prop]?.(payload);
|
|
133
|
+
}
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (defEvent.on !== "commit" && last !== void 0 && sameWatch(last, watched)) continue;
|
|
137
|
+
callbacks[defEvent.prop]?.(defEvent.detail(watched, event, parsed, context));
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
let service;
|
|
141
|
+
const transmit = (event) => {
|
|
142
|
+
const svc = ensureService();
|
|
143
|
+
refresh(svc);
|
|
144
|
+
const before = {
|
|
145
|
+
context: { ...svc.state.context },
|
|
146
|
+
state: svc.state.value
|
|
147
|
+
};
|
|
148
|
+
svc.send(event);
|
|
149
|
+
def.settled?.({
|
|
150
|
+
event,
|
|
151
|
+
before,
|
|
152
|
+
after: {
|
|
153
|
+
context: svc.state.context,
|
|
154
|
+
state: svc.state.value
|
|
155
|
+
},
|
|
156
|
+
props: props(),
|
|
157
|
+
root,
|
|
158
|
+
id: resolveId,
|
|
159
|
+
focus: focusPart,
|
|
160
|
+
measure: measurePart,
|
|
161
|
+
send: (report) => send(report)
|
|
162
|
+
});
|
|
163
|
+
return {
|
|
164
|
+
svc,
|
|
165
|
+
before
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
const send = (event) => {
|
|
169
|
+
const { svc, before } = transmit(event);
|
|
170
|
+
notify(svc, readCallbacks(), def.commitEvents?.includes(event.type) === true ? "commit" : "move", event, before, props());
|
|
171
|
+
};
|
|
172
|
+
const ensureService = () => {
|
|
173
|
+
if (service !== void 0) return service;
|
|
174
|
+
const startState = typeof def.start === "function" ? def.start(props(), authored) : def.start;
|
|
175
|
+
service = owner.run(() => {
|
|
176
|
+
const svc = interpret(machineOf()).start(startState);
|
|
177
|
+
refresh(svc);
|
|
178
|
+
return svc;
|
|
179
|
+
});
|
|
180
|
+
for (const event of def.establish?.(props(), authored) ?? []) transmit(event);
|
|
181
|
+
notify(service, {}, "move", void 0, void 0, props());
|
|
182
|
+
return service;
|
|
183
|
+
};
|
|
184
|
+
const dispatch = (event) => {
|
|
185
|
+
send(def.dispatch !== void 0 ? def.dispatch(event, props()) : event);
|
|
186
|
+
};
|
|
187
|
+
let api;
|
|
188
|
+
let mounted = false;
|
|
189
|
+
const ensureConnect = () => {
|
|
190
|
+
if (api !== void 0) return api;
|
|
191
|
+
const svc = ensureService();
|
|
192
|
+
const built = {};
|
|
193
|
+
for (const [name, command] of Object.entries(def.commands)) {
|
|
194
|
+
if (command.view !== void 0) {
|
|
195
|
+
const view = command.view;
|
|
196
|
+
built[name] = (...args) => view({
|
|
197
|
+
args,
|
|
198
|
+
id: resolveId,
|
|
199
|
+
focus: focusPart,
|
|
200
|
+
measure: measurePart,
|
|
201
|
+
root
|
|
202
|
+
});
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
const toEvent = command.event;
|
|
206
|
+
built[name] = (...args) => dispatch(toEvent(args, svc.state.context, resolveId));
|
|
207
|
+
}
|
|
208
|
+
for (const [name, reader] of Object.entries(def.readers ?? {})) Object.defineProperty(built, name, {
|
|
209
|
+
get: () => reader.read(svc.state.context, svc.state.value, props(), root),
|
|
210
|
+
enumerable: true
|
|
211
|
+
});
|
|
212
|
+
if (def.readers?.["state"] === void 0) Object.defineProperty(built, "state", {
|
|
213
|
+
get: () => svc.state.value,
|
|
214
|
+
enumerable: true
|
|
215
|
+
});
|
|
216
|
+
for (const [name, method] of Object.entries(def.methods ?? {})) built[name] = (...args) => method.call(svc.state.context, svc.state.value, args, props(), resolveId);
|
|
217
|
+
const liveProps = new Proxy({}, {
|
|
218
|
+
get: (_target, key) => props()[key],
|
|
219
|
+
has: (_target, key) => typeof key === "string" && key in props()
|
|
220
|
+
});
|
|
221
|
+
const viewFor = (slot) => {
|
|
222
|
+
const view = {
|
|
223
|
+
props: liveProps,
|
|
224
|
+
context: svc.state.context,
|
|
225
|
+
root,
|
|
226
|
+
id: resolveId,
|
|
227
|
+
measure: measurePart,
|
|
228
|
+
send: dispatch,
|
|
229
|
+
attr: dataAttr,
|
|
230
|
+
slot
|
|
231
|
+
};
|
|
232
|
+
Object.defineProperty(view, "state", {
|
|
233
|
+
get: () => svc.state.value,
|
|
234
|
+
enumerable: true
|
|
235
|
+
});
|
|
236
|
+
return view;
|
|
237
|
+
};
|
|
238
|
+
const baseView = viewFor(void 0);
|
|
239
|
+
const zeroArgBags = /* @__PURE__ */ new Map();
|
|
240
|
+
for (const [part, partDef] of Object.entries(def.parts)) {
|
|
241
|
+
const method = `get${part[0]?.toUpperCase() ?? ""}${part.slice(1)}Props`;
|
|
242
|
+
const segment = partDef.id ?? part;
|
|
243
|
+
built[method] = (...callArgs) => {
|
|
244
|
+
const raw = callArgs[0];
|
|
245
|
+
if (raw === void 0) {
|
|
246
|
+
let cached = zeroArgBags.get(part);
|
|
247
|
+
if (cached === void 0) {
|
|
248
|
+
const run = computed(() => ({
|
|
249
|
+
id: resolveId(part === "root" ? "" : part),
|
|
250
|
+
"data-scope": def.name,
|
|
251
|
+
"data-part": segment,
|
|
252
|
+
...partDef.attrs === void 0 ? {} : partDef.attrs(baseView, void 0)
|
|
253
|
+
}));
|
|
254
|
+
cached = () => run();
|
|
255
|
+
zeroArgBags.set(part, cached);
|
|
256
|
+
}
|
|
257
|
+
return cached();
|
|
258
|
+
}
|
|
259
|
+
const stamped = {
|
|
260
|
+
id: resolveId(part === "root" ? "" : part),
|
|
261
|
+
"data-scope": def.name,
|
|
262
|
+
"data-part": segment
|
|
263
|
+
};
|
|
264
|
+
if (partDef.attrs === void 0) return stamped;
|
|
265
|
+
return {
|
|
266
|
+
...stamped,
|
|
267
|
+
...partDef.attrs(raw === void 0 ? baseView : viewFor(raw), raw)
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
for (const [slotName, slotDef] of Object.entries(def.slots ?? {})) {
|
|
272
|
+
const cap = `${slotName[0]?.toUpperCase() ?? ""}${slotName.slice(1)}`;
|
|
273
|
+
const segment = slotDef.id ?? slotName;
|
|
274
|
+
built[`get${cap}Props`] = (slot, ...callArgs) => {
|
|
275
|
+
const attrs = slotDef.attrs(viewFor(slot), callArgs[0]);
|
|
276
|
+
if (slotDef.stamp === false) return attrs;
|
|
277
|
+
return {
|
|
278
|
+
"data-scope": def.name,
|
|
279
|
+
"data-part": segment,
|
|
280
|
+
...attrs
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
const indexesMemo = computed(() => slotDef.indexes(svc.state.context, props()));
|
|
284
|
+
built[`get${cap}Indexes`] = () => indexesMemo();
|
|
285
|
+
}
|
|
286
|
+
api = built;
|
|
287
|
+
if (!mounted) {
|
|
288
|
+
mounted = true;
|
|
289
|
+
def.mounted?.({
|
|
290
|
+
props: props(),
|
|
291
|
+
root,
|
|
292
|
+
id: resolveId,
|
|
293
|
+
focus: focusPart,
|
|
294
|
+
measure: measurePart
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
return api;
|
|
298
|
+
};
|
|
299
|
+
owner.run(() => effect(() => {
|
|
300
|
+
props();
|
|
301
|
+
untrack(() => {
|
|
302
|
+
const svc = ensureService();
|
|
303
|
+
const beforeContext = {
|
|
304
|
+
context: { ...svc.state.context },
|
|
305
|
+
state: svc.state.value
|
|
306
|
+
};
|
|
307
|
+
refresh(svc);
|
|
308
|
+
const syncResult = applyContract(svc, machineOf().fields, props, authored, lastContract, (event) => transmit(event));
|
|
309
|
+
const parsed = props();
|
|
310
|
+
const reconciled = [];
|
|
311
|
+
const derivedMoved = def.reconcile?.({
|
|
312
|
+
context: svc.state.context,
|
|
313
|
+
state: svc.state.value,
|
|
314
|
+
parsed,
|
|
315
|
+
authored,
|
|
316
|
+
send: (event) => {
|
|
317
|
+
const typed = event;
|
|
318
|
+
reconciled.push(typed);
|
|
319
|
+
transmit(typed);
|
|
320
|
+
}
|
|
321
|
+
}) ?? false;
|
|
322
|
+
const kindOf = (type) => def.commitEvents?.includes(type) === true ? "commit" : "move";
|
|
323
|
+
for (const event of syncResult.events) notify(svc, readCallbacks(), kindOf(event.type), event, beforeContext, props());
|
|
324
|
+
if (reconciled.length > 0) {
|
|
325
|
+
const last = reconciled[reconciled.length - 1];
|
|
326
|
+
if (last !== void 0) notify(svc, readCallbacks(), kindOf(last.type), last, beforeContext, props(), "reconcile");
|
|
327
|
+
}
|
|
328
|
+
if (syncResult.events.length === 0 && reconciled.length === 0 && derivedMoved) notify(svc, readCallbacks(), "commit", void 0, beforeContext, props());
|
|
329
|
+
});
|
|
330
|
+
}));
|
|
331
|
+
return {
|
|
332
|
+
api: new Proxy({}, {
|
|
333
|
+
get: (_target, key) => Reflect.get(ensureConnect(), key),
|
|
334
|
+
has: (_target, key) => Reflect.has(ensureConnect(), key),
|
|
335
|
+
ownKeys: () => Reflect.ownKeys(ensureConnect()),
|
|
336
|
+
getOwnPropertyDescriptor: (_target, key) => {
|
|
337
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(ensureConnect(), key);
|
|
338
|
+
if (descriptor === void 0) return void 0;
|
|
339
|
+
return {
|
|
340
|
+
...descriptor,
|
|
341
|
+
configurable: true
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
}),
|
|
345
|
+
dispose: () => {
|
|
346
|
+
service?.stop();
|
|
347
|
+
owner.dispose();
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
const events = {};
|
|
352
|
+
for (const [name, event] of Object.entries(def.events)) events[name] = {
|
|
353
|
+
on: event.prop,
|
|
354
|
+
detail: (change) => change
|
|
355
|
+
};
|
|
356
|
+
const fieldSet = new Set(def.scalars ?? []);
|
|
357
|
+
for (const event of Object.values(def.events)) fieldSet.add(event.prop);
|
|
358
|
+
if (def.machine !== void 0) try {
|
|
359
|
+
const probed = def.machine(def.args === void 0 ? {} : def.args({}), () => false);
|
|
360
|
+
for (const key of Object.keys(probed.fields)) fieldSet.add(key);
|
|
361
|
+
for (const key of Object.keys(probed.initialState.context)) fieldSet.add(key);
|
|
362
|
+
} catch {}
|
|
363
|
+
const manifest = {
|
|
364
|
+
parts: Object.keys(def.parts),
|
|
365
|
+
slots: Object.keys(def.slots ?? {}),
|
|
366
|
+
readers: [...Object.keys(def.readers ?? {}), "state"],
|
|
367
|
+
methods: Object.keys(def.methods ?? {}),
|
|
368
|
+
commands: Object.keys(def.commands ?? {}),
|
|
369
|
+
events: Object.keys(def.events ?? {})
|
|
370
|
+
};
|
|
371
|
+
const component = (_args) => {
|
|
372
|
+
throw new Error(`[spin] ${def.name}() is a <script> binding compiled by spin-components; use ${def.name}.createBridge() for imperative bridges`);
|
|
373
|
+
};
|
|
374
|
+
Object.defineProperty(component, "name", { value: def.name });
|
|
375
|
+
return Object.assign(component, {
|
|
376
|
+
fields: [...fieldSet],
|
|
377
|
+
createBridge,
|
|
378
|
+
commands: Object.keys(def.commands),
|
|
379
|
+
events,
|
|
380
|
+
manifest
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
export { authoredProps, defineComponent, pickCallback, textProp };
|
|
384
|
+
|
|
385
|
+
//# sourceMappingURL=synthesize.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reactive primitives alien-signals does not ship: `batch`, `untrack`, and
|
|
3
|
+
* a `scope` whose `dispose` reaches every effect created under its `run`.
|
|
4
|
+
*
|
|
5
|
+
* The cascade is the point: a binding that outlives its element writes into
|
|
6
|
+
* detached DOM and throws nothing, so `dispose` has to be exhaustive.
|
|
7
|
+
*/
|
|
8
|
+
import { computed, effect, signal, trigger } from "alien-signals";
|
|
9
|
+
/** A readable-and-writable value. */
|
|
10
|
+
export type Signal<T> = {
|
|
11
|
+
(): T;
|
|
12
|
+
(value: T): void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Run `fn` with writes deferred, then flush once.
|
|
16
|
+
*
|
|
17
|
+
* Every write inside `fn` schedules the same flush, so an effect that reads
|
|
18
|
+
* three of them still runs exactly once.
|
|
19
|
+
*/
|
|
20
|
+
export declare function batch<T>(fn: () => T): T;
|
|
21
|
+
/**
|
|
22
|
+
* Read without subscribing.
|
|
23
|
+
*
|
|
24
|
+
* Reads made inside `fn` are invisible to the surrounding effect, which is how
|
|
25
|
+
* a binding renders a value it must not be woken by.
|
|
26
|
+
*/
|
|
27
|
+
export declare function untrack<T>(fn: () => T): T;
|
|
28
|
+
/** A unit of ownership: work created under `run` dies with `dispose`. */
|
|
29
|
+
export interface OwnerScope {
|
|
30
|
+
/** Runs `fn` with this scope active, so what it creates is owned here. */
|
|
31
|
+
run<T>(fn: () => T): T;
|
|
32
|
+
/** Registers teardown to run at `dispose`. */
|
|
33
|
+
own(dispose: () => void): void;
|
|
34
|
+
/** Tears down everything created under `run`, plus everything `own`ed. */
|
|
35
|
+
dispose(): void;
|
|
36
|
+
/** The scope this one was created within, if any. */
|
|
37
|
+
readonly parent: OwnerScope | undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The object form of alien-signals' `effectScope`.
|
|
41
|
+
*
|
|
42
|
+
* `run` may be called any number of times; each call opens its own group and
|
|
43
|
+
* the group's effects die with the scope. Teardown runs newest-first, so an
|
|
44
|
+
* inner resource is released before the outer one it was built on, and effects
|
|
45
|
+
* go before `own`ed teardown — a binding's last run should not be able to
|
|
46
|
+
* write into a node the teardown has already removed.
|
|
47
|
+
*/
|
|
48
|
+
export declare function scope(parent?: OwnerScope | undefined): OwnerScope;
|
|
49
|
+
/**
|
|
50
|
+
* Registers teardown with the scope currently running.
|
|
51
|
+
*
|
|
52
|
+
* The standalone spelling of `scope.own`, for code inside `run` that does not
|
|
53
|
+
* hold the scope. Outside a scope there is nothing to defer the teardown to,
|
|
54
|
+
* and silently dropping it would leak, so this throws instead.
|
|
55
|
+
*/
|
|
56
|
+
export declare function own(dispose: () => void): void;
|
|
57
|
+
export { computed, effect, signal, trigger };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { computed, effect, effectScope, endBatch, setActiveSub, signal, startBatch, trigger } from "alien-signals";
|
|
2
|
+
// src/runtime/core/signal.ts
|
|
3
|
+
/**
|
|
4
|
+
* The reactive primitives alien-signals does not ship: `batch`, `untrack`, and
|
|
5
|
+
* a `scope` whose `dispose` reaches every effect created under its `run`.
|
|
6
|
+
*
|
|
7
|
+
* The cascade is the point: a binding that outlives its element writes into
|
|
8
|
+
* detached DOM and throws nothing, so `dispose` has to be exhaustive.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Run `fn` with writes deferred, then flush once.
|
|
12
|
+
*
|
|
13
|
+
* Every write inside `fn` schedules the same flush, so an effect that reads
|
|
14
|
+
* three of them still runs exactly once.
|
|
15
|
+
*/
|
|
16
|
+
function batch(fn) {
|
|
17
|
+
startBatch();
|
|
18
|
+
try {
|
|
19
|
+
return fn();
|
|
20
|
+
} finally {
|
|
21
|
+
endBatch();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Read without subscribing.
|
|
26
|
+
*
|
|
27
|
+
* Reads made inside `fn` are invisible to the surrounding effect, which is how
|
|
28
|
+
* a binding renders a value it must not be woken by.
|
|
29
|
+
*/
|
|
30
|
+
function untrack(fn) {
|
|
31
|
+
const prevSub = setActiveSub(void 0);
|
|
32
|
+
try {
|
|
33
|
+
return fn();
|
|
34
|
+
} finally {
|
|
35
|
+
setActiveSub(prevSub);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** The scope whose `run` is currently executing, if any. */
|
|
39
|
+
let activeScope;
|
|
40
|
+
/**
|
|
41
|
+
* The object form of alien-signals' `effectScope`.
|
|
42
|
+
*
|
|
43
|
+
* `run` may be called any number of times; each call opens its own group and
|
|
44
|
+
* the group's effects die with the scope. Teardown runs newest-first, so an
|
|
45
|
+
* inner resource is released before the outer one it was built on, and effects
|
|
46
|
+
* go before `own`ed teardown — a binding's last run should not be able to
|
|
47
|
+
* write into a node the teardown has already removed.
|
|
48
|
+
*/
|
|
49
|
+
function scope(parent = activeScope) {
|
|
50
|
+
const groups = [];
|
|
51
|
+
const teardowns = [];
|
|
52
|
+
let disposed = false;
|
|
53
|
+
const self = {
|
|
54
|
+
parent,
|
|
55
|
+
run(fn) {
|
|
56
|
+
if (disposed) throw new Error("scope.run: the scope is disposed");
|
|
57
|
+
const prevScope = activeScope;
|
|
58
|
+
activeScope = self;
|
|
59
|
+
try {
|
|
60
|
+
let value;
|
|
61
|
+
groups.push(effectScope(() => {
|
|
62
|
+
value = fn();
|
|
63
|
+
}));
|
|
64
|
+
return value;
|
|
65
|
+
} finally {
|
|
66
|
+
activeScope = prevScope;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
own(dispose) {
|
|
70
|
+
if (disposed) {
|
|
71
|
+
dispose();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
teardowns.push(dispose);
|
|
75
|
+
},
|
|
76
|
+
dispose() {
|
|
77
|
+
if (disposed) return;
|
|
78
|
+
disposed = true;
|
|
79
|
+
for (let i = groups.length - 1; i >= 0; i--) groups[i]?.();
|
|
80
|
+
groups.length = 0;
|
|
81
|
+
for (let i = teardowns.length - 1; i >= 0; i--) teardowns[i]?.();
|
|
82
|
+
teardowns.length = 0;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
return self;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Registers teardown with the scope currently running.
|
|
89
|
+
*
|
|
90
|
+
* The standalone spelling of `scope.own`, for code inside `run` that does not
|
|
91
|
+
* hold the scope. Outside a scope there is nothing to defer the teardown to,
|
|
92
|
+
* and silently dropping it would leak, so this throws instead.
|
|
93
|
+
*/
|
|
94
|
+
function own(dispose) {
|
|
95
|
+
if (activeScope === void 0) throw new Error("own: called outside of scope.run");
|
|
96
|
+
activeScope.own(dispose);
|
|
97
|
+
}
|
|
98
|
+
export { batch, computed, effect, own, scope, signal, trigger, untrack };
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=signal.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one style serializer the runtime ships.
|
|
3
|
+
*
|
|
4
|
+
* `{ backgroundColor: "red" }` → `"background-color:red;"`. Custom properties
|
|
5
|
+
* pass through untouched: their case IS their name, and a `--camelCased`
|
|
6
|
+
* property is a different property. Everything else is camelCase, because the
|
|
7
|
+
* values arrive from JS-side bindings.
|
|
8
|
+
*
|
|
9
|
+
* The string is written to `style` — never to a `style` attribute: the IDL
|
|
10
|
+
* path composes, while an attribute write replaces every declaration the
|
|
11
|
+
* theme, a utility, or an animation put there.
|
|
12
|
+
*/
|
|
13
|
+
/** `{ backgroundColor: "red" }` → `"background-color:red;"`. */
|
|
14
|
+
export declare function toStyleString(style: Record<string, unknown>): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/runtime/core/style.ts
|
|
2
|
+
/**
|
|
3
|
+
* The one style serializer the runtime ships.
|
|
4
|
+
*
|
|
5
|
+
* `{ backgroundColor: "red" }` → `"background-color:red;"`. Custom properties
|
|
6
|
+
* pass through untouched: their case IS their name, and a `--camelCased`
|
|
7
|
+
* property is a different property. Everything else is camelCase, because the
|
|
8
|
+
* values arrive from JS-side bindings.
|
|
9
|
+
*
|
|
10
|
+
* The string is written to `style` — never to a `style` attribute: the IDL
|
|
11
|
+
* path composes, while an attribute write replaces every declaration the
|
|
12
|
+
* theme, a utility, or an animation put there.
|
|
13
|
+
*/
|
|
14
|
+
/** `{ backgroundColor: "red" }` → `"background-color:red;"`. */
|
|
15
|
+
function toStyleString(style) {
|
|
16
|
+
let out = "";
|
|
17
|
+
for (const key in style) {
|
|
18
|
+
const value = style[key];
|
|
19
|
+
if (value === null || value === void 0) continue;
|
|
20
|
+
if (!key.startsWith("--")) {
|
|
21
|
+
const dashed = key.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
22
|
+
out += `${dashed}:${value};`;
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
out += `${key}:${value};`;
|
|
26
|
+
}
|
|
27
|
+
return out;
|
|
28
|
+
}
|
|
29
|
+
export { toStyleString };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type Signal<T> = {
|
|
2
|
+
(): T;
|
|
3
|
+
(value: T): void;
|
|
4
|
+
};
|
|
5
|
+
export declare function bindText(node: Text, get: () => unknown): void;
|
|
6
|
+
/** The class a markup's class attribute holds.
|
|
7
|
+
*
|
|
8
|
+
* The attribute takes the shape the markup reads best: a list of parts,
|
|
9
|
+
* where a part is a string of classes or an object of conditions.
|
|
10
|
+
*
|
|
11
|
+
* class={["mb-4 text-sm text-muted", { "bg-primary": focused }]}
|
|
12
|
+
*
|
|
13
|
+
* A string is the classes themselves — plain text, so the build's
|
|
14
|
+
* extractor sees them as they are. An object's keys are the classes and
|
|
15
|
+
* its values the conditions; a key whose value is truthy is in.
|
|
16
|
+
*
|
|
17
|
+
* The values are live reads, so the class follows the state.
|
|
18
|
+
*/
|
|
19
|
+
export declare function classOf(classes: unknown): string;
|
|
20
|
+
export declare function bindAttr(el: Element, name: string, get: () => unknown): void;
|
|
21
|
+
export declare function bindProp(el: Element, name: string, get: () => unknown): void;
|
|
22
|
+
export declare function bindDynamic(el: Element, name: string, get: () => unknown): void;
|
|
23
|
+
export interface Writable<T> {
|
|
24
|
+
(): T;
|
|
25
|
+
set(next: T): void;
|
|
26
|
+
}
|
|
27
|
+
export interface Binding {
|
|
28
|
+
pull(): void;
|
|
29
|
+
stop(): void;
|
|
30
|
+
}
|
|
31
|
+
export declare function bindValue(el: Element, source: Writable<string>): Binding;
|
|
32
|
+
export declare function bindChecked(el: HTMLInputElement, source: Writable<boolean>): Binding;
|
|
33
|
+
export declare function projectSlots(el: HTMLElement): Map<string, Node[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Places assigned nodes (moved, never cloned — state and listeners travel)
|
|
36
|
+
* before `anchor`, or the fallback nodes when nothing was assigned.
|
|
37
|
+
*/
|
|
38
|
+
export declare function placeSlot(host: Node, anchor: Comment, assigned: Node[] | undefined, fallback: Node[]): void;
|