@tamagui/web 3.0.0-beta.1125.1 → 3.0.0-beta.1141.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.
@@ -478,8 +478,21 @@ function contributeProp(pass, keyOg, valOg) {
478
478
  }
479
479
  var styleOriginals = shouldTrackStyleTokenProvenance ? import_styleOriginalValues.styleOriginalValues.get(style) : void 0;
480
480
  for (var key1 in style) {
481
- if (style[key1] == null) continue;
482
- contributeValue(styleState, key1, style[key1], styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[key1]);
481
+ var value1 = style[key1];
482
+ if (value1 == null) continue;
483
+ var inline = !styleState.styleProps.stylePieceEntries;
484
+ if (inline) {
485
+ if (typeof value1 === "string") {
486
+ var [segments] = (0, import_grammarConfig.getConfigRevisionState)(conf).parseFlatValue(value1);
487
+ for (var index2 = 4; index2 < segments.length; index2 += 5) if (!(segments[index2] & 1)) {
488
+ inline = false;
489
+ break;
490
+ }
491
+ } else if (value1 && typeof value1 === "object" && !Array.isArray(value1) && !(0, import_createVariable.isVariable)(value1) && classifyConditionalObject(value1, styleState) !== 0) inline = false;
492
+ }
493
+ styleState.flatInlineStyleProp = inline;
494
+ contributeValue(styleState, key1, value1, styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[key1]);
495
+ styleState.flatInlineStyleProp = false;
483
496
  }
484
497
  }
485
498
  pass[passSourceLayer] = layerBeforeStyle;
@@ -588,7 +601,7 @@ function contributeProp(pass, keyOg, valOg) {
588
601
  if (valInit === "unset") {
589
602
  var expanded = (0, import_expandStyle.expandStyle)(keyInit, valInit, conf.settings.styleCompat || "web");
590
603
  clearDirectStyle(styleState, keyInit);
591
- if (expanded) for (var index2 = 0; index2 < expanded.length; index2++) clearDirectStyle(styleState, expanded[index2][0]);
604
+ if (expanded) for (var index3 = 0; index3 < expanded.length; index3++) clearDirectStyle(styleState, expanded[index3][0]);
592
605
  } else contributeValue(styleState, keyInit, valInit, originalOg, !isHostStyleKey);
593
606
  return;
594
607
  }
@@ -972,7 +985,10 @@ function writeCapturedStyleRecord(slots, slot, source, sourceLayer) {
972
985
  for (var index = 0; index < list.length; index++) {
973
986
  var entry = list[index];
974
987
  var entryFlags = entry[7] & 31;
975
- if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) continue;
988
+ if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) {
989
+ if (sourceLayer === sourceLayerStyle && entry[7] >> 5 === sourceLayerStyle && entry[0] === source[0] && !condition && !entry[2]) list.splice(index--, 1);
990
+ continue;
991
+ }
976
992
  if (entry[0] !== source[0]) continue;
977
993
  if (flags & recordDefault) {
978
994
  if (!(entryFlags & recordDefault) && (!entry[2] || entry[3] === identity)) return;
@@ -1030,8 +1046,8 @@ function recordStyleTokenProvenance(styleState, key, originalVal) {
1030
1046
  var tokenName = typeof originalVal === "string" ? originalVal : "";
1031
1047
  if (tokenName) {
1032
1048
  var slash = tokenName.lastIndexOf("/");
1033
- var opacity = slash === -1 ? NaN : Number(tokenName.slice(slash + 1));
1034
- if (Number.isInteger(opacity) && opacity >= 0 && opacity <= 100) tokenName = tokenName.slice(0, slash);
1049
+ var opacity = slash === -1 ? NaN : +tokenName.slice(slash + 1);
1050
+ if (opacity % 1 === 0 && opacity >= 0 && opacity <= 100) tokenName = tokenName.slice(0, slash);
1035
1051
  }
1036
1052
  if (tokenName !== "" && (tokenName in styleState.theme || tokenName in (((_styleState_conf_themes = styleState.conf.themes) === null || _styleState_conf_themes === void 0 ? void 0 : _styleState_conf_themes[styleState.flatThemeName || ""]) || {}) || Object.values(styleState.conf.tokensParsed).some(function(category) {
1037
1053
  return tokenName in category;
@@ -1082,27 +1098,39 @@ var recordDefault = 8;
1082
1098
  var recordCSS = 16;
1083
1099
  function writeStyleRecord(state, property, value, cursor, original, flags) {
1084
1100
  var conditionOverride = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : -1;
1085
- var _state_flatPass;
1101
+ var _direct_flatPass;
1086
1102
  var _direct;
1087
1103
  var condition = conditionOverride !== -1 ? conditionOverride : cursor ? cursor[conditionValue] : 0;
1088
1104
  var identity = cursor ? cursor[conditionKey] : "";
1089
- var slots = (_direct = state).flatSlots || (_direct.flatSlots = /* @__PURE__ */ new Map());
1090
- var slot = property.startsWith("transition") ? "transition" : property;
1105
+ var direct = state;
1106
+ var slots = (_direct = direct).flatSlots || (_direct.flatSlots = /* @__PURE__ */ new Map());
1107
+ var sourceLayer = ((_direct_flatPass = direct.flatPass) === null || _direct_flatPass === void 0 ? void 0 : _direct_flatPass[passSourceLayer]) || 0;
1108
+ if (direct.flatInlineStyleProp) flags |= recordInline;
1109
+ var cssSlot = property.startsWith("transition") ? "transition" : property;
1110
+ var slot = flags & recordInline && cssSlot !== property ? property : cssSlot;
1091
1111
  var list = slots.get(slot);
1092
1112
  if (!list) slots.set(slot, list = []);
1093
- for (var index = 0; index < list.length; index++) {
1094
- var entry = list[index];
1095
- var entryFlags = entry[7];
1096
- if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) continue;
1097
- if (entry[0] !== property) continue;
1113
+ if (sourceLayer === sourceLayerStyle && !condition) {
1114
+ var other = slot === cssSlot ? list : slots.get(flags & recordInline ? cssSlot : property);
1115
+ if (other) for (var index = 0; index < other.length; index++) {
1116
+ var entry = other[index];
1117
+ var entryFlags = entry[7];
1118
+ if (entry[0] === property && !entry[2] && entryFlags >> 5 === sourceLayerStyle && (entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) other.splice(index--, 1);
1119
+ }
1120
+ }
1121
+ for (var index1 = 0; index1 < list.length; index1++) {
1122
+ var entry1 = list[index1];
1123
+ var entryFlags1 = entry1[7];
1124
+ if ((entryFlags1 & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) continue;
1125
+ if (entry1[0] !== property) continue;
1098
1126
  if (flags & recordDefault) {
1099
- if (!(entryFlags & recordDefault) && (!entry[2] || entry[3] === identity)) return;
1100
- } else if (entryFlags & recordDefault && (!condition || entry[3] === identity)) {
1101
- list.splice(index--, 1);
1127
+ if (!(entryFlags1 & recordDefault) && (!entry1[2] || entry1[3] === identity)) return;
1128
+ } else if (entryFlags1 & recordDefault && (!condition || entry1[3] === identity)) {
1129
+ list.splice(index1--, 1);
1102
1130
  continue;
1103
1131
  }
1104
- if (entry[3] === identity) {
1105
- list.splice(index, 1);
1132
+ if (entry1[3] === identity) {
1133
+ list.splice(index1, 1);
1106
1134
  break;
1107
1135
  }
1108
1136
  }
@@ -1114,7 +1142,7 @@ function writeStyleRecord(state, property, value, cursor, original, flags) {
1114
1142
  cursor ? cursor[conditionSelector] : "",
1115
1143
  cursor ? cursor[conditionWrappers] : void 0,
1116
1144
  original,
1117
- flags | (((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passSourceLayer]) || 0) << 5
1145
+ flags | sourceLayer << 5
1118
1146
  ]);
1119
1147
  }
1120
1148
  function streamWriteInline(state, property, value, cursor, original) {
@@ -1289,14 +1317,14 @@ var cssWideColorKeywords = /* @__PURE__ */ new Set([
1289
1317
  "transparent"
1290
1318
  ]);
1291
1319
  function configuredValue(state, property, raw) {
1292
- var embedded = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
1320
+ var embedded = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, nativeColors = arguments.length > 4 ? arguments[4] : void 0;
1293
1321
  var grammar = (0, import_grammarConfig.getConfigRevisionState)(state.conf);
1294
1322
  var name = raw;
1295
1323
  var opacity;
1296
1324
  var slash = raw.lastIndexOf("/");
1297
1325
  if (slash > 0) {
1298
- var amount = Number(raw.slice(slash + 1));
1299
- if (Number.isInteger(amount) && amount >= 0 && amount <= 100) {
1326
+ var amount = +raw.slice(slash + 1);
1327
+ if (amount % 1 === 0 && amount >= 0 && amount <= 100) {
1300
1328
  name = raw.slice(0, slash);
1301
1329
  opacity = amount;
1302
1330
  }
@@ -1309,7 +1337,7 @@ function configuredValue(state, property, raw) {
1309
1337
  var fontProperty = property.startsWith("font") || property === "lineHeight" || property === "letterSpacing";
1310
1338
  var resolveValues = state.styleProps.resolveValues;
1311
1339
  var byRaw;
1312
- if (!fontProperty) {
1340
+ if (!fontProperty && !nativeColors) {
1313
1341
  var _maps;
1314
1342
  var revision = grammar.revision;
1315
1343
  if (state.conf !== valueCacheConf || revision !== valueCacheRevision) {
@@ -1385,27 +1413,18 @@ function configuredValue(state, property, raw) {
1385
1413
  var rawNum = Number(name);
1386
1414
  var tokens = category1 ? state.conf.tokensParsed[category1] : void 0;
1387
1415
  if (tokens && Number.isFinite(rawNum)) for (var key in tokens) {
1388
- var keyNum = Number(key);
1389
- if (Number.isFinite(keyNum)) {
1390
- var dist = Math.abs(keyNum - rawNum);
1416
+ var _tokens_key;
1417
+ var val = (_tokens_key = tokens[key]) === null || _tokens_key === void 0 ? void 0 : _tokens_key.val;
1418
+ var valNum = typeof val === "number" ? val : Number(val);
1419
+ if (Number.isFinite(valNum)) {
1420
+ var dist = Math.abs(valNum - rawNum);
1391
1421
  if (dist < minDistance) {
1392
1422
  minDistance = dist;
1393
1423
  nearest = key;
1394
1424
  }
1395
- } else {
1396
- var _tokens_key;
1397
- var val = (_tokens_key = tokens[key]) === null || _tokens_key === void 0 ? void 0 : _tokens_key.val;
1398
- var valNum = typeof val === "number" ? val : Number(val);
1399
- if (Number.isFinite(valNum)) {
1400
- var dist1 = Math.abs(valNum - rawNum);
1401
- if (dist1 < minDistance) {
1402
- minDistance = dist1;
1403
- nearest = key;
1404
- }
1405
- }
1406
1425
  }
1407
1426
  }
1408
- (0, import_warnOnce.warnOnce)(`numeric-token:${property}=${raw}`, `${property}="${raw}" was passed to CSS as-is with px units${nearest ? `; nearest token is "${nearest}"` : ""}`);
1427
+ if (nearest) (0, import_warnOnce.warnOnce)(`numeric-token:${property}=${raw}`, `${property}="${raw}" was passed to CSS as-is${category1 === "zIndex" ? "" : " with px units"}${nearest ? `; nearest token is "${nearest}"` : ""}`);
1409
1428
  } else if (category1 === "color" && /^[a-zA-Z0-9-]+$/.test(name) && /[a-zA-Z]/.test(name)) {
1410
1429
  var lower = name.toLowerCase();
1411
1430
  if (!import_runtime.namedCssColors.has(lower) && !cssWideColorKeywords.has(lower)) {
@@ -1436,9 +1455,9 @@ function configuredValue(state, property, raw) {
1436
1455
  prev = temp;
1437
1456
  }
1438
1457
  }
1439
- var dist2 = d[m];
1440
- if (dist2 <= 2 && dist2 < minDistance1) {
1441
- minDistance1 = dist2;
1458
+ var dist1 = d[m];
1459
+ if (dist1 <= 2 && dist1 < minDistance1) {
1460
+ minDistance1 = dist1;
1442
1461
  bestMatch = key1;
1443
1462
  }
1444
1463
  }
@@ -1459,20 +1478,25 @@ function configuredValue(state, property, raw) {
1459
1478
  }
1460
1479
  var out = raw;
1461
1480
  if ((0, import_createVariable.isVariable)(value)) {
1462
- out = resolveValues === "except-theme" && fromTheme ? `${import_themeRef.THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : (0, import_resolveVariableValue.resolveVariableValue)(property, value, resolveValues);
1481
+ out = resolveValues === "except-theme" && fromTheme ? `${import_themeRef.THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : (0, import_resolveVariableValue.resolveVariableValue)(nativeColors ? "color" : property, value, resolveValues);
1463
1482
  if (opacity !== void 0) {
1464
1483
  var _normalizeColor;
1465
1484
  out = (_normalizeColor = (0, import_normalizeColor.normalizeColor)(out, opacity / 100)) !== null && _normalizeColor !== void 0 ? _normalizeColor : out;
1466
1485
  }
1467
1486
  }
1487
+ if (nativeColors && out && typeof out === "object") {
1488
+ var reference = `__tamagui_native_color_${nativeColors.size}`;
1489
+ nativeColors.set(reference, out);
1490
+ out = reference;
1491
+ }
1468
1492
  if (embedded && out === raw) {
1469
1493
  var usedSafeArea = state.flatUsesSafeArea;
1470
1494
  out = grammar.embeddedTokens(raw, function(word) {
1471
- return configuredValue(state, property, word);
1495
+ return configuredValue(state, property, word, false, nativeColors);
1472
1496
  });
1473
1497
  if (!usedSafeArea && state.flatUsesSafeArea) return out;
1474
1498
  }
1475
- if (!fontProperty && !fromTheme) if (valueCacheEntries > 8192) {
1499
+ if (!fontProperty && !fromTheme && !nativeColors) if (valueCacheEntries > 8192) {
1476
1500
  valueCaches = /* @__PURE__ */ new WeakMap();
1477
1501
  valueCacheEntries = 0;
1478
1502
  } else {
@@ -1511,9 +1535,21 @@ function emitProperty(state, property, value, cursor, originalValue, contextOnly
1511
1535
  var theme = cursor ? cursor[conditionTheme] : "";
1512
1536
  if (theme) {
1513
1537
  if (import_constants.supportsDynamicColorIOS && (0, import_getDynamicVal.isColorStyleKey)(property)) {
1514
- var _direct, _ref, _property;
1515
- var schemes = (_ref = (_direct = direct).flatDynamicColors || (_direct.flatDynamicColors = {}))[_property = property] || (_ref[_property] = {});
1516
- schemes[theme] = typeof originalValue === "string" && /^[a-z]+$/i.test(originalValue) ? originalValue : value;
1538
+ var _direct;
1539
+ var colors = (_direct = direct).flatDynamicColors || (_direct.flatDynamicColors = {});
1540
+ var schemes = colors[property];
1541
+ if (!schemes) {
1542
+ var _direct_flatSlots_get_find, _direct_flatSlots_get, _direct_flatSlots;
1543
+ schemes = colors[property] = {};
1544
+ var base = (_direct_flatSlots = direct.flatSlots) === null || _direct_flatSlots === void 0 ? void 0 : (_direct_flatSlots_get = _direct_flatSlots.get(property)) === null || _direct_flatSlots_get === void 0 ? void 0 : (_direct_flatSlots_get_find = _direct_flatSlots_get.find(function(entry) {
1545
+ return !entry[2];
1546
+ })) === null || _direct_flatSlots_get_find === void 0 ? void 0 : _direct_flatSlots_get_find[1];
1547
+ if (base !== void 0) {
1548
+ schemes.light = (0, import_getDynamicVal.extractValueFromDynamic)(base, "light");
1549
+ schemes.dark = (0, import_getDynamicVal.extractValueFromDynamic)(base, "dark");
1550
+ }
1551
+ }
1552
+ schemes[theme] = (0, import_getDynamicVal.extractValueFromDynamic)(value, theme);
1517
1553
  streamWriteInline(state, property, { dynamic: { ...schemes } }, cursor, originalValue, true, condition & 1 ? condition : condition + 1);
1518
1554
  return;
1519
1555
  }
@@ -1565,10 +1601,8 @@ function numericUnitValue(value, first, second) {
1565
1601
  return value.length > first.length && (value.endsWith(first) || value.endsWith(second)) ? +value.slice(0, -first.length) : NaN;
1566
1602
  }
1567
1603
  function resolveNumericValue(value) {
1568
- var unitValue = numericUnitValue(value, "px", "dp");
1569
- if (Number.isFinite(unitValue)) return unitValue;
1570
- var numeric = +value;
1571
- return Number.isFinite(numeric) ? numeric : value;
1604
+ var numeric = numericUnitValue(value, "px", "dp");
1605
+ return isFinite(numeric) ? numeric : isFinite(numeric = +value) ? numeric : value;
1572
1606
  }
1573
1607
  function emitBorder(state, property, raw, cursor, originalValue, contextOnly) {
1574
1608
  if (property === "borderBlock" || property === "borderInline") {
@@ -1625,9 +1659,9 @@ function emitTextDecoration(state, raw, cursor, originalValue, contextOnly) {
1625
1659
  function emitResolved(state, property, raw, cursor, originalValue, contextOnly) {
1626
1660
  emitProperty(state, property, resolveValue(state, property, raw), cursor, originalValue, contextOnly);
1627
1661
  }
1628
- function resolveValue(state, property, raw) {
1629
- var value = typeof raw === "string" ? configuredValue(state, property, raw, true) : raw;
1630
- if (typeof value === "string" && value !== "") value = resolveNumericValue(value);
1662
+ function resolveValue(state, property, raw, nativeColors) {
1663
+ var value = typeof raw === "string" ? configuredValue(state, property, raw, true, nativeColors) : raw;
1664
+ if (typeof value === "string" && value !== "" && true) value = resolveNumericValue(value);
1631
1665
  return value;
1632
1666
  }
1633
1667
  function shadowUnit(part) {
@@ -1679,7 +1713,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
1679
1713
  if (property === "x" || property === "y" || property === "scale" || property === "scaleX" || property === "scaleY" || property === "rotate") {
1680
1714
  var value2 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
1681
1715
  if (typeof value2 === "string" && !value2.startsWith(import_themeRef.THEME_REF_PREFIX)) {
1682
- if (property === "rotate" && !Number.isFinite(numericUnitValue(value2, "deg", "rad")) && true) {
1716
+ if (property === "rotate" && !isFinite(numericUnitValue(value2, "deg", "rad")) && true) {
1683
1717
  if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`native transform "${property}" cannot represent "${value2}"; dropping it`);
1684
1718
  if (condition & 1) {
1685
1719
  (0, import_runtime.removeTransformValue)(state.transformAccumulator, property);
@@ -1719,13 +1753,14 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
1719
1753
  }
1720
1754
  return;
1721
1755
  }
1722
- var value3 = resolveValue(state, property, raw);
1756
+ var nativeColors = typeof raw === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow") ? /* @__PURE__ */ new Map() : void 0;
1757
+ var value3 = resolveValue(state, property, raw, nativeColors);
1723
1758
  if (import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses && property === "boxShadow" && !condition) {
1724
1759
  state.flatBoxShadow = value3;
1725
1760
  state.flatBoxShadowSequence = frameSequence + 1;
1726
1761
  }
1727
1762
  if (typeof value3 === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow")) {
1728
- var parsed = (0, import_parseNativeStyle.parseNativeStyle)(property, value3);
1763
+ var parsed = (0, import_parseNativeStyle.parseNativeStyle)(property, value3, nativeColors);
1729
1764
  if (parsed) {
1730
1765
  if (property === "textShadow") {
1731
1766
  var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
@@ -1799,9 +1834,9 @@ function walkConditionalValue(state, property, value, parent, sink) {
1799
1834
  if (slices === void 0) parsedSlices.set(parsed, slices = []);
1800
1835
  var chainCount = segments.length / 5 - 1;
1801
1836
  if (property === "aspectRatio" && chainCount === 1) {
1802
- var left = Number(value.slice(segments[7], segments[8]));
1803
- var right = Number(value.slice(segments[5], segments[6]));
1804
- if (left > 0 && right > 0 && Number.isFinite(left) && Number.isFinite(right)) return false;
1837
+ var left = +value.slice(segments[7], segments[8]);
1838
+ var right = +value.slice(segments[5], segments[6]);
1839
+ if (left > 0 && right > 0 && isFinite(left) && isFinite(right)) return false;
1805
1840
  }
1806
1841
  for (var index = 0; index < segments.length; index += 5) {
1807
1842
  var start = segments[index];
@@ -1862,7 +1897,7 @@ function walkConditionalValue(state, property, value, parent, sink) {
1862
1897
  if (cursor1[conditionValue] & conditionResolvedFlag || warnMode) emitConditionalValue(state, property, value[key], cursor1, value[key], sink, warnMode, contextOnly);
1863
1898
  }
1864
1899
  }
1865
- if (warnMode && process.env.NODE_ENV === "development" && typeof value === "string" && !hasBase && conditions && (0, import_grammarConfig.getConfigRevisionState)(state.conf).tokenCategory(property) && (0, import_borderComponents.splitComponents)(lastPayload).length > 1) (0, import_warnOnce.warnOnce)(`${property}="${value}" has multiple values after its first conditional. Write the base value before the first conditional.`);
1900
+ if (warnMode && process.env.NODE_ENV === "development" && typeof value === "string" && !hasBase && conditions && (0, import_grammarConfig.getConfigRevisionState)(state.conf).tokenCategory(property) && (0, import_grammarConfig.getConfigRevisionState)(state.conf).propertyKind(property) !== 8 && property !== "boxShadow" && property !== "textShadow" && property !== "fontFamily" && property !== "gap" && (0, import_borderComponents.splitComponents)(lastPayload).length > 1) (0, import_warnOnce.warnOnce)(`${property}="${value}" has multiple values after its first conditional. Write the base value before the first conditional.`);
1866
1901
  if (warnMode === 1 && (!import_getCSSStylesAtomic.canGenerateCSS || !state.flatShouldDoClasses) && conditions & 12 && !hasBase) {
1867
1902
  var _state_flatPropertyLayers;
1868
1903
  var resting = property === "opacity" || property.startsWith("scale") ? 1 : property === "rotate" ? "0deg" : property === "x" || property === "y" ? 0 : null;
@@ -1925,18 +1960,20 @@ function contributeValue(state, property, value, originalValue) {
1925
1960
  function clearDirectStyle(state, property) {
1926
1961
  var _direct_flatAtomics;
1927
1962
  var direct = state;
1963
+ if (direct.flatDynamicColors) delete direct.flatDynamicColors[property];
1928
1964
  var propertyKind = (0, import_grammarConfig.getConfigRevisionState)(state.conf).propertyKind(property);
1929
1965
  var atomicKey = property.startsWith("transition") ? "transition" : propertyKind > 0 && propertyKind < 5 ? "boxShadow" : propertyKind === 6 ? "textShadow" : propertyKind === 5 ? "transform" : property;
1930
1966
  var slot = atomicKey;
1931
1967
  (_direct_flatAtomics = direct.flatAtomics) === null || _direct_flatAtomics === void 0 || _direct_flatAtomics.delete(slot);
1932
1968
  if (direct.flatSlots) {
1933
- if (slot !== atomicKey) {
1969
+ if (slot !== atomicKey || atomicKey === "flex") {
1934
1970
  var entries = direct.flatSlots.get(slot);
1935
1971
  if (entries) {
1936
1972
  for (var index = entries.length; index--;) if (entries[index][0] === atomicKey) entries.splice(index, 1);
1973
+ if (!entries.length) direct.flatSlots.delete(slot);
1937
1974
  }
1938
1975
  }
1939
- direct.flatSlots.delete(atomicKey);
1976
+ if (atomicKey !== "flex") direct.flatSlots.delete(atomicKey);
1940
1977
  }
1941
1978
  if (atomicKey === "transform") state.transformAccumulator = void 0;
1942
1979
  if (state.style) delete state.style[atomicKey];