@tamagui/core 1.112.2 → 1.112.4
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/hooks/useElementLayout.js +10 -12
- package/dist/cjs/hooks/useElementLayout.js.map +2 -2
- package/dist/cjs/hooks/useElementLayout.native.js +12 -16
- package/dist/cjs/hooks/useElementLayout.native.js.map +2 -2
- package/dist/cjs/index.js +33 -43
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/index.native.js +16 -3
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/esm/hooks/useElementLayout.js +10 -12
- package/dist/esm/hooks/useElementLayout.js.map +2 -2
- package/dist/esm/hooks/useElementLayout.mjs +10 -12
- package/dist/esm/hooks/useElementLayout.mjs.map +1 -1
- package/dist/esm/hooks/useElementLayout.native.js +12 -13
- package/dist/esm/hooks/useElementLayout.native.js.map +1 -1
- package/dist/esm/index.js +32 -35
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +34 -29
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +23 -4
- package/dist/esm/index.native.js.map +1 -1
- package/dist/native.js +287 -141
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +275 -129
- package/dist/test.native.js.map +3 -3
- package/package.json +6 -6
- package/src/hooks/useElementLayout.tsx +17 -11
- package/src/index.tsx +24 -16
- package/types/hooks/useElementLayout.d.ts +2 -1
- package/types/hooks/useElementLayout.d.ts.map +1 -1
- package/types/hooks/usePlatformMethods.d.ts +2 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/src/hooks/usePlatformMethods.ts +0 -27
package/dist/native.js
CHANGED
|
@@ -69,7 +69,7 @@ var require_utils_native = __commonJS({
|
|
|
69
69
|
return canUseDOM;
|
|
70
70
|
},
|
|
71
71
|
getBoundingClientRect: function() {
|
|
72
|
-
return
|
|
72
|
+
return getBoundingClientRect2;
|
|
73
73
|
},
|
|
74
74
|
getLowestCommonAncestor: function() {
|
|
75
75
|
return getLowestCommonAncestor;
|
|
@@ -94,7 +94,7 @@ var require_utils_native = __commonJS({
|
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
module2.exports = __toCommonJS2(utils_exports);
|
|
97
|
-
var keyName = "__reactResponderId", canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement),
|
|
97
|
+
var keyName = "__reactResponderId", canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), getBoundingClientRect2 = function(node) {
|
|
98
98
|
if (node && node.nodeType === 1 && node.getBoundingClientRect) return node.getBoundingClientRect();
|
|
99
99
|
};
|
|
100
100
|
function getEventPath(domEvent) {
|
|
@@ -910,7 +910,7 @@ var require_useResponderEvents_native = __commonJS({
|
|
|
910
910
|
}, [
|
|
911
911
|
id
|
|
912
912
|
]), React3.useEffect(function() {
|
|
913
|
-
var { onMoveShouldSetResponder, onMoveShouldSetResponderCapture, onScrollShouldSetResponder, onScrollShouldSetResponderCapture, onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder, onStartShouldSetResponderCapture } = config, requiresResponderSystem = onMoveShouldSetResponder
|
|
913
|
+
var { onMoveShouldSetResponder, onMoveShouldSetResponderCapture, onScrollShouldSetResponder, onScrollShouldSetResponderCapture, onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder, onStartShouldSetResponderCapture } = config, requiresResponderSystem = !!(onMoveShouldSetResponder || onMoveShouldSetResponderCapture || onScrollShouldSetResponder || onScrollShouldSetResponderCapture || onSelectionChangeShouldSetResponder || onSelectionChangeShouldSetResponderCapture || onStartShouldSetResponder || onStartShouldSetResponderCapture), node = hostRef.current.host;
|
|
914
914
|
requiresResponderSystem ? (ResponderSystem.addNode(id, node, config), isAttachedRef.current = !0) : isAttachedRef.current && (ResponderSystem.removeNode(id), isAttachedRef.current = !1);
|
|
915
915
|
}, [
|
|
916
916
|
config,
|
|
@@ -1005,9 +1005,9 @@ var require_index_native2 = __commonJS({
|
|
|
1005
1005
|
}
|
|
1006
1006
|
});
|
|
1007
1007
|
module2.exports = __toCommonJS2(src_exports2);
|
|
1008
|
-
var
|
|
1008
|
+
var cache2 = /* @__PURE__ */ new Map(), simpleHash = function(str) {
|
|
1009
1009
|
var hashMin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;
|
|
1010
|
-
if (
|
|
1010
|
+
if (cache2.has(str)) return cache2.get(str);
|
|
1011
1011
|
str[0] === "v" && str.startsWith("var(") && (str = str.slice(6, str.length - 1));
|
|
1012
1012
|
for (var hash = 0, valids = "", added = 0, len = str.length, i = 0; i < len; i++) {
|
|
1013
1013
|
if (hashMin !== "strict" && added <= hashMin) {
|
|
@@ -1024,7 +1024,7 @@ var require_index_native2 = __commonJS({
|
|
|
1024
1024
|
hash = hashChar(hash, str[i]);
|
|
1025
1025
|
}
|
|
1026
1026
|
var res = valids + (hash ? Math.abs(hash) : "");
|
|
1027
|
-
return
|
|
1027
|
+
return cache2.size > 1e4 && cache2.clear(), cache2.set(str, res), res;
|
|
1028
1028
|
}, hashChar = function(hash, c) {
|
|
1029
1029
|
return Math.imul(31, hash) + c.charCodeAt(0) | 0;
|
|
1030
1030
|
};
|
|
@@ -1369,11 +1369,11 @@ var require_constants_native = __commonJS({
|
|
|
1369
1369
|
return isWindowDefined;
|
|
1370
1370
|
},
|
|
1371
1371
|
useIsomorphicLayoutEffect: function() {
|
|
1372
|
-
return
|
|
1372
|
+
return useIsomorphicLayoutEffect2;
|
|
1373
1373
|
}
|
|
1374
1374
|
});
|
|
1375
1375
|
module2.exports = __toCommonJS2(constants_native_exports);
|
|
1376
|
-
var import_react3 = __toESM2(require("react")), isWeb = !1, isWindowDefined = !1, isServer = !1, isClient = !1,
|
|
1376
|
+
var import_react3 = __toESM2(require("react")), isWeb = !1, isWindowDefined = !1, isServer = !1, isClient = !1, useIsomorphicLayoutEffect2 = import_react3.default.useLayoutEffect, isChrome = !1, isWebTouchable = !1, isTouchable = !0, isAndroid = !1, isIos = !1, currentPlatform = "native";
|
|
1377
1377
|
}
|
|
1378
1378
|
});
|
|
1379
1379
|
|
|
@@ -1459,7 +1459,7 @@ var require_shouldRenderNativePlatform_native = __commonJS({
|
|
|
1459
1459
|
}
|
|
1460
1460
|
});
|
|
1461
1461
|
module2.exports = __toCommonJS2(shouldRenderNativePlatform_exports);
|
|
1462
|
-
var
|
|
1462
|
+
var import_constants2 = require_index_native3(), ALL_PLATFORMS = [
|
|
1463
1463
|
"web",
|
|
1464
1464
|
"android",
|
|
1465
1465
|
"ios"
|
|
@@ -1470,7 +1470,7 @@ var require_shouldRenderNativePlatform_native = __commonJS({
|
|
|
1470
1470
|
try {
|
|
1471
1471
|
for (var _iterator = ALL_PLATFORMS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
1472
1472
|
var platform = _step.value;
|
|
1473
|
-
if (platform ===
|
|
1473
|
+
if (platform === import_constants2.currentPlatform && userRequestedPlatforms.has(platform)) return platform;
|
|
1474
1474
|
}
|
|
1475
1475
|
} catch (err) {
|
|
1476
1476
|
_didIteratorError = !0, _iteratorError = err;
|
|
@@ -1568,7 +1568,7 @@ var require_validStyleProps_native = __commonJS({
|
|
|
1568
1568
|
}
|
|
1569
1569
|
});
|
|
1570
1570
|
module2.exports = __toCommonJS2(validStyleProps_exports);
|
|
1571
|
-
var
|
|
1571
|
+
var import_constants2 = require_index_native3(), textColors = {
|
|
1572
1572
|
color: !0,
|
|
1573
1573
|
textDecorationColor: !0,
|
|
1574
1574
|
textShadowColor: !0
|
|
@@ -1764,7 +1764,7 @@ var require_validStyleProps_native = __commonJS({
|
|
|
1764
1764
|
...tokenCategories.radius,
|
|
1765
1765
|
...stylePropsTransform,
|
|
1766
1766
|
...stylePropsUnitless,
|
|
1767
|
-
...
|
|
1767
|
+
...import_constants2.isAndroid ? {
|
|
1768
1768
|
elevationAndroid: !0
|
|
1769
1769
|
} : {}
|
|
1770
1770
|
}, stylePropsFont = {
|
|
@@ -2018,7 +2018,7 @@ var require_config_native = __commonJS({
|
|
|
2018
2018
|
}
|
|
2019
2019
|
});
|
|
2020
2020
|
module2.exports = __toCommonJS2(config_exports);
|
|
2021
|
-
var
|
|
2021
|
+
var import_constants2 = require_index_native3(), conf, haventCalledErrorMessage = process.env.NODE_ENV === "development" ? `
|
|
2022
2022
|
Haven't called createTamagui yet.
|
|
2023
2023
|
|
|
2024
2024
|
This often happens due to having duplicate Tamagui sub-dependencies.
|
|
@@ -2064,7 +2064,7 @@ Haven't called createTamagui yet.
|
|
|
2064
2064
|
return tokensMerged[cat][value];
|
|
2065
2065
|
}) || ""]) === null || _tokensMerged_ === void 0 ? void 0 : _tokensMerged_[value];
|
|
2066
2066
|
}, getToken2 = function(value, group) {
|
|
2067
|
-
var useVariable = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
2067
|
+
var useVariable = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_constants2.isWeb, token = getTokenObject(value, group);
|
|
2068
2068
|
return useVariable ? token == null ? void 0 : token.variable : token == null ? void 0 : token.val;
|
|
2069
2069
|
}, getTokenValue2 = function(value, group) {
|
|
2070
2070
|
if (!(value === "unset" || value === "auto")) return getToken2(value, group, !1);
|
|
@@ -2157,7 +2157,7 @@ var require_createVariable_native = __commonJS({
|
|
|
2157
2157
|
}
|
|
2158
2158
|
});
|
|
2159
2159
|
module2.exports = __toCommonJS2(createVariable_exports);
|
|
2160
|
-
var
|
|
2160
|
+
var import_constants2 = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native();
|
|
2161
2161
|
function constructCSSVariableName(name) {
|
|
2162
2162
|
return `var(--${process.env.TAMAGUI_CSS_VARIABLE_PREFIX || ""}${name})`;
|
|
2163
2163
|
}
|
|
@@ -2170,12 +2170,12 @@ var require_createVariable_native = __commonJS({
|
|
|
2170
2170
|
key,
|
|
2171
2171
|
name: skipHash ? name : (0, import_helpers.simpleHash)(name, 40),
|
|
2172
2172
|
val,
|
|
2173
|
-
variable:
|
|
2173
|
+
variable: import_constants2.isWeb ? skipHash ? constructCSSVariableName(name) : createCSSVariable(name) : ""
|
|
2174
2174
|
};
|
|
2175
2175
|
};
|
|
2176
2176
|
function variableToString(vrble) {
|
|
2177
2177
|
var getValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
2178
|
-
return isVariable(vrble) ? !getValue &&
|
|
2178
|
+
return isVariable(vrble) ? !getValue && import_constants2.isWeb && vrble.variable ? vrble.variable : `${vrble.val}` : `${vrble || ""}`;
|
|
2179
2179
|
}
|
|
2180
2180
|
function isVariable(v) {
|
|
2181
2181
|
return v && typeof v == "object" && "isVar" in v;
|
|
@@ -2284,7 +2284,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2284
2284
|
}
|
|
2285
2285
|
});
|
|
2286
2286
|
module2.exports = __toCommonJS2(insertStyleRule_exports);
|
|
2287
|
-
var
|
|
2287
|
+
var import_constants2 = require_index_native3(), import_helpers = require_index_native4(), import_createVariable = require_createVariable_native(), scannedCache = /* @__PURE__ */ new WeakMap(), totalSelectorsInserted = /* @__PURE__ */ new Map(), allSelectors = {}, allRules = {}, insertedTransforms2 = {}, getAllSelectors = function() {
|
|
2288
2288
|
return allSelectors;
|
|
2289
2289
|
}, getAllRules = function() {
|
|
2290
2290
|
return Object.values(allRules);
|
|
@@ -2301,7 +2301,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2301
2301
|
if (!insertedTransforms2[identifier]) return insertedTransforms2[identifier] = value, !0;
|
|
2302
2302
|
}
|
|
2303
2303
|
function listenForSheetChanges() {
|
|
2304
|
-
if (
|
|
2304
|
+
if (import_constants2.isClient) {
|
|
2305
2305
|
var mo = new MutationObserver(function(entries) {
|
|
2306
2306
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
2307
2307
|
try {
|
|
@@ -2330,7 +2330,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2330
2330
|
var lastScannedSheets = null;
|
|
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
|
-
if (process.env.NODE_ENV !== "test" &&
|
|
2333
|
+
if (process.env.NODE_ENV !== "test" && import_constants2.isClient) {
|
|
2334
2334
|
var themes, sheets = document.styleSheets || [], prev = lastScannedSheets, current = new Set(sheets), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
2335
2335
|
try {
|
|
2336
2336
|
for (var _iterator = current[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
@@ -2501,7 +2501,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2501
2501
|
getIdentifierFromTamaguiSelector(text),
|
|
2502
2502
|
rule
|
|
2503
2503
|
];
|
|
2504
|
-
if (collectThemes && (
|
|
2504
|
+
if (collectThemes && /^(:root\s?(\.t_[a-z0-9_]+\s*)+(,)?\s*)+$/i.test(text)) return [
|
|
2505
2505
|
text.slice(0, 20),
|
|
2506
2506
|
// just used as uid
|
|
2507
2507
|
rule,
|
|
@@ -2523,7 +2523,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2523
2523
|
}
|
|
2524
2524
|
function insertStyleRules(rulesToInsert) {
|
|
2525
2525
|
if (!process.env.TAMAGUI_REACT_19) {
|
|
2526
|
-
if (!sheet &&
|
|
2526
|
+
if (!sheet && import_constants2.isClient && document.head) {
|
|
2527
2527
|
var styleTag = document.createElement("style");
|
|
2528
2528
|
nonce && (styleTag.nonce = nonce), sheet = document.head.appendChild(styleTag).sheet;
|
|
2529
2529
|
}
|
|
@@ -2881,7 +2881,7 @@ var require_useMedia_native = __commonJS({
|
|
|
2881
2881
|
}
|
|
2882
2882
|
});
|
|
2883
2883
|
module2.exports = __toCommonJS2(useMedia_exports);
|
|
2884
|
-
var import_react3 = __toESM2(require("react")),
|
|
2884
|
+
var import_react3 = __toESM2(require("react")), import_constants2 = require_index_native3(), import_config = require_config_native(), import_matchMedia = require_matchMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_useDisableSSR = require_useDisableSSR_native(), mediaState2 = (
|
|
2885
2885
|
// development only safeguard
|
|
2886
2886
|
process.env.NODE_ENV === "development" ? new Proxy({}, {
|
|
2887
2887
|
get(target, key) {
|
|
@@ -2936,7 +2936,7 @@ var require_useMedia_native = __commonJS({
|
|
|
2936
2936
|
}, updateCurrentState());
|
|
2937
2937
|
}
|
|
2938
2938
|
};
|
|
2939
|
-
if (!(
|
|
2939
|
+
if (!(import_constants2.isWeb && import_constants2.isServer) && setupVersion !== mediaVersion) {
|
|
2940
2940
|
setupVersion = mediaVersion, unlisten();
|
|
2941
2941
|
for (var key in mediaQueryConfig2) _loop(key);
|
|
2942
2942
|
}
|
|
@@ -2962,7 +2962,7 @@ var require_useMedia_native = __commonJS({
|
|
|
2962
2962
|
};
|
|
2963
2963
|
}
|
|
2964
2964
|
function useMedia2(uidIn, componentContext, debug) {
|
|
2965
|
-
var uid = uidIn ?? import_react3.default.useRef(), disableSSR = (0, import_useDisableSSR.getDisableSSR)(componentContext), initialState = (disableSSR || !
|
|
2965
|
+
var uid = uidIn ?? import_react3.default.useRef(), disableSSR = (0, import_useDisableSSR.getDisableSSR)(componentContext), initialState = (disableSSR || !import_constants2.isWeb ? mediaState2 : initState) || {}, componentState = States.get(uid);
|
|
2966
2966
|
componentState || (componentState = {
|
|
2967
2967
|
prev: initialState
|
|
2968
2968
|
}, States.set(uid, componentState));
|
|
@@ -2980,7 +2980,7 @@ var require_useMedia_native = __commonJS({
|
|
|
2980
2980
|
});
|
|
2981
2981
|
else {
|
|
2982
2982
|
var [_state, setState] = import_react3.default.useState(initialState);
|
|
2983
|
-
state = _state, (0,
|
|
2983
|
+
state = _state, (0, import_constants2.useIsomorphicLayoutEffect)(function() {
|
|
2984
2984
|
function update() {
|
|
2985
2985
|
setState(getSnapshot);
|
|
2986
2986
|
}
|
|
@@ -3031,15 +3031,15 @@ var require_useMedia_native = __commonJS({
|
|
|
3031
3031
|
return `-${m.toLowerCase()}`;
|
|
3032
3032
|
}).toLowerCase();
|
|
3033
3033
|
}
|
|
3034
|
-
var
|
|
3034
|
+
var cache2 = /* @__PURE__ */ new WeakMap(), cachedMediaKeyToQuery = {};
|
|
3035
3035
|
function mediaObjectToString2(query, key) {
|
|
3036
3036
|
if (typeof query == "string") return query;
|
|
3037
|
-
if (
|
|
3037
|
+
if (cache2.has(query)) return cache2.get(query);
|
|
3038
3038
|
var res = Object.entries(query).map(function(param) {
|
|
3039
3039
|
var [feature, value] = param;
|
|
3040
3040
|
return feature = camelToHyphen(feature), typeof value == "string" ? `(${feature}: ${value})` : (typeof value == "number" && /[height|width]$/.test(feature) && (value = `${value}px`), `(${feature}: ${value})`);
|
|
3041
3041
|
}).join(" and ");
|
|
3042
|
-
return key && (cachedMediaKeyToQuery[key] = res),
|
|
3042
|
+
return key && (cachedMediaKeyToQuery[key] = res), cache2.set(query, res), res;
|
|
3043
3043
|
}
|
|
3044
3044
|
function mediaKeyToQuery(key) {
|
|
3045
3045
|
return cachedMediaKeyToQuery[key] || mediaObjectToString2(mediaQueryConfig2[key], key);
|
|
@@ -3172,7 +3172,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3172
3172
|
}
|
|
3173
3173
|
});
|
|
3174
3174
|
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
3175
|
-
var
|
|
3175
|
+
var import_constants2 = require_index_native3(), import_config = require_config_native(), import_constants22 = require_constants_native2();
|
|
3176
3176
|
function _class_call_check(instance, Constructor) {
|
|
3177
3177
|
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
3178
3178
|
}
|
|
@@ -3297,11 +3297,11 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3297
3297
|
return (x == null ? void 0 : x.state.name) || "";
|
|
3298
3298
|
});
|
|
3299
3299
|
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
3300
|
-
for (var base = baseName.split(
|
|
3300
|
+
for (var base = baseName.split(import_constants22.THEME_NAME_SEPARATOR), max = base.length, min = props.componentName && !nextName ? max : (
|
|
3301
3301
|
// component name only don't search upwards
|
|
3302
3302
|
0
|
|
3303
3303
|
), i = max; i >= min; i--) {
|
|
3304
|
-
var prefix = base.slice(0, i).join(
|
|
3304
|
+
var prefix = base.slice(0, i).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
3305
3305
|
props.inverse && (prefix = inverseThemeName(prefix));
|
|
3306
3306
|
var potentials = [];
|
|
3307
3307
|
if (prefix && prefix !== baseName && prefix.includes(nextName) && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
|
|
@@ -3318,7 +3318,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3318
3318
|
}
|
|
3319
3319
|
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
3320
3320
|
if (i > baseLen) {
|
|
3321
|
-
var prefixLessOne = base.slice(0, i - 1).join(
|
|
3321
|
+
var prefixLessOne = base.slice(0, i - 1).join(import_constants22.THEME_NAME_SEPARATOR);
|
|
3322
3322
|
if (prefixLessOne) {
|
|
3323
3323
|
var lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
3324
3324
|
componentPotentials.unshift(lessSpecific);
|
|
@@ -3336,7 +3336,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3336
3336
|
var found = potentials.find(function(t) {
|
|
3337
3337
|
return t in themes;
|
|
3338
3338
|
});
|
|
3339
|
-
if (process.env.NODE_ENV !== "production" && typeof props.debug == "string" &&
|
|
3339
|
+
if (process.env.NODE_ENV !== "production" && typeof props.debug == "string" && import_constants2.isClient && console.info(` \u{1F537} [${manager == null ? void 0 : manager.id}] getState`, {
|
|
3340
3340
|
props,
|
|
3341
3341
|
found,
|
|
3342
3342
|
potentials,
|
|
@@ -3345,7 +3345,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3345
3345
|
baseName,
|
|
3346
3346
|
prefix
|
|
3347
3347
|
}), found) {
|
|
3348
|
-
var _this, names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre =
|
|
3348
|
+
var _this, names = found.split("_"), [firstName, ...restNames] = names, lastName = names[names.length - 1], isComponent = lastName[0] === lastName[0].toUpperCase(), scheme = firstName === "light" ? "light" : firstName === "dark" ? "dark" : void 0, pre = import_constants22.THEME_CLASSNAME_PREFIX, className = import_constants2.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_this = baseManager || parentManager) === null || _this === void 0 ? void 0 : _this.state, parentName = parentState == null ? void 0 : parentState.name;
|
|
3349
3349
|
result = {
|
|
3350
3350
|
name: found,
|
|
3351
3351
|
parentName,
|
|
@@ -3357,7 +3357,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3357
3357
|
break;
|
|
3358
3358
|
}
|
|
3359
3359
|
}
|
|
3360
|
-
return process.env.NODE_ENV !== "production" && props.debug === "verbose" &&
|
|
3360
|
+
return process.env.NODE_ENV !== "production" && props.debug === "verbose" && import_constants2.isClient && (console.groupCollapsed("ThemeManager.getState()"), console.info({
|
|
3361
3361
|
props,
|
|
3362
3362
|
baseName,
|
|
3363
3363
|
base,
|
|
@@ -3589,7 +3589,7 @@ var require_useTheme_native = __commonJS({
|
|
|
3589
3589
|
}
|
|
3590
3590
|
});
|
|
3591
3591
|
module2.exports = __toCommonJS2(useTheme_exports);
|
|
3592
|
-
var import_react3 = __toESM2(require("react")),
|
|
3592
|
+
var import_react3 = __toESM2(require("react")), import_constants2 = require_index_native3(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_createShallowSetState = require_createShallowSetState_native(), emptyProps = {
|
|
3593
3593
|
name: null
|
|
3594
3594
|
}, cached;
|
|
3595
3595
|
function getDefaultThemeProxied() {
|
|
@@ -3604,11 +3604,11 @@ var require_useTheme_native = __commonJS({
|
|
|
3604
3604
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : emptyProps, [_, theme] = useThemeWithState(props), res = theme || getDefaultThemeProxied();
|
|
3605
3605
|
return res;
|
|
3606
3606
|
}, useThemeWithState = function(props) {
|
|
3607
|
-
var keys = import_react3.default.useRef([]), changedThemeState = useChangeThemeEffect(props, !1, keys.current,
|
|
3607
|
+
var keys = import_react3.default.useRef([]), changedThemeState = useChangeThemeEffect(props, !1, keys.current, import_constants2.isServer ? void 0 : function() {
|
|
3608
3608
|
var _props_shouldUpdate, _props_shouldUpdate1, next = (_props_shouldUpdate1 = (_props_shouldUpdate = props.shouldUpdate) === null || _props_shouldUpdate === void 0 ? void 0 : _props_shouldUpdate.call(props)) !== null && _props_shouldUpdate1 !== void 0 ? _props_shouldUpdate1 : keys.current.length > 0 ? !0 : void 0;
|
|
3609
3609
|
if (process.env.NODE_ENV === "development" && typeof props.debug == "string" && props.debug !== "profile") {
|
|
3610
3610
|
var _props_shouldUpdate2;
|
|
3611
|
-
console.info(" \u{1F3A8} useTheme() shouldUpdate?", next,
|
|
3611
|
+
console.info(" \u{1F3A8} useTheme() shouldUpdate?", next, import_constants2.isClient ? {
|
|
3612
3612
|
shouldUpdateProp: (_props_shouldUpdate2 = props.shouldUpdate) === null || _props_shouldUpdate2 === void 0 ? void 0 : _props_shouldUpdate2.call(props),
|
|
3613
3613
|
keys: [
|
|
3614
3614
|
...keys.current
|
|
@@ -3659,7 +3659,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
3659
3659
|
if (subkey === "val") track(keyString);
|
|
3660
3660
|
else if (subkey === "get") return function(platform) {
|
|
3661
3661
|
var outVal = (0, import_createVariable.getVariable)(val);
|
|
3662
|
-
if (platform !== "web" &&
|
|
3662
|
+
if (platform !== "web" && import_constants2.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && !someParentIsInversed(themeManager) && scheme) {
|
|
3663
3663
|
var oppositeThemeName = name.replace(scheme === "dark" ? "dark" : "light", scheme === "dark" ? "light" : "dark"), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
|
|
3664
3664
|
if (oppositeVal) {
|
|
3665
3665
|
var dynamicVal = {
|
|
@@ -3722,7 +3722,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
3722
3722
|
if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState))) return next;
|
|
3723
3723
|
}
|
|
3724
3724
|
}
|
|
3725
|
-
if (
|
|
3725
|
+
if (import_constants2.isServer || (import_react3.default.useEffect(function() {
|
|
3726
3726
|
if (themeManager) {
|
|
3727
3727
|
if (props.inverse && !mounted) {
|
|
3728
3728
|
setThemeState(function(prev) {
|
|
@@ -3771,7 +3771,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
3771
3771
|
};
|
|
3772
3772
|
}, [
|
|
3773
3773
|
themeManager
|
|
3774
|
-
])),
|
|
3774
|
+
])), import_constants2.isWeb && isInversingOnMount) return {
|
|
3775
3775
|
isNewTheme: !1,
|
|
3776
3776
|
inversed: !1,
|
|
3777
3777
|
themeManager: parentManager,
|
|
@@ -3805,7 +3805,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
3805
3805
|
}
|
|
3806
3806
|
var isNewTheme2 = !!(themeManager2 !== parentManager || props.inverse);
|
|
3807
3807
|
isNewTheme2 && registerThemeManager(themeManager2);
|
|
3808
|
-
var isWebSSR =
|
|
3808
|
+
var isWebSSR = import_constants2.isWeb ? !(0, import_config.getSetting)("disableSSR") : !1, mounted2 = isWebSSR ? isRoot || (prev == null ? void 0 : prev.mounted) : !0;
|
|
3809
3809
|
state2 || (isNewTheme2 ? state2 = themeManager2.state : (state2 = parentManager.state, themeManager2 = parentManager));
|
|
3810
3810
|
var wasInversed = prev == null ? void 0 : prev.inversed, isInherentlyInversed = isNewTheme2 && state2.scheme !== (parentManager == null ? void 0 : parentManager.state.scheme), inversed2 = isRoot ? !1 : isInherentlyInversed ? !0 : isWebSSR ? wasInversed != null ? !1 : null : props.inverse, response = {
|
|
3811
3811
|
themeManager: themeManager2,
|
|
@@ -3816,7 +3816,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
3816
3816
|
(0, import_createShallowSetState.isEqualShallow)(prev, response) && // ... and then compare just the state, because we make a new state obj but is likely the same
|
|
3817
3817
|
(0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
|
|
3818
3818
|
if (prev && shouldReturnPrev) return prev;
|
|
3819
|
-
if (response.state = state2, process.env.NODE_ENV === "development" && props.debug &&
|
|
3819
|
+
if (response.state = state2, process.env.NODE_ENV === "development" && props.debug && import_constants2.isClient) {
|
|
3820
3820
|
console.groupCollapsed(`\u{1F537} [${themeManager2.id}] useChangeThemeEffect createState`);
|
|
3821
3821
|
var parentState = {
|
|
3822
3822
|
...parentManager == null ? void 0 : parentManager.state
|
|
@@ -4206,15 +4206,15 @@ var require_objectIdentityKey_native = __commonJS({
|
|
|
4206
4206
|
k += key;
|
|
4207
4207
|
var arg = obj[key], type = typeof arg;
|
|
4208
4208
|
if (!arg || type !== "object" && type !== "function") k += type + arg;
|
|
4209
|
-
else if (
|
|
4209
|
+
else if (cache2.has(arg)) k += cache2.get(arg);
|
|
4210
4210
|
else {
|
|
4211
4211
|
var v = Math.random();
|
|
4212
|
-
|
|
4212
|
+
cache2.set(arg, v), k += v;
|
|
4213
4213
|
}
|
|
4214
4214
|
}
|
|
4215
4215
|
return k;
|
|
4216
4216
|
}
|
|
4217
|
-
var
|
|
4217
|
+
var cache2 = /* @__PURE__ */ new WeakMap();
|
|
4218
4218
|
}
|
|
4219
4219
|
});
|
|
4220
4220
|
|
|
@@ -5392,7 +5392,7 @@ var require_expandStyles_native = __commonJS({
|
|
|
5392
5392
|
}
|
|
5393
5393
|
});
|
|
5394
5394
|
module2.exports = __toCommonJS2(expandStyles_exports);
|
|
5395
|
-
var
|
|
5395
|
+
var import_constants2 = require_index_native3(), import_normalizeShadow = require_normalizeShadow_native();
|
|
5396
5396
|
function fixStyles(style) {
|
|
5397
5397
|
"elevationAndroid" in style && (style.elevation = style.elevationAndroid, delete style.elevationAndroid), (style.shadowRadius != null || style.shadowColor || style.shadowOpacity != null || style.shadowOffset) && Object.assign(style, (0, import_normalizeShadow.normalizeShadow)(style));
|
|
5398
5398
|
for (var key in borderDefaults) if (key in style) {
|
|
@@ -5400,7 +5400,7 @@ var require_expandStyles_native = __commonJS({
|
|
|
5400
5400
|
(_style = style)[_borderDefaults_key = borderDefaults[key]] || (_style[_borderDefaults_key] = "solid");
|
|
5401
5401
|
}
|
|
5402
5402
|
}
|
|
5403
|
-
var nativeStyle =
|
|
5403
|
+
var nativeStyle = import_constants2.isWeb ? null : "borderStyle", borderDefaults = {
|
|
5404
5404
|
borderWidth: "borderStyle",
|
|
5405
5405
|
borderBottomWidth: nativeStyle || "borderBottomStyle",
|
|
5406
5406
|
borderTopWidth: nativeStyle || "borderTopStyle",
|
|
@@ -5569,14 +5569,14 @@ var require_normalizeValueWithProperty_native = __commonJS({
|
|
|
5569
5569
|
}
|
|
5570
5570
|
});
|
|
5571
5571
|
module2.exports = __toCommonJS2(normalizeValueWithProperty_exports);
|
|
5572
|
-
var
|
|
5572
|
+
var import_constants2 = require_index_native3(), import_helpers = require_index_native4(), import_insertStyleRule = require_insertStyleRule_native(), stylePropsAllPlusTransforms = {
|
|
5573
5573
|
...import_helpers.stylePropsAll,
|
|
5574
5574
|
translateX: !0,
|
|
5575
5575
|
translateY: !0
|
|
5576
5576
|
};
|
|
5577
5577
|
function normalizeValueWithProperty(value) {
|
|
5578
5578
|
var property = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
5579
|
-
if (!
|
|
5579
|
+
if (!import_constants2.isWeb || import_helpers.stylePropsUnitless[property] || property && !stylePropsAllPlusTransforms[property] || typeof value == "boolean") return value;
|
|
5580
5580
|
var res = value;
|
|
5581
5581
|
return value && typeof value == "object" ? value : (typeof value == "number" ? res = `${value}px` : property && (res = `${res}`), res);
|
|
5582
5582
|
}
|
|
@@ -5853,14 +5853,14 @@ var require_expandStyle_native = __commonJS({
|
|
|
5853
5853
|
}
|
|
5854
5854
|
});
|
|
5855
5855
|
module2.exports = __toCommonJS2(expandStyle_exports);
|
|
5856
|
-
var
|
|
5856
|
+
var import_constants2 = require_index_native3(), import_webToNativeProps = require_webToNativeProps_native(), import_config = require_config_native(), _loop = function(parent2) {
|
|
5857
5857
|
var _exec, _exec_index, prefix = parent2.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent2)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent2.length);
|
|
5858
5858
|
EXPANSIONS[parent2] = EXPANSIONS[parent2].map(function(k) {
|
|
5859
5859
|
return `${prefix}${k}`;
|
|
5860
5860
|
});
|
|
5861
5861
|
};
|
|
5862
5862
|
function expandStyle(key, value) {
|
|
5863
|
-
if (
|
|
5863
|
+
if (import_constants2.isAndroid && key === "elevationAndroid") return [
|
|
5864
5864
|
[
|
|
5865
5865
|
"elevation",
|
|
5866
5866
|
value
|
|
@@ -5920,7 +5920,7 @@ var require_expandStyle_native = __commonJS({
|
|
|
5920
5920
|
padding: all,
|
|
5921
5921
|
paddingHorizontal: horiz,
|
|
5922
5922
|
paddingVertical: vert,
|
|
5923
|
-
...
|
|
5923
|
+
...import_constants2.isWeb && {
|
|
5924
5924
|
// react-native only supports borderStyle
|
|
5925
5925
|
borderStyle: [
|
|
5926
5926
|
"TopStyle",
|
|
@@ -6095,8 +6095,8 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
6095
6095
|
}
|
|
6096
6096
|
});
|
|
6097
6097
|
module2.exports = __toCommonJS2(getVariantExtras_exports);
|
|
6098
|
-
var import_createVariable = require_createVariable_native(),
|
|
6099
|
-
if (
|
|
6098
|
+
var import_createVariable = require_createVariable_native(), cache2 = /* @__PURE__ */ new WeakMap(), getVariantExtras = function(styleState) {
|
|
6099
|
+
if (cache2.has(styleState)) return cache2.get(styleState);
|
|
6100
6100
|
var { props, conf, context, theme } = styleState, fonts = conf.fontsParsed;
|
|
6101
6101
|
context != null && context.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
|
|
6102
6102
|
var next = {
|
|
@@ -6111,7 +6111,7 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
6111
6111
|
},
|
|
6112
6112
|
props
|
|
6113
6113
|
};
|
|
6114
|
-
return
|
|
6114
|
+
return cache2.set(styleState, next), next;
|
|
6115
6115
|
}, fontLanguageCache = /* @__PURE__ */ new WeakMap();
|
|
6116
6116
|
function getFontsForLanguage(fonts, language) {
|
|
6117
6117
|
if (fontLanguageCache.has(language)) return fontLanguageCache.get(language);
|
|
@@ -6348,8 +6348,8 @@ var require_propMapper_native = __commonJS({
|
|
|
6348
6348
|
}
|
|
6349
6349
|
});
|
|
6350
6350
|
module2.exports = __toCommonJS2(propMapper_exports);
|
|
6351
|
-
var
|
|
6352
|
-
if (lastFontFamilyToken = null, !(!
|
|
6351
|
+
var import_constants2 = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_normalizeStyle = require_normalizeStyle_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), propMapper = function(key, value, styleState) {
|
|
6352
|
+
if (lastFontFamilyToken = null, !(!import_constants2.isAndroid && key === "elevationAndroid")) {
|
|
6353
6353
|
var { conf, styleProps, fontFamily, staticConfig } = styleState;
|
|
6354
6354
|
if (value === "unset") {
|
|
6355
6355
|
var _conf_unset, unsetVal = (_conf_unset = conf.unset) === null || _conf_unset === void 0 ? void 0 : _conf_unset[key];
|
|
@@ -6682,12 +6682,12 @@ var require_isActivePlatform_native = __commonJS({
|
|
|
6682
6682
|
}
|
|
6683
6683
|
});
|
|
6684
6684
|
module2.exports = __toCommonJS2(isActivePlatform_exports);
|
|
6685
|
-
var
|
|
6685
|
+
var import_constants2 = require_index_native3();
|
|
6686
6686
|
function isActivePlatform(key) {
|
|
6687
6687
|
var platform = key.slice(10);
|
|
6688
6688
|
return (
|
|
6689
6689
|
// web, ios, android
|
|
6690
|
-
platform ===
|
|
6690
|
+
platform === import_constants2.currentPlatform || // web, native
|
|
6691
6691
|
platform === "native"
|
|
6692
6692
|
);
|
|
6693
6693
|
}
|
|
@@ -6807,14 +6807,14 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6807
6807
|
}
|
|
6808
6808
|
});
|
|
6809
6809
|
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
6810
|
-
var import_react3 = __toESM2(require("react")),
|
|
6810
|
+
var import_react3 = __toESM2(require("react")), import_constants2 = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants22 = 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_constants2.isWeb ? console.groupCollapsed : console.info, conf, PROP_SPLIT = "-";
|
|
6811
6811
|
function isValidStyleKey(key, staticConfig) {
|
|
6812
6812
|
var _staticConfig_accept, validStyleProps = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
6813
6813
|
return validStyleProps[key] || ((_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key]);
|
|
6814
6814
|
}
|
|
6815
6815
|
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug, skipThemeTokenResolution) {
|
|
6816
|
-
conf = conf || (0, import_config.getConfig)(),
|
|
6817
|
-
var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName &&
|
|
6816
|
+
conf = conf || (0, import_config.getConfig)(), import_constants2.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
6817
|
+
var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants2.isWeb && !styleProps.noClassNames, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, styleState = {
|
|
6818
6818
|
classNames,
|
|
6819
6819
|
conf,
|
|
6820
6820
|
props,
|
|
@@ -6829,7 +6829,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6829
6829
|
debug,
|
|
6830
6830
|
skipThemeTokenResolution
|
|
6831
6831
|
};
|
|
6832
|
-
process.env.NODE_ENV === "development" && debug && debug !== "profile" &&
|
|
6832
|
+
process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants2.isClient && (consoleGroupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
|
|
6833
6833
|
props,
|
|
6834
6834
|
staticConfig,
|
|
6835
6835
|
shouldDoClasses,
|
|
@@ -7023,7 +7023,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
7023
7023
|
if (
|
|
7024
7024
|
// is HOC we can just pass through the styles as props
|
|
7025
7025
|
// this fixes issues where style prop got merged with wrong priority
|
|
7026
|
-
!isHOC && (isValidStyleKey(key, staticConfig) ||
|
|
7026
|
+
!isHOC && (isValidStyleKey(key, staticConfig) || import_constants2.isAndroid && key === "elevation")
|
|
7027
7027
|
) return mergeStyle(styleState, key, val), "continue";
|
|
7028
7028
|
if (!isVariant) {
|
|
7029
7029
|
if (styleProps.styledContextProps && key in styleProps.styledContextProps) return "continue";
|
|
@@ -7051,7 +7051,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
7051
7051
|
}
|
|
7052
7052
|
}
|
|
7053
7053
|
if (!isValidStyleKeyInit) {
|
|
7054
|
-
if (!
|
|
7054
|
+
if (!import_constants2.isAndroid && keyInit === "elevationAndroid") continue;
|
|
7055
7055
|
if (keyInit === "userSelect") keyInit = "selectable", valInit = valInit !== "none";
|
|
7056
7056
|
else if (keyInit.startsWith("data-")) continue;
|
|
7057
7057
|
}
|
|
@@ -7073,7 +7073,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
7073
7073
|
isVariant,
|
|
7074
7074
|
valInit,
|
|
7075
7075
|
shouldPassProp
|
|
7076
|
-
}),
|
|
7076
|
+
}), import_constants2.isClient && (0, import_log.log)({
|
|
7077
7077
|
variants,
|
|
7078
7078
|
variant: variants == null ? void 0 : variants[keyInit],
|
|
7079
7079
|
isVariant,
|
|
@@ -7097,7 +7097,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
7097
7097
|
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
7098
7098
|
consoleGroupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
7099
7099
|
try {
|
|
7100
|
-
!
|
|
7100
|
+
!import_constants2.isServer && import_isDevTools.isDevTools && ((0, import_log.log)({
|
|
7101
7101
|
expanded,
|
|
7102
7102
|
styleProps,
|
|
7103
7103
|
componentState,
|
|
@@ -7138,7 +7138,7 @@ current`, {
|
|
|
7138
7138
|
}
|
|
7139
7139
|
var avoidNormalize = styleProps.noNormalize === !1;
|
|
7140
7140
|
if (!avoidNormalize) {
|
|
7141
|
-
if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style),
|
|
7141
|
+
if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), import_constants2.isWeb && !isReactNative && (0, import_getStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms) {
|
|
7142
7142
|
var _styleState1;
|
|
7143
7143
|
(_styleState1 = styleState).style || (_styleState1.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
|
|
7144
7144
|
var [a] = param, [b] = param1;
|
|
@@ -7173,7 +7173,7 @@ current`, {
|
|
|
7173
7173
|
}
|
|
7174
7174
|
if (transforms) for (var namespace in transforms) {
|
|
7175
7175
|
var hash, val2, identifier2;
|
|
7176
|
-
if (
|
|
7176
|
+
if (import_constants2.isClient && !insertedTransforms[identifier2]) var rule;
|
|
7177
7177
|
}
|
|
7178
7178
|
}
|
|
7179
7179
|
if (isReactNative) {
|
|
@@ -7254,14 +7254,14 @@ current`, {
|
|
|
7254
7254
|
}
|
|
7255
7255
|
function mergeStyle(styleState, key, val) {
|
|
7256
7256
|
var disableNormalize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, { classNames, viewProps, usedKeys, styleProps, staticConfig } = styleState;
|
|
7257
|
-
if (
|
|
7257
|
+
if (import_constants2.isWeb && (val == null ? void 0 : val[0]) === "_") {
|
|
7258
7258
|
var _usedKeys, _key;
|
|
7259
7259
|
classNames[key] = val, (_usedKeys = usedKeys)[_key = key] || (_usedKeys[_key] = 1);
|
|
7260
7260
|
} else if (key in import_helpers.stylePropsTransform) {
|
|
7261
7261
|
var _styleState;
|
|
7262
7262
|
(_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), styleState.flatTransforms[key] = val;
|
|
7263
7263
|
} else {
|
|
7264
|
-
var shouldNormalize =
|
|
7264
|
+
var shouldNormalize = import_constants2.isWeb && !disableNormalize && !styleProps.noNormalize, out = shouldNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
7265
7265
|
if (
|
|
7266
7266
|
// accept is for props not styles
|
|
7267
7267
|
staticConfig.accept && key in staticConfig.accept
|
|
@@ -7297,7 +7297,7 @@ current`, {
|
|
|
7297
7297
|
}
|
|
7298
7298
|
}
|
|
7299
7299
|
return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
7300
|
-
}, useInsertEffectCompat =
|
|
7300
|
+
}, useInsertEffectCompat = import_constants2.isWeb ? import_react3.default.useInsertionEffect || import_constants2.useIsomorphicLayoutEffect : function() {
|
|
7301
7301
|
}, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j) {
|
|
7302
7302
|
conf = conf || (0, import_config.getConfig)();
|
|
7303
7303
|
var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
|
|
@@ -7361,7 +7361,7 @@ current`, {
|
|
|
7361
7361
|
var val = style[key];
|
|
7362
7362
|
key in import_helpers.stylePropsTransform ? mergeTransform(out, key, val) : out[key] = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key);
|
|
7363
7363
|
}
|
|
7364
|
-
return
|
|
7364
|
+
return import_constants2.isWeb && Array.isArray(out.transform) && (out.transform = (0, import_transformsToString.transformsToString)(out.transform)), (0, import_expandStyles.fixStyles)(out), out;
|
|
7365
7365
|
}
|
|
7366
7366
|
function applyDefaultStyle(pkey, styleState) {
|
|
7367
7367
|
var defaultValues = animatableDefaults[pkey];
|
|
@@ -7665,7 +7665,7 @@ var require_Theme_native = __commonJS({
|
|
|
7665
7665
|
}
|
|
7666
7666
|
});
|
|
7667
7667
|
module2.exports = __toCommonJS2(Theme_exports);
|
|
7668
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
7668
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_constants2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_createVariable = require_createVariable_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native(), import_ThemeDebug = require_ThemeDebug_native(), import_log = require_log_native(), Theme = /* @__PURE__ */ (0, import_react3.forwardRef)(function(param, ref) {
|
|
7669
7669
|
var { children, ...props } = param;
|
|
7670
7670
|
if (props.disable) return children;
|
|
7671
7671
|
var isRoot = !!props._isRoot, themeState = (0, import_useTheme.useChangeThemeEffect)(props, isRoot), disableDirectChildTheme = props["disable-child-theme"], finalChildren = disableDirectChildTheme ? import_react3.Children.map(children, function(child) {
|
|
@@ -7708,7 +7708,7 @@ var require_Theme_native = __commonJS({
|
|
|
7708
7708
|
value: themeManager.id,
|
|
7709
7709
|
children: next
|
|
7710
7710
|
});
|
|
7711
|
-
return forceClassName === !1 ? elementsWithContext :
|
|
7711
|
+
return forceClassName === !1 ? elementsWithContext : import_constants2.isWeb ? wrapThemeElements({
|
|
7712
7712
|
children: elementsWithContext,
|
|
7713
7713
|
themeState,
|
|
7714
7714
|
forceClassName,
|
|
@@ -7943,15 +7943,15 @@ var require_useComponentState_native = __commonJS({
|
|
|
7943
7943
|
}
|
|
7944
7944
|
});
|
|
7945
7945
|
module2.exports = __toCommonJS2(useComponentState_exports);
|
|
7946
|
-
var import_defaultComponentState = require_defaultComponentState_native(), import_useDidHydrateOnce = require_useDidHydrateOnce_native(), import_react3 = require("react"),
|
|
7946
|
+
var import_defaultComponentState = require_defaultComponentState_native(), import_useDidHydrateOnce = require_useDidHydrateOnce_native(), import_react3 = require("react"), import_constants2 = 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
7947
|
var { animationDriver, groups } = param, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
|
|
7948
7948
|
stateRef.current || (stateRef.current = {});
|
|
7949
7949
|
var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
|
|
7950
7950
|
var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
|
|
7951
7951
|
return !!(next || curStateRef.hasAnimated);
|
|
7952
|
-
}(), willBeAnimated = !
|
|
7952
|
+
}(), willBeAnimated = !import_constants2.isServer && willBeAnimatedClient;
|
|
7953
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 =
|
|
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_constants2.isWeb && !didHydrateOnce, initialState = shouldEnter ? (
|
|
7955
7955
|
// on the very first render we switch all spring animation drivers to css rendering
|
|
7956
7956
|
// this is because we need to use css variables, which they don't support to do proper SSR
|
|
7957
7957
|
// without flickers of the wrong colors.
|
|
@@ -7964,7 +7964,7 @@ var require_useComponentState_native = __commonJS({
|
|
|
7964
7964
|
...states[0],
|
|
7965
7965
|
[props.forceStyle]: !0
|
|
7966
7966
|
} : states[0], setState = states[1], isHydrated = state.unmounted === !1 || state.unmounted === "should-enter", isAnimated = willBeAnimated;
|
|
7967
|
-
|
|
7967
|
+
import_constants2.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
7968
|
...state
|
|
7969
7969
|
}));
|
|
7970
7970
|
var setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled, !1, props.debug);
|
|
@@ -7975,9 +7975,9 @@ var require_useComponentState_native = __commonJS({
|
|
|
7975
7975
|
var exv = exitVariant ?? enterExitVariant, env = enterVariant ?? enterExitVariant;
|
|
7976
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
7977
|
}
|
|
7978
|
-
var shouldAvoidClasses = !
|
|
7979
|
-
if (
|
|
7980
|
-
var { disableClassName } = props, isAnimatedAndHydrated = isAnimated && !supportsCSSVars && didHydrateOnce && !
|
|
7978
|
+
var shouldAvoidClasses = !import_constants2.isWeb;
|
|
7979
|
+
if (import_constants2.isWeb) {
|
|
7980
|
+
var { disableClassName } = props, isAnimatedAndHydrated = isAnimated && !supportsCSSVars && didHydrateOnce && !import_constants2.isServer, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || didHydrateOnce), isDisabledManually = disableClassName && !import_constants2.isServer && didHydrateOnce && state.unmounted === !0;
|
|
7981
7981
|
(isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (shouldAvoidClasses = !0, process.env.NODE_ENV === "development" && props.debug && (0, import_log.log)("avoiding className", {
|
|
7982
7982
|
isAnimatedAndHydrated,
|
|
7983
7983
|
isDisabledManually,
|
|
@@ -8094,7 +8094,7 @@ var require_setupHooks_native = __commonJS({
|
|
|
8094
8094
|
}
|
|
8095
8095
|
});
|
|
8096
8096
|
module2.exports = __toCommonJS2(setupHooks_exports);
|
|
8097
|
-
var
|
|
8097
|
+
var hooks = {};
|
|
8098
8098
|
function setupHooks2(next) {
|
|
8099
8099
|
Object.assign(hooks, next);
|
|
8100
8100
|
}
|
|
@@ -8147,7 +8147,7 @@ var require_Slot_native = __commonJS({
|
|
|
8147
8147
|
}
|
|
8148
8148
|
});
|
|
8149
8149
|
module2.exports = __toCommonJS2(Slot_exports);
|
|
8150
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_compose_refs = require_index_native5(),
|
|
8150
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_compose_refs = require_index_native5(), import_constants2 = require_index_native3(), import_helpers = require_index_native4(), import_react3 = require("react"), is19 = import_react3.version.startsWith("19."), Slot = /* @__PURE__ */ (0, import_react3.memo)(/* @__PURE__ */ (0, import_react3.forwardRef)(function(props, forwardedRef) {
|
|
8151
8151
|
var { children, ...slotProps } = props;
|
|
8152
8152
|
if (/* @__PURE__ */ (0, import_react3.isValidElement)(children)) {
|
|
8153
8153
|
var mergedProps = mergeSlotProps(children, slotProps);
|
|
@@ -8164,7 +8164,7 @@ var require_Slot_native = __commonJS({
|
|
|
8164
8164
|
});
|
|
8165
8165
|
};
|
|
8166
8166
|
Slottable.displayName = "Slottable";
|
|
8167
|
-
var pressMap =
|
|
8167
|
+
var pressMap = import_constants2.isWeb ? {
|
|
8168
8168
|
onPress: "onClick",
|
|
8169
8169
|
onPressOut: "onMouseUp",
|
|
8170
8170
|
onPressIn: "onMouseDown"
|
|
@@ -8262,7 +8262,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8262
8262
|
}
|
|
8263
8263
|
});
|
|
8264
8264
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
8265
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_compose_refs = require_index_native5(),
|
|
8265
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_compose_refs = require_index_native5(), import_constants2 = require_index_native3(), import_helpers = require_index_native4(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = 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();
|
|
8266
8266
|
typeof document < "u" && (cancelTouches = function() {
|
|
8267
8267
|
componentSetStates.forEach(function(setState) {
|
|
8268
8268
|
return setState(function(prev) {
|
|
@@ -8302,7 +8302,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8302
8302
|
var cancelTouches, BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
|
|
8303
8303
|
value: !1
|
|
8304
8304
|
};
|
|
8305
|
-
|
|
8305
|
+
import_constants2.isWeb && globalThis.document && (document.addEventListener("keydown", function() {
|
|
8306
8306
|
lastInteractionWasKeyboard.value = !0;
|
|
8307
8307
|
}), document.addEventListener("mousedown", function() {
|
|
8308
8308
|
lastInteractionWasKeyboard.value = !1;
|
|
@@ -8356,7 +8356,7 @@ var require_createComponent_native = __commonJS({
|
|
|
8356
8356
|
} : defaultProps, props = propsIn;
|
|
8357
8357
|
curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
|
|
8358
8358
|
var debugProp = props.debug, componentName2 = props.componentName || staticConfig.componentName;
|
|
8359
|
-
if (process.env.NODE_ENV === "development" &&
|
|
8359
|
+
if (process.env.NODE_ENV === "development" && import_constants2.isClient && import_react3.default.useEffect(function() {
|
|
8360
8360
|
var overlay = null, debugVisualizerHandler = function() {
|
|
8361
8361
|
var show = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, node = curStateRef.host;
|
|
8362
8362
|
if (node) if (show) {
|
|
@@ -8375,9 +8375,9 @@ var require_createComponent_native = __commonJS({
|
|
|
8375
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`;
|
|
8376
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;
|
|
8377
8377
|
process.env.NODE_ENV === "development" && time && time`use-state`;
|
|
8378
|
-
var hasTextAncestor = !!(
|
|
8378
|
+
var hasTextAncestor = !!(import_constants2.isWeb && isText && componentContext.inText);
|
|
8379
8379
|
process.env.NODE_ENV === "development" && time && time`use-context`;
|
|
8380
|
-
var isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element =
|
|
8380
|
+
var isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants2.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
|
|
8381
8381
|
animationDriver && isAnimated && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
|
|
8382
8382
|
var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
|
|
8383
8383
|
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (curStateRef.themeShallow = !0);
|
|
@@ -8391,11 +8391,11 @@ var require_createComponent_native = __commonJS({
|
|
|
8391
8391
|
return stateRef.current.isListeningToTheme;
|
|
8392
8392
|
}), themeStateProps.deopt = willBeAnimated, process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
8393
8393
|
var name = `${componentName2 || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = (hasEnterStyle ? "(hasEnter)" : " ") + (isAnimated ? "(animated)" : " ") + (isReactNative ? "(rnw)" : " ") + (shouldAvoidClasses ? "(shouldAvoidClasses)" : " ") + (state.press || state.pressIn ? "(PRESSED)" : " ") + (state.hover ? "(HOVERED)" : " ") + (state.focus ? "(FOCUSED)" : " ") + ((presenceState == null ? void 0 : presenceState.isPresent) === !1 ? "(EXIT)" : ""), dataIs = propsIn["data-is"] || "", banner = `${internalID} ${name}${dataIs ? ` ${dataIs}` : ""} ${type}`;
|
|
8394
|
-
if (console.info(`%c ${banner} (hydrated: ${isHydrated}) (unmounted: ${state.unmounted})`, "background: green; color: white;"),
|
|
8394
|
+
if (console.info(`%c ${banner} (hydrated: ${isHydrated}) (unmounted: ${state.unmounted})`, "background: green; color: white;"), import_constants2.isServer) (0, import_log.log)({
|
|
8395
8395
|
noClassNames,
|
|
8396
8396
|
isAnimated,
|
|
8397
8397
|
shouldAvoidClasses,
|
|
8398
|
-
isWeb:
|
|
8398
|
+
isWeb: import_constants2.isWeb,
|
|
8399
8399
|
supportsCSSVars
|
|
8400
8400
|
});
|
|
8401
8401
|
else {
|
|
@@ -8504,7 +8504,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8504
8504
|
}), stateRef.current.hasMeasured = !0;
|
|
8505
8505
|
})), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, curStateRef.willHydrate)) || nonTamaguiProps, curStateRef.composedRef || (curStateRef.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
|
|
8506
8506
|
return stateRef.current.host = x;
|
|
8507
|
-
}, forwardedRef, import_setElementProps.setElementProps)), viewProps.ref = curStateRef.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText &&
|
|
8507
|
+
}, forwardedRef, import_setElementProps.setElementProps)), viewProps.ref = curStateRef.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants2.isWeb && !isHOC && import_react3.default.Children.toArray(props.children).forEach(function(item) {
|
|
8508
8508
|
typeof item == "string" && item !== `
|
|
8509
8509
|
` && console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
|
|
8510
8510
|
}), process.env.NODE_ENV === "development" && time && time`events-hooks`;
|
|
@@ -8514,7 +8514,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8514
8514
|
pressIn: !1
|
|
8515
8515
|
});
|
|
8516
8516
|
};
|
|
8517
|
-
process.env.NODE_ENV === "development" &&
|
|
8517
|
+
process.env.NODE_ENV === "development" && import_constants2.isWeb && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
|
|
8518
8518
|
if (debugProp === "verbose") {
|
|
8519
8519
|
var cssStyleDeclarationToObject2 = function(style) {
|
|
8520
8520
|
for (var styleObject = {}, i = 0; i < style.length; i++) {
|
|
@@ -8566,7 +8566,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8566
8566
|
...mediaGroups
|
|
8567
8567
|
]).join("") : 0
|
|
8568
8568
|
]);
|
|
8569
|
-
var runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut), attachHover =
|
|
8569
|
+
var runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut), attachHover = import_constants2.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(groupName || runtimePressStyle);
|
|
8570
8570
|
process.env.NODE_ENV === "development" && time && time`events-setup`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("\u{1FAA9} events()", {
|
|
8571
8571
|
runtimeFocusStyle,
|
|
8572
8572
|
runtimePressStyle,
|
|
@@ -8596,10 +8596,10 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8596
8596
|
(runtimePressStyle || groupName) && setStateShallow({
|
|
8597
8597
|
press: !0,
|
|
8598
8598
|
pressIn: !0
|
|
8599
|
-
}), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e),
|
|
8599
|
+
}), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e), import_constants2.isWeb && componentSetStates.add(setState);
|
|
8600
8600
|
} : void 0,
|
|
8601
8601
|
onPress: attachPress ? function(e) {
|
|
8602
|
-
unPress(),
|
|
8602
|
+
unPress(), import_constants2.isWeb && (onClick == null || onClick(e)), onPress == null || onPress(e);
|
|
8603
8603
|
} : void 0,
|
|
8604
8604
|
...attachPress && onLongPress && {
|
|
8605
8605
|
onLongPress: function(e) {
|
|
@@ -8717,7 +8717,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8717
8717
|
if (process.env.TAMAGUI_REACT_19 && !1) var rulesToInsert, keys;
|
|
8718
8718
|
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
8719
8719
|
var element1 = typeof elementType == "string" ? elementType : "Component", title = `render <${element1} /> (${internalID}) with props`;
|
|
8720
|
-
if (
|
|
8720
|
+
if (import_constants2.isWeb) {
|
|
8721
8721
|
console.groupCollapsed(title);
|
|
8722
8722
|
try {
|
|
8723
8723
|
(0, import_log.log)("viewProps", viewProps), (0, import_log.log)("children", content), typeof window < "u" && (0, import_log.log)({
|
|
@@ -8804,7 +8804,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8804
8804
|
componentName: "Spacer",
|
|
8805
8805
|
validStyles: import_helpers.validStyles,
|
|
8806
8806
|
defaultProps: {
|
|
8807
|
-
...
|
|
8807
|
+
...import_constants22.stackDefaultStyles,
|
|
8808
8808
|
// avoid nesting issues
|
|
8809
8809
|
tag: "span",
|
|
8810
8810
|
size: !0,
|
|
@@ -8899,7 +8899,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
8899
8899
|
}
|
|
8900
8900
|
var AbsoluteFill = createComponent({
|
|
8901
8901
|
defaultProps: {
|
|
8902
|
-
...
|
|
8902
|
+
...import_constants22.stackDefaultStyles,
|
|
8903
8903
|
flexDirection: "column",
|
|
8904
8904
|
position: "absolute",
|
|
8905
8905
|
top: 0,
|
|
@@ -9055,9 +9055,9 @@ var require_createVariables_native = __commonJS({
|
|
|
9055
9055
|
}
|
|
9056
9056
|
});
|
|
9057
9057
|
module2.exports = __toCommonJS2(createVariables_exports);
|
|
9058
|
-
var import_helpers = require_index_native4(), import_createVariable = require_createVariable_native(),
|
|
9058
|
+
var import_helpers = require_index_native4(), import_createVariable = require_createVariable_native(), cache2 = /* @__PURE__ */ new WeakMap(), createVariables = function(tokens) {
|
|
9059
9059
|
var parentPath = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", isFont = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
|
|
9060
|
-
if (
|
|
9060
|
+
if (cache2.has(tokens)) return tokens;
|
|
9061
9061
|
var res = {}, i = 0;
|
|
9062
9062
|
for (var keyIn in tokens) {
|
|
9063
9063
|
i++;
|
|
@@ -9078,7 +9078,7 @@ var require_createVariables_native = __commonJS({
|
|
|
9078
9078
|
});
|
|
9079
9079
|
res[key] = finalValue;
|
|
9080
9080
|
}
|
|
9081
|
-
return
|
|
9081
|
+
return cache2.set(res, !0), res;
|
|
9082
9082
|
};
|
|
9083
9083
|
}
|
|
9084
9084
|
});
|
|
@@ -9510,7 +9510,7 @@ var require_insertFont_native = __commonJS({
|
|
|
9510
9510
|
}
|
|
9511
9511
|
});
|
|
9512
9512
|
module2.exports = __toCommonJS2(insertFont_exports);
|
|
9513
|
-
var import_config = require_config_native(),
|
|
9513
|
+
var import_config = require_config_native(), import_constants2 = require_constants_native2(), import_createFont = require_createFont_native(), import_createVariables = require_createVariables_native(), import_registerCSSVariable = require_registerCSSVariable_native();
|
|
9514
9514
|
function insertFont(name, fontIn) {
|
|
9515
9515
|
var font = (0, import_createFont.createFont)(fontIn), tokened = (0, import_createVariables.createVariables)(font, name), parsed = parseFont(tokened);
|
|
9516
9516
|
if (0) var fontVars, styleElement;
|
|
@@ -9592,7 +9592,7 @@ var require_createTamagui_native = __commonJS({
|
|
|
9592
9592
|
}
|
|
9593
9593
|
});
|
|
9594
9594
|
module2.exports = __toCommonJS2(createTamagui_exports);
|
|
9595
|
-
var
|
|
9595
|
+
var import_constants2 = require_index_native3(), 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();
|
|
9596
9596
|
function createTamagui(configIn) {
|
|
9597
9597
|
var _configIn_settings;
|
|
9598
9598
|
if (createdConfigs.has(configIn)) return configIn;
|
|
@@ -9638,9 +9638,9 @@ var require_createTamagui_native = __commonJS({
|
|
|
9638
9638
|
var variable = tokens[key2][skey];
|
|
9639
9639
|
if (specificTokens[`$${key2}.${skey}`] = variable, process.env.NODE_ENV === "development" && typeof variable > "u") throw new Error(`No value for tokens.${key2}.${skey}:
|
|
9640
9640
|
${JSON.stringify(variable, null, 2)}`);
|
|
9641
|
-
|
|
9641
|
+
import_constants2.isWeb && ((0, import_registerCSSVariable.registerCSSVariable)(variable), declarations.push((0, import_registerCSSVariable.variableToCSS)(variable, key2 === "zIndex")));
|
|
9642
9642
|
}
|
|
9643
|
-
if (
|
|
9643
|
+
if (import_constants2.isWeb) {
|
|
9644
9644
|
var declarationsToRuleSet2 = function(decs) {
|
|
9645
9645
|
var selector = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
9646
9646
|
return `:root${selector} {${sep}${[
|
|
@@ -9669,7 +9669,7 @@ ${JSON.stringify(variable, null, 2)}`);
|
|
|
9669
9669
|
cssRuleSets,
|
|
9670
9670
|
getThemeRulesSets() {
|
|
9671
9671
|
var themeRuleSets = [];
|
|
9672
|
-
if (
|
|
9672
|
+
if (import_constants2.isWeb) {
|
|
9673
9673
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
9674
9674
|
try {
|
|
9675
9675
|
for (var _iterator = dedupedThemes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
@@ -10471,10 +10471,10 @@ var require_useThemeName_native = __commonJS({
|
|
|
10471
10471
|
}
|
|
10472
10472
|
});
|
|
10473
10473
|
module2.exports = __toCommonJS2(useThemeName_exports);
|
|
10474
|
-
var import_react3 = __toESM2(require("react")),
|
|
10474
|
+
var import_react3 = __toESM2(require("react")), import_constants2 = require_index_native3(), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native();
|
|
10475
10475
|
function useThemeName(opts) {
|
|
10476
10476
|
var manager = (0, import_useTheme.getThemeManager)(import_react3.default.useContext(import_ThemeManagerContext.ThemeManagerIDContext)), [name, setName] = import_react3.default.useState((manager == null ? void 0 : manager.state.name) || "");
|
|
10477
|
-
return (0,
|
|
10477
|
+
return (0, import_constants2.useIsomorphicLayoutEffect)(function() {
|
|
10478
10478
|
if (manager) return setName(manager.state.name), manager.onChangeTheme(function(next, manager2) {
|
|
10479
10479
|
var name2 = opts != null && opts.parent && manager2.state.parentName || next;
|
|
10480
10480
|
name2 && setName(name2);
|
|
@@ -10673,8 +10673,8 @@ var require_useIsTouchDevice_native = __commonJS({
|
|
|
10673
10673
|
}
|
|
10674
10674
|
});
|
|
10675
10675
|
module2.exports = __toCommonJS2(useIsTouchDevice_exports);
|
|
10676
|
-
var
|
|
10677
|
-
return
|
|
10676
|
+
var import_constants2 = require_index_native3(), import_use_did_finish_ssr = require_index_native7(), useIsTouchDevice = function() {
|
|
10677
|
+
return import_constants2.isWeb ? (0, import_use_did_finish_ssr.useDidFinishSSR)() ? import_constants2.isTouchable : !1 : !0;
|
|
10678
10678
|
};
|
|
10679
10679
|
}
|
|
10680
10680
|
});
|
|
@@ -10722,9 +10722,9 @@ var require_Stack_native = __commonJS({
|
|
|
10722
10722
|
}
|
|
10723
10723
|
});
|
|
10724
10724
|
module2.exports = __toCommonJS2(Stack_exports);
|
|
10725
|
-
var import_helpers = require_index_native4(),
|
|
10725
|
+
var import_helpers = require_index_native4(), import_constants2 = require_constants_native2(), import_createComponent = require_createComponent_native(), Stack2 = (0, import_createComponent.createComponent)({
|
|
10726
10726
|
acceptsClassName: !0,
|
|
10727
|
-
defaultProps:
|
|
10727
|
+
defaultProps: import_constants2.stackDefaultStyles,
|
|
10728
10728
|
validStyles: import_helpers.validStyles
|
|
10729
10729
|
});
|
|
10730
10730
|
Stack2.displayName = "Stack";
|
|
@@ -10900,9 +10900,9 @@ var require_View_native = __commonJS({
|
|
|
10900
10900
|
}
|
|
10901
10901
|
});
|
|
10902
10902
|
module2.exports = __toCommonJS2(View_exports);
|
|
10903
|
-
var import_helpers = require_index_native4(),
|
|
10903
|
+
var import_helpers = require_index_native4(), import_constants2 = require_constants_native2(), import_createComponent = require_createComponent_native(), View2 = (0, import_createComponent.createComponent)({
|
|
10904
10904
|
acceptsClassName: !0,
|
|
10905
|
-
defaultProps:
|
|
10905
|
+
defaultProps: import_constants2.stackDefaultStyles,
|
|
10906
10906
|
validStyles: import_helpers.validStyles
|
|
10907
10907
|
});
|
|
10908
10908
|
}
|
|
@@ -11039,10 +11039,10 @@ var require_ThemeProvider_native = __commonJS({
|
|
|
11039
11039
|
}
|
|
11040
11040
|
});
|
|
11041
11041
|
module2.exports = __toCommonJS2(ThemeProvider_exports);
|
|
11042
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")),
|
|
11043
|
-
return
|
|
11042
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_constants2 = require_index_native3(), import_constants22 = require_constants_native2(), import_Theme = require_Theme_native(), import_config = require_config_native(), ThemeProvider = function(props) {
|
|
11043
|
+
return import_constants2.isClient && import_react3.default.useLayoutEffect(function() {
|
|
11044
11044
|
if (!props.disableRootThemeClass) {
|
|
11045
|
-
var cn = `${
|
|
11045
|
+
var cn = `${import_constants22.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`, _props_themeClassNameOnRoot, target = ((_props_themeClassNameOnRoot = props.themeClassNameOnRoot) !== null && _props_themeClassNameOnRoot !== void 0 ? _props_themeClassNameOnRoot : (0, import_config.getSetting)("themeClassNameOnRoot")) ? document.documentElement : document.body;
|
|
11046
11046
|
return target.classList.add(cn), function() {
|
|
11047
11047
|
target.classList.remove(cn);
|
|
11048
11048
|
};
|
|
@@ -11189,10 +11189,10 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
11189
11189
|
}
|
|
11190
11190
|
});
|
|
11191
11191
|
module2.exports = __toCommonJS2(TamaguiProvider_exports);
|
|
11192
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
11192
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_constants2 = 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();
|
|
11193
11193
|
function TamaguiProvider(param) {
|
|
11194
11194
|
var { children, disableInjectCSS, config, className, defaultTheme, disableRootThemeClass, reset, themeClassNameOnRoot } = param;
|
|
11195
|
-
return (0, import_useMedia.setupMediaListeners)(),
|
|
11195
|
+
return (0, import_useMedia.setupMediaListeners)(), process.env.TAMAGUI_REACT_19 || import_constants2.isClient && (0, import_constants2.useIsomorphicLayoutEffect)(function() {
|
|
11196
11196
|
if (config && !disableInjectCSS) {
|
|
11197
11197
|
var style = document.createElement("style");
|
|
11198
11198
|
return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), function() {
|
|
@@ -11202,25 +11202,37 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
11202
11202
|
}, [
|
|
11203
11203
|
config,
|
|
11204
11204
|
disableInjectCSS
|
|
11205
|
-
]), /* @__PURE__ */ (0, import_jsx_runtime.
|
|
11206
|
-
children:
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11205
|
+
]), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
11206
|
+
children: [
|
|
11207
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UnmountedClassName, {
|
|
11208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {
|
|
11209
|
+
animationDriver: config == null ? void 0 : config.animations,
|
|
11210
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeProvider.ThemeProvider, {
|
|
11211
|
+
themeClassNameOnRoot: themeClassNameOnRoot ?? (0, import_config.getSetting)("themeClassNameOnRoot"),
|
|
11212
|
+
disableRootThemeClass: disableRootThemeClass ?? (0, import_config.getSetting)("disableRootThemeClass"),
|
|
11213
|
+
defaultTheme: defaultTheme ?? (config ? Object.keys(config.themes)[0] : ""),
|
|
11214
|
+
reset,
|
|
11215
|
+
className,
|
|
11216
|
+
children
|
|
11217
|
+
})
|
|
11218
|
+
})
|
|
11219
|
+
}),
|
|
11220
|
+
process.env.TAMAGUI_REACT_19 && config && !disableInjectCSS && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
|
|
11221
|
+
// react 19 feature to hoist style tags to header:
|
|
11222
|
+
// https://react.dev/reference/react-dom/components/style
|
|
11223
|
+
// @ts-ignore
|
|
11224
|
+
precedence: "default",
|
|
11225
|
+
href: "tamagui-css",
|
|
11226
|
+
children: config.getCSS()
|
|
11227
|
+
}, "tamagui-css")
|
|
11228
|
+
]
|
|
11217
11229
|
});
|
|
11218
11230
|
}
|
|
11219
11231
|
function UnmountedClassName(props) {
|
|
11220
11232
|
var [mounted, setMounted] = import_react3.default.useState(!1);
|
|
11221
11233
|
return import_react3.default.useEffect(function() {
|
|
11222
11234
|
setMounted(!0);
|
|
11223
|
-
}, []),
|
|
11235
|
+
}, []), import_constants2.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
11224
11236
|
style: {
|
|
11225
11237
|
display: "contents"
|
|
11226
11238
|
},
|
|
@@ -11353,10 +11365,10 @@ var require_useGet_native = __commonJS({
|
|
|
11353
11365
|
}
|
|
11354
11366
|
});
|
|
11355
11367
|
module2.exports = __toCommonJS2(useGet_exports);
|
|
11356
|
-
var
|
|
11368
|
+
var import_constants2 = require_index_native3(), React3 = __toESM2(require("react"));
|
|
11357
11369
|
function useGet(currentValue, initialValue, forwardToFunction) {
|
|
11358
11370
|
var curRef = React3.useRef(initialValue ?? currentValue);
|
|
11359
|
-
return (0,
|
|
11371
|
+
return (0, import_constants2.useIsomorphicLayoutEffect)(function() {
|
|
11360
11372
|
curRef.current = currentValue;
|
|
11361
11373
|
}), React3.useCallback(forwardToFunction ? function() {
|
|
11362
11374
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
@@ -11675,7 +11687,7 @@ __export(src_exports, {
|
|
|
11675
11687
|
View: () => View
|
|
11676
11688
|
});
|
|
11677
11689
|
module.exports = __toCommonJS(src_exports);
|
|
11678
|
-
var
|
|
11690
|
+
var import_react_native_use_responder_events = __toESM(require_index_native()), import_web = __toESM(require_index_native9()), import_react2 = __toESM(require("react"));
|
|
11679
11691
|
|
|
11680
11692
|
// src/createOptimizedView.native.tsx
|
|
11681
11693
|
var import_react = __toESM(require("react"));
|
|
@@ -11866,6 +11878,127 @@ function getBaseViews() {
|
|
|
11866
11878
|
};
|
|
11867
11879
|
}
|
|
11868
11880
|
|
|
11881
|
+
// src/helpers/getBoundingClientRect.tsx
|
|
11882
|
+
var getBoundingClientRect = function(node) {
|
|
11883
|
+
var _node_getBoundingClientRect;
|
|
11884
|
+
if (!(!node || node.nodeType !== 1))
|
|
11885
|
+
return (_node_getBoundingClientRect = node.getBoundingClientRect) === null || _node_getBoundingClientRect === void 0 ? void 0 : _node_getBoundingClientRect.call(node);
|
|
11886
|
+
};
|
|
11887
|
+
|
|
11888
|
+
// src/helpers/getRect.tsx
|
|
11889
|
+
var getRect = function(node) {
|
|
11890
|
+
var rect = getBoundingClientRect(node);
|
|
11891
|
+
if (rect) {
|
|
11892
|
+
var { x, y, top, left } = rect;
|
|
11893
|
+
return {
|
|
11894
|
+
x,
|
|
11895
|
+
y,
|
|
11896
|
+
width: node.offsetWidth,
|
|
11897
|
+
height: node.offsetHeight,
|
|
11898
|
+
top,
|
|
11899
|
+
left
|
|
11900
|
+
};
|
|
11901
|
+
}
|
|
11902
|
+
};
|
|
11903
|
+
|
|
11904
|
+
// src/hooks/useElementLayout.tsx
|
|
11905
|
+
var import_constants = __toESM(require_index_native3());
|
|
11906
|
+
function _type_of(obj) {
|
|
11907
|
+
"@swc/helpers - typeof";
|
|
11908
|
+
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
11909
|
+
}
|
|
11910
|
+
var LayoutHandlers = /* @__PURE__ */ new WeakMap(), resizeListeners = /* @__PURE__ */ new Set(), resizeObserver = null;
|
|
11911
|
+
typeof window < "u" && "ResizeObserver" in window && (resizeObserver = new ResizeObserver(function(entries) {
|
|
11912
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
11913
|
+
try {
|
|
11914
|
+
for (var _loop = function() {
|
|
11915
|
+
var { target } = _step.value, onLayout = LayoutHandlers.get(target);
|
|
11916
|
+
if (typeof onLayout != "function") return {
|
|
11917
|
+
v: void 0
|
|
11918
|
+
};
|
|
11919
|
+
measureElement(target).then(function(event) {
|
|
11920
|
+
onLayout(event);
|
|
11921
|
+
});
|
|
11922
|
+
}, _iterator = entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
11923
|
+
var _ret = _loop();
|
|
11924
|
+
if (_type_of(_ret) === "object") return _ret.v;
|
|
11925
|
+
}
|
|
11926
|
+
} catch (err) {
|
|
11927
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
11928
|
+
} finally {
|
|
11929
|
+
try {
|
|
11930
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
11931
|
+
} finally {
|
|
11932
|
+
if (_didIteratorError)
|
|
11933
|
+
throw _iteratorError;
|
|
11934
|
+
}
|
|
11935
|
+
}
|
|
11936
|
+
}), typeof window.addEventListener == "function" && window.addEventListener("resize", function() {
|
|
11937
|
+
clearTimeout(tm), tm = setTimeout(function() {
|
|
11938
|
+
resizeListeners.forEach(function(cb) {
|
|
11939
|
+
return cb();
|
|
11940
|
+
});
|
|
11941
|
+
}, 4);
|
|
11942
|
+
}));
|
|
11943
|
+
var tm, measureElement = async function(target) {
|
|
11944
|
+
return new Promise(function(res) {
|
|
11945
|
+
measureLayout(target, null, function(x, y, width, height, left, top) {
|
|
11946
|
+
res({
|
|
11947
|
+
nativeEvent: {
|
|
11948
|
+
layout: {
|
|
11949
|
+
x,
|
|
11950
|
+
y,
|
|
11951
|
+
width,
|
|
11952
|
+
height,
|
|
11953
|
+
left,
|
|
11954
|
+
top
|
|
11955
|
+
},
|
|
11956
|
+
target
|
|
11957
|
+
},
|
|
11958
|
+
timeStamp: Date.now()
|
|
11959
|
+
});
|
|
11960
|
+
});
|
|
11961
|
+
});
|
|
11962
|
+
}, cache = /* @__PURE__ */ new WeakMap(), measureLayout = function(node, relativeTo, callback) {
|
|
11963
|
+
var relativeNode = relativeTo || (node == null ? void 0 : node.parentNode);
|
|
11964
|
+
if (relativeNode instanceof HTMLElement) {
|
|
11965
|
+
var now = Date.now();
|
|
11966
|
+
cache.set(node, now), Promise.all([
|
|
11967
|
+
getBoundingClientRectAsync(node),
|
|
11968
|
+
getBoundingClientRectAsync(relativeNode)
|
|
11969
|
+
]).then(function(param) {
|
|
11970
|
+
var [nodeDim, relativeNodeDim] = param;
|
|
11971
|
+
if (relativeNodeDim && nodeDim && cache.get(node) === now) {
|
|
11972
|
+
var { x, y, width, height, left, top } = getRelativeDimensions(nodeDim, relativeNodeDim);
|
|
11973
|
+
callback(x, y, width, height, left, top);
|
|
11974
|
+
}
|
|
11975
|
+
});
|
|
11976
|
+
}
|
|
11977
|
+
}, getRelativeDimensions = function(a, b) {
|
|
11978
|
+
var { height, left, top, width } = a, x = left - b.left, y = top - b.top;
|
|
11979
|
+
return {
|
|
11980
|
+
x,
|
|
11981
|
+
y,
|
|
11982
|
+
width,
|
|
11983
|
+
height,
|
|
11984
|
+
left,
|
|
11985
|
+
top
|
|
11986
|
+
};
|
|
11987
|
+
}, getBoundingClientRectAsync = function(element) {
|
|
11988
|
+
return new Promise(function(resolve) {
|
|
11989
|
+
function fallbackToSync() {
|
|
11990
|
+
resolve(getBoundingClientRect(element));
|
|
11991
|
+
}
|
|
11992
|
+
var tm = setTimeout(fallbackToSync, 10), observer = new IntersectionObserver(function(entries, ob) {
|
|
11993
|
+
var _entries_;
|
|
11994
|
+
clearTimeout(tm), ob.disconnect(), resolve((_entries_ = entries[0]) === null || _entries_ === void 0 ? void 0 : _entries_.boundingClientRect);
|
|
11995
|
+
}, {
|
|
11996
|
+
threshold: 1e-4
|
|
11997
|
+
});
|
|
11998
|
+
observer.observe(element);
|
|
11999
|
+
});
|
|
12000
|
+
};
|
|
12001
|
+
|
|
11869
12002
|
// src/vendor/Pressability.native.tsx
|
|
11870
12003
|
var Pressability = require_fake_react_native().default, usePressability = (init_idFn(), __toCommonJS(idFn_exports)).default;
|
|
11871
12004
|
|
|
@@ -11874,11 +12007,24 @@ __reExport(src_exports, __toESM(require_index_native9()), module.exports);
|
|
|
11874
12007
|
var baseViews = getBaseViews();
|
|
11875
12008
|
(0, import_web.setupHooks)({
|
|
11876
12009
|
getBaseViews,
|
|
12010
|
+
setElementProps: function(node) {
|
|
12011
|
+
if (node && !node.measure) {
|
|
12012
|
+
var _node, _node1, _node2;
|
|
12013
|
+
(_node = node).measure || (_node.measure = function(callback) {
|
|
12014
|
+
return measureLayout(node, null, callback);
|
|
12015
|
+
}), (_node1 = node).measureLayout || (_node1.measureLayout = function(relativeToNode, success) {
|
|
12016
|
+
return measureLayout(node, relativeToNode, success);
|
|
12017
|
+
}), (_node2 = node).measureInWindow || (_node2.measureInWindow = function(callback) {
|
|
12018
|
+
setTimeout(function() {
|
|
12019
|
+
var { height, left, top, width } = getRect(node);
|
|
12020
|
+
callback(left, top, width, height);
|
|
12021
|
+
}, 0);
|
|
12022
|
+
});
|
|
12023
|
+
}
|
|
12024
|
+
},
|
|
11877
12025
|
usePropsTransform(elementType, propsIn, stateRef, willHydrate) {
|
|
11878
12026
|
if (0) {
|
|
11879
12027
|
var isDOM, onMoveShouldSetResponder, onMoveShouldSetResponderCapture, onResponderEnd, onResponderGrant, onResponderMove, onResponderReject, onResponderRelease, onResponderStart, onResponderTerminate, onResponderTerminationRequest, onScrollShouldSetResponder, onScrollShouldSetResponderCapture, onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder, onStartShouldSetResponderCapture, collapsable, focusable, accessible, accessibilityDisabled, onLayout, hrefAttrs, plainDOMProps;
|
|
11880
|
-
if (willHydrate || isDOM)
|
|
11881
|
-
var hostRef;
|
|
11882
12028
|
if (isDOM && plainDOMProps.href && hrefAttrs)
|
|
11883
12029
|
var download, rel, target;
|
|
11884
12030
|
}
|