@tamagui/core 1.112.0 → 1.112.2
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/cjs/react-native-web/Dimensions.js +79 -0
- package/dist/cjs/react-native-web/Dimensions.js.map +6 -0
- package/dist/cjs/react-native-web/Dimensions.native.js +87 -0
- package/dist/cjs/react-native-web/Dimensions.native.js.map +6 -0
- package/dist/esm/react-native-web/Dimensions.js +63 -0
- package/dist/esm/react-native-web/Dimensions.js.map +6 -0
- package/dist/esm/react-native-web/Dimensions.mjs +61 -0
- package/dist/esm/react-native-web/Dimensions.mjs.map +1 -0
- package/dist/esm/react-native-web/Dimensions.native.js +67 -0
- package/dist/esm/react-native-web/Dimensions.native.js.map +1 -0
- package/dist/native.js +327 -180
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +296 -165
- package/dist/test.native.js.map +3 -3
- package/package.json +8 -8
- package/types/react-native-web/Dimensions.d.ts +22 -0
- package/types/react-native-web/Dimensions.d.ts.map +1 -0
- package/types/react-native-web.d.ts +18 -1
- package/types/react-native-web.d.ts.map +1 -1
- package/src/react-native-web.ts +0 -23
package/dist/native.js
CHANGED
|
@@ -1999,7 +1999,7 @@ var require_config_native = __commonJS({
|
|
|
1999
1999
|
return onConfiguredOnce;
|
|
2000
2000
|
},
|
|
2001
2001
|
setConfig: function() {
|
|
2002
|
-
return
|
|
2002
|
+
return setConfig2;
|
|
2003
2003
|
},
|
|
2004
2004
|
setConfigFont: function() {
|
|
2005
2005
|
return setConfigFont;
|
|
@@ -2036,7 +2036,7 @@ Haven't called createTamagui yet.
|
|
|
2036
2036
|
// @ts-expect-error
|
|
2037
2037
|
conf[key]
|
|
2038
2038
|
);
|
|
2039
|
-
},
|
|
2039
|
+
}, setConfig2 = function(next) {
|
|
2040
2040
|
conf = next;
|
|
2041
2041
|
}, setConfigFont = function(name, font, fontParsed) {
|
|
2042
2042
|
if (process.env.NODE_ENV === "development" && !conf) throw new Error(haventCalledErrorMessage);
|
|
@@ -2331,29 +2331,25 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2331
2331
|
function scanAllSheets() {
|
|
2332
2332
|
var collectThemes = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, tokens = arguments.length > 1 ? arguments[1] : void 0;
|
|
2333
2333
|
if (process.env.NODE_ENV !== "test" && import_constants.isClient) {
|
|
2334
|
-
var themes, sheets = document.styleSheets || [], prev = lastScannedSheets, current = new Set(sheets);
|
|
2335
|
-
|
|
2336
|
-
var
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
var
|
|
2340
|
-
|
|
2341
|
-
var out = updateSheetStyles(sheet2, !1, collectThemes, tokens);
|
|
2342
|
-
out && (themes = out);
|
|
2343
|
-
}
|
|
2334
|
+
var themes, sheets = document.styleSheets || [], prev = lastScannedSheets, current = new Set(sheets), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
2335
|
+
try {
|
|
2336
|
+
for (var _iterator = current[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
2337
|
+
var sheet2 = _step.value;
|
|
2338
|
+
if (sheet2) {
|
|
2339
|
+
var out = updateSheetStyles(sheet2, !1, collectThemes, tokens);
|
|
2340
|
+
out && (themes = out);
|
|
2344
2341
|
}
|
|
2345
|
-
}
|
|
2346
|
-
|
|
2342
|
+
}
|
|
2343
|
+
} catch (err) {
|
|
2344
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
2345
|
+
} finally {
|
|
2346
|
+
try {
|
|
2347
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
2347
2348
|
} finally {
|
|
2348
|
-
|
|
2349
|
-
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
2350
|
-
} finally {
|
|
2351
|
-
if (_didIteratorError) throw _iteratorError;
|
|
2352
|
-
}
|
|
2349
|
+
if (_didIteratorError) throw _iteratorError;
|
|
2353
2350
|
}
|
|
2354
|
-
lastScannedSheets = current;
|
|
2355
2351
|
}
|
|
2356
|
-
if (prev) {
|
|
2352
|
+
if (lastScannedSheets = current, prev) {
|
|
2357
2353
|
var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
|
|
2358
2354
|
try {
|
|
2359
2355
|
for (var _iterator1 = prev[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
|
|
@@ -2387,7 +2383,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2387
2383
|
}
|
|
2388
2384
|
var firstSelector = (_getTamaguiSelector = getTamaguiSelector(rules[0], collectThemes)) === null || _getTamaguiSelector === void 0 ? void 0 : _getTamaguiSelector[0], lastSelector = (_getTamaguiSelector1 = getTamaguiSelector(rules[rules.length - 1], collectThemes)) === null || _getTamaguiSelector1 === void 0 ? void 0 : _getTamaguiSelector1[0], cacheKey = `${rules.length}${firstSelector}${lastSelector}`, lastScanned = scannedCache.get(sheet2);
|
|
2389
2385
|
if (!(!remove && lastScanned === cacheKey)) {
|
|
2390
|
-
for (var len = rules.length, fails = 0, dedupedThemes, i = 0; i < len; i++) {
|
|
2386
|
+
for (var len = rules.length, fails = 0, dedupedThemes, nameToTheme = {}, i = 0; i < len; i++) {
|
|
2391
2387
|
var rule = rules[i];
|
|
2392
2388
|
if (rule instanceof CSSStyleRule) {
|
|
2393
2389
|
var response = getTamaguiSelector(rule, collectThemes);
|
|
@@ -2399,7 +2395,26 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2399
2395
|
var [identifier, cssRule, isTheme] = response;
|
|
2400
2396
|
if (isTheme) {
|
|
2401
2397
|
var deduped = addThemesFromCSS(cssRule, tokens);
|
|
2402
|
-
|
|
2398
|
+
if (deduped) {
|
|
2399
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
2400
|
+
try {
|
|
2401
|
+
for (var _loop = function() {
|
|
2402
|
+
var name = _step.value;
|
|
2403
|
+
nameToTheme[name] ? (Object.apply(nameToTheme[name], deduped.theme), deduped.names = deduped.names.filter(function(x) {
|
|
2404
|
+
return x !== name;
|
|
2405
|
+
})) : nameToTheme[name] = deduped.theme;
|
|
2406
|
+
}, _iterator = deduped.names[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
2407
|
+
} catch (err) {
|
|
2408
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
2409
|
+
} finally {
|
|
2410
|
+
try {
|
|
2411
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
2412
|
+
} finally {
|
|
2413
|
+
if (_didIteratorError) throw _iteratorError;
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
dedupedThemes || (dedupedThemes = []), dedupedThemes.push(deduped);
|
|
2417
|
+
}
|
|
2403
2418
|
continue;
|
|
2404
2419
|
}
|
|
2405
2420
|
if (!process.env.TAMAGUI_REACT_19) {
|
|
@@ -6679,6 +6694,55 @@ var require_isActivePlatform_native = __commonJS({
|
|
|
6679
6694
|
}
|
|
6680
6695
|
});
|
|
6681
6696
|
|
|
6697
|
+
// ../web/dist/cjs/helpers/sortString.native.js
|
|
6698
|
+
var require_sortString_native = __commonJS({
|
|
6699
|
+
"../web/dist/cjs/helpers/sortString.native.js"(exports2, module2) {
|
|
6700
|
+
"use strict";
|
|
6701
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
6702
|
+
for (var name in all) __defProp2(target, name, {
|
|
6703
|
+
get: all[name],
|
|
6704
|
+
enumerable: !0
|
|
6705
|
+
});
|
|
6706
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
6707
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
6708
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
6709
|
+
for (var _loop = function() {
|
|
6710
|
+
var key = _step.value;
|
|
6711
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
6712
|
+
get: function() {
|
|
6713
|
+
return from[key];
|
|
6714
|
+
},
|
|
6715
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
6716
|
+
});
|
|
6717
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
6718
|
+
} catch (err) {
|
|
6719
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
6720
|
+
} finally {
|
|
6721
|
+
try {
|
|
6722
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
6723
|
+
} finally {
|
|
6724
|
+
if (_didIteratorError)
|
|
6725
|
+
throw _iteratorError;
|
|
6726
|
+
}
|
|
6727
|
+
}
|
|
6728
|
+
return to;
|
|
6729
|
+
}, __toCommonJS2 = function(mod) {
|
|
6730
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
6731
|
+
value: !0
|
|
6732
|
+
}), mod);
|
|
6733
|
+
}, sortString_exports = {};
|
|
6734
|
+
__export2(sortString_exports, {
|
|
6735
|
+
sortString: function() {
|
|
6736
|
+
return sortString;
|
|
6737
|
+
}
|
|
6738
|
+
});
|
|
6739
|
+
module2.exports = __toCommonJS2(sortString_exports);
|
|
6740
|
+
var sortString = function(a, b) {
|
|
6741
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
6742
|
+
};
|
|
6743
|
+
}
|
|
6744
|
+
});
|
|
6745
|
+
|
|
6682
6746
|
// ../web/dist/cjs/helpers/getSplitStyles.native.js
|
|
6683
6747
|
var require_getSplitStyles_native = __commonJS({
|
|
6684
6748
|
"../web/dist/cjs/helpers/getSplitStyles.native.js"(exports2, module2) {
|
|
@@ -6743,7 +6807,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6743
6807
|
}
|
|
6744
6808
|
});
|
|
6745
6809
|
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
6746
|
-
var import_react3 = __toESM2(require("react")), import_constants = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), import_transformsToString = require_transformsToString_native(), import_isActivePlatform = require_isActivePlatform_native(), consoleGroupCollapsed = import_constants.isWeb ? console.groupCollapsed : console.info, conf, PROP_SPLIT = "-";
|
|
6810
|
+
var import_react3 = __toESM2(require("react")), import_constants = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_getStylesAtomic = require_getStylesAtomic_native(), import_insertStyleRule = require_insertStyleRule_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), import_transformsToString = require_transformsToString_native(), import_isActivePlatform = require_isActivePlatform_native(), import_sortString = require_sortString_native(), consoleGroupCollapsed = import_constants.isWeb ? console.groupCollapsed : console.info, conf, PROP_SPLIT = "-";
|
|
6747
6811
|
function isValidStyleKey(key, staticConfig) {
|
|
6748
6812
|
var _staticConfig_accept, validStyleProps = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
6749
6813
|
return validStyleProps[key] || ((_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key]);
|
|
@@ -7078,7 +7142,7 @@ current`, {
|
|
|
7078
7142
|
var _styleState1;
|
|
7079
7143
|
(_styleState1 = styleState).style || (_styleState1.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
|
|
7080
7144
|
var [a] = param, [b] = param1;
|
|
7081
|
-
return
|
|
7145
|
+
return (0, import_sortString.sortString)(a, b);
|
|
7082
7146
|
}).forEach(function(param) {
|
|
7083
7147
|
var [key5, val3] = param;
|
|
7084
7148
|
mergeTransform(styleState.style, key5, val3, !0);
|
|
@@ -7420,6 +7484,78 @@ var require_setElementProps_native = __commonJS({
|
|
|
7420
7484
|
}
|
|
7421
7485
|
});
|
|
7422
7486
|
|
|
7487
|
+
// ../web/dist/cjs/helpers/subscribeToContextGroup.native.js
|
|
7488
|
+
var require_subscribeToContextGroup_native = __commonJS({
|
|
7489
|
+
"../web/dist/cjs/helpers/subscribeToContextGroup.native.js"(exports2, module2) {
|
|
7490
|
+
"use strict";
|
|
7491
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
7492
|
+
for (var name in all) __defProp2(target, name, {
|
|
7493
|
+
get: all[name],
|
|
7494
|
+
enumerable: !0
|
|
7495
|
+
});
|
|
7496
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
7497
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
7498
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
7499
|
+
for (var _loop = function() {
|
|
7500
|
+
var key = _step.value;
|
|
7501
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
7502
|
+
get: function() {
|
|
7503
|
+
return from[key];
|
|
7504
|
+
},
|
|
7505
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
7506
|
+
});
|
|
7507
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
7508
|
+
} catch (err) {
|
|
7509
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
7510
|
+
} finally {
|
|
7511
|
+
try {
|
|
7512
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
7513
|
+
} finally {
|
|
7514
|
+
if (_didIteratorError)
|
|
7515
|
+
throw _iteratorError;
|
|
7516
|
+
}
|
|
7517
|
+
}
|
|
7518
|
+
return to;
|
|
7519
|
+
}, __toCommonJS2 = function(mod) {
|
|
7520
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
7521
|
+
value: !0
|
|
7522
|
+
}), mod);
|
|
7523
|
+
}, subscribeToContextGroup_exports = {};
|
|
7524
|
+
__export2(subscribeToContextGroup_exports, {
|
|
7525
|
+
subscribeToContextGroup: function() {
|
|
7526
|
+
return subscribeToContextGroup;
|
|
7527
|
+
}
|
|
7528
|
+
});
|
|
7529
|
+
module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
|
|
7530
|
+
var import_createShallowSetState = require_createShallowSetState_native(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(param) {
|
|
7531
|
+
var { disabled = !1, setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
|
|
7532
|
+
if (pseudoGroups || mediaGroups) {
|
|
7533
|
+
var _componentContext_groups_subscribe, _componentContext_groups, current = {
|
|
7534
|
+
pseudo: {},
|
|
7535
|
+
media: {}
|
|
7536
|
+
};
|
|
7537
|
+
return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
|
|
7538
|
+
var { layout, pseudo } = param2;
|
|
7539
|
+
if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
|
|
7540
|
+
else if (layout && mediaGroups) {
|
|
7541
|
+
var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
|
|
7542
|
+
next !== current.media && (Object.assign(current.media, next), persist());
|
|
7543
|
+
}
|
|
7544
|
+
function persist() {
|
|
7545
|
+
var group = {
|
|
7546
|
+
...state.group,
|
|
7547
|
+
[name]: current
|
|
7548
|
+
};
|
|
7549
|
+
setStateShallow({
|
|
7550
|
+
group
|
|
7551
|
+
});
|
|
7552
|
+
}
|
|
7553
|
+
});
|
|
7554
|
+
}
|
|
7555
|
+
};
|
|
7556
|
+
}
|
|
7557
|
+
});
|
|
7558
|
+
|
|
7423
7559
|
// ../web/dist/cjs/views/ThemeDebug.native.js
|
|
7424
7560
|
var require_ThemeDebug_native = __commonJS({
|
|
7425
7561
|
"../web/dist/cjs/views/ThemeDebug.native.js"(exports2, module2) {
|
|
@@ -7557,7 +7693,7 @@ var require_Theme_native = __commonJS({
|
|
|
7557
7693
|
Theme.avoidForwardRef = !0;
|
|
7558
7694
|
function getThemedChildren(themeState, children, props) {
|
|
7559
7695
|
var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, stateRef = arguments.length > 4 ? arguments[4] : void 0, { themeManager, isNewTheme } = themeState;
|
|
7560
|
-
if (!themeManager)
|
|
7696
|
+
if (!themeManager) return children;
|
|
7561
7697
|
var { shallow, forceClassName } = props, shouldRenderChildrenWithTheme = isNewTheme || isRoot || stateRef.current.hasEverThemed || typeof props.inverse == "boolean";
|
|
7562
7698
|
if (shouldRenderChildrenWithTheme && (stateRef.current.hasEverThemed = !0), !shouldRenderChildrenWithTheme) return children;
|
|
7563
7699
|
process.env.NODE_ENV === "development" && shouldRenderChildrenWithTheme && props.debug === "verbose" && (0, import_log.log)(`adding theme: isRoot ${isRoot}, inverse ${"inverse" in props}, isNewTheme ${isNewTheme}, hasEver ${stateRef.current.hasEverThemed}`, props);
|
|
@@ -7764,6 +7900,154 @@ var require_useDidHydrateOnce_native = __commonJS({
|
|
|
7764
7900
|
}
|
|
7765
7901
|
});
|
|
7766
7902
|
|
|
7903
|
+
// ../web/dist/cjs/hooks/useComponentState.native.js
|
|
7904
|
+
var require_useComponentState_native = __commonJS({
|
|
7905
|
+
"../web/dist/cjs/hooks/useComponentState.native.js"(exports2, module2) {
|
|
7906
|
+
"use strict";
|
|
7907
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
7908
|
+
for (var name in all) __defProp2(target, name, {
|
|
7909
|
+
get: all[name],
|
|
7910
|
+
enumerable: !0
|
|
7911
|
+
});
|
|
7912
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
7913
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
7914
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
7915
|
+
for (var _loop = function() {
|
|
7916
|
+
var key = _step.value;
|
|
7917
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
7918
|
+
get: function() {
|
|
7919
|
+
return from[key];
|
|
7920
|
+
},
|
|
7921
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
7922
|
+
});
|
|
7923
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
7924
|
+
} catch (err) {
|
|
7925
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
7926
|
+
} finally {
|
|
7927
|
+
try {
|
|
7928
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
7929
|
+
} finally {
|
|
7930
|
+
if (_didIteratorError)
|
|
7931
|
+
throw _iteratorError;
|
|
7932
|
+
}
|
|
7933
|
+
}
|
|
7934
|
+
return to;
|
|
7935
|
+
}, __toCommonJS2 = function(mod) {
|
|
7936
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
7937
|
+
value: !0
|
|
7938
|
+
}), mod);
|
|
7939
|
+
}, useComponentState_exports = {};
|
|
7940
|
+
__export2(useComponentState_exports, {
|
|
7941
|
+
useComponentState: function() {
|
|
7942
|
+
return useComponentState;
|
|
7943
|
+
}
|
|
7944
|
+
});
|
|
7945
|
+
module2.exports = __toCommonJS2(useComponentState_exports);
|
|
7946
|
+
var import_defaultComponentState = require_defaultComponentState_native(), import_useDidHydrateOnce = require_useDidHydrateOnce_native(), import_react3 = require("react"), import_constants = require_index_native3(), import_createShallowSetState = require_createShallowSetState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
|
|
7947
|
+
var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
7948
|
+
stateRef.current || (stateRef.current = {});
|
|
7949
|
+
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
7950
|
+
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
7951
|
+
return !!(next || curStateRef.hasAnimated);
|
|
7952
|
+
}(), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
7953
|
+
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
7954
|
+
var presence = willBeAnimated && props.animatePresence !== !1 && (animationDriver == null || (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasRNAnimation = hasAnimationProp && (animationDriver == null ? void 0 : animationDriver.isReactNative), hasEnterState = hasEnterStyle || isEntering, didHydrateOnce = willBeAnimated ? (0, import_useDidHydrateOnce.useDidHydrateOnce)() : !0, shouldEnter = hasEnterState || !didHydrateOnce && hasRNAnimation, shouldEnterFromUnhydrated = import_constants.isWeb && !didHydrateOnce, initialState = shouldEnter ? (
|
|
7955
|
+
// on the very first render we switch all spring animation drivers to css rendering
|
|
7956
|
+
// this is because we need to use css variables, which they don't support to do proper SSR
|
|
7957
|
+
// without flickers of the wrong colors.
|
|
7958
|
+
// but once we do that initial hydration and we are in client side rendering mode,
|
|
7959
|
+
// we can avoid the extra re-render on mount
|
|
7960
|
+
shouldEnterFromUnhydrated ? import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateShouldEnter
|
|
7961
|
+
) : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
|
|
7962
|
+
disabled != null && (initialState.disabled = disabled);
|
|
7963
|
+
var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
|
|
7964
|
+
...states[0],
|
|
7965
|
+
[props.forceStyle]: !0
|
|
7966
|
+
} : states[0], setState = states[1], isHydrated = state.unmounted === !1 || state.unmounted === "should-enter", isAnimated = willBeAnimated;
|
|
7967
|
+
import_constants.isWeb && hasRNAnimation && !staticConfig.isHOC && state.unmounted === !0 && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
|
|
7968
|
+
...state
|
|
7969
|
+
}));
|
|
7970
|
+
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
|
|
7971
|
+
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
7972
|
+
process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
|
|
7973
|
+
var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
|
|
7974
|
+
(0, import_isObj.isObj)(custom) && Object.assign(props, custom);
|
|
7975
|
+
var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
|
|
7976
|
+
state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence ENTER "${env}"`), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence EXIT "${exv}"`), props[exv] = exitVariant !== enterExitVariant);
|
|
7977
|
+
}
|
|
7978
|
+
var shouldAvoidClasses = !import_constants.isWeb;
|
|
7979
|
+
if (import_constants.isWeb) {
|
|
7980
|
+
var { disableClassName } = props, isAnimatedAndHydrated = isAnimated && !supportsCSSVars && didHydrateOnce && !import_constants.isServer, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || didHydrateOnce), isDisabledManually = disableClassName && !import_constants.isServer && didHydrateOnce && state.unmounted === !0;
|
|
7981
|
+
(isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0, process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)("avoiding className", {
|
|
7982
|
+
isAnimatedAndHydrated,
|
|
7983
|
+
isDisabledManually,
|
|
7984
|
+
isClassNameDisabled
|
|
7985
|
+
}));
|
|
7986
|
+
}
|
|
7987
|
+
var groupName = props.group;
|
|
7988
|
+
if (groupName && !curStateRef.group) {
|
|
7989
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
7990
|
+
curStateRef.group = {
|
|
7991
|
+
listeners,
|
|
7992
|
+
emit(name, state2) {
|
|
7993
|
+
listeners.forEach(function(l) {
|
|
7994
|
+
return l(name, state2);
|
|
7995
|
+
});
|
|
7996
|
+
},
|
|
7997
|
+
subscribe(cb) {
|
|
7998
|
+
return listeners.add(cb), function() {
|
|
7999
|
+
listeners.delete(cb);
|
|
8000
|
+
};
|
|
8001
|
+
}
|
|
8002
|
+
};
|
|
8003
|
+
}
|
|
8004
|
+
if (groupName) {
|
|
8005
|
+
var groupContextState = groups.state, og = setStateShallow;
|
|
8006
|
+
setStateShallow = function(state2) {
|
|
8007
|
+
og(state2), curStateRef.group.emit(groupName, {
|
|
8008
|
+
pseudo: state2
|
|
8009
|
+
});
|
|
8010
|
+
var next = {
|
|
8011
|
+
...groupContextState[groupName],
|
|
8012
|
+
...state2
|
|
8013
|
+
};
|
|
8014
|
+
groupContextState[groupName] = next;
|
|
8015
|
+
};
|
|
8016
|
+
}
|
|
8017
|
+
return {
|
|
8018
|
+
curStateRef,
|
|
8019
|
+
disabled,
|
|
8020
|
+
groupName,
|
|
8021
|
+
hasAnimationProp,
|
|
8022
|
+
hasEnterStyle,
|
|
8023
|
+
isAnimated,
|
|
8024
|
+
isExiting,
|
|
8025
|
+
isHydrated,
|
|
8026
|
+
presence,
|
|
8027
|
+
presenceState,
|
|
8028
|
+
setState,
|
|
8029
|
+
setStateShallow,
|
|
8030
|
+
shouldAvoidClasses,
|
|
8031
|
+
state,
|
|
8032
|
+
stateRef,
|
|
8033
|
+
supportsCSSVars,
|
|
8034
|
+
willBeAnimated,
|
|
8035
|
+
willBeAnimatedClient
|
|
8036
|
+
};
|
|
8037
|
+
};
|
|
8038
|
+
function hasAnimatedStyleValue(style) {
|
|
8039
|
+
return Object.keys(style).some(function(k) {
|
|
8040
|
+
var val = style[k];
|
|
8041
|
+
return val && typeof val == "object" && "_animation" in val;
|
|
8042
|
+
});
|
|
8043
|
+
}
|
|
8044
|
+
var isDisabled = function(props) {
|
|
8045
|
+
var _props_accessibilityState;
|
|
8046
|
+
return props.disabled || ((_props_accessibilityState = props.accessibilityState) === null || _props_accessibilityState === void 0 ? void 0 : _props_accessibilityState.disabled) || props["aria-disabled"] || props.accessibilityDisabled || !1;
|
|
8047
|
+
};
|
|
8048
|
+
}
|
|
8049
|
+
});
|
|
8050
|
+
|
|
7767
8051
|
// ../web/dist/cjs/setupHooks.native.js
|
|
7768
8052
|
var require_setupHooks_native = __commonJS({
|
|
7769
8053
|
"../web/dist/cjs/setupHooks.native.js"(exports2, module2) {
|
|
@@ -7973,21 +8257,12 @@ var require_createComponent_native = __commonJS({
|
|
|
7973
8257
|
createComponent: function() {
|
|
7974
8258
|
return createComponent;
|
|
7975
8259
|
},
|
|
7976
|
-
isDisabled: function() {
|
|
7977
|
-
return isDisabled;
|
|
7978
|
-
},
|
|
7979
8260
|
spacedChildren: function() {
|
|
7980
8261
|
return spacedChildren;
|
|
7981
|
-
},
|
|
7982
|
-
subscribeToContextGroup: function() {
|
|
7983
|
-
return subscribeToContextGroup;
|
|
7984
|
-
},
|
|
7985
|
-
useComponentState: function() {
|
|
7986
|
-
return useComponentState;
|
|
7987
8262
|
}
|
|
7988
8263
|
});
|
|
7989
8264
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
7990
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
8265
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_compose_refs = require_index_native5(), import_constants = require_index_native3(), import_helpers = require_index_native4(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), tamaguiConfig, time, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
|
|
7991
8266
|
typeof document < "u" && (cancelTouches = function() {
|
|
7992
8267
|
componentSetStates.forEach(function(setState) {
|
|
7993
8268
|
return setState(function(prev) {
|
|
@@ -8024,100 +8299,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8024
8299
|
});
|
|
8025
8300
|
}
|
|
8026
8301
|
}));
|
|
8027
|
-
var cancelTouches,
|
|
8028
|
-
var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = import_react3.default.useRef(void 0);
|
|
8029
|
-
stateRef.current || (stateRef.current = {});
|
|
8030
|
-
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
8031
|
-
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
8032
|
-
return !!(next || curStateRef.hasAnimated);
|
|
8033
|
-
}(), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
8034
|
-
willBeAnimated && !curStateRef.hasAnimated && (curStateRef.hasAnimated = !0);
|
|
8035
|
-
var presence = willBeAnimated && props.animatePresence !== !1 && (animationDriver == null || (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver)) || null, presenceState = presence == null ? void 0 : presence[2], isExiting = (presenceState == null ? void 0 : presenceState.isPresent) === !1, isEntering = (presenceState == null ? void 0 : presenceState.isPresent) === !0 && presenceState.initial !== !1, hasEnterStyle = !!props.enterStyle, hasRNAnimation = hasAnimationProp && (animationDriver == null ? void 0 : animationDriver.isReactNative);
|
|
8036
|
-
process.env.NODE_ENV === "development" && time && time`pre-use-state`;
|
|
8037
|
-
var hasEnterState = hasEnterStyle || isEntering, didHydrateOnce = willBeAnimated ? (0, import_useDidHydrateOnce.useDidHydrateOnce)() : !0, shouldEnter = hasEnterState || !didHydrateOnce && hasRNAnimation, shouldEnterFromUnhydrated = import_constants.isWeb && !didHydrateOnce, initialState = shouldEnter ? (
|
|
8038
|
-
// on the very first render we switch all spring animation drivers to css rendering
|
|
8039
|
-
// this is because we need to use css variables, which they don't support to do proper SSR
|
|
8040
|
-
// without flickers of the wrong colors.
|
|
8041
|
-
// but once we do that initial hydration and we are in client side rendering mode,
|
|
8042
|
-
// we can avoid the extra re-render on mount
|
|
8043
|
-
shouldEnterFromUnhydrated ? import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateShouldEnter
|
|
8044
|
-
) : import_defaultComponentState.defaultComponentStateMounted, disabled = isDisabled(props);
|
|
8045
|
-
disabled != null && (initialState.disabled = disabled);
|
|
8046
|
-
var states = import_react3.default.useState(initialState), state = props.forceStyle ? {
|
|
8047
|
-
...states[0],
|
|
8048
|
-
[props.forceStyle]: !0
|
|
8049
|
-
} : states[0], setState = states[1], isHydrated = state.unmounted === !1 || state.unmounted === "should-enter", isAnimated = willBeAnimated;
|
|
8050
|
-
import_constants.isWeb && hasRNAnimation && !staticConfig.isHOC && state.unmounted === !0 && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
|
|
8051
|
-
...state
|
|
8052
|
-
}));
|
|
8053
|
-
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
|
|
8054
|
-
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
8055
|
-
process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
|
|
8056
|
-
var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
|
|
8057
|
-
(0, import_isObj.isObj)(custom) && Object.assign(props, custom);
|
|
8058
|
-
var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
|
|
8059
|
-
state.unmounted && env && staticConfig.variants[env] ? (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence ENTER "${env}"`), props[env] = !0) : isExiting && exv && (process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`Animating presence EXIT "${exv}"`), props[exv] = exitVariant !== enterExitVariant);
|
|
8060
|
-
}
|
|
8061
|
-
var shouldAvoidClasses = !import_constants.isWeb;
|
|
8062
|
-
if (import_constants.isWeb) {
|
|
8063
|
-
var { disableClassName } = props, isAnimatedAndHydrated = isAnimated && !supportsCSSVars && didHydrateOnce && !import_constants.isServer, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || didHydrateOnce), isDisabledManually = disableClassName && !import_constants.isServer && didHydrateOnce && state.unmounted === !0;
|
|
8064
|
-
(isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0, process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)("avoiding className", {
|
|
8065
|
-
isAnimatedAndHydrated,
|
|
8066
|
-
isDisabledManually,
|
|
8067
|
-
isClassNameDisabled
|
|
8068
|
-
}));
|
|
8069
|
-
}
|
|
8070
|
-
var groupName = props.group;
|
|
8071
|
-
if (groupName && !curStateRef.group) {
|
|
8072
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
8073
|
-
curStateRef.group = {
|
|
8074
|
-
listeners,
|
|
8075
|
-
emit(name, state2) {
|
|
8076
|
-
listeners.forEach(function(l) {
|
|
8077
|
-
return l(name, state2);
|
|
8078
|
-
});
|
|
8079
|
-
},
|
|
8080
|
-
subscribe(cb) {
|
|
8081
|
-
return listeners.add(cb), function() {
|
|
8082
|
-
listeners.delete(cb);
|
|
8083
|
-
};
|
|
8084
|
-
}
|
|
8085
|
-
};
|
|
8086
|
-
}
|
|
8087
|
-
if (groupName) {
|
|
8088
|
-
var groupContextState = groups.state, og = setStateShallow;
|
|
8089
|
-
setStateShallow = function(state2) {
|
|
8090
|
-
og(state2), curStateRef.group.emit(groupName, {
|
|
8091
|
-
pseudo: state2
|
|
8092
|
-
});
|
|
8093
|
-
var next = {
|
|
8094
|
-
...groupContextState[groupName],
|
|
8095
|
-
...state2
|
|
8096
|
-
};
|
|
8097
|
-
groupContextState[groupName] = next;
|
|
8098
|
-
};
|
|
8099
|
-
}
|
|
8100
|
-
return {
|
|
8101
|
-
curStateRef,
|
|
8102
|
-
disabled,
|
|
8103
|
-
groupName,
|
|
8104
|
-
hasAnimationProp,
|
|
8105
|
-
hasEnterStyle,
|
|
8106
|
-
isAnimated,
|
|
8107
|
-
isExiting,
|
|
8108
|
-
isHydrated,
|
|
8109
|
-
presence,
|
|
8110
|
-
presenceState,
|
|
8111
|
-
setState,
|
|
8112
|
-
setStateShallow,
|
|
8113
|
-
shouldAvoidClasses,
|
|
8114
|
-
state,
|
|
8115
|
-
stateRef,
|
|
8116
|
-
supportsCSSVars,
|
|
8117
|
-
willBeAnimated,
|
|
8118
|
-
willBeAnimatedClient
|
|
8119
|
-
};
|
|
8120
|
-
}, BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
|
|
8302
|
+
var cancelTouches, BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
|
|
8121
8303
|
value: !1
|
|
8122
8304
|
};
|
|
8123
8305
|
import_constants.isWeb && globalThis.document && (document.addEventListener("keydown", function() {
|
|
@@ -8138,7 +8320,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8138
8320
|
});
|
|
8139
8321
|
}
|
|
8140
8322
|
});
|
|
8141
|
-
var { Component, isText, isZStack, isHOC
|
|
8323
|
+
var { Component, isText, isZStack, isHOC } = staticConfig;
|
|
8142
8324
|
process.env.NODE_ENV === "development" && !((_staticConfig_defaultProps = staticConfig.defaultProps) === null || _staticConfig_defaultProps === void 0) && _staticConfig_defaultProps.debug && process.env.IS_STATIC !== "is_static" && (0, import_log.log)(`\u{1F41B} [${componentName || "Component"}]`, {
|
|
8143
8325
|
staticConfig,
|
|
8144
8326
|
defaultProps,
|
|
@@ -8191,7 +8373,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8191
8373
|
]), !1)
|
|
8192
8374
|
var timer;
|
|
8193
8375
|
process.env.NODE_ENV === "development" && time && time`start (ignore)`, process.env.NODE_ENV === "development" && time && time`did-finish-ssr`, process.env.NODE_ENV === "development" && time && time`stateref`;
|
|
8194
|
-
var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, shouldAvoidClasses, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = useComponentState(props, componentContext, staticConfig, config), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo;
|
|
8376
|
+
var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, shouldAvoidClasses, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo;
|
|
8195
8377
|
process.env.NODE_ENV === "development" && time && time`use-state`;
|
|
8196
8378
|
var hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText);
|
|
8197
8379
|
process.env.NODE_ENV === "development" && time && time`use-context`;
|
|
@@ -8362,7 +8544,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8362
8544
|
});
|
|
8363
8545
|
return;
|
|
8364
8546
|
}
|
|
8365
|
-
var dispose = subscribeToContextGroup({
|
|
8547
|
+
var dispose = (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
8366
8548
|
disabled,
|
|
8367
8549
|
componentContext,
|
|
8368
8550
|
setStateShallow,
|
|
@@ -8726,43 +8908,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8726
8908
|
left: 0,
|
|
8727
8909
|
pointerEvents: "box-none"
|
|
8728
8910
|
}
|
|
8729
|
-
})
|
|
8730
|
-
function hasAnimatedStyleValue(style) {
|
|
8731
|
-
return Object.keys(style).some(function(k) {
|
|
8732
|
-
var val = style[k];
|
|
8733
|
-
return val && typeof val == "object" && "_animation" in val;
|
|
8734
|
-
});
|
|
8735
|
-
}
|
|
8736
|
-
var fromPx = function(val) {
|
|
8911
|
+
}), fromPx = function(val) {
|
|
8737
8912
|
return typeof val != "string" ? val : +val.replace("px", "");
|
|
8738
|
-
}, isDisabled = function(props) {
|
|
8739
|
-
var _props_accessibilityState;
|
|
8740
|
-
return props.disabled || ((_props_accessibilityState = props.accessibilityState) === null || _props_accessibilityState === void 0 ? void 0 : _props_accessibilityState.disabled) || props["aria-disabled"] || props.accessibilityDisabled || !1;
|
|
8741
|
-
}, subscribeToContextGroup = function(param) {
|
|
8742
|
-
var { disabled = !1, setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
|
|
8743
|
-
if (pseudoGroups || mediaGroups) {
|
|
8744
|
-
var _componentContext_groups_subscribe, _componentContext_groups, current = {
|
|
8745
|
-
pseudo: {},
|
|
8746
|
-
media: {}
|
|
8747
|
-
};
|
|
8748
|
-
return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
|
|
8749
|
-
var { layout, pseudo } = param2;
|
|
8750
|
-
if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
|
|
8751
|
-
else if (layout && mediaGroups) {
|
|
8752
|
-
var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
|
|
8753
|
-
next !== current.media && (Object.assign(current.media, next), persist());
|
|
8754
|
-
}
|
|
8755
|
-
function persist() {
|
|
8756
|
-
var group = {
|
|
8757
|
-
...state.group,
|
|
8758
|
-
[name]: current
|
|
8759
|
-
};
|
|
8760
|
-
setStateShallow({
|
|
8761
|
-
group
|
|
8762
|
-
});
|
|
8763
|
-
}
|
|
8764
|
-
});
|
|
8765
|
-
}
|
|
8766
8913
|
};
|
|
8767
8914
|
}
|
|
8768
8915
|
});
|
|
@@ -9465,9 +9612,8 @@ var require_createTamagui_native = __commonJS({
|
|
|
9465
9612
|
var foundThemes;
|
|
9466
9613
|
if (configIn.themes) {
|
|
9467
9614
|
var noThemes = Object.keys(configIn.themes).length === 0;
|
|
9468
|
-
foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed);
|
|
9615
|
+
noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), process.env.TAMAGUI_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
|
|
9469
9616
|
}
|
|
9470
|
-
(0, import_insertStyleRule.listenForSheetChanges)();
|
|
9471
9617
|
var fontSizeTokens = null, fontsParsed;
|
|
9472
9618
|
if (configIn.fonts) {
|
|
9473
9619
|
var fontTokens = Object.fromEntries(Object.entries(configIn.fonts).map(function(param) {
|
|
@@ -9517,9 +9663,7 @@ ${JSON.stringify(variable, null, 2)}`);
|
|
|
9517
9663
|
cssRuleSets.push(specificRuleSet);
|
|
9518
9664
|
}
|
|
9519
9665
|
}
|
|
9520
|
-
var themesIn =
|
|
9521
|
-
...configIn.themes
|
|
9522
|
-
}, dedupedThemes = foundThemes ?? getThemesDeduped(themesIn), themes = (0, import_proxyThemeToParents.proxyThemesToParents)(dedupedThemes);
|
|
9666
|
+
var themesIn = configIn.themes, dedupedThemes = foundThemes ?? getThemesDeduped(themesIn), themes = (0, import_proxyThemeToParents.proxyThemesToParents)(dedupedThemes);
|
|
9523
9667
|
return {
|
|
9524
9668
|
themes,
|
|
9525
9669
|
cssRuleSets,
|
|
@@ -10648,7 +10792,7 @@ var require_useProps_native = __commonJS({
|
|
|
10648
10792
|
}
|
|
10649
10793
|
});
|
|
10650
10794
|
module2.exports = __toCommonJS2(useProps_exports);
|
|
10651
|
-
var import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(),
|
|
10795
|
+
var import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_getSplitStyles = require_getSplitStyles_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_Stack = require_Stack_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
|
|
10652
10796
|
function useProps(props, opts) {
|
|
10653
10797
|
var [propsOut, styleOut] = usePropsAndStyle(props, {
|
|
10654
10798
|
...opts,
|
|
@@ -10669,7 +10813,7 @@ var require_useProps_native = __commonJS({
|
|
|
10669
10813
|
componentName: staticConfig.componentName,
|
|
10670
10814
|
name: "theme" in props ? props.theme : void 0,
|
|
10671
10815
|
inverse: "themeInverse" in props ? props.themeInverse : void 0
|
|
10672
|
-
}), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0,
|
|
10816
|
+
}), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()), media = (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, ((_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", state, {
|
|
10673
10817
|
isAnimated: !1,
|
|
10674
10818
|
mediaState: media,
|
|
10675
10819
|
noSkip: !0,
|
|
@@ -10686,7 +10830,7 @@ var require_useProps_native = __commonJS({
|
|
|
10686
10830
|
});
|
|
10687
10831
|
return;
|
|
10688
10832
|
}
|
|
10689
|
-
return (0,
|
|
10833
|
+
return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
|
|
10690
10834
|
disabled,
|
|
10691
10835
|
componentContext,
|
|
10692
10836
|
setStateShallow,
|
|
@@ -11045,10 +11189,10 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
11045
11189
|
}
|
|
11046
11190
|
});
|
|
11047
11191
|
module2.exports = __toCommonJS2(TamaguiProvider_exports);
|
|
11048
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")),
|
|
11192
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_constants = require_index_native3(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native();
|
|
11049
11193
|
function TamaguiProvider(param) {
|
|
11050
11194
|
var { children, disableInjectCSS, config, className, defaultTheme, disableRootThemeClass, reset, themeClassNameOnRoot } = param;
|
|
11051
|
-
return (0, import_useMedia.setupMediaListeners)(), import_constants.isClient && (
|
|
11195
|
+
return (0, import_useMedia.setupMediaListeners)(), import_constants.isClient && (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
11052
11196
|
if (config && !disableInjectCSS) {
|
|
11053
11197
|
var style = document.createElement("style");
|
|
11054
11198
|
return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), function() {
|
|
@@ -11058,7 +11202,7 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
11058
11202
|
}, [
|
|
11059
11203
|
config,
|
|
11060
11204
|
disableInjectCSS
|
|
11061
|
-
])
|
|
11205
|
+
]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UnmountedClassName, {
|
|
11062
11206
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {
|
|
11063
11207
|
animationDriver: config == null ? void 0 : config.animations,
|
|
11064
11208
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeProvider.ThemeProvider, {
|
|
@@ -11391,6 +11535,9 @@ var require_index_native9 = __commonJS({
|
|
|
11391
11535
|
mediaState: function() {
|
|
11392
11536
|
return import_useMedia.mediaState;
|
|
11393
11537
|
},
|
|
11538
|
+
setConfig: function() {
|
|
11539
|
+
return import_config.setConfig;
|
|
11540
|
+
},
|
|
11394
11541
|
setNonce: function() {
|
|
11395
11542
|
return import_insertStyleRule.setNonce;
|
|
11396
11543
|
},
|