@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,11 @@
|
|
|
1
|
+
export declare function tpl<T extends Element>(html: string): () => T;
|
|
2
|
+
export interface Rendered {
|
|
3
|
+
readonly node: Node;
|
|
4
|
+
update(): void;
|
|
5
|
+
}
|
|
6
|
+
export declare function view(parts: (() => void)[], nodes: readonly Node[]): Rendered;
|
|
7
|
+
export interface ReactiveText {
|
|
8
|
+
readonly node: Text;
|
|
9
|
+
set(value: string): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function text(initial?: string): ReactiveText;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/runtime/directives/tpl.ts
|
|
2
|
+
function tpl(html) {
|
|
3
|
+
let proto;
|
|
4
|
+
return () => {
|
|
5
|
+
if (proto === void 0) {
|
|
6
|
+
const t = document.createElement("template");
|
|
7
|
+
t.innerHTML = html;
|
|
8
|
+
proto = t.content.firstElementChild;
|
|
9
|
+
}
|
|
10
|
+
return proto.cloneNode(true);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function view(parts, nodes) {
|
|
14
|
+
const host = document.createDocumentFragment();
|
|
15
|
+
for (const n of nodes) host.appendChild(n);
|
|
16
|
+
const rendered = {
|
|
17
|
+
node: host,
|
|
18
|
+
update() {
|
|
19
|
+
const n = parts.length;
|
|
20
|
+
for (let i = 0; i < n; i++) parts[i]();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
rendered.update();
|
|
24
|
+
return rendered;
|
|
25
|
+
}
|
|
26
|
+
function text(initial = "") {
|
|
27
|
+
const node = document.createTextNode(initial);
|
|
28
|
+
return {
|
|
29
|
+
node,
|
|
30
|
+
set(value) {
|
|
31
|
+
const next = String(value);
|
|
32
|
+
if (node.data === next) return;
|
|
33
|
+
node.data = next;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export { text, tpl, view };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=tpl.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Signal<T> = {
|
|
2
|
+
(): T;
|
|
3
|
+
(value: T): void;
|
|
4
|
+
};
|
|
5
|
+
export interface ActionResult<P = unknown> {
|
|
6
|
+
update?(param: P): void;
|
|
7
|
+
destroy?(): void;
|
|
8
|
+
}
|
|
9
|
+
export type ElementAction<P = unknown> = (node: Element, param: P) => ActionResult<P> | void;
|
|
10
|
+
export declare function createAction<P>(fn: ElementAction<P>): ElementAction<P>;
|
|
11
|
+
export declare function runAction<P>(node: Element, action: ElementAction<P> | null | undefined, paramThunk?: () => P): void;
|
|
12
|
+
export type SlotLookup = (name: string) => Node[];
|
|
13
|
+
export declare function on<E extends Event = Event>(el: EventTarget, event: string, handler: (e: E) => void): () => void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { effect, own, untrack } from "../core/signal.js";
|
|
2
|
+
// src/runtime/directives/use.ts
|
|
3
|
+
function createAction(fn) {
|
|
4
|
+
return (node, param) => untrack(() => fn(node, param) ?? void 0);
|
|
5
|
+
}
|
|
6
|
+
function runAction(node, action, paramThunk) {
|
|
7
|
+
if (typeof action !== "function") return;
|
|
8
|
+
let result;
|
|
9
|
+
let started = false;
|
|
10
|
+
effect(() => {
|
|
11
|
+
const param = paramThunk === void 0 ? void 0 : paramThunk();
|
|
12
|
+
if (!started) {
|
|
13
|
+
started = true;
|
|
14
|
+
result = action(node, param) ?? void 0;
|
|
15
|
+
} else result?.update?.(param);
|
|
16
|
+
});
|
|
17
|
+
own(() => {
|
|
18
|
+
result?.destroy?.();
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function on(el, event, handler) {
|
|
22
|
+
const wrapped = (e) => {
|
|
23
|
+
handler(e);
|
|
24
|
+
};
|
|
25
|
+
el.addEventListener(event, wrapped);
|
|
26
|
+
const stop = () => el.removeEventListener(event, wrapped);
|
|
27
|
+
try {
|
|
28
|
+
own(stop);
|
|
29
|
+
} catch {}
|
|
30
|
+
return stop;
|
|
31
|
+
}
|
|
32
|
+
export { createAction, on, runAction };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=use.js.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { OwnerScope, Signal, batch, computed, effect, own, scope, signal, trigger, untrack } from "./core/signal.js";
|
|
2
|
+
import { AttributeParser, BuildContext, ElementSpec, attrParsers, define, scopeOf, uniqueId, writeProp } from "./scope/element.js";
|
|
3
|
+
import { IdFn, focuser, ids, measurer } from "./component/ids.js";
|
|
4
|
+
import { coerceBool, coerceInt, coerceJsonArray, coerceList, coerceObjectArrayItems, coerceString, defaultTwin, isRecord, resolveTwins } from "./props.js";
|
|
5
|
+
import { DefinedComponent, authoredProps, defineComponent, pickCallback, textProp } from "./component/synthesize.js";
|
|
6
|
+
import { clampValue, closestIndex, getNextStepValue, getPercentValue, getPreviousStepValue, getValuePercent, getValueRanges, isInteractive, round10, snapValueToStep } from "./math/numbers.js";
|
|
7
|
+
import { AnyEvent, ApiOf, CommandDef, ComponentDef, EventDef, PartDef, PartView, PropParser, SlotDef, SlotView, SlotViewFor, ViewFor, dataAttr, isComposing } from "./component/define.js";
|
|
8
|
+
import { Handle, ScopeTable, SpinController, consume, controllerOf, controllerView, createScopeTable, provideController } from "./scope/table.js";
|
|
9
|
+
import { ElementAction, SlotLookup, createAction, on, runAction } from "./directives/use.js";
|
|
10
|
+
import { Binding, Writable, bindAttr, bindChecked, bindDynamic, bindProp, bindText, bindValue, classOf, placeSlot, projectSlots } from "./directives/bind.js";
|
|
11
|
+
import { BindForOptions, RenderedItem, bindFor } from "./directives/for.js";
|
|
12
|
+
import { BindIfOptions, BranchRender, bindIf } from "./directives/if.js";
|
|
13
|
+
import { ReactiveText, Rendered, text, tpl, view } from "./directives/tpl.js";
|
|
14
|
+
import { AriaAutocomplete, AriaCurrent, AriaFragment, AriaHasPopup, AriaLive, AriaOrientation, AriaPartRef, AriaState, AriaTarget, AriaValue, ariaAutocomplete, ariaBusy, ariaControls, ariaCurrent, ariaDescribedBy, ariaDescription, ariaDisabled, ariaFlag, ariaHidden, ariaInvalid, ariaLabelledBy, ariaOrientation, ariaOwns, ariaPressed, ariaReadOnly, ariaRequired, ariaRoleDescription, ariaState, comboboxInput, disclosureTrigger, listSurface, liveRegion, optionRow, sliderThumb } from "./aria.js";
|
|
15
|
+
import { matchBrace, skipQuoted } from "./syntax/braces.js";
|
|
16
|
+
import { CodeToken, CodeTokenType, formatExampleHtml, tokenizeHtml } from "./syntax/display.js";
|
|
17
|
+
import { expandVariantGroups } from "./syntax/expand-groups.js";
|
|
18
|
+
import { ActionUse, Attr, AttrValue, ComponentIr, Diagnostic, ElementNode, EventBinding, ForNode, Node, ParseError, SpreadUse, TextNode } from "./syntax/ir.js";
|
|
19
|
+
import { classAttrOf, classTokens, classTokensOf } from "./syntax/classes.js";
|
|
20
|
+
import { ScriptCall, ScriptConsume, StrippedScript, extractScript, stripScript } from "./syntax/script-block.js";
|
|
21
|
+
import { parse } from "./syntax/parse.js";
|
|
22
|
+
import { LoaderActions, LoaderScope, load } from "./directives/load.js";
|
|
23
|
+
import { bindActionProps, bindSpread } from "./directives/spread.js";
|
|
24
|
+
import { Assign, AssignFor, Config, EventMap, EventName, EventNames, EventObject, EventOf, EventUnion, GuardFor, Machine, MachineSpec, Service, State, Transition, Transitions, createMachine, interpret } from "./machine/fsm/machine.js";
|
|
25
|
+
/**
|
|
26
|
+
* The machine-def contract: what a `<name>.machine-def.ts` module provides.
|
|
27
|
+
*
|
|
28
|
+
* `machine` + `connect` are Zag's pair, opaque here — the runtime never
|
|
29
|
+
* imports Zag. `events` is the authored out-side: each CustomEvent name maps
|
|
30
|
+
* to the Zag callback prop that fires it and the detail mapper. The plugin
|
|
31
|
+
* codegen turns each entry into a machine prop that dispatches on `el`.
|
|
32
|
+
* A misspelled `on` never fires, so machine-defs annotate against this
|
|
33
|
+
* rather than widening to `unknown`.
|
|
34
|
+
*/
|
|
35
|
+
export interface MachineEventContract<TDetail = unknown> {
|
|
36
|
+
/** The Zag callback prop name, e.g. `onValueChange`. */
|
|
37
|
+
readonly on: string;
|
|
38
|
+
/**
|
|
39
|
+
* Maps Zag's callback payload to the event's `detail`. `any` in, typed
|
|
40
|
+
* out: Zag's payload shapes are per-machine and untyped at this seam,
|
|
41
|
+
* so the mapper narrows and the event carries the narrowed type.
|
|
42
|
+
*/
|
|
43
|
+
readonly detail: (change: any) => TDetail;
|
|
44
|
+
}
|
|
45
|
+
export interface MachineDef {
|
|
46
|
+
/**
|
|
47
|
+
* Builds the bridge from scope props, the element root, and the machine
|
|
48
|
+
* id. Props arrive as a live reader (the element's prop store), never a
|
|
49
|
+
* snapshot. The returned api is what the markup spreads and what commands
|
|
50
|
+
* and element getters forward to.
|
|
51
|
+
*/
|
|
52
|
+
readonly createBridge: (props: () => Record<string, unknown>, root: () => Element, id: string) => {
|
|
53
|
+
readonly api: object;
|
|
54
|
+
dispose(): void;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Imperative commands the host (or a controller) may call on the element:
|
|
58
|
+
* `el[name](...args)` forwards to `api[name]`. Declared, not reflected, so
|
|
59
|
+
* the element's surface is authored — no machine method can accidentally
|
|
60
|
+
* shadow a DOM API by being copied over.
|
|
61
|
+
*/
|
|
62
|
+
readonly commands?: readonly string[];
|
|
63
|
+
/**
|
|
64
|
+
* Authored out-side: each CustomEvent name maps to a callback prop the
|
|
65
|
+
* bridge reports through and the detail mapper. The plugin codegen turns
|
|
66
|
+
* each entry into a machine prop that dispatches on `el`. A misspelled
|
|
67
|
+
* `on` never fires, so machine-defs annotate against this rather than
|
|
68
|
+
* widening to `unknown`.
|
|
69
|
+
*/
|
|
70
|
+
readonly events?: Readonly<Record<string, MachineEventContract>>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The platform-tier def: a thin layer over what the browser already does.
|
|
74
|
+
*
|
|
75
|
+
* Same slot as a MachineDef — markup `consume`s it the same way, commands
|
|
76
|
+
* install the same way, events map the same way, and the app-controller
|
|
77
|
+
* surface is identical. The difference is only who owns the state: here the
|
|
78
|
+
* platform does, and `attach` wires the native behavior to the declared
|
|
79
|
+
* commands and events. This is the progressive-enhancement tier: no machine,
|
|
80
|
+
* no bridge machinery, just the adapter that makes the platform's controller
|
|
81
|
+
* look like ours.
|
|
82
|
+
*/
|
|
83
|
+
export interface ControllerDef {
|
|
84
|
+
/** Wires the element's native behavior; returns the api markup spreads. */
|
|
85
|
+
attach(el: Element): object;
|
|
86
|
+
/** Commands the element installs, as with a machine def. */
|
|
87
|
+
readonly commands?: readonly string[];
|
|
88
|
+
/** Authored events, as with a machine def. */
|
|
89
|
+
readonly events?: Readonly<Record<string, MachineEventContract>>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Build a platform-tier controller def that is also callable in `<script>`:
|
|
93
|
+
* the call typechecks the markup's binding (`const ctl = popover()`), while
|
|
94
|
+
* the compiler wires the live element through `attach(el)`.
|
|
95
|
+
*/
|
|
96
|
+
export declare function defineController<Api extends object>(def: ControllerDef & {
|
|
97
|
+
attach(el: Element): Api;
|
|
98
|
+
}): ControllerDef & {
|
|
99
|
+
attach(el: Element): Api;
|
|
100
|
+
} & (() => Api);
|
|
101
|
+
export { type ActionUse, type AnyEvent, type ApiOf, type AriaAutocomplete, type AriaCurrent, type AriaFragment, type AriaHasPopup, type AriaLive, type AriaOrientation, type AriaPartRef, type AriaState, type AriaTarget, type AriaValue, type Assign, type AssignFor, type Attr, type AttrValue, type AttributeParser, type BindForOptions, type BindIfOptions, type Binding, type BranchRender, type BuildContext, type CodeToken, type CodeTokenType, type CommandDef, type ComponentDef, type ComponentIr, type Config, type DefinedComponent, type Diagnostic, type ElementAction, type ElementNode, type ElementSpec, type EventBinding, type EventDef, type EventMap, type EventName, type EventNames, type EventObject, type EventOf, type EventUnion, type ForNode, type GuardFor, type Handle, type IdFn, type LoaderActions, type LoaderScope, type Machine, type MachineSpec, type Node, type OwnerScope, ParseError, type PartDef, type PartView, type PropParser, type ReactiveText, type Rendered, type RenderedItem, type ScopeTable, type ScriptCall, type ScriptConsume, type Service, type Signal, type SlotDef, type SlotLookup, type SlotView, type SlotViewFor, type SpinController, type SpreadUse, type State, type StrippedScript, type TextNode, type Transition, type Transitions, type ViewFor, type Writable, ariaAutocomplete, ariaBusy, ariaControls, ariaCurrent, ariaDescribedBy, ariaDescription, ariaDisabled, ariaFlag, ariaHidden, ariaInvalid, ariaLabelledBy, ariaOrientation, ariaOwns, ariaPressed, ariaReadOnly, ariaRequired, ariaRoleDescription, ariaState, attrParsers, authoredProps, batch, bindActionProps, bindAttr, bindChecked, bindDynamic, bindFor, bindIf, bindProp, bindSpread, bindText, bindValue, clampValue, classAttrOf, classOf, classTokens, classTokensOf, closestIndex, coerceBool, coerceInt, coerceJsonArray, coerceList, coerceObjectArrayItems, coerceString, comboboxInput, computed, consume, controllerOf, controllerView, createAction, createMachine, createScopeTable, dataAttr, defaultTwin, define, defineComponent, disclosureTrigger, effect, expandVariantGroups, extractScript, focuser, formatExampleHtml, getNextStepValue, getPercentValue, getPreviousStepValue, getValuePercent, getValueRanges, ids, interpret, isComposing, isInteractive, isRecord, listSurface, liveRegion, load, matchBrace, measurer, on, optionRow, own, parse, pickCallback, placeSlot, projectSlots, provideController, resolveTwins, round10, runAction, scope, scopeOf, signal, skipQuoted, sliderThumb, snapValueToStep, stripScript, text, textProp, tokenizeHtml, tpl, trigger, uniqueId, untrack, view, writeProp };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { batch, computed, effect, own, scope, signal, trigger, untrack } from "./core/signal.js";
|
|
2
|
+
import { attrParsers, define, scopeOf, uniqueId, writeProp } from "./scope/element.js";
|
|
3
|
+
import { focuser, ids, measurer } from "./component/ids.js";
|
|
4
|
+
import { coerceBool, coerceInt, coerceJsonArray, coerceList, coerceObjectArrayItems, coerceString, defaultTwin, isRecord, resolveTwins } from "./props.js";
|
|
5
|
+
import { authoredProps, defineComponent, pickCallback, textProp } from "./component/synthesize.js";
|
|
6
|
+
import "./math/index.js";
|
|
7
|
+
import { dataAttr, isComposing } from "./component/define.js";
|
|
8
|
+
import { consume, controllerOf, controllerView, createScopeTable, provideController } from "./scope/table.js";
|
|
9
|
+
import { createAction, on, runAction } from "./directives/use.js";
|
|
10
|
+
import { bindAttr, bindChecked, bindDynamic, bindProp, bindText, bindValue, classOf, placeSlot, projectSlots } from "./directives/bind.js";
|
|
11
|
+
import { bindFor } from "./directives/for.js";
|
|
12
|
+
import { bindIf } from "./directives/if.js";
|
|
13
|
+
import { text, tpl, view } from "./directives/tpl.js";
|
|
14
|
+
import { ariaAutocomplete, ariaBusy, ariaControls, ariaCurrent, ariaDescribedBy, ariaDescription, ariaDisabled, ariaFlag, ariaHidden, ariaInvalid, ariaLabelledBy, ariaOrientation, ariaOwns, ariaPressed, ariaReadOnly, ariaRequired, ariaRoleDescription, ariaState, comboboxInput, disclosureTrigger, listSurface, liveRegion, optionRow, sliderThumb } from "./aria.js";
|
|
15
|
+
import { matchBrace, skipQuoted } from "./syntax/braces.js";
|
|
16
|
+
import { formatExampleHtml, tokenizeHtml } from "./syntax/display.js";
|
|
17
|
+
import { expandVariantGroups } from "./syntax/expand-groups.js";
|
|
18
|
+
import { classAttrOf, classTokens, classTokensOf } from "./syntax/classes.js";
|
|
19
|
+
import { extractScript, stripScript } from "./syntax/script-block.js";
|
|
20
|
+
import { ParseError } from "./syntax/ir.js";
|
|
21
|
+
import { parse } from "./syntax/parse.js";
|
|
22
|
+
import { load } from "./directives/load.js";
|
|
23
|
+
import { bindActionProps, bindSpread } from "./directives/spread.js";
|
|
24
|
+
import { clampValue, closestIndex, getNextStepValue, getPercentValue, getPreviousStepValue, getValuePercent, getValueRanges, isInteractive, round10, snapValueToStep } from "./math/numbers.js";
|
|
25
|
+
import { createMachine, interpret } from "./machine/fsm/machine.js";
|
|
26
|
+
// src/runtime/index.ts
|
|
27
|
+
/**
|
|
28
|
+
* Build a platform-tier controller def that is also callable in `<script>`:
|
|
29
|
+
* the call typechecks the markup's binding (`const ctl = popover()`), while
|
|
30
|
+
* the compiler wires the live element through `attach(el)`.
|
|
31
|
+
*/
|
|
32
|
+
function defineController(def) {
|
|
33
|
+
const callable = () => {
|
|
34
|
+
throw new Error("[spin] controller() is a <script> binding compiled by spin-components; the element wires attach(el)");
|
|
35
|
+
};
|
|
36
|
+
return Object.assign(callable, def);
|
|
37
|
+
}
|
|
38
|
+
export { ParseError, ariaAutocomplete, ariaBusy, ariaControls, ariaCurrent, ariaDescribedBy, ariaDescription, ariaDisabled, ariaFlag, ariaHidden, ariaInvalid, ariaLabelledBy, ariaOrientation, ariaOwns, ariaPressed, ariaReadOnly, ariaRequired, ariaRoleDescription, ariaState, attrParsers, authoredProps, batch, bindActionProps, bindAttr, bindChecked, bindDynamic, bindFor, bindIf, bindProp, bindSpread, bindText, bindValue, clampValue, classAttrOf, classOf, classTokens, classTokensOf, closestIndex, coerceBool, coerceInt, coerceJsonArray, coerceList, coerceObjectArrayItems, coerceString, comboboxInput, computed, consume, controllerOf, controllerView, createAction, createMachine, createScopeTable, dataAttr, defaultTwin, define, defineComponent, defineController, disclosureTrigger, effect, expandVariantGroups, extractScript, focuser, formatExampleHtml, getNextStepValue, getPercentValue, getPreviousStepValue, getValuePercent, getValueRanges, ids, interpret, isComposing, isInteractive, isRecord, listSurface, liveRegion, load, matchBrace, measurer, on, optionRow, own, parse, pickCallback, placeSlot, projectSlots, provideController, resolveTwins, round10, runAction, scope, scopeOf, signal, skipQuoted, sliderThumb, snapValueToStep, stripScript, text, textProp, tokenizeHtml, tpl, trigger, uniqueId, untrack, view, writeProp };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The state machine core: a config-first FSM, forked from @xstate/fsm 2.1.0
|
|
3
|
+
* (MIT, © Stately, https://github.com/statelyai/xstate).
|
|
4
|
+
*
|
|
5
|
+
* The machine is HEADLESS: state, transitions, and its own arguments. It
|
|
6
|
+
* knows nothing about props, markup, or the DOM.
|
|
7
|
+
*
|
|
8
|
+
* Why fork rather than depend: the package is correct, tiny, MIT, and the
|
|
9
|
+
* last stable was published in 2023 — a frozen base is a solid foundation
|
|
10
|
+
* and a poor dependency. This fork adapts it to this runtime's needs and
|
|
11
|
+
* keeps the config shape agents and the studio know:
|
|
12
|
+
*
|
|
13
|
+
* const machine = createMachine({
|
|
14
|
+
* initial: "idle",
|
|
15
|
+
* context: { value: [] },
|
|
16
|
+
* states: {
|
|
17
|
+
* idle: { on: {
|
|
18
|
+
* TOGGLE: [
|
|
19
|
+
* { cond: "isOpen", actions: [{ assign: "collapse" }] },
|
|
20
|
+
* { actions: [{ assign: "expand" }] },
|
|
21
|
+
* ],
|
|
22
|
+
* } },
|
|
23
|
+
* },
|
|
24
|
+
* }, { conds: {...}, assigns: {...}, actions: {...} });
|
|
25
|
+
*
|
|
26
|
+
* Transition resolution is PURE (`machine.transition`), and `interpret`
|
|
27
|
+
* executes the resolved actions. The delta from upstream, all deliberate:
|
|
28
|
+
*
|
|
29
|
+
* 1. **Named conds and assigns.** `cond: "name"` resolves from
|
|
30
|
+
* `implementations.conds`; `{ assign: "name" }` from
|
|
31
|
+
* `implementations.assigns`. Upstream allows only inline functions, which
|
|
32
|
+
* puts code inside the config — the config is meant to be data for the
|
|
33
|
+
* studio's visualizer, test derivation, and agent authoring. Assigns are
|
|
34
|
+
* pure context transforms, so naming them keeps the whole config
|
|
35
|
+
* serializable with a lookup table of reviewed pure functions beside it.
|
|
36
|
+
* 2. **Per-field signals.** `interpret` backs `state.value` and each field of
|
|
37
|
+
* `state.context` with an `alien-signals` signal updated inside `batch()`.
|
|
38
|
+
* 3. **No status enum beyond stopped.** Scope disposal owns teardown;
|
|
39
|
+
* `stop()` is what `dispose()` calls.
|
|
40
|
+
*/
|
|
41
|
+
/** Any event object: a discriminant type plus any payload. */
|
|
42
|
+
export type EventObject = {
|
|
43
|
+
type: string;
|
|
44
|
+
} & Record<string, unknown>;
|
|
45
|
+
/**
|
|
46
|
+
* The machine's events, as a MAP: one entry per event name, carrying that
|
|
47
|
+
* event's payload.
|
|
48
|
+
*
|
|
49
|
+
* The map is the contract with the outside, so the author writes it by hand
|
|
50
|
+
* — and the spec's `on` map is typed over it, so a transition's KEY
|
|
51
|
+
* narrows the event it receives.
|
|
52
|
+
*/
|
|
53
|
+
export type EventMap = object;
|
|
54
|
+
/**
|
|
55
|
+
* The map's keys, as NAMES. A map is an interface, so it has no index
|
|
56
|
+
* signature — the names are extracted, not read off an index.
|
|
57
|
+
*/
|
|
58
|
+
export type EventNames<TMap extends EventMap> = Extract<keyof TMap, string>;
|
|
59
|
+
/**
|
|
60
|
+
* The event a name names: its discriminant, plus the payload the map
|
|
61
|
+
* gives under that name.
|
|
62
|
+
*/
|
|
63
|
+
export type EventOf<TMap extends EventMap, TName extends EventNames<TMap>> = TName extends EventNames<TMap> ? {
|
|
64
|
+
readonly type: TName;
|
|
65
|
+
} & TMap[TName & keyof TMap] : never;
|
|
66
|
+
/** Every event of a map, as the union a service sends. */
|
|
67
|
+
export type EventUnion<TMap extends EventMap> = { [TName in EventNames<TMap>]: EventOf<TMap, TName>; }[EventNames<TMap>];
|
|
68
|
+
/** The name of an event of a map. */
|
|
69
|
+
export type EventName<TMap extends EventMap> = EventNames<TMap>;
|
|
70
|
+
/** The state a service holds: a value, the context, and what it matches. */
|
|
71
|
+
export interface State<TContext extends object, TState extends string = string> {
|
|
72
|
+
readonly value: TState;
|
|
73
|
+
readonly context: TContext;
|
|
74
|
+
readonly matches: (value: string) => boolean;
|
|
75
|
+
}
|
|
76
|
+
/** A transition target: a state name, or a record with an optional target. */
|
|
77
|
+
export type Transition<TContext extends object, TEvent, TState extends string = string> = TState | {
|
|
78
|
+
readonly target?: TState;
|
|
79
|
+
readonly cond?: (context: TContext, event: TEvent) => boolean;
|
|
80
|
+
readonly assign?: Assign<TContext, TEvent> | readonly Assign<TContext, TEvent>[];
|
|
81
|
+
};
|
|
82
|
+
/** A context write: a pure transform of the context. */
|
|
83
|
+
export type Assign<TContext extends object, TEvent> = (context: TContext, event: TEvent) => Partial<TContext>;
|
|
84
|
+
/** A context write narrowed to one or more event names of a map. */
|
|
85
|
+
export type AssignFor<TContext extends object, TEventMap extends EventMap, TName extends EventNames<TEventMap> = EventNames<TEventMap>> = (context: TContext, event: EventOf<TEventMap, TName>) => Partial<TContext>;
|
|
86
|
+
/** A transition guard narrowed to one or more event names of a map. */
|
|
87
|
+
export type GuardFor<TContext extends object, TEventMap extends EventMap, TName extends EventNames<TEventMap> = EventNames<TEventMap>> = (context: TContext, event: EventOf<TEventMap, TName>) => boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The transitions of a map: each KEY narrows its own event.
|
|
90
|
+
*
|
|
91
|
+
* The author writes the event map once, and every transition reads its
|
|
92
|
+
* event through the narrowing its key gives.
|
|
93
|
+
*/
|
|
94
|
+
export type Transitions<TContext extends object, TEventMap extends EventMap, TState extends string = string> = { readonly [TName in EventNames<TEventMap>]?: Transition<TContext, EventOf<TEventMap, TName>, TState> | readonly Transition<TContext, EventOf<TEventMap, TName>, TState>[]; };
|
|
95
|
+
/**
|
|
96
|
+
* A state's entry or exit: a context write, or the `{ assign }` form a
|
|
97
|
+
* spec writes when it names a shared body.
|
|
98
|
+
*/
|
|
99
|
+
export type Entry<TContext extends object, TEvent extends object> = Assign<TContext, TEvent> | {
|
|
100
|
+
readonly assign: Assign<TContext, TEvent>;
|
|
101
|
+
};
|
|
102
|
+
export interface Config<TContext extends object, TEventMap extends EventMap, TState extends string = string> {
|
|
103
|
+
readonly id?: string;
|
|
104
|
+
readonly initial: TState;
|
|
105
|
+
readonly context?: TContext;
|
|
106
|
+
/** Root-level handlers: candidates in every state. State-level handlers
|
|
107
|
+
* for the same event shadow these; everything else falls through here,
|
|
108
|
+
* which states "this event works everywhere" once instead of duplicating
|
|
109
|
+
* it across states. */
|
|
110
|
+
readonly on?: Transitions<TContext, TEventMap, TState>;
|
|
111
|
+
readonly states: Readonly<Record<string, {
|
|
112
|
+
readonly entry?: readonly Entry<TContext, EventUnion<TEventMap>>[];
|
|
113
|
+
readonly exit?: readonly Entry<TContext, EventUnion<TEventMap>>[];
|
|
114
|
+
readonly on?: Transitions<TContext, TEventMap, TState>;
|
|
115
|
+
}>>;
|
|
116
|
+
}
|
|
117
|
+
export type FieldsContract<TContext extends object, TEventMap extends EventMap> = { readonly [K in Extract<keyof TContext, string>]?: FieldContract<TEventMap>; } & Readonly<Record<string, FieldContract<TEventMap>>>;
|
|
118
|
+
export interface Machine<TContext extends object, TEventMap extends EventMap, TState extends string = string> {
|
|
119
|
+
readonly config: Config<TContext, TEventMap, TState>;
|
|
120
|
+
/** The machine's contract with its hosts: the fields a host may write,
|
|
121
|
+
* and the event each write carries. */
|
|
122
|
+
readonly fields: FieldsContract<TContext, TEventMap>;
|
|
123
|
+
readonly initialState: State<TContext, TState>;
|
|
124
|
+
transition(state: TState | State<TContext, TState>, event: EventUnion<TEventMap>): State<TContext, TState>;
|
|
125
|
+
}
|
|
126
|
+
export interface Service<TContext extends object, TEventMap extends EventMap, TState extends string = string> {
|
|
127
|
+
send(event: EventUnion<TEventMap>): void;
|
|
128
|
+
/**
|
|
129
|
+
* Replace part of the context, the way a transition's assigns do: the
|
|
130
|
+
* context object is replaced, so subscribers see it. The seed uses
|
|
131
|
+
* this — it lands AFTER the entry actions, so a seed wins over an
|
|
132
|
+
* entry (the seed writes the value, the entry clears the highlight).
|
|
133
|
+
*/
|
|
134
|
+
setContext(patch: Partial<TContext>): void;
|
|
135
|
+
/** Start (or restart) at an optional state, running that state's entry
|
|
136
|
+
* actions. This is how `defaultOpen`-style seeds work: the service's
|
|
137
|
+
* first state is not always the config's `initial`. */
|
|
138
|
+
start(state?: TState | State<TContext, TState>): Service<TContext, TEventMap, TState>;
|
|
139
|
+
stop(): Service<TContext, TEventMap, TState>;
|
|
140
|
+
readonly state: State<TContext, TState>;
|
|
141
|
+
readonly stopped: boolean;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* The machine: one call, one object.
|
|
145
|
+
*
|
|
146
|
+
* The spec says what the machine IS (its context, its states, its
|
|
147
|
+
* transitions) and what it DOES (its context writes, its guards) — each
|
|
148
|
+
* bound to the event it answers, by the transition's KEY.
|
|
149
|
+
*/
|
|
150
|
+
export interface MachineSpec<TContext extends object, TEventMap extends EventMap, TState extends string = string> {
|
|
151
|
+
readonly id?: string;
|
|
152
|
+
/** The machine's own defaults. No prop reaches this: a machine does
|
|
153
|
+
* not know what a host is. */
|
|
154
|
+
readonly context: TContext;
|
|
155
|
+
readonly initial: NoInfer<TState>;
|
|
156
|
+
readonly on?: Transitions<TContext, TEventMap, NoInfer<TState>>;
|
|
157
|
+
readonly states: Readonly<Record<TState, {
|
|
158
|
+
readonly entry?: readonly Entry<TContext, EventUnion<TEventMap>>[];
|
|
159
|
+
readonly exit?: readonly Entry<TContext, EventUnion<TEventMap>>[];
|
|
160
|
+
readonly on?: Transitions<TContext, TEventMap, NoInfer<TState>>;
|
|
161
|
+
}>>;
|
|
162
|
+
/**
|
|
163
|
+
* The machine's contract with its hosts: the context fields a host may
|
|
164
|
+
* write, and the event each write carries.
|
|
165
|
+
*
|
|
166
|
+
* A field with an event is REPORTED: the host's write is an event, the
|
|
167
|
+
* machine decides, and the change reaches the host. A field without one
|
|
168
|
+
* is SILENT: the host's write lands in the field, and nothing reports.
|
|
169
|
+
*
|
|
170
|
+
* The machine owns this map. The element does not restate it, and a
|
|
171
|
+
* host cannot write a field the contract does not name.
|
|
172
|
+
*/
|
|
173
|
+
readonly fields?: FieldsContract<TContext, TEventMap>;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* One field of the machine's contract: how a host's write reaches it.
|
|
177
|
+
*
|
|
178
|
+
* - `event` — the write is REPORTED: the host's write is an event, the
|
|
179
|
+
* machine decides, and the change reaches the host. The machine's
|
|
180
|
+
* assign shapes the payload.
|
|
181
|
+
* - no `event` — the write is SILENT: it lands in the field, and nothing
|
|
182
|
+
* reports. The framework shapes it with `parse`.
|
|
183
|
+
* - `parse` — the machine's own shaping of the field, for the silent
|
|
184
|
+
* path. The same shaping the machine's `initial` applies to the
|
|
185
|
+
* argument, so a host's write and the start agree.
|
|
186
|
+
*/
|
|
187
|
+
export interface FieldContract<TEventMap extends EventMap> {
|
|
188
|
+
readonly event?: EventUnion<TEventMap>["type"];
|
|
189
|
+
readonly parse?: (raw: unknown) => unknown;
|
|
190
|
+
}
|
|
191
|
+
export declare function createMachine<TContext extends object, TEventMap extends EventMap, TState extends string = string>(spec: MachineSpec<TContext, TEventMap, TState>): Machine<TContext, TEventMap, TState>;
|
|
192
|
+
export declare function interpret<TContext extends object, TEventMap extends EventMap, TState extends string = string>(machine: Machine<TContext, TEventMap, TState>): Service<TContext, TEventMap, TState>;
|