tamagui 1.126.0 → 1.126.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/native.js +96 -18
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +96 -18
- package/dist/test.native.js.map +3 -3
- package/package.json +55 -55
package/dist/native.js
CHANGED
|
@@ -3922,6 +3922,73 @@ var require_getShorthandValue_native = __commonJS({
|
|
|
3922
3922
|
}
|
|
3923
3923
|
});
|
|
3924
3924
|
|
|
3925
|
+
// ../../core/web/dist/cjs/helpers/getDynamicVal.native.js
|
|
3926
|
+
var require_getDynamicVal_native = __commonJS({
|
|
3927
|
+
"../../core/web/dist/cjs/helpers/getDynamicVal.native.js"(exports2, module2) {
|
|
3928
|
+
"use strict";
|
|
3929
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
3930
|
+
for (var name in all) __defProp2(target, name, {
|
|
3931
|
+
get: all[name],
|
|
3932
|
+
enumerable: !0
|
|
3933
|
+
});
|
|
3934
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
3935
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
3936
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
3937
|
+
for (var _loop = function() {
|
|
3938
|
+
var key = _step.value;
|
|
3939
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
3940
|
+
get: function() {
|
|
3941
|
+
return from[key];
|
|
3942
|
+
},
|
|
3943
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
3944
|
+
});
|
|
3945
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
3946
|
+
} catch (err) {
|
|
3947
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
3948
|
+
} finally {
|
|
3949
|
+
try {
|
|
3950
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
3951
|
+
} finally {
|
|
3952
|
+
if (_didIteratorError)
|
|
3953
|
+
throw _iteratorError;
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3956
|
+
return to;
|
|
3957
|
+
}, __toCommonJS2 = function(mod) {
|
|
3958
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
3959
|
+
value: !0
|
|
3960
|
+
}), mod);
|
|
3961
|
+
}, getDynamicVal_exports = {};
|
|
3962
|
+
__export2(getDynamicVal_exports, {
|
|
3963
|
+
extractValueFromDynamic: function() {
|
|
3964
|
+
return extractValueFromDynamic;
|
|
3965
|
+
},
|
|
3966
|
+
getDynamicVal: function() {
|
|
3967
|
+
return getDynamicVal;
|
|
3968
|
+
},
|
|
3969
|
+
getOppositeScheme: function() {
|
|
3970
|
+
return getOppositeScheme;
|
|
3971
|
+
}
|
|
3972
|
+
});
|
|
3973
|
+
module2.exports = __toCommonJS2(getDynamicVal_exports);
|
|
3974
|
+
function getOppositeScheme(scheme) {
|
|
3975
|
+
return scheme === "dark" ? "light" : "dark";
|
|
3976
|
+
}
|
|
3977
|
+
function getDynamicVal(param) {
|
|
3978
|
+
var { scheme, val, oppositeVal } = param, oppositeScheme = getOppositeScheme(scheme);
|
|
3979
|
+
return {
|
|
3980
|
+
dynamic: {
|
|
3981
|
+
[scheme]: val,
|
|
3982
|
+
[oppositeScheme]: oppositeVal
|
|
3983
|
+
}
|
|
3984
|
+
};
|
|
3985
|
+
}
|
|
3986
|
+
function extractValueFromDynamic(val, scheme) {
|
|
3987
|
+
return val != null && val.dynamic ? val.dynamic[scheme] : val;
|
|
3988
|
+
}
|
|
3989
|
+
}
|
|
3990
|
+
});
|
|
3991
|
+
|
|
3925
3992
|
// ../../core/web/dist/cjs/constants/accessibilityDirectMap.native.js
|
|
3926
3993
|
var require_accessibilityDirectMap_native = __commonJS({
|
|
3927
3994
|
"../../core/web/dist/cjs/constants/accessibilityDirectMap.native.js"(exports2, module2) {
|
|
@@ -6336,7 +6403,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6336
6403
|
}
|
|
6337
6404
|
});
|
|
6338
6405
|
module2.exports = __toCommonJS2(getSplitStyles_exports);
|
|
6339
|
-
var import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_consoleLog = require_consoleLog_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getCSSStylesAtomic = require_getCSSStylesAtomic_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_insertStyleRule = require_insertStyleRule_native(), import_isActivePlatform = require_isActivePlatform_native(), import_isActiveTheme = require_isActiveTheme_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), import_sortString = require_sortString_native(), import_transformsToString = require_transformsToString_native(), conf, PROP_SPLIT = "-";
|
|
6406
|
+
var import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_react3 = __toESM2(require("react")), import_getDynamicVal = require_getDynamicVal_native(), import_config = require_config_native(), import_accessibilityDirectMap = require_accessibilityDirectMap_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_useMedia = require_useMedia_native(), import_consoleLog = require_consoleLog_native(), import_createMediaStyle = require_createMediaStyle_native(), import_expandStyles = require_expandStyles_native(), import_getCSSStylesAtomic = require_getCSSStylesAtomic_native(), import_getGroupPropParts = require_getGroupPropParts_native(), import_insertStyleRule = require_insertStyleRule_native(), import_isActivePlatform = require_isActivePlatform_native(), import_isActiveTheme = require_isActiveTheme_native(), import_log = require_log_native(), import_normalizeValueWithProperty = require_normalizeValueWithProperty_native(), import_propMapper = require_propMapper_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), import_sortString = require_sortString_native(), import_transformsToString = require_transformsToString_native(), conf, PROP_SPLIT = "-";
|
|
6340
6407
|
function isValidStyleKey(key, validStyles, accept) {
|
|
6341
6408
|
return key in validStyles ? !0 : accept && key in accept;
|
|
6342
6409
|
}
|
|
@@ -6534,8 +6601,8 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6534
6601
|
}
|
|
6535
6602
|
} else {
|
|
6536
6603
|
var mergeMediaStyle2 = function(key5, val3) {
|
|
6537
|
-
var
|
|
6538
|
-
(
|
|
6604
|
+
var _styleState4;
|
|
6605
|
+
(_styleState4 = styleState).style || (_styleState4.style = {});
|
|
6539
6606
|
var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, usedKeys, mediaState3[mediaKeyShort], importanceBump, debug);
|
|
6540
6607
|
didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
|
|
6541
6608
|
}, mergeMediaStyle = mergeMediaStyle2, isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
|
|
@@ -6548,7 +6615,19 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6548
6615
|
}
|
|
6549
6616
|
var mediaStyle1 = getSubStyle(styleState, key4, val2, !0), importanceBump = 0;
|
|
6550
6617
|
if (isThemeMedia) {
|
|
6551
|
-
if (dynamicThemeAccess = !0,
|
|
6618
|
+
if (dynamicThemeAccess = !0, import_constants4.isIos && (0, import_config.getSetting)("fastSchemeChange")) {
|
|
6619
|
+
var _styleState3;
|
|
6620
|
+
(_styleState3 = styleState).style || (_styleState3.style = {});
|
|
6621
|
+
var scheme = mediaKeyShort, oppositeScheme = (0, import_getDynamicVal.getOppositeScheme)(mediaKeyShort);
|
|
6622
|
+
for (var subKey1 in mediaStyle1) {
|
|
6623
|
+
var _$val1 = (0, import_getDynamicVal.extractValueFromDynamic)(mediaStyle1[subKey1], scheme), oppositeVal = (0, import_getDynamicVal.extractValueFromDynamic)(styleState.style[subKey1], oppositeScheme);
|
|
6624
|
+
mediaStyle1[subKey1] = (0, import_getDynamicVal.getDynamicVal)({
|
|
6625
|
+
scheme,
|
|
6626
|
+
val: _$val1,
|
|
6627
|
+
oppositeVal
|
|
6628
|
+
}), mergeStyle(styleState, subKey1, mediaStyle1[subKey1]);
|
|
6629
|
+
}
|
|
6630
|
+
} else if (!(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
|
|
6552
6631
|
} else if (isGroupMedia) {
|
|
6553
6632
|
var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
|
|
6554
6633
|
if (!groupContext) {
|
|
@@ -6576,15 +6655,15 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6576
6655
|
importanceBump = priority1;
|
|
6577
6656
|
}
|
|
6578
6657
|
}
|
|
6579
|
-
for (var
|
|
6580
|
-
if (
|
|
6658
|
+
for (var subKey2 in mediaStyle1) {
|
|
6659
|
+
if (subKey2 === "space") {
|
|
6581
6660
|
space = valInit.space;
|
|
6582
6661
|
continue;
|
|
6583
6662
|
}
|
|
6584
|
-
if (
|
|
6585
|
-
if (!(0, import_isActivePlatform.isActivePlatform)(
|
|
6586
|
-
for (var subSubKey in mediaStyle1[
|
|
6587
|
-
} else mergeMediaStyle2(
|
|
6663
|
+
if (subKey2[0] === "$") {
|
|
6664
|
+
if (!(0, import_isActivePlatform.isActivePlatform)(subKey2) || !(0, import_isActiveTheme.isActiveTheme)(subKey2, themeName)) continue;
|
|
6665
|
+
for (var subSubKey in mediaStyle1[subKey2]) mergeMediaStyle2(subSubKey, mediaStyle1[subKey2][subSubKey]);
|
|
6666
|
+
} else mergeMediaStyle2(subKey2, mediaStyle1[subKey2]);
|
|
6588
6667
|
}
|
|
6589
6668
|
}
|
|
6590
6669
|
return;
|
|
@@ -7505,7 +7584,7 @@ var require_getThemeProxied_native = __commonJS({
|
|
|
7505
7584
|
}
|
|
7506
7585
|
});
|
|
7507
7586
|
module2.exports = __toCommonJS2(getThemeProxied_exports);
|
|
7508
|
-
var import_constants4 = require_index_native6(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_doesRootSchemeMatchSystem = require_doesRootSchemeMatchSystem_native(), cache = /* @__PURE__ */ new Map(), curKeys, curProps, curState, emptyObject = {};
|
|
7587
|
+
var import_constants4 = require_index_native6(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_doesRootSchemeMatchSystem = require_doesRootSchemeMatchSystem_native(), import_getDynamicVal = require_getDynamicVal_native(), cache = /* @__PURE__ */ new Map(), curKeys, curProps, curState, emptyObject = {};
|
|
7509
7588
|
function getThemeProxied(_props, _state, _keys) {
|
|
7510
7589
|
if (!(_state != null && _state.theme)) return emptyObject;
|
|
7511
7590
|
if (curKeys = _keys, curProps = _props, curState = _state, cache.has(curState.theme)) {
|
|
@@ -7526,12 +7605,11 @@ var require_getThemeProxied_native = __commonJS({
|
|
|
7526
7605
|
if (curState) {
|
|
7527
7606
|
var outVal = (0, import_createVariable.getVariable)(value), { name, scheme, inverses } = curState, shouldOptimize = scheme && platform2 !== "web" && import_constants4.isIos && !curProps.deopt && (0, import_config.getSetting)("fastSchemeChange") && inverses === 0 && (0, import_doesRootSchemeMatchSystem.doesRootSchemeMatchSystem)();
|
|
7528
7607
|
if (shouldOptimize) {
|
|
7529
|
-
var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[key]), oppositeColor = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[key]), dynamicVal = {
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
};
|
|
7608
|
+
var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[key]), oppositeColor = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[key]), dynamicVal = (0, import_getDynamicVal.getDynamicVal)({
|
|
7609
|
+
scheme,
|
|
7610
|
+
val: color,
|
|
7611
|
+
oppositeVal: oppositeColor
|
|
7612
|
+
});
|
|
7535
7613
|
return dynamicVal;
|
|
7536
7614
|
}
|
|
7537
7615
|
return process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key because of:
|
|
@@ -8093,7 +8171,7 @@ var require_useComponentState_native = __commonJS({
|
|
|
8093
8171
|
...states[0],
|
|
8094
8172
|
[props.forceStyle]: !0
|
|
8095
8173
|
} : states[0], setState = states[1], isAnimated = willBeAnimated;
|
|
8096
|
-
import_constants4.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (
|
|
8174
|
+
import_constants4.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), state.disabled = disabled, setState({
|
|
8097
8175
|
...state
|
|
8098
8176
|
}));
|
|
8099
8177
|
var groupName = props.group, setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
|