@ng-native/fabric 0.13.0 → 0.15.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/css.d.ts +63 -6
- package/dist/css.js +268 -59
- package/dist/css.js.map +1 -1
- package/dist/defer-triggers.js +2 -8
- package/dist/defer-triggers.js.map +1 -1
- package/dist/engine.d.ts +201 -21
- package/dist/engine.js +915 -125
- package/dist/engine.js.map +1 -1
- package/dist/fabric.d.ts +1 -1
- package/dist/fabric.js +25 -0
- package/dist/fabric.js.map +1 -1
- package/dist/font-faces.d.ts +19 -0
- package/dist/font-faces.js +42 -0
- package/dist/font-faces.js.map +1 -1
- package/dist/forms-inputs.d.ts +1 -1
- package/dist/forms-inputs.js +2 -2
- package/dist/forms-inputs.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/inline-derived-token.js +56 -7
- package/dist/inline-derived-token.js.map +1 -1
- package/dist/inline-token.d.ts +4 -3
- package/dist/inline-token.js +41 -8
- package/dist/inline-token.js.map +1 -1
- package/dist/native-drive.d.ts +42 -1
- package/dist/native-drive.js +135 -9
- package/dist/native-drive.js.map +1 -1
- package/dist/node-global.d.ts +9 -0
- package/dist/node-global.js +41 -0
- package/dist/node-global.js.map +1 -0
- package/dist/relative-colour.d.ts +2 -2
- package/dist/relative-colour.js +4 -0
- package/dist/relative-colour.js.map +1 -1
- package/dist/scroll-animation.d.ts +12 -0
- package/dist/scroll-animation.js +10 -0
- package/dist/scroll-animation.js.map +1 -1
- package/dist/transition.d.ts +3 -2
- package/dist/transition.js +17 -8
- package/dist/transition.js.map +1 -1
- package/package.json +1 -1
package/dist/defer-triggers.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* `installDeferTriggers` runs once, from `mount()`, before anything renders.
|
|
12
12
|
*/
|
|
13
13
|
import { isEngineNode, viewNameOf } from "./engine.js";
|
|
14
|
+
import { letEngineNodesPass } from "./node-global.js";
|
|
14
15
|
/** The views a node scrolls inside of, and whose scrolling can bring it into view. */
|
|
15
16
|
const SCROLLERS = new Set(['ScrollView', 'AndroidHorizontalScrollView']);
|
|
16
17
|
/**
|
|
@@ -137,14 +138,7 @@ export function installDeferTriggers() {
|
|
|
137
138
|
const scope = globalThis;
|
|
138
139
|
const existing = scope['Element'];
|
|
139
140
|
if (existing) {
|
|
140
|
-
|
|
141
|
-
const own = existing[Symbol.hasInstance];
|
|
142
|
-
Object.defineProperty(existing, Symbol.hasInstance, {
|
|
143
|
-
configurable: true,
|
|
144
|
-
value(value) {
|
|
145
|
-
return (this === existing && isEngineNode(value)) || own.call(this, value);
|
|
146
|
-
},
|
|
147
|
-
});
|
|
141
|
+
letEngineNodesPass(existing);
|
|
148
142
|
}
|
|
149
143
|
else {
|
|
150
144
|
scope['Element'] = class Element {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defer-triggers.js","sourceRoot":"","sources":["../src/defer-triggers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAqC,MAAM,aAAa,CAAC;AAE1F,sFAAsF;AACtF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,6BAA6B,CAAC,CAAC,CAAC;AAkBzE;;;;;;;;GAQG;AACH,MAAM,OAAO,0BAA0B;IACpB,QAAQ,CAAW;IACnB,SAAS,CAAS;IAClB,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAE1D,YAAY,QAAkB,EAAE,OAAiB;QAC/C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;YACvC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,SAAsB,CAAC;YACtC,CAAC,CAAC,CAA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igger element, for the\n * engine's nodes.\n *\n * Angular registers those three triggers on the element itself rather than through `Renderer2`:\n * it asserts in development that the element is an `Element`, listens with `addEventListener`,\n * and watches for visibility with a global `IntersectionObserver`. An engine node was none of\n * those, so the placeholder stayed forever and every render logged an assertion. The listeners\n * are on the node (`addEventListener` in `engine.ts`); this is the other two.\n *\n * `installDeferTriggers` runs once, from `mount()`, before anything renders.\n */\nimport { isEngineNode, viewNameOf, type EngineNode, type WindowFrame } from './engine.ts';\n\n/** The views a node scrolls inside of, and whose scrolling can bring it into view. */\nconst SCROLLERS = new Set(['ScrollView', 'AndroidHorizontalScrollView']);\n\ninterface Entry {\n readonly target: EngineNode;\n readonly isIntersecting: boolean;\n readonly intersectionRatio: number;\n}\n\ntype Callback = (entries: Entry[], observer: EngineIntersectionObserver) => void;\n\ninterface Options {\n readonly threshold?: number | readonly number[];\n}\n\ninterface Watched {\n readonly stops: (() => void)[];\n}\n\n/**\n * Visibility for engine nodes, from the layout and scroll events native already sends.\n *\n * A node is checked when it is observed, when it is laid out, and whenever a scroll view it sits\n * in scrolls. The check measures the node in window coordinates, clips it by each scroll view\n * around it and by the window, and reports it intersecting once the visible share reaches the\n * threshold: any of it by default, as the web does, and a node of no size counts once its position\n * is inside. `root` and `rootMargin` are not applied; the root is always the window.\n */\nexport class EngineIntersectionObserver {\n private readonly callback: Callback;\n private readonly threshold: number;\n private readonly watched = new Map<EngineNode, Watched>();\n\n constructor(callback: Callback, options?: Options) {\n this.callback = callback;\n const threshold = options?.threshold;\n this.threshold = Array.isArray(threshold)\n ? Math.min(...(threshold as number[]))\n : ((threshold as number | undefined) ?? 0);\n }\n\n observe(target: EngineNode): void {\n if (this.watched.has(target)) return;\n const check = () => this.check(target);\n const stops = [target.host!.setEventListener(target, 'topLayout', check)];\n for (let at = target.parent; at; at = at.parent) {\n if (!SCROLLERS.has(viewNameOf(at))) continue;\n stops.push(at.host!.setEventListener(at, 'topScroll', check));\n }\n this.watched.set(target, { stops });\n // A node laid out before it was observed sends no layout event of its own. Measured now,\n // after the commit that mounted it, and in a microtask, as an observer never calls back from\n // inside `observe`.\n queueMicrotask(check);\n }\n\n unobserve(target: EngineNode): void {\n const watched = this.watched.get(target);\n if (!watched) return;\n for (const stop of watched.stops) stop();\n this.watched.delete(target);\n }\n\n disconnect(): void {\n for (const target of [...this.watched.keys()]) this.unobserve(target);\n }\n\n takeRecords(): Entry[] {\n return [];\n }\n\n private check(target: EngineNode): void {\n if (!this.watched.has(target)) return;\n const ratio = visibleShare(target);\n if (ratio === null) return;\n const isIntersecting = this.threshold > 0 ? ratio >= this.threshold : ratio >= 0;\n if (isIntersecting) this.callback([{ target, isIntersecting, intersectionRatio: ratio }], this);\n }\n}\n\n/** A frame as its four edges. */\ninterface Box {\n left: number;\n top: number;\n right: number;\n bottom: number;\n}\n\nconst box = (frame: WindowFrame): Box => ({\n left: frame.x,\n top: frame.y,\n right: frame.x + frame.width,\n bottom: frame.y + frame.height,\n});\n\nfunction measured(node: EngineNode): Box | null {\n let found: Box | null = null;\n node.host!.measure(node, (frame) => (found = box(frame)));\n return found;\n}\n\nfunction clip(into: Box, by: Box): void {\n into.left = Math.max(into.left, by.left);\n into.top = Math.max(into.top, by.top);\n into.right = Math.min(into.right, by.right);\n into.bottom = Math.min(into.bottom, by.bottom);\n}\n\n/**\n * How much of the node is on screen, from 0 to 1; below 0 when none of it is, and null when it\n * has not been measured. Measuring is synchronous on the new architecture.\n */\nfunction visibleShare(target: EngineNode): number | null {\n const frame = measured(target);\n if (!frame) return null;\n const visible = { ...frame };\n for (let at = target.parent; at; at = at.parent) {\n if (!SCROLLERS.has(viewNameOf(at))) continue;\n const scroller = measured(at);\n if (scroller) clip(visible, scroller);\n }\n const window = (target.host as { viewport?: { width: number; height: number } }).viewport;\n if (window && window.width > 0 && window.height > 0) {\n clip(visible, { left: 0, top: 0, right: window.width, bottom: window.height });\n }\n const width = visible.right - visible.left;\n const height = visible.bottom - visible.top;\n if (width < 0 || height < 0) return -1;\n const area = (frame.right - frame.left) * (frame.bottom - frame.top);\n return area > 0 ? (width * height) / area : 1;\n}\n\ntype Constructor = abstract new (...args: never[]) => object;\n\n/** React Native's own `IntersectionObserver`, when its feature flag has installed one. */\ninterface NativeObserver {\n observe(target: unknown): void;\n unobserve(target: unknown): void;\n disconnect(): void;\n}\ntype NativeObserverClass = new (callback: unknown, options?: unknown) => NativeObserver;\n\n// Never reset: the globals it patches stay patched for the life of the process.\nlet installed = false;\n\n/**\n * Let an engine node pass Angular's development check that a trigger is an `Element`, and give\n * `@defer (on viewport)` an `IntersectionObserver` that can watch one.\n *\n * React Native defines a global `Element` for its own DOM-like nodes, so an engine node is made to\n * answer `instanceof Element` as well, and nothing else about that class changes. Node has none,\n * and gets one that only engine nodes are instances of. An `IntersectionObserver` React Native\n * already has is kept for its own nodes; engine nodes are watched by the one above.\n */\nexport function installDeferTriggers(): void {\n if (installed) return;\n installed = true;\n const scope = globalThis as unknown as Record<string, unknown>;\n\n const existing = scope['Element'] as Constructor | undefined;\n if (existing) {\n // Its own check if it defines one, and the ordinary prototype walk if not.\n const own = existing[Symbol.hasInstance];\n Object.defineProperty(existing, Symbol.hasInstance, {\n configurable: true,\n value(this: Constructor, value: unknown): boolean {\n return (this === existing && isEngineNode(value)) || own.call(this, value);\n },\n });\n } else {\n scope['Element'] = class Element {\n static [Symbol.hasInstance](value: unknown): boolean {\n return isEngineNode(value);\n }\n };\n }\n\n const native = scope['IntersectionObserver'] as NativeObserverClass | undefined;\n if (!native) {\n scope['IntersectionObserver'] = EngineIntersectionObserver;\n return;\n }\n scope['IntersectionObserver'] = class extends EngineIntersectionObserver {\n private readonly args: [unknown, unknown];\n private other: NativeObserver | null = null;\n\n constructor(callback: Callback, options?: Options) {\n super(callback, options);\n this.args = [callback, options];\n }\n\n override observe(target: EngineNode): void {\n if (isEngineNode(target)) super.observe(target);\n else (this.other ??= new native(...this.args)).observe(target);\n }\n\n override unobserve(target: EngineNode): void {\n if (isEngineNode(target)) super.unobserve(target);\n else this.other?.unobserve(target);\n }\n\n override disconnect(): void {\n super.disconnect();\n this.other?.disconnect();\n }\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"defer-triggers.js","sourceRoot":"","sources":["../src/defer-triggers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAqC,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAoB,MAAM,kBAAkB,CAAC;AAExE,sFAAsF;AACtF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,6BAA6B,CAAC,CAAC,CAAC;AAkBzE;;;;;;;;GAQG;AACH,MAAM,OAAO,0BAA0B;IACpB,QAAQ,CAAW;IACnB,SAAS,CAAS;IAClB,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAE1D,YAAY,QAAkB,EAAE,OAAiB;QAC/C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;YACvC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,SAAsB,CAAC;YACtC,CAAC,CAAC,CAAE,SAAgC,IAAI,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,CAAC,MAAkB;QACxB,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,OAAO;QACrC,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,IAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;QAC1E,KAAK,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE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K,KAAK,IAAI,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACjE,CAAC;QAEQ,SAAS,CAAC,MAAkB;YACnC,IAAI,YAAY,CAAC,MAAM,CAAC;gBAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;;gBAC7C,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;QAEQ,UAAU;YACjB,KAAK,CAAC,UAAU,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * What Angular's `@defer (on interaction | hover | viewport)` asks of a trigger element, for the\n * engine's nodes.\n *\n * Angular registers those three triggers on the element itself rather than through `Renderer2`:\n * it asserts in development that the element is an `Element`, listens with `addEventListener`,\n * and watches for visibility with a global `IntersectionObserver`. An engine node was none of\n * those, so the placeholder stayed forever and every render logged an assertion. The listeners\n * are on the node (`addEventListener` in `engine.ts`); this is the other two.\n *\n * `installDeferTriggers` runs once, from `mount()`, before anything renders.\n */\nimport { isEngineNode, viewNameOf, type EngineNode, type WindowFrame } from './engine.ts';\nimport { letEngineNodesPass, type Constructor } from './node-global.ts';\n\n/** The views a node scrolls inside of, and whose scrolling can bring it into view. */\nconst SCROLLERS = new Set(['ScrollView', 'AndroidHorizontalScrollView']);\n\ninterface Entry {\n readonly target: EngineNode;\n readonly isIntersecting: boolean;\n readonly intersectionRatio: number;\n}\n\ntype Callback = (entries: Entry[], observer: EngineIntersectionObserver) => void;\n\ninterface Options {\n readonly threshold?: number | readonly number[];\n}\n\ninterface Watched {\n readonly stops: (() => void)[];\n}\n\n/**\n * Visibility for engine nodes, from the layout and scroll events native already sends.\n *\n * A node is checked when it is observed, when it is laid out, and whenever a scroll view it sits\n * in scrolls. The check measures the node in window coordinates, clips it by each scroll view\n * around it and by the window, and reports it intersecting once the visible share reaches the\n * threshold: any of it by default, as the web does, and a node of no size counts once its position\n * is inside. `root` and `rootMargin` are not applied; the root is always the window.\n */\nexport class EngineIntersectionObserver {\n private readonly callback: Callback;\n private readonly threshold: number;\n private readonly watched = new Map<EngineNode, Watched>();\n\n constructor(callback: Callback, options?: Options) {\n this.callback = callback;\n const threshold = options?.threshold;\n this.threshold = Array.isArray(threshold)\n ? Math.min(...(threshold as number[]))\n : ((threshold as number | undefined) ?? 0);\n }\n\n observe(target: EngineNode): void {\n if (this.watched.has(target)) return;\n const check = () => this.check(target);\n const stops = [target.host!.setEventListener(target, 'topLayout', check)];\n for (let at = target.parent; at; at = at.parent) {\n if (!SCROLLERS.has(viewNameOf(at))) continue;\n stops.push(at.host!.setEventListener(at, 'topScroll', check));\n }\n this.watched.set(target, { stops });\n // A node laid out before it was observed sends no layout event of its own. Measured now,\n // after the commit that mounted it, and in a microtask, as an observer never calls back from\n // inside `observe`.\n queueMicrotask(check);\n }\n\n unobserve(target: EngineNode): void {\n const watched = this.watched.get(target);\n if (!watched) return;\n for (const stop of watched.stops) stop();\n this.watched.delete(target);\n }\n\n disconnect(): void {\n for (const target of [...this.watched.keys()]) this.unobserve(target);\n }\n\n takeRecords(): Entry[] {\n return [];\n }\n\n private check(target: EngineNode): void {\n if (!this.watched.has(target)) return;\n const ratio = visibleShare(target);\n if (ratio === null) return;\n const isIntersecting = this.threshold > 0 ? ratio >= this.threshold : ratio >= 0;\n if (isIntersecting) this.callback([{ target, isIntersecting, intersectionRatio: ratio }], this);\n }\n}\n\n/** A frame as its four edges. */\ninterface Box {\n left: number;\n top: number;\n right: number;\n bottom: number;\n}\n\nconst box = (frame: WindowFrame): Box => ({\n left: frame.x,\n top: frame.y,\n right: frame.x + frame.width,\n bottom: frame.y + frame.height,\n});\n\nfunction measured(node: EngineNode): Box | null {\n let found: Box | null = null;\n node.host!.measure(node, (frame) => (found = box(frame)));\n return found;\n}\n\nfunction clip(into: Box, by: Box): void {\n into.left = Math.max(into.left, by.left);\n into.top = Math.max(into.top, by.top);\n into.right = Math.min(into.right, by.right);\n into.bottom = Math.min(into.bottom, by.bottom);\n}\n\n/**\n * How much of the node is on screen, from 0 to 1; below 0 when none of it is, and null when it\n * has not been measured. Measuring is synchronous on the new architecture.\n */\nfunction visibleShare(target: EngineNode): number | null {\n const frame = measured(target);\n if (!frame) return null;\n const visible = { ...frame };\n for (let at = target.parent; at; at = at.parent) {\n if (!SCROLLERS.has(viewNameOf(at))) continue;\n const scroller = measured(at);\n if (scroller) clip(visible, scroller);\n }\n const window = (target.host as { viewport?: { width: number; height: number } }).viewport;\n if (window && window.width > 0 && window.height > 0) {\n clip(visible, { left: 0, top: 0, right: window.width, bottom: window.height });\n }\n const width = visible.right - visible.left;\n const height = visible.bottom - visible.top;\n if (width < 0 || height < 0) return -1;\n const area = (frame.right - frame.left) * (frame.bottom - frame.top);\n return area > 0 ? (width * height) / area : 1;\n}\n\n/** React Native's own `IntersectionObserver`, when its feature flag has installed one. */\ninterface NativeObserver {\n observe(target: unknown): void;\n unobserve(target: unknown): void;\n disconnect(): void;\n}\ntype NativeObserverClass = new (callback: unknown, options?: unknown) => NativeObserver;\n\n// Never reset: the globals it patches stay patched for the life of the process.\nlet installed = false;\n\n/**\n * Let an engine node pass Angular's development check that a trigger is an `Element`, and give\n * `@defer (on viewport)` an `IntersectionObserver` that can watch one.\n *\n * React Native defines a global `Element` for its own DOM-like nodes, so an engine node is made to\n * answer `instanceof Element` as well, and nothing else about that class changes. Node has none,\n * and gets one that only engine nodes are instances of. An `IntersectionObserver` React Native\n * already has is kept for its own nodes; engine nodes are watched by the one above.\n */\nexport function installDeferTriggers(): void {\n if (installed) return;\n installed = true;\n const scope = globalThis as unknown as Record<string, unknown>;\n\n const existing = scope['Element'] as Constructor | undefined;\n if (existing) {\n letEngineNodesPass(existing);\n } else {\n scope['Element'] = class Element {\n static [Symbol.hasInstance](value: unknown): boolean {\n return isEngineNode(value);\n }\n };\n }\n\n const native = scope['IntersectionObserver'] as NativeObserverClass | undefined;\n if (!native) {\n scope['IntersectionObserver'] = EngineIntersectionObserver;\n return;\n }\n scope['IntersectionObserver'] = class extends EngineIntersectionObserver {\n private readonly args: [unknown, unknown];\n private other: NativeObserver | null = null;\n\n constructor(callback: Callback, options?: Options) {\n super(callback, options);\n this.args = [callback, options];\n }\n\n override observe(target: EngineNode): void {\n if (isEngineNode(target)) super.observe(target);\n else (this.other ??= new native(...this.args)).observe(target);\n }\n\n override unobserve(target: EngineNode): void {\n if (isEngineNode(target)) super.unobserve(target);\n else this.other?.unobserve(target);\n }\n\n override disconnect(): void {\n super.disconnect();\n this.other?.disconnect();\n }\n };\n}\n"]}
|
package/dist/engine.d.ts
CHANGED
|
@@ -186,8 +186,8 @@ interface Committed {
|
|
|
186
186
|
export interface EngineNode extends HostNode {
|
|
187
187
|
readonly kind: NodeKind;
|
|
188
188
|
/** Lowercase template spelling, e.g. `view`. Never the native view name. */
|
|
189
|
-
readonly
|
|
190
|
-
/** `
|
|
189
|
+
readonly tag: string;
|
|
190
|
+
/** `tag` again, for Angular 22.0, which reads it on a component's host element. */
|
|
191
191
|
readonly tagName: string;
|
|
192
192
|
props: Record<string, unknown>;
|
|
193
193
|
text: string;
|
|
@@ -269,6 +269,14 @@ export interface EngineNode extends HostNode {
|
|
|
269
269
|
playing?: RunningAnimation;
|
|
270
270
|
/** An animation played by a scroll view's offset rather than the clock. See `scrollAnimated`. */
|
|
271
271
|
scrolled?: ScrollAnimation;
|
|
272
|
+
/**
|
|
273
|
+
* The props a native animated graph has set on the view with this tag, which no commit
|
|
274
|
+
* changes again: see `Touched`. A view made again has another tag, and starts with none.
|
|
275
|
+
*/
|
|
276
|
+
owned?: {
|
|
277
|
+
readonly tag: number;
|
|
278
|
+
readonly keys: Set<string>;
|
|
279
|
+
};
|
|
272
280
|
/**
|
|
273
281
|
* The last `transform` built from the individual transform properties, and what it was built
|
|
274
282
|
* from. Reused while the parts are the same objects, so an unrelated change does not re-send it.
|
|
@@ -299,8 +307,18 @@ export interface EngineNode extends HostNode {
|
|
|
299
307
|
nativeView?: true;
|
|
300
308
|
/** Props kept for selectors to match and left out of what is committed. See `keepAsAttribute`. */
|
|
301
309
|
attributeOnly?: Set<string>;
|
|
310
|
+
/**
|
|
311
|
+
* Set by whoever needs to know which props have been written: each `setProp` with a value adds
|
|
312
|
+
* its key, even one equal to the value already there, and one with `undefined` or `null` takes
|
|
313
|
+
* it out. The native stack outlet tells a page's own binding from a value it carried this way.
|
|
314
|
+
*/
|
|
315
|
+
writes?: Set<string>;
|
|
302
316
|
/** The child this node's background is painted on instead of itself. See `paintOn`. */
|
|
303
317
|
paintsOn?: EngineNode;
|
|
318
|
+
/** What this node's background colour is handed to instead of painted. See `takePaint`. */
|
|
319
|
+
paintTaker?: (color: unknown) => void;
|
|
320
|
+
/** The background colour `paintTaker` was last handed, or is about to be. */
|
|
321
|
+
paintTaken?: unknown;
|
|
304
322
|
/**
|
|
305
323
|
* Style weaker than every sheet, where no rule and no inline style says otherwise. What lets the
|
|
306
324
|
* root component's host fill the surface by default and still give way to its own `:host`. See
|
|
@@ -403,7 +421,16 @@ export interface ViewNameOptions {
|
|
|
403
421
|
* element is the engine's own, as the paragraph a view is given for its loose text is.
|
|
404
422
|
*/
|
|
405
423
|
readonly looseText?: string;
|
|
424
|
+
/**
|
|
425
|
+
* Where a view's own props name a font that must reach native by another name, as SwiftUI's
|
|
426
|
+
* `font` modifier must name a face by its file's PostScript name: rewrites `props` in place,
|
|
427
|
+
* given that name for each name the app's `@font-face` faces are registered under. Called on
|
|
428
|
+
* every commit of the view, and again for each view when the faces change.
|
|
429
|
+
*/
|
|
430
|
+
readonly fontNames?: (props: Record<string, unknown>, postScriptName: PostScriptNames) => void;
|
|
406
431
|
}
|
|
432
|
+
/** The PostScript name of the face a name is registered under, where the build read it. */
|
|
433
|
+
export type PostScriptNames = (name: string) => string | undefined;
|
|
407
434
|
/**
|
|
408
435
|
* A view whose native name differs by platform. Chosen when the view is looked up rather than when
|
|
409
436
|
* it is registered, so it does not matter which ran first: an app's imports register the router's
|
|
@@ -457,6 +484,25 @@ export interface HoistOptions {
|
|
|
457
484
|
* another, so what the native side sees is one config that is updated, never one that goes.
|
|
458
485
|
*/
|
|
459
486
|
standIn?: Record<string, unknown>;
|
|
487
|
+
/**
|
|
488
|
+
* Have the ancestor commit the elements hoisted into it and nothing else, in the order they
|
|
489
|
+
* were written.
|
|
490
|
+
*
|
|
491
|
+
* For a native component that takes children of one type only. `RNSScreenStackHeaderConfig`
|
|
492
|
+
* takes `RNSScreenStackHeaderSubview`s: iOS logs an error and drops any other child, and Android
|
|
493
|
+
* throws. A header item written inside a component of the header reached it inside that
|
|
494
|
+
* component's host view.
|
|
495
|
+
*/
|
|
496
|
+
only?: boolean;
|
|
497
|
+
/**
|
|
498
|
+
* Ancestor names the element never hoists past: met before the ancestor it commits into, it
|
|
499
|
+
* commits where it is, as one with no such ancestor does.
|
|
500
|
+
*
|
|
501
|
+
* For an ancestor the target is not meant to reach through. A tab's page with no stack of its
|
|
502
|
+
* own has no screen of its own, and the screen above its tab is the one that holds the whole
|
|
503
|
+
* tab bar, so a header written in that page must not configure it.
|
|
504
|
+
*/
|
|
505
|
+
stopAt?: readonly string[];
|
|
460
506
|
}
|
|
461
507
|
/** A native view an ancestor keeps for a hoisted name with a stand-in, and who it is for now. */
|
|
462
508
|
interface KeptHoist {
|
|
@@ -467,7 +513,7 @@ interface KeptHoist {
|
|
|
467
513
|
/** The part of a node `viewNameOf` reads: an engine node, or any host's mirror of one. */
|
|
468
514
|
export interface ViewNameNode {
|
|
469
515
|
readonly kind: string;
|
|
470
|
-
readonly
|
|
516
|
+
readonly tag: string;
|
|
471
517
|
readonly parent: ViewNameNode | null;
|
|
472
518
|
/** Whether a component is mounted on it, and whether that component is the native view. */
|
|
473
519
|
readonly componentHost?: boolean;
|
|
@@ -650,6 +696,8 @@ export declare class Engine implements HostEngine {
|
|
|
650
696
|
* binding, so nothing marks an Angular view dirty and no change-detection pass would follow.
|
|
651
697
|
*/
|
|
652
698
|
private setActiveChain;
|
|
699
|
+
/** The nodes a press has set `:active` on, to clear whatever happens to the tree meanwhile. */
|
|
700
|
+
private readonly activeNodes;
|
|
653
701
|
/** Whether any sheet styles a pressed element, and each compound that asks about one from another. */
|
|
654
702
|
private activeUse;
|
|
655
703
|
/** What each sheet in play asks about a pressed element: `activeUse` is all of them together. */
|
|
@@ -793,13 +841,29 @@ export declare class Engine implements HostEngine {
|
|
|
793
841
|
* element matched again, and one named as what a rule's element is inside, `.animating .close`
|
|
794
842
|
* or `.close:is(.animating *)`, the elements under the node that such rules are for. What is
|
|
795
843
|
* under any of those is styled again from the rules it matched, for what it inherits: a `dark`
|
|
796
|
-
* class on the root finds no rule again for an element no `dark` rule is for.
|
|
797
|
-
* has
|
|
844
|
+
* class on the root finds no rule again for an element no `dark` rule is for. One named in
|
|
845
|
+
* `:has()`, or answering a test of the class attribute there, has the boxes above the node
|
|
846
|
+
* asked again, and one named only in `:has(> )` the box right above it. Any other class has the node and everything under it matched again, as any
|
|
847
|
+
* other change to it does.
|
|
798
848
|
*
|
|
799
849
|
* A sheet that names a class later restyles what it is for as it arrives, and a node not yet
|
|
800
850
|
* committed is styled when it is, with the class as it is then.
|
|
801
851
|
*/
|
|
802
852
|
private markClasses;
|
|
853
|
+
/**
|
|
854
|
+
* How many class changes have restyled what is under an element. `markUnder` walks the tree as
|
|
855
|
+
* it is, so an element out of it then is not reached: one that comes back after any is matched
|
|
856
|
+
* again, with all that is under it.
|
|
857
|
+
*/
|
|
858
|
+
private classesAbove;
|
|
859
|
+
/**
|
|
860
|
+
* The count when each element went out of the tree, for the ones still out. `detach` sets it
|
|
861
|
+
* for a node that only moves too, so `markReturned` runs after it and clears that.
|
|
862
|
+
*/
|
|
863
|
+
private readonly outSince;
|
|
864
|
+
/** Have matched again a node coming back into the tree that missed a class change above it. */
|
|
865
|
+
private markReturned;
|
|
866
|
+
private markAllUnder;
|
|
803
867
|
/**
|
|
804
868
|
* Have matched again each element under a node that one of `subjects`' rules could be for. One
|
|
805
869
|
* under another is marked too: what is under an element marked this way keeps its rules.
|
|
@@ -873,6 +937,13 @@ export declare class Engine implements HostEngine {
|
|
|
873
937
|
* forgetting walks each subtree that left once.
|
|
874
938
|
*/
|
|
875
939
|
private releaseDetached;
|
|
940
|
+
/** A pressed node out of the tree gets no release: native has no view to end the touch on. */
|
|
941
|
+
private dropDetachedPress;
|
|
942
|
+
/**
|
|
943
|
+
* Forget the focused node, which has left the tree without a blur: off the node as well as the
|
|
944
|
+
* engine, or a `:focus` rule styles it again when it is put back.
|
|
945
|
+
*/
|
|
946
|
+
private dropFocus;
|
|
876
947
|
/** Forget the committed views of each node removed since the last commit that is still out. */
|
|
877
948
|
private forgetDetached;
|
|
878
949
|
/** The root of the tree a node is in: the engine's root while it is attached. */
|
|
@@ -885,6 +956,18 @@ export declare class Engine implements HostEngine {
|
|
|
885
956
|
destroyNode(node: EngineNode): void;
|
|
886
957
|
parentNode(node: EngineNode): EngineNode | null;
|
|
887
958
|
nextSibling(node: EngineNode): EngineNode | null;
|
|
959
|
+
/**
|
|
960
|
+
* Whether any declaration the engine was given transitions or animates: until one does, a
|
|
961
|
+
* node's style is committed as it is, with nothing asked of what eases it. See `eased`.
|
|
962
|
+
*/
|
|
963
|
+
private eases;
|
|
964
|
+
private noteEasing;
|
|
965
|
+
/** A node's style as its transitions and animation have it: a declaration asks for one. */
|
|
966
|
+
private eased;
|
|
967
|
+
/** Note a sheet any of whose rules transitions or animates: see `eases`. */
|
|
968
|
+
private noteSheetEasing;
|
|
969
|
+
/** Note a prop, or a style set as one, that transitions or animates: see `eases`. */
|
|
970
|
+
private noteEasingProp;
|
|
888
971
|
setProp(node: EngineNode, key: string, value: unknown): void;
|
|
889
972
|
/**
|
|
890
973
|
* Have the paragraph a run of text is in merged again: it is as tall as the tallest line of
|
|
@@ -898,6 +981,17 @@ export declare class Engine implements HostEngine {
|
|
|
898
981
|
* needs, as `<gradient-text>` is.
|
|
899
982
|
*/
|
|
900
983
|
paintOn(node: EngineNode, child: EngineNode): void;
|
|
984
|
+
/**
|
|
985
|
+
* Hand a node's background colour to `listener` instead of painting it: what its stylesheets,
|
|
986
|
+
* tokens and inline style resolve `background-color` to, or undefined for none. Called after
|
|
987
|
+
* each commit that changes it, the first one included. What a component needs whose colour is
|
|
988
|
+
* drawn by a native view the node is not, from a prop of that view's, as a bottom sheet's is.
|
|
989
|
+
* The function returned stops it, and the node paints its own background again.
|
|
990
|
+
*/
|
|
991
|
+
takePaint(node: EngineNode, listener: (color: unknown) => void): () => void;
|
|
992
|
+
/** Nodes whose background colour is to be handed over once the commit running ends. */
|
|
993
|
+
private readonly paintReports;
|
|
994
|
+
private reportPaint;
|
|
901
995
|
/**
|
|
902
996
|
* Keep a prop the node already has as an attribute: on the node for a selector such as
|
|
903
997
|
* `:host([variant='primary'])` to match, and left out of what is committed to the native view.
|
|
@@ -922,11 +1016,15 @@ export declare class Engine implements HostEngine {
|
|
|
922
1016
|
*/
|
|
923
1017
|
styleChanged(node: EngineNode): void;
|
|
924
1018
|
/**
|
|
925
|
-
* A bound declaration, `[style.color]`, whose value may be a `var()
|
|
926
|
-
*
|
|
927
|
-
*
|
|
1019
|
+
* A bound declaration, `[style.color]`, whose value may be a `var()`, or a length in `em` or a
|
|
1020
|
+
* viewport unit. One that is, is kept as a declaration the cascade settles with the node's
|
|
1021
|
+
* tokens, font size and viewport, as a rule's is, and true is answered: the text is no value to
|
|
1022
|
+
* put in the node's style. A negative `line-height` is dropped, with a warning, and true is
|
|
1023
|
+
* answered too. Any other value forgets what was kept.
|
|
928
1024
|
*/
|
|
929
1025
|
setBoundStyle(node: EngineNode, prop: string, value: unknown): boolean;
|
|
1026
|
+
/** Whether a bound value is one CSS has none of, which is dropped with a warning. */
|
|
1027
|
+
private refusedBound;
|
|
930
1028
|
/**
|
|
931
1029
|
* Set a custom property on a node, `--tint` from `[style.--tint]`, or remove it with `null`.
|
|
932
1030
|
*
|
|
@@ -943,8 +1041,9 @@ export declare class Engine implements HostEngine {
|
|
|
943
1041
|
private watchHas;
|
|
944
1042
|
/**
|
|
945
1043
|
* Something at or beneath `from` changed: every node from there up may match a `:has()` rule
|
|
946
|
-
* it did not, or stop matching one. They are matched again rather than
|
|
947
|
-
* which would restyle everything under them. Only sheets that use
|
|
1044
|
+
* it did not, or stop matching one, up to `upTo` and not it. They are matched again rather than
|
|
1045
|
+
* marked for restyling, which would restyle everything under them. Only sheets that use
|
|
1046
|
+
* `:has()` pay.
|
|
948
1047
|
*/
|
|
949
1048
|
private markBeneath;
|
|
950
1049
|
/**
|
|
@@ -958,8 +1057,18 @@ export declare class Engine implements HostEngine {
|
|
|
958
1057
|
* Have matched again what is under each box that changed beneath and that such a rule could
|
|
959
1058
|
* be asking: the nodes the rule is for, and no other. Once for a commit, however many changes
|
|
960
1059
|
* there were beneath the box: a table gains its rows one at a time.
|
|
1060
|
+
*
|
|
1061
|
+
* A rule asked of a box above is walked under the highest box that asks it, which reaches what
|
|
1062
|
+
* is under the boxes beneath that one as well: a rule `:has()` asks of any box is asked by every
|
|
1063
|
+
* box from the change up to the root, and walked once, from the root. The rules a box asks are
|
|
1064
|
+
* walked together, the tree beneath it once.
|
|
961
1065
|
*/
|
|
962
1066
|
private markUnderHas;
|
|
1067
|
+
/**
|
|
1068
|
+
* `markUnderHas` for one box: the rules it asks that no box above it was walked for, walked
|
|
1069
|
+
* together. What was walked under it and above it, which is `above` where it asks no more.
|
|
1070
|
+
*/
|
|
1071
|
+
private markUnderBox;
|
|
963
1072
|
/**
|
|
964
1073
|
* What `node` matches changed, which the elements after it can read: as many of them as a rule
|
|
965
1074
|
* steps along from one, every one for a `~`, and none where no sheet steps at all.
|
|
@@ -1007,6 +1116,9 @@ export declare class Engine implements HostEngine {
|
|
|
1007
1116
|
* optimisation.
|
|
1008
1117
|
*/
|
|
1009
1118
|
commit(): boolean;
|
|
1119
|
+
/** A field went out of view focused, in the commit running: see `undisplayed`. */
|
|
1120
|
+
private blurAfterCommit;
|
|
1121
|
+
private blurHidden;
|
|
1010
1122
|
private beforeCommit;
|
|
1011
1123
|
private announceCommit;
|
|
1012
1124
|
/**
|
|
@@ -1019,14 +1131,14 @@ export declare class Engine implements HostEngine {
|
|
|
1019
1131
|
/** The first commit whose new views have not been drawn yet, while `commitUnseen` runs. */
|
|
1020
1132
|
private unseen;
|
|
1021
1133
|
/**
|
|
1022
|
-
* A commit for what changed
|
|
1023
|
-
*
|
|
1134
|
+
* A commit for what changed after earlier commits, before a frame has drawn them. `since` is
|
|
1135
|
+
* how many commits there had been before the first of them (`stats.commits`).
|
|
1024
1136
|
*
|
|
1025
1137
|
* A view those commits created has not been seen in the style they gave it, so what this one
|
|
1026
|
-
* gives it is where it starts, and no transition runs toward it. That is what a browser
|
|
1027
|
-
*
|
|
1028
|
-
* is built on: Angular adds the enter class after the render pass that created
|
|
1029
|
-
* takes it off a frame later, which is the one change the transition is for.
|
|
1138
|
+
* gives it is where it starts, and no transition runs toward it. That is what a browser does
|
|
1139
|
+
* with a class added to an element before the frame after it was inserted, and what
|
|
1140
|
+
* `animate.enter` is built on: Angular adds the enter class after the render pass that created
|
|
1141
|
+
* the element, and takes it off a frame later, which is the one change the transition is for.
|
|
1030
1142
|
*/
|
|
1031
1143
|
commitUnseen(since: number): boolean;
|
|
1032
1144
|
/** Nodes that asked for `@keyframes` this commit had not met, by the name they asked for. */
|
|
@@ -1133,6 +1245,8 @@ export declare class Engine implements HostEngine {
|
|
|
1133
1245
|
* its parent's: the cascade's, and over it the parent's inline style.
|
|
1134
1246
|
*/
|
|
1135
1247
|
private movePaint;
|
|
1248
|
+
/** Note the background colour a node that hands it over resolves to, where it changed. */
|
|
1249
|
+
private takenPaint;
|
|
1136
1250
|
/**
|
|
1137
1251
|
* A container whose direction or alignment changed since a child with a `fit-content` size
|
|
1138
1252
|
* read it, or whose height stopped or started being one a percentage is taken of since a child
|
|
@@ -1193,6 +1307,7 @@ export declare class Engine implements HostEngine {
|
|
|
1193
1307
|
private markAnimated;
|
|
1194
1308
|
/** Every `@font-face` seen, global as on the web: a face declared in one sheet serves all. */
|
|
1195
1309
|
private readonly fontFaces;
|
|
1310
|
+
private readonly postScriptName;
|
|
1196
1311
|
/** Whether a sheet first used in this commit declared a face. See `rematchFonts`. */
|
|
1197
1312
|
private facesAdded;
|
|
1198
1313
|
/**
|
|
@@ -1273,10 +1388,24 @@ export declare class Engine implements HostEngine {
|
|
|
1273
1388
|
private playNatively;
|
|
1274
1389
|
/**
|
|
1275
1390
|
* Native reached the end of an animation it was playing. The frame it ends at, or the resting
|
|
1276
|
-
* style where it does not fill, is committed
|
|
1277
|
-
*
|
|
1391
|
+
* style where it does not fill, is committed, and set on native where the animation set the
|
|
1392
|
+
* prop (see `setOwned`). The view is let go first, which puts nothing back on Fabric: it is
|
|
1393
|
+
* drawn where the animation left it until then.
|
|
1278
1394
|
*/
|
|
1279
1395
|
private endedNatively;
|
|
1396
|
+
/** A graph of native's was connected to a view: see `Touched`. */
|
|
1397
|
+
private touchedNatively;
|
|
1398
|
+
/**
|
|
1399
|
+
* Set on native a change of a prop a graph of native's has set on the view before, while no
|
|
1400
|
+
* graph of its holds it: the commit cannot change it (see `Touched`). The payload is committed
|
|
1401
|
+
* as well, so the shadow node is as the view is drawn. A transform native cannot take as
|
|
1402
|
+
* numbers, a matrix, is left committed alone.
|
|
1403
|
+
*/
|
|
1404
|
+
private setOwned;
|
|
1405
|
+
/** The size a view is laid out at, where it has been. */
|
|
1406
|
+
private boxSize;
|
|
1407
|
+
/** Forget the props native set on a node's view, which is gone or made again. */
|
|
1408
|
+
private disown;
|
|
1280
1409
|
/** Take an animation back from native, which stops it there. The caller plays it on, or not. */
|
|
1281
1410
|
private stopNative;
|
|
1282
1411
|
/**
|
|
@@ -1339,6 +1468,13 @@ export declare class Engine implements HostEngine {
|
|
|
1339
1468
|
private reportHeld;
|
|
1340
1469
|
private reportMissingKeyframes;
|
|
1341
1470
|
private transitioned;
|
|
1471
|
+
/**
|
|
1472
|
+
* What a view was last painted with, by property, for a transition that arrives with the change
|
|
1473
|
+
* it eases: CSS takes the transition from the style after the change and eases from the value
|
|
1474
|
+
* before it. Nothing for a view nobody has seen yet, which starts where it is. The individual
|
|
1475
|
+
* transforms are read back from the parts the painted transform was put together from.
|
|
1476
|
+
*/
|
|
1477
|
+
private paintedBefore;
|
|
1342
1478
|
/** Nobody saw what the last commit gave a view it created, so this is where the view starts. */
|
|
1343
1479
|
private unseenTransitions;
|
|
1344
1480
|
/** The elements native is playing a transition of. */
|
|
@@ -1362,11 +1498,24 @@ export declare class Engine implements HostEngine {
|
|
|
1362
1498
|
/**
|
|
1363
1499
|
* Commit where it ends each transition of a size or a place that just started, for native to
|
|
1364
1500
|
* move the view there: a layout animation, which the commit asks for once it is known that
|
|
1365
|
-
* nothing else in it moves. One still on its way is committed where it ends too.
|
|
1501
|
+
* nothing else in it moves. One still on its way is committed where it ends too. On a host
|
|
1502
|
+
* with no layout animation they are eased from JavaScript, but for one sent on again and again.
|
|
1366
1503
|
*
|
|
1367
1504
|
* A width eased from JavaScript is a commit a frame, and a commit lays the whole screen out.
|
|
1368
1505
|
*/
|
|
1369
1506
|
private layEased;
|
|
1507
|
+
/** When each size in transition was last started, and how many starts in a row came soon. */
|
|
1508
|
+
private readonly laidStarts;
|
|
1509
|
+
/**
|
|
1510
|
+
* Whether a transition of a size is one sent on again and again, each before the last had
|
|
1511
|
+
* ended: a progress bar that steps every 50ms and eases each step over 150. Native moves the
|
|
1512
|
+
* view, and lays the screen out, every frame while a layout animation runs, and JavaScript
|
|
1513
|
+
* commits every frame while it eases one, so one started at every step is one that never
|
|
1514
|
+
* stops. The first, and one sent back before it ends, are played; from the second sent on in
|
|
1515
|
+
* a row, each is committed where it ends, and the steps are the motion. Played again once the
|
|
1516
|
+
* size has been left alone for as long as it lasts.
|
|
1517
|
+
*/
|
|
1518
|
+
private sentOnAgain;
|
|
1370
1519
|
/** The animations this commit lays out at their last frame, for native to move the views to. */
|
|
1371
1520
|
private laidPlayed;
|
|
1372
1521
|
/**
|
|
@@ -1427,6 +1576,8 @@ export declare class Engine implements HostEngine {
|
|
|
1427
1576
|
* `lettingGo`.
|
|
1428
1577
|
*/
|
|
1429
1578
|
private keeps;
|
|
1579
|
+
/** Whether a node, or an element it is in, is `display: none`. */
|
|
1580
|
+
private boxless;
|
|
1430
1581
|
/** One `@keyframes` player, one frame on. */
|
|
1431
1582
|
private advancePlayer;
|
|
1432
1583
|
/**
|
|
@@ -1451,7 +1602,11 @@ export declare class Engine implements HostEngine {
|
|
|
1451
1602
|
* device the platform pumps this from `requestAnimationFrame` for as long as it returns true.
|
|
1452
1603
|
*/
|
|
1453
1604
|
advanceAnimations(now?: number): boolean;
|
|
1454
|
-
/**
|
|
1605
|
+
/**
|
|
1606
|
+
* The host's conversions, applied to a copy. A removed prop travels as `cleared` says, null for
|
|
1607
|
+
* nearly every one. On an update a colour dropped as unreadable is null too: JSI leaves out an
|
|
1608
|
+
* undefined key, and Fabric keeps what a clone leaves out.
|
|
1609
|
+
*/
|
|
1455
1610
|
private processed;
|
|
1456
1611
|
/** Copy a list of shadow-like objects, running each `color` through the host's converter. */
|
|
1457
1612
|
private processNestedColors;
|
|
@@ -1563,6 +1718,11 @@ export declare class Engine implements HostEngine {
|
|
|
1563
1718
|
* keeps for hoisted nodes that are gone.
|
|
1564
1719
|
*/
|
|
1565
1720
|
private reconcileHoistTarget;
|
|
1721
|
+
/**
|
|
1722
|
+
* `reconcileHoistTarget` for a node that commits only what is hoisted into it
|
|
1723
|
+
* (`HoistOptions.only`): those nodes, in the order they were written, and none of its own.
|
|
1724
|
+
*/
|
|
1725
|
+
private reconcileOnlyHoisted;
|
|
1566
1726
|
/**
|
|
1567
1727
|
* A child's handle as a child of `parent`, created again when it was committed under another.
|
|
1568
1728
|
*
|
|
@@ -1596,6 +1756,17 @@ export declare class Engine implements HostEngine {
|
|
|
1596
1756
|
* itself so the native side sees an update rather than a removal.
|
|
1597
1757
|
*/
|
|
1598
1758
|
private standIn;
|
|
1759
|
+
/**
|
|
1760
|
+
* What a hoist target takes of a child written in it: the child's handle, `direct` for one
|
|
1761
|
+
* hoisted into it, which goes after its siblings, or null for none.
|
|
1762
|
+
*/
|
|
1763
|
+
private takenByTarget;
|
|
1764
|
+
/**
|
|
1765
|
+
* A clean element's handle under `parent`, before anything else is asked of it: one committed
|
|
1766
|
+
* there and unchanged since was displayed and in its place, and is still. The siblings of what
|
|
1767
|
+
* changed are most of what a commit steps over: a list one row of which ticks.
|
|
1768
|
+
*/
|
|
1769
|
+
private cleanUnder;
|
|
1599
1770
|
/** A clean child's committed handle, when its style still holds under its parent's. */
|
|
1600
1771
|
private stillCommitted;
|
|
1601
1772
|
/**
|
|
@@ -1622,6 +1793,12 @@ export declare class Engine implements HostEngine {
|
|
|
1622
1793
|
private readonly undefinedTokens;
|
|
1623
1794
|
/** Said once per name: a phone has no inspector to show the declaration struck out. */
|
|
1624
1795
|
private reportUndefinedToken;
|
|
1796
|
+
private readonly droppedDeclarations;
|
|
1797
|
+
/**
|
|
1798
|
+
* A declaration in a style, written or bound, that is no value its property takes, so it is
|
|
1799
|
+
* dropped as a browser drops it. Said once per element name and declaration, in development.
|
|
1800
|
+
*/
|
|
1801
|
+
reportDroppedDeclaration(prop: string, value: string, on: string, why: string): void;
|
|
1625
1802
|
private readonly unreadDisplays;
|
|
1626
1803
|
/**
|
|
1627
1804
|
* Said once per token and value: the compiler refuses `display: grid` written out, but a token
|
|
@@ -1741,9 +1918,12 @@ export declare class Engine implements HostEngine {
|
|
|
1741
1918
|
private isAttached;
|
|
1742
1919
|
/** The host's `resolveAssetSource`, for a component that needs an asset's size up front. */
|
|
1743
1920
|
resolveAsset(value: unknown): unknown;
|
|
1921
|
+
/** A colour prop as `processed` sends it: one dropped as unreadable is null on an update. */
|
|
1922
|
+
private colourProp;
|
|
1744
1923
|
/**
|
|
1745
1924
|
* A colour prop as native takes it. A shape's `fill` or `stroke` the cascade settled from a
|
|
1746
|
-
* token is the solid brush react-native-svg takes,
|
|
1925
|
+
* token is the solid brush react-native-svg takes, `none` no paint at all, and one the host
|
|
1926
|
+
* reads no colour in no paint of the shape's own.
|
|
1747
1927
|
*/
|
|
1748
1928
|
private painted;
|
|
1749
1929
|
/**
|