@ng-native/fabric 0.3.0 → 0.5.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.
Files changed (41) hide show
  1. package/dist/aria-props.d.ts +16 -0
  2. package/dist/aria-props.js +78 -0
  3. package/dist/aria-props.js.map +1 -0
  4. package/dist/color-mix.js +1 -16
  5. package/dist/color-mix.js.map +1 -1
  6. package/dist/css.d.ts +169 -2
  7. package/dist/css.js +676 -34
  8. package/dist/css.js.map +1 -1
  9. package/dist/element-styles.d.ts +15 -0
  10. package/dist/element-styles.js +103 -0
  11. package/dist/element-styles.js.map +1 -0
  12. package/dist/engine.d.ts +252 -7
  13. package/dist/engine.js +1081 -80
  14. package/dist/engine.js.map +1 -1
  15. package/dist/font-faces.d.ts +5 -2
  16. package/dist/font-faces.js +13 -2
  17. package/dist/font-faces.js.map +1 -1
  18. package/dist/index.d.ts +3 -1
  19. package/dist/index.js +3 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/inline-derived-token.js +11 -10
  22. package/dist/inline-derived-token.js.map +1 -1
  23. package/dist/inline-token.d.ts +7 -0
  24. package/dist/inline-token.js +53 -8
  25. package/dist/inline-token.js.map +1 -1
  26. package/dist/inline-transform.d.ts +5 -1
  27. package/dist/inline-transform.js +34 -6
  28. package/dist/inline-transform.js.map +1 -1
  29. package/dist/native-drive.d.ts +21 -0
  30. package/dist/native-drive.js +60 -0
  31. package/dist/native-drive.js.map +1 -1
  32. package/dist/premultiplied-stops.d.ts +7 -0
  33. package/dist/premultiplied-stops.js +131 -0
  34. package/dist/premultiplied-stops.js.map +1 -0
  35. package/dist/scroll-animation.d.ts +11 -0
  36. package/dist/scroll-animation.js +29 -0
  37. package/dist/scroll-animation.js.map +1 -1
  38. package/dist/transition.d.ts +15 -0
  39. package/dist/transition.js +42 -1
  40. package/dist/transition.js.map +1 -1
  41. package/package.json +1 -1
@@ -0,0 +1,15 @@
1
+ /**
2
+ * What HTML's text elements look like with no rule of the app's: the few a browser's own sheet
3
+ * styles that Tailwind's preflight leaves alone. A heading and a paragraph are not here: they are
4
+ * plain text, as preflight makes them, and the web host's reset says the same. `code` is in the
5
+ * font each platform uses for code, by the class the root carries for its platform, as
6
+ * `@ng-native/tailwind`'s `font-mono` is.
7
+ *
8
+ * `ELEMENT_STYLES` is `ELEMENT_STYLES_CSS` compiled, written out because the engine has no
9
+ * compiler. `element-styles.test.ts` fails when the two disagree.
10
+ */
11
+ import type { StyleSheet } from './css.ts';
12
+ export declare const ELEMENT_STYLES_CSS = "\nstrong, b { font-weight: bold }\nem, i, cite { font-style: italic }\nu { text-decoration-line: underline }\ns { text-decoration-line: line-through }\nsmall { font-size: 80% }\ncode { font-family: Courier New }\n.platform-ios code { font-family: Menlo }\n.platform-android code { font-family: monospace }\nmark { background-color: rgb(255, 255, 0); color: rgb(0, 0, 0) }\n";
13
+ export declare const ELEMENT_STYLES: StyleSheet;
14
+ /** The element names `ELEMENT_STYLES` has a rule for. */
15
+ export declare const STYLED_ELEMENTS: ReadonlySet<string>;
@@ -0,0 +1,103 @@
1
+ export const ELEMENT_STYLES_CSS = `
2
+ strong, b { font-weight: bold }
3
+ em, i, cite { font-style: italic }
4
+ u { text-decoration-line: underline }
5
+ s { text-decoration-line: line-through }
6
+ small { font-size: 80% }
7
+ code { font-family: Courier New }
8
+ .platform-ios code { font-family: Menlo }
9
+ .platform-android code { font-family: monospace }
10
+ mark { background-color: rgb(255, 255, 0); color: rgb(0, 0, 0) }
11
+ `;
12
+ export const ELEMENT_STYLES = {
13
+ rules: [
14
+ {
15
+ compounds: [{ classes: [], type: 'strong' }],
16
+ combinators: [],
17
+ specificity: 1,
18
+ order: 0,
19
+ declarations: { fontWeight: '700' },
20
+ },
21
+ {
22
+ compounds: [{ classes: [], type: 'b' }],
23
+ combinators: [],
24
+ specificity: 1,
25
+ order: 1,
26
+ declarations: { fontWeight: '700' },
27
+ },
28
+ {
29
+ compounds: [{ classes: [], type: 'em' }],
30
+ combinators: [],
31
+ specificity: 1,
32
+ order: 2,
33
+ declarations: { fontStyle: 'italic' },
34
+ },
35
+ {
36
+ compounds: [{ classes: [], type: 'i' }],
37
+ combinators: [],
38
+ specificity: 1,
39
+ order: 3,
40
+ declarations: { fontStyle: 'italic' },
41
+ },
42
+ {
43
+ compounds: [{ classes: [], type: 'cite' }],
44
+ combinators: [],
45
+ specificity: 1,
46
+ order: 4,
47
+ declarations: { fontStyle: 'italic' },
48
+ },
49
+ {
50
+ compounds: [{ classes: [], type: 'u' }],
51
+ combinators: [],
52
+ specificity: 1,
53
+ order: 5,
54
+ declarations: { textDecorationLine: 'underline' },
55
+ },
56
+ {
57
+ compounds: [{ classes: [], type: 's' }],
58
+ combinators: [],
59
+ specificity: 1,
60
+ order: 6,
61
+ declarations: { textDecorationLine: 'line-through' },
62
+ },
63
+ {
64
+ compounds: [{ classes: [], type: 'small' }],
65
+ combinators: [],
66
+ specificity: 1,
67
+ order: 7,
68
+ declarations: {},
69
+ deferred: [{ props: ['fontSize'], compute: { unit: 'em', factor: 0.8 } }],
70
+ },
71
+ {
72
+ compounds: [{ classes: [], type: 'code' }],
73
+ combinators: [],
74
+ specificity: 1,
75
+ order: 8,
76
+ declarations: { fontFamily: 'Courier New' },
77
+ },
78
+ {
79
+ compounds: [{ classes: [], type: 'mark' }],
80
+ combinators: [],
81
+ specificity: 1,
82
+ order: 11,
83
+ declarations: { backgroundColor: 'rgb(255, 255, 0)', color: 'rgb(0, 0, 0)' },
84
+ },
85
+ {
86
+ compounds: [{ classes: ['platform-ios'] }, { classes: [], type: 'code' }],
87
+ combinators: ['descendant'],
88
+ specificity: 1001,
89
+ order: 9,
90
+ declarations: { fontFamily: 'Menlo' },
91
+ },
92
+ {
93
+ compounds: [{ classes: ['platform-android'] }, { classes: [], type: 'code' }],
94
+ combinators: ['descendant'],
95
+ specificity: 1001,
96
+ order: 10,
97
+ declarations: { fontFamily: 'monospace' },
98
+ },
99
+ ],
100
+ };
101
+ /** The element names `ELEMENT_STYLES` has a rule for. */
102
+ export const STYLED_ELEMENTS = new Set(ELEMENT_STYLES.rules.map((rule) => rule.compounds.at(-1).type));
103
+ //# sourceMappingURL=element-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-styles.js","sourceRoot":"","sources":["../src/element-styles.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * What HTML's text elements look like with no rule of the app's: the few a browser's own sheet\n * styles that Tailwind's preflight leaves alone. A heading and a paragraph are not here: they are\n * plain text, as preflight makes them, and the web host's reset says the same. `code` is in the\n * font each platform uses for code, by the class the root carries for its platform, as\n * `@ng-native/tailwind`'s `font-mono` is.\n *\n * `ELEMENT_STYLES` is `ELEMENT_STYLES_CSS` compiled, written out because the engine has no\n * compiler. `element-styles.test.ts` fails when the two disagree.\n */\nimport type { StyleSheet } from './css.ts';\n\nexport const ELEMENT_STYLES_CSS = `\nstrong, b { font-weight: bold }\nem, i, cite { font-style: italic }\nu { text-decoration-line: underline }\ns { text-decoration-line: line-through }\nsmall { font-size: 80% }\ncode { font-family: Courier New }\n.platform-ios code { font-family: Menlo }\n.platform-android code { font-family: monospace }\nmark { background-color: rgb(255, 255, 0); color: rgb(0, 0, 0) }\n`;\n\nexport const ELEMENT_STYLES = {\n rules: [\n {\n compounds: [{ classes: [], type: 'strong' }],\n combinators: [],\n specificity: 1,\n order: 0,\n declarations: { fontWeight: '700' },\n },\n {\n compounds: [{ classes: [], type: 'b' }],\n combinators: [],\n specificity: 1,\n order: 1,\n declarations: { fontWeight: '700' },\n },\n {\n compounds: [{ classes: [], type: 'em' }],\n combinators: [],\n specificity: 1,\n order: 2,\n declarations: { fontStyle: 'italic' },\n },\n {\n compounds: [{ classes: [], type: 'i' }],\n combinators: [],\n specificity: 1,\n order: 3,\n declarations: { fontStyle: 'italic' },\n },\n {\n compounds: [{ classes: [], type: 'cite' }],\n combinators: [],\n specificity: 1,\n order: 4,\n declarations: { fontStyle: 'italic' },\n },\n {\n compounds: [{ classes: [], type: 'u' }],\n combinators: [],\n specificity: 1,\n order: 5,\n declarations: { textDecorationLine: 'underline' },\n },\n {\n compounds: [{ classes: [], type: 's' }],\n combinators: [],\n specificity: 1,\n order: 6,\n declarations: { textDecorationLine: 'line-through' },\n },\n {\n compounds: [{ classes: [], type: 'small' }],\n combinators: [],\n specificity: 1,\n order: 7,\n declarations: {},\n deferred: [{ props: ['fontSize'], compute: { unit: 'em', factor: 0.8 } }],\n },\n {\n compounds: [{ classes: [], type: 'code' }],\n combinators: [],\n specificity: 1,\n order: 8,\n declarations: { fontFamily: 'Courier New' },\n },\n {\n compounds: [{ classes: [], type: 'mark' }],\n combinators: [],\n specificity: 1,\n order: 11,\n declarations: { backgroundColor: 'rgb(255, 255, 0)', color: 'rgb(0, 0, 0)' },\n },\n {\n compounds: [{ classes: ['platform-ios'] }, { classes: [], type: 'code' }],\n combinators: ['descendant'],\n specificity: 1001,\n order: 9,\n declarations: { fontFamily: 'Menlo' },\n },\n {\n compounds: [{ classes: ['platform-android'] }, { classes: [], type: 'code' }],\n combinators: ['descendant'],\n specificity: 1001,\n order: 10,\n declarations: { fontFamily: 'monospace' },\n },\n ],\n} as unknown as StyleSheet;\n\n/** The element names `ELEMENT_STYLES` has a rule for. */\nexport const STYLED_ELEMENTS: ReadonlySet<string> = new Set(\n ELEMENT_STYLES.rules.map((rule) => rule.compounds.at(-1)!.type as string),\n);\n"]}
package/dist/engine.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * because a persistent parent holds references to specific child handles. That bubble is
8
8
  * inherent and is what React's own Fabric renderer does.
9
9
  */
10
- import { type Conditions, type StyleCache, type StyleSheet, type TokenValue } from './css.ts';
10
+ import { type Conditions, type DeferredDeclaration, type StyleCache, type StyleSheet, type TokenValue } from './css.ts';
11
11
  import { type AnimationSpec, type Keyframe, type RunningAnimation, type Transition } from './transition.ts';
12
12
  import { type DrivenProperty, type EventFeed, type NativeAnimated, type ScrollAxis, type ScrollDrive, type ScrollRange, type StaticTransform } from './native-drive.ts';
13
13
  import type { DrivenChannels } from './scroll-animation.ts';
@@ -168,6 +168,8 @@ interface Committed {
168
168
  props: Record<string, unknown>;
169
169
  /** The child handles this node was committed with, in order. */
170
170
  childHandles: FabricNode[];
171
+ /** The native view it was created as, which a clone cannot change. */
172
+ viewName: string;
171
173
  }
172
174
  export interface EngineNode extends HostNode {
173
175
  readonly kind: NodeKind;
@@ -192,6 +194,31 @@ export interface EngineNode extends HostNode {
192
194
  styleCache: StyleCache | null;
193
195
  /** Set when something that could change what this node matches has changed. */
194
196
  styleDirty: boolean;
197
+ /** See `StyleTarget.hasDirty`. */
198
+ hasDirty: boolean;
199
+ /** See `StyleTarget.stateDirty`. */
200
+ stateDirty: boolean;
201
+ /** A family left out while it loads. See `loadingFamilies`. */
202
+ heldFamily?: string;
203
+ /** See `StyleTarget.inlineInherits`. */
204
+ inlineInherits?: boolean;
205
+ /** See `StyleTarget.boundStyle`: the declarations, and the same by the property each sets. */
206
+ boundStyle?: readonly DeferredDeclaration[] | null;
207
+ boundByProp?: Map<string, DeferredDeclaration>;
208
+ /**
209
+ * Whether this node, or one inside it, takes touches under a `pointer-events: none` it would
210
+ * otherwise inherit. Kept as each node is reconciled, children first. See `noteTouches`.
211
+ */
212
+ touchWithin?: boolean;
213
+ /**
214
+ * The paragraph the engine makes around a run of text written straight into a view. It is in no
215
+ * template and in no node's `children`: it holds the text, and commits where the text would.
216
+ */
217
+ box?: EngineNode;
218
+ /** A node the engine made, which no rule matches: it only inherits. */
219
+ anonymous?: true;
220
+ /** See `StyleTarget.styled`. */
221
+ styled?: true;
195
222
  /** `:focus`, from the native focus and blur events. */
196
223
  focused?: boolean;
197
224
  /** `:active`, set on the responder and every ancestor of it. */
@@ -207,6 +234,18 @@ export interface EngineNode extends HostNode {
207
234
  ownStyle?: object;
208
235
  /** The resolved style this node was last committed with, for the skip check in `reconcile`. */
209
236
  styleCommitted: StyleCache | null;
237
+ /**
238
+ * How this node laid its children out when one of them last had a `fit-content` size, as
239
+ * `containerOf` says it. Set by such a child, and compared on each reconcile so the children
240
+ * are worked out again when the direction or alignment changes. Unset on every other node.
241
+ */
242
+ fitContainer?: string;
243
+ /**
244
+ * Whether this node had a height a percentage could be taken of, when a box beneath it with a
245
+ * percentage height last asked, as `definiteHeight` says it. Compared on each reconcile so its
246
+ * children are worked out again when it changes. Unset on every other node.
247
+ */
248
+ heightBasis?: boolean;
210
249
  /**
211
250
  * Per-property transition state, for every property this node has ever seen a `transition` for.
212
251
  * A finished entry stays, because its target is what the next change is measured against.
@@ -224,6 +263,13 @@ export interface EngineNode extends HostNode {
224
263
  parts: readonly unknown[];
225
264
  value: unknown[];
226
265
  };
266
+ /** The commit that created this node's view, by its number: see `Engine.commitUnseen`. */
267
+ bornIn?: number;
268
+ /** The last bound `transform` string and the list it reads as, undefined where CSS cannot. */
269
+ boundTransform?: {
270
+ text: string;
271
+ list: unknown[] | undefined;
272
+ };
227
273
  /**
228
274
  * Set by the component that owns this element. A host primitive that reaches a commit without it
229
275
  * was written in a template that never imported the component, which is reported in dev.
@@ -235,6 +281,12 @@ export interface EngineNode extends HostNode {
235
281
  * knows. See `markComponentHost`.
236
282
  */
237
283
  componentHost?: true;
284
+ /** See `keepNativeView`. */
285
+ nativeView?: true;
286
+ /** Props kept for selectors to match and left out of what is committed. See `keepAsAttribute`. */
287
+ attributeOnly?: Set<string>;
288
+ /** The child this node's background is painted on instead of itself. See `paintOn`. */
289
+ paintsOn?: EngineNode;
238
290
  /**
239
291
  * Style weaker than every sheet, where no rule and no inline style says otherwise. What lets the
240
292
  * root component's host fill the surface by default and still give way to its own `:host`. See
@@ -283,6 +335,12 @@ export declare function claimHost(node: HostNode): void;
283
335
  * with the host element in hand, whatever the component's selector.
284
336
  */
285
337
  export declare function markComponentHost(node: HostNode): void;
338
+ /**
339
+ * Say that a component's host is the native view its element name is registered as: a typed
340
+ * wrapper for the view, where a component of the app's own with the same selector is a plain view.
341
+ * Called from the component's constructor. See `ViewNameOptions.yieldsToComponents`.
342
+ */
343
+ export declare function keepNativeView(node: HostNode): void;
286
344
  /** Names Android registers differently. */
287
345
  export declare const ANDROID_VIEW_NAMES: Record<string, string>;
288
346
  export declare function nativePlatform(): string;
@@ -310,6 +368,13 @@ export interface ViewNameOptions {
310
368
  * takes its own content, and is not committed as children. An explicit prop wins over it.
311
369
  */
312
370
  readonly textContent?: string;
371
+ /**
372
+ * Whether the name gives way to a component of the app's own with the same selector, whose host
373
+ * is then a plain view. For a set of views registered under a prefix an app may also use for
374
+ * its design system, as `@expo/ui`'s are under `ui-`. A component that is the view itself, a
375
+ * typed wrapper for it, says so with `keepNativeView`.
376
+ */
377
+ readonly yieldsToComponents?: boolean;
313
378
  }
314
379
  /**
315
380
  * A view whose native name differs by platform. Chosen when the view is looked up rather than when
@@ -328,6 +393,16 @@ export declare function onFontsRegistered(listener: (families: ReadonlySet<strin
328
393
  * `Engine.fontsRegistered`.
329
394
  */
330
395
  export declare function fontsRegistered(families: Iterable<string>): void;
396
+ /** Faces a load is about to ask the platform for. See `loadingFamilies`. */
397
+ export declare function fontsLoading(families: Iterable<string>): void;
398
+ /** Hear about loads settling, until the returned function is called. */
399
+ export declare function onFontsSettled(listener: (families: ReadonlySet<string>) => void): () => void;
400
+ /**
401
+ * Faces a load asked for and has finished with, registered or not, before `fontsRegistered`.
402
+ * Text held back for one that no load still asks for is laid out with the name again: see
403
+ * `Engine.fontsSettled`.
404
+ */
405
+ export declare function fontsSettled(families: Iterable<string>): void;
331
406
  /**
332
407
  * Commit every `elementName` as a direct child of its nearest `ancestorName`, wherever the
333
408
  * template put it, e.g. `registerHoist('native-header', 'screen')`.
@@ -365,9 +440,14 @@ interface KeptHoist {
365
440
  export interface ViewNameNode {
366
441
  readonly kind: string;
367
442
  readonly name: string;
368
- readonly parent: {
369
- readonly name: string;
370
- } | null;
443
+ readonly parent: ViewNameNode | null;
444
+ /** Whether a component is mounted on it, and whether that component is the native view. */
445
+ readonly componentHost?: boolean;
446
+ readonly nativeView?: boolean;
447
+ /** What it holds, which decides whether one of HTML's text elements is text or a view. */
448
+ readonly children?: readonly ViewNameNode[];
449
+ /** Set on the paragraph the engine makes for a run of text written straight into a view. */
450
+ readonly anonymous?: boolean;
371
451
  }
372
452
  /**
373
453
  * The native view a node commits as: `Paragraph` for a `<text>`, `VirtualText` for one nested in
@@ -452,7 +532,7 @@ export interface EngineStats {
452
532
  firstCommitMs: number;
453
533
  /** Worst commit *after* the mount. This is the number that matters for frame rate. */
454
534
  worstCommitMs: number;
455
- /** Commits that blew a 60fps frame budget, excluding the mount. */
535
+ /** Commits that took longer than 8ms, a frame at 120Hz, excluding the mount. */
456
536
  slowCommits: number;
457
537
  /**
458
538
  * Worst `begin()`..`end()` span, excluding the mount. This brackets Angular's whole render
@@ -509,6 +589,8 @@ export declare class Engine implements HostEngine {
509
589
  * does, a child list can move without anything else needing to be looked at again.
510
590
  */
511
591
  private structuralSheets;
592
+ /** Whether any sheet uses `:has()`. See `markBeneath`. */
593
+ private hasSheets;
512
594
  private readonly resolveAssetSource;
513
595
  constructor(fabric: FabricUIManager, rootTag: number, options?: EngineOptions);
514
596
  /**
@@ -532,6 +614,25 @@ export declare class Engine implements HostEngine {
532
614
  * binding, so nothing marks an Angular view dirty and no change-detection pass would follow.
533
615
  */
534
616
  private setActiveChain;
617
+ /** Whether any sheet styles a pressed element, and each compound that asks about one from another. */
618
+ private activeUse;
619
+ /** What each sheet in play asks about a pressed element: `activeUse` is all of them together. */
620
+ private readonly activeBySheet;
621
+ /** Note what a sheet in play asks about a pressed element. See `markActive`. */
622
+ private watchActive;
623
+ /** A sheet has left play, by a hot swap or by being removed: what it asked goes with it. */
624
+ private unwatchActive;
625
+ private countActive;
626
+ /**
627
+ * A press began or ended on `node` or under it, which is all that changed about it. A press
628
+ * reaches every ancestor up to the root, and marking each as restyled would style the whole
629
+ * screen again, twice a press. So each is only matched again, and keeps its style and all
630
+ * that is under it unless it now matches other rules. An element a rule asks about from
631
+ * inside or beside it, `.card:active .title`, changes more than itself, and is restyled with
632
+ * everything under it as any other change is. With no rule for a pressed element at all there
633
+ * is nothing to match.
634
+ */
635
+ private markActive;
535
636
  /**
536
637
  * Custom properties the device knows and the stylesheet cannot, once they change.
537
638
  *
@@ -585,6 +686,11 @@ export declare class Engine implements HostEngine {
585
686
  * text attributes change, which the same cap does. Android sets it only when `fontFamily` is in
586
687
  * the props it is sent, and the engine sends only what changed, so it is sent again once.
587
688
  */
689
+ /**
690
+ * Loads have settled for these families: every node held back for one, a span inside a
691
+ * paragraph included, is laid out with the name again, registered or not. See `loadingFamilies`.
692
+ */
693
+ fontsSettled(families: ReadonlySet<string>): void;
588
694
  fontsRegistered(families: ReadonlySet<string>): void;
589
695
  /**
590
696
  * Put the cursor in a text input; bring anything else on screen, in the scroll view it is in.
@@ -630,6 +736,9 @@ export declare class Engine implements HostEngine {
630
736
  private viewportSize;
631
737
  /** The system text size, from the conditions. See `Conditions.fontScale`. */
632
738
  private fontScale;
739
+ private readonly viewportWatchers;
740
+ /** Calls `listener` after each change of conditions, which is when `viewport` can change. */
741
+ watchViewport(listener: () => void): () => void;
633
742
  updateConditions(next: Conditions): void;
634
743
  createElement(name: string, sheet?: StyleSheet | null): EngineNode;
635
744
  addClass(node: EngineNode, name: string): void;
@@ -699,6 +808,25 @@ export declare class Engine implements HostEngine {
699
808
  parentNode(node: EngineNode): EngineNode | null;
700
809
  nextSibling(node: EngineNode): EngineNode | null;
701
810
  setProp(node: EngineNode, key: string, value: unknown): void;
811
+ /**
812
+ * Paint a node's background on one of its children instead of on the node: the node keeps its
813
+ * `background-color` and `background-image` in the cascade, where a stylesheet wrote them, and
814
+ * the child is the view that draws them. What a view that masks its children and not itself
815
+ * needs, as `<gradient-text>` is.
816
+ */
817
+ paintOn(node: EngineNode, child: EngineNode): void;
818
+ /**
819
+ * Keep a prop the node already has as an attribute: on the node for a selector such as
820
+ * `:host([variant='primary'])` to match, and left out of what is committed to the native view.
821
+ * It is committed again once the prop is next written. What the platform adapter does with a
822
+ * static attribute that is an input of the host's component.
823
+ */
824
+ keepAsAttribute(node: EngineNode, key: string): void;
825
+ /**
826
+ * Whether a node's inline style can change what it or anything below it resolves to: it sets,
827
+ * or until now set, a property its children inherit.
828
+ */
829
+ private inlineReachesStyle;
702
830
  /** Whether a node's inline style sets `direction`, remembering that one has. */
703
831
  private noteInlineDirection;
704
832
  /**
@@ -710,6 +838,12 @@ export declare class Engine implements HostEngine {
710
838
  * has changed for the props diff to notice.
711
839
  */
712
840
  styleChanged(node: EngineNode): void;
841
+ /**
842
+ * A bound declaration, `[style.color]`, whose value may be a `var()`. One that is, is kept as a
843
+ * declaration the cascade settles with the node's tokens, as a rule's is, and true is answered:
844
+ * the text is no value to put in the node's style. Any other value forgets what was kept.
845
+ */
846
+ setBoundStyle(node: EngineNode, prop: string, value: unknown): boolean;
713
847
  /**
714
848
  * Set a custom property on a node, `--tint` from `[style.--tint]`, or remove it with `null`.
715
849
  *
@@ -721,7 +855,16 @@ export declare class Engine implements HostEngine {
721
855
  setText(node: EngineNode, value: string): void;
722
856
  setEventListener(node: EngineNode, topLevelType: string, fn: (event: unknown) => void): () => void;
723
857
  private markProps;
858
+ /** Start matching ancestors again on a change, once a sheet that uses `:has()` is in play. */
859
+ private watchHas;
860
+ /**
861
+ * Something at or beneath `from` changed: every node from there up may match a `:has()` rule
862
+ * it did not, or stop matching one. They are matched again rather than marked for restyling,
863
+ * which would restyle everything under them. Only sheets that use `:has()` pay.
864
+ */
865
+ private markBeneath;
724
866
  private markLaterSiblings;
867
+ /** `node`'s child list changed: `moved` came into it or went out of it. */
725
868
  private markStructure;
726
869
  /** Walk up until we hit a node already known to have a dirty subtree. */
727
870
  private markPath;
@@ -733,6 +876,28 @@ export declare class Engine implements HostEngine {
733
876
  * optimisation.
734
877
  */
735
878
  commit(): boolean;
879
+ /** The first commit whose new views have not been drawn yet, while `commitUnseen` runs. */
880
+ private unseen;
881
+ /**
882
+ * A commit for what changed in the same turn as earlier commits, before a frame was drawn.
883
+ * `since` is how many commits there had been before the first of them (`stats.commits`).
884
+ *
885
+ * A view those commits created has not been seen in the style they gave it, so what this one
886
+ * gives it is where it starts, and no transition runs toward it. That is what a browser
887
+ * does with a class added to an element in the turn that inserted it, and what `animate.enter`
888
+ * is built on: Angular adds the enter class after the render pass that created the element, and
889
+ * takes it off a frame later, which is the one change the transition is for.
890
+ */
891
+ commitUnseen(since: number): boolean;
892
+ /** Nodes that asked for `@keyframes` this commit had not met, by the name they asked for. */
893
+ private readonly awaitingKeyframes;
894
+ /**
895
+ * A sheet is registered when the first node it styles is committed, so a node committed before
896
+ * it can name keyframes that arrive later in the same commit. Those nodes play them from another
897
+ * commit straight away, as a browser applies keyframes however the sheets arrived; a name still
898
+ * unknown once the commit is over is reported.
899
+ */
900
+ private settleKeyframes;
736
901
  private readonly scrollDriver;
737
902
  /** Whether native can move a view by a scroll with no JavaScript in between. */
738
903
  get drivesScroll(): boolean;
@@ -777,6 +942,20 @@ export declare class Engine implements HostEngine {
777
942
  * unrelated change.
778
943
  */
779
944
  private mergeProps;
945
+ /**
946
+ * Leave a node's background out of what it commits when a child paints it, and give that child
947
+ * its parent's: the cascade's, and over it the parent's inline style.
948
+ */
949
+ private movePaint;
950
+ /**
951
+ * A container whose direction or alignment changed since a child with a `fit-content` size
952
+ * read it, or whose height stopped or started being one a percentage is taken of since a child
953
+ * with a percentage height asked: those children are merged again. A change to a container
954
+ * marks nothing beneath it, since none of these is inherited.
955
+ */
956
+ private refitChildren;
957
+ /** Have a container's children merged again, through any `display: contents` among them. */
958
+ private refit;
780
959
  /**
781
960
  * The text size cap that lays a paragraph or text input out again once a face it names has
782
961
  * registered: a step per face above the app's own cap where it set one (below 1 is none, on
@@ -817,6 +996,11 @@ export declare class Engine implements HostEngine {
817
996
  * A `sheet` already gone, such as a global sheet removed, leaves `next` registered last.
818
997
  */
819
998
  sheetReplaced(sheet: StyleSheet, next: StyleSheet | null): void;
999
+ /**
1000
+ * Every sheet's `@font-face` rules again, in order, and every text that names a family matched
1001
+ * again: a face whose rule went is no longer matched, though the platform keeps it registered.
1002
+ */
1003
+ private reindexFonts;
820
1004
  /** Every sheet's `@keyframes` again, in order, and every animation told to look them up. */
821
1005
  private reindexKeyframes;
822
1006
  /** Mark every node under `node` with an animation, so it looks its keyframes up again. */
@@ -831,6 +1015,8 @@ export declare class Engine implements HostEngine {
831
1015
  * Once per sheet that declares faces, so walking the tree costs nothing that matters.
832
1016
  */
833
1017
  private rematchFonts;
1018
+ /** Mark every element under `node` committed with a family, so it is matched again. */
1019
+ private markFontText;
834
1020
  private readonly knownSheets;
835
1021
  /**
836
1022
  * Start, advance or stop the `@keyframes` animation a node's style asks for.
@@ -839,6 +1025,40 @@ export declare class Engine implements HostEngine {
839
1025
  * own frames, which is what lets an element animate in without differing from anything.
840
1026
  */
841
1027
  private animated;
1028
+ /**
1029
+ * A clock animation the scroll plays instead: the same animation where only the timeline moved,
1030
+ * and one cancelled where the name changed.
1031
+ */
1032
+ private handOverToScroll;
1033
+ /**
1034
+ * `animationcancel` for an animation stopped before it ended: the element no longer asks for it,
1035
+ * asks for another by name, or its keyframes went, as a browser fires it.
1036
+ */
1037
+ private cancelPlaying;
1038
+ /** Stop on native each animation whose view has left the tree. */
1039
+ private releasePlayedNatively;
1040
+ /** Every node whose animation native is playing, with no frame of it in JavaScript. */
1041
+ private readonly playedNatively;
1042
+ /**
1043
+ * Hand an animation that has just started to native, where native can play it: one that moves
1044
+ * only opacity and transforms, starts at once, and repeats a whole number of times. Native then
1045
+ * runs it frame by frame, and JavaScript hears of it again when it ends. Anything else is
1046
+ * played from here, a commit a frame. See `NativeScrollDriver.play`.
1047
+ */
1048
+ private playNatively;
1049
+ /**
1050
+ * Native reached the end of an animation it was playing. The frame it ends at, or the resting
1051
+ * style where it does not fill, is committed before the view is let go, so nothing shows of
1052
+ * the frame it started at, which is what the view had been committed with.
1053
+ */
1054
+ private endedNatively;
1055
+ /** Take an animation back from native, which stops it there. The caller plays it on, or not. */
1056
+ private stopNative;
1057
+ /**
1058
+ * Play on from JavaScript an animation native was playing, from where its clock has got to:
1059
+ * what a pause, other frames or a view made again need, none of which native can be told of.
1060
+ */
1061
+ private backToScript;
842
1062
  /** Start the clock on an animation, unless the node is already playing this one. */
843
1063
  private startPlaying;
844
1064
  /**
@@ -930,7 +1150,8 @@ export declare class Engine implements HostEngine {
930
1150
  *
931
1151
  * A stop's colour is a colour like any other, but it is two levels down and nothing else looks
932
1152
  * there: without this the device is handed the string `rgb(255, 0, 0)` where it wants a number,
933
- * and paints nothing.
1153
+ * and paints nothing. The stops are first rewritten so native's interpolation paints what
1154
+ * CSS's premultiplied one does (see `premultipliedStops`).
934
1155
  */
935
1156
  private processGradients;
936
1157
  private clearFlags;
@@ -955,6 +1176,20 @@ export declare class Engine implements HostEngine {
955
1176
  * which, per child, was most of what a one-row update cost.
956
1177
  */
957
1178
  private reconcileChildren;
1179
+ /**
1180
+ * The paragraph a run of text written straight into a view is drawn in, or nothing for a run of
1181
+ * whitespace, which a browser draws nothing for between the items of a flex box either.
1182
+ *
1183
+ * It is the text's own, kept on the text node, and no part of the tree: its parent is the view,
1184
+ * so it inherits what the view's text would, and no rule matches it.
1185
+ */
1186
+ /**
1187
+ * A run of text under `parent`, which commits as `viewName`: the text itself inside a text, a
1188
+ * paragraph of its own inside any other view, and nothing where the view takes its text as a
1189
+ * prop (see `ViewNameOptions`) or the run is whitespace between a view's children.
1190
+ */
1191
+ private reconcileText;
1192
+ private looseText;
958
1193
  /** Remember an iOS modal host committed as showing, so hiding it waits for `topDismiss`. */
959
1194
  private notePresented;
960
1195
  /**
@@ -989,6 +1224,11 @@ export declare class Engine implements HostEngine {
989
1224
  * Its native state goes with it, as it would there.
990
1225
  */
991
1226
  private reconcileUnder;
1227
+ /**
1228
+ * A node whose native view is no longer the one it was created as is created again: a text
1229
+ * element that came to hold a view, or stopped. A clone keeps the view it was made as.
1230
+ */
1231
+ private forgetRenamed;
992
1232
  /**
993
1233
  * Let a node and everything under it be created again at the next commit. The views it keeps
994
1234
  * for hoisted names go too: they are children of the native view it is losing.
@@ -1018,7 +1258,7 @@ export declare class Engine implements HostEngine {
1018
1258
  private create;
1019
1259
  /**
1020
1260
  * Angular's own unknown-element check does not run in this pipeline, so a `<text>` in a
1021
- * template that never imported `Text` compiles, renders as a plain view, and looks like a
1261
+ * template that never imported `Text` compiles, draws without the component, and looks like a
1022
1262
  * layout bug. On the first commit of any known element with no component behind it, say so.
1023
1263
  */
1024
1264
  private checkClaimed;
@@ -1151,6 +1391,11 @@ export declare class Engine implements HostEngine {
1151
1391
  private isAttached;
1152
1392
  /** The host's `resolveAssetSource`, for a component that needs an asset's size up front. */
1153
1393
  resolveAsset(value: unknown): unknown;
1394
+ /**
1395
+ * A colour prop as native takes it. A shape's `fill` or `stroke` the cascade settled from a
1396
+ * token is the solid brush react-native-svg takes, and `none` no paint at all.
1397
+ */
1398
+ private painted;
1154
1399
  /**
1155
1400
  * The host's `processColor`, and the one place a platform colour becomes one.
1156
1401
  *