@tamagui/core 1.123.0 → 1.123.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/addNativeValidStyles.native.js +34 -24
- package/dist/cjs/addNativeValidStyles.native.js.map +2 -2
- package/dist/esm/addNativeValidStyles.native.js +31 -14
- package/dist/esm/addNativeValidStyles.native.js.map +2 -2
- package/dist/native.js +48 -17
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +48 -17
- package/dist/test.native.js.map +2 -2
- package/package.json +7 -7
- package/src/addNativeValidStyles.native.ts +29 -6
- package/types/addNativeValidStyles.native.d.ts.map +1 -1
package/dist/test.native.js
CHANGED
|
@@ -428,7 +428,10 @@ var require_constants_native = __commonJS({
|
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
430
|
module2.exports = __toCommonJS2(constants_native_exports);
|
|
431
|
-
var import_react3 = require("react"), isWeb = !1, isWindowDefined = !1, isServer = !1, isClient = !1, useIsomorphicLayoutEffect2 = import_react3.useLayoutEffect, isChrome = !1, isWebTouchable = !1, isTouchable = !0, isAndroid =
|
|
431
|
+
var import_react3 = require("react"), import_react_native = require("react-native"), isWeb = !1, isWindowDefined = !1, isServer = !1, isClient = !1, useIsomorphicLayoutEffect2 = import_react3.useLayoutEffect, isChrome = !1, isWebTouchable = !1, isTouchable = !0, isAndroid = import_react_native.Platform.OS === "android" || process.env.TEST_NATIVE_PLATFORM === "android", isIos = import_react_native.Platform.OS === "ios" || process.env.TEST_NATIVE_PLATFORM === "ios", platforms = {
|
|
432
|
+
ios: "ios",
|
|
433
|
+
android: "android"
|
|
434
|
+
}, currentPlatform = platforms[import_react_native.Platform.OS] || "native";
|
|
432
435
|
}
|
|
433
436
|
});
|
|
434
437
|
|
|
@@ -2269,10 +2272,20 @@ var require_ThemeManager_native = __commonJS({
|
|
|
2269
2272
|
}
|
|
2270
2273
|
}
|
|
2271
2274
|
]), ThemeManager2;
|
|
2272
|
-
}();
|
|
2275
|
+
}(), cache2 = {};
|
|
2273
2276
|
function getState(props, manager) {
|
|
2274
|
-
if (props.name && props.reset) throw new Error("Cannot reset and set a new name at the same time.");
|
|
2275
2277
|
if (!getHasThemeUpdatingProps(props)) return null;
|
|
2278
|
+
var [allManagers] = getManagers(manager), cacheKey = `${props.name || ""}${props.componentName || ""}${props.inverse || ""}${props.reset || ""}${allManagers.map(function(x) {
|
|
2279
|
+
return (x == null ? void 0 : x.state.name) || ".";
|
|
2280
|
+
}).join("")}`, cached = cache2[cacheKey];
|
|
2281
|
+
if (!cached) {
|
|
2282
|
+
var res = getStateUncached(props, manager);
|
|
2283
|
+
return cache2[cacheKey] = res, res;
|
|
2284
|
+
}
|
|
2285
|
+
return cached;
|
|
2286
|
+
}
|
|
2287
|
+
function getStateUncached(props, manager) {
|
|
2288
|
+
if (props.name && props.reset) throw new Error("Cannot reset and set a new name at the same time.");
|
|
2276
2289
|
var themes = (0, import_config.getThemes)(), [allManagers, componentManagers] = getManagers(manager), isDirectParentAComponentTheme = !!(manager != null && manager.state.isComponent), startIndex = props.reset && !isDirectParentAComponentTheme ? 1 : 0, baseManager = allManagers[startIndex], parentManager = allManagers[startIndex + 1];
|
|
2277
2290
|
if (!baseManager && props.reset) return console.warn("Cannot reset, no parent theme exists"), null;
|
|
2278
2291
|
var { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
|
|
@@ -11909,21 +11922,39 @@ var tm, measureElement = async function(target) {
|
|
|
11909
11922
|
var Pressability = require_fake_react_native().default, usePressability = (init_idFn(), __toCommonJS(idFn_exports)).default;
|
|
11910
11923
|
|
|
11911
11924
|
// src/addNativeValidStyles.native.ts
|
|
11912
|
-
var import_helpers = __toESM(require_index_native3())
|
|
11925
|
+
var import_helpers = __toESM(require_index_native3());
|
|
11926
|
+
function getReactNativeVersion() {
|
|
11927
|
+
var version = process.env.REACT_NATIVE_VERSION || "";
|
|
11928
|
+
if (!process.env.REACT_NATIVE_VERSION)
|
|
11929
|
+
try {
|
|
11930
|
+
var ReactNativeOfficalVersion = require("react-native/Libraries/Core/ReactNativeVersion");
|
|
11931
|
+
if (ReactNativeOfficalVersion) {
|
|
11932
|
+
var { version: { major, minor, patch } } = ReactNativeOfficalVersion;
|
|
11933
|
+
version = `${major}.${minor}.${patch}`;
|
|
11934
|
+
}
|
|
11935
|
+
} catch {
|
|
11936
|
+
} finally {
|
|
11937
|
+
version || (version = "0.77");
|
|
11938
|
+
}
|
|
11939
|
+
var [major1, minor1, patch1] = version.split(".");
|
|
11940
|
+
return [
|
|
11941
|
+
+major1,
|
|
11942
|
+
+minor1,
|
|
11943
|
+
+patch1
|
|
11944
|
+
];
|
|
11945
|
+
}
|
|
11913
11946
|
function addNativeValidStyles() {
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
|
|
11922
|
-
|
|
11923
|
-
|
|
11924
|
-
|
|
11925
|
-
Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
|
|
11926
|
-
}
|
|
11947
|
+
var [major, minor] = getReactNativeVersion();
|
|
11948
|
+
if (major === 0 && minor >= 77) {
|
|
11949
|
+
var additional = {
|
|
11950
|
+
boxSizing: !0,
|
|
11951
|
+
mixBlendMode: !0,
|
|
11952
|
+
outlineWidth: !0,
|
|
11953
|
+
outlineStyle: !0,
|
|
11954
|
+
outlineSpread: !0,
|
|
11955
|
+
outlineColor: !0
|
|
11956
|
+
};
|
|
11957
|
+
Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
|
|
11927
11958
|
}
|
|
11928
11959
|
}
|
|
11929
11960
|
|