@wardic/solid 1.0.0-rc.1 → 1.0.0-rc.11
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/dist/browser/animation-controls.js +1 -1
- package/dist/browser/animation-controls.js.map +1 -1
- package/dist/browser/appear.js +20 -3
- package/dist/browser/appear.js.map +1 -1
- package/dist/browser/batch-appear-here.js +29 -0
- package/dist/browser/batch-appear-here.js.map +1 -0
- package/dist/browser/batch-gestures.js +174 -0
- package/dist/browser/batch-gestures.js.map +1 -0
- package/dist/browser/batch-handoff.js +72 -0
- package/dist/browser/batch-handoff.js.map +1 -0
- package/dist/browser/batch-reorder-group.js +345 -0
- package/dist/browser/batch-reorder-group.js.map +1 -0
- package/dist/browser/batch-reorder-places.js +207 -0
- package/dist/browser/batch-reorder-places.js.map +1 -0
- package/dist/browser/batch-reorder.js +641 -0
- package/dist/browser/batch-reorder.js.map +1 -0
- package/dist/browser/batch.js +2512 -0
- package/dist/browser/batch.js.map +1 -0
- package/dist/browser/bridge.js +2 -2
- package/dist/browser/bridge.js.map +1 -1
- package/dist/browser/complete.js.map +1 -1
- package/dist/browser/create-animate.js.map +1 -1
- package/dist/browser/create-batch.js +120 -0
- package/dist/browser/create-batch.js.map +1 -0
- package/dist/browser/create-ward.js +5 -3
- package/dist/browser/create-ward.js.map +1 -1
- package/dist/browser/directive.js.map +1 -1
- package/dist/browser/drag-sensor.js.map +1 -1
- package/dist/browser/drag-track.js +13 -3
- package/dist/browser/drag-track.js.map +1 -1
- package/dist/browser/drag.js.map +1 -1
- package/dist/browser/feature.js +10 -0
- package/dist/browser/feature.js.map +1 -1
- package/dist/browser/features/input.js +2 -5
- package/dist/browser/features/input.js.map +1 -1
- package/dist/browser/features/scroll.js +21 -0
- package/dist/browser/features/scroll.js.map +1 -0
- package/dist/browser/focus-sensor.js.map +1 -1
- package/dist/browser/hover-sensor.js.map +1 -1
- package/dist/browser/imperative.js +105 -10
- package/dist/browser/imperative.js.map +1 -1
- package/dist/browser/index.js +5 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/layout-member.js +17 -5
- package/dist/browser/layout-member.js.map +1 -1
- package/dist/browser/layout-projection.js.map +1 -1
- package/dist/browser/layout.js +1 -1
- package/dist/browser/layout.js.map +1 -1
- package/dist/browser/lazy-batch-gestures.js +64 -0
- package/dist/browser/lazy-batch-gestures.js.map +1 -0
- package/dist/browser/live-scroll.js +115 -0
- package/dist/browser/live-scroll.js.map +1 -0
- package/dist/browser/live-style.js +2 -1
- package/dist/browser/live-style.js.map +1 -1
- package/dist/browser/live-value.js +12 -98
- package/dist/browser/live-value.js.map +1 -1
- package/dist/browser/member-hold.js +181 -0
- package/dist/browser/member-hold.js.map +1 -0
- package/dist/browser/presence-controller.js +161 -35
- package/dist/browser/presence-controller.js.map +1 -1
- package/dist/browser/presence-record.js.map +1 -1
- package/dist/browser/press-sensor.js.map +1 -1
- package/dist/browser/press.js +2 -2
- package/dist/browser/press.js.map +1 -1
- package/dist/browser/reorder-input.js +73 -2
- package/dist/browser/reorder-input.js.map +1 -1
- package/dist/browser/reorder-values.js +20 -0
- package/dist/browser/reorder-values.js.map +1 -0
- package/dist/browser/reorder.js +27 -16
- package/dist/browser/reorder.js.map +1 -1
- package/dist/browser/retarget-legs.js +6 -3
- package/dist/browser/retarget-legs.js.map +1 -1
- package/dist/browser/runtime.js +21 -3
- package/dist/browser/runtime.js.map +1 -1
- package/dist/browser/sensors.js +3 -3
- package/dist/browser/sensors.js.map +1 -1
- package/dist/browser/spine.js +127 -22
- package/dist/browser/spine.js.map +1 -1
- package/dist/browser/unstable/v2/batch-appear-here.js +28 -0
- package/dist/browser/unstable/v2/batch-appear-here.js.map +1 -0
- package/dist/browser/unstable/v2/batch-reorder-group.js +267 -0
- package/dist/browser/unstable/v2/batch-reorder-group.js.map +1 -0
- package/dist/browser/unstable/v2/bridge.js +2 -2
- package/dist/browser/unstable/v2/bridge.js.map +1 -1
- package/dist/browser/unstable/v2/complete.js.map +1 -1
- package/dist/browser/unstable/v2/create-animate.js +11 -46
- package/dist/browser/unstable/v2/create-animate.js.map +1 -1
- package/dist/browser/unstable/v2/create-batch.js +144 -0
- package/dist/browser/unstable/v2/create-batch.js.map +1 -0
- package/dist/browser/unstable/v2/drag-sensor.js.map +1 -1
- package/dist/browser/unstable/v2/element.js +4 -2
- package/dist/browser/unstable/v2/element.js.map +1 -1
- package/dist/browser/unstable/v2/flights.js +57 -0
- package/dist/browser/unstable/v2/flights.js.map +1 -0
- package/dist/browser/unstable/v2/focus-sensor.js.map +1 -1
- package/dist/browser/unstable/v2/hover-sensor.js.map +1 -1
- package/dist/browser/unstable/v2/index.js +4 -1
- package/dist/browser/unstable/v2/index.js.map +1 -1
- package/dist/browser/unstable/v2/layout-projection.js.map +1 -1
- package/dist/browser/unstable/v2/layout.js +1 -1
- package/dist/browser/unstable/v2/layout.js.map +1 -1
- package/dist/browser/unstable/v2/live-scroll.js +128 -0
- package/dist/browser/unstable/v2/live-scroll.js.map +1 -0
- package/dist/browser/unstable/v2/live-value.js +7 -105
- package/dist/browser/unstable/v2/live-value.js.map +1 -1
- package/dist/browser/unstable/v2/presence-hooks.js.map +1 -1
- package/dist/browser/unstable/v2/press-sensor.js.map +1 -1
- package/dist/browser/unstable/v2/provider.js +13 -7
- package/dist/browser/unstable/v2/provider.js.map +1 -1
- package/dist/browser/unstable/v2/reorder.js +14 -6
- package/dist/browser/unstable/v2/reorder.js.map +1 -1
- package/dist/browser/unstable/v2/sensors.js +2 -2
- package/dist/browser/unstable/v2/sensors.js.map +1 -1
- package/dist/browser/unstable/v2/ward.js +13 -4
- package/dist/browser/unstable/v2/ward.js.map +1 -1
- package/dist/browser/unstable/v2/wardic.js.map +1 -1
- package/dist/browser/variant-target.js +6 -1
- package/dist/browser/variant-target.js.map +1 -1
- package/dist/browser/w.js.map +1 -1
- package/dist/browser/wardic.js.map +1 -1
- package/dist/server/animation-controls.js +1 -1
- package/dist/server/animation-controls.js.map +1 -1
- package/dist/server/appear.js +20 -3
- package/dist/server/appear.js.map +1 -1
- package/dist/server/batch-appear-here.js +29 -0
- package/dist/server/batch-appear-here.js.map +1 -0
- package/dist/server/batch-gestures.js +174 -0
- package/dist/server/batch-gestures.js.map +1 -0
- package/dist/server/batch-handoff.js +72 -0
- package/dist/server/batch-handoff.js.map +1 -0
- package/dist/server/batch-reorder-group.js +341 -0
- package/dist/server/batch-reorder-group.js.map +1 -0
- package/dist/server/batch-reorder-places.js +207 -0
- package/dist/server/batch-reorder-places.js.map +1 -0
- package/dist/server/batch-reorder.js +641 -0
- package/dist/server/batch-reorder.js.map +1 -0
- package/dist/server/batch.js +2512 -0
- package/dist/server/batch.js.map +1 -0
- package/dist/server/bridge.js +2 -2
- package/dist/server/bridge.js.map +1 -1
- package/dist/server/complete.js.map +1 -1
- package/dist/server/create-animate.js.map +1 -1
- package/dist/server/create-batch.js +120 -0
- package/dist/server/create-batch.js.map +1 -0
- package/dist/server/create-ward.js +5 -3
- package/dist/server/create-ward.js.map +1 -1
- package/dist/server/directive.js.map +1 -1
- package/dist/server/drag-sensor.js.map +1 -1
- package/dist/server/drag-track.js +13 -3
- package/dist/server/drag-track.js.map +1 -1
- package/dist/server/drag.js.map +1 -1
- package/dist/server/feature.js +10 -0
- package/dist/server/feature.js.map +1 -1
- package/dist/server/features/input.js +2 -5
- package/dist/server/features/input.js.map +1 -1
- package/dist/server/features/scroll.js +21 -0
- package/dist/server/features/scroll.js.map +1 -0
- package/dist/server/focus-sensor.js.map +1 -1
- package/dist/server/hover-sensor.js.map +1 -1
- package/dist/server/imperative.js +105 -10
- package/dist/server/imperative.js.map +1 -1
- package/dist/server/index.js +5 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/layout-member.js +17 -5
- package/dist/server/layout-member.js.map +1 -1
- package/dist/server/layout-projection.js.map +1 -1
- package/dist/server/layout.js +1 -1
- package/dist/server/layout.js.map +1 -1
- package/dist/server/lazy-batch-gestures.js +64 -0
- package/dist/server/lazy-batch-gestures.js.map +1 -0
- package/dist/server/live-scroll.js +115 -0
- package/dist/server/live-scroll.js.map +1 -0
- package/dist/server/live-style.js +2 -1
- package/dist/server/live-style.js.map +1 -1
- package/dist/server/live-value.js +12 -98
- package/dist/server/live-value.js.map +1 -1
- package/dist/server/member-hold.js +181 -0
- package/dist/server/member-hold.js.map +1 -0
- package/dist/server/presence-controller.js +161 -35
- package/dist/server/presence-controller.js.map +1 -1
- package/dist/server/presence-record.js.map +1 -1
- package/dist/server/press-sensor.js.map +1 -1
- package/dist/server/press.js +2 -2
- package/dist/server/press.js.map +1 -1
- package/dist/server/reorder-input.js +73 -2
- package/dist/server/reorder-input.js.map +1 -1
- package/dist/server/reorder-values.js +20 -0
- package/dist/server/reorder-values.js.map +1 -0
- package/dist/server/reorder.js +27 -16
- package/dist/server/reorder.js.map +1 -1
- package/dist/server/retarget-legs.js +6 -3
- package/dist/server/retarget-legs.js.map +1 -1
- package/dist/server/runtime.js +21 -3
- package/dist/server/runtime.js.map +1 -1
- package/dist/server/sensors.js +3 -3
- package/dist/server/sensors.js.map +1 -1
- package/dist/server/spine.js +127 -22
- package/dist/server/spine.js.map +1 -1
- package/dist/server/unstable/v2/batch-appear-here.js +28 -0
- package/dist/server/unstable/v2/batch-appear-here.js.map +1 -0
- package/dist/server/unstable/v2/batch-reorder-group.js +378 -0
- package/dist/server/unstable/v2/batch-reorder-group.js.map +1 -0
- package/dist/server/unstable/v2/bridge.js +2 -2
- package/dist/server/unstable/v2/bridge.js.map +1 -1
- package/dist/server/unstable/v2/complete.js.map +1 -1
- package/dist/server/unstable/v2/create-animate.js +11 -46
- package/dist/server/unstable/v2/create-animate.js.map +1 -1
- package/dist/server/unstable/v2/create-batch.js +144 -0
- package/dist/server/unstable/v2/create-batch.js.map +1 -0
- package/dist/server/unstable/v2/drag-sensor.js.map +1 -1
- package/dist/server/unstable/v2/element.js +4 -2
- package/dist/server/unstable/v2/element.js.map +1 -1
- package/dist/server/unstable/v2/flights.js +57 -0
- package/dist/server/unstable/v2/flights.js.map +1 -0
- package/dist/server/unstable/v2/focus-sensor.js.map +1 -1
- package/dist/server/unstable/v2/hover-sensor.js.map +1 -1
- package/dist/server/unstable/v2/index.js +4 -1
- package/dist/server/unstable/v2/index.js.map +1 -1
- package/dist/server/unstable/v2/layout-projection.js.map +1 -1
- package/dist/server/unstable/v2/layout.js +1 -1
- package/dist/server/unstable/v2/layout.js.map +1 -1
- package/dist/server/unstable/v2/live-scroll.js +128 -0
- package/dist/server/unstable/v2/live-scroll.js.map +1 -0
- package/dist/server/unstable/v2/live-value.js +7 -105
- package/dist/server/unstable/v2/live-value.js.map +1 -1
- package/dist/server/unstable/v2/presence-hooks.js.map +1 -1
- package/dist/server/unstable/v2/press-sensor.js.map +1 -1
- package/dist/server/unstable/v2/provider.js +13 -7
- package/dist/server/unstable/v2/provider.js.map +1 -1
- package/dist/server/unstable/v2/reorder.js +14 -6
- package/dist/server/unstable/v2/reorder.js.map +1 -1
- package/dist/server/unstable/v2/sensors.js +2 -2
- package/dist/server/unstable/v2/sensors.js.map +1 -1
- package/dist/server/unstable/v2/ward.js +13 -4
- package/dist/server/unstable/v2/ward.js.map +1 -1
- package/dist/server/unstable/v2/wardic.js.map +1 -1
- package/dist/server/variant-target.js +6 -1
- package/dist/server/variant-target.js.map +1 -1
- package/dist/server/w.js.map +1 -1
- package/dist/server/wardic.js.map +1 -1
- package/dist/solid/animation-controls.d.ts +3 -4
- package/dist/solid/animation-controls.d.ts.map +1 -1
- package/dist/solid/animation-controls.js +1 -1
- package/dist/solid/animation-controls.js.map +1 -1
- package/dist/solid/appear.d.ts +14 -0
- package/dist/solid/appear.d.ts.map +1 -1
- package/dist/solid/appear.js +14 -3
- package/dist/solid/appear.js.map +1 -1
- package/dist/solid/batch-appear-here.d.ts +9 -0
- package/dist/solid/batch-appear-here.d.ts.map +1 -0
- package/dist/solid/batch-appear-here.jsx +25 -0
- package/dist/solid/batch-appear-here.jsx.map +1 -0
- package/dist/solid/batch-gestures.d.ts +22 -0
- package/dist/solid/batch-gestures.d.ts.map +1 -0
- package/dist/solid/batch-gestures.js +138 -0
- package/dist/solid/batch-gestures.js.map +1 -0
- package/dist/solid/batch-handoff.d.ts +25 -0
- package/dist/solid/batch-handoff.d.ts.map +1 -0
- package/dist/solid/batch-handoff.js +75 -0
- package/dist/solid/batch-handoff.js.map +1 -0
- package/dist/solid/batch-reorder-group.d.ts +118 -0
- package/dist/solid/batch-reorder-group.d.ts.map +1 -0
- package/dist/solid/batch-reorder-group.jsx +271 -0
- package/dist/solid/batch-reorder-group.jsx.map +1 -0
- package/dist/solid/batch-reorder-places.d.ts +115 -0
- package/dist/solid/batch-reorder-places.d.ts.map +1 -0
- package/dist/solid/batch-reorder-places.js +139 -0
- package/dist/solid/batch-reorder-places.js.map +1 -0
- package/dist/solid/batch-reorder.d.ts +115 -0
- package/dist/solid/batch-reorder.d.ts.map +1 -0
- package/dist/solid/batch-reorder.js +579 -0
- package/dist/solid/batch-reorder.js.map +1 -0
- package/dist/solid/batch.d.ts +512 -0
- package/dist/solid/batch.d.ts.map +1 -0
- package/dist/solid/batch.js +2485 -0
- package/dist/solid/batch.js.map +1 -0
- package/dist/solid/bridge.d.ts +2 -2
- package/dist/solid/bridge.d.ts.map +1 -1
- package/dist/solid/{bridge.js → bridge.jsx} +3 -3
- package/dist/solid/bridge.jsx.map +1 -0
- package/dist/solid/complete.d.ts.map +1 -1
- package/dist/solid/{complete.js → complete.jsx} +1 -1
- package/dist/solid/complete.jsx.map +1 -0
- package/dist/solid/config.d.ts +6 -2
- package/dist/solid/config.d.ts.map +1 -1
- package/dist/solid/create-animate.d.ts.map +1 -1
- package/dist/solid/{create-animate.js → create-animate.jsx} +1 -1
- package/dist/solid/create-animate.jsx.map +1 -0
- package/dist/solid/create-batch.d.ts +94 -0
- package/dist/solid/create-batch.d.ts.map +1 -0
- package/dist/solid/create-batch.jsx +109 -0
- package/dist/solid/create-batch.jsx.map +1 -0
- package/dist/solid/create-ward.d.ts +1 -1
- package/dist/solid/create-ward.d.ts.map +1 -1
- package/dist/solid/create-ward.jsx +8 -6
- package/dist/solid/create-ward.jsx.map +1 -1
- package/dist/solid/directive.d.ts.map +1 -1
- package/dist/solid/{directive.js → directive.jsx} +1 -1
- package/dist/solid/directive.jsx.map +1 -0
- package/dist/solid/drag-sensor.d.ts.map +1 -1
- package/dist/solid/{drag-sensor.js → drag-sensor.jsx} +2 -2
- package/dist/solid/drag-sensor.jsx.map +1 -0
- package/dist/solid/drag-track.d.ts +6 -0
- package/dist/solid/drag-track.d.ts.map +1 -1
- package/dist/solid/drag-track.js +14 -3
- package/dist/solid/drag-track.js.map +1 -1
- package/dist/solid/drag.d.ts.map +1 -1
- package/dist/solid/{drag.js → drag.jsx} +1 -1
- package/dist/solid/drag.jsx.map +1 -0
- package/dist/solid/feature.d.ts +5 -0
- package/dist/solid/feature.d.ts.map +1 -1
- package/dist/solid/feature.js +10 -0
- package/dist/solid/feature.js.map +1 -1
- package/dist/solid/features/input.d.ts.map +1 -1
- package/dist/solid/features/input.js +2 -6
- package/dist/solid/features/input.js.map +1 -1
- package/dist/solid/features/scroll.d.ts +16 -0
- package/dist/solid/features/scroll.d.ts.map +1 -0
- package/dist/solid/features/scroll.js +21 -0
- package/dist/solid/features/scroll.js.map +1 -0
- package/dist/solid/focus-sensor.d.ts.map +1 -1
- package/dist/solid/{focus-sensor.js → focus-sensor.jsx} +2 -2
- package/dist/solid/focus-sensor.jsx.map +1 -0
- package/dist/solid/hover-sensor.d.ts.map +1 -1
- package/dist/solid/{hover-sensor.js → hover-sensor.jsx} +2 -2
- package/dist/solid/hover-sensor.jsx.map +1 -0
- package/dist/solid/imperative.d.ts +10 -2
- package/dist/solid/imperative.d.ts.map +1 -1
- package/dist/solid/imperative.js +96 -9
- package/dist/solid/imperative.js.map +1 -1
- package/dist/solid/index.d.ts +17 -13
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/{index.js → index.jsx} +15 -12
- package/dist/solid/index.jsx.map +1 -0
- package/dist/solid/layout-member.d.ts +15 -5
- package/dist/solid/layout-member.d.ts.map +1 -1
- package/dist/solid/layout-member.js +19 -5
- package/dist/solid/layout-member.js.map +1 -1
- package/dist/solid/layout-projection.d.ts.map +1 -1
- package/dist/solid/{layout-projection.js → layout-projection.jsx} +1 -1
- package/dist/solid/layout-projection.jsx.map +1 -0
- package/dist/solid/layout.jsx +2 -2
- package/dist/solid/layout.jsx.map +1 -1
- package/dist/solid/lazy-batch-gestures.d.ts +13 -0
- package/dist/solid/lazy-batch-gestures.d.ts.map +1 -0
- package/dist/solid/lazy-batch-gestures.js +70 -0
- package/dist/solid/lazy-batch-gestures.js.map +1 -0
- package/dist/solid/live-scroll.d.ts +47 -0
- package/dist/solid/live-scroll.d.ts.map +1 -0
- package/dist/solid/live-scroll.jsx +84 -0
- package/dist/solid/live-scroll.jsx.map +1 -0
- package/dist/solid/live-style.d.ts +2 -1
- package/dist/solid/live-style.d.ts.map +1 -1
- package/dist/solid/live-style.js +2 -1
- package/dist/solid/live-style.js.map +1 -1
- package/dist/solid/live-value.d.ts +4 -45
- package/dist/solid/live-value.d.ts.map +1 -1
- package/dist/solid/{live-value.js → live-value.jsx} +15 -69
- package/dist/solid/live-value.jsx.map +1 -0
- package/dist/solid/member-hold.d.ts +47 -0
- package/dist/solid/member-hold.d.ts.map +1 -0
- package/dist/solid/member-hold.js +189 -0
- package/dist/solid/member-hold.js.map +1 -0
- package/dist/solid/presence-controller.d.ts.map +1 -1
- package/dist/solid/presence-controller.js +156 -27
- package/dist/solid/presence-controller.js.map +1 -1
- package/dist/solid/presence-record.d.ts +8 -2
- package/dist/solid/presence-record.d.ts.map +1 -1
- package/dist/solid/presence-record.js.map +1 -1
- package/dist/solid/press-sensor.d.ts.map +1 -1
- package/dist/solid/{press-sensor.js → press-sensor.jsx} +2 -2
- package/dist/solid/press-sensor.jsx.map +1 -0
- package/dist/solid/press.js +2 -2
- package/dist/solid/press.js.map +1 -1
- package/dist/solid/provider.d.ts +1 -1
- package/dist/solid/provider.d.ts.map +1 -1
- package/dist/solid/reorder-input.d.ts +22 -1
- package/dist/solid/reorder-input.d.ts.map +1 -1
- package/dist/solid/reorder-input.js +70 -2
- package/dist/solid/reorder-input.js.map +1 -1
- package/dist/solid/reorder-values.d.ts +6 -0
- package/dist/solid/reorder-values.d.ts.map +1 -0
- package/dist/solid/reorder-values.js +21 -0
- package/dist/solid/reorder-values.js.map +1 -0
- package/dist/solid/reorder.d.ts +8 -4
- package/dist/solid/reorder.d.ts.map +1 -1
- package/dist/solid/reorder.jsx +23 -13
- package/dist/solid/reorder.jsx.map +1 -1
- package/dist/solid/retarget-legs.d.ts.map +1 -1
- package/dist/solid/retarget-legs.js +4 -3
- package/dist/solid/retarget-legs.js.map +1 -1
- package/dist/solid/runtime.d.ts +1 -1
- package/dist/solid/runtime.d.ts.map +1 -1
- package/dist/solid/runtime.js +21 -3
- package/dist/solid/runtime.js.map +1 -1
- package/dist/solid/sensors.d.ts.map +1 -1
- package/dist/solid/{sensors.js → sensors.jsx} +5 -5
- package/dist/solid/sensors.jsx.map +1 -0
- package/dist/solid/spine.d.ts +21 -5
- package/dist/solid/spine.d.ts.map +1 -1
- package/dist/solid/spine.js +143 -17
- package/dist/solid/spine.js.map +1 -1
- package/dist/solid/unstable/v2/batch-appear-here.d.ts +9 -0
- package/dist/solid/unstable/v2/batch-appear-here.d.ts.map +1 -0
- package/dist/solid/unstable/v2/batch-appear-here.jsx +24 -0
- package/dist/solid/unstable/v2/batch-appear-here.jsx.map +1 -0
- package/dist/solid/unstable/v2/batch-reorder-group.d.ts +119 -0
- package/dist/solid/unstable/v2/batch-reorder-group.d.ts.map +1 -0
- package/dist/solid/unstable/v2/batch-reorder-group.jsx +211 -0
- package/dist/solid/unstable/v2/batch-reorder-group.jsx.map +1 -0
- package/dist/solid/unstable/v2/bridge.d.ts +3 -2
- package/dist/solid/unstable/v2/bridge.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{bridge.js → bridge.jsx} +3 -3
- package/dist/solid/unstable/v2/bridge.jsx.map +1 -0
- package/dist/solid/unstable/v2/complete.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{complete.js → complete.jsx} +1 -1
- package/dist/solid/unstable/v2/complete.jsx.map +1 -0
- package/dist/solid/unstable/v2/create-animate.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{create-animate.js → create-animate.jsx} +8 -52
- package/dist/solid/unstable/v2/create-animate.jsx.map +1 -0
- package/dist/solid/unstable/v2/create-batch.d.ts +106 -0
- package/dist/solid/unstable/v2/create-batch.d.ts.map +1 -0
- package/dist/solid/unstable/v2/create-batch.jsx +135 -0
- package/dist/solid/unstable/v2/create-batch.jsx.map +1 -0
- package/dist/solid/unstable/v2/drag-sensor.d.ts +1 -1
- package/dist/solid/unstable/v2/drag-sensor.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{drag-sensor.js → drag-sensor.jsx} +2 -2
- package/dist/solid/unstable/v2/drag-sensor.jsx.map +1 -0
- package/dist/solid/unstable/v2/element.d.ts.map +1 -1
- package/dist/solid/unstable/v2/element.jsx +4 -2
- package/dist/solid/unstable/v2/element.jsx.map +1 -1
- package/dist/solid/unstable/v2/flights.d.ts +10 -0
- package/dist/solid/unstable/v2/flights.d.ts.map +1 -0
- package/dist/solid/unstable/v2/flights.js +63 -0
- package/dist/solid/unstable/v2/flights.js.map +1 -0
- package/dist/solid/unstable/v2/focus-sensor.d.ts +1 -1
- package/dist/solid/unstable/v2/focus-sensor.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{focus-sensor.js → focus-sensor.jsx} +2 -2
- package/dist/solid/unstable/v2/focus-sensor.jsx.map +1 -0
- package/dist/solid/unstable/v2/hover-sensor.d.ts +1 -1
- package/dist/solid/unstable/v2/hover-sensor.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{hover-sensor.js → hover-sensor.jsx} +2 -2
- package/dist/solid/unstable/v2/hover-sensor.jsx.map +1 -0
- package/dist/solid/unstable/v2/index.d.ts +16 -13
- package/dist/solid/unstable/v2/index.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{index.js → index.jsx} +14 -11
- package/dist/solid/unstable/v2/index.jsx.map +1 -0
- package/dist/solid/unstable/v2/layout-projection.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{layout-projection.js → layout-projection.jsx} +1 -1
- package/dist/solid/unstable/v2/layout-projection.jsx.map +1 -0
- package/dist/solid/unstable/v2/layout.jsx +2 -2
- package/dist/solid/unstable/v2/layout.jsx.map +1 -1
- package/dist/solid/unstable/v2/live-scroll.d.ts +47 -0
- package/dist/solid/unstable/v2/live-scroll.d.ts.map +1 -0
- package/dist/solid/unstable/v2/live-scroll.jsx +94 -0
- package/dist/solid/unstable/v2/live-scroll.jsx.map +1 -0
- package/dist/solid/unstable/v2/live-value.d.ts +4 -45
- package/dist/solid/unstable/v2/live-value.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{live-value.js → live-value.jsx} +9 -73
- package/dist/solid/unstable/v2/live-value.jsx.map +1 -0
- package/dist/solid/unstable/v2/presence-hooks.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{presence-hooks.js → presence-hooks.jsx} +1 -1
- package/dist/solid/unstable/v2/presence-hooks.jsx.map +1 -0
- package/dist/solid/unstable/v2/press-sensor.d.ts +1 -1
- package/dist/solid/unstable/v2/press-sensor.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{press-sensor.js → press-sensor.jsx} +2 -2
- package/dist/solid/unstable/v2/press-sensor.jsx.map +1 -0
- package/dist/solid/unstable/v2/provider.d.ts +1 -1
- package/dist/solid/unstable/v2/provider.d.ts.map +1 -1
- package/dist/solid/unstable/v2/provider.jsx +14 -7
- package/dist/solid/unstable/v2/provider.jsx.map +1 -1
- package/dist/solid/unstable/v2/reorder.d.ts +7 -3
- package/dist/solid/unstable/v2/reorder.d.ts.map +1 -1
- package/dist/solid/unstable/v2/reorder.jsx +13 -7
- package/dist/solid/unstable/v2/reorder.jsx.map +1 -1
- package/dist/solid/unstable/v2/sensors.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{sensors.js → sensors.jsx} +4 -4
- package/dist/solid/unstable/v2/sensors.jsx.map +1 -0
- package/dist/solid/unstable/v2/ward.d.ts +1 -1
- package/dist/solid/unstable/v2/ward.d.ts.map +1 -1
- package/dist/solid/unstable/v2/ward.jsx +14 -5
- package/dist/solid/unstable/v2/ward.jsx.map +1 -1
- package/dist/solid/unstable/v2/wardic.jsx +1 -1
- package/dist/solid/unstable/v2/wardic.jsx.map +1 -1
- package/dist/solid/variant-target.d.ts +2 -0
- package/dist/solid/variant-target.d.ts.map +1 -1
- package/dist/solid/variant-target.js +3 -1
- package/dist/solid/variant-target.js.map +1 -1
- package/dist/solid/w.jsx +1 -1
- package/dist/solid/w.jsx.map +1 -1
- package/dist/solid/ward-keys.d.ts +1 -1
- package/dist/solid/ward-keys.d.ts.map +1 -1
- package/dist/solid/wardic.jsx +2 -2
- package/dist/solid/wardic.jsx.map +1 -1
- package/package.json +17 -17
- package/src/animation-controls.ts +4 -2
- package/src/appear.ts +23 -3
- package/src/batch-appear-here.tsx +25 -0
- package/src/batch-gestures.ts +159 -0
- package/src/batch-handoff.ts +87 -0
- package/src/batch-reorder-group.tsx +497 -0
- package/src/batch-reorder-places.ts +257 -0
- package/src/batch-reorder.ts +764 -0
- package/src/batch.ts +3078 -0
- package/src/{bridge.ts → bridge.tsx} +6 -5
- package/src/config.ts +8 -3
- package/src/create-batch.tsx +219 -0
- package/src/create-ward.tsx +8 -5
- package/src/{drag-sensor.ts → drag-sensor.tsx} +1 -1
- package/src/drag-track.ts +21 -3
- package/src/feature.ts +17 -0
- package/src/features/input.ts +2 -10
- package/src/features/scroll.ts +21 -0
- package/src/{focus-sensor.ts → focus-sensor.tsx} +1 -1
- package/src/{hover-sensor.ts → hover-sensor.tsx} +1 -1
- package/src/imperative.ts +128 -16
- package/src/{index.ts → index.tsx} +39 -15
- package/src/layout-member.ts +28 -9
- package/src/layout.tsx +2 -2
- package/src/lazy-batch-gestures.ts +78 -0
- package/src/live-scroll.tsx +125 -0
- package/src/live-style.ts +2 -1
- package/src/{live-value.ts → live-value.tsx} +17 -111
- package/src/member-hold.ts +222 -0
- package/src/presence-controller.ts +160 -27
- package/src/presence-record.ts +9 -2
- package/src/{press-sensor.ts → press-sensor.tsx} +1 -1
- package/src/press.ts +2 -2
- package/src/provider.tsx +1 -1
- package/src/reorder-input.ts +91 -4
- package/src/reorder-values.ts +20 -0
- package/src/reorder.tsx +27 -14
- package/src/retarget-legs.ts +4 -3
- package/src/runtime.ts +25 -3
- package/src/{sensors.ts → sensors.tsx} +4 -4
- package/src/spine.ts +136 -13
- package/src/unstable/v2/batch-appear-here.tsx +24 -0
- package/src/unstable/v2/batch-reorder-group.tsx +385 -0
- package/src/unstable/v2/{bridge.ts → bridge.tsx} +6 -5
- package/src/unstable/v2/{create-animate.ts → create-animate.tsx} +7 -45
- package/src/unstable/v2/create-batch.tsx +265 -0
- package/src/unstable/v2/{drag-sensor.ts → drag-sensor.tsx} +1 -1
- package/src/unstable/v2/element.tsx +4 -2
- package/src/unstable/v2/flights.ts +65 -0
- package/src/unstable/v2/{focus-sensor.ts → focus-sensor.tsx} +1 -1
- package/src/unstable/v2/{hover-sensor.ts → hover-sensor.tsx} +1 -1
- package/src/unstable/v2/{index.ts → index.tsx} +42 -15
- package/src/unstable/v2/layout.tsx +2 -2
- package/src/unstable/v2/live-scroll.tsx +137 -0
- package/src/unstable/v2/{live-value.ts → live-value.tsx} +12 -117
- package/src/unstable/v2/{press-sensor.ts → press-sensor.tsx} +1 -1
- package/src/unstable/v2/provider.tsx +20 -14
- package/src/unstable/v2/reorder.tsx +16 -8
- package/src/unstable/v2/{sensors.ts → sensors.tsx} +4 -4
- package/src/unstable/v2/ward.tsx +14 -4
- package/src/unstable/v2/wardic.tsx +1 -1
- package/src/variant-target.ts +7 -1
- package/src/w.tsx +1 -1
- package/src/ward-keys.ts +1 -1
- package/src/wardic.tsx +2 -2
- package/dist/solid/bridge.js.map +0 -1
- package/dist/solid/complete.js.map +0 -1
- package/dist/solid/create-animate.js.map +0 -1
- package/dist/solid/directive.js.map +0 -1
- package/dist/solid/drag-sensor.js.map +0 -1
- package/dist/solid/drag.js.map +0 -1
- package/dist/solid/focus-sensor.js.map +0 -1
- package/dist/solid/hover-sensor.js.map +0 -1
- package/dist/solid/index.js.map +0 -1
- package/dist/solid/layout-projection.js.map +0 -1
- package/dist/solid/live-value.js.map +0 -1
- package/dist/solid/press-sensor.js.map +0 -1
- package/dist/solid/sensors.js.map +0 -1
- package/dist/solid/unstable/v2/bridge.js.map +0 -1
- package/dist/solid/unstable/v2/complete.js.map +0 -1
- package/dist/solid/unstable/v2/create-animate.js.map +0 -1
- package/dist/solid/unstable/v2/drag-sensor.js.map +0 -1
- package/dist/solid/unstable/v2/focus-sensor.js.map +0 -1
- package/dist/solid/unstable/v2/hover-sensor.js.map +0 -1
- package/dist/solid/unstable/v2/index.js.map +0 -1
- package/dist/solid/unstable/v2/layout-projection.js.map +0 -1
- package/dist/solid/unstable/v2/live-value.js.map +0 -1
- package/dist/solid/unstable/v2/presence-hooks.js.map +0 -1
- package/dist/solid/unstable/v2/press-sensor.js.map +0 -1
- package/dist/solid/unstable/v2/sensors.js.map +0 -1
- /package/src/{complete.ts → complete.tsx} +0 -0
- /package/src/{create-animate.ts → create-animate.tsx} +0 -0
- /package/src/{directive.ts → directive.tsx} +0 -0
- /package/src/{drag.ts → drag.tsx} +0 -0
- /package/src/{layout-projection.ts → layout-projection.tsx} +0 -0
- /package/src/unstable/v2/{complete.ts → complete.tsx} +0 -0
- /package/src/unstable/v2/{layout-projection.ts → layout-projection.tsx} +0 -0
- /package/src/unstable/v2/{presence-hooks.ts → presence-hooks.tsx} +0 -0
package/src/imperative.ts
CHANGED
|
@@ -28,6 +28,18 @@ import type * as Values from "@wardic/core/Values"
|
|
|
28
28
|
import * as Sequence from "@wardic/core/Sequence"
|
|
29
29
|
import type * as FlushGate from "@wardic/dom/FlushGate"
|
|
30
30
|
import * as Report from "@wardic/dom/Report"
|
|
31
|
+
import {
|
|
32
|
+
type BatchBinding,
|
|
33
|
+
type BatchMemberEntry,
|
|
34
|
+
batchSubjectOf,
|
|
35
|
+
callPartsOf,
|
|
36
|
+
isMemberElement,
|
|
37
|
+
memberEntryOf,
|
|
38
|
+
sequencePartsOf,
|
|
39
|
+
type WardicBatchSegmentTarget,
|
|
40
|
+
type WardicBatchSubject,
|
|
41
|
+
type WardicBatchTarget,
|
|
42
|
+
} from "./batch.ts"
|
|
31
43
|
import * as Arr from "effect/Array"
|
|
32
44
|
import * as Bool from "effect/Boolean"
|
|
33
45
|
import * as Cause from "effect/Cause"
|
|
@@ -35,6 +47,7 @@ import * as Effect from "effect/Effect"
|
|
|
35
47
|
import * as Exit from "effect/Exit"
|
|
36
48
|
import type * as Fiber from "effect/Fiber"
|
|
37
49
|
import { constVoid, identity } from "effect/Function"
|
|
50
|
+
import * as Iter from "effect/Iterable"
|
|
38
51
|
import * as Match from "effect/Match"
|
|
39
52
|
import * as Predicate from "effect/Predicate"
|
|
40
53
|
import * as Rec from "effect/Record"
|
|
@@ -235,15 +248,43 @@ const subjectsOf = (subject: WardicAnimationSubject, scope: Element | undefined)
|
|
|
235
248
|
return Arr.filter(Arr.makeBy(list.length, (i) => list[i] as Element), Predicate.isNotNullish)
|
|
236
249
|
}
|
|
237
250
|
|
|
251
|
+
/** A call's options without its `onComplete`: its transition. */
|
|
252
|
+
const withoutComplete = (given: WardicAnimateOptions): Readonly<Record<string, unknown>> => {
|
|
253
|
+
const { onComplete: _onComplete, ...rest } = given as Readonly<Record<string, unknown>>
|
|
254
|
+
return rest
|
|
255
|
+
}
|
|
256
|
+
|
|
238
257
|
/** Each element's transition: its `delay` worked out for it (Motion's `delay(i, n)`). */
|
|
239
258
|
const transitionFor = (options: WardicAnimateOptions | undefined, index: number, count: number): WardicTransition | undefined =>
|
|
240
259
|
UndefinedOr.map(options, (given) => {
|
|
241
|
-
const { delay,
|
|
260
|
+
const { delay, ...rest } = withoutComplete(given)
|
|
242
261
|
if (Predicate.isFunction(delay)) return { ...rest, delay: (delay as (index: number, count: number) => number)(index, count) } as WardicTransition
|
|
243
262
|
if (Predicate.isUndefined(delay)) return rest as WardicTransition
|
|
244
263
|
return { ...rest, delay } as WardicTransition
|
|
245
264
|
})
|
|
246
265
|
|
|
266
|
+
/** A Batch call's transition (#665): the options without `onComplete`, a `stagger()` delay kept for the Batch to count its movers. */
|
|
267
|
+
const batchTransitionOf = (options: WardicAnimateOptions | undefined): WardicTransition | undefined =>
|
|
268
|
+
UndefinedOr.map(options, (given) => withoutComplete(given) as WardicTransition)
|
|
269
|
+
|
|
270
|
+
/** A Batch call's track over `members` (every member when left out), driven by `head`: the call's options its transition. */
|
|
271
|
+
const batchTrackOf = (env: AnimateEnv, binding: BatchBinding, target: WardicBatchTarget, members: ReadonlyArray<number> | undefined, options: WardicAnimateOptions | undefined, head: Playback.Playhead, settled: () => void): ImperativeTrack =>
|
|
272
|
+
binding.track({
|
|
273
|
+
target,
|
|
274
|
+
transition: batchTransitionOf(options),
|
|
275
|
+
reducedMotion: env.reducedMotion(),
|
|
276
|
+
skipAnimations: skipsBatchCall(env, options),
|
|
277
|
+
head,
|
|
278
|
+
settled,
|
|
279
|
+
members,
|
|
280
|
+
})
|
|
281
|
+
|
|
282
|
+
/** Whether a Batch call lands at once: its scope's animations are skipped, or its own `skipAnimations` (#468). */
|
|
283
|
+
const skipsBatchCall = (env: AnimateEnv, options: WardicAnimateOptions | undefined): boolean => {
|
|
284
|
+
if (env.skipAnimations()) return true
|
|
285
|
+
return UndefinedOr.match(options, { onUndefined: () => false, onDefined: (given) => given.skipAnimations === true })
|
|
286
|
+
}
|
|
287
|
+
|
|
247
288
|
/** Where an animation is: `"idle"`, `"running"`, `"paused"` or `"finished"`. Motion's `AnimationPlayState`. */
|
|
248
289
|
export type WardicPlayState = "idle" | "running" | "paused" | "finished"
|
|
249
290
|
|
|
@@ -464,8 +505,18 @@ export type WardicFunctionSegment =
|
|
|
464
505
|
| readonly [callback: (value: number) => void, value: number | WardicKeyframes<number>, options: WardicSegmentOptions]
|
|
465
506
|
| readonly [callback: (value: string) => void, value: string | WardicKeyframes<string>, options: WardicSegmentOptions]
|
|
466
507
|
|
|
467
|
-
/**
|
|
468
|
-
|
|
508
|
+
/**
|
|
509
|
+
* A Segment of a Batch, `[batch, target, options?]`: a Batch, every member whose element has arrived, in
|
|
510
|
+
* member order, or a member's handle, `grid.at(i)`. Each of its keys a number, `null`, stops, or a
|
|
511
|
+
* function of a member's index and the Batch's count; a `stagger()` counts the Segment's members.
|
|
512
|
+
*/
|
|
513
|
+
// #665, Q36–Q39: each member through its own stops, in the Batch.
|
|
514
|
+
export type WardicBatchSegment =
|
|
515
|
+
| readonly [batch: WardicBatchSubject, target: WardicBatchSegmentTarget]
|
|
516
|
+
| readonly [batch: WardicBatchSubject, target: WardicBatchSegmentTarget, options: WardicSegmentOptions]
|
|
517
|
+
|
|
518
|
+
/** One step of a sequence: a label, a Segment of elements, a function Segment, or a Segment of a Batch. */
|
|
519
|
+
export type WardicSegment = WardicSequenceLabel | WardicElementSegment | WardicFunctionSegment | WardicBatchSegment
|
|
469
520
|
|
|
470
521
|
/**
|
|
471
522
|
* A sequence: Segments played one after another, unless an `at` says where one starts, and labels to
|
|
@@ -504,6 +555,7 @@ export interface WardicSequenceOptions {
|
|
|
504
555
|
// #433: through one Playhead.
|
|
505
556
|
export interface WardicAnimate {
|
|
506
557
|
(subject: WardicAnimationSubject, target: WardicVariant, options?: WardicAnimateOptions): WardicPlaybackControls
|
|
558
|
+
(batch: WardicBatchSubject, target: WardicBatchTarget, options?: WardicAnimateOptions): WardicPlaybackControls
|
|
507
559
|
(sequence: WardicAnimationSequence, options?: WardicSequenceOptions): WardicPlaybackControls
|
|
508
560
|
}
|
|
509
561
|
|
|
@@ -515,10 +567,29 @@ export interface WardicAnimate {
|
|
|
515
567
|
export const scopedAnimate = (env: AnimateEnv, scope: () => Element | undefined, watch: AnimationWatch): WardicAnimate =>
|
|
516
568
|
((first: WardicAnimationSubject | WardicAnimationSequence, second?: WardicVariant | WardicSequenceOptions, third?: WardicAnimateOptions): WardicPlaybackControls => {
|
|
517
569
|
if (isSequence(first)) return sequenceOf(env, scope(), watch, first, second as WardicSequenceOptions | undefined)
|
|
570
|
+
// A Batch, or a member's handle (#665): one track over its members, on the Batch's own run.
|
|
571
|
+
const batch = batchSubjectOf(first)
|
|
572
|
+
if (Predicate.isNotUndefined(batch)) {
|
|
573
|
+
const members = batch.binding.namedOf(batch)
|
|
574
|
+
return started(watch, 1, UndefinedOr.map(third, (given) => given.onComplete), (head, settled) => [
|
|
575
|
+
batchTrackOf(env, batch.binding, second as WardicBatchTarget, members, third, head, settled),
|
|
576
|
+
])
|
|
577
|
+
}
|
|
518
578
|
const elements = subjectsOf(first as WardicAnimationSubject, scope())
|
|
519
579
|
const target = second as WardicVariant
|
|
520
|
-
|
|
521
|
-
|
|
580
|
+
const onComplete = UndefinedOr.map(third, (given) => given.onComplete)
|
|
581
|
+
// No member's element among them: each element's track, building no parts (bench:solid --batch's
|
|
582
|
+
// per-element page, a call per element: 8.2 -> 8.5 ms at 1,000 with the parts built for every call; #665).
|
|
583
|
+
if (!Arr.some(elements, isMemberElement)) {
|
|
584
|
+
return started(watch, elements.length, onComplete, (head, settled) =>
|
|
585
|
+
Arr.map(elements, (element, index) => trackOf(env, element, target, transitionFor(third, index, elements.length), head, settled)))
|
|
586
|
+
}
|
|
587
|
+
// A Batch's members' elements as one call over them, with its keys; the rest of each element's on its own (#665, Q14, Q35).
|
|
588
|
+
const parts = callPartsOf(elements, target)
|
|
589
|
+
return started(watch, parts.members.length + parts.elements.length, onComplete, (head, settled) => [
|
|
590
|
+
...Arr.map(parts.members, (part) => batchTrackOf(env, part.binding, part.target, part.members, third, head, settled)),
|
|
591
|
+
...Arr.map(parts.elements, (part) => trackOf(env, part.element, part.target, transitionFor(third, part.index, elements.length), head, settled)),
|
|
592
|
+
])
|
|
522
593
|
}) as WardicAnimate
|
|
523
594
|
|
|
524
595
|
/**
|
|
@@ -556,8 +627,8 @@ interface Callback {
|
|
|
556
627
|
readonly call: (value: number | string) => void
|
|
557
628
|
}
|
|
558
629
|
|
|
559
|
-
/** What a sequence animates: elements,
|
|
560
|
-
type Subject = Element | Callback
|
|
630
|
+
/** What a sequence animates: elements, function Segments' values, and Batches' members (#665). */
|
|
631
|
+
type Subject = Element | Callback | BatchMemberEntry
|
|
561
632
|
|
|
562
633
|
/** Whether a subject is a function Segment's value. */
|
|
563
634
|
const isCallback = (subject: Subject): subject is Callback => Predicate.hasProperty(subject, "call")
|
|
@@ -631,6 +702,25 @@ const segmentTransitionsOf = (values: Readonly<Record<string, unknown>>, options
|
|
|
631
702
|
/** A Segment's `at`, when it gives one. */
|
|
632
703
|
const atOf = (options: WardicSegmentOptions | undefined): Sequence.Time | undefined => UndefinedOr.map(options, (given) => given.at)
|
|
633
704
|
|
|
705
|
+
/**
|
|
706
|
+
* An element Segment's subjects (#665, Q40): each element, a member's as its member's entry, so its Batch
|
|
707
|
+
* keys run in its Batch, as one subject with the member a Segment of the Batch names. Each Batch checks
|
|
708
|
+
* the Segment's values once.
|
|
709
|
+
*/
|
|
710
|
+
const subjectsIn = (elements: ReadonlyArray<Element>, target: Readonly<Record<string, unknown>>): ReadonlyArray<Subject> => {
|
|
711
|
+
if (!Arr.some(elements, isMemberElement)) return elements
|
|
712
|
+
const checked = new Set<BatchBinding>()
|
|
713
|
+
return Arr.map(elements, (element): Subject => {
|
|
714
|
+
const entry = memberEntryOf(element)
|
|
715
|
+
if (Predicate.isUndefined(entry)) return element
|
|
716
|
+
if (Bool.not(checked.has(entry.binding))) {
|
|
717
|
+
checked.add(entry.binding)
|
|
718
|
+
entry.binding.checkElementSegment(target)
|
|
719
|
+
}
|
|
720
|
+
return entry
|
|
721
|
+
})
|
|
722
|
+
}
|
|
723
|
+
|
|
634
724
|
/**
|
|
635
725
|
* A sequence's steps for core (#433): labels as they are; an element Segment's elements (a selector
|
|
636
726
|
* looked up once a sequence, inside `scope`), values and each value's transition; a function
|
|
@@ -651,6 +741,13 @@ const stepsOf = (sequence: WardicAnimationSequence, scope: Element | undefined,
|
|
|
651
741
|
if (Predicate.isString(segment)) return segment
|
|
652
742
|
if (Bool.not(Arr.isArray(segment))) return segment as { readonly name: string; readonly at: Sequence.Time }
|
|
653
743
|
const parts = segment as ReadonlyArray<unknown>
|
|
744
|
+
// A Batch, or a member's handle (#665, Q38, Q39): its members, each through its own stops in the Batch.
|
|
745
|
+
const batch = batchSubjectOf(parts[0])
|
|
746
|
+
if (Predicate.isNotUndefined(batch)) {
|
|
747
|
+
const options = parts[2] as WardicSegmentOptions | undefined
|
|
748
|
+
const { subjects, values } = batch.binding.segmentOf(batch.binding.namedOf(batch), parts[1] as Readonly<Record<string, unknown>>)
|
|
749
|
+
return { subjects, target: values, transitions: segmentTransitionsOf(values, options, defaults), at: atOf(options) }
|
|
750
|
+
}
|
|
654
751
|
if (Predicate.isFunction(parts[0])) {
|
|
655
752
|
const call = parts[0] as (value: number | string) => void
|
|
656
753
|
const three = parts.length === 3
|
|
@@ -661,7 +758,7 @@ const stepsOf = (sequence: WardicAnimationSequence, scope: Element | undefined,
|
|
|
661
758
|
}
|
|
662
759
|
const [subject, values, options] = segment as WardicElementSegment
|
|
663
760
|
const target = segmentValuesOf(values)
|
|
664
|
-
return { subjects: elementsOf(subject), target, transitions: segmentTransitionsOf(target, options, defaults), at: atOf(options) }
|
|
761
|
+
return { subjects: subjectsIn(elementsOf(subject), target), target, transitions: segmentTransitionsOf(target, options, defaults), at: atOf(options) }
|
|
665
762
|
})
|
|
666
763
|
}
|
|
667
764
|
|
|
@@ -728,12 +825,17 @@ const sequenceOf = (env: AnimateEnv, scope: Element | undefined, watch: Animatio
|
|
|
728
825
|
...picked(UndefinedOr.match(options as Readonly<Record<string, unknown>> | undefined, { onUndefined: () => NO_FIELDS, onDefined: identity }), WHOLE),
|
|
729
826
|
} as Sequence.Options
|
|
730
827
|
const compiled = Arr.fromIterable(Sequence.compile(stepsOf(sequence, scope, defaults), whole))
|
|
731
|
-
|
|
732
|
-
|
|
828
|
+
// Each Batch's members as one track, their other keys their elements' (#665, Q40).
|
|
829
|
+
const parts = sequencePartsOf<Element | Callback>(compiled)
|
|
830
|
+
return started(watch, compiled.length, UndefinedOr.map(options, (given) => given.onComplete), (head, settled) => [
|
|
831
|
+
...Arr.map(parts.others, ([subject, animation]) =>
|
|
733
832
|
Match.value(subject).pipe(
|
|
734
833
|
Match.when(isCallback, (callback) => callbackTrackOf(env, callback, animation, head, settled)),
|
|
735
834
|
Match.orElse((element) => trackOf(env, element as Element, animation.keyframes as WardicVariant, animation.transition as WardicTransition, head, settled)),
|
|
736
|
-
))
|
|
835
|
+
)),
|
|
836
|
+
...Arr.map(parts.batches, (part) =>
|
|
837
|
+
part.binding.sequenceTrack({ members: part.members, animations: part.animations, reducedMotion: env.reducedMotion(), skipAnimations: env.skipAnimations(), head, settled })),
|
|
838
|
+
])
|
|
737
839
|
}
|
|
738
840
|
|
|
739
841
|
/**
|
|
@@ -760,23 +862,33 @@ export const scopeOf = <T extends Element>(also?: AnimationWatch): {
|
|
|
760
862
|
readonly stopAll: () => void
|
|
761
863
|
} => {
|
|
762
864
|
let current: T | undefined
|
|
763
|
-
|
|
865
|
+
// A set, and its array built only when `animations` is read, then kept until the set changes (#659):
|
|
866
|
+
// an array copied at every start and every end made starting and ending n of them O(n²).
|
|
867
|
+
const live = new Set<WardicPlaybackControls>()
|
|
868
|
+
let listed: ReadonlyArray<WardicPlaybackControls> | undefined
|
|
869
|
+
const animationsNow = (): ReadonlyArray<WardicPlaybackControls> => {
|
|
870
|
+
if (Predicate.isUndefined(listed)) listed = Arr.fromIterable(live)
|
|
871
|
+
return listed
|
|
872
|
+
}
|
|
764
873
|
const ref = (element: T): void => {
|
|
765
874
|
current = element
|
|
766
875
|
}
|
|
767
876
|
const scope = Object.defineProperties(ref, {
|
|
768
877
|
current: { get: () => current },
|
|
769
|
-
animations: { get:
|
|
878
|
+
animations: { get: animationsNow },
|
|
770
879
|
}) as WardicAnimationScope<T>
|
|
771
880
|
const watch: AnimationWatch = {
|
|
772
881
|
started: (controls) => {
|
|
773
|
-
|
|
882
|
+
live.add(controls)
|
|
883
|
+
listed = undefined
|
|
774
884
|
UndefinedOr.map(also, (more) => more.started(controls))
|
|
775
885
|
},
|
|
776
886
|
ended: (controls, landed) => {
|
|
777
|
-
|
|
887
|
+
live.delete(controls)
|
|
888
|
+
listed = undefined
|
|
778
889
|
UndefinedOr.map(also, (more) => more.ended(controls, landed))
|
|
779
890
|
},
|
|
780
891
|
}
|
|
781
|
-
|
|
892
|
+
// Stopping one ends it, which deletes it from the set: safe in the set's own walk.
|
|
893
|
+
return { scope, watch, stopAll: () => Iter.forEach(live, (controls) => controls.stop()) }
|
|
782
894
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @see https://wardic.dev/reference/solid/utilities/version
|
|
13
13
|
*/
|
|
14
|
-
export const VERSION = "
|
|
14
|
+
export const VERSION = "1.0.0-rc.11"
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* `WardicProvider` (one Effect runtime + `AtomRegistry` per ADR-0006), the
|
|
@@ -42,10 +42,12 @@ export {
|
|
|
42
42
|
* those it uses; a Complete element (`wardic.*`) has every one. `colors`: every CSS colour space beyond
|
|
43
43
|
* a hex, `rgb()`, `hsl()` and the colour names. `layout`: layout animations, the props `layout`,
|
|
44
44
|
* `layoutId`, `layoutScroll` and `layoutRoot` (`LayoutGroup` and `Reorder` bring it themselves).
|
|
45
|
+
* `scroll`: a container's scroll, which `createScroll` brings itself (#518).
|
|
45
46
|
*/
|
|
46
47
|
export type { Feature, FeatureLoad, Features, FeaturesProp } from "./feature.ts"
|
|
47
48
|
export { colors } from "./features/colors.ts"
|
|
48
49
|
export { layout } from "./features/layout.ts"
|
|
50
|
+
export { scroll } from "./features/scroll.ts"
|
|
49
51
|
/**
|
|
50
52
|
* The gestures (#511, ADR-0067 decision 3), a Feature each: `hover`, `press` (its Keyboard presses
|
|
51
53
|
* included), `focus`, `inView`, `pan` and `drag` (`dragControls` and the release's inertia included).
|
|
@@ -87,20 +89,41 @@ export type { Shape as FlushGate, Sink as FlushSink } from "@wardic/dom/FlushGat
|
|
|
87
89
|
* scoped fiber) and `fromAtom` (Effect `Atom` -> Solid signal via the runtime's
|
|
88
90
|
* `AtomRegistry`).
|
|
89
91
|
*/
|
|
90
|
-
export { fromAtom, streamToSignal } from "./bridge.
|
|
92
|
+
export { fromAtom, streamToSignal } from "./bridge.tsx"
|
|
91
93
|
export type { WardicDragInfo, WardicPoint, WardicPointInfo, WardicPressEvent, WardicPressInfo, WardicPressInput } from "./gesture-info.ts"
|
|
92
94
|
export type { WardicBoundingBox, WardicDragConstraints, WardicMeasureDragConstraints } from "./drag-constraints.ts"
|
|
93
95
|
// Drag controls (#431, Motion's `useDragControls`): a drag started from a handle or a track.
|
|
94
96
|
export { createDragControls, type WardicDragControls, type WardicDragControlsOptions } from "./drag-controls.ts"
|
|
95
97
|
// Imperative animation (#433, Motion's `useAnimate`): an Animation scope, its `animate` and its Playback controls;
|
|
96
98
|
// a sequence of Segments (Motion's), on the same controls.
|
|
97
|
-
export { createAnimate } from "./create-animate.
|
|
99
|
+
export { createAnimate } from "./create-animate.tsx"
|
|
100
|
+
export {
|
|
101
|
+
createBatch,
|
|
102
|
+
type WardicBatch,
|
|
103
|
+
type WardicBatchConfig,
|
|
104
|
+
type WardicBatchExit,
|
|
105
|
+
type WardicBatchGesture,
|
|
106
|
+
type WardicBatchKey,
|
|
107
|
+
type WardicBatchLanding,
|
|
108
|
+
type WardicBatchMember,
|
|
109
|
+
type WardicBatchMemberProps,
|
|
110
|
+
type WardicBatchSegmentTarget,
|
|
111
|
+
type WardicBatchSegmentValue,
|
|
112
|
+
type WardicBatchStop,
|
|
113
|
+
type WardicBatchSubject,
|
|
114
|
+
type WardicBatchTarget,
|
|
115
|
+
type WardicBatchTransition,
|
|
116
|
+
type WardicBatchValues,
|
|
117
|
+
type WardicKeyedBatch,
|
|
118
|
+
type WardicKeyedBatchConfig,
|
|
119
|
+
} from "./create-batch.tsx"
|
|
98
120
|
export type {
|
|
99
121
|
WardicAnimate,
|
|
100
122
|
WardicAnimateOptions,
|
|
101
123
|
WardicAnimationScope,
|
|
102
124
|
WardicAnimationSequence,
|
|
103
125
|
WardicAnimationSubject,
|
|
126
|
+
WardicBatchSegment,
|
|
104
127
|
WardicElementSegment,
|
|
105
128
|
WardicFunctionSegment,
|
|
106
129
|
WardicPlaybackControls,
|
|
@@ -127,11 +150,11 @@ export {
|
|
|
127
150
|
createPageInView,
|
|
128
151
|
createReducedMotion,
|
|
129
152
|
createReducedMotionConfig,
|
|
130
|
-
} from "./sensors.
|
|
131
|
-
export { createDrag } from "./drag-sensor.
|
|
132
|
-
export { createFocus } from "./focus-sensor.
|
|
133
|
-
export { createHover } from "./hover-sensor.
|
|
134
|
-
export { createPress } from "./press-sensor.
|
|
153
|
+
} from "./sensors.tsx"
|
|
154
|
+
export { createDrag } from "./drag-sensor.tsx"
|
|
155
|
+
export { createFocus } from "./focus-sensor.tsx"
|
|
156
|
+
export { createHover } from "./hover-sensor.tsx"
|
|
157
|
+
export { createPress } from "./press-sensor.tsx"
|
|
135
158
|
// `createCycle` (#443, Motion's `useCycle`): one of a list of states at a time, stepped through.
|
|
136
159
|
export { createCycle, type Cycle } from "./cycle.ts"
|
|
137
160
|
|
|
@@ -146,16 +169,13 @@ export { createCycle, type Cycle } from "./cycle.ts"
|
|
|
146
169
|
export {
|
|
147
170
|
createAnimationFrame,
|
|
148
171
|
createFollowValue,
|
|
149
|
-
createScroll,
|
|
150
172
|
createSpring,
|
|
151
173
|
createTime,
|
|
152
174
|
createTransform,
|
|
153
175
|
createVelocity,
|
|
154
176
|
createWillChange,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
type ScrollValues,
|
|
158
|
-
} from "./live-value.ts"
|
|
177
|
+
} from "./live-value.tsx"
|
|
178
|
+
export { createScroll, type ElementSource, type ScrollOptions, type ScrollValues } from "./live-scroll.tsx"
|
|
159
179
|
export type { FollowAccessor, FollowValueOptions, Live, LiveSource, SpringAccessor, WillChange } from "./live-style.ts"
|
|
160
180
|
|
|
161
181
|
/**
|
|
@@ -164,7 +184,7 @@ export type { FollowAccessor, FollowValueOptions, Live, LiveSource, SpringAccess
|
|
|
164
184
|
* element (ADR-0034), with an SSR-correct synchronous initial (ADR-0003). Returns a callable
|
|
165
185
|
* `Ward` to spread onto a JSX element (`<div {...ward()}>`).
|
|
166
186
|
*/
|
|
167
|
-
export { createWard } from "./complete.
|
|
187
|
+
export { createWard } from "./complete.tsx"
|
|
168
188
|
export { type Ward, type WardStyle, type WardValue, type WardProps, type WardUserProps } from "./create-ward.tsx"
|
|
169
189
|
export type {
|
|
170
190
|
WardConfig,
|
|
@@ -221,6 +241,10 @@ export {
|
|
|
221
241
|
type ReorderItemWard,
|
|
222
242
|
type ReorderItemLayout,
|
|
223
243
|
type ReorderItemDirectiveValue,
|
|
244
|
+
type ReorderBatchGroupProps,
|
|
245
|
+
type ReorderBatchItemProps,
|
|
246
|
+
type ReorderBatchGap,
|
|
247
|
+
type ReorderBatchItemSize,
|
|
224
248
|
reorderItem,
|
|
225
249
|
} from "./reorder.tsx"
|
|
226
250
|
|
|
@@ -236,7 +260,7 @@ export {
|
|
|
236
260
|
type DragTrackConfig,
|
|
237
261
|
type RunDragTrackOptions,
|
|
238
262
|
runDragTrack,
|
|
239
|
-
} from "./drag.
|
|
263
|
+
} from "./drag.tsx"
|
|
240
264
|
|
|
241
265
|
/**
|
|
242
266
|
* Variant orchestration context (ADR-0007): the `WardicVariantContext` that
|
package/src/layout-member.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { constFalse, constTrue, identity } from "effect/Function"
|
|
|
14
14
|
import * as Option from "effect/Option"
|
|
15
15
|
import * as Predicate from "effect/Predicate"
|
|
16
16
|
import * as UndefinedOr from "effect/UndefinedOr"
|
|
17
|
+
import { markLayoutElement } from "./batch.ts"
|
|
17
18
|
import type * as Values from "@wardic/core/Values"
|
|
18
19
|
import * as DomRenderer from "@wardic/dom/DomRenderer"
|
|
19
20
|
import type { WardConfig, WardicTransition } from "./config.ts"
|
|
@@ -82,7 +83,11 @@ export interface CreateProjectionNodeOptions {
|
|
|
82
83
|
// ADR-0012: its scroll offset is sampled at measure and folded out of its descendants' boxes, so a
|
|
83
84
|
// scroll between triggers doesn't leak into their FLIP delta.
|
|
84
85
|
readonly layoutScroll?: boolean
|
|
85
|
-
/**
|
|
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
|
+
*/
|
|
86
91
|
// ADR-0013: a stable projection sub-root, self-snap, boundary and persistent relative anchor.
|
|
87
92
|
readonly layoutRoot?: boolean
|
|
88
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,8 +99,12 @@ export interface CreateProjectionNodeOptions {
|
|
|
94
99
|
/** Raises it above its siblings while it's dragged, as a `<Reorder>` item is. */
|
|
95
100
|
// ADR-0016 *Amendment (Reorder)*.
|
|
96
101
|
readonly raiseWhileDragged?: boolean
|
|
97
|
-
/**
|
|
98
|
-
|
|
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.
|
|
99
108
|
readonly layoutMode?: () => Projection.LayoutMode
|
|
100
109
|
/** Its own `scale`, read at each handover and each frame it follows another element. */
|
|
101
110
|
// ADR-0010 *Amendment (#8)*.
|
|
@@ -139,6 +148,9 @@ const layoutSkips = (transition: WardicTransition | undefined): boolean =>
|
|
|
139
148
|
* system needs it, outside the binding's tracking.
|
|
140
149
|
*/
|
|
141
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)
|
|
142
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
|
|
143
155
|
const configSkips = UndefinedOr.match(skipAnimations, { onUndefined: () => constFalse, onDefined: identity })
|
|
144
156
|
return {
|
|
@@ -201,11 +213,16 @@ const takeOverOf = (box: Box.Box | undefined, fade: number | undefined): Pick<Pr
|
|
|
201
213
|
}
|
|
202
214
|
|
|
203
215
|
/**
|
|
204
|
-
* The Layout mode a
|
|
205
|
-
* `true`
|
|
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.
|
|
206
220
|
*/
|
|
207
|
-
export const layoutModeOf = (layout: WardConfig["layout"]): Projection.LayoutMode =>
|
|
208
|
-
|
|
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
|
+
}
|
|
209
226
|
|
|
210
227
|
/** Whether a `layout` prop names a Layout mode (a string), not `true` / `false`. */
|
|
211
228
|
const isModeName = (layout: WardConfig["layout"]): layout is Exclude<WardConfig["layout"], boolean | undefined> => Predicate.isString(layout)
|
|
@@ -254,8 +271,10 @@ export const layoutOptionsOf = (ward: WardLayout): CreateProjectionNodeOptions =
|
|
|
254
271
|
layoutDependency: () => config().layoutDependency,
|
|
255
272
|
transition: () => ownOrInherited(config().transition, parent),
|
|
256
273
|
dragTransition: () => dragTransition,
|
|
257
|
-
// The Layout mode, read at each layout animation's start
|
|
258
|
-
|
|
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),
|
|
259
278
|
// The own scale the renderer draws, from the values last written (ADR-0010 *Amendment (#8)*).
|
|
260
279
|
ownScale: () => DomRenderer.ownScaleOf(snapshot.values),
|
|
261
280
|
// And its own translate, which the renderer adds to its projection's (#363).
|
package/src/layout.tsx
CHANGED
|
@@ -22,7 +22,7 @@ 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
24
|
import { registrationOf, type CreateProjectionNodeOptions } from "./layout-member.ts"
|
|
25
|
-
import { useWardicProjection } from "./layout-projection.
|
|
25
|
+
import { useWardicProjection } from "./layout-projection.tsx"
|
|
26
26
|
import { isServer } from "./server.ts"
|
|
27
27
|
|
|
28
28
|
export type { CreateProjectionNodeOptions } from "./layout-member.ts"
|
|
@@ -110,7 +110,7 @@ export function LayoutGroup(props: LayoutGroupProps): JSX.Element {
|
|
|
110
110
|
const outer = useLayoutGroupId()
|
|
111
111
|
const id = untrack(() => layoutGroupIdOf(outer, props.id, props.inherit))
|
|
112
112
|
// A server render has no projection system to re-measure (ADR-0021).
|
|
113
|
-
if (
|
|
113
|
+
if (!isServer) {
|
|
114
114
|
const projection = useWardicProjection()
|
|
115
115
|
// A group-level dependency change re-measures the whole tree (Q5), compared first as Motion's is
|
|
116
116
|
// (#618). `defer: true` skips the mount read (nodes seed themselves on registration).
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Batch's gesture watches, their code loaded at the first (#665's PR 5, Q62): a Batch with no gesture
|
|
3
|
+
* ships none of it, nor of the gestures' input it stands on. Shared by both bindings.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
// Q62 A: the gestures' code is about 7.4 KB gzipped, nearly all the DOM's input, which a Wardic element's
|
|
8
|
+
// gesture Features share. Loaded with `import()` at the page's first Batch `listen`, each watch starts as it
|
|
9
|
+
// arrives, as a `LazyWardic` Feature takes effect as it arrives: nothing before it is replayed. Once it
|
|
10
|
+
// has, every Batch sets its gestures up as it's made.
|
|
11
|
+
import * as Report from "@wardic/dom/Report"
|
|
12
|
+
import * as Cause from "effect/Cause"
|
|
13
|
+
import * as Predicate from "effect/Predicate"
|
|
14
|
+
import type { BatchGestureWatches } from "./batch.ts"
|
|
15
|
+
import type { BatchGesturesOn } from "./batch-gestures.ts"
|
|
16
|
+
import type { FeatureRegistry } from "./feature.ts"
|
|
17
|
+
import type { WardicRuntime } from "./runtime.ts"
|
|
18
|
+
|
|
19
|
+
/** A Batch's gesture watches, and their end, with the Batch. */
|
|
20
|
+
export interface LazyBatchGestures extends BatchGestureWatches {
|
|
21
|
+
readonly close: () => void
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The gestures' module, once it has loaded: every Batch after the first sets its gestures up at once. */
|
|
25
|
+
// Module state (#460, Q7): one module, loaded once for the page.
|
|
26
|
+
let gesturesModule: typeof import("./batch-gestures.ts") | undefined
|
|
27
|
+
// Module state (#460, Q7): its load, settled once, never rejected: a failed load reported, and nothing watched.
|
|
28
|
+
let loadingModule: Promise<typeof import("./batch-gestures.ts") | undefined> | undefined
|
|
29
|
+
|
|
30
|
+
/** The gestures' module's load, started at its first need; a failure reported on `runtime`. */
|
|
31
|
+
const loadModule = (runtime: WardicRuntime): Promise<typeof import("./batch-gestures.ts") | undefined> => {
|
|
32
|
+
if (Predicate.isUndefined(loadingModule)) {
|
|
33
|
+
loadingModule = import("./batch-gestures.ts").then(
|
|
34
|
+
(module) => {
|
|
35
|
+
gesturesModule = module
|
|
36
|
+
return module
|
|
37
|
+
},
|
|
38
|
+
(error: unknown) => {
|
|
39
|
+
// Let a later Batch try again.
|
|
40
|
+
loadingModule = undefined
|
|
41
|
+
runtime.runFork(Report.failure("createBatch: its gestures' code failed to load", Cause.die(error)))
|
|
42
|
+
return undefined
|
|
43
|
+
},
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
return loadingModule
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A Batch's gesture watches, each run once its code has loaded (at once once it has), on `runtime`, over
|
|
51
|
+
* the input `registry` builds; none once `close` has ended them.
|
|
52
|
+
*/
|
|
53
|
+
export const lazyBatchGestures = (runtime: WardicRuntime, registry: FeatureRegistry): LazyBatchGestures => {
|
|
54
|
+
let loaded: BatchGesturesOn | undefined
|
|
55
|
+
let closed = false
|
|
56
|
+
/** Its gestures, made over the loaded module. */
|
|
57
|
+
const madeOn = (module: typeof import("./batch-gestures.ts")): BatchGesturesOn => {
|
|
58
|
+
if (Predicate.isUndefined(loaded)) loaded = module.batchGesturesOn(runtime, () => registry.build(module.BATCH_GESTURES))
|
|
59
|
+
return loaded
|
|
60
|
+
}
|
|
61
|
+
/** `use` its gestures: at once once the module has loaded, else once it arrives, unless they've closed. */
|
|
62
|
+
const withGestures = (use: (on: BatchGesturesOn) => void): void => {
|
|
63
|
+
if (closed) return
|
|
64
|
+
if (Predicate.isNotUndefined(gesturesModule)) return use(madeOn(gesturesModule))
|
|
65
|
+
loadModule(runtime).then((module) => {
|
|
66
|
+
if (Predicate.isUndefined(module)) return
|
|
67
|
+
if (closed) return
|
|
68
|
+
use(madeOn(module))
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
listen: (gesture, host) => withGestures((on) => on.listen(gesture, host)),
|
|
73
|
+
close: () => {
|
|
74
|
+
closed = true
|
|
75
|
+
if (Predicate.isNotUndefined(loaded)) loaded.close()
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
}
|