@wardic/solid 1.0.0 → 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
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
import * as Bool from "effect/Boolean"
|
|
24
24
|
import * as Effect from "effect/Effect"
|
|
25
25
|
import * as Fiber from "effect/Fiber"
|
|
26
|
-
import { constUndefined, identity } from "effect/Function"
|
|
26
|
+
import { constFalse, constUndefined, identity } from "effect/Function"
|
|
27
27
|
import * as Latch from "effect/Latch"
|
|
28
28
|
import * as Option from "effect/Option"
|
|
29
29
|
import * as Predicate from "effect/Predicate"
|
|
@@ -34,10 +34,10 @@ import type * as Renderer from "@wardic/core/Renderer"
|
|
|
34
34
|
import type * as FlushGate from "@wardic/dom/FlushGate"
|
|
35
35
|
import type * as ProjectionSystem from "@wardic/dom/ProjectionSystem"
|
|
36
36
|
import { type HeadTag, isServer, type JSX, useHead } from "@solidjs/web"
|
|
37
|
-
import { createContext, DEV, flush, isHydrating, onCleanup, onSettled, runWithOwner, untrack, useContext } from "solid-js"
|
|
37
|
+
import { createContext, DEV, flush, getOwner, isHydrating, onCleanup, onSettled, runWithOwner, untrack, useContext } from "solid-js"
|
|
38
38
|
import * as Context from "effect/Context"
|
|
39
39
|
import * as Report from "@wardic/dom/Report"
|
|
40
|
-
import { type Feature, type FeatureRegistry, type FeatureSection, type FeaturesProp, ROOT, strictMessage } from "../../feature.ts"
|
|
40
|
+
import { type Feature, type FeatureRegistry, type FeatureSection, type FeaturesProp, type ElementFeatures, type InstanceFeatures, joinSections, type Own, ROOT, strictMessage } from "../../feature.ts"
|
|
41
41
|
import { FeatureSectionContext, sectionUnder, useLazySection } from "./feature-section.ts"
|
|
42
42
|
import { explainerOf, type ServerAppear, serverAppear } from "../../appear.ts"
|
|
43
43
|
import {
|
|
@@ -56,7 +56,9 @@ import {
|
|
|
56
56
|
type WardicServices,
|
|
57
57
|
whenIdle,
|
|
58
58
|
} from "../../runtime.ts"
|
|
59
|
-
import {
|
|
59
|
+
import { WAITING_ENV_FIX, WAITING_ENV_LINE } from "../../messages.ts"
|
|
60
|
+
import { warnWithoutSpans } from "../../spans-check.ts"
|
|
61
|
+
import { onSettledClientOnly, reactivityIn } from "./solid-reactivity.ts"
|
|
60
62
|
import { useWardicConfig } from "./wardic-config.tsx"
|
|
61
63
|
import { skipAnimationsOf } from "../../wardic-config-value.ts"
|
|
62
64
|
import { instantLayoutOf, type InstantTransition, instantTransitionOf, resetOf } from "../../instant.ts"
|
|
@@ -77,15 +79,27 @@ const WardicContext = createContext<WardicContextValue | null>(null)
|
|
|
77
79
|
/** The nearest provider's value, `undefined` outside one. */
|
|
78
80
|
const contextValue = (): WardicContextValue | undefined => Option.getOrUndefined(Option.fromNullishOr(useContext(WardicContext)))
|
|
79
81
|
|
|
82
|
+
/**
|
|
83
|
+
* What a client provider fails with when its `env` waits as it builds (#746, ADR-0067 *Amendment
|
|
84
|
+
* (#746)*, decision 7): the fix in development, under Solid's `DEV`, and one line in a production
|
|
85
|
+
* build. A server render always gives the fix: Solid 1's server build has no `DEV`, and a client build
|
|
86
|
+
* drops the server's branch.
|
|
87
|
+
*/
|
|
88
|
+
const waitingEnvMessage = (): string => {
|
|
89
|
+
if (DEV) return WAITING_ENV_FIX
|
|
90
|
+
return WAITING_ENV_LINE
|
|
91
|
+
}
|
|
92
|
+
|
|
80
93
|
/**
|
|
81
94
|
* A provider's context: a server render's, inert, or the client's. Decided by a plain `if`: a client
|
|
82
95
|
* build folds `isServer` and drops the server render's code, where `Bool.match` kept it (#518: 8.4 KB
|
|
83
96
|
* gzipped in every Solid 2 app). `env` and `appear` are read once, as the provider's docs say.
|
|
84
97
|
*/
|
|
85
98
|
const contextOf = (given: Parameters<typeof WardicProvider>[0]): WardicContextValue => {
|
|
86
|
-
if (isServer) return serverContext(given.env, serverAppearOf(given.appear, given.reducedMotion, given.nonce), () => untrack(() => given.reducedMotion))
|
|
99
|
+
if (isServer) return serverContext(given.env, WAITING_ENV_FIX, serverAppearOf(given.appear, given.reducedMotion, given.nonce), () => untrack(() => given.reducedMotion))
|
|
87
100
|
return clientContext(
|
|
88
101
|
given.env,
|
|
102
|
+
waitingEnvMessage(),
|
|
89
103
|
applyAndFlush,
|
|
90
104
|
() => untrack(() => given.reducedMotion),
|
|
91
105
|
// The provider's setting, tracked too: `createReducedMotionConfig` reads it where it tracks (#584).
|
|
@@ -108,7 +122,10 @@ const contextOf = (given: Parameters<typeof WardicProvider>[0]): WardicContextVa
|
|
|
108
122
|
// unmount, inert during a server render (ADR-0021). reducedMotion is read as each animation starts
|
|
109
123
|
// (ADR-0029), a WardicConfig's over it (#434); appear (ADR-0044, #585) on the server once.
|
|
110
124
|
export function WardicProvider(props: {
|
|
111
|
-
/**
|
|
125
|
+
/**
|
|
126
|
+
* The Environment Wardic runs in: `DomLive` in a browser, from `@wardic/dom`, with Effect's own Layers merged beside it, and
|
|
127
|
+
* `WardicSpans` for Wardic's spans. Read once, and built at once: a Layer that waits as it builds fails it.
|
|
128
|
+
*/
|
|
112
129
|
readonly env: WardicEnv
|
|
113
130
|
/**
|
|
114
131
|
* How animations honour the visitor's reduced-motion setting: `"user"` follows it (the default),
|
|
@@ -162,7 +179,15 @@ export function WardicProvider(props: {
|
|
|
162
179
|
// element mounted after pays none of it. One mounted before then builds it itself, as before. Asked
|
|
163
180
|
// for here, with no computation of the provider's own (an `onSettled`'s would shift a hydration's
|
|
164
181
|
// owners from the server's), and on the client alone.
|
|
165
|
-
if (!isServer)
|
|
182
|
+
if (!isServer) {
|
|
183
|
+
onCleanup(
|
|
184
|
+
whenIdle(() => {
|
|
185
|
+
prepareIdle(value, section)
|
|
186
|
+
// A tracer that reads no Wardic span, development's word (#746).
|
|
187
|
+
if (DEV) warnWithoutSpans(value.runtime)
|
|
188
|
+
}),
|
|
189
|
+
)
|
|
190
|
+
}
|
|
166
191
|
return <WardicContext value={value}>{props.children}</WardicContext>
|
|
167
192
|
}
|
|
168
193
|
|
|
@@ -226,15 +251,46 @@ export function LazyWardic(props: {
|
|
|
226
251
|
* one (`brings`), built at once. A Complete element under a `strict` section is an error in
|
|
227
252
|
* development. Internal.
|
|
228
253
|
*/
|
|
229
|
-
export function useElementFeatures(
|
|
254
|
+
export function useElementFeatures(internal: ElementFeatures): FeatureSection {
|
|
255
|
+
const { brings, instance } = internal
|
|
256
|
+
const complete = internal.complete === true
|
|
230
257
|
const section = useFeatureSection()
|
|
231
258
|
if (DEV && complete && section.strict) throw new Error(strictMessage("wardic.*, wardic.create, ward()", "w.*, w.create, w.ward()"))
|
|
259
|
+
// A Wardic instance's element (#516): its instance's Features, given at once or loaded, beside its section's.
|
|
260
|
+
if (Predicate.isNotUndefined(instance)) return joinSections(section, useInstanceFeatures(instance))
|
|
232
261
|
if (Predicate.isUndefined(brings)) return section
|
|
233
262
|
const registry = useFeatureRegistry()
|
|
234
263
|
// A Complete element has every Feature, whatever its section has: one section per provider.
|
|
235
264
|
if (complete) return registry.section(brings)
|
|
236
265
|
const own = registry.build(brings)
|
|
237
|
-
return { services: () =>
|
|
266
|
+
return joinSections(section, { services: () => own, pending: constFalse })
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* A Wardic instance's Features in this provider (#516), one per instance (`InstanceFeatures.own`): what's
|
|
271
|
+
* given built on first need, each load started the first time it's asked for, on the client. Internal.
|
|
272
|
+
*/
|
|
273
|
+
export function useInstanceFeatures(instance: InstanceFeatures): Own {
|
|
274
|
+
return fromContext(contextValue(), "createWardic", (value) =>
|
|
275
|
+
instance.own(value.features, {
|
|
276
|
+
reactivity: reactivityIn(getOwner()),
|
|
277
|
+
server: isServer,
|
|
278
|
+
report: (cause) => {
|
|
279
|
+
value.runtime.runFork(Report.failure("wardic.createWardic: a lazy load of Features failed", cause))
|
|
280
|
+
},
|
|
281
|
+
}),
|
|
282
|
+
)
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* A Wardic instance's Features brought by one of its hooks (#516, Q13): in a provider, what's given is
|
|
287
|
+
* built and its loads start, as at its first element's mount, so its layout hooks bring `layout`.
|
|
288
|
+
* Outside one, nothing. Internal.
|
|
289
|
+
*/
|
|
290
|
+
export function useInstanceBrought(instance: InstanceFeatures): void {
|
|
291
|
+
if (Predicate.isUndefined(contextValue())) return
|
|
292
|
+
const own = useInstanceFeatures(instance)
|
|
293
|
+
untrack(() => own.services())
|
|
238
294
|
}
|
|
239
295
|
|
|
240
296
|
/** The provider's Features (#511). Internal. */
|
|
@@ -77,7 +77,7 @@ import { CLIENT_ONLY, CLIENT_ONLY_DEFERRED } from "./solid-reactivity.ts"
|
|
|
77
77
|
import { eachOf, neverLands, NO_EVENTS, serverWhen, Waiters, whenOf } from "./waiters.ts"
|
|
78
78
|
import { BatchGroup, BatchItem } from "./batch-reorder-group.tsx"
|
|
79
79
|
|
|
80
|
-
export type { ReorderBatchGap, ReorderBatchGroup, ReorderBatchGroupProps, ReorderBatchItemProps, ReorderBatchItemSize } from "./batch-reorder-group.tsx"
|
|
80
|
+
export type { ReorderBatchColumnSize, ReorderBatchGap, ReorderBatchGroup, ReorderBatchGroupProps, ReorderBatchItemProps, ReorderBatchItemSize, ReorderBatchSizing } from "./batch-reorder-group.tsx"
|
|
81
81
|
|
|
82
82
|
/** A Reorder group's config, each key read as a value. */
|
|
83
83
|
export interface ReorderGroupConfigValues<V> {
|
|
@@ -675,7 +675,12 @@ type ItemMotionProps = Omit<WardicMotionProps, "layout" | "layoutId" | "drag">
|
|
|
675
675
|
*/
|
|
676
676
|
// #349, #398.
|
|
677
677
|
export type ReorderItemOf<V, C = {}> =
|
|
678
|
-
| (ItemMotionProps & {
|
|
678
|
+
| (ItemMotionProps & {
|
|
679
|
+
/** Its value in the group's `values`, of any type, not its element's `value` attribute. Read once. */
|
|
680
|
+
readonly value: V
|
|
681
|
+
readonly layout?: ReorderItemLayout
|
|
682
|
+
readonly wardRef?: WardRefCallback | undefined
|
|
683
|
+
})
|
|
679
684
|
| (WardicBeside<C, ItemMotionProps> & {
|
|
680
685
|
readonly wardRef: AnyReorderItem<V> & GivenWard<C>
|
|
681
686
|
readonly value?: never
|
|
@@ -686,12 +691,12 @@ export type ReorderItemOf<V, C = {}> =
|
|
|
686
691
|
|
|
687
692
|
/**
|
|
688
693
|
* `Reorder.Item`'s props: its item ({@link ReorderItemOf}), `as`, the element it renders (`"li"` by
|
|
689
|
-
* default, read once), and that element's own props.
|
|
694
|
+
* default, read once), and that element's own props, but its `value` attribute: `value` is the item's (#748).
|
|
690
695
|
*/
|
|
691
696
|
export type ReorderItemComponentProps<V, Tag extends ReorderElementTag = "li", C = {}> =
|
|
692
697
|
& ReorderItemOf<V, C>
|
|
693
698
|
& { readonly as?: Tag }
|
|
694
|
-
& Omit<JSX.IntrinsicElements[Tag], "style">
|
|
699
|
+
& Omit<JSX.IntrinsicElements[Tag], "style" | "value">
|
|
695
700
|
& { readonly style?: WardStyle | string | undefined }
|
|
696
701
|
|
|
697
702
|
/**
|
package/src/unstable/v2/w.tsx
CHANGED
|
@@ -15,27 +15,63 @@
|
|
|
15
15
|
* @module
|
|
16
16
|
*/
|
|
17
17
|
import type { JSX } from "@solidjs/web"
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
18
|
+
import type { AbsentGroupsOf, EveryFeature, NamesEvery, PropFeatureNames } from "../../feature.ts"
|
|
19
|
+
import type { WardCheckedConfig } from "../../ward-keys.ts"
|
|
20
|
+
import type { PerKeyApart } from "./config-view.ts"
|
|
21
|
+
import { createOf, type CreateFor, type FeatureProps, formOf, type OwnPropsFor, type WardicComponentFor } from "./element.tsx"
|
|
22
|
+
import { internalsOf, SLIM, type Ward, type WardCallbackKey, type WardChecked, type WardConfig, type WardFor, type WardInternals, wardWith, type WardOptions, type WardStyle } from "./ward.tsx"
|
|
21
23
|
|
|
22
24
|
/** `w.ward(config, options)`: `ward()`'s ward, on a Slim element. */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (Predicate.isUndefined(config)) return wardWith(NO_CONFIG, internalsOf(options, SLIM))
|
|
28
|
-
return wardWith(config, internalsOf(options, SLIM))
|
|
25
|
+
interface SlimWard {
|
|
26
|
+
<const C extends WardConfig>(config: WardChecked<C>, options?: WardOptions): Ward<C>
|
|
27
|
+
(): Ward<{}>
|
|
28
|
+
(config: undefined, options: WardOptions): Ward<{}>
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/** No config: a ward that only listens (#398), `w.ward()`. */
|
|
32
32
|
const NO_CONFIG: WardConfig = {}
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
/** A ward on an element of `kind`, as `w.ward` makes one. */
|
|
35
|
+
const wardOf =
|
|
36
|
+
(kind: WardInternals) =>
|
|
37
|
+
(config: WardConfig = NO_CONFIG, options?: WardOptions): Ward =>
|
|
38
|
+
wardWith(config, internalsOf(options, kind))
|
|
39
|
+
|
|
40
|
+
/** Every form of a `w` whose elements are of `kind` (#516): the Slim element's `w`, and a Wardic instance's. */
|
|
41
|
+
export const wOf = (kind: WardInternals): W => formOf<W>(createOf(kind), { ward: wardOf(kind) })
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The type of `w`: `w.create`, `w.ward`, and `w.<tag>`, a Slim element's component for that element (one
|
|
45
|
+
* per tag). `W<F>` is a Wardic instance's `w`, whose elements and wards take only Features `F`'s props,
|
|
46
|
+
* and whose wards hear only their events.
|
|
47
|
+
*
|
|
48
|
+
* @see https://wardic.dev/reference/solid/elements/wardic-instance
|
|
49
|
+
*/
|
|
50
|
+
// `F`: #516, ADR-0067 *Amendment (#516)*.
|
|
51
|
+
export type W<F = EveryFeature> = WFor<PropFeatureNames<F>>
|
|
52
|
+
|
|
53
|
+
/** {@link W} for the Features named `FN` (#516). */
|
|
54
|
+
type WFor<FN extends string> = { readonly create: CreateFor<FN>; readonly ward: MakeWardFor<FN> } & {
|
|
55
|
+
readonly [Tag in keyof JSX.IntrinsicElements]: WardicComponentFor<Tag, FN>
|
|
37
56
|
}
|
|
38
57
|
|
|
58
|
+
/** `w.ward` for the Features named `FN` (#516): the Slim element's with every one; else a Wardic instance's. */
|
|
59
|
+
type MakeWardFor<FN extends string> = NamesEvery<FeatureProps, FN> extends true ? SlimWard : MakeInstanceWard<FN>
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* A Wardic instance's `w.ward` (#516), its Features named `FN`: its config takes their props alone, every
|
|
63
|
+
* other Feature's `NeedsFeature<"name">`, and a key no ward takes `NotAWardKey` (#756). Its ward hears
|
|
64
|
+
* `settled` and their events alone (Q19).
|
|
65
|
+
*/
|
|
66
|
+
interface MakeInstanceWard<FN extends string> {
|
|
67
|
+
<const C extends WardConfig>(config: WardCheckedConfig<C, PerKeyApart<InstanceValues<FN>, WardCallbackKey & keyof InstanceValues<FN>>>, options?: WardOptions): WardFor<C, FN>
|
|
68
|
+
(): WardFor<{}, FN>
|
|
69
|
+
(config: undefined, options: WardOptions): WardFor<{}, FN>
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** A Wardic instance's ward config values, its Features named `FN`: theirs, `style`, and every other Feature's `NeedsFeature`. */
|
|
73
|
+
type InstanceValues<FN extends string> = OwnPropsFor<FN> & AbsentGroupsOf<FeatureProps, FN> & { readonly style?: WardStyle | string | undefined }
|
|
74
|
+
|
|
39
75
|
/**
|
|
40
76
|
* The Slim element: `w.div`, `w.button` and every other tag, each taking the element's own props and
|
|
41
77
|
* Wardic's motion props. It has the Features its `WardicProvider` and any `LazyWardic` above it give.
|
|
@@ -46,4 +82,4 @@ export type W = { readonly create: Create; readonly ward: typeof slimWard } & {
|
|
|
46
82
|
* @see https://wardic.dev/reference/solid/elements/w
|
|
47
83
|
*/
|
|
48
84
|
// Every form of the Slim element, as `wardic`'s and `ward()` are of the Complete one (ADR-0067).
|
|
49
|
-
export const w: W =
|
|
85
|
+
export const w: W = wOf(SLIM)
|
package/src/unstable/v2/ward.tsx
CHANGED
|
@@ -93,12 +93,11 @@ import * as OwnerScope from "../../owner-scope.ts"
|
|
|
93
93
|
|
|
94
94
|
import { GESTURE_WORDS, serviceIn } from "../../gesture-features.ts"
|
|
95
95
|
import { inViewOptionsOf } from "../../gesture-callbacks.ts"
|
|
96
|
-
import { projectionIn, type WardicServices } from "../../runtime.ts"
|
|
96
|
+
import { projectionIn, projectionNodesIn, type WardicRuntime, type WardicServices } from "../../runtime.ts"
|
|
97
97
|
import type { WardCheckedConfig, WardKey, WardValueOf } from "../../ward-keys.ts"
|
|
98
98
|
import { createElementStyle } from "../../element-style.ts"
|
|
99
99
|
import { createLiveStyle, type LiveSource, readLive, serverRegistryOf, split } from "../../live-style.ts"
|
|
100
100
|
import { dragTransitionOf } from "../../drag-transition.ts"
|
|
101
|
-
import { layoutOptionsOf, registrationOf, wantsLayoutNode } from "../../layout-member.ts"
|
|
102
101
|
import { useLayoutGroupId } from "./layout.tsx"
|
|
103
102
|
import { registerAnimatable } from "../../imperative.ts"
|
|
104
103
|
import { type ControlsChange, controlledConfigOf, controlledElement, isAnimationControls, subscribe, uncontrolledOf, type WardicAnimationControls } from "../../animation-controls.ts"
|
|
@@ -137,6 +136,8 @@ import {
|
|
|
137
136
|
sameResolution,
|
|
138
137
|
serverStartingStyle,
|
|
139
138
|
snapshotOf,
|
|
139
|
+
SPINE_DIAGNOSTICS,
|
|
140
|
+
type SpineDiagnostics,
|
|
140
141
|
startLinksOf,
|
|
141
142
|
startOf,
|
|
142
143
|
warnDroppedTransform,
|
|
@@ -158,12 +159,12 @@ import {
|
|
|
158
159
|
useElementFeatures,
|
|
159
160
|
useFeatureRegistry,
|
|
160
161
|
} from "./provider.tsx"
|
|
161
|
-
import { type Feature, type FeatureRegistry, type FeatureSection, LAYOUT_PROPS, missingMessage, unreadColorIn } from "../../feature.ts"
|
|
162
|
+
import { type EveryFeature, type Feature, type FeatureRegistry, type FeatureSection, type InstanceFeatures, LAYOUT_PROPS, missingMessage, type PropFeatureNames, unreadColorIn, wantsLayoutNode } from "../../feature.ts"
|
|
162
163
|
import { CLIENT_ONLY, CLIENT_ONLY_DEFERRED, CLIENT_ONLY_SYNC, CLIENT_ONLY_SYNC_DEFERRED, reactivityIn } from "./solid-reactivity.ts"
|
|
163
164
|
import { useWardicConfig } from "./wardic-config.tsx"
|
|
164
165
|
import { pointMapOptionOf, transformPagePointOf } from "../../wardic-config-value.ts"
|
|
165
166
|
import { configView, type Fixed, type PerKey, type PerKeyApart } from "./config-view.ts"
|
|
166
|
-
import { Lifecycle, type WardEvent, type WardEvents, type WardPressInfo, type WardSettled } from "./lifecycle.ts"
|
|
167
|
+
import { type EventNeeds, Lifecycle, type WardEvent, type WardEvents, type WardPressInfo, type WardSettled } from "./lifecycle.ts"
|
|
167
168
|
import { neverLands, NO_EVENTS, serverWhen } from "./waiters.ts"
|
|
168
169
|
import { usePresenceContext } from "./presence.tsx"
|
|
169
170
|
import { createVariantNode, useVariantContext, type VariantNode, WardicVariantContext } from "./variant-node.ts"
|
|
@@ -193,7 +194,7 @@ export interface WardConfigValues extends Omit<SharedWardConfig, SolidOneCallbac
|
|
|
193
194
|
* `dragConstraints`' function is its container's accessor (#273), read at each measure; a
|
|
194
195
|
* `transformTemplate` is called by the renderer (#443).
|
|
195
196
|
*/
|
|
196
|
-
type WardCallbackKey = "onUpdate" | "dragConstraints" | "onMeasureDragConstraints" | "transformTemplate" | "onBeforeLayoutMeasure" | "onLayoutMeasure"
|
|
197
|
+
export type WardCallbackKey = "onUpdate" | "dragConstraints" | "onMeasureDragConstraints" | "transformTemplate" | "onBeforeLayoutMeasure" | "onLayoutMeasure"
|
|
197
198
|
|
|
198
199
|
/**
|
|
199
200
|
* A ward's config: each key a value, or an accessor of it, read per key. A getter,
|
|
@@ -454,8 +455,19 @@ export interface WardOptions {
|
|
|
454
455
|
/**
|
|
455
456
|
* One element's motion binding: a ref carrying its props (see the module). Spread it, give it to
|
|
456
457
|
* `ref` (alone, or in an array with your own), or give it to a Wardic component's `wardRef`.
|
|
458
|
+
* `Ward<C, F>` is a Wardic instance's ward, with Features `F`: it hears `settled` and their events alone.
|
|
457
459
|
*/
|
|
458
|
-
|
|
460
|
+
// `F` (#516, Q19): its default, every Feature, gives the ward as it was ({@link WardFor}).
|
|
461
|
+
export type Ward<C extends WardConfig = WardConfig, F = EveryFeature> = WardFor<C, PropFeatureNames<F>>
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* A {@link Ward} whose Features are named `FN` (#516): its `next`, `each` and `when` take `settled` and
|
|
465
|
+
* their events alone, another Feature's event meeting `NeedsFeature<"name">` ({@link EventNeeds}).
|
|
466
|
+
*/
|
|
467
|
+
// They're methods, not function-typed properties: TS compares a method's parameters both ways, so a
|
|
468
|
+
// Wardic instance's ward, which hears fewer events, is still a `Ward` (an `Array<Ward>`, a helper's
|
|
469
|
+
// `(card: Ward) => …`). With every Feature, `EventNeeds` is `unknown`, and each takes every event.
|
|
470
|
+
export interface WardFor<C extends WardConfig, FN extends string> extends WardProps, AnyWard {
|
|
459
471
|
/** Mounts the ward on `element`: Solid calls it as a ref. */
|
|
460
472
|
(element: HTMLElement): void
|
|
461
473
|
/**
|
|
@@ -521,7 +533,7 @@ export interface Ward<C extends WardConfig = WardConfig> extends WardProps, AnyW
|
|
|
521
533
|
* A gesture's event starts its recognizer, if its `while*` hasn't. Rejected with a
|
|
522
534
|
* `DOMException` named `"AbortError"` once the ward is disposed.
|
|
523
535
|
*/
|
|
524
|
-
|
|
536
|
+
next<E extends WardEvent>(name: E & EventNeeds<E, FN>): Promise<WardEvents[E]>
|
|
525
537
|
/**
|
|
526
538
|
* Every `name` from the call on, as an async iterable, for a `for await`: each step waits as
|
|
527
539
|
* `next(name)` does, so one that comes while its body runs is missed; the loop ends once the ward is
|
|
@@ -529,7 +541,7 @@ export interface Ward<C extends WardConfig = WardConfig> extends WardProps, AnyW
|
|
|
529
541
|
* `each` misses one between its steps, and on a page rendered on the server it needs
|
|
530
542
|
* `ssrSource: "client"` and a `<Loading>`.
|
|
531
543
|
*/
|
|
532
|
-
|
|
544
|
+
each<E extends WardEvent>(name: E & EventNeeds<E, FN>): AsyncIterable<WardEvents[E]>
|
|
533
545
|
/**
|
|
534
546
|
* Every `name`, as a memo for an effect: pending until the first, so the effect runs at each
|
|
535
547
|
* one and never before, typed as the event, on any page (no `ssrSource`, no `<Loading>`). It hears
|
|
@@ -546,7 +558,7 @@ export interface Ward<C extends WardConfig = WardConfig> extends WardProps, AnyW
|
|
|
546
558
|
* })
|
|
547
559
|
* ```
|
|
548
560
|
*/
|
|
549
|
-
|
|
561
|
+
when<E extends WardEvent>(name: E & EventNeeds<E, FN>): Accessor<WardEvents[E]>
|
|
550
562
|
/**
|
|
551
563
|
* The ward's props with the element's own (the Solid 1 ward's `ward({ ref, style })`): its
|
|
552
564
|
* `ref` called beside the ward's, and its `style` over the config's, key by key. For a style made
|
|
@@ -623,6 +635,8 @@ export interface WardInternals {
|
|
|
623
635
|
readonly share?: WardShare | undefined
|
|
624
636
|
/** The Features it brings beside its section's (#511): a Complete element's every one. None for a Slim element. */
|
|
625
637
|
readonly brings?: ReadonlyArray<Feature> | undefined
|
|
638
|
+
/** A Wardic instance's Features (#516): its element brings them, given at once or loaded, beside its section's. */
|
|
639
|
+
readonly instance?: InstanceFeatures | undefined
|
|
626
640
|
/** Whether it's a **Complete element** (#511): an error in development under a `strict` section. */
|
|
627
641
|
readonly complete?: boolean | undefined
|
|
628
642
|
}
|
|
@@ -725,6 +739,21 @@ const isElement = (value: unknown): value is HTMLElement => Predicate.hasPropert
|
|
|
725
739
|
/** A context value as Solid 2's context takes it: `null` for none. */
|
|
726
740
|
const contextOf = (value: WardicVariantContextValue | undefined): WardicVariantContextValue | null => Option.getOrNull(Option.fromUndefinedOr(value))
|
|
727
741
|
|
|
742
|
+
/**
|
|
743
|
+
* Development's diagnostics for the spine (#746, ADR-0067 *Amendment (#746)*, decision 6): given under
|
|
744
|
+
* Solid's `DEV` alone, so a production build ships none of their code.
|
|
745
|
+
*/
|
|
746
|
+
const devSpineDiagnostics = (): SpineDiagnostics | undefined => {
|
|
747
|
+
if (DEV) return SPINE_DIAGNOSTICS
|
|
748
|
+
return undefined
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/** In development alone (#746), what warns once that a `transform` string gave way to `style`'s transform keys. */
|
|
752
|
+
const droppedTransformWarning = (runtime: WardicRuntime, id: string): (() => void) | undefined => {
|
|
753
|
+
if (DEV) return () => warnDroppedTransform(runtime, id)
|
|
754
|
+
return undefined
|
|
755
|
+
}
|
|
756
|
+
|
|
728
757
|
/**
|
|
729
758
|
* Says, once per provider, that a colour of the element's needs the `colors` Feature (#511, ADR-0067
|
|
730
759
|
* decision 7): a value naming a wide-gamut space, while the page reads none, outside a lazy load.
|
|
@@ -922,7 +951,7 @@ export function wardWith(config: WardConfig, internal: WardInternals): Ward {
|
|
|
922
951
|
const runtime = useWardicRuntime()
|
|
923
952
|
// Its Features (#511, ADR-0067), a Complete element's every one: what they register, a server
|
|
924
953
|
// render's elements read too (the `colors` Feature's spaces).
|
|
925
|
-
const features = useElementFeatures(internal
|
|
954
|
+
const features = useElementFeatures(internal)
|
|
926
955
|
// A server render takes the lean path: the Starting style only, no spine (ADR-0021).
|
|
927
956
|
if (isServer) return serverWard(config, internal)
|
|
928
957
|
const gate = useWardicGate()
|
|
@@ -999,7 +1028,7 @@ export function wardWith(config: WardConfig, internal: WardInternals): Ward {
|
|
|
999
1028
|
const dragDefaults = dragDefaultsOf(initialConfig, internal)
|
|
1000
1029
|
|
|
1001
1030
|
// Its routed `style` keys (#130, ADR-0043), and its `style`, switched by the gate's hooks.
|
|
1002
|
-
const live = createLiveStyle({ registry: registryOf(runtime), onDroppedTransform: (
|
|
1031
|
+
const live = createLiveStyle({ registry: registryOf(runtime), onDroppedTransform: droppedTransformWarning(runtime, id), reactivity })
|
|
1003
1032
|
const projectStarting = Bool.match(hydrating, { onTrue: () => DomRenderer.project, onFalse: () => project })
|
|
1004
1033
|
// The element's style (#264): the config's, with the latest `.with()` style over it, key by key.
|
|
1005
1034
|
// `.with()` runs in the spread's computation, an owned scope: it tells `read(key)` through a
|
|
@@ -1390,13 +1419,16 @@ export function wardWith(config: WardConfig, internal: WardInternals): Ward {
|
|
|
1390
1419
|
let arriveLayout: ((projection: ProjectionSystem.Shape) => void) | undefined
|
|
1391
1420
|
if (wantsNode) {
|
|
1392
1421
|
// `takenNow`: where a child that takes over from a leaver starts, at its mount only (#286).
|
|
1422
|
+
// Made by the `layout` Feature's code (#746), read from its section's Features, which have `layout`
|
|
1423
|
+
// once they have `projection`.
|
|
1393
1424
|
const layoutNodeOn = (projection: ProjectionSystem.Shape, takenNow: PresenceSeed | undefined): void => {
|
|
1425
|
+
const nodes = projectionNodesIn(untrack(features.services))
|
|
1394
1426
|
const started = (): void => lifecycle.layoutStarted()
|
|
1395
1427
|
const completed = (): void => lifecycle.layoutCompleted()
|
|
1396
1428
|
const released = (): void => lifecycle.released()
|
|
1397
1429
|
const handle = projection.register(
|
|
1398
|
-
registrationOf({
|
|
1399
|
-
...
|
|
1430
|
+
nodes.registrationOf({
|
|
1431
|
+
...nodes.optionsOf({
|
|
1400
1432
|
id,
|
|
1401
1433
|
element: el,
|
|
1402
1434
|
config: configNow,
|
|
@@ -1519,12 +1551,15 @@ export function wardWith(config: WardConfig, internal: WardInternals): Ward {
|
|
|
1519
1551
|
links,
|
|
1520
1552
|
styleNow,
|
|
1521
1553
|
live,
|
|
1554
|
+
// Every Feature its provider has built: where its spine finds its Timeline values (#240).
|
|
1555
|
+
builtFeatures: featureRegistry.built,
|
|
1522
1556
|
presence: presenceRecord,
|
|
1523
1557
|
projected: Predicate.isNotUndefined(layout),
|
|
1524
1558
|
dragAxis,
|
|
1525
1559
|
drag: dragTrack,
|
|
1526
1560
|
handoff,
|
|
1527
1561
|
animation: lifecycle,
|
|
1562
|
+
diagnostics: devSpineDiagnostics(),
|
|
1528
1563
|
}
|
|
1529
1564
|
// A `drag` on its way as it mounted (#551): its track starts as the Feature arrives (`startDrag`),
|
|
1530
1565
|
// and the spine reads it at each Retarget from then on. Only then is `drag` a getter, so an
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A **Wardic instance**'s types on Solid 2 (#516, ADR-0067 *Amendment (#516)*): what
|
|
3
|
+
* `createWardic(features)` returns, its `w` and its wards typed to those Features.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import type { LayoutHooksFor, NamesEvery, PropFeatureNames } from "../../feature.ts"
|
|
8
|
+
import type { WardicMotionPropsV2 } from "../../motion-props.ts"
|
|
9
|
+
import type { FeatureProps, OwnPropsFor } from "./element.tsx"
|
|
10
|
+
import type { createInstantLayoutTransition, createResetProjection, useAnimateLayout } from "./provider.tsx"
|
|
11
|
+
import type { W } from "./w.tsx"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* What `createWardic(features)` returns for Features `F`: a `w` whose elements bring them wherever they
|
|
15
|
+
* render, and take their props alone; a ward from its `w.ward()`, or one its element hands to
|
|
16
|
+
* `wardRef`, hears `settled` and their events alone. A prop or an event of a Feature `F` lacks is
|
|
17
|
+
* typed `NeedsFeature<"name">`, so giving it is a type error that names the Feature. With `layout`,
|
|
18
|
+
* given at once or loaded, it has the layout hooks too. Its `w.li` below takes `layout` and
|
|
19
|
+
* `whileHover`; `<w.li drag />` would be an error naming `drag`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* export const { w } = createWardic([domAnimation, layout])
|
|
23
|
+
*
|
|
24
|
+
* <w.li layout whileHover={{ scale: 1.05 }} />
|
|
25
|
+
* @see https://wardic.dev/reference/solid/elements/wardic-instance
|
|
26
|
+
*/
|
|
27
|
+
// ADR-0067 *Amendment (#516)*: decisions 2 (elements bring their Features), 5 (the layout hooks bring
|
|
28
|
+
// `layout`), 7 (loads), 10 (NeedsFeature, and the events, Q19).
|
|
29
|
+
export type WardicInstance<F> = { readonly w: W<F> } & LayoutHooksFor<PropFeatureNames<F>, LayoutHooks>
|
|
30
|
+
|
|
31
|
+
/** The layout hooks a Wardic instance with `layout` has, typed as the binding's own. */
|
|
32
|
+
interface LayoutHooks {
|
|
33
|
+
readonly useAnimateLayout: typeof useAnimateLayout
|
|
34
|
+
readonly createInstantLayoutTransition: typeof createInstantLayoutTransition
|
|
35
|
+
readonly createResetProjection: typeof createResetProjection
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The motion props of a Wardic instance with Features `F`: the base props and its Features', for a
|
|
40
|
+
* component that hands them on, to the instance's elements or to any with more Features. Another
|
|
41
|
+
* Feature's prop isn't one of them, so giving it is a type error, though not one that names the
|
|
42
|
+
* Feature. With every Feature, it's `WardicMotionProps`.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* const Card = (props: WardConfigOf<typeof domAnimation> & { title: string }) => <w.article {...props}>{props.title}</w.article>
|
|
46
|
+
* @see https://wardic.dev/reference/solid/elements/wardic-instance
|
|
47
|
+
*/
|
|
48
|
+
// #516. No `NeedsFeature` here: no element that has a Feature takes its brand, so a wrapper's props
|
|
49
|
+
// with them would fit none with more Features than `F`.
|
|
50
|
+
export type WardConfigOf<F> = NamesEvery<FeatureProps, PropFeatureNames<F>> extends true ? WardicMotionPropsV2 : OwnPropsFor<PropFeatureNames<F>>
|
package/src/w.tsx
CHANGED
|
@@ -18,32 +18,49 @@ import type { Accessor, JSX } from "solid-js"
|
|
|
18
18
|
import type { WardConfig, WardicVariantLabels } from "./config.ts"
|
|
19
19
|
import { createWardWith, type SpineInternals, type Ward } from "./create-ward.tsx"
|
|
20
20
|
import { runDirective } from "./directive.tsx"
|
|
21
|
-
import { type
|
|
22
|
-
import type {
|
|
21
|
+
import { createOf, type CreateFor, formOf, type InferredPropsFor, type WardicComponentFor } from "./element.tsx"
|
|
22
|
+
import type { EveryFeature, PropFeatureNames } from "./feature.ts"
|
|
23
|
+
import type { TargetKey } from "./ward-keys.ts"
|
|
23
24
|
|
|
24
25
|
/** What a Slim element tells the spine: it brings no Feature of its own. */
|
|
25
26
|
const SLIM: SpineInternals = {}
|
|
26
27
|
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/** `w.createWard(config)`: `createWard`'s Ward on a Slim element. */
|
|
31
|
-
function createSlimWard<
|
|
28
|
+
/** A Wardic instance's `w.createWard` (#516), its Features named `FN`: its config typed to their props alone. */
|
|
29
|
+
type CreateWardFor<FN extends string> = <
|
|
32
30
|
K extends TargetKey = never,
|
|
33
31
|
N extends string = never,
|
|
34
32
|
LI extends WardicVariantLabels = never,
|
|
35
33
|
LA extends WardicVariantLabels = never,
|
|
36
34
|
D extends boolean | "x" | "y" = never,
|
|
37
|
-
>(
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
>(
|
|
36
|
+
config: InferredPropsFor<FN, K, N, LI, LA, D> | Accessor<InferredPropsFor<FN, K, N, LI, LA, D>>,
|
|
37
|
+
) => Ward
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Every form of a `w` whose elements are of `kind` (#516): the Slim element's `w`, and a Wardic
|
|
41
|
+
* instance's. Its directive is an arrow function, as `use:wardic`'s is.
|
|
42
|
+
*/
|
|
43
|
+
export const wOf = (kind: SpineInternals): W =>
|
|
44
|
+
formOf<W>((el: HTMLElement, value: Accessor<WardConfig>): void => runDirective(el, value, kind), createOf(kind), {
|
|
45
|
+
createWard: (config: WardConfig | Accessor<WardConfig>): Ward => createWardWith(config, kind),
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The type of `w`: called, it's the `use:w` directive; `w.create`, `w.createWard` and `w.<tag>` are its
|
|
50
|
+
* forms. `W<F>` is a Wardic instance's `w`, whose elements take only Features `F`'s props; its `use:w`
|
|
51
|
+
* takes every prop all the same, as Solid types a directive by its name.
|
|
52
|
+
*
|
|
53
|
+
* @see https://wardic.dev/reference/solid/elements/wardic-instance
|
|
54
|
+
*/
|
|
55
|
+
// `F`: #516, ADR-0067 *Amendment (#516)*; `use:w`, its decision 4.
|
|
56
|
+
export type W<F = EveryFeature> = WFor<PropFeatureNames<F>>
|
|
40
57
|
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
readonly create:
|
|
44
|
-
readonly createWard:
|
|
58
|
+
/** {@link W} for the Features named `FN` (#516). */
|
|
59
|
+
type WFor<FN extends string> = ((el: HTMLElement, value: Accessor<WardConfig>) => void) & {
|
|
60
|
+
readonly create: CreateFor<FN>
|
|
61
|
+
readonly createWard: CreateWardFor<FN>
|
|
45
62
|
} & {
|
|
46
|
-
readonly [Tag in keyof JSX.IntrinsicElements]:
|
|
63
|
+
readonly [Tag in keyof JSX.IntrinsicElements]: WardicComponentFor<Tag, FN>
|
|
47
64
|
}
|
|
48
65
|
|
|
49
66
|
/**
|
|
@@ -56,4 +73,4 @@ export type W = ((el: HTMLElement, value: Accessor<WardConfig>) => void) & {
|
|
|
56
73
|
* @see https://wardic.dev/reference/solid/elements/w
|
|
57
74
|
*/
|
|
58
75
|
// Every form of the Slim element, as `wardic`'s are of the Complete one (ADR-0067).
|
|
59
|
-
export const w: W =
|
|
76
|
+
export const w: W = wOf(SLIM)
|
package/src/ward-keys.ts
CHANGED
|
@@ -208,6 +208,16 @@ type NoStray<T> = T extends object
|
|
|
208
208
|
/** A target's Transition end, checked (#428): a values map whose names are values. */
|
|
209
209
|
type CheckedEnd<T> = { readonly transitionEnd?: Omit<WardicValues, "transition"> & NoStray<RawOf<T, "transitionEnd">> }
|
|
210
210
|
|
|
211
|
+
/** What a config key no ward takes meets: an error naming it, an object, as {@link NotAValue}'s. */
|
|
212
|
+
type NotAWardKey<P extends string> = { readonly "is not a key a ward takes": P }
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* `C`'s keys that config `W` hasn't, each an error (#756). `C` is inferred from the literal with
|
|
216
|
+
* `const`, so it keeps every key it's given, and once one matches `W` nothing else rejects the rest.
|
|
217
|
+
* A config with a computed key (`[key]: …`) has a string index, its names unknown: it isn't checked.
|
|
218
|
+
*/
|
|
219
|
+
type NoStrayKey<C, W> = string extends keyof C ? unknown : { readonly [P in Exclude<keyof C & string, keyof W>]: NotAWardKey<P> }
|
|
220
|
+
|
|
211
221
|
/** The config props that take a target. */
|
|
212
222
|
type TargetProp = "animate" | "exit" | "whileHover" | "whileTap" | "whileDrag" | "whileFocus" | "whileInView"
|
|
213
223
|
|
|
@@ -249,9 +259,9 @@ type ElementTransition<C> = HandsDown<C> extends true
|
|
|
249
259
|
* `default` and `layout`, every value's name for an element Variant children can join; a target's
|
|
250
260
|
* own (a variant's, `animate`'s, a gesture's, `exit`'s), the keys that target sets and `default`. A
|
|
251
261
|
* config typed as a plain `WardConfig` takes every name. Every other key is `W`'s, so a callback's
|
|
252
|
-
* parameters are typed as ever.
|
|
262
|
+
* parameters are typed as ever, and a key `W` hasn't is an error naming it ({@link NoStrayKey}).
|
|
253
263
|
*/
|
|
254
|
-
export type WardCheckedConfig<C, W> = C & {
|
|
264
|
+
export type WardCheckedConfig<C, W> = C & NoStrayKey<C, W> & {
|
|
255
265
|
readonly [K in keyof W]?: K extends "transition"
|
|
256
266
|
? ElementTransition<C>
|
|
257
267
|
: K extends keyof C
|
|
@@ -326,18 +336,29 @@ type InferredProp = "initial" | "animate" | "exit" | "whileHover" | "whileTap" |
|
|
|
326
336
|
*/
|
|
327
337
|
export type InferredMotion<M, K extends TargetKey, N extends string, LI extends WardicVariantLabels, LA extends WardicVariantLabels, D extends boolean | "x" | "y", X extends string = never> =
|
|
328
338
|
& Omit<M, InferredProp>
|
|
329
|
-
&
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
339
|
+
& InferredParts<K, N, LI, LA, D, X>
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* {@link InferredMotion} for a **Wardic instance**'s motion props `M` (#516): only the props `M` has are
|
|
343
|
+
* typed again, so a gesture's target or `drag`, which its Features may lack, isn't added back.
|
|
344
|
+
*/
|
|
345
|
+
export type InferredMotionOf<M, K extends TargetKey, N extends string, LI extends WardicVariantLabels, LA extends WardicVariantLabels, D extends boolean | "x" | "y", X extends string = never> =
|
|
346
|
+
& Omit<M, InferredProp>
|
|
347
|
+
& Pick<InferredParts<K, N, LI, LA, D, X>, InferredProp & keyof M>
|
|
348
|
+
|
|
349
|
+
/** The props {@link InferredMotion} types again, from the keys inferred. */
|
|
350
|
+
type InferredParts<K extends TargetKey, N extends string, LI extends WardicVariantLabels, LA extends WardicVariantLabels, D extends boolean | "x" | "y", X extends string> = {
|
|
351
|
+
readonly initial?: InferredTarget<K, NoInfer<ValueNameOf<K>>> | LI | false
|
|
352
|
+
readonly animate?: InferredTarget<K, NoInfer<ValueNameOf<K>>> | LA | WardicAnimationControls
|
|
353
|
+
readonly exit?: InferredTarget<K, NoInfer<ValueNameOf<K>>> | WardicVariantLabels
|
|
354
|
+
readonly whileHover?: InferredTarget<K, NoInfer<ValueNameOf<K>>> | WardicVariantLabels
|
|
355
|
+
readonly whileTap?: InferredTarget<K, NoInfer<ValueNameOf<K>>> | WardicVariantLabels
|
|
356
|
+
readonly whileDrag?: InferredTarget<K, NoInfer<ValueNameOf<K>>> | WardicVariantLabels
|
|
357
|
+
readonly whileFocus?: InferredTarget<K, NoInfer<ValueNameOf<K>>> | WardicVariantLabels
|
|
358
|
+
readonly whileInView?: InferredTarget<K, NoInfer<ValueNameOf<K>>> | WardicVariantLabels
|
|
359
|
+
readonly variants?: { readonly [V in N]: InferredTarget<K, NoInfer<ValueNameOf<K>>> | WardicVariantResolver }
|
|
360
|
+
readonly drag?: D
|
|
361
|
+
readonly transition?: true extends NoInfer<JoinedBy<N, LI, LA> | ([InferredKey<K, D, X>] extends [never] ? true : false)>
|
|
362
|
+
? WardicTransition
|
|
363
|
+
: WardicTransitionWith<NoInfer<WardicValueEntries<InferredKey<K, D, X>> & { readonly layout?: WardicValueTransition }>>
|
|
364
|
+
}
|