@wardic/solid 1.0.0-rc.9 → 1.0.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/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.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 +4 -2
- 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/focus-sensor.js.map +1 -1
- package/dist/browser/hover-sensor.js.map +1 -1
- package/dist/browser/imperative.js +89 -5
- 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/layout-member.js +4 -0
- package/dist/browser/layout-member.js.map +1 -1
- package/dist/browser/layout-projection.js.map +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.map +1 -1
- 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 +53 -7
- 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 +13 -6
- package/dist/browser/reorder.js.map +1 -1
- package/dist/browser/sensors.js.map +1 -1
- package/dist/browser/spine.js +89 -8
- 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.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 +1 -0
- 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.map +1 -1
- package/dist/browser/unstable/v2/live-scroll.js.map +1 -1
- 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/reorder.js +14 -6
- package/dist/browser/unstable/v2/reorder.js.map +1 -1
- package/dist/browser/unstable/v2/sensors.js.map +1 -1
- package/dist/browser/unstable/v2/ward.js +4 -2
- package/dist/browser/unstable/v2/ward.js.map +1 -1
- package/dist/browser/unstable/v2/wardic.js.map +1 -1
- package/dist/browser/w.js.map +1 -1
- package/dist/browser/wardic.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.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 +4 -2
- 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/focus-sensor.js.map +1 -1
- package/dist/server/hover-sensor.js.map +1 -1
- package/dist/server/imperative.js +89 -5
- 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/layout-member.js +4 -0
- package/dist/server/layout-member.js.map +1 -1
- package/dist/server/layout-projection.js.map +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.map +1 -1
- 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 +53 -7
- 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 +13 -6
- package/dist/server/reorder.js.map +1 -1
- package/dist/server/sensors.js.map +1 -1
- package/dist/server/spine.js +89 -8
- 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.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 +1 -0
- 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.map +1 -1
- package/dist/server/unstable/v2/live-scroll.js.map +1 -1
- 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/reorder.js +14 -6
- package/dist/server/unstable/v2/reorder.js.map +1 -1
- package/dist/server/unstable/v2/sensors.js.map +1 -1
- package/dist/server/unstable/v2/ward.js +4 -2
- package/dist/server/unstable/v2/ward.js.map +1 -1
- package/dist/server/unstable/v2/wardic.js.map +1 -1
- package/dist/server/w.js.map +1 -1
- package/dist/server/wardic.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.map +1 -1
- package/dist/solid/{bridge.js → bridge.jsx} +1 -1
- 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/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.map +1 -1
- package/dist/solid/create-ward.jsx +7 -5
- 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/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 +79 -4
- package/dist/solid/imperative.js.map +1 -1
- package/dist/solid/index.d.ts +15 -14
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/{index.js → index.jsx} +14 -13
- package/dist/solid/index.jsx.map +1 -0
- package/dist/solid/layout-member.d.ts.map +1 -1
- package/dist/solid/layout-member.js +4 -0
- 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 +1 -1
- 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.map +1 -1
- package/dist/solid/{live-scroll.js → live-scroll.jsx} +2 -2
- package/dist/solid/live-scroll.jsx.map +1 -0
- package/dist/solid/live-value.d.ts.map +1 -1
- package/dist/solid/{live-value.js → live-value.jsx} +2 -2
- 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 +56 -5
- 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/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 +12 -7
- package/dist/solid/reorder.jsx.map +1 -1
- package/dist/solid/sensors.d.ts.map +1 -1
- package/dist/solid/{sensors.js → sensors.jsx} +2 -2
- package/dist/solid/sensors.jsx.map +1 -0
- package/dist/solid/spine.d.ts +8 -2
- package/dist/solid/spine.d.ts.map +1 -1
- package/dist/solid/spine.js +104 -10
- 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.map +1 -1
- package/dist/solid/unstable/v2/{bridge.js → bridge.jsx} +1 -1
- 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 +14 -13
- package/dist/solid/unstable/v2/index.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{index.js → index.jsx} +13 -12
- 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 +1 -1
- package/dist/solid/unstable/v2/layout.jsx.map +1 -1
- package/dist/solid/unstable/v2/live-scroll.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{live-scroll.js → live-scroll.jsx} +3 -3
- package/dist/solid/unstable/v2/live-scroll.jsx.map +1 -0
- package/dist/solid/unstable/v2/live-value.d.ts.map +1 -1
- package/dist/solid/unstable/v2/{live-value.js → live-value.jsx} +2 -2
- 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/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} +2 -2
- package/dist/solid/unstable/v2/sensors.jsx.map +1 -0
- package/dist/solid/unstable/v2/ward.d.ts.map +1 -1
- package/dist/solid/unstable/v2/ward.jsx +5 -3
- 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/w.jsx +1 -1
- package/dist/solid/w.jsx.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/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} +3 -3
- package/src/create-batch.tsx +219 -0
- package/src/create-ward.tsx +7 -4
- package/src/{drag-sensor.ts → drag-sensor.tsx} +1 -1
- package/src/drag-track.ts +21 -3
- package/src/{focus-sensor.ts → focus-sensor.tsx} +1 -1
- package/src/{hover-sensor.ts → hover-sensor.tsx} +1 -1
- package/src/imperative.ts +112 -11
- package/src/{index.ts → index.tsx} +37 -12
- package/src/layout-member.ts +4 -0
- package/src/layout.tsx +1 -1
- package/src/lazy-batch-gestures.ts +78 -0
- package/src/{live-scroll.ts → live-scroll.tsx} +1 -1
- package/src/{live-value.ts → live-value.tsx} +5 -5
- package/src/member-hold.ts +222 -0
- package/src/presence-controller.ts +52 -5
- 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/reorder-input.ts +91 -4
- package/src/reorder-values.ts +20 -0
- package/src/reorder.tsx +16 -8
- package/src/{sensors.ts → sensors.tsx} +1 -1
- package/src/spine.ts +88 -3
- 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} +3 -3
- 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} +40 -11
- package/src/unstable/v2/layout.tsx +1 -1
- package/src/unstable/v2/{live-scroll.ts → live-scroll.tsx} +2 -2
- package/src/unstable/v2/{live-value.ts → live-value.tsx} +5 -5
- package/src/unstable/v2/{press-sensor.ts → press-sensor.tsx} +1 -1
- package/src/unstable/v2/reorder.tsx +16 -8
- package/src/unstable/v2/{sensors.ts → sensors.tsx} +2 -2
- package/src/unstable/v2/ward.tsx +5 -2
- package/src/unstable/v2/wardic.tsx +1 -1
- package/src/w.tsx +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-scroll.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-scroll.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
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Reorder.BatchGroup` and `Reorder.BatchItem` on Solid 2 (#712, ADR-0072): Solid 1's, its props read per
|
|
3
|
+
* key, its group handed to `groupRef` with `reorderGroup()`'s events, `move` and axis (Q25), and Solid
|
|
4
|
+
* flushed inside `onReorder`, so the DOM follows within the controller's call, as `Reorder.Group`'s does.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import type * as CoreReorder from "@wardic/core/Reorder"
|
|
9
|
+
import * as DomAnnouncer from "@wardic/dom/DomAnnouncer"
|
|
10
|
+
import * as ReorderController from "@wardic/dom/ReorderController"
|
|
11
|
+
import * as Style from "@wardic/dom/Style"
|
|
12
|
+
import * as Bool from "effect/Boolean"
|
|
13
|
+
import { constUndefined, 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 { isServer, type JSX } from "@solidjs/web"
|
|
18
|
+
import { $PROXY, createContext, createEffect, createMemo, createSignal, flush, omit, onCleanup, untrack, useContext } from "solid-js"
|
|
19
|
+
import { configTransitionOf, type WardicBatchTransition } from "../../batch.ts"
|
|
20
|
+
import { type BatchReorderBinding, type BatchReorderExit, type BatchReorderGesture, type BatchReorderInitial, type BatchReorderItems, serverBatchReorder, type BatchReorderRead, bindBatchReorder, describedByOf, geometryOf, GROUP_BRINGS, type ReorderBatchGap, type ReorderBatchItemSize, sameRead, tabStopOf } from "../../batch-reorder.ts"
|
|
21
|
+
import { batchHandoffHere, batchServerAppearHere } from "./batch-appear-here.tsx"
|
|
22
|
+
import { refsOf, staticElementOf } from "./element.tsx"
|
|
23
|
+
import { usePresenceContext } from "./presence.tsx"
|
|
24
|
+
import { plainOrder } from "../../reorder-values.ts"
|
|
25
|
+
import { useBrought, useWardicDefaultTransition, useWardicPositionalKeys, useWardicReducedMotion, useWardicRuntime, useWardicSkipAnimations } from "./provider.tsx"
|
|
26
|
+
import type { ReorderElementTag, ReorderGroup, ReorderGroupEvents } from "./reorder.tsx"
|
|
27
|
+
import { CLIENT_ONLY, CLIENT_ONLY_DEFERRED } from "./solid-reactivity.ts"
|
|
28
|
+
import { eachOf, neverLands, NO_EVENTS, serverWhen, Waiters, whenOf } from "./waiters.ts"
|
|
29
|
+
import { useWardicConfig } from "./wardic-config.tsx"
|
|
30
|
+
|
|
31
|
+
export type { ReorderBatchGap, ReorderBatchItemSize } from "../../batch-reorder.ts"
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A `Reorder.BatchGroup`'s group, handed to its `groupRef` (Q25): `reorderGroup()`'s events (`next`, `each`
|
|
35
|
+
* and `when` of `reorderEnd`, `holdStart` and `holdEnd`), `move` and its axis.
|
|
36
|
+
*/
|
|
37
|
+
export type ReorderBatchGroup<V> = Pick<ReorderGroup<V>, "axis" | "move" | "next" | "each" | "when">
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* `Reorder.BatchGroup`'s props: `Reorder.Group`'s (its `values`, `onReorder` and keyboard), its places'
|
|
41
|
+
* geometry, its items' motion, `groupRef`, and the props of the element it renders.
|
|
42
|
+
*/
|
|
43
|
+
export type ReorderBatchGroupProps<V, Tag extends ReorderElementTag = "ul"> = {
|
|
44
|
+
/** The list's values, in order, each its own: an item's key. Your app owns them. */
|
|
45
|
+
readonly values: ReadonlyArray<V>
|
|
46
|
+
/** Given each new order, as an item crosses another: set `values` from it. */
|
|
47
|
+
readonly onReorder: (values: Array<V>) => void
|
|
48
|
+
/** The list's shape: `"y"`, a column (the default), `"x"`, a row, or `"xy"`, a grid that wraps. */
|
|
49
|
+
readonly axis?: CoreReorder.Axis | undefined
|
|
50
|
+
/** Every item's size, in px: the group places them by it. */
|
|
51
|
+
readonly itemSize: ReorderBatchItemSize
|
|
52
|
+
/** The space between places, in px: one for both axes, or `{ x, y }`. None by default. */
|
|
53
|
+
readonly gap?: ReorderBatchGap | undefined
|
|
54
|
+
/** A grid's columns: how many items a row holds. Left out, as many as the group's width holds, read again as it's resized. */
|
|
55
|
+
readonly columns?: number | undefined
|
|
56
|
+
/**
|
|
57
|
+
* `"rtl"` mirrors a row's and a grid's places, from the group's right edge. Left out, the group's element's
|
|
58
|
+
* computed direction, read as it mounts (a server render's `"ltr"`).
|
|
59
|
+
*/
|
|
60
|
+
readonly direction?: "ltr" | "rtl" | undefined
|
|
61
|
+
/** The keyboard reorder: on unless `false`. */
|
|
62
|
+
readonly keyboard?: boolean | undefined
|
|
63
|
+
/** What a screen reader hears at each step of a keyboard reorder, over the English defaults. */
|
|
64
|
+
readonly announcements?: Partial<CoreReorder.Announcements<V>> | undefined
|
|
65
|
+
/** What each item's `aria-describedby` reads, over the English default. */
|
|
66
|
+
readonly instructions?: string | undefined
|
|
67
|
+
/** Where each item starts: values, a function of its item and index, or `false` to start at its place. */
|
|
68
|
+
readonly initial?: BatchReorderInitial<V> | undefined
|
|
69
|
+
/** How the items move to their places: else the nearest `WardicConfig`'s, else each key's Default transition. */
|
|
70
|
+
readonly transition?: WardicBatchTransition | undefined
|
|
71
|
+
/**
|
|
72
|
+
* Whether a server render plays its items' entrance (`initial`'s keys) in CSS from first paint, and hydration
|
|
73
|
+
* takes it over where it's got to (an **Appear animation**, #706): off unless `true`, under a provider whose
|
|
74
|
+
* `appear` isn't `false`.
|
|
75
|
+
*/
|
|
76
|
+
readonly appear?: boolean | undefined
|
|
77
|
+
/**
|
|
78
|
+
* Where an item goes while it's in hand, dragged or lifted from the keyboard: values with an optional
|
|
79
|
+
* `transition`, or a function of its item and index. Back on the group's transition as it's let go.
|
|
80
|
+
*/
|
|
81
|
+
readonly whileDrag?: BatchReorderGesture<V> | undefined
|
|
82
|
+
/**
|
|
83
|
+
* Where an item goes while the pointer is over it (touch never hovers): values with an optional
|
|
84
|
+
* `transition`, or a function of its item and index, read as its hover starts.
|
|
85
|
+
*/
|
|
86
|
+
readonly whileHover?: BatchReorderGesture<V> | undefined
|
|
87
|
+
/**
|
|
88
|
+
* Where an item goes while it's pressed, by a pointer, or by Enter or Space while it has focus and the
|
|
89
|
+
* keyboard reorder is off (on, they lift it): values with an optional `transition`, or a function of its
|
|
90
|
+
* item and index, read as its press starts.
|
|
91
|
+
*/
|
|
92
|
+
readonly whileTap?: BatchReorderGesture<V> | undefined
|
|
93
|
+
/**
|
|
94
|
+
* Where an item leaving under `<AnimatePresence>` goes, at its last place, its element kept until it lands:
|
|
95
|
+
* values with an optional `transition`, or a function of its item, its last index and the presence's `custom`.
|
|
96
|
+
*/
|
|
97
|
+
readonly exit?: BatchReorderExit<V> | undefined
|
|
98
|
+
/** Given the group once, as it's made, as `Reorder.Group`'s `groupRef` is: for its events and `move`. */
|
|
99
|
+
readonly groupRef?: ((group: ReorderBatchGroup<V>) => void) | undefined
|
|
100
|
+
/** The element it renders: `"ul"` by default. Read once. */
|
|
101
|
+
readonly as?: Tag
|
|
102
|
+
readonly style?: JSX.CSSProperties | undefined
|
|
103
|
+
} & Omit<JSX.IntrinsicElements[Tag], "style" | "onReorder">
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* `Reorder.BatchItem`'s props: its `value`, `as`, and the props of the element it renders. It's a member
|
|
107
|
+
* of its group's Batch, not a Wardic element: its motion is the group's.
|
|
108
|
+
*/
|
|
109
|
+
export type ReorderBatchItemProps<V, Tag extends ReorderElementTag = "li"> = {
|
|
110
|
+
/** Its value in the group's `values`. Read once. */
|
|
111
|
+
readonly value: V
|
|
112
|
+
/** The element it renders: `"li"` by default. Read once. */
|
|
113
|
+
readonly as?: Tag
|
|
114
|
+
readonly style?: JSX.CSSProperties | undefined
|
|
115
|
+
/** Its own tab stop, over the keyboard reorder's `0`. */
|
|
116
|
+
readonly tabindex?: number | undefined
|
|
117
|
+
/** Its own ids, kept before the keyboard reorder's instructions'. */
|
|
118
|
+
readonly "aria-describedby"?: string | undefined
|
|
119
|
+
} & Omit<JSX.IntrinsicElements[Tag], "style" | "tabindex" | "aria-describedby">
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The props a component body reads, as plain records: instantiating the public prop types over every
|
|
123
|
+
* element tag makes a type checker build a union of every element's props.
|
|
124
|
+
*/
|
|
125
|
+
interface GroupLocal<V> {
|
|
126
|
+
readonly values: ReadonlyArray<V>
|
|
127
|
+
readonly onReorder: (values: Array<V>) => void
|
|
128
|
+
readonly axis?: CoreReorder.Axis | undefined
|
|
129
|
+
readonly itemSize: ReorderBatchItemSize
|
|
130
|
+
readonly gap?: ReorderBatchGap | undefined
|
|
131
|
+
readonly columns?: number | undefined
|
|
132
|
+
readonly direction?: "ltr" | "rtl" | undefined
|
|
133
|
+
readonly keyboard?: boolean | undefined
|
|
134
|
+
readonly announcements?: Partial<CoreReorder.Announcements<V>> | undefined
|
|
135
|
+
readonly instructions?: string | undefined
|
|
136
|
+
readonly initial?: BatchReorderInitial<V> | undefined
|
|
137
|
+
readonly transition?: WardicBatchTransition | undefined
|
|
138
|
+
readonly appear?: boolean | undefined
|
|
139
|
+
readonly whileDrag?: BatchReorderGesture<V> | undefined
|
|
140
|
+
readonly whileHover?: BatchReorderGesture<V> | undefined
|
|
141
|
+
readonly whileTap?: BatchReorderGesture<V> | undefined
|
|
142
|
+
readonly exit?: BatchReorderExit<V> | undefined
|
|
143
|
+
readonly groupRef?: ((group: ReorderBatchGroup<V>) => void) | undefined
|
|
144
|
+
readonly as?: string | undefined
|
|
145
|
+
readonly ref?: unknown
|
|
146
|
+
readonly style?: JSX.CSSProperties | undefined
|
|
147
|
+
readonly children?: JSX.Element
|
|
148
|
+
}
|
|
149
|
+
interface ItemLocal<V> {
|
|
150
|
+
readonly value: V
|
|
151
|
+
readonly as?: string | undefined
|
|
152
|
+
readonly ref?: unknown
|
|
153
|
+
readonly style?: JSX.CSSProperties | undefined
|
|
154
|
+
readonly children?: JSX.Element
|
|
155
|
+
readonly tabindex?: number | undefined
|
|
156
|
+
readonly "aria-describedby"?: string | undefined
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const GROUP_OWN = [
|
|
160
|
+
"values",
|
|
161
|
+
"onReorder",
|
|
162
|
+
"axis",
|
|
163
|
+
"itemSize",
|
|
164
|
+
"gap",
|
|
165
|
+
"columns",
|
|
166
|
+
"direction",
|
|
167
|
+
"keyboard",
|
|
168
|
+
"announcements",
|
|
169
|
+
"instructions",
|
|
170
|
+
"initial",
|
|
171
|
+
"appear",
|
|
172
|
+
"transition",
|
|
173
|
+
"whileDrag",
|
|
174
|
+
"whileHover",
|
|
175
|
+
"whileTap",
|
|
176
|
+
"exit",
|
|
177
|
+
"groupRef",
|
|
178
|
+
"as",
|
|
179
|
+
"ref",
|
|
180
|
+
"style",
|
|
181
|
+
"children",
|
|
182
|
+
] as const
|
|
183
|
+
const ITEM_OWN = ["value", "as", "ref", "style", "children", "tabindex", "aria-describedby"] as const
|
|
184
|
+
|
|
185
|
+
/** The `AbortError`'s message for a group's `next` its disposal cut off. */
|
|
186
|
+
const GROUP_GONE = "The Reorder group was disposed before its next event."
|
|
187
|
+
|
|
188
|
+
/** What a group's items read of it: its binding, and its keyboard reorder's settings. */
|
|
189
|
+
interface GroupForItems<V> {
|
|
190
|
+
readonly binding: BatchReorderItems<V>
|
|
191
|
+
readonly keyboard: () => boolean
|
|
192
|
+
/** The keyboard instructions' id, the same for every item: the group's document's (#712, Q47). */
|
|
193
|
+
readonly instructionsId: () => string | undefined
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** The nearest `Reorder.BatchGroup`, for its items: `null` for none (Solid 2's contexts). */
|
|
197
|
+
const BatchGroupContext = createContext<GroupForItems<unknown> | null>(null)
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* A long list put in order by dragging its items, or from the keyboard, as one Batch: every item one
|
|
201
|
+
* size, at the place its index gives. Rendered as `as`, `"ul"` by default, sized to its places. Your app
|
|
202
|
+
* owns `values`, and sets them from `onReorder`; `groupRef` hands out its events and `move`. Key its
|
|
203
|
+
* `Reorder.BatchItem`s with `<For>`.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* <Reorder.BatchGroup values={items()} onReorder={setItems} itemSize={{ width: 240, height: 48 }} gap={8}>
|
|
207
|
+
* <For each={items()}>{(item) => <Reorder.BatchItem value={item()}>{item()}</Reorder.BatchItem>}</For>
|
|
208
|
+
* </Reorder.BatchGroup>
|
|
209
|
+
* @see https://wardic.dev/reference/solid/reorder/reorder
|
|
210
|
+
*/
|
|
211
|
+
// #712, ADR-0072.
|
|
212
|
+
export function BatchGroup<V, Tag extends ReorderElementTag = "ul">(props: ReorderBatchGroupProps<V, Tag>): JSX.Element {
|
|
213
|
+
const local = props as unknown as GroupLocal<V>
|
|
214
|
+
const keyboard = (): boolean => local.keyboard !== false
|
|
215
|
+
const instructions = (): string => UndefinedOr.match(local.instructions, { onUndefined: () => ReorderController.DEFAULT_INSTRUCTIONS, onDefined: identity })
|
|
216
|
+
const Element = staticElementOf(UndefinedOr.match(untrack(() => local.as), { onUndefined: () => "ul", onDefined: identity }))
|
|
217
|
+
const rest = omit(props as unknown as Record<string, unknown>, ...GROUP_OWN)
|
|
218
|
+
// On a server (Q39): its items' starts, no runtime, and a group whose events never come, as
|
|
219
|
+
// `Reorder.Group`'s there. A plain `if`, so a client build drops it (#518).
|
|
220
|
+
if (isServer) {
|
|
221
|
+
const server = serverBatchReorder<V>(
|
|
222
|
+
{
|
|
223
|
+
values: () => local.values,
|
|
224
|
+
geometry: () => geometryOf(local, undefined),
|
|
225
|
+
initial: () => local.initial,
|
|
226
|
+
whileTap: () => local.whileTap,
|
|
227
|
+
transition: () => local.transition,
|
|
228
|
+
appear: () => local.appear,
|
|
229
|
+
server: batchServerAppearHere(),
|
|
230
|
+
},
|
|
231
|
+
untrack,
|
|
232
|
+
)
|
|
233
|
+
UndefinedOr.map(untrack(() => local.groupRef), (give) =>
|
|
234
|
+
give({ axis: () => geometryOf(local, undefined).axis, move: constUndefined, next: neverLands, each: () => NO_EVENTS, when: serverWhen }))
|
|
235
|
+
// eslint-disable-next-line solid/components-return-once -- `isServer` is a constant: the component takes one path for its life
|
|
236
|
+
return (
|
|
237
|
+
<BatchGroupContext value={{ binding: server as BatchReorderItems<unknown>, keyboard, instructionsId: constUndefined }}>
|
|
238
|
+
<Element {...rest} style={server.groupStyle(local.style)}>
|
|
239
|
+
{local.children}
|
|
240
|
+
</Element>
|
|
241
|
+
</BatchGroupContext>
|
|
242
|
+
)
|
|
243
|
+
}
|
|
244
|
+
const runtime = useWardicRuntime()
|
|
245
|
+
const services = useBrought(GROUP_BRINGS)
|
|
246
|
+
// The order as a plain array (#721): a store's copied, so a store changed in place is a new order.
|
|
247
|
+
const values = (): ReadonlyArray<V> => plainOrder(local.values, $PROXY)
|
|
248
|
+
// What the group read of its element: the direction it inherits and a grid's width (Q35, Q36).
|
|
249
|
+
const [read, setRead] = createSignal<BatchReorderRead | undefined>(undefined, { equals: sameRead })
|
|
250
|
+
// Its events (#257 item 3), ended with it.
|
|
251
|
+
const events = new Waiters<ReorderGroupEvents<V>>(GROUP_GONE)
|
|
252
|
+
onCleanup(() => events.dispose())
|
|
253
|
+
// Whether the app's `move` is the call under way: its reorder isn't flushed.
|
|
254
|
+
let moving = false
|
|
255
|
+
const binding = untrack(() =>
|
|
256
|
+
bindBatchReorder<V>(
|
|
257
|
+
{
|
|
258
|
+
runtime,
|
|
259
|
+
reducedMotion: useWardicReducedMotion(),
|
|
260
|
+
skipAnimations: useWardicSkipAnimations(),
|
|
261
|
+
positionalKeys: useWardicPositionalKeys(),
|
|
262
|
+
defaultTransition: useWardicDefaultTransition(),
|
|
263
|
+
configTransition: configTransitionOf(useWardicConfig()),
|
|
264
|
+
untrack,
|
|
265
|
+
...batchHandoffHere(),
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
values,
|
|
269
|
+
geometryOf: (seen) => geometryOf(local, seen),
|
|
270
|
+
read,
|
|
271
|
+
// Its places from what it read land within the read, before the page paints (Q35–Q37): Solid 2 runs
|
|
272
|
+
// the effect that places them at its next flush, which may come after a paint, so it's flushed now.
|
|
273
|
+
onRead: (seen) => {
|
|
274
|
+
setRead(seen)
|
|
275
|
+
flush()
|
|
276
|
+
},
|
|
277
|
+
initial: () => local.initial,
|
|
278
|
+
transition: () => local.transition,
|
|
279
|
+
appear: () => local.appear,
|
|
280
|
+
whileDrag: () => local.whileDrag,
|
|
281
|
+
whileHover: () => local.whileHover,
|
|
282
|
+
whileTap: () => local.whileTap,
|
|
283
|
+
exit: () => local.exit,
|
|
284
|
+
// The DOM and the Batch follow a reorder within the controller's call, as `Reorder.Group`'s do: the
|
|
285
|
+
// controller keeps focus on a lifted item right after. A `move` the app calls doesn't flush: the
|
|
286
|
+
// app may call it inside an `action`, where Solid refuses a flush (#257 item 12).
|
|
287
|
+
onReorder: (values) => {
|
|
288
|
+
const onReorder = untrack(() => local.onReorder)
|
|
289
|
+
if (moving) return onReorder(values)
|
|
290
|
+
flush(() => onReorder(values))
|
|
291
|
+
},
|
|
292
|
+
onReorderEnd: (end) => events.tell("reorderEnd", () => end),
|
|
293
|
+
onHoldStart: (start) => events.tell("holdStart", () => start),
|
|
294
|
+
onHoldEnd: (end) => events.tell("holdEnd", () => end),
|
|
295
|
+
keyboard: () => untrack(() => local.keyboard) !== false,
|
|
296
|
+
announcements: () => Option.fromUndefinedOr(untrack(() => local.announcements)),
|
|
297
|
+
brought: services,
|
|
298
|
+
},
|
|
299
|
+
{ started: noop, landed: noop },
|
|
300
|
+
))
|
|
301
|
+
// Its first places were read as it was made: from then on the compute reads them, and the apply, which
|
|
302
|
+
// Solid runs only for a compute it keeps, turns every item.
|
|
303
|
+
createEffect(binding.batch.targetsOf, binding.apply, CLIENT_ONLY_DEFERRED)
|
|
304
|
+
onCleanup(binding.dispose)
|
|
305
|
+
const controller = binding.controller
|
|
306
|
+
const group: ReorderBatchGroup<V> = {
|
|
307
|
+
axis: () => geometryOf(local, untrack(read)).axis,
|
|
308
|
+
move: (value, toIndex) => {
|
|
309
|
+
moving = true
|
|
310
|
+
try {
|
|
311
|
+
controller.move(value, toIndex)
|
|
312
|
+
} finally {
|
|
313
|
+
moving = false
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
next: (name) => events.wait(name),
|
|
317
|
+
each: (name) => eachOf(events, name),
|
|
318
|
+
when: (name) => whenOf(events, name),
|
|
319
|
+
}
|
|
320
|
+
// The group, to its `groupRef`, read once, untracked, as `ref` is.
|
|
321
|
+
UndefinedOr.map(untrack(() => local.groupRef), (give) => give(group))
|
|
322
|
+
// The keyboard instructions, once for every item (Q47): the page's document's, until the group's element's
|
|
323
|
+
// own replaces it (an iframe's).
|
|
324
|
+
const [document, setDocument] = createSignal<Document>(globalThis.document)
|
|
325
|
+
const onElement = (el: HTMLElement): void => {
|
|
326
|
+
setDocument(DomAnnouncer.documentOf(el))
|
|
327
|
+
}
|
|
328
|
+
// eslint-disable-next-line solid/reactivity -- the accessor itself is handed on, read where its memo tracks it
|
|
329
|
+
const instructionsId = instructionsIdOn(document, instructions)
|
|
330
|
+
return (
|
|
331
|
+
<BatchGroupContext value={{ binding: binding as BatchReorderBinding<unknown>, keyboard, instructionsId }}>
|
|
332
|
+
<Element {...rest} style={binding.groupStyle(local.style)} ref={refsOf(local, [binding.attach, onElement])}>
|
|
333
|
+
{local.children}
|
|
334
|
+
</Element>
|
|
335
|
+
</BatchGroupContext>
|
|
336
|
+
)
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* An item of the `Reorder.BatchGroup` around it, rendered as `as`, `"li"` by default: a member of its
|
|
341
|
+
* group's Batch. Outside a group it throws.
|
|
342
|
+
*
|
|
343
|
+
* @see https://wardic.dev/reference/solid/reorder/reorder
|
|
344
|
+
*/
|
|
345
|
+
// #712, ADR-0072.
|
|
346
|
+
export function BatchItem<V, Tag extends ReorderElementTag = "li">(props: ReorderBatchItemProps<V, Tag>): JSX.Element {
|
|
347
|
+
const group = useContext(BatchGroupContext) as GroupForItems<V> | null
|
|
348
|
+
if (Predicate.isNull(group)) throw new Error("Reorder.BatchItem must be a child of Reorder.BatchGroup")
|
|
349
|
+
const local = props as unknown as ItemLocal<V>
|
|
350
|
+
const item = group.binding.item(untrack(() => local.value), usePresenceContext())
|
|
351
|
+
onCleanup(item.dispose)
|
|
352
|
+
const Element = staticElementOf(UndefinedOr.match(untrack(() => local.as), { onUndefined: () => "li", onDefined: identity }))
|
|
353
|
+
const rest = omit(props as unknown as Record<string, unknown>, ...ITEM_OWN)
|
|
354
|
+
return (
|
|
355
|
+
<Element
|
|
356
|
+
{...rest}
|
|
357
|
+
style={item.style(local.style)}
|
|
358
|
+
draggable={Style.DRAG_DEFAULT_ATTRIBUTES.draggable}
|
|
359
|
+
tabindex={UndefinedOr.match(local.tabindex, { onDefined: identity, onUndefined: () => tabStopOf(group.keyboard(), group.binding.pressable) })}
|
|
360
|
+
aria-describedby={describedByOf(local["aria-describedby"], Bool.match(group.keyboard(), { onTrue: group.instructionsId, onFalse: constUndefined }))}
|
|
361
|
+
ref={refsOf(local, [item.ref])}
|
|
362
|
+
>
|
|
363
|
+
{local.children}
|
|
364
|
+
</Element>
|
|
365
|
+
)
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
const noop = (): void => {}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* The keyboard instructions' id (ADR-0037), derived, so each item renders with its `aria-describedby`: the
|
|
372
|
+
* page's document's, until the group's element's own replaces it (an iframe's); an effect adds the
|
|
373
|
+
* instructions element, writing nothing (#320). The element exists on the client only: on a server, none.
|
|
374
|
+
* A plain `if` (#518).
|
|
375
|
+
*/
|
|
376
|
+
const instructionsIdOn = (document: () => Document, instructions: () => string): (() => string | undefined) => {
|
|
377
|
+
if (isServer) return constUndefined
|
|
378
|
+
createEffect(
|
|
379
|
+
() => ({ doc: document(), text: instructions() }),
|
|
380
|
+
({ doc, text }) => DomAnnouncer.showInstructions(doc, text),
|
|
381
|
+
CLIENT_ONLY,
|
|
382
|
+
)
|
|
383
|
+
return createMemo(() => DomAnnouncer.instructionsIdOf(document(), instructions()), CLIENT_ONLY)
|
|
384
|
+
}
|
|
385
|
+
|
|
@@ -29,7 +29,7 @@ import { onSettledClientOnly } from "./solid-reactivity.ts"
|
|
|
29
29
|
*/
|
|
30
30
|
// `Stream.runForEach` through `runScoped`; `set(() => v)`, so an object or function value is stored as
|
|
31
31
|
// it is. The stream's `R` is the provider runtime's services.
|
|
32
|
-
export const streamToSignal = <A
|
|
32
|
+
export const streamToSignal = <A,>(stream: Stream.Stream<A, never, WardicServices>, initial: A): Accessor<A> => {
|
|
33
33
|
const runtime = useWardicRuntime()
|
|
34
34
|
const [value, setValue] = createSignal<A>(initial as Exclude<A, Function>)
|
|
35
35
|
runScoped(runtime, Stream.runForEach(stream, (next) => Effect.sync(() => setValue(() => next))))
|
|
@@ -41,7 +41,7 @@ export const streamToSignal = <A>(stream: Stream.Stream<A, never, WardicServices
|
|
|
41
41
|
* the owner is disposed. Every Atom the binding hands to Solid goes through it (a ward's `read`, the
|
|
42
42
|
* Live-value helpers, `fromAtom`). Call it where you'd make a signal.
|
|
43
43
|
*/
|
|
44
|
-
export const followAtom = <A
|
|
44
|
+
export const followAtom = <A,>(registry: AtomRegistry.AtomRegistry, atom: Atom.Atom<A>): Accessor<A> => {
|
|
45
45
|
const [value, setValue] = createSignal<A>(registry.get(atom) as Exclude<A, Function>)
|
|
46
46
|
onCleanup(registry.subscribe(atom, (next) => setValue(() => next as Exclude<A, Function>)))
|
|
47
47
|
// eslint-disable-next-line solid/reactivity -- the accessor itself is returned, for its caller to read where it tracks
|
|
@@ -60,7 +60,7 @@ export const followAtom = <A>(registry: AtomRegistry.AtomRegistry, atom: Atom.At
|
|
|
60
60
|
*/
|
|
61
61
|
// Solid's `from`, seeded with the atom's value; `set(() => v)`, so an object or function value is stored
|
|
62
62
|
// as it is. A server builds no registry (ADR-0021); the Hydration hold is decision 8.
|
|
63
|
-
export const fromAtom = <A
|
|
63
|
+
export const fromAtom = <A,>(atom: Atom.Atom<A>, options?: { readonly serverValue?: A }): Accessor<A> => {
|
|
64
64
|
const runtime = useWardicRuntime()
|
|
65
65
|
const held = Predicate.isNotUndefined(options) && "serverValue" in options
|
|
66
66
|
if (held && isServer) {
|
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
import { isServer } from "@solidjs/web"
|
|
10
|
-
import * as
|
|
11
|
-
import
|
|
12
|
-
import { type Accessor, createMemo, createSignal, getOwner, onCleanup, runWithOwner } from "solid-js"
|
|
10
|
+
import * as Bool from "effect/Boolean"
|
|
11
|
+
import { onCleanup } from "solid-js"
|
|
13
12
|
import {
|
|
14
13
|
type AnimateEnv,
|
|
15
14
|
type AnimationWatch,
|
|
@@ -21,7 +20,7 @@ import {
|
|
|
21
20
|
type WardicPlaybackControls,
|
|
22
21
|
} from "../../imperative.ts"
|
|
23
22
|
import { useWardicDefaultTransition, useWardicGate, useWardicPositionalKeys, useWardicReducedMotion, useWardicRuntime, useWardicSkipAnimations } from "./provider.tsx"
|
|
24
|
-
import {
|
|
23
|
+
import { flightsOf } from "./flights.ts"
|
|
25
24
|
|
|
26
25
|
/** A scope's landing: the animation that landed last, as `scope.settled()` gives it. */
|
|
27
26
|
// #433's Q8: held in an object, as the controls are awaitable, which an async value would wait on
|
|
@@ -43,49 +42,12 @@ export interface WardicAnimationScopeV2<T extends Element = HTMLElement> extends
|
|
|
43
42
|
|
|
44
43
|
/** `scope.settled()` (#433's Q8): its animations in flight, counted, made reactive at its first read. */
|
|
45
44
|
const settledOf = (): { readonly watch: AnimationWatch; readonly read: () => WardicScopeLanding | undefined } => {
|
|
46
|
-
const
|
|
47
|
-
let flying = 0
|
|
48
|
-
let last: WardicScopeLanding | undefined
|
|
49
|
-
let setCount: ((count: number) => void) | undefined
|
|
50
|
-
let memo: Accessor<WardicScopeLanding | undefined> | undefined
|
|
51
|
-
let waiting: ((landed: WardicScopeLanding | undefined) => void) | undefined
|
|
52
|
-
const tell = (): void => {
|
|
53
|
-
UndefinedOr.map(setCount, (set) => set(flying))
|
|
54
|
-
}
|
|
55
|
-
// Its count starts at none in flight, so its first read is never pending; one in flight then is
|
|
56
|
-
// set from a microtask, as a ward's Retarget in flight is: a start comes in Solid's flush.
|
|
57
|
-
const make = (): Accessor<WardicScopeLanding | undefined> => {
|
|
58
|
-
const [count, set] = createSignal(0)
|
|
59
|
-
setCount = set
|
|
60
|
-
const made = createMemo((): WardicScopeLanding | undefined | PromiseLike<WardicScopeLanding | undefined> => {
|
|
61
|
-
if (count() === 0) return last
|
|
62
|
-
return new Promise<WardicScopeLanding | undefined>((resolve) => {
|
|
63
|
-
waiting = resolve
|
|
64
|
-
})
|
|
65
|
-
}, CLIENT_ONLY)
|
|
66
|
-
if (flying > 0) queueMicrotask(tell)
|
|
67
|
-
return made
|
|
68
|
-
}
|
|
45
|
+
const flights = flightsOf<WardicScopeLanding>()
|
|
69
46
|
const watch: AnimationWatch = {
|
|
70
|
-
started: () =>
|
|
71
|
-
|
|
72
|
-
if (Predicate.isNotUndefined(setCount)) queueMicrotask(tell)
|
|
73
|
-
},
|
|
74
|
-
ended: (controls, landed) => {
|
|
75
|
-
flying--
|
|
76
|
-
if (landed) last = { animation: controls }
|
|
77
|
-
if (flying > 0) return
|
|
78
|
-
const resolve = waiting
|
|
79
|
-
waiting = undefined
|
|
80
|
-
UndefinedOr.map(resolve, (done) => done(last))
|
|
81
|
-
tell()
|
|
82
|
-
},
|
|
83
|
-
}
|
|
84
|
-
const read = (): WardicScopeLanding | undefined => {
|
|
85
|
-
if (Predicate.isUndefined(memo)) memo = runWithOwner(owner, make)
|
|
86
|
-
return (memo as Accessor<WardicScopeLanding | undefined>)()
|
|
47
|
+
started: () => flights.started(),
|
|
48
|
+
ended: (controls, landed) => flights.ended(Bool.match(landed, { onTrue: () => ({ animation: controls }), onFalse: () => undefined })),
|
|
87
49
|
}
|
|
88
|
-
return { watch, read }
|
|
50
|
+
return { watch, read: flights.read }
|
|
89
51
|
}
|
|
90
52
|
|
|
91
53
|
/**
|