@ng-native/fabric 0.1.1 → 0.1.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,aAAa,GAKd,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,cAAc,EACd,MAAM,EACN,WAAW,EACX,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,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5E;;;;;GAKG;AACH,SAAS,WAAW,CAAC,KAA8B;IACjD,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAA8B,CAAC;IAC9D,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC,YAAY,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAqC,CAAC;IAC1E,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACzC,OAAO,KAAK,CAAC,YAAY,CAAC,CAAC;IAC3B,OAAO,IAAI,IAAI,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC;AAC7D,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,CAAgB,EAAE,CAAgB;IACvD,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,CACL,WAAW,CAAC,KA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E,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 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 StyleResolver,\n type Conditions,\n type StyleCache,\n type StyleSheet,\n type TokenValue,\n} from './css.ts';\nimport {\n animationEvent,\n bezier,\n interpolate,\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 { firstFrame, rangeOf, scrollChannels } from './scroll-animation.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 const spec = props['$animation'] as AnimationSpec | undefined;\n if (spec !== undefined) delete props['$animation'];\n const playState = props['$playState'] as 'running' | 'paused' | undefined;\n if (playState === undefined) return spec;\n delete props['$playState'];\n return spec && { ...spec, paused: playState === 'paused' };\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 readonly tracks: ReadonlyMap<string, readonly { offset: number; value: unknown }[]>;\n readonly resting: Record<string, unknown>;\n readonly first: Record<string, 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 * 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 *\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 */\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\nconst DIRECT_EVENTS = 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 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 private stopped = false;\n\n constructor(nativeEvent: T) {\n this.nativeEvent = nativeEvent;\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}\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 /** `: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 * 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 /**\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\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 * 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/** `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 * 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 if (platform !== 'android') return;\n for (const [element, viewName] of Object.entries(ANDROID_VIEW_NAMES)) {\n registerViewName(element, viewName);\n }\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 * 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): void {\n VIEW_NAMES[elementName] = viewName;\n if (!defaultProps) return;\n for (const name of typeof viewName === 'string' ? [viewName] : [viewName.ios, viewName.android]) {\n DEFAULT_PROPS[name] = defaultProps;\n }\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/** 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 if (root?.name !== 'text') return 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 && root.parent?.name !== 'text') return node.text.trim();\n while (root.parent?.name === 'text') 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 (child.name === 'text') collect(child);\n }\n };\n collect(root);\n let text = node.text;\n if (runs[0] === node) text = text.replace(/^\\s+/, '');\n if (runs[runs.length - 1] === node) text = text.replace(/\\s+$/, '');\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: { readonly name: string } | null;\n}\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 if (node.name === 'text' && node.parent?.name === 'text') return VIRTUAL_TEXT;\n return registeredViewName(node.name) ?? DEFAULT_VIEW;\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 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 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/** 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) colorProps.set(key, (answer = IS_COLOR_PROP.test(key)));\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/** Styles arrive as objects, arrays, nested arrays and nulls. Reduce to one object. */\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' ? transformList(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 blew a 60fps frame budget, 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 /** Whether a child list has lost a member since the last commit. See `releaseDetached`. */\n private removedSinceCommit = false;\n /**\n * `@keyframes` by name, across every sheet seen so far. 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 /** 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 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 if (options.tokens) this.styles.setRootTokens(options.tokens);\n this.structuralSheets = options.globalStyles?.structural === true;\n this.dev = options.dev ?? (globalThis as { __DEV__?: boolean }).__DEV__ === true;\n if (this.dev)\n this.styles.onUndefinedToken = (name, props) => this.reportUndefinedToken(name, props);\n this.now = options.now ?? (() => globalThis.performance?.now?.() ?? Date.now());\n this.onDirty = options.onDirty;\n this.onError = options.onError;\n this.registerKeyframes(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.markProps(node);\n changed = true;\n }\n return changed;\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 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 visit = (node: EngineNode): void => {\n for (const child of node.children) {\n if (child.kind !== 'element') continue;\n if (child.committed && MEASURED_VIEWS.has(viewNameOf(child))) {\n child.remeasure = true;\n this.markProps(child, false);\n }\n visit(child);\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 /** 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\n updateConditions(next: Conditions): void {\n this.viewportSize = { width: next.width, height: next.height };\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 }\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 if (sheet?.structural) this.structuralSheets = true;\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 /** `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);\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);\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 = true;\n this.markStructure(target);\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.\n *\n * Once per commit, and only after a removal: the walks are the depth of a handful of nodes.\n */\n private releaseDetached(): void {\n this.removedSinceCommit = false;\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 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 /** 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 node.committed = null;\n node.transitions = undefined;\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 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.noteInlineDirection(node));\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.noteInlineDirection(node));\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 }\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 }\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 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 private markStructure(node: 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 }\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) 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 const set = this.fabric.createChildSet(this.rootTag);\n for (const child of this.visibleChildren(this.root)) {\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 return true;\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 return node.children.filter((child) => child.kind !== 'anchor');\n }\n\n /**\n * Everything a node renders with, unprocessed. Precedence, weakest first: native defaults,\n * matched CSS, explicit props, inline style, a component's `styleOverride`. Inline wins over CSS for the same reason it does\n * 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.registerKeyframes(node.sheet);\n this.registerKeyframes(node.hostSheet);\n const props: Record<string, unknown> = { ...DEFAULT_PROPS[viewName] };\n Object.assign(props, this.styles.resolve(node, this.styleEpoch).style);\n for (const key of Object.keys(node.props)) {\n // No native prop has a hyphen. `data-*` and `aria-*` attributes stay on the node for\n // selectors to match, and the components package maps `aria-*` to what native reads.\n if (\n key !== 'style' &&\n key !== INTRINSIC_SIZE &&\n key !== STYLE_OVERRIDE &&\n !key.includes('-')\n ) {\n props[key] = node.props[key];\n }\n }\n const style = flattenStyle(node.props['style'], props);\n const intrinsic = node.props[INTRINSIC_SIZE] as IntrinsicSize | undefined;\n if (intrinsic) applyIntrinsicSize(style, intrinsic);\n flattenStyle(node.props[STYLE_OVERRIDE], style);\n if (viewName === PARAGRAPH) alignText(style, this.directionOf(node, style));\n return composeTransform(node, this.animated(node, this.transitioned(node, style)));\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 /** Take a sheet's `@keyframes` into the registry. Cheap and idempotent; sheets are few. */\n private registerKeyframes(sheet: StyleSheet | null | undefined): void {\n if (!sheet?.keyframes || this.knownSheets.has(sheet)) return;\n this.knownSheets.add(sheet);\n for (const name of Object.keys(sheet.keyframes)) {\n this.keyframes.set(name, sheet.keyframes[name]!);\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 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 if (this.dev) this.reportMissingKeyframes(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 /** 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 if (!current || !sameAnimation(current.spec, spec)) {\n const started: RunningAnimation = {\n spec,\n tracks: tracksOf(frames, props),\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 node.playing = started;\n if (spec.paused) started.pausedAt = this.now();\n else this.playing.add(node);\n this.emitTransition(node, 'topAnimationstart', spec.name);\n return;\n }\n this.playOrPause(node, current, spec);\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 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 if (current && sameAnimation(current.spec, spec)) return Object.assign(props, current.first);\n if (current) this.stopScrolled(node);\n if (node.playing) {\n node.playing = undefined;\n this.playing.delete(node);\n }\n\n const tracks = tracksOf(frames, props);\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, tracks, resting, first, source, drive };\n return Object.assign(props, 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 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.color(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] = transformList(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.\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: 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\n const childHandles = this.reconcileChildren(node, style);\n const previous = node.committed;\n const viewName = viewNameOf(node);\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 ? diffProps(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 };\n }\n this.clearFlags(node);\n return handle;\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(node: EngineNode, style: StyleCache | null): 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 handles.push(this.reconcileUnder(node, child, context));\n }\n return handles;\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 /** 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 private withheld(child: EngineNode): boolean {\n if (child.props['visible'] !== false || child.presented) return false;\n return viewNameOf(child) === MODAL_HOST;\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 /** Let a node and everything under it be created again at the next commit. */\n private forgetCommitted(node: EngineNode): void {\n node.committed = null;\n node.committedUnder = null;\n node.styleCommitted = null;\n for (const child of node.children) if (child.committed) this.forgetCommitted(child);\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 = { handle, tag: kept.committed.tag, 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 };\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, renders as a plain view, 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 if (node.kind !== 'element' || node.claimed || !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 renders as a plain view.`,\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[]): void {\n if (this.undefinedTokens.has(name)) return;\n this.undefinedTokens.add(name);\n console.warn(\n `[angular-native] var(${name}) in ${props.join(', ')} 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 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 * 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);\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,aAAa,GAKd,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,cAAc,EACd,MAAM,EACN,WAAW,EACX,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,UAAU,EAAE,OAAO,EAAE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AAC,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 StyleResolver,\n type Conditions,\n type StyleCache,\n type StyleSheet,\n type TokenValue,\n} from './css.ts';\nimport {\n animationEvent,\n bezier,\n interpolate,\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 { firstFrame, rangeOf, scrollChannels } from './scroll-animation.ts';\nimport { FontFaces } from './font-faces.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 const spec = props['$animation'] as AnimationSpec | undefined;\n if (spec !== undefined) delete props['$animation'];\n const playState = props['$playState'] as 'running' | 'paused' | undefined;\n if (playState === undefined) return spec;\n delete props['$playState'];\n return spec && { ...spec, paused: playState === 'paused' };\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 readonly tracks: ReadonlyMap<string, readonly { offset: number; value: unknown }[]>;\n readonly resting: Record<string, unknown>;\n readonly first: Record<string, 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 * 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 *\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 */\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\nconst DIRECT_EVENTS = 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 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 private stopped = false;\n\n constructor(nativeEvent: T) {\n this.nativeEvent = nativeEvent;\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}\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 /** `: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 * 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 /**\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\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 * 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/** `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 * 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 if (platform !== 'android') return;\n for (const [element, viewName] of Object.entries(ANDROID_VIEW_NAMES)) {\n registerViewName(element, viewName);\n }\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 * 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): void {\n VIEW_NAMES[elementName] = viewName;\n if (!defaultProps) return;\n for (const name of typeof viewName === 'string' ? [viewName] : [viewName.ios, viewName.android]) {\n DEFAULT_PROPS[name] = defaultProps;\n }\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/** 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/** 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 if (root?.name !== 'text') return 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 && root.parent?.name !== 'text') return node.text.trim();\n while (root.parent?.name === 'text') 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 (child.name === 'text') collect(child);\n }\n };\n collect(root);\n let text = node.text;\n if (runs[0] === node) text = text.replace(/^\\s+/, '');\n if (runs[runs.length - 1] === node) text = text.replace(/\\s+$/, '');\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: { readonly name: string } | null;\n}\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 if (node.name === 'text' && node.parent?.name === 'text') return VIRTUAL_TEXT;\n return registeredViewName(node.name) ?? DEFAULT_VIEW;\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 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 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/** 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) colorProps.set(key, (answer = IS_COLOR_PROP.test(key)));\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/** Styles arrive as objects, arrays, nested arrays and nulls. Reduce to one object. */\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' ? transformList(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 blew a 60fps frame budget, 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 /** Whether a child list has lost a member since the last commit. See `releaseDetached`. */\n private removedSinceCommit = false;\n /**\n * `@keyframes` by name, across every sheet seen so far. 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 /** 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 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 if (options.tokens) this.styles.setRootTokens(options.tokens);\n this.structuralSheets = options.globalStyles?.structural === true;\n this.dev = options.dev ?? (globalThis as { __DEV__?: boolean }).__DEV__ === true;\n if (this.dev)\n this.styles.onUndefinedToken = (name, props) => this.reportUndefinedToken(name, props);\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.markProps(node);\n changed = true;\n }\n return changed;\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 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 visit = (node: EngineNode): void => {\n for (const child of node.children) {\n if (child.kind !== 'element') continue;\n if (child.committed && MEASURED_VIEWS.has(viewNameOf(child))) {\n child.remeasure = true;\n this.markProps(child, false);\n }\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 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 /** 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\n updateConditions(next: Conditions): void {\n this.viewportSize = { width: next.width, height: next.height };\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 }\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 if (sheet?.structural) this.structuralSheets = true;\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 /** `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);\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);\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 = true;\n this.markStructure(target);\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.\n *\n * Once per commit, and only after a removal: the walks are the depth of a handful of nodes.\n */\n private releaseDetached(): void {\n this.removedSinceCommit = false;\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 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 /** 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 node.committed = null;\n node.transitions = undefined;\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 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.noteInlineDirection(node));\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.noteInlineDirection(node));\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 }\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 }\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 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 private markStructure(node: 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 }\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) 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 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 if (this.facesAdded) this.rematchFonts();\n return true;\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 return node.children.filter((child) => child.kind !== 'anchor');\n }\n\n /**\n * Everything a node renders with, unprocessed. Precedence, weakest first: native defaults,\n * matched CSS, explicit props, inline style, a component's `styleOverride`. Inline wins over CSS for the same reason it does\n * 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] };\n Object.assign(props, this.styles.resolve(node, this.styleEpoch).style);\n for (const key of Object.keys(node.props)) {\n // No native prop has a hyphen. `data-*` and `aria-*` attributes stay on the node for\n // selectors to match, and the components package maps `aria-*` to what native reads.\n if (\n key !== 'style' &&\n key !== INTRINSIC_SIZE &&\n key !== STYLE_OVERRIDE &&\n !key.includes('-')\n ) {\n props[key] = node.props[key];\n }\n }\n const style = flattenStyle(node.props['style'], props);\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 if (viewName === PARAGRAPH) alignText(style, this.directionOf(node, style));\n if (this.fontsRefreshed) this.capForFonts(node, style);\n return composeTransform(node, this.animated(node, this.transitioned(node, style)));\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 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 /** 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 const visit = (node: EngineNode): void => {\n for (const child of node.children) {\n if (child.kind !== 'element') continue;\n if (typeof child.committed?.props['fontFamily'] === 'string') this.markProps(child, false);\n visit(child);\n }\n };\n visit(this.root);\n this.commit();\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 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 if (this.dev) this.reportMissingKeyframes(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 /** 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 if (!current || !sameAnimation(current.spec, spec)) {\n const started: RunningAnimation = {\n spec,\n tracks: tracksOf(frames, props),\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 node.playing = started;\n if (spec.paused) started.pausedAt = this.now();\n else this.playing.add(node);\n this.emitTransition(node, 'topAnimationstart', spec.name);\n return;\n }\n this.playOrPause(node, current, spec);\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 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 if (current && sameAnimation(current.spec, spec)) return Object.assign(props, current.first);\n if (current) this.stopScrolled(node);\n if (node.playing) {\n node.playing = undefined;\n this.playing.delete(node);\n }\n\n const tracks = tracksOf(frames, props);\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, tracks, resting, first, source, drive };\n return Object.assign(props, 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 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.color(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] = transformList(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.\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: 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\n const childHandles = this.reconcileChildren(node, style);\n const previous = node.committed;\n const viewName = viewNameOf(node);\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 };\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(node: EngineNode, style: StyleCache | null): 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 handles.push(this.reconcileUnder(node, child, context));\n }\n return handles;\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 /** 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 private withheld(child: EngineNode): boolean {\n if (child.props['visible'] !== false || child.presented) return false;\n return viewNameOf(child) === MODAL_HOST;\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 /** Let a node and everything under it be created again at the next commit. */\n private forgetCommitted(node: EngineNode): void {\n node.committed = null;\n node.committedUnder = null;\n node.styleCommitted = null;\n for (const child of node.children) if (child.committed) this.forgetCommitted(child);\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 = { handle, tag: kept.committed.tag, 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 };\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, renders as a plain view, 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 if (node.kind !== 'element' || node.claimed || !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 renders as a plain view.`,\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[]): void {\n if (this.undefinedTokens.has(name)) return;\n this.undefinedTokens.add(name);\n console.warn(\n `[angular-native] var(${name}) in ${props.join(', ')} 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 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 * 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);\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"]}