@tamagui/web 3.0.0-beta.1546.1 → 3.0.0-beta.1551.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/cjs/helpers/getSplitStyles.cjs +18 -31
- package/dist/cjs/helpers/getSplitStyles.native.cjs +20 -32
- package/dist/cjs/helpers/getSplitStyles.native.js +20 -32
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +18 -31
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +20 -32
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/package.json +16 -16
- package/src/helpers/getCSSStylesAtomic.ts +1 -0
- package/src/helpers/getSplitStyles.tsx +39 -50
- package/types/helpers/getCSSStylesAtomic.d.ts +2 -1
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
|
@@ -392,7 +392,7 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
392
392
|
const property = entry[0] === "--t-x" ? "x" : entry[0] === "--t-y" ? "y" : entry[0] === "--t-scale-x" ? "scaleX" : entry[0] === "--t-scale-y" ? "scaleY" : entry[0];
|
|
393
393
|
const value = styleState.animationDriver?.inputStyle === "value" ? entry[6] : entry[1];
|
|
394
394
|
entry[3] ? contributeValue(styleState, property, value, entry[6], false, entry[3]) : emitValue(styleState, property, value, null, entry[6], false);
|
|
395
|
-
} else
|
|
395
|
+
} else writeStyleSlot(slots, slot, [...entry], pass[passSourceLayer]);
|
|
396
396
|
}
|
|
397
397
|
pass[passSourceLayer] = markerLayer;
|
|
398
398
|
}
|
|
@@ -977,7 +977,7 @@ function applyStylePieceClasses(styleState, piece, sourceLayer) {
|
|
|
977
977
|
for (const slot in compiled.slots) for (const entry of compiled.slots[slot]) {
|
|
978
978
|
const property = entry[0];
|
|
979
979
|
if (!ownsSourceLayer(styleState, property, !!entry[2])) continue;
|
|
980
|
-
|
|
980
|
+
writeStyleSlot(slots, slot, [...entry], sourceLayer);
|
|
981
981
|
}
|
|
982
982
|
if (compiled.programStates) {
|
|
983
983
|
const target = styleState.flatStateKeys ||= /* @__PURE__ */ new Set();
|
|
@@ -1023,7 +1023,7 @@ function applyStylePieceClasses(styleState, piece, sourceLayer) {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
return applied;
|
|
1025
1025
|
}
|
|
1026
|
-
function
|
|
1026
|
+
function writeStyleSlot(slots, slot, source, sourceLayer) {
|
|
1027
1027
|
let list = slots.get(slot);
|
|
1028
1028
|
if (!list) slots.set(slot, list = []);
|
|
1029
1029
|
const flags = source[7] & 31;
|
|
@@ -1048,9 +1048,8 @@ function writeCapturedStyleRecord(slots, slot, source, sourceLayer) {
|
|
|
1048
1048
|
break;
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
list.push(next);
|
|
1051
|
+
source[7] = flags | sourceLayer << 5;
|
|
1052
|
+
list.push(source);
|
|
1054
1053
|
}
|
|
1055
1054
|
function mergeStyle(styleState, key, val, disableNormalize = false, originalVal) {
|
|
1056
1055
|
const { viewProps, styleProps, staticConfig } = styleState;
|
|
@@ -1172,23 +1171,7 @@ function writeStyleRecord(state, property, value, cursor, original, flags, condi
|
|
|
1172
1171
|
if (entry[0] === property && !entry[2] && entryFlags >> 5 === sourceLayerStyle && (entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) other.splice(index--, 1);
|
|
1173
1172
|
}
|
|
1174
1173
|
}
|
|
1175
|
-
|
|
1176
|
-
const entry = list[index];
|
|
1177
|
-
const entryFlags = entry[7];
|
|
1178
|
-
if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) continue;
|
|
1179
|
-
if (entry[0] !== property) continue;
|
|
1180
|
-
if (flags & recordDefault) {
|
|
1181
|
-
if (!(entryFlags & recordDefault) && (!entry[2] || entry[3] === identity)) return;
|
|
1182
|
-
} else if (entryFlags & recordDefault && (!condition || entry[3] === identity)) {
|
|
1183
|
-
list.splice(index--, 1);
|
|
1184
|
-
continue;
|
|
1185
|
-
}
|
|
1186
|
-
if (entry[3] === identity) {
|
|
1187
|
-
list.splice(index, 1);
|
|
1188
|
-
break;
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
list.push([
|
|
1174
|
+
writeStyleSlot(slots, slot, [
|
|
1192
1175
|
property,
|
|
1193
1176
|
value,
|
|
1194
1177
|
condition,
|
|
@@ -1196,8 +1179,10 @@ function writeStyleRecord(state, property, value, cursor, original, flags, condi
|
|
|
1196
1179
|
cursor ? cursor[conditionSelector] : "",
|
|
1197
1180
|
cursor ? cursor[conditionWrappers] : void 0,
|
|
1198
1181
|
original,
|
|
1199
|
-
flags
|
|
1200
|
-
|
|
1182
|
+
flags,
|
|
1183
|
+
void 0,
|
|
1184
|
+
!sourceLayer && direct.flatPass?.[passVariantOutput]
|
|
1185
|
+
], sourceLayer);
|
|
1201
1186
|
}
|
|
1202
1187
|
function streamWriteInline(state, property, value, cursor, original, normalize = property === "lineHeight", conditionOverride = -1, force = false) {
|
|
1203
1188
|
writeStyleRecord(state, property, value, cursor, original, (normalize ? recordNormalize : 0) | (force ? recordInline : 0), conditionOverride);
|
|
@@ -1469,13 +1454,15 @@ function ownsSourceLayer(state, property, conditional = false) {
|
|
|
1469
1454
|
const layer = direct.flatPass?.[passSourceLayer] || 0;
|
|
1470
1455
|
const layers = direct.flatPropertyLayers ||= /* @__PURE__ */ new Map();
|
|
1471
1456
|
const previous = layers.get(property);
|
|
1472
|
-
if (
|
|
1473
|
-
|
|
1474
|
-
if (
|
|
1475
|
-
if (
|
|
1476
|
-
clearDirectStyle(state, property);
|
|
1457
|
+
if (!layer && !conditional && !direct.flatPass?.[passVariantOutput]) {
|
|
1458
|
+
const entries = direct.flatSlots?.get(styleSlot(property));
|
|
1459
|
+
if (entries) {
|
|
1460
|
+
for (let index = entries.length; index--;) if (entries[index][0] === property && entries[index][9]) entries.splice(index, 1);
|
|
1477
1461
|
}
|
|
1478
|
-
}
|
|
1462
|
+
}
|
|
1463
|
+
if (previous > layer) return false;
|
|
1464
|
+
if (conditional && previous !== layer) return true;
|
|
1465
|
+
if (previous < layer) clearDirectStyle(state, property);
|
|
1479
1466
|
layers.set(property, layer);
|
|
1480
1467
|
return true;
|
|
1481
1468
|
}
|
|
@@ -432,7 +432,7 @@ function contributeProp(pass, keyOg, valOg) {
|
|
|
432
432
|
var property2 = entry[0] === "--t-x" ? "x" : entry[0] === "--t-y" ? "y" : entry[0] === "--t-scale-x" ? "scaleX" : entry[0] === "--t-scale-y" ? "scaleY" : entry[0];
|
|
433
433
|
var value = ((_styleState_animationDriver = styleState.animationDriver) === null || _styleState_animationDriver === void 0 ? void 0 : _styleState_animationDriver.inputStyle) === "value" ? entry[6] : entry[1];
|
|
434
434
|
entry[3] ? contributeValue(styleState, property2, value, entry[6], false, entry[3]) : emitValue(styleState, property2, value, null, entry[6], false);
|
|
435
|
-
} else
|
|
435
|
+
} else writeStyleSlot(slots, slot, [...entry], pass[passSourceLayer]);
|
|
436
436
|
}
|
|
437
437
|
} catch (err) {
|
|
438
438
|
_didIteratorError1 = true;
|
|
@@ -1015,7 +1015,7 @@ function resolveStylePiece(styleState, piece) {
|
|
|
1015
1015
|
themeCache.set(theme, resolved);
|
|
1016
1016
|
return resolved;
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function writeStyleSlot(slots, slot, source, sourceLayer) {
|
|
1019
1019
|
var list = slots.get(slot);
|
|
1020
1020
|
if (!list) slots.set(slot, list = []);
|
|
1021
1021
|
var flags = source[7] & 31;
|
|
@@ -1040,9 +1040,8 @@ function writeCapturedStyleRecord(slots, slot, source, sourceLayer) {
|
|
|
1040
1040
|
break;
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
list.push(next);
|
|
1043
|
+
source[7] = flags | sourceLayer << 5;
|
|
1044
|
+
list.push(source);
|
|
1046
1045
|
}
|
|
1047
1046
|
function mergeStyle(styleState, key, val) {
|
|
1048
1047
|
arguments.length > 3 && arguments[3] !== void 0 && arguments[3];
|
|
@@ -1143,7 +1142,7 @@ var recordDefault = 8;
|
|
|
1143
1142
|
var recordCSS = 16;
|
|
1144
1143
|
function writeStyleRecord(state, property, value, cursor, original, flags) {
|
|
1145
1144
|
var conditionOverride = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : -1;
|
|
1146
|
-
var _direct_flatPass;
|
|
1145
|
+
var _direct_flatPass, _direct_flatPass1;
|
|
1147
1146
|
var _direct;
|
|
1148
1147
|
var condition = conditionOverride !== -1 ? conditionOverride : cursor ? cursor[conditionValue] : 0;
|
|
1149
1148
|
var identity = cursor ? cursor[conditionKey] : "";
|
|
@@ -1168,23 +1167,7 @@ function writeStyleRecord(state, property, value, cursor, original, flags) {
|
|
|
1168
1167
|
if (entry[0] === property && !entry[2] && entryFlags >> 5 === sourceLayerStyle && (entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) other.splice(index--, 1);
|
|
1169
1168
|
}
|
|
1170
1169
|
}
|
|
1171
|
-
|
|
1172
|
-
var entry1 = list[index1];
|
|
1173
|
-
var entryFlags1 = entry1[7];
|
|
1174
|
-
if ((entryFlags1 & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) continue;
|
|
1175
|
-
if (entry1[0] !== property) continue;
|
|
1176
|
-
if (flags & recordDefault) {
|
|
1177
|
-
if (!(entryFlags1 & recordDefault) && (!entry1[2] || entry1[3] === identity)) return;
|
|
1178
|
-
} else if (entryFlags1 & recordDefault && (!condition || entry1[3] === identity)) {
|
|
1179
|
-
list.splice(index1--, 1);
|
|
1180
|
-
continue;
|
|
1181
|
-
}
|
|
1182
|
-
if (entry1[3] === identity) {
|
|
1183
|
-
list.splice(index1, 1);
|
|
1184
|
-
break;
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
list.push([
|
|
1170
|
+
writeStyleSlot(slots, slot, [
|
|
1188
1171
|
property,
|
|
1189
1172
|
value,
|
|
1190
1173
|
condition,
|
|
@@ -1192,8 +1175,10 @@ function writeStyleRecord(state, property, value, cursor, original, flags) {
|
|
|
1192
1175
|
cursor ? cursor[conditionSelector] : "",
|
|
1193
1176
|
cursor ? cursor[conditionWrappers] : void 0,
|
|
1194
1177
|
original,
|
|
1195
|
-
flags
|
|
1196
|
-
|
|
1178
|
+
flags,
|
|
1179
|
+
void 0,
|
|
1180
|
+
!sourceLayer && ((_direct_flatPass1 = direct.flatPass) === null || _direct_flatPass1 === void 0 ? void 0 : _direct_flatPass1[passVariantOutput])
|
|
1181
|
+
], sourceLayer);
|
|
1197
1182
|
}
|
|
1198
1183
|
function streamWriteInline(state, property, value, cursor, original) {
|
|
1199
1184
|
var normalize = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : property === "lineHeight", conditionOverride = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : -1, force = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : false;
|
|
@@ -1557,19 +1542,22 @@ function configuredValue(state, property, raw) {
|
|
|
1557
1542
|
}
|
|
1558
1543
|
function ownsSourceLayer(state, property) {
|
|
1559
1544
|
var conditional = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
1560
|
-
var _direct_flatPass;
|
|
1545
|
+
var _direct_flatPass, _direct_flatPass1;
|
|
1561
1546
|
var _direct;
|
|
1562
1547
|
var direct = state;
|
|
1563
1548
|
var layer = ((_direct_flatPass = direct.flatPass) === null || _direct_flatPass === void 0 ? void 0 : _direct_flatPass[passSourceLayer]) || 0;
|
|
1564
1549
|
var layers = (_direct = direct).flatPropertyLayers || (_direct.flatPropertyLayers = /* @__PURE__ */ new Map());
|
|
1565
1550
|
var previous = layers.get(property);
|
|
1566
|
-
if (
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1551
|
+
if (!layer && !conditional && !((_direct_flatPass1 = direct.flatPass) === null || _direct_flatPass1 === void 0 ? void 0 : _direct_flatPass1[passVariantOutput])) {
|
|
1552
|
+
var _direct_flatSlots;
|
|
1553
|
+
var entries = (_direct_flatSlots = direct.flatSlots) === null || _direct_flatSlots === void 0 ? void 0 : _direct_flatSlots.get(property);
|
|
1554
|
+
if (entries) {
|
|
1555
|
+
for (var index = entries.length; index--;) if (entries[index][0] === property && entries[index][9]) entries.splice(index, 1);
|
|
1571
1556
|
}
|
|
1572
|
-
}
|
|
1557
|
+
}
|
|
1558
|
+
if (previous > layer) return false;
|
|
1559
|
+
if (conditional && previous !== layer) return true;
|
|
1560
|
+
if (previous < layer) clearDirectStyle(state, property);
|
|
1573
1561
|
layers.set(property, layer);
|
|
1574
1562
|
return true;
|
|
1575
1563
|
}
|
|
@@ -432,7 +432,7 @@ function contributeProp(pass, keyOg, valOg) {
|
|
|
432
432
|
var property2 = entry[0] === "--t-x" ? "x" : entry[0] === "--t-y" ? "y" : entry[0] === "--t-scale-x" ? "scaleX" : entry[0] === "--t-scale-y" ? "scaleY" : entry[0];
|
|
433
433
|
var value = ((_styleState_animationDriver = styleState.animationDriver) === null || _styleState_animationDriver === void 0 ? void 0 : _styleState_animationDriver.inputStyle) === "value" ? entry[6] : entry[1];
|
|
434
434
|
entry[3] ? contributeValue(styleState, property2, value, entry[6], false, entry[3]) : emitValue(styleState, property2, value, null, entry[6], false);
|
|
435
|
-
} else
|
|
435
|
+
} else writeStyleSlot(slots, slot, [...entry], pass[passSourceLayer]);
|
|
436
436
|
}
|
|
437
437
|
} catch (err) {
|
|
438
438
|
_didIteratorError1 = true;
|
|
@@ -1015,7 +1015,7 @@ function resolveStylePiece(styleState, piece) {
|
|
|
1015
1015
|
themeCache.set(theme, resolved);
|
|
1016
1016
|
return resolved;
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function writeStyleSlot(slots, slot, source, sourceLayer) {
|
|
1019
1019
|
var list = slots.get(slot);
|
|
1020
1020
|
if (!list) slots.set(slot, list = []);
|
|
1021
1021
|
var flags = source[7] & 31;
|
|
@@ -1040,9 +1040,8 @@ function writeCapturedStyleRecord(slots, slot, source, sourceLayer) {
|
|
|
1040
1040
|
break;
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
list.push(next);
|
|
1043
|
+
source[7] = flags | sourceLayer << 5;
|
|
1044
|
+
list.push(source);
|
|
1046
1045
|
}
|
|
1047
1046
|
function mergeStyle(styleState, key, val) {
|
|
1048
1047
|
arguments.length > 3 && arguments[3] !== void 0 && arguments[3];
|
|
@@ -1143,7 +1142,7 @@ var recordDefault = 8;
|
|
|
1143
1142
|
var recordCSS = 16;
|
|
1144
1143
|
function writeStyleRecord(state, property, value, cursor, original, flags) {
|
|
1145
1144
|
var conditionOverride = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : -1;
|
|
1146
|
-
var _direct_flatPass;
|
|
1145
|
+
var _direct_flatPass, _direct_flatPass1;
|
|
1147
1146
|
var _direct;
|
|
1148
1147
|
var condition = conditionOverride !== -1 ? conditionOverride : cursor ? cursor[conditionValue] : 0;
|
|
1149
1148
|
var identity = cursor ? cursor[conditionKey] : "";
|
|
@@ -1168,23 +1167,7 @@ function writeStyleRecord(state, property, value, cursor, original, flags) {
|
|
|
1168
1167
|
if (entry[0] === property && !entry[2] && entryFlags >> 5 === sourceLayerStyle && (entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) other.splice(index--, 1);
|
|
1169
1168
|
}
|
|
1170
1169
|
}
|
|
1171
|
-
|
|
1172
|
-
var entry1 = list[index1];
|
|
1173
|
-
var entryFlags1 = entry1[7];
|
|
1174
|
-
if ((entryFlags1 & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) continue;
|
|
1175
|
-
if (entry1[0] !== property) continue;
|
|
1176
|
-
if (flags & recordDefault) {
|
|
1177
|
-
if (!(entryFlags1 & recordDefault) && (!entry1[2] || entry1[3] === identity)) return;
|
|
1178
|
-
} else if (entryFlags1 & recordDefault && (!condition || entry1[3] === identity)) {
|
|
1179
|
-
list.splice(index1--, 1);
|
|
1180
|
-
continue;
|
|
1181
|
-
}
|
|
1182
|
-
if (entry1[3] === identity) {
|
|
1183
|
-
list.splice(index1, 1);
|
|
1184
|
-
break;
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
list.push([
|
|
1170
|
+
writeStyleSlot(slots, slot, [
|
|
1188
1171
|
property,
|
|
1189
1172
|
value,
|
|
1190
1173
|
condition,
|
|
@@ -1192,8 +1175,10 @@ function writeStyleRecord(state, property, value, cursor, original, flags) {
|
|
|
1192
1175
|
cursor ? cursor[conditionSelector] : "",
|
|
1193
1176
|
cursor ? cursor[conditionWrappers] : void 0,
|
|
1194
1177
|
original,
|
|
1195
|
-
flags
|
|
1196
|
-
|
|
1178
|
+
flags,
|
|
1179
|
+
void 0,
|
|
1180
|
+
!sourceLayer && ((_direct_flatPass1 = direct.flatPass) === null || _direct_flatPass1 === void 0 ? void 0 : _direct_flatPass1[passVariantOutput])
|
|
1181
|
+
], sourceLayer);
|
|
1197
1182
|
}
|
|
1198
1183
|
function streamWriteInline(state, property, value, cursor, original) {
|
|
1199
1184
|
var normalize = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : property === "lineHeight", conditionOverride = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : -1, force = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : false;
|
|
@@ -1557,19 +1542,22 @@ function configuredValue(state, property, raw) {
|
|
|
1557
1542
|
}
|
|
1558
1543
|
function ownsSourceLayer(state, property) {
|
|
1559
1544
|
var conditional = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
1560
|
-
var _direct_flatPass;
|
|
1545
|
+
var _direct_flatPass, _direct_flatPass1;
|
|
1561
1546
|
var _direct;
|
|
1562
1547
|
var direct = state;
|
|
1563
1548
|
var layer = ((_direct_flatPass = direct.flatPass) === null || _direct_flatPass === void 0 ? void 0 : _direct_flatPass[passSourceLayer]) || 0;
|
|
1564
1549
|
var layers = (_direct = direct).flatPropertyLayers || (_direct.flatPropertyLayers = /* @__PURE__ */ new Map());
|
|
1565
1550
|
var previous = layers.get(property);
|
|
1566
|
-
if (
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1551
|
+
if (!layer && !conditional && !((_direct_flatPass1 = direct.flatPass) === null || _direct_flatPass1 === void 0 ? void 0 : _direct_flatPass1[passVariantOutput])) {
|
|
1552
|
+
var _direct_flatSlots;
|
|
1553
|
+
var entries = (_direct_flatSlots = direct.flatSlots) === null || _direct_flatSlots === void 0 ? void 0 : _direct_flatSlots.get(property);
|
|
1554
|
+
if (entries) {
|
|
1555
|
+
for (var index = entries.length; index--;) if (entries[index][0] === property && entries[index][9]) entries.splice(index, 1);
|
|
1571
1556
|
}
|
|
1572
|
-
}
|
|
1557
|
+
}
|
|
1558
|
+
if (previous > layer) return false;
|
|
1559
|
+
if (conditional && previous !== layer) return true;
|
|
1560
|
+
if (previous < layer) clearDirectStyle(state, property);
|
|
1573
1561
|
layers.set(property, layer);
|
|
1574
1562
|
return true;
|
|
1575
1563
|
}
|