@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/src/provider.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* A Wardic scope for Solid 2 (`@wardic/solid`, #209): one Effect runtime for a subtree, as the Solid 1
|
|
3
|
+
* binding's provider (`../../provider.tsx`), over the same runtime and services (`../../runtime.ts`).
|
|
4
|
+
* `<WardicProvider>` is a utility over the hooks' `createWardicScope` now (probe: behaviour-runes, the
|
|
5
|
+
* scopes round's Q45), which makes one with `scopeOf`. What Solid 2 changes:
|
|
5
6
|
*
|
|
6
7
|
* - **No `batch`.** Solid 2 batches every update on a microtask, and a read lags its setter until
|
|
7
8
|
* then. The flush gate needs a frame's Starting-style switches to have reached the elements
|
|
@@ -23,9 +24,9 @@
|
|
|
23
24
|
import * as Bool from "effect/Boolean"
|
|
24
25
|
import * as Effect from "effect/Effect"
|
|
25
26
|
import * as Fiber from "effect/Fiber"
|
|
26
|
-
import { constFalse, constUndefined
|
|
27
|
+
import { constFalse, constUndefined } from "effect/Function"
|
|
27
28
|
import * as Latch from "effect/Latch"
|
|
28
|
-
import * as
|
|
29
|
+
import * as Layer from "effect/Layer"
|
|
29
30
|
import * as Predicate from "effect/Predicate"
|
|
30
31
|
import * as UndefinedOr from "effect/UndefinedOr"
|
|
31
32
|
import type * as DefaultTransition from "@wardic/core/DefaultTransition"
|
|
@@ -34,11 +35,12 @@ import type * as Renderer from "@wardic/core/Renderer"
|
|
|
34
35
|
import type * as FlushGate from "@wardic/dom/FlushGate"
|
|
35
36
|
import type * as ProjectionSystem from "@wardic/dom/ProjectionSystem"
|
|
36
37
|
import { type HeadTag, isServer, type JSX, useHead } from "@solidjs/web"
|
|
37
|
-
import {
|
|
38
|
+
import { DEV, flush, getOwner, isHydrating, onCleanup, onSettled, runWithOwner, untrack, useContext } from "solid-js"
|
|
39
|
+
import { WardicContext } from "./wardic-context.ts"
|
|
38
40
|
import * as Context from "effect/Context"
|
|
39
41
|
import * as Report from "@wardic/dom/Report"
|
|
40
42
|
import * as Feature from "@wardic/dom/unstable/Feature"
|
|
41
|
-
import {
|
|
43
|
+
import { sectionUnder } from "./feature-section.ts"
|
|
42
44
|
import * as AppearAnimations from "@wardic/dom/unstable/AppearAnimations"
|
|
43
45
|
import {
|
|
44
46
|
animateLayoutOf,
|
|
@@ -58,6 +60,7 @@ import {
|
|
|
58
60
|
} from "./runtime.ts"
|
|
59
61
|
import type * as ElementSetup from "@wardic/dom/unstable/ElementSetup"
|
|
60
62
|
import { WAITING_ENV_FIX, WAITING_ENV_LINE } from "./messages.ts"
|
|
63
|
+
import { misuse, reporterLayer } from "./diagnostics.ts"
|
|
61
64
|
import { warnWithoutSpans } from "./spans-check.ts"
|
|
62
65
|
import { onSettledClientOnly, reactivityIn, untracked } from "./solid-reactivity.ts"
|
|
63
66
|
import { useWardicConfig } from "./wardic-config.tsx"
|
|
@@ -71,14 +74,36 @@ const applyAndFlush = (apply: () => void): void => {
|
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
/**
|
|
74
|
-
* The
|
|
75
|
-
*
|
|
76
|
-
* provider: `null` keeps Wardic's, which names the hook.
|
|
77
|
+
* The page's own context (probe: hooks-first): what `setupWardic` gives, read where no provider is
|
|
78
|
+
* above. `undefined` until an app calls it, so an app that doesn't keeps today's errors.
|
|
77
79
|
*/
|
|
78
|
-
|
|
80
|
+
// Module state (#460, Q7): the page's setup, one a page; a server's read gives each render its own.
|
|
81
|
+
let pageContext: () => WardicContextValue | undefined = constUndefined
|
|
79
82
|
|
|
80
|
-
/**
|
|
81
|
-
const
|
|
83
|
+
/** Sets what a hook reads with no provider above it (probe: hooks-first, `hooks/setup.ts`). Internal. */
|
|
84
|
+
export const setPageContext = (read: () => WardicContextValue | undefined): void => {
|
|
85
|
+
pageContext = read
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The nearest provider's value, else the page's own (probe: hooks-first); `undefined` with neither. */
|
|
89
|
+
const contextValue = (): WardicContextValue | undefined => {
|
|
90
|
+
const given = useContext(WardicContext)
|
|
91
|
+
if (Predicate.isNotNull(given)) return given
|
|
92
|
+
return pageContext()
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* How Solid 2's error for a read with neither a provider nor a page ends: in development, the fix, the
|
|
97
|
+
* page its hooks set up needing no provider (the skill grill's Q19); in a production build, the line
|
|
98
|
+
* alone, as `messages.ts`'s are, so a bundle drops the fix it never names (the size step after step 2).
|
|
99
|
+
*/
|
|
100
|
+
const pageEnding = (): string => {
|
|
101
|
+
if (DEV) return ": render the component that calls it inside one, or set the page up for it with no provider: importing `@wardic/solid/hooks` does, with `DomLive`, and `setupWard({ env })` gives it your own."
|
|
102
|
+
return "."
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** `pick` off the nearest provider's value, else the page's, or the coded error naming `name`, ending on Solid 2's ending. */
|
|
106
|
+
const fromScope = <A,>(name: string, pick: (value: WardicContextValue) => A): A => fromContext(contextValue(), name, pick, pageEnding(), misuse)
|
|
82
107
|
|
|
83
108
|
/**
|
|
84
109
|
* What a client provider fails with when its `env` waits as it builds (#746, ADR-0067 *Amendment
|
|
@@ -91,38 +116,38 @@ const waitingEnvMessage = (): string => {
|
|
|
91
116
|
return WAITING_ENV_LINE
|
|
92
117
|
}
|
|
93
118
|
|
|
119
|
+
/**
|
|
120
|
+
* `env`, with the binding's diagnostics reporter under it (solid-next): what core and dom report goes
|
|
121
|
+
* on Solid's channel, as the binding's own does, unless `env` gives a reporter of its own. Here, not in
|
|
122
|
+
* the runtime Solid 1's binding shares, which has no Solid 2 channel to report to.
|
|
123
|
+
*/
|
|
124
|
+
const reportingIn = (env: WardicEnv): WardicEnv => Layer.merge(reporterLayer, env)
|
|
125
|
+
|
|
94
126
|
/**
|
|
95
127
|
* A provider's context: a server render's, inert, or the client's. Decided by a plain `if`: a client
|
|
96
128
|
* build folds `isServer` and drops the server render's code, where `Bool.match` kept it (#518: 8.4 KB
|
|
97
129
|
* gzipped in every Solid 2 app). `env` and `appear` are read once, as the provider's docs say.
|
|
98
130
|
*/
|
|
99
|
-
const contextOf = (given:
|
|
100
|
-
if (isServer) return serverContext(given.env, WAITING_ENV_FIX, serverAppearOf(given.appear, given.reducedMotion, given.nonce), () => untrack(() => given.reducedMotion))
|
|
131
|
+
const contextOf = (given: ScopeProps): WardicContextValue => {
|
|
132
|
+
if (isServer) return serverContext(reportingIn(given.env), WAITING_ENV_FIX, serverAppearOf(given.appear, given.reducedMotion, given.nonce), () => untrack(() => given.reducedMotion), misuse)
|
|
101
133
|
return clientContext(
|
|
102
|
-
given.env,
|
|
134
|
+
reportingIn(given.env),
|
|
103
135
|
waitingEnvMessage(),
|
|
104
136
|
applyAndFlush,
|
|
105
137
|
() => untrack(() => given.reducedMotion),
|
|
106
138
|
// The provider's setting, tracked too: `createReducedMotionConfig` reads it where it tracks (#584).
|
|
107
139
|
() => given.reducedMotion,
|
|
108
140
|
untrack(() => given.scaleCorrectors),
|
|
141
|
+
misuse,
|
|
109
142
|
)
|
|
110
143
|
}
|
|
111
144
|
|
|
112
145
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
* <App />
|
|
119
|
-
* </WardicProvider>
|
|
120
|
-
* @see https://wardic.dev/reference/solid/provider/wardic-provider
|
|
121
|
-
*/
|
|
122
|
-
// As the Solid 1 binding's: one runtime made once from `env` (#51: built on first need), disposed on
|
|
123
|
-
// unmount, inert during a server render (ADR-0021). reducedMotion is read as each animation starts
|
|
124
|
-
// (ADR-0029), a WardicConfig's over it (#434); appear (ADR-0044, #585) on the server once.
|
|
125
|
-
export function WardicProvider(props: {
|
|
146
|
+
* What a Wardic scope is made of (`<WardicProvider>`'s props, without its children; probe: behaviour-runes,
|
|
147
|
+
* the scopes round's Q45): its Environment, its Features and its settings. Internal: the hooks'
|
|
148
|
+
* `createWardicScope` takes them, and a page's setup.
|
|
149
|
+
*/
|
|
150
|
+
export interface ScopeProps {
|
|
126
151
|
/**
|
|
127
152
|
* The Environment Wardic runs in: `DomLive` in a browser, from `@wardic/dom`, with Effect's own Layers merged beside it, and
|
|
128
153
|
* `WardicSpans` for Wardic's spans. Read once, and built at once: a Layer that waits as it builds fails it.
|
|
@@ -157,8 +182,17 @@ export function WardicProvider(props: {
|
|
|
157
182
|
readonly features?: Feature.FeaturesProp | undefined
|
|
158
183
|
/** In development, a `wardic.*` element under it throws, so every element ships only its Features. */
|
|
159
184
|
readonly strict?: boolean | undefined
|
|
160
|
-
|
|
161
|
-
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* A Wardic scope (probe: behaviour-runes, the scopes round's Q45): today's `<WardicProvider>`'s body,
|
|
189
|
+
* made where it's called, and its `within`, which renders what it builds under it as that provider
|
|
190
|
+
* rendered its children. Internal: the hooks' `createWardicScope`.
|
|
191
|
+
*/
|
|
192
|
+
// As the Solid 1 binding's provider: one runtime made once from `env` (#51: built on first need),
|
|
193
|
+
// disposed with its owner, inert during a server render (ADR-0021). reducedMotion is read as each
|
|
194
|
+
// animation starts (ADR-0029), a WardicConfig's over it (#434); appear (ADR-0044, #585) on the server once.
|
|
195
|
+
export const scopeOf = (props: ScopeProps): ((build: () => JSX.Element) => JSX.Element) => {
|
|
162
196
|
const value = contextOf(props)
|
|
163
197
|
// Disposing the runtime closes its Scope: the projection system, then the gate (#132). Its
|
|
164
198
|
// disposal rejects first, ending every `animateLayout` still waiting: their flights won't end (#257).
|
|
@@ -170,7 +204,7 @@ export function WardicProvider(props: {
|
|
|
170
204
|
disposed.catch(constUndefined)
|
|
171
205
|
disposals.set(value, disposed)
|
|
172
206
|
onCleanup(() => {
|
|
173
|
-
abort(new DOMException("The WardicProvider was disposed before its layout animations ended.", "AbortError"))
|
|
207
|
+
abort(new DOMException("The WardicProvider, or Wardic scope, was disposed before its layout animations ended.", "AbortError"))
|
|
174
208
|
// Its Features end first, then the runtime they stand on (#511).
|
|
175
209
|
void value.features.dispose()
|
|
176
210
|
})
|
|
@@ -189,7 +223,8 @@ export function WardicProvider(props: {
|
|
|
189
223
|
}),
|
|
190
224
|
)
|
|
191
225
|
}
|
|
192
|
-
|
|
226
|
+
// What it builds read in JSX, where it tracks, as the provider's children were.
|
|
227
|
+
return (build) => <WardicContext value={value}>{build()}</WardicContext>
|
|
193
228
|
}
|
|
194
229
|
|
|
195
230
|
/**
|
|
@@ -200,14 +235,11 @@ export function WardicProvider(props: {
|
|
|
200
235
|
const sections = new WeakMap<WardicContextValue, Feature.FeatureSection>()
|
|
201
236
|
|
|
202
237
|
/**
|
|
203
|
-
* The section an element is in (#511):
|
|
204
|
-
*
|
|
238
|
+
* The section an element is in (#511): its provider's own, or its page's; outside both, none. Internal.
|
|
239
|
+
* `<LazyWardic>`'s sections between went with it (probe: behaviour-runes, deleted after the scopes round).
|
|
205
240
|
*/
|
|
206
241
|
export function useFeatureSection(): Feature.FeatureSection {
|
|
207
|
-
return UndefinedOr.match(
|
|
208
|
-
onDefined: identity,
|
|
209
|
-
onUndefined: () => UndefinedOr.match(contextValue(), { onUndefined: () => Feature.ROOT, onDefined: (value) => UndefinedOr.getOrThrow(sections.get(value)) }),
|
|
210
|
-
})
|
|
242
|
+
return UndefinedOr.match(contextValue(), { onUndefined: () => Feature.ROOT, onDefined: (value) => UndefinedOr.getOrThrow(sections.get(value)) })
|
|
211
243
|
}
|
|
212
244
|
|
|
213
245
|
/**
|
|
@@ -224,28 +256,11 @@ const sectionOf = (
|
|
|
224
256
|
})
|
|
225
257
|
|
|
226
258
|
/**
|
|
227
|
-
*
|
|
228
|
-
* (`
|
|
229
|
-
* a
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
* <LazyWardic features={() => import("./drag-feature").then((m) => m.drag)}>
|
|
233
|
-
* <w.div drag />
|
|
234
|
-
* </LazyWardic>
|
|
235
|
-
* @see https://wardic.dev/reference/solid/provider/lazy-wardic
|
|
236
|
-
*/
|
|
237
|
-
// #511, ADR-0067, as the Solid 1 binding's: given at once, built at first need; loaded lazily, each
|
|
238
|
-
// Feature takes effect as it arrives (#551, #582). A failed load is reported once; a server loads nothing.
|
|
239
|
-
export function LazyWardic(props: {
|
|
240
|
-
/** Its Features: one, a list, or a function that loads them. Read once. */
|
|
241
|
-
readonly features: Feature.FeaturesProp
|
|
242
|
-
/** In development, a `wardic.*` element under it throws. Read once. */
|
|
243
|
-
readonly strict?: boolean | undefined
|
|
244
|
-
readonly children?: JSX.Element
|
|
245
|
-
}): JSX.Element {
|
|
246
|
-
const section = fromContext(contextValue(), "LazyWardic", (value) => sectionOf(value, useFeatureSection(), props))
|
|
247
|
-
return <FeatureSectionContext value={section}>{props.children}</FeatureSectionContext>
|
|
248
|
-
}
|
|
259
|
+
* Where Solid 2 gives `strict`, for development's word on a Complete element under it: the page's settings
|
|
260
|
+
* (`setupWard` or `makeWard`), a `createWardicScope`, or a `<WardicProvider strict>`. dom's own words name
|
|
261
|
+
* Solid 1's, a provider or a `LazyWardic`, which Solid 2 no longer has (probe: behaviour-runes).
|
|
262
|
+
*/
|
|
263
|
+
const STRICT_UNDER = "a strict page, Wardic scope or WardicProvider"
|
|
249
264
|
|
|
250
265
|
/**
|
|
251
266
|
* The Features an element has (#511): its section's, and those it brings, a Complete element's every
|
|
@@ -256,14 +271,20 @@ export function useElementFeatures(internal: Feature.ElementFeatures): Feature.F
|
|
|
256
271
|
const { brings, instance } = internal
|
|
257
272
|
const complete = internal.complete === true
|
|
258
273
|
const section = useFeatureSection()
|
|
259
|
-
if (DEV && complete && section.strict) throw
|
|
260
|
-
// A Wardic instance's element (#516): its instance's Features, given at once or loaded, beside its section's
|
|
261
|
-
|
|
274
|
+
if (DEV && complete && section.strict) throw misuse("WARDIC_COMPLETE_UNDER_STRICT", Feature.strictMessage("wardic.*, wardic.create, ward()", "w.*, w.create, w.ward()", STRICT_UNDER))
|
|
275
|
+
// A Wardic instance's element (#516): its instance's Features, given at once or loaded, beside its section's;
|
|
276
|
+
// and what it brings besides, a hooks Reorder row's (the Reorder round's RF3), where it brings any.
|
|
277
|
+
if (Predicate.isNotUndefined(instance)) return broughtBeside(Feature.joinSections(section, useInstanceFeatures(instance)), brings)
|
|
262
278
|
if (Predicate.isUndefined(brings)) return section
|
|
263
|
-
const registry = useFeatureRegistry()
|
|
264
279
|
// A Complete element has every Feature, whatever its section has: one section per provider.
|
|
265
|
-
if (complete) return
|
|
266
|
-
|
|
280
|
+
if (complete) return useFeatureRegistry().section(brings)
|
|
281
|
+
return broughtBeside(section, brings)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** `section`, with what an element `brings` built beside it: as it is, where it brings none. */
|
|
285
|
+
const broughtBeside = (section: Feature.FeatureSection, brings: ReadonlyArray<Feature.Feature> | undefined): Feature.FeatureSection => {
|
|
286
|
+
if (Predicate.isUndefined(brings)) return section
|
|
287
|
+
const own = useFeatureRegistry().build(brings)
|
|
267
288
|
return Feature.joinSections(section, { services: () => own, pending: constFalse })
|
|
268
289
|
}
|
|
269
290
|
|
|
@@ -272,12 +293,12 @@ export function useElementFeatures(internal: Feature.ElementFeatures): Feature.F
|
|
|
272
293
|
* given built on first need, each load started the first time it's asked for, on the client. Internal.
|
|
273
294
|
*/
|
|
274
295
|
export function useInstanceFeatures(instance: Feature.InstanceFeatures): Feature.Own {
|
|
275
|
-
return
|
|
296
|
+
return fromScope("makeWard", (value) =>
|
|
276
297
|
instance.own(value.features, {
|
|
277
298
|
reactivity: reactivityIn(getOwner()),
|
|
278
299
|
server: isServer,
|
|
279
300
|
report: (cause) => {
|
|
280
|
-
value.runtime.runFork(Report.failure("wardic.
|
|
301
|
+
value.runtime.runFork(Report.failure("wardic.makeWard: a lazy load of Features failed", cause))
|
|
281
302
|
},
|
|
282
303
|
}),
|
|
283
304
|
)
|
|
@@ -296,7 +317,7 @@ export function useInstanceBrought(instance: Feature.InstanceFeatures): void {
|
|
|
296
317
|
|
|
297
318
|
/** The provider's Features (#511). Internal. */
|
|
298
319
|
export function useFeatureRegistry(): Feature.FeatureRegistry {
|
|
299
|
-
return
|
|
320
|
+
return fromScope("useFeatureRegistry", (value) => value.features)
|
|
300
321
|
}
|
|
301
322
|
|
|
302
323
|
/**
|
|
@@ -313,6 +334,27 @@ export function useBrought(features: ReadonlyArray<Feature.Feature>): () => Cont
|
|
|
313
334
|
// Module state (#460, Q7): each provider's disposal, held weakly by its context value.
|
|
314
335
|
const disposals = new WeakMap<WardicContextValue, Promise<never>>()
|
|
315
336
|
|
|
337
|
+
/**
|
|
338
|
+
* A page's context for `setupWardic` (probe: hooks-first): what a provider builds from the same
|
|
339
|
+
* props, with its root section, and a disposal that never comes, since it lives as long as the page.
|
|
340
|
+
* A server render's has its Appear animations with no `<style>` registered for them: a provider
|
|
341
|
+
* registers its own where it renders, at the shell, and a page with none has no such place, so
|
|
342
|
+
* `setupWardic` registers it itself (`hooks/setup.ts`). Internal.
|
|
343
|
+
*/
|
|
344
|
+
export const pageContextOf = (props: ScopeProps): WardicContextValue => {
|
|
345
|
+
const value = pageValueOf(props)
|
|
346
|
+
disposals.set(value, new Promise<never>(constUndefined))
|
|
347
|
+
sections.set(value, sectionOf(value, Feature.ROOT, props))
|
|
348
|
+
return value
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/** {@link pageContextOf}'s value: a plain `if`, so a client build drops the server's half (#518). */
|
|
352
|
+
const pageValueOf = (props: ScopeProps): WardicContextValue => {
|
|
353
|
+
// eslint-disable-next-line solid/reactivity -- a server renders once: its props read as its context is made
|
|
354
|
+
if (isServer) return serverContext(reportingIn(props.env), WAITING_ENV_FIX, AppearAnimations.serverAppearUnder(props.appear, props.reducedMotion, props.nonce), () => untrack(() => props.reducedMotion), misuse)
|
|
355
|
+
return contextOf(props)
|
|
356
|
+
}
|
|
357
|
+
|
|
316
358
|
/**
|
|
317
359
|
* A server render's Appear animations (#48, ADR-0044), with the head's `<style>` registered for
|
|
318
360
|
* them, or `undefined` with `appear={false}`. Each element takes a slot as it renders; the head
|
|
@@ -363,7 +405,7 @@ export function useWardicAppear(): AppearAnimations.ServerAppear | undefined {
|
|
|
363
405
|
*/
|
|
364
406
|
// ADR-0021: a server builds no runtime, and DomLive refuses with its client-only error.
|
|
365
407
|
export function useWardicRuntime(): WardicRuntime {
|
|
366
|
-
return
|
|
408
|
+
return fromScope("useWardicRuntime", (value) => value.runtime)
|
|
367
409
|
}
|
|
368
410
|
|
|
369
411
|
/** The nearest provider's runtime, or none outside one: where a transform's failure is reported (#979). */
|
|
@@ -380,17 +422,17 @@ export function useProvidedRuntime(): WardicRuntime | undefined {
|
|
|
380
422
|
*/
|
|
381
423
|
// ADR-0006; inert on a server (ADR-0021, decision 9).
|
|
382
424
|
export function useWardicGate(): FlushGate.Shape {
|
|
383
|
-
return
|
|
425
|
+
return fromScope("useWardicGate", (value) => value.gate)
|
|
384
426
|
}
|
|
385
427
|
|
|
386
428
|
/** The Environment's Renderer (ADR-0003), read once by the provider: what an element and a presence project and commit through. Internal. */
|
|
387
429
|
export function useWardicRenderer(): Renderer.Renderer["Service"] {
|
|
388
|
-
return
|
|
430
|
+
return fromScope("useWardicRenderer", (value) => value.renderer)
|
|
389
431
|
}
|
|
390
432
|
|
|
391
433
|
/** The Environment's Positional keys (ADR-0036): which keys reduced motion Snaps. Internal. */
|
|
392
434
|
export function useWardicPositionalKeys(): ReducedMotion.PositionalKeys["Service"] {
|
|
393
|
-
return
|
|
435
|
+
return fromScope("useWardicPositionalKeys", (value) => value.positionalKeys)
|
|
394
436
|
}
|
|
395
437
|
|
|
396
438
|
/**
|
|
@@ -399,12 +441,12 @@ export function useWardicPositionalKeys(): ReducedMotion.PositionalKeys["Service
|
|
|
399
441
|
* DOM's). Internal.
|
|
400
442
|
*/
|
|
401
443
|
export function useWardicValueReads(): ElementSetup.ValueReads {
|
|
402
|
-
return
|
|
444
|
+
return fromScope("useWardicValueReads", (value) => value.valueReads)
|
|
403
445
|
}
|
|
404
446
|
|
|
405
447
|
/** The Environment's Default transition (ADR-0051): what a key with no transition of its own runs on. Internal. */
|
|
406
448
|
export function useWardicDefaultTransition(): DefaultTransition.DefaultTransition["Service"] {
|
|
407
|
-
return
|
|
449
|
+
return fromScope("useWardicDefaultTransition", (value) => value.defaultTransition)
|
|
408
450
|
}
|
|
409
451
|
|
|
410
452
|
/**
|
|
@@ -413,9 +455,15 @@ export function useWardicDefaultTransition(): DefaultTransition.DefaultTransitio
|
|
|
413
455
|
*/
|
|
414
456
|
// Untracked: read as each animation starts, an exit's in its presence's effect apply among them, where
|
|
415
457
|
// a config's `reducedMotion={signal()}` was Solid 2's STRICT_READ_UNTRACKED.
|
|
416
|
-
export function useWardicReducedMotion(): () => boolean {
|
|
417
|
-
const config =
|
|
418
|
-
return
|
|
458
|
+
export function useWardicReducedMotion(own?: WardicConfigValue.WardicConfigValue): () => boolean {
|
|
459
|
+
const config = configHere(own)
|
|
460
|
+
return fromScope("useWardicReducedMotion", (value) => untracked(reducedMotionWith(value, config)))
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/** A ward's own config settings where it gives them (probe: behaviour-runes), else the nearest `WardicConfig`'s. */
|
|
464
|
+
const configHere = (own: WardicConfigValue.WardicConfigValue | undefined): WardicConfigValue.WardicConfigValue | undefined => {
|
|
465
|
+
if (Predicate.isNotUndefined(own)) return own
|
|
466
|
+
return useWardicConfig()
|
|
419
467
|
}
|
|
420
468
|
|
|
421
469
|
/**
|
|
@@ -424,8 +472,8 @@ export function useWardicReducedMotion(): () => boolean {
|
|
|
424
472
|
* Internal.
|
|
425
473
|
*/
|
|
426
474
|
// Untracked, as `useWardicReducedMotion`: a config's `skipAnimations={signal()}` is read as each starts.
|
|
427
|
-
export function useWardicSkipAnimations(): () => boolean {
|
|
428
|
-
const config = WardicConfigValue.skipAnimationsOf(
|
|
475
|
+
export function useWardicSkipAnimations(own?: WardicConfigValue.WardicConfigValue): () => boolean {
|
|
476
|
+
const config = WardicConfigValue.skipAnimationsOf(configHere(own))
|
|
429
477
|
const value = contextValue()
|
|
430
478
|
if (Predicate.isUndefined(value)) return untracked(config)
|
|
431
479
|
const instant = value.instant
|
|
@@ -445,7 +493,7 @@ export function useWardicSkipAnimations(): () => boolean {
|
|
|
445
493
|
*/
|
|
446
494
|
// #443, as Solid 1's: an Instant change of the layout, the projection system's `instant`.
|
|
447
495
|
export function createInstantLayoutTransition(): (fn?: () => void) => void {
|
|
448
|
-
return
|
|
496
|
+
return fromScope("createInstantLayoutTransition", (value) => Instant.instantLayoutOf(() => value.projection))
|
|
449
497
|
}
|
|
450
498
|
|
|
451
499
|
/**
|
|
@@ -461,7 +509,7 @@ export function createInstantLayoutTransition(): (fn?: () => void) => void {
|
|
|
461
509
|
*/
|
|
462
510
|
// #443, as Solid 1's: an Instant change, each animation it covers a Skipped animation (#468).
|
|
463
511
|
export function createInstantTransition(): Instant.InstantTransition {
|
|
464
|
-
return
|
|
512
|
+
return fromScope("createInstantTransition", (value) => Instant.instantTransitionOf(() => value.projection, () => value.instant))
|
|
465
513
|
}
|
|
466
514
|
|
|
467
515
|
/**
|
|
@@ -480,7 +528,7 @@ export function createInstantTransition(): Instant.InstantTransition {
|
|
|
480
528
|
*/
|
|
481
529
|
// #443, as Solid 1's: a Projection reset, the projection system's `reset`: leavers and Switch seeds dropped.
|
|
482
530
|
export function createResetProjection(): () => void {
|
|
483
|
-
return
|
|
531
|
+
return fromScope("createResetProjection", (value) => Instant.resetOf(() => value.projection))
|
|
484
532
|
}
|
|
485
533
|
|
|
486
534
|
/**
|
|
@@ -489,14 +537,14 @@ export function createResetProjection(): () => void {
|
|
|
489
537
|
*/
|
|
490
538
|
export function useWardicReducedMotionSetting(): () => ReducedMotion.Config {
|
|
491
539
|
const config = useWardicConfig()
|
|
492
|
-
return
|
|
540
|
+
return fromScope("useWardicReducedMotionSetting", (value) => reducedMotionSettingWith(value, config))
|
|
493
541
|
}
|
|
494
542
|
|
|
495
543
|
/**
|
|
496
544
|
* `read` of the nearest provider's context value, named `name` in the error outside one: for a hook in
|
|
497
545
|
* a module of its own (#548), such as `useWardicProjection`, which brings `layout`.
|
|
498
546
|
*/
|
|
499
|
-
export const fromWardicContext = <A,>(name: string, read: (value: WardicContextValue) => A): A =>
|
|
547
|
+
export const fromWardicContext = <A,>(name: string, read: (value: WardicContextValue) => A): A => fromScope(name, read)
|
|
500
548
|
|
|
501
549
|
/**
|
|
502
550
|
* The provider's projection system once its `layout` Feature is built (#511), read as it's needed;
|
|
@@ -504,7 +552,7 @@ export const fromWardicContext = <A,>(name: string, read: (value: WardicContextV
|
|
|
504
552
|
* layout elements that are there: an element registering its values, a presence. Internal.
|
|
505
553
|
*/
|
|
506
554
|
export function useBuiltProjection(): () => ProjectionSystem.Shape | undefined {
|
|
507
|
-
return
|
|
555
|
+
return fromScope("useBuiltProjection", (value) => () => value.projection)
|
|
508
556
|
}
|
|
509
557
|
|
|
510
558
|
/**
|
|
@@ -531,7 +579,7 @@ export type AnimateLayout = <A>(fn: () => A) => Promise<Awaited<A>>
|
|
|
531
579
|
*/
|
|
532
580
|
export function useAnimateLayout(): AnimateLayout {
|
|
533
581
|
const value = contextValue()
|
|
534
|
-
const declare = animateLayoutOf(value)
|
|
582
|
+
const declare = animateLayoutOf(value, pageEnding(), misuse)
|
|
535
583
|
const disposed = UndefinedOr.match(value, { onUndefined: constUndefined, onDefined: (v) => disposals.get(v) })
|
|
536
584
|
return <A,>(fn: () => A): Promise<Awaited<A>> => {
|
|
537
585
|
// A server render has nothing to animate, and never settles.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Reorder` (probe: hooks-first, the Reorder round's utilities): Motion's `Reorder.Group` and
|
|
3
|
+
* `Reorder.Item` as the hooks' utilities over `createReorder` (`hooks/reorder-elements.tsx`), each group's
|
|
4
|
+
* element `w`'s; the Batch pair as it was, parked with the `createBatch` rework (the gap grill's Q34).
|
|
5
|
+
* Their props are the components' they replace, but the forms the round dropped (Q6): a group made with
|
|
6
|
+
* `reorderGroup` given to `groupRef`, and an item made with `reorderItem` given to `wardRef`.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { JSX } from "@solidjs/web"
|
|
11
|
+
import * as Predicate from "effect/Predicate"
|
|
12
|
+
import type { Component } from "solid-js"
|
|
13
|
+
import { BatchGroup, BatchItem } from "./batch-reorder-group.tsx"
|
|
14
|
+
import { type ListMaker, type ReorderElements, reorderElementsOf } from "./hooks/reorder-elements.tsx"
|
|
15
|
+
import { createReorder } from "./hooks/reorder.ts"
|
|
16
|
+
import { fixed, rawWardOf } from "./hooks/ward.ts"
|
|
17
|
+
import { ITEM_BRINGS, type ReorderElementTag, type ReorderGripComponentProps, type ReorderGroupComponentProps, type ReorderItemComponentProps } from "./reorder.tsx"
|
|
18
|
+
import { w } from "./w.tsx"
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The two components, made at the first one's first use: nothing is made as the module loads, so an app
|
|
22
|
+
* that renders the Batch pair alone doesn't ship them, as it shipped none of the components they
|
|
23
|
+
* replace (the Reorder round's size: `s2-reorder-batch`).
|
|
24
|
+
*/
|
|
25
|
+
// Module state (#460, Q7): the components, the same for every group and item.
|
|
26
|
+
let made: ReorderElements | undefined
|
|
27
|
+
const elements = (): ReorderElements => {
|
|
28
|
+
// Their lists `createReorder`'s, each item a plain ward of `list.item`'s behaviour (probe: behaviour-runes).
|
|
29
|
+
// Their wards the hooks' maker without its module's default page, which `make-ward.ts` sets up as it
|
|
30
|
+
// loads: imported here, it gave the whole main entry a page outside any provider. A list's row's maker,
|
|
31
|
+
// as `createWards`' rows are made and as an item's was before: one no presence takes. Bringing an item's
|
|
32
|
+
// Features at once, as today's item did (`ITEM_BRINGS`): loaded as each row asked, a key pressed as the
|
|
33
|
+
// list mounted came before the row's input, and its lift was missed (DG5).
|
|
34
|
+
if (Predicate.isUndefined(made)) made = reorderElementsOf(w as unknown as Readonly<Record<string, Component<Record<string, unknown>>>>, createReorder as ListMaker, rawWardOf(fixed({ brings: ITEM_BRINGS })))
|
|
35
|
+
return made
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const Group = (props: Record<string, unknown>): JSX.Element => elements().Group(props)
|
|
39
|
+
const Item = (props: Record<string, unknown>): JSX.Element => elements().Item(props)
|
|
40
|
+
const Grip = (props: Record<string, unknown>): JSX.Element => elements().Grip(props)
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A list put in order by dragging its items, or from the keyboard: `Reorder.Group` and `Reorder.Item`.
|
|
44
|
+
* Your app owns the order: the group takes it as `values`, and `onReorder` hands each new one back.
|
|
45
|
+
* Motion's `Reorder`. A long list of items of one size reorders as one Batch: `Reorder.BatchGroup` and
|
|
46
|
+
* `Reorder.BatchItem`.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* <Reorder.Group values={items()} onReorder={setItems}>
|
|
50
|
+
* <For each={items()}>{(item) => <Reorder.Item value={item}>{item}</Reorder.Item>}</For>
|
|
51
|
+
* </Reorder.Group>
|
|
52
|
+
* @see https://wardic.dev/reference/solid/reorder/reorder
|
|
53
|
+
*/
|
|
54
|
+
// ADR-0020; the Batch pair, ADR-0072 (#712); the grip, probe: behaviour-runes (Q29).
|
|
55
|
+
export const Reorder = {
|
|
56
|
+
Group: Group as <V, Tag extends ReorderElementTag = "ul">(props: ReorderGroupComponentProps<V, Tag>) => JSX.Element,
|
|
57
|
+
Item: Item as <V, Tag extends ReorderElementTag = "li">(props: ReorderItemComponentProps<V, Tag>) => JSX.Element,
|
|
58
|
+
Grip: Grip as <Tag extends ReorderElementTag = "button">(props: ReorderGripComponentProps<Tag>) => JSX.Element,
|
|
59
|
+
BatchGroup,
|
|
60
|
+
BatchItem,
|
|
61
|
+
} as const
|