@tamagui/native-registry 3.0.3 → 3.0.4

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,15 +1,30 @@
1
- import type { LinkHandle, RegistryStats, ViewSlots, ViewStateSnapshot, ViewStateTableUpdate, ViewStateUpdate } from "./types";
2
- export type { LinkHandle, RegistryStats, Unlink, ViewSlots, ViewStateSnapshot, ViewStateTableUpdate, ViewStateUpdate } from "./types";
1
+ import type { LinkHandle, RegistryStats, ViewSlots, ViewStateSnapshot, ViewStateUpdate } from "./types";
2
+ export type { LinkHandle, RegistryStats, Unlink, ViewSlots, ViewStateSnapshot, ViewStateUpdate } from "./types";
3
3
  export { ROOT_SCOPE, getMirroredStateName } from "./mirror";
4
4
  export { processStyleColors } from "./processStyleColors.native";
5
5
  export declare function isAvailable(): boolean;
6
6
  /**
7
7
  * Link a mounted view to the engine. Captures the ShadowNode once, returns
8
8
  * a handle keyed by the engine-issued id: unlink never re-derives anything
9
- * from the ref, so a torn-down ref cannot leave a stale entry behind. Slot
10
- * props arrive in engine form, already through processStyleColors.
9
+ * from the ref, so a torn-down ref cannot leave a stale entry behind.
10
+ *
11
+ * `table` is either the view's own slots or the id of a shared table filled
12
+ * by setTableState; every view of one compiler mapping links the same table,
13
+ * so linking sends no props at all. `commitNow` commits the view's active
14
+ * state once, for a host whose render raced a scope change. Props arrive in
15
+ * engine form, already through processStyleColors.
11
16
  */
12
- export declare function link(ref: unknown, slots: ViewSlots, scopeId?: string): LinkHandle | null;
17
+ export declare function link(ref: unknown, table: ViewSlots | number, scopeId?: string, commitNow?: boolean): LinkHandle | null;
18
+ /**
19
+ * Link many host views to shared tables in one native call. Entry i links
20
+ * refs[i] to table tableIds[i] under scope scopes[scopeIndexes[i]]. Returns
21
+ * the id of entry 0; ids are consecutive, and an entry whose host has no
22
+ * shadow node consumes its id unlinked. The refs are React Native host
23
+ * components (never Nitro views, see link).
24
+ */
25
+ export declare function linkTables(refs: unknown[], tableIds: number[], scopeIndexes: number[], scopes: string[]): number;
26
+ /** Unlink by an id from linkTables. Safe to call twice. */
27
+ export declare function unlink(id: number): void;
13
28
  /**
14
29
  * Batched per-view state selection: cold entries carry `props` (computed by
15
30
  * the caller, colors already processed via processStyleColors), warm entries
@@ -17,12 +32,11 @@ export declare function link(ref: unknown, slots: ViewSlots, scopeId?: string):
17
32
  */
18
33
  export declare function applyViewStates(entries: ViewStateUpdate[]): void;
19
34
  /**
20
- * Fill lazily resolved state-table entries without switching a view to the
21
- * per-view runtime controller. The native engine commits an entry immediately
22
- * only when that state is already active for the view's scope. Entry props
23
- * arrive in engine form, already through processStyleColors.
35
+ * Fill one state of a shared table. Every view linked to the table reads it;
36
+ * views already showing that state commit the new props. Props arrive in
37
+ * engine form, already through processStyleColors.
24
38
  */
25
- export declare function updateViewStateTables(entries: ViewStateTableUpdate[]): void;
39
+ export declare function setTableState(tableId: number, state: string, props: Record<string, unknown>): void;
26
40
  /**
27
41
  * Set the active state name (e.g. theme name) for a scope and commit the
28
42
  * update natively. The JS mirror updates first so any concurrent React
@@ -1,11 +1,11 @@
1
1
  {
2
- "mappings": "AAOA,cACE,YACA,eAEA,WACA,mBACA,sBACA,uBACK;AAQP,cACE,YACA,eACA,QACA,WACA,mBACA,sBACA,uBACK;AACP,SAAS,YAAY,4BAA4B;AACjD,SAAS,0BAA0B;AAkBnC,OAAO,iBAAS;;;;;;;AAyChB,OAAO,iBAAS,KACd,cACA,OAAO,WACP,mBACC;;;;;;AAuBH,OAAO,iBAAS,gBAAgB,SAAS;;;;;;;AAWzC,OAAO,iBAAS,sBAAsB,SAAS;;;;;;AAU/C,OAAO,iBAAS,aAAa,mBAAmB;AAKhD,OAAO,iBAAS,YAAY;;AAM5B,OAAO,iBAAS,aACd,OAAO,WACP,mBACC;;AASH,OAAO,iBAAS,aAAa,aAAa;AAK1C,OAAO,iBAAS,YAAY",
2
+ "mappings": "AAOA,cACE,YACA,eAEA,WACA,mBACA,uBACK;AAQP,cACE,YACA,eACA,QACA,WACA,mBACA,uBACK;AACP,SAAS,YAAY,4BAA4B;AACjD,SAAS,0BAA0B;AA6BnC,OAAO,iBAAS;;;;;;;;;;;;AA8ChB,OAAO,iBAAS,KACd,cACA,OAAO,oBACP,kBACA,sBACC;;;;;;;;AAyBH,OAAO,iBAAS,WACd,iBACA,oBACA,wBACA;;AAUF,OAAO,iBAAS,OAAO;;;;;;AASvB,OAAO,iBAAS,gBAAgB,SAAS;;;;;;AAUzC,OAAO,iBAAS,cACd,iBACA,eACA,OAAO;;;;;;AAUT,OAAO,iBAAS,aAAa,mBAAmB;AAKhD,OAAO,iBAAS,YAAY;;AAM5B,OAAO,iBAAS,aACd,OAAO,WACP,mBACC;;AASH,OAAO,iBAAS,aAAa,aAAa;AAK1C,OAAO,iBAAS,YAAY",
3
3
  "names": [],
4
4
  "sources": [
5
5
  "src/index.native.ts"
6
6
  ],
7
7
  "version": 3,
8
8
  "sourcesContent": [
9
- "/**\n * Native implementation backed by the TamaguiRegistry Nitro HybridObject.\n * The C++ engine commits style updates directly to Fabric's ShadowTree via\n * UIManager::updateShadowTree (RN >= 0.81), with zero React re-renders.\n */\nimport { NitroModules } from 'react-native-nitro-modules'\nimport type { TamaguiRegistry } from './specs/TamaguiRegistry.nitro'\nimport type {\n LinkHandle,\n RegistryStats,\n Unlink,\n ViewSlots,\n ViewStateSnapshot,\n ViewStateTableUpdate,\n ViewStateUpdate,\n} from './types'\nimport {\n ROOT_SCOPE,\n getMirroredStateName,\n removeMirroredScope,\n setMirroredStateName,\n} from './mirror'\n\nexport type {\n LinkHandle,\n RegistryStats,\n Unlink,\n ViewSlots,\n ViewStateSnapshot,\n ViewStateTableUpdate,\n ViewStateUpdate,\n} from './types'\nexport { ROOT_SCOPE, getMirroredStateName } from './mirror'\nexport { processStyleColors } from './processStyleColors.native'\n\n/** Full engine surface: typed Nitro methods plus the raw-JSI methods. */\ninterface Engine extends TamaguiRegistry {\n link(shadowNode: unknown, slots: object, scopeId: string): number\n applyViewStates(entries: ViewStateUpdate[]): void\n updateViewStateTables(entries: ViewStateTableUpdate[]): void\n getViewState(id: number): ViewStateSnapshot | null\n}\n\nlet engine: Engine | null = null\nlet initError: unknown = null\ntry {\n engine = NitroModules.createHybridObject<TamaguiRegistry>('TamaguiRegistry') as Engine\n} catch (error) {\n initError = error\n}\n\nexport function isAvailable(): boolean {\n return engine !== null\n}\n\nfunction getEngine(): Engine {\n if (engine) return engine\n const detail = initError instanceof Error ? ` ${initError.message}` : ''\n throw new Error(\n `[@tamagui/native-registry] TamaguiRegistry failed to initialize; is react-native-nitro-modules installed and the app rebuilt?${detail}`\n )\n}\n\n/**\n * Extract the opaque ShadowNode JSI wrapper from a Fabric host component ref.\n * Same internals access as Unistyles; verified against RN 0.86.\n */\nfunction getShadowNode(ref: unknown): unknown | null {\n const handle = (ref as Record<string, unknown>)?.__internalInstanceHandle as\n | { stateNode?: { node?: unknown } }\n | undefined\n return handle?.stateNode?.node ?? null\n}\n\n/**\n * Nitro hybrid views parse props only from JSI values (their component\n * descriptor uses the JSI RawPropsParser), so the folly props this engine\n * commits, like React Native's own setNativeProps, abort in them. Every\n * Nitro view declares its `hybridRef` prop; those hosts stay unlinked and\n * re-theme through React renders.\n */\nfunction isNitroHybridView(ref: unknown): boolean {\n const config = (ref as { __viewConfig?: { validAttributes?: object } })?.__viewConfig\n return !!config?.validAttributes && 'hybridRef' in config.validAttributes\n}\n\n/**\n * Link a mounted view to the engine. Captures the ShadowNode once, returns\n * a handle keyed by the engine-issued id: unlink never re-derives anything\n * from the ref, so a torn-down ref cannot leave a stale entry behind. Slot\n * props arrive in engine form, already through processStyleColors.\n */\nexport function link(\n ref: unknown,\n slots: ViewSlots,\n scopeId: string = ROOT_SCOPE\n): LinkHandle | null {\n if (isNitroHybridView(ref)) return null\n const node = getShadowNode(ref)\n if (!node) return null\n\n const e = getEngine()\n const id = e.link(node, slots, scopeId)\n let unlinked = false\n return {\n id,\n unlink: () => {\n if (unlinked) return\n unlinked = true\n e.unlink(id)\n },\n }\n}\n\n/**\n * Batched per-view state selection: cold entries carry `props` (computed by\n * the caller, colors already processed via processStyleColors), warm entries\n * just name the state. One native commit for the whole batch.\n */\nexport function applyViewStates(entries: ViewStateUpdate[]): void {\n if (entries.length === 0) return\n getEngine().applyViewStates(entries)\n}\n\n/**\n * Fill lazily resolved state-table entries without switching a view to the\n * per-view runtime controller. The native engine commits an entry immediately\n * only when that state is already active for the view's scope. Entry props\n * arrive in engine form, already through processStyleColors.\n */\nexport function updateViewStateTables(entries: ViewStateTableUpdate[]): void {\n if (entries.length === 0) return\n getEngine().updateViewStateTables(entries)\n}\n\n/**\n * Set the active state name (e.g. theme name) for a scope and commit the\n * update natively. The JS mirror updates first so any concurrent React\n * render paints the same styles the engine commits.\n */\nexport function setStateName(stateName: string, scopeId: string = ROOT_SCOPE): void {\n setMirroredStateName(scopeId, stateName)\n getEngine().setStateName(scopeId, stateName)\n}\n\nexport function removeScope(scopeId: string): void {\n removeMirroredScope(scopeId)\n getEngine().removeScope(scopeId)\n}\n\n/** Resolve the props a view should render right now, mirror-consistent. */\nexport function resolveSlots(\n slots: ViewSlots,\n scopeId: string = ROOT_SCOPE\n): Record<string, unknown> {\n const name = getMirroredStateName(scopeId)\n return {\n ...slots.base,\n ...(name ? slots.state?.[name] : undefined),\n }\n}\n\n/** Debug/test introspection of a linked view's engine tables. Not a hot path. */\nexport function getViewState(id: number): ViewStateSnapshot | null {\n if (!engine) return null\n return engine.getViewState(id)\n}\n\nexport function getStats(): RegistryStats {\n if (!engine) return { viewCount: 0, commitCount: 0, missCount: 0 }\n return {\n viewCount: engine.getViewCount(),\n commitCount: engine.getCommitCount(),\n missCount: engine.getMissCount(),\n }\n}\n"
9
+ "/**\n * Native implementation backed by the TamaguiRegistry Nitro HybridObject.\n * The C++ engine commits style updates directly to Fabric's ShadowTree via\n * UIManager::updateShadowTree (RN >= 0.81), with zero React re-renders.\n */\nimport { NitroModules } from 'react-native-nitro-modules'\nimport type { TamaguiRegistry } from './specs/TamaguiRegistry.nitro'\nimport type {\n LinkHandle,\n RegistryStats,\n Unlink,\n ViewSlots,\n ViewStateSnapshot,\n ViewStateUpdate,\n} from './types'\nimport {\n ROOT_SCOPE,\n getMirroredStateName,\n removeMirroredScope,\n setMirroredStateName,\n} from './mirror'\n\nexport type {\n LinkHandle,\n RegistryStats,\n Unlink,\n ViewSlots,\n ViewStateSnapshot,\n ViewStateUpdate,\n} from './types'\nexport { ROOT_SCOPE, getMirroredStateName } from './mirror'\nexport { processStyleColors } from './processStyleColors.native'\n\n/** Full engine surface: typed Nitro methods plus the raw-JSI methods. */\ninterface Engine extends TamaguiRegistry {\n link(\n shadowNode: unknown,\n table: ViewSlots | number,\n scopeId: string,\n commitNow: boolean\n ): number\n linkTables(\n shadowNodes: unknown[],\n tableIds: number[],\n scopeIndexes: number[],\n scopes: string[]\n ): number\n applyViewStates(entries: ViewStateUpdate[]): void\n setTableState(tableId: number, state: string, props: Record<string, unknown>): void\n getViewState(id: number): ViewStateSnapshot | null\n}\n\nlet engine: Engine | null = null\nlet initError: unknown = null\ntry {\n engine = NitroModules.createHybridObject<TamaguiRegistry>('TamaguiRegistry') as Engine\n} catch (error) {\n initError = error\n}\n\nexport function isAvailable(): boolean {\n return engine !== null\n}\n\nfunction getEngine(): Engine {\n if (engine) return engine\n const detail = initError instanceof Error ? ` ${initError.message}` : ''\n throw new Error(\n `[@tamagui/native-registry] TamaguiRegistry failed to initialize; is react-native-nitro-modules installed and the app rebuilt?${detail}`\n )\n}\n\n/**\n * Extract the opaque ShadowNode JSI wrapper from a Fabric host component ref.\n * Same internals access as Unistyles; verified against RN 0.86.\n */\nfunction getShadowNode(ref: unknown): unknown | null {\n const handle = (ref as Record<string, unknown>)?.__internalInstanceHandle as\n | { stateNode?: { node?: unknown } }\n | undefined\n return handle?.stateNode?.node ?? null\n}\n\n/**\n * Nitro hybrid views parse props only from JSI values (their component\n * descriptor uses the JSI RawPropsParser), so the folly props this engine\n * commits, like React Native's own setNativeProps, abort in them. Every\n * Nitro view declares its `hybridRef` prop; those hosts stay unlinked and\n * re-theme through React renders.\n */\nfunction isNitroHybridView(ref: unknown): boolean {\n const config = (ref as { __viewConfig?: { validAttributes?: object } })?.__viewConfig\n return !!config?.validAttributes && 'hybridRef' in config.validAttributes\n}\n\n/**\n * Link a mounted view to the engine. Captures the ShadowNode once, returns\n * a handle keyed by the engine-issued id: unlink never re-derives anything\n * from the ref, so a torn-down ref cannot leave a stale entry behind.\n *\n * `table` is either the view's own slots or the id of a shared table filled\n * by setTableState; every view of one compiler mapping links the same table,\n * so linking sends no props at all. `commitNow` commits the view's active\n * state once, for a host whose render raced a scope change. Props arrive in\n * engine form, already through processStyleColors.\n */\nexport function link(\n ref: unknown,\n table: ViewSlots | number,\n scopeId: string = ROOT_SCOPE,\n commitNow = false\n): LinkHandle | null {\n if (isNitroHybridView(ref)) return null\n const node = getShadowNode(ref)\n if (!node) return null\n\n const e = getEngine()\n const id = e.link(node, table, scopeId, commitNow)\n let unlinked = false\n return {\n id,\n unlink: () => {\n if (unlinked) return\n unlinked = true\n e.unlink(id)\n },\n }\n}\n\n/**\n * Link many host views to shared tables in one native call. Entry i links\n * refs[i] to table tableIds[i] under scope scopes[scopeIndexes[i]]. Returns\n * the id of entry 0; ids are consecutive, and an entry whose host has no\n * shadow node consumes its id unlinked. The refs are React Native host\n * components (never Nitro views, see link).\n */\nexport function linkTables(\n refs: unknown[],\n tableIds: number[],\n scopeIndexes: number[],\n scopes: string[]\n): number {\n const nodes = new Array(refs.length)\n for (let i = 0; i < refs.length; i++) {\n nodes[i] = getShadowNode(refs[i])\n }\n return getEngine().linkTables(nodes, tableIds, scopeIndexes, scopes)\n}\n\n/** Unlink by an id from linkTables. Safe to call twice. */\nexport function unlink(id: number): void {\n getEngine().unlink(id)\n}\n\n/**\n * Batched per-view state selection: cold entries carry `props` (computed by\n * the caller, colors already processed via processStyleColors), warm entries\n * just name the state. One native commit for the whole batch.\n */\nexport function applyViewStates(entries: ViewStateUpdate[]): void {\n if (entries.length === 0) return\n getEngine().applyViewStates(entries)\n}\n\n/**\n * Fill one state of a shared table. Every view linked to the table reads it;\n * views already showing that state commit the new props. Props arrive in\n * engine form, already through processStyleColors.\n */\nexport function setTableState(\n tableId: number,\n state: string,\n props: Record<string, unknown>\n): void {\n getEngine().setTableState(tableId, state, props)\n}\n\n/**\n * Set the active state name (e.g. theme name) for a scope and commit the\n * update natively. The JS mirror updates first so any concurrent React\n * render paints the same styles the engine commits.\n */\nexport function setStateName(stateName: string, scopeId: string = ROOT_SCOPE): void {\n setMirroredStateName(scopeId, stateName)\n getEngine().setStateName(scopeId, stateName)\n}\n\nexport function removeScope(scopeId: string): void {\n removeMirroredScope(scopeId)\n getEngine().removeScope(scopeId)\n}\n\n/** Resolve the props a view should render right now, mirror-consistent. */\nexport function resolveSlots(\n slots: ViewSlots,\n scopeId: string = ROOT_SCOPE\n): Record<string, unknown> {\n const name = getMirroredStateName(scopeId)\n return {\n ...slots.base,\n ...(name ? slots.state?.[name] : undefined),\n }\n}\n\n/** Debug/test introspection of a linked view's engine tables. Not a hot path. */\nexport function getViewState(id: number): ViewStateSnapshot | null {\n if (!engine) return null\n return engine.getViewState(id)\n}\n\nexport function getStats(): RegistryStats {\n if (!engine) return { viewCount: 0, commitCount: 0, missCount: 0 }\n return {\n viewCount: engine.getViewCount(),\n commitCount: engine.getCommitCount(),\n missCount: engine.getMissCount(),\n }\n}\n"
10
10
  ]
11
11
  }
@@ -6,10 +6,10 @@ import type { HybridObject } from "react-native-nitro-modules";
6
6
  * beyond "a named state per scope selects which slot props apply". Tamagui
7
7
  * semantics (theme names, scope wiring, compiler output) live in JS.
8
8
  *
9
- * Two methods are NOT in this spec because they take values Nitro cannot
10
- * type: `link(shadowNode, slots, scopeId) -> number` and internal raw-JSI
11
- * registration. They are registered as raw hybrid methods in C++ and typed
12
- * on the JS side in index.native.ts.
9
+ * The methods that take values Nitro cannot type (`link`, `linkTables`,
10
+ * `setTableState`, `applyViewStates`, `getViewState`) are NOT in this spec.
11
+ * They are registered as raw hybrid methods in C++ and typed on the JS side
12
+ * in index.native.ts.
13
13
  *
14
14
  * Threading: every method must be called from the JS thread. The engine is
15
15
  * single-threaded by contract and holds no locks.
@@ -6,6 +6,6 @@
6
6
  ],
7
7
  "version": 3,
8
8
  "sourcesContent": [
9
- "import type { HybridObject } from 'react-native-nitro-modules'\n\n/**\n * Typed surface of the native registry.\n *\n * The engine is deliberately generic: it knows nothing about Tamagui themes\n * beyond \"a named state per scope selects which slot props apply\". Tamagui\n * semantics (theme names, scope wiring, compiler output) live in JS.\n *\n * Two methods are NOT in this spec because they take values Nitro cannot\n * type: `link(shadowNode, slots, scopeId) -> number` and internal raw-JSI\n * registration. They are registered as raw hybrid methods in C++ and typed\n * on the JS side in index.native.ts.\n *\n * Threading: every method must be called from the JS thread. The engine is\n * single-threaded by contract and holds no locks.\n */\nexport interface TamaguiRegistry extends HybridObject<{ ios: 'c++'; android: 'c++' }> {\n /**\n * Set the active state name for a scope ('' = root scope) and commit the\n * matching slot props for every affected linked view in one ShadowTree\n * transaction.\n */\n setStateName(scopeId: string, stateName: string): void\n\n /** Read the active state name for a scope ('' = root). */\n getStateName(scopeId: string): string\n\n /** Drop a scope entry (cleanup when a scope provider unmounts). */\n removeScope(scopeId: string): void\n\n /** Unlink by the id returned from link(). Safe to call twice. */\n unlink(id: number): void\n\n /** Number of currently linked views. */\n getViewCount(): number\n\n /**\n * Number of ShadowTree commits performed. Benchmark honesty counter: a\n * measurement where this does not increase never exercised the fast path.\n */\n getCommitCount(): number\n\n /**\n * Number of linked views skipped during commits because their slots had no\n * entry for the active state name. Always 0 when the compiler emitted\n * exhaustive keys; anything else is an upstream bug, not a runtime\n * condition to recover from.\n */\n getMissCount(): number\n}\n"
9
+ "import type { HybridObject } from 'react-native-nitro-modules'\n\n/**\n * Typed surface of the native registry.\n *\n * The engine is deliberately generic: it knows nothing about Tamagui themes\n * beyond \"a named state per scope selects which slot props apply\". Tamagui\n * semantics (theme names, scope wiring, compiler output) live in JS.\n *\n * The methods that take values Nitro cannot type (`link`, `linkTables`,\n * `setTableState`, `applyViewStates`, `getViewState`) are NOT in this spec.\n * They are registered as raw hybrid methods in C++ and typed on the JS side\n * in index.native.ts.\n *\n * Threading: every method must be called from the JS thread. The engine is\n * single-threaded by contract and holds no locks.\n */\nexport interface TamaguiRegistry extends HybridObject<{ ios: 'c++'; android: 'c++' }> {\n /**\n * Set the active state name for a scope ('' = root scope) and commit the\n * matching slot props for every affected linked view in one ShadowTree\n * transaction.\n */\n setStateName(scopeId: string, stateName: string): void\n\n /** Read the active state name for a scope ('' = root). */\n getStateName(scopeId: string): string\n\n /** Drop a scope entry (cleanup when a scope provider unmounts). */\n removeScope(scopeId: string): void\n\n /** Unlink by the id returned from link(). Safe to call twice. */\n unlink(id: number): void\n\n /** Number of currently linked views. */\n getViewCount(): number\n\n /**\n * Number of ShadowTree commits performed. Benchmark honesty counter: a\n * measurement where this does not increase never exercised the fast path.\n */\n getCommitCount(): number\n\n /**\n * Number of linked views skipped during commits because their slots had no\n * entry for the active state name. Always 0 when the compiler emitted\n * exhaustive keys; anything else is an upstream bug, not a runtime\n * condition to recover from.\n */\n getMissCount(): number\n}\n"
10
10
  ]
11
11
  }
package/types/types.d.ts CHANGED
@@ -42,12 +42,6 @@ export interface ViewStateUpdate {
42
42
  state: string;
43
43
  props?: Record<string, unknown>;
44
44
  }
45
- /** add or replace one resolved state-table entry without changing its view's controller */
46
- export interface ViewStateTableUpdate {
47
- id: number;
48
- state: string;
49
- props: Record<string, unknown>;
50
- }
51
45
  /** Debug/test snapshot of a linked view's engine tables (getViewState). */
52
46
  export interface ViewStateSnapshot {
53
47
  scopeId: string;
@@ -1,11 +1,11 @@
1
1
  {
2
- "mappings": ";;;;;;;;;;;;;AAaA,iBAAiB,UAAU;CACzB,OAAO;CACP,QAAQ,eAAe;;AAGzB,iBAAiB,cAAc;CAC7B;CACA;CACA;;;AAIF,YAAY;;;;;;AAOZ,iBAAiB,WAAW;CAC1B;CACA,QAAQ;;;;;;;;AASV,iBAAiB,gBAAgB;CAC/B;CACA;CACA,QAAQ;;;AAIV,iBAAiB,qBAAqB;CACpC;CACA;CACA,OAAO;;;AAIT,iBAAiB,kBAAkB;CACjC;CACA;CACA,MAAM;CACN,QAAQ,eAAe;;CAEvB,aAAa",
2
+ "mappings": ";;;;;;;;;;;;;AAaA,iBAAiB,UAAU;CACzB,OAAO;CACP,QAAQ,eAAe;;AAGzB,iBAAiB,cAAc;CAC7B;CACA;CACA;;;AAIF,YAAY;;;;;;AAOZ,iBAAiB,WAAW;CAC1B;CACA,QAAQ;;;;;;;;AASV,iBAAiB,gBAAgB;CAC/B;CACA;CACA,QAAQ;;;AAIV,iBAAiB,kBAAkB;CACjC;CACA;CACA,MAAM;CACN,QAAQ,eAAe;;CAEvB,aAAa",
3
3
  "names": [],
4
4
  "sources": [
5
5
  "src/types.ts"
6
6
  ],
7
7
  "version": 3,
8
8
  "sourcesContent": [
9
- "/**\n * Slot props for one linked view.\n *\n * v1 implements two slot kinds: `base` (state-independent props, applied\n * under every state) and `state` (props keyed by state name, e.g. theme\n * name; the scope's active name selects which entry applies). Future kinds\n * (media, press, group, container) extend this shape; the engine merge\n * order is fixed: base, then state, then future kinds.\n *\n * Keys must be exhaustive for every state name the scope can take. The\n * engine does exact lookups only: no fallback chains, no name parsing. A\n * miss increments the engine's miss counter and is a bug in the emitter.\n */\nexport interface ViewSlots {\n base?: Record<string, unknown>\n state?: Record<string, Record<string, unknown>>\n}\n\nexport interface RegistryStats {\n viewCount: number\n commitCount: number\n missCount: number\n}\n\n/** Returned by link(); call to unlink. Safe to call more than once. */\nexport type Unlink = () => void\n\n/**\n * Handle for a linked view. `id` addresses the view in batched per-view\n * operations (applyViewStates); `unlink` removes it. null when the ref had\n * no shadow node (never mounted) or the engine is unavailable (web).\n */\nexport interface LinkHandle {\n id: number\n unlink: Unlink\n}\n\n/**\n * One entry of a batched per-view state update. When `props` is present it\n * is merged into the view's state table under `state` first (lazy warm-up\n * for runtime integrations); the view's active state then becomes `state`\n * and all entries commit natively in one transaction.\n */\nexport interface ViewStateUpdate {\n id: number\n state: string\n props?: Record<string, unknown>\n}\n\n/** add or replace one resolved state-table entry without changing its view's controller */\nexport interface ViewStateTableUpdate {\n id: number\n state: string\n props: Record<string, unknown>\n}\n\n/** Debug/test snapshot of a linked view's engine tables (getViewState). */\nexport interface ViewStateSnapshot {\n scopeId: string\n activeState: string\n base: Record<string, unknown> | null\n states: Record<string, Record<string, unknown>> | null\n /** the family's sticky nativeProps_DEPRECATED merge, null when unset */\n nativeProps: Record<string, unknown> | null\n}\n"
9
+ "/**\n * Slot props for one linked view.\n *\n * v1 implements two slot kinds: `base` (state-independent props, applied\n * under every state) and `state` (props keyed by state name, e.g. theme\n * name; the scope's active name selects which entry applies). Future kinds\n * (media, press, group, container) extend this shape; the engine merge\n * order is fixed: base, then state, then future kinds.\n *\n * Keys must be exhaustive for every state name the scope can take. The\n * engine does exact lookups only: no fallback chains, no name parsing. A\n * miss increments the engine's miss counter and is a bug in the emitter.\n */\nexport interface ViewSlots {\n base?: Record<string, unknown>\n state?: Record<string, Record<string, unknown>>\n}\n\nexport interface RegistryStats {\n viewCount: number\n commitCount: number\n missCount: number\n}\n\n/** Returned by link(); call to unlink. Safe to call more than once. */\nexport type Unlink = () => void\n\n/**\n * Handle for a linked view. `id` addresses the view in batched per-view\n * operations (applyViewStates); `unlink` removes it. null when the ref had\n * no shadow node (never mounted) or the engine is unavailable (web).\n */\nexport interface LinkHandle {\n id: number\n unlink: Unlink\n}\n\n/**\n * One entry of a batched per-view state update. When `props` is present it\n * is merged into the view's state table under `state` first (lazy warm-up\n * for runtime integrations); the view's active state then becomes `state`\n * and all entries commit natively in one transaction.\n */\nexport interface ViewStateUpdate {\n id: number\n state: string\n props?: Record<string, unknown>\n}\n\n/** Debug/test snapshot of a linked view's engine tables (getViewState). */\nexport interface ViewStateSnapshot {\n scopeId: string\n activeState: string\n base: Record<string, unknown> | null\n states: Record<string, Record<string, unknown>> | null\n /** the family's sticky nativeProps_DEPRECATED merge, null when unset */\n nativeProps: Record<string, unknown> | null\n}\n"
10
10
  ]
11
11
  }