@tamagui/core 1.109.9 → 1.110.1
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 +14 -66
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +12 -42
- package/dist/test.native.js.map +2 -2
- package/package.json +6 -6
package/dist/native.js
CHANGED
|
@@ -7127,32 +7127,19 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
7127
7127
|
}
|
|
7128
7128
|
var cache = /* @__PURE__ */ new WeakMap(), getVariantExtras = function(styleState) {
|
|
7129
7129
|
if (cache.has(styleState)) return cache.get(styleState);
|
|
7130
|
-
var
|
|
7130
|
+
var props = styleState.props, conf = styleState.conf, context = styleState.context, theme = styleState.theme, fonts = conf.fontsParsed;
|
|
7131
7131
|
context != null && context.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
|
|
7132
7132
|
var next = {
|
|
7133
7133
|
fonts,
|
|
7134
7134
|
tokens: conf.tokensParsed,
|
|
7135
7135
|
theme,
|
|
7136
7136
|
get fontFamily() {
|
|
7137
|
-
return (0, import_createVariable.getVariableValue)(styleState.fontFamily || styleState.
|
|
7137
|
+
return (0, import_createVariable.getVariableValue)(styleState.fontFamily || styleState.props.fontFamily) || props.fontFamily || (0, import_createVariable.getVariableValue)(styleState.conf.defaultFont);
|
|
7138
7138
|
},
|
|
7139
7139
|
get font() {
|
|
7140
7140
|
return fonts[this.fontFamily] || (!props.fontFamily || props.fontFamily[0] === "$" ? fonts[styleState.conf.defaultFont] : void 0);
|
|
7141
7141
|
},
|
|
7142
|
-
|
|
7143
|
-
// we avoid passing in default props for media queries because that would confuse things like SizableText.size:
|
|
7144
|
-
props: new Proxy(props, {
|
|
7145
|
-
// handles shorthands
|
|
7146
|
-
get: function(target, key) {
|
|
7147
|
-
for (var _i = 0, _iter = [
|
|
7148
|
-
key,
|
|
7149
|
-
conf.inverseShorthands[key]
|
|
7150
|
-
]; _i < _iter.length; _i++) {
|
|
7151
|
-
var tryKey = _iter[_i];
|
|
7152
|
-
if (tryKey) return Reflect.has(curProps, tryKey) ? Reflect.get(curProps, tryKey) : Reflect.get(target, tryKey);
|
|
7153
|
-
}
|
|
7154
|
-
}
|
|
7155
|
-
})
|
|
7142
|
+
props
|
|
7156
7143
|
};
|
|
7157
7144
|
return cache.set(styleState, next), next;
|
|
7158
7145
|
}, fontLanguageCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -7409,14 +7396,6 @@ var require_propMapper_native = __commonJS({
|
|
|
7409
7396
|
function _array_with_holes(arr) {
|
|
7410
7397
|
if (Array.isArray(arr)) return arr;
|
|
7411
7398
|
}
|
|
7412
|
-
function _define_property2(obj, key, value) {
|
|
7413
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
7414
|
-
value,
|
|
7415
|
-
enumerable: !0,
|
|
7416
|
-
configurable: !0,
|
|
7417
|
-
writable: !0
|
|
7418
|
-
}) : obj[key] = value, obj;
|
|
7419
|
-
}
|
|
7420
7399
|
function _iterable_to_array_limit(arr, i) {
|
|
7421
7400
|
var _i = arr == null ? null : (typeof Symbol > "u" ? "undefined" : _type_of(Symbol)) < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
7422
7401
|
if (_i != null) {
|
|
@@ -7438,17 +7417,6 @@ var require_propMapper_native = __commonJS({
|
|
|
7438
7417
|
function _non_iterable_rest() {
|
|
7439
7418
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7440
7419
|
}
|
|
7441
|
-
function _object_spread2(target) {
|
|
7442
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
7443
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys = Object.keys(source);
|
|
7444
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
7445
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
7446
|
-
}))), ownKeys.forEach(function(key) {
|
|
7447
|
-
_define_property2(target, key, source[key]);
|
|
7448
|
-
});
|
|
7449
|
-
}
|
|
7450
|
-
return target;
|
|
7451
|
-
}
|
|
7452
7420
|
function _sliced_to_array(arr, i) {
|
|
7453
7421
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
7454
7422
|
}
|
|
@@ -7464,21 +7432,17 @@ var require_propMapper_native = __commonJS({
|
|
|
7464
7432
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
7465
7433
|
}
|
|
7466
7434
|
}
|
|
7467
|
-
var propMapper = function(key, value,
|
|
7435
|
+
var propMapper = function(key, value, styleState) {
|
|
7468
7436
|
if (lastFontFamilyToken = null, !(!import_constants.isAndroid && key === "elevationAndroid")) {
|
|
7469
|
-
var conf =
|
|
7437
|
+
var conf = styleState.conf, styleProps = styleState.styleProps, fontFamily = styleState.fontFamily, staticConfig = styleState.staticConfig;
|
|
7470
7438
|
if (value === "unset") {
|
|
7471
7439
|
var _conf_unset, unsetVal = (_conf_unset = conf.unset) === null || _conf_unset === void 0 ? void 0 : _conf_unset[key];
|
|
7472
7440
|
if (unsetVal != null) value = unsetVal;
|
|
7473
7441
|
else return;
|
|
7474
7442
|
}
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
return k === "curProps" ? subProps : Reflect.get(_, k);
|
|
7478
|
-
}
|
|
7479
|
-
}) : styleStateIn, variants = staticConfig.variants;
|
|
7443
|
+
styleProps.fallbackProps && (styleState.props = styleProps.fallbackProps);
|
|
7444
|
+
var variants = staticConfig.variants;
|
|
7480
7445
|
if (process.env.NODE_ENV === "development" && fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn('Warning: no fontFamily "'.concat(fontFamily, '" found in config: ').concat(Object.keys(conf.fontsParsed).join(", "))), !styleProps.noExpand && variants && key in variants) {
|
|
7481
|
-
styleState.curProps[key] = value;
|
|
7482
7446
|
var variantValue = resolveVariants(key, value, styleProps, styleState, "");
|
|
7483
7447
|
if (variantValue) return variantValue;
|
|
7484
7448
|
}
|
|
@@ -7500,8 +7464,7 @@ var require_propMapper_native = __commonJS({
|
|
|
7500
7464
|
key,
|
|
7501
7465
|
value,
|
|
7502
7466
|
variantValue,
|
|
7503
|
-
variants
|
|
7504
|
-
curProps: _object_spread2({}, styleState.curProps)
|
|
7467
|
+
variants
|
|
7505
7468
|
}), console.groupEnd()), !variantValue) {
|
|
7506
7469
|
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof value != "boolean") {
|
|
7507
7470
|
var name = staticConfig.componentName || "[UnnamedComponent]";
|
|
@@ -7550,7 +7513,7 @@ var require_propMapper_native = __commonJS({
|
|
|
7550
7513
|
if (!(!styleProps.noSkip && subKey in import_skipProps.skipProps)) {
|
|
7551
7514
|
if (styleProps.noExpand) res[subKey] = val;
|
|
7552
7515
|
else if (variants && subKey in variants) {
|
|
7553
|
-
if (
|
|
7516
|
+
if (parentVariantKey && parentVariantKey === key) res[subKey] = // SYNC WITH *1
|
|
7554
7517
|
val[0] === "$" ? getTokenForKey(subKey, val, styleProps.resolveValues, styleState) : val;
|
|
7555
7518
|
else {
|
|
7556
7519
|
var variantOut = resolveVariants(subKey, val, styleProps, styleState, key);
|
|
@@ -7977,15 +7940,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
7977
7940
|
}
|
|
7978
7941
|
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug, skipThemeTokenResolution) {
|
|
7979
7942
|
conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
7980
|
-
var shorthands = conf.shorthands, isHOC = staticConfig.isHOC, isText = staticConfig.isText, isInput = staticConfig.isInput, variants = staticConfig.variants, isReactNative = staticConfig.isReactNative, inlineProps = staticConfig.inlineProps, inlineWhenUnflattened = staticConfig.inlineWhenUnflattened, parentStaticConfig = staticConfig.parentStaticConfig, acceptsClassName = staticConfig.acceptsClassName, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClassNames, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0,
|
|
7981
|
-
// this should go away, right now we're doing really crazy cumulative props,
|
|
7982
|
-
// as variants are resolved basically we go back and merge the results onto
|
|
7983
|
-
// the curProps, so that each following variant function recieves the current
|
|
7984
|
-
// "styles" with variants expanded. powerful, but i think too fancy
|
|
7985
|
-
// there's some part of the ui kit that depends on it we'd have to find and fix
|
|
7986
|
-
get curProps() {
|
|
7987
|
-
return curPropsState || (curPropsState = {}), curPropsState;
|
|
7988
|
-
},
|
|
7943
|
+
var shorthands = conf.shorthands, isHOC = staticConfig.isHOC, isText = staticConfig.isText, isInput = staticConfig.isInput, variants = staticConfig.variants, isReactNative = staticConfig.isReactNative, inlineProps = staticConfig.inlineProps, inlineWhenUnflattened = staticConfig.inlineWhenUnflattened, parentStaticConfig = staticConfig.parentStaticConfig, acceptsClassName = staticConfig.acceptsClassName, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClassNames, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, styleState = {
|
|
7989
7944
|
classNames,
|
|
7990
7945
|
conf,
|
|
7991
7946
|
props,
|
|
@@ -8239,7 +8194,6 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
8239
8194
|
variant: variants == null ? void 0 : variants[keyInit],
|
|
8240
8195
|
isVariant,
|
|
8241
8196
|
isHOCShouldPassThrough,
|
|
8242
|
-
curProps: _object_spread2({}, styleState.curProps),
|
|
8243
8197
|
parentStaticConfig
|
|
8244
8198
|
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant)) {
|
|
8245
8199
|
process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
|
|
@@ -8267,8 +8221,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
8267
8221
|
variant: variants == null ? void 0 : variants[keyInit],
|
|
8268
8222
|
shouldPassProp,
|
|
8269
8223
|
isHOCShouldPassThrough,
|
|
8270
|
-
usedKeys: _object_spread2({}, usedKeys)
|
|
8271
|
-
curProps: _object_spread2({}, styleState.curProps)
|
|
8224
|
+
usedKeys: _object_spread2({}, usedKeys)
|
|
8272
8225
|
}), (0, import_log.log)("expanded", expanded, `
|
|
8273
8226
|
usedKeys`, _object_spread2({}, usedKeys), `
|
|
8274
8227
|
current`, _object_spread2({}, styleState.style)));
|
|
@@ -8423,11 +8376,11 @@ current`, _object_spread2({}, styleState.style)));
|
|
|
8423
8376
|
}
|
|
8424
8377
|
}
|
|
8425
8378
|
var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
|
|
8426
|
-
var staticConfig = styleState.staticConfig,
|
|
8379
|
+
var staticConfig = styleState.staticConfig, conf2 = styleState.conf, styleProps = styleState.styleProps, styleOut = {};
|
|
8427
8380
|
for (var key in styleIn) {
|
|
8428
8381
|
var val = styleIn[key];
|
|
8429
8382
|
key = conf2.shorthands[key] || key;
|
|
8430
|
-
var expanded = (0, import_propMapper.propMapper)(key, val, styleState
|
|
8383
|
+
var expanded = (0, import_propMapper.propMapper)(key, val, styleState);
|
|
8431
8384
|
if (!(!expanded || !staticConfig.isHOC && key in import_skipProps.skipProps && !styleProps.noSkip)) {
|
|
8432
8385
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
8433
8386
|
try {
|
|
@@ -9822,12 +9775,7 @@ var require_createComponent_native = __commonJS({
|
|
|
9822
9775
|
var inverseShorthands = (0, import_config.getConfig)().inverseShorthands;
|
|
9823
9776
|
for (var key in context.props) {
|
|
9824
9777
|
var _propsIn_key, _ref, _ref1, propVal = (_ref1 = (_ref = (_propsIn_key = propsIn[key]) !== null && _propsIn_key !== void 0 ? _propsIn_key : propsIn[inverseShorthands[key]]) !== null && _ref !== void 0 ? _ref : defaultProps == null ? void 0 : defaultProps[key]) !== null && _ref1 !== void 0 ? _ref1 : defaultProps == null ? void 0 : defaultProps[inverseShorthands[key]];
|
|
9825
|
-
|
|
9826
|
-
if (contextValue) {
|
|
9827
|
-
var isValidValue = key in _$validStyles || key in variants;
|
|
9828
|
-
isValidValue && (styledContextProps || (styledContextProps = {}), styledContextProps[key] = contextValue[key]);
|
|
9829
|
-
}
|
|
9830
|
-
} else overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = propVal;
|
|
9778
|
+
propVal === void 0 ? contextValue && (styledContextProps || (styledContextProps = {}), styledContextProps[key] = contextValue[key]) : (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = propVal);
|
|
9831
9779
|
}
|
|
9832
9780
|
}
|
|
9833
9781
|
var curDefaultProps = styledContextProps ? _object_spread2({}, defaultProps, styledContextProps) : defaultProps, props = propsIn;
|