@ng-native/fabric 0.5.0 → 0.7.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 +212 -31
- package/dist/css.js +814 -134
- package/dist/css.js.map +1 -1
- package/dist/engine.d.ts +187 -2
- package/dist/engine.js +930 -88
- package/dist/engine.js.map +1 -1
- package/dist/inline-token.js +25 -12
- package/dist/inline-token.js.map +1 -1
- package/dist/inline-transform.js +21 -3
- package/dist/inline-transform.js.map +1 -1
- package/dist/native-drive.js +5 -0
- package/dist/native-drive.js.map +1 -1
- package/dist/scroll-animation.d.ts +13 -0
- package/dist/scroll-animation.js +53 -4
- package/dist/scroll-animation.js.map +1 -1
- package/dist/transition.d.ts +25 -1
- package/dist/transition.js +179 -30
- package/dist/transition.js.map +1 -1
- package/package.json +1 -1
package/dist/engine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,aAAa,EACb,UAAU,GAOX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EACL,cAAc,EACd,MAAM,EACN,WAAW,EACX,oBAAoB,EACpB,MAAM,EACN,IAAI,EACJ,QAAQ,GAMT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,UAAU,GAQX,MAAM,mBAAmB,CAAC;AAO3B,OAAO,EAAE,aAAa,EAAE,UAAU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W,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;CACF","sourcesContent":["/**\n * Framework-agnostic retained tree + incremental Fabric commit.\n * Nothing Angular-specific may enter this file; lint bans the import (see docs/ARCHITECTURE.md).\n *\n * Angular mutates; Fabric is persistent. A committed node is never mutated, it is cloned with\n * new props and/or a new child set. Cloning a leaf therefore forces every ancestor to re-clone,\n * because a persistent parent holds references to specific child handles. That bubble is\n * inherent and is what React's own Fabric renderer does.\n */\n\nimport {\n boundDeclaration,\n inlineInherited,\n setsInherited,\n StyleResolver,\n usesActive,\n type Compound,\n type Conditions,\n type DeferredDeclaration,\n type StyleCache,\n type StyleSheet,\n type TokenValue,\n} from './css.ts';\nimport { applyAria } from './aria-props.ts';\nimport { STYLED_ELEMENTS } from './element-styles.ts';\nimport {\n animationEvent,\n bezier,\n interpolate,\n readsInheritedColour,\n sample,\n step,\n tracksOf,\n type AnimationSpec,\n type Keyframe,\n type RunningAnimation,\n type Transition,\n type TransitionSpec,\n} from './transition.ts';\nimport { isFormsInput } from './forms-inputs.ts';\nimport { transformList } from './inline-transform.ts';\nimport { tokenFromValue } from './inline-token.ts';\nimport {\n NativeScrollDriver,\n scrollFeed,\n type DrivenProperty,\n type EventFeed,\n type NativeAnimated,\n type ScrollAxis,\n type ScrollDrive,\n type ScrollRange,\n type StaticTransform,\n} from './native-drive.ts';\nimport type { DrivenChannels } from './scroll-animation.ts';\n\nexport type FabricNode = { readonly __fabricNode: unique symbol } | object;\n\n/** Where a node is, in the window's coordinates. What `Engine.measure` reports. */\nimport type { HostEngine, HostNode, Settling } from './host.ts';\nimport { clockChannels, firstFrame, rangeOf, scrollChannels } from './scroll-animation.ts';\nimport { FontFaces } from './font-faces.ts';\nimport { premultipliedStops } from './premultiplied-stops.ts';\n\n/**\n * The animation a node's style asks for, with a play state from a rule of its own applied. Both\n * are instructions for this engine and nothing native has heard of them, so they come out of the\n * props; only when there, because a `delete` sends an object to Hermes's slow dictionary layout,\n * and this runs for every node that commits.\n */\nfunction animationOf(props: Record<string, unknown>): AnimationSpec | undefined {\n let spec = props['$animation'] as AnimationSpec | undefined;\n if (spec !== undefined) delete props['$animation'];\n for (const [key, field] of Object.entries(ANIMATION_PARTS)) {\n if (!(key in props)) continue;\n const value = props[key];\n delete props[key];\n if (spec && value !== null) spec = { ...spec, ...animationPart(field, value) };\n }\n return spec;\n}\n\nconst ANIMATION_PARTS = {\n $animationDuration: 'duration',\n $animationDelay: 'delay',\n $animationEasing: 'easing',\n $animationIterations: 'iterations',\n $animationDirection: 'direction',\n $animationFill: 'fill',\n $playState: 'paused',\n} as const;\n\nfunction animationPart(\n field: (typeof ANIMATION_PARTS)[keyof typeof ANIMATION_PARTS],\n value: unknown,\n): Partial<AnimationSpec> {\n switch (field) {\n case 'iterations':\n return { iterations: value === 'infinite' ? null : (value as number) };\n case 'direction':\n return {\n direction: value === 'normal' ? undefined : (value as AnimationSpec['direction']),\n };\n case 'paused':\n return { paused: value === 'paused' ? true : undefined };\n default:\n return { [field]: value };\n }\n}\n\n/**\n * Whether two specs ask for the same animation. By what they say rather than which object they\n * are: a spec with a token in its timing is settled afresh each time the node's style is, and an\n * animation that started again on every such commit would never get past its first frame.\n */\nfunction sameAnimation(a: AnimationSpec, b: AnimationSpec): boolean {\n if (a === b) return true;\n return (\n SPEC_FIELDS.every((field) => a[field] === b[field]) &&\n a.easing.join() === b.easing.join() &&\n a.range?.start === b.range?.start &&\n a.range?.end === b.range?.end\n );\n}\n\nconst SPEC_FIELDS = [\n 'name',\n 'duration',\n 'delay',\n 'iterations',\n 'fill',\n 'direction',\n 'timeline',\n] as const satisfies readonly (keyof AnimationSpec)[];\n\n/** A node's scroll-driven animation: what it plays, what drives it, and the frame it commits. */\ninterface ScrollAnimation {\n readonly spec: AnimationSpec;\n /** The `@keyframes` it was laid out from, so a hot swap that edits them lays it out again. */\n readonly frames: readonly Keyframe[];\n readonly tracks: ReadonlyMap<string, readonly { offset: number; value: unknown }[]>;\n readonly resting: Record<string, unknown>;\n readonly first: Record<string, unknown>;\n /** The colour the node inherits, which the tracks were built with, for frames that read it. */\n readonly inherited: unknown;\n readonly source: EngineNode | null;\n readonly drive: { update(channels: DrivenChannels): void; stop(): void } | null;\n}\n\nexport interface WindowFrame {\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n}\nexport type FabricNodeSet = unknown;\n\n/** The slice of `global.nativeFabricUIManager` we actually use. */\nexport interface FabricUIManager {\n createNode(\n reactTag: number,\n viewName: string,\n rootTag: number,\n props: object,\n instanceHandle: unknown,\n ): FabricNode;\n /** Clone with the *given* children (omitting the argument means none) and the same props. */\n cloneNodeWithNewChildren(node: FabricNode): FabricNode;\n /** Clone with the given props and the *same* children. */\n cloneNodeWithNewProps(node: FabricNode, newProps: object): FabricNode;\n /** Clone with the given props and the given children (omitting them means none). */\n cloneNodeWithNewChildrenAndProps(node: FabricNode, newProps: object): FabricNode;\n appendChild(parent: FabricNode, child: FabricNode): FabricNode;\n createChildSet(rootTag: number): FabricNodeSet;\n appendChildToSet(set: FabricNodeSet, child: FabricNode): void;\n completeRoot(rootTag: number, set: FabricNodeSet): void;\n registerEventHandler?(\n handler: (instanceHandle: unknown, topLevelType: string, nativeEvent: unknown) => void,\n ): void;\n /** Tells the native side that JS owns the gesture, and whether to stop its own. */\n setIsJSResponder?(node: FabricNode, isResponder: boolean, blockNativeResponder: boolean): void;\n /** A view command: `focus` on a text input, `scrollTo` on a scroll view. */\n dispatchCommand?(node: FabricNode, name: string, args: readonly unknown[]): void;\n /**\n * A node's frame in window coordinates, which is the only frame two nodes can be compared in.\n *\n * Optional because an older host may not have it, and because the callback is the platform's\n * own shape: on the new architecture it fires before this returns, which is what lets an\n * overlay place itself in the same frame it was opened in.\n */\n measureInWindow?(\n node: FabricNode,\n onSuccess: (x: number, y: number, width: number, height: number) => void,\n ): void;\n}\n\n/**\n * The scroll events that mean a finger is dragging the list rather than tapping something in it.\n *\n * `topScrollBeginDrag` is the precise one; `topScroll` is here because a scroll view configured\n * without drag events still reports movement, and a press surviving that is the bug either way.\n */\nconst SCROLL_CANCELS_PRESS = new Set(['topScroll', 'topScrollBeginDrag']);\n\n/**\n * RN's `directEventTypes`: delivered to the target only, never up the tree. Everything else\n * bubbles, which matches RN's `bubblingEventTypes` for the touch and input events that matter.\n * The web host's engine reads this set too, so both hosts deliver an event the same way.\n *\n * ponytail: a hand-kept set rather than real ViewConfigs. It is wrong only for a nested\n * scroll view, where an ancestor listening for the same direct event would not fire (correct)\n * but a third-party component's custom direct event would bubble (harmless in practice).\n * Swap it for per-component ViewConfig metadata if that ever matters.\n */\nexport const DIRECT_EVENTS: ReadonlySet<string> = new Set([\n 'topScroll',\n 'topScrollBeginDrag',\n 'topScrollEndDrag',\n 'topMomentumScrollBegin',\n 'topMomentumScrollEnd',\n 'topScrollToTop',\n 'topContentSizeChange',\n 'topLayout',\n 'topLoad',\n 'topLoadStart',\n 'topLoadEnd',\n 'topError',\n 'topProgress',\n 'topRefresh',\n 'topTextLayout',\n // react-native-screens. `topDismissed` is how a swipe-back or a native back button reaches\n // JS, and it must not bubble: the stack above would see its child's pop as its own.\n 'topDismissed',\n 'topNativeDismissCancelled',\n 'topWillAppear',\n 'topAppear',\n 'topWillDisappear',\n 'topDisappear',\n 'topHeaderHeightChange',\n 'topTransitionProgress',\n 'topFinishTransitioning',\n // The tabs host reports its own selection, and only the host it happened in wants to know.\n 'topTabSelected',\n // Safe-area insets, reported by the provider that measured them.\n 'topInsetsChange',\n]);\n\n/**\n * What a listener receives. RN's synthetic event carries more, but `nativeEvent` is the part\n * every RN API is documented against, and `stopPropagation` is the part a nested control needs.\n *\n * `stopPropagation` ends the walk to the root after the current node, as it does in the DOM and\n * on RN's `SyntheticEvent`: the other listeners on the node that called it still run. It does not\n * touch the responder negotiation, which has already finished by the time a listener sees the\n * event, so it cannot take a press away from a pressable; the negotiation already keeps an inner\n * pressable's press from reaching the one around it.\n */\nexport interface NativeSyntheticEvent<T = unknown> {\n readonly nativeEvent: T;\n /**\n * The node the event happened on, which a listener further up can compare with its own: RN's\n * `event.target`. Null where a host has no node to name.\n */\n readonly target?: unknown;\n stopPropagation(): void;\n isPropagationStopped(): boolean;\n}\n\n/**\n * The event object a dispatch hands every listener along the path. Exported so another host can\n * hand its listeners the same shape rather than a bare `{ nativeEvent }` that lacks the methods\n * the type promises.\n */\nexport class SyntheticEvent<T = unknown> implements NativeSyntheticEvent<T> {\n readonly nativeEvent: T;\n readonly target: unknown;\n private stopped = false;\n\n constructor(nativeEvent: T, target: unknown = null) {\n this.nativeEvent = nativeEvent;\n this.target = target;\n }\n\n stopPropagation(): void {\n this.stopped = true;\n }\n\n isPropagationStopped(): boolean {\n return this.stopped;\n }\n}\n\n/**\n * The JS responder system: RN's second touch layer, and the renderer's job rather than the app's.\n *\n * Fabric delivers raw touches to whichever node was hit. On top of that, React runs a negotiation\n * deciding *who owns the gesture*: a capture pass from the root down, then a bubble pass from the\n * target up, electing a single responder that alone receives grant/move/release/terminate. When\n * ownership changes the renderer tells native through `setIsJSResponder`, which is how a JS\n * control stops a native scroll view from also scrolling.\n *\n * All of RN's `Pressability` sits on this, never on raw touch events. Without it there is no way\n * for a button and an enclosing scroll view to agree on who owns a drag.\n */\n/**\n * What a touch event carries. The responder system is touch-only, so its handlers are typed\n * against this rather than `unknown`: every consumer wants the coordinates and would otherwise\n * cast to get at them.\n */\nexport interface TouchPayload {\n readonly pageX?: number;\n readonly pageY?: number;\n readonly locationX?: number;\n readonly locationY?: number;\n readonly identifier?: number;\n readonly target?: number;\n readonly timestamp?: number;\n}\n\nexport type ResponderEvent = NativeSyntheticEvent<TouchPayload>;\n\nexport interface ResponderHandlers {\n /** The `target` is the node the touch landed on, which a capturing ancestor may inspect. */\n onStartShouldSetResponderCapture?(event: ResponderEvent, target: EngineNode): boolean;\n onStartShouldSetResponder?(event: ResponderEvent, target: EngineNode): boolean;\n onMoveShouldSetResponderCapture?(event: ResponderEvent, target: EngineNode): boolean;\n onMoveShouldSetResponder?(event: ResponderEvent, target: EngineNode): boolean;\n onResponderGrant?(event: ResponderEvent): void;\n onResponderMove?(event: ResponderEvent): void;\n onResponderRelease?(event: ResponderEvent): void;\n onResponderTerminate?(event: ResponderEvent): void;\n /** Return false to keep the gesture when something else asks for it. Defaults to allowing. */\n onResponderTerminationRequest?(event: ResponderEvent): boolean;\n /** Ask native to stop its own gesture while we hold the responder (a slider inside a list). */\n blockNativeResponder?: boolean;\n}\n\n/**\n * Events the native side will not emit unless a **prop** opts in, separately from anyone\n * listening. `ShadowTree.cpp` guards the layout notification with `if (viewProps->onLayout)`,\n * so a view that never sets the prop is never measured, however many listeners it has.\n *\n * React gets this for free: attaching a handler puts `onLayout` in the props object. A renderer\n * that keeps listeners in its own registry has to set the prop deliberately, and the failure is\n * silent - the callback simply never runs.\n */\nconst EVENT_OPT_IN_PROPS: Record<string, string> = {\n topLayout: 'onLayout',\n /*\n * Hover, which exists on this platform after all.\n *\n * React Native implements the W3C pointer events, and on iPadOS a connected trackpad or mouse\n * produces them: `onPointerEnter` and `onPointerLeave` fire as the cursor crosses a view. A\n * phone never sends them, so this costs a phone two props and nothing else, and it is what\n * makes a hover style reachable on the one device that has a pointer.\n */\n topPointerEnter: 'onPointerEnter',\n topPointerLeave: 'onPointerLeave',\n};\n\n/**\n * The same opt-in, for events one view type guards with a prop of its own. Android's\n * `ReactImageView` emits no load events at all unless `shouldNotifyLoadEvents` is set, which\n * `Image.android.js` does whenever any load handler is attached. iOS ignores the prop.\n */\nconst VIEW_EVENT_OPT_IN_PROPS: Record<string, Record<string, string>> = {\n Image: {\n topLoadStart: 'shouldNotifyLoadEvents',\n topLoad: 'shouldNotifyLoadEvents',\n topLoadEnd: 'shouldNotifyLoadEvents',\n topError: 'shouldNotifyLoadEvents',\n topProgress: 'shouldNotifyLoadEvents',\n },\n};\n\n/**\n * Props the engine itself writes or reads off a node, so never a misspelling: the style, the\n * event opt-ins, and the bookkeeping keys that never reach native. See `checkProps`.\n */\nconst ENGINE_PROPS = new Set<string>([\n 'style',\n 'collapsable',\n // Read by the cascade for `:disabled`, whether or not the native view takes it.\n 'disabled',\n 'intrinsicSize',\n 'styleOverride',\n ...Object.values(EVENT_OPT_IN_PROPS),\n ...Object.values(VIEW_EVENT_OPT_IN_PROPS).flatMap((props) => Object.values(props)),\n]);\n\n/** Touch events that drive the responder negotiation. */\nconst TOUCH_START = 'topTouchStart';\nconst TOUCH_MOVE = 'topTouchMove';\nconst TOUCH_END = 'topTouchEnd';\nconst TOUCH_CANCEL = 'topTouchCancel';\n\nexport type NodeKind = 'element' | 'text' | 'anchor';\n\n/** What Fabric currently holds for a node. `null` until the node has been committed once. */\ninterface Committed {\n handle: FabricNode;\n /**\n * The react tag this node was created with. Kept because the native animation driver addresses\n * a view by tag and has no other way to find one of ours: `findNodeHandle` returns a number it\n * is given unchanged, so a tag is all an animated graph needs to point here.\n */\n tag: number;\n props: Record<string, unknown>;\n /** The child handles this node was committed with, in order. */\n childHandles: FabricNode[];\n /** The native view it was created as, which a clone cannot change. */\n viewName: string;\n}\n\nexport interface EngineNode extends HostNode {\n readonly kind: NodeKind;\n /** Lowercase template spelling, e.g. `view`. Never the native view name. */\n readonly name: string;\n /** `name` again, for Angular 22.0, which reads it on a component's host element. */\n readonly tagName: string;\n props: Record<string, unknown>;\n text: string;\n children: EngineNode[];\n parent: EngineNode | null;\n listeners: Map<string, Set<(event: unknown) => void>> | null;\n\n /** CSS classes on this node, for selector matching. */\n classes: Set<string> | null;\n /** The compiled stylesheet of the component that created this node, if any. */\n sheet: StyleSheet | null;\n /** The sheet of the component this node hosts, if it hosts one. What `:host` matches against. */\n hostSheet: StyleSheet | null;\n /** Custom properties set on the node itself; see `StyleTarget.customProperties`. */\n customProperties: Record<string, TokenValue> | null;\n /** Resolved style, memoised across commits. Owned by the CSS resolver. */\n styleCache: StyleCache | null;\n /** Set when something that could change what this node matches has changed. */\n styleDirty: boolean;\n /** See `StyleTarget.hasDirty`. */\n hasDirty: boolean;\n /** See `StyleTarget.stateDirty`. */\n stateDirty: boolean;\n /** A family left out while it loads. See `loadingFamilies`. */\n heldFamily?: string;\n /** See `StyleTarget.inlineInherits`. */\n inlineInherits?: boolean;\n /** See `StyleTarget.boundStyle`: the declarations, and the same by the property each sets. */\n boundStyle?: readonly DeferredDeclaration[] | null;\n boundByProp?: Map<string, DeferredDeclaration>;\n /**\n * Whether this node, or one inside it, takes touches under a `pointer-events: none` it would\n * otherwise inherit. Kept as each node is reconciled, children first. See `noteTouches`.\n */\n touchWithin?: boolean;\n /**\n * The paragraph the engine makes around a run of text written straight into a view. It is in no\n * template and in no node's `children`: it holds the text, and commits where the text would.\n */\n box?: EngineNode;\n /** A node the engine made, which no rule matches: it only inherits. */\n anonymous?: true;\n /** See `StyleTarget.styled`. */\n styled?: true;\n /** `:focus`, from the native focus and blur events. */\n focused?: boolean;\n /** `:active`, set on the responder and every ancestor of it. */\n active?: boolean;\n /**\n * The style object the platform adapter made for this node, and may therefore write into.\n *\n * Angular sets style properties one at a time, so building a fresh object per property means a\n * style of ten properties costs ten copies of a growing object, for every element that has one.\n * An object the adapter created is its to mutate; one that arrived any other way is copied,\n * once. A field rather than a `WeakSet` of such objects, which Hermes makes slow to consult.\n */\n ownStyle?: object;\n /** The resolved style this node was last committed with, for the skip check in `reconcile`. */\n styleCommitted: StyleCache | null;\n /**\n * How this node laid its children out when one of them last had a `fit-content` size, as\n * `containerOf` says it. Set by such a child, and compared on each reconcile so the children\n * are worked out again when the direction or alignment changes. Unset on every other node.\n */\n fitContainer?: string;\n /**\n * Whether this node had a height a percentage could be taken of, when a box beneath it with a\n * percentage height last asked, as `definiteHeight` says it. Compared on each reconcile so its\n * children are worked out again when it changes. Unset on every other node.\n */\n heightBasis?: boolean;\n /**\n * Per-property transition state, for every property this node has ever seen a `transition` for.\n * A finished entry stays, because its target is what the next change is measured against.\n */\n transitions?: Map<string, Transition>;\n /** The `@keyframes` animation this node is playing, if any. One at a time. */\n playing?: RunningAnimation;\n /** An animation played by a scroll view's offset rather than the clock. See `scrollAnimated`. */\n scrolled?: ScrollAnimation;\n /**\n * The last `transform` built from the individual transform properties, and what it was built\n * from. Reused while the parts are the same objects, so an unrelated change does not re-send it.\n */\n composedTransform?: { parts: readonly unknown[]; value: unknown[] };\n /** The commit that created this node's view, by its number: see `Engine.commitUnseen`. */\n bornIn?: number;\n /** The last bound `transform` string and the list it reads as, undefined where CSS cannot. */\n boundTransform?: { text: string; list: unknown[] | undefined };\n /**\n * Set by the component that owns this element. A host primitive that reaches a commit without it\n * was written in a template that never imported the component, which is reported in dev.\n */\n claimed?: true;\n /**\n * Set by the platform adapter when Angular mounts a component on this element. What makes an\n * `<x-card>` host legitimate where a `<veiw>` typo is not, since both are names no view table\n * knows. See `markComponentHost`.\n */\n componentHost?: true;\n /** See `keepNativeView`. */\n nativeView?: true;\n /** Props kept for selectors to match and left out of what is committed. See `keepAsAttribute`. */\n attributeOnly?: Set<string>;\n /** The child this node's background is painted on instead of itself. See `paintOn`. */\n paintsOn?: EngineNode;\n /**\n * Style weaker than every sheet, where no rule and no inline style says otherwise. What lets the\n * root component's host fill the surface by default and still give way to its own `:host`. See\n * `setDefaultStyle`.\n */\n defaultStyle?: Readonly<Record<string, unknown>>;\n\n /**\n * Hoisted nodes (`registerHoist`) inside this subtree while it is out of the tree, held here\n * rather than by the engine. See `Engine.releaseDetached`.\n */\n dormantHoists?: EngineNode[] | null;\n\n committed: Committed | null;\n /** The node this one was committed as a child of, which native holds it to for its life. */\n committedUnder: EngineNode | null;\n /** The hoisted views this node keeps committed for, by element name. See `HoistOptions`. */\n kept?: Map<string, KeptHoist>;\n /** Commit this node again with its children so Fabric measures it again. `remeasureText`. */\n remeasure?: true;\n /**\n * A modal host committed as visible on iOS whose dismissal native has not yet reported. It\n * stays committed after `visible` goes false until `topDismiss`, as React Native's Modal.js\n * keeps it for the dismissal animation. See `Engine.withheld`.\n */\n presented?: true;\n /** This node's own props changed. */\n propsDirty: boolean;\n /** This node's child list changed. */\n structureDirty: boolean;\n /** Something below this node is dirty, so the walk must descend. */\n subtreeDirty: boolean;\n}\n\n/**\n * Canonical Fabric component names, taken from `RCTFabricComponentsPlugins.mm` and the C++\n * `ComponentName[]` declarations rather than guessed. Legacy `RCT`-prefixed names also work\n * today, but only through `componentNameByReactViewName`, a documented transition-period shim\n * that strips the prefix and maps `Text` to `Paragraph`.\n */\nconst VIEW_NAMES: Record<string, string | PlatformViewName> = {\n view: 'View',\n text: 'Paragraph',\n image: 'Image',\n 'scroll-view': 'ScrollView',\n 'safe-area-view': 'SafeAreaView',\n modal: 'ModalHostView',\n switch: 'Switch',\n 'text-input': 'TextInput',\n 'activity-indicator': 'ActivityIndicatorView',\n 'refresh-control': 'PullToRefreshView',\n 'input-accessory-view': 'InputAccessoryView',\n // Composites from the components package. Their host is a plain view; they are listed so a\n // template that uses one without importing it is reported like any other host primitive.\n pressable: 'View',\n 'touchable-opacity': 'View',\n 'image-background': 'View',\n 'keyboard-avoiding-view': 'View',\n // The windowing component; its host really is a native scroll view.\n 'virtual-list': 'ScrollView',\n};\n\n/**\n * The element names above, as they were before any app registered its own.\n *\n * Only these have a component in `@ng-native/components` to forget to import, which is what\n * the dev-mode check below is about. A name added by `registerViewName` may have nothing behind\n * it on purpose: an Expo view driven as a plain element is the whole point of\n * `@ng-native/expo`, and warning about it would be noise.\n */\nconst PRIMITIVE_NAMES = new Set(Object.keys(VIEW_NAMES));\n\n/**\n * HTML's text elements, which a template can write as it would for a browser.\n *\n * Each is text when it holds only text and other text elements, and a view when it holds anything\n * else: a box inside a paragraph has no layout, so `<span>Inbox<view class=\"dot\" /></span>` is a\n * view with its text in a paragraph of its own. Decided as the element is committed, by\n * `viewNameOf`. They have no component to import, so they are not `PRIMITIVE_NAMES`.\n */\nconst TEXT_ELEMENTS = new Set([\n ...['span', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'label', 'strong', 'b', 'em', 'i'],\n ...['u', 's', 'small', 'code', 'mark', 'abbr', 'cite', 'time'],\n]);\n\n/** HTML's layout elements, each a plain view, as a browser's are boxes with a name. */\nconst LAYOUT_ELEMENTS = [\n ...['div', 'section', 'article', 'header', 'footer', 'main', 'nav', 'ul', 'ol', 'li'],\n];\n\nfor (const name of TEXT_ELEMENTS) VIEW_NAMES[name] = 'Paragraph';\nfor (const name of LAYOUT_ELEMENTS) VIEW_NAMES[name] = 'View';\n\n/**\n * What an HTML element has for its name alone, given to the node as it is made: a heading's role,\n * which a binding can replace as it can any prop, and whether the engine has styles for it.\n */\nconst HTML_ELEMENTS = new Map<string, { role?: string; styled?: true }>([\n ...['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].map((name) => [name, { role: 'header' }] as const),\n ...[...STYLED_ELEMENTS].map((name) => [name, { styled: true }] as const),\n]);\n\n/**\n * The props each host primitive's native view is sent, by element name, as the components\n * declare them: every input the element's component has, and the props it writes that no input\n * carries. What the development check for a misspelt prop compares against. See\n * `declareNativeProps`.\n */\nconst DECLARED_PROPS = new Map<string, Set<string>>();\n\n/**\n * Declare props the native view behind an element accepts. `@ng-native/components` calls this\n * once per host primitive with the component's inputs; an app driving a primitive's native view\n * with a prop the component has no input for can declare that prop too.\n */\nexport function declareNativeProps(elementName: string, props: Iterable<string>): void {\n let declared = DECLARED_PROPS.get(elementName);\n if (!declared) DECLARED_PROPS.set(elementName, (declared = new Set()));\n for (const prop of props) declared.add(prop);\n}\n\n/**\n * Mark a host element as owned by its component. The components package calls this from each\n * host primitive's constructor; see `EngineNode.claimed`.\n */\nexport function claimHost(node: HostNode): void {\n node.claimed = true;\n}\n\n/**\n * Mark an element as the host of a component. The platform adapter calls this from\n * `RendererFactory2.createRenderer`, which Angular calls once for every component it mounts,\n * with the host element in hand, whatever the component's selector.\n */\nexport function markComponentHost(node: HostNode): void {\n (node as EngineNode).componentHost = true;\n}\n\n/**\n * Say that a component's host is the native view its element name is registered as: a typed\n * wrapper for the view, where a component of the app's own with the same selector is a plain view.\n * Called from the component's constructor. See `ViewNameOptions.yieldsToComponents`.\n */\nexport function keepNativeView(node: HostNode): void {\n (node as EngineNode).nativeView = true;\n}\n\n/** `text-input` -> `TextInput`: how the components package names the class for an element. */\nconst className = (element: string): string =>\n element.replace(/(^|-)([a-z])/g, (_, __, c: string) => c.toUpperCase());\n\n/** Names Android registers differently. */\nexport const ANDROID_VIEW_NAMES: Record<string, string> = {\n switch: 'AndroidSwitch',\n 'text-input': 'AndroidTextInput',\n 'activity-indicator': 'AndroidProgressBar',\n 'refresh-control': 'AndroidSwipeRefreshLayout',\n // Neither exists on Android; RN's own wrappers render a plain view there too.\n 'safe-area-view': 'View',\n 'input-accessory-view': 'View',\n};\n\n/**\n * iOS's names for the elements Android names differently, so reporting iOS after Android puts\n * them back.\n */\nconst IOS_VIEW_NAMES: Record<string, string> = Object.fromEntries(\n Object.keys(ANDROID_VIEW_NAMES).map((element) => [element, VIEW_NAMES[element] as string]),\n);\n\n/**\n * The platform the host reported at startup. Defaults to iOS, which is what the view-name table\n * above assumes too.\n *\n * Exposed because a few of React Native's JavaScript wrappers behave differently per platform in\n * ways nothing native can infer: `Text.js` makes a text an accessibility element on iOS always,\n * and on Android only when it can be pressed.\n */\nlet platformOS = 'ios';\n\nexport function nativePlatform(): string {\n return platformOS;\n}\n\n/**\n * Call once at startup with `Platform.OS`. The view names above are the iOS/canonical ones, so\n * only the mapping half is a no-op elsewhere.\n */\nexport function registerPlatformComponents(platform: string): void {\n platformOS = platform;\n const names = platform === 'android' ? ANDROID_VIEW_NAMES : IOS_VIEW_NAMES;\n for (const [element, viewName] of Object.entries(names)) registerViewName(element, viewName);\n}\n\n/**\n * Props RN's JS wrappers apply before the caller's, per native view name.\n *\n * The native ScrollView does not clip on its own; RN's `ScrollView.js` supplies\n * `{flexGrow, flexShrink, flexDirection, overflow: 'scroll'}` as a base style. Omit it and the\n * content spills straight out of the scroll view's bounds, which reads as a layout bug in the\n * content rather than a missing default.\n *\n * Caller props and styles are applied on top, so any of this can be overridden.\n */\nconst DEFAULT_PROPS: Record<string, Record<string, unknown>> = {\n ScrollView: { flexGrow: 1, flexShrink: 1, flexDirection: 'column', overflow: 'scroll' },\n // RN's Image.ios.js: without it a border radius rounds the view but not the picture.\n Image: { overflow: 'hidden' },\n // RN's Modal.js gives the native host this; without it the modal does not lay out.\n ModalHostView: { position: 'absolute' },\n // RN's InputAccessoryView.js does the same for the keyboard bar.\n InputAccessoryView: { position: 'absolute' },\n // RN's Text.js ends truncated text in an ellipsis; native's own default is to clip. A default\n // rather than a prop the component writes, so `text-overflow` in a stylesheet can change it.\n Paragraph: { ellipsizeMode: 'tail' },\n};\n\nconst RAW_TEXT = 'RawText';\n/**\n * A `<text>` nested inside another `<text>` is a span, not a paragraph.\n *\n * Note the name: the C++ component really is called `Text`, but that name is **unreachable\n * from JS**. `ComponentDescriptorRegistry::at` puts every lookup through\n * `componentNameByReactViewName`, which rewrites `Text` to `Paragraph` and `VirtualText` to\n * `Text`. Sending the canonical `Text` therefore yields a Paragraph nested inside a Paragraph,\n * which Fabric treats as an inline view attachment: the run renders top-aligned and does not\n * inherit the parent's text attributes. It looks like a superscript.\n */\nconst VIRTUAL_TEXT = 'VirtualText';\nconst DEFAULT_VIEW = 'View';\n/** A top-level text, the one view that aligns its lines. A nested text is a `VirtualText`. */\nconst PARAGRAPH = 'Paragraph';\n\ntype TextDirection = 'ltr' | 'rtl';\n\nconst textDirection = (value: unknown): TextDirection | undefined =>\n value === 'ltr' || value === 'rtl' ? value : undefined;\n\n/**\n * What iOS scales a text's `lineHeight` by: the system text size, capped by the text's own\n * `maxFontSizeMultiplier` where it is at least 1, and 1 without font scaling\n * (`RCTEffectiveFontSizeMultiplierFromTextAttributes`).\n */\nfunction textScale(props: Record<string, unknown>, fontScale = 1): number {\n if (props['allowFontScaling'] === false) return 1;\n const cap = props['maxFontSizeMultiplier'];\n return typeof cap === 'number' && cap >= 1 ? Math.min(fontScale, cap) : fontScale;\n}\n\n/**\n * Centre the text of a single-line text field that has a line height, as Chrome centres an\n * input's, keeping the height the line height gives it.\n *\n * Where a `height` in points sizes the field, the line height has nothing left to do, and is left\n * out on both platforms: on Android, `EditText` centres a line box taller than the font's own\n * about 1.7pt high of centre in a 44pt field, and centres the font's own exactly. A percentage\n * height sizes the field only where its parent's height is definite, which is known at layout\n * alone, so such a field is left as it was. Elsewhere Android sizes the field by the line height\n * and centres the text in it itself, and keeps it.\n *\n * On iOS, React Native's field sets `lineHeight` as the paragraph's minimum and maximum line\n * height and, unlike a paragraph (`RCTApplyBaselineOffset`), never offsets the baseline, so the\n * glyphs sit at the bottom of a line box taller than the font. One line has nothing to space, so\n * the line height is left out. What it does in Chrome, and on Android, is set the field's height:\n * line height, padding and border. That is kept as a `minHeight`, the larger of it and the field's\n * own, within its `maxHeight`: the whole sum for a border-box field, Yoga's default, and the line\n * height alone for a content-box one. A null `height` is no height. A value that is not a number\n * cannot be added up, and leaves the field as it was.\n */\nfunction centreSingleLine(\n viewName: string,\n props: Record<string, unknown>,\n fontScale: number | undefined,\n): void {\n const lineHeight = props['lineHeight'];\n if (!TEXT_INPUTS.has(viewName) || typeof lineHeight !== 'number') return;\n if (props['multiline'] === true) return;\n const height = props['height'];\n if (typeof height === 'number') {\n delete props['lineHeight'];\n return;\n }\n // A percentage is a fixed height only where the parent's is definite, known at layout alone.\n if (isSet(height) && height !== 'auto') return;\n // Android sizes the field by its line height, and centres the text in it, itself.\n if (viewName !== 'TextInput') return;\n const edge = (side: 'Top' | 'Bottom', logical: 'Start' | 'End'): unknown[] => [\n props[`padding${side}`] ??\n props[`paddingBlock${logical}`] ??\n props['paddingBlock'] ??\n props['paddingVertical'] ??\n props['padding'] ??\n 0,\n props[`border${side}Width`] ?? props['borderWidth'] ?? 0,\n ];\n const line = lineHeight * textScale(props, fontScale);\n const box = [line, ...edge('Top', 'Start'), ...edge('Bottom', 'End')];\n const own = props['minHeight'] ?? 0;\n const max = props['maxHeight'] ?? Infinity;\n if (![...box, own, max].every((part) => typeof part === 'number')) return;\n delete props['lineHeight'];\n // A content-box field's minHeight is its content's: Yoga adds the padding and border itself.\n const content =\n props['boxSizing'] === 'content-box'\n ? line\n : (box as number[]).reduce((sum, part) => sum + part, 0);\n props['minHeight'] = Math.max(own as number, Math.min(content, max as number));\n}\n\n/**\n * What a container's own style says for `key`, in the order `mergeProps` applies them: a\n * component's override, inline, a prop, its stylesheet, its default.\n */\nfunction ownLayout(node: EngineNode, key: string): unknown {\n return (\n flattenStyle(node.props[STYLE_OVERRIDE], {})[key] ??\n flattenStyle(node.props['style'], {})[key] ??\n node.props[key] ??\n node.styleCache?.style[key] ??\n node.defaultStyle?.[key]\n );\n}\n\n/**\n * A container's main axis and how it aligns across it, as `row` or `column` and a keyword. A\n * `display: contents` node is no container: its children are laid out in the one above it.\n */\nfunction containerOf(node: EngineNode): string {\n if (ownLayout(node, 'display') === 'contents') return 'contents';\n const direction = String(ownLayout(node, 'flexDirection') ?? 'column');\n return `${direction.startsWith('row') ? 'row' : 'column'} ${ownLayout(node, 'alignItems') ?? 'stretch'}`;\n}\n\n/**\n * The node a box is laid out in: its parent, or the one above every `display: contents` ancestor.\n * Each of those is told a `fit-content` child passed through, so that when it stops being\n * `contents`, and is the container, the child is worked out again.\n */\nfunction layoutParent(node: EngineNode): EngineNode | null {\n let parent = node.parent;\n while (parent && containerOf(parent) === 'contents') {\n parent.fitContainer = 'contents';\n parent = parent.parent;\n }\n return parent;\n}\n\nconst STRETCHES = new Set([undefined, null, 'auto', 'stretch']);\n\n/**\n * `width: fit-content` and `height: fit-content`, which Yoga has no size for.\n *\n * Along its container's main axis a box is as big as its content already, so the size is\n * dropped. Across it a box stretches, where a browser keeps it at its content's size and at the\n * start: `align-self: flex-start` does both. An alignment the container or the box asked for is\n * kept, since it stops the stretch already.\n */\nfunction fitContent(node: EngineNode, props: Record<string, unknown>): void {\n const width = props['width'] === 'fit-content';\n const height = props['height'] === 'fit-content';\n if (!width && !height) return;\n if (width) delete props['width'];\n if (height) delete props['height'];\n const parent = layoutParent(node);\n if (!parent) return;\n const container = containerOf(parent);\n parent.fitContainer = container;\n const [direction, align] = container.split(' ');\n const across = direction === 'row' ? height : width;\n if (across && align === 'stretch' && STRETCHES.has(props['alignSelf'] as string)) {\n props['alignSelf'] = 'flex-start';\n }\n}\n\nconst isPercent = (value: unknown): boolean => typeof value === 'string' && value.endsWith('%');\n\n/**\n * Whether a box has a height a percentage can be taken of, as CSS defines one: a height of its\n * own, or one the layout around it gives it. A box as tall as what it holds has none.\n *\n * Asked of each box on the way up, and remembered on it, so a change to any of them works out\n * again the boxes beneath it. Where the answer is not known for certain it is yes, which leaves\n * the percentage to Yoga as before: a view native sizes itself, or one placed out of the flow.\n */\nfunction definiteHeight(node: EngineNode): boolean {\n return (node.heightBasis = hasDefiniteHeight(node));\n}\n\nfunction hasDefiniteHeight(node: EngineNode): boolean {\n // The root is the screen, and only a plain view is sized by its content alone.\n if (!node.parent || node.kind !== 'element' || viewNameOf(node) !== 'View') return true;\n const parent = layoutParent(node);\n if (!parent) return true;\n const height = ownLayout(node, 'height');\n if (isPercent(height)) return definiteHeight(parent);\n return sizesItself(node, height) || heightFromLayout(node, parent);\n}\n\nconst NO_HEIGHT = new Set([undefined, null, 'auto', 'fit-content']);\n\n/** Whether a box has a height from its own style: written, or placed, or kept in proportion. */\nfunction sizesItself(node: EngineNode, height: unknown): boolean {\n if (!NO_HEIGHT.has(height as string)) return true;\n return ownLayout(node, 'position') === 'absolute' || ownLayout(node, 'aspectRatio') != null;\n}\n\n/** Whether the container a box is in gives it a height: a row's, or a share of a column's. */\nfunction heightFromLayout(node: EngineNode, parent: EngineNode): boolean {\n const [direction, align] = containerOf(parent).split(' ');\n if (direction === 'row') {\n // Stretched across a row, it is as tall as the row.\n const self = ownLayout(node, 'alignSelf') as string | undefined;\n return STRETCHES.has(self) && align === 'stretch';\n }\n // In a column it has the height it grows to, where the column has one to share out.\n const grows = Number(ownLayout(node, 'flexGrow') ?? ownLayout(node, 'flex') ?? 0) > 0;\n return grows && definiteHeight(parent);\n}\n\n/**\n * `height: 50%` under a parent with no height to take it of, which CSS reads as `auto`. Yoga\n * takes it of the space on offer, the screen's or everything a scroll view holds, so no height\n * is sent.\n */\nfunction percentHeight(node: EngineNode, props: Record<string, unknown>): void {\n if (!isPercent(props['height'])) return;\n const parent = layoutParent(node);\n if (parent && !definiteHeight(parent)) delete props['height'];\n}\n\n/**\n * Start a multiline Android text field's text at the top, as iOS and a `<textarea>` do.\n *\n * React Native maps an unset `textAlignVertical` to `Gravity.NO_GRAVITY`, which `ReactEditText`\n * reads as the `EditText`'s own gravity, `center_vertical`. One the app set, through the input or\n * a CSS `vertical-align`, stays.\n */\nfunction alignMultiline(viewName: string, props: Record<string, unknown>): void {\n if (viewName !== 'AndroidTextInput' || props['multiline'] !== true) return;\n props['textAlignVertical'] ??= 'top';\n}\n\n/**\n * Resolve a paragraph's `text-align` against its direction, as CSS does.\n *\n * React Native reads `left` and `right` relative to the layout direction: in a right-to-left\n * layout `RCTAttributedTextUtils` swaps them, so its `left` is the start edge. `start` and `end`\n * are therefore `left` and `right` whatever the direction. Where the app set a direction, the\n * default is `start`, as on the web, rather than native's natural alignment, which follows the\n * app's language and not the subtree; a physical `left` or `right` is swapped back so it stays on\n * that side; and the paragraph's base writing direction follows unless a `writing-direction` says\n * otherwise, which is what puts neutral characters such as punctuation on the right side.\n */\nfunction alignText(props: Record<string, unknown>, direction: TextDirection | undefined): void {\n const align = props['textAlign'] as string | undefined;\n if (!direction) {\n if (align !== undefined) props['textAlign'] = LOGICAL_ALIGN.get(align) ?? align;\n return;\n }\n props['textAlign'] = TEXT_ALIGN[direction].get(align ?? 'start') ?? align;\n props['writingDirection'] ??= direction;\n}\n\n/** React Native's `textAlign` for CSS's logical values, which means the same in either direction. */\nconst LOGICAL_ALIGN = new Map([\n ['start', 'left'],\n ['end', 'right'],\n]);\n\n/** React Native's `textAlign` for each CSS value, in a layout of each direction. */\nconst TEXT_ALIGN: Readonly<Record<TextDirection, ReadonlyMap<string, string>>> = {\n ltr: new Map([...LOGICAL_ALIGN, ['auto', 'left'], ['left', 'left'], ['right', 'right']]),\n rtl: new Map([...LOGICAL_ALIGN, ['auto', 'left'], ['left', 'right'], ['right', 'left']]),\n};\n\n/** The native modal host, which is left out of a commit while `visible` is false. */\nconst MODAL_HOST = 'ModalHostView';\n\n/**\n * Register a codegen'd third-party Fabric component, e.g.\n * `registerViewName('rns-screen', 'RNSScreen')`, which is how the router reaches\n * react-native-screens.\n *\n * `defaultProps` is for a component whose React wrapper supplies a base style in JS, the way\n * `ScrollView` and `Modal` do below. Driving the native component directly skips that wrapper,\n * and skipping it is not cosmetic: `RNSScreenStackHeaderConfig` without its `position: absolute`\n * joins the screen's flex layout and pushes every page down by the height of the header.\n */\nexport function registerViewName(\n elementName: string,\n viewName: string | PlatformViewName,\n defaultProps?: Record<string, unknown>,\n options?: ViewNameOptions,\n): void {\n VIEW_NAMES[elementName] = viewName;\n if (options?.yieldsToComponents) YIELDING.add(elementName);\n else YIELDING.delete(elementName);\n // A name the app registers is the app's: no longer decided by what the element holds.\n TEXT_ELEMENTS.delete(elementName);\n for (const name of typeof viewName === 'string' ? [viewName] : [viewName.ios, viewName.android]) {\n if (defaultProps) DEFAULT_PROPS[name] = defaultProps;\n if (options?.textContent) TEXT_CONTENT_PROPS[name] = options.textContent;\n }\n}\n\n/** What else a registered view needs the engine to know about it. */\nexport interface ViewNameOptions {\n /**\n * The prop the view reads its text from, where it takes no children: SwiftUI's `Text` through\n * `@expo/ui` reads `text`. The text written inside the element becomes that prop, as `<text>`\n * takes its own content, and is not committed as children. An explicit prop wins over it.\n */\n readonly textContent?: string;\n /**\n * Whether the name gives way to a component of the app's own with the same selector, whose host\n * is then a plain view. For a set of views registered under a prefix an app may also use for\n * its design system, as `@expo/ui`'s are under `ui-`. A component that is the view itself, a\n * typed wrapper for it, says so with `keepNativeView`.\n */\n readonly yieldsToComponents?: boolean;\n}\n\n/** The registered names that give way to a component's own host. See `ViewNameOptions`. */\nconst YIELDING = new Set<string>();\n\n/** The prop each view that takes its text content as a prop reads it from. See `ViewNameOptions`. */\nconst TEXT_CONTENT_PROPS: Record<string, string> = {};\n\n/** Whether `node` takes its text content as a prop rather than as text children. */\nfunction takesTextAsProp(node: EngineNode): boolean {\n return node.kind === 'element' && TEXT_CONTENT_PROPS[viewNameOf(node)] !== undefined;\n}\n\n/** Sets a view's text prop from its content, unless the prop is set explicitly. */\nfunction withTextContent(node: EngineNode, viewName: string, props: Record<string, unknown>): void {\n const prop = TEXT_CONTENT_PROPS[viewName];\n if (!prop || node.props[prop] !== undefined) return;\n const text = textContent(node);\n if (text) props[prop] = text;\n}\n\n/**\n * The whitespace a paragraph drops at its ends is what CSS collapses: spaces, tabs and line\n * breaks. A no-break space is text, as in a browser, so ` ` is how a value keeps a space at\n * its end; `String.prototype.trim` would take that too.\n */\nconst trimStart = (text: string): string => text.replace(/^[ \\t\\n\\r\\f]+/, '');\nconst trimEnd = (text: string): string => text.replace(/[ \\t\\n\\r\\f]+$/, '');\nconst trimEnds = (text: string): string => trimEnd(trimStart(text));\n\n/**\n * The text written inside a view that takes it as a prop: every run joined, with the whitespace at\n * the two ends dropped as a paragraph drops it, and kept inside. A nested view is drawn after the\n * text, as SwiftUI's `Text` through `@expo/ui` draws a child `Text`, so the space before it stays.\n */\nfunction textContent(node: EngineNode): string {\n let text = '';\n let nested = false;\n for (const child of node.children) {\n if (child.kind === 'text') text += child.text;\n else if (child.kind === 'element') nested = true;\n }\n return nested ? trimStart(text) : trimEnd(trimStart(text));\n}\n\n/**\n * A view whose native name differs by platform. Chosen when the view is looked up rather than when\n * it is registered, so it does not matter which ran first: an app's imports register the router's\n * views before its `main.ts` gets to report the platform.\n */\nexport interface PlatformViewName {\n readonly ios: string;\n readonly android: string;\n}\n\n/** An element's registered view name, for the platform the host reported. */\nfunction registeredViewName(elementName: string): string | undefined {\n const name = VIEW_NAMES[elementName];\n if (name === undefined || typeof name === 'string') return name;\n return platformOS === 'android' ? name.android : name.ios;\n}\n\n/**\n * The views Fabric measures from their text, which a change of the system text size resizes:\n * a paragraph, and a text input on either platform. See `Engine.remeasureText`.\n */\nconst MEASURED_VIEWS = new Set(['Paragraph', 'TextInput', 'AndroidTextInput']);\n\n/** Leave a family that is still loading out of `style`, remembering it. See `loadingFamilies`. */\nfunction holdLoadingFamily(node: EngineNode, style: Record<string, unknown>): void {\n const family = style['fontFamily'];\n if (typeof family === 'string' && loadingFamilies.has(family)) {\n delete style['fontFamily'];\n node.heldFamily = family;\n } else if (node.heldFamily !== undefined) {\n node.heldFamily = undefined;\n }\n}\n\n/** What each mounted app does when faces register. See `fontsRegistered`. */\nconst fontListeners = new Set<(families: ReadonlySet<string>) => void>();\n\n/** Hear about faces registering with the platform, until the returned function is called. */\nexport function onFontsRegistered(listener: (families: ReadonlySet<string>) => void): () => void {\n fontListeners.add(listener);\n return () => fontListeners.delete(listener);\n}\n\n/**\n * Faces just registered with the platform, by the family names text asks for them by. Every\n * mounted app lays out again the paragraphs and text inputs that name one: see\n * `Engine.fontsRegistered`.\n */\nexport function fontsRegistered(families: Iterable<string>): void {\n const names = new Set(families);\n if (!names.size) return;\n for (const listener of [...fontListeners]) listener(names);\n}\n\n/**\n * Families a load has asked the platform for and not yet settled, by how many loads asked. Text\n * naming one is laid out in the fallback without the name until it settles: native caches a\n * text's measurement by its family name, so a fallback measurement under the face's name would\n * outlast the face arriving.\n */\nconst loadingFamilies = new Map<string, number>();\n\n/** Faces a load is about to ask the platform for. See `loadingFamilies`. */\nexport function fontsLoading(families: Iterable<string>): void {\n for (const family of families)\n loadingFamilies.set(family, (loadingFamilies.get(family) ?? 0) + 1);\n}\n\n/** What each mounted app does when a load settles. See `fontsSettled`. */\nconst settleListeners = new Set<(families: ReadonlySet<string>) => void>();\n\n/** Hear about loads settling, until the returned function is called. */\nexport function onFontsSettled(listener: (families: ReadonlySet<string>) => void): () => void {\n settleListeners.add(listener);\n return () => settleListeners.delete(listener);\n}\n\n/**\n * Faces a load asked for and has finished with, registered or not, before `fontsRegistered`.\n * Text held back for one that no load still asks for is laid out with the name again: see\n * `Engine.fontsSettled`.\n */\nexport function fontsSettled(families: Iterable<string>): void {\n const settled = new Set<string>();\n for (const family of families) {\n const left = (loadingFamilies.get(family) ?? 1) - 1;\n if (left > 0) loadingFamilies.set(family, left);\n else {\n loadingFamilies.delete(family);\n settled.add(family);\n }\n }\n if (settled.size) for (const listener of [...settleListeners]) listener(settled);\n}\n\n/** Whether a paragraph, or a span in it, was committed asking for one of these families. */\nfunction namesFamily(node: EngineNode, families: ReadonlySet<string>): boolean {\n const family = node.committed?.props['fontFamily'];\n if (typeof family === 'string' && families.has(family)) return true;\n return node.children.some((child) => namesFamily(child, families));\n}\n\n/** A text size cap far above any a platform offers, so it caps nothing. See `fontsRegistered`. */\nconst UNCAPPED = 1000;\n/**\n * How far a paragraph's cap moves each time a face it names registers: just past the 0.005 React\n * Native compares text attributes to, so the layout it cached is not found, and too little for\n * an app's own cap to cap anything visibly differently.\n */\nconst FONT_REFRESH_STEP = 0.006;\n\n/** The views that take a cursor, on either platform. */\nconst TEXT_INPUTS = new Set(['TextInput', 'AndroidTextInput']);\n\n/** The views that scroll their content, which `focus` brings a field into view within. */\nconst SCROLL_VIEWS = new Set(['ScrollView', 'AndroidHorizontalScrollView']);\n\n/** Element name -> the element name of the ancestor it commits into. See `registerHoist`. */\nconst HOISTS: Record<string, string> = {};\n/** The `ancestorName`s, so a commit asks only those nodes what to hoist into them. */\nconst HOIST_TARGETS = new Set<string>();\n\n/**\n * Commit every `elementName` as a direct child of its nearest `ancestorName`, wherever the\n * template put it, e.g. `registerHoist('native-header', 'screen')`.\n *\n * For a native component that reads a configuration node from its own direct children and\n * nowhere else. `RNSScreen.mm` finds its header that way, so a header written inside a\n * `safe-area-view`, or inside any component a page wraps itself in, was never found: no title,\n * no back button, and nothing said why. The retained tree keeps the node where Angular put it,\n * so styles, `@if` and removal all behave as written; only what reaches Fabric moves. It lands\n * just after the ancestor's child it was written in, or after all of them when it was written in\n * the ancestor itself, which keeps a page's scroll view ahead of its header as UIKit's large\n * title wants. A node with no such ancestor commits where it is.\n */\nexport function registerHoist(\n elementName: string,\n ancestorName: string,\n options: HoistOptions = {},\n): void {\n HOISTS[elementName] = ancestorName;\n HOIST_TARGETS.add(ancestorName);\n if (options.standIn) STAND_INS[elementName] = options.standIn;\n}\n\nexport interface HoistOptions {\n /**\n * Props for a native view the ancestor keeps once the element has committed into it.\n *\n * For a configuration node the native side reads when it arrives but never forgets when it\n * leaves. `RNSScreen` hides its navigation bar when a header config it holds says `hidden`, and\n * does nothing at all when the config is taken away, so the last bar it was told about stays on\n * screen. With a stand-in, removing the element commits these props onto the same native view,\n * children dropped, and the next element of that name adopts the view rather than creating\n * another, so what the native side sees is one config that is updated, never one that goes.\n */\n standIn?: Record<string, unknown>;\n}\n\n/** Element name -> the props it leaves behind in its ancestor. See `HoistOptions.standIn`. */\nconst STAND_INS: Record<string, Record<string, unknown>> = {};\n\n/** A native view an ancestor keeps for a hoisted name with a stand-in, and who it is for now. */\ninterface KeptHoist {\n /** The element committed as this view, or null while the stand-in props are. */\n node: EngineNode | null;\n committed: Committed;\n}\n\n/**\n * Unregistered names commit as a plain RCTView, because that is what an **Angular component\n * host element** is. Angular always creates one (`<x-card>` is a real node in the tree), and\n * it carries the component's host bindings, so it cannot be elided. Guessing a native view\n * name from the element name instead produces `Unimplemented component: <XCard>` on device.\n *\n * The cost is that a typo'd element name would render as an empty view without a word, and\n * Angular's own unknown-element check cannot help (it no-ops without a DOM). So in dev the\n * engine reports a name that nothing accounts for: not a view name, not a component host (see\n * `markComponentHost`), and not an element selector any template declared (`declareElement`).\n * Use an attribute selector (`selector: '[card]'`) on a component to avoid the extra view.\n */\n/**\n * A run of text as a paragraph shows it: without the space at the paragraph's very start or end.\n *\n * Angular collapses template whitespace to a single space rather than removing it, so\n * `<text>\\n {{ name }}\\n</text>` arrives as ` Ada `. A browser drops that space where a line\n * starts or ends; React Native's Text draws it, and every label written across two lines, which\n * a formatter will do to any long one, comes out indented. Spaces between runs are left alone,\n * as they are in HTML.\n *\n * ponytail: worked out when the run itself changes. A run that stops being the first or last\n * because a sibling arrived keeps its old trim until it next changes, which is a space at most.\n */\nfunction paragraphText(node: EngineNode): string {\n let root = node.parent;\n // Text written straight into a view is a paragraph of its own, and all of it.\n if (root === null || !isTextElement(root)) return node.box ? trimEnds(node.text) : node.text;\n // The commonest paragraph by far: one run and nothing else, so it is both the first and last.\n if (root.children.length === 1 && !isTextElement(root.parent)) return trimEnds(node.text);\n while (isTextElement(root.parent)) root = root.parent!;\n const runs: EngineNode[] = [];\n const collect = (from: EngineNode) => {\n for (const child of from.children) {\n if (child.kind === 'text') {\n if (child.text) runs.push(child);\n } else if (isTextElement(child)) collect(child);\n }\n };\n collect(root);\n let text = node.text;\n if (runs[0] === node) text = trimStart(text);\n if (runs[runs.length - 1] === node) text = trimEnd(text);\n return text;\n}\n\n/** The part of a node `viewNameOf` reads: an engine node, or any host's mirror of one. */\nexport interface ViewNameNode {\n readonly kind: string;\n readonly name: string;\n readonly parent: ViewNameNode | null;\n /** Whether a component is mounted on it, and whether that component is the native view. */\n readonly componentHost?: boolean;\n readonly nativeView?: boolean;\n /** What it holds, which decides whether one of HTML's text elements is text or a view. */\n readonly children?: readonly ViewNameNode[];\n /** Set on the paragraph the engine makes for a run of text written straight into a view. */\n readonly anonymous?: boolean;\n}\n\n/**\n * Whether an element is text: a `<text>`, or one of HTML's text elements that holds only text and\n * other such elements. Worked out each time, from the tree as it is, so nothing can go stale.\n */\nfunction isTextElement(node: ViewNameNode | null): boolean {\n if (node === null || node.kind !== 'element') return false;\n if (node.name === 'text') return true;\n // One lookup settles nearly every other element, which is a view.\n if (registeredViewName(node.name) !== PARAGRAPH) return false;\n return !TEXT_ELEMENTS.has(node.name) || holdsOnlyText(node);\n}\n\nfunction holdsOnlyText(node: ViewNameNode): boolean {\n for (const child of node.children ?? []) {\n if (child.kind === 'element' && !isTextElement(child)) return false;\n }\n return true;\n}\n\nconst ALIGNS = new Set(['center', 'flex-end', 'space-around', 'space-evenly']);\n\n/**\n * Whether one of HTML's text elements is a flex container that aligns the one run of text it\n * holds, as an avatar's initials are centred: `<span class=\"flex items-center justify-center\">`.\n *\n * A browser makes the run a flex item and places it. A paragraph's text is its content, which no\n * alignment moves, so such an element commits as a view, and its text as the paragraph any view's\n * loose text is. Read from the node's own style on each reconcile, which a change to it brings\n * about, so nothing is kept to go stale. A `<text>` is a paragraph whatever its style, and an\n * element holding more than the one run is left as it was.\n */\nfunction aligningText(node: EngineNode): boolean {\n if (node.kind !== 'element' || node.name === 'text' || !TEXT_ELEMENTS.has(node.name)) {\n return false;\n }\n if (node.children.length !== 1 || node.children[0]!.kind !== 'text') return false;\n if (isTextElement(node.parent) || ownLayout(node, 'display') !== 'flex') return false;\n return (\n ALIGNS.has(ownLayout(node, 'alignItems') as string) ||\n ALIGNS.has(ownLayout(node, 'justifyContent') as string)\n );\n}\n\n/** The view a node is committed as: `viewNameOf`, but for a text element that aligns its text. */\nconst committedViewName = (node: EngineNode): string =>\n aligningText(node) ? DEFAULT_VIEW : viewNameOf(node);\n\n/**\n * The native view a node commits as: `Paragraph` for a `<text>`, `VirtualText` for one nested in\n * another, `RawText` for a run of text, and `View` for anything unregistered, which is what an\n * Angular component's host element is.\n *\n * Exported for tools that show a template beside what it becomes, such as the X-ray in the\n * documentation's course, which labels `@ng-native/web`'s DOM with these names. It reads the same\n * table the commit does, so after `registerPlatformComponents('android')` it answers for Android.\n */\nexport function viewNameOf(node: ViewNameNode): string {\n if (node.kind === 'text') return RAW_TEXT;\n // RN models nested text as a span inside a paragraph: `Paragraph > [RawText, Text > RawText]`.\n // Committing a nested `<text>` as another Paragraph gives a paragraph inside a paragraph,\n // which lays out as a separate block instead of flowing inline.\n // A component of the app's own under a name a view set registered: its host is a plain view.\n if (node.componentHost && !node.nativeView && YIELDING.has(node.name)) return DEFAULT_VIEW;\n const registered = registeredViewName(node.name);\n // Nearly every element: a view of some kind, by its name alone.\n if (registered !== PARAGRAPH) return registered ?? DEFAULT_VIEW;\n // One of HTML's text elements that holds something other than text: a view.\n if (node.name !== 'text' && TEXT_ELEMENTS.has(node.name) && !holdsOnlyText(node)) {\n return DEFAULT_VIEW;\n }\n // The paragraph the engine makes for a view's loose text is under a view, whatever the name\n // of the element that view is.\n return !node.anonymous && isTextElement(node.parent) ? VIRTUAL_TEXT : PARAGRAPH;\n}\n\n/**\n * The props every native view reads as a boolean: the `bool` fields of React Native's\n * `BaseViewProps`, `AccessibilityProps` and `HostPlatformViewProps`, by the names JavaScript sends.\n *\n * An attribute arrives as text. A component that declares the prop as an input turns it into a\n * boolean itself, but an element nothing claims, such as a component's own host, holds what it\n * was given, and Android refuses a string where it reads a boolean: `focusable=\"false\"` is\n * `java.lang.String cannot be cast to java.lang.Boolean` at the first commit. iOS ignores it.\n *\n * So the text is made a boolean as it is committed, `\"false\"` false and anything else true, as an\n * attribute reads in HTML. The node keeps the text, which is what `[focusable=\"false\"]` in a\n * stylesheet matches against.\n */\nconst BOOLEAN_VIEW_PROPS = new Set([\n 'accessibilityElementsHidden',\n 'accessibilityIgnoresInvertColors',\n 'accessibilityRespondsToUserInteraction',\n 'accessibilityShowsLargeContentViewer',\n 'accessibilityViewIsModal',\n 'accessible',\n 'collapsable',\n 'collapsableChildren',\n 'focusable',\n 'hasTVPreferredFocus',\n 'needsOffscreenAlphaCompositing',\n // The flags native reads to know an event has a listener, which are booleans as well.\n 'onAccessibilityAction',\n 'onAccessibilityEscape',\n 'onAccessibilityMagicTap',\n 'onAccessibilityTap',\n 'onLayout',\n 'removeClippedSubviews',\n 'renderToHardwareTextureAndroid',\n 'screenReaderFocusable',\n 'shouldRasterizeIOS',\n]);\n\n/**\n * Whether `node` holds nothing `:empty` sees besides `moved`: so it was empty before `moved` came,\n * or is now that it has gone. An anchor is a comment on the web, which `:empty` does not see.\n */\nfunction wasOrIsEmptyWithout(node: EngineNode, moved: EngineNode): boolean {\n if (moved.kind === 'anchor') return false;\n for (const child of node.children) {\n if (child !== moved && child.kind !== 'anchor') return false;\n }\n return true;\n}\n\n/**\n * Have the child that paints a node's background merged again with the node: nothing of the\n * child's own moved, and what it paints may have.\n */\nfunction repaint(node: EngineNode): void {\n if (node.paintsOn?.parent === node) node.paintsOn.propsDirty = true;\n}\n\n/** A sixtieth of a second: how far apart the frames native is given for an animation are. */\nconst NATIVE_FRAME = 1000 / 60;\n\n/** The style keys that are a view's background. */\nconst PAINT_KEYS = [\n 'backgroundColor',\n 'experimental_backgroundImage',\n 'experimental_backgroundSize',\n 'experimental_backgroundPosition',\n 'experimental_backgroundRepeat',\n];\n\n/**\n * A node's own props onto what it commits with. No native prop has a hyphen: `data-*` and `aria-*`\n * attributes stay on the node for selectors to match, and an `aria-*` one is mapped to the prop\n * native reads. The node's `attributeOnly` names stay on it the same way.\n */\nfunction writeOwnProps(\n own: Record<string, unknown>,\n props: Record<string, unknown>,\n attributeOnly?: ReadonlySet<string>,\n): void {\n let aria = false;\n for (const key of Object.keys(own)) {\n if (attributeOnly?.has(key)) continue;\n if (key.includes('-')) aria ||= key.startsWith('aria-');\n else if (key !== 'style' && key !== INTRINSIC_SIZE && key !== STYLE_OVERRIDE) {\n props[key] = committedProp(key, own[key]);\n }\n }\n if (!aria) return;\n // An attribute-only `aria-*` is not mapped to the prop native reads either.\n const mapped = attributeOnly?.size\n ? Object.fromEntries(Object.entries(own).filter(([key]) => !attributeOnly.has(key)))\n : own;\n applyAria(mapped, props);\n}\n\n/** A prop as it is committed: a boolean view prop held as text is the boolean the text says. */\nfunction committedProp(key: string, value: unknown): unknown {\n return typeof value === 'string' && BOOLEAN_VIEW_PROPS.has(key) ? value !== 'false' : value;\n}\n\n/**\n * The `pointer-events` an element ends up with, in the order its props are merged: its inline\n * style's, then its `pointerEvents` prop, then what the sheets resolve. The inline one is read for\n * itself because an element no rule matches resolves to what it inherits, with its own inline\n * value only in what it hands down.\n */\nfunction pointerEventsOf(node: EngineNode, resolved: Record<string, unknown>): unknown {\n const inline = node.inlineInherits ? inlineInherited(node.props['style']) : null;\n const own = inline?.['pointerEvents'];\n // Merged over the prop, so its `inherit` is what the sheets and the parent settled, not the prop.\n if (own === 'inherit') return resolved['pointerEvents'];\n return own ?? node.props['pointerEvents'] ?? resolved['pointerEvents'];\n}\n/**\n * A node's `pointer-events` as native takes it, once its props and styles are merged.\n *\n * In CSS `none` is the element alone, and a descendant's `auto` takes touches again, which native\n * calls `box-none`: what a `none` with something inside to open it is committed as. Native's own\n * `none` is the whole subtree. It is what a `none` with nothing inside to open it stays, because\n * Android's text and images take no `pointerEvents` of their own and only an ancestor's `none`\n * keeps touches off them. It is also what the `pointerEvents` prop means, so a `none` that is the\n * prop's is left as it is.\n *\n * An inline `inherit` is what the element has without it, which is `resolved`: what the sheets\n * and its parent settled.\n */\nfunction nativePointerEvents(\n node: EngineNode,\n style: Record<string, unknown>,\n resolved: unknown,\n): void {\n let value = style['pointerEvents'];\n if (value === undefined) return;\n if (value === 'inherit') {\n value = resolved;\n if (value === undefined) delete style['pointerEvents'];\n else style['pointerEvents'] = value;\n }\n if (value === 'none' && node.touchWithin && node.props['pointerEvents'] !== 'none') {\n style['pointerEvents'] = 'box-none';\n }\n}\n/** Whether `node`, whose `pointer-events` is `value`, takes touches or holds something that does. */\nfunction takesTouches(node: EngineNode, value: unknown, prop: unknown): boolean {\n if (value === undefined) return false;\n // The prop's `none` is native's: the whole subtree, whatever is inside it.\n if (value === 'none' && prop === 'none') return false;\n // CSS's `none` and native's `box-none` take no touches themselves: their children answer.\n if (value === 'none' || value === 'box-none') {\n return node.children.some((child) => child.touchWithin);\n }\n return true;\n}\n\n/**\n * Records on `node` whether it, or something inside it, takes touches where it would inherit\n * `none`. When that changes a `none` element's own answer, its props are marked to be committed\n * again.\n *\n * Called as a node is reconciled, after its children, so theirs are already current: a child that\n * was skipped as clean has nothing beneath it that changed, and a change beneath marks every\n * ancestor to come back through here.\n */\nfunction noteTouches(node: EngineNode, style: StyleCache | null): void {\n if (!style) return;\n // Nearly every node: no `pointer-events` in any sheet, style or prop, and nothing recorded.\n const resolved = style.style['pointerEvents'];\n const prop = node.props['pointerEvents'];\n if (resolved === undefined && prop === undefined && !node.inlineInherits && !node.touchWithin) {\n return;\n }\n const value = pointerEventsOf(node, style.style);\n const within = takesTouches(node, value, prop);\n if (within === !!node.touchWithin) return;\n node.touchWithin = within;\n if (value === 'none') node.propsDirty = true;\n}\n\n/** Whether `node` is `ancestor` or somewhere under it. */\nfunction isWithin(node: EngineNode | null, ancestor: EngineNode): boolean {\n for (let at = node; at; at = at.parent) if (at === ancestor) return true;\n return false;\n}\n\n/**\n * The DOM events Angular's `@defer (on interaction)` and `(on hover)` listen for on the trigger\n * element, as the engine events that mean the same thing here.\n *\n * Interaction is `click` and `keydown`: a touch that lifts on the trigger or anything inside it,\n * and focus reaching it, which is what a keyboard or a screen reader does before acting on it.\n * Hover is `mouseenter`, `mouseover` and `focusin`: a pointer entering, which only a trackpad or a\n * mouse produces, and focus. Anything else is not a trigger and is ignored.\n */\nconst DEFER_TRIGGER_EVENTS: Readonly<Record<string, readonly string[]>> = {\n click: ['topTouchEnd'],\n keydown: ['topFocus'],\n mouseenter: ['topPointerEnter'],\n focusin: ['topFocus'],\n};\n\n/** Each trigger listener's teardowns, by DOM event name. Off the node, which rarely has one. */\nconst triggerListeners = new WeakMap<\n object,\n Map<(event: unknown) => void, Map<string, () => void>>\n>();\n\n/**\n * The react tag of the next view any engine creates.\n *\n * Even, because surface root tags are odd (1, 11, 21, ...): an odd view tag eventually collides\n * with a root, and UIKit throws inside `-[RCTViewComponentView mountChildComponentView:]` while\n * adding a view to itself, a native crash with no JS error at all.\n *\n * And far above 2, where React starts. Native keeps one registry of views by tag for every\n * surface, and React numbers its own views 2, 4, 6... on any surface it renders; a development\n * build always has one, LogBox, which renders the first `console.warn` on a surface of its own.\n * Starting where React starts put two views under one tag, and the app crashed natively in\n * `-[RCTComponentViewRegistry dequeueComponentViewWithComponentHandle:tag:]`. One counter for\n * every engine, so two Angular surfaces do not collide with each other either.\n *\n * ponytail: room for about 530 million views in one run of the app before a tag would pass\n * int32, which native keeps them as; recycled and cloned views take no new tag. Wrapping would\n * need to skip tags still mounted.\n */\nconst FIRST_TAG = 2 ** 30;\nlet lastTag = FIRST_TAG - 2;\nconst nextTag = (): number => (lastTag += 2);\n\nlet hoverReported = false;\n\n/**\n * Said once, in development, the first time a `@defer (on hover)` trigger is registered: a phone\n * has no pointer, so on one the block waits for focus alone.\n */\nfunction reportHover(host: HostEngine): void {\n if (hoverReported || !(host instanceof Engine) || !host.dev) return;\n hoverReported = true;\n console.warn(\n '[angular-native] @defer (on hover) fires when a pointer enters the trigger, which takes a trackpad or a mouse (an iPad, or an Android device with one), or when the trigger takes focus. On a phone it waits for focus alone; add another trigger, such as on interaction or on viewport.',\n );\n}\n\n/** Whether a value is one of the engine's own nodes. */\nexport function isEngineNode(value: unknown): value is EngineNode {\n return value instanceof RetainedNode;\n}\n\n/**\n * A retained node, as a class so every node has one shape from its first line: Hermes lays a\n * constructed object out once, where the object-spread this replaced built a literal and copied\n * eighteen fields across for each of the thousands of nodes a screen makes.\n *\n * The first three methods are what Angular's `animate.enter` and `animate.leave` ask an element\n * for directly, rather than through `Renderer2`; everything else those instructions do goes through\n * the renderer. `getAnimations` answers from the transitions the engine is actually running,\n * which is what tells Angular how long to wait before removing a leaving element.\n */\n/**\n * What the Metro preset's `Node` stand-in recognises an engine node by, so that Angular's\n * `instanceof Node` checks pass for these and for nothing else.\n */\nconst ENGINE_NODE = Symbol.for('ng-native.node');\n\nclass RetainedNode {\n static {\n Object.defineProperty(RetainedNode.prototype, ENGINE_NODE, { value: true });\n }\n\n props: Record<string, unknown> = {};\n text = '';\n children: EngineNode[] = [];\n parent: EngineNode | null = null;\n listeners: Map<string, Set<(event: unknown) => void>> | null = null;\n classes: Set<string> | null = null;\n sheet: StyleSheet | null = null;\n hostSheet: StyleSheet | null = null;\n customProperties: Record<string, TokenValue> | null = null;\n styleCache: StyleCache | null = null;\n styleDirty = true;\n styleCommitted: StyleCache | null = null;\n fitContainer: string | undefined = undefined;\n heightBasis: boolean | undefined = undefined;\n hasDirty = false;\n stateDirty = false;\n ownStyle: object | undefined = undefined;\n claimed: true | undefined = undefined;\n dormantHoists: EngineNode[] | null = null;\n committed: Committed | null = null;\n committedUnder: EngineNode | null = null;\n kept: Map<string, KeptHoist> | undefined = undefined;\n remeasure: true | undefined = undefined;\n propsDirty = false;\n structureDirty = false;\n subtreeDirty = false;\n touchWithin: boolean | undefined = undefined;\n box: EngineNode | undefined = undefined;\n anonymous: true | undefined = undefined;\n styled: true | undefined = undefined;\n transitions?: Map<string, Transition>;\n playing?: RunningAnimation;\n scrolled?: ScrollAnimation;\n\n readonly kind: NodeKind;\n readonly name: string;\n /** See `HostNode.host`. */\n readonly host: HostEngine;\n\n constructor(kind: NodeKind, name: string, host: HostEngine) {\n this.kind = kind;\n this.name = name;\n this.host = host;\n }\n\n get tagName(): string {\n return this.name;\n }\n\n /** Angular's dev-mode assertion compares this against `Node.ELEMENT_NODE`. */\n get nodeType(): number {\n return 1;\n }\n\n getAnimations(): unknown[] {\n const running: unknown[] = [];\n const playing = this.playing;\n if (playing && !playing.done) {\n running.push({\n animationName: playing.spec.name,\n effect: {\n // `animate.enter` reads this to know how long to wait. A null count is `infinite`,\n // which is what the Web Animations shape spells as Infinity.\n getTiming: () => ({\n duration: playing.spec.duration * (playing.spec.iterations ?? Infinity),\n delay: playing.spec.delay,\n iterations: playing.spec.iterations ?? Infinity,\n }),\n },\n });\n }\n for (const [property, transition] of this.transitions ?? []) {\n if (transition.done) continue;\n running.push({\n transitionProperty: property,\n effect: {\n getTiming: () => ({ duration: transition.duration, delay: 0, iterations: 1 }),\n },\n });\n }\n return running;\n }\n\n /**\n * Where another node is relative to this one, as the DOM's `compareDocumentPosition` answers:\n * the bits for preceding (2), following (4), containing (8) and contained (16), in tree order.\n * Signal Forms asks, to focus the first of a form's fields in the order the screen shows them.\n */\n compareDocumentPosition(other: RetainedNode): number {\n if (other === this) return 0;\n const path = (node: RetainedNode): RetainedNode[] => {\n const chain: RetainedNode[] = [];\n for (let at: RetainedNode | null = node; at; at = at.parent as RetainedNode | null) {\n chain.unshift(at);\n }\n return chain;\n };\n const mine = path(this);\n const theirs = path(other);\n if (mine[0] !== theirs[0]) return 1 | 32 | 4;\n let depth = 0;\n while (depth < mine.length && depth < theirs.length && mine[depth] === theirs[depth]) depth++;\n if (depth === mine.length) return 4 | 16;\n if (depth === theirs.length) return 2 | 8;\n const siblings = mine[depth - 1]!.children as unknown as RetainedNode[];\n return siblings.indexOf(theirs[depth]!) < siblings.indexOf(mine[depth]!) ? 2 : 4;\n }\n\n /**\n * What Signal Forms' `focusBoundControl()` calls on a field's element, and what a DOM element\n * would do: see `HostEngine.focus`.\n */\n focus(): void {\n this.host.focus(this as unknown as EngineNode);\n }\n\n get classList(): { contains(name: string): boolean } {\n const classes = this.classes;\n return { contains: (name: string): boolean => classes?.has(name) ?? false };\n }\n\n /**\n * What `@defer (on interaction)` and `(on hover)` call on their trigger element, the one place\n * Angular listens on an element directly rather than through `Renderer2`. See\n * `DEFER_TRIGGER_EVENTS`.\n */\n addEventListener(type: string, listener: (event: unknown) => void): void {\n const events = DEFER_TRIGGER_EVENTS[type];\n if (!events) return;\n let byListener = triggerListeners.get(this);\n if (!byListener) triggerListeners.set(this, (byListener = new Map()));\n let byType = byListener.get(listener);\n if (!byType) byListener.set(listener, (byType = new Map()));\n if (byType.has(type)) return;\n if (type === 'mouseenter') reportHover(this.host);\n const stops = events.map((event) =>\n this.host.setEventListener(this as unknown as EngineNode, event, listener),\n );\n byType.set(type, () => {\n for (const stop of stops) stop();\n });\n }\n\n removeEventListener(type: string, listener: (event: unknown) => void): void {\n const byType = triggerListeners.get(this)?.get(listener);\n byType?.get(type)?.();\n byType?.delete(type);\n }\n}\n\n/**\n * RN-specific helpers, injected rather than imported so the engine stays runnable under Node.\n */\nexport interface EngineOptions {\n /**\n * React Native's `NativeAnimatedHelper`, which lets native move a view by a scroll with no\n * JavaScript in between: how sticky headers stay pinned on a fast fling. The platform supplies it\n * on a device; without it, the components move those views from JavaScript as before.\n */\n nativeAnimated?: NativeAnimated | null;\n /**\n * RN's `processColor`. Narrower than `unknown` on purpose: it is only ever handed the value of\n * a `*color` prop, and typing it that way is what lets an app pass RN's function straight in\n * rather than casting at every call site.\n */\n processColor?: (value: string | number) => unknown;\n /**\n * RN's `resolveAssetSource`. `require('./x.png')` compiles to an asset *id*, and only this\n * turns it into `{uri, width, height, scale}`. Without it local images cannot work at all,\n * while remote `{uri}` objects pass through and appear to prove the prop is fine.\n */\n resolveAssetSource?: (value: unknown) => unknown;\n /**\n * The application-level sheet, compiled at build time. The one set of rules allowed to match a\n * node whatever component created it, which is what resets, utility classes and `:root` tokens\n * all need.\n */\n globalStyles?: StyleSheet | null;\n /**\n * What media queries are evaluated against. Pushed in rather than read, because the engine\n * imports nothing from React Native and a host may have its own idea of the viewport.\n */\n conditions?: Conditions;\n /**\n * Custom properties the device knows and the stylesheet cannot: the hairline width, and\n * whatever else is settled before the first frame. Seeded on the root, below `:root`, so an\n * app's own sheet still overrides them. Values that only arrive later - the safe-area insets,\n * which nothing knows until a view has been laid out - come through `updateTokens` instead.\n */\n tokens?: Readonly<Record<string, TokenValue>>;\n /**\n * Report host primitives used without their component (see `claimHost`). Defaults to RN's\n * `__DEV__`, so a release build never looks.\n */\n dev?: boolean;\n /**\n * The clock CSS transitions run on. Pushed in for the same reason everything else is: the\n * engine imports nothing, and a test drives time rather than waiting for it.\n */\n now?: () => number;\n /**\n * Called when the tree goes from clean to dirty. The host uses it to schedule a commit for a\n * change that arrives outside change detection, which is where Angular's animation queue puts\n * the classes for `animate.enter` and `animate.leave`.\n */\n onDirty?: () => void;\n /**\n * Where an error thrown while a native event is being dispatched goes, with the event's name.\n * The platform adapter points it at the app's `ErrorHandler`. Without one it is logged, and\n * either way it is never rethrown: see `dispatchEvent` for why.\n */\n onError?: (error: unknown, topLevelType: string) => void;\n}\n\n/**\n * A prop whose value is a colour, and so has to go through `processColor` before native reads it.\n *\n * The `Android` suffix is part of the test because React Native names its platform-specific props\n * that way round: `underlineColorAndroid` is a colour and does not end in `color`, and Android's\n * `ColorPropConverter` takes a number or a platform-colour map and refuses a string, so an unnamed\n * one arrives as the wrong type. `iOS`-suffixed props are not in the set because none of them are\n * colours - `shouldRasterizeIOS` is a boolean.\n */\nconst IS_COLOR_PROP = /color(android)?$/i;\n/**\n * Colour props React Native does not name with a `color` suffix: `<switch>`'s pair ends in the\n * state each one paints - `trackColorForTrue` and `trackColorForFalse`. They are the same type\n * problem the `Android` suffix causes: Android's `ColorPropConverter` takes a number or a\n * platform-colour map, refuses a string, and throws rather than approximating one.\n */\nconst STATE_COLOR_PROPS = new Set(['trackColorForTrue', 'trackColorForFalse']);\n/** Answers per key name, once: the regex ran for every prop of every node in every commit. */\nconst colorProps = new Map<string, boolean>();\nfunction isColorProp(key: string): boolean {\n let answer = colorProps.get(key);\n if (answer === undefined) {\n colorProps.set(\n key,\n (answer = IS_COLOR_PROP.test(key) || STATE_COLOR_PROPS.has(key) || BRUSH_PROPS.has(key)),\n );\n }\n return answer;\n}\nconst ASSET_PROPS = new Set(['source', 'defaultSource', 'loadingIndicatorSource']);\n\n/**\n * Props whose value is a list of objects with a `color` inside.\n *\n * Colour processing keys off the *property name*, which cannot see a colour nested in an array.\n * That matters more than it sounds: with `enableNativeCSSParsing` off, which is the default,\n * Fabric does not parse a colour string either, so an unprocessed nested colour is not\n * approximated, it is dropped.\n */\nconst NESTED_COLOR_LIST_PROPS = new Set(['boxShadow']);\n\n/** The props of an SVG shape that take a brush, not a colour. */\nconst BRUSH_PROPS = new Set(['fill', 'stroke']);\n\n/** Styles arrive as objects, arrays, nested arrays and nulls. Reduce to one object. */\n/**\n * A bound transform is still the CSS string: see `inline-transform.ts`. One CSS cannot read\n * leaves the transform the rules set, as a browser drops it.\n */\nfunction boundTransform(\n node: EngineNode,\n style: Record<string, unknown>,\n cascaded: unknown,\n): Record<string, unknown> {\n const text = style['transform'];\n if (typeof text !== 'string') return style;\n // The same list for the same string, commit after commit: a transition compares the two ends\n // it is given, and a list made afresh each time reads as a new place to go.\n if (node.boundTransform?.text !== text) node.boundTransform = { text, list: transformList(text) };\n const list = node.boundTransform.list ?? cascaded;\n if (list === undefined) delete style['transform'];\n else style['transform'] = list;\n return style;\n}\n\n/** A transform string as the list native reads, and none for one CSS cannot read. */\nconst transformOf = (value: string): unknown[] => transformList(value) ?? [];\n\nfunction flattenStyle(value: unknown, into: Record<string, unknown>): Record<string, unknown> {\n if (!value) return into;\n if (Array.isArray(value)) {\n for (const entry of value) flattenStyle(entry, into);\n return into;\n }\n if (typeof value === 'object') Object.assign(into, value);\n return into;\n}\n\n/** The timing a rule can set apart from a property list, and the part of the spec each sets. */\nconst TRANSITION_TIMING = {\n $transitionDuration: 'duration',\n $transitionDelay: 'delay',\n $transitionEasing: 'easing',\n} as const;\n\n/**\n * The transition spec, with any timing set by a rule of its own laid over it: `.duration-700`\n * beside `.transition`. A rule that writes the timing itself compiles it to `null`, which is how\n * a stronger transition keeps its own.\n *\n * Every key is taken out of `props`: they are instructions for this engine, and nothing native\n * has ever heard of them. See `animated` for why each `delete` is guarded.\n */\nfunction transitionSpec(\n props: Record<string, unknown>,\n): Record<string, TransitionSpec> | undefined {\n // Keyed `$transition` by the compiler, so a view's own `transition` prop reaches it.\n let spec = props['$transition'] as Record<string, TransitionSpec> | undefined;\n if (spec !== undefined) delete props['$transition'];\n for (const [key, part] of Object.entries(TRANSITION_TIMING)) {\n if (!(key in props)) continue;\n const value = props[key];\n delete props[key];\n if (value === null || spec === undefined) continue;\n const timed: Record<string, TransitionSpec> = {};\n for (const name of Object.keys(spec)) timed[name] = { ...spec[name]!, [part]: value };\n spec = timed;\n }\n return spec;\n}\n\n/**\n * The keys CSS's `translate`, `rotate` and `scale` compile to, in the order they apply. The\n * compiler's `INDIVIDUAL_TRANSFORMS` in `packages/metro/css/properties.cjs` writes the same three.\n */\nconst INDIVIDUAL_TRANSFORMS = ['__translate', '__rotate', '__scale'] as const;\n\n/**\n * Fold the individual transform properties into the one list native has.\n *\n * They cascade, transition and animate as properties of their own, so this runs last, on what\n * the node is about to paint. CSS Transforms 2 applies translate, then rotate, then scale, then\n * `transform`, and a list applies left to right, so that is the order they are written in.\n */\nfunction composeTransform(\n node: EngineNode,\n props: Record<string, unknown>,\n): Record<string, unknown> {\n const [translate, rotate, scale] = INDIVIDUAL_TRANSFORMS.map((key) => props[key]);\n if (translate === undefined && rotate === undefined && scale === undefined) return props;\n // Guarded, as `animated` guards its own: a `delete` is what sends an object to Hermes's slow\n // dictionary layout, and most nodes have none of these.\n for (const key of INDIVIDUAL_TRANSFORMS) if (key in props) delete props[key];\n\n const transform = props['transform'];\n const parts = [translate, rotate, scale, transform];\n const last = node.composedTransform;\n let value: unknown[];\n if (last && last.parts.every((part, i) => part === parts[i])) {\n value = last.value;\n } else {\n // A bound style's transform is still the CSS string: see `inline-transform.ts`.\n const own = typeof transform === 'string' ? transformOf(transform) : transform;\n value = [translate, rotate, scale, own].flatMap((part) => (Array.isArray(part) ? part : []));\n node.composedTransform = { parts, value };\n }\n\n if (value.length) props['transform'] = value;\n else delete props['transform'];\n return props;\n}\n\n/**\n * Fabric *merges* the raw props handed to a clone onto the node's existing props, so a prop\n * that has gone away has to be sent explicitly as `null`. Sending the whole prop object would\n * silently keep removed props alive.\n */\nfunction diffProps(\n prev: Record<string, unknown>,\n next: Record<string, unknown>,\n): Record<string, unknown> | null {\n let payload: Record<string, unknown> | null = null;\n for (const key of Object.keys(next)) {\n if (!Object.is(prev[key], next[key])) (payload ??= {})[key] = next[key];\n }\n for (const key of Object.keys(prev)) {\n if (!(key in next)) (payload ??= {})[key] = null;\n }\n return payload;\n}\n\n/**\n * The prop a replaced element, an image, puts its own pixel size in: `{ width, height }`.\n *\n * Not a style, because a style binding is inline style and beats every rule, so a picture's own\n * 600 by 600 would override `class=\"size-11\"`. CSS gives a replaced element's natural size the\n * lowest precedence of all, below any rule and any bound style, and that is what this is for.\n * It never reaches native.\n */\nconst INTRINSIC_SIZE = 'intrinsicSize';\n\n/**\n * The prop a component puts the style it must have the last word on in, over the caller's.\n *\n * The other end of the scale from `intrinsicSize`. Angular merges a component's host style\n * binding under the template's, so a caller's `[style]=\"{flex: 1}\"` beats the host's own\n * `flex: 0`; that is the right order for a default and the wrong one for an adjustment the\n * component is making on the caller's behalf, which RN composes after the caller's style. A\n * keyboard-avoiding view's padding, height and flex are that. Applied after inline style, a key\n * at a time, so every other property the caller wrote still applies. It never reaches native.\n */\nconst STYLE_OVERRIDE = 'styleOverride';\n\ninterface IntrinsicSize {\n readonly width: number;\n readonly height: number;\n}\n\nconst isSet = (value: unknown): boolean => value !== undefined && value !== null;\n\n/**\n * Size a box from its content's natural size, where nothing else did, as CSS sizes an `<img>`.\n *\n * Neither dimension set: the natural size, or the natural width alone when the author gave an\n * aspect ratio for Yoga to take the height from. One dimension set: the other follows the\n * picture's proportions, through `aspectRatio`, unless the author gave one of their own.\n */\nfunction applyIntrinsicSize(props: Record<string, unknown>, size: IntrinsicSize): void {\n const width = isSet(props['width']);\n const height = isSet(props['height']);\n if (width && height) return;\n const ownRatio = isSet(props['aspectRatio']);\n if (!width && !height) {\n props['width'] = size.width;\n if (!ownRatio) props['height'] = size.height;\n return;\n }\n if (!ownRatio && size.width > 0 && size.height > 0) {\n props['aspectRatio'] = size.width / size.height;\n }\n}\n\nconst now = (): number => globalThis.performance?.now?.() ?? Date.now();\n\nfunction sameHandles(a: readonly FabricNode[], b: readonly FabricNode[]): boolean {\n return a.length === b.length && a.every((handle, i) => handle === b[i]);\n}\n\n/** Dev-time commit accounting, so a slow frame can be attributed rather than guessed at. */\nexport interface EngineStats {\n commits: number;\n lastCommitMs: number;\n /** The initial mount, which is a different animal from a steady-state update. */\n firstCommitMs: number;\n /** Worst commit *after* the mount. This is the number that matters for frame rate. */\n worstCommitMs: number;\n /** Commits that took longer than 8ms, a frame at 120Hz, excluding the mount. */\n slowCommits: number;\n /**\n * Worst `begin()`..`end()` span, excluding the mount. This brackets Angular's whole render\n * pass - template execution, bindings, the commit - so comparing it against `worstCommitMs`\n * says whether time is going into the renderer or into change detection around it.\n */\n worstRenderMs: number;\n createdNodes: number;\n clonedNodes: number;\n}\n\nconst FRAME_BUDGET_MS = 8;\n\nexport class Engine implements HostEngine {\n /** Scopes the CSS resolver's memo. Bumped once per commit. */\n private styleEpoch = 0;\n\n /** The node `:focus` currently applies to. */\n private focusedNode: EngineNode | null = null;\n\n readonly stats: EngineStats = {\n commits: 0,\n lastCommitMs: 0,\n firstCommitMs: 0,\n worstCommitMs: 0,\n slowCommits: 0,\n worstRenderMs: 0,\n createdNodes: 0,\n clonedNodes: 0,\n };\n\n private eventsRegistered = false;\n\n readonly root: EngineNode = new RetainedNode('element', 'root', this);\n\n private readonly fabric: FabricUIManager;\n private readonly rootTag: number;\n private readonly styles: StyleResolver;\n /** Whether to run the development checks, which a release build skips. */\n readonly dev: boolean;\n private readonly now: () => number;\n private onDirty: (() => void) | undefined;\n private onError: ((error: unknown, topLevelType: string) => void) | undefined;\n /** Nodes with at least one transition in flight, so a frame walks those and nothing else. */\n private readonly running = new Set<EngineNode>();\n /** Nodes playing a `@keyframes` animation. */\n private readonly playing = new Set<EngineNode>();\n /**\n * Elements of a hoisted name (`registerHoist`) that are in the tree, so a commit need not search\n * for them. Only those in the tree: see `releaseDetached`.\n */\n private readonly hoisted = new Set<EngineNode>();\n /** The nodes taken out of a child list since the last commit. See `releaseDetached`. */\n private readonly removedSinceCommit = new Set<EngineNode>();\n /**\n * `@keyframes` by name, across every sheet registered. One registry rather than one per sheet,\n * because that is the scope CSS gives them: a name defined in a global stylesheet is usable\n * from a component's. The cost is that two components defining the same name collide, last one\n * in wins, exactly as two stylesheets in a document would.\n */\n private readonly keyframes = new Map<string, readonly Keyframe[]>();\n /** Every sheet registered, in the order a document would hold them. See `sheetReplaced`. */\n private readonly sheetOrder: StyleSheet[] = [];\n /** The `@keyframes` each playing animation was started from. See `startPlaying`. */\n private readonly playedFrames = new WeakMap<RunningAnimation, readonly Keyframe[]>();\n /** Element names already reported as unclaimed, so a list of a thousand rows reports once. */\n private readonly reported = new Set<string>();\n private readonly processColor: (value: string | number) => unknown;\n /**\n * Whether any sheet seen so far asks about a node's position among its siblings. Until one\n * does, a child list can move without anything else needing to be looked at again.\n */\n private structuralSheets = false;\n /** Whether any sheet uses `:has()`. See `markBeneath`. */\n private hasSheets = false;\n private readonly resolveAssetSource: (value: unknown) => unknown;\n\n constructor(fabric: FabricUIManager, rootTag: number, options: EngineOptions = {}) {\n this.fabric = fabric;\n this.rootTag = rootTag;\n const conditions = options.conditions ?? { width: 0, height: 0, colorScheme: 'light' };\n this.styles = new StyleResolver(options.globalStyles ?? null, conditions);\n this.viewportSize = { width: conditions.width, height: conditions.height };\n this.fontScale = conditions.fontScale;\n if (options.tokens) this.styles.setRootTokens(options.tokens);\n this.structuralSheets = options.globalStyles?.structural === true;\n this.watchHas(options.globalStyles);\n this.watchActive(options.globalStyles);\n this.dev = options.dev ?? (globalThis as { __DEV__?: boolean }).__DEV__ === true;\n if (this.dev) {\n this.styles.onUndefinedToken = (name, props, on) =>\n this.reportUndefinedToken(name, props, on);\n this.styles.onUnreadDisplay = (name, value) => this.reportUnreadDisplay(name, value);\n }\n this.now = options.now ?? (() => globalThis.performance?.now?.() ?? Date.now());\n this.onDirty = options.onDirty;\n this.onError = options.onError;\n this.registerSheet(options.globalStyles);\n this.processColor = options.processColor ?? ((value) => value);\n this.resolveAssetSource = options.resolveAssetSource ?? ((value) => value);\n this.scrollDriver = options.nativeAnimated\n ? new NativeScrollDriver(options.nativeAnimated)\n : null;\n // Eagerly, not on the first listener. Fabric holds exactly one event handler and\n // `ReactFabric` installs React's at module scope, so until we claim it every native event\n // lands in React's event plugins. Those look the name up in a view config registry we never\n // populate and throw `Unsupported top level event type` from inside the native dispatch, or\n // read `instanceHandle.stateNode.canonical` off our own node and throw on `canonical`.\n // Nothing here emits events until a component asks for one, so waiting looks safe; it is not.\n // `RNSScreen` fires `onWillAppear`/`onHeaderHeightChange` on its own during a push, with no\n // listener anywhere, and the throw unwinds through the mounting transaction that pushed it.\n // The next commit then reads freed props and the process dies in `updateProps`.\n this.registerEventHandler();\n }\n\n /**\n * A rotation, a window resize, or the system switching to dark mode.\n *\n * None of those change a single node, so nothing would be dirty and nothing would re-render.\n * Marking the root is what gets the tree walked again; every cached style is already invalid,\n * because each carries the conditions version it was resolved under.\n */\n /**\n * Move `:focus`, invalidating only the two nodes involved.\n *\n * Precise rather than by generation: unlike a rotation, the engine knows exactly which nodes\n * changed, and a keystroke's worth of focus movement should not invalidate the tree.\n */\n private setFocused(node: EngineNode | null): void {\n if (this.focusedNode === node) return;\n if (this.focusedNode) {\n this.focusedNode.focused = false;\n this.markProps(this.focusedNode);\n }\n this.focusedNode = node;\n if (node) {\n node.focused = true;\n this.markProps(node);\n }\n this.commit();\n }\n\n /**\n * Set or clear `:active` along a responder chain, marking each node so its style re-resolves.\n *\n * Returns whether anything moved, because the caller has to commit: a gesture changes no\n * binding, so nothing marks an Angular view dirty and no change-detection pass would follow.\n */\n private setActiveChain(from: EngineNode | null, active: boolean): boolean {\n let changed = false;\n for (let node = from; node; node = node.parent) {\n if (node.active === active) continue;\n node.active = active;\n this.markActive(node);\n changed = true;\n }\n return changed;\n }\n\n /** Whether any sheet styles a pressed element, and each compound that asks about one from another. */\n private activeUse: { own: boolean; elsewhere: readonly Compound[] } = {\n own: false,\n elsewhere: [],\n };\n\n /** What each sheet in play asks about a pressed element: `activeUse` is all of them together. */\n private readonly activeBySheet = new Map<StyleSheet, ReturnType<typeof usesActive>>();\n\n /** Note what a sheet in play asks about a pressed element. See `markActive`. */\n private watchActive(sheet: StyleSheet | null | undefined): void {\n // Asked for every element a component's sheet is given to: noted once a sheet.\n if (!sheet || this.activeBySheet.has(sheet)) return;\n const use = usesActive(sheet);\n this.activeBySheet.set(sheet, use);\n if (!use.own && !use.elsewhere.length) return;\n this.countActive();\n if (this.styles.tracksHas) return;\n // What a pressed element is compared with is the rules it matched, which no cache kept until\n // a sheet asked. Nothing is resolved yet when the sheet is the one the engine was made with.\n this.styles.tracksHas = true;\n if (!this.root) return;\n this.root.styleDirty = true;\n this.markPath(this.root);\n }\n\n /** A sheet has left play, by a hot swap or by being removed: what it asked goes with it. */\n private unwatchActive(sheet: StyleSheet): void {\n if (this.activeBySheet.delete(sheet)) this.countActive();\n }\n\n private countActive(): void {\n const all = [...this.activeBySheet.values()];\n this.activeUse = {\n own: all.some((use) => use.own),\n elsewhere: all.flatMap((use) => use.elsewhere),\n };\n }\n\n /**\n * A press began or ended on `node` or under it, which is all that changed about it. A press\n * reaches every ancestor up to the root, and marking each as restyled would style the whole\n * screen again, twice a press. So each is only matched again, and keeps its style and all\n * that is under it unless it now matches other rules. An element a rule asks about from\n * inside or beside it, `.card:active .title`, changes more than itself, and is restyled with\n * everything under it as any other change is. With no rule for a pressed element at all there\n * is nothing to match.\n */\n private markActive(node: EngineNode): void {\n const { own, elsewhere } = this.activeUse;\n if (!own && !elsewhere.length) return;\n // By its classes alone: a compound with none could be any element.\n const asked = elsewhere.some((compound) =>\n compound.classes.every((name) => node.classes?.has(name)),\n );\n if (asked) return this.markProps(node);\n node.stateDirty = true;\n this.markPath(node.parent ?? node);\n }\n\n /**\n * Custom properties the device knows and the stylesheet cannot, once they change.\n *\n * Merged rather than replaced: the insets come from a view and the hairline from the device, so\n * a caller owns the properties it names and nothing else. Each owner writes all of its own at\n * once - four insets together, never one - so nothing is left over from a previous rotation.\n */\n /**\n * Match `sheet` against every node from now on, after the global sheet the engine was made\n * with, and restyle everything; false, and nothing done, when it already is. How a platform\n * applies a component whose CSS is not scoped, such as Angular's `ViewEncapsulation.None`.\n * `replacing` is a sheet added before that this one takes the place of, after a hot swap.\n */\n addGlobalSheet(sheet: StyleSheet, replacing?: StyleSheet): boolean {\n if (!this.styles.addGlobalSheet(sheet, replacing)) return false;\n if (replacing) this.sheetReplaced(replacing, sheet);\n else this.registerSheet(sheet);\n if (sheet.structural) this.structuralSheets = true;\n this.watchHas(sheet);\n this.watchActive(sheet);\n this.markPath(this.root);\n return true;\n }\n\n /**\n * Stop matching a sheet `addGlobalSheet` added, and restyle everything; false, and nothing\n * done, when it is not one. A hot swap that leaves a None component no rules, or makes it scoped.\n */\n removeGlobalSheet(sheet: StyleSheet): boolean {\n if (!this.styles.removeGlobalSheet(sheet)) return false;\n this.sheetReplaced(sheet, null);\n this.markPath(this.root);\n return true;\n }\n\n updateTokens(next: Readonly<Record<string, TokenValue>>): void {\n this.styles.setRootTokens({ ...this.styles.rootTokens, ...next });\n this.root.subtreeDirty = true;\n this.commit();\n }\n\n /**\n * The system text size changed: measure every text and text input again, and commit.\n *\n * React Native's surface re-measures its text when the content size category changes, on a\n * commit of its own. The next commit from here is built from the handles the engine holds,\n * which are the nodes from before that, laid out at the old size, and Yoga keeps a clean node's\n * layout: every text whose content had not changed kept its old box, with its glyphs drawn at\n * the new size inside it, clipped. So each one is committed again, cloned with its children,\n * which is what makes Fabric dirty a measured node and measure it at the size now in effect.\n */\n remeasureText(): void {\n const again = (measured: EngineNode): void => {\n measured.remeasure = true;\n this.markProps(measured, false);\n };\n const visit = (node: EngineNode): void => {\n for (const child of node.children) {\n // The paragraph of a run of text written straight into a view is kept on the text.\n if (child.kind === 'text' && child.box?.committed) again(child.box);\n if (child.kind !== 'element') continue;\n if (child.committed && MEASURED_VIEWS.has(committedViewName(child))) again(child);\n visit(child);\n }\n };\n visit(this.root);\n this.commit();\n }\n\n /** Whether any text has been laid out again for a face. See `fontsRegistered`. */\n private fontsRefreshed = false;\n /** How many times each paragraph or text input has been laid out again for a face. */\n private readonly fontRefreshes = new WeakMap<EngineNode, number>();\n /** The text inputs whose `fontFamily` the next commit sends again. See `fontsRegistered`. */\n private readonly fontResends = new WeakSet<EngineNode>();\n\n /**\n * Faces registered after text naming them was laid out: lay that text out again, and commit.\n *\n * Native keeps a paragraph's text layout, face included, keyed by what the paragraph asks for.\n * iOS caches the attributed string it built and the size it measured, so text laid out before\n * its face registered stays in the fallback face, and committing it again unchanged hits the\n * same cache. What it asks for has to change, and nothing visible can: each paragraph naming\n * one of the families is committed with its text size cap raised by a step too small to see, or\n * set far above any size the platform offers where it had none. Its view, and everything native\n * holds for it, stays where it is. Android keys its text layout the same way and applies the\n * cap the same way, so the same change works there.\n *\n * A text input takes its font another way. iOS sets it on the field again only when the input's\n * text attributes change, which the same cap does. Android sets it only when `fontFamily` is in\n * the props it is sent, and the engine sends only what changed, so it is sent again once.\n */\n /**\n * Loads have settled for these families: every node held back for one, a span inside a\n * paragraph included, is laid out with the name again, registered or not. See `loadingFamilies`.\n */\n fontsSettled(families: ReadonlySet<string>): void {\n let held = false;\n const visit = (node: EngineNode): void => {\n for (const child of node.children) {\n if (child.heldFamily !== undefined && families.has(child.heldFamily)) {\n this.markProps(child, false);\n held = true;\n }\n visit(child);\n }\n };\n visit(this.root);\n if (held) this.commit();\n }\n\n fontsRegistered(families: ReadonlySet<string>): void {\n const visit = (node: EngineNode): void => {\n for (const child of node.children) {\n if (child.kind !== 'element') continue;\n const viewName = viewNameOf(child);\n const input = TEXT_INPUTS.has(viewName);\n if (child.committed && (viewName === PARAGRAPH || input) && namesFamily(child, families)) {\n this.fontRefreshes.set(child, (this.fontRefreshes.get(child) ?? 0) + 1);\n if (input) this.fontResends.add(child);\n this.fontsRefreshed = true;\n this.markProps(child, false);\n } else {\n visit(child);\n }\n }\n };\n visit(this.root);\n this.commit();\n }\n\n /**\n * Put the cursor in a text input; bring anything else on screen, in the scroll view it is in.\n * A form sends the user to the first field that needs fixing this way, and a toggle or a picker\n * has no cursor to take, so it is scrolled to instead.\n */\n focus(node: EngineNode): void {\n if (TEXT_INPUTS.has(viewNameOf(node))) this.dispatchCommand(node, 'focus');\n else this.reveal(node);\n }\n\n /**\n * Scroll the nearest scroll view the node is in by as little as brings the node fully on\n * screen, with `margin` to spare - UIKit's `scrollRectToVisible`. `visibleBottom` is where in\n * the window the visible area ends when something covers the bottom of the scroll view: the\n * keyboard's top edge, for a field the keyboard would otherwise hide.\n *\n * Measured in the window, all of it, so the scroll view's offset needs no tracking: it is how\n * far its content's top edge is above its own.\n */\n reveal(node: EngineNode, options: { visibleBottom?: number; margin?: number } = {}): void {\n // The nearest scroll view that scrolls up and down: a sideways carousel on a page is not\n // what moves a field clear of the bottom of the screen.\n let scroll = node.parent;\n while (\n scroll &&\n !(SCROLL_VIEWS.has(viewNameOf(scroll)) && scroll.props['horizontal'] !== true)\n ) {\n scroll = scroll.parent;\n }\n const content = scroll && this.visibleChildren(scroll)[0];\n if (!scroll || !content) return;\n const margin = options.margin ?? 16;\n this.measure(scroll, (view) => {\n this.measure(content, (inner) => {\n this.measure(node, (target) => {\n const offset = view.y - inner.y;\n const top = view.y + margin;\n const bottom = Math.min(view.y + view.height, options.visibleBottom ?? Infinity) - margin;\n let by = 0;\n if (target.y + target.height > bottom) by = target.y + target.height - bottom;\n else if (target.y < top) by = target.y - top;\n if (by !== 0)\n this.dispatchCommand(scroll, 'scrollTo', [0, Math.max(0, offset + by), true]);\n });\n });\n });\n }\n\n /**\n * Commit one measured node again, cloned with its children, so Fabric measures it once more.\n *\n * A text input is measured from its native state, and a text set from JavaScript reaches that\n * state only in the layout after the measurement, so the commit carrying the text sizes the\n * field for the text it had before. This is the commit that sizes it for the new one: one of\n * the exceptions to a commit per pass, because waiting for the next pass would leave the field\n * the wrong height until something else changed.\n */\n remeasure(node: EngineNode): void {\n if (!node.committed) return;\n node.remeasure = true;\n this.markProps(node, false);\n this.commit();\n }\n\n /**\n * A node's component rules are its creating sheet's, so this matches it against `like`'s, or\n * against the one it was created with once `like` is null.\n */\n adoptScope(node: EngineNode, like: EngineNode | null): void {\n if (like && !this.ownSheets.has(node)) this.ownSheets.set(node, node.sheet);\n const sheet = like ? like.sheet : this.ownSheets.get(node);\n if (sheet === undefined || node.sheet === sheet) return;\n node.sheet = sheet;\n if (sheet?.structural) this.structuralSheets = true;\n this.watchHas(sheet);\n this.watchActive(sheet);\n this.markProps(node);\n }\n\n /** The sheet each node given another's scope was created with. */\n private readonly ownSheets = new WeakMap<EngineNode, StyleSheet | null>();\n\n /** The window's size, from the conditions media queries use. Zero until the platform says. */\n get viewport(): { readonly width: number; readonly height: number } {\n return this.viewportSize;\n }\n\n private viewportSize: { readonly width: number; readonly height: number };\n /** The system text size, from the conditions. See `Conditions.fontScale`. */\n private fontScale: number | undefined;\n\n private readonly viewportWatchers = new Set<() => void>();\n\n /** Calls `listener` after each change of conditions, which is when `viewport` can change. */\n watchViewport(listener: () => void): () => void {\n this.viewportWatchers.add(listener);\n return () => this.viewportWatchers.delete(listener);\n }\n\n updateConditions(next: Conditions): void {\n this.viewportSize = { width: next.width, height: next.height };\n this.fontScale = next.fontScale;\n this.styles.setConditions(next);\n this.root.subtreeDirty = true;\n // Committed here rather than left to the next change-detection pass, because there may not\n // be one: no view is dirty, so a tick does no work and never reaches the renderer at all.\n this.commit();\n for (const watcher of this.viewportWatchers) watcher();\n }\n\n // --- mutation API -----------------------------------------------------\n\n createElement(name: string, sheet: StyleSheet | null = null): EngineNode {\n const node = new RetainedNode('element', name, this);\n node.sheet = sheet;\n const html = HTML_ELEMENTS.get(name);\n if (html !== undefined) {\n if (html.role) node.props['accessibilityRole'] = html.role;\n node.styled = html.styled;\n }\n if (sheet?.structural) this.structuralSheets = true;\n this.watchHas(sheet);\n this.watchActive(sheet);\n if (HOISTS[name]) this.hoisted.add(node);\n return node;\n }\n\n addClass(node: EngineNode, name: string): void {\n (node.classes ??= new Set()).add(name);\n this.markProps(node);\n }\n\n removeClass(node: EngineNode, name: string): void {\n node.classes?.delete(name);\n this.markProps(node);\n }\n\n /**\n * The sheet of the component `node` hosts, whose `:host` rules it matches. Set again when a hot\n * swap replaces the component's sheet, which recreates the views inside but not the host, so the\n * host is styled afresh here.\n */\n setHostSheet(node: EngineNode, sheet: StyleSheet | null): void {\n if (node.hostSheet === sheet) return;\n node.hostSheet = sheet;\n this.watchActive(sheet);\n this.markProps(node);\n }\n\n /**\n * Style for `node` that any matched rule or inline style overrides, as a browser's own default\n * for an element is. `mount` gives the root component's host the surface's height this way, as\n * the web's mount point has, unless the app's `:host` sizes it otherwise.\n */\n setDefaultStyle(node: EngineNode, style: Readonly<Record<string, unknown>> | undefined): void {\n node.defaultStyle = style;\n this.markProps(node);\n }\n\n /** `class=\"a b\"` from a template. Replaces the set rather than adding to it. */\n setClasses(node: EngineNode, value: string): void {\n const names = value.split(/\\s+/).filter(Boolean);\n node.classes = names.length ? new Set(names) : null;\n this.markProps(node);\n }\n\n /** Angular's `@if`/`@for`/`ViewContainerRef` markers. Ordered, never committed. */\n createAnchor(): EngineNode {\n return new RetainedNode('anchor', '#anchor', this);\n }\n\n createText(value: string): EngineNode {\n const node = new RetainedNode('text', '#text', this);\n node.text = value;\n return node;\n }\n\n appendChild(parent: EngineNode, child: EngineNode): void {\n this.detach(child);\n child.parent = parent;\n parent.children.push(child);\n if (child.dormantHoists) this.wakeHoists(child);\n this.markStructure(parent, child);\n this.markTextContent(parent, child);\n }\n\n insertBefore(parent: EngineNode, child: EngineNode, ref: EngineNode | null): void {\n this.detach(child);\n child.parent = parent;\n const at = ref ? parent.children.indexOf(ref) : -1;\n if (at < 0) parent.children.push(child);\n else parent.children.splice(at, 0, child);\n if (child.dormantHoists) this.wakeHoists(child);\n this.markStructure(parent, child);\n this.markTextContent(parent, child);\n }\n\n removeChild(parent: EngineNode | null, child: EngineNode): void {\n const target = parent ?? child.parent;\n if (!target) return;\n const at = target.children.indexOf(child);\n if (at < 0) return;\n target.children.splice(at, 1);\n child.parent = null;\n this.removedSinceCommit.add(child);\n this.markStructure(target, child);\n this.markTextContent(target, child);\n }\n\n /**\n * A child came or went under a view that takes its text as a prop: that prop changed. A span\n * changes it too, by keeping or dropping the space before it.\n */\n private markTextContent(parent: EngineNode, child: EngineNode): void {\n if (child.kind !== 'anchor' && takesTextAsProp(parent)) this.markProps(parent);\n }\n\n /** A subtree that went out of the tree is back in: its hoisted nodes commit again. */\n private wakeHoists(node: EngineNode): void {\n for (const hoisted of node.dormantHoists!) this.hoisted.add(hoisted);\n node.dormantHoists = null;\n }\n\n /**\n * Let go of everything the engine holds for nodes that have left the tree.\n *\n * Removal is the only signal a destroyed subtree reliably sends. Angular calls `destroyNode` for\n * the top-level nodes of the view it destroys and not for anything inside a child component's\n * view, so a screen's own template is never told it is gone. A reference the engine keeps to any\n * one node of such a subtree keeps all of it, because a node reaches every other node of its\n * subtree through its parent and children, and each of those holds its committed Fabric handle,\n * which keeps its native shadow node alive. A screen with a header was retained in full that way,\n * every native node of it, for as long as the app ran.\n *\n * Removal is not destruction, though: a detached screen can be put back, and must come back\n * whole. So a hoisted node moves to the root of the subtree it left with, which is garbage along\n * with it if the subtree never returns, and is handed back when it does. An animation on a node\n * out of the tree stops rather than running a frame loop for something nobody can see, and\n * starts again if the node returns. And a node out of the tree when the commit runs forgets its\n * committed views, as a withheld modal does: the commit unmounts them, Fabric never re-enables an\n * unmounted view's events (`EventEmitter::setEnabled`), and committed again they would ignore\n * every touch. It comes back created afresh, as React creates an element it mounts again. One\n * put back before the commit never left, and keeps its views.\n *\n * Once per commit, and only after a removal: the walks are the depth of a handful of nodes, and\n * forgetting walks each subtree that left once.\n */\n private releaseDetached(): void {\n this.forgetDetached();\n for (const node of this.hoisted) {\n const top = this.topOf(node);\n if (top === this.root) continue;\n this.hoisted.delete(node);\n (top.dormantHoists ??= []).push(node);\n }\n for (const node of this.playing) {\n if (this.topOf(node) === this.root) continue;\n this.playing.delete(node);\n node.playing = undefined;\n this.markProps(node, false);\n }\n this.releasePlayedNatively();\n for (const nodes of this.scrollTimelines.values()) {\n for (const node of nodes) {\n if (this.topOf(node) === this.root) continue;\n this.stopScrolled(node);\n this.markProps(node, false);\n }\n }\n if (this.focusedNode && this.topOf(this.focusedNode) !== this.root) this.focusedNode = null;\n }\n\n /** Forget the committed views of each node removed since the last commit that is still out. */\n private forgetDetached(): void {\n for (const node of this.removedSinceCommit) {\n if (node.committed && this.topOf(node) !== this.root) this.forgetCommitted(node);\n }\n this.removedSinceCommit.clear();\n }\n\n /** The root of the tree a node is in: the engine's root while it is attached. */\n private topOf(node: EngineNode): EngineNode {\n let top = node;\n while (top.parent) top = top.parent;\n return top;\n }\n\n /**\n * Angular calls this per node on view destroy, but only when `Renderer2.destroyNode` is\n * non-null. Without it the listener sets on discarded nodes stay reachable from the\n * closures Angular hands us, which is a slow leak on any screen that churns views.\n */\n destroyNode(node: EngineNode): void {\n node.listeners?.clear();\n node.listeners = null;\n // With what it holds: a node Angular destroys can be put back, as content projected into\n // an `@if` is, and its children's views would then be handed to the view it is made again\n // as. Native gives a view one parent for its life, and aborts on a second.\n if (node.committed) this.forgetCommitted(node);\n node.transitions = undefined;\n if (node.playing) this.stopNative(node, node.playing);\n node.playing = undefined;\n this.stopScrolled(node);\n this.running.delete(node);\n this.playing.delete(node);\n this.hoisted.delete(node);\n node.kept = undefined;\n // A field popped with the keyboard up never sends its blur.\n if (this.focusedNode === node) this.focusedNode = null;\n }\n\n parentNode(node: EngineNode): EngineNode | null {\n return node.parent;\n }\n\n nextSibling(node: EngineNode): EngineNode | null {\n const siblings = node.parent?.children;\n if (!siblings) return null;\n return siblings[siblings.indexOf(node) + 1] ?? null;\n }\n\n setProp(node: EngineNode, key: string, value: unknown): void {\n // A prop written again is a binding's, and is committed as any other is.\n if (node.attributeOnly?.delete(key)) this.markProps(node, false);\n if (value === undefined || value === null) {\n // Nothing to remove, so nothing changed. Worth its own branch because it is the common\n // case, not a rare one: a host primitive carries a host binding for every prop React Native\n // reads, so every element on screen writes some thirty of these on every pass, and the\n // work being skipped is a walk to the root marking ancestors dirty.\n if (!(key in node.props)) return;\n delete node.props[key];\n } else {\n if (node.props[key] === value) return;\n node.props[key] = value;\n }\n // Inline style is applied after the cascade and inherited by nothing, so it cannot change\n // what any node matches or inherits. Every other prop can: `[disabled]` is a selector. An\n // inline `direction` is the exception, because the paragraphs below it align by it.\n this.markProps(node, key !== 'style' || this.inlineReachesStyle(node));\n }\n\n /**\n * Paint a node's background on one of its children instead of on the node: the node keeps its\n * `background-color` and `background-image` in the cascade, where a stylesheet wrote them, and\n * the child is the view that draws them. What a view that masks its children and not itself\n * needs, as `<gradient-text>` is.\n */\n paintOn(node: EngineNode, child: EngineNode): void {\n node.paintsOn = child;\n this.markProps(node, false);\n this.markProps(child, false);\n }\n\n /**\n * Keep a prop the node already has as an attribute: on the node for a selector such as\n * `:host([variant='primary'])` to match, and left out of what is committed to the native view.\n * It is committed again once the prop is next written. What the platform adapter does with a\n * static attribute that is an input of the host's component.\n */\n keepAsAttribute(node: EngineNode, key: string): void {\n if (!(key in node.props)) return;\n (node.attributeOnly ??= new Set()).add(key);\n this.markProps(node, false);\n }\n\n /**\n * Whether a node's inline style can change what it or anything below it resolves to: it sets,\n * or until now set, a property its children inherit.\n */\n private inlineReachesStyle(node: EngineNode): boolean {\n const inherits = setsInherited(node.props['style']);\n const inherited = node.inlineInherits === true;\n node.inlineInherits = inherits;\n return this.noteInlineDirection(node) || inherits || inherited;\n }\n\n /** Whether a node's inline style sets `direction`, remembering that one has. */\n private noteInlineDirection(node: EngineNode): boolean {\n const style = node.props['style'];\n if (!style || (typeof style === 'object' && !Array.isArray(style) && !('direction' in style))) {\n return false;\n }\n if (flattenStyle(style, {})['direction'] === undefined) return false;\n this.inlineDirection = true;\n return true;\n }\n\n /**\n * The style object a node already holds has been changed in place.\n *\n * Angular's styling instructions set one property at a time, so a style of ten properties would\n * otherwise mean ten copies of a growing object per element. The adapter owns the object it put\n * there and may write into it; this is how it says so, since nothing about the object's identity\n * has changed for the props diff to notice.\n */\n styleChanged(node: EngineNode): void {\n this.markProps(node, this.inlineReachesStyle(node));\n }\n\n /**\n * A bound declaration, `[style.color]`, whose value may be a `var()`. One that is, is kept as a\n * declaration the cascade settles with the node's tokens, as a rule's is, and true is answered:\n * the text is no value to put in the node's style. Any other value forgets what was kept.\n */\n setBoundStyle(node: EngineNode, prop: string, value: unknown): boolean {\n const text = typeof value === 'string' && /^\\s*var\\(/i.test(value) ? value : undefined;\n const bound =\n text === undefined ? null : boundDeclaration(prop, tokenFromValue(text), node.name);\n if (!bound && !node.boundByProp?.has(prop)) return false;\n const byProp = (node.boundByProp ??= new Map());\n if (bound) byProp.set(prop, bound);\n else byProp.delete(prop);\n node.boundStyle = byProp.size ? [...byProp.values()] : null;\n this.markProps(node);\n return bound !== null;\n }\n\n /**\n * Set a custom property on a node, `--tint` from `[style.--tint]`, or remove it with `null`.\n *\n * Not a prop: Fabric has no such thing, and would be sent one. It is a token for the cascade,\n * converted from the value here because nothing built it ahead of time (`inline-token.ts`), and\n * changing it re-resolves the node and so everything under it.\n */\n setCustomProperty(node: EngineNode, name: string, value: unknown): void {\n const token = value === null || value === undefined ? undefined : tokenFromValue(value);\n const current = node.customProperties;\n if (!token) {\n if (!current || !(name in current)) return;\n const { [name]: _removed, ...rest } = current;\n node.customProperties = Object.keys(rest).length ? rest : null;\n } else {\n node.customProperties = { ...current, [name]: token };\n }\n this.markProps(node);\n }\n\n setText(node: EngineNode, value: string): void {\n node.text = value;\n this.markProps(node);\n if (node.parent) this.markTextContent(node.parent, node);\n }\n\n setEventListener(\n node: EngineNode,\n topLevelType: string,\n fn: (event: unknown) => void,\n ): () => void {\n this.registerEventHandler();\n\n const optIn =\n EVENT_OPT_IN_PROPS[topLevelType] ?? VIEW_EVENT_OPT_IN_PROPS[viewNameOf(node)]?.[topLevelType];\n if (optIn && node.props[optIn] !== true) this.setProp(node, optIn, true);\n\n const listeners = (node.listeners ??= new Map());\n let set = listeners.get(topLevelType);\n if (!set) listeners.set(topLevelType, (set = new Set()));\n set.add(fn);\n return () => set.delete(fn);\n }\n\n // --- dirty marking ----------------------------------------------------\n\n private markProps(node: EngineNode, affectsStyle = true): void {\n node.propsDirty = true;\n // Classes, `nativeID` and anything else a selector can read live in props, so any of them\n // changing can change what this node matches, and through it what its whole subtree does.\n // Marking only when it can is what keeps an animated `[style]` from re-cascading everything\n // beneath it on every frame.\n if (affectsStyle) {\n node.styleDirty = true;\n // `.peer:focus ~ .label`: what a later sibling matches can hang on this node's classes and\n // state, though nothing about the sibling moved. Only sheets that ask about siblings pay.\n if (this.structuralSheets) this.markLaterSiblings(node);\n if (this.hasSheets) this.markBeneath(node.parent);\n }\n // The root has no parent to carry the mark, so it carries its own: `.dark` on the root alone\n // restyles everything beneath it.\n this.markPath(node.parent ?? node);\n }\n\n /** Start matching ancestors again on a change, once a sheet that uses `:has()` is in play. */\n private watchHas(sheet: StyleSheet | null | undefined): void {\n if (!sheet?.has || this.hasSheets) return;\n this.hasSheets = true;\n this.styles.tracksHas = true;\n // What is already resolved kept no record of the rules it matched: resolve it again. Nothing\n // is, when the sheet is the one the engine was made with.\n if (!this.root) return;\n this.root.styleDirty = true;\n this.markPath(this.root);\n }\n\n /**\n * Something at or beneath `from` changed: every node from there up may match a `:has()` rule\n * it did not, or stop matching one. They are matched again rather than marked for restyling,\n * which would restyle everything under them. Only sheets that use `:has()` pay.\n */\n private markBeneath(from: EngineNode | null): void {\n for (let node = from; node; node = node.parent) node.hasDirty = true;\n }\n\n private markLaterSiblings(node: EngineNode): void {\n const siblings = node.parent?.children;\n if (!siblings) return;\n for (let i = siblings.indexOf(node) + 1; i < siblings.length; i++) {\n siblings[i]!.styleDirty = true;\n }\n }\n\n /** `node`'s child list changed: `moved` came into it or went out of it. */\n private markStructure(node: EngineNode, moved: EngineNode): void {\n node.structureDirty = true;\n // A child list that moved changes what its members match, though nothing about them did:\n // the old last row is no longer the last. Only sheets that ask about position pay for this.\n if (this.structuralSheets) {\n node.styleDirty = true;\n for (const child of node.children) child.styleDirty = true;\n // `.box:empty + .spacer`: what a later sibling matches can hang on whether this node is\n // empty, which only its first child arriving or its last one leaving changes.\n if (wasOrIsEmptyWithout(node, moved)) this.markLaterSiblings(node);\n }\n if (this.hasSheets) this.markBeneath(node);\n this.markPath(node.parent);\n }\n\n /** Walk up until we hit a node already known to have a dirty subtree. */\n private markPath(node: EngineNode | null): void {\n const wasClean = !this.root.structureDirty && !this.root.subtreeDirty;\n for (let current = node; current && !current.subtreeDirty; current = current.parent) {\n current.subtreeDirty = true;\n }\n // The tree has just gone from clean to dirty. Inside a change-detection pass that means\n // nothing, because the pass ends in a commit; outside one it means the change has no commit\n // coming, and the host has to arrange a frame.\n if (wasClean && this.root.subtreeDirty) this.onDirty?.();\n }\n\n private isClean(node: EngineNode): boolean {\n return (\n node.committed !== null && !node.propsDirty && !node.structureDirty && !node.subtreeDirty\n );\n }\n\n // --- commit -----------------------------------------------------------\n\n /**\n * Incremental: clone only what changed and reuse untouched subtrees by reference. A full\n * rebuild would mint fresh shadow nodes for every node on every tick, which drops scroll\n * offset, text cursor and keyboard focus. That is a correctness requirement, not an\n * optimisation.\n */\n commit(): boolean {\n if (this.removedSinceCommit.size) this.releaseDetached();\n // The root is never reconciled itself, so it has no `committed` record and `isClean` would\n // always say dirty. Ask the flags directly, or every change-detection pass ends in a\n // completeRoot that changes nothing: during a fling that is one wasted native commit per\n // frame, since any listener firing marks the view for refresh.\n this.settleCreated();\n if (!this.root.structureDirty && !this.root.subtreeDirty) return false;\n\n const started = now();\n // One epoch per commit. Node props do not change while a commit runs, so every node can be\n // resolved once and shared with each of its descendants for the length of this walk.\n this.styleEpoch++;\n // Faces registered before the walk, the global sheet's among them, reach every node in it.\n this.facesAdded = false;\n const set = this.fabric.createChildSet(this.rootTag);\n for (const child of this.visibleChildren(this.root)) {\n if (this.withheld(child)) continue;\n this.fabric.appendChildToSet(set, this.reconcileUnder(this.root, child));\n }\n this.clearFlags(this.root);\n this.fabric.completeRoot(this.rootTag, set);\n\n const elapsed = now() - started;\n this.stats.commits++;\n this.stats.lastCommitMs = elapsed;\n if (this.stats.commits === 1) {\n this.stats.firstCommitMs = elapsed;\n } else {\n if (elapsed > this.stats.worstCommitMs) this.stats.worstCommitMs = elapsed;\n if (elapsed > FRAME_BUDGET_MS) this.stats.slowCommits++;\n }\n\n this.flushTransitionEvents();\n this.scrollDriver?.afterCommit();\n // Read first: the commit that settles keyframes starts by clearing it.\n const facesAdded = this.facesAdded;\n if (this.awaitingKeyframes.size) this.settleKeyframes();\n if (facesAdded) this.rematchFonts();\n return true;\n }\n\n /** The first commit whose new views have not been drawn yet, while `commitUnseen` runs. */\n private unseen = Infinity;\n\n /**\n * A commit for what changed in the same turn as earlier commits, before a frame was drawn.\n * `since` is how many commits there had been before the first of them (`stats.commits`).\n *\n * A view those commits created has not been seen in the style they gave it, so what this one\n * gives it is where it starts, and no transition runs toward it. That is what a browser\n * does with a class added to an element in the turn that inserted it, and what `animate.enter`\n * is built on: Angular adds the enter class after the render pass that created the element, and\n * takes it off a frame later, which is the one change the transition is for.\n */\n commitUnseen(since: number): boolean {\n this.unseen = since;\n try {\n return this.commit();\n } finally {\n this.unseen = Infinity;\n }\n }\n\n /** Nodes that asked for `@keyframes` this commit had not met, by the name they asked for. */\n private readonly awaitingKeyframes = new Map<EngineNode, string>();\n\n /**\n * A sheet is registered when the first node it styles is committed, so a node committed before\n * it can name keyframes that arrive later in the same commit. Those nodes play them from another\n * commit straight away, as a browser applies keyframes however the sheets arrived; a name still\n * unknown once the commit is over is reported.\n */\n private settleKeyframes(): void {\n const waiting = [...this.awaitingKeyframes];\n this.awaitingKeyframes.clear();\n let found = false;\n for (const [node, name] of waiting) {\n if (this.keyframes.has(name)) {\n this.markProps(node, false);\n found = true;\n } else if (this.dev) {\n this.reportMissingKeyframes(name);\n }\n }\n if (found) this.commit();\n }\n\n private readonly scrollDriver: NativeScrollDriver | null;\n\n /** Whether native can move a view by a scroll with no JavaScript in between. */\n get drivesScroll(): boolean {\n return this.scrollDriver !== null;\n }\n\n /** See `HostEngine.driveByScroll`. The connection waits for a commit of both views. */\n driveByScroll(\n view: EngineNode,\n scroll: EngineNode,\n axis: ScrollAxis,\n range: ScrollRange,\n statics: readonly StaticTransform[] = [],\n ): ScrollDrive | null {\n const property = axis === 'x' ? 'translateX' : 'translateY';\n return this.driveByEvent(view, scroll, scrollFeed(axis), property, range, statics);\n }\n\n /** See `HostEngine.driveByEvent`. */\n driveByEvent(\n view: EngineNode,\n source: EngineNode,\n feed: EventFeed,\n property: DrivenProperty,\n range: ScrollRange,\n statics: readonly StaticTransform[] = [],\n shift: number | null = null,\n ): ScrollDrive | null {\n if (!this.scrollDriver) return null;\n // As Animated does: Fabric flattens a view that only lays out, and then there is no native\n // view for the animation to move.\n this.setProp(view, 'collapsable', false);\n return this.scrollDriver.drive(\n view,\n source,\n feed,\n property,\n range,\n statics,\n (node) => (node as EngineNode).committed?.tag ?? null,\n shift,\n );\n }\n\n /**\n * `transitionstart` and `transitionend`, for anything listening.\n *\n * Angular's `animate.enter` and `animate.leave` are built on these: they add a class, wait for\n * the transition it starts, and clean up when it ends. Nothing native emits them - there is no\n * CSS animation in React Native to emit them - so the engine that runs the transition is what\n * says when one began and ended.\n */\n /** Created since the last commit and waiting to settle. See `HostEngine.settle`. */\n private unsettled: Settling[] = [];\n\n settle(target: Settling): void {\n this.unsettled.push(target);\n }\n\n /**\n * Let every element created since the last commit write what its inputs say. One that was\n * checked already has, and answers at once; one whose view is detached writes its props here,\n * so the commit that first mounts it carries them.\n */\n private settleCreated(): void {\n if (this.unsettled.length === 0) return;\n const created = this.unsettled;\n this.unsettled = [];\n for (const target of created) target.settleProps();\n }\n\n private readonly transitionEvents: { node: EngineNode; type: string; property: string }[] = [];\n\n private emitTransition(node: EngineNode, type: string, property: string): void {\n if (!node.listeners?.has(type)) return;\n this.transitionEvents.push({ node, type, property });\n }\n\n /**\n * After the commit, never during it: a listener is free to add a class or drop an element, and\n * a tree that changes halfway through being walked is the one thing a commit cannot survive.\n */\n private flushTransitionEvents(): void {\n if (this.transitionEvents.length === 0) return;\n for (const { node, type, property } of this.transitionEvents.splice(0)) {\n for (const listener of [...(node.listeners?.get(type) ?? [])]) {\n listener(animationEvent(type, node, property));\n }\n }\n }\n\n /** Anchors take part in sibling ordering but never reach Fabric. */\n private visibleChildren(node: EngineNode): EngineNode[] {\n // A view that takes its text as a prop has no text children to commit. See `ViewNameOptions`.\n const textAsProp = takesTextAsProp(node);\n return node.children.filter(\n (child) => child.kind !== 'anchor' && !(textAsProp && child.kind === 'text'),\n );\n }\n\n /**\n * Everything a node renders with, unprocessed. Precedence, weakest first: native defaults, the\n * node's `defaultStyle`, matched CSS, explicit props, inline style, a component's\n * `styleOverride`. Inline wins over CSS for the same reason it does on the web.\n *\n * Raw, because this is what the next commit diffs against. Colours and asset ids are converted\n * on the way out instead (`processed`), and only for the keys that changed: the converters\n * return fresh objects, so diffing their output would re-send every image and shadow on every\n * unrelated change.\n */\n private mergeProps(node: EngineNode, viewName: string): Record<string, unknown> {\n if (node.kind === 'text') return { text: paragraphText(node) };\n if (this.dev) this.checkProps(node);\n this.registerSheet(node.sheet);\n this.registerSheet(node.hostSheet);\n const props: Record<string, unknown> = { ...DEFAULT_PROPS[viewName], ...node.defaultStyle };\n Object.assign(props, this.styles.resolve(node, this.styleEpoch).style);\n const resolved = props['pointerEvents'];\n writeOwnProps(node.props, props, node.attributeOnly);\n withTextContent(node, viewName, props);\n const cascaded = props['transform'];\n const style = boundTransform(node, flattenStyle(node.props['style'], props), cascaded);\n if (node.props['style']) {\n this.styles.overOtherForms(flattenStyle(node.props['style'], {}), style);\n }\n nativePointerEvents(node, style, resolved);\n // Before an image's own size: `fit-content` is no size, so the image's is what it gets.\n fitContent(node, style);\n percentHeight(node, style);\n const intrinsic = node.props[INTRINSIC_SIZE] as IntrinsicSize | undefined;\n if (intrinsic) applyIntrinsicSize(style, intrinsic);\n flattenStyle(node.props[STYLE_OVERRIDE], style);\n this.fontFaces.apply(style);\n holdLoadingFamily(node, style);\n if (viewName === PARAGRAPH) alignText(style, this.directionOf(node, style));\n if (this.fontsRefreshed) this.capForFonts(node, style);\n alignMultiline(viewName, style);\n const merged = composeTransform(node, this.animated(node, this.transitioned(node, style)));\n centreSingleLine(viewName, merged, this.fontScale);\n this.movePaint(node, merged);\n return merged;\n }\n\n /**\n * Leave a node's background out of what it commits when a child paints it, and give that child\n * its parent's: the cascade's, and over it the parent's inline style.\n */\n private movePaint(node: EngineNode, merged: Record<string, unknown>): void {\n if (node.paintsOn) for (const key of PAINT_KEYS) delete merged[key];\n const from = node.parent?.paintsOn === node ? node.parent : null;\n if (!from) return;\n const paint = flattenStyle(from.props['style'], {\n ...this.styles.resolve(from, this.styleEpoch).style,\n });\n for (const key of PAINT_KEYS) if (paint[key] !== undefined) merged[key] = paint[key];\n }\n\n /**\n * A container whose direction or alignment changed since a child with a `fit-content` size\n * read it, or whose height stopped or started being one a percentage is taken of since a child\n * with a percentage height asked: those children are merged again. A change to a container\n * marks nothing beneath it, since none of these is inherited.\n */\n private refitChildren(node: EngineNode): void {\n // Both are asked, and both remembered, before either has the children merged again.\n const basis = node.heightBasis;\n const based = basis !== undefined && definiteHeight(node) !== basis;\n const fitted = node.fitContainer !== undefined && containerOf(node) !== node.fitContainer;\n if (fitted) node.fitContainer = containerOf(node);\n if (based || fitted) this.refit(node);\n }\n\n /** Have a container's children merged again, through any `display: contents` among them. */\n private refit(container: EngineNode): void {\n for (const child of container.children) {\n if (child.kind !== 'element') continue;\n child.propsDirty = true;\n if (containerOf(child) === 'contents') this.refit(child);\n }\n }\n\n /**\n * The text size cap that lays a paragraph or text input out again once a face it names has\n * registered: a step per face above the app's own cap where it set one (below 1 is none, on\n * both platforms), or above any text size there is. Counted per view, so an app's cap moves by\n * a step for each face its text names and no further. See `fontsRegistered`.\n */\n private capForFonts(node: EngineNode, props: Record<string, unknown>): void {\n const refreshes = this.fontRefreshes.get(node);\n if (refreshes === undefined) return;\n const own = props['maxFontSizeMultiplier'];\n props['maxFontSizeMultiplier'] =\n (typeof own === 'number' && own >= 1 ? own : UNCAPPED) + refreshes * FONT_REFRESH_STEP;\n }\n\n /** Set once any node has had a `direction` in its inline style. See `directionOf`. */\n private inlineDirection = false;\n\n /**\n * The direction a paragraph is laid out in, where the app wrote one: its own, or the nearest\n * ancestor's. Undefined when nothing above it says, which leaves the platform's own.\n *\n * A stylesheet's `direction` is inherited through the cascade, so it is already in `props`. An\n * inline one is not, and is found by walking up, which only happens once some node has had one.\n */\n private directionOf(node: EngineNode, props: Record<string, unknown>): TextDirection | undefined {\n const own = textDirection(props['direction']);\n if (!this.inlineDirection) return own;\n for (let at: EngineNode | null = node; at; at = at.parent) {\n const inline = textDirection(flattenStyle(at.props['style'], {})['direction']);\n if (inline) return inline;\n const cascaded = textDirection(at.styleCache?.style['direction']);\n if (cascaded && cascaded !== textDirection(at.parent?.styleCache?.style['direction'])) {\n return cascaded;\n }\n }\n return own;\n }\n\n /**\n * Hold back what a transition is meant to ease into.\n *\n * Called with everything the node would otherwise commit with, so a property is compared\n * against the last value aimed at rather than the last one painted: a transition redirected\n * halfway carries on from where it had got to instead of snapping.\n *\n * A property seen for the first time is recorded and left alone. That is CSS's own rule, and\n * without it every element would fade in from whatever the previous value happened to be.\n */\n /**\n * Take a sheet's `@keyframes` and `@font-face` rules into the registries. Cheap and idempotent;\n * sheets are few.\n */\n private registerSheet(sheet: StyleSheet | null | undefined): void {\n if (!sheet || this.knownSheets.has(sheet)) return;\n this.knownSheets.add(sheet);\n this.sheetOrder.push(sheet);\n for (const name of Object.keys(sheet.keyframes ?? {})) {\n this.keyframes.set(name, sheet.keyframes![name]!);\n }\n if (sheet.fonts && this.fontFaces.add(sheet.fonts)) this.facesAdded = true;\n }\n\n /**\n * A hot swap edited a component's sheet into `next`, or took it away with null: `sheet`'s\n * `@keyframes` go, and `next`'s take its place among the others, as an edited stylesheet keeps\n * its place in a document. A name another sheet also defines falls back to that one. Every\n * animation re-resolves the name it plays, so one whose keyframes went stops, as in a browser.\n * A `sheet` already gone, such as a global sheet removed, leaves `next` registered last.\n */\n sheetReplaced(sheet: StyleSheet, next: StyleSheet | null): void {\n if (sheet === next && this.knownSheets.has(sheet)) return;\n this.unwatchActive(sheet);\n this.watchActive(next);\n const at = this.sheetOrder.indexOf(sheet);\n if (at === -1) {\n this.registerSheet(next);\n return;\n }\n this.knownSheets.delete(sheet);\n if (next && !this.knownSheets.has(next)) {\n this.knownSheets.add(next);\n this.sheetOrder[at] = next;\n } else {\n this.sheetOrder.splice(at, 1);\n }\n if (sheet.keyframes || next?.keyframes) this.reindexKeyframes();\n if (sheet.fonts || next?.fonts) this.reindexFonts();\n }\n\n /**\n * Every sheet's `@font-face` rules again, in order, and every text that names a family matched\n * again: a face whose rule went is no longer matched, though the platform keeps it registered.\n */\n private reindexFonts(): void {\n this.fontFaces.clear();\n for (const sheet of this.sheetOrder) if (sheet.fonts) this.fontFaces.add(sheet.fonts);\n this.markFontText(this.root);\n }\n\n /** Every sheet's `@keyframes` again, in order, and every animation told to look them up. */\n private reindexKeyframes(): void {\n this.keyframes.clear();\n for (const sheet of this.sheetOrder) {\n for (const name of Object.keys(sheet.keyframes ?? {})) {\n this.keyframes.set(name, sheet.keyframes![name]!);\n }\n }\n this.markAnimated(this.root);\n }\n\n /** Mark every node under `node` with an animation, so it looks its keyframes up again. */\n private markAnimated(node: EngineNode): void {\n for (const child of node.children) {\n if (child.playing || child.scrolled) this.markProps(child, false);\n this.markAnimated(child);\n }\n }\n\n /** Every `@font-face` seen, global as on the web: a face declared in one sheet serves all. */\n private readonly fontFaces = new FontFaces();\n /** Whether a sheet first used in this commit declared a face. See `rematchFonts`. */\n private facesAdded = false;\n\n /**\n * Faces a sheet declared partway through a commit: text resolved before it, in this commit or\n * an earlier one, matched without them. Resolve every text naming a family again, and commit.\n * Once per sheet that declares faces, so walking the tree costs nothing that matters.\n */\n private rematchFonts(): void {\n this.markFontText(this.root);\n this.commit();\n }\n\n /** Mark every element under `node` committed with a family, so it is matched again. */\n private markFontText(node: EngineNode): void {\n const named = (text: EngineNode | undefined): void => {\n if (typeof text?.committed?.props['fontFamily'] === 'string') this.markProps(text, false);\n };\n for (const child of node.children) {\n // The paragraph of a run of text written straight into a view is kept on the text.\n if (child.kind === 'text') named(child.box);\n if (child.kind !== 'element') continue;\n named(child);\n this.markFontText(child);\n }\n }\n\n private readonly knownSheets = new WeakSet<StyleSheet>();\n\n /**\n * Start, advance or stop the `@keyframes` animation a node's style asks for.\n *\n * Unlike a transition this does not need anything to have changed: an animation plays from its\n * own frames, which is what lets an element animate in without differing from anything.\n */\n private animated(node: EngineNode, props: Record<string, unknown>): Record<string, unknown> {\n const spec = animationOf(props);\n\n // One played by a scroll that is no longer asked for, whatever is asked for instead.\n if (node.scrolled && !spec?.timeline) this.stopScrolled(node);\n if (!spec) {\n if (node.playing) {\n this.cancelPlaying(node);\n node.playing = undefined;\n this.playing.delete(node);\n }\n return props;\n }\n\n const frames = this.keyframes.get(spec.name);\n if (!frames) {\n // Keyframes a hot swap deleted, from under an animation that was playing them, or ones a\n // sheet later in this commit has: see `settleKeyframes`.\n this.cancelPlaying(node);\n node.playing = undefined;\n this.playing.delete(node);\n this.stopScrolled(node);\n this.awaitingKeyframes.set(node, spec.name);\n return props;\n }\n if (spec.timeline) return this.scrollAnimated(node, spec, frames, props);\n this.startPlaying(node, spec, frames, props);\n return Object.assign(props, node.playing?.values ?? {});\n }\n\n /**\n * A clock animation the scroll plays instead: the same animation where only the timeline moved,\n * and one cancelled where the name changed.\n */\n private handOverToScroll(node: EngineNode, spec: AnimationSpec): void {\n if (!node.playing) return;\n this.stopNative(node, node.playing);\n if (node.playing.spec.name !== spec.name) this.cancelPlaying(node);\n node.playing = undefined;\n this.playing.delete(node);\n }\n\n /**\n * `animationcancel` for an animation stopped before it ended: the element no longer asks for it,\n * asks for another by name, or its keyframes went, as a browser fires it.\n */\n private cancelPlaying(node: EngineNode): void {\n const running = node.playing;\n if (running) this.stopNative(node, running);\n if (running && !running.done)\n this.emitTransition(node, 'topAnimationcancel', running.spec.name);\n }\n\n /** Stop on native each animation whose view has left the tree. */\n private releasePlayedNatively(): void {\n for (const node of [...this.playedNatively]) {\n if (this.topOf(node) === this.root) continue;\n this.stopNative(node, node.playing!);\n node.playing = undefined;\n this.markProps(node, false);\n }\n }\n\n /** Every node whose animation native is playing, with no frame of it in JavaScript. */\n private readonly playedNatively = new Set<EngineNode>();\n\n /**\n * Hand an animation that has just started to native, where native can play it: one that moves\n * only opacity and transforms, starts at once, and repeats a whole number of times. Native then\n * runs it frame by frame, and JavaScript hears of it again when it ends. Anything else is\n * played from here, a commit a frame. See `NativeScrollDriver.play`.\n */\n private playNatively(\n node: EngineNode,\n running: RunningAnimation,\n props: Record<string, unknown>,\n ): boolean {\n const { spec } = running;\n if (!this.scrollDriver || spec.delay !== 0 || spec.duration <= 0) return false;\n const { channels, held, span } = clockChannels(running.tracks, spec, props);\n if (held.length || !(channels.opacity || channels.transform.length)) return false;\n // There and back is one native animation: an odd number of ways has no whole number of them.\n const count = spec.iterations === null ? -1 : spec.iterations / span;\n if (count !== -1 && !(Number.isInteger(count) && count > 0)) return false;\n const length = Math.max(2, Math.round((spec.duration * span) / NATIVE_FRAME) + 1);\n const frames = Array.from({ length }, (_, i) => i / (length - 1));\n const native = this.scrollDriver.play(\n node,\n channels,\n { frames, toValue: span, iterations: count },\n (view) => this.tagOf(view as EngineNode),\n () => this.endedNatively(node, running),\n );\n if (!native) return false;\n running.native = native;\n // As Animated does: Fabric flattens a view that only lays out, and then there is no native\n // view for the animation to move.\n running.values = { ...running.values, collapsable: false };\n this.playedNatively.add(node);\n return true;\n }\n\n /**\n * Native reached the end of an animation it was playing. The frame it ends at, or the resting\n * style where it does not fill, is committed before the view is let go, so nothing shows of\n * the frame it started at, which is what the view had been committed with.\n */\n private endedNatively(node: EngineNode, running: RunningAnimation): void {\n if (node.playing !== running || !running.native) return;\n const { native, spec } = running;\n running.native = undefined;\n this.playedNatively.delete(node);\n const end = running.start + spec.duration * (spec.iterations ?? 1);\n this.advancePlayer(node, Math.max(this.now(), end));\n this.commit();\n native.stop();\n }\n\n /** Take an animation back from native, which stops it there. The caller plays it on, or not. */\n private stopNative(node: EngineNode, running: RunningAnimation): void {\n if (!running.native) return;\n running.native.stop();\n running.native = undefined;\n this.playedNatively.delete(node);\n }\n\n /**\n * Play on from JavaScript an animation native was playing, from where its clock has got to:\n * what a pause, other frames or a view made again need, none of which native can be told of.\n */\n private backToScript(node: EngineNode, running: RunningAnimation): void {\n if (!running.native) return;\n this.stopNative(node, running);\n running.values = sample(running, this.now()).values;\n if (!running.done && running.pausedAt === undefined) this.playing.add(node);\n }\n\n /** Start the clock on an animation, unless the node is already playing this one. */\n private startPlaying(\n node: EngineNode,\n spec: AnimationSpec,\n frames: readonly Keyframe[],\n props: Record<string, unknown>,\n ): void {\n const current = node.playing;\n const inherited = this.inheritedColour(node, frames);\n if (!current || !sameAnimation(current.spec, spec)) {\n if (current && current.spec.name !== spec.name) this.cancelPlaying(node);\n else if (current) this.stopNative(node, current);\n const started: RunningAnimation = {\n spec,\n tracks: tracksOf(frames, props, inherited),\n inherited,\n start: this.now(),\n values: {},\n done: false,\n };\n // Sampled straight away, so the very commit that starts the animation paints its first\n // frame. Otherwise an element appears in its resting style for one frame and then jumps,\n // which is the flash this whole mechanism exists to avoid.\n //\n // A delayed animation therefore holds its first frame through the delay rather than the\n // resting style: `animation-fill-mode: backwards` behaviour, always. It is what an entrance\n // wants, and the alternative is the flash again.\n started.values = sample(started, this.now()).values;\n this.playedFrames.set(started, frames);\n node.playing = started;\n if (spec.paused) started.pausedAt = this.now();\n else if (!this.playNatively(node, started, props)) this.playing.add(node);\n this.emitTransition(node, 'topAnimationstart', spec.name);\n return;\n }\n // A view made again is another view: the one native was moving is gone.\n if (node.committed === null) this.backToScript(node, current);\n if (this.playedFrames.get(current) !== frames || inherited !== current.inherited) {\n this.backToScript(node, current);\n this.reframe(node, current, frames, props, inherited);\n }\n this.playOrPause(node, node.playing!, spec);\n }\n\n /**\n * The colour `node` inherits, for frames that set `color: currentColor`, which is that colour\n * wherever the animation has got to, as in CSS. Undefined for frames that do not.\n */\n private inheritedColour(node: EngineNode, frames: readonly Keyframe[]): unknown {\n if (!readsInheritedColour(frames)) return undefined;\n const parent = node.parent && this.styles.resolve(node.parent, this.styleEpoch);\n return parent?.inherited['color'] ?? 'black';\n }\n\n /**\n * The name an animation plays now has other frames: a hot swap edited them, or took away the\n * sheet whose copy won. Or the colour its `color: currentColor` stands for has changed. It\n * carries on along the new tracks, on its own clock, as a browser does, paused or not.\n */\n private reframe(\n node: EngineNode,\n current: RunningAnimation,\n frames: readonly Keyframe[],\n props: Record<string, unknown>,\n inherited: unknown,\n ): void {\n const tracks = tracksOf(frames, props, inherited);\n const reframed: RunningAnimation = { ...current, tracks, inherited };\n const { values, finished } = sample(reframed, current.pausedAt ?? this.now());\n const holds = current.spec.fill === 'forwards' || current.spec.fill === 'both';\n reframed.values = finished && !holds ? {} : values;\n this.playedFrames.set(reframed, frames);\n node.playing = reframed;\n }\n\n /**\n * `animation-play-state` changed on an animation already playing: pausing holds the frame it\n * has reached, and running again carries on from there, the paused time left out of its clock.\n * Neither starts it over, as a change of play state does not in CSS.\n */\n private playOrPause(node: EngineNode, current: RunningAnimation, spec: AnimationSpec): void {\n current.spec = spec;\n const now = this.now();\n if (spec.paused && current.pausedAt === undefined && !current.done) {\n this.backToScript(node, current);\n current.pausedAt = now;\n this.playing.delete(node);\n } else if (!spec.paused && current.pausedAt !== undefined) {\n current.start += now - current.pausedAt;\n current.pausedAt = undefined;\n this.playing.add(node);\n }\n }\n\n /** Every node playing a scroll-driven animation, by the scroll view that plays it. */\n private readonly scrollTimelines = new Map<EngineNode, Set<EngineNode>>();\n /** How far each such scroll view scrolls, along each axis, once one of its events has said. */\n private readonly scrollExtents = new Map<EngineNode, { x: number; y: number }>();\n\n /**\n * An animation played by the nearest scroll view's offset: `animation-timeline: scroll()`.\n *\n * Its keyframes are laid along the offset and handed to native, which plays them as the view\n * scrolls, with no JavaScript between (`scroll-animation.ts`, `NativeScrollDriver.animate`).\n * The frame at the offset the view starts at is committed once and then left alone: a prop that\n * changed on a later commit would reset what native is animating.\n */\n private scrollAnimated(\n node: EngineNode,\n spec: AnimationSpec,\n frames: readonly Keyframe[],\n props: Record<string, unknown>,\n ): Record<string, unknown> {\n const current = node.scrolled;\n const inherited = this.inheritedColour(node, frames);\n if (current?.frames === frames && sameAnimation(current.spec, spec)) {\n return Object.assign(props, this.rescrolled(node, current, frames, props, inherited));\n }\n this.stopScrolled(node);\n this.handOverToScroll(node, spec);\n\n const tracks = tracksOf(frames, props, inherited);\n const source = this.scrollSourceOf(node);\n const extent = source ? (this.scrollExtents.get(source)?.[spec.timeline!] ?? null) : null;\n const range = rangeOf(spec, extent);\n const first: Record<string, unknown> = firstFrame(tracks, spec, range);\n const resting = { ...props };\n if (!source && this.dev) this.reportUnscrolled(spec.name);\n const drive = source ? this.driveScrolled(node, source, spec, tracks, resting, range) : null;\n // As Animated does: Fabric flattens a view that only lays out, and then there is no native\n // view for the animation to move. Committed with the first frame, so it stays put.\n if (drive) first['collapsable'] = false;\n node.scrolled = { spec, frames, tracks, resting, first, source, drive, inherited };\n return Object.assign(props, first);\n }\n\n /**\n * The first frame of a scroll-driven animation already playing. When the colour its\n * `color: currentColor` stands for has changed, that frame's colour is taken from tracks built\n * again. Native drives opacity and transforms only, so a colour holds its first frame, and\n * nothing native animates is touched.\n */\n private rescrolled(\n node: EngineNode,\n current: ScrollAnimation,\n frames: readonly Keyframe[],\n props: Record<string, unknown>,\n inherited: unknown,\n ): Record<string, unknown> {\n if (inherited === current.inherited) return current.first;\n // The element's own colour, which a track with no first frame starts at, may be the one it\n // inherits, so it is read again too.\n const resting = { ...current.resting, color: props['color'] };\n const tracks = tracksOf(frames, resting, inherited);\n const extent = current.source ? this.scrollExtents.get(current.source) : undefined;\n const range = rangeOf(current.spec, extent?.[current.spec.timeline!] ?? null);\n const first = { ...current.first };\n const colour = firstFrame(tracks, current.spec, range)['color'];\n if ('color' in first) first['color'] = colour;\n node.scrolled = { ...current, tracks, resting, first, inherited };\n return first;\n }\n\n /** Hand a scroll-driven animation's channels to native, fed by `source`'s scroll events. */\n private driveScrolled(\n node: EngineNode,\n source: EngineNode,\n spec: AnimationSpec,\n tracks: ScrollAnimation['tracks'],\n resting: Record<string, unknown>,\n range: readonly [number, number],\n ): ScrollAnimation['drive'] {\n if (!this.scrollDriver) return null;\n const { channels, held } = scrollChannels(tracks, spec, resting, range);\n if (held.length && this.dev) this.reportHeld(spec.name, held);\n let playing = this.scrollTimelines.get(source);\n if (!playing) this.scrollTimelines.set(source, (playing = new Set()));\n playing.add(node);\n return this.scrollDriver.animate(\n node,\n source,\n scrollFeed(spec.timeline!),\n channels,\n (one) => (one as EngineNode).committed?.tag ?? null,\n );\n }\n\n /** The scroll view a scroll-driven animation on `node` follows: the nearest one it is inside. */\n private scrollSourceOf(node: EngineNode): EngineNode | null {\n for (let up = node.parent; up; up = up.parent) {\n const name = viewNameOf(up);\n if (name === 'ScrollView' || name === 'AndroidHorizontalScrollView') return up;\n }\n return null;\n }\n\n private stopScrolled(node: EngineNode): void {\n const scrolled = node.scrolled;\n if (!scrolled) return;\n node.scrolled = undefined;\n scrolled.drive?.stop();\n if (scrolled.source) this.scrollTimelines.get(scrolled.source)?.delete(node);\n }\n\n /**\n * A scroll view has said how far it scrolls. Every animation on it with a range that depends on\n * that - none written, or a percentage - is laid out again along the new extent.\n */\n private measuredScroll(source: EngineNode, event: unknown): void {\n const { contentSize, layoutMeasurement } = (event ?? {}) as {\n contentSize?: { width: number; height: number };\n layoutMeasurement?: { width: number; height: number };\n };\n if (!contentSize || !layoutMeasurement) return;\n const extent = {\n x: Math.max(0, contentSize.width - layoutMeasurement.width),\n y: Math.max(0, contentSize.height - layoutMeasurement.height),\n };\n const known = this.scrollExtents.get(source);\n if (known && known.x === extent.x && known.y === extent.y) return;\n this.scrollExtents.set(source, extent);\n for (const node of this.scrollTimelines.get(source) ?? []) {\n const scrolled = node.scrolled;\n if (!scrolled?.drive) continue;\n const range = rangeOf(scrolled.spec, extent[scrolled.spec.timeline!]);\n scrolled.drive.update(\n scrollChannels(scrolled.tracks, scrolled.spec, scrolled.resting, range).channels,\n );\n }\n }\n\n private reportUnscrolled(name: string): void {\n if (this.reported.has(`scroll ${name}`)) return;\n this.reported.add(`scroll ${name}`);\n console.error(\n `[angular-native] '${name}' plays by animation-timeline: scroll(), but the element is not ` +\n `inside a scroll view, so nothing moves it. It shows its first frame.`,\n );\n }\n\n private reportHeld(name: string, properties: readonly string[]): void {\n if (this.reported.has(`held ${name}`)) return;\n this.reported.add(`held ${name}`);\n console.error(\n `[angular-native] '${name}' plays by a scroll, which native drives for opacity and ` +\n `transforms only. ${properties.join(', ')} holds its first frame.`,\n );\n }\n\n private reportMissingKeyframes(name: string): void {\n if (this.reported.has(`@keyframes ${name}`)) return;\n this.reported.add(`@keyframes ${name}`);\n console.error(\n `[angular-native] no @keyframes named '${name}'. Nothing animates, and the element ` +\n `renders with its resting style. Keyframes are global across every stylesheet the app ` +\n `has loaded, so the block has to exist somewhere by the time the animation starts.`,\n );\n }\n\n private transitioned(node: EngineNode, props: Record<string, unknown>): Record<string, unknown> {\n // Nobody saw what the last commit gave a view it created, so this is where the view starts.\n if (node.bornIn! >= this.unseen) node.transitions = undefined;\n const spec = transitionSpec(props);\n if (!spec && !node.transitions) return props;\n\n const state = (node.transitions ??= new Map());\n const now = this.now();\n\n // The properties a transition *names*, even where the node has none yet. A property is only\n // transitioned once it has been seen settling, and one that does not exist is never seen - so\n // `transition: transform` with no transform until a class adds one would arrive instantly,\n // which is the commonest way to write one. `all` names nothing, so it keeps the old rule.\n const named = spec ? Object.keys(spec).filter((key) => key !== 'all') : [];\n\n for (const key of new Set([...Object.keys(props), ...named])) {\n if (step(state, key, props, spec?.[key] ?? spec?.['all'], now)) {\n this.running.add(node);\n this.emitTransition(node, 'topTransitionstart', key);\n }\n }\n\n if (state.size === 0) node.transitions = undefined;\n return props;\n }\n\n /** One `@keyframes` player, one frame on. */\n private advancePlayer(node: EngineNode, now: number): void {\n const running = node.playing;\n if (!running) {\n this.playing.delete(node);\n return;\n }\n\n if (running.pausedAt !== undefined) {\n this.playing.delete(node);\n return;\n }\n const { values, finished } = sample(running, now);\n // Without a forwards fill a finished animation stops holding anything, and the element falls\n // back to whatever the cascade gives it. 'backwards' fills the start only.\n const holds = running.spec.fill === 'forwards' || running.spec.fill === 'both';\n running.values = finished && !holds ? {} : values;\n this.markProps(node, false);\n\n if (!finished) return;\n running.done = true;\n this.playing.delete(node);\n this.emitTransition(node, 'topAnimationend', running.spec.name);\n }\n\n /**\n * Late-bound because the host that wants the callback is usually built from this engine, so\n * neither can be constructed with the other in hand.\n */\n setOnDirty(fn: () => void): void {\n this.onDirty = fn;\n }\n\n /** Late-bound for the same reason: the app's `ErrorHandler` lives in an injector built later. */\n setOnError(fn: (error: unknown, topLevelType: string) => void): void {\n this.onError = fn;\n }\n\n /** Whether any transition or animation still has frames left to run. */\n get animating(): boolean {\n return this.running.size > 0 || this.playing.size > 0;\n }\n\n /**\n * Whether anything has changed since the last commit.\n *\n * The frame loop reads this because a `transitionend` listener runs after its commit has\n * finished, and what it does is often to remove the element that just finished leaving. That\n * change needs a commit of its own or the view stays on screen, fully transparent, forever.\n */\n get pending(): boolean {\n return this.root.structureDirty || this.root.subtreeDirty;\n }\n\n /**\n * Advance every transition to `now` and mark what changed. The caller commits afterwards; on a\n * device the platform pumps this from `requestAnimationFrame` for as long as it returns true.\n */\n advanceAnimations(now: number = this.now()): boolean {\n for (const node of [...this.playing]) this.advancePlayer(node, now);\n for (const node of [...this.running]) {\n let live = false;\n for (const [key, transition] of node.transitions ?? []) {\n if (transition.done) continue;\n const elapsed = now - transition.start;\n // Still inside the delay: nothing to paint yet, but the transition is not over.\n if (elapsed < 0) {\n live = true;\n continue;\n }\n const progress = transition.duration <= 0 ? 1 : Math.min(1, elapsed / transition.duration);\n if (progress >= 1) {\n transition.current = transition.to;\n transition.done = true;\n this.emitTransition(node, 'topTransitionend', key);\n } else {\n transition.current = interpolate(\n transition.from,\n transition.to,\n bezier(transition.easing, progress),\n );\n live = true;\n }\n this.markProps(node, false);\n }\n if (!live) this.running.delete(node);\n }\n return this.animating;\n }\n\n /** The host's conversions, applied to a copy. A removed prop travels as null and stays null. */\n private processed(props: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n const value = props[key];\n if (value === null || value === undefined) out[key] = value;\n else if (isColorProp(key)) out[key] = this.painted(key, value);\n // A list of sources has already been resolved by whoever built it, as RN's resolver\n // also assumes: it passes any object through and only turns a number into one.\n else if (ASSET_PROPS.has(key) && !Array.isArray(value))\n out[key] = this.resolveAssetSource(value);\n else if (NESTED_COLOR_LIST_PROPS.has(key)) out[key] = this.processNestedColors(value);\n else if (key === 'experimental_backgroundImage') out[key] = this.processGradients(value);\n else if (key === 'filter') out[key] = this.processFilters(value);\n // A bound style's transform is still the CSS string: see `inline-transform.ts`.\n else if (key === 'transform' && typeof value === 'string') out[key] = transformOf(value);\n else out[key] = value;\n }\n return out;\n }\n\n /** Copy a list of shadow-like objects, running each `color` through the host's converter. */\n private processNestedColors(value: unknown): unknown {\n if (!Array.isArray(value)) return value;\n return value.map((entry) => {\n const item = entry as Record<string, unknown>;\n if (item?.['color'] === undefined) return entry;\n return { ...item, color: this.color(item['color'] as string | number) };\n });\n }\n\n /**\n * Copy a filter list, running a drop shadow's colour through the host's converter. Android reads\n * that colour as a number and throws on a string, taking the whole surface down with it.\n */\n private processFilters(value: unknown): unknown {\n if (!Array.isArray(value)) return value;\n return value.map((entry) => {\n const shadow = (entry as { dropShadow?: Record<string, unknown> })?.dropShadow;\n if (shadow?.['color'] === undefined) return entry;\n return {\n dropShadow: { ...shadow, color: this.color(shadow['color'] as string | number) },\n };\n });\n }\n\n /**\n * Copy a list of gradients, running every stop's colour through the host's converter.\n *\n * A stop's colour is a colour like any other, but it is two levels down and nothing else looks\n * there: without this the device is handed the string `rgb(255, 0, 0)` where it wants a number,\n * and paints nothing. The stops are first rewritten so native's interpolation paints what\n * CSS's premultiplied one does (see `premultipliedStops`).\n */\n private processGradients(value: unknown): unknown {\n if (!Array.isArray(value)) return value;\n return value.map((entry) => {\n const gradient = entry as { colorStops?: { color?: unknown }[] };\n if (!Array.isArray(gradient?.colorStops)) return entry;\n return {\n ...gradient,\n colorStops: premultipliedStops(gradient.colorStops).map((stop) => ({\n ...stop,\n color: this.color(stop.color),\n })),\n };\n });\n }\n\n private clearFlags(node: EngineNode): void {\n node.propsDirty = false;\n node.structureDirty = false;\n node.subtreeDirty = false;\n }\n\n private reconcile(node: EngineNode): FabricNode {\n // A clean node can still need re-rendering: if an ancestor's class changed, what this node\n // inherits changed with it, and nothing marked this node dirty. The resolver hands back the\n // very same cache object when nothing has changed, so one reference comparison settles it,\n // and a subtree whose inherited context is unmoved is skipped exactly as before.\n const style = node.kind === 'element' ? this.styles.resolve(node, this.styleEpoch) : null;\n const styleChanged = node.styleCommitted !== style;\n if (this.isClean(node) && !styleChanged) return node.committed!.handle;\n node.styleCommitted = style;\n repaint(node);\n this.refitChildren(node);\n\n const viewName = committedViewName(node);\n this.forgetRenamed(node, viewName);\n const childHandles = this.reconcileChildren(node, viewName, style);\n noteTouches(node, style);\n const previous = node.committed;\n this.notePresented(node, viewName);\n if (!previous)\n return this.create(node, viewName, this.mergeProps(node, viewName), childHandles);\n\n // `propsDirty` is precise: Angular only calls setProperty when a binding actually changed.\n // It is not sufficient on its own, though. A node whose ancestor's class changed inherits\n // something new without any binding of its own having moved, so it is not propsDirty and\n // would never re-clone. `styleChanged` is the other half of that question. An ancestor that\n // is here only because something beneath it moved has the props it had.\n const propsMoved = node.propsDirty || styleChanged;\n const props = propsMoved ? this.mergeProps(node, viewName) : previous.props;\n const propsPayload = propsMoved ? this.propsPayload(node, previous.props, props) : null;\n\n const childrenChanged = this.childrenMoved(node, childHandles, previous.childHandles);\n\n let handle = previous.handle;\n if (childrenChanged || propsPayload) {\n handle = this.clone(\n previous.handle,\n propsPayload && this.processed(propsPayload),\n childrenChanged ? childHandles : null,\n );\n // A clone is the same view, so it keeps the tag it was created with, not the newest tag\n // handed out, which is some other node's.\n node.committed = { handle, tag: previous.tag, props, childHandles, viewName };\n }\n this.clearFlags(node);\n return handle;\n }\n\n /** What a clone sends: the props that changed, and a text input's font once it registered. */\n private propsPayload(\n node: EngineNode,\n previous: Record<string, unknown>,\n props: Record<string, unknown>,\n ): Record<string, unknown> | null {\n const payload = diffProps(previous, props);\n if (payload && this.fontsRefreshed && this.fontResends.delete(node)) {\n payload['fontFamily'] = props['fontFamily'];\n }\n return payload;\n }\n\n /**\n * Whether a node has to be committed with its children again.\n *\n * A child that re-cloned has a new handle, so the parent must re-clone too. This is the bubble\n * that persistent trees force, and it is why dirty marking propagates upwards. A node to be\n * measured again is cloned with its children even when they are the same ones: new children\n * is what makes Fabric dirty a measured node (`remeasureText`).\n */\n private childrenMoved(node: EngineNode, next: FabricNode[], previous: FabricNode[]): boolean {\n const remeasure = node.remeasure === true;\n node.remeasure = undefined;\n return remeasure || !sameHandles(next, previous);\n }\n\n /**\n * The handles of a node's children, reconciling only the ones that can have changed.\n *\n * One changed row in a list of a thousand makes the list re-clone, and the other 999 are asked\n * for their handle. A clean child whose style still holds under this node's is its committed\n * handle as it stands, so it is answered here without the call, the resolve and the walk -\n * which, per child, was most of what a one-row update cost.\n */\n private reconcileChildren(\n node: EngineNode,\n viewName: string,\n style: StyleCache | null,\n ): FabricNode[] {\n const context = style?.context;\n if (HOIST_TARGETS.has(node.name)) return this.reconcileHoistTarget(node, context);\n const handles: FabricNode[] = [];\n for (const child of node.children) {\n if (child.kind === 'anchor' || this.committedElsewhere(child) || this.withheld(child)) {\n continue;\n }\n if (child.kind === 'text') {\n const handle = this.reconcileText(node, child, viewName, context);\n if (handle) handles.push(handle);\n continue;\n }\n handles.push(this.reconcileUnder(node, child, context));\n }\n return handles;\n }\n\n /**\n * The paragraph a run of text written straight into a view is drawn in, or nothing for a run of\n * whitespace, which a browser draws nothing for between the items of a flex box either.\n *\n * It is the text's own, kept on the text node, and no part of the tree: its parent is the view,\n * so it inherits what the view's text would, and no rule matches it.\n */\n /**\n * A run of text under `parent`, which commits as `viewName`: the text itself inside a text, a\n * paragraph of its own inside any other view, and nothing where the view takes its text as a\n * prop (see `ViewNameOptions`) or the run is whitespace between a view's children.\n */\n private reconcileText(\n parent: EngineNode,\n text: EngineNode,\n viewName: string,\n context?: object,\n ): FabricNode | null {\n if (TEXT_CONTENT_PROPS[viewName] !== undefined) return null;\n if (viewName === PARAGRAPH || viewName === VIRTUAL_TEXT) {\n // Under a text element, the paragraph it had in a view is done with. Under that paragraph\n // itself, which is where a loose run is committed, it is the one to keep.\n if (text.box && text.box !== parent) text.box = undefined;\n return this.reconcileUnder(parent, text, context);\n }\n const box = this.looseText(parent, text);\n return box ? this.reconcileUnder(parent, box, context) : null;\n }\n\n private looseText(parent: EngineNode, text: EngineNode): EngineNode | null {\n if (!trimEnds(text.text)) return null;\n let box = text.box;\n if (!box) {\n box = new RetainedNode('element', 'text', this);\n box.anonymous = true;\n box.children = [text];\n text.box = box;\n }\n box.parent = parent;\n // The text is not under the box in the tree, so a change to it never marked the box.\n if (!this.isClean(text)) box.subtreeDirty = true;\n return box;\n }\n\n /** Remember an iOS modal host committed as showing, so hiding it waits for `topDismiss`. */\n private notePresented(node: EngineNode, viewName: string): void {\n if (viewName !== MODAL_HOST || node.props['visible'] === false) return;\n if (platformOS === 'ios') node.presented = true;\n }\n\n /**\n * Whether a child is left out of its parent's commit: a modal host whose `visible` is false.\n *\n * The native host covers the screen and takes every touch whether or not it presents anything,\n * which is why React Native's Modal.js renders null while hidden. This is the same thing, so a\n * hidden `<modal>` leaves the screen under it usable. On iOS a modal that was showing stays\n * committed, with `visible` false, until native reports `topDismiss`: Modal.js keeps it that\n * long so the dismissal animates and `(dismiss)` fires. Android drops it at once, as Modal.js\n * does there.\n *\n * A withheld host is unmounted, and Fabric drops an unmounted view's event target for good\n * (`EventEmitter::setEnabled`), so its committed handles are forgotten and it is created afresh\n * when it is shown again, as Modal.js creates it afresh. Committed again, it ignores every touch.\n */\n private withheld(child: EngineNode): boolean {\n if (child.props['visible'] !== false || child.presented) return false;\n if (viewNameOf(child) !== MODAL_HOST) return false;\n if (child.committed) this.forgetCommitted(child);\n return true;\n }\n\n /**\n * `reconcileChildren` for a node other nodes hoist into: its own children, each followed by\n * the hoisted nodes written inside it, then those written in it directly, then the views it\n * keeps for hoisted nodes that are gone.\n */\n private reconcileHoistTarget(node: EngineNode, context: object | undefined): FabricNode[] {\n const handles: FabricNode[] = [];\n const hoisted = this.hoistedInto(node);\n const landed = new Set<string>();\n // One written directly in the node goes after its siblings: a page writes its header first,\n // and UIKit collapses a large title against the scroll view down the screen's first subviews,\n // which RNS keeps clear by never letting the header config be the first.\n const direct: EngineNode[] = [];\n for (const child of node.children) {\n if (child.kind === 'anchor' || this.committedElsewhere(child) || this.withheld(child)) {\n continue;\n }\n if (this.hoisted.has(child)) direct.push(child);\n else handles.push(this.reconcileUnder(node, child, context));\n const moved = hoisted?.get(child);\n if (moved) for (const written of moved) handles.push(this.land(node, written, landed));\n }\n for (const child of direct) handles.push(this.land(node, child, landed));\n if (node.kept) this.standIn(node, landed, handles);\n return handles;\n }\n\n /**\n * A child's handle as a child of `parent`, created again when it was committed under another.\n *\n * Native gives a view one parent for as long as it lives: `ShadowNodeFamily::setParent`\n * asserts it in a debug build, and a release build keeps the first parent and measures and lays\n * the view out against the wrong ancestry. A node Angular moves - content projected into a\n * container that was mounted again, a scroll view Android wraps in its swipe layout - is\n * therefore created afresh, with everything under it, as React creates an element that moves.\n * Its native state goes with it, as it would there.\n */\n private reconcileUnder(parent: EngineNode, child: EngineNode, context?: object): FabricNode {\n if (child.committed && child.committedUnder !== parent) this.forgetCommitted(child);\n const handle = this.stillCommitted(child, context) ?? this.reconcile(child);\n child.committedUnder = parent;\n return handle;\n }\n\n /**\n * A node whose native view is no longer the one it was created as is created again: a text\n * element that came to hold a view, or stopped. A clone keeps the view it was made as.\n */\n private forgetRenamed(node: EngineNode, viewName: string): void {\n if (node.committed && node.committed.viewName !== viewName) this.forgetCommitted(node);\n }\n\n /**\n * Let a node and everything under it be created again at the next commit. The views it keeps\n * for hoisted names go too: they are children of the native view it is losing.\n */\n private forgetCommitted(node: EngineNode): void {\n node.committed = null;\n node.committedUnder = null;\n node.styleCommitted = null;\n node.kept = undefined;\n if (node.box?.committed) this.forgetCommitted(node.box);\n for (const child of node.children) {\n if (child.committed || child.box?.committed) this.forgetCommitted(child);\n }\n }\n\n /** A hoisted node, which commits into an ancestor further up than the parent it is in. */\n private committedElsewhere(child: EngineNode): boolean {\n return this.hoisted.has(child) && this.hoistsAbove(child);\n }\n\n /**\n * Reconcile a hoisted element committing into `target`, into the native view `target` already\n * keeps for its name when it has one (`HoistOptions.standIn`), and keep the view it commits as.\n */\n private land(target: EngineNode, child: EngineNode, landed: Set<string>): FabricNode {\n if (!STAND_INS[child.name]) return this.reconcileUnder(target, child);\n const kept = target.kept?.get(child.name);\n if (kept && kept.node !== child && child.committed === null && !isWithin(kept.node, target)) {\n // A node taken out without being destroyed would otherwise come back holding this tag too.\n if (kept.node) kept.node.committed = null;\n child.committed = kept.committed;\n child.propsDirty = true;\n }\n const handle = this.reconcile(child);\n child.committedUnder = target;\n (target.kept ??= new Map()).set(child.name, { node: child, committed: child.committed! });\n landed.add(child.name);\n return handle;\n }\n\n /**\n * Commit the stand-in props onto every view `target` keeps whose element is gone, on the view\n * itself so the native side sees an update rather than a removal.\n */\n private standIn(target: EngineNode, landed: Set<string>, handles: FabricNode[]): void {\n for (const [name, kept] of target.kept!) {\n if (landed.has(name)) continue;\n if (kept.node) {\n const props = {\n ...DEFAULT_PROPS[registeredViewName(name) ?? DEFAULT_VIEW],\n ...STAND_INS[name],\n };\n const payload = diffProps(kept.committed.props, props);\n const handle = this.clone(kept.committed.handle, payload && this.processed(payload), []);\n kept.committed = { ...kept.committed, handle, props, childHandles: [] };\n kept.node = null;\n }\n handles.push(kept.committed.handle);\n }\n }\n\n /** A clean child's committed handle, when its style still holds under its parent's. */\n private stillCommitted(child: EngineNode, context: object | undefined): FabricNode | null {\n const committed = child.committed;\n if (\n committed === null ||\n context === undefined ||\n child.propsDirty ||\n child.structureDirty ||\n child.subtreeDirty\n ) {\n return null;\n }\n if (child.kind === 'text') return committed.handle;\n const holds = child.styleCache === child.styleCommitted && this.styles.holds(child, context);\n return holds ? committed.handle : null;\n }\n\n /**\n * The hoisted nodes that commit as direct children of `node`, keyed by the child of `node` each\n * was written inside. Null when there are none, which is nearly always.\n */\n private hoistedInto(node: EngineNode): Map<EngineNode, EngineNode[]> | null {\n let found: Map<EngineNode, EngineNode[]> | null = null;\n for (const candidate of this.hoisted) {\n if (candidate.parent === node || HOISTS[candidate.name] !== node.name) continue;\n let written: EngineNode = candidate;\n let above = candidate.parent;\n while (above && above !== node && above.name !== node.name) {\n written = above;\n above = above.parent;\n }\n if (above !== node) continue;\n found ??= new Map();\n const list = found.get(written);\n if (list) list.push(candidate);\n else found.set(written, [candidate]);\n }\n return found;\n }\n\n /** Whether a hoisted node commits further up than the parent it was written in. */\n private hoistsAbove(node: EngineNode): boolean {\n const target = HOISTS[node.name];\n if (node.parent?.name === target) return false;\n for (let above = node.parent?.parent; above; above = above.parent) {\n if (above.name === target) return true;\n }\n return false;\n }\n\n private create(\n node: EngineNode,\n viewName: string,\n props: Record<string, unknown>,\n childHandles: FabricNode[],\n ): FabricNode {\n if (this.dev) {\n this.checkClaimed(node);\n this.checkKnown(node);\n }\n const tag = nextTag();\n this.stats.createdNodes++;\n // instanceHandle is the retained node itself: it is what Fabric hands back on events.\n const handle = this.fabric.createNode(tag, viewName, this.rootTag, this.processed(props), node);\n for (const child of childHandles) this.fabric.appendChild(handle, child);\n node.committed = { handle, tag, props, childHandles, viewName };\n node.bornIn = this.stats.commits;\n this.clearFlags(node);\n return handle;\n }\n\n /**\n * Angular's own unknown-element check does not run in this pipeline, so a `<text>` in a\n * template that never imported `Text` compiles, draws without the component, and looks like a\n * layout bug. On the first commit of any known element with no component behind it, say so.\n */\n private checkClaimed(node: EngineNode): void {\n // The paragraph the engine wraps loose text in is its own: no template wrote it.\n if (node.kind !== 'element' || node.claimed || node.anonymous) return;\n if (!PRIMITIVE_NAMES.has(node.name)) return;\n if (this.reported.has(node.name)) return;\n this.reported.add(node.name);\n console.error(\n `[angular-native] <${node.name}> is used in a template that does not import ` +\n `${className(node.name)}. Add it to the component's \\`imports\\` from ` +\n `'@ng-native/components'; without it the element has none of the component's inputs ` +\n `or behavior, so a prop written on it stays the text it was written as.`,\n );\n }\n\n /**\n * The misspelt-prop check. Angular's own \"Can't bind to\" check needs a DOM to run, so a\n * `[numberofLines]` on a `<text>`, or a static `iosBackgroundColor` on a `<switch>`, went to\n * native as a prop no view reads, and nothing said so. A prop on a host primitive that its\n * component did not declare is reported once per element name and prop, with the declared name\n * it most likely meant when there is one.\n */\n private readonly undefinedTokens = new Set<string>();\n\n /** Said once per name: a phone has no inspector to show the declaration struck out. */\n private reportUndefinedToken(name: string, props: readonly string[], on?: string): void {\n if (this.undefinedTokens.has(name)) return;\n this.undefinedTokens.add(name);\n // A bound declaration has no rule to be found by, so it says which element it is on.\n const where = on === undefined ? props.join(', ') : `${props.join(', ')}, bound on <${on}>,`;\n console.warn(\n `[angular-native] var(${name}) in ${where} names a custom property nothing in` +\n ` scope defines, so the declaration is dropped, as a browser drops it. Define ${name} on` +\n ` :root or an ancestor, or give the var() a fallback.`,\n );\n }\n\n private readonly unreadDisplays = new Set<string>();\n\n /**\n * Said once per token and value: the compiler refuses `display: grid` written out, but a token\n * is only known here, and without this the view lays out as flex with nothing said.\n */\n private reportUnreadDisplay(name: string, value: string | undefined): void {\n const report = `${name} ${value}`;\n if (this.unreadDisplays.has(report)) return;\n this.unreadDisplays.add(report);\n console.warn(\n `[angular-native] display: var(${name}) is ${value ?? 'no keyword'}, which is no display` +\n ` native has, so display is unset and the view lays out as flex. Native has flex, none` +\n ` and contents, and reads block, inline, inline-block, flow-root and inline-flex as flex.`,\n );\n }\n\n private checkProps(node: EngineNode): void {\n if (!node.claimed || !PRIMITIVE_NAMES.has(node.name)) return;\n const declared = DECLARED_PROPS.get(node.name);\n if (!declared) return;\n for (const key of Object.keys(node.props)) {\n if (this.isDeclared(declared, key, node.props[key])) continue;\n const report = `${node.name} ${key}`;\n if (this.reported.has(report)) continue;\n this.reported.add(report);\n const meant = [...declared].find((name) => name.toLowerCase() === key.toLowerCase());\n console.warn(\n `[angular-native] <${node.name}> has no prop '${key}', so native ignores it.` +\n (meant ? ` Did you mean '${meant}'?` : '') +\n ` Check the spelling against the ${className(node.name)} page, or declare it with` +\n ` declareNativeProps('${node.name}', ['${key}']) if the native view does read it.`,\n );\n }\n }\n\n private isDeclared(declared: Set<string>, key: string, value: unknown): boolean {\n return (\n declared.has(key) ||\n ENGINE_PROPS.has(key) ||\n this.declaredAttributes.has(key) ||\n // A forms directive's input has a report of its own, naming the import it is missing.\n isFormsInput(key) ||\n key.includes('-') ||\n // A bare marker attribute, `<text listHeader>`, is there for a selector to match.\n value === ''\n );\n }\n\n /**\n * Element names some template's directives select by tag: every component with an element\n * selector, and directives such as Angular's `router-outlet` that own an element without\n * hosting a component. Declared by the platform adapter, which sees each template's directive\n * registry as the component is created.\n */\n private readonly declaredElements = new Set<string>();\n\n /** An element name a directive or component selects, and so is not a typo. */\n declareElement(name: string): void {\n this.declaredElements.add(name);\n }\n\n /**\n * Attribute names that belong to Angular rather than to a native view: what a directive selects\n * on or takes as an input, and what a component's `<ng-content select>` projects by. Angular\n * writes a static attribute to the node whatever consumes it, so without these a\n * `nativeRouterLink` or a `listHeader` marker would read as a misspelt prop. See `checkProps`.\n */\n private readonly declaredAttributes = new Set<string>();\n\n declareAttribute(name: string): void {\n this.declaredAttributes.add(name);\n }\n\n /**\n * The typo check. The set a name is looked up in is app-wide rather than per template, so a\n * directive imported in one template also quiets its name in another that forgot it. That is\n * the trade for not holding a registry per component, and the typo is the case that matters.\n */\n private checkKnown(node: EngineNode): void {\n if (node.kind !== 'element' || node.componentHost || node.name in VIEW_NAMES) return;\n if (this.declaredElements.has(node.name) || this.reported.has(node.name)) return;\n this.reported.add(node.name);\n console.error(\n `[angular-native] <${node.name}> is not a known element: no component, directive or ` +\n `registered native view claims it, so it renders as an empty view. Check the spelling, ` +\n `or import the component that owns it.`,\n );\n }\n\n // --- responder system -------------------------------------------------\n\n private readonly responders = new WeakMap<EngineNode, ResponderHandlers>();\n private currentResponder: EngineNode | null = null;\n\n /** Register a node as a candidate responder. Returns an unsubscribe. */\n setResponder(node: EngineNode, handlers: ResponderHandlers): () => void {\n this.registerEventHandler();\n this.responders.set(node, handlers);\n this.keepNative(node, true);\n return () => {\n this.responders.delete(node);\n this.keepNative(node, false);\n if (this.currentResponder !== node) return;\n // Torn down under the finger: no release is coming, so the chain it marked is cleared\n // here or it stays `:active` for good.\n const changed = this.setActiveChain(node, false);\n this.tellNative(node, false);\n this.currentResponder = null;\n if (changed) this.commit();\n };\n }\n\n /**\n * Keep a native view for this node, or stop keeping one.\n *\n * Fabric flattens a view whose props say nothing visual and nothing interactive: no native view\n * is created and its layout is folded into the parent. Responders live here, in JavaScript, and\n * Fabric cannot see them - so a transparent touch-catcher looks exactly like a view worth\n * flattening, and gets flattened, and never receives the touch it exists to catch.\n *\n * That is a popover that will not close. The full-screen catcher over the app has no background\n * and nothing else on it; the dialog's backdrop survived the same treatment only because\n * `bg-black/50` happened to make it visual.\n *\n * Only plain views: flattening is `ViewShadowNode`'s, so a paragraph, a scroll view or a text\n * input is already a native view and marking it would be a prop on every text node in the tree\n * that buys nothing.\n *\n * A floor rather than an override: `collapsable=\"true\"` written on an element is left alone,\n * because someone who writes it means it.\n */\n private keepNative(node: EngineNode, keep: boolean): void {\n if (viewNameOf(node) !== DEFAULT_VIEW) return;\n if (keep) {\n if (node.props['collapsable'] === undefined) this.setProp(node, 'collapsable', false);\n return;\n }\n if (node.props['collapsable'] === false) this.setProp(node, 'collapsable', null);\n }\n\n /**\n * A view command, by name: `focus` and `blur` on a text input, `scrollTo` on a scroll view.\n * Fabric addresses the committed shadow node, so a node that has not reached a commit yet has\n * nothing to receive it and the call is dropped.\n */\n dispatchCommand(node: EngineNode, name: string, args: readonly unknown[] = []): void {\n const handle = node.committed?.handle;\n if (handle && this.fabric.dispatchCommand) this.fabric.dispatchCommand(handle, name, args);\n }\n\n /**\n * Where a node is, in window coordinates.\n *\n * `(layout)` reports a frame in the parent's coordinates, which sizes a view and says nothing\n * about where it is relative to anything else. This is what an anchored overlay needs: a\n * popover and its trigger live in different parts of the tree and can only be compared in the\n * window's frame.\n *\n * The callback is the platform's own shape rather than a promise, and on the new architecture\n * it fires before this returns - so a caller that needs the value immediately can capture it,\n * and one that does not is unaffected if that ever changes.\n *\n * Silent when the node has never been committed, or when the host has no `measureInWindow`.\n * Reporting zeroes would be worse than reporting nothing: a zero frame is a position, and an\n * overlay would believe it and place itself in the corner.\n */\n measure(node: EngineNode, into: (frame: WindowFrame) => void): void {\n const handle = node.committed?.handle;\n if (!handle || !this.fabric.measureInWindow) return;\n this.fabric.measureInWindow(handle, (x, y, width, height) => into({ x, y, width, height }));\n }\n\n /**\n * The react tag a node was committed with, or null if it has never reached a commit.\n *\n * This is what the native animation driver writes to: `connectAnimatedNodeToView` takes a tag,\n * and `findNodeHandle` hands a number straight back, so an animated graph can point at one of\n * our nodes without a React instance existing anywhere.\n */\n tagOf(node: EngineNode): number | null {\n return node.committed?.tag ?? null;\n }\n\n /**\n * The shadow node Fabric currently holds for a node, or null before its first commit.\n *\n * A clone-on-write tree hands back a different object every time a node's props change, so\n * this is not an identity. What is stable is the family behind it, which is what native keys a\n * node by, and is why a UI-thread animation given one of these keeps writing to the right view\n * however many times the node is cloned afterwards.\n */\n shadowNodeOf(node: EngineNode): FabricNode | null {\n return node.committed?.handle ?? null;\n }\n\n /** The node currently owning the gesture, if any. */\n get responder(): EngineNode | null {\n return this.currentResponder;\n }\n\n /**\n * The node native last reported focused, if any: the text input the keyboard belongs to.\n *\n * Checked against the tree rather than trusted, because a focused node that outlives its view\n * is not a stale style - it is every tap in the application being swallowed. Every scroll view\n * reads this on every touch to decide whether the touch means \"dismiss the keyboard\", and one\n * that decides yes *captures* the touch before any child sees it. So a field left focused after\n * its view is gone makes the whole app untappable until it is restarted.\n *\n * Neither teardown hook can be relied on to clear it. `removeChild` unlinks the subtree's root\n * and leaves everything under it pointing at its own parent, so a focused descendant still looks\n * attached; and Angular calls `destroyNode` for the nodes it tracks, not for every node in a\n * removed subtree. An overlay closing with a field inside it misses both.\n *\n * So it is answered by looking: a node still in the tree reaches the root by walking up. That\n * costs the depth of one node, on a touch, and only while something is focused.\n */\n get focused(): EngineNode | null {\n if (this.focusedNode && !this.isAttached(this.focusedNode)) this.focusedNode = null;\n return this.focusedNode;\n }\n\n /** Whether a node is still part of the tree, rather than in a subtree that was removed. */\n private isAttached(node: EngineNode): boolean {\n let current: EngineNode | null = node;\n while (current) {\n if (current === this.root) return true;\n current = current.parent;\n }\n return false;\n }\n\n /** The host's `resolveAssetSource`, for a component that needs an asset's size up front. */\n resolveAsset(value: unknown): unknown {\n return this.resolveAssetSource(value);\n }\n\n /**\n * A colour prop as native takes it. A shape's `fill` or `stroke` the cascade settled from a\n * token is the solid brush react-native-svg takes, and `none` no paint at all.\n */\n private painted(key: string, value: unknown): unknown {\n if (!BRUSH_PROPS.has(key)) return this.color(value);\n // Already a brush, as the icon wrote it: only one the cascade settled is still text.\n if (typeof value !== 'string') return value;\n return value === 'none' ? null : { type: 0, payload: this.color(value) };\n }\n\n /**\n * The host's `processColor`, and the one place a platform colour becomes one.\n *\n * Props are processed by name - anything ending in `color` - which covers every colour that is\n * a prop. A colour *nested* inside a prop native parses itself is invisible to that rule: a tab\n * bar's appearance carries eight of them, and unprocessed they arrive as strings native reads\n * as nothing at all. So this is public, and the commit walk uses it too.\n *\n * `platform-color(label)` cannot be resolved at build time - the same declaration is\n * `{semantic}` on iOS and `{resource_paths}` on Android - so the names travel and the shape is\n * put on here. `processColor` understands both, exactly as it does for RN's own `PlatformColor`.\n */\n color(value: unknown): unknown {\n if (value === undefined) return undefined;\n\n const names = (value as { platformColor?: readonly string[] })?.platformColor;\n if (!names) return this.processColor(value as string | number);\n\n const key = nativePlatform() === 'android' ? 'resource_paths' : 'semantic';\n return this.processColor({ [key]: [...names] } as never);\n }\n\n /** Root-first, so a capture pass reads forwards and a bubble pass reads backwards. */\n private pathTo(node: EngineNode): EngineNode[] {\n const path: EngineNode[] = [];\n for (let current: EngineNode | null = node; current; current = current.parent)\n path.push(current);\n return path.reverse();\n }\n\n private negotiate(\n target: EngineNode,\n event: ResponderEvent,\n phase: 'Start' | 'Move',\n ): EngineNode | null {\n const path = this.pathTo(target);\n const capture = `on${phase}ShouldSetResponderCapture` as const;\n const bubble = `on${phase}ShouldSetResponder` as const;\n\n // Capture runs root -> target, so an ancestor can claim before its children see it.\n for (const node of path) {\n if (this.responders.get(node)?.[capture]?.(event, target)) return node;\n }\n // Bubble runs target -> root: the innermost interested node wins.\n for (let i = path.length - 1; i >= 0; i--) {\n if (this.responders.get(path[i]!)?.[bubble]?.(event, target)) return path[i]!;\n }\n return null;\n }\n\n private grant(node: EngineNode, event: ResponderEvent): void {\n const previous = this.currentResponder;\n if (previous === node) return;\n\n if (previous) {\n const handlers = this.responders.get(previous);\n // An undefined handler means \"yes\": RN's default is to allow the takeover.\n if (handlers?.onResponderTerminationRequest?.(event) === false) return;\n this.tellNative(previous, false);\n handlers?.onResponderTerminate?.(event);\n }\n\n // After the takeover is agreed, not before: a refusal would otherwise leave `:active` on a\n // node that never became the responder. Both calls run, so neither is short-circuited away.\n const cleared = this.setActiveChain(previous, false);\n const marked = this.setActiveChain(node, true);\n\n this.currentResponder = node;\n this.tellNative(node, true);\n this.responders.get(node)?.onResponderGrant?.(event);\n if (cleared || marked) this.commit();\n }\n\n private release(event: ResponderEvent, terminated: boolean): void {\n const node = this.currentResponder;\n if (!node) return;\n const changed = this.setActiveChain(node, false);\n this.currentResponder = null;\n this.tellNative(node, false);\n const handlers = this.responders.get(node);\n if (terminated) handlers?.onResponderTerminate?.(event);\n else handlers?.onResponderRelease?.(event);\n if (changed) this.commit();\n }\n\n private tellNative(node: EngineNode, isResponder: boolean): void {\n const handle = node.committed?.handle;\n if (!handle || !this.fabric.setIsJSResponder) return;\n const block = this.responders.get(node)?.blockNativeResponder ?? false;\n this.fabric.setIsJSResponder(handle, isResponder, block);\n }\n\n /** Runs before listener propagation, as React's responder plugin does. */\n private runResponder(target: EngineNode, type: string, event: ResponderEvent): void {\n if (type === TOUCH_START) {\n const elected = this.negotiate(target, event, 'Start');\n if (elected) this.grant(elected, event);\n return;\n }\n if (type === TOUCH_MOVE) {\n if (this.currentResponder) {\n this.responders.get(this.currentResponder)?.onResponderMove?.(event);\n } else {\n const elected = this.negotiate(target, event, 'Move');\n if (elected) this.grant(elected, event);\n }\n return;\n }\n if (type === TOUCH_END) this.release(event, false);\n else if (type === TOUCH_CANCEL) this.release(event, true);\n }\n\n // --- events -----------------------------------------------------------\n\n private registerEventHandler(): void {\n if (this.eventsRegistered || !this.fabric.registerEventHandler) return;\n this.eventsRegistered = true;\n this.fabric.registerEventHandler((instanceHandle, topLevelType, nativeEvent) =>\n this.dispatchEvent(instanceHandle, topLevelType, nativeEvent),\n );\n }\n\n /**\n * Fabric's `(instanceHandle, topLevelType, nativeEvent)` callback.\n *\n * **Events propagate up the retained tree.** Fabric hands JS only the hit target; React\n * implements two-phase propagation itself by walking the fiber tree, and so must we. Without\n * it a tap on a `<text>` label inside a `<pressable>` reaches the text node and stops, so the\n * button only responds on its padding. That reads as \"taps sometimes do not register\".\n *\n * ponytail: event priority (`unstable_getCurrentEventPriority` and the\n * `unstable_*EventPriority` constants) is read into the facade but not acted on. Angular's\n * zoneless scheduler already flushes on a microtask, which is soon enough for taps. It stops\n * being soon enough for a controlled TextInput, where the echo has to beat the next\n * keystroke. `mostRecentEventCount` covers that today by letting native reject a stale write;\n * a synchronous flush for discrete priority is the fix if it ever stops being enough.\n *\n * **Nothing thrown here may escape.** Fabric calls this synchronously from C++\n * (`UIManagerBinding::dispatchEventToJS`), often from inside a mounting transaction, and a throw\n * unwinds through that transaction: for a screen push the next commit then reads props freed on\n * the way out and the process dies with no JS stack at all. Angular\n * already catches what its own template listeners throw; everything else on this path - the\n * responder handlers, listeners registered on the engine directly, a commit started by a focus\n * change - is caught here and handed to `onError`, which the platform points at the app's\n * `ErrorHandler`. Each listener is guarded on its own, so one that throws does not stop the\n * bubble for the rest, as in the DOM.\n */\n dispatchEvent(instanceHandle: unknown, topLevelType: string, nativeEvent: unknown): void {\n const target = instanceHandle as EngineNode | null;\n this.trace(target, topLevelType);\n\n // Listeners get RN's documented shape, `{nativeEvent}`. Fabric hands us the payload bare;\n // React wraps it in a synthetic event and every RN API is written against `event.nativeEvent`,\n // so handlers ported from RN would silently read undefined otherwise.\n const event = new SyntheticEvent(nativeEvent, target);\n\n try {\n if (topLevelType === 'topDismiss' && target) this.dismissed(target);\n if (topLevelType === 'topScroll' && target && this.scrollTimelines.has(target)) {\n this.measuredScroll(target, nativeEvent);\n }\n this.trackFocus(target, topLevelType);\n if (target) this.cancelPressForScroll(target, topLevelType, event as ResponderEvent);\n if (target) this.runResponder(target, topLevelType, event as ResponderEvent);\n } catch (error) {\n this.reportEventError(error, topLevelType);\n }\n this.propagate(target, topLevelType, event);\n }\n\n /** A presented modal host has finished leaving, so a hidden one can come out of the tree. */\n private dismissed(target: EngineNode): void {\n if (!target.presented) return;\n target.presented = undefined;\n if (target.props['visible'] === false) this.markProps(target, false);\n }\n\n private reportEventError(error: unknown, topLevelType: string): void {\n if (this.onError) {\n this.onError(error, topLevelType);\n return;\n }\n console.error(`[angular-native] an error was thrown while dispatching ${topLevelType}`, error);\n }\n\n /**\n * A list that scrolls under a finger takes the touch away from whatever it started on.\n *\n * Distance alone cannot tell a scroll from a tap. The press rect is the control's own bounds\n * plus a retention offset, which is right - a 15pt threshold cancels an ordinary thumb tap on a\n * full-width button - but on a 72pt list row it means a 72pt drag still counts as a tap, and a\n * 72pt drag is unmistakably a scroll. So the list is asked instead of the arithmetic: it knows\n * it is scrolling, and every platform cancels the touch at that moment.\n *\n * Only a responder *inside* the thing that scrolled, so a scroll view moving does not cancel a\n * press somewhere else on screen. And only while a touch is in progress: momentum after the\n * finger has lifted, and programmatic scrolling, have no press to cancel.\n */\n private cancelPressForScroll(target: EngineNode, type: string, event: ResponderEvent): void {\n if (!SCROLL_CANCELS_PRESS.has(type)) return;\n const responder = this.currentResponder;\n if (!responder || responder === target) return;\n for (let node: EngineNode | null = responder; node; node = node.parent) {\n if (node === target) {\n this.release(event, true);\n return;\n }\n }\n }\n\n /**\n * Tell \"the native side never sent it\" from \"it arrived and nothing was listening\", which are\n * otherwise identical symptoms. One line per event, so it is off unless asked for.\n */\n private trace(target: EngineNode | null, topLevelType: string): void {\n if (!(globalThis as { __angularNativeEventLog?: boolean }).__angularNativeEventLog) return;\n let matched = 0;\n for (let n = target; n; n = DIRECT_EVENTS.has(topLevelType) ? null : n.parent) {\n matched += n.listeners?.get(topLevelType)?.size ?? 0;\n }\n console.log('[event]', topLevelType, target?.name ?? '(no handle)', matched);\n }\n\n /**\n * `:focus` follows the native events rather than being inferred from a tap, so it is right for a\n * field focused programmatically or by the keyboard's next-field button.\n */\n private trackFocus(target: EngineNode | null, topLevelType: string): void {\n if (topLevelType === 'topFocus') this.setFocused(target);\n else if (topLevelType === 'topBlur' && this.focusedNode === target) this.setFocused(null);\n }\n\n /** Walk target to root. Fabric hands JS only the hit target; the propagation is ours to do. */\n private propagate(target: EngineNode | null, topLevelType: string, event: SyntheticEvent): void {\n for (let node = target; node; node = node.parent) {\n const listeners = node.listeners?.get(topLevelType);\n if (listeners) {\n for (const fn of [...listeners]) {\n try {\n fn(event);\n } catch (error) {\n this.reportEventError(error, topLevelType);\n }\n }\n }\n if (DIRECT_EVENTS.has(topLevelType) || event.isPropagationStopped()) return;\n }\n }\n\n /**\n * Clone a committed node with whatever changed. Fabric's persistent tree has no in-place edit:\n * a new revision is a new node, which is why a changed child forces its parent to clone too.\n *\n * `children` is null when the child list is unchanged, in which case Fabric keeps the previous\n * revision's children and there is nothing to append.\n *\n * Otherwise this clones the way React does: the no-children form, then `appendChild` per child.\n * Omitting the child list gives the clone *empty* children, not the old ones, and whether a\n * binding takes that argument cannot be feature-detected - `UIManagerBinding.cpp` registers\n * both clone methods with a fixed `paramCount` and argument validation is commented out - so\n * `fn.length` says nothing. One code path, no detection.\n */\n private clone(\n previous: FabricNode,\n props: Record<string, unknown> | null,\n children: FabricNode[] | null,\n ): FabricNode {\n this.stats.clonedNodes++;\n\n if (children === null) return this.fabric.cloneNodeWithNewProps(previous, props!);\n\n const handle = props\n ? this.fabric.cloneNodeWithNewChildrenAndProps(previous, props)\n : this.fabric.cloneNodeWithNewChildren(previous);\n for (const child of children) this.fabric.appendChild(handle, child);\n return handle;\n }\n\n private detach(child: EngineNode): void {\n if (child.parent) this.removeChild(child.parent, child);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,KAAK,EACL,eAAe,EACf,aAAa,EACb,aAAa,EACb,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,YAAY,GAQb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EACL,cAAc,EACd,MAAM,EACN,WAAW,EACX,oBAAoB,EACpB,MAAM,EACN,IAAI,EACJ,WAAW,EACX,QAAQ,GAMT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,UAAU,GAQX,MAAM,mBAAmB,CAAC;AAO3B,OAAO,EACL,aAAa,EACb,UAAU,EACV,YAAY,EACZ,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,uB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gBACd,KAAK,MAAM,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;oBAChC,IAAI,CAAC;wBACH,EAAE,CAAC,KAAK,CAAC,CAAC;oBACZ,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;oBAC7C,CAAC;gBACH,CAAC;YACH,CAAC;YACD,IAAI,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,oBAAoB,EAAE;gBAAE,OAAO;QAC9E,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;OAYG;IACK,KAAK,CACX,QAAoB,EACpB,KAAqC,EACrC,QAA6B;QAE7B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAEzB,IAAI,QAAQ,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,KAAM,CAAC,CAAC;QAElF,MAAM,MAAM,GAAG,KAAK;YAClB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,gCAAgC,CAAC,QAAQ,EAAE,KAAK,CAAC;YAC/D,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;QACnD,KAAK,MAAM,KAAK,IAAI,QAAQ;YAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrE,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,MAAM,CAAC,KAAiB;QAC9B,IAAI,KAAK,CAAC,MAAM;YAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;CACF","sourcesContent":["/**\n * Framework-agnostic retained tree + incremental Fabric commit.\n * Nothing Angular-specific may enter this file; lint bans the import (see docs/ARCHITECTURE.md).\n *\n * Angular mutates; Fabric is persistent. A committed node is never mutated, it is cloned with\n * new props and/or a new child set. Cloning a leaf therefore forces every ancestor to re-clone,\n * because a persistent parent holds references to specific child handles. That bubble is\n * inherent and is what React's own Fabric renderer does.\n */\n\nimport {\n boundDeclaration,\n faded,\n fills,\n inlineInherited,\n setsInherited,\n StyleResolver,\n usesActive,\n elementsAtEnd,\n placeReadElsewhere,\n siblingReach,\n type Compound,\n type Conditions,\n type DeferredDeclaration,\n type StyleCache,\n type StyleSheet,\n type Subjects,\n type TokenValue,\n} from './css.ts';\nimport { applyAria } from './aria-props.ts';\nimport { STYLED_ELEMENTS } from './element-styles.ts';\nimport {\n animationEvent,\n bezier,\n interpolate,\n readsInheritedColour,\n sample,\n step,\n steppedKeys,\n tracksOf,\n type AnimationSpec,\n type Keyframe,\n type RunningAnimation,\n type Transition,\n type TransitionSpec,\n} from './transition.ts';\nimport { isFormsInput } from './forms-inputs.ts';\nimport { transformList } from './inline-transform.ts';\nimport { tokenFromValue } from './inline-token.ts';\nimport {\n NativeScrollDriver,\n scrollFeed,\n type DrivenProperty,\n type EventFeed,\n type NativeAnimated,\n type ScrollAxis,\n type ScrollDrive,\n type ScrollRange,\n type StaticTransform,\n} from './native-drive.ts';\nimport type { DrivenChannels } from './scroll-animation.ts';\n\nexport type FabricNode = { readonly __fabricNode: unique symbol } | object;\n\n/** Where a node is, in the window's coordinates. What `Engine.measure` reports. */\nimport type { HostEngine, HostNode, Settling } from './host.ts';\nimport {\n clockChannels,\n firstFrame,\n movesByShare,\n rangeOf,\n scrollChannels,\n sharesAsPoints,\n} from './scroll-animation.ts';\nimport { FontFaces } from './font-faces.ts';\nimport { premultipliedStops } from './premultiplied-stops.ts';\n\n/**\n * The animation a node's style asks for, with a play state from a rule of its own applied. Both\n * are instructions for this engine and nothing native has heard of them, so they come out of the\n * props; only when there, because a `delete` sends an object to Hermes's slow dictionary layout,\n * and this runs for every node that commits.\n */\nfunction animationOf(props: Record<string, unknown>): AnimationSpec | undefined {\n let spec = props['$animation'] as AnimationSpec | undefined;\n if (spec !== undefined) delete props['$animation'];\n for (const [key, field] of Object.entries(ANIMATION_PARTS)) {\n if (!(key in props)) continue;\n const value = props[key];\n delete props[key];\n if (spec && value !== null) spec = { ...spec, ...animationPart(field, value) };\n }\n return spec;\n}\n\nconst ANIMATION_PARTS = {\n $animationDuration: 'duration',\n $animationDelay: 'delay',\n $animationEasing: 'easing',\n $animationIterations: 'iterations',\n $animationDirection: 'direction',\n $animationFill: 'fill',\n $playState: 'paused',\n} as const;\n\nfunction animationPart(\n field: (typeof ANIMATION_PARTS)[keyof typeof ANIMATION_PARTS],\n value: unknown,\n): Partial<AnimationSpec> {\n switch (field) {\n case 'iterations':\n return { iterations: value === 'infinite' ? null : (value as number) };\n case 'direction':\n return {\n direction: value === 'normal' ? undefined : (value as AnimationSpec['direction']),\n };\n case 'paused':\n return { paused: value === 'paused' ? true : undefined };\n default:\n return { [field]: value };\n }\n}\n\n/**\n * Whether two specs ask for the same animation. By what they say rather than which object they\n * are: a spec with a token in its timing is settled afresh each time the node's style is, and an\n * animation that started again on every such commit would never get past its first frame.\n */\nfunction sameAnimation(a: AnimationSpec, b: AnimationSpec): boolean {\n if (a === b) return true;\n return (\n SPEC_FIELDS.every((field) => a[field] === b[field]) &&\n a.easing.join() === b.easing.join() &&\n a.range?.start === b.range?.start &&\n a.range?.end === b.range?.end\n );\n}\n\nconst SPEC_FIELDS = [\n 'name',\n 'duration',\n 'delay',\n 'iterations',\n 'fill',\n 'direction',\n 'timeline',\n] as const satisfies readonly (keyof AnimationSpec)[];\n\n/** A node's scroll-driven animation: what it plays, what drives it, and the frame it commits. */\ninterface ScrollAnimation {\n readonly spec: AnimationSpec;\n /** The `@keyframes` it was laid out from, so a hot swap that edits them lays it out again. */\n readonly frames: readonly Keyframe[];\n readonly tracks: ReadonlyMap<string, readonly { offset: number; value: unknown }[]>;\n readonly resting: Record<string, unknown>;\n readonly first: Record<string, unknown>;\n /** The colour the node inherits, which the tracks were built with, for frames that read it. */\n readonly inherited: unknown;\n readonly source: EngineNode | null;\n readonly drive: { update(channels: DrivenChannels): void; stop(): void } | null;\n}\n\nexport interface WindowFrame {\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n}\nexport type FabricNodeSet = unknown;\n\n/** The slice of `global.nativeFabricUIManager` we actually use. */\nexport interface FabricUIManager {\n createNode(\n reactTag: number,\n viewName: string,\n rootTag: number,\n props: object,\n instanceHandle: unknown,\n ): FabricNode;\n /** Clone with the *given* children (omitting the argument means none) and the same props. */\n cloneNodeWithNewChildren(node: FabricNode): FabricNode;\n /** Clone with the given props and the *same* children. */\n cloneNodeWithNewProps(node: FabricNode, newProps: object): FabricNode;\n /** Clone with the given props and the given children (omitting them means none). */\n cloneNodeWithNewChildrenAndProps(node: FabricNode, newProps: object): FabricNode;\n appendChild(parent: FabricNode, child: FabricNode): FabricNode;\n createChildSet(rootTag: number): FabricNodeSet;\n appendChildToSet(set: FabricNodeSet, child: FabricNode): void;\n completeRoot(rootTag: number, set: FabricNodeSet): void;\n registerEventHandler?(\n handler: (instanceHandle: unknown, topLevelType: string, nativeEvent: unknown) => void,\n ): void;\n /** Tells the native side that JS owns the gesture, and whether to stop its own. */\n setIsJSResponder?(node: FabricNode, isResponder: boolean, blockNativeResponder: boolean): void;\n /** A view command: `focus` on a text input, `scrollTo` on a scroll view. */\n dispatchCommand?(node: FabricNode, name: string, args: readonly unknown[]): void;\n /**\n * A node's frame in window coordinates, which is the only frame two nodes can be compared in.\n *\n * Optional because an older host may not have it, and because the callback is the platform's\n * own shape: on the new architecture it fires before this returns, which is what lets an\n * overlay place itself in the same frame it was opened in.\n */\n measureInWindow?(\n node: FabricNode,\n onSuccess: (x: number, y: number, width: number, height: number) => void,\n ): void;\n}\n\n/**\n * The scroll events that mean a finger is dragging the list rather than tapping something in it.\n *\n * `topScrollBeginDrag` is the precise one; `topScroll` is here because a scroll view configured\n * without drag events still reports movement, and a press surviving that is the bug either way.\n */\nconst SCROLL_CANCELS_PRESS = new Set(['topScroll', 'topScrollBeginDrag']);\n\n/**\n * RN's `directEventTypes`: delivered to the target only, never up the tree. Everything else\n * bubbles, which matches RN's `bubblingEventTypes` for the touch and input events that matter.\n * The web host's engine reads this set too, so both hosts deliver an event the same way.\n *\n * ponytail: a hand-kept set rather than real ViewConfigs. It is wrong only for a nested\n * scroll view, where an ancestor listening for the same direct event would not fire (correct)\n * but a third-party component's custom direct event would bubble (harmless in practice).\n * Swap it for per-component ViewConfig metadata if that ever matters.\n */\nexport const DIRECT_EVENTS: ReadonlySet<string> = new Set([\n 'topScroll',\n 'topScrollBeginDrag',\n 'topScrollEndDrag',\n 'topMomentumScrollBegin',\n 'topMomentumScrollEnd',\n 'topScrollToTop',\n 'topContentSizeChange',\n 'topLayout',\n 'topLoad',\n 'topLoadStart',\n 'topLoadEnd',\n 'topError',\n 'topProgress',\n 'topRefresh',\n 'topTextLayout',\n // react-native-screens. `topDismissed` is how a swipe-back or a native back button reaches\n // JS, and it must not bubble: the stack above would see its child's pop as its own.\n 'topDismissed',\n 'topNativeDismissCancelled',\n 'topWillAppear',\n 'topAppear',\n 'topWillDisappear',\n 'topDisappear',\n 'topHeaderHeightChange',\n 'topTransitionProgress',\n 'topFinishTransitioning',\n // The tabs host reports its own selection, and only the host it happened in wants to know.\n 'topTabSelected',\n // Safe-area insets, reported by the provider that measured them.\n 'topInsetsChange',\n]);\n\n/**\n * What a listener receives. RN's synthetic event carries more, but `nativeEvent` is the part\n * every RN API is documented against, and `stopPropagation` is the part a nested control needs.\n *\n * `stopPropagation` ends the walk to the root after the current node, as it does in the DOM and\n * on RN's `SyntheticEvent`: the other listeners on the node that called it still run. It does not\n * touch the responder negotiation, which has already finished by the time a listener sees the\n * event, so it cannot take a press away from a pressable; the negotiation already keeps an inner\n * pressable's press from reaching the one around it.\n */\nexport interface NativeSyntheticEvent<T = unknown> {\n readonly nativeEvent: T;\n /**\n * The node the event happened on, which a listener further up can compare with its own: RN's\n * `event.target`. Null where a host has no node to name.\n */\n readonly target?: unknown;\n stopPropagation(): void;\n isPropagationStopped(): boolean;\n}\n\n/**\n * The event object a dispatch hands every listener along the path. Exported so another host can\n * hand its listeners the same shape rather than a bare `{ nativeEvent }` that lacks the methods\n * the type promises.\n */\nexport class SyntheticEvent<T = unknown> implements NativeSyntheticEvent<T> {\n readonly nativeEvent: T;\n readonly target: unknown;\n private stopped = false;\n\n constructor(nativeEvent: T, target: unknown = null) {\n this.nativeEvent = nativeEvent;\n this.target = target;\n }\n\n stopPropagation(): void {\n this.stopped = true;\n }\n\n isPropagationStopped(): boolean {\n return this.stopped;\n }\n}\n\n/**\n * The JS responder system: RN's second touch layer, and the renderer's job rather than the app's.\n *\n * Fabric delivers raw touches to whichever node was hit. On top of that, React runs a negotiation\n * deciding *who owns the gesture*: a capture pass from the root down, then a bubble pass from the\n * target up, electing a single responder that alone receives grant/move/release/terminate. When\n * ownership changes the renderer tells native through `setIsJSResponder`, which is how a JS\n * control stops a native scroll view from also scrolling.\n *\n * All of RN's `Pressability` sits on this, never on raw touch events. Without it there is no way\n * for a button and an enclosing scroll view to agree on who owns a drag.\n */\n/**\n * What a touch event carries. The responder system is touch-only, so its handlers are typed\n * against this rather than `unknown`: every consumer wants the coordinates and would otherwise\n * cast to get at them.\n */\nexport interface TouchPayload {\n readonly pageX?: number;\n readonly pageY?: number;\n readonly locationX?: number;\n readonly locationY?: number;\n readonly identifier?: number;\n readonly target?: number;\n readonly timestamp?: number;\n}\n\nexport type ResponderEvent = NativeSyntheticEvent<TouchPayload>;\n\nexport interface ResponderHandlers {\n /** The `target` is the node the touch landed on, which a capturing ancestor may inspect. */\n onStartShouldSetResponderCapture?(event: ResponderEvent, target: EngineNode): boolean;\n onStartShouldSetResponder?(event: ResponderEvent, target: EngineNode): boolean;\n onMoveShouldSetResponderCapture?(event: ResponderEvent, target: EngineNode): boolean;\n onMoveShouldSetResponder?(event: ResponderEvent, target: EngineNode): boolean;\n onResponderGrant?(event: ResponderEvent): void;\n onResponderMove?(event: ResponderEvent): void;\n onResponderRelease?(event: ResponderEvent): void;\n onResponderTerminate?(event: ResponderEvent): void;\n /** Return false to keep the gesture when something else asks for it. Defaults to allowing. */\n onResponderTerminationRequest?(event: ResponderEvent): boolean;\n /** Ask native to stop its own gesture while we hold the responder (a slider inside a list). */\n blockNativeResponder?: boolean;\n}\n\n/**\n * Events the native side will not emit unless a **prop** opts in, separately from anyone\n * listening. `ShadowTree.cpp` guards the layout notification with `if (viewProps->onLayout)`,\n * so a view that never sets the prop is never measured, however many listeners it has.\n *\n * React gets this for free: attaching a handler puts `onLayout` in the props object. A renderer\n * that keeps listeners in its own registry has to set the prop deliberately, and the failure is\n * silent - the callback simply never runs.\n */\nconst EVENT_OPT_IN_PROPS: Record<string, string> = {\n topLayout: 'onLayout',\n /*\n * Hover, which exists on this platform after all.\n *\n * React Native implements the W3C pointer events, and on iPadOS a connected trackpad or mouse\n * produces them: `onPointerEnter` and `onPointerLeave` fire as the cursor crosses a view. A\n * phone never sends them, so this costs a phone two props and nothing else, and it is what\n * makes a hover style reachable on the one device that has a pointer.\n */\n topPointerEnter: 'onPointerEnter',\n topPointerLeave: 'onPointerLeave',\n};\n\n/**\n * The same opt-in, for events one view type guards with a prop of its own. Android's\n * `ReactImageView` emits no load events at all unless `shouldNotifyLoadEvents` is set, which\n * `Image.android.js` does whenever any load handler is attached. iOS ignores the prop.\n */\nconst VIEW_EVENT_OPT_IN_PROPS: Record<string, Record<string, string>> = {\n Image: {\n topLoadStart: 'shouldNotifyLoadEvents',\n topLoad: 'shouldNotifyLoadEvents',\n topLoadEnd: 'shouldNotifyLoadEvents',\n topError: 'shouldNotifyLoadEvents',\n topProgress: 'shouldNotifyLoadEvents',\n },\n};\n\n/**\n * Props the engine itself writes or reads off a node, so never a misspelling: the style, the\n * event opt-ins, and the bookkeeping keys that never reach native. See `checkProps`.\n */\nconst ENGINE_PROPS = new Set<string>([\n 'style',\n 'collapsable',\n // Read by the cascade for `:disabled`, whether or not the native view takes it.\n 'disabled',\n 'intrinsicSize',\n 'styleOverride',\n ...Object.values(EVENT_OPT_IN_PROPS),\n ...Object.values(VIEW_EVENT_OPT_IN_PROPS).flatMap((props) => Object.values(props)),\n]);\n\n/** Touch events that drive the responder negotiation. */\nconst TOUCH_START = 'topTouchStart';\nconst TOUCH_MOVE = 'topTouchMove';\nconst TOUCH_END = 'topTouchEnd';\nconst TOUCH_CANCEL = 'topTouchCancel';\n\nexport type NodeKind = 'element' | 'text' | 'anchor';\n\n/** What Fabric currently holds for a node. `null` until the node has been committed once. */\ninterface Committed {\n handle: FabricNode;\n /**\n * The react tag this node was created with. Kept because the native animation driver addresses\n * a view by tag and has no other way to find one of ours: `findNodeHandle` returns a number it\n * is given unchanged, so a tag is all an animated graph needs to point here.\n */\n tag: number;\n props: Record<string, unknown>;\n /** The child handles this node was committed with, in order. */\n childHandles: FabricNode[];\n /** The native view it was created as, which a clone cannot change. */\n viewName: string;\n}\n\nexport interface EngineNode extends HostNode {\n readonly kind: NodeKind;\n /** Lowercase template spelling, e.g. `view`. Never the native view name. */\n readonly name: string;\n /** `name` again, for Angular 22.0, which reads it on a component's host element. */\n readonly tagName: string;\n props: Record<string, unknown>;\n text: string;\n children: EngineNode[];\n parent: EngineNode | null;\n listeners: Map<string, Set<(event: unknown) => void>> | null;\n\n /** CSS classes on this node, for selector matching. */\n classes: Set<string> | null;\n /** The compiled stylesheet of the component that created this node, if any. */\n sheet: StyleSheet | null;\n /** The sheet of the component this node hosts, if it hosts one. What `:host` matches against. */\n hostSheet: StyleSheet | null;\n /** Custom properties set on the node itself; see `StyleTarget.customProperties`. */\n customProperties: Record<string, TokenValue> | null;\n /** Resolved style, memoised across commits. Owned by the CSS resolver. */\n styleCache: StyleCache | null;\n /** Set when something that could change what this node matches has changed. */\n styleDirty: boolean;\n /** See `StyleTarget.hasDirty`. */\n hasDirty: boolean;\n /** See `StyleTarget.stateDirty`. */\n stateDirty: boolean;\n /** A family left out while it loads. See `loadingFamilies`. */\n heldFamily?: string;\n /** See `StyleTarget.inlineInherits`. */\n inlineInherits?: boolean;\n /** See `StyleTarget.boundStyle`: the declarations, and the same by the property each sets. */\n boundStyle?: readonly DeferredDeclaration[] | null;\n boundByProp?: Map<string, DeferredDeclaration>;\n /**\n * Whether this node, or one inside it, takes touches under a `pointer-events: none` it would\n * otherwise inherit. Kept as each node is reconciled, children first. See `noteTouches`.\n */\n touchWithin?: boolean;\n /**\n * The paragraph the engine makes around a run of text written straight into a view. It is in no\n * template and in no node's `children`: it holds the text, and commits where the text would.\n */\n box?: EngineNode;\n /** A node the engine made, which no rule matches: it only inherits. */\n anonymous?: true;\n /** See `StyleTarget.styled`. */\n styled?: true;\n /** `:focus`, from the native focus and blur events. */\n focused?: boolean;\n /** `:active`, set on the responder and every ancestor of it. */\n active?: boolean;\n /**\n * The style object the platform adapter made for this node, and may therefore write into.\n *\n * Angular sets style properties one at a time, so building a fresh object per property means a\n * style of ten properties costs ten copies of a growing object, for every element that has one.\n * An object the adapter created is its to mutate; one that arrived any other way is copied,\n * once. A field rather than a `WeakSet` of such objects, which Hermes makes slow to consult.\n */\n ownStyle?: object;\n /** The resolved style this node was last committed with, for the skip check in `reconcile`. */\n styleCommitted: StyleCache | null;\n /**\n * How this node laid its children out when one of them last had a `fit-content` size, as\n * `containerOf` says it. Set by such a child, and compared on each reconcile so the children\n * are worked out again when the direction or alignment changes. Unset on every other node.\n */\n fitContainer?: string;\n /**\n * Whether this node had a height a percentage could be taken of, when a box beneath it with a\n * percentage height last asked, as `definiteHeight` says it. Compared on each reconcile so its\n * children are worked out again when it changes. Unset on every other node.\n */\n heightBasis?: boolean;\n /**\n * Per-property transition state, for every property this node has ever seen a `transition` for.\n * A finished entry stays, because its target is what the next change is measured against.\n */\n transitions?: Map<string, Transition>;\n /** The `@keyframes` animation this node is playing, if any. One at a time. */\n playing?: RunningAnimation;\n /** An animation played by a scroll view's offset rather than the clock. See `scrollAnimated`. */\n scrolled?: ScrollAnimation;\n /**\n * The last `transform` built from the individual transform properties, and what it was built\n * from. Reused while the parts are the same objects, so an unrelated change does not re-send it.\n */\n composedTransform?: { parts: readonly unknown[]; value: unknown[] };\n /** The commit that created this node's view, by its number: see `Engine.commitUnseen`. */\n bornIn?: number;\n /** The last bound `transform` string and the list it reads as, undefined where CSS cannot. */\n boundTransform?: { text: string; list: unknown[] | undefined };\n /**\n * Set by the component that owns this element. A host primitive that reaches a commit without it\n * was written in a template that never imported the component, which is reported in dev.\n */\n claimed?: true;\n /**\n * Set by the platform adapter when Angular mounts a component on this element. What makes an\n * `<x-card>` host legitimate where a `<veiw>` typo is not, since both are names no view table\n * knows. See `markComponentHost`.\n */\n componentHost?: true;\n /** See `keepNativeView`. */\n nativeView?: true;\n /** Props kept for selectors to match and left out of what is committed. See `keepAsAttribute`. */\n attributeOnly?: Set<string>;\n /** The child this node's background is painted on instead of itself. See `paintOn`. */\n paintsOn?: EngineNode;\n /**\n * Style weaker than every sheet, where no rule and no inline style says otherwise. What lets the\n * root component's host fill the surface by default and still give way to its own `:host`. See\n * `setDefaultStyle`.\n */\n defaultStyle?: Readonly<Record<string, unknown>>;\n\n /**\n * Hoisted nodes (`registerHoist`) inside this subtree while it is out of the tree, held here\n * rather than by the engine. See `Engine.releaseDetached`.\n */\n dormantHoists?: EngineNode[] | null;\n\n committed: Committed | null;\n /** The node this one was committed as a child of, which native holds it to for its life. */\n committedUnder: EngineNode | null;\n /** The hoisted views this node keeps committed for, by element name. See `HoistOptions`. */\n kept?: Map<string, KeptHoist>;\n /** On a text field, the row aligned by baseline that takes a baseline from it: `lineBaseline`. */\n onBaseline?: EngineNode;\n /** On such a row, the fields it has marked, which it unmarks when they are no longer its own. */\n baselineFields?: Set<EngineNode>;\n /** Commit this node again with its children so Fabric measures it again. `remeasureText`. */\n remeasure?: true;\n /**\n * A modal host committed as visible on iOS whose dismissal native has not yet reported. It\n * stays committed after `visible` goes false until `topDismiss`, as React Native's Modal.js\n * keeps it for the dismissal animation. See `Engine.withheld`.\n */\n presented?: true;\n /** This node's own props changed. */\n propsDirty: boolean;\n /** This node's child list changed. */\n structureDirty: boolean;\n /** Something below this node is dirty, so the walk must descend. */\n subtreeDirty: boolean;\n}\n\n/**\n * Canonical Fabric component names, taken from `RCTFabricComponentsPlugins.mm` and the C++\n * `ComponentName[]` declarations rather than guessed. Legacy `RCT`-prefixed names also work\n * today, but only through `componentNameByReactViewName`, a documented transition-period shim\n * that strips the prefix and maps `Text` to `Paragraph`.\n */\nconst VIEW_NAMES: Record<string, string | PlatformViewName> = {\n view: 'View',\n text: 'Paragraph',\n image: 'Image',\n 'scroll-view': 'ScrollView',\n 'safe-area-view': 'SafeAreaView',\n modal: 'ModalHostView',\n switch: 'Switch',\n 'text-input': 'TextInput',\n 'activity-indicator': 'ActivityIndicatorView',\n 'refresh-control': 'PullToRefreshView',\n 'input-accessory-view': 'InputAccessoryView',\n // Composites from the components package. Their host is a plain view; they are listed so a\n // template that uses one without importing it is reported like any other host primitive.\n pressable: 'View',\n 'touchable-opacity': 'View',\n 'image-background': 'View',\n 'keyboard-avoiding-view': 'View',\n // The windowing component; its host really is a native scroll view.\n 'virtual-list': 'ScrollView',\n};\n\n/**\n * The element names above, as they were before any app registered its own.\n *\n * Only these have a component in `@ng-native/components` to forget to import, which is what\n * the dev-mode check below is about. A name added by `registerViewName` may have nothing behind\n * it on purpose: an Expo view driven as a plain element is the whole point of\n * `@ng-native/expo`, and warning about it would be noise.\n */\nconst PRIMITIVE_NAMES = new Set(Object.keys(VIEW_NAMES));\n\n/**\n * HTML's text elements, which a template can write as it would for a browser.\n *\n * Each is text when it holds only text and other text elements, and a view when it holds anything\n * else: a box inside a paragraph has no layout, so `<span>Inbox<view class=\"dot\" /></span>` is a\n * view with its text in a paragraph of its own. Decided as the element is committed, by\n * `viewNameOf`. They have no component to import, so they are not `PRIMITIVE_NAMES`.\n */\nconst TEXT_ELEMENTS = new Set([\n ...['span', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'label', 'strong', 'b', 'em', 'i'],\n ...['u', 's', 'small', 'code', 'mark', 'abbr', 'cite', 'time'],\n]);\n\n/** HTML's layout elements, each a plain view, as a browser's are boxes with a name. */\nconst LAYOUT_ELEMENTS = [\n ...['div', 'section', 'article', 'header', 'footer', 'main', 'nav', 'ul', 'ol', 'li'],\n];\n\nfor (const name of TEXT_ELEMENTS) VIEW_NAMES[name] = 'Paragraph';\nfor (const name of LAYOUT_ELEMENTS) VIEW_NAMES[name] = 'View';\n\n/**\n * What an HTML element has for its name alone, given to the node as it is made: a heading's role,\n * which a binding can replace as it can any prop, and whether the engine has styles for it.\n */\nconst HTML_ELEMENTS = new Map<string, { role?: string; styled?: true }>([\n ...['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].map((name) => [name, { role: 'header' }] as const),\n ...[...STYLED_ELEMENTS].map((name) => [name, { styled: true }] as const),\n]);\n\n/**\n * The props each host primitive's native view is sent, by element name, as the components\n * declare them: every input the element's component has, and the props it writes that no input\n * carries. What the development check for a misspelt prop compares against. See\n * `declareNativeProps`.\n */\nconst DECLARED_PROPS = new Map<string, Set<string>>();\n\n/**\n * Declare props the native view behind an element accepts. `@ng-native/components` calls this\n * once per host primitive with the component's inputs; an app driving a primitive's native view\n * with a prop the component has no input for can declare that prop too.\n */\nexport function declareNativeProps(elementName: string, props: Iterable<string>): void {\n let declared = DECLARED_PROPS.get(elementName);\n if (!declared) DECLARED_PROPS.set(elementName, (declared = new Set()));\n for (const prop of props) declared.add(prop);\n}\n\n/**\n * Mark a host element as owned by its component. The components package calls this from each\n * host primitive's constructor; see `EngineNode.claimed`.\n */\nexport function claimHost(node: HostNode): void {\n node.claimed = true;\n}\n\n/**\n * Mark an element as the host of a component. The platform adapter calls this from\n * `RendererFactory2.createRenderer`, which Angular calls once for every component it mounts,\n * with the host element in hand, whatever the component's selector.\n */\nexport function markComponentHost(node: HostNode): void {\n (node as EngineNode).componentHost = true;\n}\n\n/**\n * Say that a component's host is the native view its element name is registered as: a typed\n * wrapper for the view, where a component of the app's own with the same selector is a plain view.\n * Called from the component's constructor. See `ViewNameOptions.yieldsToComponents`.\n */\nexport function keepNativeView(node: HostNode): void {\n (node as EngineNode).nativeView = true;\n}\n\n/** `text-input` -> `TextInput`: how the components package names the class for an element. */\nconst className = (element: string): string =>\n element.replace(/(^|-)([a-z])/g, (_, __, c: string) => c.toUpperCase());\n\n/** Names Android registers differently. */\nexport const ANDROID_VIEW_NAMES: Record<string, string> = {\n switch: 'AndroidSwitch',\n 'text-input': 'AndroidTextInput',\n 'activity-indicator': 'AndroidProgressBar',\n 'refresh-control': 'AndroidSwipeRefreshLayout',\n // Neither exists on Android; RN's own wrappers render a plain view there too.\n 'safe-area-view': 'View',\n 'input-accessory-view': 'View',\n};\n\n/**\n * iOS's names for the elements Android names differently, so reporting iOS after Android puts\n * them back.\n */\nconst IOS_VIEW_NAMES: Record<string, string> = Object.fromEntries(\n Object.keys(ANDROID_VIEW_NAMES).map((element) => [element, VIEW_NAMES[element] as string]),\n);\n\n/**\n * The platform the host reported at startup. Defaults to iOS, which is what the view-name table\n * above assumes too.\n *\n * Exposed because a few of React Native's JavaScript wrappers behave differently per platform in\n * ways nothing native can infer: `Text.js` makes a text an accessibility element on iOS always,\n * and on Android only when it can be pressed.\n */\nlet platformOS = 'ios';\n\nexport function nativePlatform(): string {\n return platformOS;\n}\n\n/**\n * Call once at startup with `Platform.OS`. The view names above are the iOS/canonical ones, so\n * only the mapping half is a no-op elsewhere.\n */\nexport function registerPlatformComponents(platform: string): void {\n platformOS = platform;\n const names = platform === 'android' ? ANDROID_VIEW_NAMES : IOS_VIEW_NAMES;\n for (const [element, viewName] of Object.entries(names)) registerViewName(element, viewName);\n}\n\n/**\n * Props RN's JS wrappers apply before the caller's, per native view name.\n *\n * The native ScrollView does not clip on its own; RN's `ScrollView.js` supplies\n * `{flexGrow, flexShrink, flexDirection, overflow: 'scroll'}` as a base style. Omit it and the\n * content spills straight out of the scroll view's bounds, which reads as a layout bug in the\n * content rather than a missing default.\n *\n * Caller props and styles are applied on top, so any of this can be overridden.\n */\nconst DEFAULT_PROPS: Record<string, Record<string, unknown>> = {\n ScrollView: { flexGrow: 1, flexShrink: 1, flexDirection: 'column', overflow: 'scroll' },\n // RN's Image.ios.js: without it a border radius rounds the view but not the picture.\n Image: { overflow: 'hidden' },\n // RN's Modal.js gives the native host this; without it the modal does not lay out.\n ModalHostView: { position: 'absolute' },\n // RN's InputAccessoryView.js does the same for the keyboard bar.\n InputAccessoryView: { position: 'absolute' },\n // RN's Text.js ends truncated text in an ellipsis; native's own default is to clip. A default\n // rather than a prop the component writes, so `text-overflow` in a stylesheet can change it.\n Paragraph: { ellipsizeMode: 'tail' },\n};\n\nconst RAW_TEXT = 'RawText';\n/**\n * A `<text>` nested inside another `<text>` is a span, not a paragraph.\n *\n * Note the name: the C++ component really is called `Text`, but that name is **unreachable\n * from JS**. `ComponentDescriptorRegistry::at` puts every lookup through\n * `componentNameByReactViewName`, which rewrites `Text` to `Paragraph` and `VirtualText` to\n * `Text`. Sending the canonical `Text` therefore yields a Paragraph nested inside a Paragraph,\n * which Fabric treats as an inline view attachment: the run renders top-aligned and does not\n * inherit the parent's text attributes. It looks like a superscript.\n */\nconst VIRTUAL_TEXT = 'VirtualText';\nconst DEFAULT_VIEW = 'View';\n/** A top-level text, the one view that aligns its lines. A nested text is a `VirtualText`. */\nconst PARAGRAPH = 'Paragraph';\n\n/**\n * The box Yoga takes a view's baseline from where the view has none of its own: its first child\n * that is laid out in its flow. Words written straight into the view are the paragraph the\n * engine makes around them, and a child that is not displayed has no view to ask.\n */\nfunction firstInFlow(node: EngineNode): EngineNode | undefined {\n for (const child of node.children ?? []) {\n // Not the paragraph itself, which holds the words it was made around.\n if (child.kind === 'text' && child.box) return child.box === node ? undefined : child.box;\n if (child.kind !== 'element' || ownLayout(child, 'display') === 'none') continue;\n if (ownLayout(child, 'position') !== 'absolute') return child;\n }\n return undefined;\n}\n\nconst isNode = (node: EngineNode | undefined): node is EngineNode => node !== undefined;\n\n/** Whether a row lays a child out among its others, and so can take its baseline from it. */\nconst inFlow = (child: EngineNode): boolean =>\n child.kind === 'element' && ownLayout(child, 'position') !== 'absolute';\n\n/** The text field a row's box takes its baseline from: itself, or the first in its flow down. */\nfunction fieldOnBaseline(item: EngineNode): EngineNode | undefined {\n let at: EngineNode | undefined = item;\n while (at?.kind === 'element' && !TEXT_INPUTS.has(viewNameOf(at))) at = firstInFlow(at);\n return at?.kind === 'element' ? at : undefined;\n}\n\ntype TextDirection = 'ltr' | 'rtl';\n\nconst textDirection = (value: unknown): TextDirection | undefined =>\n value === 'ltr' || value === 'rtl' ? value : undefined;\n\n/**\n * What iOS scales a text's `lineHeight` by: the system text size, capped by the text's own\n * `maxFontSizeMultiplier` where it is at least 1, and 1 without font scaling\n * (`RCTEffectiveFontSizeMultiplierFromTextAttributes`).\n */\nfunction textScale(props: Record<string, unknown>, fontScale = 1): number {\n if (props['allowFontScaling'] === false) return 1;\n const cap = props['maxFontSizeMultiplier'];\n return typeof cap === 'number' && cap >= 1 ? Math.min(fontScale, cap) : fontScale;\n}\n\n/** A field's padding and border on its top or bottom edge, as they are written. */\nconst blockEdge = (\n props: Record<string, unknown>,\n side: 'Top' | 'Bottom',\n logical: 'Start' | 'End',\n): unknown[] => [\n props[`padding${side}`] ??\n props[`paddingBlock${logical}`] ??\n props['paddingBlock'] ??\n props['paddingVertical'] ??\n props['padding'] ??\n 0,\n props[`border${side}Width`] ?? props['borderWidth'] ?? 0,\n];\n\n/**\n * A multiline field's `rows` as its height, where it was given none: that many lines of its\n * line height at the system text size, inside its padding and border, as a browser sizes a `<textarea>`. A native field\n * is as tall as its text, which is one line before anything is typed.\n */\nfunction rowsTall(props: Record<string, unknown>, fontScale: number | undefined): void {\n const rows = Number(props['rows']);\n const line = props['lineHeight'];\n if (props['multiline'] !== true || !(rows > 0) || typeof line !== 'number') return;\n if (isSet(props['height']) && props['height'] !== 'auto') return;\n // A content box's height is its lines alone: Yoga adds the padding and border itself.\n const edges =\n props['boxSizing'] === 'content-box'\n ? []\n : [...blockEdge(props, 'Top', 'Start'), ...blockEdge(props, 'Bottom', 'End')];\n if (!edges.every((part) => typeof part === 'number')) return;\n // At the system text size, which the field's lines are drawn at.\n const lines = rows * line * textScale(props, fontScale);\n props['height'] = edges.reduce<number>((sum, part) => sum + (part as number), lines);\n}\n\n/** A field's own minimum height: none where it says `auto`, which a web element starts with. */\nconst ownMinimum = (minHeight: unknown): unknown => (minHeight === 'auto' ? 0 : (minHeight ?? 0));\n\n/** How tall the system's font is, as a share of its size: its rise over the baseline and fall under. */\nconst FONT_LINE = 0.95 + 0.24;\n\n/**\n * How tall a field is by its line: the line, padding and border of a border-box field, Yoga's\n * default, and its content alone for a content-box one, which Yoga adds the padding and border\n * to itself. In a row aligned by baseline some of the line is kept as padding: `lineBaseline`.\n */\nfunction lineBox(\n props: Record<string, unknown>,\n box: readonly number[],\n onBaseline: boolean,\n fontScale: number | undefined,\n): number {\n const half = onBaseline ? lineBaseline(props, box[0]!, box, fontScale) : 0;\n if (props['boxSizing'] === 'content-box') return box[0]! - 2 * half;\n return box.reduce((sum, part) => sum + part, 0);\n}\n\n/**\n * `lineBaseline` for a field a height sizes: the room is what the height leaves its text, and\n * the field stays that height. A content-box field's height is its content's, so what is now\n * padding comes out of it.\n */\nfunction heightBaseline(\n props: Record<string, unknown>,\n height: number,\n onBaseline: boolean,\n fontScale: number | undefined,\n): void {\n if (!onBaseline) return;\n const edges = [...blockEdge(props, 'Top', 'Start'), ...blockEdge(props, 'Bottom', 'End')];\n if (!edges.every((part) => typeof part === 'number')) return;\n const content = props['boxSizing'] === 'content-box';\n const room = content ? height : (edges as number[]).reduce((left, part) => left - part, height);\n const half = lineBaseline(props, room, [room, ...(edges as number[])], fontScale);\n if (content) props['height'] = height - 2 * half;\n}\n\n/**\n * Give a field with its line height left out the baseline of a paragraph in a line as tall, for\n * a field in a row aligned by baseline: half the room the line has over the font is kept as\n * padding over and under the text. React Native says a field's baseline from its text and its\n * top padding, so without this it is the font's own, and the row lifts the paragraphs beside the\n * field to it: a form field's prefix and suffix sit higher than what is typed. Answers the half.\n *\n * ponytail: the font is taken to be as tall as the system's, `FONT_LINE` of its size. Read from\n * the font if a field in another face is seen a point off its prefix.\n */\nfunction lineBaseline(\n props: Record<string, unknown>,\n line: number,\n [, top, , bottom]: readonly number[],\n fontScale: number | undefined,\n): number {\n const size = props['fontSize'];\n if (typeof size !== 'number') return 0;\n const half = Math.max(0, (line - size * textScale(props, fontScale) * FONT_LINE) / 2);\n props['paddingTop'] = top! + half;\n props['paddingBottom'] = bottom! + half;\n return half;\n}\n\n/**\n * Centre the text of a single-line text field that has a line height, as Chrome centres an\n * input's, keeping the height the line height gives it.\n *\n * Where a `height` in points sizes the field, the line height has nothing left to do, and is left\n * out on both platforms: on Android, `EditText` centres a line box taller than the font's own\n * about 1.7pt high of centre in a 44pt field, and centres the font's own exactly. A percentage\n * height sizes the field only where its parent's height is definite, which is known at layout\n * alone, so such a field is left as it was. Elsewhere Android sizes the field by the line height\n * and centres the text in it itself, and keeps it.\n *\n * On iOS, React Native's field sets `lineHeight` as the paragraph's minimum and maximum line\n * height and, unlike a paragraph (`RCTApplyBaselineOffset`), never offsets the baseline, so the\n * glyphs sit at the bottom of a line box taller than the font. One line has nothing to space, so\n * the line height is left out. What it does in Chrome, and on Android, is set the field's height:\n * line height, padding and border. That is kept as a `minHeight`, the larger of it and the field's\n * own, within its `maxHeight`: the whole sum for a border-box field, Yoga's default, and the line\n * height alone for a content-box one. A null `height` is no height. A value that is not a number\n * cannot be added up, and leaves the field as it was.\n */\nfunction centreSingleLine(\n viewName: string,\n props: Record<string, unknown>,\n fontScale: number | undefined,\n onBaseline = false,\n): void {\n const lineHeight = props['lineHeight'];\n if (!TEXT_INPUTS.has(viewName) || typeof lineHeight !== 'number') return;\n if (props['multiline'] === true) return;\n const height = props['height'];\n if (typeof height === 'number') {\n delete props['lineHeight'];\n heightBaseline(props, height, onBaseline, fontScale);\n return;\n }\n // A percentage is a fixed height only where the parent's is definite, known at layout alone.\n if (isSet(height) && height !== 'auto') return;\n // Android sizes the field by its line height, and centres the text in it, itself.\n if (viewName !== 'TextInput') return;\n const edge = (side: 'Top' | 'Bottom', logical: 'Start' | 'End') =>\n blockEdge(props, side, logical);\n const line = lineHeight * textScale(props, fontScale);\n const box = [line, ...edge('Top', 'Start'), ...edge('Bottom', 'End')];\n const own = ownMinimum(props['minHeight']);\n const max = props['maxHeight'] ?? Infinity;\n if (![...box, own, max].every((part) => typeof part === 'number')) return;\n delete props['lineHeight'];\n const content = lineBox(props, box as number[], onBaseline, fontScale);\n props['minHeight'] = Math.max(own as number, Math.min(content, max as number));\n}\n\nconst NO_STYLE: Readonly<Record<string, unknown>> = {};\n\n/**\n * An element's inline style, less each property a rule it matches declared `!important`: an\n * inline style is the last of the plain declarations, under every important one.\n *\n * ponytail: by the name a property is committed under, so an inline `padding` is not taken out\n * by an important `padding-top`. Expand the inline shorthand here if one is ever written so.\n */\nfunction inlineOf(node: EngineNode): Readonly<Record<string, unknown>> {\n if (!node.props['style']) return NO_STYLE;\n const inline = flattenStyle(node.props['style'], {});\n for (const key of node.styleCache?.important ?? []) delete inline[key];\n return inline;\n}\n\n/**\n * What a container's own style says for `key`, in the order `mergeProps` applies them: a\n * component's override, inline, a prop, its stylesheet, its default.\n */\nfunction ownLayout(node: EngineNode, key: string): unknown {\n return (\n flattenStyle(node.props[STYLE_OVERRIDE], {})[key] ??\n inlineOf(node)[key] ??\n node.props[key] ??\n node.styleCache?.style[key] ??\n node.defaultStyle?.[key]\n );\n}\n\n/**\n * A container's main axis and how it aligns across it, as `row` or `column` and a keyword. A\n * `display: contents` node is no container: its children are laid out in the one above it.\n */\nfunction containerOf(node: EngineNode): string {\n if (ownLayout(node, 'display') === 'contents') return 'contents';\n const direction = String(ownLayout(node, 'flexDirection') ?? 'column');\n return `${direction.startsWith('row') ? 'row' : 'column'} ${ownLayout(node, 'alignItems') ?? 'stretch'}`;\n}\n\n/**\n * The node a box is laid out in: its parent, or the one above every `display: contents` ancestor.\n * Each of those is told a `fit-content` child passed through, so that when it stops being\n * `contents`, and is the container, the child is worked out again.\n */\nfunction layoutParent(node: EngineNode): EngineNode | null {\n let parent = node.parent;\n while (parent && containerOf(parent) === 'contents') {\n parent.fitContainer = 'contents';\n parent = parent.parent;\n }\n return parent;\n}\n\nconst STRETCHES = new Set([undefined, null, 'auto', 'stretch']);\n\n/**\n * `width: fit-content` and `height: fit-content`, which Yoga has no size for.\n *\n * Along its container's main axis a box is as big as its content already, so the size is\n * dropped. Across it a box stretches, where a browser keeps it at its content's size and at the\n * start: `align-self: flex-start` does both. An alignment the container or the box asked for is\n * kept, since it stops the stretch already.\n */\nfunction fitContent(node: EngineNode, props: Record<string, unknown>): void {\n const capped = {\n row: capAtContent(props, 'width', 'maxWidth'),\n column: capAtContent(props, 'height', 'maxHeight'),\n };\n const width = props['width'] === 'fit-content';\n const height = props['height'] === 'fit-content';\n if (!width && !height) return;\n if (width) delete props['width'];\n if (height) delete props['height'];\n const parent = layoutParent(node);\n if (!parent) return;\n const container = containerOf(parent);\n parent.fitContainer = container;\n const [direction, align] = container.split(' ');\n if (capped[direction === 'row' ? 'row' : 'column']) withoutGrowth(props);\n const across = direction === 'row' ? height : width;\n if (across && align === 'stretch' && STRETCHES.has(props['alignSelf'] as string)) {\n props['alignSelf'] = 'flex-start';\n }\n}\n\n/**\n * A box capped at its content along its container's main axis, where it would grow: a browser\n * clamps a growing item by its maximum, and there is no such cap to hand Yoga. So it does not\n * grow, and starts from its content, which is as far as the cap would let it get. It may still\n * shrink.\n */\nfunction withoutGrowth(props: Record<string, unknown>): void {\n if (typeof props['flex'] === 'number' && props['flex'] > 0) {\n delete props['flex'];\n props['flexShrink'] ??= 1;\n }\n delete props['flexGrow'];\n delete props['flexBasis'];\n}\n\n/**\n * `max-width: max-content`, and the same of a height: no bigger than its content, which for a\n * box that would fill its container is `fit-content`. Yoga has no such cap. Answers whether the\n * box is the size of its content for it: one that would fill, or one that was `fit-content` as\n * written.\n *\n * ponytail: a size in points is left as it is, since nothing here knows how big the content\n * is. Measure it if a box is ever given both.\n */\nfunction capAtContent(props: Record<string, unknown>, size: string, cap: string): boolean {\n if (props[cap] !== 'max-content') return false;\n delete props[cap];\n const own = props[size];\n const fills = own == null || own === 'auto' || (typeof own === 'string' && own.endsWith('%'));\n if (fills) props[size] = 'fit-content';\n return fills || own === 'fit-content';\n}\n\nconst isPercent = (value: unknown): boolean => typeof value === 'string' && value.endsWith('%');\n\n/** Whether a `flex-basis` is a length or a percentage of something: not zero, and not `auto`. */\nconst isSizedBasis = (basis: unknown): boolean =>\n isPercent(basis)\n ? Number.parseFloat(basis as string) !== 0\n : typeof basis === 'number' && basis !== 0;\n\n/**\n * A `flex-basis` that is a length or a percentage, as the size it is along its container's main\n * axis: a width in a row and a height in a column, over one written for that axis.\n *\n * Yoga works a `flexBasis` out once for a view and keeps the answer, and React Native never has\n * it forgotten when the view's props change (`computedFlexBasis`, cleared only by\n * `markDirtyAndPropagate`). A basis that changes after the first layout is not read again, and\n * a percentage does not follow the box it is a share of. A size is worked out on every pass, and\n * with no basis Yoga takes the size along the main axis as the basis: the same sum.\n *\n * A basis of zero is left as it is, which is every `flex: 1`: under a container with no size on\n * its main axis Yoga passes over a basis and sizes the box by its content, where a size of zero\n * would be zero. A box out of the flow is no flex item, and keeps its own size.\n */\nfunction basisAsSize(node: EngineNode, props: Record<string, unknown>): void {\n const basis = props['flexBasis'];\n if (!isSizedBasis(basis) || props['position'] === 'absolute') return;\n const parent = layoutParent(node);\n if (!parent) return;\n const container = containerOf(parent);\n // Remembered on the container, so the box is merged again when the direction changes.\n parent.fitContainer = container;\n delete props['flexBasis'];\n if (container.startsWith('row')) props['width'] = basis;\n else {\n props['height'] = basis;\n percentHeight(node, props);\n }\n}\n\n/**\n * Whether a box has a height a percentage can be taken of, as CSS defines one: a height of its\n * own, or one the layout around it gives it. A box as tall as what it holds has none.\n *\n * Asked of each box on the way up, and remembered on it, so a change to any of them works out\n * again the boxes beneath it. Where the answer is not known for certain it is yes, which leaves\n * the percentage to Yoga as before: a view native sizes itself, or one placed out of the flow.\n */\nfunction definiteHeight(node: EngineNode): boolean {\n return (node.heightBasis = hasDefiniteHeight(node));\n}\n\nfunction hasDefiniteHeight(node: EngineNode): boolean {\n // The root is the screen, and only a plain view is sized by its content alone.\n if (!node.parent || node.kind !== 'element' || viewNameOf(node) !== 'View') return true;\n const parent = layoutParent(node);\n if (!parent) return true;\n const height = ownLayout(node, 'height');\n if (isPercent(height)) return definiteHeight(parent);\n return sizesItself(node, height) || heightFromLayout(node, parent);\n}\n\nconst NO_HEIGHT = new Set([undefined, null, 'auto', 'fit-content']);\n\n/** Whether a box has a height from its own style: written, or placed, or kept in proportion. */\nfunction sizesItself(node: EngineNode, height: unknown): boolean {\n if (!NO_HEIGHT.has(height as string)) return true;\n return ownLayout(node, 'position') === 'absolute' || ownLayout(node, 'aspectRatio') != null;\n}\n\n/** Whether the container a box is in gives it a height: a row's, or a share of a column's. */\nfunction heightFromLayout(node: EngineNode, parent: EngineNode): boolean {\n const [direction, align] = containerOf(parent).split(' ');\n if (direction === 'row') {\n // Stretched across a row, it is as tall as the row, where the row has a height to be. One\n // as tall as its content gives none: Yoga takes the percentage of the space on offer there\n // too, the screen's, where a browser takes it of the row once its content has sized it.\n const self = ownLayout(node, 'alignSelf') as string | undefined;\n return STRETCHES.has(self) && align === 'stretch' && definiteHeight(parent);\n }\n // In a column it has the height it grows to, where the column has one to share out.\n const grows = Number(ownLayout(node, 'flexGrow') ?? ownLayout(node, 'flex') ?? 0) > 0;\n return grows && definiteHeight(parent);\n}\n\n/**\n * A placeholder's opacity, which native has none for, as its colour faded by that share: none of\n * it at 0, which is how a stylesheet hides a placeholder under a label, and all of it at 1.\n *\n * ponytail: with no colour of its own the placeholder is native's default, and a platform colour\n * is native's to resolve: neither is known here, so each is hidden at 0 and left as it is above\n * that. Name the platform's default, or read the colour back, if one is faded part of the way.\n */\nfunction placeholderFaded(props: Record<string, unknown>): void {\n const opacity = props['placeholderOpacity'];\n if (opacity === undefined) return;\n delete props['placeholderOpacity'];\n if (typeof opacity !== 'number' || opacity >= 1) return;\n const colour = props['placeholderTextColor'];\n if (typeof colour === 'string')\n props['placeholderTextColor'] = faded(colour, Math.max(opacity, 0));\n else if (opacity <= 0) props['placeholderTextColor'] = 'rgba(0, 0, 0, 0)';\n}\n\n/** The least alpha iOS sends a touch to a view at: under a hundredth it is passed over. */\nconst TOUCHED_ALPHA = 0.011;\n\n/**\n * A view that takes a touch and has no opacity, committed with the least there is to be sent\n * one. A browser sends a press to an element at `opacity: 0`, which is how a see-through\n * backdrop hears a press outside a menu; iOS passes over a view it would not draw. A hundredth\n * of what the view draws is not seen.\n */\nfunction stillTouched(props: Record<string, unknown>): void {\n // One told to take no touch is not to be sent one, seen or not.\n if (props['pointerEvents'] === 'none') return;\n const opacity = props['opacity'];\n if (typeof opacity === 'number' && opacity < TOUCHED_ALPHA) props['opacity'] = TOUCHED_ALPHA;\n}\n\n/**\n * Leave `aspect-ratio` out for a box with both a width and a height. CSS takes the ratio only\n * for a size that is `auto`; Yoga takes it over one of two that are given, the height in a\n * column and the width in a row.\n */\nfunction ratioForAutoSize(props: Record<string, unknown>): void {\n if (!isSet(props['aspectRatio'])) return;\n const given = (size: unknown) => isSet(size) && size !== 'auto';\n if (given(props['width']) && given(props['height'])) delete props['aspectRatio'];\n}\n\nconst OUTLINE_KEYS = ['outlineWidth', 'outlineStyle', 'outlineColor', 'outlineOffset'];\n\n/**\n * Send nothing for an outline of no width, which is what `outline: none` is: it draws nothing,\n * and a view with no outline is the same view. Sent, it is an update that is not one, and on\n * Android a text field given an outline prop after it is first drawn has its background set\n * again, with which the padding Android gives a text field comes back over the padding it was\n * laid out with: a field as tall as its line clips its text away. A stylesheet takes a\n * browser's focus ring off a field with `outline: none` for the focused field alone.\n */\nfunction noOutline(props: Record<string, unknown>): void {\n if (props['outlineWidth'] !== 0) return;\n for (const key of OUTLINE_KEYS) delete props[key];\n}\n\n/**\n * A box with `display: none`, out of the flow as well. It takes no room either way, but Yoga\n * reads an item's baseline from its first child that is in the flow, and a hidden one has no\n * layout to read: under a row with `align-items: baseline` the baseline is not a number, and\n * the row comes to no height with nothing in it placed. Out of the flow it is passed over.\n */\nfunction hiddenOutOfFlow(props: Record<string, unknown>): void {\n if (props['display'] === 'none') props['position'] = 'absolute';\n}\n\n/**\n * `height: 50%` under a parent with no height to take it of, which CSS reads as `auto`. Yoga\n * takes it of the space on offer, the screen's or everything a scroll view holds, so no height\n * is sent.\n */\nfunction percentHeight(node: EngineNode, props: Record<string, unknown>): void {\n if (!isPercent(props['height'])) return;\n // Out of the flow, it is of the box that holds it, which is laid out first and has a height.\n if (props['position'] === 'absolute') return;\n const parent = layoutParent(node);\n if (parent && !definiteHeight(parent)) delete props['height'];\n}\n\n/**\n * Start a multiline Android text field's text at the top, as iOS and a `<textarea>` do.\n *\n * React Native maps an unset `textAlignVertical` to `Gravity.NO_GRAVITY`, which `ReactEditText`\n * reads as the `EditText`'s own gravity, `center_vertical`. One the app set, through the input or\n * a CSS `vertical-align`, stays.\n */\nfunction alignMultiline(viewName: string, props: Record<string, unknown>): void {\n if (viewName !== 'AndroidTextInput' || props['multiline'] !== true) return;\n props['textAlignVertical'] ??= 'top';\n}\n\n/**\n * Resolve a paragraph's `text-align` against its direction, as CSS does.\n *\n * React Native reads `left` and `right` relative to the layout direction: in a right-to-left\n * layout `RCTAttributedTextUtils` swaps them, so its `left` is the start edge. `start` and `end`\n * are therefore `left` and `right` whatever the direction. Where the app set a direction, the\n * default is `start`, as on the web, rather than native's natural alignment, which follows the\n * app's language and not the subtree; a physical `left` or `right` is swapped back so it stays on\n * that side; and the paragraph's base writing direction follows unless a `writing-direction` says\n * otherwise, which is what puts neutral characters such as punctuation on the right side.\n */\nfunction alignText(props: Record<string, unknown>, direction: TextDirection | undefined): void {\n const align = props['textAlign'] as string | undefined;\n if (!direction) {\n if (align !== undefined) props['textAlign'] = LOGICAL_ALIGN.get(align) ?? align;\n return;\n }\n props['textAlign'] = TEXT_ALIGN[direction].get(align ?? 'start') ?? align;\n props['writingDirection'] ??= direction;\n}\n\n/** React Native's `textAlign` for CSS's logical values, which means the same in either direction. */\nconst LOGICAL_ALIGN = new Map([\n ['start', 'left'],\n ['end', 'right'],\n]);\n\n/** React Native's `textAlign` for each CSS value, in a layout of each direction. */\nconst TEXT_ALIGN: Readonly<Record<TextDirection, ReadonlyMap<string, string>>> = {\n ltr: new Map([...LOGICAL_ALIGN, ['auto', 'left'], ['left', 'left'], ['right', 'right']]),\n rtl: new Map([...LOGICAL_ALIGN, ['auto', 'left'], ['left', 'right'], ['right', 'left']]),\n};\n\n/** The native modal host, which is left out of a commit while `visible` is false. */\nconst MODAL_HOST = 'ModalHostView';\n\n/**\n * A screen's `gestureResponseDistance` that no touch is within: how far from each edge a swipe\n * back may start, with -1 for no limit, and none at all from the leading edge. It is what\n * `react-native-screens` reads as the swipe is about to begin; whether the swipe is enabled it\n * read when the finger came down, before anything here had heard of the touch.\n */\nconst NO_SWIPE = Object.freeze({ start: -1, end: 0, top: -1, bottom: -1 });\n\n/** A screen of a native stack, which is what the swipe back is a gesture of. */\nconst STACK_SCREEN = 'RNSScreen';\n\n/** What an element's `touch-action` is: bound on it, or from the rules it matches. */\nfunction touchActionOf(node: EngineNode): unknown {\n return inlineOf(node)['touchAction'] ?? node.styleCache?.style['touchAction'];\n}\n\n/** Where a touch is on the screen: its own point, or its first finger's. */\nfunction pointOf(nativeEvent: unknown): { x: number; y: number } {\n const event = (nativeEvent ?? {}) as TouchPayload & { touches?: readonly TouchPayload[] };\n const touch = event.pageX === undefined ? event.touches?.[0] : event;\n return { x: touch?.pageX ?? 0, y: touch?.pageY ?? 0 };\n}\n\n/**\n * What a touch on a node leaves to the browser: the `touch-action` of it, or of the nearest\n * element over it that says. Nothing where none does, which leaves everything.\n */\nfunction touchActions(node: EngineNode): readonly string[] | undefined {\n for (let up: EngineNode | null = node; up; up = up.parent) {\n const said = up.kind === 'element' ? touchActionOf(up) : undefined;\n if (typeof said === 'string') return said.split(' ');\n }\n return undefined;\n}\n\nconst PANS_ACROSS = ['auto', 'manipulation', 'pan-x', 'pan-left', 'pan-right'];\nconst PANS_ALONG = ['auto', 'manipulation', 'pan-y', 'pan-up', 'pan-down'];\n\n/** Whether an element keeps a drag in one direction: its `touch-action` leaves no pan that way. */\nconst keeps = (actions: readonly string[] | undefined, pans: readonly string[]): boolean =>\n actions !== undefined && !actions.some((action) => pans.includes(action));\n\n/** How far a finger moves before a browser has settled which way a drag is going. */\nconst DRAG_SLOP = 4;\n\n/**\n * Register a codegen'd third-party Fabric component, e.g.\n * `registerViewName('rns-screen', 'RNSScreen')`, which is how the router reaches\n * react-native-screens.\n *\n * `defaultProps` is for a component whose React wrapper supplies a base style in JS, the way\n * `ScrollView` and `Modal` do below. Driving the native component directly skips that wrapper,\n * and skipping it is not cosmetic: `RNSScreenStackHeaderConfig` without its `position: absolute`\n * joins the screen's flex layout and pushes every page down by the height of the header.\n */\nexport function registerViewName(\n elementName: string,\n viewName: string | PlatformViewName,\n defaultProps?: Record<string, unknown>,\n options?: ViewNameOptions,\n): void {\n VIEW_NAMES[elementName] = viewName;\n if (options?.yieldsToComponents) YIELDING.add(elementName);\n else YIELDING.delete(elementName);\n // A name the app registers is the app's: no longer decided by what the element holds.\n TEXT_ELEMENTS.delete(elementName);\n for (const name of typeof viewName === 'string' ? [viewName] : [viewName.ios, viewName.android]) {\n if (defaultProps) DEFAULT_PROPS[name] = defaultProps;\n if (options?.textContent) TEXT_CONTENT_PROPS[name] = options.textContent;\n }\n}\n\n/** What else a registered view needs the engine to know about it. */\nexport interface ViewNameOptions {\n /**\n * The prop the view reads its text from, where it takes no children: SwiftUI's `Text` through\n * `@expo/ui` reads `text`. The text written inside the element becomes that prop, as `<text>`\n * takes its own content, and is not committed as children. An explicit prop wins over it.\n */\n readonly textContent?: string;\n /**\n * Whether the name gives way to a component of the app's own with the same selector, whose host\n * is then a plain view. For a set of views registered under a prefix an app may also use for\n * its design system, as `@expo/ui`'s are under `ui-`. A component that is the view itself, a\n * typed wrapper for it, says so with `keepNativeView`.\n */\n readonly yieldsToComponents?: boolean;\n}\n\n/** The registered names that give way to a component's own host. See `ViewNameOptions`. */\nconst YIELDING = new Set<string>();\n\n/** The prop each view that takes its text content as a prop reads it from. See `ViewNameOptions`. */\nconst TEXT_CONTENT_PROPS: Record<string, string> = {};\n\n/** Whether `node` takes its text content as a prop rather than as text children. */\nfunction takesTextAsProp(node: EngineNode): boolean {\n return node.kind === 'element' && TEXT_CONTENT_PROPS[viewNameOf(node)] !== undefined;\n}\n\n/** Sets a view's text prop from its content, unless the prop is set explicitly. */\nfunction withTextContent(node: EngineNode, viewName: string, props: Record<string, unknown>): void {\n const prop = TEXT_CONTENT_PROPS[viewName];\n if (!prop || node.props[prop] !== undefined) return;\n const text = textContent(node);\n if (text) props[prop] = text;\n}\n\n/**\n * The whitespace a paragraph drops at its ends is what CSS collapses: spaces, tabs and line\n * breaks. A no-break space is text, as in a browser, so ` ` is how a value keeps a space at\n * its end; `String.prototype.trim` would take that too.\n */\nconst trimStart = (text: string): string => text.replace(/^[ \\t\\n\\r\\f]+/, '');\nconst trimEnd = (text: string): string => text.replace(/[ \\t\\n\\r\\f]+$/, '');\nconst trimEnds = (text: string): string => trimEnd(trimStart(text));\n\n/**\n * The text written inside a view that takes it as a prop: every run joined, with the whitespace at\n * the two ends dropped as a paragraph drops it, and kept inside. A nested view is drawn after the\n * text, as SwiftUI's `Text` through `@expo/ui` draws a child `Text`, so the space before it stays.\n */\nfunction textContent(node: EngineNode): string {\n let text = '';\n let nested = false;\n for (const child of node.children) {\n if (child.kind === 'text') text += child.text;\n else if (child.kind === 'element') nested = true;\n }\n return nested ? trimStart(text) : trimEnd(trimStart(text));\n}\n\n/**\n * A view whose native name differs by platform. Chosen when the view is looked up rather than when\n * it is registered, so it does not matter which ran first: an app's imports register the router's\n * views before its `main.ts` gets to report the platform.\n */\nexport interface PlatformViewName {\n readonly ios: string;\n readonly android: string;\n}\n\n/** An element's registered view name, for the platform the host reported. */\nfunction registeredViewName(elementName: string): string | undefined {\n const name = VIEW_NAMES[elementName];\n if (name === undefined || typeof name === 'string') return name;\n return platformOS === 'android' ? name.android : name.ios;\n}\n\n/**\n * The views Fabric measures from their text, which a change of the system text size resizes:\n * a paragraph, and a text input on either platform. See `Engine.remeasureText`.\n */\nconst MEASURED_VIEWS = new Set(['Paragraph', 'TextInput', 'AndroidTextInput']);\n\n/** Leave a family that is still loading out of `style`, remembering it. See `loadingFamilies`. */\nfunction holdLoadingFamily(node: EngineNode, style: Record<string, unknown>): void {\n const family = style['fontFamily'];\n if (typeof family === 'string' && loadingFamilies.has(family)) {\n delete style['fontFamily'];\n node.heldFamily = family;\n } else if (node.heldFamily !== undefined) {\n node.heldFamily = undefined;\n }\n}\n\n/** What each mounted app does when faces register. See `fontsRegistered`. */\nconst fontListeners = new Set<(families: ReadonlySet<string>) => void>();\n\n/** Hear about faces registering with the platform, until the returned function is called. */\nexport function onFontsRegistered(listener: (families: ReadonlySet<string>) => void): () => void {\n fontListeners.add(listener);\n return () => fontListeners.delete(listener);\n}\n\n/**\n * Faces just registered with the platform, by the family names text asks for them by. Every\n * mounted app lays out again the paragraphs and text inputs that name one: see\n * `Engine.fontsRegistered`.\n */\nexport function fontsRegistered(families: Iterable<string>): void {\n const names = new Set(families);\n if (!names.size) return;\n for (const listener of [...fontListeners]) listener(names);\n}\n\n/**\n * Families a load has asked the platform for and not yet settled, by how many loads asked. Text\n * naming one is laid out in the fallback without the name until it settles: native caches a\n * text's measurement by its family name, so a fallback measurement under the face's name would\n * outlast the face arriving.\n */\nconst loadingFamilies = new Map<string, number>();\n\n/** Faces a load is about to ask the platform for. See `loadingFamilies`. */\nexport function fontsLoading(families: Iterable<string>): void {\n for (const family of families)\n loadingFamilies.set(family, (loadingFamilies.get(family) ?? 0) + 1);\n}\n\n/** What each mounted app does when a load settles. See `fontsSettled`. */\nconst settleListeners = new Set<(families: ReadonlySet<string>) => void>();\n\n/** Hear about loads settling, until the returned function is called. */\nexport function onFontsSettled(listener: (families: ReadonlySet<string>) => void): () => void {\n settleListeners.add(listener);\n return () => settleListeners.delete(listener);\n}\n\n/**\n * Faces a load asked for and has finished with, registered or not, before `fontsRegistered`.\n * Text held back for one that no load still asks for is laid out with the name again: see\n * `Engine.fontsSettled`.\n */\nexport function fontsSettled(families: Iterable<string>): void {\n const settled = new Set<string>();\n for (const family of families) {\n const left = (loadingFamilies.get(family) ?? 1) - 1;\n if (left > 0) loadingFamilies.set(family, left);\n else {\n loadingFamilies.delete(family);\n settled.add(family);\n }\n }\n if (settled.size) for (const listener of [...settleListeners]) listener(settled);\n}\n\n/** Whether a paragraph, or a span in it, was committed asking for one of these families. */\nfunction namesFamily(node: EngineNode, families: ReadonlySet<string>): boolean {\n const family = node.committed?.props['fontFamily'];\n if (typeof family === 'string' && families.has(family)) return true;\n return node.children.some((child) => namesFamily(child, families));\n}\n\n/** A text size cap far above any a platform offers, so it caps nothing. See `fontsRegistered`. */\nconst UNCAPPED = 1000;\n/**\n * How far a paragraph's cap moves each time a face it names registers: just past the 0.005 React\n * Native compares text attributes to, so the layout it cached is not found, and too little for\n * an app's own cap to cap anything visibly differently.\n */\nconst FONT_REFRESH_STEP = 0.006;\n\n/** The views that take a cursor, on either platform. */\nconst TEXT_INPUTS = new Set(['TextInput', 'AndroidTextInput']);\n\n/** The views that scroll their content, which `focus` brings a field into view within. */\nconst SCROLL_VIEWS = new Set(['ScrollView', 'AndroidHorizontalScrollView']);\n\n/** Element name -> the element name of the ancestor it commits into. See `registerHoist`. */\nconst HOISTS: Record<string, string> = {};\n/** The `ancestorName`s, so a commit asks only those nodes what to hoist into them. */\nconst HOIST_TARGETS = new Set<string>();\n\n/**\n * Commit every `elementName` as a direct child of its nearest `ancestorName`, wherever the\n * template put it, e.g. `registerHoist('native-header', 'screen')`.\n *\n * For a native component that reads a configuration node from its own direct children and\n * nowhere else. `RNSScreen.mm` finds its header that way, so a header written inside a\n * `safe-area-view`, or inside any component a page wraps itself in, was never found: no title,\n * no back button, and nothing said why. The retained tree keeps the node where Angular put it,\n * so styles, `@if` and removal all behave as written; only what reaches Fabric moves. It lands\n * just after the ancestor's child it was written in, or after all of them when it was written in\n * the ancestor itself, which keeps a page's scroll view ahead of its header as UIKit's large\n * title wants. A node with no such ancestor commits where it is.\n */\nexport function registerHoist(\n elementName: string,\n ancestorName: string,\n options: HoistOptions = {},\n): void {\n HOISTS[elementName] = ancestorName;\n HOIST_TARGETS.add(ancestorName);\n if (options.standIn) STAND_INS[elementName] = options.standIn;\n}\n\nexport interface HoistOptions {\n /**\n * Props for a native view the ancestor keeps once the element has committed into it.\n *\n * For a configuration node the native side reads when it arrives but never forgets when it\n * leaves. `RNSScreen` hides its navigation bar when a header config it holds says `hidden`, and\n * does nothing at all when the config is taken away, so the last bar it was told about stays on\n * screen. With a stand-in, removing the element commits these props onto the same native view,\n * children dropped, and the next element of that name adopts the view rather than creating\n * another, so what the native side sees is one config that is updated, never one that goes.\n */\n standIn?: Record<string, unknown>;\n}\n\n/** Element name -> the props it leaves behind in its ancestor. See `HoistOptions.standIn`. */\nconst STAND_INS: Record<string, Record<string, unknown>> = {};\n\n/** A native view an ancestor keeps for a hoisted name with a stand-in, and who it is for now. */\ninterface KeptHoist {\n /** The element committed as this view, or null while the stand-in props are. */\n node: EngineNode | null;\n committed: Committed;\n}\n\n/**\n * Unregistered names commit as a plain RCTView, because that is what an **Angular component\n * host element** is. Angular always creates one (`<x-card>` is a real node in the tree), and\n * it carries the component's host bindings, so it cannot be elided. Guessing a native view\n * name from the element name instead produces `Unimplemented component: <XCard>` on device.\n *\n * The cost is that a typo'd element name would render as an empty view without a word, and\n * Angular's own unknown-element check cannot help (it no-ops without a DOM). So in dev the\n * engine reports a name that nothing accounts for: not a view name, not a component host (see\n * `markComponentHost`), and not an element selector any template declared (`declareElement`).\n * Use an attribute selector (`selector: '[card]'`) on a component to avoid the extra view.\n */\n/**\n * A run of text as a paragraph shows it: without the space at the paragraph's very start or end.\n *\n * Angular collapses template whitespace to a single space rather than removing it, so\n * `<text>\\n {{ name }}\\n</text>` arrives as ` Ada `. A browser drops that space where a line\n * starts or ends; React Native's Text draws it, and every label written across two lines, which\n * a formatter will do to any long one, comes out indented. Spaces between runs are left alone,\n * as they are in HTML.\n *\n * ponytail: worked out when the run itself changes. A run that stops being the first or last\n * because a sibling arrived keeps its old trim until it next changes, which is a space at most.\n */\nfunction paragraphText(node: EngineNode): string {\n let root = node.parent;\n // Text written straight into a view is a paragraph of its own, and all of it.\n if (root === null || !isTextElement(root)) return node.box ? trimEnds(node.text) : node.text;\n // The commonest paragraph by far: one run and nothing else, so it is both the first and last.\n if (root.children.length === 1 && !isTextElement(root.parent)) return trimEnds(node.text);\n while (isTextElement(root.parent)) root = root.parent!;\n const runs: EngineNode[] = [];\n const collect = (from: EngineNode) => {\n for (const child of from.children) {\n if (child.kind === 'text') {\n if (child.text) runs.push(child);\n } else if (isTextElement(child)) collect(child);\n }\n };\n collect(root);\n let text = node.text;\n if (runs[0] === node) text = trimStart(text);\n if (runs[runs.length - 1] === node) text = trimEnd(text);\n return text;\n}\n\n/** The part of a node `viewNameOf` reads: an engine node, or any host's mirror of one. */\nexport interface ViewNameNode {\n readonly kind: string;\n readonly name: string;\n readonly parent: ViewNameNode | null;\n /** Whether a component is mounted on it, and whether that component is the native view. */\n readonly componentHost?: boolean;\n readonly nativeView?: boolean;\n /** What it holds, which decides whether one of HTML's text elements is text or a view. */\n readonly children?: readonly ViewNameNode[];\n /** Set on the paragraph the engine makes for a run of text written straight into a view. */\n readonly anonymous?: boolean;\n}\n\n/**\n * Whether an element is text: a `<text>`, or one of HTML's text elements that holds only text and\n * other such elements. Worked out each time, from the tree as it is, so nothing can go stale.\n */\nfunction isTextElement(node: ViewNameNode | null): boolean {\n if (node === null || node.kind !== 'element') return false;\n if (node.name === 'text') return true;\n // One lookup settles nearly every other element, which is a view.\n if (registeredViewName(node.name) !== PARAGRAPH) return false;\n return !TEXT_ELEMENTS.has(node.name) || holdsOnlyText(node);\n}\n\n/** Whether a text element holds text and nothing else. One that holds nothing holds no text. */\nfunction holdsOnlyText(node: ViewNameNode): boolean {\n const children = node.children ?? [];\n for (const child of children) {\n if (child.kind === 'element' && !isTextElement(child)) return false;\n }\n return children.length > 0;\n}\n\nconst ALIGNS = new Set(['center', 'flex-end', 'space-around', 'space-evenly']);\n\n/**\n * Whether one of HTML's text elements is a flex container that aligns the one run of text it\n * holds, as an avatar's initials are centred: `<span class=\"flex items-center justify-center\">`.\n *\n * A browser makes the run a flex item and places it. A paragraph's text is its content, which no\n * alignment moves, so such an element commits as a view, and its text as the paragraph any view's\n * loose text is. Read from the node's own style on each reconcile, which a change to it brings\n * about, so nothing is kept to go stale. The run can be a text element of its own, a label in a\n * span, which is then the item placed. A `<text>` is a paragraph whatever its style, and an\n * element holding more than the one run is left as it was.\n */\nfunction aligningText(node: EngineNode): boolean {\n if (node.kind !== 'element' || node.name === 'text' || !TEXT_ELEMENTS.has(node.name)) {\n return false;\n }\n if (node.children.length !== 1 || !oneRun(node.children[0]!)) return false;\n // Under a text element it is a span of that paragraph, unless that one is a view placing it.\n if (isTextElement(node.parent) && !aligningText(node.parent as EngineNode)) return false;\n if (ownLayout(node, 'display') !== 'flex') return false;\n return (\n ALIGNS.has(ownLayout(node, 'alignItems') as string) ||\n ALIGNS.has(ownLayout(node, 'justifyContent') as string)\n );\n}\n\n/** One run of text to place: text itself, or a text element around some, a label in a span. */\nconst oneRun = (child: EngineNode): boolean =>\n child.kind === 'text' || (child.kind === 'element' && TEXT_ELEMENTS.has(child.name));\n\n/** The view a node is committed as: `viewNameOf`, but for a text element that aligns its text. */\nconst committedViewName = (node: EngineNode): string =>\n aligningText(node) ? DEFAULT_VIEW : viewNameOf(node);\n\n/**\n * The native view a node commits as: `Paragraph` for a `<text>`, `VirtualText` for one nested in\n * another, `RawText` for a run of text, and `View` for anything unregistered, which is what an\n * Angular component's host element is.\n *\n * Exported for tools that show a template beside what it becomes, such as the X-ray in the\n * documentation's course, which labels `@ng-native/web`'s DOM with these names. It reads the same\n * table the commit does, so after `registerPlatformComponents('android')` it answers for Android.\n */\nexport function viewNameOf(node: ViewNameNode): string {\n if (node.kind === 'text') return RAW_TEXT;\n // RN models nested text as a span inside a paragraph: `Paragraph > [RawText, Text > RawText]`.\n // Committing a nested `<text>` as another Paragraph gives a paragraph inside a paragraph,\n // which lays out as a separate block instead of flowing inline.\n // A component of the app's own under a name a view set registered: its host is a plain view.\n if (node.componentHost && !node.nativeView && YIELDING.has(node.name)) return DEFAULT_VIEW;\n const registered = registeredViewName(node.name);\n // Nearly every element: a view of some kind, by its name alone.\n if (registered !== PARAGRAPH) return registered ?? DEFAULT_VIEW;\n // One of HTML's text elements that holds something other than text: a view.\n if (node.name !== 'text' && TEXT_ELEMENTS.has(node.name) && !holdsOnlyText(node)) {\n return DEFAULT_VIEW;\n }\n // The paragraph the engine makes for a view's loose text is under a view, whatever the name\n // of the element that view is.\n return nestedText(node) ? VIRTUAL_TEXT : PARAGRAPH;\n}\n\n/**\n * Whether a text element is a span of the paragraph above it: under another text element, but\n * not one that is a view for placing this one (see `aligningText`), nor the engine's own box.\n */\nconst nestedText = (node: ViewNameNode): boolean =>\n !node.anonymous && isTextElement(node.parent) && !placesText(node.parent);\n\n/** Whether a node's parent is a text element committed as a view, to place the run it holds. */\nconst placesText = (parent: ViewNameNode | null | undefined): boolean =>\n parent != null && 'props' in parent && aligningText(parent as unknown as EngineNode);\n\n/**\n * The props every native view reads as a boolean: the `bool` fields of React Native's\n * `BaseViewProps`, `AccessibilityProps` and `HostPlatformViewProps`, by the names JavaScript sends.\n *\n * An attribute arrives as text. A component that declares the prop as an input turns it into a\n * boolean itself, but an element nothing claims, such as a component's own host, holds what it\n * was given, and Android refuses a string where it reads a boolean: `focusable=\"false\"` is\n * `java.lang.String cannot be cast to java.lang.Boolean` at the first commit. iOS ignores it.\n *\n * So the text is made a boolean as it is committed, `\"false\"` false and anything else true, as an\n * attribute reads in HTML. The node keeps the text, which is what `[focusable=\"false\"]` in a\n * stylesheet matches against.\n */\nconst BOOLEAN_VIEW_PROPS = new Set([\n 'accessibilityElementsHidden',\n 'accessibilityIgnoresInvertColors',\n 'accessibilityRespondsToUserInteraction',\n 'accessibilityShowsLargeContentViewer',\n 'accessibilityViewIsModal',\n 'accessible',\n 'collapsable',\n 'collapsableChildren',\n 'focusable',\n 'hasTVPreferredFocus',\n 'needsOffscreenAlphaCompositing',\n // The flags native reads to know an event has a listener, which are booleans as well.\n 'onAccessibilityAction',\n 'onAccessibilityEscape',\n 'onAccessibilityMagicTap',\n 'onAccessibilityTap',\n 'onLayout',\n 'removeClippedSubviews',\n 'renderToHardwareTextureAndroid',\n 'screenReaderFocusable',\n 'shouldRasterizeIOS',\n]);\n\n/**\n * Whether `node` holds nothing `:empty` sees besides `moved`: so it was empty before `moved` came,\n * or is now that it has gone. What `:empty` does not see is `fills` in css.ts to say.\n */\nfunction wasOrIsEmptyWithout(node: EngineNode, moved: EngineNode): boolean {\n if (!fills(moved)) return false;\n return !node.children.some((child) => child !== moved && fills(child));\n}\n\n/**\n * Have the child that paints a node's background merged again with the node: nothing of the\n * child's own moved, and what it paints may have.\n */\nfunction repaint(node: EngineNode): void {\n if (node.paintsOn?.parent === node) node.paintsOn.propsDirty = true;\n}\n\n/** A sixtieth of a second: how far apart the frames native is given for an animation are. */\nconst NATIVE_FRAME = 1000 / 60;\n\n/** The style keys that are a view's background. */\nconst PAINT_KEYS = [\n 'backgroundColor',\n 'experimental_backgroundImage',\n 'experimental_backgroundSize',\n 'experimental_backgroundPosition',\n 'experimental_backgroundRepeat',\n];\n\n/**\n * A node's own props onto what it commits with. No native prop has a hyphen: `data-*` and `aria-*`\n * attributes stay on the node for selectors to match, and an `aria-*` one is mapped to the prop\n * native reads. The node's `attributeOnly` names stay on it the same way.\n */\nfunction writeOwnProps(\n own: Record<string, unknown>,\n props: Record<string, unknown>,\n attributeOnly?: ReadonlySet<string>,\n): void {\n let aria = false;\n for (const key of Object.keys(own)) {\n if (attributeOnly?.has(key)) continue;\n if (key.includes('-')) aria ||= key.startsWith('aria-');\n else if (key !== 'style' && key !== INTRINSIC_SIZE && key !== STYLE_OVERRIDE) {\n props[key] = committedProp(key, own[key]);\n }\n }\n if (!aria) return;\n // An attribute-only `aria-*` is not mapped to the prop native reads either.\n const mapped = attributeOnly?.size\n ? Object.fromEntries(Object.entries(own).filter(([key]) => !attributeOnly.has(key)))\n : own;\n applyAria(mapped, props);\n}\n\n/** A prop as it is committed: a boolean view prop held as text is the boolean the text says. */\nfunction committedProp(key: string, value: unknown): unknown {\n return typeof value === 'string' && BOOLEAN_VIEW_PROPS.has(key) ? value !== 'false' : value;\n}\n\n/**\n * The `pointer-events` an element ends up with, in the order its props are merged: its inline\n * style's, then its `pointerEvents` prop, then what the sheets resolve. The inline one is read for\n * itself because an element no rule matches resolves to what it inherits, with its own inline\n * value only in what it hands down.\n */\nfunction pointerEventsOf(node: EngineNode, resolved: Record<string, unknown>): unknown {\n const inline = node.inlineInherits ? inlineInherited(node.props['style']) : null;\n const own = inline?.['pointerEvents'];\n // Merged over the prop, so its `inherit` is what the sheets and the parent settled, not the prop.\n if (own === 'inherit') return resolved['pointerEvents'];\n return own ?? node.props['pointerEvents'] ?? resolved['pointerEvents'];\n}\n/**\n * A node's `pointer-events` as native takes it, once its props and styles are merged.\n *\n * In CSS `none` is the element alone, and a descendant's `auto` takes touches again, which native\n * calls `box-none`: what a `none` with something inside to open it is committed as. Native's own\n * `none` is the whole subtree. It is what a `none` with nothing inside to open it stays, because\n * Android's text and images take no `pointerEvents` of their own and only an ancestor's `none`\n * keeps touches off them. It is also what the `pointerEvents` prop means, so a `none` that is the\n * prop's is left as it is.\n *\n * An inline `inherit` is what the element has without it, which is `resolved`: what the sheets\n * and its parent settled.\n */\nfunction nativePointerEvents(\n node: EngineNode,\n style: Record<string, unknown>,\n resolved: unknown,\n): void {\n let value = style['pointerEvents'];\n if (value === undefined) return;\n if (value === 'inherit') {\n value = resolved;\n if (value === undefined) delete style['pointerEvents'];\n else style['pointerEvents'] = value;\n }\n if (value === 'none' && node.touchWithin && node.props['pointerEvents'] !== 'none') {\n style['pointerEvents'] = 'box-none';\n }\n}\n/** Whether `node`, whose `pointer-events` is `value`, takes touches or holds something that does. */\nfunction takesTouches(node: EngineNode, value: unknown, prop: unknown): boolean {\n if (value === undefined) return false;\n // The prop's `none` is native's: the whole subtree, whatever is inside it.\n if (value === 'none' && prop === 'none') return false;\n // CSS's `none` and native's `box-none` take no touches themselves: their children answer.\n if (value === 'none' || value === 'box-none') {\n return node.children.some((child) => child.touchWithin);\n }\n return true;\n}\n\n/**\n * Records on `node` whether it, or something inside it, takes touches where it would inherit\n * `none`. When that changes a `none` element's own answer, its props are marked to be committed\n * again.\n *\n * Called as a node is reconciled, after its children, so theirs are already current: a child that\n * was skipped as clean has nothing beneath it that changed, and a change beneath marks every\n * ancestor to come back through here.\n */\nfunction noteTouches(node: EngineNode, style: StyleCache | null): void {\n if (!style) return;\n // Nearly every node: no `pointer-events` in any sheet, style or prop, and nothing recorded.\n const resolved = style.style['pointerEvents'];\n const prop = node.props['pointerEvents'];\n if (resolved === undefined && prop === undefined && !node.inlineInherits && !node.touchWithin) {\n return;\n }\n const value = pointerEventsOf(node, style.style);\n const within = takesTouches(node, value, prop);\n if (within === !!node.touchWithin) return;\n node.touchWithin = within;\n if (value === 'none') node.propsDirty = true;\n}\n\n/** Whether `node` is `ancestor` or somewhere under it. */\nfunction isWithin(node: EngineNode | null, ancestor: EngineNode): boolean {\n for (let at = node; at; at = at.parent) if (at === ancestor) return true;\n return false;\n}\n\n/**\n * The DOM events Angular's `@defer (on interaction)` and `(on hover)` listen for on the trigger\n * element, as the engine events that mean the same thing here.\n *\n * Interaction is `click` and `keydown`: a touch that lifts on the trigger or anything inside it,\n * and focus reaching it, which is what a keyboard or a screen reader does before acting on it.\n * Hover is `mouseenter`, `mouseover` and `focusin`: a pointer entering, which only a trackpad or a\n * mouse produces, and focus. Anything else is not a trigger and is ignored.\n */\nconst DEFER_TRIGGER_EVENTS: Readonly<Record<string, readonly string[]>> = {\n click: ['topTouchEnd'],\n keydown: ['topFocus'],\n mouseenter: ['topPointerEnter'],\n focusin: ['topFocus'],\n};\n\n/** Each trigger listener's teardowns, by DOM event name. Off the node, which rarely has one. */\nconst triggerListeners = new WeakMap<\n object,\n Map<(event: unknown) => void, Map<string, () => void>>\n>();\n\n/**\n * The react tag of the next view any engine creates.\n *\n * Even, because surface root tags are odd (1, 11, 21, ...): an odd view tag eventually collides\n * with a root, and UIKit throws inside `-[RCTViewComponentView mountChildComponentView:]` while\n * adding a view to itself, a native crash with no JS error at all.\n *\n * And far above 2, where React starts. Native keeps one registry of views by tag for every\n * surface, and React numbers its own views 2, 4, 6... on any surface it renders; a development\n * build always has one, LogBox, which renders the first `console.warn` on a surface of its own.\n * Starting where React starts put two views under one tag, and the app crashed natively in\n * `-[RCTComponentViewRegistry dequeueComponentViewWithComponentHandle:tag:]`. One counter for\n * every engine, so two Angular surfaces do not collide with each other either.\n *\n * ponytail: room for about 530 million views in one run of the app before a tag would pass\n * int32, which native keeps them as; recycled and cloned views take no new tag. Wrapping would\n * need to skip tags still mounted.\n */\nconst FIRST_TAG = 2 ** 30;\nlet lastTag = FIRST_TAG - 2;\nconst nextTag = (): number => (lastTag += 2);\n\nlet hoverReported = false;\n\n/**\n * Said once, in development, the first time a `@defer (on hover)` trigger is registered: a phone\n * has no pointer, so on one the block waits for focus alone.\n */\nfunction reportHover(host: HostEngine): void {\n if (hoverReported || !(host instanceof Engine) || !host.dev) return;\n hoverReported = true;\n console.warn(\n '[angular-native] @defer (on hover) fires when a pointer enters the trigger, which takes a trackpad or a mouse (an iPad, or an Android device with one), or when the trigger takes focus. On a phone it waits for focus alone; add another trigger, such as on interaction or on viewport.',\n );\n}\n\n/** Whether a value is one of the engine's own nodes. */\nexport function isEngineNode(value: unknown): value is EngineNode {\n return value instanceof RetainedNode;\n}\n\n/**\n * A retained node, as a class so every node has one shape from its first line: Hermes lays a\n * constructed object out once, where the object-spread this replaced built a literal and copied\n * eighteen fields across for each of the thousands of nodes a screen makes.\n *\n * The first three methods are what Angular's `animate.enter` and `animate.leave` ask an element\n * for directly, rather than through `Renderer2`; everything else those instructions do goes through\n * the renderer. `getAnimations` answers from the transitions the engine is actually running,\n * which is what tells Angular how long to wait before removing a leaving element.\n */\n/**\n * What the Metro preset's `Node` stand-in recognises an engine node by, so that Angular's\n * `instanceof Node` checks pass for these and for nothing else.\n */\nconst ENGINE_NODE = Symbol.for('ng-native.node');\n\nclass RetainedNode {\n static {\n Object.defineProperty(RetainedNode.prototype, ENGINE_NODE, { value: true });\n }\n\n props: Record<string, unknown> = {};\n text = '';\n children: EngineNode[] = [];\n parent: EngineNode | null = null;\n listeners: Map<string, Set<(event: unknown) => void>> | null = null;\n classes: Set<string> | null = null;\n sheet: StyleSheet | null = null;\n hostSheet: StyleSheet | null = null;\n customProperties: Record<string, TokenValue> | null = null;\n styleCache: StyleCache | null = null;\n styleDirty = true;\n styleCommitted: StyleCache | null = null;\n fitContainer: string | undefined = undefined;\n heightBasis: boolean | undefined = undefined;\n hasDirty = false;\n stateDirty = false;\n ownStyle: object | undefined = undefined;\n claimed: true | undefined = undefined;\n dormantHoists: EngineNode[] | null = null;\n committed: Committed | null = null;\n committedUnder: EngineNode | null = null;\n kept: Map<string, KeptHoist> | undefined = undefined;\n remeasure: true | undefined = undefined;\n propsDirty = false;\n structureDirty = false;\n subtreeDirty = false;\n touchWithin: boolean | undefined = undefined;\n box: EngineNode | undefined = undefined;\n anonymous: true | undefined = undefined;\n styled: true | undefined = undefined;\n transitions?: Map<string, Transition>;\n playing?: RunningAnimation;\n scrolled?: ScrollAnimation;\n\n readonly kind: NodeKind;\n readonly name: string;\n /** See `HostNode.host`. */\n readonly host: HostEngine;\n\n constructor(kind: NodeKind, name: string, host: HostEngine) {\n this.kind = kind;\n this.name = name;\n this.host = host;\n }\n\n get tagName(): string {\n return this.name;\n }\n\n /** Angular's dev-mode assertion compares this against `Node.ELEMENT_NODE`. */\n get nodeType(): number {\n return 1;\n }\n\n getAnimations(): unknown[] {\n const running: unknown[] = [];\n const playing = this.playing;\n if (playing && !playing.done) {\n running.push({\n animationName: playing.spec.name,\n effect: {\n // `animate.enter` reads this to know how long to wait. A null count is `infinite`,\n // which is what the Web Animations shape spells as Infinity.\n getTiming: () => ({\n duration: playing.spec.duration * (playing.spec.iterations ?? Infinity),\n delay: playing.spec.delay,\n iterations: playing.spec.iterations ?? Infinity,\n }),\n },\n });\n }\n for (const [property, transition] of this.transitions ?? []) {\n if (transition.done) continue;\n running.push({\n transitionProperty: property,\n effect: {\n getTiming: () => ({ duration: transition.duration, delay: 0, iterations: 1 }),\n },\n });\n }\n return running;\n }\n\n /**\n * Where another node is relative to this one, as the DOM's `compareDocumentPosition` answers:\n * the bits for preceding (2), following (4), containing (8) and contained (16), in tree order.\n * Signal Forms asks, to focus the first of a form's fields in the order the screen shows them.\n */\n compareDocumentPosition(other: RetainedNode): number {\n if (other === this) return 0;\n const path = (node: RetainedNode): RetainedNode[] => {\n const chain: RetainedNode[] = [];\n for (let at: RetainedNode | null = node; at; at = at.parent as RetainedNode | null) {\n chain.unshift(at);\n }\n return chain;\n };\n const mine = path(this);\n const theirs = path(other);\n if (mine[0] !== theirs[0]) return 1 | 32 | 4;\n let depth = 0;\n while (depth < mine.length && depth < theirs.length && mine[depth] === theirs[depth]) depth++;\n if (depth === mine.length) return 4 | 16;\n if (depth === theirs.length) return 2 | 8;\n const siblings = mine[depth - 1]!.children as unknown as RetainedNode[];\n return siblings.indexOf(theirs[depth]!) < siblings.indexOf(mine[depth]!) ? 2 : 4;\n }\n\n /**\n * What Signal Forms' `focusBoundControl()` calls on a field's element, and what a DOM element\n * would do: see `HostEngine.focus`.\n */\n focus(): void {\n this.host.focus(this as unknown as EngineNode);\n }\n\n get classList(): { contains(name: string): boolean } {\n const classes = this.classes;\n return { contains: (name: string): boolean => classes?.has(name) ?? false };\n }\n\n /**\n * What `@defer (on interaction)` and `(on hover)` call on their trigger element, the one place\n * Angular listens on an element directly rather than through `Renderer2`. See\n * `DEFER_TRIGGER_EVENTS`.\n */\n addEventListener(type: string, listener: (event: unknown) => void): void {\n const events = DEFER_TRIGGER_EVENTS[type];\n if (!events) return;\n let byListener = triggerListeners.get(this);\n if (!byListener) triggerListeners.set(this, (byListener = new Map()));\n let byType = byListener.get(listener);\n if (!byType) byListener.set(listener, (byType = new Map()));\n if (byType.has(type)) return;\n if (type === 'mouseenter') reportHover(this.host);\n const stops = events.map((event) =>\n this.host.setEventListener(this as unknown as EngineNode, event, listener),\n );\n byType.set(type, () => {\n for (const stop of stops) stop();\n });\n }\n\n removeEventListener(type: string, listener: (event: unknown) => void): void {\n const byType = triggerListeners.get(this)?.get(listener);\n byType?.get(type)?.();\n byType?.delete(type);\n }\n}\n\n/**\n * RN-specific helpers, injected rather than imported so the engine stays runnable under Node.\n */\nexport interface EngineOptions {\n /**\n * React Native's `NativeAnimatedHelper`, which lets native move a view by a scroll with no\n * JavaScript in between: how sticky headers stay pinned on a fast fling. The platform supplies it\n * on a device; without it, the components move those views from JavaScript as before.\n */\n nativeAnimated?: NativeAnimated | null;\n /**\n * RN's `processColor`. Narrower than `unknown` on purpose: it is only ever handed the value of\n * a `*color` prop, and typing it that way is what lets an app pass RN's function straight in\n * rather than casting at every call site.\n */\n processColor?: (value: string | number) => unknown;\n /**\n * RN's `resolveAssetSource`. `require('./x.png')` compiles to an asset *id*, and only this\n * turns it into `{uri, width, height, scale}`. Without it local images cannot work at all,\n * while remote `{uri}` objects pass through and appear to prove the prop is fine.\n */\n resolveAssetSource?: (value: unknown) => unknown;\n /**\n * The application-level sheet, compiled at build time. The one set of rules allowed to match a\n * node whatever component created it, which is what resets, utility classes and `:root` tokens\n * all need.\n */\n globalStyles?: StyleSheet | null;\n /**\n * What media queries are evaluated against. Pushed in rather than read, because the engine\n * imports nothing from React Native and a host may have its own idea of the viewport.\n */\n conditions?: Conditions;\n /**\n * Custom properties the device knows and the stylesheet cannot: the hairline width, and\n * whatever else is settled before the first frame. Seeded on the root, below `:root`, so an\n * app's own sheet still overrides them. Values that only arrive later - the safe-area insets,\n * which nothing knows until a view has been laid out - come through `updateTokens` instead.\n */\n tokens?: Readonly<Record<string, TokenValue>>;\n /**\n * Report host primitives used without their component (see `claimHost`). Defaults to RN's\n * `__DEV__`, so a release build never looks.\n */\n dev?: boolean;\n /**\n * The clock CSS transitions run on. Pushed in for the same reason everything else is: the\n * engine imports nothing, and a test drives time rather than waiting for it.\n */\n now?: () => number;\n /**\n * Called when the tree goes from clean to dirty. The host uses it to schedule a commit for a\n * change that arrives outside change detection, which is where Angular's animation queue puts\n * the classes for `animate.enter` and `animate.leave`.\n */\n onDirty?: () => void;\n /**\n * Where an error thrown while a native event is being dispatched goes, with the event's name.\n * The platform adapter points it at the app's `ErrorHandler`. Without one it is logged, and\n * either way it is never rethrown: see `dispatchEvent` for why.\n */\n onError?: (error: unknown, topLevelType: string) => void;\n}\n\n/**\n * A prop whose value is a colour, and so has to go through `processColor` before native reads it.\n *\n * The `Android` suffix is part of the test because React Native names its platform-specific props\n * that way round: `underlineColorAndroid` is a colour and does not end in `color`, and Android's\n * `ColorPropConverter` takes a number or a platform-colour map and refuses a string, so an unnamed\n * one arrives as the wrong type. `iOS`-suffixed props are not in the set because none of them are\n * colours - `shouldRasterizeIOS` is a boolean.\n */\nconst IS_COLOR_PROP = /color(android)?$/i;\n/**\n * Colour props React Native does not name with a `color` suffix: `<switch>`'s pair ends in the\n * state each one paints - `trackColorForTrue` and `trackColorForFalse`. They are the same type\n * problem the `Android` suffix causes: Android's `ColorPropConverter` takes a number or a\n * platform-colour map, refuses a string, and throws rather than approximating one.\n */\nconst STATE_COLOR_PROPS = new Set(['trackColorForTrue', 'trackColorForFalse']);\n/** Answers per key name, once: the regex ran for every prop of every node in every commit. */\nconst colorProps = new Map<string, boolean>();\nfunction isColorProp(key: string): boolean {\n let answer = colorProps.get(key);\n if (answer === undefined) {\n colorProps.set(\n key,\n (answer = IS_COLOR_PROP.test(key) || STATE_COLOR_PROPS.has(key) || BRUSH_PROPS.has(key)),\n );\n }\n return answer;\n}\nconst ASSET_PROPS = new Set(['source', 'defaultSource', 'loadingIndicatorSource']);\n\n/**\n * Props whose value is a list of objects with a `color` inside.\n *\n * Colour processing keys off the *property name*, which cannot see a colour nested in an array.\n * That matters more than it sounds: with `enableNativeCSSParsing` off, which is the default,\n * Fabric does not parse a colour string either, so an unprocessed nested colour is not\n * approximated, it is dropped.\n */\nconst NESTED_COLOR_LIST_PROPS = new Set(['boxShadow']);\n\n/** The props of an SVG shape that take a brush, not a colour. */\nconst BRUSH_PROPS = new Set(['fill', 'stroke']);\n\n/** Styles arrive as objects, arrays, nested arrays and nulls. Reduce to one object. */\n/**\n * A bound transform is still the CSS string: see `inline-transform.ts`. One CSS cannot read\n * leaves the transform the rules set, as a browser drops it.\n */\nfunction boundTransform(\n node: EngineNode,\n style: Record<string, unknown>,\n cascaded: unknown,\n): Record<string, unknown> {\n const text = style['transform'];\n if (typeof text !== 'string') return style;\n // The same list for the same string, commit after commit: a transition compares the two ends\n // it is given, and a list made afresh each time reads as a new place to go.\n if (node.boundTransform?.text !== text) node.boundTransform = { text, list: transformList(text) };\n const list = node.boundTransform.list ?? cascaded;\n if (list === undefined) delete style['transform'];\n else style['transform'] = list;\n return style;\n}\n\n/** A transform string as the list native reads, and none for one CSS cannot read. */\nconst transformOf = (value: string): unknown[] => transformList(value) ?? [];\n\nfunction flattenStyle(value: unknown, into: Record<string, unknown>): Record<string, unknown> {\n if (!value) return into;\n if (Array.isArray(value)) {\n for (const entry of value) flattenStyle(entry, into);\n return into;\n }\n if (typeof value === 'object') Object.assign(into, value);\n return into;\n}\n\n/** The timing a rule can set apart from a property list, and the part of the spec each sets. */\nconst TRANSITION_TIMING = {\n $transitionDuration: 'duration',\n $transitionDelay: 'delay',\n $transitionEasing: 'easing',\n} as const;\n\n/**\n * The transition spec, with any timing set by a rule of its own laid over it: `.duration-700`\n * beside `.transition`. A rule that writes the timing itself compiles it to `null`, which is how\n * a stronger transition keeps its own.\n *\n * Every key is taken out of `props`: they are instructions for this engine, and nothing native\n * has ever heard of them. See `animated` for why each `delete` is guarded.\n */\nfunction transitionSpec(\n props: Record<string, unknown>,\n): Record<string, TransitionSpec> | undefined {\n // Keyed `$transition` by the compiler, so a view's own `transition` prop reaches it.\n let spec = props['$transition'] as Record<string, TransitionSpec> | undefined;\n if (spec !== undefined) delete props['$transition'];\n for (const [key, part] of Object.entries(TRANSITION_TIMING)) {\n if (!(key in props)) continue;\n const value = props[key];\n delete props[key];\n if (value === null || spec === undefined) continue;\n const timed: Record<string, TransitionSpec> = {};\n for (const name of Object.keys(spec)) timed[name] = { ...spec[name]!, [part]: value };\n spec = timed;\n }\n return spec;\n}\n\n/**\n * The keys CSS's `translate`, `rotate` and `scale` compile to, in the order they apply. The\n * compiler's `INDIVIDUAL_TRANSFORMS` in `packages/metro/css/properties.cjs` writes the same three.\n */\nconst INDIVIDUAL_TRANSFORMS = ['__translate', '__rotate', '__scale'] as const;\n\n/**\n * Fold the individual transform properties into the one list native has.\n *\n * They cascade, transition and animate as properties of their own, so this runs last, on what\n * the node is about to paint. CSS Transforms 2 applies translate, then rotate, then scale, then\n * `transform`, and a list applies left to right, so that is the order they are written in.\n */\nfunction composeTransform(\n node: EngineNode,\n props: Record<string, unknown>,\n): Record<string, unknown> {\n const [translate, rotate, scale] = INDIVIDUAL_TRANSFORMS.map((key) => props[key]);\n if (translate === undefined && rotate === undefined && scale === undefined) return props;\n // Guarded, as `animated` guards its own: a `delete` is what sends an object to Hermes's slow\n // dictionary layout, and most nodes have none of these.\n for (const key of INDIVIDUAL_TRANSFORMS) if (key in props) delete props[key];\n\n const transform = props['transform'];\n const parts = [translate, rotate, scale, transform];\n const last = node.composedTransform;\n let value: unknown[];\n if (last && last.parts.every((part, i) => part === parts[i])) {\n value = last.value;\n } else {\n // A bound style's transform is still the CSS string: see `inline-transform.ts`.\n const own = typeof transform === 'string' ? transformOf(transform) : transform;\n value = [translate, rotate, scale, own].flatMap((part) => (Array.isArray(part) ? part : []));\n node.composedTransform = { parts, value };\n }\n\n if (value.length) props['transform'] = value;\n else delete props['transform'];\n return props;\n}\n\n/**\n * Fabric *merges* the raw props handed to a clone onto the node's existing props, so a prop\n * that has gone away has to be sent explicitly as `null`. Sending the whole prop object would\n * silently keep removed props alive.\n */\nfunction diffProps(\n prev: Record<string, unknown>,\n next: Record<string, unknown>,\n): Record<string, unknown> | null {\n let payload: Record<string, unknown> | null = null;\n for (const key of Object.keys(next)) {\n if (!Object.is(prev[key], next[key])) (payload ??= {})[key] = next[key];\n }\n for (const key of Object.keys(prev)) {\n if (!(key in next)) (payload ??= {})[key] = null;\n }\n return payload;\n}\n\n/**\n * The prop a replaced element, an image, puts its own pixel size in: `{ width, height }`.\n *\n * Not a style, because a style binding is inline style and beats every rule, so a picture's own\n * 600 by 600 would override `class=\"size-11\"`. CSS gives a replaced element's natural size the\n * lowest precedence of all, below any rule and any bound style, and that is what this is for.\n * It never reaches native.\n */\nconst INTRINSIC_SIZE = 'intrinsicSize';\n\n/**\n * The prop a component puts the style it must have the last word on in, over the caller's.\n *\n * The other end of the scale from `intrinsicSize`. Angular merges a component's host style\n * binding under the template's, so a caller's `[style]=\"{flex: 1}\"` beats the host's own\n * `flex: 0`; that is the right order for a default and the wrong one for an adjustment the\n * component is making on the caller's behalf, which RN composes after the caller's style. A\n * keyboard-avoiding view's padding, height and flex are that. Applied after inline style, a key\n * at a time, so every other property the caller wrote still applies. It never reaches native.\n */\nconst STYLE_OVERRIDE = 'styleOverride';\n\ninterface IntrinsicSize {\n readonly width: number;\n readonly height: number;\n}\n\nconst isSet = (value: unknown): boolean => value !== undefined && value !== null;\n\n/**\n * Size a box from its content's natural size, where nothing else did, as CSS sizes an `<img>`.\n *\n * Neither dimension set: the natural size, or the natural width alone when the author gave an\n * aspect ratio for Yoga to take the height from. One dimension set: the other follows the\n * picture's proportions, through `aspectRatio`, unless the author gave one of their own.\n */\nfunction applyIntrinsicSize(props: Record<string, unknown>, size: IntrinsicSize): void {\n const width = isSet(props['width']);\n const height = isSet(props['height']);\n if (width && height) return;\n const ownRatio = isSet(props['aspectRatio']);\n if (!width && !height) {\n props['width'] = size.width;\n if (!ownRatio) props['height'] = size.height;\n return;\n }\n if (!ownRatio && size.width > 0 && size.height > 0) {\n props['aspectRatio'] = size.width / size.height;\n }\n}\n\nconst now = (): number => globalThis.performance?.now?.() ?? Date.now();\n\nfunction sameHandles(a: readonly FabricNode[], b: readonly FabricNode[]): boolean {\n return a.length === b.length && a.every((handle, i) => handle === b[i]);\n}\n\n/**\n * Whether a node could be the element a compound is written for, by its classes alone: its own,\n * and those of one alternative of each `:is()` on it, which is where Tailwind names a group or\n * a peer. A compound with no class in either could be any element.\n */\nfunction couldBe(compound: Compound, node: EngineNode): boolean {\n if (!compound.classes.every((name) => node.classes?.has(name))) return false;\n return (compound.is ?? []).every((alternatives) =>\n alternatives.some((option) => couldBe(option, node)),\n );\n}\n\n/** Dev-time commit accounting, so a slow frame can be attributed rather than guessed at. */\nexport interface EngineStats {\n commits: number;\n lastCommitMs: number;\n /** The initial mount, which is a different animal from a steady-state update. */\n firstCommitMs: number;\n /** Worst commit *after* the mount. This is the number that matters for frame rate. */\n worstCommitMs: number;\n /** Commits that took longer than 8ms, a frame at 120Hz, excluding the mount. */\n slowCommits: number;\n /**\n * Worst `begin()`..`end()` span, excluding the mount. This brackets Angular's whole render\n * pass - template execution, bindings, the commit - so comparing it against `worstCommitMs`\n * says whether time is going into the renderer or into change detection around it.\n */\n worstRenderMs: number;\n createdNodes: number;\n clonedNodes: number;\n}\n\nconst FRAME_BUDGET_MS = 8;\n\nexport class Engine implements HostEngine {\n /** Scopes the CSS resolver's memo. Bumped once per commit. */\n private styleEpoch = 0;\n\n /** The node `:focus` currently applies to. */\n private focusedNode: EngineNode | null = null;\n\n readonly stats: EngineStats = {\n commits: 0,\n lastCommitMs: 0,\n firstCommitMs: 0,\n worstCommitMs: 0,\n slowCommits: 0,\n worstRenderMs: 0,\n createdNodes: 0,\n clonedNodes: 0,\n };\n\n private eventsRegistered = false;\n\n readonly root: EngineNode = new RetainedNode('element', 'root', this);\n\n private readonly fabric: FabricUIManager;\n private readonly rootTag: number;\n private readonly styles: StyleResolver;\n /** Whether to run the development checks, which a release build skips. */\n readonly dev: boolean;\n private readonly now: () => number;\n private onDirty: (() => void) | undefined;\n private onError: ((error: unknown, topLevelType: string) => void) | undefined;\n /** Nodes with at least one transition in flight, so a frame walks those and nothing else. */\n private readonly running = new Set<EngineNode>();\n /** Nodes playing a `@keyframes` animation. */\n private readonly playing = new Set<EngineNode>();\n /**\n * Elements of a hoisted name (`registerHoist`) that are in the tree, so a commit need not search\n * for them. Only those in the tree: see `releaseDetached`.\n */\n private readonly hoisted = new Set<EngineNode>();\n /** The nodes taken out of a child list since the last commit. See `releaseDetached`. */\n private readonly removedSinceCommit = new Set<EngineNode>();\n /**\n * `@keyframes` by name, across every sheet registered. One registry rather than one per sheet,\n * because that is the scope CSS gives them: a name defined in a global stylesheet is usable\n * from a component's. The cost is that two components defining the same name collide, last one\n * in wins, exactly as two stylesheets in a document would.\n */\n private readonly keyframes = new Map<string, readonly Keyframe[]>();\n /** Every sheet registered, in the order a document would hold them. See `sheetReplaced`. */\n private readonly sheetOrder: StyleSheet[] = [];\n /** The `@keyframes` each playing animation was started from. See `startPlaying`. */\n private readonly playedFrames = new WeakMap<RunningAnimation, readonly Keyframe[]>();\n /** Element names already reported as unclaimed, so a list of a thousand rows reports once. */\n private readonly reported = new Set<string>();\n private readonly processColor: (value: string | number) => unknown;\n /**\n * Whether any sheet seen so far asks about a node's position among its siblings. Until one\n * does, a child list can move without anything else needing to be looked at again.\n */\n private structuralSheets = false;\n /** How many children after a change in a list one of them reaches. See `siblingReach`. */\n private structuralAfter = 0;\n /** Whether one of them reaches the children before it. */\n private structuralBefore = false;\n /** The compounds of theirs that read an element's place from under it. See `markPlace`. */\n private readonly placeElsewhere = new Set<Compound>();\n /** The sheets `watchStructure` has read, which it is asked about once an element. */\n private readonly watchedStructure = new WeakSet<StyleSheet>();\n /** Whether any sheet uses `:has()`. See `markBeneath`. */\n private hasSheets = false;\n private readonly resolveAssetSource: (value: unknown) => unknown;\n\n constructor(fabric: FabricUIManager, rootTag: number, options: EngineOptions = {}) {\n this.fabric = fabric;\n this.rootTag = rootTag;\n const conditions = options.conditions ?? { width: 0, height: 0, colorScheme: 'light' };\n this.styles = new StyleResolver(options.globalStyles ?? null, conditions);\n this.viewportSize = { width: conditions.width, height: conditions.height };\n this.fontScale = conditions.fontScale;\n if (options.tokens) this.styles.setRootTokens(options.tokens);\n this.watchStructure(options.globalStyles);\n this.watchHas(options.globalStyles);\n this.watchActive(options.globalStyles);\n this.dev = options.dev ?? (globalThis as { __DEV__?: boolean }).__DEV__ === true;\n if (this.dev) {\n this.styles.onUndefinedToken = (name, props, on) =>\n this.reportUndefinedToken(name, props, on);\n this.styles.onUnreadDisplay = (name, value) => this.reportUnreadDisplay(name, value);\n }\n this.now = options.now ?? (() => globalThis.performance?.now?.() ?? Date.now());\n this.onDirty = options.onDirty;\n this.onError = options.onError;\n this.registerSheet(options.globalStyles);\n this.processColor = options.processColor ?? ((value) => value);\n this.resolveAssetSource = options.resolveAssetSource ?? ((value) => value);\n this.scrollDriver = options.nativeAnimated\n ? new NativeScrollDriver(options.nativeAnimated)\n : null;\n // Eagerly, not on the first listener. Fabric holds exactly one event handler and\n // `ReactFabric` installs React's at module scope, so until we claim it every native event\n // lands in React's event plugins. Those look the name up in a view config registry we never\n // populate and throw `Unsupported top level event type` from inside the native dispatch, or\n // read `instanceHandle.stateNode.canonical` off our own node and throw on `canonical`.\n // Nothing here emits events until a component asks for one, so waiting looks safe; it is not.\n // `RNSScreen` fires `onWillAppear`/`onHeaderHeightChange` on its own during a push, with no\n // listener anywhere, and the throw unwinds through the mounting transaction that pushed it.\n // The next commit then reads freed props and the process dies in `updateProps`.\n this.registerEventHandler();\n }\n\n /**\n * A rotation, a window resize, or the system switching to dark mode.\n *\n * None of those change a single node, so nothing would be dirty and nothing would re-render.\n * Marking the root is what gets the tree walked again; every cached style is already invalid,\n * because each carries the conditions version it was resolved under.\n */\n /**\n * Move `:focus`, invalidating only the two nodes involved.\n *\n * Precise rather than by generation: unlike a rotation, the engine knows exactly which nodes\n * changed, and a keystroke's worth of focus movement should not invalidate the tree.\n */\n private setFocused(node: EngineNode | null): void {\n if (this.focusedNode === node) return;\n if (this.focusedNode) {\n this.focusedNode.focused = false;\n this.markProps(this.focusedNode);\n }\n this.focusedNode = node;\n if (node) {\n node.focused = true;\n this.markProps(node);\n }\n this.commit();\n }\n\n /**\n * Set or clear `:active` along a responder chain, marking each node so its style re-resolves.\n *\n * Returns whether anything moved, because the caller has to commit: a gesture changes no\n * binding, so nothing marks an Angular view dirty and no change-detection pass would follow.\n */\n private setActiveChain(from: EngineNode | null, active: boolean): boolean {\n let changed = false;\n for (let node = from; node; node = node.parent) {\n if (node.active === active) continue;\n node.active = active;\n this.markActive(node);\n changed = true;\n }\n return changed;\n }\n\n /** Whether any sheet styles a pressed element, and each compound that asks about one from another. */\n private activeUse: { own: boolean; elsewhere: readonly Compound[] } = {\n own: false,\n elsewhere: [],\n };\n\n /** What each sheet in play asks about a pressed element: `activeUse` is all of them together. */\n private readonly activeBySheet = new Map<StyleSheet, ReturnType<typeof usesActive>>();\n\n /** Note what a sheet in play asks about a pressed element. See `markActive`. */\n private watchActive(sheet: StyleSheet | null | undefined): void {\n // Asked for every element a component's sheet is given to: noted once a sheet.\n if (!sheet || this.activeBySheet.has(sheet)) return;\n const use = usesActive(sheet);\n this.activeBySheet.set(sheet, use);\n if (!use.own && !use.elsewhere.length) return;\n this.countActive();\n if (this.styles.tracksHas) return;\n // What a pressed element is compared with is the rules it matched, which no cache kept until\n // a sheet asked. Nothing is resolved yet when the sheet is the one the engine was made with.\n this.styles.tracksHas = true;\n if (!this.root) return;\n this.root.styleDirty = true;\n this.markPath(this.root);\n }\n\n /** A sheet has left play, by a hot swap or by being removed: what it asked goes with it. */\n private unwatchActive(sheet: StyleSheet): void {\n if (this.activeBySheet.delete(sheet)) this.countActive();\n }\n\n private countActive(): void {\n const all = [...this.activeBySheet.values()];\n this.activeUse = {\n own: all.some((use) => use.own),\n elsewhere: all.flatMap((use) => use.elsewhere),\n };\n }\n\n /**\n * A press began or ended on `node` or under it, which is all that changed about it. A press\n * reaches every ancestor up to the root, and marking each as restyled would style the whole\n * screen again, twice a press. So each is only matched again, and keeps its style and all\n * that is under it unless it now matches other rules. An element a rule asks about from\n * inside or beside it, `.card:active .title`, changes more than itself, and is restyled with\n * everything under it as any other change is. With no rule for a pressed element at all there\n * is nothing to match.\n */\n private markActive(node: EngineNode): void {\n const { own, elsewhere } = this.activeUse;\n if (!own && !elsewhere.length) return;\n if (elsewhere.some((compound) => couldBe(compound, node))) return this.markProps(node);\n node.stateDirty = true;\n this.markPath(node.parent ?? node);\n }\n\n /**\n * Custom properties the device knows and the stylesheet cannot, once they change.\n *\n * Merged rather than replaced: the insets come from a view and the hairline from the device, so\n * a caller owns the properties it names and nothing else. Each owner writes all of its own at\n * once - four insets together, never one - so nothing is left over from a previous rotation.\n */\n /**\n * Match `sheet` against every node from now on, after the global sheet the engine was made\n * with, and restyle everything; false, and nothing done, when it already is. How a platform\n * applies a component whose CSS is not scoped, such as Angular's `ViewEncapsulation.None`.\n * `replacing` is a sheet added before that this one takes the place of, after a hot swap.\n */\n addGlobalSheet(sheet: StyleSheet, replacing?: StyleSheet): boolean {\n if (!this.styles.addGlobalSheet(sheet, replacing)) return false;\n if (replacing) this.sheetReplaced(replacing, sheet);\n else this.registerSheet(sheet);\n this.watchStructure(sheet);\n this.watchHas(sheet);\n this.watchActive(sheet);\n this.markPath(this.root);\n this.markWrittenFor(sheet, this.root);\n return true;\n }\n\n /**\n * Have styled again each node a sheet just added could match. The rest keep the style they\n * have, which the resolver lets stand for a node none of the sheet's rules is written for,\n * so a commit steps over them: the walk here is what finds the ones it must not step over.\n */\n private markWrittenFor(sheet: StyleSheet, node: EngineNode): void {\n if (node.kind === 'element' && this.styles.couldMatch(sheet, node)) {\n node.styleDirty = true;\n this.markPath(node);\n }\n for (const child of node.children) this.markWrittenFor(sheet, child);\n }\n\n /**\n * Stop matching a sheet `addGlobalSheet` added, and restyle everything; false, and nothing\n * done, when it is not one. A hot swap that leaves a None component no rules, or makes it scoped.\n */\n removeGlobalSheet(sheet: StyleSheet): boolean {\n if (!this.styles.removeGlobalSheet(sheet)) return false;\n this.sheetReplaced(sheet, null);\n this.markPath(this.root);\n return true;\n }\n\n updateTokens(next: Readonly<Record<string, TokenValue>>): void {\n this.styles.setRootTokens({ ...this.styles.rootTokens, ...next });\n this.root.subtreeDirty = true;\n this.commit();\n }\n\n /**\n * The system text size changed: measure every text and text input again, and commit.\n *\n * React Native's surface re-measures its text when the content size category changes, on a\n * commit of its own. The next commit from here is built from the handles the engine holds,\n * which are the nodes from before that, laid out at the old size, and Yoga keeps a clean node's\n * layout: every text whose content had not changed kept its old box, with its glyphs drawn at\n * the new size inside it, clipped. So each one is committed again, cloned with its children,\n * which is what makes Fabric dirty a measured node and measure it at the size now in effect.\n */\n remeasureText(): void {\n const again = (measured: EngineNode): void => {\n measured.remeasure = true;\n this.markProps(measured, false);\n };\n const visit = (node: EngineNode): void => {\n for (const child of node.children) {\n // The paragraph of a run of text written straight into a view is kept on the text.\n if (child.kind === 'text' && child.box?.committed) again(child.box);\n if (child.kind !== 'element') continue;\n if (child.committed && MEASURED_VIEWS.has(committedViewName(child))) again(child);\n visit(child);\n }\n };\n visit(this.root);\n this.commit();\n }\n\n /** Whether any text has been laid out again for a face. See `fontsRegistered`. */\n private fontsRefreshed = false;\n /** How many times each paragraph or text input has been laid out again for a face. */\n private readonly fontRefreshes = new WeakMap<EngineNode, number>();\n /** The text inputs whose `fontFamily` the next commit sends again. See `fontsRegistered`. */\n private readonly fontResends = new WeakSet<EngineNode>();\n\n /**\n * Faces registered after text naming them was laid out: lay that text out again, and commit.\n *\n * Native keeps a paragraph's text layout, face included, keyed by what the paragraph asks for.\n * iOS caches the attributed string it built and the size it measured, so text laid out before\n * its face registered stays in the fallback face, and committing it again unchanged hits the\n * same cache. What it asks for has to change, and nothing visible can: each paragraph naming\n * one of the families is committed with its text size cap raised by a step too small to see, or\n * set far above any size the platform offers where it had none. Its view, and everything native\n * holds for it, stays where it is. Android keys its text layout the same way and applies the\n * cap the same way, so the same change works there.\n *\n * A text input takes its font another way. iOS sets it on the field again only when the input's\n * text attributes change, which the same cap does. Android sets it only when `fontFamily` is in\n * the props it is sent, and the engine sends only what changed, so it is sent again once.\n */\n /**\n * Loads have settled for these families: every node held back for one, a span inside a\n * paragraph included, is laid out with the name again, registered or not. See `loadingFamilies`.\n */\n fontsSettled(families: ReadonlySet<string>): void {\n let held = false;\n const visit = (node: EngineNode): void => {\n for (const child of node.children) {\n if (child.heldFamily !== undefined && families.has(child.heldFamily)) {\n this.markProps(child, false);\n held = true;\n }\n visit(child);\n }\n };\n visit(this.root);\n if (held) this.commit();\n }\n\n fontsRegistered(families: ReadonlySet<string>): void {\n const visit = (node: EngineNode): void => {\n for (const child of node.children) {\n if (child.kind !== 'element') continue;\n const viewName = viewNameOf(child);\n const input = TEXT_INPUTS.has(viewName);\n if (child.committed && (viewName === PARAGRAPH || input) && namesFamily(child, families)) {\n this.fontRefreshes.set(child, (this.fontRefreshes.get(child) ?? 0) + 1);\n if (input) this.fontResends.add(child);\n this.fontsRefreshed = true;\n this.markProps(child, false);\n } else {\n visit(child);\n }\n }\n };\n visit(this.root);\n this.commit();\n }\n\n /**\n * Put the cursor in a text input; bring anything else on screen, in the scroll view it is in.\n * A form sends the user to the first field that needs fixing this way, and a toggle or a picker\n * has no cursor to take, so it is scrolled to instead.\n */\n focus(node: EngineNode): void {\n if (TEXT_INPUTS.has(viewNameOf(node))) this.dispatchCommand(node, 'focus');\n else this.reveal(node);\n }\n\n /**\n * Scroll the nearest scroll view the node is in by as little as brings the node fully on\n * screen, with `margin` to spare - UIKit's `scrollRectToVisible`. `visibleBottom` is where in\n * the window the visible area ends when something covers the bottom of the scroll view: the\n * keyboard's top edge, for a field the keyboard would otherwise hide.\n *\n * Measured in the window, all of it, so the scroll view's offset needs no tracking: it is how\n * far its content's top edge is above its own.\n */\n reveal(node: EngineNode, options: { visibleBottom?: number; margin?: number } = {}): void {\n // The nearest scroll view that scrolls up and down: a sideways carousel on a page is not\n // what moves a field clear of the bottom of the screen.\n let scroll = node.parent;\n while (\n scroll &&\n !(SCROLL_VIEWS.has(viewNameOf(scroll)) && scroll.props['horizontal'] !== true)\n ) {\n scroll = scroll.parent;\n }\n const content = scroll && this.visibleChildren(scroll)[0];\n if (!scroll || !content) return;\n const margin = options.margin ?? 16;\n this.measure(scroll, (view) => {\n this.measure(content, (inner) => {\n this.measure(node, (target) => {\n const offset = view.y - inner.y;\n const top = view.y + margin;\n const bottom = Math.min(view.y + view.height, options.visibleBottom ?? Infinity) - margin;\n let by = 0;\n if (target.y + target.height > bottom) by = target.y + target.height - bottom;\n else if (target.y < top) by = target.y - top;\n if (by !== 0)\n this.dispatchCommand(scroll, 'scrollTo', [0, Math.max(0, offset + by), true]);\n });\n });\n });\n }\n\n /**\n * Commit one measured node again, cloned with its children, so Fabric measures it once more.\n *\n * A text input is measured from its native state, and a text set from JavaScript reaches that\n * state only in the layout after the measurement, so the commit carrying the text sizes the\n * field for the text it had before. This is the commit that sizes it for the new one: one of\n * the exceptions to a commit per pass, because waiting for the next pass would leave the field\n * the wrong height until something else changed.\n */\n remeasure(node: EngineNode): void {\n if (!node.committed) return;\n node.remeasure = true;\n this.markProps(node, false);\n this.commit();\n }\n\n /**\n * A node's component rules are its creating sheet's, so this matches it against `like`'s, or\n * against the one it was created with once `like` is null.\n */\n adoptScope(node: EngineNode, like: EngineNode | null): void {\n if (like && !this.ownSheets.has(node)) this.ownSheets.set(node, node.sheet);\n const sheet = like ? like.sheet : this.ownSheets.get(node);\n if (sheet === undefined || node.sheet === sheet) return;\n node.sheet = sheet;\n this.styles.noteSheet(sheet);\n this.watchStructure(sheet);\n this.watchHas(sheet);\n this.watchActive(sheet);\n this.markProps(node);\n }\n\n /** The sheet each node given another's scope was created with. */\n private readonly ownSheets = new WeakMap<EngineNode, StyleSheet | null>();\n\n /** The window's size, from the conditions media queries use. Zero until the platform says. */\n get viewport(): { readonly width: number; readonly height: number } {\n return this.viewportSize;\n }\n\n private viewportSize: { readonly width: number; readonly height: number };\n /** The system text size, from the conditions. See `Conditions.fontScale`. */\n private fontScale: number | undefined;\n\n private readonly viewportWatchers = new Set<() => void>();\n\n /** Calls `listener` after each change of conditions, which is when `viewport` can change. */\n watchViewport(listener: () => void): () => void {\n this.viewportWatchers.add(listener);\n return () => this.viewportWatchers.delete(listener);\n }\n\n updateConditions(next: Conditions): void {\n this.viewportSize = { width: next.width, height: next.height };\n this.fontScale = next.fontScale;\n this.styles.setConditions(next);\n this.root.subtreeDirty = true;\n // Committed here rather than left to the next change-detection pass, because there may not\n // be one: no view is dirty, so a tick does no work and never reaches the renderer at all.\n this.commit();\n for (const watcher of this.viewportWatchers) watcher();\n }\n\n // --- mutation API -----------------------------------------------------\n\n createElement(name: string, sheet: StyleSheet | null = null): EngineNode {\n const node = new RetainedNode('element', name, this);\n node.sheet = sheet;\n this.styles.noteSheet(sheet);\n const html = HTML_ELEMENTS.get(name);\n if (html !== undefined) {\n if (html.role) node.props['accessibilityRole'] = html.role;\n node.styled = html.styled;\n }\n this.watchStructure(sheet);\n this.watchHas(sheet);\n this.watchActive(sheet);\n if (HOISTS[name]) this.hoisted.add(node);\n return node;\n }\n\n addClass(node: EngineNode, name: string): void {\n (node.classes ??= new Set()).add(name);\n this.markClasses(node, [name]);\n }\n\n removeClass(node: EngineNode, name: string): void {\n node.classes?.delete(name);\n this.markClasses(node, [name]);\n }\n\n /**\n * Mark a node whose classes changed, by what the rules that name those classes can restyle.\n *\n * A class no selector names changes no style: a library's own marker, of an overlay that is\n * animating or a control that was touched. One named only as what a rule's element is\n * inside, `.animating .close`, restyles the elements under the node that such rules are for.\n * Either way a whole subtree is not styled again for a class that has no say in it. Any other\n * class restyles the node and everything under it, as any other change to it does.\n *\n * A sheet that names a class later restyles what it is for as it arrives, and a node not yet\n * committed is styled when it is, with the class as it is then.\n */\n private markClasses(node: EngineNode, changed: Iterable<string>): void {\n const reach = this.styles.reachOf(changed);\n if (reach === true) return this.markProps(node);\n this.markProps(node, false);\n if (reach) this.markUnder(node, reach);\n }\n\n /** Have styled again each element under a node that one of `subjects`' rules could be for. */\n private markUnder(node: EngineNode, subjects: Subjects): void {\n for (const child of node.children) {\n if (child.kind !== 'element') continue;\n if (this.styles.isFor(subjects, child)) {\n // And with it all under it, which is styled from it.\n child.styleDirty = true;\n this.markPath(child);\n } else this.markUnder(child, subjects);\n }\n }\n\n /**\n * The sheet of the component `node` hosts, whose `:host` rules it matches. Set again when a hot\n * swap replaces the component's sheet, which recreates the views inside but not the host, so the\n * host is styled afresh here.\n */\n setHostSheet(node: EngineNode, sheet: StyleSheet | null): void {\n if (node.hostSheet === sheet) return;\n node.hostSheet = sheet;\n this.styles.noteSheet(sheet);\n this.watchStructure(sheet);\n this.watchActive(sheet);\n this.markProps(node);\n }\n\n /**\n * Style for `node` that any matched rule or inline style overrides, as a browser's own default\n * for an element is. `mount` gives the root component's host the surface's height this way, as\n * the web's mount point has, unless the app's `:host` sizes it otherwise.\n */\n setDefaultStyle(node: EngineNode, style: Readonly<Record<string, unknown>> | undefined): void {\n node.defaultStyle = style;\n this.markProps(node);\n }\n\n /** `class=\"a b\"` from a template. Replaces the set rather than adding to it. */\n setClasses(node: EngineNode, value: string): void {\n const names = value.split(/\\s+/).filter(Boolean);\n const before = node.classes;\n node.classes = names.length ? new Set(names) : null;\n // Each class that came or went: one in both changes nothing.\n const changed = [...names.filter((name) => !before?.has(name))];\n for (const name of before ?? []) if (!node.classes?.has(name)) changed.push(name);\n this.markClasses(node, changed);\n }\n\n /** Angular's `@if`/`@for`/`ViewContainerRef` markers. Ordered, never committed. */\n createAnchor(): EngineNode {\n return new RetainedNode('anchor', '#anchor', this);\n }\n\n createText(value: string): EngineNode {\n const node = new RetainedNode('text', '#text', this);\n node.text = value;\n return node;\n }\n\n appendChild(parent: EngineNode, child: EngineNode): void {\n this.detach(child);\n child.parent = parent;\n parent.children.push(child);\n if (child.dormantHoists) this.wakeHoists(child);\n this.markStructure(parent, child, parent.children.length - 1);\n this.markTextContent(parent, child);\n }\n\n insertBefore(parent: EngineNode, child: EngineNode, ref: EngineNode | null): void {\n this.detach(child);\n child.parent = parent;\n const at = ref ? parent.children.indexOf(ref) : -1;\n if (at < 0) parent.children.push(child);\n else parent.children.splice(at, 0, child);\n if (child.dormantHoists) this.wakeHoists(child);\n this.markStructure(parent, child, at < 0 ? parent.children.length - 1 : at);\n this.markTextContent(parent, child);\n }\n\n removeChild(parent: EngineNode | null, child: EngineNode): void {\n const target = parent ?? child.parent;\n if (!target) return;\n const at = target.children.indexOf(child);\n if (at < 0) return;\n target.children.splice(at, 1);\n child.parent = null;\n this.removedSinceCommit.add(child);\n this.markStructure(target, child, at);\n this.markTextContent(target, child);\n }\n\n /**\n * A child came or went under a view that takes its text as a prop: that prop changed. A span\n * changes it too, by keeping or dropping the space before it.\n */\n private markTextContent(parent: EngineNode, child: EngineNode): void {\n if (child.kind !== 'anchor' && takesTextAsProp(parent)) this.markProps(parent);\n }\n\n /** A subtree that went out of the tree is back in: its hoisted nodes commit again. */\n private wakeHoists(node: EngineNode): void {\n for (const hoisted of node.dormantHoists!) this.hoisted.add(hoisted);\n node.dormantHoists = null;\n }\n\n /**\n * Let go of everything the engine holds for nodes that have left the tree.\n *\n * Removal is the only signal a destroyed subtree reliably sends. Angular calls `destroyNode` for\n * the top-level nodes of the view it destroys and not for anything inside a child component's\n * view, so a screen's own template is never told it is gone. A reference the engine keeps to any\n * one node of such a subtree keeps all of it, because a node reaches every other node of its\n * subtree through its parent and children, and each of those holds its committed Fabric handle,\n * which keeps its native shadow node alive. A screen with a header was retained in full that way,\n * every native node of it, for as long as the app ran.\n *\n * Removal is not destruction, though: a detached screen can be put back, and must come back\n * whole. So a hoisted node moves to the root of the subtree it left with, which is garbage along\n * with it if the subtree never returns, and is handed back when it does. An animation on a node\n * out of the tree stops rather than running a frame loop for something nobody can see, and\n * starts again if the node returns. And a node out of the tree when the commit runs forgets its\n * committed views, as a withheld modal does: the commit unmounts them, Fabric never re-enables an\n * unmounted view's events (`EventEmitter::setEnabled`), and committed again they would ignore\n * every touch. It comes back created afresh, as React creates an element it mounts again. One\n * put back before the commit never left, and keeps its views.\n *\n * Once per commit, and only after a removal: the walks are the depth of a handful of nodes, and\n * forgetting walks each subtree that left once.\n */\n private releaseDetached(): void {\n this.forgetDetached();\n for (const node of this.hoisted) {\n const top = this.topOf(node);\n if (top === this.root) continue;\n this.hoisted.delete(node);\n (top.dormantHoists ??= []).push(node);\n }\n for (const node of this.playing) {\n if (this.topOf(node) === this.root) continue;\n this.playing.delete(node);\n node.playing = undefined;\n this.markProps(node, false);\n }\n this.releasePlayedNatively();\n for (const nodes of this.scrollTimelines.values()) {\n for (const node of nodes) {\n if (this.topOf(node) === this.root) continue;\n this.stopScrolled(node);\n this.markProps(node, false);\n }\n }\n if (this.focusedNode && this.topOf(this.focusedNode) !== this.root) this.focusedNode = null;\n }\n\n /** Forget the committed views of each node removed since the last commit that is still out. */\n private forgetDetached(): void {\n for (const node of this.removedSinceCommit) {\n if (node.committed && this.topOf(node) !== this.root) this.forgetCommitted(node);\n }\n this.removedSinceCommit.clear();\n }\n\n /** The root of the tree a node is in: the engine's root while it is attached. */\n private topOf(node: EngineNode): EngineNode {\n let top = node;\n while (top.parent) top = top.parent;\n return top;\n }\n\n /**\n * Angular calls this per node on view destroy, but only when `Renderer2.destroyNode` is\n * non-null. Without it the listener sets on discarded nodes stay reachable from the\n * closures Angular hands us, which is a slow leak on any screen that churns views.\n */\n destroyNode(node: EngineNode): void {\n node.listeners?.clear();\n node.listeners = null;\n // With what it holds: a node Angular destroys can be put back, as content projected into\n // an `@if` is, and its children's views would then be handed to the view it is made again\n // as. Native gives a view one parent for its life, and aborts on a second.\n if (node.committed) this.forgetCommitted(node);\n node.transitions = undefined;\n if (node.playing) this.stopNative(node, node.playing);\n node.playing = undefined;\n this.stopScrolled(node);\n this.running.delete(node);\n this.playing.delete(node);\n this.hoisted.delete(node);\n node.kept = undefined;\n // A field popped with the keyboard up never sends its blur.\n if (this.focusedNode === node) this.focusedNode = null;\n }\n\n parentNode(node: EngineNode): EngineNode | null {\n return node.parent;\n }\n\n nextSibling(node: EngineNode): EngineNode | null {\n const siblings = node.parent?.children;\n if (!siblings) return null;\n return siblings[siblings.indexOf(node) + 1] ?? null;\n }\n\n setProp(node: EngineNode, key: string, value: unknown): void {\n // A prop written again is a binding's, and is committed as any other is.\n if (node.attributeOnly?.delete(key)) this.markProps(node, false);\n if (value === undefined || value === null) {\n // Nothing to remove, so nothing changed. Worth its own branch because it is the common\n // case, not a rare one: a host primitive carries a host binding for every prop React Native\n // reads, so every element on screen writes some thirty of these on every pass, and the\n // work being skipped is a walk to the root marking ancestors dirty.\n if (!(key in node.props)) return;\n delete node.props[key];\n } else {\n if (node.props[key] === value) return;\n node.props[key] = value;\n }\n // Inline style is applied after the cascade and inherited by nothing, so it cannot change\n // what any node matches or inherits. Every other prop can: `[disabled]` is a selector. An\n // inline `direction` is the exception, because the paragraphs below it align by it.\n // And a child that takes one of this node's own values, an `inherit`, follows it.\n const heirs = node.styleCache?.heirs === true;\n this.markProps(node, key !== 'style' || this.inlineReachesStyle(node) || heirs);\n }\n\n /**\n * Paint a node's background on one of its children instead of on the node: the node keeps its\n * `background-color` and `background-image` in the cascade, where a stylesheet wrote them, and\n * the child is the view that draws them. What a view that masks its children and not itself\n * needs, as `<gradient-text>` is.\n */\n paintOn(node: EngineNode, child: EngineNode): void {\n node.paintsOn = child;\n this.markProps(node, false);\n this.markProps(child, false);\n }\n\n /**\n * Keep a prop the node already has as an attribute: on the node for a selector such as\n * `:host([variant='primary'])` to match, and left out of what is committed to the native view.\n * It is committed again once the prop is next written. What the platform adapter does with a\n * static attribute that is an input of the host's component.\n */\n keepAsAttribute(node: EngineNode, key: string): void {\n if (!(key in node.props)) return;\n (node.attributeOnly ??= new Set()).add(key);\n this.markProps(node, false);\n }\n\n /**\n * Whether a node's inline style can change what it or anything below it resolves to: it sets,\n * or until now set, a property its children inherit.\n */\n private inlineReachesStyle(node: EngineNode): boolean {\n const inherits = setsInherited(node.props['style']);\n const inherited = node.inlineInherits === true;\n node.inlineInherits = inherits;\n return this.noteInlineDirection(node) || inherits || inherited;\n }\n\n /** Whether a node's inline style sets `direction`, remembering that one has. */\n private noteInlineDirection(node: EngineNode): boolean {\n const style = node.props['style'];\n if (!style || (typeof style === 'object' && !Array.isArray(style) && !('direction' in style))) {\n return false;\n }\n if (flattenStyle(style, {})['direction'] === undefined) return false;\n this.inlineDirection = true;\n return true;\n }\n\n /**\n * The style object a node already holds has been changed in place.\n *\n * Angular's styling instructions set one property at a time, so a style of ten properties would\n * otherwise mean ten copies of a growing object per element. The adapter owns the object it put\n * there and may write into it; this is how it says so, since nothing about the object's identity\n * has changed for the props diff to notice.\n */\n styleChanged(node: EngineNode): void {\n this.markProps(node, this.inlineReachesStyle(node));\n }\n\n /**\n * A bound declaration, `[style.color]`, whose value may be a `var()`. One that is, is kept as a\n * declaration the cascade settles with the node's tokens, as a rule's is, and true is answered:\n * the text is no value to put in the node's style. Any other value forgets what was kept.\n */\n setBoundStyle(node: EngineNode, prop: string, value: unknown): boolean {\n const text = typeof value === 'string' && /^\\s*var\\(/i.test(value) ? value : undefined;\n const bound =\n text === undefined ? null : boundDeclaration(prop, tokenFromValue(text), node.name);\n if (!bound && !node.boundByProp?.has(prop)) return false;\n const byProp = (node.boundByProp ??= new Map());\n if (bound) byProp.set(prop, bound);\n else byProp.delete(prop);\n node.boundStyle = byProp.size ? [...byProp.values()] : null;\n this.markProps(node);\n return bound !== null;\n }\n\n /**\n * Set a custom property on a node, `--tint` from `[style.--tint]`, or remove it with `null`.\n *\n * Not a prop: Fabric has no such thing, and would be sent one. It is a token for the cascade,\n * converted from the value here because nothing built it ahead of time (`inline-token.ts`), and\n * changing it re-resolves the node and so everything under it.\n */\n setCustomProperty(node: EngineNode, name: string, value: unknown): void {\n const token = value === null || value === undefined ? undefined : tokenFromValue(value);\n const current = node.customProperties;\n if (!token) {\n if (!current || !(name in current)) return;\n const { [name]: _removed, ...rest } = current;\n node.customProperties = Object.keys(rest).length ? rest : null;\n } else {\n node.customProperties = { ...current, [name]: token };\n }\n this.markProps(node);\n }\n\n setText(node: EngineNode, value: string): void {\n const filled = (node.text === '') !== (value === '');\n node.text = value;\n this.markProps(node);\n if (!node.parent) return;\n this.markTextContent(node.parent, node);\n // Text of no length is nothing to `:empty`: its first character and its last change what\n // the element it is in matches, and what comes after that element.\n if (filled && this.structuralSheets) this.markFilled(node.parent);\n }\n\n private markFilled(node: EngineNode): void {\n node.styleDirty = true;\n this.markLaterSiblings(node);\n this.markPath(node);\n }\n\n setEventListener(\n node: EngineNode,\n topLevelType: string,\n fn: (event: unknown) => void,\n ): () => void {\n this.registerEventHandler();\n\n const optIn =\n EVENT_OPT_IN_PROPS[topLevelType] ?? VIEW_EVENT_OPT_IN_PROPS[viewNameOf(node)]?.[topLevelType];\n if (optIn && node.props[optIn] !== true) this.setProp(node, optIn, true);\n\n const listeners = (node.listeners ??= new Map());\n let set = listeners.get(topLevelType);\n if (!set) listeners.set(topLevelType, (set = new Set()));\n set.add(fn);\n return () => set.delete(fn);\n }\n\n // --- dirty marking ----------------------------------------------------\n\n private markProps(node: EngineNode, affectsStyle = true): void {\n node.propsDirty = true;\n // Classes, `nativeID` and anything else a selector can read live in props, so any of them\n // changing can change what this node matches, and through it what its whole subtree does.\n // Marking only when it can is what keeps an animated `[style]` from re-cascading everything\n // beneath it on every frame.\n if (affectsStyle) {\n node.styleDirty = true;\n // `.peer:focus ~ .label`: what a later sibling matches can hang on this node's classes and\n // state, though nothing about the sibling moved. Only sheets that ask about siblings pay.\n if (this.structuralSheets) this.markLaterSiblings(node);\n if (this.hasSheets) this.markBeneath(node.parent);\n }\n // The root has no parent to carry the mark, so it carries its own: `.dark` on the root alone\n // restyles everything beneath it.\n this.markPath(node.parent ?? node);\n }\n\n /** Start matching ancestors again on a change, once a sheet that uses `:has()` is in play. */\n private watchHas(sheet: StyleSheet | null | undefined): void {\n if (!sheet?.has || this.hasSheets) return;\n this.hasSheets = true;\n this.styles.tracksHas = true;\n // What is already resolved kept no record of the rules it matched: resolve it again. Nothing\n // is, when the sheet is the one the engine was made with.\n if (!this.root) return;\n this.root.styleDirty = true;\n this.markPath(this.root);\n }\n\n /**\n * Something at or beneath `from` changed: every node from there up may match a `:has()` rule\n * it did not, or stop matching one. They are matched again rather than marked for restyling,\n * which would restyle everything under them. Only sheets that use `:has()` pay.\n */\n private markBeneath(from: EngineNode | null): void {\n for (let node = from; node; node = node.parent) node.hasDirty = true;\n }\n\n private markLaterSiblings(node: EngineNode): void {\n const siblings = node.parent?.children;\n if (!siblings) return;\n for (let i = siblings.indexOf(node) + 1; i < siblings.length; i++) {\n siblings[i]!.styleDirty = true;\n }\n }\n\n /** `node`'s child list changed: `moved` came into it at `at`, or went out of it from there. */\n private markStructure(node: EngineNode, moved: EngineNode, at: number): void {\n node.structureDirty = true;\n // A child list that moved changes what its members match, though nothing about them did:\n // the old last row is no longer the last. Only sheets that ask about position pay for this.\n if (this.structuralSheets) {\n moved.styleDirty = true;\n this.markRepositioned(node.children, at, moved);\n // What the node itself matches hangs on its child list only through `:empty`, which only\n // its first child arriving or its last one leaving changes: and then what a later sibling\n // matches can too, `.box:empty + .spacer`. Styled again for any other change, everything\n // under it would be resolved again with it.\n if (wasOrIsEmptyWithout(node, moved)) {\n node.styleDirty = true;\n this.markLaterSiblings(node);\n }\n }\n if (this.hasSheets) this.markBeneath(node);\n this.markPath(node.parent);\n }\n\n /**\n * Mark the children whose place in a child list that changed at `at` a sheet could read\n * differently. The two at each end always, which are the old first and last and the new. Those\n * from `at` on where some sheet counts from the start or asks about any one before, since a\n * child's place from the start hangs only on those before it; and those before `at` where one\n * counts from the end. Styling one again resolves everything under it again, so a long list\n * gaining a row at its end is not the whole list.\n *\n * Where the sheets ask no further than the element just before (`+`), a rule steps a known\n * number of elements along from one whose own match changed, and those are all there is to\n * mark: that many after the change, and that many after the two at the start, either of which\n * may have stopped or started being first. Nothing comes after the two at the end.\n */\n private markRepositioned(children: readonly EngineNode[], at: number, moved: EngineNode): void {\n const steps = this.structuralAfter;\n const pastFirst = steps === Infinity ? 0 : steps;\n for (const child of elementsAtEnd(children, 2 + pastFirst, false)) this.markPlace(child);\n for (const child of elementsAtEnd(children, 2, true)) this.markPlace(child);\n if (this.structuralBefore) for (let i = 0; i < at; i++) this.markPlace(children[i]!);\n // The elements after the change, not counting the one that came, which is marked already.\n let left = steps;\n for (let i = at; i < children.length && left > 0; i++) {\n const child = children[i]!;\n this.markPlace(child);\n if (child.kind === 'element' && child !== moved) left--;\n }\n }\n\n /**\n * A child's place in its list changed, which is all that changed about it. It is matched\n * again, and keeps its style and all that is under it unless it now matches other rules: its\n * place is read by the rules that style it and by no other. Not where a rule reads the place\n * of an element like it from under it, `.row:nth-child(odd) .label`: that changes more than\n * the element itself, which is then styled again with everything under it, as is a child\n * that is no element.\n */\n private markPlace(child: EngineNode): void {\n if (child.kind !== 'element' || this.placeReadFromUnder(child)) child.styleDirty = true;\n else child.stateDirty = true;\n }\n\n /**\n * Whether a rule could read this element's place from another element. By its classes alone,\n * which every such compound it could be asks for: a compound with none could be any element.\n */\n private placeReadFromUnder(node: EngineNode): boolean {\n for (const compound of this.placeElsewhere) {\n if (compound.classes.every((name) => node.classes?.has(name))) return true;\n }\n return false;\n }\n\n /** Note what a sheet coming into play asks about a child list. None is unset: see `structural`. */\n private watchStructure(sheet: StyleSheet | null | undefined): void {\n if (!sheet?.structural || this.watchedStructure.has(sheet)) return;\n this.watchedStructure.add(sheet);\n this.structuralSheets = true;\n const reach = siblingReach(sheet);\n this.structuralAfter = Math.max(this.structuralAfter, reach.after);\n if (reach.before) this.structuralBefore = true;\n for (const compound of placeReadElsewhere(sheet)) this.placeElsewhere.add(compound);\n // What a child whose place changed is compared with is the rules it matched, which a cache\n // keeps from here on. One made before has none, and is styled again the first time, as it\n // was before any sheet asked.\n this.styles.tracksHas = true;\n }\n\n /** Walk up until we hit a node already known to have a dirty subtree. */\n private markPath(node: EngineNode | null): void {\n const wasClean = !this.root.structureDirty && !this.root.subtreeDirty;\n for (let current = node; current && !current.subtreeDirty; current = current.parent) {\n current.subtreeDirty = true;\n }\n // The tree has just gone from clean to dirty. Inside a change-detection pass that means\n // nothing, because the pass ends in a commit; outside one it means the change has no commit\n // coming, and the host has to arrange a frame.\n if (wasClean && this.root.subtreeDirty) this.onDirty?.();\n }\n\n private isClean(node: EngineNode): boolean {\n return (\n node.committed !== null && !node.propsDirty && !node.structureDirty && !node.subtreeDirty\n );\n }\n\n // --- commit -----------------------------------------------------------\n\n /**\n * Incremental: clone only what changed and reuse untouched subtrees by reference. A full\n * rebuild would mint fresh shadow nodes for every node on every tick, which drops scroll\n * offset, text cursor and keyboard focus. That is a correctness requirement, not an\n * optimisation.\n */\n commit(): boolean {\n if (this.removedSinceCommit.size) this.releaseDetached();\n // The root is never reconciled itself, so it has no `committed` record and `isClean` would\n // always say dirty. Ask the flags directly, or every change-detection pass ends in a\n // completeRoot that changes nothing: during a fling that is one wasted native commit per\n // frame, since any listener firing marks the view for refresh.\n this.settleCreated();\n if (!this.root.structureDirty && !this.root.subtreeDirty) return false;\n\n const started = now();\n // One epoch per commit. Node props do not change while a commit runs, so every node can be\n // resolved once and shared with each of its descendants for the length of this walk.\n this.styleEpoch++;\n // Faces registered before the walk, the global sheet's among them, reach every node in it.\n this.facesAdded = false;\n const set = this.fabric.createChildSet(this.rootTag);\n for (const child of this.visibleChildren(this.root)) {\n if (this.withheld(child)) continue;\n this.fabric.appendChildToSet(set, this.reconcileUnder(this.root, child));\n }\n this.clearFlags(this.root);\n this.announceCommit();\n this.fabric.completeRoot(this.rootTag, set);\n\n const elapsed = now() - started;\n this.stats.commits++;\n this.stats.lastCommitMs = elapsed;\n if (this.stats.commits === 1) {\n this.stats.firstCommitMs = elapsed;\n } else {\n if (elapsed > this.stats.worstCommitMs) this.stats.worstCommitMs = elapsed;\n if (elapsed > FRAME_BUDGET_MS) this.stats.slowCommits++;\n }\n\n this.flushTransitionEvents();\n this.playSized();\n this.scrollDriver?.afterCommit();\n // Read first: the commit that settles keyframes starts by clearing it.\n const facesAdded = this.facesAdded;\n if (this.awaitingKeyframes.size) this.settleKeyframes();\n if (facesAdded) this.rematchFonts();\n return true;\n }\n\n private beforeCommit: (() => void) | null = null;\n\n private announceCommit(): void {\n const run = this.beforeCommit;\n this.beforeCommit = null;\n run?.();\n }\n\n /**\n * Run `run` once, as the next commit hands its tree to the host and before the host has it: the\n * moment for something the host applies to its next commit, which is only this one from here.\n * A pass that changes nothing commits nothing and runs nothing, so a request waits until it is\n * taken back with the function returned. A later request replaces an earlier one.\n */\n beforeNextCommit(run: () => void): () => void {\n this.beforeCommit = run;\n return () => {\n if (this.beforeCommit === run) this.beforeCommit = null;\n };\n }\n\n /** The first commit whose new views have not been drawn yet, while `commitUnseen` runs. */\n private unseen = Infinity;\n\n /**\n * A commit for what changed in the same turn as earlier commits, before a frame was drawn.\n * `since` is how many commits there had been before the first of them (`stats.commits`).\n *\n * A view those commits created has not been seen in the style they gave it, so what this one\n * gives it is where it starts, and no transition runs toward it. That is what a browser\n * does with a class added to an element in the turn that inserted it, and what `animate.enter`\n * is built on: Angular adds the enter class after the render pass that created the element, and\n * takes it off a frame later, which is the one change the transition is for.\n */\n commitUnseen(since: number): boolean {\n this.unseen = since;\n try {\n return this.commit();\n } finally {\n this.unseen = Infinity;\n }\n }\n\n /** Nodes that asked for `@keyframes` this commit had not met, by the name they asked for. */\n private readonly awaitingKeyframes = new Map<EngineNode, string>();\n\n /**\n * A sheet is registered when the first node it styles is committed, so a node committed before\n * it can name keyframes that arrive later in the same commit. Those nodes play them from another\n * commit straight away, as a browser applies keyframes however the sheets arrived; a name still\n * unknown once the commit is over is reported.\n */\n private settleKeyframes(): void {\n const waiting = [...this.awaitingKeyframes];\n this.awaitingKeyframes.clear();\n let found = false;\n for (const [node, name] of waiting) {\n if (this.keyframes.has(name)) {\n this.markProps(node, false);\n found = true;\n } else if (this.dev) {\n this.reportMissingKeyframes(name);\n }\n }\n if (found) this.commit();\n }\n\n private readonly scrollDriver: NativeScrollDriver | null;\n\n /** Whether native can move a view by a scroll with no JavaScript in between. */\n get drivesScroll(): boolean {\n return this.scrollDriver !== null;\n }\n\n /** See `HostEngine.driveByScroll`. The connection waits for a commit of both views. */\n driveByScroll(\n view: EngineNode,\n scroll: EngineNode,\n axis: ScrollAxis,\n range: ScrollRange,\n statics: readonly StaticTransform[] = [],\n ): ScrollDrive | null {\n const property = axis === 'x' ? 'translateX' : 'translateY';\n return this.driveByEvent(view, scroll, scrollFeed(axis), property, range, statics);\n }\n\n /** See `HostEngine.driveByEvent`. */\n driveByEvent(\n view: EngineNode,\n source: EngineNode,\n feed: EventFeed,\n property: DrivenProperty,\n range: ScrollRange,\n statics: readonly StaticTransform[] = [],\n shift: number | null = null,\n ): ScrollDrive | null {\n if (!this.scrollDriver) return null;\n // As Animated does: Fabric flattens a view that only lays out, and then there is no native\n // view for the animation to move.\n this.setProp(view, 'collapsable', false);\n return this.scrollDriver.drive(\n view,\n source,\n feed,\n property,\n range,\n statics,\n (node) => (node as EngineNode).committed?.tag ?? null,\n shift,\n );\n }\n\n /**\n * `transitionstart` and `transitionend`, for anything listening.\n *\n * Angular's `animate.enter` and `animate.leave` are built on these: they add a class, wait for\n * the transition it starts, and clean up when it ends. Nothing native emits them - there is no\n * CSS animation in React Native to emit them - so the engine that runs the transition is what\n * says when one began and ended.\n */\n /** Created since the last commit and waiting to settle. See `HostEngine.settle`. */\n private unsettled: Settling[] = [];\n\n settle(target: Settling): void {\n this.unsettled.push(target);\n }\n\n /**\n * Let every element created since the last commit write what its inputs say. One that was\n * checked already has, and answers at once; one whose view is detached writes its props here,\n * so the commit that first mounts it carries them.\n */\n private settleCreated(): void {\n if (this.unsettled.length === 0) return;\n const created = this.unsettled;\n this.unsettled = [];\n for (const target of created) target.settleProps();\n }\n\n private readonly transitionEvents: { node: EngineNode; type: string; property: string }[] = [];\n\n private emitTransition(node: EngineNode, type: string, property: string): void {\n if (!node.listeners?.has(type)) return;\n this.transitionEvents.push({ node, type, property });\n }\n\n /**\n * After the commit, never during it: a listener is free to add a class or drop an element, and\n * a tree that changes halfway through being walked is the one thing a commit cannot survive.\n */\n private flushTransitionEvents(): void {\n if (this.transitionEvents.length === 0) return;\n for (const { node, type, property } of this.transitionEvents.splice(0)) {\n // One listener that throws stops neither the rest nor the node being let go.\n for (const listener of [...(node.listeners?.get(type) ?? [])]) {\n try {\n listener(animationEvent(type, node, property));\n } catch (error) {\n this.reportEventError(error, type);\n }\n }\n if (type === 'topAnimationend') this.letGo(node);\n }\n }\n\n /**\n * The nodes whose animation has ended with no fill and is still held at its last frame, until\n * its `animationend` has been heard. A browser runs that listener before it paints again, and\n * an exit animation's listener takes the element away: it is never seen back at rest. Here the\n * listener runs after the commit, so the commit that ends the animation paints the last frame,\n * and the element goes back to rest once the listener has run and left it there.\n */\n private readonly lettingGo = new Set<EngineNode>();\n\n private letGo(node: EngineNode): void {\n if (!this.lettingGo.delete(node)) return;\n const running = node.playing;\n if (!running?.done) return;\n running.values = {};\n this.markProps(node, false);\n }\n\n /** Anchors take part in sibling ordering but never reach Fabric. */\n private visibleChildren(node: EngineNode): EngineNode[] {\n // A view that takes its text as a prop has no text children to commit. See `ViewNameOptions`.\n const textAsProp = takesTextAsProp(node);\n return node.children.filter(\n (child) => child.kind !== 'anchor' && !(textAsProp && child.kind === 'text'),\n );\n }\n\n /**\n * Everything a node renders with, unprocessed. Precedence, weakest first: native defaults, the\n * node's `defaultStyle`, matched CSS, explicit props, inline style, a component's\n * `styleOverride`. Inline wins over CSS as it does on the web, but for a declaration marked\n * `!important`, which stands over it: see `inlineOf`.\n *\n * Raw, because this is what the next commit diffs against. Colours and asset ids are converted\n * on the way out instead (`processed`), and only for the keys that changed: the converters\n * return fresh objects, so diffing their output would re-send every image and shadow on every\n * unrelated change.\n */\n /** What a touch on an element that keeps a drag holds off, while it lasts: see `holdSwipe`. */\n private heldFor(node: EngineNode, merged: Record<string, unknown>): void {\n if (node === this.swipeHeld) merged['gestureResponseDistance'] = NO_SWIPE;\n if (node === this.scrollHeld) merged['scrollEnabled'] = false;\n }\n\n private mergeProps(node: EngineNode, viewName: string): Record<string, unknown> {\n if (node.kind === 'text') return { text: paragraphText(node) };\n if (this.dev) this.checkProps(node);\n this.registerSheet(node.sheet);\n this.registerSheet(node.hostSheet);\n const props: Record<string, unknown> = { ...DEFAULT_PROPS[viewName], ...node.defaultStyle };\n Object.assign(props, this.styles.resolve(node, this.styleEpoch).style);\n const resolved = props['pointerEvents'];\n writeOwnProps(node.props, props, node.attributeOnly);\n withTextContent(node, viewName, props);\n const cascaded = props['transform'];\n const inline = inlineOf(node);\n const style = boundTransform(node, Object.assign(props, inline), cascaded);\n if (inline !== NO_STYLE) this.styles.overOtherForms(inline, style);\n nativePointerEvents(node, style, resolved);\n // Before an image's own size: `fit-content` is no size, so the image's is what it gets.\n fitContent(node, style);\n percentHeight(node, style);\n placeholderFaded(style);\n const intrinsic = node.props[INTRINSIC_SIZE] as IntrinsicSize | undefined;\n if (intrinsic) applyIntrinsicSize(style, intrinsic);\n flattenStyle(node.props[STYLE_OVERRIDE], style);\n this.fontFaces.apply(style);\n holdLoadingFamily(node, style);\n if (viewName === PARAGRAPH) alignText(style, this.directionOf(node, style));\n if (this.fontsRefreshed) this.capForFonts(node, style);\n alignMultiline(viewName, style);\n rowsTall(style, this.fontScale);\n const merged = composeTransform(node, this.animated(node, this.transitioned(node, style)));\n // On iOS: Android's field says the baseline of the line it is sized and centred by.\n // Still under the row that marked it: a row taken away is not committed again to unmark it.\n const row = node.onBaseline;\n const onBaseline = viewName === 'TextInput' && row !== undefined && isWithin(node, row);\n centreSingleLine(viewName, merged, this.fontScale, onBaseline);\n // After a transition, which eases the basis as the basis it was written as.\n basisAsSize(node, merged);\n // After the basis, which is a size given where it is committed as one.\n ratioForAutoSize(merged);\n noOutline(merged);\n // Last, on what is committed: an override or an animation can hide a box, or place it.\n hiddenOutOfFlow(merged);\n delete merged['touchAction'];\n if (this.responders.has(node)) stillTouched(merged);\n this.heldFor(node, merged);\n this.movePaint(node, merged);\n return merged;\n }\n\n /**\n * Leave a node's background out of what it commits when a child paints it, and give that child\n * its parent's: the cascade's, and over it the parent's inline style.\n */\n private movePaint(node: EngineNode, merged: Record<string, unknown>): void {\n if (node.paintsOn) for (const key of PAINT_KEYS) delete merged[key];\n const from = node.parent?.paintsOn === node ? node.parent : null;\n if (!from) return;\n const paint = { ...this.styles.resolve(from, this.styleEpoch).style, ...inlineOf(from) };\n for (const key of PAINT_KEYS) if (paint[key] !== undefined) merged[key] = paint[key];\n }\n\n /**\n * A container whose direction or alignment changed since a child with a `fit-content` size\n * read it, or whose height stopped or started being one a percentage is taken of since a child\n * with a percentage height asked: those children are merged again. A change to a container\n * marks nothing beneath it, since none of these is inherited.\n */\n private refitChildren(node: EngineNode): void {\n // Both are asked, and both remembered, before either has the children merged again.\n const basis = node.heightBasis;\n const based = basis !== undefined && definiteHeight(node) !== basis;\n const fitted = node.fitContainer !== undefined && containerOf(node) !== node.fitContainer;\n if (fitted) node.fitContainer = containerOf(node);\n if (based || fitted) this.refit(node);\n }\n\n /** Have a container's children merged again, through any `display: contents` among them. */\n private refit(container: EngineNode): void {\n for (const child of container.children) {\n if (child.kind !== 'element') continue;\n child.propsDirty = true;\n if (containerOf(child) === 'contents') this.refit(child);\n }\n }\n\n /**\n * The text size cap that lays a paragraph or text input out again once a face it names has\n * registered: a step per face above the app's own cap where it set one (below 1 is none, on\n * both platforms), or above any text size there is. Counted per view, so an app's cap moves by\n * a step for each face its text names and no further. See `fontsRegistered`.\n */\n private capForFonts(node: EngineNode, props: Record<string, unknown>): void {\n const refreshes = this.fontRefreshes.get(node);\n if (refreshes === undefined) return;\n const own = props['maxFontSizeMultiplier'];\n props['maxFontSizeMultiplier'] =\n (typeof own === 'number' && own >= 1 ? own : UNCAPPED) + refreshes * FONT_REFRESH_STEP;\n }\n\n /** Set once any node has had a `direction` in its inline style. See `directionOf`. */\n private inlineDirection = false;\n\n /**\n * The direction a paragraph is laid out in, where the app wrote one: its own, or the nearest\n * ancestor's. Undefined when nothing above it says, which leaves the platform's own.\n *\n * A stylesheet's `direction` is inherited through the cascade, so it is already in `props`. An\n * inline one is not, and is found by walking up, which only happens once some node has had one.\n */\n private directionOf(node: EngineNode, props: Record<string, unknown>): TextDirection | undefined {\n const own = textDirection(props['direction']);\n if (!this.inlineDirection) return own;\n for (let at: EngineNode | null = node; at; at = at.parent) {\n const inline = textDirection(inlineOf(at)['direction']);\n if (inline) return inline;\n const cascaded = textDirection(at.styleCache?.style['direction']);\n if (cascaded && cascaded !== textDirection(at.parent?.styleCache?.style['direction'])) {\n return cascaded;\n }\n }\n return own;\n }\n\n /**\n * Hold back what a transition is meant to ease into.\n *\n * Called with everything the node would otherwise commit with, so a property is compared\n * against the last value aimed at rather than the last one painted: a transition redirected\n * halfway carries on from where it had got to instead of snapping.\n *\n * A property seen for the first time is recorded and left alone. That is CSS's own rule, and\n * without it every element would fade in from whatever the previous value happened to be.\n */\n /**\n * Take a sheet's `@keyframes` and `@font-face` rules into the registries. Cheap and idempotent;\n * sheets are few.\n */\n private registerSheet(sheet: StyleSheet | null | undefined): void {\n if (!sheet || this.knownSheets.has(sheet)) return;\n this.knownSheets.add(sheet);\n this.styles.noteSheet(sheet);\n this.sheetOrder.push(sheet);\n for (const name of Object.keys(sheet.keyframes ?? {})) {\n this.keyframes.set(name, sheet.keyframes![name]!);\n }\n if (sheet.fonts && this.fontFaces.add(sheet.fonts)) this.facesAdded = true;\n }\n\n /**\n * A hot swap edited a component's sheet into `next`, or took it away with null: `sheet`'s\n * `@keyframes` go, and `next`'s take its place among the others, as an edited stylesheet keeps\n * its place in a document. A name another sheet also defines falls back to that one. Every\n * animation re-resolves the name it plays, so one whose keyframes went stops, as in a browser.\n * A `sheet` already gone, such as a global sheet removed, leaves `next` registered last.\n */\n sheetReplaced(sheet: StyleSheet, next: StyleSheet | null): void {\n if (sheet === next && this.knownSheets.has(sheet)) return;\n this.unwatchActive(sheet);\n this.watchActive(next);\n const at = this.sheetOrder.indexOf(sheet);\n if (at === -1) {\n this.registerSheet(next);\n return;\n }\n this.knownSheets.delete(sheet);\n if (next && !this.knownSheets.has(next)) {\n this.knownSheets.add(next);\n this.styles.noteSheet(next);\n this.sheetOrder[at] = next;\n } else {\n this.sheetOrder.splice(at, 1);\n }\n if (sheet.keyframes || next?.keyframes) this.reindexKeyframes();\n if (sheet.fonts || next?.fonts) this.reindexFonts();\n }\n\n /**\n * Every sheet's `@font-face` rules again, in order, and every text that names a family matched\n * again: a face whose rule went is no longer matched, though the platform keeps it registered.\n */\n private reindexFonts(): void {\n this.fontFaces.clear();\n for (const sheet of this.sheetOrder) if (sheet.fonts) this.fontFaces.add(sheet.fonts);\n this.markFontText(this.root);\n }\n\n /** Every sheet's `@keyframes` again, in order, and every animation told to look them up. */\n private reindexKeyframes(): void {\n this.keyframes.clear();\n for (const sheet of this.sheetOrder) {\n for (const name of Object.keys(sheet.keyframes ?? {})) {\n this.keyframes.set(name, sheet.keyframes![name]!);\n }\n }\n this.markAnimated(this.root);\n }\n\n /** Mark every node under `node` with an animation, so it looks its keyframes up again. */\n private markAnimated(node: EngineNode): void {\n for (const child of node.children) {\n if (child.playing || child.scrolled) this.markProps(child, false);\n this.markAnimated(child);\n }\n }\n\n /** Every `@font-face` seen, global as on the web: a face declared in one sheet serves all. */\n private readonly fontFaces = new FontFaces();\n /** Whether a sheet first used in this commit declared a face. See `rematchFonts`. */\n private facesAdded = false;\n\n /**\n * Faces a sheet declared partway through a commit: text resolved before it, in this commit or\n * an earlier one, matched without them. Resolve every text naming a family again, and commit.\n * Once per sheet that declares faces, so walking the tree costs nothing that matters.\n */\n private rematchFonts(): void {\n this.markFontText(this.root);\n this.commit();\n }\n\n /** Mark every element under `node` committed with a family, so it is matched again. */\n private markFontText(node: EngineNode): void {\n const named = (text: EngineNode | undefined): void => {\n if (typeof text?.committed?.props['fontFamily'] === 'string') this.markProps(text, false);\n };\n for (const child of node.children) {\n // The paragraph of a run of text written straight into a view is kept on the text.\n if (child.kind === 'text') named(child.box);\n if (child.kind !== 'element') continue;\n named(child);\n this.markFontText(child);\n }\n }\n\n private readonly knownSheets = new WeakSet<StyleSheet>();\n\n /**\n * Start, advance or stop the `@keyframes` animation a node's style asks for.\n *\n * Unlike a transition this does not need anything to have changed: an animation plays from its\n * own frames, which is what lets an element animate in without differing from anything.\n */\n private animated(node: EngineNode, props: Record<string, unknown>): Record<string, unknown> {\n const spec = animationOf(props);\n\n // One played by a scroll that is no longer asked for, whatever is asked for instead.\n if (node.scrolled && !spec?.timeline) this.stopScrolled(node);\n if (!spec) {\n if (node.playing) {\n this.cancelPlaying(node);\n node.playing = undefined;\n this.playing.delete(node);\n }\n return props;\n }\n\n const frames = this.keyframes.get(spec.name);\n if (!frames) {\n // Keyframes a hot swap deleted, from under an animation that was playing them, or ones a\n // sheet later in this commit has: see `settleKeyframes`.\n this.cancelPlaying(node);\n node.playing = undefined;\n this.playing.delete(node);\n this.stopScrolled(node);\n this.awaitingKeyframes.set(node, spec.name);\n return props;\n }\n if (spec.timeline) return this.scrollAnimated(node, spec, frames, props);\n this.startPlaying(node, spec, frames, props);\n return Object.assign(props, node.playing?.values ?? {});\n }\n\n /**\n * A clock animation the scroll plays instead: the same animation where only the timeline moved,\n * and one cancelled where the name changed.\n */\n private handOverToScroll(node: EngineNode, spec: AnimationSpec): void {\n if (!node.playing) return;\n this.stopNative(node, node.playing);\n if (node.playing.spec.name !== spec.name) this.cancelPlaying(node);\n node.playing = undefined;\n this.playing.delete(node);\n }\n\n /**\n * `animationcancel` for an animation stopped before it ended: the element no longer asks for it,\n * asks for another by name, or its keyframes went, as a browser fires it.\n */\n private cancelPlaying(node: EngineNode): void {\n const running = node.playing;\n if (running) this.stopNative(node, running);\n if (running && !running.done)\n this.emitTransition(node, 'topAnimationcancel', running.spec.name);\n }\n\n /** Stop on native each animation whose view has left the tree. */\n private releasePlayedNatively(): void {\n for (const node of [...this.playedNatively]) {\n if (this.topOf(node) === this.root) continue;\n this.stopNative(node, node.playing!);\n node.playing = undefined;\n this.markProps(node, false);\n }\n }\n\n /** Every node whose animation native is playing, with no frame of it in JavaScript. */\n private readonly playedNatively = new Set<EngineNode>();\n\n /**\n * Hand an animation that has just started to native, where native can play it: one that moves\n * only opacity and transforms, starts at once, and repeats a whole number of times. Native then\n * runs it frame by frame, and JavaScript hears of it again when it ends. Anything else is\n * played from here, a commit a frame. See `NativeScrollDriver.play`.\n */\n /**\n * The nodes whose animation moves them by a share of their own size and had no size yet when\n * it started, each with the style it rests at: asked again once the commit has laid them out.\n */\n private readonly unsized = new Map<EngineNode, Record<string, unknown>>();\n\n /**\n * An animation's frames as native can interpolate them: a move by a share of the box,\n * `translateX(200%)`, as the points that is of the size the view is laid out at. Nothing where\n * the view has no size yet, which is every view until its first commit: it is played from\n * JavaScript, and handed over once that commit has laid it out. See `playSized`.\n *\n * ponytail: the size it had when it started. A box that changes size goes on moving by the\n * points of the old one until the animation starts again; restart it from the box's layout\n * event if a bar that resizes mid-animation comes up.\n */\n private sized(\n node: EngineNode,\n running: RunningAnimation,\n props: Record<string, unknown>,\n ): { tracks: RunningAnimation['tracks']; resting: Record<string, unknown> } | null {\n // One that waits, or takes no time, is played from here whatever it moves by.\n if (running.spec.delay !== 0 || running.spec.duration <= 0) return null;\n if (!movesByShare(running.tracks, props)) return { tracks: running.tracks, resting: props };\n let size: { width: number; height: number } | undefined;\n this.measure(node, (frame) => (size = frame));\n if (size) return sharesAsPoints(running.tracks, props, size);\n this.unsized.set(node, props);\n return null;\n }\n\n /**\n * Hand to native each animation that was waiting for its view to have a size. The commit just\n * made painted its first frame, so its clock starts here: no frame of it has been seen move.\n */\n private playSized(): void {\n if (!this.unsized.size) return;\n const waiting = [...this.unsized];\n this.unsized.clear();\n for (const [node, props] of waiting) {\n const running = node.playing;\n if (!running || running.done || running.native || !this.playing.has(node)) continue;\n // Native plays it from its first frame, so its clock starts here: but only where native\n // takes it. Left in JavaScript, it goes on from the clock it started on.\n const started = running.start;\n running.start = this.now();\n if (this.playNatively(node, running, props)) {\n this.playing.delete(node);\n // `collapsable`, which keeps a view for native to move, is in what it holds now.\n this.markProps(node, false);\n } else {\n running.start = started;\n }\n }\n // One with no size after its commit is not laid out at all, and is played from JavaScript.\n this.unsized.clear();\n }\n\n private playNatively(\n node: EngineNode,\n running: RunningAnimation,\n props: Record<string, unknown>,\n ): boolean {\n const { spec } = running;\n const sized = this.scrollDriver ? this.sized(node, running, props) : null;\n if (!this.scrollDriver || !sized) return false;\n const { channels, held, span } = clockChannels(sized.tracks, spec, sized.resting);\n if (held.length || !(channels.opacity || channels.transform.length)) return false;\n // There and back is one native animation: an odd number of ways has no whole number of them.\n const count = spec.iterations === null ? -1 : spec.iterations / span;\n if (count !== -1 && !(Number.isInteger(count) && count > 0)) return false;\n const length = Math.max(2, Math.round((spec.duration * span) / NATIVE_FRAME) + 1);\n const frames = Array.from({ length }, (_, i) => i / (length - 1));\n const native = this.scrollDriver.play(\n node,\n channels,\n { frames, toValue: span, iterations: count },\n (view) => this.tagOf(view as EngineNode),\n () => this.endedNatively(node, running),\n );\n if (!native) return false;\n running.native = native;\n // As Animated does: Fabric flattens a view that only lays out, and then there is no native\n // view for the animation to move.\n running.values = { ...running.values, collapsable: false };\n this.playedNatively.add(node);\n return true;\n }\n\n /**\n * Native reached the end of an animation it was playing. The frame it ends at, or the resting\n * style where it does not fill, is committed before the view is let go, so nothing shows of\n * the frame it started at, which is what the view had been committed with.\n */\n private endedNatively(node: EngineNode, running: RunningAnimation): void {\n if (node.playing !== running || !running.native) return;\n const { native, spec } = running;\n running.native = undefined;\n this.playedNatively.delete(node);\n const end = running.start + spec.duration * (spec.iterations ?? 1);\n this.advancePlayer(node, Math.max(this.now(), end));\n this.commit();\n native.stop();\n }\n\n /** Take an animation back from native, which stops it there. The caller plays it on, or not. */\n private stopNative(node: EngineNode, running: RunningAnimation): void {\n if (!running.native) return;\n running.native.stop();\n running.native = undefined;\n this.playedNatively.delete(node);\n }\n\n /**\n * Play on from JavaScript an animation native was playing, from where its clock has got to:\n * what a pause, other frames or a view made again need, none of which native can be told of.\n */\n private backToScript(node: EngineNode, running: RunningAnimation): void {\n if (!running.native) return;\n this.stopNative(node, running);\n running.values = sample(running, this.now()).values;\n if (!running.done && running.pausedAt === undefined) this.playing.add(node);\n }\n\n /** Start the clock on an animation, unless the node is already playing this one. */\n private startPlaying(\n node: EngineNode,\n spec: AnimationSpec,\n frames: readonly Keyframe[],\n props: Record<string, unknown>,\n ): void {\n const current = node.playing;\n const inherited = this.inheritedColour(node, frames);\n if (!current || !sameAnimation(current.spec, spec)) {\n if (current && current.spec.name !== spec.name) this.cancelPlaying(node);\n else if (current) this.stopNative(node, current);\n const started: RunningAnimation = {\n spec,\n tracks: tracksOf(frames, props, inherited),\n inherited,\n start: this.now(),\n values: {},\n done: false,\n };\n // Sampled straight away, so the very commit that starts the animation paints its first\n // frame. Otherwise an element appears in its resting style for one frame and then jumps,\n // which is the flash this whole mechanism exists to avoid.\n //\n // A delayed animation therefore holds its first frame through the delay rather than the\n // resting style: `animation-fill-mode: backwards` behaviour, always. It is what an entrance\n // wants, and the alternative is the flash again.\n started.values = sample(started, this.now()).values;\n this.playedFrames.set(started, frames);\n node.playing = started;\n if (spec.paused) started.pausedAt = this.now();\n else if (!this.playNatively(node, started, props)) this.playing.add(node);\n this.emitTransition(node, 'topAnimationstart', spec.name);\n return;\n }\n // A view made again is another view: the one native was moving is gone.\n if (node.committed === null) this.backToScript(node, current);\n if (this.playedFrames.get(current) !== frames || inherited !== current.inherited) {\n this.backToScript(node, current);\n this.reframe(node, current, frames, props, inherited);\n }\n this.playOrPause(node, node.playing!, spec);\n }\n\n /**\n * The colour `node` inherits, for frames that set `color: currentColor`, which is that colour\n * wherever the animation has got to, as in CSS. Undefined for frames that do not.\n */\n private inheritedColour(node: EngineNode, frames: readonly Keyframe[]): unknown {\n if (!readsInheritedColour(frames)) return undefined;\n const parent = node.parent && this.styles.resolve(node.parent, this.styleEpoch);\n return parent?.inherited['color'] ?? 'black';\n }\n\n /**\n * The name an animation plays now has other frames: a hot swap edited them, or took away the\n * sheet whose copy won. Or the colour its `color: currentColor` stands for has changed. It\n * carries on along the new tracks, on its own clock, as a browser does, paused or not.\n */\n private reframe(\n node: EngineNode,\n current: RunningAnimation,\n frames: readonly Keyframe[],\n props: Record<string, unknown>,\n inherited: unknown,\n ): void {\n const tracks = tracksOf(frames, props, inherited);\n const reframed: RunningAnimation = { ...current, tracks, inherited };\n const { values, finished } = sample(reframed, current.pausedAt ?? this.now());\n const holds = current.spec.fill === 'forwards' || current.spec.fill === 'both';\n reframed.values = finished && !holds ? {} : values;\n this.playedFrames.set(reframed, frames);\n node.playing = reframed;\n // One that had nothing to paint was let go of: with frames that say something it plays on.\n const stopped = reframed.done || reframed.pausedAt !== undefined || reframed.native;\n if (!stopped) this.playing.add(node);\n }\n\n /**\n * `animation-play-state` changed on an animation already playing: pausing holds the frame it\n * has reached, and running again carries on from there, the paused time left out of its clock.\n * Neither starts it over, as a change of play state does not in CSS.\n */\n private playOrPause(node: EngineNode, current: RunningAnimation, spec: AnimationSpec): void {\n current.spec = spec;\n const now = this.now();\n if (spec.paused && current.pausedAt === undefined && !current.done) {\n this.backToScript(node, current);\n current.pausedAt = now;\n this.playing.delete(node);\n } else if (!spec.paused && current.pausedAt !== undefined) {\n current.start += now - current.pausedAt;\n current.pausedAt = undefined;\n this.playing.add(node);\n }\n }\n\n /** Every node playing a scroll-driven animation, by the scroll view that plays it. */\n private readonly scrollTimelines = new Map<EngineNode, Set<EngineNode>>();\n /** How far each such scroll view scrolls, along each axis, once one of its events has said. */\n private readonly scrollExtents = new Map<EngineNode, { x: number; y: number }>();\n\n /**\n * An animation played by the nearest scroll view's offset: `animation-timeline: scroll()`.\n *\n * Its keyframes are laid along the offset and handed to native, which plays them as the view\n * scrolls, with no JavaScript between (`scroll-animation.ts`, `NativeScrollDriver.animate`).\n * The frame at the offset the view starts at is committed once and then left alone: a prop that\n * changed on a later commit would reset what native is animating.\n */\n private scrollAnimated(\n node: EngineNode,\n spec: AnimationSpec,\n frames: readonly Keyframe[],\n props: Record<string, unknown>,\n ): Record<string, unknown> {\n const current = node.scrolled;\n const inherited = this.inheritedColour(node, frames);\n if (current?.frames === frames && sameAnimation(current.spec, spec)) {\n return Object.assign(props, this.rescrolled(node, current, frames, props, inherited));\n }\n this.stopScrolled(node);\n this.handOverToScroll(node, spec);\n\n const tracks = tracksOf(frames, props, inherited);\n const source = this.scrollSourceOf(node);\n const extent = source ? (this.scrollExtents.get(source)?.[spec.timeline!] ?? null) : null;\n const range = rangeOf(spec, extent);\n const first: Record<string, unknown> = firstFrame(tracks, spec, range);\n const resting = { ...props };\n if (!source && this.dev) this.reportUnscrolled(spec.name);\n const drive = source ? this.driveScrolled(node, source, spec, tracks, resting, range) : null;\n // As Animated does: Fabric flattens a view that only lays out, and then there is no native\n // view for the animation to move. Committed with the first frame, so it stays put.\n if (drive) first['collapsable'] = false;\n node.scrolled = { spec, frames, tracks, resting, first, source, drive, inherited };\n return Object.assign(props, first);\n }\n\n /**\n * The first frame of a scroll-driven animation already playing. When the colour its\n * `color: currentColor` stands for has changed, that frame's colour is taken from tracks built\n * again. Native drives opacity and transforms only, so a colour holds its first frame, and\n * nothing native animates is touched.\n */\n private rescrolled(\n node: EngineNode,\n current: ScrollAnimation,\n frames: readonly Keyframe[],\n props: Record<string, unknown>,\n inherited: unknown,\n ): Record<string, unknown> {\n if (inherited === current.inherited) return current.first;\n // The element's own colour, which a track with no first frame starts at, may be the one it\n // inherits, so it is read again too.\n const resting = { ...current.resting, color: props['color'] };\n const tracks = tracksOf(frames, resting, inherited);\n const extent = current.source ? this.scrollExtents.get(current.source) : undefined;\n const range = rangeOf(current.spec, extent?.[current.spec.timeline!] ?? null);\n const first = { ...current.first };\n const colour = firstFrame(tracks, current.spec, range)['color'];\n if ('color' in first) first['color'] = colour;\n node.scrolled = { ...current, tracks, resting, first, inherited };\n return first;\n }\n\n /** Hand a scroll-driven animation's channels to native, fed by `source`'s scroll events. */\n private driveScrolled(\n node: EngineNode,\n source: EngineNode,\n spec: AnimationSpec,\n tracks: ScrollAnimation['tracks'],\n resting: Record<string, unknown>,\n range: readonly [number, number],\n ): ScrollAnimation['drive'] {\n if (!this.scrollDriver) return null;\n const { channels, held } = scrollChannels(tracks, spec, resting, range);\n if (held.length && this.dev) this.reportHeld(spec.name, held);\n let playing = this.scrollTimelines.get(source);\n if (!playing) this.scrollTimelines.set(source, (playing = new Set()));\n playing.add(node);\n return this.scrollDriver.animate(\n node,\n source,\n scrollFeed(spec.timeline!),\n channels,\n (one) => (one as EngineNode).committed?.tag ?? null,\n );\n }\n\n /** The scroll view a scroll-driven animation on `node` follows: the nearest one it is inside. */\n private scrollSourceOf(node: EngineNode): EngineNode | null {\n for (let up = node.parent; up; up = up.parent) {\n const name = viewNameOf(up);\n if (name === 'ScrollView' || name === 'AndroidHorizontalScrollView') return up;\n }\n return null;\n }\n\n private stopScrolled(node: EngineNode): void {\n const scrolled = node.scrolled;\n if (!scrolled) return;\n node.scrolled = undefined;\n scrolled.drive?.stop();\n if (scrolled.source) this.scrollTimelines.get(scrolled.source)?.delete(node);\n }\n\n /**\n * A scroll view has said how far it scrolls. Every animation on it with a range that depends on\n * that - none written, or a percentage - is laid out again along the new extent.\n */\n private measuredScroll(source: EngineNode, event: unknown): void {\n const { contentSize, layoutMeasurement } = (event ?? {}) as {\n contentSize?: { width: number; height: number };\n layoutMeasurement?: { width: number; height: number };\n };\n if (!contentSize || !layoutMeasurement) return;\n const extent = {\n x: Math.max(0, contentSize.width - layoutMeasurement.width),\n y: Math.max(0, contentSize.height - layoutMeasurement.height),\n };\n const known = this.scrollExtents.get(source);\n if (known && known.x === extent.x && known.y === extent.y) return;\n this.scrollExtents.set(source, extent);\n for (const node of this.scrollTimelines.get(source) ?? []) {\n const scrolled = node.scrolled;\n if (!scrolled?.drive) continue;\n const range = rangeOf(scrolled.spec, extent[scrolled.spec.timeline!]);\n scrolled.drive.update(\n scrollChannels(scrolled.tracks, scrolled.spec, scrolled.resting, range).channels,\n );\n }\n }\n\n private reportUnscrolled(name: string): void {\n if (this.reported.has(`scroll ${name}`)) return;\n this.reported.add(`scroll ${name}`);\n console.error(\n `[angular-native] '${name}' plays by animation-timeline: scroll(), but the element is not ` +\n `inside a scroll view, so nothing moves it. It shows its first frame.`,\n );\n }\n\n private reportHeld(name: string, properties: readonly string[]): void {\n if (this.reported.has(`held ${name}`)) return;\n this.reported.add(`held ${name}`);\n console.error(\n `[angular-native] '${name}' plays by a scroll, which native drives for opacity and ` +\n `transforms only. ${properties.join(', ')} holds its first frame.`,\n );\n }\n\n private reportMissingKeyframes(name: string): void {\n if (this.reported.has(`@keyframes ${name}`)) return;\n this.reported.add(`@keyframes ${name}`);\n console.error(\n `[angular-native] no @keyframes named '${name}'. Nothing animates, and the element ` +\n `renders with its resting style. Keyframes are global across every stylesheet the app ` +\n `has loaded, so the block has to exist somewhere by the time the animation starts.`,\n );\n }\n\n private transitioned(node: EngineNode, props: Record<string, unknown>): Record<string, unknown> {\n // Nobody saw what the last commit gave a view it created, so this is where the view starts.\n if (node.bornIn! >= this.unseen) node.transitions = undefined;\n const spec = transitionSpec(props);\n if (!spec && !node.transitions) return props;\n\n const state = (node.transitions ??= new Map());\n const now = this.now();\n\n for (const key of steppedKeys(props, spec, state)) {\n if (step(state, key, props, spec?.[key] ?? spec?.['all'], now)) {\n this.running.add(node);\n this.emitTransition(node, 'topTransitionstart', key);\n }\n }\n\n if (state.size === 0) node.transitions = undefined;\n return props;\n }\n\n /**\n * Whether an animation that has finished goes on holding its last frame. With a forwards fill\n * it does, for good: without one the element falls back to whatever the cascade gives it, and\n * 'backwards' fills the start only. Heard, it holds until whoever listens has been told: see\n * `lettingGo`.\n */\n private keeps(node: EngineNode, running: RunningAnimation): boolean {\n if (running.spec.fill === 'forwards' || running.spec.fill === 'both') return true;\n // One that listened and has stopped leaves an empty set behind: nobody to hear it.\n if (!node.listeners?.get('topAnimationend')?.size) return false;\n this.lettingGo.add(node);\n return true;\n }\n\n /** One `@keyframes` player, one frame on. */\n private advancePlayer(node: EngineNode, now: number): void {\n const running = node.playing;\n if (!running) {\n this.playing.delete(node);\n return;\n }\n\n if (running.pausedAt !== undefined) {\n this.playing.delete(node);\n return;\n }\n // Frames that say nothing paint nothing: a keyframe's one declaration refused at build time\n // leaves these. No frame of it is committed, and one that never ends has nothing left to do.\n const idle = running.tracks.size === 0;\n const { values, finished } = sample(running, now);\n // One of no time is finished already, endless or not, and ends as any other does.\n if (idle && !finished && running.spec.iterations === null) {\n this.playing.delete(node);\n return;\n }\n running.values = finished && !this.keeps(node, running) ? {} : values;\n // Its end is still a commit: that is what its `animationend` is sent after.\n if (!idle || finished) this.markProps(node, false);\n\n if (!finished) return;\n running.done = true;\n this.playing.delete(node);\n this.emitTransition(node, 'topAnimationend', running.spec.name);\n }\n\n /**\n * Late-bound because the host that wants the callback is usually built from this engine, so\n * neither can be constructed with the other in hand.\n */\n setOnDirty(fn: () => void): void {\n this.onDirty = fn;\n }\n\n /** Late-bound for the same reason: the app's `ErrorHandler` lives in an injector built later. */\n setOnError(fn: (error: unknown, topLevelType: string) => void): void {\n this.onError = fn;\n }\n\n /** Whether any transition or animation still has frames left to run. */\n get animating(): boolean {\n return this.running.size > 0 || this.playing.size > 0;\n }\n\n /**\n * Whether anything has changed since the last commit.\n *\n * The frame loop reads this because a `transitionend` listener runs after its commit has\n * finished, and what it does is often to remove the element that just finished leaving. That\n * change needs a commit of its own or the view stays on screen, fully transparent, forever.\n */\n get pending(): boolean {\n return this.root.structureDirty || this.root.subtreeDirty;\n }\n\n /**\n * Advance every transition to `now` and mark what changed. The caller commits afterwards; on a\n * device the platform pumps this from `requestAnimationFrame` for as long as it returns true.\n */\n advanceAnimations(now: number = this.now()): boolean {\n for (const node of [...this.playing]) this.advancePlayer(node, now);\n for (const node of [...this.running]) {\n let live = false;\n for (const [key, transition] of node.transitions ?? []) {\n if (transition.done) continue;\n const elapsed = now - transition.start;\n // Still inside the delay: nothing to paint yet, but the transition is not over.\n if (elapsed < 0) {\n live = true;\n continue;\n }\n const progress = transition.duration <= 0 ? 1 : Math.min(1, elapsed / transition.duration);\n if (progress >= 1) {\n transition.current = transition.to;\n transition.done = true;\n this.emitTransition(node, 'topTransitionend', key);\n } else {\n transition.current = interpolate(\n transition.from,\n transition.to,\n bezier(transition.easing, progress),\n );\n live = true;\n }\n this.markProps(node, false);\n }\n if (!live) this.running.delete(node);\n }\n return this.animating;\n }\n\n /** The host's conversions, applied to a copy. A removed prop travels as null and stays null. */\n private processed(props: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n const value = props[key];\n if (value === null || value === undefined) out[key] = value;\n else if (isColorProp(key)) out[key] = this.painted(key, value);\n // A list of sources has already been resolved by whoever built it, as RN's resolver\n // also assumes: it passes any object through and only turns a number into one.\n else if (ASSET_PROPS.has(key) && !Array.isArray(value))\n out[key] = this.resolveAssetSource(value);\n else if (NESTED_COLOR_LIST_PROPS.has(key)) out[key] = this.processNestedColors(value);\n else if (key === 'experimental_backgroundImage') out[key] = this.processGradients(value);\n else if (key === 'filter') out[key] = this.processFilters(value);\n // A bound style's transform is still the CSS string: see `inline-transform.ts`.\n else if (key === 'transform' && typeof value === 'string') out[key] = transformOf(value);\n else out[key] = value;\n }\n return out;\n }\n\n /** Copy a list of shadow-like objects, running each `color` through the host's converter. */\n private processNestedColors(value: unknown): unknown {\n if (!Array.isArray(value)) return value;\n return value.map((entry) => {\n const item = entry as Record<string, unknown>;\n if (item?.['color'] === undefined) return entry;\n return { ...item, color: this.color(item['color'] as string | number) };\n });\n }\n\n /**\n * Copy a filter list, running a drop shadow's colour through the host's converter. Android reads\n * that colour as a number and throws on a string, taking the whole surface down with it.\n */\n private processFilters(value: unknown): unknown {\n if (!Array.isArray(value)) return value;\n return value.map((entry) => {\n const shadow = (entry as { dropShadow?: Record<string, unknown> })?.dropShadow;\n if (shadow?.['color'] === undefined) return entry;\n return {\n dropShadow: { ...shadow, color: this.color(shadow['color'] as string | number) },\n };\n });\n }\n\n /**\n * Mark the text field each box of a row aligned by baseline takes its baseline from, before\n * the field is merged, and unmark it when the row is aligned another way.\n */\n private noteBaselineFields(row: EngineNode): void {\n const aligned = ownLayout(row, 'alignItems') === 'baseline';\n const before = row.baselineFields;\n if (!aligned && !before) return;\n const now = new Set(\n aligned ? row.children.filter(inFlow).map(fieldOnBaseline).filter(isNode) : [],\n );\n // One that is no longer this row's, and that no other row has marked since.\n for (const field of before ?? []) {\n if (!now.has(field) && field.onBaseline === row) this.onBaselineOf(field, undefined);\n }\n for (const field of now) if (field.onBaseline !== row) this.onBaselineOf(field, row);\n row.baselineFields = now.size ? now : undefined;\n }\n\n private onBaselineOf(field: EngineNode, row: EngineNode | undefined): void {\n field.onBaseline = row;\n this.markProps(field, false);\n }\n\n /**\n * Have the text a row aligned by baseline takes a baseline from measured again, where that\n * text is inside one of the row's boxes and the row is committed again. React Native keeps\n * what a paragraph measured on the one copy of its node that was measured, and Yoga copies a\n * node it lays out around: a row that is laid out again asks a box for its baseline, the box\n * asks the paragraph in it, and a copy that was never measured works it out then, on a node\n * that is by then not to be changed. A debug build stops there. Committed to be measured\n * again (`remeasure`), the paragraph is measured in this commit and has the answer.\n *\n * ponytail: the first box in the flow at each level, which is the one Yoga asks unless\n * another is aligned by baseline itself. A row a commit lays out again without the engine\n * cloning it, as its room changing does, is not reached: clone on a layout event if one is\n * seen to stop there.\n */\n private freshBaselines(row: EngineNode): void {\n if (!row.committed || ownLayout(row, 'alignItems') !== 'baseline') return;\n for (const item of row.children) {\n let at = firstInFlow(item);\n while (at?.committed && committedViewName(at) !== PARAGRAPH) at = firstInFlow(at);\n if (!at?.committed) continue;\n at.remeasure = true;\n for (let up: EngineNode | null = at; up && up !== row; up = up.parent) up.subtreeDirty = true;\n }\n }\n\n /**\n * Copy a list of gradients, running every stop's colour through the host's converter.\n *\n * A stop's colour is a colour like any other, but it is two levels down and nothing else looks\n * there: without this the device is handed the string `rgb(255, 0, 0)` where it wants a number,\n * and paints nothing. The stops are first rewritten so native's interpolation paints what\n * CSS's premultiplied one does (see `premultipliedStops`).\n */\n private processGradients(value: unknown): unknown {\n if (!Array.isArray(value)) return value;\n return value.map((entry) => {\n const gradient = entry as { colorStops?: { color?: unknown }[] };\n if (!Array.isArray(gradient?.colorStops)) return entry;\n return {\n ...gradient,\n colorStops: premultipliedStops(gradient.colorStops).map((stop) => ({\n ...stop,\n color: this.color(stop.color),\n })),\n };\n });\n }\n\n private clearFlags(node: EngineNode): void {\n node.propsDirty = false;\n node.structureDirty = false;\n node.subtreeDirty = false;\n }\n\n private reconcile(node: EngineNode): FabricNode {\n // A clean node can still need re-rendering: if an ancestor's class changed, what this node\n // inherits changed with it, and nothing marked this node dirty. The resolver hands back the\n // very same cache object when nothing has changed, so one reference comparison settles it,\n // and a subtree whose inherited context is unmoved is skipped exactly as before.\n const style = node.kind === 'element' ? this.styles.resolve(node, this.styleEpoch) : null;\n const styleChanged = node.styleCommitted !== style;\n if (this.isClean(node) && !styleChanged) return node.committed!.handle;\n node.styleCommitted = style;\n repaint(node);\n this.refitChildren(node);\n\n const viewName = committedViewName(node);\n this.forgetRenamed(node, viewName);\n this.noteBaselineFields(node);\n this.freshBaselines(node);\n const childHandles = this.reconcileChildren(node, viewName, style);\n noteTouches(node, style);\n const previous = node.committed;\n this.notePresented(node, viewName);\n if (!previous)\n return this.create(node, viewName, this.mergeProps(node, viewName), childHandles);\n\n // `propsDirty` is precise: Angular only calls setProperty when a binding actually changed.\n // It is not sufficient on its own, though. A node whose ancestor's class changed inherits\n // something new without any binding of its own having moved, so it is not propsDirty and\n // would never re-clone. `styleChanged` is the other half of that question. An ancestor that\n // is here only because something beneath it moved has the props it had.\n const propsMoved = node.propsDirty || styleChanged;\n const props = propsMoved ? this.mergeProps(node, viewName) : previous.props;\n const propsPayload = propsMoved ? this.propsPayload(node, previous.props, props) : null;\n\n const childrenChanged = this.childrenMoved(node, childHandles, previous.childHandles);\n\n let handle = previous.handle;\n if (childrenChanged || propsPayload) {\n handle = this.clone(\n previous.handle,\n propsPayload && this.processed(propsPayload),\n childrenChanged ? childHandles : null,\n );\n // A clone is the same view, so it keeps the tag it was created with, not the newest tag\n // handed out, which is some other node's.\n node.committed = { handle, tag: previous.tag, props, childHandles, viewName };\n }\n this.clearFlags(node);\n return handle;\n }\n\n /** What a clone sends: the props that changed, and a text input's font once it registered. */\n private propsPayload(\n node: EngineNode,\n previous: Record<string, unknown>,\n props: Record<string, unknown>,\n ): Record<string, unknown> | null {\n const payload = diffProps(previous, props);\n if (payload && this.fontsRefreshed && this.fontResends.delete(node)) {\n payload['fontFamily'] = props['fontFamily'];\n }\n return payload;\n }\n\n /**\n * Whether a node has to be committed with its children again.\n *\n * A child that re-cloned has a new handle, so the parent must re-clone too. This is the bubble\n * that persistent trees force, and it is why dirty marking propagates upwards. A node to be\n * measured again is cloned with its children even when they are the same ones: new children\n * is what makes Fabric dirty a measured node (`remeasureText`).\n */\n private childrenMoved(node: EngineNode, next: FabricNode[], previous: FabricNode[]): boolean {\n const remeasure = node.remeasure === true;\n node.remeasure = undefined;\n return remeasure || !sameHandles(next, previous);\n }\n\n /**\n * The handles of a node's children, reconciling only the ones that can have changed.\n *\n * One changed row in a list of a thousand makes the list re-clone, and the other 999 are asked\n * for their handle. A clean child whose style still holds under this node's is its committed\n * handle as it stands, so it is answered here without the call, the resolve and the walk -\n * which, per child, was most of what a one-row update cost.\n */\n private reconcileChildren(\n node: EngineNode,\n viewName: string,\n style: StyleCache | null,\n ): FabricNode[] {\n const context = style?.context;\n if (HOIST_TARGETS.has(node.name)) return this.reconcileHoistTarget(node, context);\n const handles: FabricNode[] = [];\n for (const child of node.children) {\n if (child.kind === 'anchor' || this.committedElsewhere(child) || this.withheld(child)) {\n continue;\n }\n if (child.kind === 'text') {\n const handle = this.reconcileText(node, child, viewName, context);\n if (handle) handles.push(handle);\n continue;\n }\n handles.push(this.reconcileUnder(node, child, context));\n }\n return handles;\n }\n\n /**\n * The paragraph a run of text written straight into a view is drawn in, or nothing for a run of\n * whitespace, which a browser draws nothing for between the items of a flex box either.\n *\n * It is the text's own, kept on the text node, and no part of the tree: its parent is the view,\n * so it inherits what the view's text would, and no rule matches it.\n */\n /**\n * A run of text under `parent`, which commits as `viewName`: the text itself inside a text, a\n * paragraph of its own inside any other view, and nothing where the view takes its text as a\n * prop (see `ViewNameOptions`) or the run is whitespace between a view's children.\n */\n private reconcileText(\n parent: EngineNode,\n text: EngineNode,\n viewName: string,\n context?: object,\n ): FabricNode | null {\n if (TEXT_CONTENT_PROPS[viewName] !== undefined) return null;\n if (viewName === PARAGRAPH || viewName === VIRTUAL_TEXT) {\n // Under a text element, the paragraph it had in a view is done with. Under that paragraph\n // itself, which is where a loose run is committed, it is the one to keep.\n if (text.box && text.box !== parent) text.box = undefined;\n return this.reconcileUnder(parent, text, context);\n }\n const box = this.looseText(parent, text);\n return box ? this.reconcileUnder(parent, box, context) : null;\n }\n\n private looseText(parent: EngineNode, text: EngineNode): EngineNode | null {\n if (!trimEnds(text.text)) return null;\n let box = text.box;\n if (!box) {\n box = new RetainedNode('element', 'text', this);\n box.anonymous = true;\n box.children = [text];\n text.box = box;\n }\n box.parent = parent;\n // The text is not under the box in the tree, so a change to it never marked the box.\n if (!this.isClean(text)) box.subtreeDirty = true;\n return box;\n }\n\n /** Remember an iOS modal host committed as showing, so hiding it waits for `topDismiss`. */\n private notePresented(node: EngineNode, viewName: string): void {\n if (viewName !== MODAL_HOST || node.props['visible'] === false) return;\n if (platformOS === 'ios') node.presented = true;\n }\n\n /**\n * Whether a child is left out of its parent's commit: a modal host whose `visible` is false.\n *\n * The native host covers the screen and takes every touch whether or not it presents anything,\n * which is why React Native's Modal.js renders null while hidden. This is the same thing, so a\n * hidden `<modal>` leaves the screen under it usable. On iOS a modal that was showing stays\n * committed, with `visible` false, until native reports `topDismiss`: Modal.js keeps it that\n * long so the dismissal animates and `(dismiss)` fires. Android drops it at once, as Modal.js\n * does there.\n *\n * A withheld host is unmounted, and Fabric drops an unmounted view's event target for good\n * (`EventEmitter::setEnabled`), so its committed handles are forgotten and it is created afresh\n * when it is shown again, as Modal.js creates it afresh. Committed again, it ignores every touch.\n */\n private withheld(child: EngineNode): boolean {\n if (this.undisplayed(child)) return true;\n if (child.props['visible'] !== false || child.presented) return false;\n if (viewNameOf(child) !== MODAL_HOST) return false;\n if (child.committed) this.forgetCommitted(child);\n return true;\n }\n\n /**\n * Whether an element is `display: none`, which has no box and so no view, nor has anything\n * in it. A view that is committed and not displayed looks the same, but Yoga marks one as\n * laid out each time it measures what holds it, and React Native clears the mark only where it\n * reads that parent's layout: a debug build stops at the mark, on a later commit that has the\n * parent's layout already. Shown again it is made again, as an element put back in the tree\n * is: what its views held of their own, a scroll offset, is not kept.\n */\n private undisplayed(child: EngineNode): boolean {\n if (child.kind !== 'element') return false;\n this.styles.resolve(child, this.styleEpoch);\n if (ownLayout(child, 'display') !== 'none') return false;\n if (child.committed) {\n this.forgetCommitted(child);\n // A field in it has no view to send its blur from.\n if (isWithin(this.focusedNode, child)) this.setFocused(null);\n }\n return true;\n }\n\n /**\n * Whether a node hoisted into `target` is not displayed where it was written: it, or a box\n * between it and the child of `target` it was written in. That child is asked before this is.\n */\n private undisplayedUnder(target: EngineNode, written: EngineNode): boolean {\n for (let at: EngineNode | null = written; at && at.parent !== target; at = at.parent) {\n if (!this.undisplayed(at)) continue;\n if (written.committed) this.forgetCommitted(written);\n return true;\n }\n return false;\n }\n\n /**\n * `reconcileChildren` for a node other nodes hoist into: its own children, each followed by\n * the hoisted nodes written inside it, then those written in it directly, then the views it\n * keeps for hoisted nodes that are gone.\n */\n private reconcileHoistTarget(node: EngineNode, context: object | undefined): FabricNode[] {\n const handles: FabricNode[] = [];\n const hoisted = this.hoistedInto(node);\n const landed = new Set<string>();\n // One written directly in the node goes after its siblings: a page writes its header first,\n // and UIKit collapses a large title against the scroll view down the screen's first subviews,\n // which RNS keeps clear by never letting the header config be the first.\n const direct: EngineNode[] = [];\n for (const child of node.children) {\n if (child.kind === 'anchor' || this.committedElsewhere(child) || this.withheld(child)) {\n continue;\n }\n if (this.hoisted.has(child)) direct.push(child);\n else handles.push(this.reconcileUnder(node, child, context));\n const moved = hoisted?.get(child);\n for (const written of moved ?? []) {\n if (!this.undisplayedUnder(node, written)) handles.push(this.land(node, written, landed));\n }\n }\n for (const child of direct) handles.push(this.land(node, child, landed));\n if (node.kept) this.standIn(node, landed, handles);\n return handles;\n }\n\n /**\n * A child's handle as a child of `parent`, created again when it was committed under another.\n *\n * Native gives a view one parent for as long as it lives: `ShadowNodeFamily::setParent`\n * asserts it in a debug build, and a release build keeps the first parent and measures and lays\n * the view out against the wrong ancestry. A node Angular moves - content projected into a\n * container that was mounted again, a scroll view Android wraps in its swipe layout - is\n * therefore created afresh, with everything under it, as React creates an element that moves.\n * Its native state goes with it, as it would there.\n */\n private reconcileUnder(parent: EngineNode, child: EngineNode, context?: object): FabricNode {\n if (child.committed && child.committedUnder !== parent) this.forgetCommitted(child);\n const handle = this.stillCommitted(child, context) ?? this.reconcile(child);\n child.committedUnder = parent;\n return handle;\n }\n\n /**\n * A node whose native view is no longer the one it was created as is created again: a text\n * element that came to hold a view, or stopped. A clone keeps the view it was made as.\n */\n private forgetRenamed(node: EngineNode, viewName: string): void {\n if (node.committed && node.committed.viewName !== viewName) this.forgetCommitted(node);\n }\n\n /**\n * Let a node and everything under it be created again at the next commit. The views it keeps\n * for hoisted names go too: they are children of the native view it is losing.\n */\n private forgetCommitted(node: EngineNode): void {\n node.committed = null;\n node.committedUnder = null;\n node.styleCommitted = null;\n node.kept = undefined;\n if (node.box?.committed) this.forgetCommitted(node.box);\n for (const child of node.children) {\n if (child.committed || child.box?.committed) this.forgetCommitted(child);\n }\n }\n\n /** A hoisted node, which commits into an ancestor further up than the parent it is in. */\n private committedElsewhere(child: EngineNode): boolean {\n return this.hoisted.has(child) && this.hoistsAbove(child);\n }\n\n /**\n * Reconcile a hoisted element committing into `target`, into the native view `target` already\n * keeps for its name when it has one (`HoistOptions.standIn`), and keep the view it commits as.\n */\n private land(target: EngineNode, child: EngineNode, landed: Set<string>): FabricNode {\n if (!STAND_INS[child.name]) return this.reconcileUnder(target, child);\n const kept = target.kept?.get(child.name);\n if (kept && kept.node !== child && child.committed === null && !isWithin(kept.node, target)) {\n // A node taken out without being destroyed would otherwise come back holding this tag too.\n if (kept.node) kept.node.committed = null;\n child.committed = kept.committed;\n child.propsDirty = true;\n }\n const handle = this.reconcile(child);\n child.committedUnder = target;\n (target.kept ??= new Map()).set(child.name, { node: child, committed: child.committed! });\n landed.add(child.name);\n return handle;\n }\n\n /**\n * Commit the stand-in props onto every view `target` keeps whose element is gone, on the view\n * itself so the native side sees an update rather than a removal.\n */\n private standIn(target: EngineNode, landed: Set<string>, handles: FabricNode[]): void {\n for (const [name, kept] of target.kept!) {\n if (landed.has(name)) continue;\n if (kept.node) {\n const props = {\n ...DEFAULT_PROPS[registeredViewName(name) ?? DEFAULT_VIEW],\n ...STAND_INS[name],\n };\n const payload = diffProps(kept.committed.props, props);\n const handle = this.clone(kept.committed.handle, payload && this.processed(payload), []);\n kept.committed = { ...kept.committed, handle, props, childHandles: [] };\n kept.node = null;\n }\n handles.push(kept.committed.handle);\n }\n }\n\n /** A clean child's committed handle, when its style still holds under its parent's. */\n private stillCommitted(child: EngineNode, context: object | undefined): FabricNode | null {\n const committed = child.committed;\n if (\n committed === null ||\n context === undefined ||\n child.propsDirty ||\n child.structureDirty ||\n child.subtreeDirty\n ) {\n return null;\n }\n if (child.kind === 'text') return committed.handle;\n const holds = child.styleCache === child.styleCommitted && this.styles.holds(child, context);\n return holds ? committed.handle : null;\n }\n\n /**\n * The hoisted nodes that commit as direct children of `node`, keyed by the child of `node` each\n * was written inside. Null when there are none, which is nearly always.\n */\n private hoistedInto(node: EngineNode): Map<EngineNode, EngineNode[]> | null {\n let found: Map<EngineNode, EngineNode[]> | null = null;\n for (const candidate of this.hoisted) {\n if (candidate.parent === node || HOISTS[candidate.name] !== node.name) continue;\n let written: EngineNode = candidate;\n let above = candidate.parent;\n while (above && above !== node && above.name !== node.name) {\n written = above;\n above = above.parent;\n }\n if (above !== node) continue;\n found ??= new Map();\n const list = found.get(written);\n if (list) list.push(candidate);\n else found.set(written, [candidate]);\n }\n return found;\n }\n\n /** Whether a hoisted node commits further up than the parent it was written in. */\n private hoistsAbove(node: EngineNode): boolean {\n const target = HOISTS[node.name];\n if (node.parent?.name === target) return false;\n for (let above = node.parent?.parent; above; above = above.parent) {\n if (above.name === target) return true;\n }\n return false;\n }\n\n private create(\n node: EngineNode,\n viewName: string,\n props: Record<string, unknown>,\n childHandles: FabricNode[],\n ): FabricNode {\n if (this.dev) {\n this.checkClaimed(node);\n this.checkKnown(node);\n }\n const tag = nextTag();\n this.stats.createdNodes++;\n // instanceHandle is the retained node itself: it is what Fabric hands back on events.\n const handle = this.fabric.createNode(tag, viewName, this.rootTag, this.processed(props), node);\n for (const child of childHandles) this.fabric.appendChild(handle, child);\n node.committed = { handle, tag, props, childHandles, viewName };\n node.bornIn = this.stats.commits;\n this.clearFlags(node);\n return handle;\n }\n\n /**\n * Angular's own unknown-element check does not run in this pipeline, so a `<text>` in a\n * template that never imported `Text` compiles, draws without the component, and looks like a\n * layout bug. On the first commit of any known element with no component behind it, say so.\n */\n private checkClaimed(node: EngineNode): void {\n // The paragraph the engine wraps loose text in is its own: no template wrote it.\n if (node.kind !== 'element' || node.claimed || node.anonymous) return;\n if (!PRIMITIVE_NAMES.has(node.name)) return;\n if (this.reported.has(node.name)) return;\n this.reported.add(node.name);\n console.error(\n `[angular-native] <${node.name}> is used in a template that does not import ` +\n `${className(node.name)}. Add it to the component's \\`imports\\` from ` +\n `'@ng-native/components'; without it the element has none of the component's inputs ` +\n `or behavior, so a prop written on it stays the text it was written as.`,\n );\n }\n\n /**\n * The misspelt-prop check. Angular's own \"Can't bind to\" check needs a DOM to run, so a\n * `[numberofLines]` on a `<text>`, or a static `iosBackgroundColor` on a `<switch>`, went to\n * native as a prop no view reads, and nothing said so. A prop on a host primitive that its\n * component did not declare is reported once per element name and prop, with the declared name\n * it most likely meant when there is one.\n */\n private readonly undefinedTokens = new Set<string>();\n\n /** Said once per name: a phone has no inspector to show the declaration struck out. */\n private reportUndefinedToken(name: string, props: readonly string[], on?: string): void {\n if (this.undefinedTokens.has(name)) return;\n this.undefinedTokens.add(name);\n // A bound declaration has no rule to be found by, so it says which element it is on.\n const where = on === undefined ? props.join(', ') : `${props.join(', ')}, bound on <${on}>,`;\n console.warn(\n `[angular-native] var(${name}) in ${where} names a custom property nothing in` +\n ` scope defines, so the declaration is dropped, as a browser drops it. Define ${name} on` +\n ` :root or an ancestor, or give the var() a fallback.`,\n );\n }\n\n private readonly unreadDisplays = new Set<string>();\n\n /**\n * Said once per token and value: the compiler refuses `display: grid` written out, but a token\n * is only known here, and without this the view lays out as flex with nothing said.\n */\n private reportUnreadDisplay(name: string, value: string | undefined): void {\n const report = `${name} ${value}`;\n if (this.unreadDisplays.has(report)) return;\n this.unreadDisplays.add(report);\n console.warn(\n `[angular-native] display: var(${name}) is ${value ?? 'no keyword'}, which is no display` +\n ` native has, so display is unset and the view lays out as flex. Native has flex, none` +\n ` and contents, and reads block, inline, inline-block, flow-root and inline-flex as flex.`,\n );\n }\n\n private checkProps(node: EngineNode): void {\n if (!node.claimed || !PRIMITIVE_NAMES.has(node.name)) return;\n const declared = DECLARED_PROPS.get(node.name);\n if (!declared) return;\n for (const key of Object.keys(node.props)) {\n if (this.isDeclared(declared, key, node.props[key])) continue;\n const report = `${node.name} ${key}`;\n if (this.reported.has(report)) continue;\n this.reported.add(report);\n const meant = [...declared].find((name) => name.toLowerCase() === key.toLowerCase());\n console.warn(\n `[angular-native] <${node.name}> has no prop '${key}', so native ignores it.` +\n (meant ? ` Did you mean '${meant}'?` : '') +\n ` Check the spelling against the ${className(node.name)} page, or declare it with` +\n ` declareNativeProps('${node.name}', ['${key}']) if the native view does read it.`,\n );\n }\n }\n\n private isDeclared(declared: Set<string>, key: string, value: unknown): boolean {\n return (\n declared.has(key) ||\n ENGINE_PROPS.has(key) ||\n this.declaredAttributes.has(key) ||\n // A forms directive's input has a report of its own, naming the import it is missing.\n isFormsInput(key) ||\n key.includes('-') ||\n // A bare marker attribute, `<text listHeader>`, is there for a selector to match.\n value === ''\n );\n }\n\n /**\n * Element names some template's directives select by tag: every component with an element\n * selector, and directives such as Angular's `router-outlet` that own an element without\n * hosting a component. Declared by the platform adapter, which sees each template's directive\n * registry as the component is created.\n */\n private readonly declaredElements = new Set<string>();\n\n /** An element name a directive or component selects, and so is not a typo. */\n declareElement(name: string): void {\n this.declaredElements.add(name);\n }\n\n /**\n * Attribute names that belong to Angular rather than to a native view: what a directive selects\n * on or takes as an input, and what a component's `<ng-content select>` projects by. Angular\n * writes a static attribute to the node whatever consumes it, so without these a\n * `nativeRouterLink` or a `listHeader` marker would read as a misspelt prop. See `checkProps`.\n */\n private readonly declaredAttributes = new Set<string>();\n\n declareAttribute(name: string): void {\n this.declaredAttributes.add(name);\n }\n\n /**\n * The typo check. The set a name is looked up in is app-wide rather than per template, so a\n * directive imported in one template also quiets its name in another that forgot it. That is\n * the trade for not holding a registry per component, and the typo is the case that matters.\n */\n private checkKnown(node: EngineNode): void {\n if (node.kind !== 'element' || node.componentHost || node.name in VIEW_NAMES) return;\n if (this.declaredElements.has(node.name) || this.reported.has(node.name)) return;\n this.reported.add(node.name);\n console.error(\n `[angular-native] <${node.name}> is not a known element: no component, directive or ` +\n `registered native view claims it, so it renders as an empty view. Check the spelling, ` +\n `or import the component that owns it.`,\n );\n }\n\n // --- responder system -------------------------------------------------\n\n private readonly responders = new WeakMap<EngineNode, ResponderHandlers>();\n private currentResponder: EngineNode | null = null;\n\n /** Register a node as a candidate responder. Returns an unsubscribe. */\n setResponder(node: EngineNode, handlers: ResponderHandlers): () => void {\n this.registerEventHandler();\n this.responders.set(node, handlers);\n this.keepNative(node, true);\n // What it is committed with can hang on whether it takes a touch: see `stillTouched`.\n this.markProps(node);\n return () => {\n this.responders.delete(node);\n this.keepNative(node, false);\n this.markProps(node);\n if (this.currentResponder !== node) return;\n // Torn down under the finger: no release is coming, so the chain it marked is cleared\n // here or it stays `:active` for good.\n const changed = this.setActiveChain(node, false);\n this.tellNative(node, false);\n this.currentResponder = null;\n if (changed) this.commit();\n };\n }\n\n /**\n * Keep a native view for this node, or stop keeping one.\n *\n * Fabric flattens a view whose props say nothing visual and nothing interactive: no native view\n * is created and its layout is folded into the parent. Responders live here, in JavaScript, and\n * Fabric cannot see them - so a transparent touch-catcher looks exactly like a view worth\n * flattening, and gets flattened, and never receives the touch it exists to catch.\n *\n * That is a popover that will not close. The full-screen catcher over the app has no background\n * and nothing else on it; the dialog's backdrop survived the same treatment only because\n * `bg-black/50` happened to make it visual.\n *\n * Only plain views: flattening is `ViewShadowNode`'s, so a paragraph, a scroll view or a text\n * input is already a native view and marking it would be a prop on every text node in the tree\n * that buys nothing.\n *\n * A floor rather than an override: `collapsable=\"true\"` written on an element is left alone,\n * because someone who writes it means it.\n */\n private keepNative(node: EngineNode, keep: boolean): void {\n if (viewNameOf(node) !== DEFAULT_VIEW) return;\n if (keep) {\n if (node.props['collapsable'] === undefined) this.setProp(node, 'collapsable', false);\n return;\n }\n if (node.props['collapsable'] === false) this.setProp(node, 'collapsable', null);\n }\n\n /**\n * A view command, by name: `focus` and `blur` on a text input, `scrollTo` on a scroll view.\n * Fabric addresses the committed shadow node, so a node that has not reached a commit yet has\n * nothing to receive it and the call is dropped.\n */\n dispatchCommand(node: EngineNode, name: string, args: readonly unknown[] = []): void {\n const handle = node.committed?.handle;\n if (handle && this.fabric.dispatchCommand) this.fabric.dispatchCommand(handle, name, args);\n }\n\n /**\n * Where a node is, in window coordinates.\n *\n * `(layout)` reports a frame in the parent's coordinates, which sizes a view and says nothing\n * about where it is relative to anything else. This is what an anchored overlay needs: a\n * popover and its trigger live in different parts of the tree and can only be compared in the\n * window's frame.\n *\n * The callback is the platform's own shape rather than a promise, and on the new architecture\n * it fires before this returns - so a caller that needs the value immediately can capture it,\n * and one that does not is unaffected if that ever changes.\n *\n * Silent when the node has never been committed, or when the host has no `measureInWindow`.\n * Reporting zeroes would be worse than reporting nothing: a zero frame is a position, and an\n * overlay would believe it and place itself in the corner.\n */\n measure(node: EngineNode, into: (frame: WindowFrame) => void): void {\n const handle = node.committed?.handle;\n if (!handle || !this.fabric.measureInWindow) return;\n this.fabric.measureInWindow(handle, (x, y, width, height) => into({ x, y, width, height }));\n }\n\n /**\n * The react tag a node was committed with, or null if it has never reached a commit.\n *\n * This is what the native animation driver writes to: `connectAnimatedNodeToView` takes a tag,\n * and `findNodeHandle` hands a number straight back, so an animated graph can point at one of\n * our nodes without a React instance existing anywhere.\n */\n tagOf(node: EngineNode): number | null {\n return node.committed?.tag ?? null;\n }\n\n /**\n * The shadow node Fabric currently holds for a node, or null before its first commit.\n *\n * A clone-on-write tree hands back a different object every time a node's props change, so\n * this is not an identity. What is stable is the family behind it, which is what native keys a\n * node by, and is why a UI-thread animation given one of these keeps writing to the right view\n * however many times the node is cloned afterwards.\n */\n shadowNodeOf(node: EngineNode): FabricNode | null {\n return node.committed?.handle ?? null;\n }\n\n /** The node currently owning the gesture, if any. */\n get responder(): EngineNode | null {\n return this.currentResponder;\n }\n\n /**\n * The node native last reported focused, if any: the text input the keyboard belongs to.\n *\n * Checked against the tree rather than trusted, because a focused node that outlives its view\n * is not a stale style - it is every tap in the application being swallowed. Every scroll view\n * reads this on every touch to decide whether the touch means \"dismiss the keyboard\", and one\n * that decides yes *captures* the touch before any child sees it. So a field left focused after\n * its view is gone makes the whole app untappable until it is restarted.\n *\n * Neither teardown hook can be relied on to clear it. `removeChild` unlinks the subtree's root\n * and leaves everything under it pointing at its own parent, so a focused descendant still looks\n * attached; and Angular calls `destroyNode` for the nodes it tracks, not for every node in a\n * removed subtree. An overlay closing with a field inside it misses both.\n *\n * So it is answered by looking: a node still in the tree reaches the root by walking up. That\n * costs the depth of one node, on a touch, and only while something is focused.\n */\n get focused(): EngineNode | null {\n if (this.focusedNode && !this.isAttached(this.focusedNode)) this.focusedNode = null;\n return this.focusedNode;\n }\n\n /** Whether a node is still part of the tree, rather than in a subtree that was removed. */\n private isAttached(node: EngineNode): boolean {\n let current: EngineNode | null = node;\n while (current) {\n if (current === this.root) return true;\n current = current.parent;\n }\n return false;\n }\n\n /** The host's `resolveAssetSource`, for a component that needs an asset's size up front. */\n resolveAsset(value: unknown): unknown {\n return this.resolveAssetSource(value);\n }\n\n /**\n * A colour prop as native takes it. A shape's `fill` or `stroke` the cascade settled from a\n * token is the solid brush react-native-svg takes, and `none` no paint at all.\n */\n private painted(key: string, value: unknown): unknown {\n if (!BRUSH_PROPS.has(key)) return this.color(value);\n // Already a brush, as the icon wrote it: only one the cascade settled is still text.\n if (typeof value !== 'string') return value;\n return value === 'none' ? null : { type: 0, payload: this.color(value) };\n }\n\n /**\n * The host's `processColor`, and the one place a platform colour becomes one.\n *\n * Props are processed by name - anything ending in `color` - which covers every colour that is\n * a prop. A colour *nested* inside a prop native parses itself is invisible to that rule: a tab\n * bar's appearance carries eight of them, and unprocessed they arrive as strings native reads\n * as nothing at all. So this is public, and the commit walk uses it too.\n *\n * `platform-color(label)` cannot be resolved at build time - the same declaration is\n * `{semantic}` on iOS and `{resource_paths}` on Android - so the names travel and the shape is\n * put on here. `processColor` understands both, exactly as it does for RN's own `PlatformColor`.\n */\n color(value: unknown): unknown {\n if (value === undefined) return undefined;\n\n const names = (value as { platformColor?: readonly string[] })?.platformColor;\n if (!names) return this.processColor(value as string | number);\n\n const key = nativePlatform() === 'android' ? 'resource_paths' : 'semantic';\n return this.processColor({ [key]: [...names] } as never);\n }\n\n /** Root-first, so a capture pass reads forwards and a bubble pass reads backwards. */\n private pathTo(node: EngineNode): EngineNode[] {\n const path: EngineNode[] = [];\n for (let current: EngineNode | null = node; current; current = current.parent)\n path.push(current);\n return path.reverse();\n }\n\n private negotiate(\n target: EngineNode,\n event: ResponderEvent,\n phase: 'Start' | 'Move',\n ): EngineNode | null {\n const path = this.pathTo(target);\n const capture = `on${phase}ShouldSetResponderCapture` as const;\n const bubble = `on${phase}ShouldSetResponder` as const;\n\n // Capture runs root -> target, so an ancestor can claim before its children see it.\n for (const node of path) {\n if (this.responders.get(node)?.[capture]?.(event, target)) return node;\n }\n // Bubble runs target -> root: the innermost interested node wins.\n for (let i = path.length - 1; i >= 0; i--) {\n if (this.responders.get(path[i]!)?.[bubble]?.(event, target)) return path[i]!;\n }\n return null;\n }\n\n private grant(node: EngineNode, event: ResponderEvent): void {\n const previous = this.currentResponder;\n if (previous === node) return;\n\n if (previous) {\n const handlers = this.responders.get(previous);\n // An undefined handler means \"yes\": RN's default is to allow the takeover.\n if (handlers?.onResponderTerminationRequest?.(event) === false) return;\n this.tellNative(previous, false);\n handlers?.onResponderTerminate?.(event);\n }\n\n // After the takeover is agreed, not before: a refusal would otherwise leave `:active` on a\n // node that never became the responder. Both calls run, so neither is short-circuited away.\n const cleared = this.setActiveChain(previous, false);\n const marked = this.setActiveChain(node, true);\n\n this.currentResponder = node;\n this.tellNative(node, true);\n this.responders.get(node)?.onResponderGrant?.(event);\n if (cleared || marked) this.commit();\n }\n\n private release(event: ResponderEvent, terminated: boolean): void {\n const node = this.currentResponder;\n if (!node) return;\n const changed = this.setActiveChain(node, false);\n this.currentResponder = null;\n this.tellNative(node, false);\n const handlers = this.responders.get(node);\n if (terminated) handlers?.onResponderTerminate?.(event);\n else handlers?.onResponderRelease?.(event);\n if (changed) this.commit();\n }\n\n private tellNative(node: EngineNode, isResponder: boolean): void {\n const handle = node.committed?.handle;\n if (!handle || !this.fabric.setIsJSResponder) return;\n const asked = this.responders.get(node)?.blockNativeResponder ?? false;\n // And for a drag an element's `touch-action` keeps from the page: see `holdSwipe`.\n const block = asked || this.drag?.held === true;\n this.fabric.setIsJSResponder(handle, isResponder, block);\n }\n\n /** Runs before listener propagation, as React's responder plugin does. */\n private runResponder(target: EngineNode, type: string, event: ResponderEvent): void {\n if (type === TOUCH_START) {\n const elected = this.negotiate(target, event, 'Start');\n if (elected) this.grant(elected, event);\n return;\n }\n if (type === TOUCH_MOVE) {\n if (this.currentResponder) {\n this.responders.get(this.currentResponder)?.onResponderMove?.(event);\n } else {\n const elected = this.negotiate(target, event, 'Move');\n if (elected) this.grant(elected, event);\n }\n return;\n }\n if (type === TOUCH_END) this.release(event, false);\n else if (type === TOUCH_CANCEL) this.release(event, true);\n }\n\n // --- events -----------------------------------------------------------\n\n private registerEventHandler(): void {\n if (this.eventsRegistered || !this.fabric.registerEventHandler) return;\n this.eventsRegistered = true;\n this.fabric.registerEventHandler((instanceHandle, topLevelType, nativeEvent) =>\n this.dispatchEvent(instanceHandle, topLevelType, nativeEvent),\n );\n }\n\n /**\n * Fabric's `(instanceHandle, topLevelType, nativeEvent)` callback.\n *\n * **Events propagate up the retained tree.** Fabric hands JS only the hit target; React\n * implements two-phase propagation itself by walking the fiber tree, and so must we. Without\n * it a tap on a `<text>` label inside a `<pressable>` reaches the text node and stops, so the\n * button only responds on its padding. That reads as \"taps sometimes do not register\".\n *\n * ponytail: event priority (`unstable_getCurrentEventPriority` and the\n * `unstable_*EventPriority` constants) is read into the facade but not acted on. Angular's\n * zoneless scheduler already flushes on a microtask, which is soon enough for taps. It stops\n * being soon enough for a controlled TextInput, where the echo has to beat the next\n * keystroke. `mostRecentEventCount` covers that today by letting native reject a stale write;\n * a synchronous flush for discrete priority is the fix if it ever stops being enough.\n *\n * **Nothing thrown here may escape.** Fabric calls this synchronously from C++\n * (`UIManagerBinding::dispatchEventToJS`), often from inside a mounting transaction, and a throw\n * unwinds through that transaction: for a screen push the next commit then reads props freed on\n * the way out and the process dies with no JS stack at all. Angular\n * already catches what its own template listeners throw; everything else on this path - the\n * responder handlers, listeners registered on the engine directly, a commit started by a focus\n * change - is caught here and handed to `onError`, which the platform points at the app's\n * `ErrorHandler`. Each listener is guarded on its own, so one that throws does not stop the\n * bubble for the rest, as in the DOM.\n */\n dispatchEvent(instanceHandle: unknown, topLevelType: string, nativeEvent: unknown): void {\n const target = instanceHandle as EngineNode | null;\n this.trace(target, topLevelType);\n // What has the focus does not take it again: native answering a focus it was told of, where\n // whoever asked has already said so.\n if (topLevelType === 'topFocus' && target !== null && this.focusedNode === target) return;\n\n // Listeners get RN's documented shape, `{nativeEvent}`. Fabric hands us the payload bare;\n // React wraps it in a synthetic event and every RN API is written against `event.nativeEvent`,\n // so handlers ported from RN would silently read undefined otherwise.\n const event = new SyntheticEvent(nativeEvent, target);\n\n try {\n if (topLevelType === 'topDismiss' && target) this.dismissed(target);\n if (topLevelType === 'topScroll' && target && this.scrollTimelines.has(target)) {\n this.measuredScroll(target, nativeEvent);\n }\n this.holdSwipe(target, topLevelType, nativeEvent);\n this.trackFocus(target, topLevelType);\n if (target) this.cancelPressForScroll(target, topLevelType, event as ResponderEvent);\n if (target) this.runResponder(target, topLevelType, event as ResponderEvent);\n } catch (error) {\n this.reportEventError(error, topLevelType);\n }\n this.propagate(target, topLevelType, event);\n }\n\n /** The screen whose swipe back is held off while a finger is on what keeps a sideways drag. */\n private swipeHeld: EngineNode | null = null;\n\n /**\n * Hold a screen's swipe back off for a touch that starts on an element whose `touch-action`\n * keeps a drag to the side for itself, and give it back when the last finger lifts. From iOS\n * 26 the swipe starts anywhere on a screen once a finger has moved a little to the right, and\n * takes the touch from whatever was following it: a slider's thumb stops and the screen\n * leaves. The screen is told before the finger has moved that far.\n */\n private holdSwipe(target: EngineNode | null, type: string, nativeEvent: unknown): void {\n if (type === TOUCH_START) this.holdFrom(target, nativeEvent);\n else if (type === 'topTouchMove') this.settleDrag(nativeEvent);\n else if (type === 'topTouchEnd' || type === 'topTouchCancel') this.releaseSwipe(nativeEvent);\n }\n\n /**\n * A touch on an element that keeps a drag to the side: where it began, and whether native's\n * own gestures are held off for it. Held from the start where the element keeps a drag down\n * the page too (`none`); from the moment the finger sets off across where it leaves that one\n * to the page (`pan-y`), and never for that touch where it sets off down.\n */\n private drag: {\n x: number;\n y: number;\n settled: boolean;\n held: boolean;\n on: EngineNode;\n } | null = null;\n\n private holdFrom(target: EngineNode | null, nativeEvent: unknown): void {\n // A first finger down is a new touch: the last one's end never came where what it was on\n // went from under the finger.\n const fingers = (nativeEvent as { touches?: readonly unknown[] } | null)?.touches?.length;\n if (this.drag && fingers === 1) this.releaseSwipe(null);\n if (this.drag || !target) return;\n const actions = touchActions(target);\n if (!keeps(actions, PANS_ACROSS)) return;\n const all = keeps(actions, PANS_ALONG);\n this.drag = { ...pointOf(nativeEvent), settled: all, held: all, on: target };\n if (all) this.holdScroll(target);\n const screen = this.screenOf(target);\n if (!screen) return;\n this.swipeHeld = screen;\n this.tellScreen(screen);\n }\n\n /** The scroll view whose scrolling is off while a drag over it is an element's own. */\n private scrollHeld: EngineNode | null = null;\n\n /**\n * Stop the scroll view a node is in from scrolling, until the touch ends. Telling native who\n * holds the touch does this on Android. On iOS a scroll view is held off only by a responder\n * that is over it, never one inside it, so it is told not to scroll.\n */\n private holdScroll(node: EngineNode): void {\n for (let up = node.parent; up; up = up.parent) {\n if (up.kind !== 'element' || !SCROLL_VIEWS.has(viewNameOf(up))) continue;\n this.scrollHeld = up;\n this.tellScreen(up);\n return;\n }\n }\n\n /** Settle which way a drag set off, and hold native's own off one that set off across. */\n private settleDrag(nativeEvent: unknown): void {\n const drag = this.drag;\n if (!drag || drag.settled) return;\n const at = pointOf(nativeEvent);\n const [across, along] = [Math.abs(at.x - drag.x), Math.abs(at.y - drag.y)];\n if (Math.max(across, along) < DRAG_SLOP) return;\n drag.settled = true;\n drag.held = across > along;\n if (!drag.held) return;\n if (this.currentResponder) this.tellNative(this.currentResponder, true);\n this.holdScroll(drag.on);\n }\n\n /** Give the swipe back once the last finger has lifted. */\n private releaseSwipe(nativeEvent: unknown): void {\n const left = (nativeEvent as { touches?: readonly unknown[] } | null)?.touches?.length ?? 0;\n if (left > 0) return;\n this.drag = null;\n for (const held of [this.scrollHeld, this.swipeHeld]) {\n if (held === this.scrollHeld) this.scrollHeld = null;\n else this.swipeHeld = null;\n if (held) this.tellScreen(held);\n }\n }\n\n /**\n * Commit a screen or a scroll view again now, not with whatever next changes: the swipe begins\n * once the finger has moved ten points or so, which is a frame or two after it came down.\n */\n private tellScreen(screen: EngineNode): void {\n // Its props alone: nothing a selector reads moved, so nothing under it is styled again.\n this.markProps(screen, false);\n this.commit();\n }\n\n /** The screen of a native stack a node is on, or nothing where it is on none. */\n private screenOf(node: EngineNode): EngineNode | null {\n for (let up: EngineNode | null = node; up; up = up.parent) {\n if (up.kind === 'element' && viewNameOf(up) === STACK_SCREEN) return up;\n }\n return null;\n }\n\n /** A presented modal host has finished leaving, so a hidden one can come out of the tree. */\n private dismissed(target: EngineNode): void {\n if (!target.presented) return;\n target.presented = undefined;\n if (target.props['visible'] === false) this.markProps(target, false);\n }\n\n private reportEventError(error: unknown, topLevelType: string): void {\n if (this.onError) {\n this.onError(error, topLevelType);\n return;\n }\n console.error(`[angular-native] an error was thrown while dispatching ${topLevelType}`, error);\n }\n\n /**\n * A list that scrolls under a finger takes the touch away from whatever it started on.\n *\n * Distance alone cannot tell a scroll from a tap. The press rect is the control's own bounds\n * plus a retention offset, which is right - a 15pt threshold cancels an ordinary thumb tap on a\n * full-width button - but on a 72pt list row it means a 72pt drag still counts as a tap, and a\n * 72pt drag is unmistakably a scroll. So the list is asked instead of the arithmetic: it knows\n * it is scrolling, and every platform cancels the touch at that moment.\n *\n * Only a responder *inside* the thing that scrolled, so a scroll view moving does not cancel a\n * press somewhere else on screen. And only while a touch is in progress: momentum after the\n * finger has lifted, and programmatic scrolling, have no press to cancel.\n */\n private cancelPressForScroll(target: EngineNode, type: string, event: ResponderEvent): void {\n if (!SCROLL_CANCELS_PRESS.has(type)) return;\n const responder = this.currentResponder;\n if (!responder || responder === target) return;\n for (let node: EngineNode | null = responder; node; node = node.parent) {\n if (node === target) {\n this.release(event, true);\n return;\n }\n }\n }\n\n /**\n * Tell \"the native side never sent it\" from \"it arrived and nothing was listening\", which are\n * otherwise identical symptoms. One line per event, so it is off unless asked for.\n */\n private trace(target: EngineNode | null, topLevelType: string): void {\n if (!(globalThis as { __angularNativeEventLog?: boolean }).__angularNativeEventLog) return;\n let matched = 0;\n for (let n = target; n; n = DIRECT_EVENTS.has(topLevelType) ? null : n.parent) {\n matched += n.listeners?.get(topLevelType)?.size ?? 0;\n }\n console.log('[event]', topLevelType, target?.name ?? '(no handle)', matched);\n }\n\n /**\n * `:focus` follows the native events rather than being inferred from a tap, so it is right for a\n * field focused programmatically or by the keyboard's next-field button.\n */\n private trackFocus(target: EngineNode | null, topLevelType: string): void {\n if (topLevelType === 'topFocus') this.setFocused(target);\n else if (topLevelType === 'topBlur' && this.focusedNode === target) this.setFocused(null);\n }\n\n /** Walk target to root. Fabric hands JS only the hit target; the propagation is ours to do. */\n private propagate(target: EngineNode | null, topLevelType: string, event: SyntheticEvent): void {\n for (let node = target; node; node = node.parent) {\n const listeners = node.listeners?.get(topLevelType);\n if (listeners) {\n for (const fn of [...listeners]) {\n try {\n fn(event);\n } catch (error) {\n this.reportEventError(error, topLevelType);\n }\n }\n }\n if (DIRECT_EVENTS.has(topLevelType) || event.isPropagationStopped()) return;\n }\n }\n\n /**\n * Clone a committed node with whatever changed. Fabric's persistent tree has no in-place edit:\n * a new revision is a new node, which is why a changed child forces its parent to clone too.\n *\n * `children` is null when the child list is unchanged, in which case Fabric keeps the previous\n * revision's children and there is nothing to append.\n *\n * Otherwise this clones the way React does: the no-children form, then `appendChild` per child.\n * Omitting the child list gives the clone *empty* children, not the old ones, and whether a\n * binding takes that argument cannot be feature-detected - `UIManagerBinding.cpp` registers\n * both clone methods with a fixed `paramCount` and argument validation is commented out - so\n * `fn.length` says nothing. One code path, no detection.\n */\n private clone(\n previous: FabricNode,\n props: Record<string, unknown> | null,\n children: FabricNode[] | null,\n ): FabricNode {\n this.stats.clonedNodes++;\n\n if (children === null) return this.fabric.cloneNodeWithNewProps(previous, props!);\n\n const handle = props\n ? this.fabric.cloneNodeWithNewChildrenAndProps(previous, props)\n : this.fabric.cloneNodeWithNewChildren(previous);\n for (const child of children) this.fabric.appendChild(handle, child);\n return handle;\n }\n\n private detach(child: EngineNode): void {\n if (child.parent) this.removeChild(child.parent, child);\n }\n}\n"]}
|