@tamagui/web 1.90.1 → 1.90.3
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 +17 -23
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/createComponent.native.js +10 -12
- package/dist/cjs/createComponent.native.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +26 -18
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +223 -220
- 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 +17 -23
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.mjs +22 -25
- package/dist/esm/createComponent.native.js +10 -12
- package/dist/esm/createComponent.native.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +26 -19
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +23 -17
- package/dist/esm/helpers/getSplitStyles.native.js +224 -221
- 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 +28 -26
- package/src/helpers/getSplitStyles.tsx +54 -32
- 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
|
@@ -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
|
|
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
|
-
})),
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
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
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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 (
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
var
|
|
270
|
-
if (
|
|
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
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
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
|
-
|
|
295
|
-
|
|
296
|
-
} finally {
|
|
297
|
-
if (_didIteratorError)
|
|
298
|
-
throw _iteratorError;
|
|
299
|
-
}
|
|
304
|
+
if (_didIteratorError)
|
|
305
|
+
throw _iteratorError;
|
|
300
306
|
}
|
|
301
307
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
-
|
|
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
|
-
|
|
342
|
-
|
|
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
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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
|
-
|
|
377
|
-
|
|
378
|
-
|
|
386
|
+
} catch (err) {
|
|
387
|
+
_didIteratorError1 = !0, _iteratorError1 = err;
|
|
388
|
+
} finally {
|
|
379
389
|
try {
|
|
380
|
-
|
|
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
|
-
|
|
390
|
-
|
|
391
|
-
} finally {
|
|
392
|
-
if (_didIteratorError1)
|
|
393
|
-
throw _iteratorError1;
|
|
394
|
-
}
|
|
392
|
+
if (_didIteratorError1)
|
|
393
|
+
throw _iteratorError1;
|
|
395
394
|
}
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
|
|
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
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
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
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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
|
-
|
|
426
|
+
var priority1 = pseudoPriorities[groupPseudoKey];
|
|
427
|
+
importanceBump = priority1;
|
|
437
428
|
}
|
|
438
429
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
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
|
-
|
|
439
|
+
continue;
|
|
454
440
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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) {
|
|
@@ -503,8 +502,6 @@ current`, _object_spread({}, styleState.style)));
|
|
|
503
502
|
mergeTransform(styleState.style, key6, val4, !0);
|
|
504
503
|
});
|
|
505
504
|
}
|
|
506
|
-
if (0)
|
|
507
|
-
var _styleState_style;
|
|
508
505
|
if (parentSplitStyles) {
|
|
509
506
|
if (0 && shouldDoClasses)
|
|
510
507
|
for (var key2 in parentSplitStyles.classNames)
|
|
@@ -516,6 +513,8 @@ current`, _object_spread({}, styleState.style)));
|
|
|
516
513
|
}
|
|
517
514
|
}
|
|
518
515
|
}
|
|
516
|
+
if (0)
|
|
517
|
+
var _styleState_style, shouldStringifyTransforms;
|
|
519
518
|
if (0) {
|
|
520
519
|
if (styleState.style && shouldDoClasses) {
|
|
521
520
|
var retainedStyles, shouldRetain;
|
|
@@ -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).
|
|
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,
|