@wardic/solid 2.1.2 → 3.0.0-next.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 +22 -18
- package/dist/browser/batch-reorder-places.js +3 -3
- package/dist/browser/batch-reorder.js +8 -5
- package/dist/browser/batch-reorder.js.map +1 -1
- package/dist/browser/config-view.js +33 -5
- package/dist/browser/config-view.js.map +1 -1
- package/dist/browser/create-animation-controls.js +22 -0
- package/dist/browser/create-animation-controls.js.map +1 -0
- package/dist/browser/create-batch.js +1 -1
- package/dist/browser/element-style.js +61 -7
- package/dist/browser/element-style.js.map +1 -1
- package/dist/browser/element.js +19 -2
- package/dist/browser/element.js.map +1 -1
- package/dist/browser/feature-section.js +5 -13
- package/dist/browser/feature-section.js.map +1 -1
- package/dist/browser/gesture-callbacks.js +3 -1
- package/dist/browser/gesture-callbacks.js.map +1 -1
- package/dist/browser/hooks/auto.js +270 -0
- package/dist/browser/hooks/auto.js.map +1 -0
- package/dist/browser/hooks/config-scope.js +120 -0
- package/dist/browser/hooks/config-scope.js.map +1 -0
- package/dist/browser/hooks/config.js +37 -0
- package/dist/browser/hooks/config.js.map +1 -0
- package/dist/browser/hooks/drag.js +632 -0
- package/dist/browser/hooks/drag.js.map +1 -0
- package/dist/browser/hooks/elements.js +183 -0
- package/dist/browser/hooks/elements.js.map +1 -0
- package/dist/browser/hooks/group.js +28 -0
- package/dist/browser/hooks/group.js.map +1 -0
- package/dist/browser/hooks/index.js +10 -0
- package/dist/browser/hooks/index.js.map +1 -0
- package/dist/browser/hooks/kept.js +32 -0
- package/dist/browser/hooks/kept.js.map +1 -0
- package/dist/browser/hooks/layout-group-of.js +39 -0
- package/dist/browser/hooks/layout-group-of.js.map +1 -0
- package/dist/browser/hooks/layout-group.js +92 -0
- package/dist/browser/hooks/layout-group.js.map +1 -0
- package/dist/browser/hooks/make-ward.js +157 -0
- package/dist/browser/hooks/make-ward.js.map +1 -0
- package/dist/browser/hooks/presence-scope.js +87 -0
- package/dist/browser/hooks/presence-scope.js.map +1 -0
- package/dist/browser/hooks/presence.js +24 -0
- package/dist/browser/hooks/presence.js.map +1 -0
- package/dist/browser/hooks/props.js +148 -0
- package/dist/browser/hooks/props.js.map +1 -0
- package/dist/browser/hooks/reads.js +241 -0
- package/dist/browser/hooks/reads.js.map +1 -0
- package/dist/browser/hooks/refs.js +87 -0
- package/dist/browser/hooks/refs.js.map +1 -0
- package/dist/browser/hooks/reorder-elements.js +268 -0
- package/dist/browser/hooks/reorder-elements.js.map +1 -0
- package/dist/browser/hooks/reorder.js +176 -0
- package/dist/browser/hooks/reorder.js.map +1 -0
- package/dist/browser/hooks/rune.js +799 -0
- package/dist/browser/hooks/rune.js.map +1 -0
- package/dist/browser/hooks/server-features.client.js +2 -0
- package/dist/browser/hooks/server-features.client.js.map +1 -0
- package/dist/browser/hooks/server-features.js +13 -0
- package/dist/browser/hooks/server-features.js.map +1 -0
- package/dist/browser/hooks/settings.js +29 -0
- package/dist/browser/hooks/settings.js.map +1 -0
- package/dist/browser/hooks/setup.js +154 -0
- package/dist/browser/hooks/setup.js.map +1 -0
- package/dist/browser/hooks/stage.js +117 -0
- package/dist/browser/hooks/stage.js.map +1 -0
- package/dist/browser/hooks/ward.js +2193 -0
- package/dist/browser/hooks/ward.js.map +1 -0
- package/dist/browser/hooks/wardic-provider.js +29 -0
- package/dist/browser/hooks/wardic-provider.js.map +1 -0
- package/dist/browser/hooks/wardic-scope.js +68 -0
- package/dist/browser/hooks/wardic-scope.js.map +1 -0
- package/dist/browser/hooks/wards.js +562 -0
- package/dist/browser/hooks/wards.js.map +1 -0
- package/dist/browser/index.js +24 -12
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/layout.js +7 -58
- package/dist/browser/layout.js.map +1 -1
- package/dist/browser/lazy-batch-gestures.js +1 -1
- package/dist/browser/lifecycle.js +59 -13
- package/dist/browser/lifecycle.js.map +1 -1
- package/dist/browser/motion-props.js +1 -1
- package/dist/browser/presence-handle.js +28 -12
- package/dist/browser/presence-handle.js.map +1 -1
- package/dist/browser/presence.js +3 -1
- package/dist/browser/presence.js.map +1 -1
- package/dist/browser/provider.js +85 -70
- package/dist/browser/provider.js.map +1 -1
- package/dist/browser/reorder-components.js +50 -0
- package/dist/browser/reorder-components.js.map +1 -0
- package/dist/browser/reorder.js +46 -274
- package/dist/browser/reorder.js.map +1 -1
- package/dist/browser/stage-ward.js +2 -2
- package/dist/browser/stage-ward.js.map +1 -1
- package/dist/browser/stage.js.map +1 -1
- package/dist/browser/unstable/v2/index.js +0 -8
- package/dist/browser/unstable/v2/index.js.map +1 -1
- package/dist/browser/v1/batch-reorder-group.js +4 -4
- package/dist/browser/v1/create-ward.js +3 -3
- package/dist/browser/v1/create-ward.js.map +1 -1
- package/dist/browser/v1/index.js +1 -1
- package/dist/browser/v1/index.js.map +1 -1
- package/dist/browser/v1/presence.js +1 -1
- package/dist/browser/v1/presence.js.map +1 -1
- package/dist/browser/variant-node.js +4 -2
- package/dist/browser/variant-node.js.map +1 -1
- package/dist/browser/w.js +33 -3
- package/dist/browser/w.js.map +1 -1
- package/dist/browser/ward.js +579 -52
- package/dist/browser/ward.js.map +1 -1
- package/dist/browser/wardic-config.js +62 -29
- package/dist/browser/wardic-config.js.map +1 -1
- package/dist/browser/wardic-context.js +23 -0
- package/dist/browser/wardic-context.js.map +1 -0
- package/dist/browser/wardic.js +3 -0
- package/dist/browser/wardic.js.map +1 -1
- package/dist/server/batch-reorder-places.js +3 -3
- package/dist/server/batch-reorder.js +8 -5
- package/dist/server/batch-reorder.js.map +1 -1
- package/dist/server/config-view.js +33 -5
- package/dist/server/config-view.js.map +1 -1
- package/dist/server/create-animation-controls.js +22 -0
- package/dist/server/create-animation-controls.js.map +1 -0
- package/dist/server/create-batch.js +1 -1
- package/dist/server/element-style.js +61 -7
- package/dist/server/element-style.js.map +1 -1
- package/dist/server/element.js +19 -2
- package/dist/server/element.js.map +1 -1
- package/dist/server/feature-section.js +5 -13
- package/dist/server/feature-section.js.map +1 -1
- package/dist/server/gesture-callbacks.js +3 -1
- package/dist/server/gesture-callbacks.js.map +1 -1
- package/dist/server/hooks/auto.js +270 -0
- package/dist/server/hooks/auto.js.map +1 -0
- package/dist/server/hooks/config-scope.js +120 -0
- package/dist/server/hooks/config-scope.js.map +1 -0
- package/dist/server/hooks/config.js +37 -0
- package/dist/server/hooks/config.js.map +1 -0
- package/dist/server/hooks/drag.js +632 -0
- package/dist/server/hooks/drag.js.map +1 -0
- package/dist/server/hooks/elements.js +192 -0
- package/dist/server/hooks/elements.js.map +1 -0
- package/dist/server/hooks/group.js +28 -0
- package/dist/server/hooks/group.js.map +1 -0
- package/dist/server/hooks/index.js +10 -0
- package/dist/server/hooks/index.js.map +1 -0
- package/dist/server/hooks/kept.js +32 -0
- package/dist/server/hooks/kept.js.map +1 -0
- package/dist/server/hooks/layout-group-of.js +39 -0
- package/dist/server/hooks/layout-group-of.js.map +1 -0
- package/dist/server/hooks/layout-group.js +109 -0
- package/dist/server/hooks/layout-group.js.map +1 -0
- package/dist/server/hooks/make-ward.js +157 -0
- package/dist/server/hooks/make-ward.js.map +1 -0
- package/dist/server/hooks/presence-scope.js +86 -0
- package/dist/server/hooks/presence-scope.js.map +1 -0
- package/dist/server/hooks/presence.js +24 -0
- package/dist/server/hooks/presence.js.map +1 -0
- package/dist/server/hooks/props.js +148 -0
- package/dist/server/hooks/props.js.map +1 -0
- package/dist/server/hooks/reads.js +241 -0
- package/dist/server/hooks/reads.js.map +1 -0
- package/dist/server/hooks/refs.js +87 -0
- package/dist/server/hooks/refs.js.map +1 -0
- package/dist/server/hooks/reorder-elements.js +308 -0
- package/dist/server/hooks/reorder-elements.js.map +1 -0
- package/dist/server/hooks/reorder.js +176 -0
- package/dist/server/hooks/reorder.js.map +1 -0
- package/dist/server/hooks/rune.js +799 -0
- package/dist/server/hooks/rune.js.map +1 -0
- package/dist/server/hooks/server-features.client.js +2 -0
- package/dist/server/hooks/server-features.client.js.map +1 -0
- package/dist/server/hooks/server-features.js +13 -0
- package/dist/server/hooks/server-features.js.map +1 -0
- package/dist/server/hooks/settings.js +29 -0
- package/dist/server/hooks/settings.js.map +1 -0
- package/dist/server/hooks/setup.js +154 -0
- package/dist/server/hooks/setup.js.map +1 -0
- package/dist/server/hooks/stage.js +117 -0
- package/dist/server/hooks/stage.js.map +1 -0
- package/dist/server/hooks/ward.js +2193 -0
- package/dist/server/hooks/ward.js.map +1 -0
- package/dist/server/hooks/wardic-provider.js +29 -0
- package/dist/server/hooks/wardic-provider.js.map +1 -0
- package/dist/server/hooks/wardic-scope.js +68 -0
- package/dist/server/hooks/wardic-scope.js.map +1 -0
- package/dist/server/hooks/wards.js +562 -0
- package/dist/server/hooks/wards.js.map +1 -0
- package/dist/server/index.js +24 -12
- package/dist/server/index.js.map +1 -1
- package/dist/server/layout.js +7 -75
- package/dist/server/layout.js.map +1 -1
- package/dist/server/lazy-batch-gestures.js +1 -1
- package/dist/server/lifecycle.js +59 -13
- package/dist/server/lifecycle.js.map +1 -1
- package/dist/server/motion-props.js +1 -1
- package/dist/server/presence-handle.js +28 -12
- package/dist/server/presence-handle.js.map +1 -1
- package/dist/server/presence.js +3 -1
- package/dist/server/presence.js.map +1 -1
- package/dist/server/provider.js +86 -80
- package/dist/server/provider.js.map +1 -1
- package/dist/server/reorder-components.js +50 -0
- package/dist/server/reorder-components.js.map +1 -0
- package/dist/server/reorder.js +46 -344
- package/dist/server/reorder.js.map +1 -1
- package/dist/server/stage-ward.js +2 -2
- package/dist/server/stage-ward.js.map +1 -1
- package/dist/server/stage.js.map +1 -1
- package/dist/server/unstable/v2/index.js +0 -8
- package/dist/server/unstable/v2/index.js.map +1 -1
- package/dist/server/v1/batch-reorder-group.js +4 -4
- package/dist/server/v1/create-ward.js +3 -3
- package/dist/server/v1/create-ward.js.map +1 -1
- package/dist/server/v1/index.js +1 -1
- package/dist/server/v1/index.js.map +1 -1
- package/dist/server/v1/presence.js +1 -1
- package/dist/server/v1/presence.js.map +1 -1
- package/dist/server/variant-node.js +4 -2
- package/dist/server/variant-node.js.map +1 -1
- package/dist/server/w.js +33 -3
- package/dist/server/w.js.map +1 -1
- package/dist/server/ward.js +579 -52
- package/dist/server/ward.js.map +1 -1
- package/dist/server/wardic-config.js +63 -30
- package/dist/server/wardic-config.js.map +1 -1
- package/dist/server/wardic-context.js +23 -0
- package/dist/server/wardic-context.js.map +1 -0
- package/dist/server/wardic.js +3 -0
- package/dist/server/wardic.js.map +1 -1
- package/dist/solid/batch-reorder-group.d.ts +1 -1
- package/dist/solid/batch-reorder-places.js +3 -3
- package/dist/solid/batch-reorder.d.ts +1 -1
- package/dist/solid/batch-reorder.d.ts.map +1 -1
- package/dist/solid/batch-reorder.js +8 -5
- package/dist/solid/batch-reorder.js.map +1 -1
- package/dist/solid/config-view.d.ts +11 -0
- package/dist/solid/config-view.d.ts.map +1 -1
- package/dist/solid/config-view.js +29 -6
- package/dist/solid/config-view.js.map +1 -1
- package/dist/solid/create-animation-controls.d.ts +20 -0
- package/dist/solid/create-animation-controls.d.ts.map +1 -0
- package/dist/solid/create-animation-controls.js +22 -0
- package/dist/solid/create-animation-controls.js.map +1 -0
- package/dist/solid/create-batch.jsx +1 -1
- package/dist/solid/element-style.d.ts +16 -2
- package/dist/solid/element-style.d.ts.map +1 -1
- package/dist/solid/element-style.js +61 -7
- package/dist/solid/element-style.js.map +1 -1
- package/dist/solid/element.d.ts +3 -1
- package/dist/solid/element.d.ts.map +1 -1
- package/dist/solid/element.jsx +21 -2
- package/dist/solid/element.jsx.map +1 -1
- package/dist/solid/feature-section.d.ts +0 -7
- package/dist/solid/feature-section.d.ts.map +1 -1
- package/dist/solid/feature-section.js +5 -13
- package/dist/solid/feature-section.js.map +1 -1
- package/dist/solid/gesture-callbacks.d.ts.map +1 -1
- package/dist/solid/gesture-callbacks.js +2 -0
- package/dist/solid/gesture-callbacks.js.map +1 -1
- package/dist/solid/hooks/auto.d.ts +44 -0
- package/dist/solid/hooks/auto.d.ts.map +1 -0
- package/dist/solid/hooks/auto.js +269 -0
- package/dist/solid/hooks/auto.js.map +1 -0
- package/dist/solid/hooks/config-scope.d.ts +84 -0
- package/dist/solid/hooks/config-scope.d.ts.map +1 -0
- package/dist/solid/hooks/config-scope.jsx +128 -0
- package/dist/solid/hooks/config-scope.jsx.map +1 -0
- package/dist/solid/hooks/config.d.ts +28 -0
- package/dist/solid/hooks/config.d.ts.map +1 -0
- package/dist/solid/hooks/config.jsx +37 -0
- package/dist/solid/hooks/config.jsx.map +1 -0
- package/dist/solid/hooks/drag.d.ts +220 -0
- package/dist/solid/hooks/drag.d.ts.map +1 -0
- package/dist/solid/hooks/drag.js +585 -0
- package/dist/solid/hooks/drag.js.map +1 -0
- package/dist/solid/hooks/elements.d.ts +11 -0
- package/dist/solid/hooks/elements.d.ts.map +1 -0
- package/dist/solid/hooks/elements.jsx +218 -0
- package/dist/solid/hooks/elements.jsx.map +1 -0
- package/dist/solid/hooks/group.d.ts +46 -0
- package/dist/solid/hooks/group.d.ts.map +1 -0
- package/dist/solid/hooks/group.jsx +25 -0
- package/dist/solid/hooks/group.jsx.map +1 -0
- package/dist/solid/hooks/index.d.ts +28 -0
- package/dist/solid/hooks/index.d.ts.map +1 -0
- package/dist/solid/hooks/index.js +10 -0
- package/dist/solid/hooks/index.js.map +1 -0
- package/dist/solid/hooks/kept.d.ts +60 -0
- package/dist/solid/hooks/kept.d.ts.map +1 -0
- package/dist/solid/hooks/kept.js +33 -0
- package/dist/solid/hooks/kept.js.map +1 -0
- package/dist/solid/hooks/layout-group-of.d.ts +27 -0
- package/dist/solid/hooks/layout-group-of.d.ts.map +1 -0
- package/dist/solid/hooks/layout-group-of.js +39 -0
- package/dist/solid/hooks/layout-group-of.js.map +1 -0
- package/dist/solid/hooks/layout-group.d.ts +60 -0
- package/dist/solid/hooks/layout-group.d.ts.map +1 -0
- package/dist/solid/hooks/layout-group.jsx +80 -0
- package/dist/solid/hooks/layout-group.jsx.map +1 -0
- package/dist/solid/hooks/make-ward.d.ts +123 -0
- package/dist/solid/hooks/make-ward.d.ts.map +1 -0
- package/dist/solid/hooks/make-ward.js +147 -0
- package/dist/solid/hooks/make-ward.js.map +1 -0
- package/dist/solid/hooks/presence-scope.d.ts +84 -0
- package/dist/solid/hooks/presence-scope.d.ts.map +1 -0
- package/dist/solid/hooks/presence-scope.jsx +62 -0
- package/dist/solid/hooks/presence-scope.jsx.map +1 -0
- package/dist/solid/hooks/presence.d.ts +51 -0
- package/dist/solid/hooks/presence.d.ts.map +1 -0
- package/dist/solid/hooks/presence.jsx +26 -0
- package/dist/solid/hooks/presence.jsx.map +1 -0
- package/dist/solid/hooks/props.d.ts +52 -0
- package/dist/solid/hooks/props.d.ts.map +1 -0
- package/dist/solid/hooks/props.js +140 -0
- package/dist/solid/hooks/props.js.map +1 -0
- package/dist/solid/hooks/reads.d.ts +38 -0
- package/dist/solid/hooks/reads.d.ts.map +1 -0
- package/dist/solid/hooks/reads.js +218 -0
- package/dist/solid/hooks/reads.js.map +1 -0
- package/dist/solid/hooks/refs.d.ts +25 -0
- package/dist/solid/hooks/refs.d.ts.map +1 -0
- package/dist/solid/hooks/refs.js +89 -0
- package/dist/solid/hooks/refs.js.map +1 -0
- package/dist/solid/hooks/reorder-elements.d.ts +23 -0
- package/dist/solid/hooks/reorder-elements.d.ts.map +1 -0
- package/dist/solid/hooks/reorder-elements.jsx +273 -0
- package/dist/solid/hooks/reorder-elements.jsx.map +1 -0
- package/dist/solid/hooks/reorder.d.ts +55 -0
- package/dist/solid/hooks/reorder.d.ts.map +1 -0
- package/dist/solid/hooks/reorder.js +152 -0
- package/dist/solid/hooks/reorder.js.map +1 -0
- package/dist/solid/hooks/rune.d.ts +885 -0
- package/dist/solid/hooks/rune.d.ts.map +1 -0
- package/dist/solid/hooks/rune.js +816 -0
- package/dist/solid/hooks/rune.js.map +1 -0
- package/dist/solid/hooks/server-features.client.d.ts +10 -0
- package/dist/solid/hooks/server-features.client.d.ts.map +1 -0
- package/dist/solid/hooks/server-features.client.js +2 -0
- package/dist/solid/hooks/server-features.client.js.map +1 -0
- package/dist/solid/hooks/server-features.d.ts +10 -0
- package/dist/solid/hooks/server-features.d.ts.map +1 -0
- package/dist/solid/hooks/server-features.js +13 -0
- package/dist/solid/hooks/server-features.js.map +1 -0
- package/dist/solid/hooks/settings.d.ts +11 -0
- package/dist/solid/hooks/settings.d.ts.map +1 -0
- package/dist/solid/hooks/settings.js +31 -0
- package/dist/solid/hooks/settings.js.map +1 -0
- package/dist/solid/hooks/setup.d.ts +31 -0
- package/dist/solid/hooks/setup.d.ts.map +1 -0
- package/dist/solid/hooks/setup.js +155 -0
- package/dist/solid/hooks/setup.js.map +1 -0
- package/dist/solid/hooks/stage.d.ts +187 -0
- package/dist/solid/hooks/stage.d.ts.map +1 -0
- package/dist/solid/hooks/stage.js +117 -0
- package/dist/solid/hooks/stage.js.map +1 -0
- package/dist/solid/hooks/ward.d.ts +394 -0
- package/dist/solid/hooks/ward.d.ts.map +1 -0
- package/dist/solid/hooks/ward.js +2237 -0
- package/dist/solid/hooks/ward.js.map +1 -0
- package/dist/solid/hooks/wardic-provider.d.ts +32 -0
- package/dist/solid/hooks/wardic-provider.d.ts.map +1 -0
- package/dist/solid/hooks/wardic-provider.jsx +29 -0
- package/dist/solid/hooks/wardic-provider.jsx.map +1 -0
- package/dist/solid/hooks/wardic-scope.d.ts +49 -0
- package/dist/solid/hooks/wardic-scope.d.ts.map +1 -0
- package/dist/solid/hooks/wardic-scope.jsx +63 -0
- package/dist/solid/hooks/wardic-scope.jsx.map +1 -0
- package/dist/solid/hooks/wards.d.ts +157 -0
- package/dist/solid/hooks/wards.d.ts.map +1 -0
- package/dist/solid/hooks/wards.js +522 -0
- package/dist/solid/hooks/wards.js.map +1 -0
- package/dist/solid/index.d.ts +25 -17
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.jsx +24 -12
- package/dist/solid/index.jsx.map +1 -1
- package/dist/solid/layout.d.ts +2 -44
- package/dist/solid/layout.d.ts.map +1 -1
- package/dist/solid/layout.jsx +7 -49
- package/dist/solid/layout.jsx.map +1 -1
- package/dist/solid/lazy-batch-gestures.js +1 -1
- package/dist/solid/lazy-batch-gestures.js.map +1 -1
- package/dist/solid/lifecycle.d.ts +32 -5
- package/dist/solid/lifecycle.d.ts.map +1 -1
- package/dist/solid/lifecycle.js +60 -21
- package/dist/solid/lifecycle.js.map +1 -1
- package/dist/solid/motion-props.js +1 -1
- package/dist/solid/presence-handle.d.ts +13 -6
- package/dist/solid/presence-handle.d.ts.map +1 -1
- package/dist/solid/presence-handle.js +30 -12
- package/dist/solid/presence-handle.js.map +1 -1
- package/dist/solid/presence.d.ts +3 -1
- package/dist/solid/presence.d.ts.map +1 -1
- package/dist/solid/presence.jsx +3 -1
- package/dist/solid/presence.jsx.map +1 -1
- package/dist/solid/provider.d.ts +25 -32
- package/dist/solid/provider.d.ts.map +1 -1
- package/dist/solid/provider.jsx +86 -62
- package/dist/solid/provider.jsx.map +1 -1
- package/dist/solid/reorder-components.d.ts +32 -0
- package/dist/solid/reorder-components.d.ts.map +1 -0
- package/dist/solid/reorder-components.jsx +49 -0
- package/dist/solid/reorder-components.jsx.map +1 -0
- package/dist/solid/reorder.d.ts +50 -76
- package/dist/solid/reorder.d.ts.map +1 -1
- package/dist/solid/reorder.jsx +40 -202
- package/dist/solid/reorder.jsx.map +1 -1
- package/dist/solid/stage-ward.jsx +2 -2
- package/dist/solid/stage-ward.jsx.map +1 -1
- package/dist/solid/stage.d.ts +14 -0
- package/dist/solid/stage.d.ts.map +1 -1
- package/dist/solid/stage.js.map +1 -1
- package/dist/solid/unstable/v2/index.d.ts +6 -26
- package/dist/solid/unstable/v2/index.d.ts.map +1 -1
- package/dist/solid/unstable/v2/index.jsx +0 -16
- package/dist/solid/unstable/v2/index.jsx.map +1 -1
- package/dist/solid/v1/batch-reorder-group.jsx +4 -4
- package/dist/solid/v1/create-ward.jsx +3 -3
- package/dist/solid/v1/create-ward.jsx.map +1 -1
- package/dist/solid/v1/index.d.ts +3 -1
- package/dist/solid/v1/index.d.ts.map +1 -1
- package/dist/solid/v1/index.jsx +1 -1
- package/dist/solid/v1/index.jsx.map +1 -1
- package/dist/solid/v1/presence.jsx +1 -1
- package/dist/solid/variant-node.d.ts +6 -0
- package/dist/solid/variant-node.d.ts.map +1 -1
- package/dist/solid/variant-node.js +2 -0
- package/dist/solid/variant-node.js.map +1 -1
- package/dist/solid/w.d.ts +9 -3
- package/dist/solid/w.d.ts.map +1 -1
- package/dist/solid/w.jsx +36 -3
- package/dist/solid/w.jsx.map +1 -1
- package/dist/solid/ward.d.ts +134 -7
- package/dist/solid/ward.d.ts.map +1 -1
- package/dist/solid/ward.jsx +549 -51
- package/dist/solid/ward.jsx.map +1 -1
- package/dist/solid/wardic-config.d.ts +17 -12
- package/dist/solid/wardic-config.d.ts.map +1 -1
- package/dist/solid/wardic-config.jsx +68 -22
- package/dist/solid/wardic-config.jsx.map +1 -1
- package/dist/solid/wardic-context.d.ts +15 -0
- package/dist/solid/wardic-context.d.ts.map +1 -0
- package/dist/solid/wardic-context.js +23 -0
- package/dist/solid/wardic-context.js.map +1 -0
- package/dist/solid/wardic-instance.d.ts +6 -4
- package/dist/solid/wardic-instance.d.ts.map +1 -1
- package/dist/solid/wardic.d.ts +3 -0
- package/dist/solid/wardic.d.ts.map +1 -1
- package/dist/solid/wardic.jsx +3 -0
- package/dist/solid/wardic.jsx.map +1 -1
- package/package.json +26 -6
- package/src/batch-reorder-group.tsx +1 -1
- package/src/batch-reorder-places.ts +3 -3
- package/src/batch-reorder.ts +9 -6
- package/src/config-view.ts +30 -6
- package/src/create-animation-controls.ts +22 -0
- package/src/create-batch.tsx +1 -1
- package/src/element-style.ts +77 -9
- package/src/element.tsx +25 -4
- package/src/feature-section.ts +5 -15
- package/src/gesture-callbacks.ts +2 -0
- package/src/hooks/auto.ts +303 -0
- package/src/hooks/config-scope.tsx +215 -0
- package/src/hooks/config.tsx +54 -0
- package/src/hooks/drag.ts +740 -0
- package/src/hooks/elements.tsx +234 -0
- package/src/hooks/group.tsx +55 -0
- package/src/hooks/index.ts +41 -0
- package/src/hooks/kept.ts +89 -0
- package/src/hooks/layout-group-of.ts +46 -0
- package/src/hooks/layout-group.tsx +111 -0
- package/src/hooks/make-ward.ts +218 -0
- package/src/hooks/presence-scope.tsx +155 -0
- package/src/hooks/presence.tsx +67 -0
- package/src/hooks/props.ts +190 -0
- package/src/hooks/reads.ts +258 -0
- package/src/hooks/refs.ts +114 -0
- package/src/hooks/reorder-elements.tsx +321 -0
- package/src/hooks/reorder.ts +205 -0
- package/src/hooks/rune.ts +1755 -0
- package/src/hooks/server-features.client.ts +10 -0
- package/src/hooks/server-features.ts +12 -0
- package/src/hooks/settings.ts +44 -0
- package/src/hooks/setup.ts +184 -0
- package/src/hooks/stage.ts +359 -0
- package/src/hooks/ward.ts +2563 -0
- package/src/hooks/wardic-provider.tsx +51 -0
- package/src/hooks/wardic-scope.tsx +112 -0
- package/src/hooks/wards.ts +679 -0
- package/src/index.tsx +31 -17
- package/src/layout.tsx +7 -74
- package/src/lazy-batch-gestures.ts +1 -1
- package/src/lifecycle.ts +72 -24
- package/src/motion-props.ts +1 -1
- package/src/presence-handle.ts +39 -20
- package/src/presence.tsx +3 -1
- package/src/provider.tsx +96 -71
- package/src/reorder-components.tsx +61 -0
- package/src/reorder.tsx +84 -303
- package/src/stage-ward.tsx +3 -3
- package/src/stage.ts +15 -0
- package/src/unstable/v2/index.tsx +6 -26
- package/src/v1/batch-reorder-group.tsx +4 -4
- package/src/v1/create-ward.tsx +4 -4
- package/src/v1/index.tsx +3 -1
- package/src/v1/presence.tsx +1 -1
- package/src/variant-node.ts +8 -0
- package/src/w.tsx +38 -5
- package/src/ward.tsx +679 -53
- package/src/wardic-config.tsx +68 -21
- package/src/wardic-context.ts +26 -0
- package/src/wardic-instance.ts +6 -4
- package/src/wardic.tsx +3 -0
- package/dist/browser/create-wardic.js +0 -36
- package/dist/browser/create-wardic.js.map +0 -1
- package/dist/browser/presence-hooks.js +0 -144
- package/dist/browser/presence-hooks.js.map +0 -1
- package/dist/server/create-wardic.js +0 -36
- package/dist/server/create-wardic.js.map +0 -1
- package/dist/server/presence-hooks.js +0 -144
- package/dist/server/presence-hooks.js.map +0 -1
- package/dist/solid/create-wardic.d.ts +0 -25
- package/dist/solid/create-wardic.d.ts.map +0 -1
- package/dist/solid/create-wardic.jsx +0 -34
- package/dist/solid/create-wardic.jsx.map +0 -1
- package/dist/solid/presence-hooks.d.ts +0 -53
- package/dist/solid/presence-hooks.d.ts.map +0 -1
- package/dist/solid/presence-hooks.jsx +0 -117
- package/dist/solid/presence-hooks.jsx.map +0 -1
- package/src/create-wardic.tsx +0 -46
- package/src/presence-hooks.tsx +0 -159
package/dist/solid/reorder.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import type * as CoreReorder from "@wardic/core/Reorder";
|
|
|
2
2
|
import * as ReorderController from "@wardic/dom/ReorderController";
|
|
3
3
|
import { type JSX } from "@solidjs/web";
|
|
4
4
|
import { type Accessor } from "solid-js";
|
|
5
|
-
import {
|
|
5
|
+
import type { WardicMotionPropsV2 as WardicMotionProps } from "./motion-props.ts";
|
|
6
|
+
import type * as Feature from "@wardic/dom/unstable/Feature";
|
|
6
7
|
import { type PerKey } from "./config-view.ts";
|
|
7
|
-
import { type AnyWard, type Ward, type WardConfig, type WardOptions, type WardStyle } from "./ward.tsx";
|
|
8
|
-
import
|
|
9
|
-
import { BatchGroup, BatchItem } from "./batch-reorder-group.tsx";
|
|
8
|
+
import { type AnyWard, type Ward, type WardConfig, type WardInternals, type WardOptions, type WardStyle } from "./ward.tsx";
|
|
9
|
+
import type { WardicMotion, WardRefCallback } from "./element.tsx";
|
|
10
10
|
export type { ReorderBatchColumnSize, ReorderBatchGap, ReorderBatchGroup, ReorderBatchGroupProps, ReorderBatchItemProps, ReorderBatchItemSize, ReorderBatchSizing } from "./batch-reorder-group.tsx";
|
|
11
11
|
/** A Reorder group's config, each key read as a value. */
|
|
12
12
|
export interface ReorderGroupConfigValues<V> {
|
|
@@ -14,6 +14,12 @@ export interface ReorderGroupConfigValues<V> {
|
|
|
14
14
|
readonly values: ReadonlyArray<V>;
|
|
15
15
|
/** Given each new order, as an item crosses another: set `values` from it. */
|
|
16
16
|
readonly onReorder: (values: Array<V>) => void;
|
|
17
|
+
/**
|
|
18
|
+
* What makes two of `values` one item, where your app makes them again (a refetch, a store's copy):
|
|
19
|
+
* matched by it, an item made again keeps its place, its drag and its keyboard lift, and the group's
|
|
20
|
+
* events hand the item as `values` holds it now. Left out, values match by identity. Read once.
|
|
21
|
+
*/
|
|
22
|
+
readonly key?: ((value: V) => unknown) | undefined;
|
|
17
23
|
/** The list's direction: `"y"`, a column, `"x"`, a row, or `"xy"`, a grid that wraps. Left out, it's found from the items' boxes. */
|
|
18
24
|
readonly axis?: CoreReorder.Axis | undefined;
|
|
19
25
|
/** The keyboard reorder: on unless `false`. Off, the items have no keys, no tab stop and no instructions. */
|
|
@@ -32,9 +38,9 @@ export interface ReorderGroupConfigValues<V> {
|
|
|
32
38
|
/**
|
|
33
39
|
* A Reorder group's config: its `values` in order, `onReorder`, given each new order to set them from,
|
|
34
40
|
* and its options. Each key is a value or an accessor of it, such as a signal, a getter, a store's
|
|
35
|
-
* property or a component's prop; `onReorder`
|
|
41
|
+
* property or a component's prop; `onReorder` and `key` are functions.
|
|
36
42
|
*/
|
|
37
|
-
export type ReorderGroupConfig<V> = PerKey<ReorderGroupConfigValues<V>, "onReorder">;
|
|
43
|
+
export type ReorderGroupConfig<V> = PerKey<ReorderGroupConfigValues<V>, "onReorder" | "key">;
|
|
38
44
|
/** A Reorder group's events, as a ward's: `list.next(name)`, `list.each(name)` and `list.when(name)`. */
|
|
39
45
|
export interface ReorderGroupEvents<V> {
|
|
40
46
|
/**
|
|
@@ -62,11 +68,11 @@ export interface ReorderGroupProps {
|
|
|
62
68
|
readonly style: JSX.CSSProperties;
|
|
63
69
|
}
|
|
64
70
|
/**
|
|
65
|
-
* A **Reorder group**'s mark (#349): what tells a group
|
|
66
|
-
*
|
|
71
|
+
* A **Reorder group**'s mark (#349): what tells a group from a function, so `Reorder.Group`'s `groupRef`
|
|
72
|
+
* refuses one in its type ({@link GroupRefCallback}). Internal.
|
|
67
73
|
*/
|
|
68
74
|
export declare const REORDER_GROUP: unique symbol;
|
|
69
|
-
/** A Reorder group of `V`, whatever its config
|
|
75
|
+
/** A Reorder group of `V`, whatever its config. */
|
|
70
76
|
export interface AnyReorderGroup<V> {
|
|
71
77
|
readonly [REORDER_GROUP]: V;
|
|
72
78
|
}
|
|
@@ -145,11 +151,18 @@ interface ReorderItemOwn<V> {
|
|
|
145
151
|
/** The app's own ids: kept, before the instructions'. */
|
|
146
152
|
readonly "aria-describedby"?: string | undefined;
|
|
147
153
|
}
|
|
154
|
+
/** An item's own keys read per key (#259); the rest are its ward's, which reads them itself. */
|
|
155
|
+
/**
|
|
156
|
+
* What an item brings (ADR-0067 decision 12), whatever its section has (#511): its layout node, its
|
|
157
|
+
* drag, and every other gesture, so `whileHover` or `whileTap` on an item works as on Motion's, for
|
|
158
|
+
* about 0.5 KB gzipped beside the drag's.
|
|
159
|
+
*/
|
|
160
|
+
export declare const ITEM_BRINGS: ReadonlyArray<Feature.Feature>;
|
|
148
161
|
/**
|
|
149
162
|
* Makes a list of your own elements reorderable, by dragging or from the keyboard: spread the group on
|
|
150
163
|
* the list's element, and make each item with `reorderItem`, keyed with `<For>`. Your app owns
|
|
151
164
|
* `values`, and sets them from `onReorder`; a reorder it makes itself animates too. Call it where you'd
|
|
152
|
-
* make a signal, under a `WardicProvider`. `Reorder.Group`
|
|
165
|
+
* make a signal, under a `WardicProvider`. `createReorder`, and `Reorder.Group` over it, are built on it.
|
|
153
166
|
*
|
|
154
167
|
* @example
|
|
155
168
|
* const list = reorderGroup({ values: items, onReorder: setItems })
|
|
@@ -166,7 +179,7 @@ interface ReorderItemOwn<V> {
|
|
|
166
179
|
export declare function reorderGroup<V>(config: ReorderGroupConfig<V>): ReorderGroup<V>;
|
|
167
180
|
/**
|
|
168
181
|
* Makes an element an item of a Reorder group: a ward, spread on the element, `<li {...row}>`, or given
|
|
169
|
-
* to
|
|
182
|
+
* to its `ref`. `value` is its value in the group's `values`, read once; the rest is a
|
|
170
183
|
* ward's config, but `layout` (`true` or `"position"`), `layoutId` and `drag`, which the group sets. It's
|
|
171
184
|
* a tab stop for the keyboard reorder: your own `tabindex` and `aria-describedby` go in its config.
|
|
172
185
|
* Call it where you'd make a signal: in a `<For>` callback.
|
|
@@ -179,25 +192,29 @@ export declare function reorderGroup<V>(config: ReorderGroupConfig<V>): ReorderG
|
|
|
179
192
|
export declare function reorderItem<V, const C extends ReorderItemConfig<V>>(list: ReorderGroup<V>, config: C, options?: WardOptions): ReorderItem<V, C>;
|
|
180
193
|
/** A `<Reorder>` item's mark (#349): the group it's in. Internal. */
|
|
181
194
|
export declare const REORDER_ITEM: unique symbol;
|
|
182
|
-
/** A `<Reorder>` item of `V`, whatever its config
|
|
195
|
+
/** A `<Reorder>` item of `V`, whatever its config. */
|
|
183
196
|
export interface AnyReorderItem<V> extends AnyWard {
|
|
184
197
|
readonly [REORDER_ITEM]: V;
|
|
185
198
|
}
|
|
186
199
|
/**
|
|
187
|
-
* `reorderItem()`'s item: a ward in its group. Spread it on the item's element, or give it to
|
|
188
|
-
* `Reorder.Item`'s `wardRef`.
|
|
200
|
+
* `reorderItem()`'s item: a ward in its group. Spread it on the item's element, or give it to its `ref`.
|
|
189
201
|
*/
|
|
190
202
|
export type ReorderItem<V, C extends ReorderItemConfig<V> = ReorderItemConfig<V>> = Ward<C> & AnyReorderItem<V>;
|
|
191
|
-
/** An element tag a `<Reorder>` group or item can render. */
|
|
192
|
-
export type ReorderElementTag = keyof JSX.IntrinsicElements;
|
|
193
203
|
/**
|
|
194
|
-
*
|
|
195
|
-
* `
|
|
196
|
-
*
|
|
204
|
+
* {@link reorderItem} over `internal`, the internals its ward was given: its parent and its tag
|
|
205
|
+
* (`Reorder.Item`'s `as`, a hook row's `tag`), and a hook row's own besides (what the hooks are told of a
|
|
206
|
+
* ward they made, a function rune's shared lifecycle, a Variant child by its own word, a ward that names
|
|
207
|
+
* no gesture, the keys the hooks fix over its config), each kept under what an item sets itself. Internal.
|
|
197
208
|
*/
|
|
209
|
+
export declare const reorderItemWith: <V>(list: ReorderGroup<V>, config: ReorderItemConfig<V>, internal: WardInternals) => Ward;
|
|
210
|
+
/** An element tag a `<Reorder>` group or item can render. */
|
|
211
|
+
export type ReorderElementTag = keyof JSX.IntrinsicElements;
|
|
212
|
+
/** `Reorder.Group`'s group: its config as props, `groupRef` handing the group out. */
|
|
198
213
|
export type ReorderGroupOf<V> = {
|
|
199
214
|
readonly values: ReadonlyArray<V>;
|
|
200
215
|
readonly onReorder: (values: Array<V>) => void;
|
|
216
|
+
/** What makes two of `values` one item, where your app makes them again: see the group config's `key`. Read once. */
|
|
217
|
+
readonly key?: ((value: V) => unknown) | undefined;
|
|
201
218
|
readonly axis?: CoreReorder.Axis | undefined;
|
|
202
219
|
readonly keyboard?: boolean | undefined;
|
|
203
220
|
readonly announcements?: Partial<CoreReorder.Announcements<V>> | undefined;
|
|
@@ -207,18 +224,6 @@ export type ReorderGroupOf<V> = {
|
|
|
207
224
|
* `when(name)` and `move`.
|
|
208
225
|
*/
|
|
209
226
|
readonly groupRef?: GroupRefCallback<V> | undefined;
|
|
210
|
-
} | {
|
|
211
|
-
/**
|
|
212
|
-
* A group made with `reorderGroup`, which the component renders, with the options its config
|
|
213
|
-
* doesn't set beside it: never `values` or `onReorder`, which a group is made with.
|
|
214
|
-
*/
|
|
215
|
-
readonly groupRef: AnyReorderGroup<V>;
|
|
216
|
-
readonly values?: never;
|
|
217
|
-
readonly onReorder?: never;
|
|
218
|
-
readonly axis?: CoreReorder.Axis | undefined;
|
|
219
|
-
readonly keyboard?: boolean | undefined;
|
|
220
|
-
readonly announcements?: Partial<CoreReorder.Announcements<V>> | undefined;
|
|
221
|
-
readonly instructions?: string | undefined;
|
|
222
227
|
};
|
|
223
228
|
/** A function `groupRef` gives the component's group: never a group, which it would take instead. */
|
|
224
229
|
export type GroupRefCallback<V> = ((list: ReorderGroup<V>) => void) & {
|
|
@@ -232,66 +237,35 @@ export type ReorderGroupComponentProps<V, Tag extends ReorderElementTag = "ul">
|
|
|
232
237
|
readonly as?: Tag;
|
|
233
238
|
} & Omit<JSX.IntrinsicElements[Tag], "style" | "onReorder"> & {
|
|
234
239
|
readonly style?: WardStyle | string | undefined;
|
|
235
|
-
} & WardicMotion
|
|
236
|
-
/** A `<Reorder>` item's motion props: any but `layoutId` and `drag`, its `layout` a Layout mode. */
|
|
237
|
-
type ItemMotionProps = Omit<WardicMotionProps, "layout" | "layoutId" | "drag">;
|
|
240
|
+
} & Omit<WardicMotion, "key">;
|
|
238
241
|
/**
|
|
239
|
-
*
|
|
240
|
-
* or
|
|
241
|
-
* beside it, as beside a ward: never `value`, which an item is made with.
|
|
242
|
+
* A `<Reorder>` item's motion props: any but `layoutId` and `drag`, its `layout` a Layout mode. Not
|
|
243
|
+
* `dragControls` or `dragListener`: a `<Reorder.Grip>` inside it is their way (probe: behaviour-runes, Q29).
|
|
242
244
|
*/
|
|
243
|
-
|
|
245
|
+
type ItemMotionProps = Omit<WardicMotionProps, "layout" | "layoutId" | "drag" | "dragControls" | "dragListener">;
|
|
246
|
+
/** `Reorder.Item`'s item: its `value`, its `layout` and its motion props, `wardRef` handing its ward out. */
|
|
247
|
+
export type ReorderItemOf<V> = ItemMotionProps & {
|
|
244
248
|
/** Its value in the group's `values`, of any type, not its element's `value` attribute. Read once. */
|
|
245
249
|
readonly value: V;
|
|
246
250
|
readonly layout?: ReorderItemLayout;
|
|
247
251
|
readonly wardRef?: WardRefCallback | undefined;
|
|
248
|
-
}
|
|
249
|
-
readonly wardRef: AnyReorderItem<V> & GivenWard<C>;
|
|
250
|
-
readonly value?: never;
|
|
251
|
-
readonly layout?: "layout" extends WardSetKey<C> ? never : ReorderItemLayout;
|
|
252
|
-
readonly tabindex?: "tabindex" extends WardSetKey<C> ? never : number;
|
|
253
|
-
readonly "aria-describedby"?: "aria-describedby" extends WardSetKey<C> ? never : string;
|
|
254
|
-
});
|
|
252
|
+
};
|
|
255
253
|
/**
|
|
256
254
|
* `Reorder.Item`'s props: its item ({@link ReorderItemOf}), `as`, the element it renders (`"li"` by
|
|
257
255
|
* default, read once), and that element's own props, but its `value` attribute: `value` is the item's (#748).
|
|
258
256
|
*/
|
|
259
|
-
export type ReorderItemComponentProps<V, Tag extends ReorderElementTag = "li"
|
|
257
|
+
export type ReorderItemComponentProps<V, Tag extends ReorderElementTag = "li"> = ReorderItemOf<V> & {
|
|
260
258
|
readonly as?: Tag;
|
|
261
259
|
} & Omit<JSX.IntrinsicElements[Tag], "style" | "value"> & {
|
|
262
260
|
readonly style?: WardStyle | string | undefined;
|
|
263
261
|
};
|
|
264
262
|
/**
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
* `reorderGroup` as `groupRef`. Key its `Reorder.Item`s with `<For>`.
|
|
268
|
-
*
|
|
269
|
-
* @see https://wardic.dev/reference/solid/reorder/reorder
|
|
270
|
-
*/
|
|
271
|
-
declare function Group<V, Tag extends ReorderElementTag = "ul">(props: ReorderGroupComponentProps<V, Tag>): JSX.Element;
|
|
272
|
-
/**
|
|
273
|
-
* An item of the `Reorder.Group` around it, rendered as `as`, `"li"` by default: made from its props,
|
|
274
|
-
* or an item made with `reorderItem` given as `wardRef`. Outside a group it throws, as Motion's does.
|
|
275
|
-
*
|
|
276
|
-
* @see https://wardic.dev/reference/solid/reorder/reorder
|
|
277
|
-
*/
|
|
278
|
-
declare function Item<V, Tag extends ReorderElementTag = "li", C = {}>(props: ReorderItemComponentProps<V, Tag, C>): JSX.Element;
|
|
279
|
-
/**
|
|
280
|
-
* A list put in order by dragging its items, or from the keyboard: `Reorder.Group` and `Reorder.Item`.
|
|
281
|
-
* Your app owns the order: the group takes it as `values`, and `onReorder` hands each new one back.
|
|
282
|
-
* Motion's `Reorder`. A long list of items of one size reorders as one Batch: `Reorder.BatchGroup` and
|
|
283
|
-
* `Reorder.BatchItem`.
|
|
284
|
-
*
|
|
285
|
-
* @example
|
|
286
|
-
* <Reorder.Group values={items()} onReorder={setItems}>
|
|
287
|
-
* <For each={items()}>{(item) => <Reorder.Item value={item}>{item}</Reorder.Item>}</For>
|
|
288
|
-
* </Reorder.Group>
|
|
289
|
-
* @see https://wardic.dev/reference/solid/reorder/reorder
|
|
263
|
+
* `Reorder.Grip`'s props (probe: behaviour-runes, Q29, Q33): `as`, the element it renders (a
|
|
264
|
+
* `<button type="button">` by default, read once), that element's own props, and its motion props.
|
|
290
265
|
*/
|
|
291
|
-
export
|
|
292
|
-
readonly
|
|
293
|
-
|
|
294
|
-
readonly
|
|
295
|
-
readonly BatchItem: typeof BatchItem;
|
|
266
|
+
export type ReorderGripComponentProps<Tag extends ReorderElementTag = "button"> = ItemMotionProps & {
|
|
267
|
+
readonly as?: Tag;
|
|
268
|
+
} & Omit<JSX.IntrinsicElements[Tag], "style"> & {
|
|
269
|
+
readonly style?: WardStyle | string | undefined;
|
|
296
270
|
};
|
|
297
271
|
//# sourceMappingURL=reorder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reorder.d.ts","sourceRoot":"","sources":["../../src/reorder.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,KAAK,WAAW,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"reorder.d.ts","sourceRoot":"","sources":["../../src/reorder.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,KAAK,WAAW,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAA;AAYlE,OAAO,EAAY,KAAK,GAAG,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAU,KAAK,QAAQ,EAAqE,MAAM,UAAU,CAAA;AACnH,OAAO,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CAAA;CAAE,CAAA;AAEvD;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CAAC,GAAG,SAAS,iBAAiB,GAAG,QAAQ,IAC1E,eAAe,GACf;IAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,GAAG,CAAA;CAAE,GACrB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,GACzC;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA"}
|
package/dist/solid/reorder.jsx
CHANGED
|
@@ -48,11 +48,11 @@ import { constUndefined, identity, pipe } from "effect/Function";
|
|
|
48
48
|
import * as Match from "effect/Match";
|
|
49
49
|
import * as Option from "effect/Option";
|
|
50
50
|
import * as Predicate from "effect/Predicate";
|
|
51
|
+
import * as Rec from "effect/Record";
|
|
51
52
|
import * as Scope from "effect/Scope";
|
|
52
53
|
import * as UndefinedOr from "effect/UndefinedOr";
|
|
53
54
|
import { isServer } from "@solidjs/web";
|
|
54
|
-
import { $PROXY,
|
|
55
|
-
import { MOTION_PROPS_V2 as MOTION_PROPS } from "./motion-props.js";
|
|
55
|
+
import { $PROXY, createEffect, createMemo, createSignal, flush, onCleanup, untrack } from "solid-js";
|
|
56
56
|
import * as Drag from "@wardic/dom/unstable/features/Drag";
|
|
57
57
|
import * as Focus from "@wardic/dom/unstable/features/Focus";
|
|
58
58
|
import * as Hover from "@wardic/dom/unstable/features/Hover";
|
|
@@ -64,27 +64,25 @@ import * as GestureFeatures from "@wardic/dom/unstable/GestureFeatures";
|
|
|
64
64
|
import * as OwnerScope from "@wardic/dom/unstable/OwnerScope";
|
|
65
65
|
import { watchItemInput } from "@wardic/dom/unstable/ReorderInput";
|
|
66
66
|
import { plainOrder } from "./reorder-values.js";
|
|
67
|
-
import * as VariantTree from "@wardic/core/unstable/VariantTree";
|
|
68
67
|
import { configView } from "./config-view.js";
|
|
69
68
|
import { useBrought, useWardicRuntime } from "./provider.jsx";
|
|
70
69
|
import { useLayoutServices } from "./layout-projection.jsx";
|
|
71
|
-
import { spreadPropsOf, withSpreadProps,
|
|
72
|
-
import { drivenWard, givenOf, handOver, listOf, refsOf, sets, setKeysOf, staticElementOf } from "./element.jsx";
|
|
73
|
-
import { w } from "./w.jsx";
|
|
70
|
+
import { spreadPropsOf, withSpreadProps, wardWith } from "./ward.jsx";
|
|
74
71
|
import { CLIENT_ONLY, CLIENT_ONLY_DEFERRED } from "./solid-reactivity.js";
|
|
75
72
|
import { eachOf, neverLands, NO_EVENTS, serverWhen, Waiters, whenOf } from "./waiters.js";
|
|
76
|
-
import { BatchGroup, BatchItem } from "./batch-reorder-group.jsx";
|
|
77
73
|
/** A group's config read per key (#259). */
|
|
78
|
-
const GROUP_VIEW = configView(["values", "onReorder", "axis", "keyboard", "announcements", "instructions", "style"], ["onReorder"]);
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
const GROUP_VIEW = configView(["values", "onReorder", "key", "axis", "keyboard", "announcements", "instructions", "style"], ["onReorder", "key"]);
|
|
75
|
+
/**
|
|
76
|
+
* A group's config as a view of `config`, nothing beside it: a `Reorder.Group` given a group laid its
|
|
77
|
+
* element's props there (#398), a form gone with today's components (probe: hooks-first, the Reorder
|
|
78
|
+
* round's Q6).
|
|
79
|
+
*/
|
|
80
|
+
const groupViewOf = (config) => GROUP_VIEW.of(config, {});
|
|
83
81
|
/** The `AbortError`'s message for a group's `next` its disposal cut off. */
|
|
84
82
|
const GROUP_GONE = "The Reorder group was disposed before its next event.";
|
|
85
83
|
/**
|
|
86
|
-
* A **Reorder group**'s mark (#349): what tells a group
|
|
87
|
-
*
|
|
84
|
+
* A **Reorder group**'s mark (#349): what tells a group from a function, so `Reorder.Group`'s `groupRef`
|
|
85
|
+
* refuses one in its type ({@link GroupRefCallback}). Internal.
|
|
88
86
|
*/
|
|
89
87
|
export const REORDER_GROUP = Symbol("wardic.reorderGroup");
|
|
90
88
|
/** An item's own keys read per key (#259); the rest are its ward's, which reads them itself. */
|
|
@@ -93,7 +91,7 @@ export const REORDER_GROUP = Symbol("wardic.reorderGroup");
|
|
|
93
91
|
* drag, and every other gesture, so `whileHover` or `whileTap` on an item works as on Motion's, for
|
|
94
92
|
* about 0.5 KB gzipped beside the drag's.
|
|
95
93
|
*/
|
|
96
|
-
const ITEM_BRINGS = [Layout.layout, Drag.drag, Hover.hover, Press.press, Focus.focus, InView.inView, Pan.pan];
|
|
94
|
+
export const ITEM_BRINGS = [Layout.layout, Drag.drag, Hover.hover, Press.press, Focus.focus, InView.inView, Pan.pan];
|
|
97
95
|
const ITEM_VIEW = configView(["value", "layout", "tabindex", "aria-describedby"], []);
|
|
98
96
|
/** An item's `layout` as its Layout mode: `"position"`, else `true` (ADR-0009, *Amendment (#42)*). */
|
|
99
97
|
const itemLayoutOf = (layout) => Bool.match(layout === "position", { onTrue: () => "position", onFalse: () => true });
|
|
@@ -127,13 +125,17 @@ const refCarrying = (attach, props, reads) => {
|
|
|
127
125
|
const spreadProps = { ref: { value: self, enumerable: true }, ...props };
|
|
128
126
|
const spread = spreadPropsOf(spreadProps);
|
|
129
127
|
Object.defineProperties(self, { [REORDER_GROUP]: { value: true }, ...spreadProps });
|
|
130
|
-
|
|
128
|
+
// Its reads aren't enumerable. Solid calls a spread's function source for its props, `{...list}`; a
|
|
129
|
+
// group that's a member of another object, `{...made.list}`, it reads as an object, key by key, and
|
|
130
|
+
// each read was written to the element as an attribute: `group`, `axis`, `move`, `controller`.
|
|
131
|
+
const hidden = Rec.map(Object.getOwnPropertyDescriptors(reads), (descriptor) => ({ ...descriptor, enumerable: false }));
|
|
132
|
+
return Object.defineProperties(self, hidden);
|
|
131
133
|
};
|
|
132
134
|
/**
|
|
133
135
|
* Makes a list of your own elements reorderable, by dragging or from the keyboard: spread the group on
|
|
134
136
|
* the list's element, and make each item with `reorderItem`, keyed with `<For>`. Your app owns
|
|
135
137
|
* `values`, and sets them from `onReorder`; a reorder it makes itself animates too. Call it where you'd
|
|
136
|
-
* make a signal, under a `WardicProvider`. `Reorder.Group`
|
|
138
|
+
* make a signal, under a `WardicProvider`. `createReorder`, and `Reorder.Group` over it, are built on it.
|
|
137
139
|
*
|
|
138
140
|
* @example
|
|
139
141
|
* const list = reorderGroup({ values: items, onReorder: setItems })
|
|
@@ -154,12 +156,11 @@ const refCarrying = (attach, props, reads) => {
|
|
|
154
156
|
export function reorderGroup(config) {
|
|
155
157
|
if (Predicate.isFunction(config))
|
|
156
158
|
throw new Error(WHOLE_GROUP_ACCESSOR);
|
|
157
|
-
const
|
|
158
|
-
const view = groupViewOf(config, beside);
|
|
159
|
+
const view = groupViewOf(config);
|
|
159
160
|
const cfg = () => view;
|
|
160
161
|
const runtime = useWardicRuntime();
|
|
161
162
|
if (isServer)
|
|
162
|
-
return
|
|
163
|
+
return serverReorderGroup(cfg);
|
|
163
164
|
const [detected, setDetected] = createSignal("y");
|
|
164
165
|
// The order as a plain array (#721): a store's copied, so a store changed in place is a new order, read
|
|
165
166
|
// untracked by the controller and tracked by the effect below.
|
|
@@ -190,6 +191,7 @@ export function reorderGroup(config) {
|
|
|
190
191
|
onReorderEnd: (end) => events.tell("reorderEnd", () => end),
|
|
191
192
|
onHoldStart: (start) => events.tell("holdStart", () => start),
|
|
192
193
|
onHoldEnd: (end) => events.tell("holdEnd", () => end),
|
|
194
|
+
key: untrack(() => cfg().key),
|
|
193
195
|
axis: () => Option.fromUndefinedOr(untrack(() => cfg().axis)),
|
|
194
196
|
onAxis: setDetected,
|
|
195
197
|
keyedWith: "<For>",
|
|
@@ -199,8 +201,8 @@ export function reorderGroup(config) {
|
|
|
199
201
|
// The app's axis, else the detected one. When the app's is cleared, detected here, from the boxes the
|
|
200
202
|
// engine holds, so the items' touch-action follows in the same flush (#257's audit: an effect that
|
|
201
203
|
// detected it wrote a signal the items read a flush late, EFFECT_RELAY_TEAR). A Measure pass's change
|
|
202
|
-
// comes through `onAxis`. Lazy: read first by an item, so
|
|
203
|
-
//
|
|
204
|
+
// comes through `onAxis`. Lazy: read first by an item, so the `axis` it tracks is the config's as the
|
|
205
|
+
// items read it (#398).
|
|
204
206
|
const axis = createMemo(() => UndefinedOr.match(cfg().axis, {
|
|
205
207
|
onDefined: identity,
|
|
206
208
|
onUndefined: () => {
|
|
@@ -218,7 +220,7 @@ export function reorderGroup(config) {
|
|
|
218
220
|
element.style.setProperty("overflow-anchor", "none");
|
|
219
221
|
controller.attach(element);
|
|
220
222
|
};
|
|
221
|
-
return
|
|
223
|
+
return refCarrying(attach, { style: { get: () => groupStyleOf(cfg().style), enumerable: true } }, {
|
|
222
224
|
group: controller.group,
|
|
223
225
|
axis,
|
|
224
226
|
move: (value, toIndex) => {
|
|
@@ -235,29 +237,10 @@ export function reorderGroup(config) {
|
|
|
235
237
|
when: (name) => whenOf(events, name),
|
|
236
238
|
controller,
|
|
237
239
|
...keyboardOf(cfg),
|
|
238
|
-
})
|
|
240
|
+
});
|
|
239
241
|
}
|
|
240
242
|
/** The group's axis memo's options: client-only, and lazy (#398). */
|
|
241
243
|
const AXIS_MEMO = { ...CLIENT_ONLY, lazy: true };
|
|
242
|
-
/** `group`, its config and its layer kept for a `Reorder.Group` it's given to (#398). */
|
|
243
|
-
const layered = (group, config, beside) => {
|
|
244
|
-
GROUP_LAYERS.set(group, { config, beside });
|
|
245
|
-
return group;
|
|
246
|
-
};
|
|
247
|
-
/**
|
|
248
|
-
* A given group's element props (#398): each config key its `Reorder.Group` sets, laid over the
|
|
249
|
-
* group's config, read through the element's prop. A key the group's config sets too is an error.
|
|
250
|
-
*/
|
|
251
|
-
const besideGroup = (local, group) => {
|
|
252
|
-
const layer = UndefinedOr.getOrThrow(GROUP_LAYERS.get(group));
|
|
253
|
-
const given = setKeysOf(local, GROUP_CONFIG);
|
|
254
|
-
const twice = setKeysOf(layer.config, given);
|
|
255
|
-
if (twice.length > 0) {
|
|
256
|
-
throw new Error(`Reorder.Group: ${listOf(twice)} set both in the group given to groupRef and on the element (#398). ` +
|
|
257
|
-
"Set each key in one place: in reorderGroup({ … }), or on the element.");
|
|
258
|
-
}
|
|
259
|
-
Arr.forEach(given, (key) => Object.defineProperty(layer.beside, key, { enumerable: true, configurable: true, get: () => local[key] }));
|
|
260
|
-
};
|
|
261
244
|
/** What a group's Scope reports when one of its finalizers fails as its owner goes. */
|
|
262
245
|
const CLOSE_FAILED = "wardic.reorder: a finalizer failed";
|
|
263
246
|
/**
|
|
@@ -294,7 +277,7 @@ const keyboardAttributes = (list, cfg, describedBy) => ({
|
|
|
294
277
|
});
|
|
295
278
|
/**
|
|
296
279
|
* Makes an element an item of a Reorder group: a ward, spread on the element, `<li {...row}>`, or given
|
|
297
|
-
* to
|
|
280
|
+
* to its `ref`. `value` is its value in the group's `values`, read once; the rest is a
|
|
298
281
|
* ward's config, but `layout` (`true` or `"position"`), `layoutId` and `drag`, which the group sets. It's
|
|
299
282
|
* a tab stop for the keyboard reorder: your own `tabindex` and `aria-describedby` go in its config.
|
|
300
283
|
* Call it where you'd make a signal: in a `<For>` callback.
|
|
@@ -307,12 +290,19 @@ const keyboardAttributes = (list, cfg, describedBy) => ({
|
|
|
307
290
|
// ADR-0020. Given to `ref` alone, it's client-only. The element takes the drag defaults, with the
|
|
308
291
|
// group's axis's touch-action, which its `style` can override.
|
|
309
292
|
export function reorderItem(list, config, options) {
|
|
310
|
-
return reorderItemWith(list, config, UndefinedOr.map(options, (o) => o.parent)
|
|
293
|
+
return reorderItemWith(list, config, { parent: UndefinedOr.map(options, (o) => o.parent) });
|
|
311
294
|
}
|
|
312
295
|
/** A `<Reorder>` item's mark (#349): the group it's in. Internal. */
|
|
313
296
|
export const REORDER_ITEM = Symbol("wardic.reorderItem");
|
|
314
|
-
/**
|
|
315
|
-
|
|
297
|
+
/**
|
|
298
|
+
* {@link reorderItem} over `internal`, the internals its ward was given: its parent and its tag
|
|
299
|
+
* (`Reorder.Item`'s `as`, a hook row's `tag`), and a hook row's own besides (what the hooks are told of a
|
|
300
|
+
* ward they made, a function rune's shared lifecycle, a Variant child by its own word, a ward that names
|
|
301
|
+
* no gesture, the keys the hooks fix over its config), each kept under what an item sets itself. Internal.
|
|
302
|
+
*/
|
|
303
|
+
// The Reorder round's RF1: an item took its parent and its tag alone, so a hook row's function rune
|
|
304
|
+
// never heard its row, its lifecycle unshared.
|
|
305
|
+
export const reorderItemWith = (list, config, internal) => {
|
|
316
306
|
if (Predicate.isFunction(config))
|
|
317
307
|
throw new Error(WHOLE_ITEM_ACCESSOR);
|
|
318
308
|
// Its own keys read per key (#259); the rest are its ward's config, read by the ward. Its `layout`
|
|
@@ -320,7 +310,7 @@ const reorderItemWith = (list, config, parent, tag) => {
|
|
|
320
310
|
// animation's start as any ward's is (ADR-0009, *Amendment (#42)*).
|
|
321
311
|
const own = ITEM_VIEW.of(config);
|
|
322
312
|
const cfg = () => own;
|
|
323
|
-
const fixed = { layout: () => itemLayoutOf(own.layout) };
|
|
313
|
+
const fixed = { ...internal.fixed, layout: () => itemLayoutOf(own.layout) };
|
|
324
314
|
const wardConfig = config;
|
|
325
315
|
// Its group's axis's `touch-action`, under its style: none when its own presses don't drag it
|
|
326
316
|
// (`dragListener={false}`, #431), as with its other drag defaults, so a list dragged by handles scrolls by touch.
|
|
@@ -331,7 +321,7 @@ const reorderItemWith = (list, config, parent, tag) => {
|
|
|
331
321
|
// On a server the item renders the drag defaults with its group's touch-action, and joins no
|
|
332
322
|
// controller (ADR-0021); the instructions element exists on the client only.
|
|
333
323
|
if (isServer) {
|
|
334
|
-
const row = wardWith(wardConfig, {
|
|
324
|
+
const row = wardWith(wardConfig, { ...internal, brings: ITEM_BRINGS, dragAxis: () => true, baseStyle: touchAction, fixed, group: list });
|
|
335
325
|
return withSpreadProps(Object.defineProperties(row, { [REORDER_ITEM]: { value: list } }), keyboardAttributes(list, cfg, constUndefined));
|
|
336
326
|
}
|
|
337
327
|
const runtime = useWardicRuntime();
|
|
@@ -352,11 +342,10 @@ const reorderItemWith = (list, config, parent, tag) => {
|
|
|
352
342
|
const describedBy = createMemo(() => DomAnnouncer.instructionsIdOf(document(), list.instructions()), CLIENT_ONLY);
|
|
353
343
|
createEffect(() => ({ doc: document(), text: list.instructions() }), ({ doc, text }) => DomAnnouncer.showInstructions(doc, text), CLIENT_ONLY);
|
|
354
344
|
const row = wardWith(wardConfig, {
|
|
355
|
-
|
|
345
|
+
...internal,
|
|
356
346
|
brings: ITEM_BRINGS,
|
|
357
347
|
fixed,
|
|
358
348
|
group: list,
|
|
359
|
-
parent,
|
|
360
349
|
dragAxis: () => dragAxisFor(driver.dragAxis()),
|
|
361
350
|
onDragSample: driver.onSample,
|
|
362
351
|
onLayoutHandle: driver.register,
|
|
@@ -377,155 +366,4 @@ const reorderItemWith = (list, config, parent, tag) => {
|
|
|
377
366
|
// eslint-disable-next-line solid/reactivity -- handed to getters, which read it where the spread tracks them
|
|
378
367
|
return withSpreadProps(Object.defineProperties(row, { [REORDER_ITEM]: { value: list } }), keyboardAttributes(list, cfg, describedBy));
|
|
379
368
|
};
|
|
380
|
-
// --- Components (ADR-0020: built on the factories) ---------------------------------------------
|
|
381
|
-
/** The nearest `Reorder.Group`'s group, for its items: `null` for none (Solid 2's contexts). */
|
|
382
|
-
const GroupContext = createContext(null);
|
|
383
|
-
const GROUP_OWN = ["values", "onReorder", "axis", "keyboard", "announcements", "instructions", "as", "ref", "style", "children", "groupRef"];
|
|
384
|
-
const ITEM_OWN = [...MOTION_PROPS, "value", "as", "ref", "style", "children", "tabindex", "aria-describedby", "wardRef"];
|
|
385
|
-
/** A group's config keys: beside a given group, each it doesn't set (#398). */
|
|
386
|
-
const GROUP_CONFIG = ["values", "onReorder", "axis", "keyboard", "announcements", "instructions"];
|
|
387
|
-
/** An item's config keys, its motion props and its own: beside a given item, each it doesn't set (#398). */
|
|
388
|
-
const ITEM_CONFIG = [...MOTION_PROPS, "value", "tabindex", "aria-describedby"];
|
|
389
|
-
/** A `<Reorder>` item's keyboard reorder attributes (ADR-0037), which a given item's element carries (#349). */
|
|
390
|
-
const KEYBOARD_ATTRIBUTES = ["tabindex", "aria-describedby"];
|
|
391
|
-
/**
|
|
392
|
-
* The Wardic element for `tag`, as a plain component: a Slim element's (`w[tag]`, #511), so a Reorder
|
|
393
|
-
* brings no Feature but its own (ADR-0067 decision 12) and renders under a `strict` section.
|
|
394
|
-
*/
|
|
395
|
-
const wardicTag = (tag) => UndefinedOr.getOrThrow(w[tag]);
|
|
396
|
-
/** The group given to `groupRef` (#349), or `undefined` for a function or none: read once, untracked, as `ref` is. */
|
|
397
|
-
const givenGroupOf = (local) => {
|
|
398
|
-
const ref = untrack(() => local.groupRef);
|
|
399
|
-
return Bool.match(Predicate.hasProperty(ref, REORDER_GROUP), { onTrue: () => ref, onFalse: constUndefined });
|
|
400
|
-
};
|
|
401
|
-
/**
|
|
402
|
-
* A list put in order by dragging its items, or from the keyboard, rendered as `as`, `"ul"` by
|
|
403
|
-
* default. Your app owns `values`, and sets them from `onReorder`; or give it a group made with
|
|
404
|
-
* `reorderGroup` as `groupRef`. Key its `Reorder.Item`s with `<For>`.
|
|
405
|
-
*
|
|
406
|
-
* @see https://wardic.dev/reference/solid/reorder/reorder
|
|
407
|
-
*/
|
|
408
|
-
// ADR-0020, #349: a `reorderGroup` on `w[as]`, the group in context for its items.
|
|
409
|
-
function Group(props) {
|
|
410
|
-
const local = props;
|
|
411
|
-
const given = givenGroupOf(local);
|
|
412
|
-
const list = UndefinedOr.match(given, {
|
|
413
|
-
onUndefined: () => {
|
|
414
|
-
// Its props are its config, read per key (#259).
|
|
415
|
-
const made = reorderGroup(local);
|
|
416
|
-
// The group, to its `groupRef` (#257 item 3), read once, untracked, as `ref` is.
|
|
417
|
-
const give = untrack(() => local.groupRef);
|
|
418
|
-
if (Predicate.isFunction(give))
|
|
419
|
-
give(made);
|
|
420
|
-
return made;
|
|
421
|
-
},
|
|
422
|
-
onDefined: (group) => {
|
|
423
|
-
besideGroup(local, group);
|
|
424
|
-
return group;
|
|
425
|
-
},
|
|
426
|
-
});
|
|
427
|
-
const Tag = wardicTag(UndefinedOr.match(untrack(() => local.as), { onUndefined: () => "ul", onDefined: identity }));
|
|
428
|
-
const rest = omit(props, ...GROUP_OWN);
|
|
429
|
-
// Its element's style over the group's: `overflow-anchor: none`, under a given group's config (#349).
|
|
430
|
-
const styleOf = UndefinedOr.match(given, {
|
|
431
|
-
onUndefined: () => () => pipe(local.style, Style.over(ReorderController.GROUP_STYLE)),
|
|
432
|
-
onDefined: (group) => () => pipe(local.style, Style.over(group.style)),
|
|
433
|
-
});
|
|
434
|
-
return (<GroupContext value={list}>
|
|
435
|
-
<Tag {...rest} style={styleOf()} ref={refsOf(local, [list])}>
|
|
436
|
-
{local.children}
|
|
437
|
-
</Tag>
|
|
438
|
-
</GroupContext>);
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* A `<Reorder>` item given to `Reorder.Item`'s `wardRef` (#349): one of `list`'s, made with
|
|
442
|
-
* {@link reorderItem}. Its element is driven by a ward of the component's, and carries the item's
|
|
443
|
-
* keyboard reorder attributes.
|
|
444
|
-
*/
|
|
445
|
-
const givenItem = (list, local, share, tag) => {
|
|
446
|
-
if (Predicate.isUndefined(share.internal.group)) {
|
|
447
|
-
throw new Error("Reorder.Item: the ward in wardRef isn't a Reorder item (#349). Make it with reorderItem(list, { value }), list the group it's in.");
|
|
448
|
-
}
|
|
449
|
-
if (share.internal.group !== list) {
|
|
450
|
-
throw new Error("Reorder.Item: the item in wardRef is another group's (#349). Make it with reorderItem(list, …), list the Reorder.Group it renders in.");
|
|
451
|
-
}
|
|
452
|
-
const item = untrack(() => local.wardRef);
|
|
453
|
-
const { ward: row, setup } = drivenWard("Reorder.Item", local, share, { tag }, ITEM_CONFIG);
|
|
454
|
-
// Its keyboard attributes: the item's, or the element's where it sets one the item doesn't (#398).
|
|
455
|
-
const keys = Object.defineProperties({}, Object.fromEntries(Arr.map(KEYBOARD_ATTRIBUTES, (key) => [
|
|
456
|
-
key,
|
|
457
|
-
Bool.match(sets(local, key), {
|
|
458
|
-
onTrue: () => ({ enumerable: true, get: () => local[key] }),
|
|
459
|
-
onFalse: () => UndefinedOr.getOrThrow(Object.getOwnPropertyDescriptor(item, key)),
|
|
460
|
-
}),
|
|
461
|
-
])));
|
|
462
|
-
return { row, keys, setup };
|
|
463
|
-
};
|
|
464
|
-
/**
|
|
465
|
-
* An item of the `Reorder.Group` around it, rendered as `as`, `"li"` by default: made from its props,
|
|
466
|
-
* or an item made with `reorderItem` given as `wardRef`. Outside a group it throws, as Motion's does.
|
|
467
|
-
*
|
|
468
|
-
* @see https://wardic.dev/reference/solid/reorder/reorder
|
|
469
|
-
*/
|
|
470
|
-
// ADR-0020, #349: a `reorderItem` on the nearest group.
|
|
471
|
-
function Item(props) {
|
|
472
|
-
const list = useContext(GroupContext);
|
|
473
|
-
if (Predicate.isNull(list))
|
|
474
|
-
throw new Error("Reorder.Item must be a child of Reorder.Group");
|
|
475
|
-
const local = props;
|
|
476
|
-
const tag = UndefinedOr.match(untrack(() => local.as), { onUndefined: () => "li", onDefined: identity });
|
|
477
|
-
const given = givenOf(local);
|
|
478
|
-
// One plain element a tag, as every Wardic element's (#618, M3).
|
|
479
|
-
const Element = staticElementOf(tag);
|
|
480
|
-
const rest = omit(props, ...ITEM_OWN);
|
|
481
|
-
const element = UndefinedOr.match(given, {
|
|
482
|
-
onUndefined: () => {
|
|
483
|
-
// Its props are its config, read per key (#259); its `layout` is read as a Layout mode.
|
|
484
|
-
const row = reorderItemWith(list, local, undefined, tag);
|
|
485
|
-
// Its ward, to the item's `wardRef` (#257).
|
|
486
|
-
handOver(local, row);
|
|
487
|
-
// The ward's spread props, as an object: spread as the function it is, it's a source `merge`
|
|
488
|
-
// calls in a computation, whose keys `spread` can't know, so it inserts children too (#525, #618 M3).
|
|
489
|
-
const rowProps = row();
|
|
490
|
-
return {
|
|
491
|
-
row,
|
|
492
|
-
setup: undefined,
|
|
493
|
-
render: () => (<Element {...rest} {...rowProps} ref={refsOf(local, [row])}>
|
|
494
|
-
{local.children}
|
|
495
|
-
</Element>),
|
|
496
|
-
};
|
|
497
|
-
},
|
|
498
|
-
onDefined: (share) => {
|
|
499
|
-
const { row, keys, setup } = givenItem(list, local, share, tag);
|
|
500
|
-
return {
|
|
501
|
-
row,
|
|
502
|
-
setup,
|
|
503
|
-
render: () => (<Element {...rest} {...row.with({ style: local.style })} {...keys} ref={refsOf(local, [row])}>
|
|
504
|
-
{local.children}
|
|
505
|
-
</Element>),
|
|
506
|
-
};
|
|
507
|
-
},
|
|
508
|
-
});
|
|
509
|
-
// An item that changes what its children read renders its variant context's Provider around them
|
|
510
|
-
// (#50), as every Wardic element does; any other renders none.
|
|
511
|
-
const config = UndefinedOr.match(element.setup, { onUndefined: () => wardConfigView(local), onDefined: identity });
|
|
512
|
-
return Bool.match(untrack(() => VariantTree.changesContext(config)), {
|
|
513
|
-
onFalse: element.render,
|
|
514
|
-
onTrue: () => <element.row.Provider>{element.render()}</element.row.Provider>,
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
/**
|
|
518
|
-
* A list put in order by dragging its items, or from the keyboard: `Reorder.Group` and `Reorder.Item`.
|
|
519
|
-
* Your app owns the order: the group takes it as `values`, and `onReorder` hands each new one back.
|
|
520
|
-
* Motion's `Reorder`. A long list of items of one size reorders as one Batch: `Reorder.BatchGroup` and
|
|
521
|
-
* `Reorder.BatchItem`.
|
|
522
|
-
*
|
|
523
|
-
* @example
|
|
524
|
-
* <Reorder.Group values={items()} onReorder={setItems}>
|
|
525
|
-
* <For each={items()}>{(item) => <Reorder.Item value={item}>{item}</Reorder.Item>}</For>
|
|
526
|
-
* </Reorder.Group>
|
|
527
|
-
* @see https://wardic.dev/reference/solid/reorder/reorder
|
|
528
|
-
*/
|
|
529
|
-
// ADR-0020; the Batch pair, ADR-0072 (#712).
|
|
530
|
-
export const Reorder = { Group, Item, BatchGroup, BatchItem };
|
|
531
369
|
//# sourceMappingURL=reorder.jsx.map
|