@tamagui/web 1.90.1 → 1.90.2

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.
Files changed (38) hide show
  1. package/dist/cjs/createComponent.js +12 -14
  2. package/dist/cjs/createComponent.js.map +1 -1
  3. package/dist/cjs/createComponent.native.js +7 -7
  4. package/dist/cjs/createComponent.native.js.map +2 -2
  5. package/dist/cjs/helpers/getSplitStyles.js +24 -16
  6. package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
  7. package/dist/cjs/helpers/getSplitStyles.native.js +221 -218
  8. package/dist/cjs/helpers/getSplitStyles.native.js.map +2 -2
  9. package/dist/cjs/hooks/useMedia.js +0 -10
  10. package/dist/cjs/hooks/useMedia.js.map +1 -1
  11. package/dist/cjs/hooks/useMedia.native.js +0 -6
  12. package/dist/cjs/hooks/useMedia.native.js.map +2 -2
  13. package/dist/esm/createComponent.js +12 -14
  14. package/dist/esm/createComponent.js.map +1 -1
  15. package/dist/esm/createComponent.mjs +15 -16
  16. package/dist/esm/createComponent.native.js +7 -7
  17. package/dist/esm/createComponent.native.js.map +2 -2
  18. package/dist/esm/helpers/getSplitStyles.js +24 -17
  19. package/dist/esm/helpers/getSplitStyles.js.map +1 -1
  20. package/dist/esm/helpers/getSplitStyles.mjs +21 -15
  21. package/dist/esm/helpers/getSplitStyles.native.js +222 -219
  22. package/dist/esm/helpers/getSplitStyles.native.js.map +2 -2
  23. package/dist/esm/hooks/useMedia.js +0 -10
  24. package/dist/esm/hooks/useMedia.js.map +1 -1
  25. package/dist/esm/hooks/useMedia.mjs +1 -5
  26. package/dist/esm/hooks/useMedia.native.js +0 -5
  27. package/dist/esm/hooks/useMedia.native.js.map +2 -2
  28. package/package.json +11 -11
  29. package/src/createComponent.tsx +19 -16
  30. package/src/helpers/getSplitStyles.tsx +43 -20
  31. package/src/hooks/useMedia.tsx +0 -26
  32. package/src/types.tsx +1 -3
  33. package/types/createComponent.d.ts.map +1 -1
  34. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  35. package/types/hooks/useMedia.d.ts +0 -1
  36. package/types/hooks/useMedia.d.ts.map +1 -1
  37. package/types/types.d.ts +1 -2
  38. package/types/types.d.ts.map +1 -1
@@ -5,7 +5,7 @@ import { getConfig, getFont } from "../config";
5
5
  import { accessibilityWebRoleToNativeRole, nativeAccessibilityState, nativeAccessibilityValue, webToNativeAccessibilityDirectMap } from "../constants/accessibilityDirectMap";
6
6
  import "../constants/constants";
7
7
  import { isDevTools } from "../constants/isDevTools";
8
- import { getMediaImportanceIfMoreImportant, mediaState as globalMediaState, isMediaKey, mediaKeyMatch, mediaQueryConfig, mergeMediaByImportance } from "../hooks/useMedia";
8
+ import { getMediaImportanceIfMoreImportant, mediaState as globalMediaState, isMediaKey, mediaKeyMatch, mediaQueryConfig } from "../hooks/useMedia";
9
9
  import { createMediaStyle } from "./createMediaStyle";
10
10
  import { fixStyles } from "./expandStyles";
11
11
  import { getGroupPropParts } from "./getGroupPropParts";
@@ -214,253 +214,252 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
214
214
  isHOCShouldPassThrough,
215
215
  curProps: _object_spread({}, styleState.curProps),
216
216
  parentStaticConfig
217
- })), !(shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant)) && !(!styleProps.noSkip && keyInit in skipProps)) {
218
- (isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
219
- var avoidPropMap = isMediaOrPseudo1 || !isVariant && !isValidStyleKeyInit, expanded = avoidPropMap ? null : propMapper(keyInit, valInit, styleState);
220
- if (!avoidPropMap) {
221
- if (!expanded)
222
- continue;
223
- var next = getPropMappedFontFamily(expanded);
224
- next && (styleState.fontFamily = next);
225
- }
226
- if (process.env.NODE_ENV === "development" && debug === "verbose") {
227
- console.groupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
228
- try {
229
- !isServer && isDevTools && (log({
230
- expanded,
231
- styleProps,
232
- componentState,
233
- isVariant,
234
- variant: variants == null ? void 0 : variants[keyInit],
235
- shouldPassProp,
236
- isHOCShouldPassThrough,
237
- theme,
238
- usedKeys: _object_spread({}, usedKeys),
239
- curProps: _object_spread({}, styleState.curProps)
240
- }), log("expanded", expanded, `
217
+ })), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant)) {
218
+ process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
219
+ continue;
220
+ }
221
+ if (!styleProps.noSkip && keyInit in skipProps) {
222
+ process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
223
+ continue;
224
+ }
225
+ (isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
226
+ var avoidPropMap = isMediaOrPseudo1 || !isVariant && !isValidStyleKeyInit, expanded = avoidPropMap ? null : propMapper(keyInit, valInit, styleState);
227
+ if (!avoidPropMap) {
228
+ if (!expanded)
229
+ continue;
230
+ var next = getPropMappedFontFamily(expanded);
231
+ next && (styleState.fontFamily = next);
232
+ }
233
+ if (process.env.NODE_ENV === "development" && debug === "verbose") {
234
+ console.groupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
235
+ try {
236
+ !isServer && isDevTools && (log({
237
+ expanded,
238
+ styleProps,
239
+ componentState,
240
+ isVariant,
241
+ variant: variants == null ? void 0 : variants[keyInit],
242
+ shouldPassProp,
243
+ isHOCShouldPassThrough,
244
+ theme,
245
+ usedKeys: _object_spread({}, usedKeys),
246
+ curProps: _object_spread({}, styleState.curProps)
247
+ }), log("expanded", expanded, `
241
248
  usedKeys`, _object_spread({}, usedKeys), `
242
249
  current`, _object_spread({}, styleState.style)));
243
- } catch {
244
- }
245
- console.groupEnd();
250
+ } catch {
251
+ }
252
+ console.groupEnd();
253
+ }
254
+ for (var key = keyInit, val = valInit, max = expanded ? expanded.length : 1, i = 0; i < max; i++) {
255
+ var _parentStaticConfig_variants1;
256
+ if (expanded) {
257
+ var _expanded_i = _sliced_to_array(expanded[i], 2), k = _expanded_i[0], v = _expanded_i[1];
258
+ key = k, val = v;
246
259
  }
247
- for (var key = keyInit, val = valInit, max = expanded ? expanded.length : 1, i = 0; i < max; i++) {
248
- var _parentStaticConfig_variants1;
249
- if (expanded) {
250
- var _expanded_i = _sliced_to_array(expanded[i], 2), k = _expanded_i[0], v = _expanded_i[1];
251
- key = k, val = v;
260
+ if (val != null && !(key in usedKeys)) {
261
+ if (isPseudo = key in validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && isMediaKey(key), isMediaOrPseudo1 = !!(isMedia || isPseudo), isVariant = variants && key in variants, inlineProps != null && inlineProps.has(key) || IS_STATIC && (inlineWhenUnflattened != null && inlineWhenUnflattened.has(key))) {
262
+ var _props_key;
263
+ viewProps[key] = (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : val;
252
264
  }
253
- if (val != null && !(key in usedKeys)) {
254
- if (isPseudo = key in validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && isMediaKey(key), isMediaOrPseudo1 = !!(isMedia || isPseudo), isVariant = variants && key in variants, inlineProps != null && inlineProps.has(key) || IS_STATIC && (inlineWhenUnflattened != null && inlineWhenUnflattened.has(key))) {
255
- var _props_key;
256
- viewProps[key] = (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : val;
257
- }
258
- var shouldPassThrough1 = styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo1 || (parentStaticConfig == null || (_parentStaticConfig_variants1 = parentStaticConfig.variants) === null || _parentStaticConfig_variants1 === void 0 ? void 0 : _parentStaticConfig_variants1[keyInit]));
259
- if (shouldPassThrough1) {
260
- passDownProp(viewProps, key, val, isMediaOrPseudo1), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" - passing down prop ".concat(key)), log({
261
- val,
262
- after: _object_spread({}, viewProps[key])
263
- }), console.groupEnd());
265
+ var shouldPassThrough1 = styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo1 || (parentStaticConfig == null || (_parentStaticConfig_variants1 = parentStaticConfig.variants) === null || _parentStaticConfig_variants1 === void 0 ? void 0 : _parentStaticConfig_variants1[keyInit]));
266
+ if (shouldPassThrough1) {
267
+ passDownProp(viewProps, key, val, isMediaOrPseudo1), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" - passing down prop ".concat(key)), log({
268
+ val,
269
+ after: _object_spread({}, viewProps[key])
270
+ }), console.groupEnd());
271
+ continue;
272
+ }
273
+ if (isPseudo) {
274
+ if (!val)
264
275
  continue;
265
- }
266
- if (isPseudo) {
267
- if (!val)
268
- continue;
269
- var pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClassNames), descriptor = pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
270
- if (!descriptor)
276
+ var pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClassNames), descriptor = pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
277
+ if (!descriptor)
278
+ continue;
279
+ if (!shouldDoClasses || IS_STATIC) {
280
+ var _pseudos, _key;
281
+ if (pseudos || (pseudos = {}), (_pseudos = pseudos)[_key = key] || (_pseudos[_key] = {}), IS_STATIC) {
282
+ Object.assign(pseudos[key], pseudoStyleObject);
271
283
  continue;
272
- if (!shouldDoClasses || IS_STATIC) {
273
- var _pseudos, _key;
274
- if (pseudos || (pseudos = {}), (_pseudos = pseudos)[_key = key] || (_pseudos[_key] = {}), IS_STATIC) {
275
- Object.assign(pseudos[key], pseudoStyleObject);
276
- continue;
277
- }
278
284
  }
279
- if (shouldDoClasses && !isExit) {
280
- var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
281
- process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), log({
282
- pseudoStyleObject,
283
- pseudoStyles
284
- }), console.groupEnd());
285
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
285
+ }
286
+ if (shouldDoClasses && !isExit) {
287
+ var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
288
+ process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), log({
289
+ pseudoStyleObject,
290
+ pseudoStyles
291
+ }), console.groupEnd());
292
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
293
+ try {
294
+ for (var _iterator = pseudoStyles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
295
+ var psuedoStyle = _step.value, fullKey = "".concat(psuedoStyle.property).concat(PROP_SPLIT).concat(descriptor.name);
296
+ fullKey in usedKeys || mergeClassName(transforms, classNames, fullKey, psuedoStyle.identifier, isMediaOrPseudo1, !0);
297
+ }
298
+ } catch (err) {
299
+ _didIteratorError = !0, _iteratorError = err;
300
+ } finally {
286
301
  try {
287
- for (var _iterator = pseudoStyles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
288
- var psuedoStyle = _step.value, fullKey = "".concat(psuedoStyle.property).concat(PROP_SPLIT).concat(descriptor.name);
289
- fullKey in usedKeys || mergeClassName(transforms, classNames, fullKey, psuedoStyle.identifier, isMediaOrPseudo1, !0);
290
- }
291
- } catch (err) {
292
- _didIteratorError = !0, _iteratorError = err;
302
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
293
303
  } finally {
294
- try {
295
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
296
- } finally {
297
- if (_didIteratorError)
298
- throw _iteratorError;
299
- }
304
+ if (_didIteratorError)
305
+ throw _iteratorError;
300
306
  }
301
307
  }
302
- if (!shouldDoClasses || isExit || isEnter) {
303
- var descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
304
- isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, {
305
- isDisabled
306
- }), log({
307
- pseudoStyleObject,
308
- isDisabled,
309
- descriptor,
310
- componentState
311
- }), console.groupEnd());
312
- var importance = descriptor.priority;
313
- for (var pkey in pseudoStyleObject) {
314
- var val1 = pseudoStyleObject[pkey];
315
- if (isDisabled) {
316
- var defaultValues = animatableDefaults[pkey];
317
- defaultValues != null && !(pkey in usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
318
- } else {
319
- var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
320
- if (shouldMerge) {
321
- var _pseudos1, _key1;
322
- pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key] || (_pseudos1[_key1] = {}), pseudos[key][pkey] = val1, mergeStyle(styleState, pkey, val1);
323
- }
324
- process.env.NODE_ENV === "development" && debug === "verbose" && log(" subKey", pkey, shouldMerge, {
325
- importance,
326
- curImportance,
327
- pkey,
328
- val: val1,
329
- transforms: _object_spread({}, styleState.transforms)
330
- });
308
+ }
309
+ if (!shouldDoClasses || isExit || isEnter) {
310
+ var descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
311
+ isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, {
312
+ isDisabled
313
+ }), log({
314
+ pseudoStyleObject,
315
+ isDisabled,
316
+ descriptor,
317
+ componentState
318
+ }), console.groupEnd());
319
+ var importance = descriptor.priority;
320
+ for (var pkey in pseudoStyleObject) {
321
+ var val1 = pseudoStyleObject[pkey];
322
+ if (isDisabled) {
323
+ var defaultValues = animatableDefaults[pkey];
324
+ defaultValues != null && !(pkey in usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
325
+ } else {
326
+ var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
327
+ if (shouldMerge) {
328
+ var _pseudos1, _key1;
329
+ pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key] || (_pseudos1[_key1] = {}), pseudos[key][pkey] = val1, mergeStyle(styleState, pkey, val1);
331
330
  }
331
+ process.env.NODE_ENV === "development" && debug === "verbose" && log(" subKey", pkey, shouldMerge, {
332
+ importance,
333
+ curImportance,
334
+ pkey,
335
+ val: val1
336
+ });
332
337
  }
333
- if (!isDisabled)
334
- for (var key1 in val) {
335
- var k1 = shorthands[key1] || key1;
336
- usedKeys[k1] = Math.max(importance, usedKeys[k1] || 0);
337
- }
338
338
  }
339
- continue;
339
+ if (!isDisabled)
340
+ for (var key1 in val) {
341
+ var k1 = shorthands[key1] || key1;
342
+ usedKeys[k1] = Math.max(importance, usedKeys[k1] || 0);
343
+ }
340
344
  }
341
- if (isMedia) {
342
- if (!val)
345
+ continue;
346
+ }
347
+ if (isMedia) {
348
+ if (!val)
349
+ continue;
350
+ if (isMedia === "platform") {
351
+ var platform = key.slice(10);
352
+ if (
353
+ // supports web, ios, android
354
+ platform !== currentPlatform && // supports web, native
355
+ platform !== "native"
356
+ )
343
357
  continue;
344
- if (isMedia === "platform") {
345
- var platform = key.slice(10);
346
- if (
347
- // supports web, ios, android
348
- platform !== currentPlatform && // supports web, native
349
- platform !== "native"
350
- )
351
- continue;
358
+ }
359
+ hasMedia || (hasMedia = !0);
360
+ var mediaKeyShort = key.slice(1);
361
+ process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F4FA} ".concat(key), {
362
+ key,
363
+ val,
364
+ props,
365
+ shouldDoClasses,
366
+ acceptsClassName,
367
+ componentState
368
+ });
369
+ var hasSpace = val.space;
370
+ if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
371
+ var mediaStyle = getSubStyle(styleState, key, val, !1);
372
+ if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
373
+ var importance1 = getMediaImportanceIfMoreImportant(mediaKeyShort, "space", usedKeys, !0);
374
+ importance1 && (space = val.space, usedKeys.space = importance1, process.env.NODE_ENV === "development" && debug === "verbose" && log("Found more important space for current media ".concat(mediaKeyShort, ": ").concat(val, " (importance: ").concat(importance1, ")")));
352
375
  }
353
- hasMedia || (hasMedia = !0);
354
- var mediaStyle = getSubStyle(
355
- styleState,
356
- key,
357
- val,
358
- // TODO try true like pseudo
359
- !1
360
- ), mediaKeyShort = key.slice(1);
361
- process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F4FA} ".concat(key), {
362
- key,
363
- val,
364
- mediaStyle,
365
- props,
366
- shouldDoClasses,
367
- acceptsClassName,
368
- componentState
369
- });
370
- var hasSpace = val.space;
371
- if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
372
- if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
373
- var importance1 = getMediaImportanceIfMoreImportant(mediaKeyShort, "space", usedKeys, !0);
374
- importance1 && (space = val.space, usedKeys.space = importance1, process.env.NODE_ENV === "development" && debug === "verbose" && log("Found more important space for current media ".concat(mediaKeyShort, ": ").concat(val, " (importance: ").concat(importance1, ")")));
376
+ var mediaStyles = getStylesAtomic(mediaStyle), priority = mediaStylesSeen;
377
+ mediaStylesSeen += 1;
378
+ var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
379
+ try {
380
+ for (var _iterator1 = mediaStyles[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
381
+ var style = _step1.value, out = createMediaStyle(style, mediaKeyShort, mediaQueryConfig, isMedia, !1, priority);
382
+ process.env.NODE_ENV === "development" && debug === "verbose" && log("\u{1F4FA} media style:", out);
383
+ var fullKey1 = "".concat(style.property).concat(PROP_SPLIT).concat(mediaKeyShort).concat(style.pseudo || "");
384
+ fullKey1 in usedKeys || mergeClassName(transforms, classNames, fullKey1, out.identifier, !0, !0);
375
385
  }
376
- var mediaStyles = getStylesAtomic(mediaStyle), priority = mediaStylesSeen;
377
- mediaStylesSeen += 1;
378
- var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
386
+ } catch (err) {
387
+ _didIteratorError1 = !0, _iteratorError1 = err;
388
+ } finally {
379
389
  try {
380
- for (var _iterator1 = mediaStyles[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
381
- var style = _step1.value, out = createMediaStyle(style, mediaKeyShort, mediaQueryConfig, isMedia, !1, priority);
382
- process.env.NODE_ENV === "development" && debug === "verbose" && log("\u{1F4FA} media style:", out);
383
- var fullKey1 = "".concat(style.property).concat(PROP_SPLIT).concat(mediaKeyShort).concat(style.pseudo || "");
384
- fullKey1 in usedKeys || mergeClassName(transforms, classNames, fullKey1, out.identifier, !0, !0);
385
- }
386
- } catch (err) {
387
- _didIteratorError1 = !0, _iteratorError1 = err;
390
+ !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
388
391
  } finally {
389
- try {
390
- !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
391
- } finally {
392
- if (_didIteratorError1)
393
- throw _iteratorError1;
394
- }
392
+ if (_didIteratorError1)
393
+ throw _iteratorError1;
395
394
  }
396
- } else {
397
- var isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
398
- if (!isThemeMedia && !isPlatformMedia && !isGroupMedia && !mediaState[mediaKeyShort])
395
+ }
396
+ } else {
397
+ var mediaStyle1 = getSubStyle(styleState, key, val, !0), isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
398
+ if (!isThemeMedia && !isPlatformMedia && !isGroupMedia && !mediaState[mediaKeyShort])
399
+ continue;
400
+ var importanceBump = 0;
401
+ if (isThemeMedia) {
402
+ dynamicThemeAccess = !0;
403
+ var mediaThemeName = mediaKeyShort.slice(6);
404
+ if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName)))
399
405
  continue;
400
- var importanceBump = 0;
401
- if (isThemeMedia) {
402
- dynamicThemeAccess = !0;
403
- var mediaThemeName = mediaKeyShort.slice(6);
404
- if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName)))
405
- continue;
406
- } else if (isGroupMedia) {
407
- var _componentState_group, groupInfo = getGroupPropParts(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
408
- if (!groupContext) {
409
- process.env.NODE_ENV === "development" && debug && console.warn("No parent with group prop, skipping styles: ".concat(groupName));
406
+ } else if (isGroupMedia) {
407
+ var _componentState_group, groupInfo = getGroupPropParts(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
408
+ if (!groupContext) {
409
+ process.env.NODE_ENV === "development" && debug && console.warn("No parent with group prop, skipping styles: ".concat(groupName));
410
+ continue;
411
+ }
412
+ var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
413
+ if (groupMediaKey) {
414
+ mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
415
+ var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
416
+ if (!mediaState1 && groupContext.layout && (isActive = mediaKeyMatch(groupMediaKey, groupContext.layout)), !isActive)
410
417
  continue;
411
- }
412
- var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
413
- if (groupMediaKey) {
414
- mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
415
- var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
416
- if (!mediaState1 && groupContext.layout && (isActive = mediaKeyMatch(groupMediaKey, groupContext.layout)), !isActive)
417
- continue;
418
- importanceBump = 2;
419
- }
420
- if (groupPseudoKey) {
421
- pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
422
- var componentGroupPseudoState = (componentGroupState || // fallback to context initially
423
- context.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey];
424
- if (!isActive1)
425
- continue;
426
- var priority1 = pseudoPriorities[groupPseudoKey];
427
- importanceBump = priority1;
428
- }
418
+ importanceBump = 2;
429
419
  }
430
- for (var subKey in mediaStyle) {
431
- var _styleState2;
432
- if (subKey === "space") {
433
- space = valInit.space;
420
+ if (groupPseudoKey) {
421
+ pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
422
+ var componentGroupPseudoState = (componentGroupState || // fallback to context initially
423
+ context.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey];
424
+ if (!isActive1)
434
425
  continue;
435
- }
436
- (_styleState2 = styleState).style || (_styleState2.style = {}), mergeMediaByImportance(styleState.style, mediaKeyShort, subKey, mediaStyle[subKey], usedKeys, mediaState[mediaKeyShort], importanceBump), key === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
426
+ var priority1 = pseudoPriorities[groupPseudoKey];
427
+ importanceBump = priority1;
437
428
  }
438
429
  }
439
- continue;
440
- }
441
- if (key === "pointerEvents") {
442
- viewProps[key] = val;
443
- continue;
444
- }
445
- if (
446
- // is HOC we can just pass through the styles as props
447
- // this fixes issues where style prop got merged with wrong priority
448
- !isHOC && (isValidStyleKey(key, staticConfig) || isAndroid && key === "elevation")
449
- ) {
450
- mergeStyle(styleState, key, val);
451
- continue;
430
+ for (var subKey in mediaStyle1) {
431
+ var _styleState2;
432
+ if (subKey === "space") {
433
+ space = valInit.space;
434
+ continue;
435
+ }
436
+ (_styleState2 = styleState).style || (_styleState2.style = {}), mergeMediaByImportance(styleState, mediaKeyShort, subKey, mediaStyle1[subKey], usedKeys, mediaState[mediaKeyShort], importanceBump), key === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
437
+ }
452
438
  }
453
- isVariant || (viewProps[key] = val);
439
+ continue;
454
440
  }
455
- }
456
- if (process.env.NODE_ENV === "development" && debug === "verbose") {
457
- try {
458
- log(" \u2714\uFE0F expand complete", keyInit), log("style", _object_spread({}, styleState.style)), log("transforms", _object_spread({}, transforms)), log("viewProps", _object_spread({}, viewProps));
459
- } catch {
441
+ if (key === "pointerEvents") {
442
+ viewProps[key] = val;
443
+ continue;
444
+ }
445
+ if (
446
+ // is HOC we can just pass through the styles as props
447
+ // this fixes issues where style prop got merged with wrong priority
448
+ !isHOC && (isValidStyleKey(key, staticConfig) || isAndroid && key === "elevation")
449
+ ) {
450
+ mergeStyle(styleState, key, val);
451
+ continue;
460
452
  }
461
- console.groupEnd();
453
+ isVariant || (viewProps[key] = val);
462
454
  }
463
455
  }
456
+ if (process.env.NODE_ENV === "development" && debug === "verbose") {
457
+ try {
458
+ log(" \u2714\uFE0F expand complete", keyInit), log("style", _object_spread({}, styleState.style)), log("transforms", _object_spread({}, transforms)), log("viewProps", _object_spread({}, viewProps));
459
+ } catch {
460
+ }
461
+ console.groupEnd();
462
+ }
464
463
  }
465
464
  }
466
465
  }
@@ -493,9 +492,9 @@ current`, _object_spread({}, styleState.style)));
493
492
  }
494
493
  var avoidNormalize = styleProps.noNormalize === !1;
495
494
  if (!avoidNormalize) {
496
- if (styleState.style && (fixStyles(styleState.style), isWeb && !staticConfig.isReactNative && styleToCSS(styleState.style)), styleState.transforms) {
495
+ if (styleState.style && (fixStyles(styleState.style), isWeb && !staticConfig.isReactNative && styleToCSS(styleState.style)), styleState.flatTransforms) {
497
496
  var _styleState4;
498
- (_styleState4 = styleState).style || (_styleState4.style = {}), Object.entries(styleState.transforms).sort(function(param, param1) {
497
+ (_styleState4 = styleState).style || (_styleState4.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
499
498
  var _param = _sliced_to_array(param, 1), a = _param[0], _param1 = _sliced_to_array(param1, 1), b = _param1[0];
500
499
  return a.localeCompare(b);
501
500
  }).forEach(function(param) {
@@ -617,7 +616,7 @@ function mergeStyle(styleState, key, val) {
617
616
  classNames[key] = val, (_usedKeys = usedKeys)[_key = key] || (_usedKeys[_key] = 1);
618
617
  } else if (key in stylePropsTransform) {
619
618
  var _styleState;
620
- (_styleState = styleState).transforms || (_styleState.transforms = {}), styleState.transforms[key] = val;
619
+ (_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), styleState.flatTransforms[key] = val;
621
620
  } else {
622
621
  var shouldNormalize = isWeb && !disableNormalize && !styleProps.noNormalize, out = shouldNormalize ? normalizeValueWithProperty(val, key) : val;
623
622
  if (
@@ -690,6 +689,10 @@ function passDownProp(viewProps, key, val) {
690
689
  } else
691
690
  viewProps[key] = val;
692
691
  }
692
+ function mergeMediaByImportance(styleState, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump) {
693
+ var importance = getMediaImportanceIfMoreImportant(mediaKey, key, importancesUsed, isSizeMedia);
694
+ return importanceBump && (importance = (importance || 0) + importanceBump), importance === null ? !1 : (importancesUsed[key] = importance, mergeStyle(styleState, key, value), !0);
695
+ }
693
696
  export {
694
697
  PROP_SPLIT,
695
698
  getSplitStyles,