@wardic/solid 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/animation-controls.js +3 -149
- package/dist/browser/animation-controls.js.map +1 -1
- package/dist/browser/appear.js +3 -782
- package/dist/browser/appear.js.map +1 -1
- package/dist/browser/batch-gestures.js.map +1 -1
- package/dist/browser/batch.js +3 -2511
- package/dist/browser/batch.js.map +1 -1
- package/dist/browser/config.js +11 -1
- package/dist/browser/config.js.map +1 -1
- package/dist/browser/create-animate.js +4 -2
- package/dist/browser/create-animate.js.map +1 -1
- package/dist/browser/create-batch.js +2 -2
- package/dist/browser/create-batch.js.map +1 -1
- package/dist/browser/create-ward.js +28 -5
- package/dist/browser/create-ward.js.map +1 -1
- package/dist/browser/drag-constraints.js +3 -75
- package/dist/browser/drag-constraints.js.map +1 -1
- package/dist/browser/drag-controls.js +3 -50
- package/dist/browser/drag-controls.js.map +1 -1
- package/dist/browser/drag-defaults.js +4 -0
- package/dist/browser/drag-defaults.js.map +1 -0
- package/dist/browser/drag-track.js +3 -826
- package/dist/browser/drag-track.js.map +1 -1
- package/dist/browser/drag-transition.js +3 -55
- package/dist/browser/drag-transition.js.map +1 -1
- package/dist/browser/element-setup.js +4 -0
- package/dist/browser/element-setup.js.map +1 -0
- package/dist/browser/element.js.map +1 -1
- package/dist/browser/feature.js +3 -305
- package/dist/browser/feature.js.map +1 -1
- package/dist/browser/features/all.js +3 -17
- package/dist/browser/features/all.js.map +1 -1
- package/dist/browser/features/colors.js +3 -32
- package/dist/browser/features/colors.js.map +1 -1
- package/dist/browser/features/dom-animation.js +3 -14
- package/dist/browser/features/dom-animation.js.map +1 -1
- package/dist/browser/features/dom-max.js +3 -9
- package/dist/browser/features/dom-max.js.map +1 -1
- package/dist/browser/features/drag.js +3 -27
- package/dist/browser/features/drag.js.map +1 -1
- package/dist/browser/features/focus.js +3 -17
- package/dist/browser/features/focus.js.map +1 -1
- package/dist/browser/features/hover.js +3 -17
- package/dist/browser/features/hover.js.map +1 -1
- package/dist/browser/features/in-view.js +3 -17
- package/dist/browser/features/in-view.js.map +1 -1
- package/dist/browser/features/input.js +3 -26
- package/dist/browser/features/input.js.map +1 -1
- package/dist/browser/features/keys.js +3 -24
- package/dist/browser/features/keys.js.map +1 -1
- package/dist/browser/features/layout.js +3 -43
- package/dist/browser/features/layout.js.map +1 -1
- package/dist/browser/features/pan.js +3 -17
- package/dist/browser/features/pan.js.map +1 -1
- package/dist/browser/features/press.js +3 -11
- package/dist/browser/features/press.js.map +1 -1
- package/dist/browser/features/scroll.js +3 -27
- package/dist/browser/features/scroll.js.map +1 -1
- package/dist/browser/gesture-features.js +3 -28
- package/dist/browser/gesture-features.js.map +1 -1
- package/dist/browser/gesture-info.js +3 -42
- package/dist/browser/gesture-info.js.map +1 -1
- package/dist/browser/imperative.js +3 -886
- package/dist/browser/imperative.js.map +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/instant.js +3 -50
- package/dist/browser/instant.js.map +1 -1
- package/dist/browser/layout-group.js +3 -26
- package/dist/browser/layout-group.js.map +1 -1
- package/dist/browser/layout-member.js +3 -371
- package/dist/browser/layout-member.js.map +1 -1
- package/dist/browser/lazy-batch-gestures.js.map +1 -1
- package/dist/browser/live-style.js +3 -323
- package/dist/browser/live-style.js.map +1 -1
- package/dist/browser/member-hold.js +3 -210
- package/dist/browser/member-hold.js.map +1 -1
- package/dist/browser/owner-scope.js +3 -28
- package/dist/browser/owner-scope.js.map +1 -1
- package/dist/browser/presence-controller.js +3 -1541
- package/dist/browser/presence-controller.js.map +1 -1
- package/dist/browser/presence-record.js +9 -24
- package/dist/browser/presence-record.js.map +1 -1
- package/dist/browser/press.js +3 -23
- package/dist/browser/press.js.map +1 -1
- package/dist/browser/provider.js +8 -0
- package/dist/browser/provider.js.map +1 -1
- package/dist/browser/reactivity.js +0 -7
- package/dist/browser/reactivity.js.map +1 -1
- package/dist/browser/retarget-legs.js +3 -1021
- package/dist/browser/retarget-legs.js.map +1 -1
- package/dist/browser/runtime.js +54 -19
- package/dist/browser/runtime.js.map +1 -1
- package/dist/browser/server-interpolators.js +3 -19
- package/dist/browser/server-interpolators.js.map +1 -1
- package/dist/browser/spine.js +3 -2985
- package/dist/browser/spine.js.map +1 -1
- package/dist/browser/timelines.js +3 -8
- package/dist/browser/timelines.js.map +1 -1
- package/dist/browser/unstable/v2/create-animate.js +4 -2
- package/dist/browser/unstable/v2/create-animate.js.map +1 -1
- package/dist/browser/unstable/v2/create-batch.js +2 -2
- package/dist/browser/unstable/v2/create-batch.js.map +1 -1
- package/dist/browser/unstable/v2/element.js.map +1 -1
- package/dist/browser/unstable/v2/provider.js +8 -0
- package/dist/browser/unstable/v2/provider.js.map +1 -1
- package/dist/browser/unstable/v2/w.js.map +1 -1
- package/dist/browser/unstable/v2/ward.js +20 -5
- package/dist/browser/unstable/v2/ward.js.map +1 -1
- package/dist/browser/variant-target.js +3 -228
- package/dist/browser/variant-target.js.map +1 -1
- package/dist/browser/variant-tree.js +3 -393
- package/dist/browser/variant-tree.js.map +1 -1
- package/dist/browser/w.js.map +1 -1
- package/dist/browser/wardic-config-value.js +3 -90
- package/dist/browser/wardic-config-value.js.map +1 -1
- package/dist/server/animation-controls.js +3 -149
- package/dist/server/animation-controls.js.map +1 -1
- package/dist/server/appear.js +3 -782
- package/dist/server/appear.js.map +1 -1
- package/dist/server/batch-gestures.js.map +1 -1
- package/dist/server/batch.js +3 -2511
- package/dist/server/batch.js.map +1 -1
- package/dist/server/config.js +11 -1
- package/dist/server/config.js.map +1 -1
- package/dist/server/create-animate.js +4 -2
- package/dist/server/create-animate.js.map +1 -1
- package/dist/server/create-batch.js +2 -2
- package/dist/server/create-batch.js.map +1 -1
- package/dist/server/create-ward.js +28 -5
- package/dist/server/create-ward.js.map +1 -1
- package/dist/server/drag-constraints.js +3 -75
- package/dist/server/drag-constraints.js.map +1 -1
- package/dist/server/drag-controls.js +3 -50
- package/dist/server/drag-controls.js.map +1 -1
- package/dist/server/drag-defaults.js +4 -0
- package/dist/server/drag-defaults.js.map +1 -0
- package/dist/server/drag-track.js +3 -826
- package/dist/server/drag-track.js.map +1 -1
- package/dist/server/drag-transition.js +3 -55
- package/dist/server/drag-transition.js.map +1 -1
- package/dist/server/element-setup.js +4 -0
- package/dist/server/element-setup.js.map +1 -0
- package/dist/server/element.js.map +1 -1
- package/dist/server/feature.js +3 -305
- package/dist/server/feature.js.map +1 -1
- package/dist/server/features/all.js +3 -17
- package/dist/server/features/all.js.map +1 -1
- package/dist/server/features/colors.js +3 -32
- package/dist/server/features/colors.js.map +1 -1
- package/dist/server/features/dom-animation.js +3 -14
- package/dist/server/features/dom-animation.js.map +1 -1
- package/dist/server/features/dom-max.js +3 -9
- package/dist/server/features/dom-max.js.map +1 -1
- package/dist/server/features/drag.js +3 -27
- package/dist/server/features/drag.js.map +1 -1
- package/dist/server/features/focus.js +3 -17
- package/dist/server/features/focus.js.map +1 -1
- package/dist/server/features/hover.js +3 -17
- package/dist/server/features/hover.js.map +1 -1
- package/dist/server/features/in-view.js +3 -17
- package/dist/server/features/in-view.js.map +1 -1
- package/dist/server/features/input.js +3 -26
- package/dist/server/features/input.js.map +1 -1
- package/dist/server/features/keys.js +3 -24
- package/dist/server/features/keys.js.map +1 -1
- package/dist/server/features/layout.js +3 -43
- package/dist/server/features/layout.js.map +1 -1
- package/dist/server/features/pan.js +3 -17
- package/dist/server/features/pan.js.map +1 -1
- package/dist/server/features/press.js +3 -11
- package/dist/server/features/press.js.map +1 -1
- package/dist/server/features/scroll.js +3 -27
- package/dist/server/features/scroll.js.map +1 -1
- package/dist/server/gesture-features.js +3 -28
- package/dist/server/gesture-features.js.map +1 -1
- package/dist/server/gesture-info.js +3 -42
- package/dist/server/gesture-info.js.map +1 -1
- package/dist/server/imperative.js +3 -886
- package/dist/server/imperative.js.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/instant.js +3 -50
- package/dist/server/instant.js.map +1 -1
- package/dist/server/layout-group.js +3 -26
- package/dist/server/layout-group.js.map +1 -1
- package/dist/server/layout-member.js +3 -371
- package/dist/server/layout-member.js.map +1 -1
- package/dist/server/lazy-batch-gestures.js.map +1 -1
- package/dist/server/live-style.js +3 -323
- package/dist/server/live-style.js.map +1 -1
- package/dist/server/member-hold.js +3 -210
- package/dist/server/member-hold.js.map +1 -1
- package/dist/server/owner-scope.js +3 -28
- package/dist/server/owner-scope.js.map +1 -1
- package/dist/server/presence-controller.js +3 -1541
- package/dist/server/presence-controller.js.map +1 -1
- package/dist/server/presence-record.js +9 -24
- package/dist/server/presence-record.js.map +1 -1
- package/dist/server/press.js +3 -23
- package/dist/server/press.js.map +1 -1
- package/dist/server/provider.js +8 -0
- package/dist/server/provider.js.map +1 -1
- package/dist/server/reactivity.js +0 -7
- package/dist/server/reactivity.js.map +1 -1
- package/dist/server/retarget-legs.js +3 -1021
- package/dist/server/retarget-legs.js.map +1 -1
- package/dist/server/runtime.js +54 -19
- package/dist/server/runtime.js.map +1 -1
- package/dist/server/server-interpolators.js +3 -19
- package/dist/server/server-interpolators.js.map +1 -1
- package/dist/server/spine.js +3 -2985
- package/dist/server/spine.js.map +1 -1
- package/dist/server/timelines.js +3 -8
- package/dist/server/timelines.js.map +1 -1
- package/dist/server/unstable/v2/create-animate.js +4 -2
- package/dist/server/unstable/v2/create-animate.js.map +1 -1
- package/dist/server/unstable/v2/create-batch.js +2 -2
- package/dist/server/unstable/v2/create-batch.js.map +1 -1
- package/dist/server/unstable/v2/element.js.map +1 -1
- package/dist/server/unstable/v2/provider.js +8 -0
- package/dist/server/unstable/v2/provider.js.map +1 -1
- package/dist/server/unstable/v2/w.js.map +1 -1
- package/dist/server/unstable/v2/ward.js +20 -5
- package/dist/server/unstable/v2/ward.js.map +1 -1
- package/dist/server/variant-target.js +3 -228
- package/dist/server/variant-target.js.map +1 -1
- package/dist/server/variant-tree.js +3 -393
- package/dist/server/variant-tree.js.map +1 -1
- package/dist/server/w.js.map +1 -1
- package/dist/server/wardic-config-value.js +3 -90
- package/dist/server/wardic-config-value.js.map +1 -1
- package/dist/solid/animation-controls.d.ts +1 -102
- package/dist/solid/animation-controls.d.ts.map +1 -1
- package/dist/solid/animation-controls.js +3 -128
- package/dist/solid/animation-controls.js.map +1 -1
- package/dist/solid/appear.d.ts +1 -231
- package/dist/solid/appear.d.ts.map +1 -1
- package/dist/solid/appear.js +3 -570
- package/dist/solid/appear.js.map +1 -1
- package/dist/solid/batch-gestures.d.ts +2 -2
- package/dist/solid/batch-gestures.d.ts.map +1 -1
- package/dist/solid/batch-gestures.js.map +1 -1
- package/dist/solid/batch.d.ts +1 -511
- package/dist/solid/batch.d.ts.map +1 -1
- package/dist/solid/batch.js +3 -2484
- package/dist/solid/batch.js.map +1 -1
- package/dist/solid/config.d.ts +2 -728
- package/dist/solid/config.d.ts.map +1 -1
- package/dist/solid/config.js +11 -1
- package/dist/solid/config.js.map +1 -1
- package/dist/solid/create-animate.d.ts.map +1 -1
- package/dist/solid/create-animate.jsx +3 -1
- package/dist/solid/create-animate.jsx.map +1 -1
- package/dist/solid/create-batch.jsx +2 -2
- package/dist/solid/create-batch.jsx.map +1 -1
- package/dist/solid/create-ward.d.ts +5 -2
- package/dist/solid/create-ward.d.ts.map +1 -1
- package/dist/solid/create-ward.jsx +24 -5
- package/dist/solid/create-ward.jsx.map +1 -1
- package/dist/solid/drag-constraints.d.ts +1 -45
- package/dist/solid/drag-constraints.d.ts.map +1 -1
- package/dist/solid/drag-constraints.js +3 -48
- package/dist/solid/drag-constraints.js.map +1 -1
- package/dist/solid/drag-controls.d.ts +1 -49
- package/dist/solid/drag-controls.d.ts.map +1 -1
- package/dist/solid/drag-controls.js +3 -50
- package/dist/solid/drag-controls.js.map +1 -1
- package/dist/solid/drag-defaults.d.ts +2 -0
- package/dist/solid/drag-defaults.d.ts.map +1 -0
- package/dist/solid/drag-defaults.js +4 -0
- package/dist/solid/drag-defaults.js.map +1 -0
- package/dist/solid/drag-track.d.ts +1 -232
- package/dist/solid/drag-track.d.ts.map +1 -1
- package/dist/solid/drag-track.js +3 -641
- package/dist/solid/drag-track.js.map +1 -1
- package/dist/solid/drag-transition.d.ts +1 -19
- package/dist/solid/drag-transition.d.ts.map +1 -1
- package/dist/solid/drag-transition.js +3 -30
- package/dist/solid/drag-transition.js.map +1 -1
- package/dist/solid/element-setup.d.ts +2 -0
- package/dist/solid/element-setup.d.ts.map +1 -0
- package/dist/solid/element-setup.js +4 -0
- package/dist/solid/element-setup.js.map +1 -0
- package/dist/solid/element.d.ts +2 -1
- package/dist/solid/element.d.ts.map +1 -1
- package/dist/solid/element.jsx.map +1 -1
- package/dist/solid/feature.d.ts +1 -206
- package/dist/solid/feature.d.ts.map +1 -1
- package/dist/solid/feature.js +3 -286
- package/dist/solid/feature.js.map +1 -1
- package/dist/solid/features/all.d.ts +1 -16
- package/dist/solid/features/all.d.ts.map +1 -1
- package/dist/solid/features/all.js +3 -26
- package/dist/solid/features/all.js.map +1 -1
- package/dist/solid/features/colors.d.ts +1 -11
- package/dist/solid/features/colors.d.ts.map +1 -1
- package/dist/solid/features/colors.js +3 -33
- package/dist/solid/features/colors.js.map +1 -1
- package/dist/solid/features/dom-animation.d.ts +1 -13
- package/dist/solid/features/dom-animation.d.ts.map +1 -1
- package/dist/solid/features/dom-animation.js +3 -14
- package/dist/solid/features/dom-animation.js.map +1 -1
- package/dist/solid/features/dom-max.d.ts +1 -9
- package/dist/solid/features/dom-max.d.ts.map +1 -1
- package/dist/solid/features/dom-max.js +3 -9
- package/dist/solid/features/dom-max.js.map +1 -1
- package/dist/solid/features/drag.d.ts +1 -4
- package/dist/solid/features/drag.d.ts.map +1 -1
- package/dist/solid/features/drag.js +3 -27
- package/dist/solid/features/drag.js.map +1 -1
- package/dist/solid/features/focus.d.ts +1 -4
- package/dist/solid/features/focus.d.ts.map +1 -1
- package/dist/solid/features/focus.js +3 -15
- package/dist/solid/features/focus.js.map +1 -1
- package/dist/solid/features/hover.d.ts +1 -4
- package/dist/solid/features/hover.d.ts.map +1 -1
- package/dist/solid/features/hover.js +3 -15
- package/dist/solid/features/hover.js.map +1 -1
- package/dist/solid/features/in-view.d.ts +1 -4
- package/dist/solid/features/in-view.d.ts.map +1 -1
- package/dist/solid/features/in-view.js +3 -15
- package/dist/solid/features/in-view.js.map +1 -1
- package/dist/solid/features/input.d.ts +1 -25
- package/dist/solid/features/input.d.ts.map +1 -1
- package/dist/solid/features/input.js +3 -26
- package/dist/solid/features/input.js.map +1 -1
- package/dist/solid/features/keys.d.ts +1 -84
- package/dist/solid/features/keys.d.ts.map +1 -1
- package/dist/solid/features/keys.js +3 -32
- package/dist/solid/features/keys.js.map +1 -1
- package/dist/solid/features/layout.d.ts +1 -37
- package/dist/solid/features/layout.d.ts.map +1 -1
- package/dist/solid/features/layout.js +3 -43
- package/dist/solid/features/layout.js.map +1 -1
- package/dist/solid/features/pan.d.ts +1 -4
- package/dist/solid/features/pan.d.ts.map +1 -1
- package/dist/solid/features/pan.js +3 -15
- package/dist/solid/features/pan.js.map +1 -1
- package/dist/solid/features/press.d.ts +1 -10
- package/dist/solid/features/press.d.ts.map +1 -1
- package/dist/solid/features/press.js +3 -9
- package/dist/solid/features/press.js.map +1 -1
- package/dist/solid/features/scroll.d.ts +1 -17
- package/dist/solid/features/scroll.d.ts.map +1 -1
- package/dist/solid/features/scroll.js +3 -29
- package/dist/solid/features/scroll.js.map +1 -1
- package/dist/solid/gesture-features.d.ts +1 -27
- package/dist/solid/gesture-features.d.ts.map +1 -1
- package/dist/solid/gesture-features.js +3 -28
- package/dist/solid/gesture-features.js.map +1 -1
- package/dist/solid/gesture-info.d.ts +1 -58
- package/dist/solid/gesture-info.d.ts.map +1 -1
- package/dist/solid/gesture-info.js +3 -22
- package/dist/solid/gesture-info.js.map +1 -1
- package/dist/solid/imperative.d.ts +1 -202
- package/dist/solid/imperative.d.ts.map +1 -1
- package/dist/solid/imperative.js +3 -764
- package/dist/solid/imperative.js.map +1 -1
- package/dist/solid/index.d.ts +1 -1
- package/dist/solid/index.jsx +1 -1
- package/dist/solid/instant.d.ts +1 -43
- package/dist/solid/instant.d.ts.map +1 -1
- package/dist/solid/instant.js +3 -48
- package/dist/solid/instant.js.map +1 -1
- package/dist/solid/layout-group.d.ts +1 -13
- package/dist/solid/layout-group.d.ts.map +1 -1
- package/dist/solid/layout-group.js +3 -26
- package/dist/solid/layout-group.js.map +1 -1
- package/dist/solid/layout-member.d.ts +1 -124
- package/dist/solid/layout-member.d.ts.map +1 -1
- package/dist/solid/layout-member.js +3 -175
- package/dist/solid/layout-member.js.map +1 -1
- package/dist/solid/lazy-batch-gestures.d.ts +2 -2
- package/dist/solid/lazy-batch-gestures.d.ts.map +1 -1
- package/dist/solid/lazy-batch-gestures.js.map +1 -1
- package/dist/solid/live-style.d.ts +1 -158
- package/dist/solid/live-style.d.ts.map +1 -1
- package/dist/solid/live-style.js +3 -314
- package/dist/solid/live-style.js.map +1 -1
- package/dist/solid/member-hold.d.ts +1 -32
- package/dist/solid/member-hold.d.ts.map +1 -1
- package/dist/solid/member-hold.js +3 -223
- package/dist/solid/member-hold.js.map +1 -1
- package/dist/solid/owner-scope.d.ts +1 -15
- package/dist/solid/owner-scope.d.ts.map +1 -1
- package/dist/solid/owner-scope.js +3 -30
- package/dist/solid/owner-scope.js.map +1 -1
- package/dist/solid/presence-controller.d.ts +1 -121
- package/dist/solid/presence-controller.d.ts.map +1 -1
- package/dist/solid/presence-controller.js +3 -1426
- package/dist/solid/presence-controller.js.map +1 -1
- package/dist/solid/presence-record.d.ts +6 -168
- package/dist/solid/presence-record.d.ts.map +1 -1
- package/dist/solid/presence-record.js +9 -23
- package/dist/solid/presence-record.js.map +1 -1
- package/dist/solid/press.d.ts +1 -23
- package/dist/solid/press.d.ts.map +1 -1
- package/dist/solid/press.js +3 -18
- package/dist/solid/press.js.map +1 -1
- package/dist/solid/provider.d.ts +7 -1
- package/dist/solid/provider.d.ts.map +1 -1
- package/dist/solid/provider.jsx +8 -0
- package/dist/solid/provider.jsx.map +1 -1
- package/dist/solid/reactivity.d.ts +1 -20
- package/dist/solid/reactivity.d.ts.map +1 -1
- package/dist/solid/reactivity.js +0 -7
- package/dist/solid/reactivity.js.map +1 -1
- package/dist/solid/retarget-legs.d.ts +1 -188
- package/dist/solid/retarget-legs.d.ts.map +1 -1
- package/dist/solid/retarget-legs.js +3 -825
- package/dist/solid/retarget-legs.js.map +1 -1
- package/dist/solid/runtime.d.ts +12 -32
- package/dist/solid/runtime.d.ts.map +1 -1
- package/dist/solid/runtime.js +44 -21
- package/dist/solid/runtime.js.map +1 -1
- package/dist/solid/server-interpolators.d.ts +1 -12
- package/dist/solid/server-interpolators.d.ts.map +1 -1
- package/dist/solid/server-interpolators.js +3 -19
- package/dist/solid/server-interpolators.js.map +1 -1
- package/dist/solid/spine.d.ts +1 -743
- package/dist/solid/spine.d.ts.map +1 -1
- package/dist/solid/spine.js +3 -2834
- package/dist/solid/spine.js.map +1 -1
- package/dist/solid/timelines.d.ts +1 -43
- package/dist/solid/timelines.d.ts.map +1 -1
- package/dist/solid/timelines.js +3 -9
- package/dist/solid/timelines.js.map +1 -1
- package/dist/solid/unstable/v2/create-animate.d.ts.map +1 -1
- package/dist/solid/unstable/v2/create-animate.jsx +3 -1
- package/dist/solid/unstable/v2/create-animate.jsx.map +1 -1
- package/dist/solid/unstable/v2/create-batch.jsx +2 -2
- package/dist/solid/unstable/v2/create-batch.jsx.map +1 -1
- package/dist/solid/unstable/v2/element.d.ts +2 -1
- package/dist/solid/unstable/v2/element.d.ts.map +1 -1
- package/dist/solid/unstable/v2/element.jsx.map +1 -1
- package/dist/solid/unstable/v2/provider.d.ts +7 -1
- package/dist/solid/unstable/v2/provider.d.ts.map +1 -1
- package/dist/solid/unstable/v2/provider.jsx +8 -0
- package/dist/solid/unstable/v2/provider.jsx.map +1 -1
- package/dist/solid/unstable/v2/w.d.ts +2 -1
- package/dist/solid/unstable/v2/w.d.ts.map +1 -1
- package/dist/solid/unstable/v2/w.jsx.map +1 -1
- package/dist/solid/unstable/v2/ward.d.ts +3 -2
- package/dist/solid/unstable/v2/ward.d.ts.map +1 -1
- package/dist/solid/unstable/v2/ward.jsx +15 -5
- package/dist/solid/unstable/v2/ward.jsx.map +1 -1
- package/dist/solid/variant-target.d.ts +1 -103
- package/dist/solid/variant-target.d.ts.map +1 -1
- package/dist/solid/variant-target.js +3 -181
- package/dist/solid/variant-target.js.map +1 -1
- package/dist/solid/variant-tree.d.ts +1 -348
- package/dist/solid/variant-tree.d.ts.map +1 -1
- package/dist/solid/variant-tree.js +3 -357
- package/dist/solid/variant-tree.js.map +1 -1
- package/dist/solid/w.d.ts +2 -1
- package/dist/solid/w.d.ts.map +1 -1
- package/dist/solid/w.jsx.map +1 -1
- package/dist/solid/wardic-config-value.d.ts +1 -86
- package/dist/solid/wardic-config-value.d.ts.map +1 -1
- package/dist/solid/wardic-config-value.js +3 -105
- package/dist/solid/wardic-config-value.js.map +1 -1
- package/package.json +4 -4
- package/src/animation-controls.ts +3 -206
- package/src/appear.ts +3 -878
- package/src/batch-gestures.ts +2 -2
- package/src/batch.ts +3 -3078
- package/src/config.ts +5 -858
- package/src/create-animate.tsx +3 -1
- package/src/create-batch.tsx +2 -2
- package/src/create-ward.tsx +27 -46
- package/src/drag-constraints.ts +3 -103
- package/src/drag-controls.ts +3 -94
- package/src/drag-defaults.ts +3 -0
- package/src/drag-track.ts +3 -955
- package/src/drag-transition.ts +3 -43
- package/src/element-setup.ts +3 -0
- package/src/element.tsx +2 -1
- package/src/feature.ts +3 -491
- package/src/features/all.ts +3 -27
- package/src/features/colors.ts +3 -36
- package/src/features/dom-animation.ts +3 -15
- package/src/features/dom-max.ts +3 -10
- package/src/features/drag.ts +3 -30
- package/src/features/focus.ts +3 -17
- package/src/features/hover.ts +3 -17
- package/src/features/in-view.ts +3 -17
- package/src/features/input.ts +3 -34
- package/src/features/keys.ts +3 -106
- package/src/features/layout.ts +3 -66
- package/src/features/pan.ts +3 -17
- package/src/features/press.ts +3 -17
- package/src/features/scroll.ts +3 -31
- package/src/gesture-features.ts +3 -35
- package/src/gesture-info.ts +3 -81
- package/src/imperative.ts +3 -1052
- package/src/index.tsx +1 -1
- package/src/instant.ts +3 -90
- package/src/layout-group.ts +3 -32
- package/src/layout-member.ts +3 -315
- package/src/lazy-batch-gestures.ts +3 -3
- package/src/live-style.ts +3 -471
- package/src/member-hold.ts +3 -241
- package/src/owner-scope.ts +3 -31
- package/src/presence-controller.ts +3 -1732
- package/src/presence-record.ts +8 -192
- package/src/press.ts +3 -40
- package/src/provider.tsx +10 -0
- package/src/reactivity.ts +3 -23
- package/src/retarget-legs.ts +3 -1049
- package/src/runtime.ts +54 -42
- package/src/server-interpolators.ts +3 -33
- package/src/spine.ts +3 -3540
- package/src/timelines.ts +3 -46
- package/src/unstable/v2/create-animate.tsx +3 -1
- package/src/unstable/v2/create-batch.tsx +2 -2
- package/src/unstable/v2/element.tsx +2 -1
- package/src/unstable/v2/provider.tsx +10 -0
- package/src/unstable/v2/w.tsx +2 -1
- package/src/unstable/v2/ward.tsx +18 -43
- package/src/variant-target.ts +3 -240
- package/src/variant-tree.ts +3 -638
- package/src/w.tsx +2 -1
- package/src/wardic-config-value.ts +3 -150
- package/dist/browser/batch-handoff.js +0 -57
- package/dist/browser/batch-handoff.js.map +0 -1
- package/dist/browser/features/timeline-keys.js +0 -100
- package/dist/browser/features/timeline-keys.js.map +0 -1
- package/dist/browser/frame-time.js +0 -40
- package/dist/browser/frame-time.js.map +0 -1
- package/dist/server/batch-handoff.js +0 -57
- package/dist/server/batch-handoff.js.map +0 -1
- package/dist/server/features/timeline-keys.js +0 -100
- package/dist/server/features/timeline-keys.js.map +0 -1
- package/dist/server/frame-time.js +0 -40
- package/dist/server/frame-time.js.map +0 -1
- package/dist/solid/batch-handoff.d.ts +0 -25
- package/dist/solid/batch-handoff.d.ts.map +0 -1
- package/dist/solid/batch-handoff.js +0 -62
- package/dist/solid/batch-handoff.js.map +0 -1
- package/dist/solid/features/timeline-keys.d.ts +0 -7
- package/dist/solid/features/timeline-keys.d.ts.map +0 -1
- package/dist/solid/features/timeline-keys.js +0 -97
- package/dist/solid/features/timeline-keys.js.map +0 -1
- package/dist/solid/frame-time.d.ts +0 -21
- package/dist/solid/frame-time.d.ts.map +0 -1
- package/dist/solid/frame-time.js +0 -41
- package/dist/solid/frame-time.js.map +0 -1
- package/src/batch-handoff.ts +0 -73
- package/src/features/timeline-keys.ts +0 -109
- package/src/frame-time.ts +0 -45
package/src/drag-transition.ts
CHANGED
|
@@ -1,43 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import type * as ProjectionSystem from "@wardic/dom/ProjectionSystem"
|
|
8
|
-
import * as Bool from "effect/Boolean"
|
|
9
|
-
import { identity } from "effect/Function"
|
|
10
|
-
import * as UndefinedOr from "effect/UndefinedOr"
|
|
11
|
-
import type { WardicDragTransition } from "./config.ts"
|
|
12
|
-
|
|
13
|
-
/** Motion's `dragElastic` default (`defaultElastic`, ADR-0016 *Amendment (#140)*). */
|
|
14
|
-
export const DEFAULT_DRAG_ELASTIC = 0.35
|
|
15
|
-
|
|
16
|
-
/** A drag's `dragElastic`, or Motion's default. */
|
|
17
|
-
export const elasticOf = (elastic: number | undefined): number =>
|
|
18
|
-
UndefinedOr.match(elastic, { onUndefined: () => DEFAULT_DRAG_ELASTIC, onDefined: identity })
|
|
19
|
-
|
|
20
|
-
/** Motion's release (`startAnimation`), in seconds: a 0.75 s time constant, power 0.8, at rest within 1 px and 10 px/s. */
|
|
21
|
-
const MOTION_RELEASE = { power: 0.8, timeConstant: 0.75, restDelta: 1, restSpeed: 10 } as const
|
|
22
|
-
/** The bounce with an elastic drag, Motion's `dragElastic ? 200 : …`. */
|
|
23
|
-
const ELASTIC_BOUNCE = { bounceStiffness: 200, bounceDamping: 40 } as const
|
|
24
|
-
/** The bounce with none, a wall: Motion's `… : 1000000` and `10000000`. */
|
|
25
|
-
const RIGID_BOUNCE = { bounceStiffness: 1e6, bounceDamping: 1e7 } as const
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* An element's drag transition, resolved (ADR-0016, *Amendment (#140)*): Motion's release, its bounce
|
|
29
|
-
* from `dragElastic` (a wall with none), then the element's own `dragTransition` over it, its
|
|
30
|
-
* `timeConstant` from milliseconds to seconds. What every release runs on: a Fling, a snap back to the
|
|
31
|
-
* origin, and a projection node's Release offset.
|
|
32
|
-
*/
|
|
33
|
-
export const dragTransitionOf = (elastic: number | undefined, own: WardicDragTransition | undefined): ProjectionSystem.DragTransition => ({
|
|
34
|
-
...MOTION_RELEASE,
|
|
35
|
-
...Bool.match(elasticOf(elastic) !== 0, { onTrue: () => ELASTIC_BOUNCE, onFalse: () => RIGID_BOUNCE }),
|
|
36
|
-
...UndefinedOr.match(own, {
|
|
37
|
-
onUndefined: () => ({}),
|
|
38
|
-
onDefined: ({ timeConstant, ...rest }) => ({
|
|
39
|
-
...rest,
|
|
40
|
-
...UndefinedOr.match(timeConstant, { onUndefined: () => ({}), onDefined: (ms) => ({ timeConstant: ms / 1000 }) }),
|
|
41
|
-
}),
|
|
42
|
-
}),
|
|
43
|
-
})
|
|
1
|
+
// #672: @wardic/dom/unstable/DragTransition since the lift; solid's modules import it through
|
|
2
|
+
// here until each has moved.
|
|
3
|
+
export * from "@wardic/dom/unstable/DragTransition"
|
package/src/element.tsx
CHANGED
|
@@ -45,7 +45,8 @@ import { isServer } from "./server.ts"
|
|
|
45
45
|
import { GESTURE_KEYS } from "./gesture-callbacks.ts"
|
|
46
46
|
import { renderServerElement, serverAppearOfWard, createWardWith, type SpineInternals, type WardStyle, type WardUserProps } from "./create-ward.tsx"
|
|
47
47
|
import type { WardBaseConfig, WardConfig, WardFeatureConfigs, WardicVariantLabels } from "./config.ts"
|
|
48
|
-
import type { AbsentGroupsOf,
|
|
48
|
+
import type { AbsentGroupsOf, GroupsOf, NamesEvery, PropFeatureNames } from "./feature.ts"
|
|
49
|
+
import type { EveryFeature } from "./features/all.ts"
|
|
49
50
|
import type { InferredMotion, InferredMotionOf, TargetKey } from "./ward-keys.ts"
|
|
50
51
|
import { changesContext } from "./variant-tree.ts"
|
|
51
52
|
import { MOTION_PROPS, motionToConfig, type WardicMotionProps } from "./motion-props.ts"
|
package/src/feature.ts
CHANGED
|
@@ -1,491 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* `LazyWardic` and elements read them through it.
|
|
5
|
-
*
|
|
6
|
-
* Each Feature is an Effect `Layer` (ADR-0067, *Features are Layers*): its services, built once per
|
|
7
|
-
* provider into the provider's runtime's `MemoMap` (`Layer.buildWithMemoMap`), so a Layer two Features
|
|
8
|
-
* share is built once, and ended with the provider. A Feature that arrives late, loaded lazily, is built
|
|
9
|
-
* the same way when it arrives: the runtime, made once, needn't change. A section of the tree (its
|
|
10
|
-
* `WardicProvider`, each `LazyWardic`) holds the services of the Features it has, a `Context`, joined
|
|
11
|
-
* with its parent's; an element looks a Feature up there.
|
|
12
|
-
*
|
|
13
|
-
* @module
|
|
14
|
-
*/
|
|
15
|
-
import * as Color from "@wardic/dom/Color"
|
|
16
|
-
import * as Report from "@wardic/dom/Report"
|
|
17
|
-
import * as Arr from "effect/Array"
|
|
18
|
-
import * as Cause from "effect/Cause"
|
|
19
|
-
import * as Context from "effect/Context"
|
|
20
|
-
import * as Effect from "effect/Effect"
|
|
21
|
-
import * as Exit from "effect/Exit"
|
|
22
|
-
import { constFalse, constVoid, identity } from "effect/Function"
|
|
23
|
-
import * as Layer from "effect/Layer"
|
|
24
|
-
import type * as ManagedRuntime from "effect/ManagedRuntime"
|
|
25
|
-
import * as Option from "effect/Option"
|
|
26
|
-
import * as Predicate from "effect/Predicate"
|
|
27
|
-
import * as UndefinedOr from "effect/UndefinedOr"
|
|
28
|
-
import * as OwnerScope from "./owner-scope.ts"
|
|
29
|
-
import type { WardConfig, WardFeatureConfigs } from "./config.ts"
|
|
30
|
-
import type { ALL } from "./features/all.ts"
|
|
31
|
-
import type { Reactivity } from "./reactivity.ts"
|
|
32
|
-
import type { ProviderRuntime, ProviderServices, WardicServices } from "./runtime.ts"
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* A **Feature**: its name, the key of the service its Layer gives (what an element looks up),
|
|
36
|
-
* and that Layer, built on the provider's runtime: its Environment, its flush gate and its projection
|
|
37
|
-
* options. `server` is what a server render, which builds no runtime, does with it: the
|
|
38
|
-
* `colors` Feature registers its colour spaces there too, as the render reads colours; the rest do
|
|
39
|
-
* nothing. `N` is its name as a type, by which each binding finds the props it adds.
|
|
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
|
|
44
|
-
readonly key: Context.Key<I, S>
|
|
45
|
-
readonly layer: Layer.Layer<I, never, ProviderServices>
|
|
46
|
-
readonly server?: (() => void) | undefined
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** Features as an app gives them: one, or a list, a preset's nested in it (`[domAnimation, layout]`). */
|
|
50
|
-
export type Features = Feature | ReadonlyArray<Features>
|
|
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
|
-
|
|
108
|
-
/** Features loaded lazily: `() => import("./features.ts").then((m) => m.domMax)`. */
|
|
109
|
-
export type FeatureLoad = () => Promise<Features>
|
|
110
|
-
|
|
111
|
-
/** Features given to a `WardicProvider` or a `LazyWardic`: at once, or loaded lazily. */
|
|
112
|
-
export type FeaturesProp = Features | FeatureLoad
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* `key`'s Layer for a Feature: the Environment's service when it gives one (`@wardic/test`'s `TestLive`),
|
|
116
|
-
* else `layer`, the DOM's, which a provider's `MemoMap` builds once for every Feature standing on it.
|
|
117
|
-
*/
|
|
118
|
-
// ADR-0067 decision 14 (the gestures' input) and *Amendment (#518)*, decision 5 (the scroll). A Feature
|
|
119
|
-
// module's call to it is marked pure, so an app that never imports the module drops `layer`.
|
|
120
|
-
export const fromEnvironmentOr = <I, S, R>(key: Context.Key<I, S>, layer: Layer.Layer<I, never, R>): Layer.Layer<I, never, R> =>
|
|
121
|
-
Layer.unwrap(
|
|
122
|
-
Effect.map(
|
|
123
|
-
Effect.serviceOption(key),
|
|
124
|
-
Option.match({
|
|
125
|
-
onSome: (given): Layer.Layer<I, never, R> => Layer.succeed(key)(given),
|
|
126
|
-
onNone: (): Layer.Layer<I, never, R> => layer,
|
|
127
|
-
}),
|
|
128
|
-
),
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
/** Features as one flat list, each once, in order. */
|
|
132
|
-
export const flatten = (features: Features): ReadonlyArray<Feature> => Arr.dedupeWith(flattenInto(features), (a, b) => a === b)
|
|
133
|
-
|
|
134
|
-
const flattenInto = (features: Features): ReadonlyArray<Feature> => {
|
|
135
|
-
if (isFeature(features)) return [features]
|
|
136
|
-
return Arr.flatMap(features as ReadonlyArray<Features>, flattenInto)
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const isFeature = (value: Features): value is Feature => Predicate.hasProperty(value, "layer")
|
|
140
|
-
|
|
141
|
-
/** Whether a `features` prop loads lazily: a function, where Features are values. */
|
|
142
|
-
export const isLoad = (prop: FeaturesProp): prop is FeatureLoad => Predicate.isFunction(prop)
|
|
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
|
-
|
|
171
|
-
/** No Features. */
|
|
172
|
-
export const NONE: Context.Context<never> = Context.empty()
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* A section of the tree's Features (#511): a `WardicProvider`'s, a `LazyWardic`'s, or an element's,
|
|
176
|
-
* each its own joined with its parent's. Each binding makes its sections with its own signals.
|
|
177
|
-
*/
|
|
178
|
-
export interface FeatureSection {
|
|
179
|
-
/** The services of the Features it has now. Tracked: a lazy one arriving changes it. */
|
|
180
|
-
readonly services: () => Context.Context<never>
|
|
181
|
-
/** Whether a lazy load of its own or a parent's is still on its way: no missing-Feature warning while one is. */
|
|
182
|
-
readonly pending: () => boolean
|
|
183
|
-
/** Whether it, or a section above it, is `strict`: a Complete element under it is an error in development. */
|
|
184
|
-
readonly strict: boolean
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/** Outside every provider, and above each provider's own: no Features, nothing on its way, not strict. */
|
|
188
|
-
export const ROOT: FeatureSection = { services: () => NONE, pending: constFalse, strict: false }
|
|
189
|
-
|
|
190
|
-
/** What a section takes from its binding: its reactivity, whether it renders on a server, and its owner's cleanup. */
|
|
191
|
-
export interface SectionHost {
|
|
192
|
-
readonly reactivity: Reactivity
|
|
193
|
-
readonly server: boolean
|
|
194
|
-
readonly onCleanup: (fn: () => void) => void
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* A section under `parent` with `prop`'s Features (#511):
|
|
199
|
-
* - **Given at once**, they're built on first need, the first time an element in it asks (#51: a
|
|
200
|
-
* provider with no element under it builds nothing); a server render runs their `server` part at
|
|
201
|
-
* once, as its elements may read what it registers.
|
|
202
|
-
* - **Loaded lazily** (decision 8), the load starts now on the client and they're built as they
|
|
203
|
-
* arrive, from then on; `pending` until it settles. A failed load is `report`ed, once. A server
|
|
204
|
-
* render loads nothing: it renders as it would without them.
|
|
205
|
-
*
|
|
206
|
-
* Its services join its own and its parent's, joined again only when either changes.
|
|
207
|
-
*/
|
|
208
|
-
export const makeSection = (
|
|
209
|
-
parent: FeatureSection,
|
|
210
|
-
registry: FeatureRegistry,
|
|
211
|
-
prop: FeaturesProp | undefined,
|
|
212
|
-
strict: boolean,
|
|
213
|
-
report: (cause: Cause.Cause<unknown>) => void,
|
|
214
|
-
host: SectionHost,
|
|
215
|
-
): FeatureSection => {
|
|
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
|
|
226
|
-
const services = (): Context.Context<never> => {
|
|
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 }
|
|
232
|
-
return joined
|
|
233
|
-
}
|
|
234
|
-
return { services, pending: () => b.pending() || a.pending() }
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/** A section's own Features: their services and whether they're on their way. */
|
|
238
|
-
export interface Own {
|
|
239
|
-
readonly services: () => Context.Context<never>
|
|
240
|
-
readonly pending: () => boolean
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const NO_OWN: Own = { services: () => NONE, pending: constFalse }
|
|
244
|
-
|
|
245
|
-
export const ownOf = (build: Build, prop: FeaturesProp | undefined, report: (cause: Cause.Cause<unknown>) => void, host: SectionHost): Own => {
|
|
246
|
-
if (Predicate.isUndefined(prop)) return NO_OWN
|
|
247
|
-
if (isLoad(prop)) return loaded(build, prop, report, host)
|
|
248
|
-
const features = flatten(prop)
|
|
249
|
-
if (host.server) build(features)
|
|
250
|
-
let built: Context.Context<never> | undefined
|
|
251
|
-
return {
|
|
252
|
-
services: () =>
|
|
253
|
-
UndefinedOr.match(built, {
|
|
254
|
-
onDefined: identity,
|
|
255
|
-
onUndefined: () => {
|
|
256
|
-
built = build(features)
|
|
257
|
-
return built
|
|
258
|
-
},
|
|
259
|
-
}),
|
|
260
|
-
pending: constFalse,
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/** What builds Features: a registry's `build`. */
|
|
265
|
-
export type Build = (features: ReadonlyArray<Feature>) => Context.Context<never>
|
|
266
|
-
|
|
267
|
-
/** Features loaded lazily: none until they arrive, which a trigger tells; on the client only. */
|
|
268
|
-
const loaded = (build: Build, load: FeatureLoad, report: (cause: Cause.Cause<unknown>) => void, host: SectionHost): Own => {
|
|
269
|
-
if (host.server) return NO_OWN
|
|
270
|
-
const changed = host.reactivity.trigger()
|
|
271
|
-
let services = NONE
|
|
272
|
-
let pending = true
|
|
273
|
-
let live = true
|
|
274
|
-
host.onCleanup(() => {
|
|
275
|
-
live = false
|
|
276
|
-
})
|
|
277
|
-
load().then(
|
|
278
|
-
(features) => {
|
|
279
|
-
if (!live) return
|
|
280
|
-
services = build(flatten(features))
|
|
281
|
-
pending = false
|
|
282
|
-
changed.notify()
|
|
283
|
-
},
|
|
284
|
-
(error: unknown) => {
|
|
285
|
-
if (!live) return
|
|
286
|
-
pending = false
|
|
287
|
-
changed.notify()
|
|
288
|
-
report(Cause.die(error))
|
|
289
|
-
},
|
|
290
|
-
)
|
|
291
|
-
return {
|
|
292
|
-
services: () => {
|
|
293
|
-
changed.track()
|
|
294
|
-
return services
|
|
295
|
-
},
|
|
296
|
-
pending: () => {
|
|
297
|
-
changed.track()
|
|
298
|
-
return pending
|
|
299
|
-
},
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* A provider's Features: each built once, on first need, and every list it's asked for joined once.
|
|
305
|
-
* `build` is synchronous; a Feature's Layer that can't build at once is a defect.
|
|
306
|
-
*/
|
|
307
|
-
export interface FeatureRegistry {
|
|
308
|
-
/** The services of `features`, each Feature built the first time it's asked for. */
|
|
309
|
-
readonly build: (features: ReadonlyArray<Feature>) => Context.Context<never>
|
|
310
|
-
/** A section of exactly `features`, nothing on its way: one per list, a Complete element's (#511). */
|
|
311
|
-
readonly section: (features: ReadonlyArray<Feature>) => FeatureSection
|
|
312
|
-
/**
|
|
313
|
-
* The services of every Feature built so far, whichever section asked: what a part of the provider
|
|
314
|
-
* that brings no Feature works with when one is there (the projection system, for a presence).
|
|
315
|
-
*/
|
|
316
|
-
readonly built: () => Context.Context<never>
|
|
317
|
-
/** Logs `message` at Warning the first time `feature` is named: development's word on a missing Feature. */
|
|
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
|
|
321
|
-
/** Ends every Feature built, the provider's runtime after (a Feature's Layer may stand on it). */
|
|
322
|
-
readonly dispose: () => Promise<void>
|
|
323
|
-
}
|
|
324
|
-
|
|
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) => {
|
|
338
|
-
const sections = new WeakMap<ReadonlyArray<Feature>, FeatureSection>()
|
|
339
|
-
const ends: Array<() => void> = []
|
|
340
|
-
const warned = new Set<string>()
|
|
341
|
-
return {
|
|
342
|
-
onEnd: (end: () => void): void => {
|
|
343
|
-
ends.push(end)
|
|
344
|
-
},
|
|
345
|
-
end: (): void => Arr.forEach(ends.splice(0), (end) => end()),
|
|
346
|
-
section: (features: ReadonlyArray<Feature>): FeatureSection =>
|
|
347
|
-
UndefinedOr.match(sections.get(features), {
|
|
348
|
-
onDefined: identity,
|
|
349
|
-
onUndefined: () => {
|
|
350
|
-
const services = build(features)
|
|
351
|
-
const section: FeatureSection = { services: () => services, pending: constFalse, strict: false }
|
|
352
|
-
sections.set(features, section)
|
|
353
|
-
return section
|
|
354
|
-
},
|
|
355
|
-
}),
|
|
356
|
-
warnOnce: (feature: string, message: string): void => {
|
|
357
|
-
if (warned.has(feature)) return
|
|
358
|
-
warned.add(feature)
|
|
359
|
-
warn(message)
|
|
360
|
-
},
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* A client provider's Features (#511): built into `runtime`'s `MemoMap` in a Scope of their own, a child
|
|
366
|
-
* of the runtime's that closes before its Layers do, so a Feature ends before the Environment it stands
|
|
367
|
-
* on. A list asked for again (the Complete element's every Feature) is joined once.
|
|
368
|
-
*/
|
|
369
|
-
// #618 (decision 4): the Scope was detached, closed by `dispose` before the runtime's, and a failing
|
|
370
|
-
// Feature finalizer skipped the runtime's disposal. A child forked after `ManagedRuntime.make`'s own
|
|
371
|
-
// closes first in its Scope's reverse order.
|
|
372
|
-
export const clientRegistry = (runtime: ProviderRuntime): FeatureRegistry => {
|
|
373
|
-
const scope = OwnerScope.open(runtime)
|
|
374
|
-
const built = new Map<Feature, Context.Context<never>>()
|
|
375
|
-
const lists = new WeakMap<ReadonlyArray<Feature>, Context.Context<never>>()
|
|
376
|
-
let all = NONE
|
|
377
|
-
const one = (feature: Feature): Context.Context<never> =>
|
|
378
|
-
UndefinedOr.match(built.get(feature), {
|
|
379
|
-
onDefined: (services) => services,
|
|
380
|
-
onUndefined: () => {
|
|
381
|
-
const services = runtime.runSync(Layer.buildWithMemoMap(feature.layer, runtime.memoMap, scope)) as Context.Context<never>
|
|
382
|
-
built.set(feature, services)
|
|
383
|
-
all = Context.merge(all, services)
|
|
384
|
-
return services
|
|
385
|
-
},
|
|
386
|
-
})
|
|
387
|
-
const build = (features: ReadonlyArray<Feature>): Context.Context<never> =>
|
|
388
|
-
UndefinedOr.match(lists.get(features), {
|
|
389
|
-
onDefined: (services) => services,
|
|
390
|
-
onUndefined: () => {
|
|
391
|
-
const services = Arr.reduce(features, NONE, (joined, feature) => Context.merge(joined, one(feature)))
|
|
392
|
-
lists.set(features, services)
|
|
393
|
-
return services
|
|
394
|
-
},
|
|
395
|
-
})
|
|
396
|
-
const { end, ...rest } = sectionsAndWarnings(build, (message) => {
|
|
397
|
-
runtime.runFork(Effect.logWarning(message))
|
|
398
|
-
})
|
|
399
|
-
return {
|
|
400
|
-
build,
|
|
401
|
-
built: () => all,
|
|
402
|
-
...rest,
|
|
403
|
-
dispose: () => {
|
|
404
|
-
end()
|
|
405
|
-
return disposeReported(runtime)
|
|
406
|
-
},
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* Disposes `runtime`, its Features first. A finalizer that fails is logged and reported, through the
|
|
412
|
-
* `ErrorReporter`s its Environment had, once the runtime has gone, and the rest still run: the promise
|
|
413
|
-
* never rejects.
|
|
414
|
-
*/
|
|
415
|
-
const disposeReported = (runtime: ProviderRuntime): Promise<void> => {
|
|
416
|
-
// Read before it goes: its reporters are in it. Unbuilt, there's none, and a report is logged only.
|
|
417
|
-
const context = runtime.cachedContext
|
|
418
|
-
return Effect.runPromiseExit(runtime.disposeEffect).then((exit) => {
|
|
419
|
-
if (Exit.isSuccess(exit)) return
|
|
420
|
-
const report = Report.failure("wardic.provider: a finalizer failed as it was disposed", exit.cause)
|
|
421
|
-
return Effect.runPromise(UndefinedOr.match(context, { onUndefined: () => report, onDefined: (services) => Effect.provideContext(report, services) }))
|
|
422
|
-
})
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* A server render's Features (ADR-0021): none built, as no runtime is; each one's `server` run once,
|
|
427
|
-
* the first time it's asked for. Disposing disposes the unbuilt runtime, as on unmount.
|
|
428
|
-
*/
|
|
429
|
-
export const serverRegistry = (runtime: ManagedRuntime.ManagedRuntime<WardicServices, never>): FeatureRegistry => {
|
|
430
|
-
const ran = new Set<Feature>()
|
|
431
|
-
const build = (features: ReadonlyArray<Feature>): Context.Context<never> => {
|
|
432
|
-
Arr.forEach(features, (feature) => {
|
|
433
|
-
if (ran.has(feature)) return
|
|
434
|
-
ran.add(feature)
|
|
435
|
-
UndefinedOr.map(feature.server, (server) => server())
|
|
436
|
-
})
|
|
437
|
-
return NONE
|
|
438
|
-
}
|
|
439
|
-
// A server render says nothing: the client, rendering the same, does.
|
|
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
|
-
}
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* A CSS function naming a colour space only the `colors` Feature reads: `oklch()`, `oklab()`, `lab()`,
|
|
454
|
-
* `lch()`, `hwb()`, and `color()` in any space but `srgb`, which the base reads.
|
|
455
|
-
*/
|
|
456
|
-
const WIDE_GAMUT = /^\s*(?:(?:oklch|oklab|lab|lch|hwb)\(|color\(\s*(?!srgb\s))/i
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* The first of `values` that only the `colors` Feature would read as a colour (#511, decision 7): a
|
|
460
|
-
* string naming a wide-gamut space, while no space beyond sRGB's is registered on the page.
|
|
461
|
-
* `undefined` when there's none. Asked of the page, not of an element's Features: culori's spaces are
|
|
462
|
-
* the page's, so one registered by any provider is read by every element (`features/colors.ts`).
|
|
463
|
-
*/
|
|
464
|
-
export const unreadColorIn = (values: Readonly<Record<string, unknown>>): string | undefined => {
|
|
465
|
-
if (Color.spacesRegistered()) return undefined
|
|
466
|
-
return Arr.findFirst(Object.values(values), (value): value is string => Predicate.isString(value) && WIDE_GAMUT.test(value)).pipe(Option.getOrUndefined)
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
* Development's word on a Complete element under a `strict` section (#511, ADR-0067 decision 7,
|
|
471
|
-
* Motion's), naming the binding's `complete` forms and the `slim` ones to use.
|
|
472
|
-
*/
|
|
473
|
-
export const strictMessage = (complete: string, slim: string): string =>
|
|
474
|
-
`wardic: a Complete element (${complete}) is rendered under a strict WardicProvider or LazyWardic. ` +
|
|
475
|
-
`It brings every Feature's code with it; render the Slim element (${slim}) instead.`
|
|
476
|
-
|
|
477
|
-
/** What development's word on a missing `layout` Feature names (#511): the props that need it. */
|
|
478
|
-
export const LAYOUT_PROPS = "A layout prop (`layout`, `layoutId`, `layoutScroll` or `layoutRoot`)"
|
|
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
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Development's word on a missing Feature (#511, ADR-0067 decision 7): what needed it, its import from
|
|
486
|
-
* the binding's `entry`, and where to add it. Not a Complete element, which a `strict` section makes
|
|
487
|
-
* an error (#581).
|
|
488
|
-
*/
|
|
489
|
-
export const missingMessage = (feature: string, what: string, entry: string): string =>
|
|
490
|
-
`wardic: ${what} needs the \`${feature}\` Feature, which no WardicProvider or LazyWardic above this element has. ` +
|
|
491
|
-
`Add it: \`import { ${feature} } from "${entry}"\`, then \`<WardicProvider features={[${feature}]}>\` or \`<LazyWardic features={[${feature}]}>\`.`
|
|
1
|
+
// #672: @wardic/dom/unstable/Feature since the lift; solid's modules import it through
|
|
2
|
+
// here until each has moved.
|
|
3
|
+
export * from "@wardic/dom/unstable/Feature"
|
package/src/features/all.ts
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* forms never do.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
import { colors } from "./colors.ts"
|
|
9
|
-
import { drag } from "./drag.ts"
|
|
10
|
-
import { focus } from "./focus.ts"
|
|
11
|
-
import { hover } from "./hover.ts"
|
|
12
|
-
import { inView } from "./in-view.ts"
|
|
13
|
-
import { layout } from "./layout.ts"
|
|
14
|
-
import { pan } from "./pan.ts"
|
|
15
|
-
import { press } from "./press.ts"
|
|
16
|
-
|
|
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
|
-
]
|
|
1
|
+
// #672: @wardic/dom/unstable/features/All since the lift; solid's modules import it through
|
|
2
|
+
// here until each has moved.
|
|
3
|
+
export * from "@wardic/dom/unstable/features/All"
|
package/src/features/colors.ts
CHANGED
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Rollup kept `registerSpaces` and every space's definition for the callback `Effect.sync` is given,
|
|
5
|
-
* though nothing of the module's was emitted (1 KB gzipped on a Slim element's app).
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import * as InterpolatorRegistry from "@wardic/core/InterpolatorRegistry"
|
|
10
|
-
import * as Color from "@wardic/dom/Color"
|
|
11
|
-
import * as Effect from "effect/Effect"
|
|
12
|
-
import * as Layer from "effect/Layer"
|
|
13
|
-
import type { Feature } from "../feature.ts"
|
|
14
|
-
import { Colors } from "./keys.ts"
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Every CSS colour space beyond a hex, `rgb()`, `hsl()` and the colour names, which every element
|
|
18
|
-
* reads: `oklch()`, `lab()`, `lch()`, `oklab()`, `hwb()` and `color()`'s spaces (`display-p3`,
|
|
19
|
-
* `rec2020` …). Blends don't change: every colour blends in sRGB. culori
|
|
20
|
-
* keeps its spaces in one registry for the page, so once one provider, or a server render, registers
|
|
21
|
-
* them, every element on the page reads them; a pair another provider resolved before stays as it
|
|
22
|
-
* was resolved there.
|
|
23
|
-
*/
|
|
24
|
-
export const colors: Feature<Colors, true, "colors"> = {
|
|
25
|
-
name: "colors",
|
|
26
|
-
key: Colors,
|
|
27
|
-
// The provider's registry forgets the pairs it resolved before: one with a wide-gamut colour read as
|
|
28
|
-
// a complex value then is a colour from now on (decision 8, "from then on").
|
|
29
|
-
layer: /*#__PURE__*/ Layer.effect(Colors)(
|
|
30
|
-
/*#__PURE__*/ Effect.flatMap(InterpolatorRegistry.InterpolatorRegistry, (registry) => {
|
|
31
|
-
Color.registerSpaces()
|
|
32
|
-
return Effect.as(registry.forget, true as const)
|
|
33
|
-
}),
|
|
34
|
-
),
|
|
35
|
-
server: Color.registerSpaces,
|
|
36
|
-
}
|
|
1
|
+
// #672: @wardic/dom/unstable/features/Colors since the lift; solid's modules import it through
|
|
2
|
+
// here until each has moved.
|
|
3
|
+
export * from "@wardic/dom/unstable/features/Colors"
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* apart from `domMax` (#548), so a page given `domAnimation` never ships `domMax`'s Features with it.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
import { focus } from "./focus.ts"
|
|
9
|
-
import { hover } from "./hover.ts"
|
|
10
|
-
import { inView } from "./in-view.ts"
|
|
11
|
-
import { press } from "./press.ts"
|
|
12
|
-
|
|
13
|
-
/** Motion's `domAnimation`: the gestures an element animates on without dragging, `hover`, `press`, `focus` and `inView`. */
|
|
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]
|
|
1
|
+
// #672: @wardic/dom/unstable/features/DomAnimation since the lift; solid's modules import it through
|
|
2
|
+
// here until each has moved.
|
|
3
|
+
export * from "@wardic/dom/unstable/features/DomAnimation"
|
package/src/features/dom-max.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { ALL } from "./all.ts"
|
|
8
|
-
|
|
9
|
-
/** Motion's `domMax`: every Feature, `pan`, `drag`, `layout` and `colors` beside `domAnimation`'s, as a Complete element has. */
|
|
10
|
-
export const domMax: typeof ALL = ALL
|
|
1
|
+
// #672: @wardic/dom/unstable/features/DomMax since the lift; solid's modules import it through
|
|
2
|
+
// here until each has moved.
|
|
3
|
+
export * from "@wardic/dom/unstable/features/DomMax"
|