@tamagui/core 2.0.0-1 → 2.0.0-1768024152500
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.cjs +30 -16
- package/dist/test.native.cjs +28 -14
- package/package.json +11 -11
package/dist/native.cjs
CHANGED
|
@@ -1747,10 +1747,10 @@ const stylesFromProps = /* @__PURE__ */ new WeakMap(), createDOMProps = (element
|
|
|
1747
1747
|
/* These roles are made keyboard focusable by default */
|
|
1748
1748
|
role === "button" || role === "checkbox" || role === "link" || role === "radio" || role === "textbox" || role === "switch" ? focusable !== false && (domProps.tabIndex = "0") : focusable === true && (domProps.tabIndex = "0")
|
|
1749
1749
|
);
|
|
1750
|
-
flattenStyle$1(style);
|
|
1750
|
+
const flat = flattenStyle$1(style);
|
|
1751
1751
|
let className = tmgCN || "";
|
|
1752
1752
|
props.className && (className += ` ${props.className}`);
|
|
1753
|
-
const stylesAtomic = getCSSStylesAtomic();
|
|
1753
|
+
const stylesAtomic = flat ? getCSSStylesAtomic() : [];
|
|
1754
1754
|
stylesFromProps.set(domProps, stylesAtomic), domProps.style = stylesAtomic.reduce((acc, [key, value]) => key[0] === "_" || key.startsWith("is_") || key.startsWith("font_") ? (className += ` ${key}`, acc) : (key === "$$css" || key === "" || (acc[key] = value), acc), {}), className && (domProps.className = className);
|
|
1755
1755
|
const _id = tmgID || id2 || nativeID;
|
|
1756
1756
|
return _id && (domProps.id = _id), testID != null && (domProps["data-testid"] = testID), domProps;
|
|
@@ -8976,7 +8976,7 @@ var ThemeStateContext = React.createContext(""), allListeners = /* @__PURE__ */
|
|
|
8976
8976
|
name: ""
|
|
8977
8977
|
}];
|
|
8978
8978
|
themes || (themes = getConfig().themes);
|
|
8979
|
-
var name = !propsKey && (!lastState || !(lastState == null ? void 0 : lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props, pendingUpdate === "force" ? true : !!needsUpdate), isSameAsParent = parentState && (!name || name === parentState.name), shouldRerender = !!(needsUpdate && (pendingUpdate || (lastState == null ? void 0 : lastState.name) !== (parentState == null ? void 0 : parentState.name)));
|
|
8979
|
+
var name = !propsKey && (!lastState || !(lastState == null ? void 0 : lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props, pendingUpdate === "force" ? true : !!needsUpdate), isSameAsParent = parentState && (!name || name === parentState.name), shouldRerender = !!(pendingUpdate === "force" || needsUpdate && (pendingUpdate || (lastState == null ? void 0 : lastState.name) !== (parentState == null ? void 0 : parentState.name)));
|
|
8980
8980
|
if (isSameAsParent) return [shouldRerender, __spreadProps(__spreadValues({}, parentState), {
|
|
8981
8981
|
isNew: false
|
|
8982
8982
|
})];
|
|
@@ -9082,13 +9082,27 @@ function getNewThemeName() {
|
|
|
9082
9082
|
if (!found && !nameHasScheme) {
|
|
9083
9083
|
var parentScheme = getScheme(parentName);
|
|
9084
9084
|
if (parentScheme) {
|
|
9085
|
-
var
|
|
9085
|
+
for (var potentialBases = [], i = parentParts.length; i >= 1; i--) potentialBases.push(parentParts.slice(0, i).join("_"));
|
|
9086
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
9086
9087
|
try {
|
|
9087
|
-
for (var _iterator1 =
|
|
9088
|
-
var
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9088
|
+
outer: for (var _iterator1 = potentialBases[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
9089
|
+
var base = _step1.value, candidates = [componentName ? `${base}_${name}_${componentName}` : void 0, `${base}_${name}`].filter(Boolean), _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
9090
|
+
try {
|
|
9091
|
+
for (var _iterator2 = candidates[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
9092
|
+
var potential = _step2.value;
|
|
9093
|
+
if (potential in themes2) {
|
|
9094
|
+
found = potential;
|
|
9095
|
+
break outer;
|
|
9096
|
+
}
|
|
9097
|
+
}
|
|
9098
|
+
} catch (err) {
|
|
9099
|
+
_didIteratorError2 = true, _iteratorError2 = err;
|
|
9100
|
+
} finally {
|
|
9101
|
+
try {
|
|
9102
|
+
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
|
9103
|
+
} finally {
|
|
9104
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
9105
|
+
}
|
|
9092
9106
|
}
|
|
9093
9107
|
}
|
|
9094
9108
|
} catch (err) {
|
|
@@ -9106,23 +9120,23 @@ function getNewThemeName() {
|
|
|
9106
9120
|
if (!found) if (!name && componentName) {
|
|
9107
9121
|
var potential1 = `${parentParts.join("_")}_${componentName}`;
|
|
9108
9122
|
potential1 in themes2 && (found = potential1);
|
|
9109
|
-
} else for (var max = parentParts.length,
|
|
9110
|
-
var
|
|
9123
|
+
} else for (var max = parentParts.length, i1 = 0; i1 <= max; i1++) {
|
|
9124
|
+
var base1 = (i1 === 0 ? parentParts : parentParts.slice(0, -i1)).join("_"), _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
|
|
9111
9125
|
try {
|
|
9112
|
-
for (var
|
|
9113
|
-
var subName1 =
|
|
9126
|
+
for (var _iterator3 = subNames[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
9127
|
+
var subName1 = _step3.value, potential2 = base1 ? `${base1}_${subName1}` : subName1;
|
|
9114
9128
|
if (potential2 in themes2) {
|
|
9115
9129
|
found = potential2;
|
|
9116
9130
|
break;
|
|
9117
9131
|
}
|
|
9118
9132
|
}
|
|
9119
9133
|
} catch (err) {
|
|
9120
|
-
|
|
9134
|
+
_didIteratorError3 = true, _iteratorError3 = err;
|
|
9121
9135
|
} finally {
|
|
9122
9136
|
try {
|
|
9123
|
-
!
|
|
9137
|
+
!_iteratorNormalCompletion3 && _iterator3.return != null && _iterator3.return();
|
|
9124
9138
|
} finally {
|
|
9125
|
-
if (
|
|
9139
|
+
if (_didIteratorError3) throw _iteratorError3;
|
|
9126
9140
|
}
|
|
9127
9141
|
}
|
|
9128
9142
|
if (found) break;
|
package/dist/test.native.cjs
CHANGED
|
@@ -1128,7 +1128,7 @@ var ThemeStateContext = React.createContext(""), allListeners = /* @__PURE__ */
|
|
|
1128
1128
|
name: ""
|
|
1129
1129
|
}];
|
|
1130
1130
|
themes || (themes = getConfig().themes);
|
|
1131
|
-
var name = !propsKey && (!lastState || !(lastState == null ? void 0 : lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props, pendingUpdate === "force" ? true : !!needsUpdate), isSameAsParent = parentState && (!name || name === parentState.name), shouldRerender = !!(needsUpdate && (pendingUpdate || (lastState == null ? void 0 : lastState.name) !== (parentState == null ? void 0 : parentState.name)));
|
|
1131
|
+
var name = !propsKey && (!lastState || !(lastState == null ? void 0 : lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props, pendingUpdate === "force" ? true : !!needsUpdate), isSameAsParent = parentState && (!name || name === parentState.name), shouldRerender = !!(pendingUpdate === "force" || needsUpdate && (pendingUpdate || (lastState == null ? void 0 : lastState.name) !== (parentState == null ? void 0 : parentState.name)));
|
|
1132
1132
|
if (isSameAsParent) return [shouldRerender, __spreadProps(__spreadValues({}, parentState), {
|
|
1133
1133
|
isNew: false
|
|
1134
1134
|
})];
|
|
@@ -1234,13 +1234,27 @@ function getNewThemeName() {
|
|
|
1234
1234
|
if (!found && !nameHasScheme) {
|
|
1235
1235
|
var parentScheme = getScheme(parentName);
|
|
1236
1236
|
if (parentScheme) {
|
|
1237
|
-
var
|
|
1237
|
+
for (var potentialBases = [], i = parentParts.length; i >= 1; i--) potentialBases.push(parentParts.slice(0, i).join("_"));
|
|
1238
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
1238
1239
|
try {
|
|
1239
|
-
for (var _iterator1 =
|
|
1240
|
-
var
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1240
|
+
outer: for (var _iterator1 = potentialBases[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
1241
|
+
var base = _step1.value, candidates = [componentName ? `${base}_${name}_${componentName}` : void 0, `${base}_${name}`].filter(Boolean), _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
1242
|
+
try {
|
|
1243
|
+
for (var _iterator2 = candidates[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
1244
|
+
var potential = _step2.value;
|
|
1245
|
+
if (potential in themes2) {
|
|
1246
|
+
found = potential;
|
|
1247
|
+
break outer;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
} catch (err) {
|
|
1251
|
+
_didIteratorError2 = true, _iteratorError2 = err;
|
|
1252
|
+
} finally {
|
|
1253
|
+
try {
|
|
1254
|
+
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
|
1255
|
+
} finally {
|
|
1256
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
1257
|
+
}
|
|
1244
1258
|
}
|
|
1245
1259
|
}
|
|
1246
1260
|
} catch (err) {
|
|
@@ -1258,23 +1272,23 @@ function getNewThemeName() {
|
|
|
1258
1272
|
if (!found) if (!name && componentName) {
|
|
1259
1273
|
var potential1 = `${parentParts.join("_")}_${componentName}`;
|
|
1260
1274
|
potential1 in themes2 && (found = potential1);
|
|
1261
|
-
} else for (var max = parentParts.length,
|
|
1262
|
-
var
|
|
1275
|
+
} else for (var max = parentParts.length, i1 = 0; i1 <= max; i1++) {
|
|
1276
|
+
var base1 = (i1 === 0 ? parentParts : parentParts.slice(0, -i1)).join("_"), _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
|
|
1263
1277
|
try {
|
|
1264
|
-
for (var
|
|
1265
|
-
var subName1 =
|
|
1278
|
+
for (var _iterator3 = subNames[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
1279
|
+
var subName1 = _step3.value, potential2 = base1 ? `${base1}_${subName1}` : subName1;
|
|
1266
1280
|
if (potential2 in themes2) {
|
|
1267
1281
|
found = potential2;
|
|
1268
1282
|
break;
|
|
1269
1283
|
}
|
|
1270
1284
|
}
|
|
1271
1285
|
} catch (err) {
|
|
1272
|
-
|
|
1286
|
+
_didIteratorError3 = true, _iteratorError3 = err;
|
|
1273
1287
|
} finally {
|
|
1274
1288
|
try {
|
|
1275
|
-
!
|
|
1289
|
+
!_iteratorNormalCompletion3 && _iterator3.return != null && _iterator3.return();
|
|
1276
1290
|
} finally {
|
|
1277
|
-
if (
|
|
1291
|
+
if (_didIteratorError3) throw _iteratorError3;
|
|
1278
1292
|
}
|
|
1279
1293
|
}
|
|
1280
1294
|
if (found) break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-1768024152500",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"source": "src/index.tsx",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
"native-test.d.ts"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tamagui/helpers": "2.0.0-
|
|
37
|
-
"@tamagui/react-native-media-driver": "2.0.0-
|
|
38
|
-
"@tamagui/react-native-use-pressable": "2.0.0-
|
|
39
|
-
"@tamagui/react-native-use-responder-events": "2.0.0-
|
|
40
|
-
"@tamagui/use-element-layout": "2.0.0-
|
|
41
|
-
"@tamagui/use-event": "2.0.0-
|
|
42
|
-
"@tamagui/web": "2.0.0-
|
|
36
|
+
"@tamagui/helpers": "2.0.0-1768024152500",
|
|
37
|
+
"@tamagui/react-native-media-driver": "2.0.0-1768024152500",
|
|
38
|
+
"@tamagui/react-native-use-pressable": "2.0.0-1768024152500",
|
|
39
|
+
"@tamagui/react-native-use-responder-events": "2.0.0-1768024152500",
|
|
40
|
+
"@tamagui/use-element-layout": "2.0.0-1768024152500",
|
|
41
|
+
"@tamagui/use-event": "2.0.0-1768024152500",
|
|
42
|
+
"@tamagui/web": "2.0.0-1768024152500"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@tamagui/build": "2.0.0-
|
|
46
|
-
"@tamagui/native-bundle": "2.0.0-
|
|
47
|
-
"@tamagui/react-native-web-lite": "2.0.0-
|
|
45
|
+
"@tamagui/build": "2.0.0-1768024152500",
|
|
46
|
+
"@tamagui/native-bundle": "2.0.0-1768024152500",
|
|
47
|
+
"@tamagui/react-native-web-lite": "2.0.0-1768024152500",
|
|
48
48
|
"@testing-library/react": "^16.1.0",
|
|
49
49
|
"csstype": "^3.0.10",
|
|
50
50
|
"react": "*",
|