@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,117 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include "HybridTamaguiRegistrySpec.hpp"
|
|
4
|
+
|
|
5
|
+
#include <folly/dynamic.h>
|
|
6
|
+
#include <jsi/jsi.h>
|
|
7
|
+
#include <react/renderer/core/ShadowNode.h>
|
|
8
|
+
|
|
9
|
+
#include <string>
|
|
10
|
+
#include <unordered_map>
|
|
11
|
+
|
|
12
|
+
namespace margelo::nitro::tamagui::registry {
|
|
13
|
+
|
|
14
|
+
namespace jsi = facebook::jsi;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Generic style registry engine.
|
|
18
|
+
*
|
|
19
|
+
* Views link with slot props (base + per-state-name); scopes hold an active
|
|
20
|
+
* state name; changing a scope's state commits the matching props for every
|
|
21
|
+
* affected view straight to Fabric's ShadowTree via
|
|
22
|
+
* UIManager::updateShadowTree (RN >= 0.81), bypassing React entirely.
|
|
23
|
+
*
|
|
24
|
+
* The engine knows nothing about themes, media queries, or Tamagui: those
|
|
25
|
+
* semantics live in JS. Future dependency kinds (media, press, group,
|
|
26
|
+
* container) add a state table and an invalidation rule and reuse the same
|
|
27
|
+
* commit path.
|
|
28
|
+
*
|
|
29
|
+
* Contracts:
|
|
30
|
+
* - Every entry point runs on the JS thread. Single-threaded by design, no
|
|
31
|
+
* locks. A future cross-thread producer must queue onto the JS thread at
|
|
32
|
+
* its own boundary.
|
|
33
|
+
* - Views are keyed by engine-issued id and store the Fabric Tag, never a
|
|
34
|
+
* ShadowNodeFamily pointer. updateShadowTree ignores tags no longer in the
|
|
35
|
+
* tree, so a missed unlink degrades to a dead map entry, not UB.
|
|
36
|
+
* - State-name lookups are exact. A miss bumps missCount_ and skips the
|
|
37
|
+
* view; emitting exhaustive keys is the JS/compiler side's job.
|
|
38
|
+
*/
|
|
39
|
+
class HybridTamaguiRegistry : public HybridTamaguiRegistrySpec {
|
|
40
|
+
public:
|
|
41
|
+
using LeafUpdates =
|
|
42
|
+
std::unordered_map<const facebook::react::ShadowNodeFamily*,
|
|
43
|
+
folly::dynamic>;
|
|
44
|
+
|
|
45
|
+
HybridTamaguiRegistry() : HybridObject(TAG) {}
|
|
46
|
+
|
|
47
|
+
void loadHybridMethods() override;
|
|
48
|
+
|
|
49
|
+
// typed spec methods
|
|
50
|
+
void setStateName(const std::string& scopeId, const std::string& stateName) override;
|
|
51
|
+
std::string getStateName(const std::string& scopeId) override;
|
|
52
|
+
void removeScope(const std::string& scopeId) override;
|
|
53
|
+
void unlink(double id) override;
|
|
54
|
+
double getViewCount() override;
|
|
55
|
+
double getCommitCount() override;
|
|
56
|
+
double getMissCount() override;
|
|
57
|
+
|
|
58
|
+
private:
|
|
59
|
+
struct LinkedView {
|
|
60
|
+
// retained so the family stays valid for in-transaction ancestor lookup;
|
|
61
|
+
// unmounted views resolve to no ancestors and are skipped
|
|
62
|
+
std::shared_ptr<const facebook::react::ShadowNode> node;
|
|
63
|
+
std::string scopeId;
|
|
64
|
+
folly::dynamic baseProps; // object, or nullptr when absent
|
|
65
|
+
folly::dynamic stateProps; // stateName -> props object, or nullptr
|
|
66
|
+
// per-view active state (runtime mode). empty = follow scope state.
|
|
67
|
+
// runtime integrations resolve state names per view (nested themes);
|
|
68
|
+
// scope broadcast stays for compiler-emitted tables.
|
|
69
|
+
std::string activeState;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// raw JSI: link(shadowNode, slots, scopeId) -> id
|
|
73
|
+
jsi::Value link(jsi::Runtime& rt, const jsi::Value& thisValue,
|
|
74
|
+
const jsi::Value* args, size_t count);
|
|
75
|
+
|
|
76
|
+
// raw JSI: applyViewStates([{id, state, props?}]) -> void
|
|
77
|
+
// batched per-view state selection: for each entry, `props` (when given)
|
|
78
|
+
// replaces the view's state table entry under `state`, the view's active
|
|
79
|
+
// state becomes `state`, and all changed views commit in ONE transaction.
|
|
80
|
+
jsi::Value applyViewStates(jsi::Runtime& rt, const jsi::Value& thisValue,
|
|
81
|
+
const jsi::Value* args, size_t count);
|
|
82
|
+
|
|
83
|
+
// raw JSI: updateViewStateTables([{id, state, props}]) -> void
|
|
84
|
+
// compiler mappings resolve a state once in JS, then fill every matching
|
|
85
|
+
// linked view without moving it off scope-broadcast control.
|
|
86
|
+
jsi::Value updateViewStateTables(jsi::Runtime& rt,
|
|
87
|
+
const jsi::Value& thisValue,
|
|
88
|
+
const jsi::Value* args, size_t count);
|
|
89
|
+
|
|
90
|
+
// raw JSI: getViewState(id) -> {scopeId, activeState, base, states} | null
|
|
91
|
+
// debug/test introspection of a linked view's tables; not a hot path
|
|
92
|
+
jsi::Value getViewState(jsi::Runtime& rt, const jsi::Value& thisValue,
|
|
93
|
+
const jsi::Value* args, size_t count);
|
|
94
|
+
|
|
95
|
+
// resolve the active state name for a scope: scope entry, else root
|
|
96
|
+
const std::string* activeStateName(const std::string& scopeId) const;
|
|
97
|
+
|
|
98
|
+
// merge base + named state props for one view into `out` (with native-props
|
|
99
|
+
// sync); returns false on a state miss
|
|
100
|
+
bool buildViewUpdate(LinkedView& view, const std::string& stateName,
|
|
101
|
+
LeafUpdates& out);
|
|
102
|
+
|
|
103
|
+
// one race-safe in-transaction commit for all built updates
|
|
104
|
+
void commitUpdates(jsi::Runtime& rt, LeafUpdates& updates);
|
|
105
|
+
|
|
106
|
+
// commit current props for all views (scopeFilter == nullptr) or one scope
|
|
107
|
+
void applyUpdates(jsi::Runtime& rt, const std::string* scopeFilter);
|
|
108
|
+
|
|
109
|
+
std::unordered_map<double, LinkedView> views_;
|
|
110
|
+
std::unordered_map<std::string, std::string> scopeStates_; // "" = root
|
|
111
|
+
double nextId_ = 1;
|
|
112
|
+
double commitCount_ = 0;
|
|
113
|
+
double missCount_ = 0;
|
|
114
|
+
jsi::Runtime* runtime_ = nullptr;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
} // namespace margelo::nitro::tamagui::registry
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
|
+
ROOT_SCOPE: () => import_mirror2.ROOT_SCOPE,
|
|
25
|
+
applyViewStates: () => applyViewStates,
|
|
26
|
+
getMirroredStateName: () => import_mirror2.getMirroredStateName,
|
|
27
|
+
getStats: () => getStats,
|
|
28
|
+
getViewState: () => getViewState,
|
|
29
|
+
isAvailable: () => isAvailable,
|
|
30
|
+
link: () => link,
|
|
31
|
+
processStyleColors: () => processStyleColors,
|
|
32
|
+
removeScope: () => removeScope,
|
|
33
|
+
resolveSlots: () => resolveSlots,
|
|
34
|
+
setStateName: () => setStateName,
|
|
35
|
+
updateViewStateTables: () => updateViewStateTables
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(index_exports);
|
|
38
|
+
var import_mirror = require("./mirror.cjs");
|
|
39
|
+
var import_mirror2 = require("./mirror.cjs");
|
|
40
|
+
function isAvailable() {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
function link(_ref, _slots, _scopeId) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
function applyViewStates(_entries) {}
|
|
47
|
+
function updateViewStateTables(_entries) {}
|
|
48
|
+
function getViewState(_id) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
function setStateName(stateName, scopeId = import_mirror.ROOT_SCOPE) {
|
|
52
|
+
(0, import_mirror.setMirroredStateName)(scopeId, stateName);
|
|
53
|
+
}
|
|
54
|
+
function removeScope(scopeId) {
|
|
55
|
+
(0, import_mirror.removeMirroredScope)(scopeId);
|
|
56
|
+
}
|
|
57
|
+
function resolveSlots(slots, scopeId = import_mirror.ROOT_SCOPE) {
|
|
58
|
+
const name = (0, import_mirror.getMirroredStateName)(scopeId);
|
|
59
|
+
return {
|
|
60
|
+
...slots.base,
|
|
61
|
+
...name ? slots.state?.[name] : void 0
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function getStats() {
|
|
65
|
+
return {
|
|
66
|
+
viewCount: 0,
|
|
67
|
+
commitCount: 0,
|
|
68
|
+
missCount: 0
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function processStyleColors(props) {
|
|
72
|
+
return props;
|
|
73
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var index_native_exports = {};
|
|
25
|
+
__export(index_native_exports, {
|
|
26
|
+
ROOT_SCOPE: () => import_mirror2.ROOT_SCOPE,
|
|
27
|
+
applyViewStates: () => applyViewStates,
|
|
28
|
+
getMirroredStateName: () => import_mirror2.getMirroredStateName,
|
|
29
|
+
getStats: () => getStats,
|
|
30
|
+
getViewState: () => getViewState,
|
|
31
|
+
isAvailable: () => isAvailable,
|
|
32
|
+
link: () => link,
|
|
33
|
+
processStyleColors: () => import_processStyleColors2.processStyleColors,
|
|
34
|
+
removeScope: () => removeScope,
|
|
35
|
+
resolveSlots: () => resolveSlots,
|
|
36
|
+
setStateName: () => setStateName,
|
|
37
|
+
updateViewStateTables: () => updateViewStateTables
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(index_native_exports);
|
|
40
|
+
var import_react_native_nitro_modules = require("react-native-nitro-modules");
|
|
41
|
+
var import_mirror = require("./mirror.native.js");
|
|
42
|
+
var import_processStyleColors = require("./processStyleColors.native.js");
|
|
43
|
+
var import_mirror2 = require("./mirror.native.js");
|
|
44
|
+
var import_processStyleColors2 = require("./processStyleColors.native.js");
|
|
45
|
+
function _instanceof(left, right) {
|
|
46
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
47
|
+
return !!right[Symbol.hasInstance](left);
|
|
48
|
+
} else {
|
|
49
|
+
return left instanceof right;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
var engine = null;
|
|
53
|
+
var initError = null;
|
|
54
|
+
try {
|
|
55
|
+
engine = import_react_native_nitro_modules.NitroModules.createHybridObject("TamaguiRegistry");
|
|
56
|
+
} catch (error) {
|
|
57
|
+
initError = error;
|
|
58
|
+
}
|
|
59
|
+
function isAvailable() {
|
|
60
|
+
return engine !== null;
|
|
61
|
+
}
|
|
62
|
+
function getEngine() {
|
|
63
|
+
if (engine) return engine;
|
|
64
|
+
var detail = _instanceof(initError, Error) ? ` ${initError.message}` : "";
|
|
65
|
+
throw new Error(`[@tamagui/native-registry] TamaguiRegistry failed to initialize; is react-native-nitro-modules installed and the app rebuilt?${detail}`);
|
|
66
|
+
}
|
|
67
|
+
function getShadowNode(ref) {
|
|
68
|
+
var _handle_stateNode;
|
|
69
|
+
var handle = ref === null || ref === void 0 ? void 0 : ref.__internalInstanceHandle;
|
|
70
|
+
var _handle_stateNode_node;
|
|
71
|
+
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;
|
|
72
|
+
}
|
|
73
|
+
function link(ref, slots) {
|
|
74
|
+
var scopeId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_mirror.ROOT_SCOPE;
|
|
75
|
+
var node = getShadowNode(ref);
|
|
76
|
+
if (!node) return null;
|
|
77
|
+
var e = getEngine();
|
|
78
|
+
var prepared = {};
|
|
79
|
+
if (slots.base) prepared.base = (0, import_processStyleColors.processStyleColors)(slots.base);
|
|
80
|
+
if (slots.state) {
|
|
81
|
+
var state = {};
|
|
82
|
+
for (var name in slots.state) {
|
|
83
|
+
state[name] = (0, import_processStyleColors.processStyleColors)(slots.state[name]);
|
|
84
|
+
}
|
|
85
|
+
prepared.state = state;
|
|
86
|
+
}
|
|
87
|
+
var id = e.link(node, prepared, scopeId);
|
|
88
|
+
var unlinked = false;
|
|
89
|
+
return {
|
|
90
|
+
id,
|
|
91
|
+
unlink: function() {
|
|
92
|
+
if (unlinked) return;
|
|
93
|
+
unlinked = true;
|
|
94
|
+
e.unlink(id);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function applyViewStates(entries) {
|
|
99
|
+
if (entries.length === 0) return;
|
|
100
|
+
getEngine().applyViewStates(entries);
|
|
101
|
+
}
|
|
102
|
+
function updateViewStateTables(entries) {
|
|
103
|
+
if (entries.length === 0) return;
|
|
104
|
+
getEngine().updateViewStateTables(entries.map(function(entry) {
|
|
105
|
+
return {
|
|
106
|
+
...entry,
|
|
107
|
+
props: (0, import_processStyleColors.processStyleColors)(entry.props)
|
|
108
|
+
};
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
function setStateName(stateName) {
|
|
112
|
+
var scopeId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : import_mirror.ROOT_SCOPE;
|
|
113
|
+
(0, import_mirror.setMirroredStateName)(scopeId, stateName);
|
|
114
|
+
getEngine().setStateName(scopeId, stateName);
|
|
115
|
+
}
|
|
116
|
+
function removeScope(scopeId) {
|
|
117
|
+
(0, import_mirror.removeMirroredScope)(scopeId);
|
|
118
|
+
getEngine().removeScope(scopeId);
|
|
119
|
+
}
|
|
120
|
+
function resolveSlots(slots) {
|
|
121
|
+
var scopeId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : import_mirror.ROOT_SCOPE;
|
|
122
|
+
var _slots_state;
|
|
123
|
+
var name = (0, import_mirror.getMirroredStateName)(scopeId);
|
|
124
|
+
return {
|
|
125
|
+
...slots.base,
|
|
126
|
+
...name ? (_slots_state = slots.state) === null || _slots_state === void 0 ? void 0 : _slots_state[name] : void 0
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function getViewState(id) {
|
|
130
|
+
if (!engine) return null;
|
|
131
|
+
return engine.getViewState(id);
|
|
132
|
+
}
|
|
133
|
+
function getStats() {
|
|
134
|
+
if (!engine) return {
|
|
135
|
+
viewCount: 0,
|
|
136
|
+
commitCount: 0,
|
|
137
|
+
missCount: 0
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
viewCount: engine.getViewCount(),
|
|
141
|
+
commitCount: engine.getCommitCount(),
|
|
142
|
+
missCount: engine.getMissCount()
|
|
143
|
+
};
|
|
144
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var index_native_exports = {};
|
|
25
|
+
__export(index_native_exports, {
|
|
26
|
+
ROOT_SCOPE: () => import_mirror2.ROOT_SCOPE,
|
|
27
|
+
applyViewStates: () => applyViewStates,
|
|
28
|
+
getMirroredStateName: () => import_mirror2.getMirroredStateName,
|
|
29
|
+
getStats: () => getStats,
|
|
30
|
+
getViewState: () => getViewState,
|
|
31
|
+
isAvailable: () => isAvailable,
|
|
32
|
+
link: () => link,
|
|
33
|
+
processStyleColors: () => import_processStyleColors2.processStyleColors,
|
|
34
|
+
removeScope: () => removeScope,
|
|
35
|
+
resolveSlots: () => resolveSlots,
|
|
36
|
+
setStateName: () => setStateName,
|
|
37
|
+
updateViewStateTables: () => updateViewStateTables
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(index_native_exports);
|
|
40
|
+
var import_react_native_nitro_modules = require("react-native-nitro-modules");
|
|
41
|
+
var import_mirror = require("./mirror.native.js");
|
|
42
|
+
var import_processStyleColors = require("./processStyleColors.native.js");
|
|
43
|
+
var import_mirror2 = require("./mirror.native.js");
|
|
44
|
+
var import_processStyleColors2 = require("./processStyleColors.native.js");
|
|
45
|
+
function _instanceof(left, right) {
|
|
46
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
47
|
+
return !!right[Symbol.hasInstance](left);
|
|
48
|
+
} else {
|
|
49
|
+
return left instanceof right;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
var engine = null;
|
|
53
|
+
var initError = null;
|
|
54
|
+
try {
|
|
55
|
+
engine = import_react_native_nitro_modules.NitroModules.createHybridObject("TamaguiRegistry");
|
|
56
|
+
} catch (error) {
|
|
57
|
+
initError = error;
|
|
58
|
+
}
|
|
59
|
+
function isAvailable() {
|
|
60
|
+
return engine !== null;
|
|
61
|
+
}
|
|
62
|
+
function getEngine() {
|
|
63
|
+
if (engine) return engine;
|
|
64
|
+
var detail = _instanceof(initError, Error) ? ` ${initError.message}` : "";
|
|
65
|
+
throw new Error(`[@tamagui/native-registry] TamaguiRegistry failed to initialize; is react-native-nitro-modules installed and the app rebuilt?${detail}`);
|
|
66
|
+
}
|
|
67
|
+
function getShadowNode(ref) {
|
|
68
|
+
var _handle_stateNode;
|
|
69
|
+
var handle = ref === null || ref === void 0 ? void 0 : ref.__internalInstanceHandle;
|
|
70
|
+
var _handle_stateNode_node;
|
|
71
|
+
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;
|
|
72
|
+
}
|
|
73
|
+
function link(ref, slots) {
|
|
74
|
+
var scopeId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_mirror.ROOT_SCOPE;
|
|
75
|
+
var node = getShadowNode(ref);
|
|
76
|
+
if (!node) return null;
|
|
77
|
+
var e = getEngine();
|
|
78
|
+
var prepared = {};
|
|
79
|
+
if (slots.base) prepared.base = (0, import_processStyleColors.processStyleColors)(slots.base);
|
|
80
|
+
if (slots.state) {
|
|
81
|
+
var state = {};
|
|
82
|
+
for (var name in slots.state) {
|
|
83
|
+
state[name] = (0, import_processStyleColors.processStyleColors)(slots.state[name]);
|
|
84
|
+
}
|
|
85
|
+
prepared.state = state;
|
|
86
|
+
}
|
|
87
|
+
var id = e.link(node, prepared, scopeId);
|
|
88
|
+
var unlinked = false;
|
|
89
|
+
return {
|
|
90
|
+
id,
|
|
91
|
+
unlink: function() {
|
|
92
|
+
if (unlinked) return;
|
|
93
|
+
unlinked = true;
|
|
94
|
+
e.unlink(id);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function applyViewStates(entries) {
|
|
99
|
+
if (entries.length === 0) return;
|
|
100
|
+
getEngine().applyViewStates(entries);
|
|
101
|
+
}
|
|
102
|
+
function updateViewStateTables(entries) {
|
|
103
|
+
if (entries.length === 0) return;
|
|
104
|
+
getEngine().updateViewStateTables(entries.map(function(entry) {
|
|
105
|
+
return {
|
|
106
|
+
...entry,
|
|
107
|
+
props: (0, import_processStyleColors.processStyleColors)(entry.props)
|
|
108
|
+
};
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
function setStateName(stateName) {
|
|
112
|
+
var scopeId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : import_mirror.ROOT_SCOPE;
|
|
113
|
+
(0, import_mirror.setMirroredStateName)(scopeId, stateName);
|
|
114
|
+
getEngine().setStateName(scopeId, stateName);
|
|
115
|
+
}
|
|
116
|
+
function removeScope(scopeId) {
|
|
117
|
+
(0, import_mirror.removeMirroredScope)(scopeId);
|
|
118
|
+
getEngine().removeScope(scopeId);
|
|
119
|
+
}
|
|
120
|
+
function resolveSlots(slots) {
|
|
121
|
+
var scopeId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : import_mirror.ROOT_SCOPE;
|
|
122
|
+
var _slots_state;
|
|
123
|
+
var name = (0, import_mirror.getMirroredStateName)(scopeId);
|
|
124
|
+
return {
|
|
125
|
+
...slots.base,
|
|
126
|
+
...name ? (_slots_state = slots.state) === null || _slots_state === void 0 ? void 0 : _slots_state[name] : void 0
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function getViewState(id) {
|
|
130
|
+
if (!engine) return null;
|
|
131
|
+
return engine.getViewState(id);
|
|
132
|
+
}
|
|
133
|
+
function getStats() {
|
|
134
|
+
if (!engine) return {
|
|
135
|
+
viewCount: 0,
|
|
136
|
+
commitCount: 0,
|
|
137
|
+
missCount: 0
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
viewCount: engine.getViewCount(),
|
|
141
|
+
commitCount: engine.getCommitCount(),
|
|
142
|
+
missCount: engine.getMissCount()
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +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_processStyleColors2.processStyleColors,\n removeScope: () => removeScope,\n resolveSlots: () => resolveSlots,\n setStateName: () => setStateName,\n updateViewStateTables: () => updateViewStateTables\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_processStyleColors = require(\"./processStyleColors\");\nvar import_mirror2 = require(\"./mirror\");\nvar import_processStyleColors2 = require(\"./processStyleColors\");\nfunction _instanceof(left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n}\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 = _instanceof(initError, 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 link(ref, slots) {\n var scopeId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_mirror.ROOT_SCOPE;\n var node = getShadowNode(ref);\n if (!node) return null;\n var e = getEngine();\n var prepared = {};\n if (slots.base) prepared.base = (0, import_processStyleColors.processStyleColors)(slots.base);\n if (slots.state) {\n var state = {};\n for (var name in slots.state) {\n state[name] = (0, import_processStyleColors.processStyleColors)(slots.state[name]);\n }\n prepared.state = state;\n }\n var id = e.link(node, prepared, scopeId);\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 applyViewStates(entries) {\n if (entries.length === 0) return;\n getEngine().applyViewStates(entries);\n}\nfunction updateViewStateTables(entries) {\n if (entries.length === 0) return;\n getEngine().updateViewStateTables(entries.map(function(entry) {\n return {\n ...entry,\n props: (0, import_processStyleColors.processStyleColors)(entry.props)\n };\n }));\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,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,uBAAuB,CAAC;AAC5B,SAAS,sBAAsB;CAC7B,kBAAkB,eAAe;CACjC,uBAAuB;CACvB,4BAA4B,eAAe;CAC3C,gBAAgB;CAChB,oBAAoB;CACpB,mBAAmB;CACnB,YAAY;CACZ,0BAA0B,2BAA2B;CACrD,mBAAmB;CACnB,oBAAoB;CACpB,oBAAoB;CACpB,6BAA6B;AAC/B,CAAC;AACD,OAAO,UAA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AiB,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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
var mirror_exports = {};
|
|
23
|
+
__export(mirror_exports, {
|
|
24
|
+
ROOT_SCOPE: () => ROOT_SCOPE,
|
|
25
|
+
getMirroredStateName: () => getMirroredStateName,
|
|
26
|
+
removeMirroredScope: () => removeMirroredScope,
|
|
27
|
+
resetMirror: () => resetMirror,
|
|
28
|
+
setMirroredStateName: () => setMirroredStateName
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(mirror_exports);
|
|
31
|
+
const scopeStates = /* @__PURE__ */ new Map();
|
|
32
|
+
const ROOT_SCOPE = "";
|
|
33
|
+
function getMirroredStateName(scopeId = ROOT_SCOPE) {
|
|
34
|
+
return scopeStates.get(scopeId) ?? (scopeId === ROOT_SCOPE ? void 0 : scopeStates.get(ROOT_SCOPE));
|
|
35
|
+
}
|
|
36
|
+
function setMirroredStateName(scopeId, stateName) {
|
|
37
|
+
scopeStates.set(scopeId, stateName);
|
|
38
|
+
}
|
|
39
|
+
function removeMirroredScope(scopeId) {
|
|
40
|
+
scopeStates.delete(scopeId);
|
|
41
|
+
}
|
|
42
|
+
function resetMirror() {
|
|
43
|
+
scopeStates.clear();
|
|
44
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var mirror_exports = {};
|
|
25
|
+
__export(mirror_exports, {
|
|
26
|
+
ROOT_SCOPE: () => ROOT_SCOPE,
|
|
27
|
+
getMirroredStateName: () => getMirroredStateName,
|
|
28
|
+
removeMirroredScope: () => removeMirroredScope,
|
|
29
|
+
resetMirror: () => resetMirror,
|
|
30
|
+
setMirroredStateName: () => setMirroredStateName
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(mirror_exports);
|
|
33
|
+
var scopeStates = /* @__PURE__ */ new Map();
|
|
34
|
+
var ROOT_SCOPE = "";
|
|
35
|
+
function getMirroredStateName() {
|
|
36
|
+
var scopeId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ROOT_SCOPE;
|
|
37
|
+
var _scopeStates_get;
|
|
38
|
+
return (_scopeStates_get = scopeStates.get(scopeId)) !== null && _scopeStates_get !== void 0 ? _scopeStates_get : scopeId === ROOT_SCOPE ? void 0 : scopeStates.get(ROOT_SCOPE);
|
|
39
|
+
}
|
|
40
|
+
function setMirroredStateName(scopeId, stateName) {
|
|
41
|
+
scopeStates.set(scopeId, stateName);
|
|
42
|
+
}
|
|
43
|
+
function removeMirroredScope(scopeId) {
|
|
44
|
+
scopeStates.delete(scopeId);
|
|
45
|
+
}
|
|
46
|
+
function resetMirror() {
|
|
47
|
+
scopeStates.clear();
|
|
48
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var mirror_exports = {};
|
|
25
|
+
__export(mirror_exports, {
|
|
26
|
+
ROOT_SCOPE: () => ROOT_SCOPE,
|
|
27
|
+
getMirroredStateName: () => getMirroredStateName,
|
|
28
|
+
removeMirroredScope: () => removeMirroredScope,
|
|
29
|
+
resetMirror: () => resetMirror,
|
|
30
|
+
setMirroredStateName: () => setMirroredStateName
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(mirror_exports);
|
|
33
|
+
var scopeStates = /* @__PURE__ */ new Map();
|
|
34
|
+
var ROOT_SCOPE = "";
|
|
35
|
+
function getMirroredStateName() {
|
|
36
|
+
var scopeId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ROOT_SCOPE;
|
|
37
|
+
var _scopeStates_get;
|
|
38
|
+
return (_scopeStates_get = scopeStates.get(scopeId)) !== null && _scopeStates_get !== void 0 ? _scopeStates_get : scopeId === ROOT_SCOPE ? void 0 : scopeStates.get(ROOT_SCOPE);
|
|
39
|
+
}
|
|
40
|
+
function setMirroredStateName(scopeId, stateName) {
|
|
41
|
+
scopeStates.set(scopeId, stateName);
|
|
42
|
+
}
|
|
43
|
+
function removeMirroredScope(scopeId) {
|
|
44
|
+
scopeStates.delete(scopeId);
|
|
45
|
+
}
|
|
46
|
+
function resetMirror() {
|
|
47
|
+
scopeStates.clear();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=mirror.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mirror.native.js","names":[],"sources":["cjs/mirror.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 mirror_exports = {};\n__export(mirror_exports, {\n ROOT_SCOPE: () => ROOT_SCOPE,\n getMirroredStateName: () => getMirroredStateName,\n removeMirroredScope: () => removeMirroredScope,\n resetMirror: () => resetMirror,\n setMirroredStateName: () => setMirroredStateName\n});\nmodule.exports = __toCommonJS(mirror_exports);\nvar scopeStates = /* @__PURE__ */ new Map();\nvar ROOT_SCOPE = \"\";\nfunction getMirroredStateName() {\n var scopeId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ROOT_SCOPE;\n var _scopeStates_get;\n return (_scopeStates_get = scopeStates.get(scopeId)) !== null && _scopeStates_get !== void 0 ? _scopeStates_get : scopeId === ROOT_SCOPE ? void 0 : scopeStates.get(ROOT_SCOPE);\n}\nfunction setMirroredStateName(scopeId, stateName) {\n scopeStates.set(scopeId, stateName);\n}\nfunction removeMirroredScope(scopeId) {\n scopeStates.delete(scopeId);\n}\nfunction resetMirror() {\n scopeStates.clear();\n}\n//# sourceMappingURL=mirror.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI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