@wardic/dom 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MeasuredPair.d.ts +14 -1
- package/dist/MeasuredPair.d.ts.map +1 -1
- package/dist/MeasuredPair.js +11 -13
- package/dist/MeasuredPair.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/appear.d.ts +6 -0
- package/dist/internal/appear.d.ts.map +1 -1
- package/dist/internal/appear.js +20 -2
- package/dist/internal/appear.js.map +1 -1
- package/dist/internal/batch-handoff.d.ts.map +1 -1
- package/dist/internal/batch-handoff.js +25 -15
- package/dist/internal/batch-handoff.js.map +1 -1
- package/dist/internal/batch-writer.d.ts +1 -1
- package/dist/internal/batch-writer.d.ts.map +1 -1
- package/dist/internal/batch-writer.js +32 -16
- package/dist/internal/batch-writer.js.map +1 -1
- package/dist/internal/clock.d.ts +6 -0
- package/dist/internal/clock.d.ts.map +1 -1
- package/dist/internal/clock.js +27 -0
- package/dist/internal/clock.js.map +1 -1
- package/dist/internal/default-transition.d.ts +3 -2
- package/dist/internal/default-transition.d.ts.map +1 -1
- package/dist/internal/default-transition.js +28 -3
- package/dist/internal/default-transition.js.map +1 -1
- package/dist/internal/failing.d.ts +9 -0
- package/dist/internal/failing.d.ts.map +1 -0
- package/dist/internal/failing.js +33 -0
- package/dist/internal/failing.js.map +1 -0
- package/dist/internal/length-keys.d.ts +19 -0
- package/dist/internal/length-keys.d.ts.map +1 -0
- package/dist/internal/length-keys.js +77 -0
- package/dist/internal/length-keys.js.map +1 -0
- package/dist/internal/measured-pairs.d.ts +3 -2
- package/dist/internal/measured-pairs.d.ts.map +1 -1
- package/dist/internal/measured-pairs.js +60 -23
- package/dist/internal/measured-pairs.js.map +1 -1
- package/dist/internal/own-values.d.ts.map +1 -1
- package/dist/internal/own-values.js +2 -2
- package/dist/internal/own-values.js.map +1 -1
- package/dist/internal/positional-keys.d.ts +1 -1
- package/dist/internal/positional-keys.d.ts.map +1 -1
- package/dist/internal/positional-keys.js +4 -2
- package/dist/internal/positional-keys.js.map +1 -1
- package/dist/internal/projection.d.ts.map +1 -1
- package/dist/internal/projection.js +180 -46
- package/dist/internal/projection.js.map +1 -1
- package/dist/internal/renderer.d.ts +59 -27
- package/dist/internal/renderer.d.ts.map +1 -1
- package/dist/internal/renderer.js +241 -207
- package/dist/internal/renderer.js.map +1 -1
- package/dist/internal/scroll.d.ts.map +1 -1
- package/dist/internal/scroll.js +26 -2
- package/dist/internal/scroll.js.map +1 -1
- package/dist/internal/starting-style.js +5 -5
- package/dist/internal/transform-keys.d.ts +23 -0
- package/dist/internal/transform-keys.d.ts.map +1 -0
- package/dist/internal/transform-keys.js +55 -0
- package/dist/internal/transform-keys.js.map +1 -0
- package/dist/unstable/AppearAnimations.d.ts +2 -1
- package/dist/unstable/AppearAnimations.d.ts.map +1 -1
- package/dist/unstable/AppearAnimations.js +73 -22
- package/dist/unstable/AppearAnimations.js.map +1 -1
- package/dist/unstable/BatchMembers.d.ts +2 -2
- package/dist/unstable/BatchMembers.d.ts.map +1 -1
- package/dist/unstable/BatchMembers.js +30 -7
- package/dist/unstable/BatchMembers.js.map +1 -1
- package/dist/unstable/DomValues.js +1 -1
- package/dist/unstable/DomValues.js.map +1 -1
- package/dist/unstable/DragTrack.d.ts +2 -2
- package/dist/unstable/DragTrack.d.ts.map +1 -1
- package/dist/unstable/DragTrack.js +37 -10
- package/dist/unstable/DragTrack.js.map +1 -1
- package/dist/unstable/ElementSetup.d.ts.map +1 -1
- package/dist/unstable/ElementSetup.js +3 -2
- package/dist/unstable/ElementSetup.js.map +1 -1
- package/dist/unstable/GestureFeatures.d.ts +8 -2
- package/dist/unstable/GestureFeatures.d.ts.map +1 -1
- package/dist/unstable/GestureFeatures.js +26 -40
- package/dist/unstable/GestureFeatures.js.map +1 -1
- package/dist/unstable/GestureInfo.d.ts +11 -0
- package/dist/unstable/GestureInfo.d.ts.map +1 -1
- package/dist/unstable/GestureInfo.js +8 -0
- package/dist/unstable/GestureInfo.js.map +1 -1
- package/dist/unstable/Imperative.d.ts +1 -1
- package/dist/unstable/Imperative.d.ts.map +1 -1
- package/dist/unstable/Imperative.js.map +1 -1
- package/dist/unstable/LiveStyle.d.ts +28 -2
- package/dist/unstable/LiveStyle.d.ts.map +1 -1
- package/dist/unstable/LiveStyle.js +8 -32
- package/dist/unstable/LiveStyle.js.map +1 -1
- package/dist/unstable/MemberHold.js +3 -3
- package/dist/unstable/MemberHold.js.map +1 -1
- package/dist/unstable/PointerValues.d.ts.map +1 -1
- package/dist/unstable/PointerValues.js +82 -8
- package/dist/unstable/PointerValues.js.map +1 -1
- package/dist/unstable/PresenceController.d.ts +5 -2
- package/dist/unstable/PresenceController.d.ts.map +1 -1
- package/dist/unstable/PresenceController.js +82 -55
- package/dist/unstable/PresenceController.js.map +1 -1
- package/dist/unstable/ReorderInput.d.ts +2 -2
- package/dist/unstable/ReorderInput.js +2 -2
- package/dist/unstable/WardConfig.d.ts +18 -9
- package/dist/unstable/WardConfig.d.ts.map +1 -1
- package/dist/unstable/WardConfig.js.map +1 -1
- package/dist/unstable/features/TimelineKeys.d.ts.map +1 -1
- package/dist/unstable/features/TimelineKeys.js +19 -3
- package/dist/unstable/features/TimelineKeys.js.map +1 -1
- package/package.json +3 -3
- package/src/MeasuredPair.ts +21 -1
- package/src/index.ts +4 -1
- package/src/internal/appear.ts +20 -2
- package/src/internal/batch-handoff.ts +19 -11
- package/src/internal/batch-writer.ts +32 -16
- package/src/internal/clock.ts +28 -0
- package/src/internal/default-transition.ts +28 -4
- package/src/internal/failing.ts +37 -0
- package/src/internal/length-keys.ts +80 -0
- package/src/internal/measured-pairs.ts +58 -22
- package/src/internal/own-values.ts +2 -2
- package/src/internal/positional-keys.ts +4 -2
- package/src/internal/projection.ts +190 -44
- package/src/internal/renderer.ts +272 -198
- package/src/internal/scroll.ts +24 -2
- package/src/internal/starting-style.ts +5 -5
- package/src/internal/transform-keys.ts +59 -0
- package/src/unstable/AppearAnimations.ts +73 -24
- package/src/unstable/BatchMembers.ts +33 -9
- package/src/unstable/DomValues.ts +1 -1
- package/src/unstable/DragTrack.ts +49 -14
- package/src/unstable/ElementSetup.ts +3 -2
- package/src/unstable/GestureFeatures.ts +38 -47
- package/src/unstable/GestureInfo.ts +24 -0
- package/src/unstable/Imperative.ts +1 -0
- package/src/unstable/LiveStyle.ts +12 -8
- package/src/unstable/MemberHold.ts +3 -3
- package/src/unstable/PointerValues.ts +73 -8
- package/src/unstable/PresenceController.ts +80 -54
- package/src/unstable/ReorderInput.ts +2 -2
- package/src/unstable/WardConfig.ts +22 -10
- package/src/unstable/features/TimelineKeys.ts +20 -3
|
@@ -1,49 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `RendererDomLive` — the browser realization of `Renderer` (ADR-0002).
|
|
3
|
+
*
|
|
4
|
+
* Split into the two halves the contract mandates:
|
|
5
|
+
*
|
|
6
|
+
* - {@link project} — PURE, synchronous: translates engine values into a DOM
|
|
7
|
+
* `Patch`. Its one piece of real work is grouping the individual transform
|
|
8
|
+
* keys (`x`/`y`/`scale`/`rotate`/…) into a single CSS `transform` string in
|
|
9
|
+
* a canonical order, and applying default units (px/deg) to bare numbers.
|
|
10
|
+
* Reused by the Starting style so this grouping/unit logic isn't duplicated in
|
|
11
|
+
* the binding (ADR-0002). No side effects, no Effect.
|
|
12
|
+
* - {@link commit} — imperative: writes each `Patch` entry onto `target.style`, now.
|
|
13
|
+
* The flush gate calls it once per element per Refresh frame (ADR-0034), and
|
|
14
|
+
* `applyTo` once per Frame.
|
|
15
|
+
*
|
|
16
|
+
* Observability (CONTEXT.md convention): `project` and `commit` are the
|
|
17
|
+
* per-frame hot path, so — exactly like core's `applyTo` per-frame writes and
|
|
18
|
+
* the Clock's `tick` — they stay quiet (no span, no per-call log).
|
|
19
|
+
*/
|
|
1
20
|
import type * as Point from "@wardic/core/Point";
|
|
2
21
|
import * as Renderer from "@wardic/core/Renderer";
|
|
22
|
+
import * as Projector from "@wardic/core/unstable/Projector";
|
|
3
23
|
import * as Layer from "effect/Layer";
|
|
4
24
|
import * as Option from "effect/Option";
|
|
25
|
+
/** Default unit appended to a bare numeric transform value, by transform key. */
|
|
26
|
+
type TransformUnit = "px" | "deg" | "";
|
|
27
|
+
/** A transform key's default unit; none for a key the table doesn't name. */
|
|
28
|
+
export declare const unitOf: (key: string) => TransformUnit;
|
|
29
|
+
/** A transform function `project` draws, and the text either side of its value, made once. */
|
|
30
|
+
export interface TransformFunc {
|
|
31
|
+
/** The property name accepted on engine values, shorthands `x`/`y`/`z` included. */
|
|
32
|
+
readonly key: string;
|
|
33
|
+
/** The CSS function name it renders as. */
|
|
34
|
+
readonly fn: string;
|
|
35
|
+
/** The value at which `project` leaves the key out (ADR-0023). */
|
|
36
|
+
readonly identity: number;
|
|
37
|
+
/** What goes before its value as the transform's first function: `translateX(`. */
|
|
38
|
+
readonly open: string;
|
|
39
|
+
/** What goes before its value after another function: ` translateX(`. */
|
|
40
|
+
readonly openAfter: string;
|
|
41
|
+
/** What goes after a number of it: its unit, and the bracket, `px)`. */
|
|
42
|
+
readonly close: string;
|
|
43
|
+
}
|
|
44
|
+
/** The element's own depth's function, `perspective()`: a plain render, a projection and a Batch draw it first. */
|
|
45
|
+
export declare const DEPTH_FUNC: TransformFunc;
|
|
5
46
|
/**
|
|
6
|
-
* CSS transform functions in their canonical emission order:
|
|
7
|
-
* then scale, then rotate, then skew. `project` walks this list and emits a
|
|
47
|
+
* CSS transform functions in their canonical emission order: the element's own
|
|
48
|
+
* depth, then the translate group, then scale, then rotate, then skew. `project` walks this list and emits a
|
|
8
49
|
* func for each key that is present in `values` and not at its identity, so the
|
|
9
50
|
* resulting `transform` string is always grouped in this order regardless of
|
|
10
51
|
* input key order.
|
|
11
52
|
*
|
|
12
|
-
* `
|
|
13
|
-
*
|
|
14
|
-
* (ADR-0022), the value at which `project` leaves the key out (ADR-0023).
|
|
53
|
+
* `identity` is the DOM's (core's, ADR-0022, and the DOM's own). The element's own depth is left out below it
|
|
54
|
+
* too (`TransformKeys.drawsDepth`).
|
|
15
55
|
*/
|
|
16
|
-
export declare const TRANSFORM_FUNCS: ReadonlyArray<
|
|
17
|
-
readonly key: string;
|
|
18
|
-
readonly fn: string;
|
|
19
|
-
readonly identity: number;
|
|
20
|
-
}>;
|
|
56
|
+
export declare const TRANSFORM_FUNCS: ReadonlyArray<TransformFunc>;
|
|
21
57
|
/**
|
|
22
|
-
* Whether `key`'s `value` adds to the element's `transform` (#240): a transform key
|
|
58
|
+
* Whether `key`'s `value` adds to the element's `transform` (#240): a transform key it draws, a
|
|
23
59
|
* `transform` string, the projection's value or a Transform template. A Timeline value drawing
|
|
24
60
|
* `transform` runs only while nothing else does. Per frame: statements.
|
|
25
61
|
*/
|
|
26
62
|
export declare const addsToTransform: (key: string, value: unknown) => boolean;
|
|
27
|
-
|
|
28
|
-
type TransformUnit = "px" | "deg" | "";
|
|
29
|
-
/**
|
|
30
|
-
* The CSS properties a bare number on is a length, drawn in `px`, spelled as Wardic's keys are
|
|
31
|
-
* (`margin-top`): Motion's, and `min-width`, `min-height`, the gaps and `letter-spacing`. The Solid
|
|
32
|
-
* bindings' value types take a number on these and on no other length, so a number never draws CSS a
|
|
33
|
-
* browser drops. `line-height` isn't one: CSS reads its bare number as a multiple. A number on any other
|
|
34
|
-
* key, `opacity`, `z-index`, a custom property, is drawn as it is; a string always is.
|
|
35
|
-
*/
|
|
36
|
-
export declare const LENGTH_KEYS: readonly ["border-width", "border-top-width", "border-right-width", "border-bottom-width", "border-left-width", "border-radius", "border-top-left-radius", "border-top-right-radius", "border-bottom-right-radius", "border-bottom-left-radius", "width", "min-width", "max-width", "height", "min-height", "max-height", "top", "right", "bottom", "left", "inset", "inset-block", "inset-block-start", "inset-block-end", "inset-inline", "inset-inline-start", "inset-inline-end", "padding", "padding-top", "padding-right", "padding-bottom", "padding-left", "padding-block", "padding-block-start", "padding-block-end", "padding-inline", "padding-inline-start", "padding-inline-end", "margin", "margin-top", "margin-right", "margin-bottom", "margin-left", "margin-block", "margin-block-start", "margin-block-end", "margin-inline", "margin-inline-start", "margin-inline-end", "gap", "row-gap", "column-gap", "font-size", "letter-spacing", "background-position-x", "background-position-y"];
|
|
37
|
-
/** One of `LENGTH_KEYS`: a CSS property a bare number on is drawn in `px`. */
|
|
38
|
-
export type LengthKey = (typeof LENGTH_KEYS)[number];
|
|
63
|
+
export { LENGTH_KEYS, type LengthKey } from "./length-keys.ts";
|
|
39
64
|
/**
|
|
40
65
|
* `key`'s own transform function for `value`, drawn even at its identity: a Timeline value's keyframe
|
|
41
66
|
* (#240), so each blends with its neighbours as one function, as the gate's values do. `None` for a key
|
|
42
67
|
* that isn't a transform key.
|
|
43
68
|
*/
|
|
44
69
|
export declare const transformFunctionOf: (key: string, value: unknown) => Option.Option<string>;
|
|
45
|
-
/** A transform key's default unit; none for a key the table doesn't name. */
|
|
46
|
-
export declare const unitOf: (key: string) => TransformUnit;
|
|
47
70
|
/**
|
|
48
71
|
* The unit {@link project} draws a bare number of `key` in: a transform key's (`px`, `deg`, or none
|
|
49
72
|
* for a scale), `px` for a length key, none for the rest. The Appear sampler judges its stops in it
|
|
@@ -111,7 +134,16 @@ export declare const heldTransformOf: (values: Readonly<Record<string, unknown>>
|
|
|
111
134
|
* DomRenderer.project({ x: 0, scale: 1, width: 200 }) // { transform: "none", width: "200px" }
|
|
112
135
|
*/
|
|
113
136
|
export declare const project: (values: Readonly<Record<string, unknown>>) => Renderer.Patch;
|
|
114
|
-
/**
|
|
137
|
+
/**
|
|
138
|
+
* One element's projector (#1030): its values drawn as {@link project} draws them, each number as the text
|
|
139
|
+
* `commit` writes, into a patch of its own that it rewrites in place at its next call. Its patch stays the
|
|
140
|
+
* same object while the element's keys do; when they change, a new one holds them, so a key that went is
|
|
141
|
+
* never written again. The gate makes one for each element it registers.
|
|
142
|
+
*/
|
|
143
|
+
export declare const makeProjector: () => Projector.Projector;
|
|
144
|
+
/**
|
|
145
|
+
* Core's `Renderer` for the DOM: `project` and a `commit` that writes a patch onto an element's style, with a
|
|
146
|
+
* projector for each element the Flush gate draws. It needs nothing.
|
|
147
|
+
*/
|
|
115
148
|
export declare const RendererDomLive: Layer.Layer<Renderer.Renderer>;
|
|
116
|
-
export {};
|
|
117
149
|
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/internal/renderer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/internal/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAEhD,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,SAAS,MAAM,iCAAiC,CAAA;AAM5D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAIvC,iFAAiF;AACjF,KAAK,aAAa,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE,CAAA;AA6BtC,6EAA6E;AAE7E,eAAO,MAAM,MAAM,QAAS,MAAM,KAAG,aAIpC,CAAA;AAED,8FAA8F;AAC9F,MAAM,WAAW,aAAa;IAC5B,oFAAoF;IACpF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,mFAAmF;IACnF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,wEAAwE;IACxE,QAAQ,CA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