@tamagui/core 1.85.3 → 1.85.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/usePlatformMethods.js +1 -1
- package/dist/cjs/hooks/usePlatformMethods.js.map +1 -1
- package/dist/cjs/hooks/usePlatformMethods.native.js +1 -1
- package/dist/cjs/hooks/usePlatformMethods.native.js.map +1 -1
- package/dist/cjs/index.js +60 -50
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +1 -51
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/hooks/usePlatformMethods.js +1 -1
- package/dist/esm/hooks/usePlatformMethods.js.map +1 -1
- package/dist/esm/hooks/usePlatformMethods.native.js +1 -1
- package/dist/esm/hooks/usePlatformMethods.native.js.map +1 -1
- package/dist/esm/index.js +60 -50
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.native.js +4 -54
- package/dist/esm/index.native.js.map +1 -1
- package/dist/native.js +206 -363
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +179 -309
- package/dist/test.native.js.map +3 -3
- package/package.json +6 -6
- package/src/hooks/usePlatformMethods.ts +1 -1
- package/src/index.tsx +84 -69
- package/types/index.d.ts.map +1 -1
package/dist/native.js
CHANGED
|
@@ -42,7 +42,7 @@ var require_utils_native = __commonJS({
|
|
|
42
42
|
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), utils_exports = {};
|
|
43
43
|
__export2(utils_exports, {
|
|
44
44
|
canUseDOM: () => canUseDOM,
|
|
45
|
-
getBoundingClientRect: () =>
|
|
45
|
+
getBoundingClientRect: () => getBoundingClientRect,
|
|
46
46
|
getLowestCommonAncestor: () => getLowestCommonAncestor,
|
|
47
47
|
getResponderPaths: () => getResponderPaths,
|
|
48
48
|
hasTargetTouches: () => hasTargetTouches,
|
|
@@ -52,7 +52,7 @@ var require_utils_native = __commonJS({
|
|
|
52
52
|
setResponderId: () => setResponderId
|
|
53
53
|
});
|
|
54
54
|
module2.exports = __toCommonJS2(utils_exports);
|
|
55
|
-
var keyName = "__reactResponderId", canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement),
|
|
55
|
+
var keyName = "__reactResponderId", canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), getBoundingClientRect = (node) => {
|
|
56
56
|
if (node && node.nodeType === 1 && node.getBoundingClientRect)
|
|
57
57
|
return node.getBoundingClientRect();
|
|
58
58
|
};
|
|
@@ -900,10 +900,10 @@ var require_constants_native = __commonJS({
|
|
|
900
900
|
isWeb: () => isWeb,
|
|
901
901
|
isWebTouchable: () => isWebTouchable,
|
|
902
902
|
isWindowDefined: () => isWindowDefined,
|
|
903
|
-
useIsomorphicLayoutEffect: () =>
|
|
903
|
+
useIsomorphicLayoutEffect: () => useIsomorphicLayoutEffect
|
|
904
904
|
});
|
|
905
905
|
module2.exports = __toCommonJS2(constants_native_exports);
|
|
906
|
-
var import_react3 = require("react"), isWeb = !1, isWindowDefined = !1, isServer = !1, isClient = !1,
|
|
906
|
+
var import_react3 = require("react"), isWeb = !1, isWindowDefined = !1, isServer = !1, isClient = !1, useIsomorphicLayoutEffect = import_react3.useLayoutEffect, isChrome = !1, isWebTouchable = !1, isTouchable = !0, isAndroid = !1, isIos = !1, currentPlatform = "native";
|
|
907
907
|
}
|
|
908
908
|
});
|
|
909
909
|
|
|
@@ -949,7 +949,7 @@ var require_validStyleProps_native = __commonJS({
|
|
|
949
949
|
validStylesOnBaseProps: () => validStylesOnBaseProps
|
|
950
950
|
});
|
|
951
951
|
module2.exports = __toCommonJS2(validStyleProps_exports);
|
|
952
|
-
var
|
|
952
|
+
var import_constants = require_index_native3(), placeHolderTextColors = {
|
|
953
953
|
placeholderTextColor: !0
|
|
954
954
|
}, validStylesOnBaseProps = {
|
|
955
955
|
...placeHolderTextColors
|
|
@@ -1120,7 +1120,7 @@ var require_validStyleProps_native = __commonJS({
|
|
|
1120
1120
|
...validStylesOnBaseProps,
|
|
1121
1121
|
...stylePropsTransform,
|
|
1122
1122
|
...stylePropsUnitless,
|
|
1123
|
-
...
|
|
1123
|
+
...import_constants.isAndroid ? { elevationAndroid: !0 } : {}
|
|
1124
1124
|
}, stylePropsFont = {
|
|
1125
1125
|
fontFamily: !0,
|
|
1126
1126
|
fontSize: !0,
|
|
@@ -1241,7 +1241,7 @@ var require_config_native = __commonJS({
|
|
|
1241
1241
|
useTokens: () => useTokens
|
|
1242
1242
|
});
|
|
1243
1243
|
module2.exports = __toCommonJS2(config_exports);
|
|
1244
|
-
var
|
|
1244
|
+
var import_constants = require_index_native3(), conf, setConfig = (next) => {
|
|
1245
1245
|
conf = next;
|
|
1246
1246
|
}, setConfigFont = (name, font, fontParsed) => {
|
|
1247
1247
|
if (process.env.NODE_ENV === "development" && !conf)
|
|
@@ -1267,7 +1267,7 @@ var require_config_native = __commonJS({
|
|
|
1267
1267
|
}, getTokenObject = (value, group) => {
|
|
1268
1268
|
var _a, _b;
|
|
1269
1269
|
return conf.specificTokens[value] ?? (group ? (_a = tokensMerged[group]) == null ? void 0 : _a[value] : (_b = tokensMerged[Object.keys(tokensMerged).find((cat) => tokensMerged[cat][value]) || ""]) == null ? void 0 : _b[value]);
|
|
1270
|
-
}, getToken2 = (value, group, useVariable =
|
|
1270
|
+
}, getToken2 = (value, group, useVariable = import_constants.isWeb) => {
|
|
1271
1271
|
let token = getTokenObject(value, group);
|
|
1272
1272
|
return useVariable ? token == null ? void 0 : token.variable : token == null ? void 0 : token.val;
|
|
1273
1273
|
}, getTokenValue2 = (value, group) => getToken2(value, group, !1), useTokens = getTokens2, getThemes2 = () => conf.themes, configListeners = /* @__PURE__ */ new Set(), onConfiguredOnce = (cb) => {
|
|
@@ -1316,7 +1316,7 @@ var require_createVariable_native = __commonJS({
|
|
|
1316
1316
|
variableToString: () => variableToString
|
|
1317
1317
|
});
|
|
1318
1318
|
module2.exports = __toCommonJS2(createVariable_exports);
|
|
1319
|
-
var
|
|
1319
|
+
var import_constants = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native(), IS_VAR = "isVar", createVariable = (props, skipHash = !1) => {
|
|
1320
1320
|
if (!skipHash && isVariable(props))
|
|
1321
1321
|
return props;
|
|
1322
1322
|
let { key, name, val } = props;
|
|
@@ -1325,11 +1325,11 @@ var require_createVariable_native = __commonJS({
|
|
|
1325
1325
|
key,
|
|
1326
1326
|
name: skipHash ? "" : (0, import_helpers.simpleHash)(name, 40),
|
|
1327
1327
|
val,
|
|
1328
|
-
variable:
|
|
1328
|
+
variable: import_constants.isWeb ? skipHash ? `var(--${name})` : createCSSVariable(name) : ""
|
|
1329
1329
|
};
|
|
1330
1330
|
};
|
|
1331
1331
|
function variableToString(vrble, getValue = !1) {
|
|
1332
|
-
return isVariable(vrble) ? !getValue &&
|
|
1332
|
+
return isVariable(vrble) ? !getValue && import_constants.isWeb && vrble.variable ? vrble.variable : `${vrble.val}` : `${vrble || ""}`;
|
|
1333
1333
|
}
|
|
1334
1334
|
function isVariable(v) {
|
|
1335
1335
|
return v && typeof v == "object" && IS_VAR in v;
|
|
@@ -1384,7 +1384,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1384
1384
|
updateRules: () => updateRules
|
|
1385
1385
|
});
|
|
1386
1386
|
module2.exports = __toCommonJS2(insertStyleRule_exports);
|
|
1387
|
-
var
|
|
1387
|
+
var import_constants = require_index_native3(), import_createVariable = require_createVariable_native(), scannedCache = /* @__PURE__ */ new WeakMap(), totalSelectorsInserted = /* @__PURE__ */ new Map(), allSelectors = {}, allRules = {}, insertedTransforms = {}, getAllSelectors = () => allSelectors, getAllRules = () => Object.values(allRules), getAllTransforms = () => insertedTransforms;
|
|
1388
1388
|
function addTransform(identifier, css, rule) {
|
|
1389
1389
|
let s = css.indexOf("transform:");
|
|
1390
1390
|
if (s === -1) {
|
|
@@ -1396,7 +1396,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1396
1396
|
return insertedTransforms[identifier] = value, !0;
|
|
1397
1397
|
}
|
|
1398
1398
|
function listenForSheetChanges() {
|
|
1399
|
-
|
|
1399
|
+
import_constants.isClient && new MutationObserver((entries) => {
|
|
1400
1400
|
for (let entry of entries)
|
|
1401
1401
|
if (entry instanceof HTMLStyleElement && entry.sheet || entry instanceof HTMLLinkElement && entry.href.endsWith(".css")) {
|
|
1402
1402
|
scanAllSheets();
|
|
@@ -1408,7 +1408,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1408
1408
|
}
|
|
1409
1409
|
var lastScannedSheets = null;
|
|
1410
1410
|
function scanAllSheets(collectThemes = !1, tokens) {
|
|
1411
|
-
if (process.env.NODE_ENV === "test" || !
|
|
1411
|
+
if (process.env.NODE_ENV === "test" || !import_constants.isClient)
|
|
1412
1412
|
return;
|
|
1413
1413
|
let themes, sheets = document.styleSheets || [], prev = lastScannedSheets, current = new Set(sheets);
|
|
1414
1414
|
if (document.styleSheets) {
|
|
@@ -1529,7 +1529,7 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1529
1529
|
var getIdentifierFromTamaguiSelector = (selector) => {
|
|
1530
1530
|
let res = selector.slice(7);
|
|
1531
1531
|
return selector.includes(":") ? res.replace(/:[a-z]+$/, "") : res;
|
|
1532
|
-
}, sheet =
|
|
1532
|
+
}, sheet = import_constants.isClient ? document.head.appendChild(document.createElement("style")).sheet : null;
|
|
1533
1533
|
function updateRules(identifier, rules) {
|
|
1534
1534
|
return identifier in allRules ? !1 : (allRules[identifier] = rules.join(" "), identifier.startsWith("_transform") ? addTransform(identifier, rules[0]) : !0);
|
|
1535
1535
|
}
|
|
@@ -1642,7 +1642,7 @@ var require_pseudoDescriptors_native = __commonJS({
|
|
|
1642
1642
|
...pseudoDescriptorsBase,
|
|
1643
1643
|
enterStyle: {
|
|
1644
1644
|
name: "enter",
|
|
1645
|
-
|
|
1645
|
+
selector: ".t_unmounted",
|
|
1646
1646
|
priority: 4
|
|
1647
1647
|
},
|
|
1648
1648
|
exitStyle: {
|
|
@@ -1708,7 +1708,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1708
1708
|
useMedia: () => useMedia2
|
|
1709
1709
|
});
|
|
1710
1710
|
module2.exports = __toCommonJS2(useMedia_exports);
|
|
1711
|
-
var
|
|
1711
|
+
var import_constants = require_index_native3(), import_react3 = require("react"), import_config = require_config_native(), import_matchMedia = require_matchMedia_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_useDisableSSR = require_useDisableSSR_native(), mediaState2 = (
|
|
1712
1712
|
// development only safeguard
|
|
1713
1713
|
process.env.NODE_ENV === "development" ? new Proxy(
|
|
1714
1714
|
{},
|
|
@@ -1751,7 +1751,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1751
1751
|
}
|
|
1752
1752
|
var setupVersion = -1;
|
|
1753
1753
|
function setupMediaListeners() {
|
|
1754
|
-
if (!(
|
|
1754
|
+
if (!(import_constants.isWeb && import_constants.isServer) && setupVersion !== mediaVersion) {
|
|
1755
1755
|
setupVersion = mediaVersion, unlisten();
|
|
1756
1756
|
for (let key in mediaQueryConfig2) {
|
|
1757
1757
|
let update2 = function() {
|
|
@@ -1782,7 +1782,7 @@ var require_useMedia_native = __commonJS({
|
|
|
1782
1782
|
return listeners.add(subscriber), () => listeners.delete(subscriber);
|
|
1783
1783
|
}
|
|
1784
1784
|
function useMedia2(uid, componentContext) {
|
|
1785
|
-
let internal = (0, import_react3.useRef)(), initialState = ((0, import_useDisableSSR.getDisableSSR)(componentContext) || !
|
|
1785
|
+
let internal = (0, import_react3.useRef)(), initialState = ((0, import_useDisableSSR.getDisableSSR)(componentContext) || !import_constants.isWeb ? mediaState2 : initState) || {}, state = (0, import_react3.useSyncExternalStore)(
|
|
1786
1786
|
subscribe,
|
|
1787
1787
|
() => {
|
|
1788
1788
|
if (!internal.current)
|
|
@@ -2173,11 +2173,11 @@ var require_createShallowSetState_native = __commonJS({
|
|
|
2173
2173
|
mergeIfNotShallowEqual: () => mergeIfNotShallowEqual
|
|
2174
2174
|
});
|
|
2175
2175
|
module2.exports = __toCommonJS2(createShallowSetState_exports);
|
|
2176
|
-
function createShallowSetState(setter) {
|
|
2177
|
-
return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next));
|
|
2176
|
+
function createShallowSetState(setter, debug) {
|
|
2177
|
+
return (next) => setter((prev) => mergeIfNotShallowEqual(prev, next, debug));
|
|
2178
2178
|
}
|
|
2179
|
-
function mergeIfNotShallowEqual(prev, next) {
|
|
2180
|
-
return isEqualShallow(prev, next) ? prev : { ...prev, ...next };
|
|
2179
|
+
function mergeIfNotShallowEqual(prev, next, debug) {
|
|
2180
|
+
return isEqualShallow(prev, next) ? prev : (process.env.NODE_ENV === "development" && debug && console.warn("setStateShallow CHANGE", { prev, next }), { ...prev, ...next });
|
|
2181
2181
|
}
|
|
2182
2182
|
function isEqualShallow(prev, next) {
|
|
2183
2183
|
for (let key in next)
|
|
@@ -2930,13 +2930,13 @@ var require_normalizeValueWithProperty_native = __commonJS({
|
|
|
2930
2930
|
reverseMapClassNameToValue: () => reverseMapClassNameToValue
|
|
2931
2931
|
});
|
|
2932
2932
|
module2.exports = __toCommonJS2(normalizeValueWithProperty_exports);
|
|
2933
|
-
var
|
|
2933
|
+
var import_constants = require_index_native3(), import_helpers = require_index_native4(), import_insertStyleRule = require_insertStyleRule_native(), stylePropsAllPlusTransforms = {
|
|
2934
2934
|
...import_helpers.stylePropsAll,
|
|
2935
2935
|
translateX: !0,
|
|
2936
2936
|
translateY: !0
|
|
2937
2937
|
};
|
|
2938
2938
|
function normalizeValueWithProperty(value, property) {
|
|
2939
|
-
if (!
|
|
2939
|
+
if (!import_constants.isWeb || typeof value == "boolean" || property && property in import_helpers.stylePropsUnitless || property && !(property in stylePropsAllPlusTransforms))
|
|
2940
2940
|
return value;
|
|
2941
2941
|
let res = value;
|
|
2942
2942
|
return value && typeof value == "object" ? value : (typeof value == "number" ? res = `${value}px` : property && (res = `${res}`), res);
|
|
@@ -3022,13 +3022,13 @@ var require_expandStyles_native = __commonJS({
|
|
|
3022
3022
|
fixStyles: () => fixStyles
|
|
3023
3023
|
});
|
|
3024
3024
|
module2.exports = __toCommonJS2(expandStyles_exports);
|
|
3025
|
-
var
|
|
3025
|
+
var import_constants = require_index_native3(), import_normalizeShadow = require_normalizeShadow_native();
|
|
3026
3026
|
function fixStyles(style) {
|
|
3027
3027
|
"elevationAndroid" in style && (style.elevation = style.elevationAndroid, delete style.elevationAndroid), (style.shadowRadius || style.shadowColor || style.shadowOpacity || style.shadowOffset) && Object.assign(style, (0, import_normalizeShadow.normalizeShadow)(style));
|
|
3028
3028
|
for (let key in borderDefaults)
|
|
3029
3029
|
key in style && (style[borderDefaults[key]] ||= "solid");
|
|
3030
3030
|
}
|
|
3031
|
-
var nativeStyle =
|
|
3031
|
+
var nativeStyle = import_constants.isWeb ? null : "borderStyle", borderDefaults = {
|
|
3032
3032
|
borderWidth: "borderStyle",
|
|
3033
3033
|
borderBottomWidth: nativeStyle || "borderBottomStyle",
|
|
3034
3034
|
borderTopWidth: nativeStyle || "borderTopStyle",
|
|
@@ -3105,14 +3105,14 @@ var require_expandStyle_native = __commonJS({
|
|
|
3105
3105
|
expandStyle: () => expandStyle
|
|
3106
3106
|
});
|
|
3107
3107
|
module2.exports = __toCommonJS2(expandStyle_exports);
|
|
3108
|
-
var
|
|
3108
|
+
var import_constants = require_index_native3();
|
|
3109
3109
|
function expandStyle(key, value) {
|
|
3110
3110
|
if (0)
|
|
3111
3111
|
switch (key) {
|
|
3112
3112
|
case "textAlignVertical":
|
|
3113
3113
|
case "writingDirection":
|
|
3114
3114
|
}
|
|
3115
|
-
if (
|
|
3115
|
+
if (import_constants.isAndroid && key === "elevationAndroid")
|
|
3116
3116
|
return [["elevation", value]];
|
|
3117
3117
|
if (key in EXPANSIONS)
|
|
3118
3118
|
return EXPANSIONS[key].map((key2) => [key2, value]);
|
|
@@ -3133,7 +3133,7 @@ var require_expandStyle_native = __commonJS({
|
|
|
3133
3133
|
padding: all,
|
|
3134
3134
|
paddingHorizontal: horiz,
|
|
3135
3135
|
paddingVertical: vert,
|
|
3136
|
-
...
|
|
3136
|
+
...import_constants.isWeb && {
|
|
3137
3137
|
// react-native only supports borderStyle
|
|
3138
3138
|
borderStyle: ["TopStyle", "RightStyle", "BottomStyle", "LeftStyle"],
|
|
3139
3139
|
// react-native doesn't support X / Y
|
|
@@ -3289,9 +3289,9 @@ var require_propMapper_native = __commonJS({
|
|
|
3289
3289
|
propMapper: () => propMapper
|
|
3290
3290
|
});
|
|
3291
3291
|
module2.exports = __toCommonJS2(propMapper_exports);
|
|
3292
|
-
var
|
|
3292
|
+
var import_constants = require_index_native3(), import_helpers = require_index_native4(), import_config = require_config_native(), import_isDevTools = require_isDevTools_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_expandStylesAndRemoveNullishValues = require_expandStylesAndRemoveNullishValues_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), propMapper = (key, value, styleStateIn, subPropsIn) => {
|
|
3293
3293
|
var _a;
|
|
3294
|
-
if (lastFontFamilyToken = null, !
|
|
3294
|
+
if (lastFontFamilyToken = null, !import_constants.isAndroid && key === "elevationAndroid")
|
|
3295
3295
|
return;
|
|
3296
3296
|
if (value === "unset") {
|
|
3297
3297
|
let unsetVal = (_a = styleStateIn.conf.unset) == null ? void 0 : _a[key];
|
|
@@ -3530,14 +3530,14 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3530
3530
|
useSplitStyles: () => useSplitStyles
|
|
3531
3531
|
});
|
|
3532
3532
|
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
3533
|
-
var
|
|
3533
|
+
var import_constants = require_index_native3(), import_helpers = require_index_native4(), import_react3 = require("react"), 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(), IS_STATIC = process.env.IS_STATIC === "is_static", conf, PROP_SPLIT = "-";
|
|
3534
3534
|
function isValidStyleKey(key, staticConfig) {
|
|
3535
3535
|
let validStyleProps = staticConfig.validStyles ?? (staticConfig.isText ? import_helpers.stylePropsText : import_helpers.validStyles);
|
|
3536
3536
|
return key in validStyleProps || staticConfig.acceptTokens && key in staticConfig.acceptTokens;
|
|
3537
3537
|
}
|
|
3538
3538
|
var getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
|
|
3539
3539
|
var _a, _b, _c, _e, _f, _g;
|
|
3540
|
-
conf = conf || (0, import_config.getConfig)(),
|
|
3540
|
+
conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
3541
3541
|
let { shorthands } = conf, {
|
|
3542
3542
|
isHOC,
|
|
3543
3543
|
isText,
|
|
@@ -3547,7 +3547,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3547
3547
|
inlineWhenUnflattened,
|
|
3548
3548
|
parentStaticConfig,
|
|
3549
3549
|
acceptsClassName
|
|
3550
|
-
} = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName &&
|
|
3550
|
+
} = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClassNames, rulesToInsert = [], classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, style = {}, className = props.className ?? "", mediaStylesSeen = 0, styleState = {
|
|
3551
3551
|
curProps: { ...props },
|
|
3552
3552
|
classNames,
|
|
3553
3553
|
conf,
|
|
@@ -3562,7 +3562,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3562
3562
|
context,
|
|
3563
3563
|
debug
|
|
3564
3564
|
};
|
|
3565
|
-
process.env.NODE_ENV === "development" && debug && debug !== "profile" &&
|
|
3565
|
+
process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (console.groupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
|
|
3566
3566
|
props,
|
|
3567
3567
|
staticConfig,
|
|
3568
3568
|
shouldDoClasses,
|
|
@@ -3576,7 +3576,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3576
3576
|
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || keyInit in skipProps && !styleProps.noSkip && !isHOC)
|
|
3577
3577
|
continue;
|
|
3578
3578
|
let valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
3579
|
-
if (styleState.curProps[keyInit] = valInit, !
|
|
3579
|
+
if (styleState.curProps[keyInit] = valInit, !import_constants.isAndroid && keyInit === "elevationAndroid")
|
|
3580
3580
|
continue;
|
|
3581
3581
|
if (keyInit === "userSelect")
|
|
3582
3582
|
keyInit = "selectable", valInit = valInit !== "none";
|
|
@@ -3632,7 +3632,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3632
3632
|
isHOC && (parentStaticConfig == null ? void 0 : parentStaticConfig.variants) && keyInit in parentStaticConfig.variants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = (_a = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _a[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || parentVariant || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
3633
3633
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(
|
|
3634
3634
|
`\u{1F539}\u{1F539}\u{1F539}\u{1F539} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""} \u{1F539}\u{1F539}\u{1F539}\u{1F539}`
|
|
3635
|
-
), (0, import_log.log)({ isVariant, valInit, shouldPassProp }),
|
|
3635
|
+
), (0, import_log.log)({ isVariant, valInit, shouldPassProp }), import_constants.isClient && (0, import_log.log)({
|
|
3636
3636
|
variants,
|
|
3637
3637
|
variant: variants == null ? void 0 : variants[keyInit],
|
|
3638
3638
|
isVariant,
|
|
@@ -3649,7 +3649,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
3649
3649
|
if (next && (styleState.fontFamily = next), process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
3650
3650
|
console.groupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
3651
3651
|
try {
|
|
3652
|
-
!
|
|
3652
|
+
!import_constants.isServer && import_isDevTools.isDevTools && ((0, import_log.log)({
|
|
3653
3653
|
expanded,
|
|
3654
3654
|
styleProps,
|
|
3655
3655
|
componentState,
|
|
@@ -3691,20 +3691,15 @@ current`, {
|
|
|
3691
3691
|
Object.assign(pseudos[key], pseudoStyleObject);
|
|
3692
3692
|
continue;
|
|
3693
3693
|
}
|
|
3694
|
-
if (shouldDoClasses && !
|
|
3694
|
+
if (shouldDoClasses && !isExit) {
|
|
3695
3695
|
let pseudoStyles = (0, import_getStylesAtomic.generateAtomicStyles)(pseudoStyleObject, descriptor);
|
|
3696
3696
|
process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), (0, import_log.log)({ pseudoStyleObject, pseudoStyles }), console.groupEnd());
|
|
3697
3697
|
for (let psuedoStyle of pseudoStyles)
|
|
3698
3698
|
`${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}` in usedKeys || psuedoStyle.identifier;
|
|
3699
|
-
}
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
descriptorKey,
|
|
3704
|
-
descriptor,
|
|
3705
|
-
pseudoState,
|
|
3706
|
-
state: { ...componentState }
|
|
3707
|
-
}), console.groupEnd());
|
|
3699
|
+
}
|
|
3700
|
+
if (!shouldDoClasses || isExit || isEnter) {
|
|
3701
|
+
let descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
|
|
3702
|
+
isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, { isDisabled }), (0, import_log.log)({ pseudoStyleObject, isDisabled, descriptor, componentState }), console.groupEnd());
|
|
3708
3703
|
let importance = descriptor.priority;
|
|
3709
3704
|
for (let pkey in pseudoStyleObject) {
|
|
3710
3705
|
let val2 = pseudoStyleObject[pkey];
|
|
@@ -3739,7 +3734,7 @@ current`, {
|
|
|
3739
3734
|
let platform = key.slice(10);
|
|
3740
3735
|
if (
|
|
3741
3736
|
// supports web, ios, android
|
|
3742
|
-
platform !==
|
|
3737
|
+
platform !== import_constants.currentPlatform && // supports web, native
|
|
3743
3738
|
platform !== "native"
|
|
3744
3739
|
)
|
|
3745
3740
|
continue;
|
|
@@ -3844,7 +3839,7 @@ current`, {
|
|
|
3844
3839
|
if (
|
|
3845
3840
|
// is HOC we can just pass through the styles as props
|
|
3846
3841
|
// this fixes issues where style prop got merged with wrong priority
|
|
3847
|
-
!isHOC && (isValidStyleKey(key, staticConfig) ||
|
|
3842
|
+
!isHOC && (isValidStyleKey(key, staticConfig) || import_constants.isAndroid && key === "elevation")
|
|
3848
3843
|
) {
|
|
3849
3844
|
mergeStyle(styleState, key, val);
|
|
3850
3845
|
continue;
|
|
@@ -3861,7 +3856,7 @@ current`, {
|
|
|
3861
3856
|
}
|
|
3862
3857
|
}
|
|
3863
3858
|
}
|
|
3864
|
-
if (props.style && mergeStylePropIntoStyle(styleState, props.style), styleProps.noNormalize !== !1 && ((0, import_expandStyles.fixStyles)(style),
|
|
3859
|
+
if (props.style && mergeStylePropIntoStyle(styleState, props.style), styleProps.noNormalize !== !1 && ((0, import_expandStyles.fixStyles)(style), import_constants.isWeb && !staticConfig.isReactNative && (0, import_getStylesAtomic.styleToCSS)(style), styleState.transforms && Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
|
|
3865
3860
|
mergeTransform(style, key, val, !0);
|
|
3866
3861
|
}), parentSplitStyles && !shouldDoClasses))
|
|
3867
3862
|
for (let key in parentSplitStyles.style)
|
|
@@ -3911,12 +3906,12 @@ current`, {
|
|
|
3911
3906
|
};
|
|
3912
3907
|
function mergeStyle(styleState, key, val, disableNormalize = !1) {
|
|
3913
3908
|
let { classNames, viewProps, style, usedKeys, styleProps } = styleState;
|
|
3914
|
-
if (
|
|
3909
|
+
if (import_constants.isWeb && (val == null ? void 0 : val[0]) === "_")
|
|
3915
3910
|
classNames[key] = val, usedKeys[key] ||= 1;
|
|
3916
3911
|
else if (key in import_helpers.stylePropsTransform)
|
|
3917
3912
|
styleState.transforms ||= {}, styleState.transforms[key] = val;
|
|
3918
3913
|
else {
|
|
3919
|
-
let out =
|
|
3914
|
+
let out = import_constants.isWeb && !disableNormalize && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
3920
3915
|
key in import_helpers.validStylesOnBaseProps ? viewProps[key] = out : style[key] = out;
|
|
3921
3916
|
}
|
|
3922
3917
|
}
|
|
@@ -3943,7 +3938,7 @@ current`, {
|
|
|
3943
3938
|
Object.assign(isRNW ? styleState.classNames : styleState.style, style);
|
|
3944
3939
|
}
|
|
3945
3940
|
}
|
|
3946
|
-
var useInsertEffectCompat =
|
|
3941
|
+
var useInsertEffectCompat = import_constants.isWeb ? import_react3.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : () => {
|
|
3947
3942
|
}, useSplitStyles = (...args) => {
|
|
3948
3943
|
let res = getSplitStyles(...args);
|
|
3949
3944
|
return useInsertEffectCompat(() => {
|
|
@@ -4046,37 +4041,6 @@ var require_mergeProps_native = __commonJS({
|
|
|
4046
4041
|
}
|
|
4047
4042
|
});
|
|
4048
4043
|
|
|
4049
|
-
// ../web/dist/cjs/helpers/proxyThemeVariables.native.js
|
|
4050
|
-
var require_proxyThemeVariables_native = __commonJS({
|
|
4051
|
-
"../web/dist/cjs/helpers/proxyThemeVariables.native.js"(exports2, module2) {
|
|
4052
|
-
"use strict";
|
|
4053
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
4054
|
-
for (var name in all)
|
|
4055
|
-
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
4056
|
-
}, __copyProps2 = (to, from, except, desc) => {
|
|
4057
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
4058
|
-
for (let key of __getOwnPropNames2(from))
|
|
4059
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
4060
|
-
return to;
|
|
4061
|
-
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), proxyThemeVariables_exports = {};
|
|
4062
|
-
__export2(proxyThemeVariables_exports, {
|
|
4063
|
-
proxyThemeVariables: () => proxyThemeVariables
|
|
4064
|
-
});
|
|
4065
|
-
module2.exports = __toCommonJS2(proxyThemeVariables_exports);
|
|
4066
|
-
function proxyThemeVariables(obj) {
|
|
4067
|
-
return new Proxy(obj || {}, {
|
|
4068
|
-
has(target, key) {
|
|
4069
|
-
return Reflect.has(target, removeStarting$(key));
|
|
4070
|
-
},
|
|
4071
|
-
get(target, key) {
|
|
4072
|
-
return Reflect.get(target, removeStarting$(key));
|
|
4073
|
-
}
|
|
4074
|
-
});
|
|
4075
|
-
}
|
|
4076
|
-
var removeStarting$ = (str) => typeof str == "string" && str[0] === "$" ? str.slice(1) : str;
|
|
4077
|
-
}
|
|
4078
|
-
});
|
|
4079
|
-
|
|
4080
4044
|
// ../web/dist/cjs/helpers/ThemeManagerContext.native.js
|
|
4081
4045
|
var require_ThemeManagerContext_native = __commonJS({
|
|
4082
4046
|
"../web/dist/cjs/helpers/ThemeManagerContext.native.js"(exports2, module2) {
|
|
@@ -4117,7 +4081,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4117
4081
|
getManagers: () => getManagers
|
|
4118
4082
|
});
|
|
4119
4083
|
module2.exports = __toCommonJS2(ThemeManager_exports);
|
|
4120
|
-
var
|
|
4084
|
+
var import_constants = require_index_native3(), import_config = require_config_native(), import_constants2 = require_constants_native2(), emptyState = { name: "" };
|
|
4121
4085
|
function getHasThemeUpdatingProps(props) {
|
|
4122
4086
|
return !!(props.name || props.componentName || props.inverse || props.reset);
|
|
4123
4087
|
}
|
|
@@ -4130,7 +4094,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4130
4094
|
if (!parentManager)
|
|
4131
4095
|
throw process.env.NODE_ENV !== "production" ? new Error(
|
|
4132
4096
|
"No parent manager given, this is likely due to duplicated Tamagui dependencies. Check your lockfile for mis-matched versions. It could also be from an error somewhere else in your stack causing Tamagui to recieve undefined context, you can try putting some ErrorBoundary components around other areas of your app, or a Suspense boundary."
|
|
4133
|
-
) : "\u274C
|
|
4097
|
+
) : "\u274C 000";
|
|
4134
4098
|
if (this.parentManager = parentManager, !this.updateStateFromProps(props, !1))
|
|
4135
4099
|
return parentManager;
|
|
4136
4100
|
}
|
|
@@ -4188,10 +4152,9 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4188
4152
|
baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
|
|
4189
4153
|
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
4190
4154
|
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
4191
|
-
let base = baseName.split(
|
|
4192
|
-
process.env.NODE_ENV !== "production" && props.debug && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min, max }));
|
|
4155
|
+
let base = baseName.split(import_constants2.THEME_NAME_SEPARATOR), max = base.length, min = props.componentName && !nextName ? max : 0;
|
|
4193
4156
|
for (let i = max; i >= min; i--) {
|
|
4194
|
-
let prefix = base.slice(0, i).join(
|
|
4157
|
+
let prefix = base.slice(0, i).join(import_constants2.THEME_NAME_SEPARATOR);
|
|
4195
4158
|
props.inverse && (prefix = inverseThemeName(prefix));
|
|
4196
4159
|
let potentials = [];
|
|
4197
4160
|
if (prefix && prefix !== baseName && potentials.push(prefix), nextName && potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName), i === 1) {
|
|
@@ -4206,7 +4169,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4206
4169
|
}
|
|
4207
4170
|
if (componentPotentials.push(`${prefix}_${componentName}`), nextName) {
|
|
4208
4171
|
if (i > baseLen) {
|
|
4209
|
-
let prefixLessOne = base.slice(0, i - 1).join(
|
|
4172
|
+
let prefixLessOne = base.slice(0, i - 1).join(import_constants2.THEME_NAME_SEPARATOR);
|
|
4210
4173
|
if (prefixLessOne) {
|
|
4211
4174
|
let lessSpecific = `${prefixLessOne}_${nextName}_${componentName}`;
|
|
4212
4175
|
componentPotentials.unshift(lessSpecific);
|
|
@@ -4227,7 +4190,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4227
4190
|
baseName,
|
|
4228
4191
|
prefix
|
|
4229
4192
|
}), found) {
|
|
4230
|
-
let 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 =
|
|
4193
|
+
let 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_constants2.THEME_CLASSNAME_PREFIX, className = import_constants.isWeb ? `${pre}sub_theme ${pre}${!scheme || !restNames.length ? firstName : restNames.join("_")}` : "", parentState = (_a = baseManager || parentManager) == null ? void 0 : _a.state, parentName = parentState == null ? void 0 : parentState.name;
|
|
4231
4194
|
result = {
|
|
4232
4195
|
name: found,
|
|
4233
4196
|
parentName,
|
|
@@ -4239,7 +4202,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
4239
4202
|
break;
|
|
4240
4203
|
}
|
|
4241
4204
|
}
|
|
4242
|
-
return process.env.NODE_ENV !== "production" &&
|
|
4205
|
+
return process.env.NODE_ENV !== "production" && props.debug === "verbose" && typeof window < "u" && (console.groupCollapsed("ThemeManager.getState()"), console.info({ props, baseName, base, min, max }), console.warn("result", { result }), console.trace(), console.groupEnd()), result;
|
|
4243
4206
|
}
|
|
4244
4207
|
var inverseThemeName = (themeName) => themeName.startsWith("light") ? themeName.replace(/^light/, "dark") : themeName.replace(/^dark/, "light");
|
|
4245
4208
|
function getManagers(themeManager) {
|
|
@@ -4273,7 +4236,7 @@ var require_useTheme_native = __commonJS({
|
|
|
4273
4236
|
useThemeWithState: () => useThemeWithState
|
|
4274
4237
|
});
|
|
4275
4238
|
module2.exports = __toCommonJS2(useTheme_exports);
|
|
4276
|
-
var
|
|
4239
|
+
var import_constants = require_index_native3(), import_react3 = require("react"), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_createShallowSetState = require_createShallowSetState_native(), import_ThemeManager = require_ThemeManager_native(), import_ThemeManagerContext = require_ThemeManagerContext_native(), emptyProps = { name: null }, cached;
|
|
4277
4240
|
function getDefaultThemeProxied() {
|
|
4278
4241
|
if (cached)
|
|
4279
4242
|
return cached;
|
|
@@ -4288,10 +4251,10 @@ var require_useTheme_native = __commonJS({
|
|
|
4288
4251
|
props,
|
|
4289
4252
|
!1,
|
|
4290
4253
|
keys.current,
|
|
4291
|
-
|
|
4254
|
+
import_constants.isServer ? void 0 : () => {
|
|
4292
4255
|
var _a, _b;
|
|
4293
4256
|
let next = ((_a = props.shouldUpdate) == null ? void 0 : _a.call(props)) ?? (keys.current.length > 0 ? !0 : void 0);
|
|
4294
|
-
return process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && console.info(" \u{1F3A8} useTheme() shouldUpdate?", next, {
|
|
4257
|
+
return process.env.NODE_ENV === "development" && typeof props.debug == "string" && props.debug !== "profile" && console.info(" \u{1F3A8} useTheme() shouldUpdate?", next, {
|
|
4295
4258
|
shouldUpdateProp: (_b = props.shouldUpdate) == null ? void 0 : _b.call(props),
|
|
4296
4259
|
keys: [...keys.current]
|
|
4297
4260
|
}), next;
|
|
@@ -4338,7 +4301,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
4338
4301
|
else if (subkey === "get")
|
|
4339
4302
|
return (platform) => {
|
|
4340
4303
|
let outVal = (0, import_createVariable.getVariable)(val);
|
|
4341
|
-
if (platform !== "web" &&
|
|
4304
|
+
if (platform !== "web" && import_constants.isIos && !deopt && config.settings.fastSchemeChange && !someParentIsInversed(themeManager) && scheme) {
|
|
4342
4305
|
let oppositeThemeName = name.replace(
|
|
4343
4306
|
scheme === "dark" ? "dark" : "light",
|
|
4344
4307
|
scheme === "dark" ? "light" : "dark"
|
|
@@ -4403,7 +4366,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
4403
4366
|
if (forceShouldChange || next && !(forceUpdate !== !0 && !manager.getStateShouldChange(next, prevState)))
|
|
4404
4367
|
return next;
|
|
4405
4368
|
}
|
|
4406
|
-
if (
|
|
4369
|
+
if (import_constants.isServer || ((0, import_react3.useEffect)(() => {
|
|
4407
4370
|
if (!themeManager)
|
|
4408
4371
|
return;
|
|
4409
4372
|
if (props.inverse && !mounted) {
|
|
@@ -4493,7 +4456,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
4493
4456
|
(0, import_createShallowSetState.isEqualShallow)(prev.state, state2);
|
|
4494
4457
|
if (prev && shouldReturnPrev)
|
|
4495
4458
|
return prev;
|
|
4496
|
-
if (response.state = state2, process.env.NODE_ENV === "development" && props.debug &&
|
|
4459
|
+
if (response.state = state2, process.env.NODE_ENV === "development" && props.debug && import_constants.isClient) {
|
|
4497
4460
|
console.groupCollapsed(` \u{1F537} ${themeManager2.id} useChangeThemeEffect createState`);
|
|
4498
4461
|
let parentState = { ...parentManager == null ? void 0 : parentManager.state }, parentId = parentManager == null ? void 0 : parentManager.id, themeManagerState = { ...themeManager2.state };
|
|
4499
4462
|
console.info({
|
|
@@ -4565,7 +4528,7 @@ var require_Theme_native = __commonJS({
|
|
|
4565
4528
|
getThemedChildren: () => getThemedChildren
|
|
4566
4529
|
});
|
|
4567
4530
|
module2.exports = __toCommonJS2(Theme_exports);
|
|
4568
|
-
var
|
|
4531
|
+
var import_constants = 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_jsx_runtime = require("react/jsx-runtime"), Theme = (0, import_react3.forwardRef)(function({ children, ...props }, ref) {
|
|
4569
4532
|
if (props.disable)
|
|
4570
4533
|
return children;
|
|
4571
4534
|
let isRoot = !!props._isRoot, themeState = (0, import_useTheme.useChangeThemeEffect)(props, isRoot), finalChildren = props["disable-child-theme"] ? import_react3.Children.map(
|
|
@@ -4585,7 +4548,7 @@ var require_Theme_native = __commonJS({
|
|
|
4585
4548
|
let { themeManager, isNewTheme } = themeState;
|
|
4586
4549
|
if (!themeManager)
|
|
4587
4550
|
throw new Error(
|
|
4588
|
-
process.env.NODE_ENV === "development" ? "\u274C No theme found, either incorrect name, potential duplicate tamagui deps, or TamaguiProvider not providing themes." : "\u274C"
|
|
4551
|
+
process.env.NODE_ENV === "development" ? "\u274C No theme found, either incorrect name, potential duplicate tamagui deps, or TamaguiProvider not providing themes." : "\u274C 005"
|
|
4589
4552
|
);
|
|
4590
4553
|
let { shallow, forceClassName } = props, hasEverThemed = (0, import_react3.useRef)(!1), shouldRenderChildrenWithTheme = isNewTheme || props.inverse || hasEverThemed.current || forceClassName || isRoot;
|
|
4591
4554
|
if (shouldRenderChildrenWithTheme && (hasEverThemed.current = !0), !shouldRenderChildrenWithTheme)
|
|
@@ -4597,7 +4560,7 @@ var require_Theme_native = __commonJS({
|
|
|
4597
4560
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Theme, { name: themeManager.state.parentName, children: child.props.children })
|
|
4598
4561
|
) : child));
|
|
4599
4562
|
let elementsWithContext = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeManagerContext.ThemeManagerIDContext.Provider, { value: themeManager.id, children: next });
|
|
4600
|
-
return forceClassName === !1 ? elementsWithContext :
|
|
4563
|
+
return forceClassName === !1 ? elementsWithContext : import_constants.isWeb ? wrapThemeElements({
|
|
4601
4564
|
children: elementsWithContext,
|
|
4602
4565
|
themeState,
|
|
4603
4566
|
forceClassName,
|
|
@@ -4718,7 +4681,7 @@ var require_Slot_native = __commonJS({
|
|
|
4718
4681
|
Slottable: () => Slottable
|
|
4719
4682
|
});
|
|
4720
4683
|
module2.exports = __toCommonJS2(Slot_exports);
|
|
4721
|
-
var import_compose_refs = require_index_native5(),
|
|
4684
|
+
var import_compose_refs = require_index_native5(), import_constants = require_index_native3(), import_helpers = require_index_native4(), import_react3 = require("react"), import_jsx_runtime = require("react/jsx-runtime"), Slot = (0, import_react3.forwardRef)(function(props, forwardedRef) {
|
|
4722
4685
|
let { children, ...slotProps } = props;
|
|
4723
4686
|
if ((0, import_react3.isValidElement)(children)) {
|
|
4724
4687
|
let mergedProps = mergeSlotProps(children, slotProps);
|
|
@@ -4735,7 +4698,7 @@ var require_Slot_native = __commonJS({
|
|
|
4735
4698
|
Slot.displayName = "Slot";
|
|
4736
4699
|
var Slottable = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
|
4737
4700
|
Slottable.displayName = "Slottable";
|
|
4738
|
-
var pressMap =
|
|
4701
|
+
var pressMap = import_constants.isWeb ? {
|
|
4739
4702
|
onPress: "onClick",
|
|
4740
4703
|
onPressOut: "onMouseUp",
|
|
4741
4704
|
onPressIn: "onMouseDown"
|
|
@@ -4783,7 +4746,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4783
4746
|
spacedChildren: () => spacedChildren
|
|
4784
4747
|
});
|
|
4785
4748
|
module2.exports = __toCommonJS2(createComponent_exports);
|
|
4786
|
-
var import_compose_refs = require_index_native5(),
|
|
4749
|
+
var import_compose_refs = require_index_native5(), import_constants = require_index_native3(), import_helpers = require_index_native4(), import_use_did_finish_ssr = require_index_native6(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants2 = require_constants_native2(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_themeable = require_themeable_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(), import_jsx_runtime = require("react/jsx-runtime"), tamaguiConfig, time, debugKeyListeners, startVisualizer, mouseUps = /* @__PURE__ */ new Set();
|
|
4787
4750
|
if (typeof document < "u") {
|
|
4788
4751
|
let cancelTouches = () => {
|
|
4789
4752
|
mouseUps.forEach((x) => x()), mouseUps.clear();
|
|
@@ -4813,17 +4776,13 @@ var require_createComponent_native = __commonJS({
|
|
|
4813
4776
|
var BaseText, BaseView, hasSetupBaseViews = !1;
|
|
4814
4777
|
function createComponent(staticConfig) {
|
|
4815
4778
|
var _a;
|
|
4816
|
-
let config = null, defaultProps = staticConfig.defaultProps;
|
|
4779
|
+
let { componentName } = staticConfig, config = null, defaultProps = staticConfig.defaultProps;
|
|
4817
4780
|
(0, import_config.onConfiguredOnce)((conf) => {
|
|
4818
4781
|
var _a2;
|
|
4819
|
-
if (config = conf,
|
|
4820
|
-
let defaultForComponent = (_a2 = conf.defaultProps) == null ? void 0 : _a2[
|
|
4782
|
+
if (config = conf, componentName) {
|
|
4783
|
+
let defaultForComponent = (_a2 = conf.defaultProps) == null ? void 0 : _a2[componentName];
|
|
4821
4784
|
defaultForComponent && (defaultProps = { ...defaultForComponent, ...defaultProps });
|
|
4822
4785
|
}
|
|
4823
|
-
if (!tamaguiConfig && (tamaguiConfig = conf, !initialTheme)) {
|
|
4824
|
-
let next = conf.themes[Object.keys(conf.themes)[0]];
|
|
4825
|
-
initialTheme = (0, import_proxyThemeVariables.proxyThemeVariables)(next), process.env.NODE_ENV === "development" && (initialTheme || (0, import_log.log)("Warning: Missing theme"));
|
|
4826
|
-
}
|
|
4827
4786
|
});
|
|
4828
4787
|
let {
|
|
4829
4788
|
Component,
|
|
@@ -4832,14 +4791,14 @@ var require_createComponent_native = __commonJS({
|
|
|
4832
4791
|
isHOC,
|
|
4833
4792
|
validStyles: validStyles2 = {},
|
|
4834
4793
|
variants = {}
|
|
4835
|
-
} = staticConfig
|
|
4836
|
-
process.env.NODE_ENV === "development" && (_a = staticConfig.defaultProps) != null && _a.debug && process.env.IS_STATIC !== "is_static" && (0, import_log.log)(`\u{1F41B} [${
|
|
4794
|
+
} = staticConfig;
|
|
4795
|
+
process.env.NODE_ENV === "development" && (_a = staticConfig.defaultProps) != null && _a.debug && process.env.IS_STATIC !== "is_static" && (0, import_log.log)(`\u{1F41B} [${componentName || "Component"}]`, {
|
|
4837
4796
|
staticConfig,
|
|
4838
4797
|
defaultProps,
|
|
4839
4798
|
defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
|
|
4840
4799
|
});
|
|
4841
4800
|
let component = (0, import_react3.forwardRef)((propsIn, forwardedRef) => {
|
|
4842
|
-
var _a2, _b, _c, _d, _e, _f, _i, _j, _k, _l, _m, _n;
|
|
4801
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
4843
4802
|
let internalID = process.env.NODE_ENV === "development" ? (0, import_react3.useId)() : "";
|
|
4844
4803
|
if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
|
|
4845
4804
|
hasSetupBaseViews = !0;
|
|
@@ -4861,39 +4820,39 @@ var require_createComponent_native = __commonJS({
|
|
|
4861
4820
|
}
|
|
4862
4821
|
let curDefaultProps = styledContextProps ? { ...defaultProps, ...styledContextProps } : defaultProps, props = propsIn;
|
|
4863
4822
|
curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
|
|
4864
|
-
let debugProp = props.debug,
|
|
4865
|
-
process.env.NODE_ENV === "development" &&
|
|
4823
|
+
let debugProp = props.debug, componentName2 = props.componentName || staticConfig.componentName;
|
|
4824
|
+
process.env.NODE_ENV === "development" && import_constants.isClient && (0, import_react3.useEffect)(() => {
|
|
4866
4825
|
let overlay = null, debugVisualizerHandler = (show = !1) => {
|
|
4867
4826
|
let node = hostRef.current;
|
|
4868
4827
|
if (node)
|
|
4869
4828
|
if (show) {
|
|
4870
4829
|
overlay = document.createElement("span"), overlay.style.inset = "0px", overlay.style.zIndex = "1000000", overlay.style.position = "absolute", overlay.style.borderColor = "red", overlay.style.borderWidth = "1px", overlay.style.borderStyle = "dotted";
|
|
4871
4830
|
let dataAt = node.getAttribute("data-at") || "", dataIn = node.getAttribute("data-in") || "", tooltip = document.createElement("span");
|
|
4872
|
-
tooltip.style.position = "absolute", tooltip.style.top = "0px", tooltip.style.left = "0px", tooltip.style.padding = "3px", tooltip.style.background = "rgba(0,0,0,0.75)", tooltip.style.color = "rgba(255,255,255,1)", tooltip.style.fontSize = "12px", tooltip.style.lineHeight = "12px", tooltip.style.fontFamily = "monospace", tooltip.style.webkitFontSmoothing = "none", tooltip.innerText = `${
|
|
4831
|
+
tooltip.style.position = "absolute", tooltip.style.top = "0px", tooltip.style.left = "0px", tooltip.style.padding = "3px", tooltip.style.background = "rgba(0,0,0,0.75)", tooltip.style.color = "rgba(255,255,255,1)", tooltip.style.fontSize = "12px", tooltip.style.lineHeight = "12px", tooltip.style.fontFamily = "monospace", tooltip.style.webkitFontSmoothing = "none", tooltip.innerText = `${componentName2 || ""} ${dataAt} ${dataIn}`.trim(), overlay.appendChild(tooltip), node.appendChild(overlay);
|
|
4873
4832
|
} else
|
|
4874
4833
|
overlay && node.removeChild(overlay);
|
|
4875
4834
|
};
|
|
4876
4835
|
return debugKeyListeners ||= /* @__PURE__ */ new Set(), debugKeyListeners.add(debugVisualizerHandler), () => {
|
|
4877
4836
|
debugKeyListeners == null || debugKeyListeners.delete(debugVisualizerHandler);
|
|
4878
4837
|
};
|
|
4879
|
-
}, [
|
|
4880
|
-
let isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)();
|
|
4881
|
-
process.env.NODE_ENV === "development" && time && time`did-finish-ssr`;
|
|
4838
|
+
}, [componentName2]), process.env.NODE_ENV === "development" && time && time`start (ignore)`, process.env.NODE_ENV === "development" && time && time`did-finish-ssr`;
|
|
4882
4839
|
let stateRef = (0, import_react3.useRef)(
|
|
4883
4840
|
{}
|
|
4884
4841
|
);
|
|
4885
4842
|
process.env.NODE_ENV === "development" && time && time`stateref`;
|
|
4886
|
-
let hostRef = (0, import_react3.useRef)(null), animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars,
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4843
|
+
let hostRef = (0, import_react3.useRef)(null), animationsConfig = componentContext.animationDriver, useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations, hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationsConfig == null ? void 0 : animationsConfig.supportsCSSVars, curState = stateRef.current, willBeAnimatedClient = !!(hasAnimationProp && !isHOC && useAnimations || curState.hasAnimated), willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
4844
|
+
willBeAnimated && !curState.hasAnimated && (curState.hasAnimated = !0);
|
|
4845
|
+
let isHydrated = config != null && config.disableSSR ? !0 : (0, import_use_did_finish_ssr.useDidFinishSSR)(), presence = willBeAnimated && ((_c = animationsConfig == null ? void 0 : animationsConfig.usePresence) == null ? void 0 : _c.call(animationsConfig)) || null, presenceState = presence == null ? void 0 : presence[2], enterExitVariant = presenceState == null ? void 0 : presenceState.enterExitVariant, enterVariant = enterExitVariant ?? (presenceState == null ? void 0 : presenceState.enterVariant), hasEnterStyle = !!props.enterStyle, hasRNAnimation = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = staticConfig.isReactNative, isAnimated = willBeAnimated;
|
|
4846
|
+
!isReactNative && hasRNAnimation && !isHOC && !isHydrated && (isAnimated = !1, curState.willHydrate = !0), process.env.NODE_ENV === "development" && time && time`pre-use-state`;
|
|
4847
|
+
let initialState = hasEnterStyle || enterVariant ? isHydrated ? import_defaultComponentState.defaultComponentState : import_defaultComponentState.defaultComponentStateShouldEnter : import_defaultComponentState.defaultComponentStateMounted, states = (0, import_react3.useState)(initialState), state = props.forceStyle ? { ...states[0], [props.forceStyle]: !0 } : states[0], setState = states[1], setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, debugProp);
|
|
4848
|
+
if (isHydrated && state.unmounted === "should-enter" && (state.unmounted = !0), presenceState && isAnimated && isHydrated) {
|
|
4849
|
+
let isExiting2 = !presenceState.isPresent, exitVariant = enterExitVariant ?? presenceState.exitVariant;
|
|
4850
|
+
state.unmounted && enterVariant ? (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence ENTER "${enterVariant}"`), props[enterVariant] = !0) : isExiting2 && exitVariant && (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence EXIT "${enterVariant}"`), props[exitVariant] = !enterExitVariant);
|
|
4851
|
+
}
|
|
4852
|
+
let shouldAvoidClasses = !!(!import_constants.isWeb || isAnimated && !supportsCSSVars || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
|
|
4853
|
+
if (groupName && !curState.group) {
|
|
4895
4854
|
let listeners = /* @__PURE__ */ new Set();
|
|
4896
|
-
|
|
4855
|
+
curState.group = {
|
|
4897
4856
|
listeners,
|
|
4898
4857
|
emit(name, state2) {
|
|
4899
4858
|
listeners.forEach((l) => l(name, state2));
|
|
@@ -4908,7 +4867,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4908
4867
|
if (groupName) {
|
|
4909
4868
|
let groupContextState = componentContext.groups.state, og = setStateShallow;
|
|
4910
4869
|
setStateShallow = (state2) => {
|
|
4911
|
-
og(state2),
|
|
4870
|
+
og(state2), curState.group.emit(groupName, {
|
|
4912
4871
|
pseudo: state2
|
|
4913
4872
|
});
|
|
4914
4873
|
let next = {
|
|
@@ -4919,53 +4878,30 @@ var require_createComponent_native = __commonJS({
|
|
|
4919
4878
|
};
|
|
4920
4879
|
}
|
|
4921
4880
|
process.env.NODE_ENV === "development" && time && time`use-state`;
|
|
4922
|
-
let
|
|
4923
|
-
willBeAnimated && !supportsCSSVars && !presence && isHydrated && (import_constants3.isServer || state.unmounted === !0) && (isAnimated = !1), willBeAnimated && !stateRef.current.hasAnimated && (stateRef.current.hasAnimated = !0);
|
|
4924
|
-
let componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName, hasTextAncestor = !!(import_constants3.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_c = props.accessibilityState) == null ? void 0 : _c.disabled);
|
|
4881
|
+
let componentNameFinal = props.componentName || componentName2, componentClassName = props.asChild || !componentNameFinal ? "" : `is_${componentNameFinal}`, hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_d = props.accessibilityState) == null ? void 0 : _d.disabled);
|
|
4925
4882
|
process.env.NODE_ENV === "development" && time && time`use-context`;
|
|
4926
|
-
let element =
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
let isEntering = state.unmounted, isExiting2 = !presenceState.isPresent, enterExitVariant = presenceState.enterExitVariant, enterVariant = enterExitVariant ?? presenceState.enterVariant, exitVariant = enterExitVariant ?? presenceState.exitVariant;
|
|
4931
|
-
isEntering && enterVariant ? (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence ENTER "${enterVariant}"`), props[enterVariant] = !0) : isExiting2 && exitVariant && (process.env.NODE_ENV === "development" && debugProp === "verbose" && console.warn(`Animating presence EXIT "${enterVariant}"`), props[exitVariant] = !enterExitVariant);
|
|
4932
|
-
}
|
|
4933
|
-
}
|
|
4934
|
-
let isAnimatedReactNative = hasAnimationProp && (animationsConfig == null ? void 0 : animationsConfig.isReactNative), isReactNative = !!(staticConfig.isReactNative || isAnimatedReactNative), shouldAvoidClasses = !!(!import_constants3.isWeb || isAnimated || !staticConfig.acceptsClassName || propsIn.disableClassName), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, disableTheme = isHOC;
|
|
4935
|
-
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (stateRef.current.themeShallow = !0);
|
|
4883
|
+
let element = import_constants.isWeb && (!Component || typeof Component == "string") && props.tag || Component, elementType = isText ? BaseText || element || "span" : BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
4884
|
+
animationsConfig && isAnimated && (elementType = animationsConfig[isText ? "Text" : "View"] || elementType);
|
|
4885
|
+
let disableTheme = isHOC;
|
|
4886
|
+
process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (curState.themeShallow = !0);
|
|
4936
4887
|
let themeStateProps = {
|
|
4937
4888
|
name: props.theme,
|
|
4938
|
-
componentName,
|
|
4889
|
+
componentName: componentName2,
|
|
4939
4890
|
disable: disableTheme,
|
|
4940
|
-
shallow:
|
|
4891
|
+
shallow: curState.themeShallow,
|
|
4941
4892
|
inverse: props.themeInverse,
|
|
4942
4893
|
debug: debugProp
|
|
4943
4894
|
};
|
|
4944
|
-
typeof
|
|
4895
|
+
typeof curState.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = () => stateRef.current.isListeningToTheme), themeStateProps.deopt = willBeAnimated;
|
|
4945
4896
|
let isExiting = !state.unmounted && (presence == null ? void 0 : presence[0]) === !1;
|
|
4946
4897
|
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
4947
|
-
let name = `${
|
|
4898
|
+
let name = `${componentName2 || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = (hasEnterStyle ? "(hasEnter)" : "") + (isAnimated ? "(animated)" : "") + (isReactNative ? "(rnw)" : ""), dataIs = propsIn["data-is"] || "", banner = `${internalID} ${name}${dataIs ? ` ${dataIs}` : ""} ${type}`;
|
|
4948
4899
|
console.group(
|
|
4949
|
-
`%c ${banner} (
|
|
4900
|
+
`%c ${banner} (hydrated: ${isHydrated}) (unmounted: ${state.unmounted})`,
|
|
4950
4901
|
"background: green; color: white;"
|
|
4951
|
-
),
|
|
4902
|
+
), import_constants.isServer || (console.groupEnd(), console.groupEnd(), console.groupCollapsed(
|
|
4952
4903
|
`Info (collapsed): ${state.press || state.pressIn ? "PRESSED " : ""}${state.hover ? "HOVERED " : ""}${state.focus ? "FOCUSED" : " "}`
|
|
4953
|
-
), (0, import_log.log)({
|
|
4954
|
-
propsIn,
|
|
4955
|
-
props,
|
|
4956
|
-
state,
|
|
4957
|
-
staticConfig,
|
|
4958
|
-
elementType,
|
|
4959
|
-
themeStateProps,
|
|
4960
|
-
styledContext: { contextProps: styledContextProps, overriddenContextProps },
|
|
4961
|
-
presence,
|
|
4962
|
-
isAnimated,
|
|
4963
|
-
isHOC,
|
|
4964
|
-
hasAnimationProp,
|
|
4965
|
-
useAnimations,
|
|
4966
|
-
propsInOrder: Object.keys(propsIn),
|
|
4967
|
-
propsOrder: Object.keys(props)
|
|
4968
|
-
}), console.groupEnd());
|
|
4904
|
+
), (0, import_log.log)({ propsIn, props, state, staticConfig, elementType, themeStateProps }), (0, import_log.log)({ contextProps: styledContextProps, overriddenContextProps }), (0, import_log.log)({ presence, isAnimated, isHOC, hasAnimationProp, useAnimations }), console.groupEnd());
|
|
4969
4905
|
}
|
|
4970
4906
|
process.env.NODE_ENV === "development" && time && time`pre-theme-media`;
|
|
4971
4907
|
let [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
|
|
@@ -4977,18 +4913,17 @@ var require_createComponent_native = __commonJS({
|
|
|
4977
4913
|
let resolveValues = (
|
|
4978
4914
|
// if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
|
|
4979
4915
|
isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
|
|
4980
|
-
),
|
|
4916
|
+
), styleProps = {
|
|
4981
4917
|
mediaState: mediaState2,
|
|
4982
4918
|
noClassNames,
|
|
4983
4919
|
resolveValues,
|
|
4984
4920
|
isExiting,
|
|
4985
|
-
isAnimated
|
|
4986
|
-
keepStyleSSR
|
|
4921
|
+
isAnimated
|
|
4987
4922
|
}, splitStyles = (0, import_getSplitStyles.useSplitStyles)(
|
|
4988
4923
|
props,
|
|
4989
4924
|
staticConfig,
|
|
4990
4925
|
theme,
|
|
4991
|
-
((
|
|
4926
|
+
((_e = themeState == null ? void 0 : themeState.state) == null ? void 0 : _e.name) || "",
|
|
4992
4927
|
state,
|
|
4993
4928
|
styleProps,
|
|
4994
4929
|
null,
|
|
@@ -4996,15 +4931,12 @@ var require_createComponent_native = __commonJS({
|
|
|
4996
4931
|
elementType,
|
|
4997
4932
|
debugProp
|
|
4998
4933
|
);
|
|
4999
|
-
props.group && props.untilMeasured === "hide" && !
|
|
4934
|
+
props.group && props.untilMeasured === "hide" && !curState.hasMeasured && (splitStyles.style.opacity = 0), process.env.NODE_ENV === "development" && time && time`split-styles`, curState.isListeningToTheme = splitStyles.dynamicThemeAccess;
|
|
5000
4935
|
let isMediaArray = splitStyles.hasMedia && Array.isArray(splitStyles.hasMedia), shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || isMediaArray || noClassNames && splitStyles.hasMedia === !0, mediaListeningKeys = isMediaArray ? splitStyles.hasMedia : null;
|
|
5001
4936
|
(0, import_useMedia.setMediaShouldUpdate)(stateRef, {
|
|
5002
4937
|
enabled: shouldListenForMedia,
|
|
5003
4938
|
keys: mediaListeningKeys
|
|
5004
4939
|
});
|
|
5005
|
-
let isAnimatedReactNativeWeb = hasAnimationProp && isReactNative;
|
|
5006
|
-
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && (console.groupCollapsed(">>>"), (0, import_log.log)("props in", propsIn, "mapped to", props, "in order", Object.keys(props)), (0, import_log.log)("splitStyles", splitStyles), (0, import_log.log)("media", { shouldListenForMedia, isMediaArray, mediaListeningKeys }), (0, import_log.log)("className", Object.values(splitStyles.classNames)), import_constants3.isClient && (0, import_log.log)("ref", hostRef, "(click to view)"), console.groupEnd(), debugProp === "break"))
|
|
5007
|
-
debugger;
|
|
5008
4940
|
let {
|
|
5009
4941
|
viewProps: viewPropsIn,
|
|
5010
4942
|
pseudos,
|
|
@@ -5012,21 +4944,23 @@ var require_createComponent_native = __commonJS({
|
|
|
5012
4944
|
classNames,
|
|
5013
4945
|
space
|
|
5014
4946
|
} = splitStyles, propsWithAnimation = props, animationStyles;
|
|
5015
|
-
if (
|
|
4947
|
+
if (
|
|
4948
|
+
// if it supports css vars we run it on server too to get matching initial style
|
|
4949
|
+
(supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
4950
|
+
) {
|
|
5016
4951
|
let animations = useAnimations({
|
|
5017
4952
|
props: propsWithAnimation,
|
|
5018
4953
|
// if hydrating, send empty style
|
|
5019
4954
|
style: splitStylesStyle,
|
|
5020
|
-
// style: splitStylesStyle,
|
|
5021
4955
|
presence,
|
|
5022
4956
|
componentState: state,
|
|
5023
4957
|
styleProps,
|
|
5024
|
-
theme: (
|
|
4958
|
+
theme: (_f = themeState.state) == null ? void 0 : _f.theme,
|
|
5025
4959
|
pseudos: pseudos || null,
|
|
5026
4960
|
hostRef,
|
|
5027
4961
|
staticConfig
|
|
5028
4962
|
});
|
|
5029
|
-
isAnimated && animations && (animationStyles = animations.style), process.env.NODE_ENV === "development" && time && time`animations`;
|
|
4963
|
+
(isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style), process.env.NODE_ENV === "development" && time && time`animations`;
|
|
5030
4964
|
}
|
|
5031
4965
|
let {
|
|
5032
4966
|
asChild,
|
|
@@ -5061,7 +4995,7 @@ var require_createComponent_native = __commonJS({
|
|
|
5061
4995
|
|
|
5062
4996
|
If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`
|
|
5063
4997
|
), process.env.NODE_ENV === "development" && time && time`destructure`;
|
|
5064
|
-
let disabled = ((
|
|
4998
|
+
let disabled = ((_g = props.accessibilityState) == null ? void 0 : _g.disabled) || // @ts-expect-error (comes from core)
|
|
5065
4999
|
props.accessibilityDisabled, viewProps = nonTamaguiProps;
|
|
5066
5000
|
hasAnimationProp && props.tag && !props.role && !props.accessibilityRole && (viewProps.role = props.tag), isHOC && _themeProp && (viewProps.theme = _themeProp), groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
|
|
5067
5001
|
nonTamaguiProps.onLayout,
|
|
@@ -5070,24 +5004,26 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5070
5004
|
layout: e.nativeEvent.layout
|
|
5071
5005
|
}), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState((prev) => ({ ...prev })), stateRef.current.hasMeasured = !0;
|
|
5072
5006
|
}
|
|
5073
|
-
)), viewProps =
|
|
5007
|
+
)), viewProps = ((_i = (_h = import_setupHooks.hooks).usePropsTransform) == null ? void 0 : _i.call(
|
|
5008
|
+
_h,
|
|
5009
|
+
elementType,
|
|
5010
|
+
nonTamaguiProps,
|
|
5011
|
+
hostRef,
|
|
5012
|
+
curState.willHydrate
|
|
5013
|
+
)) ?? nonTamaguiProps;
|
|
5074
5014
|
let composedRef = (0, import_compose_refs.useComposedRefs)(hostRef, forwardedRef);
|
|
5075
|
-
viewProps.ref = composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText &&
|
|
5015
|
+
viewProps.ref = composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants.isWeb && !isHOC && import_react3.Children.toArray(props.children).forEach((item) => {
|
|
5076
5016
|
typeof item == "string" && item !== `
|
|
5077
5017
|
` && console.error(
|
|
5078
5018
|
`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`
|
|
5079
5019
|
);
|
|
5080
5020
|
}), process.env.NODE_ENV === "development" && time && time`events-hooks`;
|
|
5081
|
-
let
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
}), shouldSetMounted = needsMount && state.unmounted, { pseudoGroups, mediaGroups } = splitStyles;
|
|
5021
|
+
let { pseudoGroups, mediaGroups } = splitStyles;
|
|
5022
|
+
curState.unPress || (curState.unPress = () => setStateShallow({ press: !1, pressIn: !1 }));
|
|
5023
|
+
let unPress = curState.unPress, shouldEnter = state.unmounted;
|
|
5085
5024
|
(0, import_react3.useEffect)(() => {
|
|
5086
|
-
if (
|
|
5087
|
-
|
|
5088
|
-
setStateShallow({
|
|
5089
|
-
unmounted
|
|
5090
|
-
});
|
|
5025
|
+
if (shouldEnter) {
|
|
5026
|
+
setStateShallow({ unmounted: !1 });
|
|
5091
5027
|
return;
|
|
5092
5028
|
}
|
|
5093
5029
|
let disposeGroupsListener;
|
|
@@ -5120,16 +5056,15 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5120
5056
|
disposeGroupsListener == null || disposeGroupsListener(), mouseUps.delete(unPress);
|
|
5121
5057
|
};
|
|
5122
5058
|
}, [
|
|
5123
|
-
|
|
5124
|
-
state.unmounted,
|
|
5059
|
+
shouldEnter,
|
|
5125
5060
|
pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0,
|
|
5126
5061
|
mediaGroups ? Object.keys([...mediaGroups]).join("") : 0
|
|
5127
5062
|
]);
|
|
5128
|
-
let
|
|
5063
|
+
let fontFamily = isText ? splitStyles.fontFamily || ((_j = staticConfig.defaultProps) == null ? void 0 : _j.fontFamily) : null;
|
|
5129
5064
|
fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
|
|
5130
|
-
let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style =
|
|
5065
|
+
let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = animationStyles || splitStyles.style, className;
|
|
5131
5066
|
asChild === "except-style" || asChild === "except-style-web" || (viewProps.style = style);
|
|
5132
|
-
let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = runtimeHoverStyle || onHoverIn || onHoverOut, isHoverable =
|
|
5067
|
+
let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = runtimeHoverStyle || onHoverIn || onHoverOut, isHoverable = import_constants.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle);
|
|
5133
5068
|
process.env.NODE_ENV === "development" && time && time`events-setup`;
|
|
5134
5069
|
let events = shouldAttach && !isDisabled && !props.asChild ? {
|
|
5135
5070
|
onPressOut: attachPress ? (e) => {
|
|
@@ -5149,10 +5084,10 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5149
5084
|
runtimePressStyle && setStateShallow({
|
|
5150
5085
|
press: !0,
|
|
5151
5086
|
pressIn: !0
|
|
5152
|
-
}), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e),
|
|
5087
|
+
}), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e), import_constants.isWeb && mouseUps.add(unPress);
|
|
5153
5088
|
} : void 0,
|
|
5154
5089
|
onPress: attachPress ? (e) => {
|
|
5155
|
-
unPress(),
|
|
5090
|
+
unPress(), import_constants.isWeb && (onClick == null || onClick(e)), onPress == null || onPress(e);
|
|
5156
5091
|
} : void 0,
|
|
5157
5092
|
...attachPress && onLongPress && {
|
|
5158
5093
|
onLongPress: (e) => {
|
|
@@ -5181,7 +5116,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5181
5116
|
delayPressOut: viewProps.delayPressOut,
|
|
5182
5117
|
focusable: viewProps.focusable ?? !0,
|
|
5183
5118
|
minPressDuration: 0
|
|
5184
|
-
}), process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("events", { events, isHoverable, attachPress }), (
|
|
5119
|
+
}), process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("events", { events, isHoverable, attachPress }), (_l = (_k = import_setupHooks.hooks).useEvents) == null || _l.call(_k, viewProps, events, splitStyles, setStateShallow, staticConfig);
|
|
5185
5120
|
let direction = props.spaceDirection || "both";
|
|
5186
5121
|
process.env.NODE_ENV === "development" && time && time`hooks`;
|
|
5187
5122
|
let content = !children || asChild ? children : spacedChildren({
|
|
@@ -5201,9 +5136,9 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5201
5136
|
events,
|
|
5202
5137
|
staticConfig
|
|
5203
5138
|
)), useChildrenResult ? content = useChildrenResult : content = (0, import_react3.createElement)(elementType, viewProps, content);
|
|
5204
|
-
let ResetPresence = (
|
|
5205
|
-
willBeAnimated &&
|
|
5206
|
-
let groupState =
|
|
5139
|
+
let ResetPresence = (_m = config == null ? void 0 : config.animations) == null ? void 0 : _m.ResetPresence;
|
|
5140
|
+
willBeAnimated && hasEnterStyle && ResetPresence && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResetPresence, { children: content })), process.env.NODE_ENV === "development" && time && time`create-element`;
|
|
5141
|
+
let groupState = curState.group, subGroupContext = (0, import_react3.useMemo)(() => {
|
|
5207
5142
|
if (!(!groupState || !groupName))
|
|
5208
5143
|
return groupState.listeners.clear(), {
|
|
5209
5144
|
...componentContext.groups,
|
|
@@ -5211,7 +5146,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5211
5146
|
state: {
|
|
5212
5147
|
...componentContext.groups.state,
|
|
5213
5148
|
[groupName]: {
|
|
5214
|
-
pseudo:
|
|
5149
|
+
pseudo: import_defaultComponentState.defaultComponentStateMounted,
|
|
5215
5150
|
// capture just initial width and height if they exist
|
|
5216
5151
|
// will have top, left, width, height (not x, y)
|
|
5217
5152
|
layout: {
|
|
@@ -5236,23 +5171,23 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5236
5171
|
if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
|
|
5237
5172
|
console.groupCollapsed(`render <${typeof elementType == "string" ? elementType : "Component"} /> (${internalID}) with props`);
|
|
5238
5173
|
try {
|
|
5239
|
-
(0, import_log.log)("viewProps", viewProps), (0, import_log.log)("
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5174
|
+
(0, import_log.log)("viewProps", viewProps), (0, import_log.log)("children", content), typeof window < "u" && ((0, import_log.log)("props in", propsIn, "mapped to", props, "in order", Object.keys(props)), (0, import_log.log)({
|
|
5175
|
+
shouldListenForMedia,
|
|
5176
|
+
mediaListeningKeys,
|
|
5177
|
+
isMediaArray,
|
|
5243
5178
|
viewProps,
|
|
5179
|
+
hostRef,
|
|
5244
5180
|
state,
|
|
5245
5181
|
styleProps,
|
|
5246
5182
|
themeState,
|
|
5247
5183
|
isAnimated,
|
|
5248
|
-
isAnimatedReactNativeWeb,
|
|
5249
5184
|
defaultProps,
|
|
5250
5185
|
splitStyles,
|
|
5251
5186
|
animationStyles,
|
|
5252
5187
|
willBeAnimated,
|
|
5253
5188
|
isStringElement,
|
|
5254
|
-
classNamesIn: (
|
|
5255
|
-
classNamesOut: (
|
|
5189
|
+
classNamesIn: (_n = props.className) == null ? void 0 : _n.split(" "),
|
|
5190
|
+
classNamesOut: (_o = viewProps.className) == null ? void 0 : _o.split(" "),
|
|
5256
5191
|
events,
|
|
5257
5192
|
shouldAttach,
|
|
5258
5193
|
pseudos,
|
|
@@ -5266,10 +5201,11 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5266
5201
|
elementType,
|
|
5267
5202
|
initialState,
|
|
5268
5203
|
classNames
|
|
5269
|
-
});
|
|
5204
|
+
}));
|
|
5270
5205
|
} catch {
|
|
5271
5206
|
}
|
|
5272
|
-
console.groupEnd(),
|
|
5207
|
+
if (console.groupEnd(), debugProp === "break")
|
|
5208
|
+
debugger;
|
|
5273
5209
|
}
|
|
5274
5210
|
return process.env.NODE_ENV === "development" && time && (time`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(() => {
|
|
5275
5211
|
delete globalThis.willPrint, time.print(), time = null;
|
|
@@ -5316,7 +5252,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5316
5252
|
componentName: "Spacer",
|
|
5317
5253
|
validStyles: import_helpers.validStyles,
|
|
5318
5254
|
defaultProps: {
|
|
5319
|
-
...
|
|
5255
|
+
...import_constants2.stackDefaultStyles,
|
|
5320
5256
|
// avoid nesting issues
|
|
5321
5257
|
tag: "span",
|
|
5322
5258
|
size: !0,
|
|
@@ -5411,7 +5347,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
5411
5347
|
}
|
|
5412
5348
|
var AbsoluteFill = createComponent({
|
|
5413
5349
|
defaultProps: {
|
|
5414
|
-
...
|
|
5350
|
+
...import_constants2.stackDefaultStyles,
|
|
5415
5351
|
flexDirection: "column",
|
|
5416
5352
|
position: "absolute",
|
|
5417
5353
|
top: 0,
|
|
@@ -5790,7 +5726,7 @@ var require_createTamagui_native = __commonJS({
|
|
|
5790
5726
|
createTamagui: () => createTamagui
|
|
5791
5727
|
});
|
|
5792
5728
|
module2.exports = __toCommonJS2(createTamagui_exports);
|
|
5793
|
-
var
|
|
5729
|
+
var import_constants = 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();
|
|
5794
5730
|
function createTamagui(configIn) {
|
|
5795
5731
|
var _a;
|
|
5796
5732
|
if (createdConfigs.has(configIn))
|
|
@@ -5845,9 +5781,9 @@ ${JSON.stringify(
|
|
|
5845
5781
|
2
|
|
5846
5782
|
)}`
|
|
5847
5783
|
);
|
|
5848
|
-
|
|
5784
|
+
import_constants.isWeb && ((0, import_registerCSSVariable.registerCSSVariable)(variable), declarations.push((0, import_registerCSSVariable.variableToCSS)(variable, key === "zIndex")));
|
|
5849
5785
|
}
|
|
5850
|
-
if (
|
|
5786
|
+
if (import_constants.isWeb) {
|
|
5851
5787
|
let declarationsToRuleSet2 = function(decs, selector = "") {
|
|
5852
5788
|
return `:root${selector} {${sep}${[...decs].join(`;${sep}`)}${sep}}`;
|
|
5853
5789
|
};
|
|
@@ -5874,7 +5810,7 @@ ${JSON.stringify(
|
|
|
5874
5810
|
cssRuleSets,
|
|
5875
5811
|
getThemeRulesSets() {
|
|
5876
5812
|
let themeRuleSets = [];
|
|
5877
|
-
if (
|
|
5813
|
+
if (import_constants.isWeb)
|
|
5878
5814
|
for (let { names, theme } of dedupedThemes) {
|
|
5879
5815
|
let nextRules = (0, import_getThemeCSSRules.getThemeCSSRules)({
|
|
5880
5816
|
config: configIn,
|
|
@@ -6239,6 +6175,37 @@ var require_isTamaguiElement_native = __commonJS({
|
|
|
6239
6175
|
}
|
|
6240
6176
|
});
|
|
6241
6177
|
|
|
6178
|
+
// ../web/dist/cjs/helpers/proxyThemeVariables.native.js
|
|
6179
|
+
var require_proxyThemeVariables_native = __commonJS({
|
|
6180
|
+
"../web/dist/cjs/helpers/proxyThemeVariables.native.js"(exports2, module2) {
|
|
6181
|
+
"use strict";
|
|
6182
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
6183
|
+
for (var name in all)
|
|
6184
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
6185
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
6186
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
6187
|
+
for (let key of __getOwnPropNames2(from))
|
|
6188
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
6189
|
+
return to;
|
|
6190
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), proxyThemeVariables_exports = {};
|
|
6191
|
+
__export2(proxyThemeVariables_exports, {
|
|
6192
|
+
proxyThemeVariables: () => proxyThemeVariables
|
|
6193
|
+
});
|
|
6194
|
+
module2.exports = __toCommonJS2(proxyThemeVariables_exports);
|
|
6195
|
+
function proxyThemeVariables(obj) {
|
|
6196
|
+
return new Proxy(obj || {}, {
|
|
6197
|
+
has(target, key) {
|
|
6198
|
+
return Reflect.has(target, removeStarting$(key));
|
|
6199
|
+
},
|
|
6200
|
+
get(target, key) {
|
|
6201
|
+
return Reflect.get(target, removeStarting$(key));
|
|
6202
|
+
}
|
|
6203
|
+
});
|
|
6204
|
+
}
|
|
6205
|
+
var removeStarting$ = (str) => typeof str == "string" && str[0] === "$" ? str.slice(1) : str;
|
|
6206
|
+
}
|
|
6207
|
+
});
|
|
6208
|
+
|
|
6242
6209
|
// ../web/dist/cjs/internalWithTheme.native.js
|
|
6243
6210
|
var require_internalWithTheme_native = __commonJS({
|
|
6244
6211
|
"../web/dist/cjs/internalWithTheme.native.js"(exports2, module2) {
|
|
@@ -6280,10 +6247,10 @@ var require_useThemeName_native = __commonJS({
|
|
|
6280
6247
|
useThemeName: () => useThemeName
|
|
6281
6248
|
});
|
|
6282
6249
|
module2.exports = __toCommonJS2(useThemeName_exports);
|
|
6283
|
-
var
|
|
6250
|
+
var import_constants = require_index_native3(), import_react3 = require("react"), import_ThemeManagerContext = require_ThemeManagerContext_native(), import_useTheme = require_useTheme_native();
|
|
6284
6251
|
function useThemeName(opts) {
|
|
6285
6252
|
let manager = (0, import_useTheme.getThemeManager)((0, import_react3.useContext)(import_ThemeManagerContext.ThemeManagerIDContext)), [name, setName] = (0, import_react3.useState)((manager == null ? void 0 : manager.state.name) || "");
|
|
6286
|
-
return (0,
|
|
6253
|
+
return (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
6287
6254
|
if (manager)
|
|
6288
6255
|
return setName(manager.state.name), manager.onChangeTheme((next, manager2) => {
|
|
6289
6256
|
let name2 = opts != null && opts.parent && manager2.state.parentName || next;
|
|
@@ -6339,7 +6306,7 @@ var require_useIsTouchDevice_native = __commonJS({
|
|
|
6339
6306
|
useIsTouchDevice: () => useIsTouchDevice
|
|
6340
6307
|
});
|
|
6341
6308
|
module2.exports = __toCommonJS2(useIsTouchDevice_exports);
|
|
6342
|
-
var
|
|
6309
|
+
var import_constants = require_index_native3(), import_use_did_finish_ssr = require_index_native6(), useIsTouchDevice = () => import_constants.isWeb ? (0, import_use_did_finish_ssr.useDidFinishSSR)() ? import_constants.isTouchable : !1 : !0;
|
|
6343
6310
|
}
|
|
6344
6311
|
});
|
|
6345
6312
|
|
|
@@ -6360,9 +6327,9 @@ var require_Stack_native = __commonJS({
|
|
|
6360
6327
|
Stack: () => Stack2
|
|
6361
6328
|
});
|
|
6362
6329
|
module2.exports = __toCommonJS2(Stack_exports);
|
|
6363
|
-
var import_helpers = require_index_native4(),
|
|
6330
|
+
var import_helpers = require_index_native4(), import_constants = require_constants_native2(), import_createComponent = require_createComponent_native(), Stack2 = (0, import_createComponent.createComponent)({
|
|
6364
6331
|
acceptsClassName: !0,
|
|
6365
|
-
defaultProps:
|
|
6332
|
+
defaultProps: import_constants.stackDefaultStyles,
|
|
6366
6333
|
validStyles: import_helpers.validStyles
|
|
6367
6334
|
});
|
|
6368
6335
|
Stack2.displayName = "Stack";
|
|
@@ -6447,9 +6414,9 @@ var require_View_native = __commonJS({
|
|
|
6447
6414
|
View: () => View2
|
|
6448
6415
|
});
|
|
6449
6416
|
module2.exports = __toCommonJS2(View_exports);
|
|
6450
|
-
var import_helpers = require_index_native4(),
|
|
6417
|
+
var import_helpers = require_index_native4(), import_constants = require_constants_native2(), import_createComponent = require_createComponent_native(), View2 = (0, import_createComponent.createComponent)({
|
|
6451
6418
|
acceptsClassName: !0,
|
|
6452
|
-
defaultProps:
|
|
6419
|
+
defaultProps: import_constants.stackDefaultStyles,
|
|
6453
6420
|
validStyles: import_helpers.validStyles
|
|
6454
6421
|
});
|
|
6455
6422
|
}
|
|
@@ -6524,10 +6491,10 @@ var require_ThemeProvider_native = __commonJS({
|
|
|
6524
6491
|
ThemeProvider: () => ThemeProvider
|
|
6525
6492
|
});
|
|
6526
6493
|
module2.exports = __toCommonJS2(ThemeProvider_exports);
|
|
6527
|
-
var
|
|
6494
|
+
var import_constants = require_index_native3(), import_react3 = require("react"), import_constants2 = require_constants_native2(), import_Theme = require_Theme_native(), import_jsx_runtime = require("react/jsx-runtime"), ThemeProvider = (props) => (import_constants.isClient && (0, import_react3.useLayoutEffect)(() => {
|
|
6528
6495
|
if (props.disableRootThemeClass)
|
|
6529
6496
|
return;
|
|
6530
|
-
let cn = `${
|
|
6497
|
+
let cn = `${import_constants2.THEME_CLASSNAME_PREFIX}${props.defaultTheme}`, target = props.themeClassNameOnRoot ? document.documentElement : document.body;
|
|
6531
6498
|
return target.classList.add(cn), () => {
|
|
6532
6499
|
target.classList.remove(cn);
|
|
6533
6500
|
};
|
|
@@ -6593,20 +6560,20 @@ var require_TamaguiProvider_native = __commonJS({
|
|
|
6593
6560
|
TamaguiProvider: () => TamaguiProvider
|
|
6594
6561
|
});
|
|
6595
6562
|
module2.exports = __toCommonJS2(TamaguiProvider_exports);
|
|
6596
|
-
var
|
|
6563
|
+
var import_constants = require_index_native3(), React = __toESM2(require("react")), import_ComponentContext = require_ComponentContext_native(), import_useMedia = require_useMedia_native(), import_ThemeProvider = require_ThemeProvider_native(), import_jsx_runtime = require("react/jsx-runtime");
|
|
6597
6564
|
function TamaguiProvider({
|
|
6598
6565
|
children,
|
|
6599
6566
|
disableInjectCSS,
|
|
6600
6567
|
config,
|
|
6601
6568
|
...themePropsProvider
|
|
6602
6569
|
}) {
|
|
6603
|
-
return (0, import_useMedia.setupMediaListeners)(),
|
|
6604
|
-
if (document.documentElement.classList.contains("t_unmounted") && document.documentElement.classList.remove("t_unmounted"), disableInjectCSS)
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
}
|
|
6570
|
+
return (0, import_useMedia.setupMediaListeners)(), import_constants.isClient && React.useLayoutEffect(() => {
|
|
6571
|
+
if (config.disableSSR || document.documentElement.classList.contains("t_unmounted") && document.documentElement.classList.remove("t_unmounted"), !disableInjectCSS) {
|
|
6572
|
+
let style = document.createElement("style");
|
|
6573
|
+
return style.appendChild(document.createTextNode(config.getCSS())), document.head.appendChild(style), () => {
|
|
6574
|
+
document.head.removeChild(style);
|
|
6575
|
+
};
|
|
6576
|
+
}
|
|
6610
6577
|
}, [config, disableInjectCSS]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { animationDriver: config.animations, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
6611
6578
|
import_ThemeProvider.ThemeProvider,
|
|
6612
6579
|
{
|
|
@@ -6664,10 +6631,10 @@ var require_useGet_native = __commonJS({
|
|
|
6664
6631
|
useGet: () => useGet
|
|
6665
6632
|
});
|
|
6666
6633
|
module2.exports = __toCommonJS2(useGet_exports);
|
|
6667
|
-
var
|
|
6634
|
+
var import_constants = require_index_native3(), import_react3 = require("react");
|
|
6668
6635
|
function useGet(currentValue, initialValue, forwardToFunction) {
|
|
6669
6636
|
let curRef = (0, import_react3.useRef)(initialValue ?? currentValue);
|
|
6670
|
-
return (0,
|
|
6637
|
+
return (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
6671
6638
|
curRef.current = currentValue;
|
|
6672
6639
|
}), (0, import_react3.useCallback)(
|
|
6673
6640
|
forwardToFunction ? (...args) => {
|
|
@@ -7089,80 +7056,6 @@ function getBaseViews() {
|
|
|
7089
7056
|
};
|
|
7090
7057
|
}
|
|
7091
7058
|
|
|
7092
|
-
// src/hooks/useElementLayout.tsx
|
|
7093
|
-
var import_constants = __toESM(require_index_native3());
|
|
7094
|
-
|
|
7095
|
-
// src/helpers/getBoundingClientRect.tsx
|
|
7096
|
-
var getBoundingClientRect = (node) => {
|
|
7097
|
-
var _a;
|
|
7098
|
-
if (!(!node || node.nodeType !== 1))
|
|
7099
|
-
return (_a = node.getBoundingClientRect) == null ? void 0 : _a.call(node);
|
|
7100
|
-
};
|
|
7101
|
-
|
|
7102
|
-
// src/helpers/getRect.tsx
|
|
7103
|
-
var getRect = (node) => {
|
|
7104
|
-
let rect = getBoundingClientRect(node);
|
|
7105
|
-
if (!rect)
|
|
7106
|
-
return;
|
|
7107
|
-
let { x, y, top, left } = rect;
|
|
7108
|
-
return { x, y, width: node.offsetWidth, height: node.offsetHeight, top, left };
|
|
7109
|
-
};
|
|
7110
|
-
|
|
7111
|
-
// src/hooks/useElementLayout.tsx
|
|
7112
|
-
var LayoutHandlers = /* @__PURE__ */ new WeakMap(), LayoutTimeouts = /* @__PURE__ */ new WeakMap(), resizeObserver = null;
|
|
7113
|
-
typeof window < "u" && "ResizeObserver" in window && (resizeObserver = new ResizeObserver((entries) => {
|
|
7114
|
-
for (let { target } of entries) {
|
|
7115
|
-
let onLayout = LayoutHandlers.get(target);
|
|
7116
|
-
if (typeof onLayout != "function")
|
|
7117
|
-
return;
|
|
7118
|
-
measureLayout(target, null, (x, y, width, height, left, top) => {
|
|
7119
|
-
onLayout({
|
|
7120
|
-
nativeEvent: {
|
|
7121
|
-
layout: { x, y, width, height, left, top },
|
|
7122
|
-
target
|
|
7123
|
-
},
|
|
7124
|
-
timeStamp: Date.now()
|
|
7125
|
-
});
|
|
7126
|
-
});
|
|
7127
|
-
}
|
|
7128
|
-
}));
|
|
7129
|
-
var measureLayout = (node, relativeTo, callback) => {
|
|
7130
|
-
let relativeNode = relativeTo || (node == null ? void 0 : node.parentNode);
|
|
7131
|
-
if (relativeNode instanceof HTMLElement) {
|
|
7132
|
-
clearTimeout(LayoutTimeouts.get(relativeNode));
|
|
7133
|
-
let tm = setTimeout(() => {
|
|
7134
|
-
let relativeRect = getBoundingClientRect(relativeNode), { height, left, top, width } = getRect(node), x = left - relativeRect.left, y = top - relativeRect.top;
|
|
7135
|
-
callback(x, y, width, height, left, top), LayoutTimeouts.delete(relativeNode);
|
|
7136
|
-
}, 0);
|
|
7137
|
-
LayoutTimeouts.set(relativeNode, tm);
|
|
7138
|
-
}
|
|
7139
|
-
};
|
|
7140
|
-
function useElementLayout(ref, onLayout) {
|
|
7141
|
-
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
7142
|
-
if (!resizeObserver || !onLayout)
|
|
7143
|
-
return;
|
|
7144
|
-
let node = ref.current;
|
|
7145
|
-
if (node)
|
|
7146
|
-
return LayoutHandlers.set(node, onLayout), resizeObserver.observe(node), () => {
|
|
7147
|
-
resizeObserver == null || resizeObserver.unobserve(node);
|
|
7148
|
-
};
|
|
7149
|
-
}, [ref, onLayout]);
|
|
7150
|
-
}
|
|
7151
|
-
|
|
7152
|
-
// src/hooks/usePlatformMethods.ts
|
|
7153
|
-
var import_constants2 = __toESM(require_index_native3());
|
|
7154
|
-
function usePlatformMethods(hostRef) {
|
|
7155
|
-
(0, import_constants2.useIsomorphicLayoutEffect)(() => {
|
|
7156
|
-
let node = hostRef.current;
|
|
7157
|
-
node && (node.measure = (callback) => measureLayout(node, null, callback), node.measureLayout = (relativeToNode, success) => measureLayout(node, relativeToNode, success), node.measureInWindow = (callback) => {
|
|
7158
|
-
node && setTimeout(() => {
|
|
7159
|
-
let { height, left, top, width } = getRect(node);
|
|
7160
|
-
callback(left, top, width, height);
|
|
7161
|
-
}, 0);
|
|
7162
|
-
});
|
|
7163
|
-
}, [hostRef]);
|
|
7164
|
-
}
|
|
7165
|
-
|
|
7166
7059
|
// src/vendor/Pressability.native.tsx
|
|
7167
7060
|
var Pressability = require_fake_react_native().default, usePressability = (init_idFn(), __toCommonJS(idFn_exports)).default;
|
|
7168
7061
|
|
|
@@ -7171,57 +7064,7 @@ __reExport(src_exports, __toESM(require_index_native9()), module.exports);
|
|
|
7171
7064
|
var baseViews = getBaseViews();
|
|
7172
7065
|
(0, import_web.setupHooks)({
|
|
7173
7066
|
getBaseViews,
|
|
7174
|
-
usePropsTransform(elementType, propsIn, hostRef) {
|
|
7175
|
-
let {
|
|
7176
|
-
// event props
|
|
7177
|
-
onMoveShouldSetResponder,
|
|
7178
|
-
onMoveShouldSetResponderCapture,
|
|
7179
|
-
onResponderEnd,
|
|
7180
|
-
onResponderGrant,
|
|
7181
|
-
onResponderMove,
|
|
7182
|
-
onResponderReject,
|
|
7183
|
-
onResponderRelease,
|
|
7184
|
-
onResponderStart,
|
|
7185
|
-
onResponderTerminate,
|
|
7186
|
-
onResponderTerminationRequest,
|
|
7187
|
-
onScrollShouldSetResponder,
|
|
7188
|
-
onScrollShouldSetResponderCapture,
|
|
7189
|
-
onSelectionChangeShouldSetResponder,
|
|
7190
|
-
onSelectionChangeShouldSetResponderCapture,
|
|
7191
|
-
onStartShouldSetResponder,
|
|
7192
|
-
onStartShouldSetResponderCapture,
|
|
7193
|
-
// android
|
|
7194
|
-
collapsable,
|
|
7195
|
-
focusable,
|
|
7196
|
-
// deprecated,
|
|
7197
|
-
accessible,
|
|
7198
|
-
accessibilityDisabled,
|
|
7199
|
-
onLayout,
|
|
7200
|
-
hrefAttrs,
|
|
7201
|
-
...viewProps
|
|
7202
|
-
} = propsIn;
|
|
7203
|
-
if (usePlatformMethods(hostRef), useElementLayout(hostRef, onLayout), (0, import_react_native_use_responder_events.useResponderEvents)(hostRef, {
|
|
7204
|
-
onMoveShouldSetResponder,
|
|
7205
|
-
onMoveShouldSetResponderCapture,
|
|
7206
|
-
onResponderEnd,
|
|
7207
|
-
onResponderGrant,
|
|
7208
|
-
onResponderMove,
|
|
7209
|
-
onResponderReject,
|
|
7210
|
-
onResponderRelease,
|
|
7211
|
-
onResponderStart,
|
|
7212
|
-
onResponderTerminate,
|
|
7213
|
-
onResponderTerminationRequest,
|
|
7214
|
-
onScrollShouldSetResponder,
|
|
7215
|
-
onScrollShouldSetResponderCapture,
|
|
7216
|
-
onSelectionChangeShouldSetResponder,
|
|
7217
|
-
onSelectionChangeShouldSetResponderCapture,
|
|
7218
|
-
onStartShouldSetResponder,
|
|
7219
|
-
onStartShouldSetResponderCapture
|
|
7220
|
-
}), viewProps.href && hrefAttrs) {
|
|
7221
|
-
let { download, rel, target } = hrefAttrs;
|
|
7222
|
-
download != null && (viewProps.download = download), rel && (viewProps.rel = rel), typeof target == "string" && (viewProps.target = target.charAt(0) !== "_" ? `_${target}` : target);
|
|
7223
|
-
}
|
|
7224
|
-
return viewProps;
|
|
7067
|
+
usePropsTransform(elementType, propsIn, hostRef, willHydrate) {
|
|
7225
7068
|
},
|
|
7226
7069
|
useEvents(viewProps, events, { pseudos }, setStateShallow, staticConfig) {
|
|
7227
7070
|
if (events && (events.onFocus && (viewProps.onFocus = events.onFocus), events.onBlur && (viewProps.onBlur = events.onBlur)), staticConfig.isInput) {
|