@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
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wardic's coded diagnostics on Solid 2 (solid-next, the skill grill's Q6, Q17 and Q21): a broken rule is
|
|
3
|
+
* reported as Solid reports its own. In development it goes on Solid's channel (`OBSERVE.diagnostics`),
|
|
4
|
+
* under the owner it happened in, where `@solidjs/diagnostics`' `captureArtifact` reads it, and it's
|
|
5
|
+
* printed: `[WARDIC_…]` and what happened with its fix, the owners it happened under, and on its code's
|
|
6
|
+
* first report a footer naming its page on next.wardic.dev and its section in the `wardic-diagnostics`
|
|
7
|
+
* skill. Solid's own printer isn't used: its footer names Solid's docs and Solid's skill. A production
|
|
8
|
+
* build has no channel, and reports nothing.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import * as Diagnostic from "@wardic/core/unstable/Diagnostic"
|
|
13
|
+
import * as Effect from "effect/Effect"
|
|
14
|
+
import * as Layer from "effect/Layer"
|
|
15
|
+
import * as UndefinedOr from "effect/UndefinedOr"
|
|
16
|
+
import { DEV, type DiagnosticCode, type DiagnosticEvent, getOwner, OBSERVE } from "solid-js"
|
|
17
|
+
|
|
18
|
+
/** A Wardic diagnostic's code: `WARDIC_` and what happened, core's, dom's or the binding's own. */
|
|
19
|
+
export type Code = Diagnostic.Code
|
|
20
|
+
|
|
21
|
+
/** Where a code's page is, by the code in lowercase. */
|
|
22
|
+
const DOCS = "https://next.wardic.dev/diagnostics/"
|
|
23
|
+
|
|
24
|
+
/** Where a code's section is in the skill the package ships, by the code in lowercase. */
|
|
25
|
+
const SKILL = "node_modules/@wardic/solid/skills/wardic-diagnostics/SKILL.md#"
|
|
26
|
+
|
|
27
|
+
// Module state (#460, Q7): the codes whose first report has printed the footer, once a page, as Solid's footer
|
|
28
|
+
// is: development's alone, as `report` and `misuse` print nothing else, and a page's for its life.
|
|
29
|
+
const footered = new Set<string>()
|
|
30
|
+
|
|
31
|
+
/** A coded report's first line, what happened and its fix: what a thrown misuse says too. */
|
|
32
|
+
const coded = (code: Code, message: string): string => Diagnostic.line(code, message)
|
|
33
|
+
|
|
34
|
+
/** A code's footer, on its first report alone: its page, and its section in the skill. */
|
|
35
|
+
const footerOf = (code: Code): ReadonlyArray<string> => {
|
|
36
|
+
if (footered.has(code)) return []
|
|
37
|
+
footered.add(code)
|
|
38
|
+
const anchor = code.toLowerCase()
|
|
39
|
+
return [` What it means and how to fix it: ${DOCS}${anchor}`, ` For a coding agent: ${SKILL}${anchor}`]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** What's printed for `event`: its line, its owners and where, and its code's footer the first time. */
|
|
43
|
+
const printedOf = (code: Code, event: DiagnosticEvent): string =>
|
|
44
|
+
[
|
|
45
|
+
event.message,
|
|
46
|
+
...UndefinedOr.match(event.ownerPath, { onUndefined: () => [], onDefined: (path) => [` in ${path.join(" › ")}`] }),
|
|
47
|
+
...UndefinedOr.match(event.loc, { onUndefined: () => [], onDefined: (loc) => [` at ${loc}`] }),
|
|
48
|
+
...footerOf(code),
|
|
49
|
+
].join("\n")
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* `code` on Solid's channel, under the current owner, at `warn` (Solid prints an `error` with its own
|
|
53
|
+
* footer, which names its docs and its skill), and what's printed for it. Development's alone.
|
|
54
|
+
*/
|
|
55
|
+
const emittedInDev = (code: Code, message: string): string =>
|
|
56
|
+
UndefinedOr.match(OBSERVE, {
|
|
57
|
+
onUndefined: () => coded(code, message),
|
|
58
|
+
// Solid's codes are a closed list: a Wardic one is carried as one of its own.
|
|
59
|
+
onDefined: (observe) =>
|
|
60
|
+
printedOf(code, observe.diagnostics.emit({ code: code as unknown as DiagnosticCode, kind: "render", severity: "warn", message: coded(code, message) }, getOwner())),
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Reports `code` in development, `message` saying what happened and its fix: on Solid's channel, under
|
|
65
|
+
* the current owner, and printed. Nothing in production: under `DEV`, which Solid's production build
|
|
66
|
+
* leaves undefined, so a bundle drops it, the footer's text with it.
|
|
67
|
+
*/
|
|
68
|
+
export const report = (code: Code, message: string): void => {
|
|
69
|
+
if (DEV) console.warn(emittedInDev(code, message))
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The binding's reporter, for what core and dom report on the runtime it builds (`Diagnostic.report`):
|
|
74
|
+
* on Solid's channel and printed, as the binding's own are. Under no owner: it runs from a fiber.
|
|
75
|
+
*/
|
|
76
|
+
export const reporterLayer: Layer.Layer<never> = Layer.succeed(Diagnostic.Reporter, {
|
|
77
|
+
report: (code, message) => Effect.sync(() => report(code, message)),
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* A misuse that throws: on Solid's channel in development, as {@link report} puts one, and the error to
|
|
82
|
+
* throw, its message `code`'s line, with its owners and its code's footer the first time. In production,
|
|
83
|
+
* the line alone.
|
|
84
|
+
*/
|
|
85
|
+
export const misuse = (code: Code, message: string): Error => {
|
|
86
|
+
if (DEV) return new Error(emittedInDev(code, message))
|
|
87
|
+
return new Error(coded(code, message))
|
|
88
|
+
}
|
package/src/element-style.ts
CHANGED
|
@@ -11,13 +11,15 @@
|
|
|
11
11
|
* The gate switches it through the sink's hooks, outside its commits: `beforeFirstCommit`, and
|
|
12
12
|
* `onHeld` whenever the keys it holds change. Only a change to a key the element's own style
|
|
13
13
|
* sets re-runs `style`, so a frame never does. A ward's element that comes after the last one left
|
|
14
|
-
* the page enters fresh (#414): `restart` puts a Starting style back on until its first commit.
|
|
14
|
+
* the page enters fresh (#414): `restart` puts a Starting style back on until its first commit. Its
|
|
15
|
+
* element reads its style before that, as it's made: seen coming, it reads `entering` then, the
|
|
16
|
+
* same Starting style, and `restart` re-runs every read but that one, which has it.
|
|
15
17
|
*
|
|
16
18
|
* The user's routed keys (#130, ADR-0043: its Live values and transform keys) are never Solid's:
|
|
17
19
|
* the Starting style carries their values, and from mount the gate holds them. Each style the
|
|
18
20
|
* user gives is seen by the element's {@link LiveStyle} here, where it's read reactively.
|
|
19
21
|
*
|
|
20
|
-
* Solid-free (#209): its state is plain, and
|
|
22
|
+
* Solid-free (#209): its state is plain, and a {@link Trigger} re-runs `style`, so it reads the
|
|
21
23
|
* same under Solid 2, where a signal's read lags its write until the flush.
|
|
22
24
|
*/
|
|
23
25
|
import type * as Renderer from "@wardic/core/Renderer"
|
|
@@ -25,7 +27,9 @@ import type * as Values from "@wardic/core/Values"
|
|
|
25
27
|
import type * as FlushGate from "@wardic/dom/FlushGate"
|
|
26
28
|
import * as Style from "@wardic/dom/Style"
|
|
27
29
|
import * as Bool from "effect/Boolean"
|
|
30
|
+
import * as Equivalence from "effect/Equivalence"
|
|
28
31
|
import { constUndefined } from "effect/Function"
|
|
32
|
+
import * as Predicate from "effect/Predicate"
|
|
29
33
|
import * as Rec from "effect/Record"
|
|
30
34
|
import type * as LiveStyle from "@wardic/dom/unstable/LiveStyle"
|
|
31
35
|
import type * as Reactivity from "@wardic/core/unstable/Reactivity"
|
|
@@ -52,6 +56,13 @@ export interface ElementStyleOptions {
|
|
|
52
56
|
export interface ElementStyle {
|
|
53
57
|
/** The element's style, given the user's: reactive, read inside the element's JSX. */
|
|
54
58
|
readonly style: (user: object | string | undefined) => Style.Style
|
|
59
|
+
/**
|
|
60
|
+
* The style of an element seen coming that enters fresh (#414), read before {@link restart} has
|
|
61
|
+
* begun its entry: `starting` over the user's, whatever the gate has committed. Reactive, as
|
|
62
|
+
* `style` is. A `restart` with the same Starting style doesn't re-run what read this, which has
|
|
63
|
+
* the entry's style already; it re-runs every read made through `style`.
|
|
64
|
+
*/
|
|
65
|
+
readonly entering: (user: object | string | undefined, starting: Renderer.Patch) => Style.Style
|
|
55
66
|
/** The hooks the element's flush sink carries. */
|
|
56
67
|
readonly hooks: Required<Pick<FlushGate.Sink, "beforeFirstCommit" | "onHeld">>
|
|
57
68
|
/**
|
|
@@ -59,8 +70,16 @@ export interface ElementStyle {
|
|
|
59
70
|
* element entering fresh (#414), its sink registered after this call.
|
|
60
71
|
*/
|
|
61
72
|
readonly restart: (starting: Renderer.Patch) => void
|
|
73
|
+
/**
|
|
74
|
+
* An element mounted that doesn't enter fresh: what took it for one that does, reading through
|
|
75
|
+
* {@link entering}, is run again. Nothing otherwise.
|
|
76
|
+
*/
|
|
77
|
+
readonly notFresh: () => void
|
|
62
78
|
}
|
|
63
79
|
|
|
80
|
+
/** Whether two Starting styles draw the same: key by key. */
|
|
81
|
+
const sameStarting: Equivalence.Equivalence<Renderer.Patch> = Rec.makeEquivalence(Equivalence.strictEqual<unknown>())
|
|
82
|
+
|
|
64
83
|
/** An element's `style`, switched by its flush sink's hooks. Call within a Solid owner. */
|
|
65
84
|
export const createElementStyle = (options: ElementStyleOptions): ElementStyle => {
|
|
66
85
|
const { userStyle, startingWith, live, defaults, base = constUndefined, reactivity } = options
|
|
@@ -73,40 +92,89 @@ export const createElementStyle = (options: ElementStyleOptions): ElementStyle =
|
|
|
73
92
|
// element's own style re-runs it; any other change waits for the next run.
|
|
74
93
|
let held: ReadonlyArray<string> = []
|
|
75
94
|
const changed = reactivity.trigger()
|
|
95
|
+
// What re-runs a read made through `entering` (#414): an element's, seen coming and given its
|
|
96
|
+
// entry's Starting style before `restart` began it. Its own trigger, apart from `changed`, so a
|
|
97
|
+
// restart to the style those reads were given re-runs every other read and none of them. Made at
|
|
98
|
+
// the first such read: most elements are the only one their ward is ever on, and have none.
|
|
99
|
+
let entered: Reactivity.Trigger | undefined
|
|
100
|
+
// The Starting style those reads were given since the last restart, and whether each was given
|
|
101
|
+
// the same one.
|
|
102
|
+
let expected: Renderer.Patch | undefined
|
|
103
|
+
let agreed = true
|
|
104
|
+
const trackEntered = (): void => {
|
|
105
|
+
if (Predicate.isUndefined(entered)) entered = reactivity.trigger()
|
|
106
|
+
entered.track()
|
|
107
|
+
}
|
|
108
|
+
/** Re-runs every read of the style, however it was made. */
|
|
109
|
+
const tellAll = (): void => {
|
|
110
|
+
expected = undefined
|
|
111
|
+
agreed = true
|
|
112
|
+
changed.notify()
|
|
113
|
+
if (Predicate.isNotUndefined(entered)) entered.notify()
|
|
114
|
+
}
|
|
76
115
|
|
|
77
|
-
//
|
|
78
|
-
const startingNow = (): Renderer.Patch => {
|
|
116
|
+
// `from` as the Starting style, with the routed keys' values now: read before the first commit only.
|
|
117
|
+
const startingNow = (from: Renderer.Patch): Renderer.Patch => {
|
|
79
118
|
const routed = live.values()
|
|
80
|
-
return Bool.match(Rec.isEmptyRecord(routed), { onTrue: () =>
|
|
119
|
+
return Bool.match(Rec.isEmptyRecord(routed), { onTrue: () => from, onFalse: () => startingWith(routed) })
|
|
81
120
|
}
|
|
121
|
+
// The style until the first commit: the Starting style on top of the user's.
|
|
122
|
+
const uncommitted = (from: Renderer.Patch, css: object | string | undefined): Style.Style =>
|
|
123
|
+
Style.over(Style.over(Style.over(startingNow(from), css), base()), defaults)
|
|
82
124
|
|
|
83
125
|
const style = (user: object | string | undefined): Style.Style => {
|
|
84
126
|
changed.track()
|
|
85
127
|
const css = live.css(user)
|
|
86
128
|
return Bool.match(committed, {
|
|
87
|
-
onFalse: () =>
|
|
129
|
+
onFalse: () => uncommitted(starting, css),
|
|
88
130
|
onTrue: () => Style.without(Style.over(Style.over(css, base()), defaults), held),
|
|
89
131
|
})
|
|
90
132
|
}
|
|
91
133
|
|
|
134
|
+
/** Whether every read through `entering` since the last restart was given `next`. */
|
|
135
|
+
const allGiven = (next: Renderer.Patch): boolean => {
|
|
136
|
+
if (Predicate.isUndefined(expected)) return false
|
|
137
|
+
return Bool.and(agreed, sameStarting(expected, next))
|
|
138
|
+
}
|
|
139
|
+
const entering = (user: object | string | undefined, next: Renderer.Patch): Style.Style => {
|
|
140
|
+
trackEntered()
|
|
141
|
+
// One given another Starting style than the last was: the restart re-runs them all.
|
|
142
|
+
if (Predicate.isNotUndefined(expected)) agreed = allGiven(next)
|
|
143
|
+
expected = next
|
|
144
|
+
return uncommitted(next, live.css(user))
|
|
145
|
+
}
|
|
146
|
+
|
|
92
147
|
const onHeld = (next: ReadonlyArray<string>): void => {
|
|
93
148
|
const prev = held
|
|
94
149
|
held = next
|
|
95
150
|
if (!committed) return
|
|
96
151
|
const style = Style.over(Style.over(live.css(untrack(userStyle)), untrack(base)), defaults)
|
|
97
|
-
if (Style.heldTouches(style, prev, next))
|
|
152
|
+
if (Style.heldTouches(style, prev, next)) tellAll()
|
|
98
153
|
}
|
|
99
154
|
|
|
100
155
|
const beforeFirstCommit = (): void => {
|
|
101
156
|
committed = true
|
|
157
|
+
tellAll()
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Re-runs every read made through `style`: one made through `entering` keeps what it was given. */
|
|
161
|
+
const tellOthers = (): void => {
|
|
162
|
+
expected = undefined
|
|
102
163
|
changed.notify()
|
|
103
164
|
}
|
|
104
165
|
|
|
105
166
|
const restart = (next: Renderer.Patch): void => {
|
|
167
|
+
// What was given this Starting style as it was made has it: every other read is told, as ever.
|
|
168
|
+
const given = allGiven(next)
|
|
106
169
|
starting = next
|
|
107
170
|
committed = false
|
|
108
|
-
|
|
171
|
+
Bool.match(given, { onTrue: tellOthers, onFalse: tellAll })
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const notFresh = (): void => {
|
|
175
|
+
if (Predicate.isUndefined(expected)) return
|
|
176
|
+
tellAll()
|
|
109
177
|
}
|
|
110
178
|
|
|
111
|
-
return { style, hooks: { beforeFirstCommit, onHeld }, restart }
|
|
179
|
+
return { style, entering, hooks: { beforeFirstCommit, onHeld }, restart, notFresh }
|
|
112
180
|
}
|
package/src/element.tsx
CHANGED
|
@@ -29,6 +29,7 @@ import { identity } from "effect/Function"
|
|
|
29
29
|
import * as UndefinedOr from "effect/UndefinedOr"
|
|
30
30
|
import { type ComponentProps, dynamic, isServer, type JSX, type ValidComponent } from "@solidjs/web"
|
|
31
31
|
import { $PROXY, children, type Component, createEffect, createMemo, createRoot, DEV, omit, runWithOwner, untrack } from "solid-js"
|
|
32
|
+
import { misuse } from "./diagnostics.ts"
|
|
32
33
|
import { unforwardedRefFix, unforwardedRefLine } from "./messages.ts"
|
|
33
34
|
import { MOTION_PROPS_V2 as MOTION_PROPS, type WardicMotionPropsV2 as WardicMotionProps } from "./motion-props.ts"
|
|
34
35
|
import * as VariantTree from "@wardic/core/unstable/VariantTree"
|
|
@@ -94,9 +95,10 @@ export type WardicBeside<C, P = WardicMotionProps> = {
|
|
|
94
95
|
|
|
95
96
|
/**
|
|
96
97
|
* A ward given to `wardRef`, its config's type `C` carried with no call signature, so a
|
|
97
|
-
* callback's `(card) => …` keeps its contextual type.
|
|
98
|
+
* callback's `(card) => …` keeps its contextual type. One `ward(config)` made: a hooks ward, which
|
|
99
|
+
* carries `exiting`, is spread instead (probe: behaviour-runes, the wardRef gap's B).
|
|
98
100
|
*/
|
|
99
|
-
export type GivenWard<C> = AnyWard & { readonly read: WardRead<C
|
|
101
|
+
export type GivenWard<C> = AnyWard & { readonly read: WardRead<C>; readonly exiting?: never }
|
|
100
102
|
|
|
101
103
|
/**
|
|
102
104
|
* A Wardic component's motion: its motion props, with `wardRef` handing its own ward out
|
|
@@ -214,17 +216,18 @@ export const besideOf = (name: string, props: object, share: WardShare, keys: Re
|
|
|
214
216
|
if (beside.length === 0) return beside
|
|
215
217
|
const twice = setKeysOf(share.config, beside)
|
|
216
218
|
if (twice.length > 0) {
|
|
217
|
-
throw
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
throw misuse(
|
|
220
|
+
"WARDIC_WARDREF_CONFLICT",
|
|
221
|
+
`${name}: ${listOf(twice)} set both in the ward given to wardRef and on the element. ` + "Set each key in one place: in ward({ … }), or on the element.",
|
|
220
222
|
)
|
|
221
223
|
}
|
|
222
224
|
if (share.carries) {
|
|
223
225
|
const carried = Arr.filter(beside, (key) => NODE_KEYS.has(key))
|
|
224
226
|
if (carried.length > 0) {
|
|
225
|
-
throw
|
|
227
|
+
throw misuse(
|
|
228
|
+
"WARDIC_WARDREF_CONFLICT",
|
|
226
229
|
`${name}: the ward given to wardRef carries its variants (\`variants\` or \`inherit\` in its ward({ … })), so ${listOf(carried)} ` +
|
|
227
|
-
"go there too: its variant node, made where the ward is made, reads them
|
|
230
|
+
"go there too: its variant node, made where the ward is made, reads them. Or leave the variants to the element: " +
|
|
228
231
|
"a ward with neither only listens, and its element's props set its motion.",
|
|
229
232
|
)
|
|
230
233
|
}
|
|
@@ -260,8 +263,9 @@ const checkParent = (name: string, share: WardShare): void => {
|
|
|
260
263
|
const here = useVariantContext()
|
|
261
264
|
if (Bool.or(here === share.parent, Predicate.isUndefined(here))) return
|
|
262
265
|
if (Bool.not(VariantTree.isVariantChild(share.setup))) return
|
|
263
|
-
throw
|
|
264
|
-
|
|
266
|
+
throw misuse(
|
|
267
|
+
"WARDIC_WARDREF_CONFLICT",
|
|
268
|
+
`${name}: the ward in wardRef was made outside its element's variant parent, so it wouldn't inherit from it. ` +
|
|
265
269
|
"Make it with ward(config, { parent }), naming the ward whose element it renders in, or give it `inherit: false` to stand alone.",
|
|
266
270
|
)
|
|
267
271
|
}
|
|
@@ -272,6 +276,22 @@ export interface Driven {
|
|
|
272
276
|
readonly setup: WardConfigValues
|
|
273
277
|
}
|
|
274
278
|
|
|
279
|
+
/**
|
|
280
|
+
* Whether `given`, a ward given to `wardRef`, is one the hooks made (`createWard`): they tell themselves
|
|
281
|
+
* of each element their wards are handed (`handed`), and nothing else sets it. On a server too.
|
|
282
|
+
*/
|
|
283
|
+
const madeByTheHooks = (given: WardShare): boolean => Predicate.isNotUndefined(given.internal.handed)
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* What a component says of a hooks ward given to its `wardRef` to drive (probe: behaviour-runes, the
|
|
287
|
+
* owner's B): it's refused. Driven, its runes' `ref`s never ran, their `props` never reached the element,
|
|
288
|
+
* and its reads of its element (`focusing()`) never told anything, as only the component's own ward
|
|
289
|
+
* knew the element. Spread, a hooks ward has them all.
|
|
290
|
+
*/
|
|
291
|
+
const hookWardGiven = (name: string): string =>
|
|
292
|
+
`${name}: a ward createWard made isn't given to wardRef to drive. Spread it on the element, \`{...ward}\`, or on a ` +
|
|
293
|
+
"component that forwards its ref. wardRef takes a ward made with ward(config), or a function handed the component's own ward."
|
|
294
|
+
|
|
275
295
|
/**
|
|
276
296
|
* The ward a component drives its element with, for a ward given to `wardRef` (#349): one of its
|
|
277
297
|
* own, on the given ward's config, variant node and lifecycle, under the component's presence, with
|
|
@@ -282,9 +302,11 @@ export interface Driven {
|
|
|
282
302
|
export const drivenWard = (name: string, props: object, share: WardShare, internal: WardInternals, keys: ReadonlyArray<string>): Driven => {
|
|
283
303
|
const beside = besideOf(name, props, share, keys)
|
|
284
304
|
checkParent(name, share)
|
|
305
|
+
// What's fixed over the given ward's config as it is now: what was fixed since it was made too.
|
|
306
|
+
const under = share.fixed()
|
|
285
307
|
// Plain checks: a match's objects would cost every given ward's element (#349).
|
|
286
|
-
if (beside.length === 0) return { ward: wardWith(share.config, { ...share.internal, ...internal, name, share }), setup: share.setup }
|
|
287
|
-
const fixed = fixedOf(props, beside,
|
|
308
|
+
if (beside.length === 0) return { ward: wardWith(share.config, { ...share.internal, ...internal, name, share, fixed: under }), setup: share.setup }
|
|
309
|
+
const fixed = fixedOf(props, beside, under) as WardInternals["fixed"]
|
|
288
310
|
return { ward: wardWith(share.config, { ...share.internal, ...internal, name, share, fixed }), setup: setupWith(share.setup, props, beside) }
|
|
289
311
|
}
|
|
290
312
|
|
|
@@ -464,6 +486,7 @@ const tagComponent = (tag: string, routing: string | undefined, forward: boolean
|
|
|
464
486
|
const wardRef = untrack(() => own.wardRef)
|
|
465
487
|
const given = shareOf(wardRef)
|
|
466
488
|
if (Predicate.isNotUndefined(given)) {
|
|
489
|
+
if (madeByTheHooks(given)) throw misuse("WARDIC_HOOK_WARD_IN_WARDREF", hookWardGiven(name))
|
|
467
490
|
const { ward: driving, setup } = drivenWard(name, own, given, { ...kind, tag: routing }, MOTION_PROPS)
|
|
468
491
|
return withProvider(driving, setup, () => <Element {...rest} {...driving.with({ style: own.style })} ref={refsOf(own, [driving])} />)
|
|
469
492
|
}
|
|
@@ -513,7 +536,7 @@ const wrapComponent = (Wrapped: Component<Record<string, unknown>>, routing: str
|
|
|
513
536
|
(elements) => {
|
|
514
537
|
if (Arr.isArrayEmpty(elements)) return
|
|
515
538
|
if (Arr.some(elements, (inside) => Predicate.isNotUndefined(reached) && inside.contains(reached))) return
|
|
516
|
-
throw
|
|
539
|
+
throw misuse("WARDIC_REF_NOT_FORWARDED", unforwardedRefMessage(name))
|
|
517
540
|
},
|
|
518
541
|
CLIENT_ONLY,
|
|
519
542
|
)
|
|
@@ -523,6 +546,7 @@ const wrapComponent = (Wrapped: Component<Record<string, unknown>>, routing: str
|
|
|
523
546
|
const wardRef = untrack(() => own.wardRef)
|
|
524
547
|
const given = shareOf(wardRef)
|
|
525
548
|
if (Predicate.isNotUndefined(given)) {
|
|
549
|
+
if (madeByTheHooks(given)) throw misuse("WARDIC_HOOK_WARD_IN_WARDREF", hookWardGiven(name))
|
|
526
550
|
const { ward: driving, setup } = drivenWard(name, own, given, { ...kind, defaultsOnElement: true, tag: routing }, MOTION_PROPS)
|
|
527
551
|
return withProvider(driving, setup, () => checked(() => <Element {...rest} {...driving.with({ style: own.style })} ref={refsOf(own, [driving, seen])} />))
|
|
528
552
|
}
|
package/src/feature-section.ts
CHANGED
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A section's **Features** (#511, ADR-0067), for the Solid 2 binding:
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* A section's **Features** (#511, ADR-0067), for the Solid 2 binding: a provider's own section (dom's
|
|
3
|
+
* `Feature.makeSection`), kept by the provider (`provider.tsx`). `<LazyWardic>`'s sections, a context of
|
|
4
|
+
* their own here, were deleted with it (probe: behaviour-runes, after the scopes round); Solid 1's stay
|
|
5
|
+
* (`../../feature-section.ts`).
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
import { isServer } from "@solidjs/web"
|
|
10
10
|
import type * as Cause from "effect/Cause"
|
|
11
|
-
import {
|
|
12
|
-
import * as Option from "effect/Option"
|
|
11
|
+
import { getOwner, onCleanup } from "solid-js"
|
|
13
12
|
import * as Feature from "@wardic/dom/unstable/Feature"
|
|
14
13
|
import { reactivityIn } from "./solid-reactivity.ts"
|
|
15
14
|
|
|
16
|
-
/**
|
|
17
|
-
* A `LazyWardic`'s section, a provider of its own. `null` under none: Solid 2 takes an `undefined`
|
|
18
|
-
* default for none, and its `useContext` then throws outside a provider.
|
|
19
|
-
*/
|
|
20
|
-
export const FeatureSectionContext = createContext<Feature.FeatureSection | null>(null)
|
|
21
|
-
|
|
22
|
-
/** The nearest `LazyWardic`'s section, or `undefined` under none: its provider's then. */
|
|
23
|
-
export const useLazySection = (): Feature.FeatureSection | undefined => Option.getOrUndefined(Option.fromNullishOr(useContext(FeatureSectionContext)))
|
|
24
|
-
|
|
25
15
|
/** A section under `parent`, made under the current owner (`makeSection`). */
|
|
26
16
|
export const sectionUnder = (
|
|
27
17
|
parent: Feature.FeatureSection,
|
package/src/frame-effect.tsx
CHANGED
|
@@ -53,7 +53,7 @@ const slotOf = (runtime: WardicRuntime): Slot => {
|
|
|
53
53
|
const known = SLOTS.get(runtime)
|
|
54
54
|
if (Predicate.isNotUndefined(known)) return known
|
|
55
55
|
const scope = OwnerScope.open(runtime)
|
|
56
|
-
const report = (defect: unknown): void => void runtime.runFork(Report.
|
|
56
|
+
const report = (defect: unknown): void => void runtime.runFork(Report.callbackFailed("wardic.createFrameEffect: an apply failed", Cause.die(defect)))
|
|
57
57
|
const effects = runtime.runSync(FrameEffects.onFrameLoop(report).pipe(Scope.provide(scope)))
|
|
58
58
|
const made: Slot = { effects, scope, live: 0 }
|
|
59
59
|
SLOTS.set(runtime, made)
|
package/src/gesture-callbacks.ts
CHANGED
|
@@ -38,7 +38,7 @@ export const gestureCallbacksOf = (runtime: WardicRuntime, id: string, config: (
|
|
|
38
38
|
config,
|
|
39
39
|
invoke: (handler, args) => (handler as Called)(...args),
|
|
40
40
|
report: (name, defect) => {
|
|
41
|
-
runtime.runFork(Report.
|
|
41
|
+
runtime.runFork(Report.callbackFailed(`wardic.gesture: ${name} failed`, Cause.die(defect)).pipe(Effect.annotateLogs({ id })))
|
|
42
42
|
},
|
|
43
43
|
// `onDragEnd` and `onPanEnd` told how each ended (#1042).
|
|
44
44
|
tellsEndedBy: true,
|