@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,407 @@
|
|
|
1
|
+
import { ParseError } from "./ir.js";
|
|
2
|
+
import { matchBrace } from "./braces.js";
|
|
3
|
+
// src/runtime/syntax/parse.ts
|
|
4
|
+
const VOID = /* @__PURE__ */ new Set([
|
|
5
|
+
"area",
|
|
6
|
+
"base",
|
|
7
|
+
"br",
|
|
8
|
+
"col",
|
|
9
|
+
"embed",
|
|
10
|
+
"hr",
|
|
11
|
+
"img",
|
|
12
|
+
"input",
|
|
13
|
+
"link",
|
|
14
|
+
"meta",
|
|
15
|
+
"source",
|
|
16
|
+
"track",
|
|
17
|
+
"wbr"
|
|
18
|
+
]);
|
|
19
|
+
const span = (start, end) => ({
|
|
20
|
+
start,
|
|
21
|
+
end
|
|
22
|
+
});
|
|
23
|
+
function fail(p, code, message, start, end) {
|
|
24
|
+
p.errors.push({
|
|
25
|
+
code,
|
|
26
|
+
message,
|
|
27
|
+
span: span(start, end)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function skipWs(p) {
|
|
31
|
+
while (p.pos < p.src.length && /\s/.test(p.src[p.pos])) p.pos++;
|
|
32
|
+
}
|
|
33
|
+
function readTagName(p) {
|
|
34
|
+
const start = p.pos;
|
|
35
|
+
while (p.pos < p.src.length && /[A-Za-z0-9\-\._:]/.test(p.src[p.pos])) p.pos++;
|
|
36
|
+
return p.src.slice(start, p.pos);
|
|
37
|
+
}
|
|
38
|
+
function readAttrValue(p) {
|
|
39
|
+
const quote = p.src[p.pos];
|
|
40
|
+
if (quote === "\"" || quote === "'") {
|
|
41
|
+
p.pos;
|
|
42
|
+
p.pos++;
|
|
43
|
+
const start = p.pos;
|
|
44
|
+
let value = "";
|
|
45
|
+
for (;;) {
|
|
46
|
+
if (p.pos >= p.src.length) break;
|
|
47
|
+
const ch = p.src[p.pos];
|
|
48
|
+
if (ch === quote) {
|
|
49
|
+
p.pos++;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
if (ch === "{") {
|
|
53
|
+
const close = matchBrace(p.src, p.pos, p.src.length);
|
|
54
|
+
value += p.src.slice(p.pos, close + 1);
|
|
55
|
+
p.pos = close + 1;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
value += ch;
|
|
59
|
+
p.pos++;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
value,
|
|
63
|
+
start,
|
|
64
|
+
end: p.pos
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const start = p.pos;
|
|
68
|
+
if (p.src[p.pos] === "{") {
|
|
69
|
+
const close = matchBrace(p.src, p.pos, p.src.length);
|
|
70
|
+
const value = p.src.slice(p.pos, close + 1);
|
|
71
|
+
p.pos = close + 1;
|
|
72
|
+
return {
|
|
73
|
+
value,
|
|
74
|
+
start,
|
|
75
|
+
end: p.pos
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
while (p.pos < p.src.length && !/[\s/>]/.test(p.src[p.pos])) p.pos++;
|
|
79
|
+
return {
|
|
80
|
+
value: p.src.slice(start, p.pos),
|
|
81
|
+
start,
|
|
82
|
+
end: p.pos
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function attrValue(raw, start, end) {
|
|
86
|
+
const t = raw.trim();
|
|
87
|
+
if (t.startsWith("{") && t.endsWith("}")) return {
|
|
88
|
+
kind: "expr",
|
|
89
|
+
expr: t.slice(1, -1).trim(),
|
|
90
|
+
span: span(start, end)
|
|
91
|
+
};
|
|
92
|
+
return {
|
|
93
|
+
kind: "static",
|
|
94
|
+
value: raw
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function parseText(p) {
|
|
98
|
+
const start = p.pos;
|
|
99
|
+
while (p.pos < p.src.length && p.src[p.pos] !== "<") p.pos++;
|
|
100
|
+
const raw = p.src.slice(start, p.pos);
|
|
101
|
+
const mixed = [];
|
|
102
|
+
let last = 0;
|
|
103
|
+
let i = 0;
|
|
104
|
+
while (i < raw.length) {
|
|
105
|
+
const open = raw.indexOf("{", i);
|
|
106
|
+
if (open === -1) break;
|
|
107
|
+
const close = matchBrace(raw, open, raw.length);
|
|
108
|
+
if (close >= raw.length) break;
|
|
109
|
+
if (open > last) {
|
|
110
|
+
const seg = raw.slice(last, open);
|
|
111
|
+
mixed.push({
|
|
112
|
+
kind: "static",
|
|
113
|
+
value: seg.includes("&") ? seg.replace(/&(#[xX]?[0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g, (m, body) => {
|
|
114
|
+
if (body[0] === "#") {
|
|
115
|
+
const isHex = body[1] === "x" || body[1] === "X";
|
|
116
|
+
const code = parseInt(body.slice(isHex ? 2 : 1), isHex ? 16 : 10);
|
|
117
|
+
if (Number.isNaN(code) || code < 0 || code > 1114111) return m;
|
|
118
|
+
try {
|
|
119
|
+
return String.fromCodePoint(code);
|
|
120
|
+
} catch {
|
|
121
|
+
return m;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
amp: "&",
|
|
126
|
+
lt: "<",
|
|
127
|
+
gt: ">",
|
|
128
|
+
quot: "\"",
|
|
129
|
+
apos: "'",
|
|
130
|
+
times: "×",
|
|
131
|
+
mdash: "—",
|
|
132
|
+
ndash: "–",
|
|
133
|
+
hellip: "…",
|
|
134
|
+
copy: "©"
|
|
135
|
+
}[body] ?? m;
|
|
136
|
+
}) : seg
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
mixed.push({
|
|
140
|
+
kind: "expr",
|
|
141
|
+
expr: raw.slice(open + 1, close).trim(),
|
|
142
|
+
span: span(start + open, start + close + 1)
|
|
143
|
+
});
|
|
144
|
+
last = close + 1;
|
|
145
|
+
i = close + 1;
|
|
146
|
+
}
|
|
147
|
+
if (last < raw.length) {
|
|
148
|
+
const seg = raw.slice(last);
|
|
149
|
+
mixed.push({
|
|
150
|
+
kind: "static",
|
|
151
|
+
value: seg.includes("&") ? seg.replace(/&(#[xX]?[0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g, (m, body) => {
|
|
152
|
+
if (body[0] === "#") {
|
|
153
|
+
const isHex = body[1] === "x" || body[1] === "X";
|
|
154
|
+
const code = parseInt(body.slice(isHex ? 2 : 1), isHex ? 16 : 10);
|
|
155
|
+
if (Number.isNaN(code) || code < 0 || code > 1114111) return m;
|
|
156
|
+
try {
|
|
157
|
+
return String.fromCodePoint(code);
|
|
158
|
+
} catch {
|
|
159
|
+
return m;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
amp: "&",
|
|
164
|
+
lt: "<",
|
|
165
|
+
gt: ">",
|
|
166
|
+
quot: "\"",
|
|
167
|
+
apos: "'",
|
|
168
|
+
times: "×",
|
|
169
|
+
mdash: "—",
|
|
170
|
+
ndash: "–",
|
|
171
|
+
hellip: "…",
|
|
172
|
+
copy: "©"
|
|
173
|
+
}[body] ?? m;
|
|
174
|
+
}) : seg
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
kind: "text",
|
|
179
|
+
parts: mixed,
|
|
180
|
+
span: span(start, p.pos)
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function parseElement(p) {
|
|
184
|
+
const start = p.pos;
|
|
185
|
+
p.pos++;
|
|
186
|
+
if (p.src[p.pos] === "/") {
|
|
187
|
+
fail(p, "stray-close", "closing tag without an opener", start, p.pos + 1);
|
|
188
|
+
while (p.pos < p.src.length && p.src[p.pos] !== ">") p.pos++;
|
|
189
|
+
p.pos++;
|
|
190
|
+
return {
|
|
191
|
+
kind: "text",
|
|
192
|
+
parts: [],
|
|
193
|
+
span: span(start, p.pos)
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const tag = readTagName(p);
|
|
197
|
+
const attrs = [];
|
|
198
|
+
const events = [];
|
|
199
|
+
const actions = [];
|
|
200
|
+
const spreads = [];
|
|
201
|
+
for (;;) {
|
|
202
|
+
skipWs(p);
|
|
203
|
+
if (p.pos >= p.src.length) break;
|
|
204
|
+
const aStart = p.pos;
|
|
205
|
+
const ch = p.src[p.pos];
|
|
206
|
+
if (ch === ">") {
|
|
207
|
+
p.pos++;
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
if (ch === "/" && p.src[p.pos + 1] === ">") {
|
|
211
|
+
p.pos += 2;
|
|
212
|
+
return finishElement(p, tag, attrs, events, actions, spreads, [], start, p.pos);
|
|
213
|
+
}
|
|
214
|
+
if (ch === "/") {
|
|
215
|
+
fail(p, "stray-slash", "a `/` that closes nothing is dropped", p.pos, p.pos + 1);
|
|
216
|
+
p.pos++;
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
let name = "";
|
|
220
|
+
if (p.src[p.pos] === "{" && p.src.slice(p.pos, p.pos + 4) === "{...") {
|
|
221
|
+
let depth = 0;
|
|
222
|
+
let quote;
|
|
223
|
+
while (p.pos < p.src.length) {
|
|
224
|
+
const c = p.src[p.pos];
|
|
225
|
+
if (quote !== void 0) {
|
|
226
|
+
name += c;
|
|
227
|
+
if (c === quote) quote = void 0;
|
|
228
|
+
} else if (c === "\"" || c === "'") {
|
|
229
|
+
quote = c;
|
|
230
|
+
name += c;
|
|
231
|
+
} else if (c === "{") {
|
|
232
|
+
depth++;
|
|
233
|
+
name += c;
|
|
234
|
+
} else if (c === "}") {
|
|
235
|
+
depth--;
|
|
236
|
+
name += c;
|
|
237
|
+
if (depth === 0) {
|
|
238
|
+
p.pos++;
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
} else name += c;
|
|
242
|
+
p.pos++;
|
|
243
|
+
}
|
|
244
|
+
} else while (p.pos < p.src.length && !/[\s=/>]/.test(p.src[p.pos])) {
|
|
245
|
+
name += p.src[p.pos];
|
|
246
|
+
p.pos++;
|
|
247
|
+
}
|
|
248
|
+
skipWs(p);
|
|
249
|
+
let raw = "";
|
|
250
|
+
let vStart = p.pos;
|
|
251
|
+
let vEnd = p.pos;
|
|
252
|
+
if (p.src[p.pos] === "=") {
|
|
253
|
+
p.pos++;
|
|
254
|
+
skipWs(p);
|
|
255
|
+
const v = readAttrValue(p);
|
|
256
|
+
raw = v.value;
|
|
257
|
+
vStart = v.start;
|
|
258
|
+
vEnd = v.end;
|
|
259
|
+
}
|
|
260
|
+
const aSpan = span(aStart, p.pos);
|
|
261
|
+
if (name.startsWith("{...") && name.endsWith("}")) spreads.push({
|
|
262
|
+
expr: name.slice(4, -1).trim(),
|
|
263
|
+
span: aSpan
|
|
264
|
+
});
|
|
265
|
+
else if (name.startsWith("on:")) {
|
|
266
|
+
const body = raw.trim();
|
|
267
|
+
const handler = body.startsWith("{") && body.endsWith("}") ? body.slice(1, -1).trim() : body;
|
|
268
|
+
events.push({
|
|
269
|
+
event: name.slice(3),
|
|
270
|
+
handler,
|
|
271
|
+
span: aSpan
|
|
272
|
+
});
|
|
273
|
+
} else if (name.startsWith("use:")) {
|
|
274
|
+
const body = raw.trim();
|
|
275
|
+
const param = body.startsWith("{") && body.endsWith("}") ? body.slice(1, -1).trim() : body.length > 0 ? JSON.stringify(body) : void 0;
|
|
276
|
+
actions.push({
|
|
277
|
+
name: name.slice(4),
|
|
278
|
+
param,
|
|
279
|
+
span: aSpan
|
|
280
|
+
});
|
|
281
|
+
} else if (name === "for" || name === "as" || name === "key") attrs.push({
|
|
282
|
+
name,
|
|
283
|
+
value: attrValue(raw, vStart, vEnd),
|
|
284
|
+
span: aSpan
|
|
285
|
+
});
|
|
286
|
+
else attrs.push({
|
|
287
|
+
name,
|
|
288
|
+
value: attrValue(raw, vStart, vEnd),
|
|
289
|
+
span: aSpan
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
if (VOID.has(tag)) return finishElement(p, tag, attrs, events, actions, spreads, [], start, p.pos);
|
|
293
|
+
if (tag === "template") return parseTemplate(p, attrs, events, actions, start);
|
|
294
|
+
const children = [];
|
|
295
|
+
for (;;) {
|
|
296
|
+
skipWs(p);
|
|
297
|
+
if (p.pos >= p.src.length) {
|
|
298
|
+
fail(p, "unclosed", `element <${tag}> is never closed`, start, p.pos);
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
if (p.src[p.pos] === "<" && p.src[p.pos + 1] === "/") {
|
|
302
|
+
p.pos += 2;
|
|
303
|
+
const close = readTagName(p);
|
|
304
|
+
skipWs(p);
|
|
305
|
+
if (p.src[p.pos] === ">") p.pos++;
|
|
306
|
+
if (close !== tag) fail(p, "mismatch", `expected </${tag}> but found </${close}>`, start, p.pos);
|
|
307
|
+
break;
|
|
308
|
+
}
|
|
309
|
+
if (p.src[p.pos] === "<") children.push(parseElement(p));
|
|
310
|
+
else {
|
|
311
|
+
const t = parseText(p);
|
|
312
|
+
if (t.kind === "text" && t.parts.length > 0) children.push(t);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return finishElement(p, tag, attrs, events, actions, spreads, children, start, p.pos);
|
|
316
|
+
}
|
|
317
|
+
function finishElement(p, tag, attrs, events, actions, spreads, children, start, end) {
|
|
318
|
+
const at = attrs.findIndex((a) => a.name === "show");
|
|
319
|
+
let show;
|
|
320
|
+
if (at !== -1) {
|
|
321
|
+
const found = attrs[at];
|
|
322
|
+
if (found.value.kind !== "expr") fail(p, "show-static", "`show` needs an expression: show={cond}", found.span.start, found.span.end);
|
|
323
|
+
else show = found.value.expr;
|
|
324
|
+
attrs.splice(at, 1);
|
|
325
|
+
}
|
|
326
|
+
return {
|
|
327
|
+
kind: "element",
|
|
328
|
+
tag,
|
|
329
|
+
attrs,
|
|
330
|
+
events,
|
|
331
|
+
actions,
|
|
332
|
+
spreads,
|
|
333
|
+
children,
|
|
334
|
+
...show !== void 0 ? { show } : {},
|
|
335
|
+
span: span(start, end)
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
function templateAttr(attrs, name) {
|
|
339
|
+
const found = attrs.find((a) => a.name === name);
|
|
340
|
+
if (!found) return void 0;
|
|
341
|
+
const v = found.value;
|
|
342
|
+
if (v.kind === "static") return v.value;
|
|
343
|
+
return `{${v.expr}}`;
|
|
344
|
+
}
|
|
345
|
+
function parseTemplate(p, attrs, events, actions, start) {
|
|
346
|
+
const rawFor = templateAttr(attrs, "for");
|
|
347
|
+
const rawAs = templateAttr(attrs, "as");
|
|
348
|
+
const rawKey = templateAttr(attrs, "key");
|
|
349
|
+
if (rawFor === void 0) fail(p, "template-for", "<template> needs a for={items} attribute", start, p.pos);
|
|
350
|
+
const source = rawFor !== void 0 && rawFor.startsWith("{") && rawFor.endsWith("}") ? rawFor.slice(1, -1).trim() : rawFor ?? "";
|
|
351
|
+
const binding = rawAs !== void 0 && rawAs.startsWith("{") && rawAs.endsWith("}") ? rawAs.slice(1, -1).trim() : rawAs ?? "item";
|
|
352
|
+
const key = rawKey !== void 0 && rawKey.startsWith("{") && rawKey.endsWith("}") ? rawKey.slice(1, -1).trim() : rawKey;
|
|
353
|
+
const body = [];
|
|
354
|
+
for (;;) {
|
|
355
|
+
skipWs(p);
|
|
356
|
+
if (p.pos >= p.src.length) {
|
|
357
|
+
fail(p, "unclosed", "<template> is never closed", start, p.pos);
|
|
358
|
+
break;
|
|
359
|
+
}
|
|
360
|
+
if (p.src[p.pos] === "<" && p.src[p.pos + 1] === "/") {
|
|
361
|
+
p.pos += 2;
|
|
362
|
+
const close = readTagName(p);
|
|
363
|
+
skipWs(p);
|
|
364
|
+
if (p.src[p.pos] === ">") p.pos++;
|
|
365
|
+
if (close !== "template") fail(p, "mismatch", `expected </template> but found </${close}>`, start, p.pos);
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
if (p.src[p.pos] === "<") body.push(parseElement(p));
|
|
369
|
+
else {
|
|
370
|
+
const t = parseText(p);
|
|
371
|
+
if (t.kind === "text" && t.parts.length > 0) body.push(t);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return {
|
|
375
|
+
kind: "for",
|
|
376
|
+
source,
|
|
377
|
+
binding,
|
|
378
|
+
key,
|
|
379
|
+
body,
|
|
380
|
+
span: span(start, p.pos)
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
function parse(source) {
|
|
384
|
+
const p = {
|
|
385
|
+
src: source,
|
|
386
|
+
pos: 0,
|
|
387
|
+
errors: []
|
|
388
|
+
};
|
|
389
|
+
const nodes = [];
|
|
390
|
+
for (;;) {
|
|
391
|
+
skipWs(p);
|
|
392
|
+
if (p.pos >= p.src.length) break;
|
|
393
|
+
if (p.src[p.pos] === "<") {
|
|
394
|
+
const n = parseElement(p);
|
|
395
|
+
if (n.kind === "text" && n.parts.length === 0) continue;
|
|
396
|
+
nodes.push(n);
|
|
397
|
+
} else {
|
|
398
|
+
const t = parseText(p);
|
|
399
|
+
if (t.kind === "text" && t.parts.length > 0) nodes.push(t);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
if (p.errors.length > 0) throw new ParseError(p.errors);
|
|
403
|
+
return { nodes };
|
|
404
|
+
}
|
|
405
|
+
export { parse };
|
|
406
|
+
|
|
407
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** The script block: real TypeScript the checker sees.
|
|
2
|
+
*
|
|
3
|
+
* The script is a module the checker checks — not text the compiler
|
|
4
|
+
* parses for types. The compiler's job is the allowlist: only type and
|
|
5
|
+
* interface declarations, imports, and machine-factory calls survive.
|
|
6
|
+
* Everything else is stripped before the check, and a stripped script
|
|
7
|
+
* that leaves nothing meaningful behind is an empty component, not an
|
|
8
|
+
* error somewhere else.
|
|
9
|
+
*
|
|
10
|
+
* <script lang="ts">
|
|
11
|
+
* import { slider } from "../slider.machine.ts";
|
|
12
|
+
* const ctl = slider({ value: [50] });
|
|
13
|
+
* </script>
|
|
14
|
+
*
|
|
15
|
+
* The call's semantics are the factory's semantics: called here, fresh
|
|
16
|
+
* instance, caller owns lifecycle. The template references the binding
|
|
17
|
+
* (`ctl.getRootProps()`); the compiler wires it.
|
|
18
|
+
*/
|
|
19
|
+
export interface ScriptCall {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly factory: string;
|
|
22
|
+
readonly args: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ScriptConsume {
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly handle: string;
|
|
27
|
+
}
|
|
28
|
+
export interface StrippedScript {
|
|
29
|
+
/** The module text the checker sees. */
|
|
30
|
+
readonly module: string;
|
|
31
|
+
/** The binding names the template may reference. */
|
|
32
|
+
readonly bindings: readonly string[];
|
|
33
|
+
/** The parsed machine-factory calls, including multi-line args. */
|
|
34
|
+
readonly calls: readonly ScriptCall[];
|
|
35
|
+
/** `consume(handle)` ancestor lookups the template may reference. */
|
|
36
|
+
readonly consumes: readonly ScriptConsume[];
|
|
37
|
+
/** What was stripped, for diagnostics. */
|
|
38
|
+
readonly stripped: readonly string[];
|
|
39
|
+
}
|
|
40
|
+
/** Strip a script body to what the checker sees. */
|
|
41
|
+
export declare function stripScript(body: string): StrippedScript;
|
|
42
|
+
/** Extract the script block from markup source, if it has one. */
|
|
43
|
+
export declare function extractScript(source: string): string | undefined;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { skipQuoted } from "./braces.js";
|
|
2
|
+
// src/runtime/syntax/script-block.ts
|
|
3
|
+
/** The script block: real TypeScript the checker sees.
|
|
4
|
+
*
|
|
5
|
+
* The script is a module the checker checks — not text the compiler
|
|
6
|
+
* parses for types. The compiler's job is the allowlist: only type and
|
|
7
|
+
* interface declarations, imports, and machine-factory calls survive.
|
|
8
|
+
* Everything else is stripped before the check, and a stripped script
|
|
9
|
+
* that leaves nothing meaningful behind is an empty component, not an
|
|
10
|
+
* error somewhere else.
|
|
11
|
+
*
|
|
12
|
+
* <script lang="ts">
|
|
13
|
+
* import { slider } from "../slider.machine.ts";
|
|
14
|
+
* const ctl = slider({ value: [50] });
|
|
15
|
+
* <\/script>
|
|
16
|
+
*
|
|
17
|
+
* The call's semantics are the factory's semantics: called here, fresh
|
|
18
|
+
* instance, caller owns lifecycle. The template references the binding
|
|
19
|
+
* (`ctl.getRootProps()`); the compiler wires it.
|
|
20
|
+
*/
|
|
21
|
+
const IMPORT_START = /^import(?:\s|\{|\*)/;
|
|
22
|
+
const TYPE_START = /^(?:export\s+)?(?:type|interface)\b/;
|
|
23
|
+
const MACHINE_CALL_START = /^(?:export\s+)?const\s+([A-Za-z_$][\w$]*)\s*=\s*([A-Za-z_$][\w$]*)\s*\(/;
|
|
24
|
+
/** Find the matching `)` for the `(` at `openParen`, skipping strings and comments. */
|
|
25
|
+
function matchParen(source, openParen) {
|
|
26
|
+
const end = source.length;
|
|
27
|
+
let depth = 0;
|
|
28
|
+
let i = openParen;
|
|
29
|
+
while (i < end) {
|
|
30
|
+
const c = source[i];
|
|
31
|
+
if (c === "\"" || c === "'" || c === "`") {
|
|
32
|
+
i = skipQuoted(source, i, end);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (c === "/" && source[i + 1] === "/") {
|
|
36
|
+
const nl = source.indexOf("\n", i + 2);
|
|
37
|
+
i = nl < 0 ? end : nl + 1;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (c === "/" && source[i + 1] === "*") {
|
|
41
|
+
const close = source.indexOf("*/", i + 2);
|
|
42
|
+
i = close < 0 ? end : close + 2;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (c === "(") depth += 1;
|
|
46
|
+
else if (c === ")") {
|
|
47
|
+
depth -= 1;
|
|
48
|
+
if (depth === 0) return i;
|
|
49
|
+
}
|
|
50
|
+
i += 1;
|
|
51
|
+
}
|
|
52
|
+
return -1;
|
|
53
|
+
}
|
|
54
|
+
/** Scan a balanced top-level statement (`import`, `type`, `interface`) to its line end. */
|
|
55
|
+
function scanStatementEnd(source, start) {
|
|
56
|
+
const end = source.length;
|
|
57
|
+
let depth = 0;
|
|
58
|
+
let i = start;
|
|
59
|
+
while (i < end) {
|
|
60
|
+
const c = source[i];
|
|
61
|
+
if (c === "\"" || c === "'" || c === "`") {
|
|
62
|
+
i = skipQuoted(source, i, end);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (c === "/" && source[i + 1] === "/") {
|
|
66
|
+
const nl = source.indexOf("\n", i + 2);
|
|
67
|
+
if (depth === 0) return nl < 0 ? end : nl;
|
|
68
|
+
i = nl < 0 ? end : nl + 1;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (c === "/" && source[i + 1] === "*") {
|
|
72
|
+
const close = source.indexOf("*/", i + 2);
|
|
73
|
+
i = close < 0 ? end : close + 2;
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (c === "{" || c === "(" || c === "[") depth += 1;
|
|
77
|
+
else if (c === "}" || c === ")" || c === "]") depth = Math.max(0, depth - 1);
|
|
78
|
+
else if (c === "\n" && depth === 0) {
|
|
79
|
+
const rest = source.slice(i + 1).trimStart();
|
|
80
|
+
if (rest.startsWith("|") || rest.startsWith("&")) {
|
|
81
|
+
i += 1;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
return i;
|
|
85
|
+
}
|
|
86
|
+
i += 1;
|
|
87
|
+
}
|
|
88
|
+
return end;
|
|
89
|
+
}
|
|
90
|
+
/** Strip a script body to what the checker sees. */
|
|
91
|
+
function stripScript(body) {
|
|
92
|
+
const kept = [];
|
|
93
|
+
const bindings = [];
|
|
94
|
+
const calls = [];
|
|
95
|
+
const consumes = [];
|
|
96
|
+
const stripped = [];
|
|
97
|
+
const len = body.length;
|
|
98
|
+
let pos = 0;
|
|
99
|
+
while (pos < len) {
|
|
100
|
+
const lineStart = pos;
|
|
101
|
+
while (pos < len && (body[pos] === " " || body[pos] === " " || body[pos] === "\r")) pos += 1;
|
|
102
|
+
if (pos >= len) {
|
|
103
|
+
kept.push(body.slice(lineStart));
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
if (body[pos] === "\n") {
|
|
107
|
+
kept.push(body.slice(lineStart, pos));
|
|
108
|
+
pos += 1;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const rest = body.slice(pos);
|
|
112
|
+
if (rest.startsWith("//")) {
|
|
113
|
+
const nl = body.indexOf("\n", pos);
|
|
114
|
+
const end = nl < 0 ? len : nl;
|
|
115
|
+
kept.push(body.slice(lineStart, end));
|
|
116
|
+
pos = nl < 0 ? len : nl + 1;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (rest.startsWith("/*")) {
|
|
120
|
+
const close = body.indexOf("*/", pos + 2);
|
|
121
|
+
const after = close < 0 ? len : close + 2;
|
|
122
|
+
const nl = body.indexOf("\n", after);
|
|
123
|
+
const end = nl < 0 ? len : nl;
|
|
124
|
+
kept.push(body.slice(lineStart, end));
|
|
125
|
+
pos = nl < 0 ? len : nl + 1;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (IMPORT_START.test(rest) || TYPE_START.test(rest)) {
|
|
129
|
+
const stmtEnd = scanStatementEnd(body, pos);
|
|
130
|
+
kept.push(body.slice(lineStart, stmtEnd));
|
|
131
|
+
pos = stmtEnd < len && body[stmtEnd] === "\n" ? stmtEnd + 1 : stmtEnd;
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
const callMatch = MACHINE_CALL_START.exec(rest);
|
|
135
|
+
if (callMatch !== null) {
|
|
136
|
+
const name = callMatch[1] ?? "";
|
|
137
|
+
const factory = callMatch[2] ?? "";
|
|
138
|
+
const openParen = pos + callMatch[0].length - 1;
|
|
139
|
+
const closeParen = matchParen(body, openParen);
|
|
140
|
+
if (closeParen >= 0) {
|
|
141
|
+
const nl = body.indexOf("\n", closeParen);
|
|
142
|
+
const lineEnd = nl < 0 ? len : nl;
|
|
143
|
+
const tail = body.slice(closeParen + 1, lineEnd).trim();
|
|
144
|
+
if (tail === "" || tail === ";" || tail.startsWith("//")) {
|
|
145
|
+
if (factory === "consume") {
|
|
146
|
+
kept.push(body.slice(lineStart, lineEnd));
|
|
147
|
+
bindings.push(name);
|
|
148
|
+
consumes.push({
|
|
149
|
+
name,
|
|
150
|
+
handle: body.slice(openParen + 1, closeParen).trim()
|
|
151
|
+
});
|
|
152
|
+
} else {
|
|
153
|
+
kept.push(body.slice(lineStart, lineEnd));
|
|
154
|
+
bindings.push(name);
|
|
155
|
+
calls.push({
|
|
156
|
+
name,
|
|
157
|
+
factory,
|
|
158
|
+
args: body.slice(openParen + 1, closeParen).trim()
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
pos = nl < 0 ? len : nl + 1;
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const nl = body.indexOf("\n", pos);
|
|
167
|
+
const lineEnd = nl < 0 ? len : nl;
|
|
168
|
+
stripped.push(body.slice(lineStart, lineEnd));
|
|
169
|
+
pos = nl < 0 ? len : nl + 1;
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
module: kept.join("\n"),
|
|
173
|
+
bindings,
|
|
174
|
+
calls,
|
|
175
|
+
consumes,
|
|
176
|
+
stripped
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
/** Extract the script block from markup source, if it has one. */
|
|
180
|
+
function extractScript(source) {
|
|
181
|
+
const open = /<script(\s[^>]*)?>/.exec(source);
|
|
182
|
+
if (open === null || open.index === void 0) return void 0;
|
|
183
|
+
const bodyStart = open.index + open[0].length;
|
|
184
|
+
const close = source.indexOf("<\/script>", bodyStart);
|
|
185
|
+
if (close < 0) return void 0;
|
|
186
|
+
return source.slice(bodyStart, close);
|
|
187
|
+
}
|
|
188
|
+
export { extractScript, stripScript };
|
|
189
|
+
|
|
190
|
+
//# sourceMappingURL=script-block.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The test-only DOM.
|
|
3
|
+
*
|
|
4
|
+
* A second `Window` type, which is the point of keeping it behind a
|
|
5
|
+
* subpath: a browser consumer importing `@spinjs/components/runtime` never loads this
|
|
6
|
+
* module, so the two `Window` types never coexist in one program. Exposing
|
|
7
|
+
* it from the package root instead put it in every consumer's program and
|
|
8
|
+
* broke the whole workspace check.
|
|
9
|
+
*/
|
|
10
|
+
import { parseHTML } from "linkedom";
|
|
11
|
+
export { parseHTML };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { parseHTML } from "linkedom";
|