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