@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/element.tsx
CHANGED
|
@@ -38,13 +38,15 @@ import * as Option from "effect/Option"
|
|
|
38
38
|
import * as Predicate from "effect/Predicate"
|
|
39
39
|
import * as Rec from "effect/Record"
|
|
40
40
|
import * as UndefinedOr from "effect/UndefinedOr"
|
|
41
|
-
import { $PROXY, type Accessor, children, type Component, createComponent, createEffect, createRenderEffect, type JSX, sharedConfig, splitProps, untrack } from "solid-js"
|
|
41
|
+
import { $PROXY, type Accessor, children, type Component, createComponent, createEffect, createRenderEffect, DEV, type JSX, sharedConfig, splitProps, untrack } from "solid-js"
|
|
42
|
+
import { unforwardedRefFix, unforwardedRefLine } from "./messages.ts"
|
|
42
43
|
import { assign, Dynamic, getNextElement, insert, spread, SVGElements, use } from "solid-js/web"
|
|
43
44
|
import { isServer } from "./server.ts"
|
|
44
45
|
import { GESTURE_KEYS } from "./gesture-callbacks.ts"
|
|
45
46
|
import { renderServerElement, serverAppearOfWard, createWardWith, type SpineInternals, type WardStyle, type WardUserProps } from "./create-ward.tsx"
|
|
46
|
-
import type { WardConfig, WardicVariantLabels } from "./config.ts"
|
|
47
|
-
import type {
|
|
47
|
+
import type { WardBaseConfig, WardConfig, WardFeatureConfigs, WardicVariantLabels } from "./config.ts"
|
|
48
|
+
import type { AbsentGroupsOf, EveryFeature, GroupsOf, NamesEvery, PropFeatureNames } from "./feature.ts"
|
|
49
|
+
import type { InferredMotion, InferredMotionOf, TargetKey } from "./ward-keys.ts"
|
|
48
50
|
import { changesContext } from "./variant-tree.ts"
|
|
49
51
|
import { MOTION_PROPS, motionToConfig, type WardicMotionProps } from "./motion-props.ts"
|
|
50
52
|
import { droppedKeysOf, markWardic, routingTagOf, type WardicCreateOptions } from "./wardic-component.ts"
|
|
@@ -70,13 +72,39 @@ export type WardicProps<Tag extends keyof JSX.IntrinsicElements, M = WardicMotio
|
|
|
70
72
|
* ({@link InferredMotion}). A name an entry gives that the element doesn't animate is an error, and
|
|
71
73
|
* completion inside a `transition` offers the keys it drives.
|
|
72
74
|
*/
|
|
73
|
-
|
|
75
|
+
//
|
|
76
|
+
// `F` (#516): a Wardic instance's Features. Its default, every one, gives the props as they were; a
|
|
77
|
+
// list without some gives their props as `NeedsFeature` ({@link InferredPropsFor}).
|
|
78
|
+
export type WardicComponent<Tag extends keyof JSX.IntrinsicElements, F = EveryFeature> = WardicComponentFor<Tag, PropFeatureNames<F>>
|
|
79
|
+
|
|
80
|
+
/** A {@link WardicComponent} whose Features are named `FN` (#516). */
|
|
81
|
+
export type WardicComponentFor<Tag extends keyof JSX.IntrinsicElements, FN extends string> = <
|
|
74
82
|
K extends TargetKey = never,
|
|
75
83
|
N extends string = never,
|
|
76
84
|
LI extends WardicVariantLabels = never,
|
|
77
85
|
LA extends WardicVariantLabels = never,
|
|
78
86
|
D extends boolean | "x" | "y" = never,
|
|
79
|
-
>(props: WardicProps<Tag,
|
|
87
|
+
>(props: WardicProps<Tag, InferredPropsFor<FN, K, N, LI, LA, D>>) => JSX.Element
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The motion props, keys inferred (#305), of an element whose Features are named `FN` (#516): with every
|
|
91
|
+
* one, as they were; a Wardic instance's without some, the base props and its Features', and every
|
|
92
|
+
* other Feature's prop `NeedsFeature<"name">`, an error naming the Feature.
|
|
93
|
+
*/
|
|
94
|
+
export type InferredPropsFor<FN extends string, K extends TargetKey, N extends string, LI extends WardicVariantLabels, LA extends WardicVariantLabels, D extends boolean | "x" | "y"> =
|
|
95
|
+
NamesEvery<WardFeatureConfigs, FN> extends true
|
|
96
|
+
? InferredMotion<WardicMotionProps, K, N, LI, LA, D>
|
|
97
|
+
: InferredMotionOf<OwnPropsFor<FN>, K, N, LI, LA, D> & AbsentGroupsOf<WardFeatureConfigs, FN>
|
|
98
|
+
|
|
99
|
+
/** A Wardic instance's own motion props, its Features named `FN` (#516): the base group and each of theirs. */
|
|
100
|
+
export type OwnPropsFor<FN extends string> = WardBaseConfig & GroupsOf<WardFeatureConfigs, FN>
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The motion props of an element whose Features are named `FN` (#516): every one's, as they were, with
|
|
104
|
+
* every Feature; else {@link OwnPropsFor}, and every other Feature's prop `NeedsFeature<"name">`.
|
|
105
|
+
*/
|
|
106
|
+
export type MotionPropsFor<FN extends string> =
|
|
107
|
+
NamesEvery<WardFeatureConfigs, FN> extends true ? WardicMotionProps : OwnPropsFor<FN> & AbsentGroupsOf<WardFeatureConfigs, FN>
|
|
80
108
|
|
|
81
109
|
/**
|
|
82
110
|
* The shape `wardic.create(Component)` requires of a wrapped component: it must
|
|
@@ -123,13 +151,16 @@ export function createWith(arg: string | Component<Record<string, unknown> & War
|
|
|
123
151
|
return markWardic(made, arg)
|
|
124
152
|
}
|
|
125
153
|
|
|
126
|
-
/** The `create` of a form: {@link createWith}'s overloads. */
|
|
127
|
-
export
|
|
128
|
-
|
|
154
|
+
/** The `create` of a form: {@link createWith}'s overloads. `F` (#516): a Wardic instance's Features. */
|
|
155
|
+
export type Create<F = EveryFeature> = CreateFor<PropFeatureNames<F>>
|
|
156
|
+
|
|
157
|
+
/** {@link Create} for the Features named `FN` (#516). */
|
|
158
|
+
export interface CreateFor<FN extends string> {
|
|
159
|
+
<Tag extends keyof JSX.IntrinsicElements>(tag: Tag, options?: WardicCreateOptions): WardicComponentFor<Tag, FN>
|
|
129
160
|
// A component's stays a plain `Component`, its keys not inferred: a generic return type would stop
|
|
130
161
|
// TS carrying a generic component's own type parameters through (Kobalte's `<T extends ValidComponent>`).
|
|
131
|
-
<P>(component: Component<P & WardicWrappable>, options?: WardicCreateOptions): Component<P &
|
|
132
|
-
(tag: string, options?: WardicCreateOptions): Component<WardicProps<keyof JSX.IntrinsicElements
|
|
162
|
+
<P>(component: Component<P & WardicWrappable>, options?: WardicCreateOptions): Component<P & MotionPropsFor<FN>>
|
|
163
|
+
(tag: string, options?: WardicCreateOptions): Component<WardicProps<keyof JSX.IntrinsicElements, MotionPropsFor<FN>>>
|
|
133
164
|
}
|
|
134
165
|
|
|
135
166
|
/** A form's `create`, its elements of `kind`. */
|
|
@@ -295,6 +326,16 @@ interface Forwarding {
|
|
|
295
326
|
/** A tag's: the user's ref, and its element as it is. */
|
|
296
327
|
const ownElement = (element: () => JSX.Element): JSX.Element => element()
|
|
297
328
|
|
|
329
|
+
/**
|
|
330
|
+
* The error for a wrapped component that renders an element but forwards its ref to none (#746,
|
|
331
|
+
* ADR-0067 *Amendment (#746)*, decision 7): the fix in development, under Solid's `DEV`, and one line
|
|
332
|
+
* in a production build. `label` names the wrap.
|
|
333
|
+
*/
|
|
334
|
+
const unforwardedRefMessage = (label: string): string => {
|
|
335
|
+
if (DEV) return unforwardedRefFix(label)
|
|
336
|
+
return unforwardedRefLine(label)
|
|
337
|
+
}
|
|
338
|
+
|
|
298
339
|
/**
|
|
299
340
|
* The user's ref, and, for a wrapped component, the check that it forwards the Ward's (ADR-0008,
|
|
300
341
|
* narrowed by #414): one that renders an element and forwards its ref to none of what it renders
|
|
@@ -314,12 +355,7 @@ const forwardingOf = (component: Rendered, userRef: ((el: HTMLElement) => void)
|
|
|
314
355
|
const elements = Arr.filter(rendered.toArray(), isElement)
|
|
315
356
|
if (Arr.isArrayEmpty(elements)) return
|
|
316
357
|
if (Arr.some(elements, (inside) => Predicate.isNotUndefined(reached) && inside.contains(reached))) return
|
|
317
|
-
|
|
318
|
-
throw new Error(
|
|
319
|
-
`wardic.create(${name}): the wrapped component rendered an element but did not forward its ref to it. ` +
|
|
320
|
-
"The component must forward props.ref to a single root DOM element " +
|
|
321
|
-
"(e.g. <div ref={props.ref}>...</div>). Element-only motion is wired through the ref.",
|
|
322
|
-
)
|
|
358
|
+
throw new Error(unforwardedRefMessage(`wardic.create(${component.name || "anonymous component"})`))
|
|
323
359
|
})
|
|
324
360
|
return rendered as unknown as JSX.Element
|
|
325
361
|
}
|
package/src/feature.ts
CHANGED
|
@@ -26,6 +26,8 @@ import * as Option from "effect/Option"
|
|
|
26
26
|
import * as Predicate from "effect/Predicate"
|
|
27
27
|
import * as UndefinedOr from "effect/UndefinedOr"
|
|
28
28
|
import * as OwnerScope from "./owner-scope.ts"
|
|
29
|
+
import type { WardConfig, WardFeatureConfigs } from "./config.ts"
|
|
30
|
+
import type { ALL } from "./features/all.ts"
|
|
29
31
|
import type { Reactivity } from "./reactivity.ts"
|
|
30
32
|
import type { ProviderRuntime, ProviderServices, WardicServices } from "./runtime.ts"
|
|
31
33
|
|
|
@@ -34,10 +36,11 @@ import type { ProviderRuntime, ProviderServices, WardicServices } from "./runtim
|
|
|
34
36
|
* and that Layer, built on the provider's runtime: its Environment, its flush gate and its projection
|
|
35
37
|
* options. `server` is what a server render, which builds no runtime, does with it: the
|
|
36
38
|
* `colors` Feature registers its colour spaces there too, as the render reads colours; the rest do
|
|
37
|
-
* nothing.
|
|
39
|
+
* nothing. `N` is its name as a type, by which each binding finds the props it adds.
|
|
38
40
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
// `N`: #516, ADR-0067 *Amendment (#516)*, decision 3. A Feature typed without it adds no props.
|
|
42
|
+
export interface Feature<I = any, S = any, N extends string = string> {
|
|
43
|
+
readonly name: N
|
|
41
44
|
readonly key: Context.Key<I, S>
|
|
42
45
|
readonly layer: Layer.Layer<I, never, ProviderServices>
|
|
43
46
|
readonly server?: (() => void) | undefined
|
|
@@ -46,6 +49,62 @@ export interface Feature<I = any, S = any> {
|
|
|
46
49
|
/** Features as an app gives them: one, or a list, a preset's nested in it (`[domAnimation, layout]`). */
|
|
47
50
|
export type Features = Feature | ReadonlyArray<Features>
|
|
48
51
|
|
|
52
|
+
/**
|
|
53
|
+
* The names of the Features in `F` (#516): a Feature's own, every one's in a list, nested lists
|
|
54
|
+
* flattened, and what a load resolves to. What a Wardic instance's types find their props by. A
|
|
55
|
+
* Feature typed without its name (`Feature`, whose `N` is `string`) names none: as a member of a
|
|
56
|
+
* union, `string` would swallow every other name.
|
|
57
|
+
*/
|
|
58
|
+
// Unconstrained: `F extends Features` would send it down `Features`' own recursion (TS2589).
|
|
59
|
+
export type FeatureNames<F> = F extends ReadonlyArray<infer E>
|
|
60
|
+
? FeatureNames<E>
|
|
61
|
+
: F extends () => PromiseLike<infer L>
|
|
62
|
+
? FeatureNames<L>
|
|
63
|
+
: F extends { readonly name: infer N extends string }
|
|
64
|
+
? string extends N
|
|
65
|
+
? never
|
|
66
|
+
: N
|
|
67
|
+
: never
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* What a prop of a Feature a Wardic instance doesn't have takes: nothing, so giving it is an error
|
|
71
|
+
* naming the Feature, `Type 'boolean' is not assignable to type 'NeedsFeature<"drag">'`.
|
|
72
|
+
*/
|
|
73
|
+
// #516, Q15.
|
|
74
|
+
export interface NeedsFeature<N extends string> {
|
|
75
|
+
readonly "needs the Feature": N
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** A union's members, intersected. */
|
|
79
|
+
type UnionToIntersection<U> = (U extends unknown ? (u: U) => void : never) extends (i: infer I) => void ? I : never
|
|
80
|
+
|
|
81
|
+
/** The props `Groups` gives the Features named `N`, a binding's map from a Feature's name to its props (#516). */
|
|
82
|
+
export type GroupsOf<Groups, N extends string> = UnionToIntersection<Groups[N & keyof Groups]>
|
|
83
|
+
|
|
84
|
+
/** Every prop of the Features `Groups` has and `N` doesn't name, each {@link NeedsFeature} its own. */
|
|
85
|
+
export type AbsentGroupsOf<Groups, N extends string> = UnionToIntersection<
|
|
86
|
+
Exclude<keyof Groups, N> extends infer A ? (A extends keyof Groups & string ? { readonly [P in keyof Groups[A]]?: NeedsFeature<A> } : never) : never
|
|
87
|
+
>
|
|
88
|
+
|
|
89
|
+
/** Every Feature: what an element has unless it's a Wardic instance's (#516). */
|
|
90
|
+
export type EveryFeature = typeof ALL
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The names of those of Features `F` that add props (#516), on either binding. A Wardic instance's
|
|
94
|
+
* types take these, not `F`: every list with each of them is one type, and an error prints names, not
|
|
95
|
+
* each Feature's service.
|
|
96
|
+
*/
|
|
97
|
+
export type PropFeatureNames<F> = Extract<FeatureNames<F>, keyof WardFeatureConfigs>
|
|
98
|
+
|
|
99
|
+
/** The names of every Feature that adds props (#516): what an element has unless it's a Wardic instance's. */
|
|
100
|
+
export type EveryFeatureName = PropFeatureNames<EveryFeature>
|
|
101
|
+
|
|
102
|
+
/** Whether `N` names every Feature in `Groups`: a Wardic instance whose props are the binding's plain ones. */
|
|
103
|
+
export type NamesEvery<Groups, N extends string> = [Exclude<keyof Groups, N>] extends [never] ? true : false
|
|
104
|
+
|
|
105
|
+
/** A Wardic instance's layout hooks, `Hooks`, when its Features named `N` include `layout`; else nothing (#516, Q6). */
|
|
106
|
+
export type LayoutHooksFor<N extends string, Hooks> = "layout" extends N ? Hooks : unknown
|
|
107
|
+
|
|
49
108
|
/** Features loaded lazily: `() => import("./features.ts").then((m) => m.domMax)`. */
|
|
50
109
|
export type FeatureLoad = () => Promise<Features>
|
|
51
110
|
|
|
@@ -82,6 +141,33 @@ const isFeature = (value: Features): value is Feature => Predicate.hasProperty(v
|
|
|
82
141
|
/** Whether a `features` prop loads lazily: a function, where Features are values. */
|
|
83
142
|
export const isLoad = (prop: FeaturesProp): prop is FeatureLoad => Predicate.isFunction(prop)
|
|
84
143
|
|
|
144
|
+
/**
|
|
145
|
+
* What a Wardic instance is made with (#516, Q8): Features, loads of them, or lists of either, nested
|
|
146
|
+
* (`[domAnimation, () => import("./drag-feature.ts").then((m) => m.drag)]`).
|
|
147
|
+
*/
|
|
148
|
+
export type InstanceFeaturesProp = Feature | FeatureLoad | ReadonlyArray<InstanceFeaturesProp>
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* A Wardic instance's Features (#516): what its elements and hooks join their section's with, one per
|
|
152
|
+
* provider. Its code is `instance-features.ts`'s, which only `createWardic` imports, so an app with no
|
|
153
|
+
* Wardic instance ships none of it: the spine only calls `own`.
|
|
154
|
+
*/
|
|
155
|
+
export interface InstanceFeatures {
|
|
156
|
+
/**
|
|
157
|
+
* Its Features in `registry`'s provider, one per provider: those given at once, built on first need,
|
|
158
|
+
* and each load, started on the client the first time it's asked for and built as it arrives, until
|
|
159
|
+
* the provider ends. A server render builds what's given and loads nothing.
|
|
160
|
+
*/
|
|
161
|
+
readonly own: (registry: FeatureRegistry, host: InstanceHost) => Own
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** What an element's Features come from (#511, #516): those it brings, a Complete element's every one, or a Wardic instance's. */
|
|
165
|
+
export interface ElementFeatures {
|
|
166
|
+
readonly brings?: ReadonlyArray<Feature> | undefined
|
|
167
|
+
readonly complete?: boolean | undefined
|
|
168
|
+
readonly instance?: InstanceFeatures | undefined
|
|
169
|
+
}
|
|
170
|
+
|
|
85
171
|
/** No Features. */
|
|
86
172
|
export const NONE: Context.Context<never> = Context.empty()
|
|
87
173
|
|
|
@@ -127,39 +213,47 @@ export const makeSection = (
|
|
|
127
213
|
report: (cause: Cause.Cause<unknown>) => void,
|
|
128
214
|
host: SectionHost,
|
|
129
215
|
): FeatureSection => {
|
|
130
|
-
const own = ownOf(registry, prop, report, host)
|
|
131
|
-
|
|
216
|
+
const own = ownOf(registry.build, prop, report, host)
|
|
217
|
+
return { ...joinSections(parent, own), strict: strict || parent.strict }
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** `parent`'s Features and `own`'s, as a section: `parent`'s `strict`. */
|
|
221
|
+
export const joinSections = (parent: FeatureSection, own: Own): FeatureSection => ({ ...joinOwns(parent, own), strict: parent.strict })
|
|
222
|
+
|
|
223
|
+
/** `a`'s services and `b`'s, joined again only when either changes, and whether either's load is on its way. */
|
|
224
|
+
export const joinOwns = (a: Own, b: Own): Own => {
|
|
225
|
+
let last: { readonly a: Context.Context<never>; readonly b: Context.Context<never>; readonly joined: Context.Context<never> } | undefined
|
|
132
226
|
const services = (): Context.Context<never> => {
|
|
133
|
-
const
|
|
134
|
-
const
|
|
135
|
-
if (Predicate.isNotUndefined(last) && last.
|
|
136
|
-
const joined = Context.merge(
|
|
137
|
-
last = {
|
|
227
|
+
const first = a.services()
|
|
228
|
+
const second = b.services()
|
|
229
|
+
if (Predicate.isNotUndefined(last) && last.a === first && last.b === second) return last.joined
|
|
230
|
+
const joined = Context.merge(first, second)
|
|
231
|
+
last = { a: first, b: second, joined }
|
|
138
232
|
return joined
|
|
139
233
|
}
|
|
140
|
-
return { services, pending: () =>
|
|
234
|
+
return { services, pending: () => b.pending() || a.pending() }
|
|
141
235
|
}
|
|
142
236
|
|
|
143
237
|
/** A section's own Features: their services and whether they're on their way. */
|
|
144
|
-
interface Own {
|
|
238
|
+
export interface Own {
|
|
145
239
|
readonly services: () => Context.Context<never>
|
|
146
240
|
readonly pending: () => boolean
|
|
147
241
|
}
|
|
148
242
|
|
|
149
243
|
const NO_OWN: Own = { services: () => NONE, pending: constFalse }
|
|
150
244
|
|
|
151
|
-
const ownOf = (
|
|
245
|
+
export const ownOf = (build: Build, prop: FeaturesProp | undefined, report: (cause: Cause.Cause<unknown>) => void, host: SectionHost): Own => {
|
|
152
246
|
if (Predicate.isUndefined(prop)) return NO_OWN
|
|
153
|
-
if (isLoad(prop)) return loaded(
|
|
247
|
+
if (isLoad(prop)) return loaded(build, prop, report, host)
|
|
154
248
|
const features = flatten(prop)
|
|
155
|
-
if (host.server)
|
|
249
|
+
if (host.server) build(features)
|
|
156
250
|
let built: Context.Context<never> | undefined
|
|
157
251
|
return {
|
|
158
252
|
services: () =>
|
|
159
253
|
UndefinedOr.match(built, {
|
|
160
254
|
onDefined: identity,
|
|
161
255
|
onUndefined: () => {
|
|
162
|
-
built =
|
|
256
|
+
built = build(features)
|
|
163
257
|
return built
|
|
164
258
|
},
|
|
165
259
|
}),
|
|
@@ -167,8 +261,11 @@ const ownOf = (registry: FeatureRegistry, prop: FeaturesProp | undefined, report
|
|
|
167
261
|
}
|
|
168
262
|
}
|
|
169
263
|
|
|
264
|
+
/** What builds Features: a registry's `build`. */
|
|
265
|
+
export type Build = (features: ReadonlyArray<Feature>) => Context.Context<never>
|
|
266
|
+
|
|
170
267
|
/** Features loaded lazily: none until they arrive, which a trigger tells; on the client only. */
|
|
171
|
-
const loaded = (
|
|
268
|
+
const loaded = (build: Build, load: FeatureLoad, report: (cause: Cause.Cause<unknown>) => void, host: SectionHost): Own => {
|
|
172
269
|
if (host.server) return NO_OWN
|
|
173
270
|
const changed = host.reactivity.trigger()
|
|
174
271
|
let services = NONE
|
|
@@ -180,7 +277,7 @@ const loaded = (registry: FeatureRegistry, load: FeatureLoad, report: (cause: Ca
|
|
|
180
277
|
load().then(
|
|
181
278
|
(features) => {
|
|
182
279
|
if (!live) return
|
|
183
|
-
services =
|
|
280
|
+
services = build(flatten(features))
|
|
184
281
|
pending = false
|
|
185
282
|
changed.notify()
|
|
186
283
|
},
|
|
@@ -219,15 +316,33 @@ export interface FeatureRegistry {
|
|
|
219
316
|
readonly built: () => Context.Context<never>
|
|
220
317
|
/** Logs `message` at Warning the first time `feature` is named: development's word on a missing Feature. */
|
|
221
318
|
readonly warnOnce: (feature: string, message: string) => void
|
|
319
|
+
/** Runs `end` as the provider ends, before its Features: what a Wardic instance's loads stop by (#516). */
|
|
320
|
+
readonly onEnd: (end: () => void) => void
|
|
222
321
|
/** Ends every Feature built, the provider's runtime after (a Feature's Layer may stand on it). */
|
|
223
322
|
readonly dispose: () => Promise<void>
|
|
224
323
|
}
|
|
225
324
|
|
|
226
|
-
/**
|
|
227
|
-
|
|
325
|
+
/**
|
|
326
|
+
* What a Wardic instance's Features take from the binding asking for them (#516): a section's host but
|
|
327
|
+
* its cleanup, which is its provider's (`FeatureRegistry.onEnd`), and what reports a failed load.
|
|
328
|
+
*/
|
|
329
|
+
export interface InstanceHost extends Omit<SectionHost, "onCleanup"> {
|
|
330
|
+
readonly report: (cause: Cause.Cause<unknown>) => void
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* A registry's sections of exactly a list, one per list; what runs as it ends (`onEnd`, run by `end`);
|
|
335
|
+
* and its warnings, one per Feature.
|
|
336
|
+
*/
|
|
337
|
+
const sectionsAndWarnings = (build: Build, warn: (message: string) => void) => {
|
|
228
338
|
const sections = new WeakMap<ReadonlyArray<Feature>, FeatureSection>()
|
|
339
|
+
const ends: Array<() => void> = []
|
|
229
340
|
const warned = new Set<string>()
|
|
230
341
|
return {
|
|
342
|
+
onEnd: (end: () => void): void => {
|
|
343
|
+
ends.push(end)
|
|
344
|
+
},
|
|
345
|
+
end: (): void => Arr.forEach(ends.splice(0), (end) => end()),
|
|
231
346
|
section: (features: ReadonlyArray<Feature>): FeatureSection =>
|
|
232
347
|
UndefinedOr.match(sections.get(features), {
|
|
233
348
|
onDefined: identity,
|
|
@@ -278,13 +393,17 @@ export const clientRegistry = (runtime: ProviderRuntime): FeatureRegistry => {
|
|
|
278
393
|
return services
|
|
279
394
|
},
|
|
280
395
|
})
|
|
396
|
+
const { end, ...rest } = sectionsAndWarnings(build, (message) => {
|
|
397
|
+
runtime.runFork(Effect.logWarning(message))
|
|
398
|
+
})
|
|
281
399
|
return {
|
|
282
400
|
build,
|
|
283
401
|
built: () => all,
|
|
284
|
-
...
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
402
|
+
...rest,
|
|
403
|
+
dispose: () => {
|
|
404
|
+
end()
|
|
405
|
+
return disposeReported(runtime)
|
|
406
|
+
},
|
|
288
407
|
}
|
|
289
408
|
}
|
|
290
409
|
|
|
@@ -318,7 +437,16 @@ export const serverRegistry = (runtime: ManagedRuntime.ManagedRuntime<WardicServ
|
|
|
318
437
|
return NONE
|
|
319
438
|
}
|
|
320
439
|
// A server render says nothing: the client, rendering the same, does.
|
|
321
|
-
|
|
440
|
+
const { end, ...rest } = sectionsAndWarnings(build, constVoid)
|
|
441
|
+
return {
|
|
442
|
+
build,
|
|
443
|
+
built: () => NONE,
|
|
444
|
+
...rest,
|
|
445
|
+
dispose: () => {
|
|
446
|
+
end()
|
|
447
|
+
return runtime.dispose()
|
|
448
|
+
},
|
|
449
|
+
}
|
|
322
450
|
}
|
|
323
451
|
|
|
324
452
|
/**
|
|
@@ -349,6 +477,10 @@ export const strictMessage = (complete: string, slim: string): string =>
|
|
|
349
477
|
/** What development's word on a missing `layout` Feature names (#511): the props that need it. */
|
|
350
478
|
export const LAYOUT_PROPS = "A layout prop (`layout`, `layoutId`, `layoutScroll` or `layoutRoot`)"
|
|
351
479
|
|
|
480
|
+
/** Whether a config makes its element a projection node: `layout` (or a mode), a `layoutId`, `layoutScroll` or `layoutRoot`. */
|
|
481
|
+
export const wantsLayoutNode = (c: WardConfig): boolean =>
|
|
482
|
+
c.layout === true || Predicate.isString(c.layout) || Predicate.isNotUndefined(c.layoutId) || c.layoutScroll === true || c.layoutRoot === true
|
|
483
|
+
|
|
352
484
|
/**
|
|
353
485
|
* Development's word on a missing Feature (#511, ADR-0067 decision 7): what needed it, its import from
|
|
354
486
|
* the binding's `entry`, and where to add it. Not a Complete element, which a `strict` section makes
|
package/src/features/all.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import type { Feature } from "../feature.ts"
|
|
9
8
|
import { colors } from "./colors.ts"
|
|
10
9
|
import { drag } from "./drag.ts"
|
|
11
10
|
import { focus } from "./focus.ts"
|
|
@@ -15,4 +14,14 @@ import { layout } from "./layout.ts"
|
|
|
15
14
|
import { pan } from "./pan.ts"
|
|
16
15
|
import { press } from "./press.ts"
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
// A tuple, so a Wardic instance's types keep each Feature's name (#516).
|
|
18
|
+
export const ALL: readonly [typeof colors, typeof layout, typeof hover, typeof press, typeof focus, typeof inView, typeof pan, typeof drag] = [
|
|
19
|
+
colors,
|
|
20
|
+
layout,
|
|
21
|
+
hover,
|
|
22
|
+
press,
|
|
23
|
+
focus,
|
|
24
|
+
inView,
|
|
25
|
+
pan,
|
|
26
|
+
drag,
|
|
27
|
+
]
|
package/src/features/colors.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { Colors } from "./keys.ts"
|
|
|
21
21
|
* them, every element on the page reads them; a pair another provider resolved before stays as it
|
|
22
22
|
* was resolved there.
|
|
23
23
|
*/
|
|
24
|
-
export const colors: Feature<Colors, true> = {
|
|
24
|
+
export const colors: Feature<Colors, true, "colors"> = {
|
|
25
25
|
name: "colors",
|
|
26
26
|
key: Colors,
|
|
27
27
|
// The provider's registry forgets the pairs it resolved before: one with a wide-gamut colour read as
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import type { Feature } from "../feature.ts"
|
|
9
8
|
import { focus } from "./focus.ts"
|
|
10
9
|
import { hover } from "./hover.ts"
|
|
11
10
|
import { inView } from "./in-view.ts"
|
|
12
11
|
import { press } from "./press.ts"
|
|
13
12
|
|
|
14
13
|
/** Motion's `domAnimation`: the gestures an element animates on without dragging, `hover`, `press`, `focus` and `inView`. */
|
|
15
|
-
|
|
14
|
+
// A tuple, so a Wardic instance's types keep each Feature's name (#516).
|
|
15
|
+
export const domAnimation: readonly [typeof hover, typeof press, typeof focus, typeof inView] = [hover, press, focus, inView]
|
package/src/features/dom-max.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import type { Feature } from "../feature.ts"
|
|
8
7
|
import { ALL } from "./all.ts"
|
|
9
8
|
|
|
10
9
|
/** Motion's `domMax`: every Feature, `pan`, `drag`, `layout` and `colors` beside `domAnimation`'s, as a Complete element has. */
|
|
11
|
-
export const domMax:
|
|
10
|
+
export const domMax: typeof ALL = ALL
|
package/src/features/drag.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { DragGesture } from "./keys.ts"
|
|
|
15
15
|
import { gestureLayer } from "./input.ts"
|
|
16
16
|
|
|
17
17
|
/** Drag gestures: `drag`, `dragControls`, the drag callbacks, and what a `Reorder` item drags with. */
|
|
18
|
-
export const drag: Feature<DragGesture, DragGesture["Service"]> = {
|
|
18
|
+
export const drag: Feature<DragGesture, DragGesture["Service"], "drag"> = {
|
|
19
19
|
name: "drag",
|
|
20
20
|
key: DragGesture,
|
|
21
21
|
layer: /*#__PURE__*/ gestureLayer(DragGesture, (source) => ({
|
package/src/features/focus.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { FocusGesture } from "./keys.ts"
|
|
|
10
10
|
import { gestureLayer, withInput } from "./input.ts"
|
|
11
11
|
|
|
12
12
|
/** Focus gestures: `whileFocus`. */
|
|
13
|
-
export const focus: Feature<FocusGesture, FocusGesture["Service"]> = {
|
|
13
|
+
export const focus: Feature<FocusGesture, FocusGesture["Service"], "focus"> = {
|
|
14
14
|
name: "focus",
|
|
15
15
|
key: FocusGesture,
|
|
16
16
|
layer: /*#__PURE__*/ gestureLayer(FocusGesture, (source) => ({ watch: withInput(source, Recognizer.watchFocus) })),
|
package/src/features/hover.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { HoverGesture } from "./keys.ts"
|
|
|
10
10
|
import { gestureLayer, withInput } from "./input.ts"
|
|
11
11
|
|
|
12
12
|
/** Hover gestures: `whileHover` and the hover callbacks. */
|
|
13
|
-
export const hover: Feature<HoverGesture, HoverGesture["Service"]> = {
|
|
13
|
+
export const hover: Feature<HoverGesture, HoverGesture["Service"], "hover"> = {
|
|
14
14
|
name: "hover",
|
|
15
15
|
key: HoverGesture,
|
|
16
16
|
layer: /*#__PURE__*/ gestureLayer(HoverGesture, (source) => ({ watch: withInput(source, Recognizer.watchHover) })),
|
package/src/features/in-view.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { Feature } from "../feature.ts"
|
|
|
10
10
|
import { InViewGesture } from "./keys.ts"
|
|
11
11
|
|
|
12
12
|
/** In-view gestures: `whileInView` and the viewport callbacks. It reads no input: the Probe's intersections. */
|
|
13
|
-
export const inView: Feature<InViewGesture, InViewGesture["Service"]> = {
|
|
13
|
+
export const inView: Feature<InViewGesture, InViewGesture["Service"], "inView"> = {
|
|
14
14
|
name: "inView",
|
|
15
15
|
key: InViewGesture,
|
|
16
16
|
layer: /*#__PURE__*/ Layer.succeed(InViewGesture)({ watch: Recognizer.watchInView }),
|
package/src/features/keys.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Every Feature's key (#548, ADR-0067 *Amendment (#548)*): the services an element's code looks up,
|
|
3
3
|
* apart from the Features themselves, whose Layers bring a gesture's or the colour spaces' code. Every
|
|
4
4
|
* page's elements import these; only a page whose section has a Feature imports its module. The
|
|
5
|
-
* `layout` Feature's key is dom's `ProjectionSystem
|
|
5
|
+
* `layout` Feature's key is dom's `ProjectionSystem`, beside {@link ProjectionNodes}, its element code's.
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
@@ -10,12 +10,14 @@ import type * as DragRecognizer from "@wardic/core/DragRecognizer"
|
|
|
10
10
|
import type * as InputFeed from "@wardic/core/InputFeed"
|
|
11
11
|
import type * as Probe from "@wardic/core/Probe"
|
|
12
12
|
import type * as Recognizer from "@wardic/core/Recognizer"
|
|
13
|
+
import type * as ProjectionSystem from "@wardic/dom/ProjectionSystem"
|
|
13
14
|
import * as Context from "effect/Context"
|
|
14
15
|
import type * as Effect from "effect/Effect"
|
|
15
16
|
import type { LazyArg } from "effect/Function"
|
|
16
17
|
import type * as Scope from "effect/Scope"
|
|
17
18
|
import type { trackConstraintsOf } from "../drag-constraints.ts"
|
|
18
19
|
import type { DragTrack, DragTrackOptions } from "../drag-track.ts"
|
|
20
|
+
import type { CreateProjectionNodeOptions, WardLayout } from "../layout-member.ts"
|
|
19
21
|
import type { WardicServices } from "../runtime.ts"
|
|
20
22
|
|
|
21
23
|
/** The `hover` Feature's service: an element's hover watched, over the gestures' input. */
|
|
@@ -87,3 +89,18 @@ export class DragGesture extends /*#__PURE__*/ Context.Service<
|
|
|
87
89
|
|
|
88
90
|
/** The `colors` Feature's service: that the page reads every CSS colour space. */
|
|
89
91
|
export class Colors extends /*#__PURE__*/ Context.Service<Colors, true>()("@wardic/solid/Colors") {}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The `layout` Feature's element code (#746, ADR-0067 *Amendment (#746)*, decision 9), beside the
|
|
95
|
+
* projection system it builds: what makes a Wardic element's **Projection node**, its options from its
|
|
96
|
+
* config and its registration, so an app without `layout` ships neither.
|
|
97
|
+
*/
|
|
98
|
+
export class ProjectionNodes extends /*#__PURE__*/ Context.Service<
|
|
99
|
+
ProjectionNodes,
|
|
100
|
+
{
|
|
101
|
+
/** A ward's node options, from its config (`layout-member.ts`'s `layoutOptionsOf`). */
|
|
102
|
+
readonly optionsOf: (ward: WardLayout) => CreateProjectionNodeOptions
|
|
103
|
+
/** What its node registers with the projection system (`layout-member.ts`'s `registrationOf`). */
|
|
104
|
+
readonly registrationOf: (opts: CreateProjectionNodeOptions) => ProjectionSystem.RegisterNodeOptions
|
|
105
|
+
}
|
|
106
|
+
>()("@wardic/solid/ProjectionNodes") {}
|
package/src/features/layout.ts
CHANGED
|
@@ -16,19 +16,25 @@ import * as Effect from "effect/Effect"
|
|
|
16
16
|
import * as Layer from "effect/Layer"
|
|
17
17
|
import * as UndefinedOr from "effect/UndefinedOr"
|
|
18
18
|
import type { Feature } from "../feature.ts"
|
|
19
|
-
import {
|
|
19
|
+
import { layoutOptionsOf, registrationOf } from "../layout-member.ts"
|
|
20
|
+
import { ProjectionOptions, projectionIn, projectionNodesIn, type WardicContextValue } from "../runtime.ts"
|
|
21
|
+
import { ProjectionNodes } from "./keys.ts"
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
* Layout animations: a provider's projection system, built once for the provider, over its
|
|
23
25
|
* flush gate and with its reduced motion and scale correctors. Every section with it shares it, as the
|
|
24
26
|
* projection tree is the page's: a `layoutId` pair in two sections still crossfades.
|
|
25
27
|
*/
|
|
26
|
-
export const layout: Feature<ProjectionSystem.ProjectionSystem, ProjectionSystem.Shape> = {
|
|
28
|
+
export const layout: Feature<ProjectionSystem.ProjectionSystem, ProjectionSystem.Shape, "layout"> = {
|
|
27
29
|
name: "layout",
|
|
28
30
|
key: ProjectionSystem.ProjectionSystem,
|
|
29
|
-
// The engine, and what its Reorder controllers hear each Measure pass by, beside it (#618)
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
// The engine, and what its Reorder controllers hear each Measure pass by, beside it (#618); and the
|
|
32
|
+
// code that makes a Wardic element's node on it, here so the base ships none (#746).
|
|
33
|
+
layer: /*#__PURE__*/ Layer.merge(
|
|
34
|
+
/*#__PURE__*/ Layer.effectContext(
|
|
35
|
+
/*#__PURE__*/ Effect.flatMap(FlushGate.FlushGate, (gate) => Effect.flatMap(ProjectionOptions, (options) => DomProjectionSystem.make(gate, options))),
|
|
36
|
+
),
|
|
37
|
+
/*#__PURE__*/ Layer.succeed(ProjectionNodes, { optionsOf: layoutOptionsOf, registrationOf }),
|
|
32
38
|
),
|
|
33
39
|
}
|
|
34
40
|
|
|
@@ -47,6 +53,12 @@ const BRINGS: ReadonlyArray<Feature> = [layout]
|
|
|
47
53
|
export const projectionBrought = (value: WardicContextValue): ProjectionSystem.Shape =>
|
|
48
54
|
UndefinedOr.getOrThrowWith(projectionIn(value.features.build(BRINGS)), () => new Error("useWardicProjection: there is no projection system during a server render (ADR-0021)"))
|
|
49
55
|
|
|
56
|
+
/**
|
|
57
|
+
* The `layout` Feature's element code (#746), brought as {@link projectionBrought} brings the projection
|
|
58
|
+
* system, whose call comes first and gives a server render's error: what `createProjectionNode` registers through.
|
|
59
|
+
*/
|
|
60
|
+
export const projectionNodesBrought = (value: WardicContextValue): ProjectionNodes["Service"] => projectionNodesIn(value.features.build(BRINGS))
|
|
61
|
+
|
|
50
62
|
/** {@link projectionBrought}'s services, all of them: what a Reorder controller is built with (#618). */
|
|
51
63
|
export const layoutBrought = (value: WardicContextValue): Context.Context<LayoutServices> => {
|
|
52
64
|
projectionBrought(value)
|
package/src/features/pan.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { PanGesture } from "./keys.ts"
|
|
|
10
10
|
import { gestureLayer, withInput } from "./input.ts"
|
|
11
11
|
|
|
12
12
|
/** Pan gestures: the pan callbacks. */
|
|
13
|
-
export const pan: Feature<PanGesture, PanGesture["Service"]> = {
|
|
13
|
+
export const pan: Feature<PanGesture, PanGesture["Service"], "pan"> = {
|
|
14
14
|
name: "pan",
|
|
15
15
|
key: PanGesture,
|
|
16
16
|
layer: /*#__PURE__*/ gestureLayer(PanGesture, (source) => ({ watch: withInput(source, DragRecognizer.watchPan) })),
|
package/src/features/press.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { watchPressOn } from "../press.ts"
|
|
|
10
10
|
import { gestureLayer, withInput } from "./input.ts"
|
|
11
11
|
|
|
12
12
|
/** Press gestures, a pointer's and the keyboard's: `whileTap` and the tap callbacks. */
|
|
13
|
-
export const press: Feature<PressGesture, PressGesture["Service"]> = {
|
|
13
|
+
export const press: Feature<PressGesture, PressGesture["Service"], "press"> = {
|
|
14
14
|
name: "press",
|
|
15
15
|
key: PressGesture,
|
|
16
16
|
layer: /*#__PURE__*/ gestureLayer(PressGesture, (source) => ({ watch: withInput(source, watchPressOn) })),
|