tamagui 1.125.9 → 1.125.10
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/dist/native.js +22 -43
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +19 -21
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
package/dist/test.native.js
CHANGED
|
@@ -6819,15 +6819,12 @@ var require_useThemeState_native = __commonJS({
|
|
|
6819
6819
|
hasThemeUpdatingProps: function() {
|
|
6820
6820
|
return hasThemeUpdatingProps;
|
|
6821
6821
|
},
|
|
6822
|
-
keysToId: function() {
|
|
6823
|
-
return keysToId;
|
|
6824
|
-
},
|
|
6825
6822
|
useThemeState: function() {
|
|
6826
6823
|
return useThemeState;
|
|
6827
6824
|
}
|
|
6828
6825
|
});
|
|
6829
6826
|
module2.exports = __toCommonJS2(useThemeState_exports);
|
|
6830
|
-
var import_constants4 = require_index_native6(), import_react3 = require("react"), import_config = require_config_native(), ThemeStateContext = (0, import_react3.createContext)(""),
|
|
6827
|
+
var import_constants4 = require_index_native6(), import_react3 = require("react"), import_config = require_config_native(), ThemeStateContext = (0, import_react3.createContext)(""), allListeners = /* @__PURE__ */ new Map(), listenersByParent = {}, HasRenderedOnce = /* @__PURE__ */ new WeakMap(), HadTheme = /* @__PURE__ */ new WeakMap(), PendingUpdate = /* @__PURE__ */ new Map(), states = /* @__PURE__ */ new Map(), localStates = /* @__PURE__ */ new Map(), shouldForce = !1, forceUpdateThemes2 = function() {
|
|
6831
6828
|
cacheVersion++, shouldForce = !0, allListeners.forEach(function(cb) {
|
|
6832
6829
|
return cb();
|
|
6833
6830
|
});
|
|
@@ -6847,37 +6844,39 @@ var require_useThemeState_native = __commonJS({
|
|
|
6847
6844
|
var id = (0, import_react3.useId)(), subscribe = (0, import_react3.useCallback)(function(cb) {
|
|
6848
6845
|
var _listenersByParent, _parentId;
|
|
6849
6846
|
return (_listenersByParent = listenersByParent)[_parentId = parentId] || (_listenersByParent[_parentId] = /* @__PURE__ */ new Set()), listenersByParent[parentId].add(id), allListeners.set(id, function() {
|
|
6850
|
-
|
|
6847
|
+
PendingUpdate.set(id, shouldForce ? "force" : !0), cb();
|
|
6851
6848
|
}), function() {
|
|
6852
|
-
allListeners.delete(id), listenersByParent[parentId].delete(id), localStates.delete(id), states.delete(id),
|
|
6849
|
+
allListeners.delete(id), listenersByParent[parentId].delete(id), localStates.delete(id), states.delete(id), PendingUpdate.delete(id);
|
|
6853
6850
|
};
|
|
6854
6851
|
}, [
|
|
6855
6852
|
id,
|
|
6856
6853
|
parentId
|
|
6857
6854
|
]), propsKey = getPropsKey(props), getSnapshot = function() {
|
|
6858
|
-
var _keys_current, _props_needsUpdate, local = localStates.get(id), needsUpdate = isRoot || props.name === "light" || props.name === "dark" || props.name === null ? !0 :
|
|
6859
|
-
return
|
|
6855
|
+
var _keys_current, _props_needsUpdate, local = localStates.get(id), needsUpdate = isRoot || props.name === "light" || props.name === "dark" || props.name === null ? !0 : HasRenderedOnce.get(keys) ? !(keys == null || (_keys_current = keys.current) === null || _keys_current === void 0) && _keys_current.size ? !0 : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props) : !0, [rerender, next] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
|
|
6856
|
+
return PendingUpdate.delete(id), (!local || rerender) && (local = {
|
|
6860
6857
|
...next
|
|
6861
6858
|
}, localStates.set(id, local)), Object.assign(local, next), local.id = id, states.set(id, next), local;
|
|
6862
6859
|
}, state = (0, import_react3.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
6863
6860
|
return (0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
6864
|
-
if (!
|
|
6865
|
-
|
|
6861
|
+
if (!HasRenderedOnce.get(keys)) {
|
|
6862
|
+
HasRenderedOnce.set(keys, !0);
|
|
6866
6863
|
return;
|
|
6867
6864
|
}
|
|
6868
|
-
if (propsKey) {
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
scheduleUpdate(id);
|
|
6865
|
+
if (!propsKey) {
|
|
6866
|
+
HadTheme.get(keys) && scheduleUpdate(id), HadTheme.set(keys, !1);
|
|
6867
|
+
return;
|
|
6872
6868
|
}
|
|
6869
|
+
if (0)
|
|
6870
|
+
var _states_get;
|
|
6871
|
+
scheduleUpdate(id), HadTheme.set(keys, !0);
|
|
6873
6872
|
}, [
|
|
6874
6873
|
keys,
|
|
6875
6874
|
propsKey
|
|
6876
6875
|
]), state;
|
|
6877
6876
|
}, getNextState = function(lastState, props, propsKey) {
|
|
6878
|
-
var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0,
|
|
6877
|
+
var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate = arguments.length > 7 ? arguments[7] : void 0, { debug } = props, parentState = states.get(parentId);
|
|
6879
6878
|
themes || (themes = (0, import_config.getConfig)().themes);
|
|
6880
|
-
var name = !propsKey && (!lastState || !(lastState != null && lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props,
|
|
6879
|
+
var name = !propsKey && (!lastState || !(lastState != null && lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props, pendingUpdate === "force" ? !0 : !!needsUpdate), isSameAsParent = parentState && (!name || name === parentState.name), shouldRerender = !!(needsUpdate && (pendingUpdate || (lastState == null ? void 0 : lastState.name) !== (parentState == null ? void 0 : parentState.name)));
|
|
6881
6880
|
if (0)
|
|
6882
6881
|
var message;
|
|
6883
6882
|
if (isSameAsParent) return [
|
|
@@ -6915,11 +6914,11 @@ var require_useThemeState_native = __commonJS({
|
|
|
6915
6914
|
isInverse,
|
|
6916
6915
|
isNew: !0
|
|
6917
6916
|
};
|
|
6918
|
-
if (isRoot && (rootThemeState = nextState),
|
|
6917
|
+
if (isRoot && (rootThemeState = nextState), pendingUpdate !== "force" && lastState && lastState.name === name) return [
|
|
6919
6918
|
!1,
|
|
6920
6919
|
nextState
|
|
6921
6920
|
];
|
|
6922
|
-
var shouldAvoidRerender =
|
|
6921
|
+
var shouldAvoidRerender = pendingUpdate !== "force" && lastState && !needsUpdate && nextState.name === lastState.name;
|
|
6923
6922
|
return shouldAvoidRerender ? [
|
|
6924
6923
|
!1,
|
|
6925
6924
|
nextState
|
|
@@ -7110,7 +7109,7 @@ var require_getThemeProxied_native = __commonJS({
|
|
|
7110
7109
|
}
|
|
7111
7110
|
});
|
|
7112
7111
|
module2.exports = __toCommonJS2(getThemeProxied_exports);
|
|
7113
|
-
var import_constants4 = require_index_native6(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_doesRootSchemeMatchSystem = require_doesRootSchemeMatchSystem_native(),
|
|
7112
|
+
var import_constants4 = require_index_native6(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_doesRootSchemeMatchSystem = require_doesRootSchemeMatchSystem_native(), cache = /* @__PURE__ */ new Map(), curKeys, curProps, curState, emptyObject = {};
|
|
7114
7113
|
function getThemeProxied(_props, _state, _keys) {
|
|
7115
7114
|
if (!(_state != null && _state.theme)) return emptyObject;
|
|
7116
7115
|
if (curKeys = _keys, curProps = _props, curState = _state, cache.has(curState.theme)) {
|
|
@@ -7119,8 +7118,7 @@ var require_getThemeProxied_native = __commonJS({
|
|
|
7119
7118
|
}
|
|
7120
7119
|
var config = (0, import_config.getConfig)();
|
|
7121
7120
|
function track(key) {
|
|
7122
|
-
|
|
7123
|
-
var _globalThis_states, realId;
|
|
7121
|
+
curKeys && (curKeys.current || (curKeys.current = /* @__PURE__ */ new Set()), curKeys.current.add(key));
|
|
7124
7122
|
}
|
|
7125
7123
|
var proxied1 = Object.fromEntries(Object.entries(_state.theme).flatMap(function(param) {
|
|
7126
7124
|
var [key, value] = param, proxied2 = {
|