@wardic/solid 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/dist/browser/appear.js +42 -3
- package/dist/browser/appear.js.map +1 -1
- package/dist/browser/batch-handoff.js +2 -17
- package/dist/browser/batch-handoff.js.map +1 -1
- package/dist/browser/batch-reorder-group.js +40 -11
- package/dist/browser/batch-reorder-group.js.map +1 -1
- package/dist/browser/batch-reorder-places.js +517 -50
- package/dist/browser/batch-reorder-places.js.map +1 -1
- package/dist/browser/batch-reorder.js +284 -42
- package/dist/browser/batch-reorder.js.map +1 -1
- package/dist/browser/batch.js +4 -4
- package/dist/browser/batch.js.map +1 -1
- package/dist/browser/create-ward.js +28 -10
- package/dist/browser/create-ward.js.map +1 -1
- package/dist/browser/create-wardic.js +44 -0
- package/dist/browser/create-wardic.js.map +1 -0
- package/dist/browser/element.js +12 -3
- package/dist/browser/element.js.map +1 -1
- package/dist/browser/feature.js +57 -22
- package/dist/browser/feature.js.map +1 -1
- package/dist/browser/features/all.js +8 -0
- package/dist/browser/features/all.js.map +1 -1
- package/dist/browser/features/colors.js.map +1 -1
- package/dist/browser/features/dom-animation.js +8 -0
- package/dist/browser/features/dom-animation.js.map +1 -1
- package/dist/browser/features/dom-max.js +6 -0
- package/dist/browser/features/dom-max.js.map +1 -1
- package/dist/browser/features/drag.js.map +1 -1
- package/dist/browser/features/focus.js.map +1 -1
- package/dist/browser/features/hover.js.map +1 -1
- package/dist/browser/features/in-view.js.map +1 -1
- package/dist/browser/features/keys.js +6 -0
- package/dist/browser/features/keys.js.map +1 -1
- package/dist/browser/features/layout.js +14 -3
- package/dist/browser/features/layout.js.map +1 -1
- package/dist/browser/features/pan.js.map +1 -1
- package/dist/browser/features/press.js.map +1 -1
- package/dist/browser/features/scroll.js +10 -3
- package/dist/browser/features/scroll.js.map +1 -1
- package/dist/browser/features/timeline-keys.js +100 -0
- package/dist/browser/features/timeline-keys.js.map +1 -0
- package/dist/browser/imperative.js +182 -4
- package/dist/browser/imperative.js.map +1 -1
- package/dist/browser/index.js +2 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/instance-features.js +66 -0
- package/dist/browser/instance-features.js.map +1 -0
- package/dist/browser/layout-member.js +0 -2
- package/dist/browser/layout-member.js.map +1 -1
- package/dist/browser/layout-projection.js +8 -1
- package/dist/browser/layout-projection.js.map +1 -1
- package/dist/browser/layout.js +5 -6
- package/dist/browser/layout.js.map +1 -1
- package/dist/browser/live-scroll.js +29 -21
- package/dist/browser/live-scroll.js.map +1 -1
- package/dist/browser/live-style.js +10 -0
- package/dist/browser/live-style.js.map +1 -1
- package/dist/browser/live-value.js +11 -2
- package/dist/browser/live-value.js.map +1 -1
- package/dist/browser/member-hold.js +37 -7
- package/dist/browser/member-hold.js.map +1 -1
- package/dist/browser/messages.js +20 -0
- package/dist/browser/messages.js.map +1 -0
- package/dist/browser/presence-controller.js +136 -44
- package/dist/browser/presence-controller.js.map +1 -1
- package/dist/browser/presence-record.js.map +1 -1
- package/dist/browser/presence.js.map +1 -1
- package/dist/browser/provider.js +57 -11
- package/dist/browser/provider.js.map +1 -1
- package/dist/browser/reorder.js.map +1 -1
- package/dist/browser/runtime.js +15 -9
- package/dist/browser/runtime.js.map +1 -1
- package/dist/browser/scroll-values.js +46 -0
- package/dist/browser/scroll-values.js.map +1 -0
- package/dist/browser/spans-check.js +25 -0
- package/dist/browser/spans-check.js.map +1 -0
- package/dist/browser/spine.js +149 -207
- package/dist/browser/spine.js.map +1 -1
- package/dist/browser/timelines.js +9 -0
- package/dist/browser/timelines.js.map +1 -0
- package/dist/browser/unstable/v2/batch-reorder-group.js +36 -6
- package/dist/browser/unstable/v2/batch-reorder-group.js.map +1 -1
- package/dist/browser/unstable/v2/create-wardic.js +45 -0
- package/dist/browser/unstable/v2/create-wardic.js.map +1 -0
- package/dist/browser/unstable/v2/element.js +12 -2
- package/dist/browser/unstable/v2/element.js.map +1 -1
- package/dist/browser/unstable/v2/index.js +1 -0
- package/dist/browser/unstable/v2/index.js.map +1 -1
- package/dist/browser/unstable/v2/lifecycle.js +2 -0
- package/dist/browser/unstable/v2/lifecycle.js.map +1 -1
- package/dist/browser/unstable/v2/live-scroll.js +22 -13
- package/dist/browser/unstable/v2/live-scroll.js.map +1 -1
- package/dist/browser/unstable/v2/live-value.js +9 -1
- package/dist/browser/unstable/v2/live-value.js.map +1 -1
- package/dist/browser/unstable/v2/presence.js.map +1 -1
- package/dist/browser/unstable/v2/provider.js +60 -13
- package/dist/browser/unstable/v2/provider.js.map +1 -1
- package/dist/browser/unstable/v2/reorder.js.map +1 -1
- package/dist/browser/unstable/v2/w.js +7 -8
- package/dist/browser/unstable/v2/w.js.map +1 -1
- package/dist/browser/unstable/v2/ward.js +27 -9
- package/dist/browser/unstable/v2/ward.js.map +1 -1
- package/dist/browser/unstable/v2/wardic-instance.js +2 -0
- package/dist/browser/unstable/v2/wardic-instance.js.map +1 -0
- package/dist/browser/w.js +8 -9
- package/dist/browser/w.js.map +1 -1
- package/dist/browser/wardic-instance.js +2 -0
- package/dist/browser/wardic-instance.js.map +1 -0
- package/dist/server/appear.js +42 -3
- package/dist/server/appear.js.map +1 -1
- package/dist/server/batch-handoff.js +2 -17
- package/dist/server/batch-handoff.js.map +1 -1
- package/dist/server/batch-reorder-group.js +40 -11
- package/dist/server/batch-reorder-group.js.map +1 -1
- package/dist/server/batch-reorder-places.js +517 -50
- package/dist/server/batch-reorder-places.js.map +1 -1
- package/dist/server/batch-reorder.js +284 -42
- package/dist/server/batch-reorder.js.map +1 -1
- package/dist/server/batch.js +4 -4
- package/dist/server/batch.js.map +1 -1
- package/dist/server/create-ward.js +28 -10
- package/dist/server/create-ward.js.map +1 -1
- package/dist/server/create-wardic.js +44 -0
- package/dist/server/create-wardic.js.map +1 -0
- package/dist/server/element.js +12 -3
- package/dist/server/element.js.map +1 -1
- package/dist/server/feature.js +57 -22
- package/dist/server/feature.js.map +1 -1
- package/dist/server/features/all.js +8 -0
- package/dist/server/features/all.js.map +1 -1
- package/dist/server/features/colors.js.map +1 -1
- package/dist/server/features/dom-animation.js +8 -0
- package/dist/server/features/dom-animation.js.map +1 -1
- package/dist/server/features/dom-max.js +6 -0
- package/dist/server/features/dom-max.js.map +1 -1
- package/dist/server/features/drag.js.map +1 -1
- package/dist/server/features/focus.js.map +1 -1
- package/dist/server/features/hover.js.map +1 -1
- package/dist/server/features/in-view.js.map +1 -1
- package/dist/server/features/keys.js +6 -0
- package/dist/server/features/keys.js.map +1 -1
- package/dist/server/features/layout.js +14 -3
- package/dist/server/features/layout.js.map +1 -1
- package/dist/server/features/pan.js.map +1 -1
- package/dist/server/features/press.js.map +1 -1
- package/dist/server/features/scroll.js +10 -3
- package/dist/server/features/scroll.js.map +1 -1
- package/dist/server/features/timeline-keys.js +100 -0
- package/dist/server/features/timeline-keys.js.map +1 -0
- package/dist/server/imperative.js +182 -4
- package/dist/server/imperative.js.map +1 -1
- package/dist/server/index.js +2 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/instance-features.js +66 -0
- package/dist/server/instance-features.js.map +1 -0
- package/dist/server/layout-member.js +0 -2
- package/dist/server/layout-member.js.map +1 -1
- package/dist/server/layout-projection.js +8 -1
- package/dist/server/layout-projection.js.map +1 -1
- package/dist/server/layout.js +5 -6
- package/dist/server/layout.js.map +1 -1
- package/dist/server/live-scroll.js +29 -21
- package/dist/server/live-scroll.js.map +1 -1
- package/dist/server/live-style.js +10 -0
- package/dist/server/live-style.js.map +1 -1
- package/dist/server/live-value.js +11 -2
- package/dist/server/live-value.js.map +1 -1
- package/dist/server/member-hold.js +37 -7
- package/dist/server/member-hold.js.map +1 -1
- package/dist/server/messages.js +20 -0
- package/dist/server/messages.js.map +1 -0
- package/dist/server/presence-controller.js +136 -44
- package/dist/server/presence-controller.js.map +1 -1
- package/dist/server/presence-record.js.map +1 -1
- package/dist/server/presence.js.map +1 -1
- package/dist/server/provider.js +57 -11
- package/dist/server/provider.js.map +1 -1
- package/dist/server/reorder.js.map +1 -1
- package/dist/server/runtime.js +15 -9
- package/dist/server/runtime.js.map +1 -1
- package/dist/server/scroll-values.js +46 -0
- package/dist/server/scroll-values.js.map +1 -0
- package/dist/server/spans-check.js +25 -0
- package/dist/server/spans-check.js.map +1 -0
- package/dist/server/spine.js +149 -207
- package/dist/server/spine.js.map +1 -1
- package/dist/server/timelines.js +9 -0
- package/dist/server/timelines.js.map +1 -0
- package/dist/server/unstable/v2/batch-reorder-group.js +36 -6
- package/dist/server/unstable/v2/batch-reorder-group.js.map +1 -1
- package/dist/server/unstable/v2/create-wardic.js +45 -0
- package/dist/server/unstable/v2/create-wardic.js.map +1 -0
- package/dist/server/unstable/v2/element.js +12 -2
- package/dist/server/unstable/v2/element.js.map +1 -1
- package/dist/server/unstable/v2/index.js +1 -0
- package/dist/server/unstable/v2/index.js.map +1 -1
- package/dist/server/unstable/v2/lifecycle.js +2 -0
- package/dist/server/unstable/v2/lifecycle.js.map +1 -1
- package/dist/server/unstable/v2/live-scroll.js +22 -13
- package/dist/server/unstable/v2/live-scroll.js.map +1 -1
- package/dist/server/unstable/v2/live-value.js +9 -1
- package/dist/server/unstable/v2/live-value.js.map +1 -1
- package/dist/server/unstable/v2/presence.js.map +1 -1
- package/dist/server/unstable/v2/provider.js +60 -13
- package/dist/server/unstable/v2/provider.js.map +1 -1
- package/dist/server/unstable/v2/reorder.js.map +1 -1
- package/dist/server/unstable/v2/w.js +7 -8
- package/dist/server/unstable/v2/w.js.map +1 -1
- package/dist/server/unstable/v2/ward.js +27 -9
- package/dist/server/unstable/v2/ward.js.map +1 -1
- package/dist/server/unstable/v2/wardic-instance.js +2 -0
- package/dist/server/unstable/v2/wardic-instance.js.map +1 -0
- package/dist/server/w.js +8 -9
- package/dist/server/w.js.map +1 -1
- package/dist/server/wardic-instance.js +2 -0
- package/dist/server/wardic-instance.js.map +1 -0
- package/dist/solid/appear.d.ts +15 -2
- package/dist/solid/appear.d.ts.map +1 -1
- package/dist/solid/appear.js +43 -2
- package/dist/solid/appear.js.map +1 -1
- package/dist/solid/batch-handoff.d.ts.map +1 -1
- package/dist/solid/batch-handoff.js +2 -15
- package/dist/solid/batch-handoff.js.map +1 -1
- package/dist/solid/batch-reorder-group.d.ts +17 -15
- package/dist/solid/batch-reorder-group.d.ts.map +1 -1
- package/dist/solid/batch-reorder-group.jsx +37 -7
- package/dist/solid/batch-reorder-group.jsx.map +1 -1
- package/dist/solid/batch-reorder-places.d.ts +184 -23
- package/dist/solid/batch-reorder-places.d.ts.map +1 -1
- package/dist/solid/batch-reorder-places.js +397 -41
- package/dist/solid/batch-reorder-places.js.map +1 -1
- package/dist/solid/batch-reorder.d.ts +30 -1
- package/dist/solid/batch-reorder.d.ts.map +1 -1
- package/dist/solid/batch-reorder.js +298 -37
- package/dist/solid/batch-reorder.js.map +1 -1
- package/dist/solid/batch.d.ts.map +1 -1
- package/dist/solid/batch.js +4 -4
- package/dist/solid/batch.js.map +1 -1
- package/dist/solid/config.d.ts +141 -103
- package/dist/solid/config.d.ts.map +1 -1
- package/dist/solid/create-ward.d.ts +3 -1
- package/dist/solid/create-ward.d.ts.map +1 -1
- package/dist/solid/create-ward.jsx +29 -9
- package/dist/solid/create-ward.jsx.map +1 -1
- package/dist/solid/create-wardic.d.ts +24 -0
- package/dist/solid/create-wardic.d.ts.map +1 -0
- package/dist/solid/create-wardic.jsx +42 -0
- package/dist/solid/create-wardic.jsx.map +1 -0
- package/dist/solid/element.d.ts +26 -8
- package/dist/solid/element.d.ts.map +1 -1
- package/dist/solid/element.jsx +13 -5
- package/dist/solid/element.jsx.map +1 -1
- package/dist/solid/feature.d.ts +91 -3
- package/dist/solid/feature.d.ts.map +1 -1
- package/dist/solid/feature.js +48 -19
- package/dist/solid/feature.js.map +1 -1
- package/dist/solid/features/all.d.ts +9 -2
- package/dist/solid/features/all.d.ts.map +1 -1
- package/dist/solid/features/all.js +18 -1
- package/dist/solid/features/all.js.map +1 -1
- package/dist/solid/features/colors.d.ts +1 -1
- package/dist/solid/features/colors.d.ts.map +1 -1
- package/dist/solid/features/colors.js.map +1 -1
- package/dist/solid/features/dom-animation.d.ts +5 -2
- package/dist/solid/features/dom-animation.d.ts.map +1 -1
- package/dist/solid/features/dom-animation.js +8 -0
- package/dist/solid/features/dom-animation.js.map +1 -1
- package/dist/solid/features/dom-max.d.ts +2 -2
- package/dist/solid/features/dom-max.d.ts.map +1 -1
- package/dist/solid/features/dom-max.js +6 -0
- package/dist/solid/features/dom-max.js.map +1 -1
- package/dist/solid/features/drag.d.ts +1 -1
- package/dist/solid/features/drag.d.ts.map +1 -1
- package/dist/solid/features/drag.js.map +1 -1
- package/dist/solid/features/focus.d.ts +1 -1
- package/dist/solid/features/focus.d.ts.map +1 -1
- package/dist/solid/features/focus.js.map +1 -1
- package/dist/solid/features/hover.d.ts +1 -1
- package/dist/solid/features/hover.d.ts.map +1 -1
- package/dist/solid/features/hover.js.map +1 -1
- package/dist/solid/features/in-view.d.ts +1 -1
- package/dist/solid/features/in-view.d.ts.map +1 -1
- package/dist/solid/features/in-view.js.map +1 -1
- package/dist/solid/features/keys.d.ts +16 -1
- package/dist/solid/features/keys.d.ts.map +1 -1
- package/dist/solid/features/keys.js +7 -0
- package/dist/solid/features/keys.js.map +1 -1
- package/dist/solid/features/layout.d.ts +7 -1
- package/dist/solid/features/layout.d.ts.map +1 -1
- package/dist/solid/features/layout.js +14 -4
- package/dist/solid/features/layout.js.map +1 -1
- package/dist/solid/features/pan.d.ts +1 -1
- package/dist/solid/features/pan.d.ts.map +1 -1
- package/dist/solid/features/pan.js.map +1 -1
- package/dist/solid/features/press.d.ts +1 -1
- package/dist/solid/features/press.d.ts.map +1 -1
- package/dist/solid/features/press.js.map +1 -1
- package/dist/solid/features/scroll.d.ts +5 -3
- package/dist/solid/features/scroll.d.ts.map +1 -1
- package/dist/solid/features/scroll.js +12 -3
- package/dist/solid/features/scroll.js.map +1 -1
- package/dist/solid/features/timeline-keys.d.ts +7 -0
- package/dist/solid/features/timeline-keys.d.ts.map +1 -0
- package/dist/solid/features/timeline-keys.js +97 -0
- package/dist/solid/features/timeline-keys.js.map +1 -0
- package/dist/solid/imperative.d.ts +3 -3
- package/dist/solid/imperative.d.ts.map +1 -1
- package/dist/solid/imperative.js +146 -4
- package/dist/solid/imperative.js.map +1 -1
- package/dist/solid/index.d.ts +4 -2
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.jsx +2 -1
- package/dist/solid/index.jsx.map +1 -1
- package/dist/solid/instance-features.d.ts +7 -0
- package/dist/solid/instance-features.d.ts.map +1 -0
- package/dist/solid/instance-features.js +63 -0
- package/dist/solid/instance-features.js.map +1 -0
- package/dist/solid/layout-member.d.ts +0 -2
- package/dist/solid/layout-member.d.ts.map +1 -1
- package/dist/solid/layout-member.js +0 -2
- package/dist/solid/layout-member.js.map +1 -1
- package/dist/solid/layout-projection.d.ts +6 -0
- package/dist/solid/layout-projection.d.ts.map +1 -1
- package/dist/solid/layout-projection.jsx +8 -1
- package/dist/solid/layout-projection.jsx.map +1 -1
- package/dist/solid/layout.d.ts +4 -3
- package/dist/solid/layout.d.ts.map +1 -1
- package/dist/solid/layout.jsx +5 -6
- package/dist/solid/layout.jsx.map +1 -1
- package/dist/solid/live-scroll.d.ts +4 -0
- package/dist/solid/live-scroll.d.ts.map +1 -1
- package/dist/solid/live-scroll.jsx +29 -19
- package/dist/solid/live-scroll.jsx.map +1 -1
- package/dist/solid/live-style.d.ts +11 -0
- package/dist/solid/live-style.d.ts.map +1 -1
- package/dist/solid/live-style.js +10 -0
- package/dist/solid/live-style.js.map +1 -1
- package/dist/solid/live-value.d.ts +1 -0
- package/dist/solid/live-value.d.ts.map +1 -1
- package/dist/solid/live-value.jsx +12 -3
- package/dist/solid/live-value.jsx.map +1 -1
- package/dist/solid/member-hold.d.ts +5 -19
- package/dist/solid/member-hold.d.ts.map +1 -1
- package/dist/solid/member-hold.js +42 -7
- package/dist/solid/member-hold.js.map +1 -1
- package/dist/solid/messages.d.ts +20 -0
- package/dist/solid/messages.d.ts.map +1 -0
- package/dist/solid/messages.js +22 -0
- package/dist/solid/messages.js.map +1 -0
- package/dist/solid/presence-controller.d.ts +1 -1
- package/dist/solid/presence-controller.d.ts.map +1 -1
- package/dist/solid/presence-controller.js +125 -34
- package/dist/solid/presence-controller.js.map +1 -1
- package/dist/solid/presence-record.d.ts +3 -3
- package/dist/solid/presence-record.d.ts.map +1 -1
- package/dist/solid/presence-record.js.map +1 -1
- package/dist/solid/presence.d.ts +3 -1
- package/dist/solid/presence.d.ts.map +1 -1
- package/dist/solid/presence.jsx.map +1 -1
- package/dist/solid/provider.d.ts +17 -3
- package/dist/solid/provider.d.ts.map +1 -1
- package/dist/solid/provider.jsx +55 -7
- package/dist/solid/provider.jsx.map +1 -1
- package/dist/solid/reorder.d.ts +5 -4
- package/dist/solid/reorder.d.ts.map +1 -1
- package/dist/solid/reorder.jsx.map +1 -1
- package/dist/solid/runtime.d.ts +10 -2
- package/dist/solid/runtime.d.ts.map +1 -1
- package/dist/solid/runtime.js +15 -9
- package/dist/solid/runtime.js.map +1 -1
- package/dist/solid/scroll-values.d.ts +30 -0
- package/dist/solid/scroll-values.d.ts.map +1 -0
- package/dist/solid/scroll-values.js +44 -0
- package/dist/solid/scroll-values.js.map +1 -0
- package/dist/solid/spans-check.d.ts +4 -0
- package/dist/solid/spans-check.d.ts.map +1 -0
- package/dist/solid/spans-check.js +23 -0
- package/dist/solid/spans-check.js.map +1 -0
- package/dist/solid/spine.d.ts +144 -13
- package/dist/solid/spine.d.ts.map +1 -1
- package/dist/solid/spine.js +131 -183
- package/dist/solid/spine.js.map +1 -1
- package/dist/solid/timelines.d.ts +44 -0
- package/dist/solid/timelines.d.ts.map +1 -0
- package/dist/solid/timelines.js +10 -0
- package/dist/solid/timelines.js.map +1 -0
- package/dist/solid/unstable/v2/batch-reorder-group.d.ts +18 -17
- package/dist/solid/unstable/v2/batch-reorder-group.d.ts.map +1 -1
- package/dist/solid/unstable/v2/batch-reorder-group.jsx +32 -5
- package/dist/solid/unstable/v2/batch-reorder-group.jsx.map +1 -1
- package/dist/solid/unstable/v2/create-wardic.d.ts +25 -0
- package/dist/solid/unstable/v2/create-wardic.d.ts.map +1 -0
- package/dist/solid/unstable/v2/create-wardic.jsx +43 -0
- package/dist/solid/unstable/v2/create-wardic.jsx.map +1 -0
- package/dist/solid/unstable/v2/element.d.ts +52 -18
- package/dist/solid/unstable/v2/element.d.ts.map +1 -1
- package/dist/solid/unstable/v2/element.jsx +13 -4
- package/dist/solid/unstable/v2/element.jsx.map +1 -1
- package/dist/solid/unstable/v2/index.d.ts +3 -1
- package/dist/solid/unstable/v2/index.d.ts.map +1 -1
- package/dist/solid/unstable/v2/index.jsx +1 -0
- package/dist/solid/unstable/v2/index.jsx.map +1 -1
- package/dist/solid/unstable/v2/lifecycle.d.ts +29 -0
- package/dist/solid/unstable/v2/lifecycle.d.ts.map +1 -1
- package/dist/solid/unstable/v2/lifecycle.js +2 -0
- package/dist/solid/unstable/v2/lifecycle.js.map +1 -1
- package/dist/solid/unstable/v2/live-scroll.d.ts +4 -0
- package/dist/solid/unstable/v2/live-scroll.d.ts.map +1 -1
- package/dist/solid/unstable/v2/live-scroll.jsx +22 -11
- package/dist/solid/unstable/v2/live-scroll.jsx.map +1 -1
- package/dist/solid/unstable/v2/live-value.d.ts +1 -0
- package/dist/solid/unstable/v2/live-value.d.ts.map +1 -1
- package/dist/solid/unstable/v2/live-value.jsx +10 -1
- package/dist/solid/unstable/v2/live-value.jsx.map +1 -1
- package/dist/solid/unstable/v2/presence.d.ts +3 -1
- package/dist/solid/unstable/v2/presence.d.ts.map +1 -1
- package/dist/solid/unstable/v2/presence.jsx.map +1 -1
- package/dist/solid/unstable/v2/provider.d.ts +17 -3
- package/dist/solid/unstable/v2/provider.d.ts.map +1 -1
- package/dist/solid/unstable/v2/provider.jsx +58 -10
- package/dist/solid/unstable/v2/provider.jsx.map +1 -1
- package/dist/solid/unstable/v2/reorder.d.ts +4 -3
- package/dist/solid/unstable/v2/reorder.d.ts.map +1 -1
- package/dist/solid/unstable/v2/reorder.jsx.map +1 -1
- package/dist/solid/unstable/v2/w.d.ts +41 -10
- package/dist/solid/unstable/v2/w.d.ts.map +1 -1
- package/dist/solid/unstable/v2/w.jsx +5 -7
- package/dist/solid/unstable/v2/w.jsx.map +1 -1
- package/dist/solid/unstable/v2/ward.d.ts +15 -8
- package/dist/solid/unstable/v2/ward.d.ts.map +1 -1
- package/dist/solid/unstable/v2/ward.jsx +28 -8
- package/dist/solid/unstable/v2/ward.jsx.map +1 -1
- package/dist/solid/unstable/v2/wardic-instance.d.ts +47 -0
- package/dist/solid/unstable/v2/wardic-instance.d.ts.map +1 -0
- package/dist/solid/unstable/v2/wardic-instance.js +2 -0
- package/dist/solid/unstable/v2/wardic-instance.js.map +1 -0
- package/dist/solid/w.d.ts +24 -10
- package/dist/solid/w.d.ts.map +1 -1
- package/dist/solid/w.jsx +8 -7
- package/dist/solid/w.jsx.map +1 -1
- package/dist/solid/ward-keys.d.ts +22 -3
- package/dist/solid/ward-keys.d.ts.map +1 -1
- package/dist/solid/wardic-instance.d.ts +46 -0
- package/dist/solid/wardic-instance.d.ts.map +1 -0
- package/dist/solid/wardic-instance.js +2 -0
- package/dist/solid/wardic-instance.js.map +1 -0
- package/package.json +4 -4
- package/src/appear.ts +56 -2
- package/src/batch-handoff.ts +2 -16
- package/src/batch-reorder-group.tsx +47 -21
- package/src/batch-reorder-places.ts +566 -54
- package/src/batch-reorder.ts +333 -40
- package/src/batch.ts +4 -4
- package/src/config.ts +177 -123
- package/src/create-ward.tsx +32 -8
- package/src/create-wardic.tsx +45 -0
- package/src/element.tsx +52 -16
- package/src/feature.ts +157 -25
- package/src/features/all.ts +11 -2
- package/src/features/colors.ts +1 -1
- package/src/features/dom-animation.ts +2 -2
- package/src/features/dom-max.ts +1 -2
- package/src/features/drag.ts +1 -1
- package/src/features/focus.ts +1 -1
- package/src/features/hover.ts +1 -1
- package/src/features/in-view.ts +1 -1
- package/src/features/keys.ts +18 -1
- package/src/features/layout.ts +17 -5
- package/src/features/pan.ts +1 -1
- package/src/features/press.ts +1 -1
- package/src/features/scroll.ts +14 -4
- package/src/features/timeline-keys.ts +109 -0
- package/src/imperative.ts +168 -10
- package/src/index.tsx +6 -1
- package/src/instance-features.ts +88 -0
- package/src/layout-member.ts +0 -4
- package/src/layout-projection.tsx +10 -1
- package/src/layout.tsx +7 -6
- package/src/live-scroll.tsx +30 -22
- package/src/live-style.ts +21 -0
- package/src/live-value.tsx +12 -2
- package/src/member-hold.ts +45 -26
- package/src/messages.ts +27 -0
- package/src/presence-controller.ts +222 -106
- package/src/presence-record.ts +3 -3
- package/src/presence.tsx +3 -1
- package/src/provider.tsx +62 -7
- package/src/reorder.tsx +5 -4
- package/src/runtime.ts +17 -10
- package/src/scroll-values.ts +53 -0
- package/src/spans-check.ts +25 -0
- package/src/spine.ts +219 -187
- package/src/timelines.ts +46 -0
- package/src/unstable/v2/batch-reorder-group.tsx +42 -18
- package/src/unstable/v2/create-wardic.tsx +46 -0
- package/src/unstable/v2/element.tsx +85 -24
- package/src/unstable/v2/index.tsx +5 -0
- package/src/unstable/v2/lifecycle.ts +35 -0
- package/src/unstable/v2/live-scroll.tsx +22 -11
- package/src/unstable/v2/live-value.tsx +10 -0
- package/src/unstable/v2/presence.tsx +3 -1
- package/src/unstable/v2/provider.tsx +65 -9
- package/src/unstable/v2/reorder.tsx +9 -4
- package/src/unstable/v2/w.tsx +49 -13
- package/src/unstable/v2/ward.tsx +48 -13
- package/src/unstable/v2/wardic-instance.ts +50 -0
- package/src/w.tsx +33 -16
- package/src/ward-keys.ts +38 -17
- package/src/wardic-instance.ts +49 -0
package/src/batch-reorder.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A **Batch Reorder group**'s work (#712, ADR-0072), Solid-free: a long list reordered as one keyed Batch,
|
|
3
|
-
* each item at the place its index gives (`batch-reorder-places.ts`), never measured.
|
|
4
|
-
* `Reorder.BatchGroup` build on it, each tracking its values and geometry with its own Solid.
|
|
3
|
+
* each item at the place its index gives (`batch-reorder-places.ts`), its box computed, never measured.
|
|
4
|
+
* Both bindings' `Reorder.BatchGroup` build on it, each tracking its values and geometry with its own Solid.
|
|
5
5
|
*
|
|
6
6
|
* - **The Batch**: keyed by the value itself, each member turned toward its place, `x` and `y`, whenever
|
|
7
7
|
* the list or the geometry changes, in one change.
|
|
8
8
|
* - **The item in hand** (decision 7): held where the pointer has it, raised, `whileDrag` on; let go, it
|
|
9
9
|
* flies to its place at its release's speed, and a grab stops it where it is, as a `Reorder.Item`'s.
|
|
10
10
|
* - **What it reads of its element** (Q35, Q36): the direction it inherits, as it mounts, and a grid's width
|
|
11
|
-
* as it's resized; its first read's places drawn before the page paints.
|
|
11
|
+
* as it's resized, its rows from it (#714 too); its first read's places drawn before the page paints.
|
|
12
|
+
* - **Items each their own size** (#714, ADR-0072 *Amendment (#714)*): a function's, called for every item
|
|
13
|
+
* at each change, in the binding's tracking; each item's size written on its element as it's made, and
|
|
14
|
+
* again at a change that changes it. Or each read from the page, `itemSize` left out (decisions 3 to 5):
|
|
15
|
+
* one observer over every item, its delivery placing them, the group's own size a tick after.
|
|
12
16
|
* - **A server's group** (Q37, Q39): each item's start, with no runtime.
|
|
13
17
|
*
|
|
14
18
|
* @module
|
|
@@ -17,6 +21,7 @@ import type * as Box from "@wardic/core/Box"
|
|
|
17
21
|
import type * as Drag from "@wardic/core/Drag"
|
|
18
22
|
import * as DragRecognizer from "@wardic/core/DragRecognizer"
|
|
19
23
|
import * as InputSource from "@wardic/core/InputSource"
|
|
24
|
+
import * as Machine from "@wardic/core/Machine"
|
|
20
25
|
import * as RefreshFrameSource from "@wardic/core/RefreshFrameSource"
|
|
21
26
|
import type * as CoreReorder from "@wardic/core/Reorder"
|
|
22
27
|
import * as ReorderController from "@wardic/dom/ReorderController"
|
|
@@ -57,13 +62,25 @@ import {
|
|
|
57
62
|
type BatchReorderGeometry,
|
|
58
63
|
type BatchReorderPlaces,
|
|
59
64
|
type BatchReorderRead,
|
|
65
|
+
type ReorderBatchItemSize,
|
|
60
66
|
groupStyleOf,
|
|
61
|
-
|
|
67
|
+
heightAt,
|
|
62
68
|
isFromWidth,
|
|
63
69
|
itemBaseOf,
|
|
70
|
+
itemsInFlow,
|
|
64
71
|
placeOf,
|
|
72
|
+
readsSizes,
|
|
73
|
+
type SizesRead,
|
|
74
|
+
releaseGroupWidth,
|
|
65
75
|
resolvePlaces,
|
|
66
76
|
samePlaces,
|
|
77
|
+
sameStyle,
|
|
78
|
+
sizeStyleOf,
|
|
79
|
+
widthAt,
|
|
80
|
+
unwriteSizeOn,
|
|
81
|
+
writeSizeOn,
|
|
82
|
+
writesSizes,
|
|
83
|
+
type WrittenSize,
|
|
67
84
|
type XY,
|
|
68
85
|
} from "./batch-reorder-places.ts"
|
|
69
86
|
import type { Feature } from "./feature.ts"
|
|
@@ -77,8 +94,10 @@ export {
|
|
|
77
94
|
type BatchReorderDirection,
|
|
78
95
|
type BatchReorderRead,
|
|
79
96
|
geometryOf,
|
|
97
|
+
type ReorderBatchColumnSize,
|
|
80
98
|
type ReorderBatchGap,
|
|
81
99
|
type ReorderBatchItemSize,
|
|
100
|
+
type ReorderBatchSizing,
|
|
82
101
|
sameRead,
|
|
83
102
|
} from "./batch-reorder-places.ts"
|
|
84
103
|
|
|
@@ -118,12 +137,49 @@ const directionAbove = (el: Element): BatchReorderDirection =>
|
|
|
118
137
|
onFalse: (): BatchReorderDirection => "ltr",
|
|
119
138
|
})
|
|
120
139
|
|
|
121
|
-
/** `
|
|
140
|
+
/** Whether an `overflow` makes a scrollbar room may be taken from: one that scrolls. */
|
|
141
|
+
const scrolls = (overflow: string): boolean => Bool.or(overflow === "auto", overflow === "scroll")
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* `el`'s content box's width, unrounded, as the browser lays its rows out (#714: a grid's rows break where
|
|
145
|
+
* `flex-wrap`'s do): its used width, less its padding and border when it's border-box. One that scrolls may
|
|
146
|
+
* have a scrollbar there, which only `clientWidth` leaves out: its client width less its padding, in whole px.
|
|
147
|
+
*/
|
|
122
148
|
const contentWidthOf = (el: Element): number => {
|
|
123
149
|
const style = getComputedStyle(el)
|
|
124
|
-
|
|
150
|
+
const padding = parseFloat(style.paddingLeft) + parseFloat(style.paddingRight)
|
|
151
|
+
const client = (): number => el.clientWidth - padding
|
|
152
|
+
const used = parseFloat(style.width)
|
|
153
|
+
if (Bool.or(scrolls(style.overflowY), Number.isNaN(used))) return client()
|
|
154
|
+
return Bool.match(style.boxSizing === "border-box", {
|
|
155
|
+
onTrue: () => used - padding - parseFloat(style.borderLeftWidth) - parseFloat(style.borderRightWidth),
|
|
156
|
+
onFalse: () => used,
|
|
157
|
+
})
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* What `el` holds beyond its content box (#714): what its own `width` and `height` hold besides it, on each
|
|
162
|
+
* axis, its padding and border when it's `border-box`, as a CSS reset makes it, none when it's `content-box`;
|
|
163
|
+
* and its horizontal padding, what an absolutely placed item's `100%` holds besides it.
|
|
164
|
+
*/
|
|
165
|
+
const edgesAndPaddingOf = (el: Element): Pick<BatchReorderRead, "edges" | "padding"> => {
|
|
166
|
+
const style = getComputedStyle(el)
|
|
167
|
+
const padding = parseFloat(style.paddingLeft) + parseFloat(style.paddingRight)
|
|
168
|
+
return {
|
|
169
|
+
padding,
|
|
170
|
+
edges: Bool.match(style.boxSizing === "border-box", {
|
|
171
|
+
onTrue: (): XY => ({
|
|
172
|
+
x: padding + parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth),
|
|
173
|
+
y: parseFloat(style.paddingTop) + parseFloat(style.paddingBottom) + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth),
|
|
174
|
+
}),
|
|
175
|
+
onFalse: (): XY => ORIGIN,
|
|
176
|
+
}),
|
|
177
|
+
}
|
|
125
178
|
}
|
|
126
179
|
|
|
180
|
+
/** The group's boxes its size is observed by (#714): a padding that changes moves one or the other. */
|
|
181
|
+
const GROUP_BOXES: ReadonlyArray<ResizeObserverBoxOptions> = ["content-box", "border-box"]
|
|
182
|
+
|
|
127
183
|
/** Whether a node is an HTML element: what a raise's `z-index` is written on. */
|
|
128
184
|
const isHTMLElement = (node: unknown): node is HTMLElement => node instanceof HTMLElement
|
|
129
185
|
|
|
@@ -158,6 +214,35 @@ export interface BatchReorderOptions<V> {
|
|
|
158
214
|
readonly announcements: () => Option.Option<Partial<CoreReorder.Announcements<V>>>
|
|
159
215
|
/** What the group brings ({@link GROUP_BRINGS}): the gestures' input its items are heard through. */
|
|
160
216
|
readonly brought: () => Context.Context<never>
|
|
217
|
+
/** Its items' sizes read from the page (#714): signals of the binding's own. */
|
|
218
|
+
readonly sizes: BatchReorderSizeSignals
|
|
219
|
+
/**
|
|
220
|
+
* Its binding's Solid's `createMemo`, made under the group, its value kept while `equals` holds: what every
|
|
221
|
+
* item reads of the group (their base style), worked out once, not once an item.
|
|
222
|
+
*/
|
|
223
|
+
readonly memo: <A>(compute: () => A, equals: Equivalence.Equivalence<A>) => () => A
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* A group's signals for its items' sizes read from the page, `itemSize` left out (#714, decisions 3 to 5),
|
|
228
|
+
* its binding's own, each read in its tracking: the Batch's places read `version` and `placed`, its items'
|
|
229
|
+
* style `placed`, the group's style `placed` and `groupVersion`, so its own size never changes in its
|
|
230
|
+
* items' delivery (the page's "ResizeObserver loop" error).
|
|
231
|
+
*/
|
|
232
|
+
export interface BatchReorderSizeSignals {
|
|
233
|
+
/** How many deliveries of new sizes there have been. */
|
|
234
|
+
readonly version: () => number
|
|
235
|
+
/** Whether the first came in: its items out of flow from then on. */
|
|
236
|
+
readonly placed: () => boolean
|
|
237
|
+
/** The group's own size's version: written a tick after a later delivery's. */
|
|
238
|
+
readonly groupVersion: () => number
|
|
239
|
+
/**
|
|
240
|
+
* New sizes in: every change they make runs now, in the delivery, before the page paints. The first
|
|
241
|
+
* also takes the items out of flow and sizes the group with them, where flow had it already.
|
|
242
|
+
*/
|
|
243
|
+
readonly arrived: (first: boolean) => void
|
|
244
|
+
/** The group's own size, written at the Frame loop's tick after a later delivery. */
|
|
245
|
+
readonly resizeGroup: () => void
|
|
161
246
|
}
|
|
162
247
|
|
|
163
248
|
/** What a group's items read of it: each one's half, and whether they're pressed. A server's group is one. */
|
|
@@ -293,10 +378,19 @@ export const bindBatchReorder = <V>(env: BatchEnv, options: BatchReorderOptions<
|
|
|
293
378
|
const gestures = batchGesturesOn(runtime, options.brought)
|
|
294
379
|
/** Where its items go now: its props', with what it read of its element. */
|
|
295
380
|
const geometryNow = (): BatchReorderGeometry => options.geometryOf(options.read())
|
|
296
|
-
// The places each item's is read from, resolved once a change
|
|
297
|
-
// item's targets. A change of them its first read makes lands at once (Q35, Q36): no
|
|
298
|
-
// drawn before the first paint.
|
|
299
|
-
|
|
381
|
+
// The places each item's is read from, resolved once a change, and the list they're for: the Batch reads
|
|
382
|
+
// the list before any item's targets. A change of them its first read makes lands at once (Q35, Q36): no
|
|
383
|
+
// flight from a guess, drawn before the first paint.
|
|
384
|
+
// Its items' sizes as read from the page (#714), by value: what its places read, `itemSize` left out.
|
|
385
|
+
const sizesByValue = new Map<V, ReorderBatchItemSize>()
|
|
386
|
+
const readSoFar: SizesRead = {
|
|
387
|
+
sizeOf: (item) => sizesByValue.get(item as V),
|
|
388
|
+
get arrived() {
|
|
389
|
+
return options.sizes.placed()
|
|
390
|
+
},
|
|
391
|
+
}
|
|
392
|
+
let resolvedValues: ReadonlyArray<V> = env.untrack(options.values)
|
|
393
|
+
let resolved: BatchReorderPlaces = env.untrack(() => resolvePlaces(geometryNow(), resolvedValues, readSoFar))
|
|
300
394
|
/** An item's place now, at index `i`. */
|
|
301
395
|
const placeAt = (i: number): XY => placeOf(resolved, i)
|
|
302
396
|
const startOf = startsAtPlace<V>(placeAt)
|
|
@@ -311,7 +405,12 @@ export const bindBatchReorder = <V>(env: BatchEnv, options: BatchReorderOptions<
|
|
|
311
405
|
const config = {
|
|
312
406
|
each: () => {
|
|
313
407
|
const values = options.values()
|
|
314
|
-
|
|
408
|
+
const geometry = geometryNow()
|
|
409
|
+
// A function `itemSize` is called here for every item, tracked: what it reads places them again (#714, Q8).
|
|
410
|
+
// Sizes read from the page place them again at each delivery.
|
|
411
|
+
if (readsSizes(geometry)) options.sizes.version()
|
|
412
|
+
resolved = resolvePlaces(geometry, values, readSoFar)
|
|
413
|
+
resolvedValues = values
|
|
315
414
|
return values
|
|
316
415
|
},
|
|
317
416
|
key: (item: V) => item,
|
|
@@ -537,10 +636,14 @@ export const bindBatchReorder = <V>(env: BatchEnv, options: BatchReorderOptions<
|
|
|
537
636
|
if (index < 0) return Option.none()
|
|
538
637
|
if (index === boxIndex && resolved === boxPlaces) return box
|
|
539
638
|
const place = placeAt(index)
|
|
540
|
-
const
|
|
639
|
+
const width = widthAt(resolved, index)
|
|
640
|
+
// Every box from the static position of an item with no width: the content box's start, its left edge, or,
|
|
641
|
+
// right to left, its right edge, where each item's right edge sits, however wide it is (#714).
|
|
642
|
+
let start = place.x
|
|
643
|
+
if (resolved.signX < 0) start = place.x - width
|
|
541
644
|
boxIndex = index
|
|
542
645
|
boxPlaces = resolved
|
|
543
|
-
box = Option.some({ x: { min:
|
|
646
|
+
box = Option.some({ x: { min: start, max: start + width }, y: { min: place.y, max: place.y + heightAt(resolved, index) } })
|
|
544
647
|
return box
|
|
545
648
|
}
|
|
546
649
|
return {
|
|
@@ -551,16 +654,16 @@ export const bindBatchReorder = <V>(env: BatchEnv, options: BatchReorderOptions<
|
|
|
551
654
|
setLifted: (lifted) => {
|
|
552
655
|
if (lifted) raise(i, IN_HAND_Z)
|
|
553
656
|
},
|
|
554
|
-
// Called for a reveal, once the group is attached and the item placed:
|
|
555
|
-
// (its untransformed offset in its group, padding and direction counted), its place.
|
|
657
|
+
// Called for a reveal, once the group is attached and the item placed: its element's box at its static
|
|
658
|
+
// position (its untransformed offset in its group, padding and direction counted), moved to its place.
|
|
556
659
|
placeOnScreen: () => {
|
|
557
660
|
const group = UndefinedOr.getOrThrow(groupEl)
|
|
558
661
|
const item = batch.elementOf(i) as HTMLElement
|
|
559
662
|
const at = group.getBoundingClientRect()
|
|
560
|
-
const
|
|
561
|
-
const left = at.left + group.clientLeft + item.offsetLeft
|
|
562
|
-
const top = at.top + group.clientTop + item.offsetTop
|
|
563
|
-
return { left
|
|
663
|
+
const place = placeAt(host.indexOf(i))
|
|
664
|
+
const left = at.left + group.clientLeft + item.offsetLeft + place.x
|
|
665
|
+
const top = at.top + group.clientTop + item.offsetTop + place.y
|
|
666
|
+
return { left, top, right: left + item.offsetWidth, bottom: top + item.offsetHeight }
|
|
564
667
|
},
|
|
565
668
|
}
|
|
566
669
|
}
|
|
@@ -570,12 +673,13 @@ export const bindBatchReorder = <V>(env: BatchEnv, options: BatchReorderOptions<
|
|
|
570
673
|
// The direction its element inherits, read the first time (Q35: as it mounts); its observer of its size;
|
|
571
674
|
// and whether it's gone: a read a frame callback still had waiting does nothing then.
|
|
572
675
|
let inherited: BatchReorderDirection | undefined
|
|
573
|
-
let resizes: ResizeObserver
|
|
676
|
+
let resizes: ReadonlyArray<ResizeObserver> = []
|
|
574
677
|
let gone = false
|
|
575
678
|
/**
|
|
576
679
|
* What it reads of its element, told its binding: the direction its parent gives it (not its own, which
|
|
577
|
-
* its `direction` sets), the first time;
|
|
578
|
-
*
|
|
680
|
+
* its `direction` sets), the first time; for a grid whose rows break at it, its content width; and its edges
|
|
681
|
+
* and padding, what its own size and a column's items' width go by (#714). The first time, its items go to
|
|
682
|
+
* the places that gives at once when those aren't where they are.
|
|
579
683
|
*/
|
|
580
684
|
const readElement = (el: Element): void => {
|
|
581
685
|
if (gone) return
|
|
@@ -583,26 +687,184 @@ export const bindBatchReorder = <V>(env: BatchEnv, options: BatchReorderOptions<
|
|
|
583
687
|
const first = Predicate.isUndefined(inherited)
|
|
584
688
|
const direction = UndefinedOr.match(inherited, { onUndefined: () => directionAbove(el), onDefined: identity })
|
|
585
689
|
inherited = direction
|
|
586
|
-
const seen: BatchReorderRead = { direction, width: Bool.match(isFromWidth(env.untrack(geometryNow)), { onTrue: () => contentWidthOf(el), onFalse: () => undefined }) }
|
|
587
|
-
if (first) atOnce = Bool.not(samePlaces(resolved,
|
|
690
|
+
const seen: BatchReorderRead = { direction, width: Bool.match(isFromWidth(env.untrack(geometryNow)), { onTrue: () => contentWidthOf(el), onFalse: () => undefined }), ...edgesAndPaddingOf(el) }
|
|
691
|
+
if (first) atOnce = Bool.not(samePlaces(resolved, env.untrack(() => resolvePlaces(options.geometryOf(seen), options.values(), readSoFar))))
|
|
588
692
|
options.onRead(seen)
|
|
589
693
|
}
|
|
590
694
|
/**
|
|
591
|
-
* Its element read again as it's resized: a grid's columns from its width (Q36)
|
|
695
|
+
* Its element read again as it's resized: a grid's columns or rows from its width (Q36; #714), its edges and
|
|
696
|
+
* padding. Its content box and its border box are each observed: a padding that changes moves one or the
|
|
697
|
+
* other, as it's `content-box` or `border-box` and its width its own or not. Read once, the frame after: a new
|
|
592
698
|
* column count changes the group's height, which inside the observer's own delivery is a notification it
|
|
593
699
|
* can't deliver (the page's "ResizeObserver loop" error).
|
|
594
700
|
*/
|
|
595
701
|
const observeSize = (el: Element): void => {
|
|
596
|
-
|
|
702
|
+
Arr.forEach(resizes, (observer) => observer.disconnect())
|
|
597
703
|
// The Environment's frames (ADR-0031), called detached as the flush gate's are: the web's is
|
|
598
704
|
// `requestAnimationFrame` itself, which won't run with another object as its `this`.
|
|
599
705
|
const { requestFrame } = runtime.runSync(RefreshFrameSource.RefreshFrameSource)
|
|
600
|
-
|
|
601
|
-
|
|
706
|
+
let readPending = false
|
|
707
|
+
const readNextFrame = (): void => {
|
|
708
|
+
if (readPending) return
|
|
709
|
+
readPending = true
|
|
710
|
+
requestFrame(() => {
|
|
711
|
+
readPending = false
|
|
712
|
+
readElement(el)
|
|
713
|
+
})
|
|
714
|
+
}
|
|
715
|
+
resizes = Arr.map(GROUP_BOXES, (box) => {
|
|
716
|
+
const observer = new ResizeObserver(readNextFrame)
|
|
717
|
+
observer.observe(el, { box })
|
|
718
|
+
return observer
|
|
719
|
+
})
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
// --- Its items' own sizes (#714) -------------------------------------------------------------
|
|
723
|
+
|
|
724
|
+
// The size last written on each item's element, given by a function; and the last change's sizing.
|
|
725
|
+
let written = new WeakMap<Element, WrittenSize>()
|
|
726
|
+
let givenSizes = writesSizes(resolved)
|
|
727
|
+
let readingSizes = resolved.sizesRead
|
|
728
|
+
/** Every listed item's element, where it has one. */
|
|
729
|
+
const eachElement = (f: (el: HTMLElement, value: V, i: number) => void): void => {
|
|
730
|
+
// Per item at a change: statements.
|
|
731
|
+
Arr.forEach(resolvedValues, (value, i) => {
|
|
732
|
+
const el = batch.elementOf(batch.memberFor(value, undefined))
|
|
733
|
+
if (isHTMLElement(el)) f(el, value, i)
|
|
734
|
+
})
|
|
735
|
+
}
|
|
736
|
+
/** Every listed item's own size written on its element where it isn't already: its items each their own size. */
|
|
737
|
+
const writeEachSize = (): void => {
|
|
738
|
+
if (gone) return
|
|
739
|
+
eachElement((el, _, i) => writeSizeOn(el, resolved, i, written))
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Its items' sizes at a change: each one's own written, a function's; or each one's observed, read from the
|
|
743
|
+
* page. Switched to a function's, after the change's style writes: the group's style for every item drops
|
|
744
|
+
* the one size it had, which, written after these, would take theirs. Switched from one, an item whose width
|
|
745
|
+
* was the group's gets its own sizing back where its style gives no width; and to sizes read from the page,
|
|
746
|
+
* each item's written size goes, after the change's style writes, where it's still the one written.
|
|
747
|
+
*/
|
|
748
|
+
const changeSizes = (): void => {
|
|
749
|
+
const nowGiven = writesSizes(resolved)
|
|
750
|
+
const nowReading = resolved.sizesRead
|
|
751
|
+
const fromGiven = Bool.and(givenSizes, Bool.not(nowGiven))
|
|
752
|
+
const toGiven = Bool.and(Bool.not(givenSizes), nowGiven)
|
|
753
|
+
const was = written
|
|
754
|
+
if (Bool.or(fromGiven, toGiven)) written = new WeakMap()
|
|
755
|
+
if (Bool.and(fromGiven, Bool.not(Bool.or(nowReading, resolved.takesWidth)))) eachElement((el) => releaseGroupWidth(el, was.get(el)))
|
|
756
|
+
if (Bool.and(fromGiven, nowReading)) queueMicrotask(() => eachElement((el) => unwriteSizeOn(el, was.get(el))))
|
|
757
|
+
if (nowReading !== readingSizes) Bool.match(nowReading, { onTrue: () => eachElement(observe), onFalse: stopReading })
|
|
758
|
+
givenSizes = nowGiven
|
|
759
|
+
readingSizes = nowReading
|
|
760
|
+
if (Bool.not(nowGiven)) return
|
|
761
|
+
if (toGiven) {
|
|
762
|
+
queueMicrotask(writeEachSize)
|
|
763
|
+
return
|
|
764
|
+
}
|
|
765
|
+
writeEachSize()
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// Its items' sizes as read (decisions 3 to 5): one observer over every item, made at the first; each
|
|
769
|
+
// observed element's value; and whether the group's own size waits for the Frame loop's next tick.
|
|
770
|
+
let sizes: ResizeObserver | undefined
|
|
771
|
+
const observedValue = new WeakMap<Element, V>()
|
|
772
|
+
let resizePending = false
|
|
773
|
+
/**
|
|
774
|
+
* New sizes, in the observer's delivery: placed now, before the page paints, by their transforms alone. The
|
|
775
|
+
* first takes the items out of flow, at once, where flow had them: no flight from a guess, and the group
|
|
776
|
+
* sized as flow sized it. A later one moves the items after a changed one on the group's transition, and the
|
|
777
|
+
* group's own size waits for the Frame loop's next tick: a size change in the delivery of an element its
|
|
778
|
+
* items are inside is one the browser can't deliver to its observers (the page's "ResizeObserver loop" error).
|
|
779
|
+
*/
|
|
780
|
+
const onSizes = (entries: ReadonlyArray<ResizeObserverEntry>): void => {
|
|
781
|
+
if (Bool.or(gone, Bool.not(resolved.sizesRead))) return
|
|
782
|
+
let changed = false
|
|
783
|
+
// Per item at a delivery: statements. Its layout size, its border box: the Batch's transforms change none.
|
|
784
|
+
// None at all is an item under a hidden ancestor (a tab, a closed `<details>`): its last size is kept, so
|
|
785
|
+
// shown again it's where it was, and hidden from the start, its group stays in flow.
|
|
786
|
+
Arr.forEach(entries, (entry) => {
|
|
787
|
+
const value = observedValue.get(entry.target)
|
|
788
|
+
const box = entry.borderBoxSize[0]
|
|
789
|
+
if (Predicate.isUndefined(value) || Predicate.isUndefined(box)) return
|
|
790
|
+
if (box.inlineSize === 0 && box.blockSize === 0) return
|
|
791
|
+
const was = sizesByValue.get(value)
|
|
792
|
+
if (Predicate.isNotUndefined(was) && was.width === box.inlineSize && was.height === box.blockSize) return
|
|
793
|
+
sizesByValue.set(value, { width: box.inlineSize, height: box.blockSize })
|
|
794
|
+
changed = true
|
|
602
795
|
})
|
|
603
|
-
|
|
796
|
+
if (Bool.not(changed)) return
|
|
797
|
+
const first = Bool.not(env.untrack(options.sizes.placed))
|
|
798
|
+
if (first) atOnce = true
|
|
799
|
+
options.sizes.arrived(first)
|
|
800
|
+
if (Bool.not(first)) resizeAtNextTick()
|
|
801
|
+
}
|
|
802
|
+
/** The group's own size, at the Frame loop's next tick (core's `Machine.nextFrame`): once for a frame's deliveries. */
|
|
803
|
+
const resizeAtNextTick = (): void => {
|
|
804
|
+
if (resizePending) return
|
|
805
|
+
resizePending = true
|
|
806
|
+
runtime.runFork(
|
|
807
|
+
Effect.andThen(
|
|
808
|
+
Machine.nextFrame,
|
|
809
|
+
Effect.sync(() => {
|
|
810
|
+
resizePending = false
|
|
811
|
+
if (Bool.not(gone)) options.sizes.resizeGroup()
|
|
812
|
+
}),
|
|
813
|
+
),
|
|
814
|
+
)
|
|
815
|
+
}
|
|
816
|
+
/** `el`, `value`'s element, observed: its size delivered now, and at each change. */
|
|
817
|
+
const observe = (el: Element, value: V): void => {
|
|
818
|
+
// Per element at mount, by the hot path's rules: statements.
|
|
819
|
+
observedValue.set(el, value)
|
|
820
|
+
if (Predicate.isUndefined(sizes)) sizes = new ResizeObserver(onSizes)
|
|
821
|
+
sizes.observe(el)
|
|
822
|
+
}
|
|
823
|
+
/** `el`, `value`'s element, gone: observed no more, its size forgotten. */
|
|
824
|
+
const forget = (el: Element, value: V): void => {
|
|
825
|
+
// Per element as it goes: statements.
|
|
826
|
+
if (observedValue.get(el) !== value) return
|
|
827
|
+
observedValue.delete(el)
|
|
828
|
+
if (Predicate.isNotUndefined(sizes)) sizes.unobserve(el)
|
|
829
|
+
sizesByValue.delete(value)
|
|
830
|
+
}
|
|
831
|
+
/** No sizes read for now: its `itemSize` given. The sizes read so far stay, for a switch back. */
|
|
832
|
+
const stopReading = (): void => {
|
|
833
|
+
UndefinedOr.map(sizes, (observer) => observer.disconnect())
|
|
834
|
+
sizes = undefined
|
|
604
835
|
}
|
|
605
836
|
|
|
837
|
+
/**
|
|
838
|
+
* Member `member`'s `ref`, for `value`: its size read from the page, its element observed; given by a
|
|
839
|
+
* function, written on its element, now when the places have its index, else at the change that lists it.
|
|
840
|
+
*/
|
|
841
|
+
const refOf = (member: number, value: V): ((el: Element) => void) => {
|
|
842
|
+
// Per element at mount, by the hot path's rules: statements.
|
|
843
|
+
const memberRef = batch.refOf(member)
|
|
844
|
+
if (resolved.sizesRead) {
|
|
845
|
+
return (el) => {
|
|
846
|
+
memberRef(el)
|
|
847
|
+
observe(el, value)
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
if (Predicate.isUndefined(resolved.each)) return memberRef
|
|
851
|
+
return (el) => {
|
|
852
|
+
memberRef(el)
|
|
853
|
+
const index = host.indexOf(member)
|
|
854
|
+
if (isHTMLElement(el) && index >= 0 && resolvedValues[index] === value) writeSizeOn(el, resolved, index, written)
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* An item's own style under its group's now, in flow or not: the same for every item, so worked out once, in
|
|
860
|
+
* a memo each item's style reads. What the group reads of its element (its first read, a resize) re-runs that
|
|
861
|
+
* memo, and the items only when it changes: not every item for the same answer (Solid 2's HUGE_FAN_OUT).
|
|
862
|
+
*/
|
|
863
|
+
const itemBase = options.memo((): Readonly<Record<string, string>> => {
|
|
864
|
+
const geometry = geometryNow()
|
|
865
|
+
return itemBaseOf(geometry, itemsInFlow(geometry, options.sizes.placed()))
|
|
866
|
+
}, sameStyle)
|
|
867
|
+
|
|
606
868
|
/** Member `i`'s keyboard lift: its `whileDrag` on, or off at its drop, then let down. */
|
|
607
869
|
const onLift = (i: number, lifted: boolean): void => {
|
|
608
870
|
turnWhileDrag(i, lifted)
|
|
@@ -617,17 +879,26 @@ export const bindBatchReorder = <V>(env: BatchEnv, options: BatchReorderOptions<
|
|
|
617
879
|
// By its items: a store's order is a new array at each read (#721).
|
|
618
880
|
if (Bool.not(UndefinedOr.match(placedValues, { onUndefined: constFalse, onDefined: (placed) => sameOrder(placed, values) }))) controller.valuesChanged()
|
|
619
881
|
placedValues = values
|
|
882
|
+
// Switched to sizes read from the page (#714): into flow, or to the places read so far, at once, as their
|
|
883
|
+
// first delivery takes them out of it: no flight from a guess.
|
|
884
|
+
if (Bool.and(resolved.sizesRead, Bool.not(readingSizes))) atOnce = true
|
|
620
885
|
// The first read of its element's places, drawn now, before the page paints (Q35, Q36, Q37): each item as
|
|
621
886
|
// far off its new place as it was off its guessed one, an entrance from `initial` going on.
|
|
622
887
|
Bool.match(atOnce, { onTrue: () => batch.applyShifted(targets), onFalse: () => batch.apply(targets) })
|
|
623
888
|
atOnce = false
|
|
889
|
+
changeSizes()
|
|
624
890
|
version = version + 1
|
|
625
891
|
controller.placed()
|
|
626
892
|
},
|
|
627
893
|
groupStyle: (own) => {
|
|
628
|
-
const
|
|
894
|
+
const values = options.values()
|
|
629
895
|
const geometry = geometryNow()
|
|
630
|
-
|
|
896
|
+
// Its own resolution, tracked as the Batch's is: a function `itemSize`'s sizes size it (#714).
|
|
897
|
+
if (Bool.not(readsSizes(geometry))) return groupStyleOf(resolvePlaces(geometry, values), values.length, geometry, own)
|
|
898
|
+
// Sizes read from the page: its own size from its own version, never in its items' delivery (`onSizes`).
|
|
899
|
+
options.sizes.placed()
|
|
900
|
+
options.sizes.groupVersion()
|
|
901
|
+
return groupStyleOf(env.untrack(() => resolvePlaces(geometry, values, readSoFar)), values.length, geometry, own)
|
|
631
902
|
},
|
|
632
903
|
attach: (el) => {
|
|
633
904
|
groupEl = el
|
|
@@ -636,15 +907,15 @@ export const bindBatchReorder = <V>(env: BatchEnv, options: BatchReorderOptions<
|
|
|
636
907
|
// Once it's on the page: the direction it inherits and its width, before the first paint.
|
|
637
908
|
queueMicrotask(() => readElement(el))
|
|
638
909
|
},
|
|
639
|
-
itemStyle: () => batch.styleOf(
|
|
910
|
+
itemStyle: () => batch.styleOf(itemBase()),
|
|
640
911
|
item: (value, presence) => {
|
|
641
912
|
const member = batch.memberFor(value, presence)
|
|
642
913
|
const driver = controller.item(value, () => Option.fromUndefinedOr(batch.elementOf(member)), (lifted) => onLift(member, lifted))
|
|
643
914
|
drivers.set(value, driver)
|
|
644
915
|
const unregister = driver.register(handleOf(member))
|
|
645
916
|
return {
|
|
646
|
-
ref:
|
|
647
|
-
style: (own) => batch.styleOf(Style.over(own,
|
|
917
|
+
ref: refOf(member, value),
|
|
918
|
+
style: (own) => batch.styleOf(Style.over(own, itemBase())),
|
|
648
919
|
dispose: () => {
|
|
649
920
|
// Under `<AnimatePresence>` its element stays while it exits (Q38), at its last place: let go if it was
|
|
650
921
|
// in hand, `whileDrag` off, let down, and neither focused nor pressed meanwhile.
|
|
@@ -653,6 +924,7 @@ export const bindBatchReorder = <V>(env: BatchEnv, options: BatchReorderOptions<
|
|
|
653
924
|
raise(member, undefined)
|
|
654
925
|
UndefinedOr.map(batch.elementOf(member), (el) => {
|
|
655
926
|
if (isHTMLElement(el)) el.inert = true
|
|
927
|
+
forget(el, value)
|
|
656
928
|
})
|
|
657
929
|
driver.dispose()
|
|
658
930
|
unregister()
|
|
@@ -667,7 +939,8 @@ export const bindBatchReorder = <V>(env: BatchEnv, options: BatchReorderOptions<
|
|
|
667
939
|
pressable,
|
|
668
940
|
dispose: () => {
|
|
669
941
|
gone = true
|
|
670
|
-
|
|
942
|
+
Arr.forEach(resizes, (observer) => observer.disconnect())
|
|
943
|
+
UndefinedOr.map(sizes, (observer) => observer.disconnect())
|
|
671
944
|
gestures.close()
|
|
672
945
|
OwnerScope.close(runtime, scope, CLOSE_FAILED)
|
|
673
946
|
batch.dispose()
|
|
@@ -701,9 +974,9 @@ const noop = (): void => {}
|
|
|
701
974
|
export const serverBatchReorder = <V>(options: ServerBatchReorderOptions<V>, untrack: <A>(read: () => A) => A): ServerBatchReorder<V> => {
|
|
702
975
|
const geometry = untrack(options.geometry)
|
|
703
976
|
const values = untrack(options.values)
|
|
704
|
-
const places = resolvePlaces(geometry, values
|
|
705
|
-
// In flow (Q37),
|
|
706
|
-
const inFlow =
|
|
977
|
+
const places = resolvePlaces(geometry, values)
|
|
978
|
+
// In flow (Q37; #714, decision 4), CSS places each item: drawn at no place, and `initial`'s `x` and `y` left out.
|
|
979
|
+
const inFlow = places.inFlow
|
|
707
980
|
const placeAt = (i: number): XY => Bool.match(inFlow, { onTrue: () => AT_NO_PLACE, onFalse: () => placeOf(places, i) })
|
|
708
981
|
const startOf = startsAtPlace<V>(placeAt)
|
|
709
982
|
const targetsOf = targetsAtPlace<V>(placeAt, () => values[0])
|
|
@@ -728,13 +1001,33 @@ export const serverBatchReorder = <V>(options: ServerBatchReorderOptions<V>, unt
|
|
|
728
1001
|
if (Predicate.isUndefined(handles)) handles = serverKeyedHandlesOf<Style.Style>(config as KeyedBatchConfig<unknown>, () => presence, options.server)
|
|
729
1002
|
return handles
|
|
730
1003
|
}
|
|
731
|
-
const base = itemBaseOf(geometry)
|
|
1004
|
+
const base = itemBaseOf(geometry, inFlow)
|
|
1005
|
+
// Each item's index, for its own size (#714): built at the first item that needs it.
|
|
1006
|
+
let indexOfValue: Map<V, number> | undefined
|
|
1007
|
+
const indexOf = (value: V): number => {
|
|
1008
|
+
if (Predicate.isUndefined(indexOfValue)) {
|
|
1009
|
+
const made = new Map<V, number>()
|
|
1010
|
+
Arr.forEach(values, (v, i) => made.set(v, i))
|
|
1011
|
+
indexOfValue = made
|
|
1012
|
+
}
|
|
1013
|
+
return UndefinedOr.getOrThrow(indexOfValue.get(value))
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* An item's style: its own over its group's, and, its items each their own size (#714), that size over both,
|
|
1017
|
+
* as the client writes it on its element: the size places it.
|
|
1018
|
+
*/
|
|
1019
|
+
const placedOf = (own: Style.Input, value: V): Style.Style => {
|
|
1020
|
+
// Per element at mount, by the hot path's rules: statements.
|
|
1021
|
+
const placed = Style.over(own, base)
|
|
1022
|
+
if (Predicate.isUndefined(places.each)) return placed
|
|
1023
|
+
return Style.over(sizeStyleOf(places, indexOf(value)), placed)
|
|
1024
|
+
}
|
|
732
1025
|
return {
|
|
733
1026
|
groupStyle: (own) => groupStyleOf(places, values.length, geometry, own),
|
|
734
1027
|
item: (value, presence) => ({
|
|
735
1028
|
ref: noop,
|
|
736
1029
|
style: (own) => {
|
|
737
|
-
const placed =
|
|
1030
|
+
const placed = placedOf(own, value)
|
|
738
1031
|
// Its start over its own and its group's: what the handle draws, the base when it draws none.
|
|
739
1032
|
return UndefinedOr.match(handlesFor(presence)(value, { style: placed }).style, { onUndefined: () => placed, onDefined: identity })
|
|
740
1033
|
},
|
package/src/batch.ts
CHANGED
|
@@ -504,7 +504,7 @@ export interface ElementPart<T> {
|
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
/** Whether `value` is a Batch's key's first stop through an element: a number, or `null` for where it is. */
|
|
507
|
-
const isFirstStop: Predicate.Predicate<unknown> = Predicate.or(Predicate.isNumber, Predicate.isNull)
|
|
507
|
+
const isFirstStop: Predicate.Predicate<unknown> = /*#__PURE__*/ Predicate.or(Predicate.isNumber, Predicate.isNull)
|
|
508
508
|
|
|
509
509
|
/** Whether `value` is a Batch's key's two stops through an element: a first stop, and a number. */
|
|
510
510
|
const isElementStops = (value: unknown): value is readonly [number | null, number] => {
|
|
@@ -563,7 +563,7 @@ export const isMemberElement = (element: Element): boolean => MEMBER_ELEMENTS.ha
|
|
|
563
563
|
export const memberEntryOf = (element: Element): BatchMemberEntry | undefined => MEMBER_ELEMENTS.get(element)
|
|
564
564
|
|
|
565
565
|
/** Whether a sequence's subject is a Batch member's entry. */
|
|
566
|
-
export const isMemberEntry: Predicate.Refinement<unknown, BatchMemberEntry> = Predicate.and(Predicate.hasProperty("binding"), Predicate.hasProperty("member")) as Predicate.Refinement<unknown, BatchMemberEntry>
|
|
566
|
+
export const isMemberEntry: Predicate.Refinement<unknown, BatchMemberEntry> = /*#__PURE__*/ Predicate.and(/*#__PURE__*/ Predicate.hasProperty("binding"), /*#__PURE__*/ Predicate.hasProperty("member")) as Predicate.Refinement<unknown, BatchMemberEntry>
|
|
567
567
|
|
|
568
568
|
// --- A sequence's Segments of Batches (#665, Q36–Q40) ---------------------------------------------
|
|
569
569
|
|
|
@@ -703,7 +703,7 @@ const keysOf = (config: BatchConfig): ReadonlyArray<string> =>
|
|
|
703
703
|
const INSTANT: Batch.Transition = { type: "tween", duration: 0 }
|
|
704
704
|
|
|
705
705
|
/** A key's index, -1 for a key the Batch hasn't. Built once. */
|
|
706
|
-
const keyIndexOr: (k: number | undefined) => number = UndefinedOr.match({ onUndefined: (): number => -1, onDefined: (k: number): number => k })
|
|
706
|
+
const keyIndexOr: (k: number | undefined) => number = /*#__PURE__*/ UndefinedOr.match({ onUndefined: (): number => -1, onDefined: (k: number): number => k })
|
|
707
707
|
|
|
708
708
|
/** A Batch Reorder group's item in hand's change (#712): its `x` and `y` where it's held, at once. */
|
|
709
709
|
const IN_HAND: Batch.RetargetOptions = { transition: { x: INSTANT, y: INSTANT } }
|
|
@@ -1912,7 +1912,7 @@ export const bindBatch = (env: BatchEnv, config: BatchConfig | KeyedBatchConfig<
|
|
|
1912
1912
|
const i = memberOf[slot]
|
|
1913
1913
|
const presence = presenceOf[i]
|
|
1914
1914
|
const el = elementOf[i]
|
|
1915
|
-
if (Predicate.isUndefined(presence) ||
|
|
1915
|
+
if (Predicate.isUndefined(presence) || Predicate.isUndefined(el)) return false
|
|
1916
1916
|
unhold(i)
|
|
1917
1917
|
const entry = entries[i]
|
|
1918
1918
|
const cancel = presenceHold(presence, el, () => {
|