tamagui 1.125.9 → 1.125.11
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 +41 -56
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +38 -34
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
package/dist/test.native.js
CHANGED
|
@@ -6660,7 +6660,8 @@ var require_createShallowSetState_native = __commonJS({
|
|
|
6660
6660
|
var import_react3 = require("react"), callImmediate = function(cb) {
|
|
6661
6661
|
return cb();
|
|
6662
6662
|
};
|
|
6663
|
-
function createShallowSetState(setter, onlyAllow, transition,
|
|
6663
|
+
function createShallowSetState(setter, onlyAllow, transition, debugIn, callback) {
|
|
6664
|
+
var debug = !0;
|
|
6664
6665
|
return (0, import_react3.useCallback)(function(next) {
|
|
6665
6666
|
var wrap = transition ? import_react3.startTransition : callImmediate;
|
|
6666
6667
|
wrap(function() {
|
|
@@ -6673,7 +6674,8 @@ var require_createShallowSetState_native = __commonJS({
|
|
|
6673
6674
|
setter,
|
|
6674
6675
|
onlyAllow ? onlyAllow.join("") : "",
|
|
6675
6676
|
transition,
|
|
6676
|
-
debug
|
|
6677
|
+
debug,
|
|
6678
|
+
callback
|
|
6677
6679
|
]);
|
|
6678
6680
|
}
|
|
6679
6681
|
function mergeIfNotShallowEqual(prev, next, onlyAllow, debug) {
|
|
@@ -6819,15 +6821,12 @@ var require_useThemeState_native = __commonJS({
|
|
|
6819
6821
|
hasThemeUpdatingProps: function() {
|
|
6820
6822
|
return hasThemeUpdatingProps;
|
|
6821
6823
|
},
|
|
6822
|
-
keysToId: function() {
|
|
6823
|
-
return keysToId;
|
|
6824
|
-
},
|
|
6825
6824
|
useThemeState: function() {
|
|
6826
6825
|
return useThemeState;
|
|
6827
6826
|
}
|
|
6828
6827
|
});
|
|
6829
6828
|
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)(""),
|
|
6829
|
+
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
6830
|
cacheVersion++, shouldForce = !0, allListeners.forEach(function(cb) {
|
|
6832
6831
|
return cb();
|
|
6833
6832
|
});
|
|
@@ -6847,37 +6846,39 @@ var require_useThemeState_native = __commonJS({
|
|
|
6847
6846
|
var id = (0, import_react3.useId)(), subscribe = (0, import_react3.useCallback)(function(cb) {
|
|
6848
6847
|
var _listenersByParent, _parentId;
|
|
6849
6848
|
return (_listenersByParent = listenersByParent)[_parentId = parentId] || (_listenersByParent[_parentId] = /* @__PURE__ */ new Set()), listenersByParent[parentId].add(id), allListeners.set(id, function() {
|
|
6850
|
-
|
|
6849
|
+
PendingUpdate.set(id, shouldForce ? "force" : !0), cb();
|
|
6851
6850
|
}), function() {
|
|
6852
|
-
allListeners.delete(id), listenersByParent[parentId].delete(id), localStates.delete(id), states.delete(id),
|
|
6851
|
+
allListeners.delete(id), listenersByParent[parentId].delete(id), localStates.delete(id), states.delete(id), PendingUpdate.delete(id);
|
|
6853
6852
|
};
|
|
6854
6853
|
}, [
|
|
6855
6854
|
id,
|
|
6856
6855
|
parentId
|
|
6857
6856
|
]), 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
|
|
6857
|
+
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));
|
|
6858
|
+
return PendingUpdate.delete(id), (!local || rerender) && (local = {
|
|
6860
6859
|
...next
|
|
6861
6860
|
}, localStates.set(id, local)), Object.assign(local, next), local.id = id, states.set(id, next), local;
|
|
6862
6861
|
}, state = (0, import_react3.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
|
|
6863
6862
|
return (0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
6864
|
-
if (!
|
|
6865
|
-
|
|
6863
|
+
if (!HasRenderedOnce.get(keys)) {
|
|
6864
|
+
HasRenderedOnce.set(keys, !0);
|
|
6866
6865
|
return;
|
|
6867
6866
|
}
|
|
6868
|
-
if (propsKey) {
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
scheduleUpdate(id);
|
|
6867
|
+
if (!propsKey) {
|
|
6868
|
+
HadTheme.get(keys) && scheduleUpdate(id), HadTheme.set(keys, !1);
|
|
6869
|
+
return;
|
|
6872
6870
|
}
|
|
6871
|
+
if (0)
|
|
6872
|
+
var _states_get;
|
|
6873
|
+
scheduleUpdate(id), HadTheme.set(keys, !0);
|
|
6873
6874
|
}, [
|
|
6874
6875
|
keys,
|
|
6875
6876
|
propsKey
|
|
6876
6877
|
]), state;
|
|
6877
6878
|
}, 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,
|
|
6879
|
+
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
6880
|
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,
|
|
6881
|
+
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
6882
|
if (0)
|
|
6882
6883
|
var message;
|
|
6883
6884
|
if (isSameAsParent) return [
|
|
@@ -6915,11 +6916,11 @@ var require_useThemeState_native = __commonJS({
|
|
|
6915
6916
|
isInverse,
|
|
6916
6917
|
isNew: !0
|
|
6917
6918
|
};
|
|
6918
|
-
if (isRoot && (rootThemeState = nextState),
|
|
6919
|
+
if (isRoot && (rootThemeState = nextState), pendingUpdate !== "force" && lastState && lastState.name === name) return [
|
|
6919
6920
|
!1,
|
|
6920
6921
|
nextState
|
|
6921
6922
|
];
|
|
6922
|
-
var shouldAvoidRerender =
|
|
6923
|
+
var shouldAvoidRerender = pendingUpdate !== "force" && lastState && !needsUpdate && nextState.name === lastState.name;
|
|
6923
6924
|
return shouldAvoidRerender ? [
|
|
6924
6925
|
!1,
|
|
6925
6926
|
nextState
|
|
@@ -7110,7 +7111,7 @@ var require_getThemeProxied_native = __commonJS({
|
|
|
7110
7111
|
}
|
|
7111
7112
|
});
|
|
7112
7113
|
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(),
|
|
7114
|
+
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
7115
|
function getThemeProxied(_props, _state, _keys) {
|
|
7115
7116
|
if (!(_state != null && _state.theme)) return emptyObject;
|
|
7116
7117
|
if (curKeys = _keys, curProps = _props, curState = _state, cache.has(curState.theme)) {
|
|
@@ -7119,8 +7120,7 @@ var require_getThemeProxied_native = __commonJS({
|
|
|
7119
7120
|
}
|
|
7120
7121
|
var config = (0, import_config.getConfig)();
|
|
7121
7122
|
function track(key) {
|
|
7122
|
-
|
|
7123
|
-
var _globalThis_states, realId;
|
|
7123
|
+
curKeys && (curKeys.current || (curKeys.current = /* @__PURE__ */ new Set()), curKeys.current.add(key));
|
|
7124
7124
|
}
|
|
7125
7125
|
var proxied1 = Object.fromEntries(Object.entries(_state.theme).flatMap(function(param) {
|
|
7126
7126
|
var [key, value] = param, proxied2 = {
|
|
@@ -7683,10 +7683,8 @@ var require_useComponentState_native = __commonJS({
|
|
|
7683
7683
|
import_constants4.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
|
|
7684
7684
|
...state
|
|
7685
7685
|
}));
|
|
7686
|
-
var groupName = props.group, setStateWrapper
|
|
7687
|
-
|
|
7688
|
-
var groupContextState = groups.state;
|
|
7689
|
-
setStateWrapper = function(state2) {
|
|
7686
|
+
var groupName = props.group, groupContextState = groups == null ? void 0 : groups.state, setStateWrapper = (0, import_react3.useMemo)(function() {
|
|
7687
|
+
if (groupContextState && groupName) return function(state2) {
|
|
7690
7688
|
curStateRef.group.emit(groupName, {
|
|
7691
7689
|
pseudo: state2
|
|
7692
7690
|
});
|
|
@@ -7696,8 +7694,11 @@ var require_useComponentState_native = __commonJS({
|
|
|
7696
7694
|
};
|
|
7697
7695
|
groupContextState[groupName] = next;
|
|
7698
7696
|
};
|
|
7699
|
-
}
|
|
7700
|
-
|
|
7697
|
+
}, [
|
|
7698
|
+
groupContextState,
|
|
7699
|
+
curStateRef,
|
|
7700
|
+
groupName
|
|
7701
|
+
]), setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
|
|
7701
7702
|
"disabled"
|
|
7702
7703
|
] : void 0, !1, props.debug, setStateWrapper);
|
|
7703
7704
|
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
@@ -9148,6 +9149,7 @@ var require_createTamagui_native = __commonJS({
|
|
|
9148
9149
|
var import_constants4 = require_index_native6(), import_config = require_config_native(), import_createVariables = require_createVariables_native(), import_getThemeCSSRules = require_getThemeCSSRules_native(), import_insertStyleRule = require_insertStyleRule_native(), import_proxyThemeToParents = require_proxyThemeToParents_native(), import_registerCSSVariable = require_registerCSSVariable_native(), import_themes = require_themes_native(), import_useMedia = require_useMedia_native(), import_insertFont = require_insertFont_native(), import_Tamagui = require_Tamagui_native(), createdConfigs = /* @__PURE__ */ new WeakMap();
|
|
9149
9150
|
function createTamagui2(configIn) {
|
|
9150
9151
|
var _configIn_settings;
|
|
9152
|
+
if (globalThis.__tamaguiConfig) return console.warn("Warning: You somehow have duplicate Tamagui dependencies, this can cause issues. Tamagui is working around this by loading a previously loaded config in test mode. "), globalThis.__tamaguiConfig;
|
|
9151
9153
|
if (createdConfigs.has(configIn)) return configIn;
|
|
9152
9154
|
var tokensParsed = {}, tokens = (0, import_createVariables.createVariables)(configIn.tokens || {});
|
|
9153
9155
|
if (configIn.tokens) {
|
|
@@ -9293,7 +9295,7 @@ var require_createTamagui_native = __commonJS({
|
|
|
9293
9295
|
specificTokens,
|
|
9294
9296
|
defaultFontToken
|
|
9295
9297
|
};
|
|
9296
|
-
if ((0, import_config.setConfig)(config), (0, import_useMedia.configureMedia)(config), createdConfigs.set(config, !0), import_config.configListeners.size && (import_config.configListeners.forEach(function(cb) {
|
|
9298
|
+
if ((0, import_config.setConfig)(config), (0, import_useMedia.configureMedia)(config), createdConfigs.set(config, !0), globalThis.__tamaguiConfig = config, import_config.configListeners.size && (import_config.configListeners.forEach(function(cb) {
|
|
9297
9299
|
return cb(config);
|
|
9298
9300
|
}), import_config.configListeners.clear()), !1)
|
|
9299
9301
|
var _process_env_DEBUG;
|
|
@@ -16154,7 +16156,7 @@ var require_Adapt_native = __commonJS({
|
|
|
16154
16156
|
}
|
|
16155
16157
|
});
|
|
16156
16158
|
module2.exports = __toCommonJS2(Adapt_exports);
|
|
16157
|
-
var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_core12 = require_index_native18(), import_helpers = require_index_native7(), import_portal2 = require_index_native28(), import_react3 = __toESM2(require("react")), CurrentAdaptContextScope = /* @__PURE__ */ (0, import_react3.createContext)(""), AdaptContext = (0, import_core12.createStyledContext)({
|
|
16159
|
+
var import_jsx_runtime6 = require("react/jsx-runtime"), import_z_index_stack2 = require_index_native27(), import_constants4 = require_index_native6(), import_core12 = require_index_native18(), import_helpers = require_index_native7(), import_portal2 = require_index_native28(), import_react3 = __toESM2(require("react")), CurrentAdaptContextScope = /* @__PURE__ */ (0, import_react3.createContext)(""), AdaptContext = (0, import_core12.createStyledContext)({
|
|
16158
16160
|
Contents: null,
|
|
16159
16161
|
scopeName: "",
|
|
16160
16162
|
portalName: "",
|
|
@@ -16236,9 +16238,11 @@ var require_Adapt_native = __commonJS({
|
|
|
16236
16238
|
typeof children == "function" && output !== void 0 && (context == null || context.setChildren(output));
|
|
16237
16239
|
}, [
|
|
16238
16240
|
output
|
|
16239
|
-
]), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
16240
|
-
|
|
16241
|
-
|
|
16241
|
+
]), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_z_index_stack2.StackZIndexContext, {
|
|
16242
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CurrentAdaptContextScope.Provider, {
|
|
16243
|
+
value: scopeName,
|
|
16244
|
+
children: enabled ? output : null
|
|
16245
|
+
})
|
|
16242
16246
|
});
|
|
16243
16247
|
}, {
|
|
16244
16248
|
Contents: AdaptContents
|