@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/dist/server/ward.js
CHANGED
|
@@ -46,6 +46,7 @@ function _P$2(_p3, _p4) {
|
|
|
46
46
|
Object.defineProperty(this, "children", _d$4);
|
|
47
47
|
}
|
|
48
48
|
_P$2.prototype = Object.prototype;
|
|
49
|
+
import * as InputSource from "@wardic/core/InputSource";
|
|
49
50
|
import * as Press from "@wardic/dom/unstable/Press";
|
|
50
51
|
import * as Report from "@wardic/dom/Report";
|
|
51
52
|
import * as Renderer from "@wardic/core/Renderer";
|
|
@@ -63,7 +64,7 @@ import * as Predicate from "effect/Predicate";
|
|
|
63
64
|
import * as UndefinedOr from "effect/UndefinedOr";
|
|
64
65
|
import * as Atom from "effect/reactivity/Atom";
|
|
65
66
|
import { isServer, useHead } from "@solidjs/web";
|
|
66
|
-
import { createEffect, createMemo, createSignal, createUniqueId, DEV, getOwner, isHydrating, onCleanup, runWithOwner, untrack } from "solid-js";
|
|
67
|
+
import { createEffect, createMemo, createSignal, createUniqueId, DEV, getOwner, isHydrating, onCleanup, refresh, runWithOwner, untrack } from "solid-js";
|
|
67
68
|
import { MOTION_PROPS_V2 } from "./motion-props.js";
|
|
68
69
|
import * as OwnerScope from "@wardic/dom/unstable/OwnerScope";
|
|
69
70
|
import * as GestureFeatures from "@wardic/dom/unstable/GestureFeatures";
|
|
@@ -87,13 +88,18 @@ import { appearStyle, useWardicAppear, useWardicGate, useWardicValueReads, useWa
|
|
|
87
88
|
import * as Feature from "@wardic/dom/unstable/Feature";
|
|
88
89
|
import { CLIENT_ONLY, CLIENT_ONLY_DEFERRED, CLIENT_ONLY_SYNC, CLIENT_ONLY_SYNC_DEFERRED, firstCallOwnerHere, reactivityIn } from "./solid-reactivity.js";
|
|
89
90
|
import { useWardicConfig } from "./wardic-config.js";
|
|
90
|
-
import { configView } from "./config-view.js";
|
|
91
|
+
import { configView, fixedOver, fixMore } from "./config-view.js";
|
|
91
92
|
import { Lifecycle } from "./lifecycle.js";
|
|
92
93
|
import { neverLands, NO_EVENTS, serverWhen } from "./waiters.js";
|
|
93
94
|
import { usePresenceContext } from "./presence.js";
|
|
94
95
|
import { createVariantNode, useVariantContext, WardicVariantContext } from "./variant-node.js";
|
|
95
96
|
/** The entry a missing Feature's message tells the app to import it from: this binding's (#566). */
|
|
96
97
|
const ENTRY = "@wardic/solid";
|
|
98
|
+
/**
|
|
99
|
+
* Development's word on a missing Feature (#511), with how a Solid 2 app adds it: dom's default names
|
|
100
|
+
* `<LazyWardic>`, Solid 1's still, deleted from Solid 2 (probe: behaviour-runes, after the scopes round).
|
|
101
|
+
*/
|
|
102
|
+
const missingMessage = (feature, what) => Feature.missingMessage(feature, what, ENTRY, `which this element's WardicProvider doesn't have. Add it: \`import { ${feature} } from "${ENTRY}"\`, then \`<WardicProvider features={[${feature}]}>\`, or give it to \`makeWard({ features })\`.`);
|
|
97
103
|
/** Every key a ward reads, its callbacks among them. */
|
|
98
104
|
const WARD_KEYS = ["initial", "animate", "variants", "custom", "inherit", "whileHover", "whileTap", "whileInView", "whileFocus", "viewport", "drag", "whileDrag", "dragConstraints", "dragElastic", "dragMomentum", "dragSnapToOrigin", "dragTransition", "dragPropagation", "propagate", "dragDirectionLock", "dragControls", "dragListener", "onMeasureDragConstraints", "transition", "exit", "layout", "layoutDependency", "layoutId", "layoutScroll", "layoutRoot", "layoutAnchor", "layoutCrossfade", "onUpdate", "transformTemplate", "onBeforeLayoutMeasure", "onLayoutMeasure", "appear", "style", "key"];
|
|
99
105
|
const everyKeyRead = true;
|
|
@@ -204,7 +210,9 @@ const WARD_MEMBER_KEYS = {
|
|
|
204
210
|
return state.tapped;
|
|
205
211
|
}
|
|
206
212
|
},
|
|
213
|
+
// `next`, `each` and `when` can be given again: the hooks' own take their place ({@link shareMembers}).
|
|
207
214
|
next: {
|
|
215
|
+
configurable: true,
|
|
208
216
|
get() {
|
|
209
217
|
const state = stateOf(this);
|
|
210
218
|
if (Predicate.isNotUndefined(state.next)) return state.next;
|
|
@@ -215,6 +223,7 @@ const WARD_MEMBER_KEYS = {
|
|
|
215
223
|
}
|
|
216
224
|
},
|
|
217
225
|
each: {
|
|
226
|
+
configurable: true,
|
|
218
227
|
get() {
|
|
219
228
|
const state = stateOf(this);
|
|
220
229
|
if (Predicate.isNotUndefined(state.each)) return state.each;
|
|
@@ -225,6 +234,7 @@ const WARD_MEMBER_KEYS = {
|
|
|
225
234
|
}
|
|
226
235
|
},
|
|
227
236
|
when: {
|
|
237
|
+
configurable: true,
|
|
228
238
|
get() {
|
|
229
239
|
const state = stateOf(this);
|
|
230
240
|
if (Predicate.isNotUndefined(state.when)) return state.when;
|
|
@@ -235,8 +245,68 @@ const WARD_MEMBER_KEYS = {
|
|
|
235
245
|
}
|
|
236
246
|
}
|
|
237
247
|
};
|
|
238
|
-
/**
|
|
248
|
+
/**
|
|
249
|
+
* {@link WARD_MEMBER_KEYS} on one prototype over `Function.prototype`.
|
|
250
|
+
*
|
|
251
|
+
* Module state (#460, Q7): made once, and added to once more where the hooks are loaded
|
|
252
|
+
* ({@link shareMembers}), with their own members for every ward.
|
|
253
|
+
*/
|
|
239
254
|
const WARD_MEMBERS = /*#__PURE__*/Object.create(Function.prototype, WARD_MEMBER_KEYS);
|
|
255
|
+
/**
|
|
256
|
+
* Whether `ward` has a state of its own, as a client's has and a server's hasn't: where the hooks
|
|
257
|
+
* keep what they know of it (probe: hooks-first). True of nothing but a ward made here.
|
|
258
|
+
*/
|
|
259
|
+
export const keepsState = ward => Predicate.hasProperty(ward, WARD_STATE);
|
|
260
|
+
/** What the hooks keep of `ward`, one with a state of its own ({@link keepsState}): none until they've kept something. */
|
|
261
|
+
export const hooksOf = ward => stateOf(ward).hooks;
|
|
262
|
+
/** Keeps `kept` of `ward` for the hooks, one with a state of its own ({@link keepsState}). */
|
|
263
|
+
export const keepForHooks = (ward, kept) => {
|
|
264
|
+
stateOf(ward).hooks = kept;
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* Fixes more of `ward`'s config from here on (probe: hooks-first), a ward with a state of its own:
|
|
268
|
+
* what a presence that takes it after it's made has its `animate`, `exit` and `custom` read
|
|
269
|
+
* through, with nothing set up for it on a ward no presence takes. Read in the config's place at
|
|
270
|
+
* the next read of each key; {@link targetAgain} makes that read happen.
|
|
271
|
+
*/
|
|
272
|
+
export const fixLater = (ward, fixed) => {
|
|
273
|
+
fixMore(stateOf(ward).written, fixed);
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Works `ward`'s target out again (probe: hooks-first): after {@link fixLater}, since what read those
|
|
277
|
+
* keys read them before they were fixed, and follows nothing that says so. From then on it follows
|
|
278
|
+
* whatever the fixed values read. Not in a component's body or a computation, where Solid allows no
|
|
279
|
+
* refresh: at the settle.
|
|
280
|
+
*/
|
|
281
|
+
export const targetAgain = ward => {
|
|
282
|
+
const state = stateOf(ward);
|
|
283
|
+
const target = state.target;
|
|
284
|
+
if (Predicate.isNotUndefined(target)) void refresh(target);
|
|
285
|
+
// The names it hands its followers come from its `animate` too: a leader a presence takes hands
|
|
286
|
+
// down the name it leaves by.
|
|
287
|
+
const handsDown = state.handsDown;
|
|
288
|
+
if (Predicate.isNotUndefined(handsDown)) void refresh(handsDown);
|
|
289
|
+
// And what a presence above it leaves it by: its `exit`, kept current by an effect that read it
|
|
290
|
+
// before more was fixed, and isn't told. A ward a presence of the hooks takes keeps its `exit` for
|
|
291
|
+
// that presence, so one above it runs none for it (HP30). Read here; the effect follows whatever it
|
|
292
|
+
// followed, and reads through what's fixed the next time it runs.
|
|
293
|
+
const exitNow = state.exitNow;
|
|
294
|
+
if (Predicate.isNotUndefined(exitNow)) state.exitConfig.current = untrack(exitNow);
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* More members for the prototype every client ward shares (probe: hooks-first): the hooks' own, a
|
|
298
|
+
* ward's reads and whether it's shown, given once as the hooks load. Each a getter over what the
|
|
299
|
+
* hooks keep of the ward ({@link hooksOf}), as the members here are over its state, so a ward
|
|
300
|
+
* carries nothing for them. One given a name that's here already takes its place.
|
|
301
|
+
*/
|
|
302
|
+
export const shareMembers = keys => {
|
|
303
|
+
Object.defineProperties(WARD_MEMBERS, keys);
|
|
304
|
+
};
|
|
305
|
+
/** A member every client ward shares, as it's read of `ward`: for one that takes its place for some wards ({@link shareMembers}). */
|
|
306
|
+
export const sharedMember = name => {
|
|
307
|
+
const descriptor = Object.getOwnPropertyDescriptor(WARD_MEMBERS, name);
|
|
308
|
+
return descriptor.get;
|
|
309
|
+
};
|
|
240
310
|
/** What a `wardic.*` component or a `<Reorder>` item adds to a ward. Internal. */
|
|
241
311
|
/**
|
|
242
312
|
* The config keys that want a gesture on Solid 2 (#525), as the ward's `wants*` read them: an element
|
|
@@ -307,21 +377,30 @@ const warnUnreadColors = (registry, features, values) => {
|
|
|
307
377
|
return Feature.unreadColorIn(values());
|
|
308
378
|
}, unread => {
|
|
309
379
|
if (Predicate.isUndefined(unread)) return;
|
|
310
|
-
registry.warnOnce("colors",
|
|
380
|
+
registry.warnOnce("colors", missingMessage("colors", `The colour \`${unread}\``));
|
|
311
381
|
}, CLIENT_ONLY);
|
|
312
382
|
};
|
|
313
383
|
/** Whether a config carries its variants (#398): it sets `variants` or `inherit`. */
|
|
314
384
|
const carriesVariants = config => Bool.or(Predicate.isNotUndefined(config.variants), Predicate.isNotUndefined(config.inherit));
|
|
385
|
+
/** Whether a ward made with `internal` and `config` carries its variants (#398): by its config, or by its maker's word (a hook ward's). */
|
|
386
|
+
const carriesFor = (internal, config) => Bool.or(internal.carries === true, carriesVariants(config));
|
|
315
387
|
/** A child made with `{ parent }` naming a Listening ward (#398's Q10). */
|
|
316
388
|
const LISTENING_PARENT = "ward(config, { parent }): the parent given carries no variants (no `variants` or `inherit` in its ward({ … })): it only listens, " + "and its element's props hold its variants, so a child can't join it by `{ parent }` (#398). Render the child inside that " + "ward's element, where it joins through the tree, or put the variants in the parent's ward({ … }).";
|
|
389
|
+
/** The **Layout group** a ward made here with `internal` is in: its maker's choice, else the one around it. */
|
|
390
|
+
const groupOf = internal => {
|
|
391
|
+
const chosen = internal.layoutGroup;
|
|
392
|
+
if (Predicate.isNotUndefined(chosen)) return chosen.id;
|
|
393
|
+
return useLayoutGroupId();
|
|
394
|
+
};
|
|
317
395
|
/**
|
|
318
396
|
* The **Layout group** a ward's `layoutId` goes in (#432): the one it's made in, as its presence and
|
|
319
|
-
* variant parent are; a driving ward's is its given ward's, where that was made,
|
|
320
|
-
* own props set the `layoutId` (#398), which is then the element's.
|
|
397
|
+
* variant parent are, or its maker's choice; a driving ward's is its given ward's, where that was made,
|
|
398
|
+
* unless the element's own props set the `layoutId` (#398), which is then the element's.
|
|
321
399
|
*/
|
|
322
|
-
const layoutGroupFor = (share,
|
|
323
|
-
if (Predicate.isUndefined(share)) return
|
|
324
|
-
|
|
400
|
+
const layoutGroupFor = (share, internal) => {
|
|
401
|
+
if (Predicate.isUndefined(share)) return groupOf(internal);
|
|
402
|
+
const fixed = internal.fixed;
|
|
403
|
+
if (Bool.and(Predicate.isNotUndefined(fixed), Predicate.hasProperty(fixed, "layoutId"))) return groupOf(internal);
|
|
325
404
|
return share.layoutGroup;
|
|
326
405
|
};
|
|
327
406
|
/**
|
|
@@ -382,6 +461,12 @@ const controlsOf = (given, animate) => {
|
|
|
382
461
|
set: made => setChange(() => made)
|
|
383
462
|
};
|
|
384
463
|
};
|
|
464
|
+
/** A ward's config settings: its own over its nearest `WardicConfig`'s, where it has any (`wardicConfig`), else that config's. */
|
|
465
|
+
const configOf = internal => {
|
|
466
|
+
const own = internal.wardicConfig;
|
|
467
|
+
if (Predicate.isNotUndefined(own)) return own;
|
|
468
|
+
return useWardicConfig();
|
|
469
|
+
};
|
|
385
470
|
/**
|
|
386
471
|
* `view` with its **Config transition** as its own when it gives none (#434, Motion's
|
|
387
472
|
* `{ ...config, ...props }`), read per read as its keys are; `view` itself with no `WardicConfig` above.
|
|
@@ -440,6 +525,18 @@ const LOADING_NAMES = [];
|
|
|
440
525
|
* `animate` names the ward's own variants when it has `variants` (what it can name), and is a target
|
|
441
526
|
* of values otherwise: setup reads it only to tell which.
|
|
442
527
|
*/
|
|
528
|
+
/**
|
|
529
|
+
* `config` a **Variant child** by its own word, where its internals say so (probe: hooks-first, the
|
|
530
|
+
* gap grill's Q26): core's `variantChild` set on the copy its variant decisions read. As it is for
|
|
531
|
+
* every other ward, a component's among them.
|
|
532
|
+
*/
|
|
533
|
+
const variantChildBy = (internal, config) => {
|
|
534
|
+
if (internal.variantChild !== true) return config;
|
|
535
|
+
return {
|
|
536
|
+
...config,
|
|
537
|
+
variantChild: true
|
|
538
|
+
};
|
|
539
|
+
};
|
|
443
540
|
export const configAtSetup = setup => {
|
|
444
541
|
if (setup.pending.length === 0) return setup.config;
|
|
445
542
|
const fixed = Arr.findFirst(setup.pending, key => Bool.not(LOADS_AS_IT_GOES.has(key)));
|
|
@@ -480,11 +577,14 @@ export function wardWith(config, internal) {
|
|
|
480
577
|
const layoutProjection = Keys.projectionIn(untrack(features.services));
|
|
481
578
|
// The provider's, once any section has built it: what its values register with.
|
|
482
579
|
const builtProjection = useBuiltProjection();
|
|
483
|
-
|
|
580
|
+
// Its config's settings: its own over its nearest WardicConfig's, where a hook ward gives any
|
|
581
|
+
// (probe: behaviour-runes), else that config's.
|
|
582
|
+
const wardicConfig = configOf(internal);
|
|
583
|
+
const reducedMotion = useWardicReducedMotion(wardicConfig);
|
|
484
584
|
// Whether its animations are skipped (#468): its nearest WardicConfig's, read as each starts.
|
|
485
|
-
const skipAnimations = useWardicSkipAnimations();
|
|
585
|
+
const skipAnimations = useWardicSkipAnimations(wardicConfig);
|
|
486
586
|
// Where its drag's and pan's points are (#443): its nearest WardicConfig's, read as each starts.
|
|
487
|
-
const pagePoint = WardicConfigValue.transformPagePointOf(
|
|
587
|
+
const pagePoint = WardicConfigValue.transformPagePointOf(wardicConfig);
|
|
488
588
|
const positionalKeys = useWardicPositionalKeys();
|
|
489
589
|
const defaultTransition = useWardicDefaultTransition();
|
|
490
590
|
// How a value is read in the Environment's own terms (#672).
|
|
@@ -505,7 +605,8 @@ export function wardWith(config, internal) {
|
|
|
505
605
|
// Its config, read per key where it's read (#259): a change re-runs only what reads the key. With
|
|
506
606
|
// Animation controls for its `animate` (#433), read once, each change they make is its entry.
|
|
507
607
|
// Under a `WardicConfig`, its Config transition is its own when it gives none (#434).
|
|
508
|
-
const
|
|
608
|
+
const written = WARD_VIEW.of(config, internal.fixed);
|
|
609
|
+
const asGiven = configuredView(written, wardicConfig);
|
|
509
610
|
// The config at setup, a plain copy read untracked: what setup reads, the keys read once among it.
|
|
510
611
|
// A key still loading (#257 item 1) is left out of it: one the ward reads as it goes holds its
|
|
511
612
|
// region until it lands; one setup fixes is an error, naming it. Its `animate` there tells
|
|
@@ -521,10 +622,10 @@ export function wardWith(config, internal) {
|
|
|
521
622
|
onUndefined: () => givenSetup,
|
|
522
623
|
onDefined: () => WARD_VIEW.setupOf(view)
|
|
523
624
|
});
|
|
524
|
-
const initialConfig = UndefinedOr.match(controls, {
|
|
625
|
+
const initialConfig = variantChildBy(internal, UndefinedOr.match(controls, {
|
|
525
626
|
onUndefined: () => configAtSetup(setup),
|
|
526
627
|
onDefined: () => AnimationControls.controlledConfigOf(configAtSetup(setup), undefined)
|
|
527
|
-
});
|
|
628
|
+
}));
|
|
528
629
|
// Its Animation controls' change (#433), read with the Override stack: none without them.
|
|
529
630
|
const ownChange = UndefinedOr.match(controls, {
|
|
530
631
|
onUndefined: () => NO_CHANGE,
|
|
@@ -543,12 +644,14 @@ export function wardWith(config, internal) {
|
|
|
543
644
|
// The nearest <AnimatePresence> (ADR-0007), or none.
|
|
544
645
|
const presence = usePresenceContext();
|
|
545
646
|
// The Layout group its `layoutId` goes in (#432): where it's made, or a given ward's.
|
|
546
|
-
const layoutGroup = layoutGroupFor(share, internal
|
|
647
|
+
const layoutGroup = layoutGroupFor(share, internal);
|
|
547
648
|
// The values it starts from, read once (ADR-0003): its `initial`, or the one it inherits, or its
|
|
548
649
|
// `animate` with `initial={false}` (its own, inherited, or its presence's first render, #134).
|
|
549
650
|
const presenceBlocks = PresenceRecord.presenceBlocksInitial(presence);
|
|
550
651
|
if (Bool.and(Arr.contains(setup.pending, "animate"), VariantTree.startsAtAnimate(initialConfig, node.inherited, presenceBlocks))) throw new Error(STARTS_AT_PENDING);
|
|
551
|
-
|
|
652
|
+
// Untracked as a whole: a target that's a store's (a store given as a hook's rune) is read here,
|
|
653
|
+
// in the component's body, for its values now.
|
|
654
|
+
const start = untrack(() => Spine.startOf(initialConfig, node.inherited, presenceBlocks, untrack));
|
|
552
655
|
// A variant whose resolver throws is this element's alone: reported once until it resolves, the element
|
|
553
656
|
// keeping its last target (#979; ADR-0074).
|
|
554
657
|
Spine.reportStart(variantFailures, start);
|
|
@@ -617,17 +720,30 @@ export function wardWith(config, internal) {
|
|
|
617
720
|
// last one left the page, as a mount after the first render's (no presence holds its `initial`
|
|
618
721
|
// back). Its Snapshot goes back to it, and its Starting style comes back on until its first commit.
|
|
619
722
|
let begun = start;
|
|
620
|
-
|
|
621
|
-
|
|
723
|
+
// A fresh start and the Starting style it draws, from the config now: a plain copy read untracked,
|
|
724
|
+
// as setup reads it. Read in the mount effect, and by an element's first read of its style.
|
|
725
|
+
const freshStart = () => {
|
|
622
726
|
const now = WARD_VIEW.setupOf(view).config;
|
|
623
|
-
|
|
727
|
+
const from = Spine.startOf(now, node.inherited, false, untrack);
|
|
728
|
+
return {
|
|
729
|
+
from,
|
|
730
|
+
starting: Svg.splitPatchForTag(internal.tag, project(ElementSetup.drawnAtRest(from.initialValues, layoutNode, now.transformTemplate))).style
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
const freshStarting = () => freshStart().starting;
|
|
734
|
+
const beginFresh = () => {
|
|
735
|
+
const fresh = freshStart();
|
|
736
|
+
begun = fresh.from;
|
|
737
|
+
// As the first start (#979): its variant's resolver that throws is reported, here where it begins.
|
|
624
738
|
Spine.reportStart(variantFailures, begun);
|
|
625
739
|
snapshot.values = {
|
|
626
740
|
...begun.initialValues
|
|
627
741
|
};
|
|
628
742
|
snapshot.velocities = {};
|
|
629
743
|
snapshot.drawnAt = {};
|
|
630
|
-
|
|
744
|
+
// Its element read this Starting style as it was made, where it was seen coming, so that read
|
|
745
|
+
// isn't run again: any other read of its style is.
|
|
746
|
+
elementStyle.restart(fresh.starting);
|
|
631
747
|
};
|
|
632
748
|
const configNow = () => view;
|
|
633
749
|
const styleNow = () => untrack(userStyle);
|
|
@@ -636,10 +752,15 @@ export function wardWith(config, internal) {
|
|
|
636
752
|
const exitConfig = {
|
|
637
753
|
current: Spine.NO_EXIT_CONFIG
|
|
638
754
|
};
|
|
755
|
+
// How it's read of its config, under a presence: none with no presence above it, and nothing
|
|
756
|
+
// made for it then. Mapped from the presence, a function was made for every ward to make it by.
|
|
757
|
+
let exitNow;
|
|
639
758
|
if (Predicate.isNotUndefined(presence)) {
|
|
759
|
+
const now = () => Spine.exitConfigOf(cfg(), node.inherited);
|
|
760
|
+
exitNow = now;
|
|
640
761
|
// Its inherited transition is read untracked here: the effect keeps it current.
|
|
641
762
|
exitConfig.current = untrack(() => Spine.exitConfigOf(initialConfig, node.inherited));
|
|
642
|
-
createEffect(
|
|
763
|
+
createEffect(now, config => {
|
|
643
764
|
exitConfig.current = config;
|
|
644
765
|
}, CLIENT_ONLY_DEFERRED);
|
|
645
766
|
}
|
|
@@ -648,8 +769,21 @@ export function wardWith(config, internal) {
|
|
|
648
769
|
// (#140)*). Its section's `layout` makes its node (#511): without it, its layout props do nothing,
|
|
649
770
|
// and development says so once, unless `layout` is on its way.
|
|
650
771
|
const wantsNode = Feature.wantsLayoutNode(initialConfig);
|
|
772
|
+
/**
|
|
773
|
+
* Whether its drag waits for its layout node (probe: behaviour-runes): it wants one, has none yet, and a
|
|
774
|
+
* Feature is still on its way (`pending`, read now where not given). A hook row's lazy `layout` that came
|
|
775
|
+
* after `drag` was left out of the track (#582), so a behaviour's `measured()` never saw the drag.
|
|
776
|
+
*/
|
|
777
|
+
const holdsForNode = (wants, node, pending) => {
|
|
778
|
+
if (Bool.not(wants)) return false;
|
|
779
|
+
if (Predicate.isNotUndefined(node)) return false;
|
|
780
|
+
return UndefinedOr.match(pending, {
|
|
781
|
+
onUndefined: () => untrack(features.pending),
|
|
782
|
+
onDefined: identity
|
|
783
|
+
});
|
|
784
|
+
};
|
|
651
785
|
if (DEV && wantsNode && Predicate.isUndefined(layoutProjection) && Bool.not(untrack(features.pending))) {
|
|
652
|
-
useFeatureRegistry().warnOnce("layout",
|
|
786
|
+
useFeatureRegistry().warnOnce("layout", missingMessage("layout", Feature.LAYOUT_PROPS));
|
|
653
787
|
}
|
|
654
788
|
const layoutNodes = Bool.match(wantsNode, {
|
|
655
789
|
onTrue: () => layoutProjection,
|
|
@@ -790,7 +924,7 @@ export function wardWith(config, internal) {
|
|
|
790
924
|
if (Bool.not(wanted)) return undefined;
|
|
791
925
|
const service = GestureFeatures.serviceIn(services, key);
|
|
792
926
|
if (DEV && Predicate.isUndefined(service) && Bool.not(untrack(features.pending))) {
|
|
793
|
-
featureRegistry.warnOnce(name,
|
|
927
|
+
featureRegistry.warnOnce(name, missingMessage(name, GestureFeatures.GESTURE_WORDS[name]));
|
|
794
928
|
}
|
|
795
929
|
return service;
|
|
796
930
|
};
|
|
@@ -861,6 +995,14 @@ export function wardWith(config, internal) {
|
|
|
861
995
|
onDefect
|
|
862
996
|
}));
|
|
863
997
|
}
|
|
998
|
+
// A behaviour's input (probe: behaviour-runes): told once a mount, once its gestures' input is there.
|
|
999
|
+
const onInput = internal.onInput;
|
|
1000
|
+
if (Predicate.isNotUndefined(onInput) && Bool.not(m.input)) {
|
|
1001
|
+
UndefinedOr.map(GestureFeatures.serviceIn(services, InputSource.InputSource), input => {
|
|
1002
|
+
m.input = true;
|
|
1003
|
+
onInput(m.element, input, make => m.watch(make(onDefect)), effect => void runtime.runFork(effect), runtime);
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
864
1006
|
};
|
|
865
1007
|
let mounted;
|
|
866
1008
|
// The last two elements given to its ref, for a second one still on the page as it mounts (#349's Q5).
|
|
@@ -894,22 +1036,29 @@ export function wardWith(config, internal) {
|
|
|
894
1036
|
held = PresenceRecord.presenceHold(presence, el, shown);
|
|
895
1037
|
return Predicate.isNotUndefined(held);
|
|
896
1038
|
};
|
|
1039
|
+
/**
|
|
1040
|
+
* Its element's mount ended, and what `afterMount` gave it handed back to be called once the caller's
|
|
1041
|
+
* own work is done (probe: behaviour-runes): a rune's undoing that throws ends nothing of the binding's.
|
|
1042
|
+
*/
|
|
897
1043
|
const unmount = () => {
|
|
898
1044
|
unhold();
|
|
899
|
-
if (Predicate.isUndefined(mounted)) return;
|
|
1045
|
+
if (Predicate.isUndefined(mounted)) return constVoid;
|
|
900
1046
|
const left = mounted.element;
|
|
1047
|
+
const afterUnmount = mounted.afterUnmount;
|
|
901
1048
|
mounted.dispose();
|
|
902
1049
|
mounted = undefined;
|
|
903
1050
|
if (justLeft.size === 0) queueMicrotask(forgetJustLeft);
|
|
904
1051
|
justLeft.add(left);
|
|
1052
|
+
return afterUnmount;
|
|
905
1053
|
};
|
|
906
1054
|
// Its element's mount goes, and its lifecycle's waits are rejected (#257): one cleanup, which ends
|
|
907
1055
|
// what its accessors mounted at their first calls too (#566).
|
|
908
1056
|
// A driving ward's lifecycle is its given ward's, which outlives the element (#349).
|
|
909
1057
|
onCleanup(() => {
|
|
910
|
-
unmount();
|
|
1058
|
+
const afterUnmount = unmount();
|
|
911
1059
|
if (Predicate.isUndefined(share)) lifecycle.dispose();
|
|
912
1060
|
UndefinedOr.map(cleanups, all => Arr.forEach(all, runCleanup));
|
|
1061
|
+
afterUnmount();
|
|
913
1062
|
});
|
|
914
1063
|
const mount = el => {
|
|
915
1064
|
if (justLeft.has(el)) throw new Error(REMADE);
|
|
@@ -1079,7 +1228,10 @@ export function wardWith(config, internal) {
|
|
|
1079
1228
|
propagation: initialConfig.dragPropagation,
|
|
1080
1229
|
directionLock: initialConfig.dragDirectionLock,
|
|
1081
1230
|
transition: dragTransition,
|
|
1082
|
-
listen:
|
|
1231
|
+
listen: UndefinedOr.match(internal.dragListen, {
|
|
1232
|
+
onUndefined: () => initialConfig.dragListener,
|
|
1233
|
+
onDefined: identity
|
|
1234
|
+
})
|
|
1083
1235
|
},
|
|
1084
1236
|
container: constraints.container,
|
|
1085
1237
|
controls: initialConfig.dragControls,
|
|
@@ -1108,7 +1260,14 @@ export function wardWith(config, internal) {
|
|
|
1108
1260
|
onReleaseEnd: () => lifecycle.released()
|
|
1109
1261
|
});
|
|
1110
1262
|
};
|
|
1111
|
-
|
|
1263
|
+
// One that wants a layout node whose `layout` is still on its way holds its drag back until the node
|
|
1264
|
+
// is made, so its track drives the node (probe: behaviour-runes): a hook row's Features come as its
|
|
1265
|
+
// config asks, `drag` before `layout` as often as not, and a node made after the track was left out
|
|
1266
|
+
// of it (#582), so a behaviour's `measured()` never saw the drag.
|
|
1267
|
+
let dragTrack = Bool.match(holdsForNode(wantsNode, layout), {
|
|
1268
|
+
onTrue: constUndefined,
|
|
1269
|
+
onFalse: () => UndefinedOr.map(dragGesture, driveDrag)
|
|
1270
|
+
});
|
|
1112
1271
|
const spineOptions = {
|
|
1113
1272
|
runtime,
|
|
1114
1273
|
gate,
|
|
@@ -1192,6 +1351,8 @@ export function wardWith(config, internal) {
|
|
|
1192
1351
|
pan: false,
|
|
1193
1352
|
inView: false,
|
|
1194
1353
|
focus: false,
|
|
1354
|
+
input: false,
|
|
1355
|
+
afterUnmount: constVoid,
|
|
1195
1356
|
dispose: () => {
|
|
1196
1357
|
if (Predicate.isNotUndefined(undrive)) undrive();
|
|
1197
1358
|
UndefinedOr.map(mountedHook, end => end());
|
|
@@ -1242,9 +1403,10 @@ export function wardWith(config, internal) {
|
|
|
1242
1403
|
services,
|
|
1243
1404
|
pending
|
|
1244
1405
|
}) => {
|
|
1245
|
-
|
|
1406
|
+
// Its node reads its config's options (its `layoutId`, an accessor's): untracked, as at its mount, so said.
|
|
1407
|
+
UndefinedOr.map(mounted, m => untrack(() => layoutArrivedIn(m.arriveLayout, services)));
|
|
1246
1408
|
if (DEV && Predicate.isUndefined(Keys.projectionIn(services)) && Bool.not(pending)) {
|
|
1247
|
-
featureRegistry.warnOnce("layout",
|
|
1409
|
+
featureRegistry.warnOnce("layout", missingMessage("layout", Feature.LAYOUT_PROPS));
|
|
1248
1410
|
}
|
|
1249
1411
|
}, CLIENT_ONLY_DEFERRED);
|
|
1250
1412
|
}
|
|
@@ -1264,11 +1426,14 @@ export function wardWith(config, internal) {
|
|
|
1264
1426
|
UndefinedOr.match(GestureFeatures.serviceIn(services, Keys.DragGesture), {
|
|
1265
1427
|
// A `layout` from the same load makes its node first, so the track drives it (#582).
|
|
1266
1428
|
onDefined: gesture => UndefinedOr.map(mounted, m => {
|
|
1267
|
-
layoutArrivedIn(m.arriveLayout, services);
|
|
1268
|
-
|
|
1429
|
+
untrack(() => layoutArrivedIn(m.arriveLayout, services));
|
|
1430
|
+
// One that wants a node starts its drag once it has one, or once nothing more is coming.
|
|
1431
|
+
if (Bool.not(holdsForNode(wantsNode, m.layout, pending))) UndefinedOr.map(m.startDrag, start => start(gesture));
|
|
1432
|
+
// Its input with it, for a behaviour's keys (probe: behaviour-runes).
|
|
1433
|
+
startRecognizers(m);
|
|
1269
1434
|
}),
|
|
1270
1435
|
onUndefined: () => {
|
|
1271
|
-
if (DEV && Bool.not(pending)) featureRegistry.warnOnce("drag",
|
|
1436
|
+
if (DEV && Bool.not(pending)) featureRegistry.warnOnce("drag", missingMessage("drag", GestureFeatures.GESTURE_WORDS.drag));
|
|
1272
1437
|
}
|
|
1273
1438
|
});
|
|
1274
1439
|
}, CLIENT_ONLY_DEFERRED);
|
|
@@ -1305,6 +1470,9 @@ export function wardWith(config, internal) {
|
|
|
1305
1470
|
el,
|
|
1306
1471
|
resolution
|
|
1307
1472
|
} = mounting;
|
|
1473
|
+
let mountedNow = false;
|
|
1474
|
+
// What the last element's `afterMount` gave, called once this one is mounted and aimed.
|
|
1475
|
+
let afterLast = constVoid;
|
|
1308
1476
|
if (Predicate.isUndefined(mounted) || mounted.element !== el) {
|
|
1309
1477
|
// Another element it was spread on, or the one it's on, still on the page: a ward drives one
|
|
1310
1478
|
// element at a time (#349's Q5). One the page has let go of is left behind.
|
|
@@ -1313,18 +1481,32 @@ export function wardWith(config, internal) {
|
|
|
1313
1481
|
// Held off the page: nothing starts until it's on it.
|
|
1314
1482
|
if (heldBack(el)) return;
|
|
1315
1483
|
// A new element starts with no gesture on, read from its gesture state (#257's audit).
|
|
1316
|
-
unmount();
|
|
1317
|
-
// One that came after the last left the page enters fresh (#414).
|
|
1318
|
-
|
|
1484
|
+
afterLast = unmount();
|
|
1485
|
+
// One that came after the last left the page enters fresh (#414). One that doesn't, read as
|
|
1486
|
+
// one that would, reads its style again.
|
|
1487
|
+
Bool.match(el === fresh, {
|
|
1488
|
+
onTrue: beginFresh,
|
|
1489
|
+
onFalse: elementStyle.notFresh
|
|
1490
|
+
});
|
|
1319
1491
|
// Its config is read at mount (its layout node's options, its `onUpdate`, its spine's) through
|
|
1320
1492
|
// the per-key view (#259): untracked, so said, as the Retarget below.
|
|
1321
1493
|
mounted = untrack(() => mount(el));
|
|
1494
|
+
mountedNow = true;
|
|
1322
1495
|
}
|
|
1323
1496
|
// The spine reads the variant context (its gates, its stagger, what it inherits) at the
|
|
1324
1497
|
// Retarget, once: untracked, so said (Solid 2's dev build warns of a reactive read in an
|
|
1325
1498
|
// effect's apply, STRICT_READ_UNTRACKED). The effect's compute is what re-runs it.
|
|
1326
|
-
const
|
|
1499
|
+
const m = mounted;
|
|
1500
|
+
const spine = m.spine;
|
|
1501
|
+
// What it resolved to, told to a ward that asks for its Features as it uses them (`targeted`).
|
|
1502
|
+
const targeted = internal.targeted;
|
|
1503
|
+
if (Predicate.isNotUndefined(targeted)) targeted(resolution.resolved);
|
|
1327
1504
|
untrack(() => spine.retarget(resolution));
|
|
1505
|
+
// A hooks ward's runes' `ref`s, once it's mounted and aimed (probe: behaviour-runes): the last
|
|
1506
|
+
// element's undone, then this one's run. Not untracked, which is the `ref`'s author's to say.
|
|
1507
|
+
afterLast();
|
|
1508
|
+
const afterMount = internal.afterMount;
|
|
1509
|
+
if (mountedNow && Predicate.isNotUndefined(afterMount)) m.afterUnmount = afterMount(el);
|
|
1328
1510
|
}, CLIENT_ONLY_SYNC);
|
|
1329
1511
|
// `<card.Provider>` hands down what this element hands its children (#50).
|
|
1330
1512
|
const Provider = props => WardicVariantContext(new _P$(node, props));
|
|
@@ -1396,9 +1578,45 @@ export function wardWith(config, internal) {
|
|
|
1396
1578
|
};
|
|
1397
1579
|
}
|
|
1398
1580
|
});
|
|
1581
|
+
// Whether its presence says the next element it's given enters afresh (probe: hooks-first).
|
|
1582
|
+
const presenceSaysFresh = () => {
|
|
1583
|
+
const enters = internal.entersFresh;
|
|
1584
|
+
if (Predicate.isUndefined(enters)) return false;
|
|
1585
|
+
return enters(self);
|
|
1586
|
+
};
|
|
1587
|
+
// Whether the element a first read of its style is for enters fresh (#414), told before its mount
|
|
1588
|
+
// begins it: its ref has decided it for one given and not yet mounted, and will say this of the next.
|
|
1589
|
+
const comesFresh = () => {
|
|
1590
|
+
const last = refdLast;
|
|
1591
|
+
if (Predicate.isUndefined(last)) return presenceSaysFresh();
|
|
1592
|
+
if (UndefinedOr.map(mounted, elementOfMount) !== last) return fresh === last;
|
|
1593
|
+
return Bool.or(Bool.not(last.isConnected), presenceSaysFresh());
|
|
1594
|
+
};
|
|
1595
|
+
// Each computation that has read its style: one for each element it's on, the same at every run of
|
|
1596
|
+
// that element's props. So a first read is an element's being made.
|
|
1597
|
+
const styleReaders = new WeakSet();
|
|
1399
1598
|
const renderedStyle = () => {
|
|
1400
1599
|
holdWhileLoading();
|
|
1401
|
-
|
|
1600
|
+
const user = userStyle();
|
|
1601
|
+
const reader = getOwner();
|
|
1602
|
+
// Read outside a computation, or by one that has read it before: as the gate has it.
|
|
1603
|
+
if (Predicate.isNull(reader)) return elementStyle.style(user);
|
|
1604
|
+
if (styleReaders.has(reader)) return elementStyle.style(user);
|
|
1605
|
+
// An element that enters fresh reads its Starting style here, derived from what its ref goes by.
|
|
1606
|
+
// Its mount begins the entry once the ref has given it, and doesn't run this read again: told
|
|
1607
|
+
// of the restart afterwards, a spread re-ran on a write its own effect had led to, through the
|
|
1608
|
+
// ref it calls (EFFECT_WRITES_OWN_SOURCE).
|
|
1609
|
+
const style = Bool.match(comesFresh(), {
|
|
1610
|
+
onTrue: () => elementStyle.entering(user, untrack(freshStarting)),
|
|
1611
|
+
onFalse: () => elementStyle.style(user)
|
|
1612
|
+
});
|
|
1613
|
+
styleReaders.add(reader);
|
|
1614
|
+
// Told to the hooks, where they made it, in development alone (probe: hooks-first, Q29).
|
|
1615
|
+
if (DEV) {
|
|
1616
|
+
const styled = internal.styled;
|
|
1617
|
+
if (Predicate.isNotUndefined(styled)) styled(self);
|
|
1618
|
+
}
|
|
1619
|
+
return style;
|
|
1402
1620
|
};
|
|
1403
1621
|
// The ward: a ref, and its own props. Under a presence, its element is told to it as it's made
|
|
1404
1622
|
// (#286): its `key`, and whether it's a twin.
|
|
@@ -1425,9 +1643,10 @@ export function wardWith(config, internal) {
|
|
|
1425
1643
|
config,
|
|
1426
1644
|
setup: initialConfig,
|
|
1427
1645
|
internal,
|
|
1646
|
+
fixed: () => fixedOver(written),
|
|
1428
1647
|
parent,
|
|
1429
1648
|
chosen: Predicate.isNotUndefined(internal.parent),
|
|
1430
|
-
carries:
|
|
1649
|
+
carries: carriesFor(internal, initialConfig),
|
|
1431
1650
|
provided: node.provided,
|
|
1432
1651
|
layoutGroup,
|
|
1433
1652
|
node,
|
|
@@ -1439,6 +1658,10 @@ export function wardWith(config, internal) {
|
|
|
1439
1658
|
const setMade = Spine.madeWith(presence, setElement, initialConfig);
|
|
1440
1659
|
const self = value => {
|
|
1441
1660
|
if (isElement(value)) {
|
|
1661
|
+
// Told to the hooks, where they made it (probe: hooks-first): what a leaving row finds inside it.
|
|
1662
|
+
// No callback made for it: this runs for every element of every ward.
|
|
1663
|
+
const handed = internal.handed;
|
|
1664
|
+
if (Predicate.isNotUndefined(handed)) handed(value, self);
|
|
1442
1665
|
const last = refdLast;
|
|
1443
1666
|
if (Predicate.isNotUndefined(last)) {
|
|
1444
1667
|
if (last !== value) {
|
|
@@ -1446,12 +1669,21 @@ export function wardWith(config, internal) {
|
|
|
1446
1669
|
if (Bool.not(last.isConnected)) fresh = value;
|
|
1447
1670
|
}
|
|
1448
1671
|
}
|
|
1672
|
+
// A presence's next value (probe: hooks-first): its element enters afresh though the last may
|
|
1673
|
+
// still be on the page, and so does the first one of a value that came after the page opened.
|
|
1674
|
+
if (Bool.and(last !== value, presenceSaysFresh())) fresh = value;
|
|
1449
1675
|
refdLast = value;
|
|
1450
1676
|
setMade(value);
|
|
1451
1677
|
return undefined;
|
|
1452
1678
|
}
|
|
1453
1679
|
return spreadNow();
|
|
1454
1680
|
};
|
|
1681
|
+
// The presence it's made under, for a hook ward to watch its child's leave by (probe: hooks-first).
|
|
1682
|
+
// No callback made for it: this runs for every ward under a presence, each row of a list.
|
|
1683
|
+
if (Predicate.isNotUndefined(presence)) {
|
|
1684
|
+
const madeUnder = internal.madeUnder;
|
|
1685
|
+
if (Predicate.isNotUndefined(madeUnder)) madeUnder(self, presence);
|
|
1686
|
+
}
|
|
1455
1687
|
// What a spread of the ward reads (#495): its spread's props alone, made at its first spread, so a
|
|
1456
1688
|
// ward given only to `ref` makes none, and a Reorder item's keyboard attributes are in it.
|
|
1457
1689
|
let spread;
|
|
@@ -1491,11 +1723,17 @@ export function wardWith(config, internal) {
|
|
|
1491
1723
|
lifecycle,
|
|
1492
1724
|
element,
|
|
1493
1725
|
hold: holdWhileLoading,
|
|
1726
|
+
written,
|
|
1727
|
+
target,
|
|
1728
|
+
handsDown: node.handsDown,
|
|
1729
|
+
exitConfig,
|
|
1730
|
+
exitNow,
|
|
1494
1731
|
settled: undefined,
|
|
1495
1732
|
tapped: undefined,
|
|
1496
1733
|
next: undefined,
|
|
1497
1734
|
each: undefined,
|
|
1498
|
-
when: undefined
|
|
1735
|
+
when: undefined,
|
|
1736
|
+
hooks: undefined
|
|
1499
1737
|
};
|
|
1500
1738
|
Object.setPrototypeOf(self, WARD_MEMBERS);
|
|
1501
1739
|
Object.defineProperties(self, {
|
|
@@ -1614,19 +1852,19 @@ const serverWard = (config, internal) => {
|
|
|
1614
1852
|
// A server's own values: the DOM's, its context's constant (#672).
|
|
1615
1853
|
const ownValues = ElementSetup.valueReadsOf(useWardicValueReads()).ownValues;
|
|
1616
1854
|
createUniqueId();
|
|
1617
|
-
const view = configuredView(WARD_VIEW.of(config, internal.fixed),
|
|
1855
|
+
const view = configuredView(WARD_VIEW.of(config, internal.fixed), configOf(internal));
|
|
1618
1856
|
// A key still loading (#257 item 1): one setup fixes is the client's error here too. One the ward
|
|
1619
1857
|
// reads as it goes is read again, throwing Solid's `NotReadyError`: a server waits for it and
|
|
1620
1858
|
// renders the component again, so its region streams once the data is in, Appear and all.
|
|
1621
1859
|
// Both are checked before the read that waits.
|
|
1622
1860
|
const setup = WARD_VIEW.setupOf(view);
|
|
1623
1861
|
// Animation controls (#433) set nothing on a server: no entry yet, and controlled, as on the client.
|
|
1624
|
-
const atSetup = AnimationControls.uncontrolledOf(configAtSetup(setup));
|
|
1862
|
+
const atSetup = variantChildBy(internal, AnimationControls.uncontrolledOf(configAtSetup(setup)));
|
|
1625
1863
|
// Where it's made, its given parent's, or its given ward's (#349).
|
|
1626
1864
|
const parent = variantParentOf(internal);
|
|
1627
1865
|
const presenceBlocks = PresenceRecord.presenceBlocksInitial(usePresenceContext());
|
|
1628
1866
|
if (Bool.and(Arr.contains(setup.pending, "animate"), VariantTree.startsAtAnimate(atSetup, VariantTree.inheritedContext(atSetup, parent), presenceBlocks))) throw new Error(STARTS_AT_PENDING);
|
|
1629
|
-
const c = AnimationControls.uncontrolledOf(WARD_VIEW.snapshotOf(view));
|
|
1867
|
+
const c = variantChildBy(internal, AnimationControls.uncontrolledOf(WARD_VIEW.snapshotOf(view)));
|
|
1630
1868
|
const node = VariantTree.serverVariantNode(c, parent);
|
|
1631
1869
|
const serverStart = Spine.startOf(c, node.inherited, presenceBlocks, untrack);
|
|
1632
1870
|
// A variant that throws leaves its values out of the markup, logged on the server (#979).
|
|
@@ -1656,7 +1894,13 @@ const serverWard = (config, internal) => {
|
|
|
1656
1894
|
onDefined: base => base()
|
|
1657
1895
|
})), Style.over(dragDefaults), Style.over(appear.style));
|
|
1658
1896
|
};
|
|
1659
|
-
|
|
1897
|
+
// Worked out at its first read, a spread's (probe: behaviour-runes): what's made after the ward and
|
|
1898
|
+
// before its element renders still counts, a hooks row's grip, which takes its `touch-action` away.
|
|
1899
|
+
let style;
|
|
1900
|
+
const styleNow = () => {
|
|
1901
|
+
if (Predicate.isUndefined(style)) style = styleFor(c.style);
|
|
1902
|
+
return style;
|
|
1903
|
+
};
|
|
1660
1904
|
let given = NO_WITH;
|
|
1661
1905
|
const attributes = attributeKeysOf(seed.attrs, Predicate.isNotUndefined(dragDefaults));
|
|
1662
1906
|
// A spread of it reads its spread's props alone, made at its first spread, as the client's (#495).
|
|
@@ -1666,7 +1910,7 @@ const serverWard = (config, internal) => {
|
|
|
1666
1910
|
value: noRef,
|
|
1667
1911
|
enumerable: true
|
|
1668
1912
|
}, {
|
|
1669
|
-
|
|
1913
|
+
get: styleNow,
|
|
1670
1914
|
enumerable: true
|
|
1671
1915
|
}, attributes);
|
|
1672
1916
|
return spread;
|
|
@@ -1676,11 +1920,12 @@ const serverWard = (config, internal) => {
|
|
|
1676
1920
|
config,
|
|
1677
1921
|
setup: atSetup,
|
|
1678
1922
|
internal,
|
|
1923
|
+
fixed: () => internal.fixed,
|
|
1679
1924
|
parent,
|
|
1680
1925
|
chosen: Predicate.isNotUndefined(internal.parent),
|
|
1681
|
-
carries:
|
|
1926
|
+
carries: carriesFor(internal, atSetup),
|
|
1682
1927
|
provided: appear.provided,
|
|
1683
|
-
layoutGroup:
|
|
1928
|
+
layoutGroup: groupOf(internal),
|
|
1684
1929
|
node: undefined,
|
|
1685
1930
|
lifecycle: undefined,
|
|
1686
1931
|
drive: () => constVoid
|
|
@@ -1694,7 +1939,7 @@ const serverWard = (config, internal) => {
|
|
|
1694
1939
|
enumerable: true
|
|
1695
1940
|
},
|
|
1696
1941
|
style: {
|
|
1697
|
-
|
|
1942
|
+
get: styleNow,
|
|
1698
1943
|
enumerable: true
|
|
1699
1944
|
},
|
|
1700
1945
|
...attributes,
|
|
@@ -1724,8 +1969,11 @@ const serverWard = (config, internal) => {
|
|
|
1724
1969
|
when: {
|
|
1725
1970
|
value: serverWhen
|
|
1726
1971
|
},
|
|
1727
|
-
// The element's own style over the config's, rendered in its Starting style (#264).
|
|
1972
|
+
// The element's own style over the config's, rendered in its Starting style (#264). Configurable,
|
|
1973
|
+
// as a client's is by being a shared member: so what makes a ward of this one can give it a
|
|
1974
|
+
// `with` of its own, on a server as in a browser (the hooks', for what their runes add to a spread).
|
|
1728
1975
|
with: {
|
|
1976
|
+
configurable: true,
|
|
1729
1977
|
value: own => {
|
|
1730
1978
|
given = own;
|
|
1731
1979
|
return spreadPropsOf({
|
|
@@ -1746,4 +1994,283 @@ const serverWard = (config, internal) => {
|
|
|
1746
1994
|
};
|
|
1747
1995
|
/** A server render's `ref`: Solid never calls it there. */
|
|
1748
1996
|
const noRef = constUndefined;
|
|
1997
|
+
/** No values: what a function rune's ward rests at, having no config ({@link holderWard}). */
|
|
1998
|
+
const NO_VALUES = {};
|
|
1999
|
+
/** A function rune's ward's config, as it's written and at setup: none. */
|
|
2000
|
+
const NO_WRITTEN = Object.freeze({});
|
|
2001
|
+
/** A function rune's ward's exit: none, never read again, as it has no `exitNow`. */
|
|
2002
|
+
const NO_EXIT = Object.freeze({
|
|
2003
|
+
current: Spine.NO_EXIT_CONFIG
|
|
2004
|
+
});
|
|
2005
|
+
/**
|
|
2006
|
+
* What development says of `member` used in a function rune's body (the ward split's Q7): it's the
|
|
2007
|
+
* finished ward's, and that ward isn't made yet.
|
|
2008
|
+
*/
|
|
2009
|
+
const usedEarly = member => `createRune(fn): ${member} was used in the rune's body, before its ward is made. It's the ward's, and the ward ` + "doesn't exist until every rune has run: use it where the ward is rendered, or in an effect or a callback.";
|
|
2010
|
+
// Module state (#460, Q7): what development has said, each member once.
|
|
2011
|
+
const SAID_EARLY = new Set();
|
|
2012
|
+
/** Says {@link usedEarly} of `member`, once, in development. */
|
|
2013
|
+
const sayEarly = member => {
|
|
2014
|
+
if (Predicate.isUndefined(DEV)) return;
|
|
2015
|
+
if (SAID_EARLY.has(member)) return;
|
|
2016
|
+
SAID_EARLY.add(member);
|
|
2017
|
+
console.warn(usedEarly(member));
|
|
2018
|
+
};
|
|
2019
|
+
/** The finished ward each function rune's ward hands on to, told it by {@link holderFinished}. */
|
|
2020
|
+
// Module state (#460, Q7): held weakly by the function rune's ward.
|
|
2021
|
+
const FINISHING = new WeakMap();
|
|
2022
|
+
/** Tells `holder`, a function rune's ward ({@link holderWard}), the ward it's part of, now that it's made. */
|
|
2023
|
+
export const holderFinished = (holder, ward) => {
|
|
2024
|
+
UndefinedOr.map(FINISHING.get(holder), finish => finish(ward));
|
|
2025
|
+
};
|
|
2026
|
+
/**
|
|
2027
|
+
* A function rune's ward (probe: behaviour-runes, the ward split's Q6–Q8, Q11), made before the ward it's
|
|
2028
|
+
* part of, since every rune runs before that ward is: a lifecycle and what the hooks keep, with no config,
|
|
2029
|
+
* no variant node and no mount. The finished ward adopts its lifecycle through its share, as a ward given
|
|
2030
|
+
* to a component does (#349), and drives its `read` and `atom` while it's on an element: as the second
|
|
2031
|
+
* binding ward this replaces did, at a fraction of its cost. What only the finished ward has, its
|
|
2032
|
+
* `Provider`, its spread and `with`, its `style` and its element, it hands on to that ward once
|
|
2033
|
+
* {@link holderFinished} says which: used in the rune's body, before then, development says so. It takes
|
|
2034
|
+
* no hydration id, on a server or in a browser.
|
|
2035
|
+
*/
|
|
2036
|
+
export const holderWard = internal => {
|
|
2037
|
+
// Where it's made: the variant context and Layout group its finished ward takes through its share.
|
|
2038
|
+
const parent = variantParentOf(internal);
|
|
2039
|
+
const layoutGroup = groupOf(internal);
|
|
2040
|
+
if (isServer) return serverHolder(internal, parent, layoutGroup);
|
|
2041
|
+
return clientHolder(internal, parent, layoutGroup);
|
|
2042
|
+
};
|
|
2043
|
+
/** A function rune's ward in a browser ({@link holderWard}). */
|
|
2044
|
+
const clientHolder = (internal, parent, layoutGroup) => {
|
|
2045
|
+
const registry = Spine.registryOf(useWardicRuntime());
|
|
2046
|
+
const firstCallOwner = firstCallOwnerHere();
|
|
2047
|
+
let finished;
|
|
2048
|
+
// The finished ward on its element (#349's driver): what its `read`, `atom` and `next` follow.
|
|
2049
|
+
let driver;
|
|
2050
|
+
let driven;
|
|
2051
|
+
let cleanups;
|
|
2052
|
+
const addCleanup = cleanup => {
|
|
2053
|
+
if (Predicate.isUndefined(cleanups)) cleanups = [];
|
|
2054
|
+
cleanups.push(cleanup);
|
|
2055
|
+
};
|
|
2056
|
+
const drivenAtom = () => {
|
|
2057
|
+
if (Predicate.isNotUndefined(driven)) return driven;
|
|
2058
|
+
const atom = Atom.make(driver);
|
|
2059
|
+
addCleanup(registry().mount(atom));
|
|
2060
|
+
driven = atom;
|
|
2061
|
+
return atom;
|
|
2062
|
+
};
|
|
2063
|
+
// Its gestures are its finished ward's: a `next` that asks for one starts it on that ward's element.
|
|
2064
|
+
const lifecycle = new Lifecycle(firstCallOwner, () => {
|
|
2065
|
+
UndefinedOr.map(driver, d => d.wanted());
|
|
2066
|
+
});
|
|
2067
|
+
onCleanup(() => {
|
|
2068
|
+
lifecycle.dispose();
|
|
2069
|
+
UndefinedOr.map(cleanups, all => Arr.forEach(all, runCleanup));
|
|
2070
|
+
});
|
|
2071
|
+
// A key's value: the finished ward's element's, while it drives this one; where nothing rests, else.
|
|
2072
|
+
let reads;
|
|
2073
|
+
const read = key => {
|
|
2074
|
+
if (Predicate.isUndefined(reads)) reads = new Map();
|
|
2075
|
+
const known = reads.get(key);
|
|
2076
|
+
if (Predicate.isNotUndefined(known)) return known;
|
|
2077
|
+
const following = drivenAtom();
|
|
2078
|
+
const resting = ElementSetup.restingOf(key, NO_VALUES, undefined, identity);
|
|
2079
|
+
const atom = Atom.make(get => UndefinedOr.match(get(following), {
|
|
2080
|
+
onUndefined: () => resting,
|
|
2081
|
+
onDefined: d => get(d.readAtom(key))
|
|
2082
|
+
}));
|
|
2083
|
+
const accessor = runWithOwner(firstCallOwner, () => followAtom(registry(), atom, addCleanup));
|
|
2084
|
+
reads.set(key, accessor);
|
|
2085
|
+
return accessor;
|
|
2086
|
+
};
|
|
2087
|
+
const atomOf = key => {
|
|
2088
|
+
const following = drivenAtom();
|
|
2089
|
+
return Atom.make(get => UndefinedOr.match(get(following), {
|
|
2090
|
+
onUndefined: constUndefined,
|
|
2091
|
+
onDefined: d => get(d.atom(key))
|
|
2092
|
+
}));
|
|
2093
|
+
};
|
|
2094
|
+
// Followed by one finished ward at a time (#349's Q5).
|
|
2095
|
+
const drive = (next, name) => {
|
|
2096
|
+
if (Predicate.isNotUndefined(driver)) throw new Error(secondElement(name));
|
|
2097
|
+
driver = next;
|
|
2098
|
+
UndefinedOr.map(driven, atom => registry().set(atom, next));
|
|
2099
|
+
return () => {
|
|
2100
|
+
if (driver !== next) return;
|
|
2101
|
+
driver = undefined;
|
|
2102
|
+
UndefinedOr.map(driven, atom => registry().set(atom, undefined));
|
|
2103
|
+
};
|
|
2104
|
+
};
|
|
2105
|
+
const shared = {
|
|
2106
|
+
config: NO_WRITTEN,
|
|
2107
|
+
setup: NO_WRITTEN,
|
|
2108
|
+
internal,
|
|
2109
|
+
fixed: () => internal.fixed,
|
|
2110
|
+
parent,
|
|
2111
|
+
chosen: Predicate.isNotUndefined(internal.parent),
|
|
2112
|
+
carries: false,
|
|
2113
|
+
provided: undefined,
|
|
2114
|
+
layoutGroup,
|
|
2115
|
+
node: undefined,
|
|
2116
|
+
lifecycle,
|
|
2117
|
+
drive
|
|
2118
|
+
};
|
|
2119
|
+
const self = value => UndefinedOr.match(finished, {
|
|
2120
|
+
onUndefined: () => {
|
|
2121
|
+
sayEarly("the ward as a ref or a spread");
|
|
2122
|
+
return undefined;
|
|
2123
|
+
},
|
|
2124
|
+
onDefined: to => to(value)
|
|
2125
|
+
});
|
|
2126
|
+
const state = {
|
|
2127
|
+
shared: () => shared,
|
|
2128
|
+
Provider: props => UndefinedOr.match(finished, {
|
|
2129
|
+
onUndefined: () => {
|
|
2130
|
+
sayEarly("Provider");
|
|
2131
|
+
return props.children;
|
|
2132
|
+
},
|
|
2133
|
+
onDefined: to => to.Provider(props)
|
|
2134
|
+
}),
|
|
2135
|
+
read,
|
|
2136
|
+
atom: atomOf,
|
|
2137
|
+
with: own => UndefinedOr.match(finished, {
|
|
2138
|
+
onUndefined: () => {
|
|
2139
|
+
sayEarly("with");
|
|
2140
|
+
return spreadPropsOf({});
|
|
2141
|
+
},
|
|
2142
|
+
onDefined: to => to.with(own)
|
|
2143
|
+
}),
|
|
2144
|
+
lifecycle,
|
|
2145
|
+
element: () => UndefinedOr.match(finished, {
|
|
2146
|
+
onUndefined: constUndefined,
|
|
2147
|
+
onDefined: to => UndefinedOr.match(sensedOf(to), {
|
|
2148
|
+
onUndefined: constUndefined,
|
|
2149
|
+
onDefined: sensed => sensed.element()
|
|
2150
|
+
})
|
|
2151
|
+
}),
|
|
2152
|
+
hold: () => {
|
|
2153
|
+
UndefinedOr.map(finished, to => stateOf(to).hold());
|
|
2154
|
+
},
|
|
2155
|
+
written: NO_WRITTEN,
|
|
2156
|
+
target: undefined,
|
|
2157
|
+
handsDown: undefined,
|
|
2158
|
+
exitConfig: NO_EXIT,
|
|
2159
|
+
exitNow: undefined,
|
|
2160
|
+
settled: undefined,
|
|
2161
|
+
tapped: undefined,
|
|
2162
|
+
next: undefined,
|
|
2163
|
+
each: undefined,
|
|
2164
|
+
when: undefined,
|
|
2165
|
+
hooks: undefined
|
|
2166
|
+
};
|
|
2167
|
+
FINISHING.set(self, ward => {
|
|
2168
|
+
finished = ward;
|
|
2169
|
+
});
|
|
2170
|
+
Object.setPrototypeOf(self, WARD_MEMBERS);
|
|
2171
|
+
Object.defineProperties(self, {
|
|
2172
|
+
[WARD_STATE]: {
|
|
2173
|
+
value: state
|
|
2174
|
+
},
|
|
2175
|
+
ref: {
|
|
2176
|
+
value: self,
|
|
2177
|
+
enumerable: true
|
|
2178
|
+
},
|
|
2179
|
+
style: {
|
|
2180
|
+
get: () => styleOf(finished),
|
|
2181
|
+
enumerable: true
|
|
2182
|
+
}
|
|
2183
|
+
});
|
|
2184
|
+
return self;
|
|
2185
|
+
};
|
|
2186
|
+
/** A function rune's ward's `style`: its finished ward's. */
|
|
2187
|
+
const styleOf = finished => UndefinedOr.match(finished, {
|
|
2188
|
+
onUndefined: () => {
|
|
2189
|
+
sayEarly("style");
|
|
2190
|
+
return {};
|
|
2191
|
+
},
|
|
2192
|
+
onDefined: to => to.style
|
|
2193
|
+
});
|
|
2194
|
+
/** A function rune's ward on a server ({@link holderWard}): a server ward's members, and its share. Nothing hears anything there. */
|
|
2195
|
+
const serverHolder = (internal, parent, layoutGroup) => {
|
|
2196
|
+
let finished;
|
|
2197
|
+
const self = () => UndefinedOr.match(finished, {
|
|
2198
|
+
onUndefined: () => {
|
|
2199
|
+
sayEarly("the ward as a ref or a spread");
|
|
2200
|
+
return undefined;
|
|
2201
|
+
},
|
|
2202
|
+
onDefined: to => to()
|
|
2203
|
+
});
|
|
2204
|
+
const shared = {
|
|
2205
|
+
config: NO_WRITTEN,
|
|
2206
|
+
setup: NO_WRITTEN,
|
|
2207
|
+
internal,
|
|
2208
|
+
fixed: () => internal.fixed,
|
|
2209
|
+
parent,
|
|
2210
|
+
chosen: Predicate.isNotUndefined(internal.parent),
|
|
2211
|
+
carries: false,
|
|
2212
|
+
provided: undefined,
|
|
2213
|
+
layoutGroup,
|
|
2214
|
+
node: undefined,
|
|
2215
|
+
lifecycle: undefined,
|
|
2216
|
+
drive: () => constVoid
|
|
2217
|
+
};
|
|
2218
|
+
FINISHING.set(self, ward => {
|
|
2219
|
+
finished = ward;
|
|
2220
|
+
});
|
|
2221
|
+
Object.defineProperties(self, {
|
|
2222
|
+
[WARD]: {
|
|
2223
|
+
value: shared
|
|
2224
|
+
},
|
|
2225
|
+
ref: {
|
|
2226
|
+
value: noRef,
|
|
2227
|
+
enumerable: true
|
|
2228
|
+
},
|
|
2229
|
+
style: {
|
|
2230
|
+
get: () => styleOf(finished),
|
|
2231
|
+
enumerable: true
|
|
2232
|
+
},
|
|
2233
|
+
Provider: {
|
|
2234
|
+
value: props => UndefinedOr.match(finished, {
|
|
2235
|
+
onUndefined: () => {
|
|
2236
|
+
sayEarly("Provider");
|
|
2237
|
+
return props.children;
|
|
2238
|
+
},
|
|
2239
|
+
onDefined: to => to.Provider(props)
|
|
2240
|
+
})
|
|
2241
|
+
},
|
|
2242
|
+
read: {
|
|
2243
|
+
value: key => () => ElementSetup.restingOf(key, NO_VALUES, undefined, identity)
|
|
2244
|
+
},
|
|
2245
|
+
atom: {
|
|
2246
|
+
value: () => NO_OUTPUT
|
|
2247
|
+
},
|
|
2248
|
+
settled: {
|
|
2249
|
+
value: constUndefined
|
|
2250
|
+
},
|
|
2251
|
+
tapped: {
|
|
2252
|
+
value: constUndefined
|
|
2253
|
+
},
|
|
2254
|
+
next: {
|
|
2255
|
+
value: neverLands
|
|
2256
|
+
},
|
|
2257
|
+
each: {
|
|
2258
|
+
value: () => NO_EVENTS
|
|
2259
|
+
},
|
|
2260
|
+
when: {
|
|
2261
|
+
value: serverWhen
|
|
2262
|
+
},
|
|
2263
|
+
with: {
|
|
2264
|
+
configurable: true,
|
|
2265
|
+
value: own => UndefinedOr.match(finished, {
|
|
2266
|
+
onUndefined: () => {
|
|
2267
|
+
sayEarly("with");
|
|
2268
|
+
return spreadPropsOf({});
|
|
2269
|
+
},
|
|
2270
|
+
onDefined: to => to.with(own)
|
|
2271
|
+
})
|
|
2272
|
+
}
|
|
2273
|
+
});
|
|
2274
|
+
return self;
|
|
2275
|
+
};
|
|
1749
2276
|
//# sourceMappingURL=ward.js.map
|