@tamagui/core 1.132.14 → 1.132.16-1754534218765
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 +127 -212
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +117 -202
- package/dist/test.native.js.map +3 -3
- package/package.json +10 -10
package/dist/native.js
CHANGED
|
@@ -150,9 +150,9 @@ var require_clamp_native = __commonJS({
|
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
module2.exports = __toCommonJS2(clamp_exports);
|
|
153
|
-
function clamp(
|
|
153
|
+
function clamp(value, param) {
|
|
154
154
|
var [min, max] = param;
|
|
155
|
-
return Math.min(max, Math.max(min,
|
|
155
|
+
return Math.min(max, Math.max(min, value));
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
});
|
|
@@ -210,92 +210,6 @@ var require_composeEventHandlers_native = __commonJS({
|
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
|
|
213
|
-
// ../helpers/dist/cjs/concatClassName.native.js
|
|
214
|
-
var require_concatClassName_native = __commonJS({
|
|
215
|
-
"../helpers/dist/cjs/concatClassName.native.js"(exports2, module2) {
|
|
216
|
-
"use strict";
|
|
217
|
-
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
218
|
-
for (var name in all) __defProp2(target, name, {
|
|
219
|
-
get: all[name],
|
|
220
|
-
enumerable: !0
|
|
221
|
-
});
|
|
222
|
-
}, __copyProps2 = function(to, from, except, desc) {
|
|
223
|
-
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
224
|
-
if (from && typeof from == "object" || typeof from == "function") try {
|
|
225
|
-
for (var _loop = function() {
|
|
226
|
-
var key = _step.value;
|
|
227
|
-
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
228
|
-
get: function() {
|
|
229
|
-
return from[key];
|
|
230
|
-
},
|
|
231
|
-
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
232
|
-
});
|
|
233
|
-
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
234
|
-
} catch (err) {
|
|
235
|
-
_didIteratorError = !0, _iteratorError = err;
|
|
236
|
-
} finally {
|
|
237
|
-
try {
|
|
238
|
-
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
239
|
-
} finally {
|
|
240
|
-
if (_didIteratorError)
|
|
241
|
-
throw _iteratorError;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
return to;
|
|
245
|
-
}, __toCommonJS2 = function(mod) {
|
|
246
|
-
return __copyProps2(__defProp2({}, "__esModule", {
|
|
247
|
-
value: !0
|
|
248
|
-
}), mod);
|
|
249
|
-
}, concatClassName_exports = {};
|
|
250
|
-
__export2(concatClassName_exports, {
|
|
251
|
-
concatClassName: function() {
|
|
252
|
-
return concatClassName;
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
module2.exports = __toCommonJS2(concatClassName_exports);
|
|
256
|
-
function concatClassName(_cn) {
|
|
257
|
-
for (var args = arguments, usedPrefixes = [], final = "", len = args.length, propObjects = null, x = len; x >= 0; x--) {
|
|
258
|
-
var _loop = function(i2) {
|
|
259
|
-
var name = names[i2];
|
|
260
|
-
if (!name || name === " ") return "continue";
|
|
261
|
-
if (name[0] !== "_") return final = name + " " + final, "continue";
|
|
262
|
-
var splitIndex = name.indexOf("-");
|
|
263
|
-
if (splitIndex < 1) return final = name + " " + final, "continue";
|
|
264
|
-
var nextChar = name[splitIndex + 1], isMediaQuery = nextChar === "_", styleKey = name.slice(1, name.lastIndexOf("-")), mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null, uid = mediaKey ? styleKey + mediaKey : styleKey;
|
|
265
|
-
if (usedPrefixes.indexOf(uid) > -1) return "continue";
|
|
266
|
-
usedPrefixes.push(uid);
|
|
267
|
-
var propName = styleKey;
|
|
268
|
-
if (propName && propObjects && propObjects.some(function(po) {
|
|
269
|
-
if (mediaKey) {
|
|
270
|
-
var propKey = pseudoInvert[mediaKey];
|
|
271
|
-
return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
|
|
272
|
-
}
|
|
273
|
-
var res = po && propName in po && po[propName] !== null;
|
|
274
|
-
return res;
|
|
275
|
-
})) return "continue";
|
|
276
|
-
final = name + " " + final;
|
|
277
|
-
}, cns = args[x];
|
|
278
|
-
if (cns) {
|
|
279
|
-
if (!Array.isArray(cns) && typeof cns != "string") {
|
|
280
|
-
propObjects = propObjects || [], propObjects.push(cns);
|
|
281
|
-
continue;
|
|
282
|
-
}
|
|
283
|
-
for (var names = Array.isArray(cns) ? cns : cns.split(" "), numNames = names.length, i = numNames - 1; i >= 0; i--) _loop(i);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
return final;
|
|
287
|
-
}
|
|
288
|
-
var pseudoInvert = {
|
|
289
|
-
hover: "hoverStyle",
|
|
290
|
-
focus: "focusStyle",
|
|
291
|
-
press: "pressStyle",
|
|
292
|
-
focusVisible: "focusVisibleStyle",
|
|
293
|
-
focusWithin: "focusWithinStyle",
|
|
294
|
-
disabled: "disabledStyle"
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
|
|
299
213
|
// ../helpers/dist/cjs/types.native.js
|
|
300
214
|
var require_types_native = __commonJS({
|
|
301
215
|
"../helpers/dist/cjs/types.native.js"(exports2, module2) {
|
|
@@ -1014,7 +928,6 @@ var require_index_native3 = __commonJS({
|
|
|
1014
928
|
__reExport2(index_exports2, require_index_native(), module2.exports);
|
|
1015
929
|
__reExport2(index_exports2, require_clamp_native(), module2.exports);
|
|
1016
930
|
__reExport2(index_exports2, require_composeEventHandlers_native(), module2.exports);
|
|
1017
|
-
__reExport2(index_exports2, require_concatClassName_native(), module2.exports);
|
|
1018
931
|
__reExport2(index_exports2, require_types_native(), module2.exports);
|
|
1019
932
|
__reExport2(index_exports2, require_shouldRenderNativePlatform_native(), module2.exports);
|
|
1020
933
|
__reExport2(index_exports2, require_validStyleProps_native(), module2.exports);
|
|
@@ -1283,22 +1196,22 @@ Haven't called createTamagui yet. ${import_constants2.MISSING_THEME_MESSAGE}
|
|
|
1283
1196
|
if (process.env.NODE_ENV === "development" && !conf) throw new Error(haventCalledErrorMessage);
|
|
1284
1197
|
var { tokens, tokensParsed } = conf;
|
|
1285
1198
|
return prefixed === !1 ? tokens : prefixed === !0 ? tokensParsed : tokensMerged;
|
|
1286
|
-
}, getTokenObject = function(
|
|
1199
|
+
}, getTokenObject = function(value, group) {
|
|
1287
1200
|
var _tokensMerged_group, _tokensMerged_, _conf_specificTokens_value;
|
|
1288
|
-
return (_conf_specificTokens_value = conf.specificTokens[
|
|
1289
|
-
return tokensMerged[cat][
|
|
1290
|
-
}) || ""]) === null || _tokensMerged_ === void 0 ? void 0 : _tokensMerged_[
|
|
1291
|
-
}, getToken2 = function(
|
|
1292
|
-
var useVariable = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_constants.isWeb, token = getTokenObject(
|
|
1201
|
+
return (_conf_specificTokens_value = conf.specificTokens[value]) !== null && _conf_specificTokens_value !== void 0 ? _conf_specificTokens_value : group ? (_tokensMerged_group = tokensMerged[group]) === null || _tokensMerged_group === void 0 ? void 0 : _tokensMerged_group[value] : (_tokensMerged_ = tokensMerged[Object.keys(tokensMerged).find(function(cat) {
|
|
1202
|
+
return tokensMerged[cat][value];
|
|
1203
|
+
}) || ""]) === null || _tokensMerged_ === void 0 ? void 0 : _tokensMerged_[value];
|
|
1204
|
+
}, getToken2 = function(value, group) {
|
|
1205
|
+
var useVariable = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_constants.isWeb, token = getTokenObject(value, group);
|
|
1293
1206
|
return useVariable ? token == null ? void 0 : token.variable : token == null ? void 0 : token.val;
|
|
1294
|
-
}, getTokenValue2 = function(
|
|
1295
|
-
if (!(
|
|
1207
|
+
}, getTokenValue2 = function(value, group) {
|
|
1208
|
+
if (!(value === "unset" || value === "auto")) return getToken2(value, group, !1);
|
|
1296
1209
|
}, useTokens = getTokens2, getThemes2 = function() {
|
|
1297
1210
|
return conf.themes;
|
|
1298
1211
|
}, configListeners = /* @__PURE__ */ new Set(), onConfiguredOnce = function(cb) {
|
|
1299
1212
|
conf ? cb(conf) : configListeners.add(cb);
|
|
1300
|
-
}, updateConfig2 = function(key,
|
|
1301
|
-
Object.assign(conf[key],
|
|
1213
|
+
}, updateConfig2 = function(key, value) {
|
|
1214
|
+
Object.assign(conf[key], value);
|
|
1302
1215
|
}, getFont = function(name) {
|
|
1303
1216
|
var _Object_entries_find, conf2 = getConfig2(), _conf_fontsParsed_name;
|
|
1304
1217
|
return (_conf_fontsParsed_name = conf2.fontsParsed[name]) !== null && _conf_fontsParsed_name !== void 0 ? _conf_fontsParsed_name : (_Object_entries_find = Object.entries(conf2.fontsParsed).find(function(param) {
|
|
@@ -1440,9 +1353,9 @@ var require_createVariable_native = __commonJS({
|
|
|
1440
1353
|
var name = (0, import_helpers2.simpleHash)(nameProp, 60);
|
|
1441
1354
|
return includeVar ? constructCSSVariableName(name) : name;
|
|
1442
1355
|
};
|
|
1443
|
-
function px(
|
|
1356
|
+
function px(value) {
|
|
1444
1357
|
return {
|
|
1445
|
-
val:
|
|
1358
|
+
val: value,
|
|
1446
1359
|
needsPx: !0
|
|
1447
1360
|
};
|
|
1448
1361
|
}
|
|
@@ -1532,8 +1445,8 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1532
1445
|
process.env.NODE_ENV === "development" && console.error(`\u274C Invalid transform, likely used deg/% improperly ${identifier}`);
|
|
1533
1446
|
return;
|
|
1534
1447
|
}
|
|
1535
|
-
var startI = s + 10, endI = css.indexOf(";"),
|
|
1536
|
-
if (!insertedTransforms[identifier]) return insertedTransforms[identifier] =
|
|
1448
|
+
var startI = s + 10, endI = css.indexOf(";"), value = css.slice(startI, endI);
|
|
1449
|
+
if (!insertedTransforms[identifier]) return insertedTransforms[identifier] = value, !0;
|
|
1537
1450
|
}
|
|
1538
1451
|
var lastScannedSheets = null;
|
|
1539
1452
|
function scanAllSheets() {
|
|
@@ -1648,15 +1561,15 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
1648
1561
|
if (sepI !== -1) {
|
|
1649
1562
|
var varIndex = rule.indexOf("--"), key1 = rule.slice(varIndex === -1 ? 0 : varIndex + 2, sepI);
|
|
1650
1563
|
process.env.TAMAGUI_CSS_VARIABLE_PREFIX && (key1 = key1.replace(process.env.TAMAGUI_CSS_VARIABLE_PREFIX, ""));
|
|
1651
|
-
var val = rule.slice(sepI + 2),
|
|
1564
|
+
var val = rule.slice(sepI + 2), value = void 0;
|
|
1652
1565
|
if (val[0] === "v" && val.startsWith("var(")) {
|
|
1653
1566
|
var varName = val.slice(6, -1), tokenVal = colorVarToVal[varName];
|
|
1654
|
-
tokenVal ?
|
|
1655
|
-
} else
|
|
1567
|
+
tokenVal ? value = tokenVal : (rootComputedStyle || (rootComputedStyle = getComputedStyle(document.body)), value = rootComputedStyle.getPropertyValue("--" + varName));
|
|
1568
|
+
} else value = val;
|
|
1656
1569
|
values[key1] = (0, import_createVariable.createVariable)({
|
|
1657
1570
|
key: key1,
|
|
1658
1571
|
name: key1,
|
|
1659
|
-
val:
|
|
1572
|
+
val: value
|
|
1660
1573
|
}, !0);
|
|
1661
1574
|
}
|
|
1662
1575
|
}
|
|
@@ -2190,8 +2103,8 @@ var require_useMedia_native = __commonJS({
|
|
|
2190
2103
|
if (typeof query == "string") return query;
|
|
2191
2104
|
if (cache.has(query)) return cache.get(query);
|
|
2192
2105
|
var res = Object.entries(query).map(function(param) {
|
|
2193
|
-
var [feature,
|
|
2194
|
-
return feature = camelToHyphen(feature), typeof
|
|
2106
|
+
var [feature, value] = param;
|
|
2107
|
+
return feature = camelToHyphen(feature), typeof value == "string" ? `(${feature}: ${value})` : (typeof value == "number" && /[height|width]$/.test(feature) && (value = `${value}px`), `(${feature}: ${value})`);
|
|
2195
2108
|
}).join(" and ");
|
|
2196
2109
|
return key && (cachedMediaKeyToQuery[key] = res), cache.set(query, res), res;
|
|
2197
2110
|
}
|
|
@@ -2282,13 +2195,13 @@ var require_Tamagui_native = __commonJS({
|
|
|
2282
2195
|
function _create_class(Constructor, protoProps, staticProps) {
|
|
2283
2196
|
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
|
|
2284
2197
|
}
|
|
2285
|
-
function _define_property(obj, key,
|
|
2198
|
+
function _define_property(obj, key, value) {
|
|
2286
2199
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
2287
|
-
value
|
|
2200
|
+
value,
|
|
2288
2201
|
enumerable: !0,
|
|
2289
2202
|
configurable: !0,
|
|
2290
2203
|
writable: !0
|
|
2291
|
-
}) : obj[key] =
|
|
2204
|
+
}) : obj[key] = value, obj;
|
|
2292
2205
|
}
|
|
2293
2206
|
var Tamagui = function() {
|
|
2294
2207
|
if (process.env.NODE_ENV === "development") {
|
|
@@ -2342,8 +2255,8 @@ var require_Tamagui_native = __commonJS({
|
|
|
2342
2255
|
}
|
|
2343
2256
|
}(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = function(identifier) {
|
|
2344
2257
|
return identifierToValue.get(identifier);
|
|
2345
|
-
}, setIdentifierValue = function(identifier,
|
|
2346
|
-
identifierToValue.set(identifier,
|
|
2258
|
+
}, setIdentifierValue = function(identifier, value) {
|
|
2259
|
+
identifierToValue.set(identifier, value);
|
|
2347
2260
|
};
|
|
2348
2261
|
}
|
|
2349
2262
|
});
|
|
@@ -2410,8 +2323,8 @@ var require_compose_refs_native = __commonJS({
|
|
|
2410
2323
|
});
|
|
2411
2324
|
module2.exports = __toCommonJS2(compose_refs_exports);
|
|
2412
2325
|
var React3 = __toESM2(require("react"));
|
|
2413
|
-
function setRef(ref,
|
|
2414
|
-
typeof ref == "function" ? ref(
|
|
2326
|
+
function setRef(ref, value) {
|
|
2327
|
+
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
2415
2328
|
}
|
|
2416
2329
|
function composeRefs() {
|
|
2417
2330
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
|
|
@@ -2738,8 +2651,8 @@ var require_createStyledContext_native = __commonJS({
|
|
|
2738
2651
|
})
|
|
2739
2652
|
});
|
|
2740
2653
|
}, useStyledContext = function() {
|
|
2741
|
-
var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", lastScopeInNamespace = (0, import_react3.useContext)(LastScopeInNamespace), scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn, context = scope ? getOrCreateScopedContext(scope) : OGContext,
|
|
2742
|
-
return
|
|
2654
|
+
var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", lastScopeInNamespace = (0, import_react3.useContext)(LastScopeInNamespace), scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn, context = scope ? getOrCreateScopedContext(scope) : OGContext, value = import_react3.default.useContext(context);
|
|
2655
|
+
return value;
|
|
2743
2656
|
};
|
|
2744
2657
|
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
2745
2658
|
}
|
|
@@ -4283,11 +4196,11 @@ var require_normalizeValueWithProperty_native = __commonJS({
|
|
|
4283
4196
|
translateX: !0,
|
|
4284
4197
|
translateY: !0
|
|
4285
4198
|
};
|
|
4286
|
-
function normalizeValueWithProperty(
|
|
4199
|
+
function normalizeValueWithProperty(value) {
|
|
4287
4200
|
var property = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
4288
|
-
if (!import_constants.isWeb || import_helpers2.stylePropsUnitless[property] || property && !stylePropsAllPlusTransforms[property] || typeof
|
|
4289
|
-
var res =
|
|
4290
|
-
return
|
|
4201
|
+
if (!import_constants.isWeb || import_helpers2.stylePropsUnitless[property] || property && !stylePropsAllPlusTransforms[property] || typeof value == "boolean") return value;
|
|
4202
|
+
var res = value;
|
|
4203
|
+
return value && typeof value == "object" ? value : (typeof value == "number" ? res = `${value}px` : property && (res = `${res}`), res);
|
|
4291
4204
|
}
|
|
4292
4205
|
}
|
|
4293
4206
|
});
|
|
@@ -4551,26 +4464,26 @@ var require_expandStyle_native = __commonJS({
|
|
|
4551
4464
|
return `${prefix}${k}`;
|
|
4552
4465
|
});
|
|
4553
4466
|
};
|
|
4554
|
-
function expandStyle(key,
|
|
4467
|
+
function expandStyle(key, value) {
|
|
4555
4468
|
if (import_constants.isAndroid && key === "elevationAndroid") return [
|
|
4556
4469
|
[
|
|
4557
4470
|
"elevation",
|
|
4558
|
-
|
|
4471
|
+
value
|
|
4559
4472
|
]
|
|
4560
4473
|
];
|
|
4561
4474
|
if (key in EXPANSIONS) return EXPANSIONS[key].map(function(key2) {
|
|
4562
4475
|
return [
|
|
4563
4476
|
key2,
|
|
4564
|
-
|
|
4477
|
+
value
|
|
4565
4478
|
];
|
|
4566
4479
|
});
|
|
4567
4480
|
if (key in import_webToNativeProps.webToNativeExpansion) return import_webToNativeProps.webToNativeExpansion[key].map(function(key2) {
|
|
4568
4481
|
return [
|
|
4569
4482
|
key2,
|
|
4570
|
-
|
|
4483
|
+
value
|
|
4571
4484
|
];
|
|
4572
4485
|
});
|
|
4573
|
-
if (key in import_webToNativeProps.webToNativeDynamicExpansion) return import_webToNativeProps.webToNativeDynamicExpansion[key](
|
|
4486
|
+
if (key in import_webToNativeProps.webToNativeDynamicExpansion) return import_webToNativeProps.webToNativeDynamicExpansion[key](value);
|
|
4574
4487
|
}
|
|
4575
4488
|
var all = [
|
|
4576
4489
|
"Top",
|
|
@@ -4815,8 +4728,8 @@ var require_normalizeStyle_native = __commonJS({
|
|
|
4815
4728
|
res[key] = normalizeStyle(prop, disableNormalize);
|
|
4816
4729
|
continue;
|
|
4817
4730
|
}
|
|
4818
|
-
var
|
|
4819
|
-
out ? Object.assign(res, Object.fromEntries(out)) : res[key] =
|
|
4731
|
+
var value = disableNormalize ? prop : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(prop, key), out = (0, import_expandStyle.expandStyle)(key, value);
|
|
4732
|
+
out ? Object.assign(res, Object.fromEntries(out)) : res[key] = value;
|
|
4820
4733
|
}
|
|
4821
4734
|
}
|
|
4822
4735
|
return (0, import_expandStyles.fixStyles)(res), res;
|
|
@@ -5035,18 +4948,18 @@ var require_propMapper_native = __commonJS({
|
|
|
5035
4948
|
}
|
|
5036
4949
|
});
|
|
5037
4950
|
module2.exports = __toCommonJS2(propMapper_exports);
|
|
5038
|
-
var import_constants = require_index_native2(), import_helpers2 = require_index_native3(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_normalizeStyle = require_normalizeStyle_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), propMapper = function(key,
|
|
5039
|
-
if (disabled) return map(key,
|
|
4951
|
+
var import_constants = require_index_native2(), import_helpers2 = require_index_native3(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_normalizeStyle = require_normalizeStyle_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), propMapper = function(key, value, styleState, disabled, map) {
|
|
4952
|
+
if (disabled) return map(key, value);
|
|
5040
4953
|
if (lastFontFamilyToken = null, !(!import_constants.isAndroid && key === "elevationAndroid")) {
|
|
5041
4954
|
var { conf, styleProps, staticConfig } = styleState;
|
|
5042
|
-
if (
|
|
4955
|
+
if (value === "unset") {
|
|
5043
4956
|
var _conf_unset, unsetVal = (_conf_unset = conf.unset) === null || _conf_unset === void 0 ? void 0 : _conf_unset[key];
|
|
5044
|
-
if (unsetVal != null)
|
|
4957
|
+
if (unsetVal != null) value = unsetVal;
|
|
5045
4958
|
else return;
|
|
5046
4959
|
}
|
|
5047
4960
|
var { variants } = staticConfig;
|
|
5048
4961
|
if (!styleProps.noExpand && variants && key in variants) {
|
|
5049
|
-
var variantValue = resolveVariants(key,
|
|
4962
|
+
var variantValue = resolveVariants(key, value, styleProps, styleState, "");
|
|
5050
4963
|
if (variantValue) {
|
|
5051
4964
|
variantValue.forEach(function(param) {
|
|
5052
4965
|
var [_$key, _$value] = param;
|
|
@@ -5055,35 +4968,35 @@ var require_propMapper_native = __commonJS({
|
|
|
5055
4968
|
return;
|
|
5056
4969
|
}
|
|
5057
4970
|
}
|
|
5058
|
-
if (styleProps.disableExpandShorthands || key in conf.shorthands && (key = conf.shorthands[key]),
|
|
4971
|
+
if (styleProps.disableExpandShorthands || key in conf.shorthands && (key = conf.shorthands[key]), value != null && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : (0, import_createVariable.isVariable)(value) && (value = resolveVariableValue(key, value, styleProps.resolveValues))), value != null) {
|
|
5059
4972
|
key === "fontFamily" && lastFontFamilyToken && (styleState.fontFamily = lastFontFamilyToken);
|
|
5060
|
-
var expanded = styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key,
|
|
4973
|
+
var expanded = styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value);
|
|
5061
4974
|
if (expanded) for (var max = expanded.length, i = 0; i < max; i++) {
|
|
5062
4975
|
var [nkey, nvalue] = expanded[i];
|
|
5063
4976
|
map(nkey, nvalue);
|
|
5064
4977
|
}
|
|
5065
|
-
else map(key,
|
|
4978
|
+
else map(key, value);
|
|
5066
4979
|
}
|
|
5067
4980
|
}
|
|
5068
|
-
}, resolveVariants = function(key,
|
|
4981
|
+
}, resolveVariants = function(key, value, styleProps, styleState, parentVariantKey) {
|
|
5069
4982
|
var { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
|
|
5070
4983
|
if (variants) {
|
|
5071
|
-
var variantValue = getVariantDefinition(variants[key],
|
|
4984
|
+
var variantValue = getVariantDefinition(variants[key], value, conf);
|
|
5072
4985
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`), console.info({
|
|
5073
4986
|
key,
|
|
5074
|
-
value
|
|
4987
|
+
value,
|
|
5075
4988
|
variantValue,
|
|
5076
4989
|
variants
|
|
5077
4990
|
}), console.groupEnd()), !variantValue) {
|
|
5078
|
-
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof
|
|
4991
|
+
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof value != "boolean") {
|
|
5079
4992
|
var name = staticConfig.componentName || "[UnnamedComponent]";
|
|
5080
|
-
console.warn(`No variant found: ${name} has variant "${key}", but no matching value "${
|
|
4993
|
+
console.warn(`No variant found: ${name} has variant "${key}", but no matching value "${value}"`);
|
|
5081
4994
|
}
|
|
5082
4995
|
return;
|
|
5083
4996
|
}
|
|
5084
4997
|
if (typeof variantValue == "function") {
|
|
5085
4998
|
var fn = variantValue, extras = (0, import_getVariantExtras.getVariantExtras)(styleState);
|
|
5086
|
-
variantValue = fn(
|
|
4999
|
+
variantValue = fn(value, extras), process.env.NODE_ENV;
|
|
5087
5000
|
}
|
|
5088
5001
|
var fontFamilyResult;
|
|
5089
5002
|
if ((0, import_isObj.isObj)(variantValue)) {
|
|
@@ -5108,11 +5021,11 @@ var require_propMapper_native = __commonJS({
|
|
|
5108
5021
|
}
|
|
5109
5022
|
} else if (typeof input == "string" && input[0] === "$") return input;
|
|
5110
5023
|
}
|
|
5111
|
-
var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), resolveTokensAndVariants = function(key,
|
|
5024
|
+
var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), resolveTokensAndVariants = function(key, value, styleProps, styleState, parentVariantKey) {
|
|
5112
5025
|
var { conf, staticConfig, debug, theme } = styleState, { variants } = staticConfig, res = {};
|
|
5113
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" - resolveTokensAndVariants", key,
|
|
5114
|
-
for (var _key in
|
|
5115
|
-
var subKey = conf.shorthands[_key] || _key, val =
|
|
5026
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" - resolveTokensAndVariants", key, value);
|
|
5027
|
+
for (var _key in value) {
|
|
5028
|
+
var subKey = conf.shorthands[_key] || _key, val = value[_key];
|
|
5116
5029
|
if (!(!styleProps.noSkip && subKey in import_skipProps.skipProps)) {
|
|
5117
5030
|
if (styleProps.noExpand) res[subKey] = val;
|
|
5118
5031
|
else if (variants && subKey in variants) {
|
|
@@ -5180,17 +5093,17 @@ var require_propMapper_native = __commonJS({
|
|
|
5180
5093
|
spreadName: `...${name}`
|
|
5181
5094
|
};
|
|
5182
5095
|
});
|
|
5183
|
-
function getVariantDefinition(variant,
|
|
5096
|
+
function getVariantDefinition(variant, value, conf) {
|
|
5184
5097
|
if (variant) {
|
|
5185
5098
|
if (typeof variant == "function") return variant;
|
|
5186
|
-
var exact = variant[
|
|
5099
|
+
var exact = variant[value];
|
|
5187
5100
|
if (exact) return exact;
|
|
5188
|
-
if (
|
|
5101
|
+
if (value != null) {
|
|
5189
5102
|
var { tokensParsed } = conf, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
5190
5103
|
try {
|
|
5191
5104
|
for (var _iterator = tokenCats[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
5192
5105
|
var { name, spreadName } = _step.value;
|
|
5193
|
-
if (spreadName in variant && name in tokensParsed &&
|
|
5106
|
+
if (spreadName in variant && name in tokensParsed && value in tokensParsed[name]) return variant[spreadName];
|
|
5194
5107
|
}
|
|
5195
5108
|
} catch (err) {
|
|
5196
5109
|
_didIteratorError = !0, _iteratorError = err;
|
|
@@ -5202,32 +5115,32 @@ var require_propMapper_native = __commonJS({
|
|
|
5202
5115
|
}
|
|
5203
5116
|
}
|
|
5204
5117
|
var fontSizeVariant = variant["...fontSize"];
|
|
5205
|
-
if (fontSizeVariant && conf.fontSizeTokens.has(
|
|
5118
|
+
if (fontSizeVariant && conf.fontSizeTokens.has(value)) return fontSizeVariant;
|
|
5206
5119
|
}
|
|
5207
|
-
return variant[`:${typeof
|
|
5120
|
+
return variant[`:${typeof value}`] || variant["..."];
|
|
5208
5121
|
}
|
|
5209
5122
|
}
|
|
5210
5123
|
var fontShorthand = {
|
|
5211
5124
|
fontSize: "size",
|
|
5212
5125
|
fontWeight: "weight"
|
|
5213
|
-
}, lastFontFamilyToken = null, getTokenForKey = function(key,
|
|
5126
|
+
}, lastFontFamilyToken = null, getTokenForKey = function(key, value, styleProps, styleState) {
|
|
5214
5127
|
var _staticConfig_accept, resolveAs = styleProps.resolveValues || "none";
|
|
5215
|
-
if (resolveAs === "none") return
|
|
5216
|
-
var { theme, conf = (0, import_config.getConfig)(), context, fontFamily, staticConfig } = styleState, themeValue = theme ? theme[
|
|
5128
|
+
if (resolveAs === "none") return value;
|
|
5129
|
+
var { theme, conf = (0, import_config.getConfig)(), context, fontFamily, staticConfig } = styleState, themeValue = theme ? theme[value] || theme[value.slice(1)] : void 0, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1, customTokenAccept = staticConfig == null || (_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key];
|
|
5217
5130
|
if (customTokenAccept) {
|
|
5218
|
-
var val = themeValue ?? tokensParsed[customTokenAccept][
|
|
5131
|
+
var val = themeValue ?? tokensParsed[customTokenAccept][value];
|
|
5219
5132
|
val != null && (resolveAs = "value", valOrVar = val, hasSet = !0);
|
|
5220
5133
|
}
|
|
5221
5134
|
if (themeValue) {
|
|
5222
|
-
if (resolveAs === "except-theme") return
|
|
5223
|
-
valOrVar = themeValue, process.env.NODE_ENV === "development" && styleState.debug === "verbose" && (globalThis.tamaguiAvoidTracking = !0, console.info(` - resolving ${key} to theme value ${
|
|
5135
|
+
if (resolveAs === "except-theme") return value;
|
|
5136
|
+
valOrVar = themeValue, process.env.NODE_ENV === "development" && styleState.debug === "verbose" && (globalThis.tamaguiAvoidTracking = !0, console.info(` - resolving ${key} to theme value ${value} resolveAs ${resolveAs}`, valOrVar), globalThis.tamaguiAvoidTracking = !1), hasSet = !0;
|
|
5224
5137
|
} else {
|
|
5225
|
-
if (
|
|
5138
|
+
if (value in conf.specificTokens) hasSet = !0, valOrVar = conf.specificTokens[value];
|
|
5226
5139
|
else {
|
|
5227
5140
|
switch (key) {
|
|
5228
5141
|
case "fontFamily": {
|
|
5229
5142
|
var _fontsParsed_value, fontsParsed = context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed;
|
|
5230
|
-
valOrVar = ((_fontsParsed_value = fontsParsed[
|
|
5143
|
+
valOrVar = ((_fontsParsed_value = fontsParsed[value]) === null || _fontsParsed_value === void 0 ? void 0 : _fontsParsed_value.family) || value, lastFontFamilyToken = value, hasSet = !0;
|
|
5231
5144
|
break;
|
|
5232
5145
|
}
|
|
5233
5146
|
case "fontSize":
|
|
@@ -5237,18 +5150,18 @@ var require_propMapper_native = __commonJS({
|
|
|
5237
5150
|
var fam = fontFamily || conf.defaultFontToken;
|
|
5238
5151
|
if (fam) {
|
|
5239
5152
|
var _font_, fontsParsed1 = context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed, font = fontsParsed1[fam] || fontsParsed1[conf.defaultFontToken];
|
|
5240
|
-
valOrVar = (font == null || (_font_ = font[fontShorthand[key] || key]) === null || _font_ === void 0 ? void 0 : _font_[
|
|
5153
|
+
valOrVar = (font == null || (_font_ = font[fontShorthand[key] || key]) === null || _font_ === void 0 ? void 0 : _font_[value]) || value, hasSet = !0;
|
|
5241
5154
|
}
|
|
5242
5155
|
break;
|
|
5243
5156
|
}
|
|
5244
5157
|
}
|
|
5245
5158
|
for (var cat in import_helpers2.tokenCategories) if (key in import_helpers2.tokenCategories[cat]) {
|
|
5246
|
-
var res = tokensParsed[cat][
|
|
5159
|
+
var res = tokensParsed[cat][value];
|
|
5247
5160
|
res != null && (valOrVar = res, hasSet = !0);
|
|
5248
5161
|
}
|
|
5249
5162
|
}
|
|
5250
5163
|
if (!hasSet) {
|
|
5251
|
-
var spaceVar = tokensParsed.space[
|
|
5164
|
+
var spaceVar = tokensParsed.space[value];
|
|
5252
5165
|
spaceVar != null && (valOrVar = spaceVar, hasSet = !0);
|
|
5253
5166
|
}
|
|
5254
5167
|
}
|
|
@@ -5374,8 +5287,8 @@ var require_transformsToString_native = __commonJS({
|
|
|
5374
5287
|
// { matrix: [1,2,3,4,5,6] } => 'matrix(1,2,3,4,5,6)'
|
|
5375
5288
|
// { perspective: 1000 } => perspective(1000px)
|
|
5376
5289
|
function(transform) {
|
|
5377
|
-
var type = Object.keys(transform)[0],
|
|
5378
|
-
return type === "matrix" || type === "matrix3d" ? `${type}(${
|
|
5290
|
+
var type = Object.keys(transform)[0], value = transform[type];
|
|
5291
|
+
return type === "matrix" || type === "matrix3d" ? `${type}(${value.join(",")})` : `${type}(${(0, import_normalizeValueWithProperty.normalizeValueWithProperty)(value, type)})`;
|
|
5379
5292
|
}
|
|
5380
5293
|
).join(" ");
|
|
5381
5294
|
}
|
|
@@ -5811,7 +5724,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5811
5724
|
if (!styleState.style.$$css) {
|
|
5812
5725
|
var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
|
|
5813
5726
|
try {
|
|
5814
|
-
for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) var atomicStyle, _props_animateOnly, _props_animateOnly1, key2,
|
|
5727
|
+
for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) var atomicStyle, _props_animateOnly, _props_animateOnly1, key2, value, identifier, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
|
|
5815
5728
|
} catch (err) {
|
|
5816
5729
|
} finally {
|
|
5817
5730
|
}
|
|
@@ -5985,14 +5898,14 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
5985
5898
|
delete viewProps[key], viewProps[key] = next;
|
|
5986
5899
|
} else viewProps[key] = val;
|
|
5987
5900
|
}
|
|
5988
|
-
function mergeMediaByImportance(styleState, mediaKey, key,
|
|
5901
|
+
function mergeMediaByImportance(styleState, mediaKey, key, value, isSizeMedia, importanceBump, debugProp) {
|
|
5989
5902
|
var usedKeys = styleState.usedKeys, importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, styleState, isSizeMedia);
|
|
5990
5903
|
if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)(`mergeMediaByImportance ${key} importance usedKey ${usedKeys[key]} next ${importance}`), importance === null) return !1;
|
|
5991
5904
|
if (key in import_pseudoDescriptors.pseudoDescriptors) {
|
|
5992
5905
|
var descriptor = import_pseudoDescriptors.pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = styleState.componentState[descriptorKey] === !1;
|
|
5993
5906
|
if (isDisabled) return !1;
|
|
5994
|
-
for (var subKey in
|
|
5995
|
-
} else mergeStyle(styleState, key,
|
|
5907
|
+
for (var subKey in value) mergeStyle(styleState, subKey, value[subKey], importance);
|
|
5908
|
+
} else mergeStyle(styleState, key, value, importance);
|
|
5996
5909
|
return !0;
|
|
5997
5910
|
}
|
|
5998
5911
|
function normalizeStyle(style) {
|
|
@@ -6622,14 +6535,14 @@ var require_getThemeProxied_native = __commonJS({
|
|
|
6622
6535
|
curKeys && (curKeys.current || (curKeys.current = /* @__PURE__ */ new Set()), curKeys.current.add(key), process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`, curKeys));
|
|
6623
6536
|
}
|
|
6624
6537
|
var proxied1 = Object.fromEntries(Object.entries(_state.theme).flatMap(function(param) {
|
|
6625
|
-
var [key,
|
|
6626
|
-
...
|
|
6538
|
+
var [key, value] = param, proxied2 = {
|
|
6539
|
+
...value,
|
|
6627
6540
|
get val() {
|
|
6628
|
-
return globalThis.tamaguiAvoidTracking || track(key),
|
|
6541
|
+
return globalThis.tamaguiAvoidTracking || track(key), value.val;
|
|
6629
6542
|
},
|
|
6630
6543
|
get(platform) {
|
|
6631
6544
|
if (curState) {
|
|
6632
|
-
var outVal = (0, import_createVariable.getVariable)(
|
|
6545
|
+
var outVal = (0, import_createVariable.getVariable)(value), { name, scheme, inverses } = curState, shouldOptimize = scheme && platform !== "web" && import_constants.isIos && !curProps.deopt && (0, import_config.getSetting)("fastSchemeChange") && inverses === 0 && (0, import_doesRootSchemeMatchSystem.doesRootSchemeMatchSystem)();
|
|
6633
6546
|
if (shouldOptimize) {
|
|
6634
6547
|
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)({
|
|
6635
6548
|
scheme,
|
|
@@ -7198,11 +7111,11 @@ var require_index_native7 = __commonJS({
|
|
|
7198
7111
|
};
|
|
7199
7112
|
function useDidFinishSSR() {
|
|
7200
7113
|
var clientOnly = React3.useContext(import_ClientOnly.ClientOnlyContext);
|
|
7201
|
-
return
|
|
7114
|
+
return !0;
|
|
7202
7115
|
}
|
|
7203
|
-
function useClientValue(
|
|
7116
|
+
function useClientValue(value) {
|
|
7204
7117
|
var done = useDidFinishSSR();
|
|
7205
|
-
return done ? typeof
|
|
7118
|
+
return done ? typeof value == "function" ? value() : value : void 0;
|
|
7206
7119
|
}
|
|
7207
7120
|
}
|
|
7208
7121
|
});
|
|
@@ -8819,10 +8732,10 @@ var require_createFont_native = __commonJS({
|
|
|
8819
8732
|
...sectionKeys
|
|
8820
8733
|
])
|
|
8821
8734
|
].map(function(key) {
|
|
8822
|
-
var _section_key, _ref,
|
|
8823
|
-
return fillValue =
|
|
8735
|
+
var _section_key, _ref, value = (_ref = (_section_key = section[key]) !== null && _section_key !== void 0 ? _section_key : defaultValue) !== null && _ref !== void 0 ? _ref : fillValue;
|
|
8736
|
+
return fillValue = value, defaultValue = value, [
|
|
8824
8737
|
key,
|
|
8825
|
-
|
|
8738
|
+
value
|
|
8826
8739
|
];
|
|
8827
8740
|
}));
|
|
8828
8741
|
}, createFont = function(font) {
|
|
@@ -9040,7 +8953,7 @@ ${JSON.stringify(variable, null, 2)}`);
|
|
|
9040
8953
|
var sep;
|
|
9041
8954
|
if (fontDeclarations) for (var key22 in fontDeclarations) var name1, declarations1, language1, fontSelector, langSelector, selectors, specificRuleSet;
|
|
9042
8955
|
}
|
|
9043
|
-
var themesIn = configIn.themes, dedupedThemes = foundThemes ?? getThemesDeduped(themesIn), themes = (0, import_proxyThemeToParents.proxyThemesToParents)(dedupedThemes);
|
|
8956
|
+
var themesIn = configIn.themes, dedupedThemes = foundThemes ?? getThemesDeduped(themesIn, tokens.color), themes = (0, import_proxyThemeToParents.proxyThemesToParents)(dedupedThemes);
|
|
9044
8957
|
return {
|
|
9045
8958
|
themes,
|
|
9046
8959
|
cssRuleSets,
|
|
@@ -9144,7 +9057,7 @@ ${JSON.stringify(variable, null, 2)}`);
|
|
|
9144
9057
|
}
|
|
9145
9058
|
return config;
|
|
9146
9059
|
}
|
|
9147
|
-
function getThemesDeduped(themes) {
|
|
9060
|
+
function getThemesDeduped(themes, colorTokens) {
|
|
9148
9061
|
var dedupedThemes = [], existing = /* @__PURE__ */ new Map();
|
|
9149
9062
|
for (var themeName in themes) {
|
|
9150
9063
|
var darkOrLightSpecificPrefix = themeName.startsWith("dark") ? "dark" : themeName.startsWith("light") ? "light" : "", rawTheme = themes[themeName], key = darkOrLightSpecificPrefix + JSON.stringify(rawTheme);
|
|
@@ -9156,6 +9069,7 @@ ${JSON.stringify(variable, null, 2)}`);
|
|
|
9156
9069
|
var theme = {
|
|
9157
9070
|
...rawTheme
|
|
9158
9071
|
};
|
|
9072
|
+
colorTokens && Object.assign(theme, colorTokens);
|
|
9159
9073
|
for (var key1 in theme) (0, import_themes.ensureThemeVariable)(theme, key1);
|
|
9160
9074
|
var deduped = {
|
|
9161
9075
|
names: [
|
|
@@ -10394,12 +10308,13 @@ var require_FontLanguage_native = __commonJS({
|
|
|
10394
10308
|
});
|
|
10395
10309
|
module2.exports = __toCommonJS2(FontLanguage_native_exports);
|
|
10396
10310
|
var import_jsx_runtime2 = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_ComponentContext = require_ComponentContext_native(), FontLanguage = function(param) {
|
|
10397
|
-
var { children, ...props } = param, language = import_react3.default.useMemo(function() {
|
|
10311
|
+
var { children, ...props } = param, parentProps = import_react3.default.useContext(import_ComponentContext.ComponentContext), language = import_react3.default.useMemo(function() {
|
|
10398
10312
|
return props;
|
|
10399
10313
|
}, [
|
|
10400
10314
|
JSON.stringify(props)
|
|
10401
10315
|
]);
|
|
10402
10316
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ComponentContext.ComponentContext.Provider, {
|
|
10317
|
+
...parentProps,
|
|
10403
10318
|
language,
|
|
10404
10319
|
children
|
|
10405
10320
|
});
|
|
@@ -10976,41 +10891,41 @@ var require_matchQuery_native = __commonJS({
|
|
|
10976
10891
|
var inverse = query.inverse, typeMatch = query.type === "all" || values.type === query.type;
|
|
10977
10892
|
if (typeMatch && inverse || !(typeMatch || inverse)) return !1;
|
|
10978
10893
|
var expressionsMatch = query.expressions.every(function(expression) {
|
|
10979
|
-
var feature = expression.feature, modifier = expression.modifier, expValue = expression.value,
|
|
10980
|
-
if (!
|
|
10894
|
+
var feature = expression.feature, modifier = expression.modifier, expValue = expression.value, value = values[feature];
|
|
10895
|
+
if (!value) return !1;
|
|
10981
10896
|
switch (feature) {
|
|
10982
10897
|
case "orientation":
|
|
10983
10898
|
case "scan":
|
|
10984
|
-
return
|
|
10899
|
+
return value.toLowerCase() === expValue.toLowerCase();
|
|
10985
10900
|
case "width":
|
|
10986
10901
|
case "height":
|
|
10987
10902
|
case "device-width":
|
|
10988
10903
|
case "device-height":
|
|
10989
|
-
expValue = toPx(expValue),
|
|
10904
|
+
expValue = toPx(expValue), value = toPx(value);
|
|
10990
10905
|
break;
|
|
10991
10906
|
case "resolution":
|
|
10992
|
-
expValue = toDpi(expValue),
|
|
10907
|
+
expValue = toDpi(expValue), value = toDpi(value);
|
|
10993
10908
|
break;
|
|
10994
10909
|
case "aspect-ratio":
|
|
10995
10910
|
case "device-aspect-ratio":
|
|
10996
10911
|
case /* Deprecated */
|
|
10997
10912
|
"device-pixel-ratio":
|
|
10998
|
-
expValue = toDecimal(expValue),
|
|
10913
|
+
expValue = toDecimal(expValue), value = toDecimal(value);
|
|
10999
10914
|
break;
|
|
11000
10915
|
case "grid":
|
|
11001
10916
|
case "color":
|
|
11002
10917
|
case "color-index":
|
|
11003
10918
|
case "monochrome":
|
|
11004
|
-
expValue = Number.parseInt(expValue, 10) || 1,
|
|
10919
|
+
expValue = Number.parseInt(expValue, 10) || 1, value = Number.parseInt(value, 10) || 0;
|
|
11005
10920
|
break;
|
|
11006
10921
|
}
|
|
11007
10922
|
switch (modifier) {
|
|
11008
10923
|
case "min":
|
|
11009
|
-
return
|
|
10924
|
+
return value >= expValue;
|
|
11010
10925
|
case "max":
|
|
11011
|
-
return
|
|
10926
|
+
return value <= expValue;
|
|
11012
10927
|
default:
|
|
11013
|
-
return
|
|
10928
|
+
return value === expValue;
|
|
11014
10929
|
}
|
|
11015
10930
|
});
|
|
11016
10931
|
return expressionsMatch && !inverse || !expressionsMatch && inverse;
|
|
@@ -11042,35 +10957,35 @@ var require_matchQuery_native = __commonJS({
|
|
|
11042
10957
|
return decimal || (numbers = ratio.match(/^(\d+)\s*\/\s*(\d+)$/), decimal = numbers[1] / numbers[2]), decimal;
|
|
11043
10958
|
}
|
|
11044
10959
|
function toDpi(resolution) {
|
|
11045
|
-
var _String_match,
|
|
10960
|
+
var _String_match, value = Number.parseFloat(resolution), units = (_String_match = String(resolution).match(RE_RESOLUTION_UNIT)) === null || _String_match === void 0 ? void 0 : _String_match[1];
|
|
11046
10961
|
switch (units) {
|
|
11047
10962
|
case "dpcm":
|
|
11048
|
-
return
|
|
10963
|
+
return value / 2.54;
|
|
11049
10964
|
case "dppx":
|
|
11050
|
-
return
|
|
10965
|
+
return value * 96;
|
|
11051
10966
|
default:
|
|
11052
|
-
return
|
|
10967
|
+
return value;
|
|
11053
10968
|
}
|
|
11054
10969
|
}
|
|
11055
10970
|
function toPx(length) {
|
|
11056
|
-
var _String_match,
|
|
10971
|
+
var _String_match, value = Number.parseFloat(length), units = (_String_match = String(length).match(RE_LENGTH_UNIT)) === null || _String_match === void 0 ? void 0 : _String_match[1];
|
|
11057
10972
|
switch (units) {
|
|
11058
10973
|
case "em":
|
|
11059
|
-
return
|
|
10974
|
+
return value * 16;
|
|
11060
10975
|
case "rem":
|
|
11061
|
-
return
|
|
10976
|
+
return value * 16;
|
|
11062
10977
|
case "cm":
|
|
11063
|
-
return
|
|
10978
|
+
return value * 96 / 2.54;
|
|
11064
10979
|
case "mm":
|
|
11065
|
-
return
|
|
10980
|
+
return value * 96 / 2.54 / 10;
|
|
11066
10981
|
case "in":
|
|
11067
|
-
return
|
|
10982
|
+
return value * 96;
|
|
11068
10983
|
case "pt":
|
|
11069
|
-
return
|
|
10984
|
+
return value * 72;
|
|
11070
10985
|
case "pc":
|
|
11071
|
-
return
|
|
10986
|
+
return value * 72 / 12;
|
|
11072
10987
|
default:
|
|
11073
|
-
return
|
|
10988
|
+
return value;
|
|
11074
10989
|
}
|
|
11075
10990
|
}
|
|
11076
10991
|
}
|
|
@@ -11132,13 +11047,13 @@ var require_mediaQueryList_native = __commonJS({
|
|
|
11132
11047
|
function _create_class(Constructor, protoProps, staticProps) {
|
|
11133
11048
|
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
|
|
11134
11049
|
}
|
|
11135
|
-
function _define_property(obj, key,
|
|
11050
|
+
function _define_property(obj, key, value) {
|
|
11136
11051
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
11137
|
-
value
|
|
11052
|
+
value,
|
|
11138
11053
|
enumerable: !0,
|
|
11139
11054
|
configurable: !0,
|
|
11140
11055
|
writable: !0
|
|
11141
|
-
}) : obj[key] =
|
|
11056
|
+
}) : obj[key] = value, obj;
|
|
11142
11057
|
}
|
|
11143
11058
|
var NativeMediaQueryList = /* @__PURE__ */ function() {
|
|
11144
11059
|
"use strict";
|
|
@@ -11808,13 +11723,13 @@ var require_ResponderTouchHistoryStore_native = __commonJS({
|
|
|
11808
11723
|
function _create_class(Constructor, protoProps, staticProps) {
|
|
11809
11724
|
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
|
|
11810
11725
|
}
|
|
11811
|
-
function _define_property(obj, key,
|
|
11726
|
+
function _define_property(obj, key, value) {
|
|
11812
11727
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
11813
|
-
value
|
|
11728
|
+
value,
|
|
11814
11729
|
enumerable: !0,
|
|
11815
11730
|
configurable: !0,
|
|
11816
11731
|
writable: !0
|
|
11817
|
-
}) : obj[key] =
|
|
11732
|
+
}) : obj[key] = value, obj;
|
|
11818
11733
|
}
|
|
11819
11734
|
var ResponderTouchHistoryStore = /* @__PURE__ */ function() {
|
|
11820
11735
|
"use strict";
|