@tamagui/core 1.125.8 → 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 +7 -7
package/dist/test.native.js
CHANGED
|
@@ -5720,15 +5720,12 @@ var require_useThemeState_native = __commonJS({
|
|
|
5720
5720
|
hasThemeUpdatingProps: function() {
|
|
5721
5721
|
return hasThemeUpdatingProps;
|
|
5722
5722
|
},
|
|
5723
|
-
keysToId: function() {
|
|
5724
|
-
return keysToId;
|
|
5725
|
-
},
|
|
5726
5723
|
useThemeState: function() {
|
|
5727
5724
|
return useThemeState;
|
|
5728
5725
|
}
|
|
5729
5726
|
});
|
|
5730
5727
|
module2.exports = __toCommonJS2(useThemeState_exports);
|
|
5731
|
-
var import_constants2 = require_index_native2(), import_react3 = require("react"), import_config = require_config_native(), ThemeStateContext = (0, import_react3.createContext)(""),
|
|
5728
|
+
var import_constants2 = require_index_native2(), 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() {
|
|
5732
5729
|
cacheVersion++, shouldForce = !0, allListeners.forEach(function(cb) {
|
|
5733
5730
|
return cb();
|
|
5734
5731
|
});
|
|
@@ -5748,37 +5745,39 @@ var require_useThemeState_native = __commonJS({
|
|
|
5748
5745
|
var id = (0, import_react3.useId)(), subscribe = (0, import_react3.useCallback)(function(cb) {
|
|
5749
5746
|
var _listenersByParent, _parentId;
|
|
5750
5747
|
return (_listenersByParent = listenersByParent)[_parentId = parentId] || (_listenersByParent[_parentId] = /* @__PURE__ */ new Set()), listenersByParent[parentId].add(id), allListeners.set(id, function() {
|
|
5751
|
-
|
|
5748
|
+
PendingUpdate.set(id, shouldForce ? "force" : !0), cb();
|
|
5752
5749
|
}), function() {
|
|
5753
|
-
allListeners.delete(id), listenersByParent[parentId].delete(id), localStates.delete(id), states.delete(id),
|
|
5750
|
+
allListeners.delete(id), listenersByParent[parentId].delete(id), localStates.delete(id), states.delete(id), PendingUpdate.delete(id);
|
|
5754
5751
|
};
|
|
5755
5752
|
}, [
|
|
5756
5753
|
id,
|
|
5757
5754
|
parentId
|
|
5758
5755
|
]), propsKey = getPropsKey(props), getSnapshot = function() {
|
|
5759
|
-
var _keys_current, _props_needsUpdate, local = localStates.get(id), needsUpdate = isRoot || props.name === "light" || props.name === "dark" || props.name === null ? !0 :
|
|
5760
|
-
return
|
|
5756
|
+
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));
|
|
5757
|
+
return PendingUpdate.delete(id), (!local || rerender) && (local = {
|
|
5761
5758
|
...next
|
|
5762
5759
|
}, localStates.set(id, local)), Object.assign(local, next), local.id = id, states.set(id, next), local;
|
|
5763
5760
|
}, state = (0, import_react3.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
5764
5761
|
return (0, import_constants2.useIsomorphicLayoutEffect)(function() {
|
|
5765
|
-
if (!
|
|
5766
|
-
|
|
5762
|
+
if (!HasRenderedOnce.get(keys)) {
|
|
5763
|
+
HasRenderedOnce.set(keys, !0);
|
|
5767
5764
|
return;
|
|
5768
5765
|
}
|
|
5769
|
-
if (propsKey) {
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
scheduleUpdate(id);
|
|
5766
|
+
if (!propsKey) {
|
|
5767
|
+
HadTheme.get(keys) && scheduleUpdate(id), HadTheme.set(keys, !1);
|
|
5768
|
+
return;
|
|
5773
5769
|
}
|
|
5770
|
+
if (0)
|
|
5771
|
+
var _states_get;
|
|
5772
|
+
scheduleUpdate(id), HadTheme.set(keys, !0);
|
|
5774
5773
|
}, [
|
|
5775
5774
|
keys,
|
|
5776
5775
|
propsKey
|
|
5777
5776
|
]), state;
|
|
5778
5777
|
}, getNextState = function(lastState, props, propsKey) {
|
|
5779
|
-
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,
|
|
5778
|
+
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);
|
|
5780
5779
|
themes || (themes = (0, import_config.getConfig)().themes);
|
|
5781
|
-
var name = !propsKey && (!lastState || !(lastState != null && lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props,
|
|
5780
|
+
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)));
|
|
5782
5781
|
if (0)
|
|
5783
5782
|
var message;
|
|
5784
5783
|
if (isSameAsParent) return [
|
|
@@ -5816,11 +5815,11 @@ var require_useThemeState_native = __commonJS({
|
|
|
5816
5815
|
isInverse,
|
|
5817
5816
|
isNew: !0
|
|
5818
5817
|
};
|
|
5819
|
-
if (isRoot && (rootThemeState = nextState),
|
|
5818
|
+
if (isRoot && (rootThemeState = nextState), pendingUpdate !== "force" && lastState && lastState.name === name) return [
|
|
5820
5819
|
!1,
|
|
5821
5820
|
nextState
|
|
5822
5821
|
];
|
|
5823
|
-
var shouldAvoidRerender =
|
|
5822
|
+
var shouldAvoidRerender = pendingUpdate !== "force" && lastState && !needsUpdate && nextState.name === lastState.name;
|
|
5824
5823
|
return shouldAvoidRerender ? [
|
|
5825
5824
|
!1,
|
|
5826
5825
|
nextState
|
|
@@ -6011,7 +6010,7 @@ var require_getThemeProxied_native = __commonJS({
|
|
|
6011
6010
|
}
|
|
6012
6011
|
});
|
|
6013
6012
|
module2.exports = __toCommonJS2(getThemeProxied_exports);
|
|
6014
|
-
var import_constants2 = require_index_native2(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_doesRootSchemeMatchSystem = require_doesRootSchemeMatchSystem_native(),
|
|
6013
|
+
var import_constants2 = require_index_native2(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_doesRootSchemeMatchSystem = require_doesRootSchemeMatchSystem_native(), cache2 = /* @__PURE__ */ new Map(), curKeys, curProps, curState, emptyObject = {};
|
|
6015
6014
|
function getThemeProxied(_props, _state, _keys) {
|
|
6016
6015
|
if (!(_state != null && _state.theme)) return emptyObject;
|
|
6017
6016
|
if (curKeys = _keys, curProps = _props, curState = _state, cache2.has(curState.theme)) {
|
|
@@ -6020,8 +6019,7 @@ var require_getThemeProxied_native = __commonJS({
|
|
|
6020
6019
|
}
|
|
6021
6020
|
var config = (0, import_config.getConfig)();
|
|
6022
6021
|
function track(key) {
|
|
6023
|
-
|
|
6024
|
-
var _globalThis_states, realId;
|
|
6022
|
+
curKeys && (curKeys.current || (curKeys.current = /* @__PURE__ */ new Set()), curKeys.current.add(key));
|
|
6025
6023
|
}
|
|
6026
6024
|
var proxied1 = Object.fromEntries(Object.entries(_state.theme).flatMap(function(param) {
|
|
6027
6025
|
var [key, value] = param, proxied2 = {
|