tamagui 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 +54 -54
package/dist/native.js
CHANGED
|
@@ -7370,32 +7370,19 @@ var require_getVariantExtras_native = __commonJS({
|
|
|
7370
7370
|
}
|
|
7371
7371
|
var cache = /* @__PURE__ */ new WeakMap(), getVariantExtras = function(styleState) {
|
|
7372
7372
|
if (cache.has(styleState)) return cache.get(styleState);
|
|
7373
|
-
var
|
|
7373
|
+
var props = styleState.props, conf = styleState.conf, context = styleState.context, theme = styleState.theme, fonts = conf.fontsParsed;
|
|
7374
7374
|
context != null && context.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
|
|
7375
7375
|
var next = {
|
|
7376
7376
|
fonts,
|
|
7377
7377
|
tokens: conf.tokensParsed,
|
|
7378
7378
|
theme,
|
|
7379
7379
|
get fontFamily() {
|
|
7380
|
-
return (0, import_createVariable.getVariableValue)(styleState.fontFamily || styleState.
|
|
7380
|
+
return (0, import_createVariable.getVariableValue)(styleState.fontFamily || styleState.props.fontFamily) || props.fontFamily || (0, import_createVariable.getVariableValue)(styleState.conf.defaultFont);
|
|
7381
7381
|
},
|
|
7382
7382
|
get font() {
|
|
7383
7383
|
return fonts[this.fontFamily] || (!props.fontFamily || props.fontFamily[0] === "$" ? fonts[styleState.conf.defaultFont] : void 0);
|
|
7384
7384
|
},
|
|
7385
|
-
|
|
7386
|
-
// we avoid passing in default props for media queries because that would confuse things like SizableText.size:
|
|
7387
|
-
props: new Proxy(props, {
|
|
7388
|
-
// handles shorthands
|
|
7389
|
-
get: function(target, key) {
|
|
7390
|
-
for (var _i = 0, _iter = [
|
|
7391
|
-
key,
|
|
7392
|
-
conf.inverseShorthands[key]
|
|
7393
|
-
]; _i < _iter.length; _i++) {
|
|
7394
|
-
var tryKey = _iter[_i];
|
|
7395
|
-
if (tryKey) return Reflect.has(curProps, tryKey) ? Reflect.get(curProps, tryKey) : Reflect.get(target, tryKey);
|
|
7396
|
-
}
|
|
7397
|
-
}
|
|
7398
|
-
})
|
|
7385
|
+
props
|
|
7399
7386
|
};
|
|
7400
7387
|
return cache.set(styleState, next), next;
|
|
7401
7388
|
}, fontLanguageCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -7652,14 +7639,6 @@ var require_propMapper_native = __commonJS({
|
|
|
7652
7639
|
function _array_with_holes(arr) {
|
|
7653
7640
|
if (Array.isArray(arr)) return arr;
|
|
7654
7641
|
}
|
|
7655
|
-
function _define_property9(obj, key, value) {
|
|
7656
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
7657
|
-
value,
|
|
7658
|
-
enumerable: !0,
|
|
7659
|
-
configurable: !0,
|
|
7660
|
-
writable: !0
|
|
7661
|
-
}) : obj[key] = value, obj;
|
|
7662
|
-
}
|
|
7663
7642
|
function _iterable_to_array_limit(arr, i) {
|
|
7664
7643
|
var _i = arr == null ? null : (typeof Symbol > "u" ? "undefined" : _type_of3(Symbol)) < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
7665
7644
|
if (_i != null) {
|
|
@@ -7681,17 +7660,6 @@ var require_propMapper_native = __commonJS({
|
|
|
7681
7660
|
function _non_iterable_rest() {
|
|
7682
7661
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7683
7662
|
}
|
|
7684
|
-
function _object_spread9(target) {
|
|
7685
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
7686
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys8 = Object.keys(source);
|
|
7687
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys8 = ownKeys8.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
7688
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
7689
|
-
}))), ownKeys8.forEach(function(key) {
|
|
7690
|
-
_define_property9(target, key, source[key]);
|
|
7691
|
-
});
|
|
7692
|
-
}
|
|
7693
|
-
return target;
|
|
7694
|
-
}
|
|
7695
7663
|
function _sliced_to_array(arr, i) {
|
|
7696
7664
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array2(arr, i) || _non_iterable_rest();
|
|
7697
7665
|
}
|
|
@@ -7707,21 +7675,17 @@ var require_propMapper_native = __commonJS({
|
|
|
7707
7675
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array2(o, minLen);
|
|
7708
7676
|
}
|
|
7709
7677
|
}
|
|
7710
|
-
var propMapper = function(key, value,
|
|
7678
|
+
var propMapper = function(key, value, styleState) {
|
|
7711
7679
|
if (lastFontFamilyToken = null, !(!import_constants4.isAndroid && key === "elevationAndroid")) {
|
|
7712
|
-
var conf =
|
|
7680
|
+
var conf = styleState.conf, styleProps = styleState.styleProps, fontFamily = styleState.fontFamily, staticConfig = styleState.staticConfig;
|
|
7713
7681
|
if (value === "unset") {
|
|
7714
7682
|
var _conf_unset, unsetVal = (_conf_unset = conf.unset) === null || _conf_unset === void 0 ? void 0 : _conf_unset[key];
|
|
7715
7683
|
if (unsetVal != null) value = unsetVal;
|
|
7716
7684
|
else return;
|
|
7717
7685
|
}
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
return k === "curProps" ? subProps : Reflect.get(_, k);
|
|
7721
|
-
}
|
|
7722
|
-
}) : styleStateIn, variants = staticConfig.variants;
|
|
7686
|
+
styleProps.fallbackProps && (styleState.props = styleProps.fallbackProps);
|
|
7687
|
+
var variants = staticConfig.variants;
|
|
7723
7688
|
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) {
|
|
7724
|
-
styleState.curProps[key] = value;
|
|
7725
7689
|
var variantValue = resolveVariants(key, value, styleProps, styleState, "");
|
|
7726
7690
|
if (variantValue) return variantValue;
|
|
7727
7691
|
}
|
|
@@ -7743,8 +7707,7 @@ var require_propMapper_native = __commonJS({
|
|
|
7743
7707
|
key,
|
|
7744
7708
|
value,
|
|
7745
7709
|
variantValue,
|
|
7746
|
-
variants
|
|
7747
|
-
curProps: _object_spread9({}, styleState.curProps)
|
|
7710
|
+
variants
|
|
7748
7711
|
}), console.groupEnd()), !variantValue) {
|
|
7749
7712
|
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof value != "boolean") {
|
|
7750
7713
|
var name = staticConfig.componentName || "[UnnamedComponent]";
|
|
@@ -7793,7 +7756,7 @@ var require_propMapper_native = __commonJS({
|
|
|
7793
7756
|
if (!(!styleProps.noSkip && subKey in import_skipProps.skipProps)) {
|
|
7794
7757
|
if (styleProps.noExpand) res[subKey] = val;
|
|
7795
7758
|
else if (variants && subKey in variants) {
|
|
7796
|
-
if (
|
|
7759
|
+
if (parentVariantKey && parentVariantKey === key) res[subKey] = // SYNC WITH *1
|
|
7797
7760
|
val[0] === "$" ? getTokenForKey(subKey, val, styleProps.resolveValues, styleState) : val;
|
|
7798
7761
|
else {
|
|
7799
7762
|
var variantOut = resolveVariants(subKey, val, styleProps, styleState, key);
|
|
@@ -8220,15 +8183,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
8220
8183
|
}
|
|
8221
8184
|
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug, skipThemeTokenResolution) {
|
|
8222
8185
|
conf = conf || (0, import_config.getConfig)(), import_constants4.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
8223
|
-
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 = {}, mediaState3 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants4.isWeb && !styleProps.noClassNames, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0,
|
|
8224
|
-
// this should go away, right now we're doing really crazy cumulative props,
|
|
8225
|
-
// as variants are resolved basically we go back and merge the results onto
|
|
8226
|
-
// the curProps, so that each following variant function recieves the current
|
|
8227
|
-
// "styles" with variants expanded. powerful, but i think too fancy
|
|
8228
|
-
// there's some part of the ui kit that depends on it we'd have to find and fix
|
|
8229
|
-
get curProps() {
|
|
8230
|
-
return curPropsState || (curPropsState = {}), curPropsState;
|
|
8231
|
-
},
|
|
8186
|
+
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 = {}, mediaState3 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants4.isWeb && !styleProps.noClassNames, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, styleState = {
|
|
8232
8187
|
classNames,
|
|
8233
8188
|
conf,
|
|
8234
8189
|
props,
|
|
@@ -8482,7 +8437,6 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
8482
8437
|
variant: variants == null ? void 0 : variants[keyInit],
|
|
8483
8438
|
isVariant,
|
|
8484
8439
|
isHOCShouldPassThrough,
|
|
8485
|
-
curProps: _object_spread9({}, styleState.curProps),
|
|
8486
8440
|
parentStaticConfig
|
|
8487
8441
|
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant)) {
|
|
8488
8442
|
process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
|
|
@@ -8510,8 +8464,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
8510
8464
|
variant: variants == null ? void 0 : variants[keyInit],
|
|
8511
8465
|
shouldPassProp,
|
|
8512
8466
|
isHOCShouldPassThrough,
|
|
8513
|
-
usedKeys: _object_spread9({}, usedKeys)
|
|
8514
|
-
curProps: _object_spread9({}, styleState.curProps)
|
|
8467
|
+
usedKeys: _object_spread9({}, usedKeys)
|
|
8515
8468
|
}), (0, import_log.log)("expanded", expanded, `
|
|
8516
8469
|
usedKeys`, _object_spread9({}, usedKeys), `
|
|
8517
8470
|
current`, _object_spread9({}, styleState.style)));
|
|
@@ -8666,11 +8619,11 @@ current`, _object_spread9({}, styleState.style)));
|
|
|
8666
8619
|
}
|
|
8667
8620
|
}
|
|
8668
8621
|
var getSubStyle = function(styleState, subKey, styleIn, avoidMergeTransform) {
|
|
8669
|
-
var staticConfig = styleState.staticConfig,
|
|
8622
|
+
var staticConfig = styleState.staticConfig, conf2 = styleState.conf, styleProps = styleState.styleProps, styleOut = {};
|
|
8670
8623
|
for (var key in styleIn) {
|
|
8671
8624
|
var val = styleIn[key];
|
|
8672
8625
|
key = conf2.shorthands[key] || key;
|
|
8673
|
-
var expanded = (0, import_propMapper.propMapper)(key, val, styleState
|
|
8626
|
+
var expanded = (0, import_propMapper.propMapper)(key, val, styleState);
|
|
8674
8627
|
if (!(!expanded || !staticConfig.isHOC && key in import_skipProps.skipProps && !styleProps.noSkip)) {
|
|
8675
8628
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
8676
8629
|
try {
|
|
@@ -10065,12 +10018,7 @@ var require_createComponent_native = __commonJS({
|
|
|
10065
10018
|
var inverseShorthands = (0, import_config.getConfig)().inverseShorthands;
|
|
10066
10019
|
for (var key in context.props) {
|
|
10067
10020
|
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]];
|
|
10068
|
-
|
|
10069
|
-
if (contextValue) {
|
|
10070
|
-
var isValidValue = key in _$validStyles || key in variants;
|
|
10071
|
-
isValidValue && (styledContextProps || (styledContextProps = {}), styledContextProps[key] = contextValue[key]);
|
|
10072
|
-
}
|
|
10073
|
-
} else overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = propVal;
|
|
10021
|
+
propVal === void 0 ? contextValue && (styledContextProps || (styledContextProps = {}), styledContextProps[key] = contextValue[key]) : (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = propVal);
|
|
10074
10022
|
}
|
|
10075
10023
|
}
|
|
10076
10024
|
var curDefaultProps = styledContextProps ? _object_spread9({}, defaultProps, styledContextProps) : defaultProps, props = propsIn;
|