@tamagui/native-registry 0.0.0-bootstrap.0 → 3.0.0-beta.643.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -0
- package/TamaguiRegistry.podspec +32 -0
- package/android/CMakeLists.txt +25 -0
- package/android/build.gradle +83 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/cpp/cpp-adapter.cpp +11 -0
- package/android/src/main/java/com/tamagui/registry/TamaguiRegistryPackage.kt +25 -0
- package/cpp/HybridTamaguiRegistry.cpp +369 -0
- package/cpp/HybridTamaguiRegistry.hpp +117 -0
- package/dist/cjs/index.cjs +73 -0
- package/dist/cjs/index.native.cjs +144 -0
- package/dist/cjs/index.native.js +146 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/mirror.cjs +44 -0
- package/dist/cjs/mirror.native.cjs +48 -0
- package/dist/cjs/mirror.native.js +50 -0
- package/dist/cjs/mirror.native.js.map +1 -0
- package/dist/cjs/processStyleColors.cjs +56 -0
- package/dist/cjs/processStyleColors.native.cjs +58 -0
- package/dist/cjs/processStyleColors.native.js +60 -0
- package/dist/cjs/processStyleColors.native.js.map +1 -0
- package/dist/cjs/specs/TamaguiRegistry.nitro.cjs +17 -0
- package/dist/cjs/specs/TamaguiRegistry.nitro.native.cjs +19 -0
- package/dist/cjs/specs/TamaguiRegistry.nitro.native.js +21 -0
- package/dist/cjs/specs/TamaguiRegistry.nitro.native.js.map +1 -0
- package/dist/cjs/types.cjs +17 -0
- package/dist/cjs/types.native.cjs +19 -0
- package/dist/cjs/types.native.js +21 -0
- package/dist/cjs/types.native.js.map +1 -0
- package/dist/esm/index.js +39 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.mjs +39 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +107 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/esm/mirror.mjs +17 -0
- package/dist/esm/mirror.mjs.map +1 -0
- package/dist/esm/mirror.native.js +19 -0
- package/dist/esm/mirror.native.js.map +1 -0
- package/dist/esm/processStyleColors.mjs +36 -0
- package/dist/esm/processStyleColors.mjs.map +1 -0
- package/dist/esm/processStyleColors.native.js +36 -0
- package/dist/esm/processStyleColors.native.js.map +1 -0
- package/dist/esm/specs/TamaguiRegistry.nitro.mjs +0 -0
- package/dist/esm/specs/TamaguiRegistry.nitro.native.js +0 -0
- package/dist/esm/types.mjs +0 -0
- package/dist/esm/types.native.js +0 -0
- package/nitro.json +18 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/tamagui/registry/tamaguiregistryOnLoad.kt +35 -0
- package/nitrogen/generated/android/tamaguiregistry+autolinking.cmake +81 -0
- package/nitrogen/generated/android/tamaguiregistry+autolinking.gradle +27 -0
- package/nitrogen/generated/android/tamaguiregistryOnLoad.cpp +49 -0
- package/nitrogen/generated/android/tamaguiregistryOnLoad.hpp +34 -0
- package/nitrogen/generated/ios/TamaguiRegistry+autolinking.rb +62 -0
- package/nitrogen/generated/ios/TamaguiRegistry-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/TamaguiRegistry-Swift-Cxx-Bridge.hpp +27 -0
- package/nitrogen/generated/ios/TamaguiRegistry-Swift-Cxx-Umbrella.hpp +38 -0
- package/nitrogen/generated/ios/TamaguiRegistryAutolinking.mm +35 -0
- package/nitrogen/generated/ios/TamaguiRegistryAutolinking.swift +16 -0
- package/nitrogen/generated/shared/c++/HybridTamaguiRegistrySpec.cpp +27 -0
- package/nitrogen/generated/shared/c++/HybridTamaguiRegistrySpec.hpp +68 -0
- package/package.json +69 -6
- package/src/index.native.ts +174 -0
- package/src/index.ts +79 -0
- package/src/mirror.ts +31 -0
- package/src/processStyleColors.ts +42 -0
- package/src/specs/TamaguiRegistry.nitro.ts +51 -0
- package/src/types.ts +65 -0
- package/types/index.d.ts +20 -0
- package/types/index.d.ts.map +11 -0
- package/types/index.native.d.ts +37 -0
- package/types/index.native.d.ts.map +11 -0
- package/types/mirror.d.ts +7 -0
- package/types/mirror.d.ts.map +11 -0
- package/types/processStyleColors.d.ts +3 -0
- package/types/processStyleColors.d.ts.map +11 -0
- package/types/specs/TamaguiRegistry.nitro.d.ts +49 -0
- package/types/specs/TamaguiRegistry.nitro.d.ts.map +11 -0
- package/types/types.d.ts +61 -0
- package/types/types.d.ts.map +11 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { HybridObject } from "react-native-nitro-modules";
|
|
2
|
+
/**
|
|
3
|
+
* Typed surface of the native registry.
|
|
4
|
+
*
|
|
5
|
+
* The engine is deliberately generic: it knows nothing about Tamagui themes
|
|
6
|
+
* beyond "a named state per scope selects which slot props apply". Tamagui
|
|
7
|
+
* semantics (theme names, scope wiring, compiler output) live in JS.
|
|
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.
|
|
13
|
+
*
|
|
14
|
+
* Threading: every method must be called from the JS thread. The engine is
|
|
15
|
+
* single-threaded by contract and holds no locks.
|
|
16
|
+
*/
|
|
17
|
+
export interface TamaguiRegistry extends HybridObject<{
|
|
18
|
+
ios: "c++";
|
|
19
|
+
android: "c++";
|
|
20
|
+
}> {
|
|
21
|
+
/**
|
|
22
|
+
* Set the active state name for a scope ('' = root scope) and commit the
|
|
23
|
+
* matching slot props for every affected linked view in one ShadowTree
|
|
24
|
+
* transaction.
|
|
25
|
+
*/
|
|
26
|
+
setStateName(scopeId: string, stateName: string): void;
|
|
27
|
+
/** Read the active state name for a scope ('' = root). */
|
|
28
|
+
getStateName(scopeId: string): string;
|
|
29
|
+
/** Drop a scope entry (cleanup when a scope provider unmounts). */
|
|
30
|
+
removeScope(scopeId: string): void;
|
|
31
|
+
/** Unlink by the id returned from link(). Safe to call twice. */
|
|
32
|
+
unlink(id: number): void;
|
|
33
|
+
/** Number of currently linked views. */
|
|
34
|
+
getViewCount(): number;
|
|
35
|
+
/**
|
|
36
|
+
* Number of ShadowTree commits performed. Benchmark honesty counter: a
|
|
37
|
+
* measurement where this does not increase never exercised the fast path.
|
|
38
|
+
*/
|
|
39
|
+
getCommitCount(): number;
|
|
40
|
+
/**
|
|
41
|
+
* Number of linked views skipped during commits because their slots had no
|
|
42
|
+
* entry for the active state name. Always 0 when the compiler emitted
|
|
43
|
+
* exhaustive keys; anything else is an upstream bug, not a runtime
|
|
44
|
+
* condition to recover from.
|
|
45
|
+
*/
|
|
46
|
+
getMissCount(): number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=TamaguiRegistry.nitro.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mappings": "AAAA,cAAc,oBAAoB;;;;;;;;;;;;;;;;AAiBlC,iBAAiB,wBAAwB,aAAa;CAAE,KAAK;CAAO,SAAS;GAAS;;;;;;CAMpF,aAAa,iBAAiB;;CAG9B,aAAa;;CAGb,YAAY;;CAGZ,OAAO;;CAGP;;;;;CAMA;;;;;;;CAQA",
|
|
3
|
+
"names": [],
|
|
4
|
+
"sources": [
|
|
5
|
+
"src/specs/TamaguiRegistry.nitro.ts"
|
|
6
|
+
],
|
|
7
|
+
"version": 3,
|
|
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"
|
|
10
|
+
]
|
|
11
|
+
}
|
package/types/types.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slot props for one linked view.
|
|
3
|
+
*
|
|
4
|
+
* v1 implements two slot kinds: `base` (state-independent props, applied
|
|
5
|
+
* under every state) and `state` (props keyed by state name, e.g. theme
|
|
6
|
+
* name; the scope's active name selects which entry applies). Future kinds
|
|
7
|
+
* (media, press, group, container) extend this shape; the engine merge
|
|
8
|
+
* order is fixed: base, then state, then future kinds.
|
|
9
|
+
*
|
|
10
|
+
* Keys must be exhaustive for every state name the scope can take. The
|
|
11
|
+
* engine does exact lookups only: no fallback chains, no name parsing. A
|
|
12
|
+
* miss increments the engine's miss counter and is a bug in the emitter.
|
|
13
|
+
*/
|
|
14
|
+
export interface ViewSlots {
|
|
15
|
+
base?: Record<string, unknown>;
|
|
16
|
+
state?: Record<string, Record<string, unknown>>;
|
|
17
|
+
}
|
|
18
|
+
export interface RegistryStats {
|
|
19
|
+
viewCount: number;
|
|
20
|
+
commitCount: number;
|
|
21
|
+
missCount: number;
|
|
22
|
+
}
|
|
23
|
+
/** Returned by link(); call to unlink. Safe to call more than once. */
|
|
24
|
+
export type Unlink = () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Handle for a linked view. `id` addresses the view in batched per-view
|
|
27
|
+
* operations (applyViewStates); `unlink` removes it. null when the ref had
|
|
28
|
+
* no shadow node (never mounted) or the engine is unavailable (web).
|
|
29
|
+
*/
|
|
30
|
+
export interface LinkHandle {
|
|
31
|
+
id: number;
|
|
32
|
+
unlink: Unlink;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* One entry of a batched per-view state update. When `props` is present it
|
|
36
|
+
* is merged into the view's state table under `state` first (lazy warm-up
|
|
37
|
+
* for runtime integrations); the view's active state then becomes `state`
|
|
38
|
+
* and all entries commit natively in one transaction.
|
|
39
|
+
*/
|
|
40
|
+
export interface ViewStateUpdate {
|
|
41
|
+
id: number;
|
|
42
|
+
state: string;
|
|
43
|
+
props?: Record<string, unknown>;
|
|
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
|
+
/** Debug/test snapshot of a linked view's engine tables (getViewState). */
|
|
52
|
+
export interface ViewStateSnapshot {
|
|
53
|
+
scopeId: string;
|
|
54
|
+
activeState: string;
|
|
55
|
+
base: Record<string, unknown> | null;
|
|
56
|
+
states: Record<string, Record<string, unknown>> | null;
|
|
57
|
+
/** the family's sticky nativeProps_DEPRECATED merge, null when unset */
|
|
58
|
+
nativeProps: Record<string, unknown> | null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
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",
|
|
3
|
+
"names": [],
|
|
4
|
+
"sources": [
|
|
5
|
+
"src/types.ts"
|
|
6
|
+
],
|
|
7
|
+
"version": 3,
|
|
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"
|
|
10
|
+
]
|
|
11
|
+
}
|