@ng-native/fabric 0.3.0 → 0.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/aria-props.d.ts +16 -0
- package/dist/aria-props.js +78 -0
- package/dist/aria-props.js.map +1 -0
- package/dist/css.d.ts +73 -1
- package/dist/css.js +345 -31
- package/dist/css.js.map +1 -1
- package/dist/element-styles.d.ts +15 -0
- package/dist/element-styles.js +103 -0
- package/dist/element-styles.js.map +1 -0
- package/dist/engine.d.ts +147 -6
- package/dist/engine.js +602 -68
- package/dist/engine.js.map +1 -1
- package/dist/font-faces.d.ts +5 -2
- package/dist/font-faces.js +13 -2
- package/dist/font-faces.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/inline-derived-token.js +11 -10
- package/dist/inline-derived-token.js.map +1 -1
- package/dist/inline-token.d.ts +7 -0
- package/dist/inline-token.js +50 -4
- package/dist/inline-token.js.map +1 -1
- package/dist/inline-transform.d.ts +5 -1
- package/dist/inline-transform.js +34 -6
- package/dist/inline-transform.js.map +1 -1
- 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":"AAYA,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;CAUjC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,KAAK,EAAE;QACL;YACE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;YAC5C,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,CAAC;YACd,KAAK,EAAE,CAAC;YACR,YAAY,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;SACpC;QACD;YACE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;YACvC,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,CAAC;YACd,KAAK,EAAE,CAAC;YACR,YAAY,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;SACpC;QACD;YACE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,I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AI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,IAAc,CAAC,CAC1E,CAAC","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,27 @@ 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
|
+
/** A family left out while it loads. See `loadingFamilies`. */
|
|
198
|
+
heldFamily?: string;
|
|
199
|
+
/** See `StyleTarget.inlineInherits`. */
|
|
200
|
+
inlineInherits?: boolean;
|
|
201
|
+
/** See `StyleTarget.boundStyle`: the declarations, and the same by the property each sets. */
|
|
202
|
+
boundStyle?: readonly DeferredDeclaration[] | null;
|
|
203
|
+
boundByProp?: Map<string, DeferredDeclaration>;
|
|
204
|
+
/**
|
|
205
|
+
* Whether this node, or one inside it, takes touches under a `pointer-events: none` it would
|
|
206
|
+
* otherwise inherit. Kept as each node is reconciled, children first. See `noteTouches`.
|
|
207
|
+
*/
|
|
208
|
+
touchWithin?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* The paragraph the engine makes around a run of text written straight into a view. It is in no
|
|
211
|
+
* template and in no node's `children`: it holds the text, and commits where the text would.
|
|
212
|
+
*/
|
|
213
|
+
box?: EngineNode;
|
|
214
|
+
/** A node the engine made, which no rule matches: it only inherits. */
|
|
215
|
+
anonymous?: true;
|
|
216
|
+
/** See `StyleTarget.styled`. */
|
|
217
|
+
styled?: true;
|
|
195
218
|
/** `:focus`, from the native focus and blur events. */
|
|
196
219
|
focused?: boolean;
|
|
197
220
|
/** `:active`, set on the responder and every ancestor of it. */
|
|
@@ -224,6 +247,13 @@ export interface EngineNode extends HostNode {
|
|
|
224
247
|
parts: readonly unknown[];
|
|
225
248
|
value: unknown[];
|
|
226
249
|
};
|
|
250
|
+
/** The commit that created this node's view, by its number: see `Engine.commitUnseen`. */
|
|
251
|
+
bornIn?: number;
|
|
252
|
+
/** The last bound `transform` string and the list it reads as, undefined where CSS cannot. */
|
|
253
|
+
boundTransform?: {
|
|
254
|
+
text: string;
|
|
255
|
+
list: unknown[] | undefined;
|
|
256
|
+
};
|
|
227
257
|
/**
|
|
228
258
|
* Set by the component that owns this element. A host primitive that reaches a commit without it
|
|
229
259
|
* was written in a template that never imported the component, which is reported in dev.
|
|
@@ -235,6 +265,8 @@ export interface EngineNode extends HostNode {
|
|
|
235
265
|
* knows. See `markComponentHost`.
|
|
236
266
|
*/
|
|
237
267
|
componentHost?: true;
|
|
268
|
+
/** See `keepNativeView`. */
|
|
269
|
+
nativeView?: true;
|
|
238
270
|
/**
|
|
239
271
|
* Style weaker than every sheet, where no rule and no inline style says otherwise. What lets the
|
|
240
272
|
* root component's host fill the surface by default and still give way to its own `:host`. See
|
|
@@ -283,6 +315,12 @@ export declare function claimHost(node: HostNode): void;
|
|
|
283
315
|
* with the host element in hand, whatever the component's selector.
|
|
284
316
|
*/
|
|
285
317
|
export declare function markComponentHost(node: HostNode): void;
|
|
318
|
+
/**
|
|
319
|
+
* Say that a component's host is the native view its element name is registered as: a typed
|
|
320
|
+
* wrapper for the view, where a component of the app's own with the same selector is a plain view.
|
|
321
|
+
* Called from the component's constructor. See `ViewNameOptions.yieldsToComponents`.
|
|
322
|
+
*/
|
|
323
|
+
export declare function keepNativeView(node: HostNode): void;
|
|
286
324
|
/** Names Android registers differently. */
|
|
287
325
|
export declare const ANDROID_VIEW_NAMES: Record<string, string>;
|
|
288
326
|
export declare function nativePlatform(): string;
|
|
@@ -310,6 +348,13 @@ export interface ViewNameOptions {
|
|
|
310
348
|
* takes its own content, and is not committed as children. An explicit prop wins over it.
|
|
311
349
|
*/
|
|
312
350
|
readonly textContent?: string;
|
|
351
|
+
/**
|
|
352
|
+
* Whether the name gives way to a component of the app's own with the same selector, whose host
|
|
353
|
+
* is then a plain view. For a set of views registered under a prefix an app may also use for
|
|
354
|
+
* its design system, as `@expo/ui`'s are under `ui-`. A component that is the view itself, a
|
|
355
|
+
* typed wrapper for it, says so with `keepNativeView`.
|
|
356
|
+
*/
|
|
357
|
+
readonly yieldsToComponents?: boolean;
|
|
313
358
|
}
|
|
314
359
|
/**
|
|
315
360
|
* A view whose native name differs by platform. Chosen when the view is looked up rather than when
|
|
@@ -328,6 +373,16 @@ export declare function onFontsRegistered(listener: (families: ReadonlySet<strin
|
|
|
328
373
|
* `Engine.fontsRegistered`.
|
|
329
374
|
*/
|
|
330
375
|
export declare function fontsRegistered(families: Iterable<string>): void;
|
|
376
|
+
/** Faces a load is about to ask the platform for. See `loadingFamilies`. */
|
|
377
|
+
export declare function fontsLoading(families: Iterable<string>): void;
|
|
378
|
+
/** Hear about loads settling, until the returned function is called. */
|
|
379
|
+
export declare function onFontsSettled(listener: (families: ReadonlySet<string>) => void): () => void;
|
|
380
|
+
/**
|
|
381
|
+
* Faces a load asked for and has finished with, registered or not, before `fontsRegistered`.
|
|
382
|
+
* Text held back for one that no load still asks for is laid out with the name again: see
|
|
383
|
+
* `Engine.fontsSettled`.
|
|
384
|
+
*/
|
|
385
|
+
export declare function fontsSettled(families: Iterable<string>): void;
|
|
331
386
|
/**
|
|
332
387
|
* Commit every `elementName` as a direct child of its nearest `ancestorName`, wherever the
|
|
333
388
|
* template put it, e.g. `registerHoist('native-header', 'screen')`.
|
|
@@ -365,9 +420,12 @@ interface KeptHoist {
|
|
|
365
420
|
export interface ViewNameNode {
|
|
366
421
|
readonly kind: string;
|
|
367
422
|
readonly name: string;
|
|
368
|
-
readonly parent:
|
|
369
|
-
|
|
370
|
-
|
|
423
|
+
readonly parent: ViewNameNode | null;
|
|
424
|
+
/** Whether a component is mounted on it, and whether that component is the native view. */
|
|
425
|
+
readonly componentHost?: boolean;
|
|
426
|
+
readonly nativeView?: boolean;
|
|
427
|
+
/** What it holds, which decides whether one of HTML's text elements is text or a view. */
|
|
428
|
+
readonly children?: readonly ViewNameNode[];
|
|
371
429
|
}
|
|
372
430
|
/**
|
|
373
431
|
* The native view a node commits as: `Paragraph` for a `<text>`, `VirtualText` for one nested in
|
|
@@ -452,7 +510,7 @@ export interface EngineStats {
|
|
|
452
510
|
firstCommitMs: number;
|
|
453
511
|
/** Worst commit *after* the mount. This is the number that matters for frame rate. */
|
|
454
512
|
worstCommitMs: number;
|
|
455
|
-
/** Commits that
|
|
513
|
+
/** Commits that took longer than 8ms, a frame at 120Hz, excluding the mount. */
|
|
456
514
|
slowCommits: number;
|
|
457
515
|
/**
|
|
458
516
|
* Worst `begin()`..`end()` span, excluding the mount. This brackets Angular's whole render
|
|
@@ -585,6 +643,11 @@ export declare class Engine implements HostEngine {
|
|
|
585
643
|
* text attributes change, which the same cap does. Android sets it only when `fontFamily` is in
|
|
586
644
|
* the props it is sent, and the engine sends only what changed, so it is sent again once.
|
|
587
645
|
*/
|
|
646
|
+
/**
|
|
647
|
+
* Loads have settled for these families: every node held back for one, a span inside a
|
|
648
|
+
* paragraph included, is laid out with the name again, registered or not. See `loadingFamilies`.
|
|
649
|
+
*/
|
|
650
|
+
fontsSettled(families: ReadonlySet<string>): void;
|
|
588
651
|
fontsRegistered(families: ReadonlySet<string>): void;
|
|
589
652
|
/**
|
|
590
653
|
* Put the cursor in a text input; bring anything else on screen, in the scroll view it is in.
|
|
@@ -630,6 +693,9 @@ export declare class Engine implements HostEngine {
|
|
|
630
693
|
private viewportSize;
|
|
631
694
|
/** The system text size, from the conditions. See `Conditions.fontScale`. */
|
|
632
695
|
private fontScale;
|
|
696
|
+
private readonly viewportWatchers;
|
|
697
|
+
/** Calls `listener` after each change of conditions, which is when `viewport` can change. */
|
|
698
|
+
watchViewport(listener: () => void): () => void;
|
|
633
699
|
updateConditions(next: Conditions): void;
|
|
634
700
|
createElement(name: string, sheet?: StyleSheet | null): EngineNode;
|
|
635
701
|
addClass(node: EngineNode, name: string): void;
|
|
@@ -699,6 +765,11 @@ export declare class Engine implements HostEngine {
|
|
|
699
765
|
parentNode(node: EngineNode): EngineNode | null;
|
|
700
766
|
nextSibling(node: EngineNode): EngineNode | null;
|
|
701
767
|
setProp(node: EngineNode, key: string, value: unknown): void;
|
|
768
|
+
/**
|
|
769
|
+
* Whether a node's inline style can change what it or anything below it resolves to: it sets,
|
|
770
|
+
* or until now set, a property its children inherit.
|
|
771
|
+
*/
|
|
772
|
+
private inlineReachesStyle;
|
|
702
773
|
/** Whether a node's inline style sets `direction`, remembering that one has. */
|
|
703
774
|
private noteInlineDirection;
|
|
704
775
|
/**
|
|
@@ -710,6 +781,12 @@ export declare class Engine implements HostEngine {
|
|
|
710
781
|
* has changed for the props diff to notice.
|
|
711
782
|
*/
|
|
712
783
|
styleChanged(node: EngineNode): void;
|
|
784
|
+
/**
|
|
785
|
+
* A bound declaration, `[style.color]`, whose value may be a `var()`. One that is, is kept as a
|
|
786
|
+
* declaration the cascade settles with the node's tokens, as a rule's is, and true is answered:
|
|
787
|
+
* the text is no value to put in the node's style. Any other value forgets what was kept.
|
|
788
|
+
*/
|
|
789
|
+
setBoundStyle(node: EngineNode, prop: string, value: unknown): boolean;
|
|
713
790
|
/**
|
|
714
791
|
* Set a custom property on a node, `--tint` from `[style.--tint]`, or remove it with `null`.
|
|
715
792
|
*
|
|
@@ -722,6 +799,7 @@ export declare class Engine implements HostEngine {
|
|
|
722
799
|
setEventListener(node: EngineNode, topLevelType: string, fn: (event: unknown) => void): () => void;
|
|
723
800
|
private markProps;
|
|
724
801
|
private markLaterSiblings;
|
|
802
|
+
/** `node`'s child list changed: `moved` came into it or went out of it. */
|
|
725
803
|
private markStructure;
|
|
726
804
|
/** Walk up until we hit a node already known to have a dirty subtree. */
|
|
727
805
|
private markPath;
|
|
@@ -733,6 +811,28 @@ export declare class Engine implements HostEngine {
|
|
|
733
811
|
* optimisation.
|
|
734
812
|
*/
|
|
735
813
|
commit(): boolean;
|
|
814
|
+
/** The first commit whose new views have not been drawn yet, while `commitUnseen` runs. */
|
|
815
|
+
private unseen;
|
|
816
|
+
/**
|
|
817
|
+
* A commit for what changed in the same turn as earlier commits, before a frame was drawn.
|
|
818
|
+
* `since` is how many commits there had been before the first of them (`stats.commits`).
|
|
819
|
+
*
|
|
820
|
+
* A view those commits created has not been seen in the style they gave it, so what this one
|
|
821
|
+
* gives it is where it starts, and no transition runs toward it. That is what a browser
|
|
822
|
+
* does with a class added to an element in the turn that inserted it, and what `animate.enter`
|
|
823
|
+
* is built on: Angular adds the enter class after the render pass that created the element, and
|
|
824
|
+
* takes it off a frame later, which is the one change the transition is for.
|
|
825
|
+
*/
|
|
826
|
+
commitUnseen(since: number): boolean;
|
|
827
|
+
/** Nodes that asked for `@keyframes` this commit had not met, by the name they asked for. */
|
|
828
|
+
private readonly awaitingKeyframes;
|
|
829
|
+
/**
|
|
830
|
+
* A sheet is registered when the first node it styles is committed, so a node committed before
|
|
831
|
+
* it can name keyframes that arrive later in the same commit. Those nodes play them from another
|
|
832
|
+
* commit straight away, as a browser applies keyframes however the sheets arrived; a name still
|
|
833
|
+
* unknown once the commit is over is reported.
|
|
834
|
+
*/
|
|
835
|
+
private settleKeyframes;
|
|
736
836
|
private readonly scrollDriver;
|
|
737
837
|
/** Whether native can move a view by a scroll with no JavaScript in between. */
|
|
738
838
|
get drivesScroll(): boolean;
|
|
@@ -817,6 +917,11 @@ export declare class Engine implements HostEngine {
|
|
|
817
917
|
* A `sheet` already gone, such as a global sheet removed, leaves `next` registered last.
|
|
818
918
|
*/
|
|
819
919
|
sheetReplaced(sheet: StyleSheet, next: StyleSheet | null): void;
|
|
920
|
+
/**
|
|
921
|
+
* Every sheet's `@font-face` rules again, in order, and every text that names a family matched
|
|
922
|
+
* again: a face whose rule went is no longer matched, though the platform keeps it registered.
|
|
923
|
+
*/
|
|
924
|
+
private reindexFonts;
|
|
820
925
|
/** Every sheet's `@keyframes` again, in order, and every animation told to look them up. */
|
|
821
926
|
private reindexKeyframes;
|
|
822
927
|
/** Mark every node under `node` with an animation, so it looks its keyframes up again. */
|
|
@@ -831,6 +936,8 @@ export declare class Engine implements HostEngine {
|
|
|
831
936
|
* Once per sheet that declares faces, so walking the tree costs nothing that matters.
|
|
832
937
|
*/
|
|
833
938
|
private rematchFonts;
|
|
939
|
+
/** Mark every element under `node` committed with a family, so it is matched again. */
|
|
940
|
+
private markFontText;
|
|
834
941
|
private readonly knownSheets;
|
|
835
942
|
/**
|
|
836
943
|
* Start, advance or stop the `@keyframes` animation a node's style asks for.
|
|
@@ -839,6 +946,16 @@ export declare class Engine implements HostEngine {
|
|
|
839
946
|
* own frames, which is what lets an element animate in without differing from anything.
|
|
840
947
|
*/
|
|
841
948
|
private animated;
|
|
949
|
+
/**
|
|
950
|
+
* A clock animation the scroll plays instead: the same animation where only the timeline moved,
|
|
951
|
+
* and one cancelled where the name changed.
|
|
952
|
+
*/
|
|
953
|
+
private handOverToScroll;
|
|
954
|
+
/**
|
|
955
|
+
* `animationcancel` for an animation stopped before it ended: the element no longer asks for it,
|
|
956
|
+
* asks for another by name, or its keyframes went, as a browser fires it.
|
|
957
|
+
*/
|
|
958
|
+
private cancelPlaying;
|
|
842
959
|
/** Start the clock on an animation, unless the node is already playing this one. */
|
|
843
960
|
private startPlaying;
|
|
844
961
|
/**
|
|
@@ -955,6 +1072,20 @@ export declare class Engine implements HostEngine {
|
|
|
955
1072
|
* which, per child, was most of what a one-row update cost.
|
|
956
1073
|
*/
|
|
957
1074
|
private reconcileChildren;
|
|
1075
|
+
/**
|
|
1076
|
+
* The paragraph a run of text written straight into a view is drawn in, or nothing for a run of
|
|
1077
|
+
* whitespace, which a browser draws nothing for between the items of a flex box either.
|
|
1078
|
+
*
|
|
1079
|
+
* It is the text's own, kept on the text node, and no part of the tree: its parent is the view,
|
|
1080
|
+
* so it inherits what the view's text would, and no rule matches it.
|
|
1081
|
+
*/
|
|
1082
|
+
/**
|
|
1083
|
+
* A run of text under `parent`, which commits as `viewName`: the text itself inside a text, a
|
|
1084
|
+
* paragraph of its own inside any other view, and nothing where the view takes its text as a
|
|
1085
|
+
* prop (see `ViewNameOptions`) or the run is whitespace between a view's children.
|
|
1086
|
+
*/
|
|
1087
|
+
private reconcileText;
|
|
1088
|
+
private looseText;
|
|
958
1089
|
/** Remember an iOS modal host committed as showing, so hiding it waits for `topDismiss`. */
|
|
959
1090
|
private notePresented;
|
|
960
1091
|
/**
|
|
@@ -989,6 +1120,11 @@ export declare class Engine implements HostEngine {
|
|
|
989
1120
|
* Its native state goes with it, as it would there.
|
|
990
1121
|
*/
|
|
991
1122
|
private reconcileUnder;
|
|
1123
|
+
/**
|
|
1124
|
+
* A node whose native view is no longer the one it was created as is created again: a text
|
|
1125
|
+
* element that came to hold a view, or stopped. A clone keeps the view it was made as.
|
|
1126
|
+
*/
|
|
1127
|
+
private forgetRenamed;
|
|
992
1128
|
/**
|
|
993
1129
|
* Let a node and everything under it be created again at the next commit. The views it keeps
|
|
994
1130
|
* for hoisted names go too: they are children of the native view it is losing.
|
|
@@ -1018,7 +1154,7 @@ export declare class Engine implements HostEngine {
|
|
|
1018
1154
|
private create;
|
|
1019
1155
|
/**
|
|
1020
1156
|
* Angular's own unknown-element check does not run in this pipeline, so a `<text>` in a
|
|
1021
|
-
* template that never imported `Text` compiles,
|
|
1157
|
+
* template that never imported `Text` compiles, draws without the component, and looks like a
|
|
1022
1158
|
* layout bug. On the first commit of any known element with no component behind it, say so.
|
|
1023
1159
|
*/
|
|
1024
1160
|
private checkClaimed;
|
|
@@ -1151,6 +1287,11 @@ export declare class Engine implements HostEngine {
|
|
|
1151
1287
|
private isAttached;
|
|
1152
1288
|
/** The host's `resolveAssetSource`, for a component that needs an asset's size up front. */
|
|
1153
1289
|
resolveAsset(value: unknown): unknown;
|
|
1290
|
+
/**
|
|
1291
|
+
* A colour prop as native takes it. A shape's `fill` or `stroke` the cascade settled from a
|
|
1292
|
+
* token is the solid brush react-native-svg takes, and `none` no paint at all.
|
|
1293
|
+
*/
|
|
1294
|
+
private painted;
|
|
1154
1295
|
/**
|
|
1155
1296
|
* The host's `processColor`, and the one place a platform colour becomes one.
|
|
1156
1297
|
*
|