@wardic/solid 2.2.0 → 3.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -18
- package/dist/browser/animation-frame.js +1 -1
- package/dist/browser/animation-frame.js.map +1 -1
- package/dist/browser/config-view.js +35 -6
- package/dist/browser/config-view.js.map +1 -1
- package/dist/browser/create-batch.js +1 -1
- package/dist/browser/diagnostic-codes.js +216 -0
- package/dist/browser/diagnostic-codes.js.map +1 -0
- package/dist/browser/diagnostics.js +79 -0
- package/dist/browser/diagnostics.js.map +1 -0
- package/dist/browser/element-style.js +61 -7
- package/dist/browser/element-style.js.map +1 -1
- package/dist/browser/element.js +24 -6
- 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/frame-effect.js +1 -1
- package/dist/browser/frame-effect.js.map +1 -1
- package/dist/browser/gesture-callbacks.js +1 -1
- package/dist/browser/gesture-callbacks.js.map +1 -1
- package/dist/browser/hooks/auto.js +270 -0
- package/dist/browser/hooks/auto.js.map +1 -0
- package/dist/browser/hooks/config-scope.js +120 -0
- package/dist/browser/hooks/config-scope.js.map +1 -0
- package/dist/browser/hooks/config.js +37 -0
- package/dist/browser/hooks/config.js.map +1 -0
- package/dist/browser/hooks/drag.js +633 -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 +88 -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 +269 -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 +800 -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 +2212 -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 +563 -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 +124 -90
- 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 +51 -278
- package/dist/browser/reorder.js.map +1 -1
- package/dist/browser/runtime.js +26 -15
- package/dist/browser/runtime.js.map +1 -1
- package/dist/browser/spans-check.js +8 -3
- package/dist/browser/spans-check.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 +594 -61
- 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/animation-frame.js +1 -1
- package/dist/server/animation-frame.js.map +1 -1
- package/dist/server/config-view.js +35 -6
- package/dist/server/config-view.js.map +1 -1
- package/dist/server/create-batch.js +1 -1
- package/dist/server/diagnostic-codes.js +216 -0
- package/dist/server/diagnostic-codes.js.map +1 -0
- package/dist/server/diagnostics.js +79 -0
- package/dist/server/diagnostics.js.map +1 -0
- package/dist/server/element-style.js +61 -7
- package/dist/server/element-style.js.map +1 -1
- package/dist/server/element.js +24 -6
- 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/frame-effect.js +1 -1
- package/dist/server/frame-effect.js.map +1 -1
- package/dist/server/gesture-callbacks.js +1 -1
- package/dist/server/gesture-callbacks.js.map +1 -1
- package/dist/server/hooks/auto.js +270 -0
- package/dist/server/hooks/auto.js.map +1 -0
- package/dist/server/hooks/config-scope.js +120 -0
- package/dist/server/hooks/config-scope.js.map +1 -0
- package/dist/server/hooks/config.js +37 -0
- package/dist/server/hooks/config.js.map +1 -0
- package/dist/server/hooks/drag.js +633 -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 +87 -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 +309 -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 +800 -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 +2212 -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 +563 -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 +125 -100
- 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 +51 -348
- package/dist/server/reorder.js.map +1 -1
- package/dist/server/runtime.js +26 -15
- package/dist/server/runtime.js.map +1 -1
- package/dist/server/spans-check.js +8 -3
- package/dist/server/spans-check.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 +594 -61
- 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/animation-frame.js +1 -1
- package/dist/solid/animation-frame.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 +31 -7
- package/dist/solid/config-view.js.map +1 -1
- package/dist/solid/create-batch.jsx +1 -1
- package/dist/solid/diagnostic-codes.d.ts +10 -0
- package/dist/solid/diagnostic-codes.d.ts.map +1 -0
- package/dist/solid/diagnostic-codes.js +246 -0
- package/dist/solid/diagnostic-codes.js.map +1 -0
- package/dist/solid/diagnostics.d.ts +33 -0
- package/dist/solid/diagnostics.d.ts.map +1 -0
- package/dist/solid/diagnostics.js +76 -0
- package/dist/solid/diagnostics.js.map +1 -0
- 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 +27 -8
- 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/frame-effect.jsx +1 -1
- package/dist/solid/frame-effect.jsx.map +1 -1
- package/dist/solid/gesture-callbacks.js +1 -1
- package/dist/solid/gesture-callbacks.js.map +1 -1
- package/dist/solid/hooks/auto.d.ts +44 -0
- package/dist/solid/hooks/auto.d.ts.map +1 -0
- package/dist/solid/hooks/auto.js +269 -0
- package/dist/solid/hooks/auto.js.map +1 -0
- package/dist/solid/hooks/config-scope.d.ts +84 -0
- package/dist/solid/hooks/config-scope.d.ts.map +1 -0
- package/dist/solid/hooks/config-scope.jsx +128 -0
- package/dist/solid/hooks/config-scope.jsx.map +1 -0
- package/dist/solid/hooks/config.d.ts +28 -0
- package/dist/solid/hooks/config.d.ts.map +1 -0
- package/dist/solid/hooks/config.jsx +37 -0
- package/dist/solid/hooks/config.jsx.map +1 -0
- package/dist/solid/hooks/drag.d.ts +220 -0
- package/dist/solid/hooks/drag.d.ts.map +1 -0
- package/dist/solid/hooks/drag.js +586 -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 +63 -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 +274 -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 +817 -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 +2258 -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 +523 -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 +126 -82
- 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 +45 -206
- package/dist/solid/reorder.jsx.map +1 -1
- package/dist/solid/runtime.d.ts +20 -7
- package/dist/solid/runtime.d.ts.map +1 -1
- package/dist/solid/runtime.js +25 -14
- package/dist/solid/runtime.js.map +1 -1
- package/dist/solid/spans-check.d.ts +5 -1
- package/dist/solid/spans-check.d.ts.map +1 -1
- package/dist/solid/spans-check.js +8 -3
- package/dist/solid/spans-check.js.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 +564 -60
- 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 +29 -7
- package/skills/wardic-diagnostics/SKILL.md +472 -0
- package/skills/wardic-migrate/SKILL.md +204 -0
- package/skills/wardic-solid/SKILL.md +60 -0
- package/skills/wardic-solid/events.md +70 -0
- package/skills/wardic-solid/from-motion.md +59 -0
- package/skills/wardic-solid/lists-and-presence.md +110 -0
- package/skills/wardic-solid/reorder-and-grips.md +88 -0
- package/skills/wardic-solid/runes.md +151 -0
- package/skills/wardic-solid/scopes-and-settings.md +75 -0
- package/src/animation-frame.ts +1 -1
- package/src/batch-reorder-group.tsx +1 -1
- package/src/batch-reorder.ts +1 -1
- package/src/config-view.ts +35 -7
- package/src/create-batch.tsx +1 -1
- package/src/diagnostic-codes.ts +254 -0
- package/src/diagnostics.ts +88 -0
- package/src/element-style.ts +77 -9
- package/src/element.tsx +36 -12
- package/src/feature-section.ts +5 -15
- package/src/frame-effect.tsx +1 -1
- package/src/gesture-callbacks.ts +1 -1
- 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 +741 -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 +156 -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 +323 -0
- package/src/hooks/reorder.ts +205 -0
- package/src/hooks/rune.ts +1756 -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 +2587 -0
- package/src/hooks/wardic-provider.tsx +51 -0
- package/src/hooks/wardic-scope.tsx +112 -0
- package/src/hooks/wards.ts +681 -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 +136 -88
- package/src/reorder-components.tsx +61 -0
- package/src/reorder.tsx +89 -307
- package/src/runtime.ts +43 -13
- package/src/spans-check.ts +12 -3
- 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 +694 -60
- package/src/wardic-config.tsx +68 -21
- package/src/wardic-context.ts +26 -0
- package/src/wardic-instance.ts +6 -4
- package/src/wardic.tsx +3 -0
- package/dist/browser/create-wardic.js +0 -36
- package/dist/browser/create-wardic.js.map +0 -1
- package/dist/browser/presence-hooks.js +0 -144
- package/dist/browser/presence-hooks.js.map +0 -1
- package/dist/server/create-wardic.js +0 -36
- package/dist/server/create-wardic.js.map +0 -1
- package/dist/server/presence-hooks.js +0 -144
- package/dist/server/presence-hooks.js.map +0 -1
- package/dist/solid/create-wardic.d.ts +0 -25
- package/dist/solid/create-wardic.d.ts.map +0 -1
- package/dist/solid/create-wardic.jsx +0 -34
- package/dist/solid/create-wardic.jsx.map +0 -1
- package/dist/solid/presence-hooks.d.ts +0 -53
- package/dist/solid/presence-hooks.d.ts.map +0 -1
- package/dist/solid/presence-hooks.jsx +0 -117
- package/dist/solid/presence-hooks.jsx.map +0 -1
- package/src/create-wardic.tsx +0 -46
- package/src/presence-hooks.tsx +0 -159
package/dist/solid/ward.jsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as InputSource from "@wardic/core/InputSource";
|
|
1
2
|
import * as Press from "@wardic/dom/unstable/Press";
|
|
2
3
|
import * as Report from "@wardic/dom/Report";
|
|
3
4
|
import * as Renderer from "@wardic/core/Renderer";
|
|
@@ -15,10 +16,11 @@ import * as Predicate from "effect/Predicate";
|
|
|
15
16
|
import * as UndefinedOr from "effect/UndefinedOr";
|
|
16
17
|
import * as Atom from "effect/reactivity/Atom";
|
|
17
18
|
import { isServer, useHead } from "@solidjs/web";
|
|
18
|
-
import { createEffect, createMemo, createSignal, createUniqueId, DEV, getOwner, isHydrating, onCleanup, runWithOwner, untrack, } from "solid-js";
|
|
19
|
+
import { createEffect, createMemo, createSignal, createUniqueId, DEV, getOwner, isHydrating, onCleanup, refresh, runWithOwner, untrack, } from "solid-js";
|
|
19
20
|
import { MOTION_PROPS_V2 } from "./motion-props.js";
|
|
20
21
|
import * as OwnerScope from "@wardic/dom/unstable/OwnerScope";
|
|
21
22
|
import * as GestureFeatures from "@wardic/dom/unstable/GestureFeatures";
|
|
23
|
+
import { misuse, report } from "./diagnostics.js";
|
|
22
24
|
import { inViewOptionsOf } from "./gesture-callbacks.js";
|
|
23
25
|
import * as Keys from "@wardic/dom/unstable/features/Keys";
|
|
24
26
|
import { createElementStyle } from "./element-style.js";
|
|
@@ -39,13 +41,20 @@ import { appearStyle, useWardicAppear, useWardicGate, useWardicValueReads, useWa
|
|
|
39
41
|
import * as Feature from "@wardic/dom/unstable/Feature";
|
|
40
42
|
import { CLIENT_ONLY, CLIENT_ONLY_DEFERRED, CLIENT_ONLY_SYNC, CLIENT_ONLY_SYNC_DEFERRED, firstCallOwnerHere, reactivityIn } from "./solid-reactivity.js";
|
|
41
43
|
import { useWardicConfig } from "./wardic-config.jsx";
|
|
42
|
-
import { configView } from "./config-view.js";
|
|
44
|
+
import { configView, fixedOver, fixMore } from "./config-view.js";
|
|
43
45
|
import { Lifecycle } from "./lifecycle.js";
|
|
44
46
|
import { neverLands, NO_EVENTS, serverWhen } from "./waiters.js";
|
|
45
47
|
import { usePresenceContext } from "./presence.jsx";
|
|
46
48
|
import { createVariantNode, useVariantContext, WardicVariantContext } from "./variant-node.js";
|
|
47
49
|
/** The entry a missing Feature's message tells the app to import it from: this binding's (#566). */
|
|
48
50
|
const ENTRY = "@wardic/solid";
|
|
51
|
+
/**
|
|
52
|
+
* Development's word on a missing Feature (#511), with how a Solid 2 app adds it: dom's default names
|
|
53
|
+
* `<LazyWardic>`, Solid 1's still, deleted from Solid 2 (probe: behaviour-runes, after the scopes round).
|
|
54
|
+
*/
|
|
55
|
+
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 })\`.`);
|
|
56
|
+
/** Development's word on a missing Feature, once a provider, as its coded diagnostic (solid-next). */
|
|
57
|
+
const warnMissing = (registry, feature, what) => registry.warnOnce(feature, missingMessage(feature, what), "WARDIC_FEATURE_MISSING");
|
|
49
58
|
/** Every key a ward reads, its callbacks among them. */
|
|
50
59
|
const WARD_KEYS = [
|
|
51
60
|
"initial",
|
|
@@ -109,7 +118,7 @@ export const WARD_VIEW = configView(WARD_KEYS, ["onUpdate", "dragConstraints", "
|
|
|
109
118
|
/** `config` read per key (#259), for a read outside a ward: a `wardic.<tag>`'s props at setup. Internal. */
|
|
110
119
|
export const wardConfigView = (config) => WARD_VIEW.of(config);
|
|
111
120
|
/** A config given whole as an accessor, which the Solid 2 binding no longer reads (#259). */
|
|
112
|
-
const WHOLE_ACCESSOR = "ward(config) takes its config as an object, read per key
|
|
121
|
+
const WHOLE_ACCESSOR = "ward(config) takes its config as an object, read per key: make a key reactive with an accessor " +
|
|
113
122
|
"(`ward({ animate: () => ({ x: x() }) })`), a getter, a store or a component's props, not the whole config " +
|
|
114
123
|
"(`ward(() => ({ … }))`).";
|
|
115
124
|
/**
|
|
@@ -198,7 +207,9 @@ const WARD_MEMBER_KEYS = {
|
|
|
198
207
|
return state.tapped;
|
|
199
208
|
},
|
|
200
209
|
},
|
|
210
|
+
// `next`, `each` and `when` can be given again: the hooks' own take their place ({@link shareMembers}).
|
|
201
211
|
next: {
|
|
212
|
+
configurable: true,
|
|
202
213
|
get() {
|
|
203
214
|
const state = stateOf(this);
|
|
204
215
|
if (Predicate.isNotUndefined(state.next))
|
|
@@ -210,6 +221,7 @@ const WARD_MEMBER_KEYS = {
|
|
|
210
221
|
},
|
|
211
222
|
},
|
|
212
223
|
each: {
|
|
224
|
+
configurable: true,
|
|
213
225
|
get() {
|
|
214
226
|
const state = stateOf(this);
|
|
215
227
|
if (Predicate.isNotUndefined(state.each))
|
|
@@ -221,6 +233,7 @@ const WARD_MEMBER_KEYS = {
|
|
|
221
233
|
},
|
|
222
234
|
},
|
|
223
235
|
when: {
|
|
236
|
+
configurable: true,
|
|
224
237
|
get() {
|
|
225
238
|
const state = stateOf(this);
|
|
226
239
|
if (Predicate.isNotUndefined(state.when))
|
|
@@ -232,8 +245,71 @@ const WARD_MEMBER_KEYS = {
|
|
|
232
245
|
},
|
|
233
246
|
},
|
|
234
247
|
};
|
|
235
|
-
/**
|
|
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
|
+
*/
|
|
236
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))
|
|
285
|
+
void refresh(target);
|
|
286
|
+
// The names it hands its followers come from its `animate` too: a leader a presence takes hands
|
|
287
|
+
// down the name it leaves by.
|
|
288
|
+
const handsDown = state.handsDown;
|
|
289
|
+
if (Predicate.isNotUndefined(handsDown))
|
|
290
|
+
void refresh(handsDown);
|
|
291
|
+
// And what a presence above it leaves it by: its `exit`, kept current by an effect that read it
|
|
292
|
+
// before more was fixed, and isn't told. A ward a presence of the hooks takes keeps its `exit` for
|
|
293
|
+
// that presence, so one above it runs none for it (HP30). Read here; the effect follows whatever it
|
|
294
|
+
// followed, and reads through what's fixed the next time it runs.
|
|
295
|
+
const exitNow = state.exitNow;
|
|
296
|
+
if (Predicate.isNotUndefined(exitNow))
|
|
297
|
+
state.exitConfig.current = untrack(exitNow);
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* More members for the prototype every client ward shares (probe: hooks-first): the hooks' own, a
|
|
301
|
+
* ward's reads and whether it's shown, given once as the hooks load. Each a getter over what the
|
|
302
|
+
* hooks keep of the ward ({@link hooksOf}), as the members here are over its state, so a ward
|
|
303
|
+
* carries nothing for them. One given a name that's here already takes its place.
|
|
304
|
+
*/
|
|
305
|
+
export const shareMembers = (keys) => {
|
|
306
|
+
Object.defineProperties(WARD_MEMBERS, keys);
|
|
307
|
+
};
|
|
308
|
+
/** A member every client ward shares, as it's read of `ward`: for one that takes its place for some wards ({@link shareMembers}). */
|
|
309
|
+
export const sharedMember = (name) => {
|
|
310
|
+
const descriptor = Object.getOwnPropertyDescriptor(WARD_MEMBERS, name);
|
|
311
|
+
return descriptor.get;
|
|
312
|
+
};
|
|
237
313
|
/** What a `wardic.*` component or a `<Reorder>` item adds to a ward. Internal. */
|
|
238
314
|
/**
|
|
239
315
|
* The config keys that want a gesture on Solid 2 (#525), as the ward's `wants*` read them: an element
|
|
@@ -300,25 +376,35 @@ const warnUnreadColors = (registry, features, values) => {
|
|
|
300
376
|
}, (unread) => {
|
|
301
377
|
if (Predicate.isUndefined(unread))
|
|
302
378
|
return;
|
|
303
|
-
registry
|
|
379
|
+
warnMissing(registry, "colors", `The colour \`${unread}\``);
|
|
304
380
|
}, CLIENT_ONLY);
|
|
305
381
|
};
|
|
306
382
|
/** Whether a config carries its variants (#398): it sets `variants` or `inherit`. */
|
|
307
383
|
const carriesVariants = (config) => Bool.or(Predicate.isNotUndefined(config.variants), Predicate.isNotUndefined(config.inherit));
|
|
384
|
+
/** 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). */
|
|
385
|
+
const carriesFor = (internal, config) => Bool.or(internal.carries === true, carriesVariants(config));
|
|
308
386
|
/** A child made with `{ parent }` naming a Listening ward (#398's Q10). */
|
|
309
387
|
const LISTENING_PARENT = "ward(config, { parent }): the parent given carries no variants (no `variants` or `inherit` in its ward({ … })): it only listens, " +
|
|
310
|
-
"and its element's props hold its variants, so a child can't join it by `{ parent }
|
|
388
|
+
"and its element's props hold its variants, so a child can't join it by `{ parent }`. Render the child inside that " +
|
|
311
389
|
"ward's element, where it joins through the tree, or put the variants in the parent's ward({ … }).";
|
|
390
|
+
/** The **Layout group** a ward made here with `internal` is in: its maker's choice, else the one around it. */
|
|
391
|
+
const groupOf = (internal) => {
|
|
392
|
+
const chosen = internal.layoutGroup;
|
|
393
|
+
if (Predicate.isNotUndefined(chosen))
|
|
394
|
+
return chosen.id;
|
|
395
|
+
return useLayoutGroupId();
|
|
396
|
+
};
|
|
312
397
|
/**
|
|
313
398
|
* The **Layout group** a ward's `layoutId` goes in (#432): the one it's made in, as its presence and
|
|
314
|
-
* variant parent are; a driving ward's is its given ward's, where that was made,
|
|
315
|
-
* own props set the `layoutId` (#398), which is then the element's.
|
|
399
|
+
* variant parent are, or its maker's choice; a driving ward's is its given ward's, where that was made,
|
|
400
|
+
* unless the element's own props set the `layoutId` (#398), which is then the element's.
|
|
316
401
|
*/
|
|
317
|
-
const layoutGroupFor = (share,
|
|
402
|
+
const layoutGroupFor = (share, internal) => {
|
|
318
403
|
if (Predicate.isUndefined(share))
|
|
319
|
-
return
|
|
404
|
+
return groupOf(internal);
|
|
405
|
+
const fixed = internal.fixed;
|
|
320
406
|
if (Bool.and(Predicate.isNotUndefined(fixed), Predicate.hasProperty(fixed, "layoutId")))
|
|
321
|
-
return
|
|
407
|
+
return groupOf(internal);
|
|
322
408
|
return share.layoutGroup;
|
|
323
409
|
};
|
|
324
410
|
/**
|
|
@@ -336,7 +422,7 @@ const variantParentOf = (internal) => {
|
|
|
336
422
|
const parent = shareOf(internal.parent);
|
|
337
423
|
if (Predicate.isNotUndefined(parent)) {
|
|
338
424
|
if (Bool.not(parent.carries))
|
|
339
|
-
throw
|
|
425
|
+
throw misuse("WARDIC_PARENT_WITHOUT_VARIANTS", LISTENING_PARENT);
|
|
340
426
|
return parent.provided;
|
|
341
427
|
}
|
|
342
428
|
return useVariantContext();
|
|
@@ -372,6 +458,13 @@ const controlsOf = (given, animate) => {
|
|
|
372
458
|
});
|
|
373
459
|
return { controls, view, change, set: (made) => setChange(() => made) };
|
|
374
460
|
};
|
|
461
|
+
/** A ward's config settings: its own over its nearest `WardicConfig`'s, where it has any (`wardicConfig`), else that config's. */
|
|
462
|
+
const configOf = (internal) => {
|
|
463
|
+
const own = internal.wardicConfig;
|
|
464
|
+
if (Predicate.isNotUndefined(own))
|
|
465
|
+
return own;
|
|
466
|
+
return useWardicConfig();
|
|
467
|
+
};
|
|
375
468
|
/**
|
|
376
469
|
* `view` with its **Config transition** as its own when it gives none (#434, Motion's
|
|
377
470
|
* `{ ...config, ...props }`), read per read as its keys are; `view` itself with no `WardicConfig` above.
|
|
@@ -429,12 +522,22 @@ const LOADING_NAMES = [];
|
|
|
429
522
|
* `animate` names the ward's own variants when it has `variants` (what it can name), and is a target
|
|
430
523
|
* of values otherwise: setup reads it only to tell which.
|
|
431
524
|
*/
|
|
525
|
+
/**
|
|
526
|
+
* `config` a **Variant child** by its own word, where its internals say so (probe: hooks-first, the
|
|
527
|
+
* gap grill's Q26): core's `variantChild` set on the copy its variant decisions read. As it is for
|
|
528
|
+
* every other ward, a component's among them.
|
|
529
|
+
*/
|
|
530
|
+
const variantChildBy = (internal, config) => {
|
|
531
|
+
if (internal.variantChild !== true)
|
|
532
|
+
return config;
|
|
533
|
+
return { ...config, variantChild: true };
|
|
534
|
+
};
|
|
432
535
|
export const configAtSetup = (setup) => {
|
|
433
536
|
if (setup.pending.length === 0)
|
|
434
537
|
return setup.config;
|
|
435
538
|
const fixed = Arr.findFirst(setup.pending, (key) => Bool.not(LOADS_AS_IT_GOES.has(key)));
|
|
436
539
|
if (Option.isSome(fixed))
|
|
437
|
-
throw
|
|
540
|
+
throw misuse("WARDIC_KEY_LOADING_AT_SETUP", loadingAtSetup(fixed.value));
|
|
438
541
|
const config = setup.config;
|
|
439
542
|
if (Bool.and(Arr.contains(setup.pending, "animate"), Predicate.isNotUndefined(config.variants)))
|
|
440
543
|
return { ...config, animate: LOADING_NAMES };
|
|
@@ -457,7 +560,7 @@ const layoutArrivedIn = (arrive, services) => {
|
|
|
457
560
|
};
|
|
458
561
|
export function wardWith(config, internal) {
|
|
459
562
|
if (Predicate.isFunction(config))
|
|
460
|
-
throw
|
|
563
|
+
throw misuse("WARDIC_CONFIG_AS_ACCESSOR", WHOLE_ACCESSOR);
|
|
461
564
|
const runtime = useWardicRuntime();
|
|
462
565
|
// Its Features (#511, ADR-0067), a Complete element's every one: what they register, a server
|
|
463
566
|
// render's elements read too (the `colors` Feature's spaces).
|
|
@@ -471,11 +574,14 @@ export function wardWith(config, internal) {
|
|
|
471
574
|
const layoutProjection = Keys.projectionIn(untrack(features.services));
|
|
472
575
|
// The provider's, once any section has built it: what its values register with.
|
|
473
576
|
const builtProjection = useBuiltProjection();
|
|
474
|
-
|
|
577
|
+
// Its config's settings: its own over its nearest WardicConfig's, where a hook ward gives any
|
|
578
|
+
// (probe: behaviour-runes), else that config's.
|
|
579
|
+
const wardicConfig = configOf(internal);
|
|
580
|
+
const reducedMotion = useWardicReducedMotion(wardicConfig);
|
|
475
581
|
// Whether its animations are skipped (#468): its nearest WardicConfig's, read as each starts.
|
|
476
|
-
const skipAnimations = useWardicSkipAnimations();
|
|
582
|
+
const skipAnimations = useWardicSkipAnimations(wardicConfig);
|
|
477
583
|
// Where its drag's and pan's points are (#443): its nearest WardicConfig's, read as each starts.
|
|
478
|
-
const pagePoint = WardicConfigValue.transformPagePointOf(
|
|
584
|
+
const pagePoint = WardicConfigValue.transformPagePointOf(wardicConfig);
|
|
479
585
|
const positionalKeys = useWardicPositionalKeys();
|
|
480
586
|
const defaultTransition = useWardicDefaultTransition();
|
|
481
587
|
// How a value is read in the Environment's own terms (#672).
|
|
@@ -492,7 +598,8 @@ export function wardWith(config, internal) {
|
|
|
492
598
|
// Its config, read per key where it's read (#259): a change re-runs only what reads the key. With
|
|
493
599
|
// Animation controls for its `animate` (#433), read once, each change they make is its entry.
|
|
494
600
|
// Under a `WardicConfig`, its Config transition is its own when it gives none (#434).
|
|
495
|
-
const
|
|
601
|
+
const written = WARD_VIEW.of(config, internal.fixed);
|
|
602
|
+
const asGiven = configuredView(written, wardicConfig);
|
|
496
603
|
// The config at setup, a plain copy read untracked: what setup reads, the keys read once among it.
|
|
497
604
|
// A key still loading (#257 item 1) is left out of it: one the ward reads as it goes holds its
|
|
498
605
|
// region until it lands; one setup fixes is an error, naming it. Its `animate` there tells
|
|
@@ -502,7 +609,7 @@ export function wardWith(config, internal) {
|
|
|
502
609
|
const view = UndefinedOr.match(controls, { onUndefined: () => asGiven, onDefined: (c) => c.view });
|
|
503
610
|
const cfg = () => view;
|
|
504
611
|
const setup = UndefinedOr.match(controls, { onUndefined: () => givenSetup, onDefined: () => WARD_VIEW.setupOf(view) });
|
|
505
|
-
const initialConfig = UndefinedOr.match(controls, { onUndefined: () => configAtSetup(setup), onDefined: () => AnimationControls.controlledConfigOf(configAtSetup(setup), undefined) });
|
|
612
|
+
const initialConfig = variantChildBy(internal, UndefinedOr.match(controls, { onUndefined: () => configAtSetup(setup), onDefined: () => AnimationControls.controlledConfigOf(configAtSetup(setup), undefined) }));
|
|
506
613
|
// Its Animation controls' change (#433), read with the Override stack: none without them.
|
|
507
614
|
const ownChange = UndefinedOr.match(controls, { onUndefined: () => NO_CHANGE, onDefined: (c) => c.change });
|
|
508
615
|
// A ward a component was given (#349), whose element this one drives: its variant node and its
|
|
@@ -518,13 +625,15 @@ export function wardWith(config, internal) {
|
|
|
518
625
|
// The nearest <AnimatePresence> (ADR-0007), or none.
|
|
519
626
|
const presence = usePresenceContext();
|
|
520
627
|
// The Layout group its `layoutId` goes in (#432): where it's made, or a given ward's.
|
|
521
|
-
const layoutGroup = layoutGroupFor(share, internal
|
|
628
|
+
const layoutGroup = layoutGroupFor(share, internal);
|
|
522
629
|
// The values it starts from, read once (ADR-0003): its `initial`, or the one it inherits, or its
|
|
523
630
|
// `animate` with `initial={false}` (its own, inherited, or its presence's first render, #134).
|
|
524
631
|
const presenceBlocks = PresenceRecord.presenceBlocksInitial(presence);
|
|
525
632
|
if (Bool.and(Arr.contains(setup.pending, "animate"), VariantTree.startsAtAnimate(initialConfig, node.inherited, presenceBlocks)))
|
|
526
|
-
throw
|
|
527
|
-
|
|
633
|
+
throw misuse("WARDIC_KEY_LOADING_AT_SETUP", STARTS_AT_PENDING);
|
|
634
|
+
// Untracked as a whole: a target that's a store's (a store given as a hook's rune) is read here,
|
|
635
|
+
// in the component's body, for its values now.
|
|
636
|
+
const start = untrack(() => Spine.startOf(initialConfig, node.inherited, presenceBlocks, untrack));
|
|
528
637
|
// A variant whose resolver throws is this element's alone: reported once until it resolves, the element
|
|
529
638
|
// keeping its last target (#979; ADR-0074).
|
|
530
639
|
Spine.reportStart(variantFailures, start);
|
|
@@ -576,25 +685,40 @@ export function wardWith(config, internal) {
|
|
|
576
685
|
// last one left the page, as a mount after the first render's (no presence holds its `initial`
|
|
577
686
|
// back). Its Snapshot goes back to it, and its Starting style comes back on until its first commit.
|
|
578
687
|
let begun = start;
|
|
579
|
-
|
|
580
|
-
|
|
688
|
+
// A fresh start and the Starting style it draws, from the config now: a plain copy read untracked,
|
|
689
|
+
// as setup reads it. Read in the mount effect, and by an element's first read of its style.
|
|
690
|
+
const freshStart = () => {
|
|
581
691
|
const now = WARD_VIEW.setupOf(view).config;
|
|
582
|
-
|
|
692
|
+
const from = Spine.startOf(now, node.inherited, false, untrack);
|
|
693
|
+
return { from, starting: Svg.splitPatchForTag(internal.tag, project(ElementSetup.drawnAtRest(from.initialValues, layoutNode, now.transformTemplate))).style };
|
|
694
|
+
};
|
|
695
|
+
const freshStarting = () => freshStart().starting;
|
|
696
|
+
const beginFresh = () => {
|
|
697
|
+
const fresh = freshStart();
|
|
698
|
+
begun = fresh.from;
|
|
699
|
+
// As the first start (#979): its variant's resolver that throws is reported, here where it begins.
|
|
583
700
|
Spine.reportStart(variantFailures, begun);
|
|
584
701
|
snapshot.values = { ...begun.initialValues };
|
|
585
702
|
snapshot.velocities = {};
|
|
586
703
|
snapshot.drawnAt = {};
|
|
587
|
-
|
|
704
|
+
// Its element read this Starting style as it was made, where it was seen coming, so that read
|
|
705
|
+
// isn't run again: any other read of its style is.
|
|
706
|
+
elementStyle.restart(fresh.starting);
|
|
588
707
|
};
|
|
589
708
|
const configNow = () => view;
|
|
590
709
|
const styleNow = () => untrack(userStyle);
|
|
591
710
|
// What its exit resolves from under an <AnimatePresence> (#277: its `exit`, `variants`, `custom` and
|
|
592
711
|
// transition), kept current while it's alive: the presence resolves it as the ward leaves (ADR-0007).
|
|
593
712
|
const exitConfig = { current: Spine.NO_EXIT_CONFIG };
|
|
713
|
+
// How it's read of its config, under a presence: none with no presence above it, and nothing
|
|
714
|
+
// made for it then. Mapped from the presence, a function was made for every ward to make it by.
|
|
715
|
+
let exitNow;
|
|
594
716
|
if (Predicate.isNotUndefined(presence)) {
|
|
717
|
+
const now = () => Spine.exitConfigOf(cfg(), node.inherited);
|
|
718
|
+
exitNow = now;
|
|
595
719
|
// Its inherited transition is read untracked here: the effect keeps it current.
|
|
596
720
|
exitConfig.current = untrack(() => Spine.exitConfigOf(initialConfig, node.inherited));
|
|
597
|
-
createEffect(
|
|
721
|
+
createEffect(now, (config) => {
|
|
598
722
|
exitConfig.current = config;
|
|
599
723
|
}, CLIENT_ONLY_DEFERRED);
|
|
600
724
|
}
|
|
@@ -603,8 +727,20 @@ export function wardWith(config, internal) {
|
|
|
603
727
|
// (#140)*). Its section's `layout` makes its node (#511): without it, its layout props do nothing,
|
|
604
728
|
// and development says so once, unless `layout` is on its way.
|
|
605
729
|
const wantsNode = Feature.wantsLayoutNode(initialConfig);
|
|
730
|
+
/**
|
|
731
|
+
* Whether its drag waits for its layout node (probe: behaviour-runes): it wants one, has none yet, and a
|
|
732
|
+
* Feature is still on its way (`pending`, read now where not given). A hook row's lazy `layout` that came
|
|
733
|
+
* after `drag` was left out of the track (#582), so a behaviour's `measured()` never saw the drag.
|
|
734
|
+
*/
|
|
735
|
+
const holdsForNode = (wants, node, pending) => {
|
|
736
|
+
if (Bool.not(wants))
|
|
737
|
+
return false;
|
|
738
|
+
if (Predicate.isNotUndefined(node))
|
|
739
|
+
return false;
|
|
740
|
+
return UndefinedOr.match(pending, { onUndefined: () => untrack(features.pending), onDefined: identity });
|
|
741
|
+
};
|
|
606
742
|
if (DEV && wantsNode && Predicate.isUndefined(layoutProjection) && Bool.not(untrack(features.pending))) {
|
|
607
|
-
useFeatureRegistry()
|
|
743
|
+
warnMissing(useFeatureRegistry(), "layout", Feature.LAYOUT_PROPS);
|
|
608
744
|
}
|
|
609
745
|
const layoutNodes = Bool.match(wantsNode, { onTrue: () => layoutProjection, onFalse: constUndefined });
|
|
610
746
|
const dragTransition = DragTransition.dragTransitionOf(initialConfig.dragElastic, initialConfig.dragTransition);
|
|
@@ -666,9 +802,12 @@ export function wardWith(config, internal) {
|
|
|
666
802
|
}, snapshot, ownChange()));
|
|
667
803
|
}, { equals: sameTarget, transparent: true });
|
|
668
804
|
// A colour only the `colors` Feature reads, on a Slim element without it (#511, decision 7): said
|
|
669
|
-
// once per provider, in development only, and not while a lazy load is on its way.
|
|
805
|
+
// once per provider, in development only, and not while a lazy load is on its way. Not of a ward that
|
|
806
|
+
// asks for its Features as it uses them (`targeted`, the hooks'): it asks for `colors` a microtask after
|
|
807
|
+
// a colour shows, when this had already found none on its way, and said so wrongly (AS2, CL1; seen once
|
|
808
|
+
// it was coded, where it had gone to Effect's log unread).
|
|
670
809
|
// eslint-disable-next-line solid/reactivity -- read inside the warning's effect, where it tracks
|
|
671
|
-
if (DEV && internal.complete !== true)
|
|
810
|
+
if (DEV && Bool.and(internal.complete !== true, Predicate.isUndefined(internal.targeted)))
|
|
672
811
|
warnUnreadColors(useFeatureRegistry(), features, () => target().resolved);
|
|
673
812
|
// Its gesture states, for what its variant node hands down (#291): bound at setup, before its
|
|
674
813
|
// children read them. Read from the gestures themselves, not the target: a gesture whose layer
|
|
@@ -726,7 +865,7 @@ export function wardWith(config, internal) {
|
|
|
726
865
|
return undefined;
|
|
727
866
|
const service = GestureFeatures.serviceIn(services, key);
|
|
728
867
|
if (DEV && Predicate.isUndefined(service) && Bool.not(untrack(features.pending))) {
|
|
729
|
-
featureRegistry
|
|
868
|
+
warnMissing(featureRegistry, name, GestureFeatures.GESTURE_WORDS[name]);
|
|
730
869
|
}
|
|
731
870
|
return service;
|
|
732
871
|
};
|
|
@@ -787,6 +926,14 @@ export function wardWith(config, internal) {
|
|
|
787
926
|
m.focus = true;
|
|
788
927
|
m.watch(focus.watch(m.element, { visible: true }, { on: (focused) => setGesture(m.element, "focused", focused), onDefect }));
|
|
789
928
|
}
|
|
929
|
+
// A behaviour's input (probe: behaviour-runes): told once a mount, once its gestures' input is there.
|
|
930
|
+
const onInput = internal.onInput;
|
|
931
|
+
if (Predicate.isNotUndefined(onInput) && Bool.not(m.input)) {
|
|
932
|
+
UndefinedOr.map(GestureFeatures.serviceIn(services, InputSource.InputSource), (input) => {
|
|
933
|
+
m.input = true;
|
|
934
|
+
onInput(m.element, input, (make) => m.watch(make(onDefect)), (effect) => void runtime.runFork(effect), runtime);
|
|
935
|
+
});
|
|
936
|
+
}
|
|
790
937
|
};
|
|
791
938
|
let mounted;
|
|
792
939
|
// The last two elements given to its ref, for a second one still on the page as it mounts (#349's Q5).
|
|
@@ -820,29 +967,36 @@ export function wardWith(config, internal) {
|
|
|
820
967
|
held = PresenceRecord.presenceHold(presence, el, shown);
|
|
821
968
|
return Predicate.isNotUndefined(held);
|
|
822
969
|
};
|
|
970
|
+
/**
|
|
971
|
+
* Its element's mount ended, and what `afterMount` gave it handed back to be called once the caller's
|
|
972
|
+
* own work is done (probe: behaviour-runes): a rune's undoing that throws ends nothing of the binding's.
|
|
973
|
+
*/
|
|
823
974
|
const unmount = () => {
|
|
824
975
|
unhold();
|
|
825
976
|
if (Predicate.isUndefined(mounted))
|
|
826
|
-
return;
|
|
977
|
+
return constVoid;
|
|
827
978
|
const left = mounted.element;
|
|
979
|
+
const afterUnmount = mounted.afterUnmount;
|
|
828
980
|
mounted.dispose();
|
|
829
981
|
mounted = undefined;
|
|
830
982
|
if (justLeft.size === 0)
|
|
831
983
|
queueMicrotask(forgetJustLeft);
|
|
832
984
|
justLeft.add(left);
|
|
985
|
+
return afterUnmount;
|
|
833
986
|
};
|
|
834
987
|
// Its element's mount goes, and its lifecycle's waits are rejected (#257): one cleanup, which ends
|
|
835
988
|
// what its accessors mounted at their first calls too (#566).
|
|
836
989
|
// A driving ward's lifecycle is its given ward's, which outlives the element (#349).
|
|
837
990
|
onCleanup(() => {
|
|
838
|
-
unmount();
|
|
991
|
+
const afterUnmount = unmount();
|
|
839
992
|
if (Predicate.isUndefined(share))
|
|
840
993
|
lifecycle.dispose();
|
|
841
994
|
UndefinedOr.map(cleanups, (all) => Arr.forEach(all, runCleanup));
|
|
995
|
+
afterUnmount();
|
|
842
996
|
});
|
|
843
997
|
const mount = (el) => {
|
|
844
998
|
if (justLeft.has(el))
|
|
845
|
-
throw
|
|
999
|
+
throw misuse("WARDIC_WARD_MADE_IN_SPREAD", REMADE);
|
|
846
1000
|
// The ward a component was given follows this element while it's mounted (#349): one at a time.
|
|
847
1001
|
let undrive;
|
|
848
1002
|
if (Predicate.isNotUndefined(share)) {
|
|
@@ -996,7 +1150,7 @@ export function wardWith(config, internal) {
|
|
|
996
1150
|
propagation: initialConfig.dragPropagation,
|
|
997
1151
|
directionLock: initialConfig.dragDirectionLock,
|
|
998
1152
|
transition: dragTransition,
|
|
999
|
-
listen: initialConfig.dragListener,
|
|
1153
|
+
listen: UndefinedOr.match(internal.dragListen, { onUndefined: () => initialConfig.dragListener, onDefined: identity }),
|
|
1000
1154
|
},
|
|
1001
1155
|
container: constraints.container,
|
|
1002
1156
|
controls: initialConfig.dragControls,
|
|
@@ -1015,7 +1169,11 @@ export function wardWith(config, internal) {
|
|
|
1015
1169
|
onReleaseEnd: () => lifecycle.released(),
|
|
1016
1170
|
});
|
|
1017
1171
|
};
|
|
1018
|
-
|
|
1172
|
+
// One that wants a layout node whose `layout` is still on its way holds its drag back until the node
|
|
1173
|
+
// is made, so its track drives the node (probe: behaviour-runes): a hook row's Features come as its
|
|
1174
|
+
// config asks, `drag` before `layout` as often as not, and a node made after the track was left out
|
|
1175
|
+
// of it (#582), so a behaviour's `measured()` never saw the drag.
|
|
1176
|
+
let dragTrack = Bool.match(holdsForNode(wantsNode, layout), { onTrue: constUndefined, onFalse: () => UndefinedOr.map(dragGesture, driveDrag) });
|
|
1019
1177
|
const spineOptions = {
|
|
1020
1178
|
runtime,
|
|
1021
1179
|
gate,
|
|
@@ -1090,6 +1248,8 @@ export function wardWith(config, internal) {
|
|
|
1090
1248
|
pan: false,
|
|
1091
1249
|
inView: false,
|
|
1092
1250
|
focus: false,
|
|
1251
|
+
input: false,
|
|
1252
|
+
afterUnmount: constVoid,
|
|
1093
1253
|
dispose: () => {
|
|
1094
1254
|
if (Predicate.isNotUndefined(undrive))
|
|
1095
1255
|
undrive();
|
|
@@ -1134,9 +1294,10 @@ export function wardWith(config, internal) {
|
|
|
1134
1294
|
createEffect(() => ({ services: features.services(), pending: features.pending() }),
|
|
1135
1295
|
// Its apply returns nothing: a function returned there would be its cleanup.
|
|
1136
1296
|
({ services, pending }) => {
|
|
1137
|
-
|
|
1297
|
+
// Its node reads its config's options (its `layoutId`, an accessor's): untracked, as at its mount, so said.
|
|
1298
|
+
UndefinedOr.map(mounted, (m) => untrack(() => layoutArrivedIn(m.arriveLayout, services)));
|
|
1138
1299
|
if (DEV && Predicate.isUndefined(Keys.projectionIn(services)) && Bool.not(pending)) {
|
|
1139
|
-
featureRegistry
|
|
1300
|
+
warnMissing(featureRegistry, "layout", Feature.LAYOUT_PROPS);
|
|
1140
1301
|
}
|
|
1141
1302
|
}, CLIENT_ONLY_DEFERRED);
|
|
1142
1303
|
}
|
|
@@ -1150,12 +1311,16 @@ export function wardWith(config, internal) {
|
|
|
1150
1311
|
UndefinedOr.match(GestureFeatures.serviceIn(services, Keys.DragGesture), {
|
|
1151
1312
|
// A `layout` from the same load makes its node first, so the track drives it (#582).
|
|
1152
1313
|
onDefined: (gesture) => UndefinedOr.map(mounted, (m) => {
|
|
1153
|
-
layoutArrivedIn(m.arriveLayout, services);
|
|
1154
|
-
|
|
1314
|
+
untrack(() => layoutArrivedIn(m.arriveLayout, services));
|
|
1315
|
+
// One that wants a node starts its drag once it has one, or once nothing more is coming.
|
|
1316
|
+
if (Bool.not(holdsForNode(wantsNode, m.layout, pending)))
|
|
1317
|
+
UndefinedOr.map(m.startDrag, (start) => start(gesture));
|
|
1318
|
+
// Its input with it, for a behaviour's keys (probe: behaviour-runes).
|
|
1319
|
+
startRecognizers(m);
|
|
1155
1320
|
}),
|
|
1156
1321
|
onUndefined: () => {
|
|
1157
1322
|
if (DEV && Bool.not(pending))
|
|
1158
|
-
featureRegistry
|
|
1323
|
+
warnMissing(featureRegistry, "drag", GestureFeatures.GESTURE_WORDS.drag);
|
|
1159
1324
|
},
|
|
1160
1325
|
});
|
|
1161
1326
|
}, CLIENT_ONLY_DEFERRED);
|
|
@@ -1186,29 +1351,44 @@ export function wardWith(config, internal) {
|
|
|
1186
1351
|
if (Predicate.isUndefined(mounting))
|
|
1187
1352
|
return;
|
|
1188
1353
|
const { el, resolution } = mounting;
|
|
1354
|
+
let mountedNow = false;
|
|
1355
|
+
// What the last element's `afterMount` gave, called once this one is mounted and aimed.
|
|
1356
|
+
let afterLast = constVoid;
|
|
1189
1357
|
if (Predicate.isUndefined(mounted) || mounted.element !== el) {
|
|
1190
1358
|
// Another element it was spread on, or the one it's on, still on the page: a ward drives one
|
|
1191
1359
|
// element at a time (#349's Q5). One the page has let go of is left behind.
|
|
1192
1360
|
if (Bool.or(stillOn(refdBefore, el), stillOn(UndefinedOr.map(mounted, elementOfMount), el)))
|
|
1193
|
-
throw
|
|
1361
|
+
throw misuse("WARDIC_WARD_ON_TWO_SUBJECTS", secondElement("ward(config)"));
|
|
1194
1362
|
refdBefore = undefined;
|
|
1195
1363
|
// Held off the page: nothing starts until it's on it.
|
|
1196
1364
|
if (heldBack(el))
|
|
1197
1365
|
return;
|
|
1198
1366
|
// A new element starts with no gesture on, read from its gesture state (#257's audit).
|
|
1199
|
-
unmount();
|
|
1200
|
-
// One that came after the last left the page enters fresh (#414).
|
|
1201
|
-
|
|
1202
|
-
|
|
1367
|
+
afterLast = unmount();
|
|
1368
|
+
// One that came after the last left the page enters fresh (#414). One that doesn't, read as
|
|
1369
|
+
// one that would, reads its style again.
|
|
1370
|
+
Bool.match(el === fresh, { onTrue: beginFresh, onFalse: elementStyle.notFresh });
|
|
1203
1371
|
// Its config is read at mount (its layout node's options, its `onUpdate`, its spine's) through
|
|
1204
1372
|
// the per-key view (#259): untracked, so said, as the Retarget below.
|
|
1205
1373
|
mounted = untrack(() => mount(el));
|
|
1374
|
+
mountedNow = true;
|
|
1206
1375
|
}
|
|
1207
1376
|
// The spine reads the variant context (its gates, its stagger, what it inherits) at the
|
|
1208
1377
|
// Retarget, once: untracked, so said (Solid 2's dev build warns of a reactive read in an
|
|
1209
1378
|
// effect's apply, STRICT_READ_UNTRACKED). The effect's compute is what re-runs it.
|
|
1210
|
-
const
|
|
1379
|
+
const m = mounted;
|
|
1380
|
+
const spine = m.spine;
|
|
1381
|
+
// What it resolved to, told to a ward that asks for its Features as it uses them (`targeted`).
|
|
1382
|
+
const targeted = internal.targeted;
|
|
1383
|
+
if (Predicate.isNotUndefined(targeted))
|
|
1384
|
+
targeted(resolution.resolved);
|
|
1211
1385
|
untrack(() => spine.retarget(resolution));
|
|
1386
|
+
// A hooks ward's runes' `ref`s, once it's mounted and aimed (probe: behaviour-runes): the last
|
|
1387
|
+
// element's undone, then this one's run. Not untracked, which is the `ref`'s author's to say.
|
|
1388
|
+
afterLast();
|
|
1389
|
+
const afterMount = internal.afterMount;
|
|
1390
|
+
if (mountedNow && Predicate.isNotUndefined(afterMount))
|
|
1391
|
+
m.afterUnmount = afterMount(el);
|
|
1212
1392
|
}, CLIENT_ONLY_SYNC);
|
|
1213
1393
|
// `<card.Provider>` hands down what this element hands its children (#50).
|
|
1214
1394
|
const Provider = (props) => (<WardicVariantContext value={contextOf(node.provided)}>{props.children}</WardicVariantContext>);
|
|
@@ -1270,9 +1450,51 @@ export function wardWith(config, internal) {
|
|
|
1270
1450
|
};
|
|
1271
1451
|
},
|
|
1272
1452
|
});
|
|
1453
|
+
// Whether its presence says the next element it's given enters afresh (probe: hooks-first).
|
|
1454
|
+
const presenceSaysFresh = () => {
|
|
1455
|
+
const enters = internal.entersFresh;
|
|
1456
|
+
if (Predicate.isUndefined(enters))
|
|
1457
|
+
return false;
|
|
1458
|
+
return enters(self);
|
|
1459
|
+
};
|
|
1460
|
+
// Whether the element a first read of its style is for enters fresh (#414), told before its mount
|
|
1461
|
+
// begins it: its ref has decided it for one given and not yet mounted, and will say this of the next.
|
|
1462
|
+
const comesFresh = () => {
|
|
1463
|
+
const last = refdLast;
|
|
1464
|
+
if (Predicate.isUndefined(last))
|
|
1465
|
+
return presenceSaysFresh();
|
|
1466
|
+
if (UndefinedOr.map(mounted, elementOfMount) !== last)
|
|
1467
|
+
return fresh === last;
|
|
1468
|
+
return Bool.or(Bool.not(last.isConnected), presenceSaysFresh());
|
|
1469
|
+
};
|
|
1470
|
+
// Each computation that has read its style: one for each element it's on, the same at every run of
|
|
1471
|
+
// that element's props. So a first read is an element's being made.
|
|
1472
|
+
const styleReaders = new WeakSet();
|
|
1273
1473
|
const renderedStyle = () => {
|
|
1274
1474
|
holdWhileLoading();
|
|
1275
|
-
|
|
1475
|
+
const user = userStyle();
|
|
1476
|
+
const reader = getOwner();
|
|
1477
|
+
// Read outside a computation, or by one that has read it before: as the gate has it.
|
|
1478
|
+
if (Predicate.isNull(reader))
|
|
1479
|
+
return elementStyle.style(user);
|
|
1480
|
+
if (styleReaders.has(reader))
|
|
1481
|
+
return elementStyle.style(user);
|
|
1482
|
+
// An element that enters fresh reads its Starting style here, derived from what its ref goes by.
|
|
1483
|
+
// Its mount begins the entry once the ref has given it, and doesn't run this read again: told
|
|
1484
|
+
// of the restart afterwards, a spread re-ran on a write its own effect had led to, through the
|
|
1485
|
+
// ref it calls (EFFECT_WRITES_OWN_SOURCE).
|
|
1486
|
+
const style = Bool.match(comesFresh(), {
|
|
1487
|
+
onTrue: () => elementStyle.entering(user, untrack(freshStarting)),
|
|
1488
|
+
onFalse: () => elementStyle.style(user),
|
|
1489
|
+
});
|
|
1490
|
+
styleReaders.add(reader);
|
|
1491
|
+
// Told to the hooks, where they made it, in development alone (probe: hooks-first, Q29).
|
|
1492
|
+
if (DEV) {
|
|
1493
|
+
const styled = internal.styled;
|
|
1494
|
+
if (Predicate.isNotUndefined(styled))
|
|
1495
|
+
styled(self);
|
|
1496
|
+
}
|
|
1497
|
+
return style;
|
|
1276
1498
|
};
|
|
1277
1499
|
// The ward: a ref, and its own props. Under a presence, its element is told to it as it's made
|
|
1278
1500
|
// (#286): its `key`, and whether it's a twin.
|
|
@@ -1288,7 +1510,7 @@ export function wardWith(config, internal) {
|
|
|
1288
1510
|
*/
|
|
1289
1511
|
const drive = (next, name) => {
|
|
1290
1512
|
if (Bool.or(Predicate.isNotUndefined(driver), stillOn(UndefinedOr.map(mounted, elementOfMount), undefined)))
|
|
1291
|
-
throw
|
|
1513
|
+
throw misuse("WARDIC_WARD_ON_TWO_SUBJECTS", secondElement(name));
|
|
1292
1514
|
driver = next;
|
|
1293
1515
|
UndefinedOr.map(driven, (atom) => registry().set(atom, next));
|
|
1294
1516
|
return () => {
|
|
@@ -1302,9 +1524,10 @@ export function wardWith(config, internal) {
|
|
|
1302
1524
|
config,
|
|
1303
1525
|
setup: initialConfig,
|
|
1304
1526
|
internal,
|
|
1527
|
+
fixed: () => fixedOver(written),
|
|
1305
1528
|
parent,
|
|
1306
1529
|
chosen: Predicate.isNotUndefined(internal.parent),
|
|
1307
|
-
carries:
|
|
1530
|
+
carries: carriesFor(internal, initialConfig),
|
|
1308
1531
|
provided: node.provided,
|
|
1309
1532
|
layoutGroup,
|
|
1310
1533
|
node,
|
|
@@ -1316,6 +1539,11 @@ export function wardWith(config, internal) {
|
|
|
1316
1539
|
const setMade = Spine.madeWith(presence, setElement, initialConfig);
|
|
1317
1540
|
const self = ((value) => {
|
|
1318
1541
|
if (isElement(value)) {
|
|
1542
|
+
// Told to the hooks, where they made it (probe: hooks-first): what a leaving row finds inside it.
|
|
1543
|
+
// No callback made for it: this runs for every element of every ward.
|
|
1544
|
+
const handed = internal.handed;
|
|
1545
|
+
if (Predicate.isNotUndefined(handed))
|
|
1546
|
+
handed(value, self);
|
|
1319
1547
|
const last = refdLast;
|
|
1320
1548
|
if (Predicate.isNotUndefined(last)) {
|
|
1321
1549
|
if (last !== value) {
|
|
@@ -1324,12 +1552,23 @@ export function wardWith(config, internal) {
|
|
|
1324
1552
|
fresh = value;
|
|
1325
1553
|
}
|
|
1326
1554
|
}
|
|
1555
|
+
// A presence's next value (probe: hooks-first): its element enters afresh though the last may
|
|
1556
|
+
// still be on the page, and so does the first one of a value that came after the page opened.
|
|
1557
|
+
if (Bool.and(last !== value, presenceSaysFresh()))
|
|
1558
|
+
fresh = value;
|
|
1327
1559
|
refdLast = value;
|
|
1328
1560
|
setMade(value);
|
|
1329
1561
|
return undefined;
|
|
1330
1562
|
}
|
|
1331
1563
|
return spreadNow();
|
|
1332
1564
|
});
|
|
1565
|
+
// The presence it's made under, for a hook ward to watch its child's leave by (probe: hooks-first).
|
|
1566
|
+
// No callback made for it: this runs for every ward under a presence, each row of a list.
|
|
1567
|
+
if (Predicate.isNotUndefined(presence)) {
|
|
1568
|
+
const madeUnder = internal.madeUnder;
|
|
1569
|
+
if (Predicate.isNotUndefined(madeUnder))
|
|
1570
|
+
madeUnder(self, presence);
|
|
1571
|
+
}
|
|
1333
1572
|
// What a spread of the ward reads (#495): its spread's props alone, made at its first spread, so a
|
|
1334
1573
|
// ward given only to `ref` makes none, and a Reorder item's keyboard attributes are in it.
|
|
1335
1574
|
let spread;
|
|
@@ -1357,11 +1596,17 @@ export function wardWith(config, internal) {
|
|
|
1357
1596
|
lifecycle,
|
|
1358
1597
|
element,
|
|
1359
1598
|
hold: holdWhileLoading,
|
|
1599
|
+
written,
|
|
1600
|
+
target,
|
|
1601
|
+
handsDown: node.handsDown,
|
|
1602
|
+
exitConfig,
|
|
1603
|
+
exitNow,
|
|
1360
1604
|
settled: undefined,
|
|
1361
1605
|
tapped: undefined,
|
|
1362
1606
|
next: undefined,
|
|
1363
1607
|
each: undefined,
|
|
1364
1608
|
when: undefined,
|
|
1609
|
+
hooks: undefined,
|
|
1365
1610
|
};
|
|
1366
1611
|
Object.setPrototypeOf(self, WARD_MEMBERS);
|
|
1367
1612
|
Object.defineProperties(self, {
|
|
@@ -1465,20 +1710,20 @@ const serverWard = (config, internal) => {
|
|
|
1465
1710
|
// A server's own values: the DOM's, its context's constant (#672).
|
|
1466
1711
|
const ownValues = ElementSetup.valueReadsOf(useWardicValueReads()).ownValues;
|
|
1467
1712
|
createUniqueId();
|
|
1468
|
-
const view = configuredView(WARD_VIEW.of(config, internal.fixed),
|
|
1713
|
+
const view = configuredView(WARD_VIEW.of(config, internal.fixed), configOf(internal));
|
|
1469
1714
|
// A key still loading (#257 item 1): one setup fixes is the client's error here too. One the ward
|
|
1470
1715
|
// reads as it goes is read again, throwing Solid's `NotReadyError`: a server waits for it and
|
|
1471
1716
|
// renders the component again, so its region streams once the data is in, Appear and all.
|
|
1472
1717
|
// Both are checked before the read that waits.
|
|
1473
1718
|
const setup = WARD_VIEW.setupOf(view);
|
|
1474
1719
|
// Animation controls (#433) set nothing on a server: no entry yet, and controlled, as on the client.
|
|
1475
|
-
const atSetup = AnimationControls.uncontrolledOf(configAtSetup(setup));
|
|
1720
|
+
const atSetup = variantChildBy(internal, AnimationControls.uncontrolledOf(configAtSetup(setup)));
|
|
1476
1721
|
// Where it's made, its given parent's, or its given ward's (#349).
|
|
1477
1722
|
const parent = variantParentOf(internal);
|
|
1478
1723
|
const presenceBlocks = PresenceRecord.presenceBlocksInitial(usePresenceContext());
|
|
1479
1724
|
if (Bool.and(Arr.contains(setup.pending, "animate"), VariantTree.startsAtAnimate(atSetup, VariantTree.inheritedContext(atSetup, parent), presenceBlocks)))
|
|
1480
|
-
throw
|
|
1481
|
-
const c = AnimationControls.uncontrolledOf(WARD_VIEW.snapshotOf(view));
|
|
1725
|
+
throw misuse("WARDIC_KEY_LOADING_AT_SETUP", STARTS_AT_PENDING);
|
|
1726
|
+
const c = variantChildBy(internal, AnimationControls.uncontrolledOf(WARD_VIEW.snapshotOf(view)));
|
|
1482
1727
|
const node = VariantTree.serverVariantNode(c, parent);
|
|
1483
1728
|
const serverStart = Spine.startOf(c, node.inherited, presenceBlocks, untrack);
|
|
1484
1729
|
// A variant that throws leaves its values out of the markup, logged on the server (#979).
|
|
@@ -1508,14 +1753,21 @@ const serverWard = (config, internal) => {
|
|
|
1508
1753
|
appear.veto(AppearAnimations.OWN_ANIMATION);
|
|
1509
1754
|
return pipe(ElementSetup.serverStartingStyle(internal.tag, seed.style, initialValues, parts.routed, layoutNode, untrack, c.transformTemplate), Style.over(parts.css), Style.over(UndefinedOr.match(internal.baseStyle, { onUndefined: constUndefined, onDefined: (base) => base() })), Style.over(dragDefaults), Style.over(appear.style));
|
|
1510
1755
|
};
|
|
1511
|
-
|
|
1756
|
+
// Worked out at its first read, a spread's (probe: behaviour-runes): what's made after the ward and
|
|
1757
|
+
// before its element renders still counts, a hooks row's grip, which takes its `touch-action` away.
|
|
1758
|
+
let style;
|
|
1759
|
+
const styleNow = () => {
|
|
1760
|
+
if (Predicate.isUndefined(style))
|
|
1761
|
+
style = styleFor(c.style);
|
|
1762
|
+
return style;
|
|
1763
|
+
};
|
|
1512
1764
|
let given = NO_WITH;
|
|
1513
1765
|
const attributes = attributeKeysOf(seed.attrs, Predicate.isNotUndefined(dragDefaults));
|
|
1514
1766
|
// A spread of it reads its spread's props alone, made at its first spread, as the client's (#495).
|
|
1515
1767
|
let spread;
|
|
1516
1768
|
const self = (() => {
|
|
1517
1769
|
if (Predicate.isUndefined(spread))
|
|
1518
|
-
spread = spreadOfWard(self, { value: noRef, enumerable: true }, {
|
|
1770
|
+
spread = spreadOfWard(self, { value: noRef, enumerable: true }, { get: styleNow, enumerable: true }, attributes);
|
|
1519
1771
|
return spread;
|
|
1520
1772
|
});
|
|
1521
1773
|
// What it shares with a component it's given to (#349): a server's component renders its own.
|
|
@@ -1523,11 +1775,12 @@ const serverWard = (config, internal) => {
|
|
|
1523
1775
|
config,
|
|
1524
1776
|
setup: atSetup,
|
|
1525
1777
|
internal,
|
|
1778
|
+
fixed: () => internal.fixed,
|
|
1526
1779
|
parent,
|
|
1527
1780
|
chosen: Predicate.isNotUndefined(internal.parent),
|
|
1528
|
-
carries:
|
|
1781
|
+
carries: carriesFor(internal, atSetup),
|
|
1529
1782
|
provided: appear.provided,
|
|
1530
|
-
layoutGroup:
|
|
1783
|
+
layoutGroup: groupOf(internal),
|
|
1531
1784
|
node: undefined,
|
|
1532
1785
|
lifecycle: undefined,
|
|
1533
1786
|
drive: () => constVoid,
|
|
@@ -1535,7 +1788,7 @@ const serverWard = (config, internal) => {
|
|
|
1535
1788
|
Object.defineProperties(self, {
|
|
1536
1789
|
[WARD]: { value: shared },
|
|
1537
1790
|
ref: { value: noRef, enumerable: true },
|
|
1538
|
-
style: {
|
|
1791
|
+
style: { get: styleNow, enumerable: true },
|
|
1539
1792
|
...attributes,
|
|
1540
1793
|
Provider: { value: Provider },
|
|
1541
1794
|
read: { value: (key) => () => ElementSetup.restingOf(key, initialValues, withStyleOver(c.style, given.style), readServerStyle) },
|
|
@@ -1547,8 +1800,11 @@ const serverWard = (config, internal) => {
|
|
|
1547
1800
|
next: { value: neverLands },
|
|
1548
1801
|
each: { value: () => NO_EVENTS },
|
|
1549
1802
|
when: { value: serverWhen },
|
|
1550
|
-
// The element's own style over the config's, rendered in its Starting style (#264).
|
|
1803
|
+
// The element's own style over the config's, rendered in its Starting style (#264). Configurable,
|
|
1804
|
+
// as a client's is by being a shared member: so what makes a ward of this one can give it a
|
|
1805
|
+
// `with` of its own, on a server as in a browser (the hooks', for what their runes add to a spread).
|
|
1551
1806
|
with: {
|
|
1807
|
+
configurable: true,
|
|
1552
1808
|
value: (own) => {
|
|
1553
1809
|
given = own;
|
|
1554
1810
|
return spreadPropsOf({
|
|
@@ -1563,4 +1819,252 @@ const serverWard = (config, internal) => {
|
|
|
1563
1819
|
};
|
|
1564
1820
|
/** A server render's `ref`: Solid never calls it there. */
|
|
1565
1821
|
const noRef = constUndefined;
|
|
1822
|
+
/** No values: what a function rune's ward rests at, having no config ({@link holderWard}). */
|
|
1823
|
+
const NO_VALUES = {};
|
|
1824
|
+
/** A function rune's ward's config, as it's written and at setup: none. */
|
|
1825
|
+
const NO_WRITTEN = Object.freeze({});
|
|
1826
|
+
/** A function rune's ward's exit: none, never read again, as it has no `exitNow`. */
|
|
1827
|
+
const NO_EXIT = Object.freeze({ current: Spine.NO_EXIT_CONFIG });
|
|
1828
|
+
/**
|
|
1829
|
+
* What development says of `member` used in a function rune's body (the ward split's Q7): it's the
|
|
1830
|
+
* finished ward's, and that ward isn't made yet.
|
|
1831
|
+
*/
|
|
1832
|
+
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 ` +
|
|
1833
|
+
"doesn't exist until every rune has run: use it where the ward is rendered, or in an effect or a callback.";
|
|
1834
|
+
// Module state (#460, Q7): what development has said, each member once.
|
|
1835
|
+
const SAID_EARLY = new Set();
|
|
1836
|
+
/** Says {@link usedEarly} of `member`, once, in development. */
|
|
1837
|
+
const sayEarly = (member) => {
|
|
1838
|
+
if (Predicate.isUndefined(DEV))
|
|
1839
|
+
return;
|
|
1840
|
+
if (SAID_EARLY.has(member))
|
|
1841
|
+
return;
|
|
1842
|
+
SAID_EARLY.add(member);
|
|
1843
|
+
report("WARDIC_RUNE_READ_TOO_EARLY", usedEarly(member));
|
|
1844
|
+
};
|
|
1845
|
+
/** The finished ward each function rune's ward hands on to, told it by {@link holderFinished}. */
|
|
1846
|
+
// Module state (#460, Q7): held weakly by the function rune's ward.
|
|
1847
|
+
const FINISHING = new WeakMap();
|
|
1848
|
+
/** Tells `holder`, a function rune's ward ({@link holderWard}), the ward it's part of, now that it's made. */
|
|
1849
|
+
export const holderFinished = (holder, ward) => {
|
|
1850
|
+
UndefinedOr.map(FINISHING.get(holder), (finish) => finish(ward));
|
|
1851
|
+
};
|
|
1852
|
+
/**
|
|
1853
|
+
* A function rune's ward (probe: behaviour-runes, the ward split's Q6–Q8, Q11), made before the ward it's
|
|
1854
|
+
* part of, since every rune runs before that ward is: a lifecycle and what the hooks keep, with no config,
|
|
1855
|
+
* no variant node and no mount. The finished ward adopts its lifecycle through its share, as a ward given
|
|
1856
|
+
* to a component does (#349), and drives its `read` and `atom` while it's on an element: as the second
|
|
1857
|
+
* binding ward this replaces did, at a fraction of its cost. What only the finished ward has, its
|
|
1858
|
+
* `Provider`, its spread and `with`, its `style` and its element, it hands on to that ward once
|
|
1859
|
+
* {@link holderFinished} says which: used in the rune's body, before then, development says so. It takes
|
|
1860
|
+
* no hydration id, on a server or in a browser.
|
|
1861
|
+
*/
|
|
1862
|
+
export const holderWard = (internal) => {
|
|
1863
|
+
// Where it's made: the variant context and Layout group its finished ward takes through its share.
|
|
1864
|
+
const parent = variantParentOf(internal);
|
|
1865
|
+
const layoutGroup = groupOf(internal);
|
|
1866
|
+
if (isServer)
|
|
1867
|
+
return serverHolder(internal, parent, layoutGroup);
|
|
1868
|
+
return clientHolder(internal, parent, layoutGroup);
|
|
1869
|
+
};
|
|
1870
|
+
/** A function rune's ward in a browser ({@link holderWard}). */
|
|
1871
|
+
const clientHolder = (internal, parent, layoutGroup) => {
|
|
1872
|
+
const registry = Spine.registryOf(useWardicRuntime());
|
|
1873
|
+
const firstCallOwner = firstCallOwnerHere();
|
|
1874
|
+
let finished;
|
|
1875
|
+
// The finished ward on its element (#349's driver): what its `read`, `atom` and `next` follow.
|
|
1876
|
+
let driver;
|
|
1877
|
+
let driven;
|
|
1878
|
+
let cleanups;
|
|
1879
|
+
const addCleanup = (cleanup) => {
|
|
1880
|
+
if (Predicate.isUndefined(cleanups))
|
|
1881
|
+
cleanups = [];
|
|
1882
|
+
cleanups.push(cleanup);
|
|
1883
|
+
};
|
|
1884
|
+
const drivenAtom = () => {
|
|
1885
|
+
if (Predicate.isNotUndefined(driven))
|
|
1886
|
+
return driven;
|
|
1887
|
+
const atom = Atom.make(driver);
|
|
1888
|
+
addCleanup(registry().mount(atom));
|
|
1889
|
+
driven = atom;
|
|
1890
|
+
return atom;
|
|
1891
|
+
};
|
|
1892
|
+
// Its gestures are its finished ward's: a `next` that asks for one starts it on that ward's element.
|
|
1893
|
+
const lifecycle = new Lifecycle(firstCallOwner, () => {
|
|
1894
|
+
UndefinedOr.map(driver, (d) => d.wanted());
|
|
1895
|
+
});
|
|
1896
|
+
onCleanup(() => {
|
|
1897
|
+
lifecycle.dispose();
|
|
1898
|
+
UndefinedOr.map(cleanups, (all) => Arr.forEach(all, runCleanup));
|
|
1899
|
+
});
|
|
1900
|
+
// A key's value: the finished ward's element's, while it drives this one; where nothing rests, else.
|
|
1901
|
+
let reads;
|
|
1902
|
+
const read = (key) => {
|
|
1903
|
+
if (Predicate.isUndefined(reads))
|
|
1904
|
+
reads = new Map();
|
|
1905
|
+
const known = reads.get(key);
|
|
1906
|
+
if (Predicate.isNotUndefined(known))
|
|
1907
|
+
return known;
|
|
1908
|
+
const following = drivenAtom();
|
|
1909
|
+
const resting = ElementSetup.restingOf(key, NO_VALUES, undefined, identity);
|
|
1910
|
+
const atom = Atom.make((get) => UndefinedOr.match(get(following), { onUndefined: () => resting, onDefined: (d) => get(d.readAtom(key)) }));
|
|
1911
|
+
const accessor = runWithOwner(firstCallOwner, () => followAtom(registry(), atom, addCleanup));
|
|
1912
|
+
reads.set(key, accessor);
|
|
1913
|
+
return accessor;
|
|
1914
|
+
};
|
|
1915
|
+
const atomOf = (key) => {
|
|
1916
|
+
const following = drivenAtom();
|
|
1917
|
+
return Atom.make((get) => UndefinedOr.match(get(following), { onUndefined: constUndefined, onDefined: (d) => get(d.atom(key)) }));
|
|
1918
|
+
};
|
|
1919
|
+
// Followed by one finished ward at a time (#349's Q5).
|
|
1920
|
+
const drive = (next, name) => {
|
|
1921
|
+
if (Predicate.isNotUndefined(driver))
|
|
1922
|
+
throw misuse("WARDIC_WARD_ON_TWO_SUBJECTS", secondElement(name));
|
|
1923
|
+
driver = next;
|
|
1924
|
+
UndefinedOr.map(driven, (atom) => registry().set(atom, next));
|
|
1925
|
+
return () => {
|
|
1926
|
+
if (driver !== next)
|
|
1927
|
+
return;
|
|
1928
|
+
driver = undefined;
|
|
1929
|
+
UndefinedOr.map(driven, (atom) => registry().set(atom, undefined));
|
|
1930
|
+
};
|
|
1931
|
+
};
|
|
1932
|
+
const shared = {
|
|
1933
|
+
config: NO_WRITTEN,
|
|
1934
|
+
setup: NO_WRITTEN,
|
|
1935
|
+
internal,
|
|
1936
|
+
fixed: () => internal.fixed,
|
|
1937
|
+
parent,
|
|
1938
|
+
chosen: Predicate.isNotUndefined(internal.parent),
|
|
1939
|
+
carries: false,
|
|
1940
|
+
provided: undefined,
|
|
1941
|
+
layoutGroup,
|
|
1942
|
+
node: undefined,
|
|
1943
|
+
lifecycle,
|
|
1944
|
+
drive,
|
|
1945
|
+
};
|
|
1946
|
+
const self = ((value) => UndefinedOr.match(finished, {
|
|
1947
|
+
onUndefined: () => {
|
|
1948
|
+
sayEarly("the ward as a ref or a spread");
|
|
1949
|
+
return undefined;
|
|
1950
|
+
},
|
|
1951
|
+
onDefined: (to) => to(value),
|
|
1952
|
+
}));
|
|
1953
|
+
const state = {
|
|
1954
|
+
shared: () => shared,
|
|
1955
|
+
Provider: (props) => UndefinedOr.match(finished, {
|
|
1956
|
+
onUndefined: () => {
|
|
1957
|
+
sayEarly("Provider");
|
|
1958
|
+
return props.children;
|
|
1959
|
+
},
|
|
1960
|
+
onDefined: (to) => to.Provider(props),
|
|
1961
|
+
}),
|
|
1962
|
+
read,
|
|
1963
|
+
atom: atomOf,
|
|
1964
|
+
with: (own) => UndefinedOr.match(finished, {
|
|
1965
|
+
onUndefined: () => {
|
|
1966
|
+
sayEarly("with");
|
|
1967
|
+
return spreadPropsOf({});
|
|
1968
|
+
},
|
|
1969
|
+
onDefined: (to) => to.with(own),
|
|
1970
|
+
}),
|
|
1971
|
+
lifecycle,
|
|
1972
|
+
element: () => UndefinedOr.match(finished, {
|
|
1973
|
+
onUndefined: constUndefined,
|
|
1974
|
+
onDefined: (to) => UndefinedOr.match(sensedOf(to), { onUndefined: constUndefined, onDefined: (sensed) => sensed.element() }),
|
|
1975
|
+
}),
|
|
1976
|
+
hold: () => {
|
|
1977
|
+
UndefinedOr.map(finished, (to) => stateOf(to).hold());
|
|
1978
|
+
},
|
|
1979
|
+
written: NO_WRITTEN,
|
|
1980
|
+
target: undefined,
|
|
1981
|
+
handsDown: undefined,
|
|
1982
|
+
exitConfig: NO_EXIT,
|
|
1983
|
+
exitNow: undefined,
|
|
1984
|
+
settled: undefined,
|
|
1985
|
+
tapped: undefined,
|
|
1986
|
+
next: undefined,
|
|
1987
|
+
each: undefined,
|
|
1988
|
+
when: undefined,
|
|
1989
|
+
hooks: undefined,
|
|
1990
|
+
};
|
|
1991
|
+
FINISHING.set(self, (ward) => {
|
|
1992
|
+
finished = ward;
|
|
1993
|
+
});
|
|
1994
|
+
Object.setPrototypeOf(self, WARD_MEMBERS);
|
|
1995
|
+
Object.defineProperties(self, {
|
|
1996
|
+
[WARD_STATE]: { value: state },
|
|
1997
|
+
ref: { value: self, enumerable: true },
|
|
1998
|
+
style: { get: () => styleOf(finished), enumerable: true },
|
|
1999
|
+
});
|
|
2000
|
+
return self;
|
|
2001
|
+
};
|
|
2002
|
+
/** A function rune's ward's `style`: its finished ward's. */
|
|
2003
|
+
const styleOf = (finished) => UndefinedOr.match(finished, {
|
|
2004
|
+
onUndefined: () => {
|
|
2005
|
+
sayEarly("style");
|
|
2006
|
+
return {};
|
|
2007
|
+
},
|
|
2008
|
+
onDefined: (to) => to.style,
|
|
2009
|
+
});
|
|
2010
|
+
/** A function rune's ward on a server ({@link holderWard}): a server ward's members, and its share. Nothing hears anything there. */
|
|
2011
|
+
const serverHolder = (internal, parent, layoutGroup) => {
|
|
2012
|
+
let finished;
|
|
2013
|
+
const self = (() => UndefinedOr.match(finished, {
|
|
2014
|
+
onUndefined: () => {
|
|
2015
|
+
sayEarly("the ward as a ref or a spread");
|
|
2016
|
+
return undefined;
|
|
2017
|
+
},
|
|
2018
|
+
onDefined: (to) => to(),
|
|
2019
|
+
}));
|
|
2020
|
+
const shared = {
|
|
2021
|
+
config: NO_WRITTEN,
|
|
2022
|
+
setup: NO_WRITTEN,
|
|
2023
|
+
internal,
|
|
2024
|
+
fixed: () => internal.fixed,
|
|
2025
|
+
parent,
|
|
2026
|
+
chosen: Predicate.isNotUndefined(internal.parent),
|
|
2027
|
+
carries: false,
|
|
2028
|
+
provided: undefined,
|
|
2029
|
+
layoutGroup,
|
|
2030
|
+
node: undefined,
|
|
2031
|
+
lifecycle: undefined,
|
|
2032
|
+
drive: () => constVoid,
|
|
2033
|
+
};
|
|
2034
|
+
FINISHING.set(self, (ward) => {
|
|
2035
|
+
finished = ward;
|
|
2036
|
+
});
|
|
2037
|
+
Object.defineProperties(self, {
|
|
2038
|
+
[WARD]: { value: shared },
|
|
2039
|
+
ref: { value: noRef, enumerable: true },
|
|
2040
|
+
style: { get: () => styleOf(finished), enumerable: true },
|
|
2041
|
+
Provider: {
|
|
2042
|
+
value: (props) => UndefinedOr.match(finished, {
|
|
2043
|
+
onUndefined: () => {
|
|
2044
|
+
sayEarly("Provider");
|
|
2045
|
+
return props.children;
|
|
2046
|
+
},
|
|
2047
|
+
onDefined: (to) => to.Provider(props),
|
|
2048
|
+
}),
|
|
2049
|
+
},
|
|
2050
|
+
read: { value: (key) => () => ElementSetup.restingOf(key, NO_VALUES, undefined, identity) },
|
|
2051
|
+
atom: { value: () => NO_OUTPUT },
|
|
2052
|
+
settled: { value: constUndefined },
|
|
2053
|
+
tapped: { value: constUndefined },
|
|
2054
|
+
next: { value: neverLands },
|
|
2055
|
+
each: { value: () => NO_EVENTS },
|
|
2056
|
+
when: { value: serverWhen },
|
|
2057
|
+
with: {
|
|
2058
|
+
configurable: true,
|
|
2059
|
+
value: (own) => UndefinedOr.match(finished, {
|
|
2060
|
+
onUndefined: () => {
|
|
2061
|
+
sayEarly("with");
|
|
2062
|
+
return spreadPropsOf({});
|
|
2063
|
+
},
|
|
2064
|
+
onDefined: (to) => to.with(own),
|
|
2065
|
+
}),
|
|
2066
|
+
},
|
|
2067
|
+
});
|
|
2068
|
+
return self;
|
|
2069
|
+
};
|
|
1566
2070
|
//# sourceMappingURL=ward.jsx.map
|