@wardic/solid 1.0.1 → 1.1.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 +5 -2
- package/dist/browser/animation-controls.js +3 -149
- package/dist/browser/animation-controls.js.map +1 -1
- package/dist/browser/appear.js +3 -743
- package/dist/browser/appear.js.map +1 -1
- package/dist/browser/batch-gestures.js.map +1 -1
- package/dist/browser/batch-reorder-group.js +40 -11
- package/dist/browser/batch-reorder-group.js.map +1 -1
- package/dist/browser/batch-reorder-places.js +517 -50
- package/dist/browser/batch-reorder-places.js.map +1 -1
- package/dist/browser/batch-reorder.js +284 -42
- package/dist/browser/batch-reorder.js.map +1 -1
- package/dist/browser/batch.js +3 -2511
- package/dist/browser/batch.js.map +1 -1
- package/dist/browser/config.js +11 -1
- package/dist/browser/config.js.map +1 -1
- package/dist/browser/create-animate.js +4 -2
- package/dist/browser/create-animate.js.map +1 -1
- package/dist/browser/create-batch.js +2 -2
- package/dist/browser/create-batch.js.map +1 -1
- package/dist/browser/create-ward.js +54 -13
- package/dist/browser/create-ward.js.map +1 -1
- package/dist/browser/create-wardic.js +44 -0
- package/dist/browser/create-wardic.js.map +1 -0
- package/dist/browser/drag-constraints.js +3 -75
- package/dist/browser/drag-constraints.js.map +1 -1
- package/dist/browser/drag-controls.js +3 -50
- package/dist/browser/drag-controls.js.map +1 -1
- package/dist/browser/drag-defaults.js +4 -0
- package/dist/browser/drag-defaults.js.map +1 -0
- package/dist/browser/drag-track.js +3 -826
- package/dist/browser/drag-track.js.map +1 -1
- package/dist/browser/drag-transition.js +3 -55
- package/dist/browser/drag-transition.js.map +1 -1
- package/dist/browser/element-setup.js +4 -0
- package/dist/browser/element-setup.js.map +1 -0
- package/dist/browser/element.js +12 -3
- package/dist/browser/element.js.map +1 -1
- package/dist/browser/feature.js +3 -270
- package/dist/browser/feature.js.map +1 -1
- package/dist/browser/features/all.js +3 -9
- package/dist/browser/features/all.js.map +1 -1
- package/dist/browser/features/colors.js +3 -32
- package/dist/browser/features/colors.js.map +1 -1
- package/dist/browser/features/dom-animation.js +3 -6
- package/dist/browser/features/dom-animation.js.map +1 -1
- package/dist/browser/features/dom-max.js +3 -3
- package/dist/browser/features/dom-max.js.map +1 -1
- package/dist/browser/features/drag.js +3 -27
- package/dist/browser/features/drag.js.map +1 -1
- package/dist/browser/features/focus.js +3 -17
- package/dist/browser/features/focus.js.map +1 -1
- package/dist/browser/features/hover.js +3 -17
- package/dist/browser/features/hover.js.map +1 -1
- package/dist/browser/features/in-view.js +3 -17
- package/dist/browser/features/in-view.js.map +1 -1
- package/dist/browser/features/input.js +3 -26
- package/dist/browser/features/input.js.map +1 -1
- package/dist/browser/features/keys.js +3 -18
- package/dist/browser/features/keys.js.map +1 -1
- package/dist/browser/features/layout.js +3 -32
- package/dist/browser/features/layout.js.map +1 -1
- package/dist/browser/features/pan.js +3 -17
- package/dist/browser/features/pan.js.map +1 -1
- package/dist/browser/features/press.js +3 -11
- package/dist/browser/features/press.js.map +1 -1
- package/dist/browser/features/scroll.js +3 -20
- package/dist/browser/features/scroll.js.map +1 -1
- package/dist/browser/gesture-features.js +3 -28
- package/dist/browser/gesture-features.js.map +1 -1
- package/dist/browser/gesture-info.js +3 -42
- package/dist/browser/gesture-info.js.map +1 -1
- package/dist/browser/imperative.js +3 -708
- package/dist/browser/imperative.js.map +1 -1
- package/dist/browser/index.js +2 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/instance-features.js +66 -0
- package/dist/browser/instance-features.js.map +1 -0
- package/dist/browser/instant.js +3 -50
- package/dist/browser/instant.js.map +1 -1
- package/dist/browser/layout-group.js +3 -26
- package/dist/browser/layout-group.js.map +1 -1
- package/dist/browser/layout-member.js +3 -373
- package/dist/browser/layout-member.js.map +1 -1
- package/dist/browser/layout-projection.js +8 -1
- package/dist/browser/layout-projection.js.map +1 -1
- package/dist/browser/layout.js +5 -6
- package/dist/browser/layout.js.map +1 -1
- package/dist/browser/lazy-batch-gestures.js.map +1 -1
- package/dist/browser/live-scroll.js +29 -21
- package/dist/browser/live-scroll.js.map +1 -1
- package/dist/browser/live-style.js +3 -313
- package/dist/browser/live-style.js.map +1 -1
- package/dist/browser/live-value.js +11 -2
- package/dist/browser/live-value.js.map +1 -1
- package/dist/browser/member-hold.js +3 -180
- package/dist/browser/member-hold.js.map +1 -1
- package/dist/browser/messages.js +20 -0
- package/dist/browser/messages.js.map +1 -0
- package/dist/browser/owner-scope.js +3 -28
- package/dist/browser/owner-scope.js.map +1 -1
- package/dist/browser/presence-controller.js +3 -1449
- package/dist/browser/presence-controller.js.map +1 -1
- package/dist/browser/presence-record.js +9 -24
- package/dist/browser/presence-record.js.map +1 -1
- package/dist/browser/presence.js.map +1 -1
- package/dist/browser/press.js +3 -23
- package/dist/browser/press.js.map +1 -1
- package/dist/browser/provider.js +65 -11
- package/dist/browser/provider.js.map +1 -1
- package/dist/browser/reactivity.js +0 -7
- package/dist/browser/reactivity.js.map +1 -1
- package/dist/browser/reorder.js.map +1 -1
- package/dist/browser/retarget-legs.js +3 -1021
- package/dist/browser/retarget-legs.js.map +1 -1
- package/dist/browser/runtime.js +62 -21
- package/dist/browser/runtime.js.map +1 -1
- package/dist/browser/scroll-values.js +46 -0
- package/dist/browser/scroll-values.js.map +1 -0
- package/dist/browser/server-interpolators.js +3 -19
- package/dist/browser/server-interpolators.js.map +1 -1
- package/dist/browser/spans-check.js +25 -0
- package/dist/browser/spans-check.js.map +1 -0
- package/dist/browser/spine.js +3 -3043
- package/dist/browser/spine.js.map +1 -1
- package/dist/browser/timelines.js +4 -0
- package/dist/browser/timelines.js.map +1 -0
- package/dist/browser/unstable/v2/batch-reorder-group.js +36 -6
- package/dist/browser/unstable/v2/batch-reorder-group.js.map +1 -1
- package/dist/browser/unstable/v2/create-animate.js +4 -2
- package/dist/browser/unstable/v2/create-animate.js.map +1 -1
- package/dist/browser/unstable/v2/create-batch.js +2 -2
- package/dist/browser/unstable/v2/create-batch.js.map +1 -1
- package/dist/browser/unstable/v2/create-wardic.js +45 -0
- package/dist/browser/unstable/v2/create-wardic.js.map +1 -0
- package/dist/browser/unstable/v2/element.js +12 -2
- package/dist/browser/unstable/v2/element.js.map +1 -1
- package/dist/browser/unstable/v2/index.js +1 -0
- package/dist/browser/unstable/v2/index.js.map +1 -1
- package/dist/browser/unstable/v2/lifecycle.js +2 -0
- package/dist/browser/unstable/v2/lifecycle.js.map +1 -1
- package/dist/browser/unstable/v2/live-scroll.js +22 -13
- package/dist/browser/unstable/v2/live-scroll.js.map +1 -1
- package/dist/browser/unstable/v2/live-value.js +9 -1
- package/dist/browser/unstable/v2/live-value.js.map +1 -1
- package/dist/browser/unstable/v2/presence.js.map +1 -1
- package/dist/browser/unstable/v2/provider.js +68 -13
- package/dist/browser/unstable/v2/provider.js.map +1 -1
- package/dist/browser/unstable/v2/reorder.js.map +1 -1
- package/dist/browser/unstable/v2/w.js +7 -8
- package/dist/browser/unstable/v2/w.js.map +1 -1
- package/dist/browser/unstable/v2/ward.js +45 -12
- package/dist/browser/unstable/v2/ward.js.map +1 -1
- package/dist/browser/unstable/v2/wardic-instance.js +2 -0
- package/dist/browser/unstable/v2/wardic-instance.js.map +1 -0
- package/dist/browser/variant-target.js +3 -228
- package/dist/browser/variant-target.js.map +1 -1
- package/dist/browser/variant-tree.js +3 -393
- package/dist/browser/variant-tree.js.map +1 -1
- package/dist/browser/w.js +8 -9
- package/dist/browser/w.js.map +1 -1
- package/dist/browser/wardic-config-value.js +3 -90
- package/dist/browser/wardic-config-value.js.map +1 -1
- package/dist/browser/wardic-instance.js +2 -0
- package/dist/browser/wardic-instance.js.map +1 -0
- package/dist/server/animation-controls.js +3 -149
- package/dist/server/animation-controls.js.map +1 -1
- package/dist/server/appear.js +3 -743
- package/dist/server/appear.js.map +1 -1
- package/dist/server/batch-gestures.js.map +1 -1
- package/dist/server/batch-reorder-group.js +40 -11
- package/dist/server/batch-reorder-group.js.map +1 -1
- package/dist/server/batch-reorder-places.js +517 -50
- package/dist/server/batch-reorder-places.js.map +1 -1
- package/dist/server/batch-reorder.js +284 -42
- package/dist/server/batch-reorder.js.map +1 -1
- package/dist/server/batch.js +3 -2511
- package/dist/server/batch.js.map +1 -1
- package/dist/server/config.js +11 -1
- package/dist/server/config.js.map +1 -1
- package/dist/server/create-animate.js +4 -2
- package/dist/server/create-animate.js.map +1 -1
- package/dist/server/create-batch.js +2 -2
- package/dist/server/create-batch.js.map +1 -1
- package/dist/server/create-ward.js +54 -13
- package/dist/server/create-ward.js.map +1 -1
- package/dist/server/create-wardic.js +44 -0
- package/dist/server/create-wardic.js.map +1 -0
- package/dist/server/drag-constraints.js +3 -75
- package/dist/server/drag-constraints.js.map +1 -1
- package/dist/server/drag-controls.js +3 -50
- package/dist/server/drag-controls.js.map +1 -1
- package/dist/server/drag-defaults.js +4 -0
- package/dist/server/drag-defaults.js.map +1 -0
- package/dist/server/drag-track.js +3 -826
- package/dist/server/drag-track.js.map +1 -1
- package/dist/server/drag-transition.js +3 -55
- package/dist/server/drag-transition.js.map +1 -1
- package/dist/server/element-setup.js +4 -0
- package/dist/server/element-setup.js.map +1 -0
- package/dist/server/element.js +12 -3
- package/dist/server/element.js.map +1 -1
- package/dist/server/feature.js +3 -270
- package/dist/server/feature.js.map +1 -1
- package/dist/server/features/all.js +3 -9
- package/dist/server/features/all.js.map +1 -1
- package/dist/server/features/colors.js +3 -32
- package/dist/server/features/colors.js.map +1 -1
- package/dist/server/features/dom-animation.js +3 -6
- package/dist/server/features/dom-animation.js.map +1 -1
- package/dist/server/features/dom-max.js +3 -3
- package/dist/server/features/dom-max.js.map +1 -1
- package/dist/server/features/drag.js +3 -27
- package/dist/server/features/drag.js.map +1 -1
- package/dist/server/features/focus.js +3 -17
- package/dist/server/features/focus.js.map +1 -1
- package/dist/server/features/hover.js +3 -17
- package/dist/server/features/hover.js.map +1 -1
- package/dist/server/features/in-view.js +3 -17
- package/dist/server/features/in-view.js.map +1 -1
- package/dist/server/features/input.js +3 -26
- package/dist/server/features/input.js.map +1 -1
- package/dist/server/features/keys.js +3 -18
- package/dist/server/features/keys.js.map +1 -1
- package/dist/server/features/layout.js +3 -32
- package/dist/server/features/layout.js.map +1 -1
- package/dist/server/features/pan.js +3 -17
- package/dist/server/features/pan.js.map +1 -1
- package/dist/server/features/press.js +3 -11
- package/dist/server/features/press.js.map +1 -1
- package/dist/server/features/scroll.js +3 -20
- package/dist/server/features/scroll.js.map +1 -1
- package/dist/server/gesture-features.js +3 -28
- package/dist/server/gesture-features.js.map +1 -1
- package/dist/server/gesture-info.js +3 -42
- package/dist/server/gesture-info.js.map +1 -1
- package/dist/server/imperative.js +3 -708
- package/dist/server/imperative.js.map +1 -1
- package/dist/server/index.js +2 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/instance-features.js +66 -0
- package/dist/server/instance-features.js.map +1 -0
- package/dist/server/instant.js +3 -50
- package/dist/server/instant.js.map +1 -1
- package/dist/server/layout-group.js +3 -26
- package/dist/server/layout-group.js.map +1 -1
- package/dist/server/layout-member.js +3 -373
- package/dist/server/layout-member.js.map +1 -1
- package/dist/server/layout-projection.js +8 -1
- package/dist/server/layout-projection.js.map +1 -1
- package/dist/server/layout.js +5 -6
- package/dist/server/layout.js.map +1 -1
- package/dist/server/lazy-batch-gestures.js.map +1 -1
- package/dist/server/live-scroll.js +29 -21
- package/dist/server/live-scroll.js.map +1 -1
- package/dist/server/live-style.js +3 -313
- package/dist/server/live-style.js.map +1 -1
- package/dist/server/live-value.js +11 -2
- package/dist/server/live-value.js.map +1 -1
- package/dist/server/member-hold.js +3 -180
- package/dist/server/member-hold.js.map +1 -1
- package/dist/server/messages.js +20 -0
- package/dist/server/messages.js.map +1 -0
- package/dist/server/owner-scope.js +3 -28
- package/dist/server/owner-scope.js.map +1 -1
- package/dist/server/presence-controller.js +3 -1449
- package/dist/server/presence-controller.js.map +1 -1
- package/dist/server/presence-record.js +9 -24
- package/dist/server/presence-record.js.map +1 -1
- package/dist/server/presence.js.map +1 -1
- package/dist/server/press.js +3 -23
- package/dist/server/press.js.map +1 -1
- package/dist/server/provider.js +65 -11
- package/dist/server/provider.js.map +1 -1
- package/dist/server/reactivity.js +0 -7
- package/dist/server/reactivity.js.map +1 -1
- package/dist/server/reorder.js.map +1 -1
- package/dist/server/retarget-legs.js +3 -1021
- package/dist/server/retarget-legs.js.map +1 -1
- package/dist/server/runtime.js +62 -21
- package/dist/server/runtime.js.map +1 -1
- package/dist/server/scroll-values.js +46 -0
- package/dist/server/scroll-values.js.map +1 -0
- package/dist/server/server-interpolators.js +3 -19
- package/dist/server/server-interpolators.js.map +1 -1
- package/dist/server/spans-check.js +25 -0
- package/dist/server/spans-check.js.map +1 -0
- package/dist/server/spine.js +3 -3043
- package/dist/server/spine.js.map +1 -1
- package/dist/server/timelines.js +4 -0
- package/dist/server/timelines.js.map +1 -0
- package/dist/server/unstable/v2/batch-reorder-group.js +36 -6
- package/dist/server/unstable/v2/batch-reorder-group.js.map +1 -1
- package/dist/server/unstable/v2/create-animate.js +4 -2
- package/dist/server/unstable/v2/create-animate.js.map +1 -1
- package/dist/server/unstable/v2/create-batch.js +2 -2
- package/dist/server/unstable/v2/create-batch.js.map +1 -1
- package/dist/server/unstable/v2/create-wardic.js +45 -0
- package/dist/server/unstable/v2/create-wardic.js.map +1 -0
- package/dist/server/unstable/v2/element.js +12 -2
- package/dist/server/unstable/v2/element.js.map +1 -1
- package/dist/server/unstable/v2/index.js +1 -0
- package/dist/server/unstable/v2/index.js.map +1 -1
- package/dist/server/unstable/v2/lifecycle.js +2 -0
- package/dist/server/unstable/v2/lifecycle.js.map +1 -1
- package/dist/server/unstable/v2/live-scroll.js +22 -13
- package/dist/server/unstable/v2/live-scroll.js.map +1 -1
- package/dist/server/unstable/v2/live-value.js +9 -1
- package/dist/server/unstable/v2/live-value.js.map +1 -1
- package/dist/server/unstable/v2/presence.js.map +1 -1
- package/dist/server/unstable/v2/provider.js +68 -13
- package/dist/server/unstable/v2/provider.js.map +1 -1
- package/dist/server/unstable/v2/reorder.js.map +1 -1
- package/dist/server/unstable/v2/w.js +7 -8
- package/dist/server/unstable/v2/w.js.map +1 -1
- package/dist/server/unstable/v2/ward.js +45 -12
- package/dist/server/unstable/v2/ward.js.map +1 -1
- package/dist/server/unstable/v2/wardic-instance.js +2 -0
- package/dist/server/unstable/v2/wardic-instance.js.map +1 -0
- package/dist/server/variant-target.js +3 -228
- package/dist/server/variant-target.js.map +1 -1
- package/dist/server/variant-tree.js +3 -393
- package/dist/server/variant-tree.js.map +1 -1
- package/dist/server/w.js +8 -9
- package/dist/server/w.js.map +1 -1
- package/dist/server/wardic-config-value.js +3 -90
- package/dist/server/wardic-config-value.js.map +1 -1
- package/dist/server/wardic-instance.js +2 -0
- package/dist/server/wardic-instance.js.map +1 -0
- package/dist/solid/animation-controls.d.ts +1 -102
- package/dist/solid/animation-controls.d.ts.map +1 -1
- package/dist/solid/animation-controls.js +3 -128
- package/dist/solid/animation-controls.js.map +1 -1
- package/dist/solid/appear.d.ts +1 -218
- package/dist/solid/appear.d.ts.map +1 -1
- package/dist/solid/appear.js +3 -529
- package/dist/solid/appear.js.map +1 -1
- package/dist/solid/batch-gestures.d.ts +2 -2
- package/dist/solid/batch-gestures.d.ts.map +1 -1
- package/dist/solid/batch-gestures.js.map +1 -1
- package/dist/solid/batch-reorder-group.d.ts +17 -15
- package/dist/solid/batch-reorder-group.d.ts.map +1 -1
- package/dist/solid/batch-reorder-group.jsx +37 -7
- package/dist/solid/batch-reorder-group.jsx.map +1 -1
- package/dist/solid/batch-reorder-places.d.ts +184 -23
- package/dist/solid/batch-reorder-places.d.ts.map +1 -1
- package/dist/solid/batch-reorder-places.js +397 -41
- package/dist/solid/batch-reorder-places.js.map +1 -1
- package/dist/solid/batch-reorder.d.ts +30 -1
- package/dist/solid/batch-reorder.d.ts.map +1 -1
- package/dist/solid/batch-reorder.js +298 -37
- package/dist/solid/batch-reorder.js.map +1 -1
- package/dist/solid/batch.d.ts +1 -511
- package/dist/solid/batch.d.ts.map +1 -1
- package/dist/solid/batch.js +3 -2484
- package/dist/solid/batch.js.map +1 -1
- package/dist/solid/config.d.ts +2 -690
- package/dist/solid/config.d.ts.map +1 -1
- package/dist/solid/config.js +11 -1
- package/dist/solid/config.js.map +1 -1
- package/dist/solid/create-animate.d.ts.map +1 -1
- package/dist/solid/create-animate.jsx +3 -1
- package/dist/solid/create-animate.jsx.map +1 -1
- package/dist/solid/create-batch.jsx +2 -2
- package/dist/solid/create-batch.jsx.map +1 -1
- package/dist/solid/create-ward.d.ts +8 -3
- package/dist/solid/create-ward.d.ts.map +1 -1
- package/dist/solid/create-ward.jsx +50 -11
- package/dist/solid/create-ward.jsx.map +1 -1
- package/dist/solid/create-wardic.d.ts +24 -0
- package/dist/solid/create-wardic.d.ts.map +1 -0
- package/dist/solid/create-wardic.jsx +42 -0
- package/dist/solid/create-wardic.jsx.map +1 -0
- package/dist/solid/drag-constraints.d.ts +1 -45
- package/dist/solid/drag-constraints.d.ts.map +1 -1
- package/dist/solid/drag-constraints.js +3 -48
- package/dist/solid/drag-constraints.js.map +1 -1
- package/dist/solid/drag-controls.d.ts +1 -49
- package/dist/solid/drag-controls.d.ts.map +1 -1
- package/dist/solid/drag-controls.js +3 -50
- package/dist/solid/drag-controls.js.map +1 -1
- package/dist/solid/drag-defaults.d.ts +2 -0
- package/dist/solid/drag-defaults.d.ts.map +1 -0
- package/dist/solid/drag-defaults.js +4 -0
- package/dist/solid/drag-defaults.js.map +1 -0
- package/dist/solid/drag-track.d.ts +1 -232
- package/dist/solid/drag-track.d.ts.map +1 -1
- package/dist/solid/drag-track.js +3 -641
- package/dist/solid/drag-track.js.map +1 -1
- package/dist/solid/drag-transition.d.ts +1 -19
- package/dist/solid/drag-transition.d.ts.map +1 -1
- package/dist/solid/drag-transition.js +3 -30
- package/dist/solid/drag-transition.js.map +1 -1
- package/dist/solid/element-setup.d.ts +2 -0
- package/dist/solid/element-setup.d.ts.map +1 -0
- package/dist/solid/element-setup.js +4 -0
- package/dist/solid/element-setup.js.map +1 -0
- package/dist/solid/element.d.ts +27 -8
- package/dist/solid/element.d.ts.map +1 -1
- package/dist/solid/element.jsx +13 -5
- package/dist/solid/element.jsx.map +1 -1
- package/dist/solid/feature.d.ts +1 -118
- package/dist/solid/feature.d.ts.map +1 -1
- package/dist/solid/feature.js +3 -257
- package/dist/solid/feature.js.map +1 -1
- package/dist/solid/features/all.d.ts +1 -9
- package/dist/solid/features/all.d.ts.map +1 -1
- package/dist/solid/features/all.js +3 -9
- package/dist/solid/features/all.js.map +1 -1
- package/dist/solid/features/colors.d.ts +1 -11
- package/dist/solid/features/colors.d.ts.map +1 -1
- package/dist/solid/features/colors.js +3 -33
- package/dist/solid/features/colors.js.map +1 -1
- package/dist/solid/features/dom-animation.d.ts +1 -10
- package/dist/solid/features/dom-animation.d.ts.map +1 -1
- package/dist/solid/features/dom-animation.js +3 -6
- package/dist/solid/features/dom-animation.js.map +1 -1
- package/dist/solid/features/dom-max.d.ts +1 -9
- package/dist/solid/features/dom-max.d.ts.map +1 -1
- package/dist/solid/features/dom-max.js +3 -3
- package/dist/solid/features/dom-max.js.map +1 -1
- package/dist/solid/features/drag.d.ts +1 -4
- package/dist/solid/features/drag.d.ts.map +1 -1
- package/dist/solid/features/drag.js +3 -27
- package/dist/solid/features/drag.js.map +1 -1
- package/dist/solid/features/focus.d.ts +1 -4
- package/dist/solid/features/focus.d.ts.map +1 -1
- package/dist/solid/features/focus.js +3 -15
- package/dist/solid/features/focus.js.map +1 -1
- package/dist/solid/features/hover.d.ts +1 -4
- package/dist/solid/features/hover.d.ts.map +1 -1
- package/dist/solid/features/hover.js +3 -15
- package/dist/solid/features/hover.js.map +1 -1
- package/dist/solid/features/in-view.d.ts +1 -4
- package/dist/solid/features/in-view.d.ts.map +1 -1
- package/dist/solid/features/in-view.js +3 -15
- package/dist/solid/features/in-view.js.map +1 -1
- package/dist/solid/features/input.d.ts +1 -25
- package/dist/solid/features/input.d.ts.map +1 -1
- package/dist/solid/features/input.js +3 -26
- package/dist/solid/features/input.js.map +1 -1
- package/dist/solid/features/keys.d.ts +1 -69
- package/dist/solid/features/keys.d.ts.map +1 -1
- package/dist/solid/features/keys.js +3 -25
- package/dist/solid/features/keys.js.map +1 -1
- package/dist/solid/features/layout.d.ts +1 -31
- package/dist/solid/features/layout.d.ts.map +1 -1
- package/dist/solid/features/layout.js +3 -33
- package/dist/solid/features/layout.js.map +1 -1
- package/dist/solid/features/pan.d.ts +1 -4
- package/dist/solid/features/pan.d.ts.map +1 -1
- package/dist/solid/features/pan.js +3 -15
- package/dist/solid/features/pan.js.map +1 -1
- package/dist/solid/features/press.d.ts +1 -10
- package/dist/solid/features/press.d.ts.map +1 -1
- package/dist/solid/features/press.js +3 -9
- package/dist/solid/features/press.js.map +1 -1
- package/dist/solid/features/scroll.d.ts +1 -15
- package/dist/solid/features/scroll.d.ts.map +1 -1
- package/dist/solid/features/scroll.js +3 -20
- package/dist/solid/features/scroll.js.map +1 -1
- package/dist/solid/gesture-features.d.ts +1 -27
- package/dist/solid/gesture-features.d.ts.map +1 -1
- package/dist/solid/gesture-features.js +3 -28
- package/dist/solid/gesture-features.js.map +1 -1
- package/dist/solid/gesture-info.d.ts +1 -58
- package/dist/solid/gesture-info.d.ts.map +1 -1
- package/dist/solid/gesture-info.js +3 -22
- package/dist/solid/gesture-info.js.map +1 -1
- package/dist/solid/imperative.d.ts +1 -202
- package/dist/solid/imperative.d.ts.map +1 -1
- package/dist/solid/imperative.js +3 -622
- package/dist/solid/imperative.js.map +1 -1
- package/dist/solid/index.d.ts +4 -2
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.jsx +2 -1
- package/dist/solid/index.jsx.map +1 -1
- package/dist/solid/instance-features.d.ts +7 -0
- package/dist/solid/instance-features.d.ts.map +1 -0
- package/dist/solid/instance-features.js +63 -0
- package/dist/solid/instance-features.js.map +1 -0
- package/dist/solid/instant.d.ts +1 -43
- package/dist/solid/instant.d.ts.map +1 -1
- package/dist/solid/instant.js +3 -48
- package/dist/solid/instant.js.map +1 -1
- package/dist/solid/layout-group.d.ts +1 -13
- package/dist/solid/layout-group.d.ts.map +1 -1
- package/dist/solid/layout-group.js +3 -26
- package/dist/solid/layout-group.js.map +1 -1
- package/dist/solid/layout-member.d.ts +1 -126
- package/dist/solid/layout-member.d.ts.map +1 -1
- package/dist/solid/layout-member.js +3 -177
- package/dist/solid/layout-member.js.map +1 -1
- package/dist/solid/layout-projection.d.ts +6 -0
- package/dist/solid/layout-projection.d.ts.map +1 -1
- package/dist/solid/layout-projection.jsx +8 -1
- package/dist/solid/layout-projection.jsx.map +1 -1
- package/dist/solid/layout.d.ts +4 -3
- package/dist/solid/layout.d.ts.map +1 -1
- package/dist/solid/layout.jsx +5 -6
- package/dist/solid/layout.jsx.map +1 -1
- package/dist/solid/lazy-batch-gestures.d.ts +2 -2
- package/dist/solid/lazy-batch-gestures.d.ts.map +1 -1
- package/dist/solid/lazy-batch-gestures.js.map +1 -1
- package/dist/solid/live-scroll.d.ts +4 -0
- package/dist/solid/live-scroll.d.ts.map +1 -1
- package/dist/solid/live-scroll.jsx +29 -19
- package/dist/solid/live-scroll.jsx.map +1 -1
- package/dist/solid/live-style.d.ts +1 -147
- package/dist/solid/live-style.d.ts.map +1 -1
- package/dist/solid/live-style.js +3 -304
- package/dist/solid/live-style.js.map +1 -1
- package/dist/solid/live-value.d.ts +1 -0
- package/dist/solid/live-value.d.ts.map +1 -1
- package/dist/solid/live-value.jsx +12 -3
- package/dist/solid/live-value.jsx.map +1 -1
- package/dist/solid/member-hold.d.ts +1 -46
- package/dist/solid/member-hold.d.ts.map +1 -1
- package/dist/solid/member-hold.js +3 -188
- package/dist/solid/member-hold.js.map +1 -1
- package/dist/solid/messages.d.ts +20 -0
- package/dist/solid/messages.d.ts.map +1 -0
- package/dist/solid/messages.js +22 -0
- package/dist/solid/messages.js.map +1 -0
- package/dist/solid/owner-scope.d.ts +1 -15
- package/dist/solid/owner-scope.d.ts.map +1 -1
- package/dist/solid/owner-scope.js +3 -30
- package/dist/solid/owner-scope.js.map +1 -1
- package/dist/solid/presence-controller.d.ts +1 -121
- package/dist/solid/presence-controller.d.ts.map +1 -1
- package/dist/solid/presence-controller.js +3 -1335
- package/dist/solid/presence-controller.js.map +1 -1
- package/dist/solid/presence-record.d.ts +6 -168
- package/dist/solid/presence-record.d.ts.map +1 -1
- package/dist/solid/presence-record.js +9 -23
- package/dist/solid/presence-record.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.map +1 -1
- package/dist/solid/press.d.ts +1 -23
- package/dist/solid/press.d.ts.map +1 -1
- package/dist/solid/press.js +3 -18
- package/dist/solid/press.js.map +1 -1
- package/dist/solid/provider.d.ts +24 -4
- package/dist/solid/provider.d.ts.map +1 -1
- package/dist/solid/provider.jsx +63 -7
- package/dist/solid/provider.jsx.map +1 -1
- package/dist/solid/reactivity.d.ts +1 -20
- package/dist/solid/reactivity.d.ts.map +1 -1
- package/dist/solid/reactivity.js +0 -7
- package/dist/solid/reactivity.js.map +1 -1
- package/dist/solid/reorder.d.ts +5 -4
- package/dist/solid/reorder.d.ts.map +1 -1
- package/dist/solid/reorder.jsx.map +1 -1
- package/dist/solid/retarget-legs.d.ts +1 -188
- package/dist/solid/retarget-legs.d.ts.map +1 -1
- package/dist/solid/retarget-legs.js +3 -825
- package/dist/solid/retarget-legs.js.map +1 -1
- package/dist/solid/runtime.d.ts +15 -27
- package/dist/solid/runtime.d.ts.map +1 -1
- package/dist/solid/runtime.js +52 -23
- package/dist/solid/runtime.js.map +1 -1
- package/dist/solid/scroll-values.d.ts +30 -0
- package/dist/solid/scroll-values.d.ts.map +1 -0
- package/dist/solid/scroll-values.js +44 -0
- package/dist/solid/scroll-values.js.map +1 -0
- package/dist/solid/server-interpolators.d.ts +1 -12
- package/dist/solid/server-interpolators.d.ts.map +1 -1
- package/dist/solid/server-interpolators.js +3 -19
- package/dist/solid/server-interpolators.js.map +1 -1
- package/dist/solid/spans-check.d.ts +4 -0
- package/dist/solid/spans-check.d.ts.map +1 -0
- package/dist/solid/spans-check.js +23 -0
- package/dist/solid/spans-check.js.map +1 -0
- package/dist/solid/spine.d.ts +1 -612
- package/dist/solid/spine.d.ts.map +1 -1
- package/dist/solid/spine.js +3 -2886
- package/dist/solid/spine.js.map +1 -1
- package/dist/solid/timelines.d.ts +2 -0
- package/dist/solid/timelines.d.ts.map +1 -0
- package/dist/solid/timelines.js +4 -0
- package/dist/solid/timelines.js.map +1 -0
- package/dist/solid/unstable/v2/batch-reorder-group.d.ts +18 -17
- package/dist/solid/unstable/v2/batch-reorder-group.d.ts.map +1 -1
- package/dist/solid/unstable/v2/batch-reorder-group.jsx +32 -5
- package/dist/solid/unstable/v2/batch-reorder-group.jsx.map +1 -1
- package/dist/solid/unstable/v2/create-animate.d.ts.map +1 -1
- package/dist/solid/unstable/v2/create-animate.jsx +3 -1
- package/dist/solid/unstable/v2/create-animate.jsx.map +1 -1
- package/dist/solid/unstable/v2/create-batch.jsx +2 -2
- package/dist/solid/unstable/v2/create-batch.jsx.map +1 -1
- package/dist/solid/unstable/v2/create-wardic.d.ts +25 -0
- package/dist/solid/unstable/v2/create-wardic.d.ts.map +1 -0
- package/dist/solid/unstable/v2/create-wardic.jsx +43 -0
- package/dist/solid/unstable/v2/create-wardic.jsx.map +1 -0
- package/dist/solid/unstable/v2/element.d.ts +53 -18
- package/dist/solid/unstable/v2/element.d.ts.map +1 -1
- package/dist/solid/unstable/v2/element.jsx +13 -4
- package/dist/solid/unstable/v2/element.jsx.map +1 -1
- package/dist/solid/unstable/v2/index.d.ts +3 -1
- package/dist/solid/unstable/v2/index.d.ts.map +1 -1
- package/dist/solid/unstable/v2/index.jsx +1 -0
- package/dist/solid/unstable/v2/index.jsx.map +1 -1
- package/dist/solid/unstable/v2/lifecycle.d.ts +29 -0
- package/dist/solid/unstable/v2/lifecycle.d.ts.map +1 -1
- package/dist/solid/unstable/v2/lifecycle.js +2 -0
- package/dist/solid/unstable/v2/lifecycle.js.map +1 -1
- package/dist/solid/unstable/v2/live-scroll.d.ts +4 -0
- package/dist/solid/unstable/v2/live-scroll.d.ts.map +1 -1
- package/dist/solid/unstable/v2/live-scroll.jsx +22 -11
- package/dist/solid/unstable/v2/live-scroll.jsx.map +1 -1
- package/dist/solid/unstable/v2/live-value.d.ts +1 -0
- package/dist/solid/unstable/v2/live-value.d.ts.map +1 -1
- package/dist/solid/unstable/v2/live-value.jsx +10 -1
- package/dist/solid/unstable/v2/live-value.jsx.map +1 -1
- package/dist/solid/unstable/v2/presence.d.ts +3 -1
- package/dist/solid/unstable/v2/presence.d.ts.map +1 -1
- package/dist/solid/unstable/v2/presence.jsx.map +1 -1
- package/dist/solid/unstable/v2/provider.d.ts +24 -4
- package/dist/solid/unstable/v2/provider.d.ts.map +1 -1
- package/dist/solid/unstable/v2/provider.jsx +66 -10
- package/dist/solid/unstable/v2/provider.jsx.map +1 -1
- package/dist/solid/unstable/v2/reorder.d.ts +4 -3
- package/dist/solid/unstable/v2/reorder.d.ts.map +1 -1
- package/dist/solid/unstable/v2/reorder.jsx.map +1 -1
- package/dist/solid/unstable/v2/w.d.ts +42 -10
- package/dist/solid/unstable/v2/w.d.ts.map +1 -1
- package/dist/solid/unstable/v2/w.jsx +5 -7
- package/dist/solid/unstable/v2/w.jsx.map +1 -1
- package/dist/solid/unstable/v2/ward.d.ts +17 -9
- package/dist/solid/unstable/v2/ward.d.ts.map +1 -1
- package/dist/solid/unstable/v2/ward.jsx +40 -10
- package/dist/solid/unstable/v2/ward.jsx.map +1 -1
- package/dist/solid/unstable/v2/wardic-instance.d.ts +47 -0
- package/dist/solid/unstable/v2/wardic-instance.d.ts.map +1 -0
- package/dist/solid/unstable/v2/wardic-instance.js +2 -0
- package/dist/solid/unstable/v2/wardic-instance.js.map +1 -0
- package/dist/solid/variant-target.d.ts +1 -103
- package/dist/solid/variant-target.d.ts.map +1 -1
- package/dist/solid/variant-target.js +3 -181
- package/dist/solid/variant-target.js.map +1 -1
- package/dist/solid/variant-tree.d.ts +1 -348
- package/dist/solid/variant-tree.d.ts.map +1 -1
- package/dist/solid/variant-tree.js +3 -357
- package/dist/solid/variant-tree.js.map +1 -1
- package/dist/solid/w.d.ts +25 -10
- package/dist/solid/w.d.ts.map +1 -1
- package/dist/solid/w.jsx +8 -7
- package/dist/solid/w.jsx.map +1 -1
- package/dist/solid/ward-keys.d.ts +22 -3
- package/dist/solid/ward-keys.d.ts.map +1 -1
- package/dist/solid/wardic-config-value.d.ts +1 -86
- package/dist/solid/wardic-config-value.d.ts.map +1 -1
- package/dist/solid/wardic-config-value.js +3 -105
- package/dist/solid/wardic-config-value.js.map +1 -1
- package/dist/solid/wardic-instance.d.ts +46 -0
- package/dist/solid/wardic-instance.d.ts.map +1 -0
- package/dist/solid/wardic-instance.js +2 -0
- package/dist/solid/wardic-instance.js.map +1 -0
- package/package.json +4 -4
- package/src/animation-controls.ts +3 -206
- package/src/appear.ts +3 -824
- package/src/batch-gestures.ts +2 -2
- package/src/batch-reorder-group.tsx +47 -21
- package/src/batch-reorder-places.ts +566 -54
- package/src/batch-reorder.ts +333 -40
- package/src/batch.ts +3 -3078
- package/src/config.ts +5 -804
- package/src/create-animate.tsx +3 -1
- package/src/create-batch.tsx +2 -2
- package/src/create-ward.tsx +55 -50
- package/src/create-wardic.tsx +45 -0
- package/src/drag-constraints.ts +3 -103
- package/src/drag-controls.ts +3 -94
- package/src/drag-defaults.ts +3 -0
- package/src/drag-track.ts +3 -955
- package/src/drag-transition.ts +3 -43
- package/src/element-setup.ts +3 -0
- package/src/element.tsx +53 -16
- package/src/feature.ts +3 -359
- package/src/features/all.ts +3 -18
- package/src/features/colors.ts +3 -36
- package/src/features/dom-animation.ts +3 -15
- package/src/features/dom-max.ts +3 -11
- package/src/features/drag.ts +3 -30
- package/src/features/focus.ts +3 -17
- package/src/features/hover.ts +3 -17
- package/src/features/in-view.ts +3 -17
- package/src/features/input.ts +3 -34
- package/src/features/keys.ts +3 -89
- package/src/features/layout.ts +3 -54
- package/src/features/pan.ts +3 -17
- package/src/features/press.ts +3 -17
- package/src/features/scroll.ts +3 -21
- package/src/gesture-features.ts +3 -35
- package/src/gesture-info.ts +3 -81
- package/src/imperative.ts +3 -894
- package/src/index.tsx +6 -1
- package/src/instance-features.ts +88 -0
- package/src/instant.ts +3 -90
- package/src/layout-group.ts +3 -32
- package/src/layout-member.ts +3 -319
- package/src/layout-projection.tsx +10 -1
- package/src/layout.tsx +7 -6
- package/src/lazy-batch-gestures.ts +3 -3
- package/src/live-scroll.tsx +30 -22
- package/src/live-style.ts +3 -450
- package/src/live-value.tsx +12 -2
- package/src/member-hold.ts +3 -222
- package/src/messages.ts +27 -0
- package/src/owner-scope.ts +3 -31
- package/src/presence-controller.ts +3 -1616
- package/src/presence-record.ts +8 -192
- package/src/presence.tsx +3 -1
- package/src/press.ts +3 -40
- package/src/provider.tsx +72 -7
- package/src/reactivity.ts +3 -23
- package/src/reorder.tsx +5 -4
- package/src/retarget-legs.ts +3 -1049
- package/src/runtime.ts +62 -43
- package/src/scroll-values.ts +53 -0
- package/src/server-interpolators.ts +3 -33
- package/src/spans-check.ts +25 -0
- package/src/spine.ts +3 -3508
- package/src/timelines.ts +3 -0
- package/src/unstable/v2/batch-reorder-group.tsx +42 -18
- package/src/unstable/v2/create-animate.tsx +3 -1
- package/src/unstable/v2/create-batch.tsx +2 -2
- package/src/unstable/v2/create-wardic.tsx +46 -0
- package/src/unstable/v2/element.tsx +86 -24
- package/src/unstable/v2/index.tsx +5 -0
- package/src/unstable/v2/lifecycle.ts +35 -0
- package/src/unstable/v2/live-scroll.tsx +22 -11
- package/src/unstable/v2/live-value.tsx +10 -0
- package/src/unstable/v2/presence.tsx +3 -1
- package/src/unstable/v2/provider.tsx +75 -9
- package/src/unstable/v2/reorder.tsx +9 -4
- package/src/unstable/v2/w.tsx +50 -13
- package/src/unstable/v2/ward.tsx +61 -51
- package/src/unstable/v2/wardic-instance.ts +50 -0
- package/src/variant-target.ts +3 -240
- package/src/variant-tree.ts +3 -638
- package/src/w.tsx +34 -16
- package/src/ward-keys.ts +38 -17
- package/src/wardic-config-value.ts +3 -150
- package/src/wardic-instance.ts +49 -0
- package/dist/browser/batch-handoff.js +0 -72
- package/dist/browser/batch-handoff.js.map +0 -1
- package/dist/browser/frame-time.js +0 -40
- package/dist/browser/frame-time.js.map +0 -1
- package/dist/server/batch-handoff.js +0 -72
- package/dist/server/batch-handoff.js.map +0 -1
- package/dist/server/frame-time.js +0 -40
- package/dist/server/frame-time.js.map +0 -1
- package/dist/solid/batch-handoff.d.ts +0 -25
- package/dist/solid/batch-handoff.d.ts.map +0 -1
- package/dist/solid/batch-handoff.js +0 -75
- package/dist/solid/batch-handoff.js.map +0 -1
- package/dist/solid/frame-time.d.ts +0 -21
- package/dist/solid/frame-time.d.ts.map +0 -1
- package/dist/solid/frame-time.js +0 -41
- package/dist/solid/frame-time.js.map +0 -1
- package/src/batch-handoff.ts +0 -87
- package/src/frame-time.ts +0 -45
package/src/index.tsx
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @see https://wardic.dev/reference/solid/utilities/version
|
|
13
13
|
*/
|
|
14
|
-
export const VERSION = "1.
|
|
14
|
+
export const VERSION = "1.1.1"
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* `WardicProvider` (one Effect runtime + `AtomRegistry` per ADR-0006), the
|
|
@@ -243,8 +243,10 @@ export {
|
|
|
243
243
|
type ReorderItemDirectiveValue,
|
|
244
244
|
type ReorderBatchGroupProps,
|
|
245
245
|
type ReorderBatchItemProps,
|
|
246
|
+
type ReorderBatchColumnSize,
|
|
246
247
|
type ReorderBatchGap,
|
|
247
248
|
type ReorderBatchItemSize,
|
|
249
|
+
type ReorderBatchSizing,
|
|
248
250
|
reorderItem,
|
|
249
251
|
} from "./reorder.tsx"
|
|
250
252
|
|
|
@@ -295,6 +297,9 @@ export {
|
|
|
295
297
|
* `w.createWard` and `use:w`, each as its `wardic` form but with only the Features chosen above it.
|
|
296
298
|
*/
|
|
297
299
|
export { type W, w } from "./w.tsx"
|
|
300
|
+
// #516: what `createWardic(features)` returns, its `w` typed to its Features.
|
|
301
|
+
export type { WardConfigOf, WardicInstance } from "./wardic-instance.ts"
|
|
302
|
+
export { createWardic } from "./create-wardic.tsx"
|
|
298
303
|
// #443 (Motion's): `wardic.create`'s options; whether a component is a Wardic element's and what it
|
|
299
304
|
// wraps; whether a prop is a motion prop.
|
|
300
305
|
export { isWardicComponent, unwrapWardicComponent, type WardicCreateOptions } from "./wardic-component.ts"
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A **Wardic instance**'s Features (#516, ADR-0067 *Amendment (#516)*), for both bindings: what
|
|
3
|
+
* `createWardic` splits its list into, and what its elements and hooks take in each provider. In a module
|
|
4
|
+
* that only `createWardic` imports, apart from the spine every page shares, so an app with no Wardic
|
|
5
|
+
* instance ships none of it (ADR-0067, *Amendment (#548)*).
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import * as Arr from "effect/Array"
|
|
10
|
+
import * as Bool from "effect/Boolean"
|
|
11
|
+
import type * as Cause from "effect/Cause"
|
|
12
|
+
import { constVoid, identity } from "effect/Function"
|
|
13
|
+
import * as Predicate from "effect/Predicate"
|
|
14
|
+
import * as UndefinedOr from "effect/UndefinedOr"
|
|
15
|
+
import {
|
|
16
|
+
type Build,
|
|
17
|
+
type Feature,
|
|
18
|
+
type FeatureLoad,
|
|
19
|
+
type FeatureRegistry,
|
|
20
|
+
type Features,
|
|
21
|
+
type InstanceFeatures,
|
|
22
|
+
type InstanceFeaturesProp,
|
|
23
|
+
joinOwns,
|
|
24
|
+
type Own,
|
|
25
|
+
ownOf,
|
|
26
|
+
type SectionHost,
|
|
27
|
+
} from "./feature.ts"
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* `prop`'s Features (#516): those given at once, flattened, each once, and its loads, each started once,
|
|
31
|
+
* the first time any provider asks, so one module's Wardic instance loads each once.
|
|
32
|
+
*/
|
|
33
|
+
export const instanceFeaturesOf = (prop: InstanceFeaturesProp): InstanceFeatures => {
|
|
34
|
+
const leaves = leavesOf(prop)
|
|
35
|
+
const given = Arr.dedupeWith(Arr.filter(leaves, isFeature), (a, b) => a === b)
|
|
36
|
+
const loads = Arr.map(Arr.filter(leaves, isLoad), once)
|
|
37
|
+
const owns = new WeakMap<FeatureRegistry, Own>()
|
|
38
|
+
return {
|
|
39
|
+
own: (registry, host) =>
|
|
40
|
+
UndefinedOr.match(owns.get(registry), {
|
|
41
|
+
onDefined: identity,
|
|
42
|
+
onUndefined: () => {
|
|
43
|
+
const own = ownIn(registry.build, given, loads, host.report, { reactivity: host.reactivity, server: host.server, onCleanup: registry.onEnd })
|
|
44
|
+
owns.set(registry, own)
|
|
45
|
+
return own
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** `prop`'s Features and loads, every list flattened. */
|
|
52
|
+
const leavesOf = (prop: InstanceFeaturesProp): ReadonlyArray<Feature | FeatureLoad> =>
|
|
53
|
+
Bool.match(Array.isArray(prop), {
|
|
54
|
+
onTrue: () => Arr.flatMap(prop as ReadonlyArray<InstanceFeaturesProp>, leavesOf),
|
|
55
|
+
onFalse: () => [prop as Feature | FeatureLoad],
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const isFeature = (leaf: Feature | FeatureLoad): leaf is Feature => Predicate.hasProperty(leaf, "layer")
|
|
59
|
+
|
|
60
|
+
const isLoad = (leaf: Feature | FeatureLoad): leaf is FeatureLoad => Predicate.isFunction(leaf)
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* `load`, started at its first call, its promise kept for every call after. A failed load is forgotten,
|
|
64
|
+
* so the next provider to ask loads again, as a new `LazyWardic` does.
|
|
65
|
+
*/
|
|
66
|
+
const once = (load: FeatureLoad): FeatureLoad => {
|
|
67
|
+
let started: Promise<Features> | undefined
|
|
68
|
+
return () =>
|
|
69
|
+
UndefinedOr.match(started, {
|
|
70
|
+
onDefined: identity,
|
|
71
|
+
onUndefined: () => {
|
|
72
|
+
const loading = load()
|
|
73
|
+
started = loading
|
|
74
|
+
loading.then(constVoid, () => {
|
|
75
|
+
if (started === loading) started = undefined
|
|
76
|
+
})
|
|
77
|
+
return loading
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** A Wardic instance's Features in one provider: those given at once, and each load's, joined. */
|
|
83
|
+
const ownIn = (build: Build, given: ReadonlyArray<Feature>, loads: ReadonlyArray<FeatureLoad>, report: (cause: Cause.Cause<unknown>) => void, host: SectionHost): Own =>
|
|
84
|
+
Arr.reduce(
|
|
85
|
+
Arr.map(loads, (load) => ownOf(build, load, report, host)),
|
|
86
|
+
ownOf(build, given, report, host),
|
|
87
|
+
joinOwns,
|
|
88
|
+
)
|
package/src/instant.ts
CHANGED
|
@@ -1,90 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* system's `instant` and `reset`, and a flag its elements' animations read as they start.
|
|
5
|
-
*
|
|
6
|
-
* Solid-free: both bindings run it over their own provider's context value (#209).
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
import type * as ProjectionSystem from "@wardic/dom/ProjectionSystem"
|
|
11
|
-
import { constFalse, constVoid } from "effect/Function"
|
|
12
|
-
import * as Predicate from "effect/Predicate"
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Whether a provider's animations are instant now (#443, Motion's `instantAnimations`): while on,
|
|
16
|
-
* every animation that starts is a **Skipped animation** (#468). `start` turns it on, and it goes off
|
|
17
|
-
* two Refresh frames after the last `start`, as Motion's does; `end` turns it off at once (Motion's
|
|
18
|
-
* `disableInstantTransitions`).
|
|
19
|
-
*/
|
|
20
|
-
export interface InstantAnimations {
|
|
21
|
-
readonly active: () => boolean
|
|
22
|
-
readonly start: () => void
|
|
23
|
-
readonly end: () => void
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** A provider's {@link InstantAnimations}, timed by its Environment's Refresh frames, found at the first `start`. */
|
|
27
|
-
export const makeInstantAnimations = (requestFrame: () => (callback: () => void) => unknown): InstantAnimations => {
|
|
28
|
-
let on = false
|
|
29
|
-
// The calls so far: a call's turn-off is skipped once a later call has come.
|
|
30
|
-
let calls = 0
|
|
31
|
-
return {
|
|
32
|
-
active: () => on,
|
|
33
|
-
start: () => {
|
|
34
|
-
on = true
|
|
35
|
-
calls++
|
|
36
|
-
const call = calls
|
|
37
|
-
const request = requestFrame()
|
|
38
|
-
request(() =>
|
|
39
|
-
request(() => {
|
|
40
|
-
if (call === calls) on = false
|
|
41
|
-
}))
|
|
42
|
-
},
|
|
43
|
-
end: () => {
|
|
44
|
-
on = false
|
|
45
|
-
},
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** A server's: never on. */
|
|
50
|
-
export const NO_INSTANT: InstantAnimations = { active: constFalse, start: constVoid, end: constVoid }
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* `createInstantTransition()`'s start: `start(fn)` runs `fn`, and its layout change and every
|
|
54
|
-
* animation that starts until two frames after the call land at once. A later call extends it, and
|
|
55
|
-
* `start.end()` ends it now.
|
|
56
|
-
*/
|
|
57
|
-
// #443, Motion's `useInstantTransition`; `end` is its `disableInstantTransitions`.
|
|
58
|
-
export interface InstantTransition {
|
|
59
|
-
(fn: () => void): void
|
|
60
|
-
readonly end: () => void
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* An Instant change of the layout (#443): `fn` run, and the next Measure pass blocked. On a server,
|
|
65
|
-
* with no projection system, `fn` alone.
|
|
66
|
-
*/
|
|
67
|
-
export const instantLayoutOf =
|
|
68
|
-
(projection: () => ProjectionSystem.Shape | undefined) =>
|
|
69
|
-
(fn?: () => void): void => {
|
|
70
|
-
const system = projection()
|
|
71
|
-
if (Predicate.isNotUndefined(system)) return system.instant(fn)
|
|
72
|
-
if (Predicate.isNotUndefined(fn)) fn()
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** An Instant change of the layout and of the animations started meanwhile (#443): see {@link InstantTransition}. */
|
|
76
|
-
export const instantTransitionOf = (projection: () => ProjectionSystem.Shape | undefined, instant: () => InstantAnimations): InstantTransition =>
|
|
77
|
-
Object.assign(
|
|
78
|
-
(fn: () => void): void =>
|
|
79
|
-
instantLayoutOf(projection)(() => {
|
|
80
|
-
instant().start()
|
|
81
|
-
fn()
|
|
82
|
-
}),
|
|
83
|
-
{ end: () => instant().end() },
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
/** A Projection reset (#443): the projection system's `reset`; nothing on a server. */
|
|
87
|
-
export const resetOf = (projection: () => ProjectionSystem.Shape | undefined) => (): void => {
|
|
88
|
-
const system = projection()
|
|
89
|
-
if (Predicate.isNotUndefined(system)) system.reset()
|
|
90
|
-
}
|
|
1
|
+
// #672: @wardic/dom/unstable/Instant since the lift; solid's modules import it through
|
|
2
|
+
// here until each has moved.
|
|
3
|
+
export * from "@wardic/dom/unstable/Instant"
|
package/src/layout-group.ts
CHANGED
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* layout node's `layoutId` is put in it before it reaches the Projection system.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
import * as Predicate from "effect/Predicate"
|
|
9
|
-
import * as UndefinedOr from "effect/UndefinedOr"
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Whether a group joins the id of the group it's in (Motion's `inherit`): `true` and `"id"` both do
|
|
13
|
-
* (Motion's `true` also joins its node group, whose members are measured together, which Wardic's
|
|
14
|
-
* whole-tree Measure pass already does, ADR-0009); `false` starts a namespace of its own.
|
|
15
|
-
*/
|
|
16
|
-
export type LayoutGroupInherit = boolean | "id"
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* A group's id (Motion's): with `inherit` and an outer group's id, that id joined with its own
|
|
20
|
-
* (`outer-inner`), or the outer one's alone when it has none; else its own, or none.
|
|
21
|
-
*/
|
|
22
|
-
export const layoutGroupIdOf = (outer: string | undefined, id: string | undefined, inherit: LayoutGroupInherit = true): string | undefined => {
|
|
23
|
-
if (inherit === false) return id
|
|
24
|
-
if (Predicate.isUndefined(outer)) return id
|
|
25
|
-
return UndefinedOr.match(id, { onUndefined: () => outer, onDefined: (own) => `${outer}-${own}` })
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** `layoutId` in the group `group` (Motion's `useLayoutId`): `${group}-${layoutId}`, or as it is outside any. */
|
|
29
|
-
export const layoutIdIn = (group: string | undefined, layoutId: string | undefined): string | undefined => {
|
|
30
|
-
if (Predicate.isUndefined(group)) return layoutId
|
|
31
|
-
return UndefinedOr.map(layoutId, (own) => `${group}-${own}`)
|
|
32
|
-
}
|
|
1
|
+
// #672: @wardic/dom/unstable/LayoutGroup since the lift; solid's modules import it through
|
|
2
|
+
// here until each has moved.
|
|
3
|
+
export * from "@wardic/dom/unstable/LayoutGroup"
|
package/src/layout-member.ts
CHANGED
|
@@ -1,319 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* its own lifetime: the node's disposal, and a `layoutDependency` change's Measure pass.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
import type * as Box from "@wardic/core/Box"
|
|
9
|
-
import type * as Point from "@wardic/core/Point"
|
|
10
|
-
import type * as Projection from "@wardic/core/Projection"
|
|
11
|
-
import * as ProjectionSystem from "@wardic/dom/ProjectionSystem"
|
|
12
|
-
import * as Bool from "effect/Boolean"
|
|
13
|
-
import { constFalse, constTrue, identity } from "effect/Function"
|
|
14
|
-
import * as Option from "effect/Option"
|
|
15
|
-
import * as Predicate from "effect/Predicate"
|
|
16
|
-
import * as UndefinedOr from "effect/UndefinedOr"
|
|
17
|
-
import { markLayoutElement } from "./batch.ts"
|
|
18
|
-
import type * as Values from "@wardic/core/Values"
|
|
19
|
-
import * as DomRenderer from "@wardic/dom/DomRenderer"
|
|
20
|
-
import type { WardConfig, WardicTransition } from "./config.ts"
|
|
21
|
-
import { layoutIdIn } from "./layout-group.ts"
|
|
22
|
-
import type { PresenceSeed } from "./presence-record.ts"
|
|
23
|
-
import { runOf, transitionForKey } from "./retarget-legs.ts"
|
|
24
|
-
import { ownOrInherited, type WardicVariantContextValue } from "./variant-tree.ts"
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* One transition as a layout animation's (ADR-0009 *Amendment (#171)*, ADR-0051): as it runs, a value's
|
|
28
|
-
* rule (a spring when it says so or gives a spring field, else a tween, Motion's fields filled in), so
|
|
29
|
-
* a ported `{ duration: 0.5 }` is a 0.5 s tween. One that defines none, a `delay` alone say, is
|
|
30
|
-
* Motion's default layout tween with its delay: it never turns a layout animation into a spring. An
|
|
31
|
-
* inertia (#435) is that tween too: a layout animation's progress has no velocity to glide on.
|
|
32
|
-
*/
|
|
33
|
-
const asLayoutTransition = (t: WardicTransition): ProjectionSystem.LayoutTransition =>
|
|
34
|
-
UndefinedOr.match(runOf(t), {
|
|
35
|
-
// A layout tween takes one `ease`: a list of them (#429) is a Keyframes tween's, which core's layout tween rejects.
|
|
36
|
-
onDefined: (run): ProjectionSystem.LayoutTransition =>
|
|
37
|
-
Bool.match(run.type === "inertia", { onTrue: () => defaultLayoutAfter(t.delay), onFalse: () => run as ProjectionSystem.LayoutTransition }),
|
|
38
|
-
onUndefined: () => defaultLayoutAfter(t.delay),
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
/** Motion's default layout tween, after `delay` when given. */
|
|
42
|
-
const defaultLayoutAfter = (delay: number | undefined): ProjectionSystem.LayoutTransition =>
|
|
43
|
-
UndefinedOr.match(delay, { onUndefined: () => ProjectionSystem.DEFAULT_LAYOUT_TRANSITION, onDefined: (after): ProjectionSystem.LayoutTransition => ({ ...ProjectionSystem.DEFAULT_LAYOUT_TRANSITION, delay: after }) })
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* The element's layout transition (ADR-0009 *Amendment (#171)*, *Amendment (#301)*): Motion's
|
|
47
|
-
* `layout` entry, else its `default`, else its whole `transition`; `undefined`, with none, for the
|
|
48
|
-
* engine's default, Motion's 0.45 s tween.
|
|
49
|
-
*/
|
|
50
|
-
const toLayoutTransition = (t: WardicTransition | undefined): Option.Option<ProjectionSystem.LayoutTransition> =>
|
|
51
|
-
Option.map(Option.fromUndefinedOr(transitionForKey(t, "layout")), asLayoutTransition)
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* `createProjectionNode`'s options: the element, its id, and what its motion props would give a `w.*`
|
|
55
|
-
* element's layout node. Each function is read when the projection needs it, outside Solid's tracking.
|
|
56
|
-
*/
|
|
57
|
-
export interface CreateProjectionNodeOptions {
|
|
58
|
-
/** The element's id in the provider's gate, the entry its values are written under. */
|
|
59
|
-
// The spine's entry: the projection's `@projection` writes merge there.
|
|
60
|
-
readonly id: string
|
|
61
|
-
/** The element to measure and animate. */
|
|
62
|
-
readonly element: HTMLElement
|
|
63
|
-
/** Its `layoutDependency`: a change has it measured again. */
|
|
64
|
-
readonly layoutDependency: () => unknown
|
|
65
|
-
/** Its `transition`: the `layout` entry, else the whole transition, runs its layout animations. */
|
|
66
|
-
// ADR-0009 *Amendment (#171)*.
|
|
67
|
-
readonly transition: () => WardicTransition | undefined
|
|
68
|
-
/** Its `dragTransition`, resolved: what it carries on with after a drag is let go. */
|
|
69
|
-
// ADR-0016, *Amendment (#140)*: what its Release offset runs on.
|
|
70
|
-
readonly dragTransition?: () => ProjectionSystem.DragTransition
|
|
71
|
-
/** Whether reduced motion applies to it now: its nearest `WardicConfig`'s, else the provider's. Default: the system's. */
|
|
72
|
-
// ADR-0029, #434.
|
|
73
|
-
readonly reducedMotion?: () => boolean
|
|
74
|
-
/** Whether its animations land at once now: its nearest `WardicConfig`'s `skipAnimations`. Default: never. */
|
|
75
|
-
// #468.
|
|
76
|
-
readonly skipAnimations?: () => boolean
|
|
77
|
-
/** Its `layoutId`: an element with the same one, mounting as it leaves, flies from it. Left out, it's a plain `layout` element. */
|
|
78
|
-
// ADR-0010: the one node joins the engine's per-`layoutId` lead/follow stack (coexisting twins
|
|
79
|
-
// crossfade) and takes a Switch seed from a twin disposed in the same task, both engine-side
|
|
80
|
-
// (*Amendment (#13)*).
|
|
81
|
-
readonly layoutId?: string
|
|
82
|
-
/** Its `layoutScroll`: it scrolls, and its scroll isn't read as its children moving. */
|
|
83
|
-
// ADR-0012: its scroll offset is sampled at measure and folded out of its descendants' boxes, so a
|
|
84
|
-
// scroll between triggers doesn't leak into their FLIP delta.
|
|
85
|
-
readonly layoutScroll?: boolean
|
|
86
|
-
/**
|
|
87
|
-
* Its `layoutRoot`: a root for the layout animations inside it, which never animates its own. With a
|
|
88
|
-
* `layoutMode` other than `false` it stays at its new place while an ancestor's layout animation runs;
|
|
89
|
-
* with `false` it moves with it, as a `w.*` element's with no `layout` or `layoutId` does.
|
|
90
|
-
*/
|
|
91
|
-
// ADR-0013: a stable projection sub-root, self-snap, boundary and persistent relative anchor.
|
|
92
|
-
readonly layoutRoot?: boolean
|
|
93
|
-
/** Its `layoutAnchor`: where in its parent's box it anchors, 0 to 1 per axis, or `false` to measure it against the page. */
|
|
94
|
-
// ADR-0013: its relative-projection anchor; `false` forces absolute.
|
|
95
|
-
readonly layoutAnchor?: Point.Point | false
|
|
96
|
-
/** Its `layoutCrossfade`: whether a `layoutId` handover onto it crossfades, read as each begins. Default: always. */
|
|
97
|
-
// #442.
|
|
98
|
-
readonly crossfade?: () => boolean
|
|
99
|
-
/** Raises it above its siblings while it's dragged, as a `<Reorder>` item is. */
|
|
100
|
-
// ADR-0016 *Amendment (Reorder)*.
|
|
101
|
-
readonly raiseWhileDragged?: boolean
|
|
102
|
-
/**
|
|
103
|
-
* Its `layout` value: which part of a change it animates, read as each layout animation starts. `false`
|
|
104
|
-
* for one with no layout of its own, as a `w.*` element's with `layoutRoot` or `layoutScroll` and no
|
|
105
|
-
* `layout` or `layoutId`. Default `true`.
|
|
106
|
-
*/
|
|
107
|
-
// ADR-0009, *Amendments (#42, #691)*: its Layout mode.
|
|
108
|
-
readonly layoutMode?: () => Projection.LayoutMode
|
|
109
|
-
/** Its own `scale`, read at each handover and each frame it follows another element. */
|
|
110
|
-
// ADR-0010 *Amendment (#8)*.
|
|
111
|
-
readonly ownScale?: () => Point.Point
|
|
112
|
-
/** Its own `x` and `y`, in page pixels, read where its own scale is. */
|
|
113
|
-
// #363.
|
|
114
|
-
readonly ownTranslate?: () => Point.Point
|
|
115
|
-
/** Its own `rotate` and `opacity`, which a `layoutId` handover blends into. */
|
|
116
|
-
// ADR-0010 *Amendment (#166)*.
|
|
117
|
-
readonly ownRotate?: () => number
|
|
118
|
-
readonly ownOpacity?: () => number
|
|
119
|
-
/** The `transform` it's held at while it's measured: its `transformTemplate`'s. Left out without one. */
|
|
120
|
-
// #443.
|
|
121
|
-
readonly heldTransform?: () => string
|
|
122
|
-
/** Its `onBeforeLayoutMeasure` and `onLayoutMeasure`. Left out when it has none at mount. */
|
|
123
|
-
// #443.
|
|
124
|
-
readonly onBeforeMeasure?: () => void
|
|
125
|
-
readonly onMeasure?: (box: Box.Box, prev: Box.Box | undefined) => void
|
|
126
|
-
/** Its `onLayoutAnimationStart` and `onLayoutAnimationComplete`, read when they're called. */
|
|
127
|
-
// #191, ADR-0039.
|
|
128
|
-
readonly onLayoutAnimationStart?: () => (() => void) | undefined
|
|
129
|
-
readonly onLayoutAnimationComplete?: () => (() => void) | undefined
|
|
130
|
-
/** Its `onDragTransitionEnd`, read when it's called: once it comes to rest after a drag. */
|
|
131
|
-
// #273: a drag's Release offset at rest.
|
|
132
|
-
readonly onReleaseEnd?: () => (() => void) | undefined
|
|
133
|
-
/** Where its first layout animation starts, when it takes over from a leaving element with its `key`: that element's box. */
|
|
134
|
-
// #286: a presence take-over, its leaver's box in the Root frame.
|
|
135
|
-
readonly enteredFrom?: Box.Box
|
|
136
|
-
/** Where its handover's fade starts, when it takes over from a leaving twin with its `key`: how far that one had faded. */
|
|
137
|
-
// #286.
|
|
138
|
-
readonly fadeFrom?: number
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/** Whether a layout transition skips its animation (#468): its `layout` entry's, else its own `skipAnimations`. */
|
|
142
|
-
const layoutSkips = (transition: WardicTransition | undefined): boolean =>
|
|
143
|
-
UndefinedOr.match(transitionForKey(transition, "layout"), { onUndefined: constFalse, onDefined: (t) => t.skipAnimations === true })
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* A layout node's registration with the projection system (ADR-0009, ADR-0010): exactly one node per
|
|
147
|
-
* element, whether it has `layout`, `layoutId`, or both. Each getter is read where the projection
|
|
148
|
-
* system needs it, outside the binding's tracking.
|
|
149
|
-
*/
|
|
150
|
-
export const registrationOf = (opts: CreateProjectionNodeOptions): ProjectionSystem.RegisterNodeOptions => {
|
|
151
|
-
// A Batch member's element has no layout node (#665's PR 4, Q52): the projection measures its box under
|
|
152
|
-
// the Batch's transform, which it doesn't draw. Marked, so a Batch it joins later says so too.
|
|
153
|
-
markLayoutElement(opts.element)
|
|
154
|
-
const { crossfade, dragTransition, element, enteredFrom, fadeFrom, id, layoutAnchor, layoutId, layoutMode, layoutRoot, layoutScroll, heldTransform, onBeforeMeasure, onMeasure, onLayoutAnimationComplete, onLayoutAnimationStart, onReleaseEnd, ownOpacity, ownRotate, ownScale, ownTranslate, raiseWhileDragged, reducedMotion, skipAnimations, transition } = opts
|
|
155
|
-
const configSkips = UndefinedOr.match(skipAnimations, { onUndefined: () => constFalse, onDefined: identity })
|
|
156
|
-
return {
|
|
157
|
-
id,
|
|
158
|
-
element,
|
|
159
|
-
transition: () => toLayoutTransition(transition()),
|
|
160
|
-
// Its layout transition's Path (#438, ADR-0065), Motion's: the `layout` entry's, else the element's.
|
|
161
|
-
// A layout animation of 20 px or more curves along it.
|
|
162
|
-
path: () => Option.fromUndefinedOr(UndefinedOr.map(transitionForKey(transition(), "layout"), (t) => t.path)),
|
|
163
|
-
// The layout transition's reduced-motion opt-out (ADR-0029, #301), read at each layout animation's start.
|
|
164
|
-
respectReducedMotion: () =>
|
|
165
|
-
UndefinedOr.match(transitionForKey(transition(), "layout"), { onUndefined: constTrue, onDefined: (t) => t.respectReducedMotion !== false }),
|
|
166
|
-
// Whether reduced motion applies to it (#434): its subtree's, else the system's.
|
|
167
|
-
...UndefinedOr.match(reducedMotion, { onUndefined: () => ({}), onDefined: (applies) => ({ reducedMotion: applies }) }),
|
|
168
|
-
// Whether its layout animations are skipped (#468): its subtree's, or its layout transition's own
|
|
169
|
-
// `skipAnimations`, as Motion's projection runs on its layout transition. Read at each start.
|
|
170
|
-
skipAnimations: () => Bool.or(configSkips(), layoutSkips(transition())),
|
|
171
|
-
...UndefinedOr.match(layoutId, { onUndefined: () => ({}), onDefined: (twinId) => ({ layoutId: twinId }) }),
|
|
172
|
-
...Bool.match(layoutScroll === true, { onTrue: () => ({ layoutScroll: true }), onFalse: () => ({}) }),
|
|
173
|
-
...Bool.match(layoutRoot === true, { onTrue: () => ({ layoutRoot: true }), onFalse: () => ({}) }),
|
|
174
|
-
...UndefinedOr.match(layoutAnchor, { onUndefined: () => ({}), onDefined: (anchor) => ({ layoutAnchor: anchor }) }),
|
|
175
|
-
...UndefinedOr.match(crossfade, { onUndefined: () => ({}), onDefined: (fades) => ({ crossfade: fades }) }),
|
|
176
|
-
...Bool.match(raiseWhileDragged === true, { onTrue: () => ({ raiseWhileDragged: true }), onFalse: () => ({}) }),
|
|
177
|
-
...UndefinedOr.match(dragTransition, { onUndefined: () => ({}), onDefined: (release) => ({ dragTransition: () => Option.some(release()) }) }),
|
|
178
|
-
...UndefinedOr.match(layoutMode, { onUndefined: () => ({}), onDefined: (mode) => ({ layoutMode: mode }) }),
|
|
179
|
-
...UndefinedOr.match(ownScale, { onUndefined: () => ({}), onDefined: (scale) => ({ ownScale: scale }) }),
|
|
180
|
-
...UndefinedOr.match(ownTranslate, { onUndefined: () => ({}), onDefined: (translate) => ({ ownTranslate: translate }) }),
|
|
181
|
-
...UndefinedOr.match(ownRotate, { onUndefined: () => ({}), onDefined: (rotate) => ({ ownRotate: rotate }) }),
|
|
182
|
-
...UndefinedOr.match(ownOpacity, { onUndefined: () => ({}), onDefined: (opacity) => ({ ownOpacity: opacity }) }),
|
|
183
|
-
...UndefinedOr.match(heldTransform, { onUndefined: () => ({}), onDefined: (held) => ({ heldTransform: held }) }),
|
|
184
|
-
...UndefinedOr.match(onBeforeMeasure, { onUndefined: () => ({}), onDefined: (before) => ({ onBeforeMeasure: before }) }),
|
|
185
|
-
// The engine's `prev` is an `Option` (#618, A1); this option keeps Motion's `undefined` at the first.
|
|
186
|
-
...UndefinedOr.match(onMeasure, { onUndefined: () => ({}), onDefined: (measured) => ({ onMeasure: (box: Box.Box, prev: Option.Option<Box.Box>) => measured(box, Option.getOrUndefined(prev)) }) }),
|
|
187
|
-
...UndefinedOr.match(onLayoutAnimationStart, {
|
|
188
|
-
onUndefined: () => ({}),
|
|
189
|
-
onDefined: (start) => ({ onLayoutAnimationStart: () => Option.fromUndefinedOr(start()) }),
|
|
190
|
-
}),
|
|
191
|
-
...UndefinedOr.match(onLayoutAnimationComplete, {
|
|
192
|
-
onUndefined: () => ({}),
|
|
193
|
-
onDefined: (complete) => ({ onLayoutAnimationComplete: () => Option.fromUndefinedOr(complete()) }),
|
|
194
|
-
}),
|
|
195
|
-
...UndefinedOr.match(onReleaseEnd, {
|
|
196
|
-
onUndefined: () => ({}),
|
|
197
|
-
onDefined: (ended) => ({ onReleaseEnd: () => Option.fromUndefinedOr(ended()) }),
|
|
198
|
-
}),
|
|
199
|
-
...takeOverOf(enteredFrom, fadeFrom),
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/** No options: what most registrations add for a take-over (#286). */
|
|
204
|
-
const NONE = {}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* A take-over's layout start (#286): the leaver's box and fade, each when it has one. Guards, not a
|
|
208
|
-
* match per option: every layout node registers through here.
|
|
209
|
-
*/
|
|
210
|
-
const takeOverOf = (box: Box.Box | undefined, fade: number | undefined): Pick<ProjectionSystem.RegisterNodeOptions, "enteredFrom" | "fadeFrom"> => {
|
|
211
|
-
if (Bool.and(Predicate.isUndefined(box), Predicate.isUndefined(fade))) return NONE
|
|
212
|
-
return { ...UndefinedOr.match(box, { onUndefined: () => NONE, onDefined: (from) => ({ enteredFrom: from }) }), ...UndefinedOr.match(fade, { onUndefined: () => NONE, onDefined: (from) => ({ fadeFrom: from }) }) }
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* The Layout mode a config gives its node (ADR-0009, *Amendment (#42)*): the mode its `layout` names,
|
|
217
|
-
* `true` for `layout` or a `layoutId`, and `false` for a node only a `layoutScroll` or a `layoutRoot` gives,
|
|
218
|
-
* which animates no layout of its own and rides its ancestors', as Motion's (#691). Statement `if`s:
|
|
219
|
-
* read each frame for a Follower.
|
|
220
|
-
*/
|
|
221
|
-
export const layoutModeOf = (layout: WardConfig["layout"], layoutId: string | undefined): Projection.LayoutMode => {
|
|
222
|
-
if (isModeName(layout)) return layout
|
|
223
|
-
if (layout === true) return true
|
|
224
|
-
return Predicate.isNotUndefined(layoutId)
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/** Whether a `layout` prop names a Layout mode (a string), not `true` / `false`. */
|
|
228
|
-
const isModeName = (layout: WardConfig["layout"]): layout is Exclude<WardConfig["layout"], boolean | undefined> => Predicate.isString(layout)
|
|
229
|
-
|
|
230
|
-
/** Whether a config makes its element a projection node: `layout` (or a mode), a `layoutId`, `layoutScroll` or `layoutRoot`. */
|
|
231
|
-
export const wantsLayoutNode = (c: WardConfig): boolean =>
|
|
232
|
-
c.layout === true || Predicate.isString(c.layout) || Predicate.isNotUndefined(c.layoutId) || c.layoutScroll === true || c.layoutRoot === true
|
|
233
|
-
|
|
234
|
-
/** What {@link layoutOptionsOf} reads of a ward. */
|
|
235
|
-
export interface WardLayout {
|
|
236
|
-
readonly id: string
|
|
237
|
-
readonly element: HTMLElement
|
|
238
|
-
/** The ward's config: its static layout props read once, here; the rest read where they're used. */
|
|
239
|
-
readonly config: () => WardConfig
|
|
240
|
-
/** The variant context the ward inherits its default transition from. */
|
|
241
|
-
readonly parent: WardicVariantContextValue | undefined
|
|
242
|
-
/** The ward's Snapshot: its own scale, rotate and opacity, as the renderer draws them. */
|
|
243
|
-
readonly snapshot: { readonly values: Values.Values }
|
|
244
|
-
/** What a release runs on: the node's Release offset (ADR-0016, *Amendment (#140)*). */
|
|
245
|
-
readonly dragTransition: ProjectionSystem.DragTransition
|
|
246
|
-
/** Raise the node while it's dragged: a `<Reorder>` item's. */
|
|
247
|
-
readonly raiseWhileDragged: boolean
|
|
248
|
-
/** Where its child's take-over of a leaver starts it (#286): its box and fade, when it has one. */
|
|
249
|
-
readonly taken?: PresenceSeed | undefined
|
|
250
|
-
/** The id of the **Layout group** the ward was made in (#432), whose namespace its `layoutId` goes in. */
|
|
251
|
-
readonly layoutGroup?: string | undefined
|
|
252
|
-
/** Whether reduced motion applies to it now (ADR-0029): its nearest `WardicConfig`'s, else the provider's (#434). */
|
|
253
|
-
readonly reducedMotion?: (() => boolean) | undefined
|
|
254
|
-
/** Whether its animations are skipped now (#468): its nearest `WardicConfig`'s. */
|
|
255
|
-
readonly skipAnimations?: (() => boolean) | undefined
|
|
256
|
-
/** What a Measure pass holds its transform at (#443): its Transform template's, when it had one at mount. */
|
|
257
|
-
readonly heldTransform?: (() => string) | undefined
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* A ward's layout node options, from its config: `layoutId` (in its **Layout group**'s namespace,
|
|
262
|
-
* #432), `layoutScroll`, `layoutRoot` and `layoutAnchor` read once, at mount; its transition, Layout
|
|
263
|
-
* mode and callbacks read when the projection system needs them.
|
|
264
|
-
*/
|
|
265
|
-
export const layoutOptionsOf = (ward: WardLayout): CreateProjectionNodeOptions => {
|
|
266
|
-
const { config, element, id, parent, snapshot, dragTransition, raiseWhileDragged, taken, layoutGroup, reducedMotion, skipAnimations, heldTransform } = ward
|
|
267
|
-
const c0 = config()
|
|
268
|
-
return {
|
|
269
|
-
id,
|
|
270
|
-
element,
|
|
271
|
-
layoutDependency: () => config().layoutDependency,
|
|
272
|
-
transition: () => ownOrInherited(config().transition, parent),
|
|
273
|
-
dragTransition: () => dragTransition,
|
|
274
|
-
// The Layout mode, read at each layout animation's start, at each Measure pass for a layoutRoot
|
|
275
|
-
// until it isolates, and each frame for a Follower (ADR-0009, *Amendments (#42, #691)*); its
|
|
276
|
-
// `layoutId` is the one read at mount.
|
|
277
|
-
layoutMode: () => layoutModeOf(config().layout, c0.layoutId),
|
|
278
|
-
// The own scale the renderer draws, from the values last written (ADR-0010 *Amendment (#8)*).
|
|
279
|
-
ownScale: () => DomRenderer.ownScaleOf(snapshot.values),
|
|
280
|
-
// And its own translate, which the renderer adds to its projection's (#363).
|
|
281
|
-
ownTranslate: () => DomRenderer.ownTranslateOf(snapshot.values),
|
|
282
|
-
// And its own rotate and opacity, which a handover blends into (ADR-0010 *Amendment (#166)*).
|
|
283
|
-
ownRotate: () => DomRenderer.ownRotateOf(snapshot.values),
|
|
284
|
-
ownOpacity: () => DomRenderer.ownOpacityOf(snapshot.values),
|
|
285
|
-
// The app's layout animation callbacks, read when they fire (#191, ADR-0039).
|
|
286
|
-
onLayoutAnimationStart: () => config().onLayoutAnimationStart,
|
|
287
|
-
onLayoutAnimationComplete: () => config().onLayoutAnimationComplete,
|
|
288
|
-
// The app's `onDragTransitionEnd` (#273): its Release offset at rest.
|
|
289
|
-
onReleaseEnd: () => config().onDragTransitionEnd,
|
|
290
|
-
// Whether a handover onto it crossfades (#442, Motion's `layoutCrossfade`), read as each begins.
|
|
291
|
-
crossfade: () => config().layoutCrossfade !== false,
|
|
292
|
-
...UndefinedOr.match(layoutIdIn(layoutGroup, c0.layoutId), { onUndefined: () => ({}), onDefined: (twinId) => ({ layoutId: twinId }) }),
|
|
293
|
-
...Bool.match(c0.layoutScroll === true, { onTrue: () => ({ layoutScroll: true }), onFalse: () => ({}) }),
|
|
294
|
-
...Bool.match(c0.layoutRoot === true, { onTrue: () => ({ layoutRoot: true }), onFalse: () => ({}) }),
|
|
295
|
-
...UndefinedOr.match(c0.layoutAnchor, { onUndefined: () => ({}), onDefined: (anchor) => ({ layoutAnchor: anchor }) }),
|
|
296
|
-
...Bool.match(raiseWhileDragged, { onTrue: () => ({ raiseWhileDragged: true }), onFalse: () => ({}) }),
|
|
297
|
-
...takenOptionsOf(taken),
|
|
298
|
-
...UndefinedOr.match(reducedMotion, { onUndefined: () => ({}), onDefined: (applies) => ({ reducedMotion: applies }) }),
|
|
299
|
-
...UndefinedOr.match(skipAnimations, { onUndefined: () => ({}), onDefined: (skips) => ({ skipAnimations: skips }) }),
|
|
300
|
-
// Its Transform template's hold for a Measure pass (#443): a node without one is cleared.
|
|
301
|
-
...UndefinedOr.match(heldTransform, { onUndefined: () => ({}), onDefined: (held) => ({ heldTransform: held }) }),
|
|
302
|
-
// The app's layout measure callbacks (#443), read when each is called: a node whose config had
|
|
303
|
-
// none at mount is given none, and pays nothing a pass.
|
|
304
|
-
...Bool.match(Predicate.isNotUndefined(c0.onBeforeLayoutMeasure), {
|
|
305
|
-
onTrue: () => ({ onBeforeMeasure: () => UndefinedOr.map(config().onBeforeLayoutMeasure, (before) => before()) }),
|
|
306
|
-
onFalse: () => ({}),
|
|
307
|
-
}),
|
|
308
|
-
...Bool.match(Predicate.isNotUndefined(c0.onLayoutMeasure), {
|
|
309
|
-
onTrue: () => ({ onMeasure: (box: Box.Box, prev: Box.Box | undefined) => UndefinedOr.map(config().onLayoutMeasure, (measured) => measured(box, prev)) }),
|
|
310
|
-
onFalse: () => ({}),
|
|
311
|
-
}),
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
/** A take-over's layout start (#286), when its child took over from a leaver: its box and fade. */
|
|
316
|
-
const takenOptionsOf = (taken: PresenceSeed | undefined): Pick<CreateProjectionNodeOptions, "enteredFrom" | "fadeFrom"> => {
|
|
317
|
-
if (Predicate.isUndefined(taken)) return NONE
|
|
318
|
-
return takeOverOf(taken.box, taken.fade)
|
|
319
|
-
}
|
|
1
|
+
// #672: @wardic/dom/unstable/LayoutMember since the lift; solid's modules import it through
|
|
2
|
+
// here until each has moved.
|
|
3
|
+
export * from "@wardic/dom/unstable/LayoutMember"
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type * as ProjectionSystem from "@wardic/dom/ProjectionSystem"
|
|
8
8
|
import type * as Context from "effect/Context"
|
|
9
|
-
import
|
|
9
|
+
import type { ProjectionNodes } from "./features/keys.ts"
|
|
10
|
+
import { layoutBrought, type LayoutServices, projectionBrought, projectionNodesBrought } from "./features/layout.ts"
|
|
10
11
|
import { fromWardicContext } from "./provider.tsx"
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -19,6 +20,14 @@ export function useWardicProjection(): ProjectionSystem.Shape {
|
|
|
19
20
|
return fromWardicContext("useWardicProjection", projectionBrought)
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
/**
|
|
24
|
+
* The `layout` Feature's element code beside {@link useWardicProjection}'s system (#746): what
|
|
25
|
+
* `createProjectionNode` registers its node through, after `useWardicProjection`. Internal.
|
|
26
|
+
*/
|
|
27
|
+
export function useProjectionNodes(): ProjectionNodes["Service"] {
|
|
28
|
+
return fromWardicContext("useWardicProjection", projectionNodesBrought)
|
|
29
|
+
}
|
|
30
|
+
|
|
22
31
|
/**
|
|
23
32
|
* {@link useWardicProjection}'s services, all of them, for a Reorder controller: the projection system
|
|
24
33
|
* and what it hears each Measure pass by (#618). Internal.
|
package/src/layout.tsx
CHANGED
|
@@ -21,8 +21,9 @@ import type * as ProjectionSystem from "@wardic/dom/ProjectionSystem"
|
|
|
21
21
|
import * as Bool from "effect/Boolean"
|
|
22
22
|
import { createContext, createEffect, createMemo, type JSX, on, onCleanup, untrack, useContext } from "solid-js"
|
|
23
23
|
import { layoutGroupIdOf, type LayoutGroupInherit } from "./layout-group.ts"
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import type { ProjectionNodes } from "./features/keys.ts"
|
|
25
|
+
import type { CreateProjectionNodeOptions } from "./layout-member.ts"
|
|
26
|
+
import { useProjectionNodes, useWardicProjection } from "./layout-projection.tsx"
|
|
26
27
|
import { isServer } from "./server.ts"
|
|
27
28
|
|
|
28
29
|
export type { CreateProjectionNodeOptions } from "./layout-member.ts"
|
|
@@ -44,14 +45,14 @@ export type { CreateProjectionNodeOptions } from "./layout-member.ts"
|
|
|
44
45
|
// lead/follow stack, and seeds its first measure from a twin disposed in the same task (a Switch), in
|
|
45
46
|
// either swap order (ADR-0010 *Amendment (#13)*), so there's no registry here. It brings `layout`
|
|
46
47
|
// (#511), whatever its section has: a Slim element's own layout node is its section's.
|
|
47
|
-
export const createProjectionNode = (opts: CreateProjectionNodeOptions): ProjectionSystem.NodeHandle => projectionNodeOf(useWardicProjection(), opts)
|
|
48
|
+
export const createProjectionNode = (opts: CreateProjectionNodeOptions): ProjectionSystem.NodeHandle => projectionNodeOf(useWardicProjection(), useProjectionNodes(), opts)
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* {@link createProjectionNode} on `projection`: an element's, its section's `layout` Feature's (#511), where
|
|
51
|
-
* `createProjectionNode` brings it. Internal.
|
|
52
|
+
* `createProjectionNode` brings it, registered through the Feature's `nodes` (#746). Internal.
|
|
52
53
|
*/
|
|
53
|
-
export const projectionNodeOf = (projection: ProjectionSystem.Shape, opts: CreateProjectionNodeOptions): ProjectionSystem.NodeHandle => {
|
|
54
|
-
const handle = projection.register(registrationOf(opts))
|
|
54
|
+
export const projectionNodeOf = (projection: ProjectionSystem.Shape, nodes: ProjectionNodes["Service"], opts: CreateProjectionNodeOptions): ProjectionSystem.NodeHandle => {
|
|
55
|
+
const handle = projection.register(nodes.registrationOf(opts))
|
|
55
56
|
onCleanup(handle.dispose)
|
|
56
57
|
// Compared before it measures, as Motion's `prevProps.layoutDependency !== layoutDependency`: an
|
|
57
58
|
// effect re-runs at any change of what it read, and the config is read again at any prop's (#618).
|