@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
|
@@ -4,17 +4,18 @@ import * as Arr from "effect/Array";
|
|
|
4
4
|
import * as Bool from "effect/Boolean";
|
|
5
5
|
import * as Equivalence from "effect/Equivalence";
|
|
6
6
|
import { identity } from "effect/Function";
|
|
7
|
+
import * as Iter from "effect/Iterable";
|
|
7
8
|
import * as Match from "effect/Match";
|
|
8
9
|
import * as Predicate from "effect/Predicate";
|
|
9
10
|
import * as Rec from "effect/Record";
|
|
10
11
|
import * as UndefinedOr from "effect/UndefinedOr";
|
|
11
12
|
import { fail } from "./batch.js";
|
|
12
|
-
/** Whether two reads of a group's element are alike: the same direction and
|
|
13
|
+
/** Whether two reads of a group's element are alike: the same direction, width, edges and padding. */
|
|
13
14
|
export const sameRead = (a, b) => UndefinedOr.match(a, {
|
|
14
15
|
onUndefined: () => Predicate.isUndefined(b),
|
|
15
16
|
onDefined: x => UndefinedOr.match(b, {
|
|
16
17
|
onUndefined: () => false,
|
|
17
|
-
onDefined: y => Bool.
|
|
18
|
+
onDefined: y => Bool.every([x.direction === y.direction, x.width === y.width, x.edges.x === y.edges.x, x.edges.y === y.edges.y, x.padding === y.padding])
|
|
18
19
|
})
|
|
19
20
|
});
|
|
20
21
|
/** A style's own `direction`, when it gives one: an app's on the group. */
|
|
@@ -52,8 +53,26 @@ export const geometryOf = (props, read) => ({
|
|
|
52
53
|
width: UndefinedOr.match(read, {
|
|
53
54
|
onUndefined: () => undefined,
|
|
54
55
|
onDefined: r => r.width
|
|
56
|
+
}),
|
|
57
|
+
edges: UndefinedOr.match(read, {
|
|
58
|
+
onUndefined: () => NO_EDGES,
|
|
59
|
+
onDefined: r => r.edges
|
|
60
|
+
}),
|
|
61
|
+
padding: UndefinedOr.match(read, {
|
|
62
|
+
onUndefined: () => undefined,
|
|
63
|
+
onDefined: r => r.padding
|
|
55
64
|
})
|
|
56
65
|
});
|
|
66
|
+
/** No edges: a `content-box` group's, and a group's before its first read. */
|
|
67
|
+
const NO_EDGES = {
|
|
68
|
+
x: 0,
|
|
69
|
+
y: 0
|
|
70
|
+
};
|
|
71
|
+
/** No sizes read: a server's, and a client's before its first. */
|
|
72
|
+
export const NONE_READ = {
|
|
73
|
+
sizeOf: () => undefined,
|
|
74
|
+
arrived: false
|
|
75
|
+
};
|
|
57
76
|
const ORIGIN = {
|
|
58
77
|
x: 0,
|
|
59
78
|
y: 0
|
|
@@ -67,6 +86,16 @@ const gapsOf = Match.type().pipe(Match.when(Predicate.isNumber, gap => ({
|
|
|
67
86
|
x: gap,
|
|
68
87
|
y: gap
|
|
69
88
|
})), Match.orElse(gap => gap));
|
|
89
|
+
/** A geometry's gap on each axis: none when it gives none. */
|
|
90
|
+
const gapOf = geometry => UndefinedOr.match(geometry.gap, {
|
|
91
|
+
onUndefined: () => ORIGIN,
|
|
92
|
+
onDefined: gapsOf
|
|
93
|
+
});
|
|
94
|
+
/** The content width a group read of its element: 0 before it's read (a server's, a client's before its first read). */
|
|
95
|
+
const readWidthOf = geometry => UndefinedOr.match(geometry.width, {
|
|
96
|
+
onUndefined: () => 0,
|
|
97
|
+
onDefined: identity
|
|
98
|
+
});
|
|
70
99
|
/** Whether a grid's `columns` is a whole number, 1 or more. */
|
|
71
100
|
const isColumnCount = columns => Bool.and(Number.isInteger(columns), columns >= 1);
|
|
72
101
|
/** A grid's given `columns`, checked. */
|
|
@@ -84,119 +113,557 @@ const columnsBy = Match.type().pipe(Match.when("y", () => () => 1), Match.when("
|
|
|
84
113
|
onUndefined: () => columnsFitting(geometry.width, step, gap),
|
|
85
114
|
onDefined: checkedColumns
|
|
86
115
|
})));
|
|
87
|
-
/** A grid whose
|
|
116
|
+
/** A grid whose rows break at its width: `"xy"` with no `columns`, its items one size (Q36) or each their own (#714). */
|
|
88
117
|
export const isFromWidth = geometry => Bool.and(geometry.axis === "xy", Predicate.isUndefined(geometry.columns));
|
|
89
|
-
/** Whether a group's items are laid out in flow by CSS
|
|
118
|
+
/** Whether a group's items are laid out in flow by CSS: its rows from a width it hasn't read. */
|
|
90
119
|
export const inGridFlow = geometry => Bool.and(isFromWidth(geometry), Predicate.isUndefined(geometry.width));
|
|
120
|
+
/** Whether a group reads its items' sizes from the page: its `itemSize` left out (#714). */
|
|
121
|
+
export const readsSizes = geometry => Predicate.isUndefined(geometry.itemSize);
|
|
122
|
+
/**
|
|
123
|
+
* Whether a group's items are in flow, its first sizes `arrived` or not: a grid's width unread, or its items'
|
|
124
|
+
* sizes, read from the page (#714).
|
|
125
|
+
*/
|
|
126
|
+
export const itemsInFlow = (geometry, arrived) => {
|
|
127
|
+
// Per element at mount, by the hot path's rules: statements.
|
|
128
|
+
if (inGridFlow(geometry)) return true;
|
|
129
|
+
return readsSizes(geometry) && !arrived;
|
|
130
|
+
};
|
|
131
|
+
/** Whether `places` are of items each their own size given by a function (#714): those written on their elements. */
|
|
132
|
+
export const writesSizes = places => Bool.and(Predicate.isNotUndefined(places.each), Bool.not(places.sizesRead));
|
|
91
133
|
/** Each direction's way along a row: rightward, or leftward from the right edge. */
|
|
92
134
|
const SIGN_X = {
|
|
93
135
|
ltr: 1,
|
|
94
136
|
rtl: -1
|
|
95
137
|
};
|
|
96
|
-
/**
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
138
|
+
/**
|
|
139
|
+
* `geometry`'s places for `values`: every item one size, each its own, a function's, or each its own as
|
|
140
|
+
* `read` from the page (#714). An error names a grid's `columns` that isn't a whole number.
|
|
141
|
+
*/
|
|
142
|
+
export const resolvePlaces = (geometry, values, read = NONE_READ) => {
|
|
143
|
+
const itemSize = geometry.itemSize;
|
|
144
|
+
if (Predicate.isUndefined(itemSize)) return resolveRead(geometry, values, read);
|
|
145
|
+
if (Predicate.isFunction(itemSize)) return resolveEach(geometry, values, itemSize);
|
|
146
|
+
return resolveOne(geometry, values.length, itemSize);
|
|
147
|
+
};
|
|
148
|
+
/** Places for `n` items of one size, a column's width the group's when it gives none (#714, Q10): never read, 0 here. */
|
|
149
|
+
const resolveOne = (geometry, n, size) => {
|
|
150
|
+
const gap = gapOf(geometry);
|
|
151
|
+
const inFlow = inGridFlow(geometry);
|
|
152
|
+
const takesWidth = Predicate.isUndefined(size.width);
|
|
153
|
+
const itemSize = {
|
|
154
|
+
width: UndefinedOr.match(size.width, {
|
|
155
|
+
onUndefined: () => readWidthOf(geometry),
|
|
156
|
+
onDefined: identity
|
|
157
|
+
}),
|
|
158
|
+
height: size.height
|
|
159
|
+
};
|
|
160
|
+
const stepX = itemSize.width + gap.x;
|
|
103
161
|
const columns = columnsBy(geometry.axis)(geometry, n, stepX, gap.x);
|
|
104
|
-
const
|
|
162
|
+
const appsWidth = Bool.or(isFromWidth(geometry), takesWidth);
|
|
105
163
|
const used = Math.min(columns, Math.max(n, 1));
|
|
106
164
|
const placesWidth = Bool.match(n === 0, {
|
|
107
165
|
onTrue: () => 0,
|
|
108
|
-
onFalse: () => (used - 1) * stepX +
|
|
166
|
+
onFalse: () => (used - 1) * stepX + itemSize.width
|
|
109
167
|
});
|
|
110
168
|
return {
|
|
111
169
|
columns,
|
|
112
170
|
stepX,
|
|
113
|
-
stepY:
|
|
171
|
+
stepY: itemSize.height + gap.y,
|
|
114
172
|
signX: SIGN_X[geometry.direction],
|
|
115
|
-
itemSize
|
|
116
|
-
width: Bool.match(
|
|
173
|
+
itemSize,
|
|
174
|
+
width: Bool.match(appsWidth, {
|
|
117
175
|
onTrue: () => UndefinedOr.match(geometry.width, {
|
|
118
176
|
onUndefined: () => placesWidth,
|
|
119
177
|
onDefined: identity
|
|
120
178
|
}),
|
|
121
179
|
onFalse: () => placesWidth
|
|
122
180
|
}),
|
|
123
|
-
|
|
181
|
+
appsWidth,
|
|
182
|
+
takesWidth,
|
|
183
|
+
each: undefined,
|
|
184
|
+
sizesRead: false,
|
|
185
|
+
inFlow,
|
|
186
|
+
groupWidth: groupWidthOf(geometry, inFlow)
|
|
124
187
|
};
|
|
125
188
|
};
|
|
126
|
-
/**
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
189
|
+
/** Places for `values`, each its own size, `sizeOf`'s (#714): laid out by the group's axis. */
|
|
190
|
+
const resolveEach = (geometry, values, sizeOf) => {
|
|
191
|
+
const inFlow = inGridFlow(geometry);
|
|
192
|
+
const widths = new Float64Array(values.length);
|
|
193
|
+
const heights = new Float64Array(values.length);
|
|
194
|
+
let takesWidth = false;
|
|
195
|
+
// Per item at a change: statements.
|
|
196
|
+
Arr.forEach(values, (item, i) => {
|
|
197
|
+
const size = sizeOf(item, i);
|
|
198
|
+
heights[i] = size.height;
|
|
199
|
+
if (Predicate.isNotUndefined(size.width)) {
|
|
200
|
+
widths[i] = size.width;
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
widths[i] = Number.NaN;
|
|
204
|
+
takesWidth = true;
|
|
205
|
+
});
|
|
206
|
+
const each = layoutBy(geometry.axis)(widths, heights, gapOf(geometry), geometry.width);
|
|
207
|
+
const appsWidth = Bool.or(isFromWidth(geometry), takesWidth);
|
|
208
|
+
return {
|
|
209
|
+
columns: 1,
|
|
210
|
+
stepX: 0,
|
|
211
|
+
stepY: 0,
|
|
212
|
+
signX: SIGN_X[geometry.direction],
|
|
213
|
+
itemSize: NO_SIZE,
|
|
214
|
+
width: Bool.match(appsWidth, {
|
|
215
|
+
onTrue: () => readWidthOf(geometry),
|
|
216
|
+
onFalse: () => each.width
|
|
217
|
+
}),
|
|
218
|
+
appsWidth,
|
|
219
|
+
takesWidth,
|
|
220
|
+
each,
|
|
221
|
+
sizesRead: false,
|
|
222
|
+
inFlow,
|
|
223
|
+
groupWidth: groupWidthOf(geometry, inFlow)
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
/** A size not read yet: none, its place from the sizes before it. A column's, its width the group's. */
|
|
227
|
+
const UNREAD = {
|
|
228
|
+
width: 0,
|
|
229
|
+
height: 0
|
|
230
|
+
};
|
|
231
|
+
const UNREAD_IN_COLUMN = {
|
|
232
|
+
width: undefined,
|
|
233
|
+
height: 0
|
|
234
|
+
};
|
|
235
|
+
/** Each item's size as read, a column's height alone: its width is the group's (Q6). */
|
|
236
|
+
const readInColumn = read => item => {
|
|
237
|
+
// Per item at a change: statements.
|
|
238
|
+
const size = read.sizeOf(item);
|
|
239
|
+
if (Predicate.isUndefined(size)) return UNREAD_IN_COLUMN;
|
|
240
|
+
return {
|
|
241
|
+
width: undefined,
|
|
242
|
+
height: size.height
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
/** Each item's size as read: its width and height its own (Q6). */
|
|
246
|
+
const readOwn = read => item => {
|
|
247
|
+
// Per item at a change: statements.
|
|
248
|
+
const size = read.sizeOf(item);
|
|
249
|
+
if (Predicate.isUndefined(size)) return UNREAD;
|
|
250
|
+
return size;
|
|
251
|
+
};
|
|
252
|
+
/** Each axis's reading of an item's size. Built once, at module load. */
|
|
253
|
+
const readBy = Match.type().pipe(Match.when("y", () => readInColumn), Match.orElse(() => readOwn));
|
|
254
|
+
/**
|
|
255
|
+
* Places for `values`, each its own size as `read` from the page (#714): laid out as a function's sizes are.
|
|
256
|
+
* In flow, before its first sizes or a grid's width, every item at no place, where CSS has it.
|
|
257
|
+
*/
|
|
258
|
+
const resolveRead = (geometry, values, read) => {
|
|
259
|
+
const places = resolveEach(geometry, values, readBy(geometry.axis)(read));
|
|
260
|
+
const inFlow = itemsInFlow(geometry, read.arrived);
|
|
261
|
+
// A column's items take its width, whether it has any or not (Q6).
|
|
262
|
+
const takesWidth = geometry.axis === "y";
|
|
263
|
+
const appsWidth = Bool.or(isFromWidth(geometry), takesWidth);
|
|
264
|
+
const each = UndefinedOr.getOrThrow(places.each);
|
|
265
|
+
return {
|
|
266
|
+
...places,
|
|
267
|
+
sizesRead: true,
|
|
268
|
+
inFlow,
|
|
269
|
+
groupWidth: groupWidthOf(geometry, inFlow),
|
|
270
|
+
takesWidth,
|
|
271
|
+
appsWidth,
|
|
272
|
+
width: Bool.match(appsWidth, {
|
|
273
|
+
onTrue: () => readWidthOf(geometry),
|
|
274
|
+
onFalse: () => each.width
|
|
275
|
+
}),
|
|
276
|
+
each: Bool.match(inFlow, {
|
|
277
|
+
onTrue: () => atNoPlace(each),
|
|
278
|
+
onFalse: () => each
|
|
279
|
+
})
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
/** `each` with every item at no place: in flow, where CSS has it; the group's size its flow's. */
|
|
283
|
+
const atNoPlace = each => ({
|
|
284
|
+
...each,
|
|
285
|
+
xs: new Float64Array(each.xs.length),
|
|
286
|
+
ys: new Float64Array(each.ys.length),
|
|
287
|
+
width: 0,
|
|
288
|
+
height: 0
|
|
132
289
|
});
|
|
290
|
+
/** A column: each item below the one before, a gap apart; as wide as the widest, those that take the group's width aside. */
|
|
291
|
+
const columnLayout = (widths, heights, gap) => {
|
|
292
|
+
const ys = new Float64Array(heights.length);
|
|
293
|
+
let y = 0;
|
|
294
|
+
let width = 0;
|
|
295
|
+
// Per item at a change: statements.
|
|
296
|
+
Iter.forEach(heights, (height, i) => {
|
|
297
|
+
ys[i] = y;
|
|
298
|
+
y = y + height + gap.y;
|
|
299
|
+
if (widths[i] > width) width = widths[i];
|
|
300
|
+
});
|
|
301
|
+
return {
|
|
302
|
+
xs: new Float64Array(heights.length),
|
|
303
|
+
ys,
|
|
304
|
+
widths,
|
|
305
|
+
heights,
|
|
306
|
+
width,
|
|
307
|
+
height: Math.max(0, y - gap.y)
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
/** A row: each item after the one before, a gap apart, at the row's top; as tall as the tallest. */
|
|
311
|
+
const rowLayout = (widths, heights, gap) => {
|
|
312
|
+
const xs = new Float64Array(widths.length);
|
|
313
|
+
let x = 0;
|
|
314
|
+
let height = 0;
|
|
315
|
+
// Per item at a change: statements.
|
|
316
|
+
Iter.forEach(widths, (width, i) => {
|
|
317
|
+
xs[i] = x;
|
|
318
|
+
x = x + width + gap.x;
|
|
319
|
+
if (heights[i] > height) height = heights[i];
|
|
320
|
+
});
|
|
321
|
+
return {
|
|
322
|
+
xs,
|
|
323
|
+
ys: new Float64Array(widths.length),
|
|
324
|
+
widths,
|
|
325
|
+
heights,
|
|
326
|
+
width: Math.max(0, x - gap.x),
|
|
327
|
+
height
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
/** How far past the group's width an item may reach and still fit its row: a hundredth of a px, for sums that round. */
|
|
331
|
+
const FIT_SLACK = 0.01;
|
|
332
|
+
/**
|
|
333
|
+
* Rows, as CSS `flex-wrap` with `align-items: flex-start` (Q2): items left to right while they fit the
|
|
334
|
+
* group's content width, the next row below the tallest of the one before, each item at its row's top.
|
|
335
|
+
* Before the width is read, every item at no place: in flow, where `flex-wrap` has it (Q5).
|
|
336
|
+
*/
|
|
337
|
+
const rowsLayout = (widths, heights, gap, width) => {
|
|
338
|
+
const n = widths.length;
|
|
339
|
+
const xs = new Float64Array(n);
|
|
340
|
+
const ys = new Float64Array(n);
|
|
341
|
+
if (Predicate.isUndefined(width)) return {
|
|
342
|
+
xs,
|
|
343
|
+
ys,
|
|
344
|
+
widths,
|
|
345
|
+
heights,
|
|
346
|
+
width: 0,
|
|
347
|
+
height: 0
|
|
348
|
+
};
|
|
349
|
+
let x = 0;
|
|
350
|
+
let rowY = 0;
|
|
351
|
+
let rowHeight = 0;
|
|
352
|
+
let widest = 0;
|
|
353
|
+
// Per item at a change: statements.
|
|
354
|
+
Iter.forEach(widths, (itemWidth, i) => {
|
|
355
|
+
if (x > 0 && x + itemWidth - width > FIT_SLACK) {
|
|
356
|
+
rowY = rowY + rowHeight + gap.y;
|
|
357
|
+
x = 0;
|
|
358
|
+
rowHeight = 0;
|
|
359
|
+
}
|
|
360
|
+
xs[i] = x;
|
|
361
|
+
ys[i] = rowY;
|
|
362
|
+
x = x + itemWidth + gap.x;
|
|
363
|
+
if (x - gap.x > widest) widest = x - gap.x;
|
|
364
|
+
if (heights[i] > rowHeight) rowHeight = heights[i];
|
|
365
|
+
});
|
|
366
|
+
return {
|
|
367
|
+
xs,
|
|
368
|
+
ys,
|
|
369
|
+
widths,
|
|
370
|
+
heights,
|
|
371
|
+
width: widest,
|
|
372
|
+
height: rowY + rowHeight
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
/** Each axis's layout of items each their own size. Built once, at module load. */
|
|
376
|
+
const layoutBy = Match.type().pipe(Match.when("y", () => columnLayout), Match.when("x", () => rowLayout), Match.orElse(() => rowsLayout));
|
|
377
|
+
/** Whether two arrays of numbers hold the same numbers in the same order. */
|
|
378
|
+
const sameNumbers = (a, b) => {
|
|
379
|
+
if (a.length !== b.length) return false;
|
|
380
|
+
return Bool.not(Iter.some(a, (x, i) => x !== b[i]));
|
|
381
|
+
};
|
|
382
|
+
/** Whether two resolutions of items each their own size place every item alike. */
|
|
383
|
+
const sameEach = (a, b) => {
|
|
384
|
+
if (Predicate.isUndefined(a)) return Predicate.isUndefined(b);
|
|
385
|
+
if (Predicate.isUndefined(b)) return false;
|
|
386
|
+
if (Bool.not(sameNumbers(a.xs, b.xs))) return false;
|
|
387
|
+
return sameNumbers(a.ys, b.ys);
|
|
388
|
+
};
|
|
389
|
+
/** Whether two resolutions place every item alike. */
|
|
390
|
+
export const samePlaces = (a, b) => {
|
|
391
|
+
if (Bool.not(Bool.every([a.columns === b.columns, a.stepX === b.stepX, a.stepY === b.stepY, a.signX === b.signX]))) return false;
|
|
392
|
+
return sameEach(a.each, b.each);
|
|
393
|
+
};
|
|
394
|
+
/** Item `i`'s place among `places`: its column and row, a step apart, or its own (#714), from its static position. */
|
|
395
|
+
export const placeOf = (places, i) => {
|
|
396
|
+
// Per item at a change: statements.
|
|
397
|
+
const each = places.each;
|
|
398
|
+
if (Predicate.isNotUndefined(each)) return {
|
|
399
|
+
x: places.signX * each.xs[i],
|
|
400
|
+
y: each.ys[i]
|
|
401
|
+
};
|
|
402
|
+
return {
|
|
403
|
+
x: places.signX * (i % places.columns) * places.stepX,
|
|
404
|
+
y: Math.floor(i / places.columns) * places.stepY
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* Item `i`'s width among `places`: one taking the group's content width has none, its width the group's by
|
|
409
|
+
* CSS and never read (#714): a column's crossover reads its places' `y` alone.
|
|
410
|
+
*/
|
|
411
|
+
export const widthAt = (places, i) => {
|
|
412
|
+
// Per item, per drag sample: statements.
|
|
413
|
+
const each = places.each;
|
|
414
|
+
if (Predicate.isUndefined(each)) return places.itemSize.width;
|
|
415
|
+
const width = each.widths[i];
|
|
416
|
+
if (Number.isNaN(width)) return places.width;
|
|
417
|
+
return width;
|
|
418
|
+
};
|
|
419
|
+
/** Item `i`'s height among `places`. */
|
|
420
|
+
export const heightAt = (places, i) => {
|
|
421
|
+
// Per item, per drag sample: statements.
|
|
422
|
+
const each = places.each;
|
|
423
|
+
if (Predicate.isUndefined(each)) return places.itemSize.height;
|
|
424
|
+
return each.heights[i];
|
|
425
|
+
};
|
|
133
426
|
/** The group's size for `n` items: its width, and its places' height, the last row's far edge. */
|
|
134
427
|
export const extentOf = (places, n) => Bool.match(n === 0, {
|
|
135
428
|
onTrue: () => NO_SIZE,
|
|
136
|
-
onFalse: () => ({
|
|
137
|
-
|
|
138
|
-
|
|
429
|
+
onFalse: () => UndefinedOr.match(places.each, {
|
|
430
|
+
onUndefined: () => ({
|
|
431
|
+
width: places.width,
|
|
432
|
+
height: (Math.ceil(n / places.columns) - 1) * places.stepY + places.itemSize.height
|
|
433
|
+
}),
|
|
434
|
+
onDefined: each => ({
|
|
435
|
+
width: places.width,
|
|
436
|
+
height: each.height
|
|
437
|
+
})
|
|
139
438
|
})
|
|
140
439
|
});
|
|
141
440
|
/** `px`. */
|
|
142
441
|
export const px = n => `${n}px`;
|
|
442
|
+
/** A size container's whole inline size: its content box's. */
|
|
443
|
+
const CONTAINER_WIDTH = "100cqi";
|
|
444
|
+
/**
|
|
445
|
+
* The width of an item that takes the group's content width (#714, Q10), `inFlow` or not, its padding and
|
|
446
|
+
* border inside it (border-box). In flow, `100%`: its content box's. Placed, once the group's padding is
|
|
447
|
+
* read, its padding box's (an absolutely placed box's `100%`) less that padding: a resize of the group is
|
|
448
|
+
* then a layout alone. Before, a server's, all of a size container's inline size, the group being one
|
|
449
|
+
* ({@link containsWidth}): exact, at a style recalc of every item each time the group's width changes.
|
|
450
|
+
*/
|
|
451
|
+
export const groupWidthOf = (geometry, inFlow) => Bool.match(inFlow, {
|
|
452
|
+
onTrue: () => "100%",
|
|
453
|
+
onFalse: () => UndefinedOr.match(geometry.padding, {
|
|
454
|
+
onUndefined: () => CONTAINER_WIDTH,
|
|
455
|
+
onDefined: padding => Bool.match(padding === 0, {
|
|
456
|
+
onTrue: () => "100%",
|
|
457
|
+
onFalse: () => `calc(100% - ${px(padding)})`
|
|
458
|
+
})
|
|
459
|
+
})
|
|
460
|
+
});
|
|
461
|
+
/** The style of an item that takes the group's content width, `width`: that width, its padding and border inside it. */
|
|
462
|
+
const groupWidthStyle = width => ({
|
|
463
|
+
width,
|
|
464
|
+
"box-sizing": "border-box"
|
|
465
|
+
});
|
|
466
|
+
/** Whether `places`' group is its items' size container: they take its width, out of flow, its padding not read. */
|
|
467
|
+
const containsWidth = (places, geometry) => Bool.every([places.takesWidth, Bool.not(places.inFlow), Predicate.isUndefined(geometry.padding)]);
|
|
468
|
+
/** What makes a group whose items take its content width their query container: on its inline axis alone. */
|
|
469
|
+
const SIZE_CONTAINER = {
|
|
470
|
+
"container-type": "inline-size"
|
|
471
|
+
};
|
|
143
472
|
/**
|
|
144
473
|
* The group element's style for `places`, `geometry` and `n` items, under `own`: positioned, its direction,
|
|
145
|
-
* and sized to its places, or, a grid whose width isn't read yet, laid out by CSS
|
|
146
|
-
* the server and the client, so
|
|
474
|
+
* and sized to its places, or, a grid whose width isn't read yet, laid out by CSS (Q37; #714, Q5): CSS grid
|
|
475
|
+
* for items of one size, `flex-wrap` for each their own, the same on the server and the client, so
|
|
476
|
+
* hydrating keeps the markup. Items that take its content width have it as their query container until its
|
|
477
|
+
* padding is read, out of flow (#714).
|
|
147
478
|
*/
|
|
148
479
|
export const groupStyleOf = (places, n, geometry, own) => {
|
|
149
|
-
const
|
|
480
|
+
const positioned = {
|
|
150
481
|
...ReorderController.GROUP_STYLE,
|
|
151
482
|
position: "relative",
|
|
152
483
|
direction: geometry.direction
|
|
153
484
|
};
|
|
154
|
-
const
|
|
485
|
+
const base = Bool.match(containsWidth(places, geometry), {
|
|
155
486
|
onTrue: () => ({
|
|
156
|
-
...
|
|
157
|
-
|
|
158
|
-
"grid-template-columns": `repeat(auto-fill, ${px(places.itemSize.width)})`,
|
|
159
|
-
"column-gap": px(places.stepX - places.itemSize.width),
|
|
160
|
-
"row-gap": px(places.stepY - places.itemSize.height)
|
|
487
|
+
...positioned,
|
|
488
|
+
...SIZE_CONTAINER
|
|
161
489
|
}),
|
|
490
|
+
onFalse: () => positioned
|
|
491
|
+
});
|
|
492
|
+
const sized = Bool.match(places.inFlow, {
|
|
493
|
+
onTrue: () => flowStyleOf(places, geometry, base),
|
|
162
494
|
onFalse: () => {
|
|
163
495
|
const extent = extentOf(places, n);
|
|
164
|
-
// Its
|
|
165
|
-
|
|
496
|
+
// Its width the app's (Q36; #714). Its own size holds its edges too, a `border-box` group's (#714).
|
|
497
|
+
const height = px(extent.height + geometry.edges.y);
|
|
498
|
+
return Bool.match(places.appsWidth, {
|
|
166
499
|
onTrue: () => ({
|
|
167
500
|
...base,
|
|
168
|
-
height
|
|
501
|
+
height
|
|
169
502
|
}),
|
|
170
503
|
onFalse: () => ({
|
|
171
504
|
...base,
|
|
172
|
-
width: px(extent.width),
|
|
173
|
-
height
|
|
505
|
+
width: px(extent.width + geometry.edges.x),
|
|
506
|
+
height
|
|
174
507
|
})
|
|
175
508
|
});
|
|
176
509
|
}
|
|
177
510
|
});
|
|
178
511
|
return Style.over(own, sized);
|
|
179
512
|
};
|
|
513
|
+
/** A grid in flow's style: CSS grid's columns for items of one size, `flex-wrap`'s rows for each their own (#714, Q5). */
|
|
514
|
+
const flowStyleOf = (places, geometry, base) => {
|
|
515
|
+
const gap = gapOf(geometry);
|
|
516
|
+
return Bool.match(Predicate.isUndefined(places.each), {
|
|
517
|
+
onTrue: () => ({
|
|
518
|
+
...base,
|
|
519
|
+
display: "grid",
|
|
520
|
+
"grid-template-columns": `repeat(auto-fill, ${px(places.itemSize.width)})`,
|
|
521
|
+
"column-gap": px(gap.x),
|
|
522
|
+
"row-gap": px(gap.y)
|
|
523
|
+
}),
|
|
524
|
+
onFalse: () => ({
|
|
525
|
+
...base,
|
|
526
|
+
...eachFlowBy(geometry.axis)(gap)
|
|
527
|
+
})
|
|
528
|
+
});
|
|
529
|
+
};
|
|
530
|
+
/**
|
|
531
|
+
* Each axis's flow for items each their own size (#714, decision 4), where their places would put them: a
|
|
532
|
+
* column, its items as wide as its content box; a row at its items' tops, as wide as they are, so it's as
|
|
533
|
+
* wide as its places make it; rows that wrap. Built once, at module load.
|
|
534
|
+
*/
|
|
535
|
+
const eachFlowBy = Match.type().pipe(Match.when("y", () => gap => ({
|
|
536
|
+
display: "flex",
|
|
537
|
+
"flex-direction": "column",
|
|
538
|
+
"row-gap": px(gap.y)
|
|
539
|
+
})), Match.when("x", () => gap => ({
|
|
540
|
+
display: "flex",
|
|
541
|
+
"flex-direction": "row",
|
|
542
|
+
"align-items": "flex-start",
|
|
543
|
+
"column-gap": px(gap.x),
|
|
544
|
+
width: "max-content"
|
|
545
|
+
})), Match.orElse(() => gap => ({
|
|
546
|
+
display: "flex",
|
|
547
|
+
"flex-wrap": "wrap",
|
|
548
|
+
"align-items": "flex-start",
|
|
549
|
+
"column-gap": px(gap.x),
|
|
550
|
+
"row-gap": px(gap.y)
|
|
551
|
+
})));
|
|
180
552
|
/** A Reorder item's drag axis for its group's: a grid's `xy` is a free drag. Built once, at module load. */
|
|
181
553
|
const dragAxisFor = Match.type().pipe(Match.when("xy", () => true), Match.orElse(axis => axis));
|
|
182
554
|
/**
|
|
183
|
-
* An item's own style under its group's:
|
|
184
|
-
*
|
|
555
|
+
* An item's own style under its group's, `inFlow` or not: a drag element's defaults; sized, its items one
|
|
556
|
+
* size; a column's items read from the page as wide as the group (#714, Q6); and, unless its group lays it out
|
|
557
|
+
* in flow, absolute at its static position (no `top` or `left`): the start of the group's content box. Items
|
|
558
|
+
* each their own size, a function's, are sized each by {@link sizeStyleOf} (#714).
|
|
185
559
|
*/
|
|
186
|
-
export const itemBaseOf = geometry => {
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
560
|
+
export const itemBaseOf = (geometry, inFlow) => {
|
|
561
|
+
const drag = Style.dragDefaults(dragAxisFor(geometry.axis));
|
|
562
|
+
const base = sizedBy(geometry, drag, groupWidthOf(geometry, inFlow));
|
|
563
|
+
return Bool.match(inFlow, {
|
|
564
|
+
onTrue: () => ({
|
|
565
|
+
...base,
|
|
566
|
+
...IN_FLOW
|
|
567
|
+
}),
|
|
194
568
|
onFalse: () => ({
|
|
195
569
|
...base,
|
|
196
570
|
position: "absolute"
|
|
197
571
|
})
|
|
198
572
|
});
|
|
199
573
|
};
|
|
574
|
+
/**
|
|
575
|
+
* `drag` with every item's size, its group's one size; the group's width, `groupWidth`, a column's read from the
|
|
576
|
+
* page; or none.
|
|
577
|
+
*/
|
|
578
|
+
const sizedBy = (geometry, drag, groupWidth) => {
|
|
579
|
+
// Per element at mount, by the hot path's rules: statements.
|
|
580
|
+
const itemSize = geometry.itemSize;
|
|
581
|
+
if (Predicate.isUndefined(itemSize)) {
|
|
582
|
+
if (geometry.axis !== "y") return drag;
|
|
583
|
+
return {
|
|
584
|
+
...drag,
|
|
585
|
+
...groupWidthStyle(groupWidth)
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
if (Predicate.isFunction(itemSize)) return drag;
|
|
589
|
+
return {
|
|
590
|
+
...drag,
|
|
591
|
+
...sizeStyle(itemSize.width, itemSize.height, groupWidth)
|
|
592
|
+
};
|
|
593
|
+
};
|
|
594
|
+
/** An item in flow's own: unshrunk, as wide as at its place, its row breaking where its place's does (#714). */
|
|
595
|
+
const IN_FLOW = {
|
|
596
|
+
"flex-shrink": "0"
|
|
597
|
+
};
|
|
598
|
+
/** An item's size as style: its width, or the group's content width, `groupWidth`, border-box (#714, Q10); and its height. */
|
|
599
|
+
const sizeStyle = (width, height, groupWidth) => UndefinedOr.match(width, {
|
|
600
|
+
onUndefined: () => ({
|
|
601
|
+
...groupWidthStyle(groupWidth),
|
|
602
|
+
height: px(height)
|
|
603
|
+
}),
|
|
604
|
+
onDefined: w => ({
|
|
605
|
+
width: px(w),
|
|
606
|
+
height: px(height)
|
|
607
|
+
})
|
|
608
|
+
});
|
|
609
|
+
/** Item `i`'s own size as style, its items each their own size (#714): `width` and `height`, or none. */
|
|
610
|
+
export const sizeStyleOf = (places, i) => {
|
|
611
|
+
// Per element at mount, by the hot path's rules: statements.
|
|
612
|
+
const each = places.each;
|
|
613
|
+
if (Predicate.isUndefined(each) || places.sizesRead) return NO_STYLE;
|
|
614
|
+
const width = each.widths[i];
|
|
615
|
+
if (Number.isNaN(width)) return {
|
|
616
|
+
...groupWidthStyle(places.groupWidth),
|
|
617
|
+
height: px(each.heights[i])
|
|
618
|
+
};
|
|
619
|
+
return {
|
|
620
|
+
width: px(width),
|
|
621
|
+
height: px(each.heights[i])
|
|
622
|
+
};
|
|
623
|
+
};
|
|
624
|
+
const NO_STYLE = {};
|
|
625
|
+
/** An element whose width was the group's, `was`, written no longer: its own `box-sizing` back (#714). */
|
|
626
|
+
export const releaseGroupWidth = (el, was) => {
|
|
627
|
+
// Per item at a change: statements.
|
|
628
|
+
if (Predicate.isNotUndefined(was) && was.tookGroupWidth) el.style.removeProperty("box-sizing");
|
|
629
|
+
};
|
|
630
|
+
/**
|
|
631
|
+
* `el`'s own size as `was` written, taken back where its style is still that: its items' sizes read from the
|
|
632
|
+
* page now (#714). A width that was the group's stays, a column's read from the page being the group's too.
|
|
633
|
+
*/
|
|
634
|
+
export const unwriteSizeOn = (el, was) => {
|
|
635
|
+
// Per item at a change: statements.
|
|
636
|
+
if (Predicate.isUndefined(was)) return;
|
|
637
|
+
if (el.style.height === was.height) el.style.removeProperty("height");
|
|
638
|
+
if (!was.tookGroupWidth && el.style.width === was.width) el.style.removeProperty("width");
|
|
639
|
+
};
|
|
640
|
+
/**
|
|
641
|
+
* Item `i`'s own size written on `el`, its items each their own size (#714), where it isn't already: what
|
|
642
|
+
* `written` holds, by element, is what was last written.
|
|
643
|
+
*/
|
|
644
|
+
export const writeSizeOn = (el, places, i, written) => {
|
|
645
|
+
// Per item at a change: statements.
|
|
646
|
+
const each = places.each;
|
|
647
|
+
if (Predicate.isUndefined(each) || places.sizesRead) return;
|
|
648
|
+
const tookGroupWidth = Number.isNaN(each.widths[i]);
|
|
649
|
+
let width = places.groupWidth;
|
|
650
|
+
if (!tookGroupWidth) width = px(each.widths[i]);
|
|
651
|
+
const height = px(each.heights[i]);
|
|
652
|
+
const was = written.get(el);
|
|
653
|
+
if (Predicate.isNotUndefined(was) && was.width === width && was.height === height) return;
|
|
654
|
+
written.set(el, {
|
|
655
|
+
width,
|
|
656
|
+
height,
|
|
657
|
+
tookGroupWidth
|
|
658
|
+
});
|
|
659
|
+
el.style.setProperty("height", height);
|
|
660
|
+
el.style.setProperty("width", width);
|
|
661
|
+
if (tookGroupWidth) {
|
|
662
|
+
el.style.setProperty("box-sizing", "border-box");
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
releaseGroupWidth(el, was);
|
|
666
|
+
};
|
|
200
667
|
/**
|
|
201
668
|
* A style as CSS text: the one every item of a group shares, written once as each is made, where a key at
|
|
202
669
|
* a time cost each item a write per key (#712, Q47).
|