@tamagui/native-registry 3.0.3 → 3.0.5
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/android/CMakeLists.txt +10 -0
- package/cpp/HybridTamaguiRegistry.cpp +283 -80
- package/cpp/HybridTamaguiRegistry.hpp +52 -9
- package/dist/cjs/index.cjs +9 -3
- package/dist/cjs/index.native.cjs +18 -7
- package/dist/cjs/index.native.js +18 -7
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/index.js +7 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +7 -3
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +16 -7
- package/dist/esm/index.native.js.map +1 -1
- package/package.json +3 -3
- package/src/index.native.ts +58 -16
- package/src/index.ts +19 -5
- package/src/specs/TamaguiRegistry.nitro.ts +4 -4
- package/src/types.ts +0 -7
- package/types/index.d.ts +6 -4
- package/types/index.d.ts.map +2 -2
- package/types/index.native.d.ts +24 -10
- package/types/index.native.d.ts.map +2 -2
- package/types/specs/TamaguiRegistry.nitro.d.ts +4 -4
- package/types/specs/TamaguiRegistry.nitro.d.ts.map +1 -1
- package/types/types.d.ts +0 -6
- package/types/types.d.ts.map +2 -2
|
@@ -29,11 +29,13 @@ __export(index_native_exports, {
|
|
|
29
29
|
getViewState: () => getViewState,
|
|
30
30
|
isAvailable: () => isAvailable,
|
|
31
31
|
link: () => link,
|
|
32
|
+
linkTables: () => linkTables,
|
|
32
33
|
processStyleColors: () => import_processStyleColors.processStyleColors,
|
|
33
34
|
removeScope: () => removeScope,
|
|
34
35
|
resolveSlots: () => resolveSlots,
|
|
35
36
|
setStateName: () => setStateName,
|
|
36
|
-
|
|
37
|
+
setTableState: () => setTableState,
|
|
38
|
+
unlink: () => unlink
|
|
37
39
|
});
|
|
38
40
|
module.exports = __toCommonJS(index_native_exports);
|
|
39
41
|
var import_react_native_nitro_modules = require("react-native-nitro-modules");
|
|
@@ -65,13 +67,13 @@ function isNitroHybridView(ref) {
|
|
|
65
67
|
var config = ref === null || ref === void 0 ? void 0 : ref.__viewConfig;
|
|
66
68
|
return !!(config === null || config === void 0 ? void 0 : config.validAttributes) && "hybridRef" in config.validAttributes;
|
|
67
69
|
}
|
|
68
|
-
function link(ref,
|
|
69
|
-
var scopeId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_mirror.ROOT_SCOPE;
|
|
70
|
+
function link(ref, table) {
|
|
71
|
+
var scopeId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_mirror.ROOT_SCOPE, commitNow = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
70
72
|
if (isNitroHybridView(ref)) return null;
|
|
71
73
|
var node = getShadowNode(ref);
|
|
72
74
|
if (!node) return null;
|
|
73
75
|
var e = getEngine();
|
|
74
|
-
var id = e.link(node,
|
|
76
|
+
var id = e.link(node, table, scopeId, commitNow);
|
|
75
77
|
var unlinked = false;
|
|
76
78
|
return {
|
|
77
79
|
id,
|
|
@@ -82,13 +84,22 @@ function link(ref, slots) {
|
|
|
82
84
|
}
|
|
83
85
|
};
|
|
84
86
|
}
|
|
87
|
+
function linkTables(refs, tableIds, scopeIndexes, scopes) {
|
|
88
|
+
var nodes = new Array(refs.length);
|
|
89
|
+
for (var i = 0; i < refs.length; i++) {
|
|
90
|
+
nodes[i] = getShadowNode(refs[i]);
|
|
91
|
+
}
|
|
92
|
+
return getEngine().linkTables(nodes, tableIds, scopeIndexes, scopes);
|
|
93
|
+
}
|
|
94
|
+
function unlink(id) {
|
|
95
|
+
getEngine().unlink(id);
|
|
96
|
+
}
|
|
85
97
|
function applyViewStates(entries) {
|
|
86
98
|
if (entries.length === 0) return;
|
|
87
99
|
getEngine().applyViewStates(entries);
|
|
88
100
|
}
|
|
89
|
-
function
|
|
90
|
-
|
|
91
|
-
getEngine().updateViewStateTables(entries);
|
|
101
|
+
function setTableState(tableId, state, props) {
|
|
102
|
+
getEngine().setTableState(tableId, state, props);
|
|
92
103
|
}
|
|
93
104
|
function setStateName(stateName) {
|
|
94
105
|
var scopeId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : import_mirror.ROOT_SCOPE;
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -29,11 +29,13 @@ __export(index_native_exports, {
|
|
|
29
29
|
getViewState: () => getViewState,
|
|
30
30
|
isAvailable: () => isAvailable,
|
|
31
31
|
link: () => link,
|
|
32
|
+
linkTables: () => linkTables,
|
|
32
33
|
processStyleColors: () => import_processStyleColors.processStyleColors,
|
|
33
34
|
removeScope: () => removeScope,
|
|
34
35
|
resolveSlots: () => resolveSlots,
|
|
35
36
|
setStateName: () => setStateName,
|
|
36
|
-
|
|
37
|
+
setTableState: () => setTableState,
|
|
38
|
+
unlink: () => unlink
|
|
37
39
|
});
|
|
38
40
|
module.exports = __toCommonJS(index_native_exports);
|
|
39
41
|
var import_react_native_nitro_modules = require("react-native-nitro-modules");
|
|
@@ -65,13 +67,13 @@ function isNitroHybridView(ref) {
|
|
|
65
67
|
var config = ref === null || ref === void 0 ? void 0 : ref.__viewConfig;
|
|
66
68
|
return !!(config === null || config === void 0 ? void 0 : config.validAttributes) && "hybridRef" in config.validAttributes;
|
|
67
69
|
}
|
|
68
|
-
function link(ref,
|
|
69
|
-
var scopeId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_mirror.ROOT_SCOPE;
|
|
70
|
+
function link(ref, table) {
|
|
71
|
+
var scopeId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_mirror.ROOT_SCOPE, commitNow = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
70
72
|
if (isNitroHybridView(ref)) return null;
|
|
71
73
|
var node = getShadowNode(ref);
|
|
72
74
|
if (!node) return null;
|
|
73
75
|
var e = getEngine();
|
|
74
|
-
var id = e.link(node,
|
|
76
|
+
var id = e.link(node, table, scopeId, commitNow);
|
|
75
77
|
var unlinked = false;
|
|
76
78
|
return {
|
|
77
79
|
id,
|
|
@@ -82,13 +84,22 @@ function link(ref, slots) {
|
|
|
82
84
|
}
|
|
83
85
|
};
|
|
84
86
|
}
|
|
87
|
+
function linkTables(refs, tableIds, scopeIndexes, scopes) {
|
|
88
|
+
var nodes = new Array(refs.length);
|
|
89
|
+
for (var i = 0; i < refs.length; i++) {
|
|
90
|
+
nodes[i] = getShadowNode(refs[i]);
|
|
91
|
+
}
|
|
92
|
+
return getEngine().linkTables(nodes, tableIds, scopeIndexes, scopes);
|
|
93
|
+
}
|
|
94
|
+
function unlink(id) {
|
|
95
|
+
getEngine().unlink(id);
|
|
96
|
+
}
|
|
85
97
|
function applyViewStates(entries) {
|
|
86
98
|
if (entries.length === 0) return;
|
|
87
99
|
getEngine().applyViewStates(entries);
|
|
88
100
|
}
|
|
89
|
-
function
|
|
90
|
-
|
|
91
|
-
getEngine().updateViewStateTables(entries);
|
|
101
|
+
function setTableState(tableId, state, props) {
|
|
102
|
+
getEngine().setTableState(tableId, state, props);
|
|
92
103
|
}
|
|
93
104
|
function setStateName(stateName) {
|
|
94
105
|
var scopeId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : import_mirror.ROOT_SCOPE;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_native_exports = {};\n__export(index_native_exports, {\n ROOT_SCOPE: () => import_mirror2.ROOT_SCOPE,\n applyViewStates: () => applyViewStates,\n getMirroredStateName: () => import_mirror2.getMirroredStateName,\n getStats: () => getStats,\n getViewState: () => getViewState,\n isAvailable: () => isAvailable,\n link: () => link,\n processStyleColors: () => import_processStyleColors.processStyleColors,\n removeScope: () => removeScope,\n resolveSlots: () => resolveSlots,\n setStateName: () => setStateName,\n
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_native_exports = {};\n__export(index_native_exports, {\n ROOT_SCOPE: () => import_mirror2.ROOT_SCOPE,\n applyViewStates: () => applyViewStates,\n getMirroredStateName: () => import_mirror2.getMirroredStateName,\n getStats: () => getStats,\n getViewState: () => getViewState,\n isAvailable: () => isAvailable,\n link: () => link,\n linkTables: () => linkTables,\n processStyleColors: () => import_processStyleColors.processStyleColors,\n removeScope: () => removeScope,\n resolveSlots: () => resolveSlots,\n setStateName: () => setStateName,\n setTableState: () => setTableState,\n unlink: () => unlink\n});\nmodule.exports = __toCommonJS(index_native_exports);\nvar import_react_native_nitro_modules = require(\"react-native-nitro-modules\");\nvar import_mirror = require(\"./mirror\");\nvar import_mirror2 = require(\"./mirror\");\nvar import_processStyleColors = require(\"./processStyleColors.native\");\nvar engine = null;\nvar initError = null;\ntry {\n engine = import_react_native_nitro_modules.NitroModules.createHybridObject(\"TamaguiRegistry\");\n} catch (error) {\n initError = error;\n}\nfunction isAvailable() {\n return engine !== null;\n}\nfunction getEngine() {\n if (engine) return engine;\n var detail = initError instanceof Error ? ` ${initError.message}` : \"\";\n throw new Error(`[@tamagui/native-registry] TamaguiRegistry failed to initialize; is react-native-nitro-modules installed and the app rebuilt?${detail}`);\n}\nfunction getShadowNode(ref) {\n var _handle_stateNode;\n var handle = ref === null || ref === void 0 ? void 0 : ref.__internalInstanceHandle;\n var _handle_stateNode_node;\n return (_handle_stateNode_node = handle === null || handle === void 0 ? void 0 : (_handle_stateNode = handle.stateNode) === null || _handle_stateNode === void 0 ? void 0 : _handle_stateNode.node) !== null && _handle_stateNode_node !== void 0 ? _handle_stateNode_node : null;\n}\nfunction isNitroHybridView(ref) {\n var config = ref === null || ref === void 0 ? void 0 : ref.__viewConfig;\n return !!(config === null || config === void 0 ? void 0 : config.validAttributes) && \"hybridRef\" in config.validAttributes;\n}\nfunction link(ref, table) {\n var scopeId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_mirror.ROOT_SCOPE, commitNow = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;\n if (isNitroHybridView(ref)) return null;\n var node = getShadowNode(ref);\n if (!node) return null;\n var e = getEngine();\n var id = e.link(node, table, scopeId, commitNow);\n var unlinked = false;\n return {\n id,\n unlink: function() {\n if (unlinked) return;\n unlinked = true;\n e.unlink(id);\n }\n };\n}\nfunction linkTables(refs, tableIds, scopeIndexes, scopes) {\n var nodes = new Array(refs.length);\n for (var i = 0; i < refs.length; i++) {\n nodes[i] = getShadowNode(refs[i]);\n }\n return getEngine().linkTables(nodes, tableIds, scopeIndexes, scopes);\n}\nfunction unlink(id) {\n getEngine().unlink(id);\n}\nfunction applyViewStates(entries) {\n if (entries.length === 0) return;\n getEngine().applyViewStates(entries);\n}\nfunction setTableState(tableId, state, props) {\n getEngine().setTableState(tableId, state, props);\n}\nfunction setStateName(stateName) {\n var scopeId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : import_mirror.ROOT_SCOPE;\n (0, import_mirror.setMirroredStateName)(scopeId, stateName);\n getEngine().setStateName(scopeId, stateName);\n}\nfunction removeScope(scopeId) {\n (0, import_mirror.removeMirroredScope)(scopeId);\n getEngine().removeScope(scopeId);\n}\nfunction resolveSlots(slots) {\n var scopeId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : import_mirror.ROOT_SCOPE;\n var _slots_state;\n var name = (0, import_mirror.getMirroredStateName)(scopeId);\n return {\n ...slots.base,\n ...name ? (_slots_state = slots.state) === null || _slots_state === void 0 ? void 0 : _slots_state[name] : void 0\n };\n}\nfunction getViewState(id) {\n if (!engine) return null;\n return engine.getViewState(id);\n}\nfunction getStats() {\n if (!engine) return {\n viewCount: 0,\n commitCount: 0,\n missCount: 0\n };\n return {\n viewCount: engine.getViewCount(),\n commitCount: engine.getCommitCount(),\n missCount: engine.getMissCount()\n };\n}\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW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UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,cAAc;CAC7F,CAAC,GAAG,cAAc,qBAAoB,CAAE,SAAS,SAAS;CAC1D,UAAU,CAAC,CAAC,aAAa,SAAS,SAAS;AAC7C;AACA,SAAS,YAAY,SAAS;CAC5B,CAAC,GAAG,cAAc,oBAAmB,CAAE,OAAO;CAC9C,UAAU,CAAC,CAAC,YAAY,OAAO;AACjC;AACA,SAAS,aAAa,OAAO;CAC3B,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,cAAc;CAC7F,IAAI;CACJ,IAAI,QAAQ,GAAG,cAAc,qBAAoB,CAAE,OAAO;CAC1D,OAAO;EACL,GAAG,MAAM;EACT,GAAG,QAAQ,eAAe,MAAM,WAAW,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa,QAAQ,KAAK;CAClH;AACF;AACA,SAAS,aAAa,IAAI;CACxB,IAAI,CAAC,QAAQ,OAAO;CACpB,OAAO,OAAO,aAAa,EAAE;AAC/B;AACA,SAAS,WAAW;CAClB,IAAI,CAAC,QAAQ,OAAO;EAClB,WAAW;EACX,aAAa;EACb,WAAW;CACb;CACA,OAAO;EACL,WAAW,OAAO,aAAa;EAC/B,aAAa,OAAO,eAAe;EACnC,WAAW,OAAO,aAAa;CACjC;AACF"}
|
package/dist/esm/index.js
CHANGED
|
@@ -3,11 +3,15 @@ import { ROOT_SCOPE, ROOT_SCOPE as ROOT_SCOPE2, getMirroredStateName, getMirrore
|
|
|
3
3
|
function isAvailable() {
|
|
4
4
|
return false;
|
|
5
5
|
}
|
|
6
|
-
function link(_ref,
|
|
6
|
+
function link(_ref, _table, _scopeId, _commitNow) {
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
|
+
function linkTables(_refs, _tableIds, _scopeIndexes, _scopes) {
|
|
10
|
+
return 0;
|
|
11
|
+
}
|
|
12
|
+
function unlink(_id) {}
|
|
9
13
|
function applyViewStates(_entries) {}
|
|
10
|
-
function
|
|
14
|
+
function setTableState(_tableId, _state, _props) {}
|
|
11
15
|
function getViewState(_id) {
|
|
12
16
|
return null;
|
|
13
17
|
}
|
|
@@ -35,5 +39,5 @@ function processStyleColors(props) {
|
|
|
35
39
|
return props;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
export { ROOT_SCOPE2 as ROOT_SCOPE, applyViewStates, getMirroredStateName2 as getMirroredStateName, getStats, getViewState, isAvailable, link, processStyleColors, removeScope, resolveSlots, setStateName,
|
|
42
|
+
export { ROOT_SCOPE2 as ROOT_SCOPE, applyViewStates, getMirroredStateName2 as getMirroredStateName, getStats, getViewState, isAvailable, link, linkTables, processStyleColors, removeScope, resolveSlots, setStateName, setTableState, unlink };
|
|
39
43
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import {\n ROOT_SCOPE,\n getMirroredStateName,\n removeMirroredScope,\n setMirroredStateName\n} from \"./mirror\";\nimport { ROOT_SCOPE as ROOT_SCOPE2, getMirroredStateName as getMirroredStateName2 } from \"./mirror\";\nfunction isAvailable() {\n return false;\n}\nfunction link(_ref,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import {\n ROOT_SCOPE,\n getMirroredStateName,\n removeMirroredScope,\n setMirroredStateName\n} from \"./mirror\";\nimport { ROOT_SCOPE as ROOT_SCOPE2, getMirroredStateName as getMirroredStateName2 } from \"./mirror\";\nfunction isAvailable() {\n return false;\n}\nfunction link(_ref, _table, _scopeId, _commitNow) {\n return null;\n}\nfunction linkTables(_refs, _tableIds, _scopeIndexes, _scopes) {\n return 0;\n}\nfunction unlink(_id) {\n}\nfunction applyViewStates(_entries) {\n}\nfunction setTableState(_tableId, _state, _props) {\n}\nfunction getViewState(_id) {\n return null;\n}\nfunction setStateName(stateName, scopeId = ROOT_SCOPE) {\n setMirroredStateName(scopeId, stateName);\n}\nfunction removeScope(scopeId) {\n removeMirroredScope(scopeId);\n}\nfunction resolveSlots(slots, scopeId = ROOT_SCOPE) {\n const name = getMirroredStateName(scopeId);\n return {\n ...slots.base,\n ...name ? slots.state?.[name] : void 0\n };\n}\nfunction getStats() {\n return { viewCount: 0, commitCount: 0, missCount: 0 };\n}\nfunction processStyleColors(props) {\n return props;\n}\nexport {\n ROOT_SCOPE2 as ROOT_SCOPE,\n applyViewStates,\n getMirroredStateName2 as getMirroredStateName,\n getStats,\n getViewState,\n isAvailable,\n link,\n linkTables,\n processStyleColors,\n removeScope,\n resolveSlots,\n setStateName,\n setTableState,\n unlink\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AAOA,SAAS,cAAc;CACrB,OAAO;AACT;AACA,SAAS,KAAK,MAAM,QAAQ,UAAU,YAAY;CAChD,OAAO;AACT;AACA,SAAS,WAAW,OAAO,WAAW,eAAe,SAAS;CAC5D,OAAO;AACT;AACA,SAAS,OAAO,KAAK,CACrB;AACA,SAAS,gBAAgB,UAAU,CACnC;AACA,SAAS,cAAc,UAAU,QAAQ,QAAQ,CACjD;AACA,SAAS,aAAa,KAAK;CACzB,OAAO;AACT;AACA,SAAS,aAAa,WAAW,UAAU,YAAY;CACrD,qBAAqB,SAAS,SAAS;AACzC;AACA,SAAS,YAAY,SAAS;CAC5B,oBAAoB,OAAO;AAC7B;AACA,SAAS,aAAa,OAAO,UAAU,YAAY;CACjD,MAAM,OAAO,qBAAqB,OAAO;CACzC,OAAO;EACL,GAAG,MAAM;EACT,GAAG,OAAO,MAAM,QAAQ,QAAQ,KAAK;CACvC;AACF;AACA,SAAS,WAAW;CAClB,OAAO;EAAE,WAAW;EAAG,aAAa;EAAG,WAAW;CAAE;AACtD;AACA,SAAS,mBAAmB,OAAO;CACjC,OAAO;AACT"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -3,11 +3,15 @@ import { ROOT_SCOPE, ROOT_SCOPE as ROOT_SCOPE2, getMirroredStateName, getMirrore
|
|
|
3
3
|
function isAvailable() {
|
|
4
4
|
return false;
|
|
5
5
|
}
|
|
6
|
-
function link(_ref,
|
|
6
|
+
function link(_ref, _table, _scopeId, _commitNow) {
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
|
+
function linkTables(_refs, _tableIds, _scopeIndexes, _scopes) {
|
|
10
|
+
return 0;
|
|
11
|
+
}
|
|
12
|
+
function unlink(_id) {}
|
|
9
13
|
function applyViewStates(_entries) {}
|
|
10
|
-
function
|
|
14
|
+
function setTableState(_tableId, _state, _props) {}
|
|
11
15
|
function getViewState(_id) {
|
|
12
16
|
return null;
|
|
13
17
|
}
|
|
@@ -35,5 +39,5 @@ function processStyleColors(props) {
|
|
|
35
39
|
return props;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
export { ROOT_SCOPE2 as ROOT_SCOPE, applyViewStates, getMirroredStateName2 as getMirroredStateName, getStats, getViewState, isAvailable, link, processStyleColors, removeScope, resolveSlots, setStateName,
|
|
42
|
+
export { ROOT_SCOPE2 as ROOT_SCOPE, applyViewStates, getMirroredStateName2 as getMirroredStateName, getStats, getViewState, isAvailable, link, linkTables, processStyleColors, removeScope, resolveSlots, setStateName, setTableState, unlink };
|
|
39
43
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import {\n ROOT_SCOPE,\n getMirroredStateName,\n removeMirroredScope,\n setMirroredStateName\n} from \"./mirror\";\nimport { ROOT_SCOPE as ROOT_SCOPE2, getMirroredStateName as getMirroredStateName2 } from \"./mirror\";\nfunction isAvailable() {\n return false;\n}\nfunction link(_ref,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import {\n ROOT_SCOPE,\n getMirroredStateName,\n removeMirroredScope,\n setMirroredStateName\n} from \"./mirror\";\nimport { ROOT_SCOPE as ROOT_SCOPE2, getMirroredStateName as getMirroredStateName2 } from \"./mirror\";\nfunction isAvailable() {\n return false;\n}\nfunction link(_ref, _table, _scopeId, _commitNow) {\n return null;\n}\nfunction linkTables(_refs, _tableIds, _scopeIndexes, _scopes) {\n return 0;\n}\nfunction unlink(_id) {\n}\nfunction applyViewStates(_entries) {\n}\nfunction setTableState(_tableId, _state, _props) {\n}\nfunction getViewState(_id) {\n return null;\n}\nfunction setStateName(stateName, scopeId = ROOT_SCOPE) {\n setMirroredStateName(scopeId, stateName);\n}\nfunction removeScope(scopeId) {\n removeMirroredScope(scopeId);\n}\nfunction resolveSlots(slots, scopeId = ROOT_SCOPE) {\n const name = getMirroredStateName(scopeId);\n return {\n ...slots.base,\n ...name ? slots.state?.[name] : void 0\n };\n}\nfunction getStats() {\n return { viewCount: 0, commitCount: 0, missCount: 0 };\n}\nfunction processStyleColors(props) {\n return props;\n}\nexport {\n ROOT_SCOPE2 as ROOT_SCOPE,\n applyViewStates,\n getMirroredStateName2 as getMirroredStateName,\n getStats,\n getViewState,\n isAvailable,\n link,\n linkTables,\n processStyleColors,\n removeScope,\n resolveSlots,\n setStateName,\n setTableState,\n unlink\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AAOA,SAAS,cAAc;CACrB,OAAO;AACT;AACA,SAAS,KAAK,MAAM,QAAQ,UAAU,YAAY;CAChD,OAAO;AACT;AACA,SAAS,WAAW,OAAO,WAAW,eAAe,SAAS;CAC5D,OAAO;AACT;AACA,SAAS,OAAO,KAAK,CACrB;AACA,SAAS,gBAAgB,UAAU,CACnC;AACA,SAAS,cAAc,UAAU,QAAQ,QAAQ,CACjD;AACA,SAAS,aAAa,KAAK;CACzB,OAAO;AACT;AACA,SAAS,aAAa,WAAW,UAAU,YAAY;CACrD,qBAAqB,SAAS,SAAS;AACzC;AACA,SAAS,YAAY,SAAS;CAC5B,oBAAoB,OAAO;AAC7B;AACA,SAAS,aAAa,OAAO,UAAU,YAAY;CACjD,MAAM,OAAO,qBAAqB,OAAO;CACzC,OAAO;EACL,GAAG,MAAM;EACT,GAAG,OAAO,MAAM,QAAQ,QAAQ,KAAK;CACvC;AACF;AACA,SAAS,WAAW;CAClB,OAAO;EAAE,WAAW;EAAG,aAAa;EAAG,WAAW;CAAE;AACtD;AACA,SAAS,mBAAmB,OAAO;CACjC,OAAO;AACT"}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -27,13 +27,13 @@ function isNitroHybridView(ref) {
|
|
|
27
27
|
var config = ref === null || ref === void 0 ? void 0 : ref.__viewConfig;
|
|
28
28
|
return !!(config === null || config === void 0 ? void 0 : config.validAttributes) && "hybridRef" in config.validAttributes;
|
|
29
29
|
}
|
|
30
|
-
function link(ref,
|
|
31
|
-
var scopeId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ROOT_SCOPE;
|
|
30
|
+
function link(ref, table) {
|
|
31
|
+
var scopeId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ROOT_SCOPE, commitNow = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
32
32
|
if (isNitroHybridView(ref)) return null;
|
|
33
33
|
var node = getShadowNode(ref);
|
|
34
34
|
if (!node) return null;
|
|
35
35
|
var e = getEngine();
|
|
36
|
-
var id = e.link(node,
|
|
36
|
+
var id = e.link(node, table, scopeId, commitNow);
|
|
37
37
|
var unlinked = false;
|
|
38
38
|
return {
|
|
39
39
|
id,
|
|
@@ -44,13 +44,22 @@ function link(ref, slots) {
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
function linkTables(refs, tableIds, scopeIndexes, scopes) {
|
|
48
|
+
var nodes = new Array(refs.length);
|
|
49
|
+
for (var i = 0; i < refs.length; i++) {
|
|
50
|
+
nodes[i] = getShadowNode(refs[i]);
|
|
51
|
+
}
|
|
52
|
+
return getEngine().linkTables(nodes, tableIds, scopeIndexes, scopes);
|
|
53
|
+
}
|
|
54
|
+
function unlink(id) {
|
|
55
|
+
getEngine().unlink(id);
|
|
56
|
+
}
|
|
47
57
|
function applyViewStates(entries) {
|
|
48
58
|
if (entries.length === 0) return;
|
|
49
59
|
getEngine().applyViewStates(entries);
|
|
50
60
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
getEngine().updateViewStateTables(entries);
|
|
61
|
+
function setTableState(tableId, state, props) {
|
|
62
|
+
getEngine().setTableState(tableId, state, props);
|
|
54
63
|
}
|
|
55
64
|
function setStateName(stateName) {
|
|
56
65
|
var scopeId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ROOT_SCOPE;
|
|
@@ -87,5 +96,5 @@ function getStats() {
|
|
|
87
96
|
};
|
|
88
97
|
}
|
|
89
98
|
|
|
90
|
-
export { ROOT_SCOPE2 as ROOT_SCOPE, applyViewStates, getMirroredStateName2 as getMirroredStateName, getStats, getViewState, isAvailable, link, processStyleColors, removeScope, resolveSlots, setStateName,
|
|
99
|
+
export { ROOT_SCOPE2 as ROOT_SCOPE, applyViewStates, getMirroredStateName2 as getMirroredStateName, getStats, getViewState, isAvailable, link, linkTables, processStyleColors, removeScope, resolveSlots, setStateName, setTableState, unlink };
|
|
91
100
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["import { NitroModules } from \"react-native-nitro-modules\";\nimport { ROOT_SCOPE, getMirroredStateName, removeMirroredScope, setMirroredStateName } from \"./mirror\";\nimport { ROOT_SCOPE as ROOT_SCOPE2, getMirroredStateName as getMirroredStateName2 } from \"./mirror\";\nimport { processStyleColors } from \"./processStyleColors.native\";\nvar engine = null;\nvar initError = null;\ntry {\n engine = NitroModules.createHybridObject(\"TamaguiRegistry\");\n} catch (error) {\n initError = error;\n}\nfunction isAvailable() {\n return engine !== null;\n}\nfunction getEngine() {\n if (engine) return engine;\n var detail = initError instanceof Error ? ` ${initError.message}` : \"\";\n throw new Error(`[@tamagui/native-registry] TamaguiRegistry failed to initialize; is react-native-nitro-modules installed and the app rebuilt?${detail}`);\n}\nfunction getShadowNode(ref) {\n var _handle_stateNode;\n var handle = ref === null || ref === void 0 ? void 0 : ref.__internalInstanceHandle;\n var _handle_stateNode_node;\n return (_handle_stateNode_node = handle === null || handle === void 0 ? void 0 : (_handle_stateNode = handle.stateNode) === null || _handle_stateNode === void 0 ? void 0 : _handle_stateNode.node) !== null && _handle_stateNode_node !== void 0 ? _handle_stateNode_node : null;\n}\nfunction isNitroHybridView(ref) {\n var config = ref === null || ref === void 0 ? void 0 : ref.__viewConfig;\n return !!(config === null || config === void 0 ? void 0 : config.validAttributes) && \"hybridRef\" in config.validAttributes;\n}\nfunction link(ref,
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["import { NitroModules } from \"react-native-nitro-modules\";\nimport { ROOT_SCOPE, getMirroredStateName, removeMirroredScope, setMirroredStateName } from \"./mirror\";\nimport { ROOT_SCOPE as ROOT_SCOPE2, getMirroredStateName as getMirroredStateName2 } from \"./mirror\";\nimport { processStyleColors } from \"./processStyleColors.native\";\nvar engine = null;\nvar initError = null;\ntry {\n engine = NitroModules.createHybridObject(\"TamaguiRegistry\");\n} catch (error) {\n initError = error;\n}\nfunction isAvailable() {\n return engine !== null;\n}\nfunction getEngine() {\n if (engine) return engine;\n var detail = initError instanceof Error ? ` ${initError.message}` : \"\";\n throw new Error(`[@tamagui/native-registry] TamaguiRegistry failed to initialize; is react-native-nitro-modules installed and the app rebuilt?${detail}`);\n}\nfunction getShadowNode(ref) {\n var _handle_stateNode;\n var handle = ref === null || ref === void 0 ? void 0 : ref.__internalInstanceHandle;\n var _handle_stateNode_node;\n return (_handle_stateNode_node = handle === null || handle === void 0 ? void 0 : (_handle_stateNode = handle.stateNode) === null || _handle_stateNode === void 0 ? void 0 : _handle_stateNode.node) !== null && _handle_stateNode_node !== void 0 ? _handle_stateNode_node : null;\n}\nfunction isNitroHybridView(ref) {\n var config = ref === null || ref === void 0 ? void 0 : ref.__viewConfig;\n return !!(config === null || config === void 0 ? void 0 : config.validAttributes) && \"hybridRef\" in config.validAttributes;\n}\nfunction link(ref, table) {\n var scopeId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ROOT_SCOPE, commitNow = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;\n if (isNitroHybridView(ref)) return null;\n var node = getShadowNode(ref);\n if (!node) return null;\n var e = getEngine();\n var id = e.link(node, table, scopeId, commitNow);\n var unlinked = false;\n return {\n id,\n unlink: function() {\n if (unlinked) return;\n unlinked = true;\n e.unlink(id);\n }\n };\n}\nfunction linkTables(refs, tableIds, scopeIndexes, scopes) {\n var nodes = new Array(refs.length);\n for (var i = 0; i < refs.length; i++) {\n nodes[i] = getShadowNode(refs[i]);\n }\n return getEngine().linkTables(nodes, tableIds, scopeIndexes, scopes);\n}\nfunction unlink(id) {\n getEngine().unlink(id);\n}\nfunction applyViewStates(entries) {\n if (entries.length === 0) return;\n getEngine().applyViewStates(entries);\n}\nfunction setTableState(tableId, state, props) {\n getEngine().setTableState(tableId, state, props);\n}\nfunction setStateName(stateName) {\n var scopeId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ROOT_SCOPE;\n setMirroredStateName(scopeId, stateName);\n getEngine().setStateName(scopeId, stateName);\n}\nfunction removeScope(scopeId) {\n removeMirroredScope(scopeId);\n getEngine().removeScope(scopeId);\n}\nfunction resolveSlots(slots) {\n var scopeId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ROOT_SCOPE;\n var _slots_state;\n var name = getMirroredStateName(scopeId);\n return {\n ...slots.base,\n ...name ? (_slots_state = slots.state) === null || _slots_state === void 0 ? void 0 : _slots_state[name] : void 0\n };\n}\nfunction getViewState(id) {\n if (!engine) return null;\n return engine.getViewState(id);\n}\nfunction getStats() {\n if (!engine) return {\n viewCount: 0,\n commitCount: 0,\n missCount: 0\n };\n return {\n viewCount: engine.getViewCount(),\n commitCount: engine.getCommitCount(),\n missCount: engine.getMissCount()\n };\n}\nexport {\n ROOT_SCOPE2 as ROOT_SCOPE,\n applyViewStates,\n getMirroredStateName2 as getMirroredStateName,\n getStats,\n getViewState,\n isAvailable,\n link,\n linkTables,\n processStyleColors,\n removeScope,\n resolveSlots,\n setStateName,\n setTableState,\n unlink\n};\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;;;AAIA,IAAI,SAAS;AACb,IAAI,YAAY;AAChB,IAAI;CACF,SAAS,aAAa,mBAAmB,iBAAiB;AAC5D,SAAS,OAAO;CACd,YAAY;AACd;AACA,SAAS,cAAc;CACrB,OAAO,WAAW;AACpB;AACA,SAAS,YAAY;CACnB,IAAI,QAAQ,OAAO;CACnB,IAAI,SAAS,qBAAqB,QAAQ,IAAI,UAAU,YAAY;CACpE,MAAM,IAAI,MAAM,gIAAgI,QAAQ;AAC1J;AACA,SAAS,cAAc,KAAK;CAC1B,IAAI;CACJ,IAAI,SAAS,QAAQ,QAAQ,QAAQ,KAAK,IAAI,KAAK,IAAI,IAAI;CAC3D,IAAI;CACJ,QAAQ,yBAAyB,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,KAAK,oBAAoB,OAAO,eAAe,QAAQ,sBAAsB,KAAK,IAAI,KAAK,IAAI,kBAAkB,UAAU,QAAQ,2BAA2B,KAAK,IAAI,yBAAyB;AAC/Q;AACA,SAAS,kBAAkB,KAAK;CAC9B,IAAI,SAAS,QAAQ,QAAQ,QAAQ,KAAK,IAAI,KAAK,IAAI,IAAI;CAC3D,OAAO,CAAC,EAAE,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,oBAAoB,eAAe,OAAO;AAC7G;AACA,SAAS,KAAK,KAAK,OAAO;CACxB,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,YAAY,YAAY,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,I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O;EACL,GAAG,MAAM;EACT,GAAG,QAAQ,eAAe,MAAM,WAAW,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa,QAAQ,KAAK;CAClH;AACF;AACA,SAAS,aAAa,IAAI;CACxB,IAAI,CAAC,QAAQ,OAAO;CACpB,OAAO,OAAO,aAAa,EAAE;AAC/B;AACA,SAAS,WAAW;CAClB,IAAI,CAAC,QAAQ,OAAO;EAClB,WAAW;EACX,aAAa;EACb,WAAW;CACb;CACA,OAAO;EACL,WAAW,OAAO,aAAa;EAC/B,aAAa,OAAO,eAAe;EACnC,WAAW,OAAO,aAAa;CACjC;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/native-registry",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "Generic native style registry: zero-re-render style updates via Fabric ShadowTree commits",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@tamagui/build": "3.0.
|
|
49
|
+
"@tamagui/build": "3.0.5",
|
|
50
50
|
"react": "19.2.3",
|
|
51
51
|
"react-native": "0.87.1",
|
|
52
52
|
"react-native-nitro-modules": "0.37.1",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"releaseSourceCommit": "
|
|
80
|
+
"releaseSourceCommit": "2500e65729dfd41ce27b4b3271f22f9c1d1ff5a3"
|
|
81
81
|
}
|
package/src/index.native.ts
CHANGED
|
@@ -11,7 +11,6 @@ import type {
|
|
|
11
11
|
Unlink,
|
|
12
12
|
ViewSlots,
|
|
13
13
|
ViewStateSnapshot,
|
|
14
|
-
ViewStateTableUpdate,
|
|
15
14
|
ViewStateUpdate,
|
|
16
15
|
} from './types'
|
|
17
16
|
import {
|
|
@@ -27,7 +26,6 @@ export type {
|
|
|
27
26
|
Unlink,
|
|
28
27
|
ViewSlots,
|
|
29
28
|
ViewStateSnapshot,
|
|
30
|
-
ViewStateTableUpdate,
|
|
31
29
|
ViewStateUpdate,
|
|
32
30
|
} from './types'
|
|
33
31
|
export { ROOT_SCOPE, getMirroredStateName } from './mirror'
|
|
@@ -35,9 +33,20 @@ export { processStyleColors } from './processStyleColors.native'
|
|
|
35
33
|
|
|
36
34
|
/** Full engine surface: typed Nitro methods plus the raw-JSI methods. */
|
|
37
35
|
interface Engine extends TamaguiRegistry {
|
|
38
|
-
link(
|
|
36
|
+
link(
|
|
37
|
+
shadowNode: unknown,
|
|
38
|
+
table: ViewSlots | number,
|
|
39
|
+
scopeId: string,
|
|
40
|
+
commitNow: boolean
|
|
41
|
+
): number
|
|
42
|
+
linkTables(
|
|
43
|
+
shadowNodes: unknown[],
|
|
44
|
+
tableIds: number[],
|
|
45
|
+
scopeIndexes: number[],
|
|
46
|
+
scopes: string[]
|
|
47
|
+
): number
|
|
39
48
|
applyViewStates(entries: ViewStateUpdate[]): void
|
|
40
|
-
|
|
49
|
+
setTableState(tableId: number, state: string, props: Record<string, unknown>): void
|
|
41
50
|
getViewState(id: number): ViewStateSnapshot | null
|
|
42
51
|
}
|
|
43
52
|
|
|
@@ -87,20 +96,26 @@ function isNitroHybridView(ref: unknown): boolean {
|
|
|
87
96
|
/**
|
|
88
97
|
* Link a mounted view to the engine. Captures the ShadowNode once, returns
|
|
89
98
|
* a handle keyed by the engine-issued id: unlink never re-derives anything
|
|
90
|
-
* from the ref, so a torn-down ref cannot leave a stale entry behind.
|
|
91
|
-
*
|
|
99
|
+
* from the ref, so a torn-down ref cannot leave a stale entry behind.
|
|
100
|
+
*
|
|
101
|
+
* `table` is either the view's own slots or the id of a shared table filled
|
|
102
|
+
* by setTableState; every view of one compiler mapping links the same table,
|
|
103
|
+
* so linking sends no props at all. `commitNow` commits the view's active
|
|
104
|
+
* state once, for a host whose render raced a scope change. Props arrive in
|
|
105
|
+
* engine form, already through processStyleColors.
|
|
92
106
|
*/
|
|
93
107
|
export function link(
|
|
94
108
|
ref: unknown,
|
|
95
|
-
|
|
96
|
-
scopeId: string = ROOT_SCOPE
|
|
109
|
+
table: ViewSlots | number,
|
|
110
|
+
scopeId: string = ROOT_SCOPE,
|
|
111
|
+
commitNow = false
|
|
97
112
|
): LinkHandle | null {
|
|
98
113
|
if (isNitroHybridView(ref)) return null
|
|
99
114
|
const node = getShadowNode(ref)
|
|
100
115
|
if (!node) return null
|
|
101
116
|
|
|
102
117
|
const e = getEngine()
|
|
103
|
-
const id = e.link(node,
|
|
118
|
+
const id = e.link(node, table, scopeId, commitNow)
|
|
104
119
|
let unlinked = false
|
|
105
120
|
return {
|
|
106
121
|
id,
|
|
@@ -112,6 +127,31 @@ export function link(
|
|
|
112
127
|
}
|
|
113
128
|
}
|
|
114
129
|
|
|
130
|
+
/**
|
|
131
|
+
* Link many host views to shared tables in one native call. Entry i links
|
|
132
|
+
* refs[i] to table tableIds[i] under scope scopes[scopeIndexes[i]]. Returns
|
|
133
|
+
* the id of entry 0; ids are consecutive, and an entry whose host has no
|
|
134
|
+
* shadow node consumes its id unlinked. The refs are React Native host
|
|
135
|
+
* components (never Nitro views, see link).
|
|
136
|
+
*/
|
|
137
|
+
export function linkTables(
|
|
138
|
+
refs: unknown[],
|
|
139
|
+
tableIds: number[],
|
|
140
|
+
scopeIndexes: number[],
|
|
141
|
+
scopes: string[]
|
|
142
|
+
): number {
|
|
143
|
+
const nodes = new Array(refs.length)
|
|
144
|
+
for (let i = 0; i < refs.length; i++) {
|
|
145
|
+
nodes[i] = getShadowNode(refs[i])
|
|
146
|
+
}
|
|
147
|
+
return getEngine().linkTables(nodes, tableIds, scopeIndexes, scopes)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Unlink by an id from linkTables. Safe to call twice. */
|
|
151
|
+
export function unlink(id: number): void {
|
|
152
|
+
getEngine().unlink(id)
|
|
153
|
+
}
|
|
154
|
+
|
|
115
155
|
/**
|
|
116
156
|
* Batched per-view state selection: cold entries carry `props` (computed by
|
|
117
157
|
* the caller, colors already processed via processStyleColors), warm entries
|
|
@@ -123,14 +163,16 @@ export function applyViewStates(entries: ViewStateUpdate[]): void {
|
|
|
123
163
|
}
|
|
124
164
|
|
|
125
165
|
/**
|
|
126
|
-
* Fill
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* arrive in engine form, already through processStyleColors.
|
|
166
|
+
* Fill one state of a shared table. Every view linked to the table reads it;
|
|
167
|
+
* views already showing that state commit the new props. Props arrive in
|
|
168
|
+
* engine form, already through processStyleColors.
|
|
130
169
|
*/
|
|
131
|
-
export function
|
|
132
|
-
|
|
133
|
-
|
|
170
|
+
export function setTableState(
|
|
171
|
+
tableId: number,
|
|
172
|
+
state: string,
|
|
173
|
+
props: Record<string, unknown>
|
|
174
|
+
): void {
|
|
175
|
+
getEngine().setTableState(tableId, state, props)
|
|
134
176
|
}
|
|
135
177
|
|
|
136
178
|
/**
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,6 @@ import type {
|
|
|
8
8
|
RegistryStats,
|
|
9
9
|
ViewSlots,
|
|
10
10
|
ViewStateSnapshot,
|
|
11
|
-
ViewStateTableUpdate,
|
|
12
11
|
ViewStateUpdate,
|
|
13
12
|
} from './types'
|
|
14
13
|
import {
|
|
@@ -24,7 +23,6 @@ export type {
|
|
|
24
23
|
Unlink,
|
|
25
24
|
ViewSlots,
|
|
26
25
|
ViewStateSnapshot,
|
|
27
|
-
ViewStateTableUpdate,
|
|
28
26
|
ViewStateUpdate,
|
|
29
27
|
} from './types'
|
|
30
28
|
export { ROOT_SCOPE, getMirroredStateName } from './mirror'
|
|
@@ -35,15 +33,31 @@ export function isAvailable(): boolean {
|
|
|
35
33
|
|
|
36
34
|
export function link(
|
|
37
35
|
_ref: unknown,
|
|
38
|
-
|
|
39
|
-
_scopeId?: string
|
|
36
|
+
_table: ViewSlots | number,
|
|
37
|
+
_scopeId?: string,
|
|
38
|
+
_commitNow?: boolean
|
|
40
39
|
): LinkHandle | null {
|
|
41
40
|
return null
|
|
42
41
|
}
|
|
43
42
|
|
|
43
|
+
export function linkTables(
|
|
44
|
+
_refs: unknown[],
|
|
45
|
+
_tableIds: number[],
|
|
46
|
+
_scopeIndexes: number[],
|
|
47
|
+
_scopes: string[]
|
|
48
|
+
): number {
|
|
49
|
+
return 0
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function unlink(_id: number): void {}
|
|
53
|
+
|
|
44
54
|
export function applyViewStates(_entries: ViewStateUpdate[]): void {}
|
|
45
55
|
|
|
46
|
-
export function
|
|
56
|
+
export function setTableState(
|
|
57
|
+
_tableId: number,
|
|
58
|
+
_state: string,
|
|
59
|
+
_props: Record<string, unknown>
|
|
60
|
+
): void {}
|
|
47
61
|
|
|
48
62
|
export function getViewState(_id: number): ViewStateSnapshot | null {
|
|
49
63
|
return null
|
|
@@ -7,10 +7,10 @@ import type { HybridObject } from 'react-native-nitro-modules'
|
|
|
7
7
|
* beyond "a named state per scope selects which slot props apply". Tamagui
|
|
8
8
|
* semantics (theme names, scope wiring, compiler output) live in JS.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* The methods that take values Nitro cannot type (`link`, `linkTables`,
|
|
11
|
+
* `setTableState`, `applyViewStates`, `getViewState`) are NOT in this spec.
|
|
12
|
+
* They are registered as raw hybrid methods in C++ and typed on the JS side
|
|
13
|
+
* in index.native.ts.
|
|
14
14
|
*
|
|
15
15
|
* Threading: every method must be called from the JS thread. The engine is
|
|
16
16
|
* single-threaded by contract and holds no locks.
|
package/src/types.ts
CHANGED
|
@@ -47,13 +47,6 @@ export interface ViewStateUpdate {
|
|
|
47
47
|
props?: Record<string, unknown>
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/** add or replace one resolved state-table entry without changing its view's controller */
|
|
51
|
-
export interface ViewStateTableUpdate {
|
|
52
|
-
id: number
|
|
53
|
-
state: string
|
|
54
|
-
props: Record<string, unknown>
|
|
55
|
-
}
|
|
56
|
-
|
|
57
50
|
/** Debug/test snapshot of a linked view's engine tables (getViewState). */
|
|
58
51
|
export interface ViewStateSnapshot {
|
|
59
52
|
scopeId: string
|
package/types/index.d.ts
CHANGED
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
* (or when the native module is absent) the mirror still tracks scope state
|
|
4
4
|
* so shared code can resolve slots, but nothing links and nothing commits.
|
|
5
5
|
*/
|
|
6
|
-
import type { LinkHandle, RegistryStats, ViewSlots, ViewStateSnapshot,
|
|
7
|
-
export type { LinkHandle, RegistryStats, Unlink, ViewSlots, ViewStateSnapshot,
|
|
6
|
+
import type { LinkHandle, RegistryStats, ViewSlots, ViewStateSnapshot, ViewStateUpdate } from "./types";
|
|
7
|
+
export type { LinkHandle, RegistryStats, Unlink, ViewSlots, ViewStateSnapshot, ViewStateUpdate } from "./types";
|
|
8
8
|
export { ROOT_SCOPE, getMirroredStateName } from "./mirror";
|
|
9
9
|
export declare function isAvailable(): boolean;
|
|
10
|
-
export declare function link(_ref: unknown,
|
|
10
|
+
export declare function link(_ref: unknown, _table: ViewSlots | number, _scopeId?: string, _commitNow?: boolean): LinkHandle | null;
|
|
11
|
+
export declare function linkTables(_refs: unknown[], _tableIds: number[], _scopeIndexes: number[], _scopes: string[]): number;
|
|
12
|
+
export declare function unlink(_id: number): void;
|
|
11
13
|
export declare function applyViewStates(_entries: ViewStateUpdate[]): void;
|
|
12
|
-
export declare function
|
|
14
|
+
export declare function setTableState(_tableId: number, _state: string, _props: Record<string, unknown>): void;
|
|
13
15
|
export declare function getViewState(_id: number): ViewStateSnapshot | null;
|
|
14
16
|
export declare function setStateName(stateName: string, scopeId?: string): void;
|
|
15
17
|
export declare function removeScope(scopeId: string): void;
|
package/types/index.d.ts.map
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"mappings": ";;;;;AAKA,cACE,YACA,eACA,WACA,mBACA,
|
|
2
|
+
"mappings": ";;;;;AAKA,cACE,YACA,eACA,WACA,mBACA,uBACK;AAQP,cACE,YACA,eACA,QACA,WACA,mBACA,uBACK;AACP,SAAS,YAAY,4BAA4B;AAEjD,OAAO,iBAAS;AAIhB,OAAO,iBAAS,KACd,eACA,QAAQ,oBACR,mBACA,uBACC;AAIH,OAAO,iBAAS,WACd,kBACA,qBACA,yBACA;AAKF,OAAO,iBAAS,OAAO;AAEvB,OAAO,iBAAS,gBAAgB,UAAU;AAE1C,OAAO,iBAAS,cACd,kBACA,gBACA,QAAQ;AAGV,OAAO,iBAAS,aAAa,cAAc;AAI3C,OAAO,iBAAS,aAAa,mBAAmB;AAIhD,OAAO,iBAAS,YAAY;AAI5B,OAAO,iBAAS,aACd,OAAO,WACP,mBACC;AAQH,OAAO,iBAAS,YAAY;AAI5B,OAAO,iBAAS,mBACd,OAAO,0BACN",
|
|
3
3
|
"names": [],
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/index.ts"
|
|
6
6
|
],
|
|
7
7
|
"version": 3,
|
|
8
8
|
"sourcesContent": [
|
|
9
|
-
"/**\n * Web/no-native fallback. The registry is a native-only optimization; on web\n * (or when the native module is absent) the mirror still tracks scope state\n * so shared code can resolve slots, but nothing links and nothing commits.\n */\nimport type {\n LinkHandle,\n RegistryStats,\n ViewSlots,\n ViewStateSnapshot,\n
|
|
9
|
+
"/**\n * Web/no-native fallback. The registry is a native-only optimization; on web\n * (or when the native module is absent) the mirror still tracks scope state\n * so shared code can resolve slots, but nothing links and nothing commits.\n */\nimport type {\n LinkHandle,\n RegistryStats,\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'\n\nexport function isAvailable(): boolean {\n return false\n}\n\nexport function link(\n _ref: unknown,\n _table: ViewSlots | number,\n _scopeId?: string,\n _commitNow?: boolean\n): LinkHandle | null {\n return null\n}\n\nexport function linkTables(\n _refs: unknown[],\n _tableIds: number[],\n _scopeIndexes: number[],\n _scopes: string[]\n): number {\n return 0\n}\n\nexport function unlink(_id: number): void {}\n\nexport function applyViewStates(_entries: ViewStateUpdate[]): void {}\n\nexport function setTableState(\n _tableId: number,\n _state: string,\n _props: Record<string, unknown>\n): void {}\n\nexport function getViewState(_id: number): ViewStateSnapshot | null {\n return null\n}\n\nexport function setStateName(stateName: string, scopeId: string = ROOT_SCOPE): void {\n setMirroredStateName(scopeId, stateName)\n}\n\nexport function removeScope(scopeId: string): void {\n removeMirroredScope(scopeId)\n}\n\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\nexport function getStats(): RegistryStats {\n return { viewCount: 0, commitCount: 0, missCount: 0 }\n}\n\nexport function processStyleColors(\n props: Record<string, unknown>\n): Record<string, unknown> {\n return props\n}\n"
|
|
10
10
|
]
|
|
11
11
|
}
|