@wardic/solid 2.2.0 → 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/config-view.js +33 -5
- package/dist/browser/config-view.js.map +1 -1
- 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/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 +23 -11
- 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 +37 -0
- package/dist/browser/lifecycle.js.map +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.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/index.js +1 -1
- package/dist/browser/v1/index.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 +576 -49
- 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/config-view.js +33 -5
- package/dist/server/config-view.js.map +1 -1
- 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/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 +23 -11
- 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 +37 -0
- package/dist/server/lifecycle.js.map +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.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/index.js +1 -1
- package/dist/server/v1/index.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 +576 -49
- 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.d.ts +1 -1
- package/dist/solid/batch-reorder.d.ts.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-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/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 +21 -14
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.jsx +23 -11
- 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 +19 -0
- package/dist/solid/lifecycle.d.ts.map +1 -1
- package/dist/solid/lifecycle.js +40 -0
- package/dist/solid/lifecycle.js.map +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.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 +2 -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/index.d.ts +1 -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/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 +546 -48
- 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.ts +1 -1
- package/src/config-view.ts +30 -6
- 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/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 +27 -15
- package/src/layout.tsx +7 -74
- package/src/lazy-batch-gestures.ts +1 -1
- package/src/lifecycle.ts +40 -0
- 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.ts +15 -0
- package/src/unstable/v2/index.tsx +2 -26
- package/src/v1/index.tsx +1 -1
- package/src/variant-node.ts +8 -0
- package/src/w.tsx +38 -5
- package/src/ward.tsx +674 -48
- 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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wardic/solid",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.0.0-next.0",
|
|
4
|
+
"description": "Wardic's hooks for Solid 2, and Solid 1's binding at @wardic/solid/v1: elements, gestures, layout and presence animations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animation",
|
|
7
7
|
"motion",
|
|
@@ -38,6 +38,16 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
+
"imports": {
|
|
42
|
+
"#server-features": {
|
|
43
|
+
"@wardic/source": {
|
|
44
|
+
"browser": "./src/hooks/server-features.client.ts",
|
|
45
|
+
"default": "./src/hooks/server-features.ts"
|
|
46
|
+
},
|
|
47
|
+
"browser": "./dist/solid/hooks/server-features.client.js",
|
|
48
|
+
"default": "./dist/solid/hooks/server-features.js"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
41
51
|
"exports": {
|
|
42
52
|
"./package.json": "./package.json",
|
|
43
53
|
".": {
|
|
@@ -50,6 +60,16 @@
|
|
|
50
60
|
"node": "./dist/server/index.js",
|
|
51
61
|
"default": "./dist/browser/index.js"
|
|
52
62
|
},
|
|
63
|
+
"./hooks": {
|
|
64
|
+
"@wardic/source": "./src/hooks/index.ts",
|
|
65
|
+
"types": "./dist/solid/hooks/index.d.ts",
|
|
66
|
+
"solid": "./dist/solid/hooks/index.js",
|
|
67
|
+
"browser": "./dist/browser/hooks/index.js",
|
|
68
|
+
"worker": "./dist/server/hooks/index.js",
|
|
69
|
+
"deno": "./dist/server/hooks/index.js",
|
|
70
|
+
"node": "./dist/server/hooks/index.js",
|
|
71
|
+
"default": "./dist/browser/hooks/index.js"
|
|
72
|
+
},
|
|
53
73
|
"./v1": {
|
|
54
74
|
"@wardic/source": "./src/v1/index.tsx",
|
|
55
75
|
"types": "./dist/solid/v1/index.d.ts",
|
|
@@ -78,8 +98,8 @@
|
|
|
78
98
|
},
|
|
79
99
|
"dependencies": {
|
|
80
100
|
"@solid-primitives/refs": "^1.1.3",
|
|
81
|
-
"@wardic/core": "1.
|
|
82
|
-
"@wardic/dom": "1.
|
|
101
|
+
"@wardic/core": "1.5.0-next.0",
|
|
102
|
+
"@wardic/dom": "1.5.0-next.0",
|
|
83
103
|
"csstype": "^3.1.0"
|
|
84
104
|
},
|
|
85
105
|
"peerDependencies": {
|
|
@@ -101,8 +121,8 @@
|
|
|
101
121
|
"@solidjs/router-1": "npm:@solidjs/router@1.0.1",
|
|
102
122
|
"@solidjs/web": "2.0.1",
|
|
103
123
|
"@types/babel__core": "^7.20.5",
|
|
104
|
-
"@wardic/object": "1.
|
|
105
|
-
"@wardic/test": "1.
|
|
124
|
+
"@wardic/object": "1.5.0-next.0",
|
|
125
|
+
"@wardic/test": "1.5.0-next.0",
|
|
106
126
|
"babel-preset-solid": "1.9.12",
|
|
107
127
|
"effect": "4.1.4",
|
|
108
128
|
"solid-js": "2.0.1",
|
|
@@ -87,7 +87,7 @@ export type ReorderBatchGroupProps<V, Tag extends ReorderElementTag = "ul"> = Re
|
|
|
87
87
|
*/
|
|
88
88
|
readonly whileTap?: BatchReorderGesture<V> | undefined
|
|
89
89
|
/**
|
|
90
|
-
* Where an item leaving under `<
|
|
90
|
+
* Where an item leaving under a `<Presence>` goes, at its last place, its element kept until it lands:
|
|
91
91
|
* values with an optional `transition`, or a function of its item, its last index and the presence's `custom`.
|
|
92
92
|
*/
|
|
93
93
|
readonly exit?: BatchReorderExit<V> | undefined
|
package/src/batch-reorder.ts
CHANGED
|
@@ -187,7 +187,7 @@ export interface BatchReorderOptions<V> {
|
|
|
187
187
|
/** Where an item goes while the pointer is over it, and while it's pressed (#712's PR 3), read as each starts. */
|
|
188
188
|
readonly whileHover: () => BatchReorderGesture<V> | undefined
|
|
189
189
|
readonly whileTap: () => BatchReorderGesture<V> | undefined
|
|
190
|
-
/** Where an item leaving under `<
|
|
190
|
+
/** Where an item leaving under a `<Presence>` goes (Q38), read as it's made. */
|
|
191
191
|
readonly exit: () => BatchReorderExit<V> | undefined
|
|
192
192
|
/** Given each new order, as an item crosses another: the app sets `values` from it, and the binding places it at once. */
|
|
193
193
|
readonly onReorder: (values: Array<V>) => void
|
package/src/config-view.ts
CHANGED
|
@@ -47,20 +47,44 @@ export type PerKeyApart<C, K extends keyof C = never> = {
|
|
|
47
47
|
readonly [P in keyof C]: P extends K ? C[P] : C[P] | (() => C[P])
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/** A view's state: the source it reads, and the values it fixes over it. */
|
|
50
|
+
/** A view's state: the source it reads, and the values it fixes over it, which can be added to later ({@link fixMore}). */
|
|
51
51
|
class View {
|
|
52
52
|
constructor(
|
|
53
53
|
readonly source: Readonly<Record<string, unknown>>,
|
|
54
|
-
|
|
54
|
+
public fixed: Readonly<Record<string, unknown>> | undefined,
|
|
55
55
|
) {}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* More values fixed over a view's source, after it's made (probe: hooks-first): over the ones it
|
|
60
|
+
* fixes already, and read in their place from here on, as a `fixed` given at the start is. A view
|
|
61
|
+
* made over this one reads them too. What read those keys before isn't told: whoever fixes them sees
|
|
62
|
+
* to that, since a key fixed later is one its readers followed nothing for. What it fixes is copied
|
|
63
|
+
* as it is now, so a key added afterwards to a `fixed` still being filled in (a Reorder group's) would
|
|
64
|
+
* be lost: no such view has more fixed over it.
|
|
65
|
+
*/
|
|
66
|
+
export const fixMore = <C,>(view: C, fixed: Fixed<C>): void => {
|
|
67
|
+
const state = view as unknown as View
|
|
68
|
+
// Each as it's defined, a getter kept a getter: what a component fixes over a ward given to it is
|
|
69
|
+
// read through its props.
|
|
70
|
+
const before = UndefinedOr.match(state.fixed, { onUndefined: () => ({}), onDefined: (given) => Object.getOwnPropertyDescriptors(given) })
|
|
71
|
+
state.fixed = Object.defineProperties({}, { ...before, ...Object.getOwnPropertyDescriptors(fixed) }) as Readonly<Record<string, unknown>>
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** What's fixed over a view as it is now: what it was given, and whatever was fixed over it since ({@link fixMore}). */
|
|
75
|
+
export const fixedOver = <C,>(view: C): Fixed<C> | undefined => (view as unknown as View).fixed as Fixed<C> | undefined
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* `key`'s value in a view: its fixed one, else its source's.
|
|
79
|
+
*
|
|
80
|
+
* `fixed` is asked at each read. A bit a key, made once as it was given, was tried (probe:
|
|
81
|
+
* hooks-first, 70ccd967) for a ward of several runes' Retarget, and moved nothing that was timed:
|
|
82
|
+
* what that ward paid was core reading a key several times a resolution. Taken out for its size.
|
|
83
|
+
*/
|
|
59
84
|
const valueAt = (view: View, key: string): unknown => {
|
|
60
85
|
const fixed = view.fixed
|
|
61
|
-
if (Predicate.
|
|
62
|
-
|
|
63
|
-
}
|
|
86
|
+
if (Predicate.isUndefined(fixed)) return view.source[key]
|
|
87
|
+
if (Object.hasOwn(fixed, key)) return fixed[key]
|
|
64
88
|
return view.source[key]
|
|
65
89
|
}
|
|
66
90
|
|
package/src/create-batch.tsx
CHANGED
|
@@ -120,7 +120,7 @@ export interface WardicKeyedBatch<K> extends BatchLandings {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
* The `<
|
|
123
|
+
* The presence (a `<Presence>`'s) a member's handle is made under: none outside an owner (a handle made in a
|
|
124
124
|
* handler, or after an `await`), where Solid 2's context read throws.
|
|
125
125
|
*/
|
|
126
126
|
const presenceHere = (): PresenceController.PresenceContextValue | undefined => {
|
package/src/element-style.ts
CHANGED
|
@@ -11,13 +11,15 @@
|
|
|
11
11
|
* The gate switches it through the sink's hooks, outside its commits: `beforeFirstCommit`, and
|
|
12
12
|
* `onHeld` whenever the keys it holds change. Only a change to a key the element's own style
|
|
13
13
|
* sets re-runs `style`, so a frame never does. A ward's element that comes after the last one left
|
|
14
|
-
* the page enters fresh (#414): `restart` puts a Starting style back on until its first commit.
|
|
14
|
+
* the page enters fresh (#414): `restart` puts a Starting style back on until its first commit. Its
|
|
15
|
+
* element reads its style before that, as it's made: seen coming, it reads `entering` then, the
|
|
16
|
+
* same Starting style, and `restart` re-runs every read but that one, which has it.
|
|
15
17
|
*
|
|
16
18
|
* The user's routed keys (#130, ADR-0043: its Live values and transform keys) are never Solid's:
|
|
17
19
|
* the Starting style carries their values, and from mount the gate holds them. Each style the
|
|
18
20
|
* user gives is seen by the element's {@link LiveStyle} here, where it's read reactively.
|
|
19
21
|
*
|
|
20
|
-
* Solid-free (#209): its state is plain, and
|
|
22
|
+
* Solid-free (#209): its state is plain, and a {@link Trigger} re-runs `style`, so it reads the
|
|
21
23
|
* same under Solid 2, where a signal's read lags its write until the flush.
|
|
22
24
|
*/
|
|
23
25
|
import type * as Renderer from "@wardic/core/Renderer"
|
|
@@ -25,7 +27,9 @@ import type * as Values from "@wardic/core/Values"
|
|
|
25
27
|
import type * as FlushGate from "@wardic/dom/FlushGate"
|
|
26
28
|
import * as Style from "@wardic/dom/Style"
|
|
27
29
|
import * as Bool from "effect/Boolean"
|
|
30
|
+
import * as Equivalence from "effect/Equivalence"
|
|
28
31
|
import { constUndefined } from "effect/Function"
|
|
32
|
+
import * as Predicate from "effect/Predicate"
|
|
29
33
|
import * as Rec from "effect/Record"
|
|
30
34
|
import type * as LiveStyle from "@wardic/dom/unstable/LiveStyle"
|
|
31
35
|
import type * as Reactivity from "@wardic/core/unstable/Reactivity"
|
|
@@ -52,6 +56,13 @@ export interface ElementStyleOptions {
|
|
|
52
56
|
export interface ElementStyle {
|
|
53
57
|
/** The element's style, given the user's: reactive, read inside the element's JSX. */
|
|
54
58
|
readonly style: (user: object | string | undefined) => Style.Style
|
|
59
|
+
/**
|
|
60
|
+
* The style of an element seen coming that enters fresh (#414), read before {@link restart} has
|
|
61
|
+
* begun its entry: `starting` over the user's, whatever the gate has committed. Reactive, as
|
|
62
|
+
* `style` is. A `restart` with the same Starting style doesn't re-run what read this, which has
|
|
63
|
+
* the entry's style already; it re-runs every read made through `style`.
|
|
64
|
+
*/
|
|
65
|
+
readonly entering: (user: object | string | undefined, starting: Renderer.Patch) => Style.Style
|
|
55
66
|
/** The hooks the element's flush sink carries. */
|
|
56
67
|
readonly hooks: Required<Pick<FlushGate.Sink, "beforeFirstCommit" | "onHeld">>
|
|
57
68
|
/**
|
|
@@ -59,8 +70,16 @@ export interface ElementStyle {
|
|
|
59
70
|
* element entering fresh (#414), its sink registered after this call.
|
|
60
71
|
*/
|
|
61
72
|
readonly restart: (starting: Renderer.Patch) => void
|
|
73
|
+
/**
|
|
74
|
+
* An element mounted that doesn't enter fresh: what took it for one that does, reading through
|
|
75
|
+
* {@link entering}, is run again. Nothing otherwise.
|
|
76
|
+
*/
|
|
77
|
+
readonly notFresh: () => void
|
|
62
78
|
}
|
|
63
79
|
|
|
80
|
+
/** Whether two Starting styles draw the same: key by key. */
|
|
81
|
+
const sameStarting: Equivalence.Equivalence<Renderer.Patch> = Rec.makeEquivalence(Equivalence.strictEqual<unknown>())
|
|
82
|
+
|
|
64
83
|
/** An element's `style`, switched by its flush sink's hooks. Call within a Solid owner. */
|
|
65
84
|
export const createElementStyle = (options: ElementStyleOptions): ElementStyle => {
|
|
66
85
|
const { userStyle, startingWith, live, defaults, base = constUndefined, reactivity } = options
|
|
@@ -73,40 +92,89 @@ export const createElementStyle = (options: ElementStyleOptions): ElementStyle =
|
|
|
73
92
|
// element's own style re-runs it; any other change waits for the next run.
|
|
74
93
|
let held: ReadonlyArray<string> = []
|
|
75
94
|
const changed = reactivity.trigger()
|
|
95
|
+
// What re-runs a read made through `entering` (#414): an element's, seen coming and given its
|
|
96
|
+
// entry's Starting style before `restart` began it. Its own trigger, apart from `changed`, so a
|
|
97
|
+
// restart to the style those reads were given re-runs every other read and none of them. Made at
|
|
98
|
+
// the first such read: most elements are the only one their ward is ever on, and have none.
|
|
99
|
+
let entered: Reactivity.Trigger | undefined
|
|
100
|
+
// The Starting style those reads were given since the last restart, and whether each was given
|
|
101
|
+
// the same one.
|
|
102
|
+
let expected: Renderer.Patch | undefined
|
|
103
|
+
let agreed = true
|
|
104
|
+
const trackEntered = (): void => {
|
|
105
|
+
if (Predicate.isUndefined(entered)) entered = reactivity.trigger()
|
|
106
|
+
entered.track()
|
|
107
|
+
}
|
|
108
|
+
/** Re-runs every read of the style, however it was made. */
|
|
109
|
+
const tellAll = (): void => {
|
|
110
|
+
expected = undefined
|
|
111
|
+
agreed = true
|
|
112
|
+
changed.notify()
|
|
113
|
+
if (Predicate.isNotUndefined(entered)) entered.notify()
|
|
114
|
+
}
|
|
76
115
|
|
|
77
|
-
//
|
|
78
|
-
const startingNow = (): Renderer.Patch => {
|
|
116
|
+
// `from` as the Starting style, with the routed keys' values now: read before the first commit only.
|
|
117
|
+
const startingNow = (from: Renderer.Patch): Renderer.Patch => {
|
|
79
118
|
const routed = live.values()
|
|
80
|
-
return Bool.match(Rec.isEmptyRecord(routed), { onTrue: () =>
|
|
119
|
+
return Bool.match(Rec.isEmptyRecord(routed), { onTrue: () => from, onFalse: () => startingWith(routed) })
|
|
81
120
|
}
|
|
121
|
+
// The style until the first commit: the Starting style on top of the user's.
|
|
122
|
+
const uncommitted = (from: Renderer.Patch, css: object | string | undefined): Style.Style =>
|
|
123
|
+
Style.over(Style.over(Style.over(startingNow(from), css), base()), defaults)
|
|
82
124
|
|
|
83
125
|
const style = (user: object | string | undefined): Style.Style => {
|
|
84
126
|
changed.track()
|
|
85
127
|
const css = live.css(user)
|
|
86
128
|
return Bool.match(committed, {
|
|
87
|
-
onFalse: () =>
|
|
129
|
+
onFalse: () => uncommitted(starting, css),
|
|
88
130
|
onTrue: () => Style.without(Style.over(Style.over(css, base()), defaults), held),
|
|
89
131
|
})
|
|
90
132
|
}
|
|
91
133
|
|
|
134
|
+
/** Whether every read through `entering` since the last restart was given `next`. */
|
|
135
|
+
const allGiven = (next: Renderer.Patch): boolean => {
|
|
136
|
+
if (Predicate.isUndefined(expected)) return false
|
|
137
|
+
return Bool.and(agreed, sameStarting(expected, next))
|
|
138
|
+
}
|
|
139
|
+
const entering = (user: object | string | undefined, next: Renderer.Patch): Style.Style => {
|
|
140
|
+
trackEntered()
|
|
141
|
+
// One given another Starting style than the last was: the restart re-runs them all.
|
|
142
|
+
if (Predicate.isNotUndefined(expected)) agreed = allGiven(next)
|
|
143
|
+
expected = next
|
|
144
|
+
return uncommitted(next, live.css(user))
|
|
145
|
+
}
|
|
146
|
+
|
|
92
147
|
const onHeld = (next: ReadonlyArray<string>): void => {
|
|
93
148
|
const prev = held
|
|
94
149
|
held = next
|
|
95
150
|
if (!committed) return
|
|
96
151
|
const style = Style.over(Style.over(live.css(untrack(userStyle)), untrack(base)), defaults)
|
|
97
|
-
if (Style.heldTouches(style, prev, next))
|
|
152
|
+
if (Style.heldTouches(style, prev, next)) tellAll()
|
|
98
153
|
}
|
|
99
154
|
|
|
100
155
|
const beforeFirstCommit = (): void => {
|
|
101
156
|
committed = true
|
|
157
|
+
tellAll()
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Re-runs every read made through `style`: one made through `entering` keeps what it was given. */
|
|
161
|
+
const tellOthers = (): void => {
|
|
162
|
+
expected = undefined
|
|
102
163
|
changed.notify()
|
|
103
164
|
}
|
|
104
165
|
|
|
105
166
|
const restart = (next: Renderer.Patch): void => {
|
|
167
|
+
// What was given this Starting style as it was made has it: every other read is told, as ever.
|
|
168
|
+
const given = allGiven(next)
|
|
106
169
|
starting = next
|
|
107
170
|
committed = false
|
|
108
|
-
|
|
171
|
+
Bool.match(given, { onTrue: tellOthers, onFalse: tellAll })
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const notFresh = (): void => {
|
|
175
|
+
if (Predicate.isUndefined(expected)) return
|
|
176
|
+
tellAll()
|
|
109
177
|
}
|
|
110
178
|
|
|
111
|
-
return { style, hooks: { beforeFirstCommit, onHeld }, restart }
|
|
179
|
+
return { style, entering, hooks: { beforeFirstCommit, onHeld }, restart, notFresh }
|
|
112
180
|
}
|
package/src/element.tsx
CHANGED
|
@@ -94,9 +94,10 @@ export type WardicBeside<C, P = WardicMotionProps> = {
|
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* A ward given to `wardRef`, its config's type `C` carried with no call signature, so a
|
|
97
|
-
* callback's `(card) => …` keeps its contextual type.
|
|
97
|
+
* callback's `(card) => …` keeps its contextual type. One `ward(config)` made: a hooks ward, which
|
|
98
|
+
* carries `exiting`, is spread instead (probe: behaviour-runes, the wardRef gap's B).
|
|
98
99
|
*/
|
|
99
|
-
export type GivenWard<C> = AnyWard & { readonly read: WardRead<C
|
|
100
|
+
export type GivenWard<C> = AnyWard & { readonly read: WardRead<C>; readonly exiting?: never }
|
|
100
101
|
|
|
101
102
|
/**
|
|
102
103
|
* A Wardic component's motion: its motion props, with `wardRef` handing its own ward out
|
|
@@ -272,6 +273,22 @@ export interface Driven {
|
|
|
272
273
|
readonly setup: WardConfigValues
|
|
273
274
|
}
|
|
274
275
|
|
|
276
|
+
/**
|
|
277
|
+
* Whether `given`, a ward given to `wardRef`, is one the hooks made (`createWard`): they tell themselves
|
|
278
|
+
* of each element their wards are handed (`handed`), and nothing else sets it. On a server too.
|
|
279
|
+
*/
|
|
280
|
+
const madeByTheHooks = (given: WardShare): boolean => Predicate.isNotUndefined(given.internal.handed)
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* What a component says of a hooks ward given to its `wardRef` to drive (probe: behaviour-runes, the
|
|
284
|
+
* owner's B): it's refused. Driven, its runes' `ref`s never ran, their `props` never reached the element,
|
|
285
|
+
* and its reads of its element (`focusing()`) never told anything, as only the component's own ward
|
|
286
|
+
* knew the element. Spread, a hooks ward has them all.
|
|
287
|
+
*/
|
|
288
|
+
const hookWardGiven = (name: string): string =>
|
|
289
|
+
`${name}: a ward createWard made isn't given to wardRef to drive. Spread it on the element, \`{...ward}\`, or on a ` +
|
|
290
|
+
"component that forwards its ref. wardRef takes a ward made with ward(config), or a function handed the component's own ward."
|
|
291
|
+
|
|
275
292
|
/**
|
|
276
293
|
* The ward a component drives its element with, for a ward given to `wardRef` (#349): one of its
|
|
277
294
|
* own, on the given ward's config, variant node and lifecycle, under the component's presence, with
|
|
@@ -282,9 +299,11 @@ export interface Driven {
|
|
|
282
299
|
export const drivenWard = (name: string, props: object, share: WardShare, internal: WardInternals, keys: ReadonlyArray<string>): Driven => {
|
|
283
300
|
const beside = besideOf(name, props, share, keys)
|
|
284
301
|
checkParent(name, share)
|
|
302
|
+
// What's fixed over the given ward's config as it is now: what was fixed since it was made too.
|
|
303
|
+
const under = share.fixed()
|
|
285
304
|
// Plain checks: a match's objects would cost every given ward's element (#349).
|
|
286
|
-
if (beside.length === 0) return { ward: wardWith(share.config, { ...share.internal, ...internal, name, share }), setup: share.setup }
|
|
287
|
-
const fixed = fixedOf(props, beside,
|
|
305
|
+
if (beside.length === 0) return { ward: wardWith(share.config, { ...share.internal, ...internal, name, share, fixed: under }), setup: share.setup }
|
|
306
|
+
const fixed = fixedOf(props, beside, under) as WardInternals["fixed"]
|
|
288
307
|
return { ward: wardWith(share.config, { ...share.internal, ...internal, name, share, fixed }), setup: setupWith(share.setup, props, beside) }
|
|
289
308
|
}
|
|
290
309
|
|
|
@@ -464,6 +483,7 @@ const tagComponent = (tag: string, routing: string | undefined, forward: boolean
|
|
|
464
483
|
const wardRef = untrack(() => own.wardRef)
|
|
465
484
|
const given = shareOf(wardRef)
|
|
466
485
|
if (Predicate.isNotUndefined(given)) {
|
|
486
|
+
if (madeByTheHooks(given)) throw new Error(hookWardGiven(name))
|
|
467
487
|
const { ward: driving, setup } = drivenWard(name, own, given, { ...kind, tag: routing }, MOTION_PROPS)
|
|
468
488
|
return withProvider(driving, setup, () => <Element {...rest} {...driving.with({ style: own.style })} ref={refsOf(own, [driving])} />)
|
|
469
489
|
}
|
|
@@ -523,6 +543,7 @@ const wrapComponent = (Wrapped: Component<Record<string, unknown>>, routing: str
|
|
|
523
543
|
const wardRef = untrack(() => own.wardRef)
|
|
524
544
|
const given = shareOf(wardRef)
|
|
525
545
|
if (Predicate.isNotUndefined(given)) {
|
|
546
|
+
if (madeByTheHooks(given)) throw new Error(hookWardGiven(name))
|
|
526
547
|
const { ward: driving, setup } = drivenWard(name, own, given, { ...kind, defaultsOnElement: true, tag: routing }, MOTION_PROPS)
|
|
527
548
|
return withProvider(driving, setup, () => checked(() => <Element {...rest} {...driving.with({ style: own.style })} ref={refsOf(own, [driving, seen])} />))
|
|
528
549
|
}
|
package/src/feature-section.ts
CHANGED
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A section's **Features** (#511, ADR-0067), for the Solid 2 binding:
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* A section's **Features** (#511, ADR-0067), for the Solid 2 binding: a provider's own section (dom's
|
|
3
|
+
* `Feature.makeSection`), kept by the provider (`provider.tsx`). `<LazyWardic>`'s sections, a context of
|
|
4
|
+
* their own here, were deleted with it (probe: behaviour-runes, after the scopes round); Solid 1's stay
|
|
5
|
+
* (`../../feature-section.ts`).
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
import { isServer } from "@solidjs/web"
|
|
10
10
|
import type * as Cause from "effect/Cause"
|
|
11
|
-
import {
|
|
12
|
-
import * as Option from "effect/Option"
|
|
11
|
+
import { getOwner, onCleanup } from "solid-js"
|
|
13
12
|
import * as Feature from "@wardic/dom/unstable/Feature"
|
|
14
13
|
import { reactivityIn } from "./solid-reactivity.ts"
|
|
15
14
|
|
|
16
|
-
/**
|
|
17
|
-
* A `LazyWardic`'s section, a provider of its own. `null` under none: Solid 2 takes an `undefined`
|
|
18
|
-
* default for none, and its `useContext` then throws outside a provider.
|
|
19
|
-
*/
|
|
20
|
-
export const FeatureSectionContext = createContext<Feature.FeatureSection | null>(null)
|
|
21
|
-
|
|
22
|
-
/** The nearest `LazyWardic`'s section, or `undefined` under none: its provider's then. */
|
|
23
|
-
export const useLazySection = (): Feature.FeatureSection | undefined => Option.getOrUndefined(Option.fromNullishOr(useContext(FeatureSectionContext)))
|
|
24
|
-
|
|
25
15
|
/** A section under `parent`, made under the current owner (`makeSection`). */
|
|
26
16
|
export const sectionUnder = (
|
|
27
17
|
parent: Feature.FeatureSection,
|