@remix-run/ui 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +116 -157
- package/dist/accordion/index.d.ts +46 -0
- package/dist/accordion/index.js +142 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/accordion/primitives.d.ts +104 -0
- package/dist/accordion/primitives.js +312 -0
- package/dist/accordion/primitives.js.map +1 -0
- package/dist/{components/anchor/anchor.js → anchor/index.js} +1 -1
- package/dist/anchor/index.js.map +1 -0
- package/dist/animation/animate-layout-mixin.js +1 -1
- package/dist/animation/animate-layout-mixin.js.map +1 -1
- package/dist/animation/animate-mixins.js +2 -2
- package/dist/animation/animate-mixins.js.map +1 -1
- package/dist/animation/demos/color-interpolation.js +1 -1
- package/dist/animation/demos/color-interpolation.js.map +1 -1
- package/dist/animation/demos/drag-release.d.ts +1 -1
- package/dist/animation/demos/hold-to-confirm.d.ts +3 -3
- package/dist/animation/demos/material-ripple.js +1 -3
- package/dist/animation/demos/material-ripple.js.map +1 -1
- package/dist/animation/demos/reordering.js +9 -6
- package/dist/animation/demos/reordering.js.map +1 -1
- package/dist/animation/index.js +4 -4
- package/dist/animation/spring.js.map +1 -1
- package/dist/{components/breadcrumbs/breadcrumbs.js → breadcrumbs/index.js} +19 -19
- package/dist/breadcrumbs/index.js.map +1 -0
- package/dist/button/index.d.ts +15 -0
- package/dist/button/index.js +128 -0
- package/dist/button/index.js.map +1 -0
- package/dist/checkbox/index.d.ts +14 -0
- package/dist/checkbox/index.js +127 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/combobox/index.d.ts +21 -0
- package/dist/combobox/index.js +58 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/{components/combobox/combobox.d.ts → combobox/primitives.d.ts} +4 -8
- package/dist/{components/combobox/combobox.js → combobox/primitives.js} +8 -61
- package/dist/combobox/primitives.js.map +1 -0
- package/dist/dev/refresh.d.ts +1 -0
- package/dist/dev/refresh.js +2 -0
- package/dist/dev/refresh.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -14
- package/dist/input/index.d.ts +13 -0
- package/dist/input/index.js +121 -0
- package/dist/input/index.js.map +1 -0
- package/dist/jsx-runtime.js +2 -2
- package/dist/listbox/flash-attribute.js.map +1 -0
- package/dist/{components/listbox/listbox.d.ts → listbox/index.d.ts} +2 -6
- package/dist/{components/listbox/listbox.js → listbox/index.js} +4 -82
- package/dist/listbox/index.js.map +1 -0
- package/dist/menu/hover-aim.js.map +1 -0
- package/dist/menu/index.d.ts +42 -0
- package/dist/menu/index.js +250 -0
- package/dist/menu/index.js.map +1 -0
- package/dist/{components/menu/menu.d.ts → menu/primitives.d.ts} +4 -33
- package/dist/{components/menu/menu.js → menu/primitives.js} +98 -315
- package/dist/menu/primitives.js.map +1 -0
- package/dist/{components/popover/popover.d.ts → popover/index.d.ts} +2 -4
- package/dist/{components/popover/popover.js → popover/index.js} +5 -48
- package/dist/popover/index.js.map +1 -0
- package/dist/{interactions/outside-click/outside-click-mixin.js → popover/outside-click.js} +1 -1
- package/dist/popover/outside-click.js.map +1 -0
- package/dist/popover/scroll-lock.d.ts +1 -0
- package/dist/{utils → popover}/scroll-lock.js +0 -18
- package/dist/popover/scroll-lock.js.map +1 -0
- package/dist/radio/index.d.ts +12 -0
- package/dist/radio/index.js +77 -0
- package/dist/radio/index.js.map +1 -0
- package/dist/runtime/client-entry-boundary.d.ts +14 -0
- package/dist/runtime/client-entry-boundary.js +29 -0
- package/dist/runtime/client-entry-boundary.js.map +1 -0
- package/dist/runtime/component.d.ts +19 -4
- package/dist/runtime/component.js +39 -9
- package/dist/runtime/component.js.map +1 -1
- package/dist/runtime/core/attributes.js +36 -3
- package/dist/runtime/core/attributes.js.map +1 -1
- package/dist/runtime/core/children.d.ts +2 -0
- package/dist/runtime/core/children.js +26 -2
- package/dist/runtime/core/children.js.map +1 -1
- package/dist/runtime/core/props.js +2 -2
- package/dist/runtime/core/vnode.d.ts +3 -3
- package/dist/runtime/core/vnode.js +22 -1
- package/dist/runtime/core/vnode.js.map +1 -1
- package/dist/runtime/create-element.d.ts +2 -2
- package/dist/runtime/create-element.js +3 -2
- package/dist/runtime/create-element.js.map +1 -1
- package/dist/runtime/diff-dom.js +294 -219
- package/dist/runtime/diff-dom.js.map +1 -1
- package/dist/runtime/diff-props.js +3 -3
- package/dist/runtime/dom.d.ts +12 -0
- package/dist/runtime/element-function.d.ts +3 -0
- package/dist/runtime/element-function.js +2 -0
- package/dist/runtime/element-function.js.map +1 -0
- package/dist/runtime/form-navigation.d.ts +25 -0
- package/dist/runtime/form-navigation.js +132 -0
- package/dist/runtime/form-navigation.js.map +1 -0
- package/dist/runtime/frame-resolution.d.ts +5 -0
- package/dist/runtime/frame-resolution.js +10 -0
- package/dist/runtime/frame-resolution.js.map +1 -0
- package/dist/runtime/frame.d.ts +58 -15
- package/dist/runtime/frame.js +367 -114
- package/dist/runtime/frame.js.map +1 -1
- package/dist/runtime/jsx.d.ts +1 -1
- package/dist/runtime/jsx.js +1 -1
- package/dist/runtime/jsx.js.map +1 -1
- package/dist/runtime/key.d.ts +1 -0
- package/dist/runtime/key.js +2 -0
- package/dist/runtime/key.js.map +1 -0
- package/dist/runtime/mixins/attrs-mixin.js +2 -2
- package/dist/runtime/mixins/link-mixin.js +4 -3
- package/dist/runtime/mixins/link-mixin.js.map +1 -1
- package/dist/runtime/mixins/mixin.d.ts +15 -10
- package/dist/runtime/mixins/mixin.js +4 -4
- package/dist/runtime/mixins/mixin.js.map +1 -1
- package/dist/runtime/mixins/on-mixin.js +1 -1
- package/dist/runtime/mixins/ref-mixin.js +1 -1
- package/dist/runtime/navigation.d.ts +4 -1
- package/dist/runtime/navigation.js +157 -32
- package/dist/runtime/navigation.js.map +1 -1
- package/dist/runtime/reconcile.d.ts +11 -10
- package/dist/runtime/reconcile.js +557 -423
- package/dist/runtime/reconcile.js.map +1 -1
- package/dist/runtime/refresh.d.ts +28 -0
- package/dist/runtime/refresh.js +31 -0
- package/dist/runtime/refresh.js.map +1 -0
- package/dist/runtime/render.js +1 -1
- package/dist/runtime/render.js.map +1 -1
- package/dist/runtime/run.d.ts +3 -1
- package/dist/runtime/run.js +15 -7
- package/dist/runtime/run.js.map +1 -1
- package/dist/runtime/scheduler.js +8 -16
- package/dist/runtime/scheduler.js.map +1 -1
- package/dist/runtime/to-vnode.d.ts +2 -2
- package/dist/runtime/to-vnode.js +68 -20
- package/dist/runtime/to-vnode.js.map +1 -1
- package/dist/runtime/vdom.d.ts +4 -2
- package/dist/runtime/vdom.js +89 -41
- package/dist/runtime/vdom.js.map +1 -1
- package/dist/runtime/vnode.d.ts +138 -67
- package/dist/runtime/vnode.js +17 -12
- package/dist/runtime/vnode.js.map +1 -1
- package/dist/select/index.d.ts +19 -0
- package/dist/select/index.js +95 -0
- package/dist/select/index.js.map +1 -0
- package/dist/select/keydown.js.map +1 -0
- package/dist/{components/select/select.d.ts → select/primitives.d.ts} +5 -7
- package/dist/{components/select/select.js → select/primitives.js} +11 -63
- package/dist/select/primitives.js.map +1 -0
- package/dist/server/stream.js +22 -29
- package/dist/server/stream.js.map +1 -1
- package/dist/shared/focus-styles.d.ts +1 -0
- package/dist/shared/focus-styles.js +2 -0
- package/dist/shared/focus-styles.js.map +1 -0
- package/dist/shared/icons.d.ts +9 -0
- package/dist/shared/icons.js +42 -0
- package/dist/shared/icons.js.map +1 -0
- package/dist/shared/listbox-popover-styles.d.ts +6 -0
- package/dist/shared/listbox-popover-styles.js +137 -0
- package/dist/shared/listbox-popover-styles.js.map +1 -0
- package/dist/shared/style-values.d.ts +78 -0
- package/dist/shared/style-values.js +88 -0
- package/dist/shared/style-values.js.map +1 -0
- package/dist/{interactions/typeahead/typeahead-mixin.js → shared/typeahead.js} +1 -1
- package/dist/shared/typeahead.js.map +1 -0
- package/dist/shared/wait-for-css-transition.js.map +1 -0
- package/dist/shared/wait.js.map +1 -0
- package/dist/style/css-mixin.js +3 -3
- package/dist/style/index.js +2 -2
- package/dist/style/style.js +25 -6
- package/dist/style/style.js.map +1 -1
- package/dist/style/stylesheet.d.ts +0 -1
- package/dist/style/stylesheet.js +13 -54
- package/dist/style/stylesheet.js.map +1 -1
- package/dist/tabs/index.d.ts +32 -0
- package/dist/tabs/index.js +157 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/tabs/primitives.d.ts +57 -0
- package/dist/tabs/primitives.js +238 -0
- package/dist/tabs/primitives.js.map +1 -0
- package/dist/test.js +1 -1
- package/dist/toggle/index.d.ts +9 -0
- package/dist/toggle/index.js +108 -0
- package/dist/toggle/index.js.map +1 -0
- package/dist/toggle/primitives.d.ts +29 -0
- package/dist/toggle/primitives.js +127 -0
- package/dist/toggle/primitives.js.map +1 -0
- package/package.json +81 -49
- package/src/{components/accordion → accordion}/README.md +50 -14
- package/src/accordion/index.tsx +285 -0
- package/src/accordion/primitives.tsx +512 -0
- package/src/{components/anchor → anchor}/README.md +37 -2
- package/src/animation/animate-mixins.ts +3 -3
- package/src/animation/demos/color-interpolation.tsx +1 -1
- package/src/animation/demos/reordering.tsx +9 -6
- package/src/{components/breadcrumbs → breadcrumbs}/README.md +4 -4
- package/src/{components/breadcrumbs/breadcrumbs.tsx → breadcrumbs/index.tsx} +18 -18
- package/src/button/README.md +44 -0
- package/src/button/index.ts +168 -0
- package/src/checkbox/README.md +59 -0
- package/src/checkbox/index.ts +164 -0
- package/src/{components/combobox → combobox}/README.md +58 -9
- package/src/combobox/index.tsx +112 -0
- package/src/{components/combobox/combobox.tsx → combobox/primitives.tsx} +5 -91
- package/src/dev/refresh.ts +1 -0
- package/src/index.ts +1 -1
- package/src/input/README.md +52 -0
- package/src/input/index.ts +147 -0
- package/src/{components/listbox → listbox}/README.md +9 -41
- package/src/{components/listbox/listbox.ts → listbox/index.ts} +2 -87
- package/src/{components/menu → menu}/README.md +55 -14
- package/src/menu/index.tsx +354 -0
- package/src/{components/menu/menu.tsx → menu/primitives.tsx} +99 -413
- package/src/{components/popover → popover}/README.md +20 -39
- package/src/{components/popover/popover.ts → popover/index.ts} +3 -57
- package/src/{utils → popover}/scroll-lock.ts +0 -28
- package/src/radio/README.md +53 -0
- package/src/radio/index.ts +101 -0
- package/src/runtime/client-entry-boundary.ts +54 -0
- package/src/runtime/component.ts +65 -16
- package/src/runtime/core/attributes.ts +35 -1
- package/src/runtime/core/children.ts +24 -2
- package/src/runtime/core/vnode.ts +25 -4
- package/src/runtime/create-element.ts +6 -5
- package/src/runtime/demos/readme.demo.tsx +20 -18
- package/src/runtime/diff-dom.ts +358 -243
- package/src/runtime/dom.ts +331 -214
- package/src/runtime/element-function.ts +1 -0
- package/src/runtime/event-listeners.ts +1 -1
- package/src/runtime/form-navigation.ts +184 -0
- package/src/runtime/frame-resolution.ts +13 -0
- package/src/runtime/frame.ts +482 -124
- package/src/runtime/jsx.ts +3 -5
- package/src/runtime/key.ts +1 -0
- package/src/runtime/mixins/link-mixin.ts +1 -0
- package/src/runtime/mixins/mixin.ts +21 -18
- package/src/runtime/navigation.ts +204 -30
- package/src/runtime/reconcile.ts +769 -760
- package/src/runtime/refresh.ts +46 -0
- package/src/runtime/run.ts +12 -2
- package/src/runtime/scheduler.ts +9 -29
- package/src/runtime/to-vnode.ts +85 -23
- package/src/runtime/vdom.ts +91 -69
- package/src/runtime/vnode.ts +192 -88
- package/src/{components/select → select}/README.md +29 -19
- package/src/select/index.tsx +159 -0
- package/src/{components/select/select.tsx → select/primitives.tsx} +10 -98
- package/src/server/stream.ts +25 -31
- package/src/shared/focus-styles.ts +2 -0
- package/src/shared/icons.tsx +62 -0
- package/src/shared/listbox-popover-styles.ts +146 -0
- package/src/shared/style-values.ts +165 -0
- package/src/style/style.ts +25 -6
- package/src/style/stylesheet.ts +32 -57
- package/src/tabs/README.md +141 -0
- package/src/tabs/index.tsx +245 -0
- package/src/tabs/primitives.ts +365 -0
- package/src/test/README.md +151 -60
- package/src/toggle/README.md +56 -0
- package/src/toggle/index.tsx +136 -0
- package/src/toggle/primitives.ts +192 -0
- package/dist/animation/demos/animation.demo.d.ts +0 -5
- package/dist/animation/demos/animation.demo.js +0 -92
- package/dist/animation/demos/animation.demo.js.map +0 -1
- package/dist/animation/demos/spring.demo.d.ts +0 -6
- package/dist/animation/demos/spring.demo.js +0 -304
- package/dist/animation/demos/spring.demo.js.map +0 -1
- package/dist/components/accordion/accordion.d.ts +0 -92
- package/dist/components/accordion/accordion.js +0 -335
- package/dist/components/accordion/accordion.js.map +0 -1
- package/dist/components/accordion/demos/card.demo.d.ts +0 -7
- package/dist/components/accordion/demos/card.demo.js +0 -59
- package/dist/components/accordion/demos/card.demo.js.map +0 -1
- package/dist/components/accordion/demos/multiple.demo.d.ts +0 -7
- package/dist/components/accordion/demos/multiple.demo.js +0 -20
- package/dist/components/accordion/demos/multiple.demo.js.map +0 -1
- package/dist/components/accordion/demos/overview.demo.d.ts +0 -7
- package/dist/components/accordion/demos/overview.demo.js +0 -20
- package/dist/components/accordion/demos/overview.demo.js.map +0 -1
- package/dist/components/anchor/anchor.js.map +0 -1
- package/dist/components/breadcrumbs/basic.demo.d.ts +0 -6
- package/dist/components/breadcrumbs/basic.demo.js +0 -15
- package/dist/components/breadcrumbs/basic.demo.js.map +0 -1
- package/dist/components/breadcrumbs/breadcrumbs.js.map +0 -1
- package/dist/components/breadcrumbs/separator.demo.d.ts +0 -6
- package/dist/components/breadcrumbs/separator.demo.js +0 -15
- package/dist/components/breadcrumbs/separator.demo.js.map +0 -1
- package/dist/components/button/button.d.ts +0 -105
- package/dist/components/button/button.js +0 -207
- package/dist/components/button/button.js.map +0 -1
- package/dist/components/button/demos/aliases.demo.d.ts +0 -7
- package/dist/components/button/demos/aliases.demo.js +0 -19
- package/dist/components/button/demos/aliases.demo.js.map +0 -1
- package/dist/components/button/demos/basic.demo.d.ts +0 -7
- package/dist/components/button/demos/basic.demo.js +0 -20
- package/dist/components/button/demos/basic.demo.js.map +0 -1
- package/dist/components/button/demos/states.demo.d.ts +0 -7
- package/dist/components/button/demos/states.demo.js +0 -30
- package/dist/components/button/demos/states.demo.js.map +0 -1
- package/dist/components/combobox/combobox.js.map +0 -1
- package/dist/components/combobox/overview.demo.d.ts +0 -7
- package/dist/components/combobox/overview.demo.js +0 -154
- package/dist/components/combobox/overview.demo.js.map +0 -1
- package/dist/components/glyph/glyph.d.ts +0 -14
- package/dist/components/glyph/glyph.js +0 -65
- package/dist/components/glyph/glyph.js.map +0 -1
- package/dist/components/listbox/listbox.js.map +0 -1
- package/dist/components/listbox/overview.demo.d.ts +0 -7
- package/dist/components/listbox/overview.demo.js +0 -65
- package/dist/components/listbox/overview.demo.js.map +0 -1
- package/dist/components/menu/demos/bubbling.demo.d.ts +0 -6
- package/dist/components/menu/demos/bubbling.demo.js +0 -16
- package/dist/components/menu/demos/bubbling.demo.js.map +0 -1
- package/dist/components/menu/demos/context-trigger.demo.d.ts +0 -7
- package/dist/components/menu/demos/context-trigger.demo.js +0 -87
- package/dist/components/menu/demos/context-trigger.demo.js.map +0 -1
- package/dist/components/menu/demos/overview.demo.d.ts +0 -7
- package/dist/components/menu/demos/overview.demo.js +0 -33
- package/dist/components/menu/demos/overview.demo.js.map +0 -1
- package/dist/components/menu/hover-aim.js.map +0 -1
- package/dist/components/menu/menu.js.map +0 -1
- package/dist/components/popover/overview.demo.d.ts +0 -7
- package/dist/components/popover/overview.demo.js +0 -65
- package/dist/components/popover/overview.demo.js.map +0 -1
- package/dist/components/popover/popover.js.map +0 -1
- package/dist/components/select/deconstructed.demo.d.ts +0 -7
- package/dist/components/select/deconstructed.demo.js +0 -54
- package/dist/components/select/deconstructed.demo.js.map +0 -1
- package/dist/components/select/overview.demo.d.ts +0 -6
- package/dist/components/select/overview.demo.js +0 -28
- package/dist/components/select/overview.demo.js.map +0 -1
- package/dist/components/select/select.js.map +0 -1
- package/dist/components/separator/separator.d.ts +0 -2
- package/dist/components/separator/separator.js +0 -15
- package/dist/components/separator/separator.js.map +0 -1
- package/dist/components/tabs/tabs.d.ts +0 -78
- package/dist/components/tabs/tabs.js +0 -339
- package/dist/components/tabs/tabs.js.map +0 -1
- package/dist/interactions/keydown/keydown.js.map +0 -1
- package/dist/interactions/outside-click/outside-click-mixin.js.map +0 -1
- package/dist/interactions/typeahead/typeahead-mixin.js.map +0 -1
- package/dist/runtime/demos/basic.demo.d.ts +0 -6
- package/dist/runtime/demos/basic.demo.js +0 -16
- package/dist/runtime/demos/basic.demo.js.map +0 -1
- package/dist/runtime/demos/controlled-uncontrolled-values.demo.d.ts +0 -6
- package/dist/runtime/demos/controlled-uncontrolled-values.demo.js +0 -77
- package/dist/runtime/demos/controlled-uncontrolled-values.demo.js.map +0 -1
- package/dist/runtime/demos/keyed-list.demo.d.ts +0 -6
- package/dist/runtime/demos/keyed-list.demo.js +0 -62
- package/dist/runtime/demos/keyed-list.demo.js.map +0 -1
- package/dist/runtime/demos/readme.demo.d.ts +0 -5
- package/dist/runtime/demos/readme.demo.js +0 -396
- package/dist/runtime/demos/readme.demo.js.map +0 -1
- package/dist/theme/contract.d.ts +0 -61
- package/dist/theme/contract.js +0 -131
- package/dist/theme/contract.js.map +0 -1
- package/dist/theme/glyph-contract.d.ts +0 -11
- package/dist/theme/glyph-contract.js +0 -34
- package/dist/theme/glyph-contract.js.map +0 -1
- package/dist/theme/presets/rmx-01/glyphs.d.ts +0 -2
- package/dist/theme/presets/rmx-01/glyphs.js +0 -252
- package/dist/theme/presets/rmx-01/glyphs.js.map +0 -1
- package/dist/theme/presets/rmx-01/index.d.ts +0 -4
- package/dist/theme/presets/rmx-01/index.js +0 -119
- package/dist/theme/presets/rmx-01/index.js.map +0 -1
- package/dist/theme/runtime.d.ts +0 -2
- package/dist/theme/runtime.js +0 -84
- package/dist/theme/runtime.js.map +0 -1
- package/dist/theme/theme.d.ts +0 -6
- package/dist/theme/theme.js +0 -5
- package/dist/theme/theme.js.map +0 -1
- package/dist/utils/flash-attribute.js.map +0 -1
- package/dist/utils/scroll-lock.d.ts +0 -3
- package/dist/utils/scroll-lock.js.map +0 -1
- package/dist/utils/wait-for-css-transition.js.map +0 -1
- package/dist/utils/wait.js.map +0 -1
- package/src/animation/demos/animation.demo.tsx +0 -194
- package/src/animation/demos/spring.demo.tsx +0 -385
- package/src/components/accordion/accordion.tsx +0 -565
- package/src/components/accordion/demos/card.demo.tsx +0 -114
- package/src/components/accordion/demos/multiple.demo.tsx +0 -57
- package/src/components/accordion/demos/overview.demo.tsx +0 -57
- package/src/components/breadcrumbs/basic.demo.tsx +0 -18
- package/src/components/breadcrumbs/separator.demo.tsx +0 -19
- package/src/components/button/README.md +0 -44
- package/src/components/button/button.tsx +0 -286
- package/src/components/button/demos/aliases.demo.tsx +0 -28
- package/src/components/button/demos/basic.demo.tsx +0 -31
- package/src/components/button/demos/states.demo.tsx +0 -53
- package/src/components/combobox/overview.demo.tsx +0 -200
- package/src/components/glyph/README.md +0 -72
- package/src/components/glyph/glyph.tsx +0 -110
- package/src/components/listbox/overview.demo.tsx +0 -102
- package/src/components/menu/demos/bubbling.demo.tsx +0 -35
- package/src/components/menu/demos/context-trigger.demo.tsx +0 -133
- package/src/components/menu/demos/overview.demo.tsx +0 -77
- package/src/components/popover/overview.demo.tsx +0 -144
- package/src/components/select/deconstructed.demo.tsx +0 -96
- package/src/components/select/overview.demo.tsx +0 -52
- package/src/components/separator/separator.ts +0 -19
- package/src/components/tabs/README.md +0 -105
- package/src/components/tabs/tabs.tsx +0 -504
- package/src/runtime/demos/basic.demo.tsx +0 -21
- package/src/runtime/demos/controlled-uncontrolled-values.demo.tsx +0 -177
- package/src/runtime/demos/keyed-list.demo.tsx +0 -94
- package/src/theme/README.md +0 -103
- package/src/theme/contract.ts +0 -215
- package/src/theme/glyph-contract.ts +0 -59
- package/src/theme/presets/rmx-01/glyphs.tsx +0 -308
- package/src/theme/presets/rmx-01/index.ts +0 -123
- package/src/theme/runtime.ts +0 -119
- package/src/theme/theme.ts +0 -15
- package/src/utils/scroll-lock/README.md +0 -33
- /package/dist/{components/anchor/anchor.d.ts → anchor/index.d.ts} +0 -0
- /package/dist/{components/breadcrumbs/breadcrumbs.d.ts → breadcrumbs/index.d.ts} +0 -0
- /package/dist/{utils → listbox}/flash-attribute.d.ts +0 -0
- /package/dist/{utils → listbox}/flash-attribute.js +0 -0
- /package/dist/{components/menu → menu}/hover-aim.d.ts +0 -0
- /package/dist/{components/menu → menu}/hover-aim.js +0 -0
- /package/dist/{interactions/outside-click/outside-click-mixin.d.ts → popover/outside-click.d.ts} +0 -0
- /package/dist/{interactions/keydown → select}/keydown.d.ts +0 -0
- /package/dist/{interactions/keydown → select}/keydown.js +0 -0
- /package/dist/{interactions/typeahead/typeahead-mixin.d.ts → shared/typeahead.d.ts} +0 -0
- /package/dist/{utils → shared}/wait-for-css-transition.d.ts +0 -0
- /package/dist/{utils → shared}/wait-for-css-transition.js +0 -0
- /package/dist/{utils → shared}/wait.d.ts +0 -0
- /package/dist/{utils → shared}/wait.js +0 -0
- /package/src/{components/anchor/anchor.ts → anchor/index.ts} +0 -0
- /package/src/{utils → listbox}/flash-attribute.ts +0 -0
- /package/src/{components/menu → menu}/hover-aim.ts +0 -0
- /package/src/{interactions/outside-click/outside-click-mixin.ts → popover/outside-click.ts} +0 -0
- /package/src/{interactions/keydown → select}/keydown.ts +0 -0
- /package/src/{interactions/typeahead/typeahead-mixin.ts → shared/typeahead.ts} +0 -0
- /package/src/{utils → shared}/wait-for-css-transition.ts +0 -0
- /package/src/{utils → shared}/wait.ts +0 -0
package/dist/runtime/to-vnode.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Fragment } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Fragment } from './component.js';
|
|
2
|
+
import { Frame } from './component.js';
|
|
3
|
+
import { invariant } from './invariant.js';
|
|
4
|
+
import { isEmptyChild, isPrimitiveChild, isRemixNode, normalizeChildren } from './core/children.js';
|
|
5
|
+
import { isMixinDescriptor } from './mixins/mixin.js';
|
|
6
|
+
import { isRemixElement, NON_RENDER_NODE, TEXT_NODE, } from './vnode.js';
|
|
7
|
+
function flatMapChildrenToVNodes(props) {
|
|
8
|
+
let children = props.children;
|
|
9
|
+
if (children === undefined)
|
|
7
10
|
return [];
|
|
8
|
-
let children = node.props.children;
|
|
9
11
|
if (!Array.isArray(children))
|
|
10
12
|
return [toVNode(children)];
|
|
11
13
|
let vnodes = [];
|
|
@@ -13,30 +15,76 @@ function flatMapChildrenToVNodes(node) {
|
|
|
13
15
|
return vnodes;
|
|
14
16
|
}
|
|
15
17
|
function flattenChildrenToVNodes(nodes, out) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
let children = normalizeChildren(nodes);
|
|
19
|
+
for (let i = 0; i < children.length; i++) {
|
|
20
|
+
out.push(toVNode(children[i]));
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
export function toVNode(node) {
|
|
21
24
|
if (isEmptyChild(node)) {
|
|
22
|
-
return { type: NON_RENDER_NODE };
|
|
25
|
+
return { kind: 'empty', type: NON_RENDER_NODE };
|
|
23
26
|
}
|
|
24
27
|
if (isPrimitiveChild(node)) {
|
|
25
|
-
return { type: TEXT_NODE, _text: String(node) };
|
|
28
|
+
return { kind: 'text', type: TEXT_NODE, _text: String(node) };
|
|
29
|
+
}
|
|
30
|
+
if (isRemixElement(node)) {
|
|
31
|
+
if (node.type === Fragment) {
|
|
32
|
+
let props = parseHostProps(node.props);
|
|
33
|
+
return {
|
|
34
|
+
kind: 'fragment',
|
|
35
|
+
type: Fragment,
|
|
36
|
+
key: node.key,
|
|
37
|
+
_children: flatMapChildrenToVNodes(props),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
if (node.type === Frame) {
|
|
41
|
+
invariant(isFrameProps(node.props), '<Frame /> requires a src prop');
|
|
42
|
+
return { kind: 'frame', type: Frame, key: node.key, props: node.props };
|
|
43
|
+
}
|
|
44
|
+
if (typeof node.type === 'string') {
|
|
45
|
+
let props = parseHostProps(node.props);
|
|
46
|
+
// When innerHTML is set, ignore children
|
|
47
|
+
let children = props.innerHTML != null ? [] : flatMapChildrenToVNodes(props);
|
|
48
|
+
return {
|
|
49
|
+
kind: 'host',
|
|
50
|
+
type: node.type,
|
|
51
|
+
key: node.key,
|
|
52
|
+
props,
|
|
53
|
+
_children: children,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
invariant(isElementFunction(node.type), 'Expected component element type');
|
|
57
|
+
return { kind: 'component', type: node.type, key: node.key, props: node.props };
|
|
26
58
|
}
|
|
27
59
|
if (Array.isArray(node)) {
|
|
28
60
|
let children = [];
|
|
29
61
|
flattenChildrenToVNodes(node, children);
|
|
30
|
-
return { type: Fragment, _children: children };
|
|
31
|
-
}
|
|
32
|
-
if (node.type === Fragment) {
|
|
33
|
-
return { type: Fragment, key: node.key, _children: flatMapChildrenToVNodes(node) };
|
|
34
|
-
}
|
|
35
|
-
if (isRemixElement(node)) {
|
|
36
|
-
// When innerHTML is set, ignore children
|
|
37
|
-
let children = node.props.innerHTML != null ? [] : flatMapChildrenToVNodes(node);
|
|
38
|
-
return { type: node.type, key: node.key, props: node.props, _children: children };
|
|
62
|
+
return { kind: 'fragment', type: Fragment, _children: children };
|
|
39
63
|
}
|
|
40
64
|
invariant(false, 'Unexpected RemixNode');
|
|
41
65
|
}
|
|
66
|
+
function isFrameProps(props) {
|
|
67
|
+
return typeof props.src === 'string' && props.src.length > 0;
|
|
68
|
+
}
|
|
69
|
+
function parseHostProps(props) {
|
|
70
|
+
let children = props.children;
|
|
71
|
+
invariant(children === undefined || isRemixNode(children), 'Invalid host children');
|
|
72
|
+
let innerHTML = props.innerHTML;
|
|
73
|
+
invariant(innerHTML === undefined || typeof innerHTML === 'string', 'Invalid innerHTML prop');
|
|
74
|
+
let mix = props.mix;
|
|
75
|
+
invariant(mix === undefined || isRuntimeMixValue(mix), 'Invalid mix prop');
|
|
76
|
+
return props;
|
|
77
|
+
}
|
|
78
|
+
function isRuntimeMixValue(value) {
|
|
79
|
+
if (!Array.isArray(value))
|
|
80
|
+
return isMixinDescriptor(value);
|
|
81
|
+
for (let descriptor of value) {
|
|
82
|
+
if (!isMixinDescriptor(descriptor))
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
function isElementFunction(value) {
|
|
88
|
+
return typeof value === 'function';
|
|
89
|
+
}
|
|
42
90
|
//# sourceMappingURL=to-vnode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-vnode.js","sourceRoot":"","sources":["../../src/runtime/to-vnode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"to-vnode.js","sourceRoot":"","sources":["../../src/runtime/to-vnode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAInG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EACL,cAAc,EACd,eAAe,EACf,SAAS,GAIV,MAAM,YAAY,CAAA;AAEnB,SAAS,uBAAuB,CAAC,KAAuB;IACtD,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAA;IAC7B,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,EAAE,CAAA;IACrC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAAE,OAAO,CAAC,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C;AAED,SAAS,YAAY,CAAC,KAA0B;IAC9C,OAAO,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAA;AAC9D,CAAC;AAED,SAAS,cAAc,CAAC,KAA0B;IAChD,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAA;IAC7B,SAAS,CAAC,QAAQ,KAAK,SAAS,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE,uBAAuB,CAAC,CAAA;IAEnF,IAAI,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;IAC/B,SAAS,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,wBAAwB,CAAC,CAAA;IAE7F,IAAI,GAAG,GAAG,KAAK,CAAC,GAAG,CAAA;IACnB,SAAS,CAAC,GAAG,KAAK,SAAS,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE,kBAAkB,CAAC,CAAA;IAC1E,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAA;IAC1D,KAAK,IAAI,UAAU,IAAI,KAAK,EAAE,CAAC;QAC7B,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;YAAE,OAAO,KAAK,CAAA;IAClD,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,UAAU,CAAA;AACpC,CAAC"}
|
package/dist/runtime/vdom.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FrameHandle } from './component.ts';
|
|
2
2
|
import type { RemixNode } from './jsx.ts';
|
|
3
|
+
import { type ResolveFrame } from './frame.ts';
|
|
3
4
|
import { type ComponentErrorEvent } from './error-event.ts';
|
|
4
5
|
import { createScheduler, type Scheduler } from './scheduler.ts';
|
|
5
6
|
import { diffVNodes } from './reconcile.ts';
|
|
@@ -18,6 +19,7 @@ export type VirtualRootEventMap = {
|
|
|
18
19
|
*/
|
|
19
20
|
export type VirtualRoot = TypedEventTarget<VirtualRootEventMap> & {
|
|
20
21
|
render: (element: RemixNode) => void;
|
|
22
|
+
reconcile: () => void;
|
|
21
23
|
dispose: () => void;
|
|
22
24
|
flush: () => void;
|
|
23
25
|
};
|
|
@@ -30,7 +32,7 @@ export type VirtualRootOptions = {
|
|
|
30
32
|
styleManager?: StyleManager;
|
|
31
33
|
frameInit?: {
|
|
32
34
|
src?: string;
|
|
33
|
-
resolveFrame:
|
|
35
|
+
resolveFrame: ResolveFrame;
|
|
34
36
|
loadModule?: (moduleUrl: string, exportName: string) => Promise<Function> | Function;
|
|
35
37
|
};
|
|
36
38
|
};
|
package/dist/runtime/vdom.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { createFrameHandle } from
|
|
2
|
-
import { invariant } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { createFrameHandle } from './component.js';
|
|
2
|
+
import { invariant } from './invariant.js';
|
|
3
|
+
import { createFrameRuntime } from './frame.js';
|
|
4
|
+
import { createComponentErrorEvent, getComponentError, } from './error-event.js';
|
|
5
|
+
import { createScheduler } from './scheduler.js';
|
|
6
|
+
import { diffVNodes, remove as removeVNode } from './reconcile.js';
|
|
7
|
+
import { toVNode } from './to-vnode.js';
|
|
8
|
+
import { TypedEventTarget } from './typed-event-target.js';
|
|
9
|
+
import { ROOT_VNODE } from './vnode.js';
|
|
10
|
+
import { resetStyleState, defaultStyleManager } from './diff-props.js';
|
|
11
|
+
import { registerRoot, unregisterRoot } from './refresh.js';
|
|
10
12
|
export { createScheduler };
|
|
11
13
|
export { diffVNodes, toVNode };
|
|
12
14
|
export { resetStyleState };
|
|
@@ -29,6 +31,7 @@ function getHydrationComponentIdFromRangeStart(start) {
|
|
|
29
31
|
export function createRangeRoot(boundaries, options = {}) {
|
|
30
32
|
let [start, end] = boundaries;
|
|
31
33
|
let vroot = null;
|
|
34
|
+
let currentElement;
|
|
32
35
|
let styles = options.styleManager ?? defaultStyleManager;
|
|
33
36
|
let container = end.parentNode;
|
|
34
37
|
invariant(container, 'Expected parent node');
|
|
@@ -46,6 +49,12 @@ export function createRangeRoot(boundaries, options = {}) {
|
|
|
46
49
|
scheduler,
|
|
47
50
|
styleManager: styles,
|
|
48
51
|
});
|
|
52
|
+
let context = {
|
|
53
|
+
frame: frameStub,
|
|
54
|
+
scheduler,
|
|
55
|
+
styles,
|
|
56
|
+
rootTarget: eventTarget,
|
|
57
|
+
};
|
|
49
58
|
let isErrorForwardingAttached = false;
|
|
50
59
|
function forwardDomError(event) {
|
|
51
60
|
eventTarget.dispatchEvent(createComponentErrorEvent(getComponentError(event)));
|
|
@@ -63,12 +72,15 @@ export function createRangeRoot(boundaries, options = {}) {
|
|
|
63
72
|
isErrorForwardingAttached = false;
|
|
64
73
|
}
|
|
65
74
|
attachDomErrorForwarding();
|
|
66
|
-
|
|
75
|
+
let root = Object.assign(eventTarget, {
|
|
67
76
|
render(element) {
|
|
68
77
|
attachDomErrorForwarding();
|
|
78
|
+
currentElement = element;
|
|
69
79
|
let vnode = toVNode(element);
|
|
70
80
|
let vParent = {
|
|
81
|
+
kind: 'root',
|
|
71
82
|
type: ROOT_VNODE,
|
|
83
|
+
_children: [],
|
|
72
84
|
_svg: false,
|
|
73
85
|
_rangeStart: start,
|
|
74
86
|
_rangeEnd: end,
|
|
@@ -76,26 +88,37 @@ export function createRangeRoot(boundaries, options = {}) {
|
|
|
76
88
|
};
|
|
77
89
|
scheduler.enqueueWork([
|
|
78
90
|
() => {
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
let cursor = hydrationCursor === null ? undefined : { current: hydrationCursor };
|
|
92
|
+
let committed = diffVNodes(vroot, vnode, parent, vParent, context, end, cursor);
|
|
93
|
+
vParent._children = [committed];
|
|
94
|
+
vroot = committed;
|
|
81
95
|
hydrationCursor = null;
|
|
82
96
|
},
|
|
83
97
|
]);
|
|
84
98
|
scheduler.dequeue();
|
|
85
99
|
},
|
|
100
|
+
reconcile() {
|
|
101
|
+
if (currentElement === undefined)
|
|
102
|
+
return;
|
|
103
|
+
root.render(currentElement);
|
|
104
|
+
},
|
|
86
105
|
dispose() {
|
|
87
106
|
detachDomErrorForwarding();
|
|
107
|
+
unregisterRoot(root);
|
|
108
|
+
currentElement = undefined;
|
|
88
109
|
if (!vroot)
|
|
89
110
|
return;
|
|
90
111
|
let current = vroot;
|
|
91
112
|
vroot = null;
|
|
92
|
-
scheduler.enqueueWork([() => removeVNode(current, parent,
|
|
113
|
+
scheduler.enqueueWork([() => removeVNode(current, parent, context)]);
|
|
93
114
|
scheduler.dequeue();
|
|
94
115
|
},
|
|
95
116
|
flush() {
|
|
96
117
|
scheduler.dequeue();
|
|
97
118
|
},
|
|
98
119
|
});
|
|
120
|
+
registerRoot(root);
|
|
121
|
+
return root;
|
|
99
122
|
}
|
|
100
123
|
/**
|
|
101
124
|
* Creates a virtual root for a host container element.
|
|
@@ -106,7 +129,14 @@ export function createRangeRoot(boundaries, options = {}) {
|
|
|
106
129
|
*/
|
|
107
130
|
export function createRoot(container, options = {}) {
|
|
108
131
|
let vroot = null;
|
|
132
|
+
let currentElement;
|
|
109
133
|
let styles = options.styleManager ?? defaultStyleManager;
|
|
134
|
+
if (container.innerHTML.trim() !== '') {
|
|
135
|
+
// Adopt additively: multiple roots hydrating separate islands may share
|
|
136
|
+
// the default style manager, and adopting a later island must not release
|
|
137
|
+
// the server styles an earlier island still depends on.
|
|
138
|
+
styles.adoptServerStyles(container);
|
|
139
|
+
}
|
|
110
140
|
let hydrationCursor = container.innerHTML.trim() !== '' ? container.firstChild : undefined;
|
|
111
141
|
let eventTarget = new TypedEventTarget();
|
|
112
142
|
let scheduler = options.scheduler ?? createScheduler(container.ownerDocument ?? document, eventTarget, styles);
|
|
@@ -119,6 +149,12 @@ export function createRoot(container, options = {}) {
|
|
|
119
149
|
scheduler,
|
|
120
150
|
styleManager: styles,
|
|
121
151
|
});
|
|
152
|
+
let context = {
|
|
153
|
+
frame: frameStub,
|
|
154
|
+
scheduler,
|
|
155
|
+
styles,
|
|
156
|
+
rootTarget: eventTarget,
|
|
157
|
+
};
|
|
122
158
|
let isErrorForwardingAttached = false;
|
|
123
159
|
function forwardDomError(event) {
|
|
124
160
|
eventTarget.dispatchEvent(createComponentErrorEvent(getComponentError(event)));
|
|
@@ -136,63 +172,75 @@ export function createRoot(container, options = {}) {
|
|
|
136
172
|
isErrorForwardingAttached = false;
|
|
137
173
|
}
|
|
138
174
|
attachDomErrorForwarding();
|
|
139
|
-
|
|
175
|
+
let root = Object.assign(eventTarget, {
|
|
140
176
|
render(element) {
|
|
141
177
|
attachDomErrorForwarding();
|
|
178
|
+
currentElement = element;
|
|
142
179
|
let vnode = toVNode(element);
|
|
143
|
-
let vParent = {
|
|
180
|
+
let vParent = {
|
|
181
|
+
kind: 'root',
|
|
182
|
+
type: ROOT_VNODE,
|
|
183
|
+
_children: [],
|
|
184
|
+
_svg: false,
|
|
185
|
+
};
|
|
144
186
|
scheduler.enqueueWork([
|
|
145
187
|
() => {
|
|
146
|
-
|
|
147
|
-
|
|
188
|
+
let cursor = hydrationCursor === undefined ? undefined : { current: hydrationCursor };
|
|
189
|
+
let committed = diffVNodes(vroot, vnode, container, vParent, context, undefined, cursor);
|
|
190
|
+
vParent._children = [committed];
|
|
191
|
+
vroot = committed;
|
|
148
192
|
hydrationCursor = undefined;
|
|
149
193
|
},
|
|
150
194
|
]);
|
|
151
195
|
scheduler.dequeue();
|
|
152
196
|
},
|
|
197
|
+
reconcile() {
|
|
198
|
+
if (currentElement === undefined)
|
|
199
|
+
return;
|
|
200
|
+
root.render(currentElement);
|
|
201
|
+
},
|
|
153
202
|
dispose() {
|
|
154
203
|
detachDomErrorForwarding();
|
|
204
|
+
unregisterRoot(root);
|
|
205
|
+
currentElement = undefined;
|
|
155
206
|
if (!vroot)
|
|
156
207
|
return;
|
|
157
208
|
let current = vroot;
|
|
158
209
|
vroot = null;
|
|
159
|
-
scheduler.enqueueWork([() => removeVNode(current, container,
|
|
210
|
+
scheduler.enqueueWork([() => removeVNode(current, container, context)]);
|
|
160
211
|
scheduler.dequeue();
|
|
161
212
|
},
|
|
162
213
|
flush() {
|
|
163
214
|
scheduler.dequeue();
|
|
164
215
|
},
|
|
165
216
|
});
|
|
217
|
+
registerRoot(root);
|
|
218
|
+
return root;
|
|
166
219
|
}
|
|
167
220
|
function createRootFrameHandle(init) {
|
|
168
221
|
let resolveFrame = init.resolveFrame ??
|
|
169
222
|
(() => {
|
|
170
223
|
throw new Error('Cannot render <Frame /> without frame runtime. Use run() or pass frameInit to createRoot/createRangeRoot.');
|
|
171
224
|
});
|
|
172
|
-
let
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
moduleCache: new Map(),
|
|
188
|
-
moduleLoads: new Map(),
|
|
189
|
-
frameInstances: new WeakMap(),
|
|
190
|
-
namedFrames: new Map(),
|
|
191
|
-
},
|
|
225
|
+
let runtime = createFrameRuntime({
|
|
226
|
+
topFrame: undefined,
|
|
227
|
+
loadModule: init.loadModule ??
|
|
228
|
+
(() => {
|
|
229
|
+
throw new Error('loadModule is required to hydrate client entries inside <Frame />');
|
|
230
|
+
}),
|
|
231
|
+
resolveFrame,
|
|
232
|
+
errorTarget: init.errorTarget,
|
|
233
|
+
pendingClientEntries: new Map(),
|
|
234
|
+
scheduler: init.scheduler,
|
|
235
|
+
styleManager: init.styleManager,
|
|
236
|
+
moduleCache: new Map(),
|
|
237
|
+
moduleLoads: new Map(),
|
|
238
|
+
frameInstances: new WeakMap(),
|
|
239
|
+
namedFrames: new Map(),
|
|
192
240
|
});
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
241
|
+
runtime.canResolveFrames = !!init.resolveFrame;
|
|
242
|
+
let frame = createFrameHandle({ src: init.src ?? '/', $runtime: runtime });
|
|
243
|
+
runtime.topFrame = frame;
|
|
196
244
|
return frame;
|
|
197
245
|
}
|
|
198
246
|
//# sourceMappingURL=vdom.js.map
|
package/dist/runtime/vdom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vdom.js","sourceRoot":"","sources":["../../src/runtime/vdom.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAElB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,eAAe,EAAkB,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"vdom.js","sourceRoot":"","sources":["../../src/runtime/vdom.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,kBAAkB,EAAqB,MAAM,YAAY,CAAA;AAClE,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAElB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,eAAe,EAA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,GAAG,kBAAkB,CAAC;QAC/B,QAAQ,EAAE,SAAS;QACnB,UAAU,EACR,IAAI,CAAC,UAAU;YACf,CAAC,GAAG,EAAE;gBACJ,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAA;YACtF,CAAC,CAAC;QACJ,YAAY;QACZ,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,oBAAoB,EAAE,IAAI,GAAG,EAAE;QAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,WAAW,EAAE,IAAI,GAAG,EAAE;QACtB,WAAW,EAAE,IAAI,GAAG,EAAE;QACtB,cAAc,EAAE,IAAI,OAAO,EAAE;QAC7B,WAAW,EAAE,IAAI,GAAG,EAAE;KACvB,CAAC,CAAA;IACF,OAAO,CAAC,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,YAAY,CAAA;IAC9C,IAAI,KAAK,GAAG,iBAAiB,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAA;IAC1E,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAA;IACxB,OAAO,KAAK,CAAA;AACd,CAAC"}
|
package/dist/runtime/vnode.d.ts
CHANGED
|
@@ -1,85 +1,156 @@
|
|
|
1
|
-
import type { ComponentHandle,
|
|
2
|
-
import { Fragment, Frame } from './component.ts';
|
|
1
|
+
import type { ComponentHandle, Fragment, Frame, FrameHandle, FrameProps } from './component.ts';
|
|
3
2
|
import { isRemixElement } from './core/vnode.ts';
|
|
4
|
-
import type {
|
|
3
|
+
import type { Frame as FrameInstance } from './frame.ts';
|
|
4
|
+
import type { RemixNode } from './jsx.ts';
|
|
5
|
+
import type { ElementFunction } from './element-function.ts';
|
|
6
|
+
import type { Key } from './key.ts';
|
|
7
|
+
import type { MixinRuntimeState, MixinRuntimeValue } from './mixins/mixin.ts';
|
|
8
|
+
import type { OnMixinDescriptor } from './mixins/on-mixin.ts';
|
|
9
|
+
import type { Scheduler } from './scheduler.ts';
|
|
10
|
+
import type { StyleManager } from '../style/index.ts';
|
|
5
11
|
export { isRemixElement };
|
|
6
12
|
export declare const TEXT_NODE: unique symbol;
|
|
7
13
|
export declare const NON_RENDER_NODE: unique symbol;
|
|
8
14
|
export declare const ROOT_VNODE: unique symbol;
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
_pendingHydrationComponentId?: string;
|
|
27
|
-
_frameInstance?: unknown;
|
|
28
|
-
_frameFallbackRoot?: {
|
|
29
|
-
render: (element: RemixNode) => void;
|
|
30
|
-
dispose: () => void;
|
|
31
|
-
};
|
|
32
|
-
_frameResolveToken?: number;
|
|
33
|
-
_frameResolveController?: AbortController;
|
|
34
|
-
_frameResolved?: boolean;
|
|
35
|
-
_text?: string;
|
|
36
|
-
_handle?: ComponentHandle;
|
|
37
|
-
_id?: string;
|
|
38
|
-
_content?: VNode;
|
|
39
|
-
_persistedByMixins?: boolean;
|
|
40
|
-
_persistedParentByMixins?: ParentNode;
|
|
41
|
-
_persistedRemovalToken?: number;
|
|
42
|
-
};
|
|
43
|
-
export type FragmentNode = VNode & {
|
|
44
|
-
type: typeof Fragment;
|
|
45
|
-
_children: VNode[];
|
|
46
|
-
};
|
|
47
|
-
export type TextNode = VNode & {
|
|
48
|
-
type: typeof TEXT_NODE;
|
|
15
|
+
export type VNodeKind = 'root' | 'empty' | 'text' | 'fragment' | 'host' | 'component' | 'frame';
|
|
16
|
+
export type RuntimeElementProps = {
|
|
17
|
+
[name: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
export type RuntimeHostProps = RuntimeElementProps & {
|
|
20
|
+
children?: RemixNode;
|
|
21
|
+
innerHTML?: string;
|
|
22
|
+
mix?: MixinRuntimeValue;
|
|
23
|
+
};
|
|
24
|
+
type InputNodeBase<kind extends VNodeKind, type> = {
|
|
25
|
+
kind: kind;
|
|
26
|
+
type: type;
|
|
27
|
+
key?: Key;
|
|
28
|
+
_parent?: never;
|
|
29
|
+
};
|
|
30
|
+
export type NonRenderNode = InputNodeBase<'empty', typeof NON_RENDER_NODE>;
|
|
31
|
+
export type TextNode = InputNodeBase<'text', typeof TEXT_NODE> & {
|
|
49
32
|
_text: string;
|
|
50
33
|
};
|
|
51
|
-
export type
|
|
52
|
-
|
|
34
|
+
export type FragmentNode = InputNodeBase<'fragment', typeof Fragment> & {
|
|
35
|
+
_children: VNodeInput[];
|
|
53
36
|
};
|
|
54
|
-
export type
|
|
37
|
+
export type HostNode = InputNodeBase<'host', string> & {
|
|
38
|
+
props: RuntimeHostProps;
|
|
39
|
+
_children: VNodeInput[];
|
|
40
|
+
};
|
|
41
|
+
export type ComponentNode = InputNodeBase<'component', ElementFunction> & {
|
|
42
|
+
props: RuntimeElementProps;
|
|
43
|
+
};
|
|
44
|
+
export type FrameNode = InputNodeBase<'frame', typeof Frame> & {
|
|
45
|
+
props: RuntimeElementProps & FrameProps;
|
|
46
|
+
};
|
|
47
|
+
export type VNodeInput = NonRenderNode | TextNode | FragmentNode | HostNode | ComponentNode | FrameNode;
|
|
48
|
+
type MountedNodeBase = {
|
|
49
|
+
_parent: VNodeParent;
|
|
50
|
+
_svg: boolean;
|
|
51
|
+
};
|
|
52
|
+
type CommittedNodeBase<kind extends VNodeKind, type> = {
|
|
53
|
+
kind: kind;
|
|
54
|
+
type: type;
|
|
55
|
+
key?: Key;
|
|
56
|
+
} & MountedNodeBase;
|
|
57
|
+
export type CommittedNonRenderNode = CommittedNodeBase<'empty', typeof NON_RENDER_NODE>;
|
|
58
|
+
export type CommittedTextNode = CommittedNodeBase<'text', typeof TEXT_NODE> & {
|
|
59
|
+
_text: string;
|
|
55
60
|
_dom: Text;
|
|
56
61
|
};
|
|
57
|
-
export type
|
|
62
|
+
export type ControlledReflectionState = {
|
|
63
|
+
disposed: boolean;
|
|
64
|
+
listenersAttached: boolean;
|
|
65
|
+
pendingRestoreVersion: number;
|
|
66
|
+
managesValue: boolean;
|
|
67
|
+
managesChecked: boolean;
|
|
68
|
+
hasControlledValue: boolean;
|
|
69
|
+
controlledValue: unknown;
|
|
70
|
+
hasControlledChecked: boolean;
|
|
71
|
+
controlledChecked: unknown;
|
|
72
|
+
onInput(): void;
|
|
73
|
+
onChange(): void;
|
|
74
|
+
};
|
|
75
|
+
export type DirectEventBinding = {
|
|
58
76
|
type: string;
|
|
59
|
-
|
|
60
|
-
|
|
77
|
+
handler: (event: Event, signal: AbortSignal) => void | Promise<void>;
|
|
78
|
+
capture: boolean;
|
|
79
|
+
stableHandler: ((event: Event) => void) | null;
|
|
80
|
+
reentry: AbortController | null;
|
|
81
|
+
};
|
|
82
|
+
export type DirectEventState = {
|
|
83
|
+
bindings: DirectEventBinding[];
|
|
84
|
+
};
|
|
85
|
+
export type HostPersistenceState = {
|
|
86
|
+
parent: ParentNode;
|
|
87
|
+
token: number;
|
|
61
88
|
};
|
|
62
|
-
export type CommittedHostNode =
|
|
89
|
+
export type CommittedHostNode = CommittedNodeBase<'host', string> & {
|
|
90
|
+
props: RuntimeHostProps;
|
|
91
|
+
_children: CommittedVNode[];
|
|
63
92
|
_dom: Element;
|
|
64
|
-
|
|
93
|
+
_mixedProps: RuntimeHostProps;
|
|
94
|
+
_mixState?: MixinRuntimeState;
|
|
95
|
+
_directEventDescriptors?: OnMixinDescriptor[];
|
|
96
|
+
_directEventState?: DirectEventState;
|
|
97
|
+
_controlledState?: ControlledReflectionState;
|
|
98
|
+
_persistence?: HostPersistenceState;
|
|
65
99
|
};
|
|
66
|
-
export type
|
|
67
|
-
|
|
68
|
-
props: ElementProps;
|
|
69
|
-
_handle: ComponentHandle;
|
|
100
|
+
export type CommittedFragmentNode = CommittedNodeBase<'fragment', typeof Fragment> & {
|
|
101
|
+
_children: CommittedVNode[];
|
|
70
102
|
};
|
|
71
|
-
export type
|
|
72
|
-
|
|
73
|
-
props: ElementProps;
|
|
74
|
-
_content: VNode;
|
|
103
|
+
export type MountingComponentNode = CommittedNodeBase<'component', ElementFunction> & {
|
|
104
|
+
props: RuntimeElementProps;
|
|
75
105
|
_handle: ComponentHandle;
|
|
106
|
+
_context: ReconcileContext;
|
|
107
|
+
};
|
|
108
|
+
export type CommittedComponentNode = MountingComponentNode & {
|
|
109
|
+
_content: CommittedVNode;
|
|
110
|
+
};
|
|
111
|
+
export interface FrameFallbackRoot {
|
|
112
|
+
render(element: RemixNode): void;
|
|
113
|
+
dispose(): void;
|
|
114
|
+
}
|
|
115
|
+
export type FrameMountState = {
|
|
116
|
+
instance: FrameInstance;
|
|
117
|
+
fallbackRoot?: FrameFallbackRoot;
|
|
118
|
+
resolveToken: number;
|
|
119
|
+
resolveController?: AbortController;
|
|
120
|
+
resolved: boolean;
|
|
121
|
+
};
|
|
122
|
+
export type CommittedFrameNode = CommittedNodeBase<'frame', typeof Frame> & {
|
|
123
|
+
props: RuntimeElementProps & FrameProps;
|
|
124
|
+
_rangeStart: Comment;
|
|
125
|
+
_rangeEnd: Comment;
|
|
126
|
+
_state: FrameMountState;
|
|
127
|
+
};
|
|
128
|
+
export type CommittedVNode = CommittedNonRenderNode | CommittedTextNode | CommittedFragmentNode | CommittedHostNode | CommittedComponentNode | CommittedFrameNode;
|
|
129
|
+
export type RootVNode = {
|
|
130
|
+
kind: 'root';
|
|
131
|
+
type: typeof ROOT_VNODE;
|
|
132
|
+
_children: CommittedVNode[];
|
|
133
|
+
_svg: boolean;
|
|
134
|
+
_rangeStart?: Node;
|
|
135
|
+
_rangeEnd?: Node;
|
|
136
|
+
_pendingHydrationComponentId?: string;
|
|
76
137
|
};
|
|
77
|
-
export
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
export
|
|
138
|
+
export interface ReconcileContext {
|
|
139
|
+
frame: FrameHandle;
|
|
140
|
+
scheduler: Scheduler;
|
|
141
|
+
styles: StyleManager;
|
|
142
|
+
rootTarget: EventTarget;
|
|
143
|
+
}
|
|
144
|
+
export type VNodeParent = RootVNode | CommittedFragmentNode | CommittedHostNode | MountingComponentNode | CommittedComponentNode;
|
|
145
|
+
export type VNode = VNodeInput | CommittedVNode | RootVNode | MountingComponentNode;
|
|
146
|
+
export declare function isFragmentNode(node: VNode): node is FragmentNode | CommittedFragmentNode;
|
|
147
|
+
export declare function isTextNode(node: VNode): node is TextNode | CommittedTextNode;
|
|
148
|
+
export declare function isNonRenderNode(node: VNode): node is NonRenderNode | CommittedNonRenderNode;
|
|
149
|
+
export declare function isCommittedTextNode(node: CommittedVNode): node is CommittedTextNode;
|
|
150
|
+
export declare function isHostNode(node: VNode): node is HostNode | CommittedHostNode;
|
|
151
|
+
export declare function isCommittedHostNode(node: CommittedVNode): node is CommittedHostNode;
|
|
152
|
+
export declare function isComponentNode(node: VNode): node is ComponentNode | MountingComponentNode | CommittedComponentNode;
|
|
84
153
|
export declare function isCommittedComponentNode(node: VNode): node is CommittedComponentNode;
|
|
85
|
-
export declare function
|
|
154
|
+
export declare function isFrameNode(node: VNode): node is FrameNode | CommittedFrameNode;
|
|
155
|
+
export declare function isCommittedFrameNode(node: CommittedVNode): node is CommittedFrameNode;
|
|
156
|
+
export declare function findContextFromAncestry(node: VNodeParent, type: ElementFunction): unknown;
|