@tamagui/web 3.0.0-beta.1115.1 → 3.0.0-beta.1121.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.
@@ -58,7 +58,7 @@ var import_log = require("./log.cjs");
58
58
  var import_normalizeColor = require("./normalizeColor.cjs");
59
59
  var import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs");
60
60
  require("./parseNativeStyle.cjs");
61
- require("./parseNativeTransform.native.cjs");
61
+ var import_parseNativeTransform = require("./parseNativeTransform.native.cjs");
62
62
  require("./resolveNativeUnits.cjs");
63
63
  var import_resolveVariableValue = require("./resolveVariableValue.cjs");
64
64
  var import_skipProps = require("./skipProps.cjs");
@@ -383,7 +383,11 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
383
383
  const slots = direct.flatSlots ||= /* @__PURE__ */ new Map();
384
384
  for (const [slot, entries] of hocSlots) for (const entry of entries) {
385
385
  if (!ownsSourceLayer(styleState, entry[0], !!entry[2])) continue;
386
- writeCapturedStyleRecord(slots, slot, entry, pass[passSourceLayer]);
386
+ if (!isHOC && styleState.styleProps.isAnimated && (slot === "transition" || entry[8]) && !(entry[0] in import_helpers.nonAnimatableStyleProps)) {
387
+ 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];
388
+ const value = styleState.animationDriver?.inputStyle === "value" ? entry[6] : entry[1];
389
+ entry[3] ? contributeValue(styleState, property, value, entry[6], false, entry[3]) : emitValue(styleState, property, value, null, entry[6], false);
390
+ } else writeCapturedStyleRecord(slots, slot, entry, pass[passSourceLayer]);
387
391
  }
388
392
  }
389
393
  }
@@ -1210,7 +1214,11 @@ function completeResolvedStyles(state, merge = mergeStyle) {
1210
1214
  if (cssEntries) {
1211
1215
  (0, import_getCSSStylesAtomic.registerAtomicSlot)(direct, property, cssEntries);
1212
1216
  if (capture) {
1213
- for (const entry of cssEntries) entry[7] = entry[7] | recordCSS;
1217
+ for (const entry of cssEntries) {
1218
+ entry[7] = entry[7] | recordCSS;
1219
+ if (!(entry[2] & 12)) continue;
1220
+ for (const sibling of cssEntries) if (sibling[0] === entry[0]) sibling[8] = true;
1221
+ }
1214
1222
  capture.set(property, cssEntries);
1215
1223
  }
1216
1224
  }
@@ -1456,6 +1464,10 @@ function emitProperty(state, property, value, cursor, originalValue, contextOnly
1456
1464
  (0, import_runtime.addTransformValue)(state.transformAccumulator, property, value);
1457
1465
  return;
1458
1466
  }
1467
+ if (property === "transition" && condition & 12 && !state.staticConfig.isHOC && state.styleProps.isAnimated) {
1468
+ streamWriteInline(state, property, value, cursor, originalValue, false, -1, true);
1469
+ return;
1470
+ }
1459
1471
  const shouldPromoteAnimatedStyle = import_getCSSStylesAtomic.canGenerateCSS && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && state.animationDriver?.inputStyle === "css" && property in import_helpers.nonAnimatableStyleProps;
1460
1472
  if (import_getCSSStylesAtomic.canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
1461
1473
  writeStyleRecord(state, property, value, cursor, originalValue, shouldPromoteAnimatedStyle ? recordCSS : 0);
@@ -1535,6 +1547,13 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
1535
1547
  }
1536
1548
  if (property === "transform") {
1537
1549
  if (import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses && Array.isArray(raw)) raw = (0, import_transformsToString.transformsToString)(raw);
1550
+ if (typeof raw === "string" && !state.flatShouldDoClasses && state.animationDriver?.inputStyle === "value") {
1551
+ const transform = (0, import_parseNativeTransform.parseNativeTransform)(raw);
1552
+ if (transform) {
1553
+ emitProperty(state, property, transform, cursor, originalValue, contextOnly);
1554
+ return;
1555
+ }
1556
+ }
1538
1557
  }
1539
1558
  if (typeof raw === "string" && property === "background") {
1540
1559
  const parts = (0, import_borderComponents.splitComponents)(raw);
@@ -1591,7 +1610,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
1591
1610
  }
1592
1611
  function emitConditionalValue(state, property, payload, condition, source, sink, mode, contextOnly) {
1593
1612
  if (sink) sink(payload, condition, source);
1594
- else if (condition) emitUnderCondition(state, property, payload, condition, mode === 2 ? payload : void 0, contextOnly, mode, source);
1613
+ else if (condition) emitUnderCondition(state, property, payload, condition, mode === 2 || state.staticConfig.isHOC || state.styleProps.stylePieceEntries ? payload : void 0, contextOnly, mode, source);
1595
1614
  else emitValue(state, property, payload, null, payload, contextOnly);
1596
1615
  }
1597
1616
  function walkConditionalValue(state, property, value, parent, sink, warnMode = 0, contextOnly = false) {
@@ -349,22 +349,22 @@ function contributeProp(pass, keyOg, valOg) {
349
349
  var resolveClassName = styleFrontend === null || styleFrontend === void 0 ? void 0 : styleFrontend.resolveClassName;
350
350
  var composedProps = null;
351
351
  var sink = function(entry2) {
352
- var property2 = entry2[0];
352
+ var property3 = entry2[0];
353
353
  var condition2 = entry2[2];
354
- if (property2.charCodeAt(0) === 95 && property2.charCodeAt(1) === 95) {
354
+ if (property3.charCodeAt(0) === 95 && property3.charCodeAt(1) === 95) {
355
355
  composedProps || (composedProps = {});
356
- composedProps[property2] = (0, import_styleFrontend.mergeFrontendCondition)(composedProps[property2], entry2[1], condition2);
356
+ composedProps[property3] = (0, import_styleFrontend.mergeFrontendCondition)(composedProps[property3], entry2[1], condition2);
357
357
  return;
358
358
  }
359
359
  if (condition2 !== void 0) {
360
- if (isValidStyleKey(property2, validStyles)) contributeValue(styleState, property2, entry2[1], void 0, false, condition2);
361
- else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${property2}" is not a valid style on this component; the frontend value is dropped.`);
360
+ if (isValidStyleKey(property3, validStyles)) contributeValue(styleState, property3, entry2[1], void 0, false, condition2);
361
+ else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${property3}" is not a valid style on this component; the frontend value is dropped.`);
362
362
  return;
363
363
  }
364
- if (property2 === "group") pass[passFrontendGroup] = entry2[1];
365
- else if (property2 === "container") pass[passFrontendContainer] = entry2[1];
366
- else if (property2 === "containerType") pass[passFrontendContainerType] = entry2[1];
367
- contributeProp(pass, property2, entry2[1]);
364
+ if (property3 === "group") pass[passFrontendGroup] = entry2[1];
365
+ else if (property3 === "container") pass[passFrontendContainer] = entry2[1];
366
+ else if (property3 === "containerType") pass[passFrontendContainerType] = entry2[1];
367
+ contributeProp(pass, property3, entry2[1]);
368
368
  };
369
369
  var start = 0;
370
370
  for (var index = 0; index <= valInit.length; index++) {
@@ -422,7 +422,12 @@ function contributeProp(pass, keyOg, valOg) {
422
422
  for (var _iterator1 = entries[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
423
423
  var entry = _step1.value;
424
424
  if (!ownsSourceLayer(styleState, entry[0], !!entry[2])) continue;
425
- writeCapturedStyleRecord(slots, slot, entry, pass[passSourceLayer]);
425
+ if (!isHOC && styleState.styleProps.isAnimated && (slot === "transition" || entry[8]) && !(entry[0] in import_helpers.nonAnimatableStyleProps)) {
426
+ var _styleState_animationDriver;
427
+ 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];
428
+ var value = ((_styleState_animationDriver = styleState.animationDriver) === null || _styleState_animationDriver === void 0 ? void 0 : _styleState_animationDriver.inputStyle) === "value" ? entry[6] : entry[1];
429
+ entry[3] ? contributeValue(styleState, property2, value, entry[6], false, entry[3]) : emitValue(styleState, property2, value, null, entry[6], false);
430
+ } else writeCapturedStyleRecord(slots, slot, entry, pass[passSourceLayer]);
426
431
  }
427
432
  } catch (err) {
428
433
  _didIteratorError1 = true;
@@ -1181,6 +1186,23 @@ function completeResolvedStyles(state) {
1181
1186
  for (var _iterator1 = cssEntries[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
1182
1187
  var entry1 = _step1.value;
1183
1188
  entry1[7] = entry1[7] | recordCSS;
1189
+ if (!(entry1[2] & 12)) continue;
1190
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
1191
+ try {
1192
+ for (var _iterator2 = cssEntries[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
1193
+ var sibling = _step2.value;
1194
+ if (sibling[0] === entry1[0]) sibling[8] = true;
1195
+ }
1196
+ } catch (err) {
1197
+ _didIteratorError2 = true;
1198
+ _iteratorError2 = err;
1199
+ } finally {
1200
+ try {
1201
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
1202
+ } finally {
1203
+ if (_didIteratorError2) throw _iteratorError2;
1204
+ }
1205
+ }
1184
1206
  }
1185
1207
  } catch (err) {
1186
1208
  _didIteratorError1 = true;
@@ -1528,6 +1550,10 @@ function emitProperty(state, property, value, cursor, originalValue, contextOnly
1528
1550
  (0, import_runtime.addTransformValue)(state.transformAccumulator, property, value);
1529
1551
  return;
1530
1552
  }
1553
+ if (property === "transition" && condition & 12 && !state.staticConfig.isHOC && state.styleProps.isAnimated) {
1554
+ streamWriteInline(state, property, value, cursor, originalValue, false, -1, true);
1555
+ return;
1556
+ }
1531
1557
  var shouldPromoteAnimatedStyle = import_getCSSStylesAtomic.canGenerateCSS && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && ((_state_animationDriver = state.animationDriver) === null || _state_animationDriver === void 0 ? void 0 : _state_animationDriver.inputStyle) === "css" && property in import_helpers.nonAnimatableStyleProps;
1532
1558
  if (import_getCSSStylesAtomic.canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
1533
1559
  writeStyleRecord(state, property, value, cursor, originalValue, shouldPromoteAnimatedStyle ? recordCSS : 0);
@@ -1625,7 +1651,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
1625
1651
  }
1626
1652
  if (property === "transform") {
1627
1653
  if (import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses && Array.isArray(raw)) raw = (0, import_transformsToString.transformsToString)(raw);
1628
- if (typeof raw === "string") {
1654
+ if (typeof raw === "string" && true) {
1629
1655
  var transform = (0, import_parseNativeTransform.parseNativeTransform)(raw);
1630
1656
  if (transform) {
1631
1657
  emitProperty(state, property, transform, cursor, originalValue, contextOnly);
@@ -1752,7 +1778,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
1752
1778
  }
1753
1779
  function emitConditionalValue(state, property, payload, condition, source, sink, mode, contextOnly) {
1754
1780
  if (sink) sink(payload, condition, source);
1755
- else if (condition) emitUnderCondition(state, property, payload, condition, mode === 2 ? payload : void 0, contextOnly, mode, source);
1781
+ else if (condition) emitUnderCondition(state, property, payload, condition, mode === 2 || state.staticConfig.isHOC || state.styleProps.stylePieceEntries ? payload : void 0, contextOnly, mode, source);
1756
1782
  else emitValue(state, property, payload, null, payload, contextOnly);
1757
1783
  }
1758
1784
  function walkConditionalValue(state, property, value, parent, sink) {
@@ -349,22 +349,22 @@ function contributeProp(pass, keyOg, valOg) {
349
349
  var resolveClassName = styleFrontend === null || styleFrontend === void 0 ? void 0 : styleFrontend.resolveClassName;
350
350
  var composedProps = null;
351
351
  var sink = function(entry2) {
352
- var property2 = entry2[0];
352
+ var property3 = entry2[0];
353
353
  var condition2 = entry2[2];
354
- if (property2.charCodeAt(0) === 95 && property2.charCodeAt(1) === 95) {
354
+ if (property3.charCodeAt(0) === 95 && property3.charCodeAt(1) === 95) {
355
355
  composedProps || (composedProps = {});
356
- composedProps[property2] = (0, import_styleFrontend.mergeFrontendCondition)(composedProps[property2], entry2[1], condition2);
356
+ composedProps[property3] = (0, import_styleFrontend.mergeFrontendCondition)(composedProps[property3], entry2[1], condition2);
357
357
  return;
358
358
  }
359
359
  if (condition2 !== void 0) {
360
- if (isValidStyleKey(property2, validStyles)) contributeValue(styleState, property2, entry2[1], void 0, false, condition2);
361
- else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${property2}" is not a valid style on this component; the frontend value is dropped.`);
360
+ if (isValidStyleKey(property3, validStyles)) contributeValue(styleState, property3, entry2[1], void 0, false, condition2);
361
+ else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${property3}" is not a valid style on this component; the frontend value is dropped.`);
362
362
  return;
363
363
  }
364
- if (property2 === "group") pass[passFrontendGroup] = entry2[1];
365
- else if (property2 === "container") pass[passFrontendContainer] = entry2[1];
366
- else if (property2 === "containerType") pass[passFrontendContainerType] = entry2[1];
367
- contributeProp(pass, property2, entry2[1]);
364
+ if (property3 === "group") pass[passFrontendGroup] = entry2[1];
365
+ else if (property3 === "container") pass[passFrontendContainer] = entry2[1];
366
+ else if (property3 === "containerType") pass[passFrontendContainerType] = entry2[1];
367
+ contributeProp(pass, property3, entry2[1]);
368
368
  };
369
369
  var start = 0;
370
370
  for (var index = 0; index <= valInit.length; index++) {
@@ -422,7 +422,12 @@ function contributeProp(pass, keyOg, valOg) {
422
422
  for (var _iterator1 = entries[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
423
423
  var entry = _step1.value;
424
424
  if (!ownsSourceLayer(styleState, entry[0], !!entry[2])) continue;
425
- writeCapturedStyleRecord(slots, slot, entry, pass[passSourceLayer]);
425
+ if (!isHOC && styleState.styleProps.isAnimated && (slot === "transition" || entry[8]) && !(entry[0] in import_helpers.nonAnimatableStyleProps)) {
426
+ var _styleState_animationDriver;
427
+ 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];
428
+ var value = ((_styleState_animationDriver = styleState.animationDriver) === null || _styleState_animationDriver === void 0 ? void 0 : _styleState_animationDriver.inputStyle) === "value" ? entry[6] : entry[1];
429
+ entry[3] ? contributeValue(styleState, property2, value, entry[6], false, entry[3]) : emitValue(styleState, property2, value, null, entry[6], false);
430
+ } else writeCapturedStyleRecord(slots, slot, entry, pass[passSourceLayer]);
426
431
  }
427
432
  } catch (err) {
428
433
  _didIteratorError1 = true;
@@ -1181,6 +1186,23 @@ function completeResolvedStyles(state) {
1181
1186
  for (var _iterator1 = cssEntries[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
1182
1187
  var entry1 = _step1.value;
1183
1188
  entry1[7] = entry1[7] | recordCSS;
1189
+ if (!(entry1[2] & 12)) continue;
1190
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
1191
+ try {
1192
+ for (var _iterator2 = cssEntries[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
1193
+ var sibling = _step2.value;
1194
+ if (sibling[0] === entry1[0]) sibling[8] = true;
1195
+ }
1196
+ } catch (err) {
1197
+ _didIteratorError2 = true;
1198
+ _iteratorError2 = err;
1199
+ } finally {
1200
+ try {
1201
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
1202
+ } finally {
1203
+ if (_didIteratorError2) throw _iteratorError2;
1204
+ }
1205
+ }
1184
1206
  }
1185
1207
  } catch (err) {
1186
1208
  _didIteratorError1 = true;
@@ -1528,6 +1550,10 @@ function emitProperty(state, property, value, cursor, originalValue, contextOnly
1528
1550
  (0, import_runtime.addTransformValue)(state.transformAccumulator, property, value);
1529
1551
  return;
1530
1552
  }
1553
+ if (property === "transition" && condition & 12 && !state.staticConfig.isHOC && state.styleProps.isAnimated) {
1554
+ streamWriteInline(state, property, value, cursor, originalValue, false, -1, true);
1555
+ return;
1556
+ }
1531
1557
  var shouldPromoteAnimatedStyle = import_getCSSStylesAtomic.canGenerateCSS && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && ((_state_animationDriver = state.animationDriver) === null || _state_animationDriver === void 0 ? void 0 : _state_animationDriver.inputStyle) === "css" && property in import_helpers.nonAnimatableStyleProps;
1532
1558
  if (import_getCSSStylesAtomic.canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
1533
1559
  writeStyleRecord(state, property, value, cursor, originalValue, shouldPromoteAnimatedStyle ? recordCSS : 0);
@@ -1625,7 +1651,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
1625
1651
  }
1626
1652
  if (property === "transform") {
1627
1653
  if (import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses && Array.isArray(raw)) raw = (0, import_transformsToString.transformsToString)(raw);
1628
- if (typeof raw === "string") {
1654
+ if (typeof raw === "string" && true) {
1629
1655
  var transform = (0, import_parseNativeTransform.parseNativeTransform)(raw);
1630
1656
  if (transform) {
1631
1657
  emitProperty(state, property, transform, cursor, originalValue, contextOnly);
@@ -1752,7 +1778,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
1752
1778
  }
1753
1779
  function emitConditionalValue(state, property, payload, condition, source, sink, mode, contextOnly) {
1754
1780
  if (sink) sink(payload, condition, source);
1755
- else if (condition) emitUnderCondition(state, property, payload, condition, mode === 2 ? payload : void 0, contextOnly, mode, source);
1781
+ else if (condition) emitUnderCondition(state, property, payload, condition, mode === 2 || state.staticConfig.isHOC || state.styleProps.stylePieceEntries ? payload : void 0, contextOnly, mode, source);
1756
1782
  else emitValue(state, property, payload, null, payload, contextOnly);
1757
1783
  }
1758
1784
  function walkConditionalValue(state, property, value, parent, sink) {