@wardic/dom 1.1.0 → 1.1.2
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/DomProjectionSystem.js +3 -3
- package/dist/DomProjectionSystem.js.map +1 -1
- package/dist/FlushGate.d.ts +6 -6
- package/dist/FlushGate.d.ts.map +1 -1
- package/dist/FlushGate.js +7 -5
- package/dist/FlushGate.js.map +1 -1
- package/dist/ReorderController.js +3 -3
- package/dist/ReorderController.js.map +1 -1
- package/dist/Report.d.ts +1 -1
- package/dist/Report.d.ts.map +1 -1
- package/dist/Report.js +3 -2
- package/dist/Report.js.map +1 -1
- package/dist/Style.d.ts +2 -1
- package/dist/Style.d.ts.map +1 -1
- package/dist/Style.js +3 -1
- package/dist/Style.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/batch-handoff.d.ts +25 -0
- package/dist/internal/batch-handoff.d.ts.map +1 -0
- package/dist/internal/batch-handoff.js +64 -0
- package/dist/internal/batch-handoff.js.map +1 -0
- package/dist/internal/gate-environment.d.ts +4 -0
- package/dist/internal/gate-environment.d.ts.map +1 -0
- package/dist/internal/gate-environment.js +21 -0
- package/dist/internal/gate-environment.js.map +1 -0
- package/dist/internal/projection.js +14 -14
- package/dist/internal/projection.js.map +1 -1
- package/dist/internal/reorder.d.ts +2 -2
- package/dist/internal/reorder.d.ts.map +1 -1
- package/dist/internal/reorder.js +2 -2
- package/dist/internal/reorder.js.map +1 -1
- package/dist/internal/starting-style.d.ts +0 -83
- package/dist/internal/starting-style.d.ts.map +1 -1
- package/dist/internal/starting-style.js +16 -143
- package/dist/internal/starting-style.js.map +1 -1
- package/dist/unstable/AppearAnimations.d.ts +191 -0
- package/dist/unstable/AppearAnimations.d.ts.map +1 -0
- package/dist/unstable/AppearAnimations.js +561 -0
- package/dist/unstable/AppearAnimations.js.map +1 -0
- package/dist/unstable/BatchMembers.d.ts +513 -0
- package/dist/unstable/BatchMembers.d.ts.map +1 -0
- package/dist/unstable/BatchMembers.js +2490 -0
- package/dist/unstable/BatchMembers.js.map +1 -0
- package/dist/unstable/DomValues.d.ts +25 -0
- package/dist/unstable/DomValues.d.ts.map +1 -0
- package/dist/unstable/DomValues.js +45 -0
- package/dist/unstable/DomValues.js.map +1 -0
- package/dist/unstable/DragConstraints.d.ts +48 -0
- package/dist/unstable/DragConstraints.d.ts.map +1 -0
- package/dist/unstable/DragConstraints.js +49 -0
- package/dist/unstable/DragConstraints.js.map +1 -0
- package/dist/unstable/DragControls.d.ts +50 -0
- package/dist/unstable/DragControls.d.ts.map +1 -0
- package/dist/unstable/DragControls.js +55 -0
- package/dist/unstable/DragControls.js.map +1 -0
- package/dist/unstable/DragDefaults.d.ts +34 -0
- package/dist/unstable/DragDefaults.d.ts.map +1 -0
- package/dist/unstable/DragDefaults.js +47 -0
- package/dist/unstable/DragDefaults.js.map +1 -0
- package/dist/unstable/DragTrack.d.ts +236 -0
- package/dist/unstable/DragTrack.d.ts.map +1 -0
- package/dist/unstable/DragTrack.js +646 -0
- package/dist/unstable/DragTrack.js.map +1 -0
- package/dist/unstable/DragTransition.d.ts +22 -0
- package/dist/unstable/DragTransition.d.ts.map +1 -0
- package/dist/unstable/DragTransition.js +31 -0
- package/dist/unstable/DragTransition.js.map +1 -0
- package/dist/unstable/ElementSetup.d.ts +144 -0
- package/dist/unstable/ElementSetup.d.ts.map +1 -0
- package/dist/unstable/ElementSetup.js +297 -0
- package/dist/unstable/ElementSetup.js.map +1 -0
- package/dist/unstable/Feature.d.ts +221 -0
- package/dist/unstable/Feature.d.ts.map +1 -0
- package/dist/unstable/Feature.js +281 -0
- package/dist/unstable/Feature.js.map +1 -0
- package/dist/unstable/GestureFeatures.d.ts +30 -0
- package/dist/unstable/GestureFeatures.d.ts.map +1 -0
- package/dist/unstable/GestureFeatures.js +32 -0
- package/dist/unstable/GestureFeatures.js.map +1 -0
- package/dist/unstable/GestureInfo.d.ts +61 -0
- package/dist/unstable/GestureInfo.d.ts.map +1 -0
- package/dist/unstable/GestureInfo.js +23 -0
- package/dist/unstable/GestureInfo.js.map +1 -0
- package/dist/unstable/Imperative.d.ts +214 -0
- package/dist/unstable/Imperative.d.ts.map +1 -0
- package/dist/unstable/Imperative.js +768 -0
- package/dist/unstable/Imperative.js.map +1 -0
- package/dist/unstable/Instant.d.ts +46 -0
- package/dist/unstable/Instant.d.ts.map +1 -0
- package/dist/unstable/Instant.js +49 -0
- package/dist/unstable/Instant.js.map +1 -0
- package/dist/unstable/LayoutGroup.d.ts +14 -0
- package/dist/unstable/LayoutGroup.d.ts.map +1 -0
- package/dist/unstable/LayoutGroup.js +31 -0
- package/dist/unstable/LayoutGroup.js.map +1 -0
- package/dist/unstable/LayoutMember.d.ts +127 -0
- package/dist/unstable/LayoutMember.d.ts.map +1 -0
- package/dist/unstable/LayoutMember.js +176 -0
- package/dist/unstable/LayoutMember.js.map +1 -0
- package/dist/unstable/LiveStyle.d.ts +171 -0
- package/dist/unstable/LiveStyle.d.ts.map +1 -0
- package/dist/unstable/LiveStyle.js +329 -0
- package/dist/unstable/LiveStyle.js.map +1 -0
- package/dist/unstable/MemberHold.d.ts +3 -0
- package/dist/unstable/MemberHold.d.ts.map +1 -0
- package/dist/unstable/MemberHold.js +223 -0
- package/dist/unstable/MemberHold.js.map +1 -0
- package/dist/unstable/OwnerScope.d.ts +16 -0
- package/dist/unstable/OwnerScope.d.ts.map +1 -0
- package/dist/unstable/OwnerScope.js +35 -0
- package/dist/unstable/OwnerScope.js.map +1 -0
- package/dist/unstable/PresenceController.d.ts +128 -0
- package/dist/unstable/PresenceController.d.ts.map +1 -0
- package/dist/unstable/PresenceController.js +1427 -0
- package/dist/unstable/PresenceController.js.map +1 -0
- package/dist/unstable/Press.d.ts +26 -0
- package/dist/unstable/Press.d.ts.map +1 -0
- package/dist/unstable/Press.js +19 -0
- package/dist/unstable/Press.js.map +1 -0
- package/dist/unstable/ServerInterpolators.d.ts +17 -0
- package/dist/unstable/ServerInterpolators.d.ts.map +1 -0
- package/dist/unstable/ServerInterpolators.js +20 -0
- package/dist/unstable/ServerInterpolators.js.map +1 -0
- package/dist/unstable/WardConfig.d.ts +567 -0
- package/dist/unstable/WardConfig.d.ts.map +1 -0
- package/dist/unstable/WardConfig.js +2 -0
- package/dist/unstable/WardConfig.js.map +1 -0
- package/dist/unstable/features/All.d.ts +24 -0
- package/dist/unstable/features/All.d.ts.map +1 -0
- package/dist/unstable/features/All.js +20 -0
- package/dist/unstable/features/All.js.map +1 -0
- package/dist/unstable/features/Colors.d.ts +12 -0
- package/dist/unstable/features/Colors.d.ts.map +1 -0
- package/dist/unstable/features/Colors.js +38 -0
- package/dist/unstable/features/Colors.js.map +1 -0
- package/dist/unstable/features/DomAnimation.d.ts +16 -0
- package/dist/unstable/features/DomAnimation.d.ts.map +1 -0
- package/dist/unstable/features/DomAnimation.js +19 -0
- package/dist/unstable/features/DomAnimation.js.map +1 -0
- package/dist/unstable/features/DomMax.d.ts +12 -0
- package/dist/unstable/features/DomMax.d.ts.map +1 -0
- package/dist/unstable/features/DomMax.js +14 -0
- package/dist/unstable/features/DomMax.js.map +1 -0
- package/dist/unstable/features/Drag.d.ts +5 -0
- package/dist/unstable/features/Drag.d.ts.map +1 -0
- package/dist/unstable/features/Drag.js +32 -0
- package/dist/unstable/features/Drag.js.map +1 -0
- package/dist/unstable/features/Focus.d.ts +5 -0
- package/dist/unstable/features/Focus.d.ts.map +1 -0
- package/dist/unstable/features/Focus.js +20 -0
- package/dist/unstable/features/Focus.js.map +1 -0
- package/dist/unstable/features/Hover.d.ts +5 -0
- package/dist/unstable/features/Hover.d.ts.map +1 -0
- package/dist/unstable/features/Hover.js +20 -0
- package/dist/unstable/features/Hover.js.map +1 -0
- package/dist/unstable/features/InView.d.ts +5 -0
- package/dist/unstable/features/InView.d.ts.map +1 -0
- package/dist/unstable/features/InView.js +20 -0
- package/dist/unstable/features/InView.js.map +1 -0
- package/dist/unstable/features/Input.d.ts +28 -0
- package/dist/unstable/features/Input.d.ts.map +1 -0
- package/dist/unstable/features/Input.js +31 -0
- package/dist/unstable/features/Input.js.map +1 -0
- package/dist/unstable/features/Keys.d.ts +95 -0
- package/dist/unstable/features/Keys.d.ts.map +1 -0
- package/dist/unstable/features/Keys.js +44 -0
- package/dist/unstable/features/Keys.js.map +1 -0
- package/dist/unstable/features/Layout.d.ts +43 -0
- package/dist/unstable/features/Layout.d.ts.map +1 -0
- package/dist/unstable/features/Layout.js +44 -0
- package/dist/unstable/features/Layout.js.map +1 -0
- package/dist/unstable/features/Pan.d.ts +5 -0
- package/dist/unstable/features/Pan.d.ts.map +1 -0
- package/dist/unstable/features/Pan.js +20 -0
- package/dist/unstable/features/Pan.js.map +1 -0
- package/dist/unstable/features/Press.d.ts +13 -0
- package/dist/unstable/features/Press.d.ts.map +1 -0
- package/dist/unstable/features/Press.js +10 -0
- package/dist/unstable/features/Press.js.map +1 -0
- package/dist/unstable/features/Scroll.d.ts +20 -0
- package/dist/unstable/features/Scroll.d.ts.map +1 -0
- package/dist/unstable/features/Scroll.js +34 -0
- package/dist/unstable/features/Scroll.js.map +1 -0
- package/dist/unstable/features/TimelineKeys.d.ts +7 -0
- package/dist/unstable/features/TimelineKeys.d.ts.map +1 -0
- package/dist/unstable/features/TimelineKeys.js +103 -0
- package/dist/unstable/features/TimelineKeys.js.map +1 -0
- package/package.json +4 -3
- package/src/DomProjectionSystem.ts +3 -3
- package/src/FlushGate.ts +11 -9
- package/src/ReorderController.ts +3 -3
- package/src/Report.ts +3 -7
- package/src/Style.ts +4 -1
- package/src/index.ts +1 -1
- package/src/internal/batch-handoff.ts +75 -0
- package/src/internal/gate-environment.ts +21 -0
- package/src/internal/projection.ts +14 -14
- package/src/internal/reorder.ts +4 -4
- package/src/internal/starting-style.ts +5 -204
- package/src/unstable/AppearAnimations.ts +837 -0
- package/src/unstable/BatchMembers.ts +3085 -0
- package/src/unstable/DomValues.ts +53 -0
- package/src/unstable/DragConstraints.ts +107 -0
- package/src/unstable/DragControls.ts +98 -0
- package/src/unstable/DragDefaults.ts +57 -0
- package/src/unstable/DragTrack.ts +959 -0
- package/src/unstable/DragTransition.ts +46 -0
- package/src/unstable/ElementSetup.ts +411 -0
- package/src/unstable/Feature.ts +494 -0
- package/src/unstable/GestureFeatures.ts +38 -0
- package/src/unstable/GestureInfo.ts +85 -0
- package/src/unstable/Imperative.ts +1037 -0
- package/src/unstable/Instant.ts +93 -0
- package/src/unstable/LayoutGroup.ts +36 -0
- package/src/unstable/LayoutMember.ts +319 -0
- package/src/unstable/LiveStyle.ts +497 -0
- package/src/unstable/MemberHold.ts +211 -0
- package/src/unstable/OwnerScope.ts +35 -0
- package/src/unstable/PresenceController.ts +1747 -0
- package/src/unstable/Press.ts +43 -0
- package/src/unstable/ServerInterpolators.ts +39 -0
- package/src/unstable/WardConfig.ts +704 -0
- package/src/unstable/features/All.ts +39 -0
- package/src/unstable/features/Colors.ts +40 -0
- package/src/unstable/features/DomAnimation.ts +19 -0
- package/src/unstable/features/DomMax.ts +14 -0
- package/src/unstable/features/Drag.ts +34 -0
- package/src/unstable/features/Focus.ts +21 -0
- package/src/unstable/features/Hover.ts +21 -0
- package/src/unstable/features/InView.ts +21 -0
- package/src/unstable/features/Input.ts +37 -0
- package/src/unstable/features/Keys.ts +124 -0
- package/src/unstable/features/Layout.ts +75 -0
- package/src/unstable/features/Pan.ts +21 -0
- package/src/unstable/features/Press.ts +21 -0
- package/src/unstable/features/Scroll.ts +35 -0
- package/src/unstable/features/TimelineKeys.ts +115 -0
- package/dist/internal/gate.d.ts +0 -199
- package/dist/internal/gate.d.ts.map +0 -1
- package/dist/internal/gate.js +0 -570
- package/dist/internal/gate.js.map +0 -1
- package/dist/internal/report.d.ts +0 -30
- package/dist/internal/report.d.ts.map +0 -1
- package/dist/internal/report.js +0 -60
- package/dist/internal/report.js.map +0 -1
- package/dist/internal/runner.d.ts +0 -22
- package/dist/internal/runner.d.ts.map +0 -1
- package/dist/internal/runner.js +0 -62
- package/dist/internal/runner.js.map +0 -1
- package/src/internal/gate.ts +0 -706
- package/src/internal/report.ts +0 -69
- package/src/internal/runner.ts +0 -78
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as DomProjectionSystem from "../../DomProjectionSystem.js";
|
|
2
|
+
import * as FlushGate from "../../FlushGate.js";
|
|
3
|
+
import * as ProjectionSystem from "../../ProjectionSystem.js";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
|
+
import * as UndefinedOr from "effect/UndefinedOr";
|
|
7
|
+
import * as Feature from "../Feature.js";
|
|
8
|
+
import * as LayoutMember from "../LayoutMember.js";
|
|
9
|
+
import * as Keys from "./Keys.js";
|
|
10
|
+
/**
|
|
11
|
+
* Layout animations: a provider's projection system, built once for the provider, over its
|
|
12
|
+
* flush gate and with its reduced motion and scale correctors. Every section with it shares it, as the
|
|
13
|
+
* projection tree is the page's: a `layoutId` pair in two sections still crossfades.
|
|
14
|
+
*/
|
|
15
|
+
export const layout = {
|
|
16
|
+
name: "layout",
|
|
17
|
+
key: ProjectionSystem.ProjectionSystem,
|
|
18
|
+
// The engine, and what its Reorder controllers hear each Measure pass by, beside it (#618); and the
|
|
19
|
+
// code that makes a Wardic element's node on it, here so the base ships none (#746).
|
|
20
|
+
layer: /*#__PURE__*/ Layer.merge(
|
|
21
|
+
/*#__PURE__*/ Layer.effectContext(
|
|
22
|
+
/*#__PURE__*/ Effect.flatMap(FlushGate.FlushGate, (gate) => Effect.flatMap(Feature.ProjectionOptions, (options) => DomProjectionSystem.make(gate, options)))),
|
|
23
|
+
/*#__PURE__*/ Layer.succeed(Keys.ProjectionNodes, { optionsOf: LayoutMember.layoutOptionsOf, registrationOf: LayoutMember.registrationOf })),
|
|
24
|
+
};
|
|
25
|
+
/** What a component that brings `layout` asks its provider for: one list, so the provider joins it once. */
|
|
26
|
+
const BRINGS = [layout];
|
|
27
|
+
/**
|
|
28
|
+
* The projection system of `value`'s provider, its `layout` Feature built now if nothing has built it
|
|
29
|
+
* yet (#511, decision 12): what a component that brings it works with (`LayoutGroup`, `Reorder`,
|
|
30
|
+
* `createProjectionNode`), whatever its section has. A clear error during a server render, which builds
|
|
31
|
+
* none (ADR-0021).
|
|
32
|
+
*/
|
|
33
|
+
export const projectionBrought = (value) => UndefinedOr.getOrThrowWith(Keys.projectionIn(value.features.build(BRINGS)), () => new Error("useWardicProjection: there is no projection system during a server render (ADR-0021)"));
|
|
34
|
+
/**
|
|
35
|
+
* The `layout` Feature's element code (#746), brought as {@link projectionBrought} brings the projection
|
|
36
|
+
* system, whose call comes first and gives a server render's error: what `createProjectionNode` registers through.
|
|
37
|
+
*/
|
|
38
|
+
export const projectionNodesBrought = (value) => Keys.projectionNodesIn(value.features.build(BRINGS));
|
|
39
|
+
/** {@link projectionBrought}'s services, all of them: what a Reorder controller is built with (#618). */
|
|
40
|
+
export const layoutBrought = (value) => {
|
|
41
|
+
projectionBrought(value);
|
|
42
|
+
return value.features.build(BRINGS);
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=Layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/unstable/features/Layout.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,mBAAmB,MAAM,8BAA8B,CAAA;AACnE,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAC/C,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAA;AAG7D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAyF;IAC1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AAQ,CAAC,KAAK,CAAC,MAAM,CAAoC,CAAA;AACxE,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pan.d.ts","sourceRoot":"","sources":["../../../src/unstable/features/Pan.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAGjC,uCAAuC;AACvC,eAAO,MAAM,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,KAAK,CAInF,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The **`pan` Feature** (#511, ADR-0067 decision 3): an element's pan (`onPan`, `onPanStart`, `onPanSessionStart`, `onPanEnd`; Solid 2's `"pan"` events), in a module of its own, so an app that
|
|
3
|
+
* never imports it ships none of it. Its top-level calls are marked pure, as every Feature module's are.
|
|
4
|
+
*
|
|
5
|
+
* Unstable, for Wardic's own packages: public, with no semver promise.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
// Unstable: ADR-0071, decision 5. #672 (PR6-Q1): solid's `features/pan.ts`, moved to dom with the Features, for
|
|
10
|
+
// every DOM binding.
|
|
11
|
+
import * as DragRecognizer from "@wardic/core/DragRecognizer";
|
|
12
|
+
import * as Keys from "./Keys.js";
|
|
13
|
+
import * as Input from "./Input.js";
|
|
14
|
+
/** Pan gestures: the pan callbacks. */
|
|
15
|
+
export const pan = {
|
|
16
|
+
name: "pan",
|
|
17
|
+
key: Keys.PanGesture,
|
|
18
|
+
layer: /*#__PURE__*/ Input.gestureLayer(Keys.PanGesture, (source) => ({ watch: Input.withInput(source, DragRecognizer.watchPan) })),
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=Pan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pan.js","sourceRoot":"","sources":["../../../src/unstable/features/Pan.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,gHAAgH;AAChH,qBAAqB;AACrB,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAA;AAE7D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC,uCAAuC;AACvC,MAAM,CAAC,MAAM,GAAG,GAAwE;IACtF,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,IAAI,CAAC,UAAU;IACpB,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;CACpI,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The **`press` Feature** (#511, ADR-0067 decision 3): an element's press, its Keyboard presses included (`whileTap`, `onTap…`; Solid 2's `"tap"` events), in a module of its own, so an app that
|
|
3
|
+
* never imports it ships none of it. Its top-level calls are marked pure, as every Feature module's are.
|
|
4
|
+
*
|
|
5
|
+
* Unstable, for Wardic's own packages: public, with no semver promise.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type * as Feature from "../Feature.ts";
|
|
10
|
+
import * as Keys from "./Keys.ts";
|
|
11
|
+
/** Press gestures, a pointer's and the keyboard's: `whileTap` and the tap callbacks. */
|
|
12
|
+
export declare const press: Feature.Feature<Keys.PressGesture, Keys.PressGesture["Service"], "press">;
|
|
13
|
+
//# sourceMappingURL=Press.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Press.d.ts","sourceRoot":"","sources":["../../../src/unstable/features/Press.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAIjC,wFAAwF;AACxF,eAAO,MAAM,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,CAI3F,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Keys from "./Keys.js";
|
|
2
|
+
import * as Press from "../Press.js";
|
|
3
|
+
import * as Input from "./Input.js";
|
|
4
|
+
/** Press gestures, a pointer's and the keyboard's: `whileTap` and the tap callbacks. */
|
|
5
|
+
export const press = {
|
|
6
|
+
name: "press",
|
|
7
|
+
key: Keys.PressGesture,
|
|
8
|
+
layer: /*#__PURE__*/ Input.gestureLayer(Keys.PressGesture, (source) => ({ watch: Input.withInput(source, Press.watchPressOn) })),
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=Press.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Press.js","sourceRoot":"","sources":["../../../src/unstable/features/Press.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AACpC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC,wFAAwF;AACxF,MAAM,CAAC,MAAM,KAAK,GAA8E;IAC9F,IAAI,EAAE,OAAO;IACb,GAAG,EAAE,IAAI,CAAC,YAAY;IACtB,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;CACjI,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The **`scroll` Feature** (#518, ADR-0067 *Amendment (#518)*, decision 5), in a module of its own: a
|
|
3
|
+
* container's scroll, which `createScroll` brings, so an app that reads no scroll ships none of the
|
|
4
|
+
* Environment's scroll code. With it, the Timeline values (#240): a value derived from the scroll by
|
|
5
|
+
* ranges alone, drawn by the browser with the scroll. Its top-level calls are marked pure, as every
|
|
6
|
+
* Feature module's are.
|
|
7
|
+
*
|
|
8
|
+
* Unstable, for Wardic's own packages: public, with no semver promise.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import * as ScrollSource from "@wardic/core/ScrollSource";
|
|
13
|
+
import * as Feature from "../Feature.ts";
|
|
14
|
+
/**
|
|
15
|
+
* A container's scroll, live, for the scroll-linked values. `createScroll` brings it, so an app doesn't
|
|
16
|
+
* give it. The Environment's `ScrollSource` when it gives one (`@wardic/test`'s `TestLive`), else the
|
|
17
|
+
* DOM's, built once per provider. Its Timeline values run where the browser has native scroll timelines.
|
|
18
|
+
*/
|
|
19
|
+
export declare const scroll: Feature.Feature<ScrollSource.ScrollSource, ScrollSource.ScrollSource["Service"], "scroll">;
|
|
20
|
+
//# sourceMappingURL=Scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scroll.d.ts","sourceRoot":"","sources":["../../../src/unstable/features/Scroll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,YAAY,MAAM,2BAA2B,CAAA;AAGzD,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAIxC;;;;GAIG;AAGH,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,QAAQ,CAO7G,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The **`scroll` Feature** (#518, ADR-0067 *Amendment (#518)*, decision 5), in a module of its own: a
|
|
3
|
+
* container's scroll, which `createScroll` brings, so an app that reads no scroll ships none of the
|
|
4
|
+
* Environment's scroll code. With it, the Timeline values (#240): a value derived from the scroll by
|
|
5
|
+
* ranges alone, drawn by the browser with the scroll. Its top-level calls are marked pure, as every
|
|
6
|
+
* Feature module's are.
|
|
7
|
+
*
|
|
8
|
+
* Unstable, for Wardic's own packages: public, with no semver promise.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
// Unstable: ADR-0071, decision 5. #672 (PR6-Q1): solid's `features/scroll.ts`, moved to dom with the Features, for
|
|
13
|
+
// every DOM binding.
|
|
14
|
+
import * as ScrollSource from "@wardic/core/ScrollSource";
|
|
15
|
+
import * as DomScrollSource from "../../DomScrollSource.js";
|
|
16
|
+
import * as Layer from "effect/Layer";
|
|
17
|
+
import * as Feature from "../Feature.js";
|
|
18
|
+
import * as Timelines from "@wardic/core/unstable/Timelines";
|
|
19
|
+
import * as TimelineKeys from "./TimelineKeys.js";
|
|
20
|
+
/**
|
|
21
|
+
* A container's scroll, live, for the scroll-linked values. `createScroll` brings it, so an app doesn't
|
|
22
|
+
* give it. The Environment's `ScrollSource` when it gives one (`@wardic/test`'s `TestLive`), else the
|
|
23
|
+
* DOM's, built once per provider. Its Timeline values run where the browser has native scroll timelines.
|
|
24
|
+
*/
|
|
25
|
+
// #240 (ADR-0043 *Amendment (#240)*, decision 4): the `Timelines` service, which an element's spine finds
|
|
26
|
+
// among the provider's built Features.
|
|
27
|
+
export const scroll = {
|
|
28
|
+
name: "scroll",
|
|
29
|
+
key: ScrollSource.ScrollSource,
|
|
30
|
+
layer: /*#__PURE__*/ Layer.merge(
|
|
31
|
+
/*#__PURE__*/ Feature.fromEnvironmentOr(ScrollSource.ScrollSource, DomScrollSource.layer),
|
|
32
|
+
/*#__PURE__*/ Layer.sync(Timelines.Timelines)(TimelineKeys.makeTimelines)),
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=Scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scroll.js","sourceRoot":"","sources":["../../../src/unstable/features/Scroll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,mHAAmH;AACnH,qBAAqB;AACrB,OAAO,KAAK,YAAY,MAAM,2BAA2B,CAAA;AACzD,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,SAAS,MAAM,iCAAiC,CAAA;AAC5D,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;;GAIG;AACH,0GAA0G;AAC1G,uCAAuC;AACvC,MAAM,CAAC,MAAM,MAAM,GAA+F;IAChH,IAAI,EAAE,QAAQ;IACd,GAAG,EAAE,YAAY,CAAC,YAAY;IAC9B,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK;IAC9B,aAAa,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,YAAY,EAAE,eAAe,CAAC,KAAK,CAAC;IACzF,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,CAC1E;CACF,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as Timelines from "@wardic/core/unstable/Timelines";
|
|
2
|
+
/**
|
|
3
|
+
* A provider's {@link Timelines.Timelines}: each mounted element's keys, told again when a `createScroll`
|
|
4
|
+
* describes its values.
|
|
5
|
+
*/
|
|
6
|
+
export declare const makeTimelines: () => Timelines.Timelines["Service"];
|
|
7
|
+
//# sourceMappingURL=TimelineKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimelineKeys.d.ts","sourceRoot":"","sources":["../../../src/unstable/features/TimelineKeys.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,SAAS,MAAM,iCAAiC,CAAA;AAcjE;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,SAAS,CAAC,SAAS,CAAC,SAAS,CAY7D,CAAA"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An element's **Timeline values** (#240, ADR-0043 *Amendment (#240)*), the `scroll` Feature's: a routed
|
|
3
|
+
* `style` key whose Live value core describes as derived from a container's scroll
|
|
4
|
+
* (`LiveValue.scrollDerivationOf`) gets the DOM's `TimelineValue`, handed to the gate while the key shows
|
|
5
|
+
* its Live value and taken back from it while anything else draws the key. Made again when what the key
|
|
6
|
+
* derives from changes: a new source in its `style`, or a `createScroll`'s new container.
|
|
7
|
+
*
|
|
8
|
+
* Unstable, for Wardic's own packages: public, with no semver promise.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
// Unstable: ADR-0071, decision 5. #672 (PR6-Q1): solid's `features/timeline-keys.ts`, moved to dom with the Features, for
|
|
13
|
+
// every DOM binding.
|
|
14
|
+
import * as LiveValue from "@wardic/core/LiveValue";
|
|
15
|
+
import * as TimelineValue from "../../TimelineValue.js";
|
|
16
|
+
import * as Bool from "effect/Boolean";
|
|
17
|
+
import * as Option from "effect/Option";
|
|
18
|
+
import * as Predicate from "effect/Predicate";
|
|
19
|
+
/**
|
|
20
|
+
* A provider's {@link Timelines.Timelines}: each mounted element's keys, told again when a `createScroll`
|
|
21
|
+
* describes its values.
|
|
22
|
+
*/
|
|
23
|
+
export const makeTimelines = () => {
|
|
24
|
+
const mounted = new Set();
|
|
25
|
+
return {
|
|
26
|
+
keysOf: (options) => {
|
|
27
|
+
const keys = elementKeysOf(options, () => mounted.delete(keys));
|
|
28
|
+
mounted.add(keys);
|
|
29
|
+
return keys;
|
|
30
|
+
},
|
|
31
|
+
described: () => {
|
|
32
|
+
mounted.forEach((keys) => keys.recheck());
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* An element's keys. `shown` runs at each write of a key's Live value, so per frame while it moves: a key
|
|
38
|
+
* shown already from the same source is left as it is, with nothing read but its source, statements and
|
|
39
|
+
* nothing made. What it derives from changes only where it's described anew, which `recheck` hears.
|
|
40
|
+
*/
|
|
41
|
+
const elementKeysOf = (options, unmounted) => {
|
|
42
|
+
const { runtime, gate, id, live } = options;
|
|
43
|
+
// #672: the spine hands its Subject; a DOM binding's is its element, which a Timeline value follows.
|
|
44
|
+
const element = options.element;
|
|
45
|
+
const made = new Map();
|
|
46
|
+
// The keys that show their Live value, whatever runs them, each with the Atom it was shown from (none
|
|
47
|
+
// for a plain accessor's): the ones `recheck` looks at again.
|
|
48
|
+
const showing = new Map();
|
|
49
|
+
// The keys whose Timeline value the gate has, each with it.
|
|
50
|
+
const running = new Map();
|
|
51
|
+
/** `key`'s Timeline value now, made again when its derivation changed; `undefined` for none. */
|
|
52
|
+
const timelineOf = (key) => {
|
|
53
|
+
const atom = live.atomOf(key);
|
|
54
|
+
if (Predicate.isUndefined(atom))
|
|
55
|
+
return undefined;
|
|
56
|
+
const derivation = Option.getOrUndefined(LiveValue.scrollDerivationOf(atom));
|
|
57
|
+
if (Predicate.isUndefined(derivation))
|
|
58
|
+
return undefined;
|
|
59
|
+
const last = made.get(key);
|
|
60
|
+
if (Predicate.isNotUndefined(last)) {
|
|
61
|
+
if (last.derivation === derivation)
|
|
62
|
+
return last.timeline;
|
|
63
|
+
}
|
|
64
|
+
const timeline = Option.getOrUndefined(runtime.runSync(TimelineValue.make(derivation, element, key)));
|
|
65
|
+
made.set(key, { derivation, timeline });
|
|
66
|
+
return timeline;
|
|
67
|
+
};
|
|
68
|
+
/** The gate runs `key`'s Timeline value now, or none. */
|
|
69
|
+
const run = (key) => {
|
|
70
|
+
const timeline = timelineOf(key);
|
|
71
|
+
if (running.get(key) === timeline)
|
|
72
|
+
return;
|
|
73
|
+
gate.timeline(id, key, timeline);
|
|
74
|
+
if (Predicate.isUndefined(timeline)) {
|
|
75
|
+
running.delete(key);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
running.set(key, timeline);
|
|
79
|
+
};
|
|
80
|
+
return {
|
|
81
|
+
shown: (key) => {
|
|
82
|
+
const atom = live.atomOf(key);
|
|
83
|
+
if (showing.has(key)) {
|
|
84
|
+
if (showing.get(key) === atom)
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
showing.set(key, atom);
|
|
88
|
+
run(key);
|
|
89
|
+
},
|
|
90
|
+
taken: (key) => {
|
|
91
|
+
showing.delete(key);
|
|
92
|
+
if (Bool.not(running.has(key)))
|
|
93
|
+
return;
|
|
94
|
+
running.delete(key);
|
|
95
|
+
gate.timeline(id, key, undefined);
|
|
96
|
+
},
|
|
97
|
+
recheck: () => {
|
|
98
|
+
showing.forEach((_, key) => run(key));
|
|
99
|
+
},
|
|
100
|
+
dispose: unmounted,
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=TimelineKeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimelineKeys.js","sourceRoot":"","sources":["../../../src/unstable/features/TimelineKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,0HAA0H;AAC1H,qBAAqB;AACrB,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAgB7C;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAmC,EAAE;IAChE,MAAM,OAAO,GAAG,IAAI,GAAG,EAAe,CAAA;IACtC,OAAO;QACL,MAAM,EAAE,CAAC,OAAO,EAAE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CAAA;YACtB,GAAG,CAAC,GAAG,CAAC,CAAA;QACV,CAAC;QACD,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE;YACb,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACnB,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBAAE,OAAM;YACtC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACnB,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,CAAC,CAAA;QACnC,CAAC;QACD,OAAO,EAAE,GAAG,EAAE;YACZ,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QACvC,CAAC;QACD,OAAO,EAAE,SAAS;KACnB,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wardic/dom",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "The browser environment for Wardic: its clock, renderer, input, probe and projection system, as Effect Layers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animation",
|
|
@@ -55,13 +55,14 @@
|
|
|
55
55
|
"typecheck:tests": "../../node_modules/typescript-7/bin/tsc -p tsconfig.test.json"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@wardic/core": "1.1.
|
|
58
|
+
"@wardic/core": "1.1.2",
|
|
59
|
+
"csstype": "^3.1.0",
|
|
59
60
|
"culori": "^4.0.2"
|
|
60
61
|
},
|
|
61
62
|
"peerDependencies": {
|
|
62
63
|
"effect": "^4.1.4"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
|
-
"@wardic/test": "1.1.
|
|
66
|
+
"@wardic/test": "1.1.2"
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -19,7 +19,7 @@ import type * as Scope from "effect/Scope"
|
|
|
19
19
|
import * as FlushGate from "./FlushGate.ts"
|
|
20
20
|
import { PassEnds } from "./internal/pass-ends.ts"
|
|
21
21
|
import * as internal from "./internal/projection.ts"
|
|
22
|
-
import
|
|
22
|
+
import * as WardicServices from "@wardic/core/unstable/WardicServices"
|
|
23
23
|
import { ProjectionSystem, type Options, type Services, type Shape, type Sink } from "./ProjectionSystem.ts"
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -30,11 +30,11 @@ import { ProjectionSystem, type Options, type Services, type Shape, type Sink }
|
|
|
30
30
|
// The context holds the internal `PassEnds` too (internal/pass-ends.ts, #618), the engine's own, so a
|
|
31
31
|
// ProjectionSystem a binding wraps or replaces in its context still has its Reorder controller hear
|
|
32
32
|
// each Measure pass. Its runner forks on Effect's default scheduler, whatever call built the Layer
|
|
33
|
-
// (`
|
|
33
|
+
// (core's `unstable/WardicServices`).
|
|
34
34
|
export const make: (sink: Sink, options?: Options) => Effect.Effect<Context.Context<ProjectionSystem | PassEnds>, never, Services | Scope.Scope> =
|
|
35
35
|
/*#__PURE__*/ Effect.fnUntraced(function* (sink: Sink, options: Options = {}) {
|
|
36
36
|
// Typed without `dispose` and `onPassEnd`: the Scope ends it, and `PassEnds` hands the other out.
|
|
37
|
-
const system = internal.makeProjectionSystem(yield* makeRunner<Services>(), sink, options)
|
|
37
|
+
const system = internal.makeProjectionSystem(yield* WardicServices.makeRunner<Services>(), sink, options)
|
|
38
38
|
yield* Effect.addFinalizer(() => Effect.sync(system.dispose))
|
|
39
39
|
return Context.make(ProjectionSystem, system as Shape).pipe(Context.add(PassEnds, { onPassEnd: system.onPassEnd }))
|
|
40
40
|
})
|
package/src/FlushGate.ts
CHANGED
|
@@ -17,26 +17,28 @@
|
|
|
17
17
|
// the Frame loop, cancels a pending frame and clears what it held. Its members are plain functions, called
|
|
18
18
|
// per element and per frame. `make` is the scoped constructor, for a binding that wires it itself. `inert`
|
|
19
19
|
// (ADR-0021, decision 9): a value for a binding whose server builds no runtime, or `layerInert` for one
|
|
20
|
-
// whose server runs an Effect program.
|
|
20
|
+
// whose server runs an Effect program. #672: the gate itself is core's `unstable/FlushGate`; this module gives it
|
|
21
|
+
// the DOM's edges (`DOM_GATE`) and its service.
|
|
21
22
|
import * as Context from "effect/Context"
|
|
22
23
|
import * as Effect from "effect/Effect"
|
|
23
24
|
import * as Layer from "effect/Layer"
|
|
24
25
|
import * as Atom from "effect/reactivity/Atom"
|
|
25
26
|
import type * as Scope from "effect/Scope"
|
|
26
|
-
import * as
|
|
27
|
-
import {
|
|
27
|
+
import * as CoreFlushGate from "@wardic/core/unstable/FlushGate"
|
|
28
|
+
import { DOM_GATE } from "./internal/gate-environment.ts"
|
|
29
|
+
import * as WardicServices from "@wardic/core/unstable/WardicServices"
|
|
28
30
|
|
|
29
31
|
/** The gate: what a binding registers its elements with and writes their values into. */
|
|
30
|
-
export type Shape =
|
|
32
|
+
export type Shape = CoreFlushGate.Shape
|
|
31
33
|
|
|
32
34
|
/** An element's commit target and hooks, given to `register`. */
|
|
33
|
-
export type Sink =
|
|
35
|
+
export type Sink = CoreFlushGate.Sink
|
|
34
36
|
|
|
35
37
|
/** What a binding hands its gate: the `batch` a frame's Starting-style switches run in. */
|
|
36
|
-
export type Options =
|
|
38
|
+
export type Options = CoreFlushGate.FlushGateOptions
|
|
37
39
|
|
|
38
40
|
/** The services a gate needs from its Environment. */
|
|
39
|
-
export type Services =
|
|
41
|
+
export type Services = CoreFlushGate.FlushGateServices
|
|
40
42
|
|
|
41
43
|
/** The Environment's Flush gate. */
|
|
42
44
|
export class FlushGate extends Context.Service<FlushGate, Shape>()("@wardic/dom/FlushGate") {}
|
|
@@ -48,8 +50,8 @@ export class FlushGate extends Context.Service<FlushGate, Shape>()("@wardic/dom/
|
|
|
48
50
|
export const make: (options: Options) => Effect.Effect<Shape, never, Services | Scope.Scope> = Effect.fnUntraced(
|
|
49
51
|
function* (options: Options) {
|
|
50
52
|
// The gate itself, typed without `dispose`: the Scope ends it. Its runner forks on Effect's
|
|
51
|
-
// default scheduler, whatever call built the Layer (`
|
|
52
|
-
const gate =
|
|
53
|
+
// default scheduler, whatever call built the Layer (core's `unstable/WardicServices`).
|
|
54
|
+
const gate = CoreFlushGate.makeFlushGate(yield* WardicServices.makeRunner<Services>(), options, DOM_GATE)
|
|
53
55
|
yield* Effect.addFinalizer(() => Effect.sync(gate.dispose))
|
|
54
56
|
return gate
|
|
55
57
|
})
|
package/src/ReorderController.ts
CHANGED
|
@@ -29,7 +29,7 @@ import { constVoid } from "effect/Function"
|
|
|
29
29
|
import type * as Scope from "effect/Scope"
|
|
30
30
|
import { PassEnds } from "./internal/pass-ends.ts"
|
|
31
31
|
import * as internal from "./internal/reorder.ts"
|
|
32
|
-
import
|
|
32
|
+
import * as WardicServices from "@wardic/core/unstable/WardicServices"
|
|
33
33
|
import * as ProjectionSystem from "./ProjectionSystem.ts"
|
|
34
34
|
|
|
35
35
|
export {
|
|
@@ -66,7 +66,7 @@ export const make: <V>(options: Options<V>) => Effect.Effect<ReorderController<V
|
|
|
66
66
|
const passEnds = yield* PassEnds
|
|
67
67
|
const announcer = yield* Announcer.Announcer
|
|
68
68
|
const controller = internal.makeReorderController(
|
|
69
|
-
{ runtime: yield* makeRunner<never>(), layOut: () => projection.notify(), announce: announcer.announce, onLaidOut: passEnds.onPassEnd },
|
|
69
|
+
{ runtime: yield* WardicServices.makeRunner<never>(), layOut: () => projection.notify(), announce: announcer.announce, onLaidOut: passEnds.onPassEnd },
|
|
70
70
|
options,
|
|
71
71
|
)
|
|
72
72
|
yield* Effect.addFinalizer(() => Effect.sync(controller.dispose))
|
|
@@ -97,7 +97,7 @@ export const makePlaced: <V>(options: Options<V>) => Effect.Effect<Placed<V>, ne
|
|
|
97
97
|
let laidOut: () => void = constVoid
|
|
98
98
|
const controller = internal.makeReorderController(
|
|
99
99
|
{
|
|
100
|
-
runtime: yield* makeRunner<never>(),
|
|
100
|
+
runtime: yield* WardicServices.makeRunner<never>(),
|
|
101
101
|
// The binding places its items on a change of `values` itself.
|
|
102
102
|
layOut: constVoid,
|
|
103
103
|
announce: announcer.announce,
|
package/src/Report.ts
CHANGED
|
@@ -8,10 +8,6 @@
|
|
|
8
8
|
*
|
|
9
9
|
* yield* Report.failure("wardic: an animation failed", cause)
|
|
10
10
|
*/
|
|
11
|
-
// `@wardic/dom/Report` (#132, ADR-0041): ADR-0030, decision 4.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
debugKept,
|
|
15
|
-
debugOf,
|
|
16
|
-
type DebugLog,
|
|
17
|
-
} from "./internal/report.ts"
|
|
11
|
+
// `@wardic/dom/Report` (#132, ADR-0041): ADR-0030, decision 4. Core's since #672 (ADR-0030's
|
|
12
|
+
// *Amendment (#672)*): the spine reports from core once it's lifted there; this stays its Tier 2 face.
|
|
13
|
+
export { failure, debugKept, debugOf, type DebugLog } from "@wardic/core/unstable/Report"
|
package/src/Style.ts
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
*/
|
|
13
13
|
// `@wardic/dom/Style` (#132, ADR-0041): the **Starting style**, the merges of an app's style with
|
|
14
14
|
// Wardic's, and a drag element's defaults (ADR-0019, ADR-0021, ADR-0034).
|
|
15
|
+
// Its starting values (`toValues`, `resolveInitial`, the Keyframes' stops) are core's `unstable/Stops` since #672.
|
|
15
16
|
export {
|
|
16
|
-
startingStyle as starting,
|
|
17
17
|
resolveInitial,
|
|
18
18
|
type InitialConfig,
|
|
19
19
|
keyframesOf,
|
|
@@ -23,6 +23,9 @@ export {
|
|
|
23
23
|
type Stops,
|
|
24
24
|
toValues,
|
|
25
25
|
valuesAt,
|
|
26
|
+
} from "@wardic/core/unstable/Stops"
|
|
27
|
+
export {
|
|
28
|
+
startingStyle as starting,
|
|
26
29
|
type StyleInput as Input,
|
|
27
30
|
type StyleRecord as Style,
|
|
28
31
|
over,
|
package/src/index.ts
CHANGED
|
@@ -38,7 +38,7 @@ import * as DomPositionalKeys from "./DomPositionalKeys.ts"
|
|
|
38
38
|
import * as DomProbe from "./DomProbe.ts"
|
|
39
39
|
import * as DomRenderer from "./DomRenderer.ts"
|
|
40
40
|
|
|
41
|
-
export const VERSION = "1.1.
|
|
41
|
+
export const VERSION = "1.1.2"
|
|
42
42
|
|
|
43
43
|
export * as DomBatch from "./DomBatch.ts"
|
|
44
44
|
export * as DomClock from "./DomClock.ts"
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Batch's Handoff (#706, ADR-0044 *Amendment (#706)*): its members' Appear animations read where they've
|
|
3
|
+
* got to, and let go, at the first step of the first change after they arrive. Loaded with `import()` the
|
|
4
|
+
* first time a hydrating Batch has a member running one (Q11), so a Batch that never takes one over ships
|
|
5
|
+
* none of it. Every DOM binding's Batch loads it.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
// #672 (PR 5): solid's `batch-handoff.ts`, moved to dom's internal modules with the Batch, its one importer,
|
|
10
|
+
// which loads it at the page's first Handoff.
|
|
11
|
+
import * as Appear from "../Appear.ts"
|
|
12
|
+
import * as Effect from "effect/Effect"
|
|
13
|
+
import * as Iter from "effect/Iterable"
|
|
14
|
+
import * as Option from "effect/Option"
|
|
15
|
+
import * as Predicate from "effect/Predicate"
|
|
16
|
+
import * as AppearAnimations from "../unstable/AppearAnimations.ts"
|
|
17
|
+
import type * as WardicServices from "@wardic/core/unstable/WardicServices"
|
|
18
|
+
|
|
19
|
+
/** A Batch's members running their Appear animation, as its Handoff reads them. */
|
|
20
|
+
export interface HandoffMembers {
|
|
21
|
+
/** Their slots: each one's taken over, or let go, at the change's first step. */
|
|
22
|
+
readonly appearing: ReadonlySet<number>
|
|
23
|
+
/** A slot's element, where it has one. */
|
|
24
|
+
readonly elementOf: (slot: number) => Element | undefined
|
|
25
|
+
/** In development, a member's own transitions' key, which its animation's rule is checked against (Q9). */
|
|
26
|
+
readonly keyOf: ((slot: number) => Option.Option<string>) | undefined
|
|
27
|
+
/** Where a rule another set of transitions named is noted, at Debug. */
|
|
28
|
+
readonly runtime: WardicServices.Runner<WardicServices.WardicServices>
|
|
29
|
+
/** Each member let go of its animation, once the step's starts are done: none waits for a step then. */
|
|
30
|
+
readonly release: () => void
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** A member's rule sampled from other transitions than the client's (ADR-0044 decision 6): noted, and taken over all the same. */
|
|
34
|
+
const MISMATCH = /*#__PURE__*/ Effect.logDebug("wardic.hydration: a Batch member's Appear animation was sampled from other transitions than the client's; it goes on from the same time")
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The Handoff's `startAt`, every change's until the first one's first step: a member running its Appear
|
|
38
|
+
* animation started where that has got to; any other, `NaN`, from its start. At the first member's first step, in the frame that draws it, every such
|
|
39
|
+
* member's time is read with the page's animations, all before any is let go: a release between two reads
|
|
40
|
+
* would have the second work the page's style out again. They're let go once the step's starts are done,
|
|
41
|
+
* in its task, so no paint falls between. In development, each rule is checked once against the member's
|
|
42
|
+
* own transitions (ADR-0044 decision 6): another is noted, and taken over all the same.
|
|
43
|
+
*/
|
|
44
|
+
export const startAtOf = (members: HandoffMembers): ((slot: number) => number) => {
|
|
45
|
+
let times: Map<number, number> | undefined = undefined
|
|
46
|
+
/** Every such member's time, read at once. */
|
|
47
|
+
const timesNow = (): Map<number, number> => {
|
|
48
|
+
const read = new Map<number, number>()
|
|
49
|
+
const checked = new Set<string>()
|
|
50
|
+
const keyOf = members.keyOf
|
|
51
|
+
// Once a Handoff, over its members (#665's per-member site): reads alone.
|
|
52
|
+
Iter.forEach(members.appearing, (slot) => {
|
|
53
|
+
const el = members.elementOf(slot)
|
|
54
|
+
if (Predicate.isUndefined(el)) return
|
|
55
|
+
const animation = AppearAnimations.pageAnimationsOf(el).get(el)
|
|
56
|
+
if (Predicate.isUndefined(animation)) return
|
|
57
|
+
const name = (animation as Animation & { readonly animationName: string }).animationName
|
|
58
|
+
if (Predicate.isNotUndefined(keyOf) && !checked.has(name)) {
|
|
59
|
+
checked.add(name)
|
|
60
|
+
if (!Option.exists(keyOf(slot), (key) => Appear.matchesBatch(animation, key))) members.runtime.runFork(MISMATCH)
|
|
61
|
+
}
|
|
62
|
+
read.set(slot, Appear.elapsedOf(animation))
|
|
63
|
+
})
|
|
64
|
+
// Every one let go once this step's starts are done, a member it didn't move among them.
|
|
65
|
+
queueMicrotask(members.release)
|
|
66
|
+
return read
|
|
67
|
+
}
|
|
68
|
+
// Per member at the change's first step: statements.
|
|
69
|
+
return (slot) => {
|
|
70
|
+
if (Predicate.isUndefined(times)) times = timesNow()
|
|
71
|
+
const time = times.get(slot)
|
|
72
|
+
if (Predicate.isUndefined(time)) return Number.NaN
|
|
73
|
+
return time
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The DOM's edges of the Flush gate (#672): an element's own inline value for a patch key, and the
|
|
3
|
+
* key the DOM's renderer reserves for an element's Transform template. `FlushGate.make` gives them to
|
|
4
|
+
* the gate it builds.
|
|
5
|
+
*/
|
|
6
|
+
// #672 (PR2-Q1): out of `gate.ts`, so the gate reads no DOM and moves to core as it is.
|
|
7
|
+
import * as Predicate from "effect/Predicate"
|
|
8
|
+
import type * as FlushGate from "@wardic/core/unstable/FlushGate"
|
|
9
|
+
import { TEMPLATE_KEY } from "./renderer.ts"
|
|
10
|
+
import { dashCase } from "./svg.ts"
|
|
11
|
+
|
|
12
|
+
/** The element's inline value for a patch key, before the gate writes it (`""` for none, or a target with no style). */
|
|
13
|
+
const valueBeforeOf = (target: unknown, key: string): string => {
|
|
14
|
+
if (Predicate.isNullish(target)) return ""
|
|
15
|
+
const style = (target as { readonly style?: CSSStyleDeclaration }).style
|
|
16
|
+
if (Predicate.isUndefined(style)) return ""
|
|
17
|
+
return style.getPropertyValue(dashCase(key))
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** The DOM's: its inline style, and its renderer's Transform template key. */
|
|
21
|
+
export const DOM_GATE: FlushGate.GateEnvironment = { valueBeforeOf, templateKey: TEMPLATE_KEY }
|