@tamagui/web 1.88.17 → 1.88.19
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 +3 -2
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/createComponent.native.js +3 -2
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +191 -183
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +217 -212
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.js +5 -7
- package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.native.js +5 -7
- package/dist/cjs/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +2 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/createComponent.js +3 -2
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.mjs +4 -3
- package/dist/esm/createComponent.native.js +3 -2
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +191 -183
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +181 -175
- package/dist/esm/helpers/getSplitStyles.native.js +217 -212
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.js +5 -7
- package/dist/esm/helpers/getVariantExtras.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.mjs +3 -4
- package/dist/esm/helpers/getVariantExtras.native.js +5 -7
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.native.js +2 -0
- package/dist/esm/index.native.js.map +1 -1
- package/package.json +10 -10
- package/src/createComponent.tsx +4 -3
- package/src/helpers/getSplitStyles.tsx +87 -78
- package/src/helpers/getVariantExtras.tsx +6 -10
- package/src/index.ts +1 -0
- package/src/types.tsx +13 -0
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/types.d.ts +11 -0
- package/types/types.d.ts.map +1 -1
|
@@ -52,12 +52,10 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
52
52
|
pseudoGroups,
|
|
53
53
|
mediaGroups,
|
|
54
54
|
style = {},
|
|
55
|
-
className = props.className
|
|
55
|
+
className = props.className || "",
|
|
56
56
|
mediaStylesSeen = 0;
|
|
57
57
|
const styleState = {
|
|
58
|
-
curProps: {
|
|
59
|
-
...props
|
|
60
|
-
},
|
|
58
|
+
curProps: {},
|
|
61
59
|
classNames,
|
|
62
60
|
conf,
|
|
63
61
|
props,
|
|
@@ -83,7 +81,6 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
83
81
|
}
|
|
84
82
|
}), console.groupEnd());
|
|
85
83
|
for (const keyOg in props) {
|
|
86
|
-
process.env.NODE_ENV === "development" && console.groupEnd();
|
|
87
84
|
let keyInit = keyOg,
|
|
88
85
|
valInit = props[keyOg];
|
|
89
86
|
if (styleProps.disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || props.asChild && webViewFlexCompatStyles[keyInit] === valInit) continue;
|
|
@@ -113,11 +110,11 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
113
110
|
continue;
|
|
114
111
|
}
|
|
115
112
|
}
|
|
116
|
-
if (styleState.curProps[keyInit] = valInit, keyInit === "dataSet") {
|
|
113
|
+
if (valInit !== props[keyInit] && (styleState.curProps[keyInit] = valInit), keyInit === "dataSet") {
|
|
117
114
|
for (const keyInit2 in valInit) viewProps[`data-${hyphenate(keyInit2)}`] = valInit[keyInit2];
|
|
118
115
|
continue;
|
|
119
116
|
}
|
|
120
|
-
if (keyInit.startsWith("_style") && isObj(valInit)) {
|
|
117
|
+
if (!isValidStyleKeyInit && keyInit.startsWith("_style") && isObj(valInit)) {
|
|
121
118
|
Object.assign(styleState.style, valInit);
|
|
122
119
|
continue;
|
|
123
120
|
}
|
|
@@ -188,7 +185,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
188
185
|
let isPseudo = (keyInit in validPseudoKeys),
|
|
189
186
|
isMedia = !isStyleLikeKey && !isPseudo && isMediaKey(keyInit),
|
|
190
187
|
isMediaOrPseudo = !!(isMedia || isPseudo);
|
|
191
|
-
const isStyleProp = isMediaOrPseudo || isVariant && !styleProps.noExpand ||
|
|
188
|
+
const isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !styleProps.noExpand || isShorthand;
|
|
192
189
|
if (isStyleProp && (props.asChild === "except-style" || props.asChild === "except-style-web")) continue;
|
|
193
190
|
const shouldPassProp = !isStyleProp ||
|
|
194
191
|
// is in parent variants
|
|
@@ -196,7 +193,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
196
193
|
parentVariant = parentStaticConfig?.variants?.[keyInit],
|
|
197
194
|
isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || parentVariant || keyInit in skipProps)),
|
|
198
195
|
shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
199
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.
|
|
196
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`), log({
|
|
200
197
|
isVariant,
|
|
201
198
|
valInit,
|
|
202
199
|
shouldPassProp
|
|
@@ -211,9 +208,14 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
211
208
|
parentStaticConfig
|
|
212
209
|
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo), !isVariant) || !styleProps.noSkip && keyInit in skipProps) continue;
|
|
213
210
|
(isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
if (
|
|
211
|
+
const avoidPropMap = isMediaOrPseudo || !isVariant && !isValidStyleKeyInit,
|
|
212
|
+
expanded = avoidPropMap ? null : propMapper(keyInit, valInit, styleState);
|
|
213
|
+
if (!avoidPropMap) {
|
|
214
|
+
if (!expanded) continue;
|
|
215
|
+
const next = getPropMappedFontFamily(expanded);
|
|
216
|
+
next && (styleState.fontFamily = next);
|
|
217
|
+
}
|
|
218
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
217
219
|
console.groupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
218
220
|
try {
|
|
219
221
|
!isServer && isDevTools && (log({
|
|
@@ -241,185 +243,189 @@ current`, {
|
|
|
241
243
|
} catch {}
|
|
242
244
|
console.groupEnd();
|
|
243
245
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
246
|
+
let key = keyInit,
|
|
247
|
+
val = valInit;
|
|
248
|
+
const max = expanded ? expanded.length : 1;
|
|
249
|
+
for (let i = 0; i < max; i++) {
|
|
250
|
+
if (expanded) {
|
|
251
|
+
const [k, v] = expanded[i];
|
|
252
|
+
key = k, val = v;
|
|
253
|
+
}
|
|
254
|
+
if (val == null || key in usedKeys) continue;
|
|
255
|
+
if (isPseudo = key in validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && isMediaKey(key), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key in variants, (inlineProps?.has(key) || IS_STATIC && inlineWhenUnflattened?.has(key)) && (viewProps[key] = props[key] ?? val), styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo || parentStaticConfig?.variants?.[keyInit])) {
|
|
256
|
+
passDownProp(viewProps, key, val, isMediaOrPseudo), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(` - passing down prop ${key}`), log({
|
|
257
|
+
val,
|
|
258
|
+
after: {
|
|
259
|
+
...viewProps[key]
|
|
260
|
+
}
|
|
261
|
+
}), console.groupEnd());
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (isPseudo) {
|
|
265
|
+
if (!val) continue;
|
|
266
|
+
const pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClassNames),
|
|
267
|
+
descriptor = pseudoDescriptors[key],
|
|
268
|
+
isEnter = key === "enterStyle",
|
|
269
|
+
isExit = key === "exitStyle";
|
|
270
|
+
if (!descriptor) continue;
|
|
271
|
+
if ((!shouldDoClasses || IS_STATIC) && (pseudos ||= {}, pseudos[key] ||= {}, IS_STATIC)) {
|
|
272
|
+
Object.assign(pseudos[key], pseudoStyleObject);
|
|
254
273
|
continue;
|
|
255
274
|
}
|
|
256
|
-
if (
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
continue;
|
|
275
|
+
if (shouldDoClasses && !isExit) {
|
|
276
|
+
const pseudoStyles = generateAtomicStyles(pseudoStyleObject, descriptor);
|
|
277
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), log({
|
|
278
|
+
pseudoStyleObject,
|
|
279
|
+
pseudoStyles
|
|
280
|
+
}), console.groupEnd());
|
|
281
|
+
for (const psuedoStyle of pseudoStyles) {
|
|
282
|
+
const fullKey = `${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}`;
|
|
283
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(transforms, classNames, fullKey, psuedoStyle.identifier, isMediaOrPseudo, !0));
|
|
266
284
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
285
|
+
}
|
|
286
|
+
if (!shouldDoClasses || isExit || isEnter) {
|
|
287
|
+
const descriptorKey = descriptor.stateKey || descriptor.name;
|
|
288
|
+
let isDisabled = componentState[descriptorKey] === !1;
|
|
289
|
+
isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, {
|
|
290
|
+
isDisabled
|
|
291
|
+
}), log({
|
|
292
|
+
pseudoStyleObject,
|
|
293
|
+
isDisabled,
|
|
294
|
+
descriptor,
|
|
295
|
+
componentState
|
|
296
|
+
}), console.groupEnd());
|
|
297
|
+
const importance = descriptor.priority;
|
|
298
|
+
for (const pkey in pseudoStyleObject) {
|
|
299
|
+
const val2 = pseudoStyleObject[pkey];
|
|
300
|
+
if (isDisabled) {
|
|
301
|
+
const defaultValues = animatableDefaults[pkey];
|
|
302
|
+
defaultValues != null && !(pkey in usedKeys) && !(pkey in styleState.style) && mergeStyle(styleState, pkey, defaultValues);
|
|
303
|
+
} else {
|
|
304
|
+
const curImportance = usedKeys[pkey] || 0,
|
|
305
|
+
shouldMerge = importance >= curImportance;
|
|
306
|
+
shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2)), process.env.NODE_ENV === "development" && debug === "verbose" && log(" subKey", pkey, shouldMerge, {
|
|
307
|
+
importance,
|
|
308
|
+
curImportance,
|
|
309
|
+
pkey,
|
|
310
|
+
val: val2,
|
|
311
|
+
transforms: {
|
|
312
|
+
...styleState.transforms
|
|
313
|
+
}
|
|
314
|
+
});
|
|
276
315
|
}
|
|
277
316
|
}
|
|
278
|
-
if (!
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, {
|
|
282
|
-
isDisabled
|
|
283
|
-
}), log({
|
|
284
|
-
pseudoStyleObject,
|
|
285
|
-
isDisabled,
|
|
286
|
-
descriptor,
|
|
287
|
-
componentState
|
|
288
|
-
}), console.groupEnd());
|
|
289
|
-
const importance = descriptor.priority;
|
|
290
|
-
for (const pkey in pseudoStyleObject) {
|
|
291
|
-
const val2 = pseudoStyleObject[pkey];
|
|
292
|
-
if (isDisabled) {
|
|
293
|
-
const defaultValues = animatableDefaults[pkey];
|
|
294
|
-
defaultValues != null && !(pkey in usedKeys) && mergeStyle(styleState, pkey, defaultValues);
|
|
295
|
-
} else {
|
|
296
|
-
const curImportance = usedKeys[pkey] || 0,
|
|
297
|
-
shouldMerge = importance >= curImportance;
|
|
298
|
-
shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2)), process.env.NODE_ENV === "development" && debug === "verbose" && log(" subKey", pkey, shouldMerge, {
|
|
299
|
-
importance,
|
|
300
|
-
curImportance,
|
|
301
|
-
pkey,
|
|
302
|
-
val: val2,
|
|
303
|
-
transforms: {
|
|
304
|
-
...styleState.transforms
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
if (!isDisabled) for (const key2 in val) {
|
|
310
|
-
const k = shorthands[key2] || key2;
|
|
311
|
-
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
312
|
-
}
|
|
317
|
+
if (!isDisabled) for (const key2 in val) {
|
|
318
|
+
const k = shorthands[key2] || key2;
|
|
319
|
+
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
313
320
|
}
|
|
314
|
-
continue;
|
|
315
321
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
if (isMedia) {
|
|
325
|
+
if (!val) continue;
|
|
326
|
+
if (isMedia === "platform") {
|
|
327
|
+
const platform = key.slice(10);
|
|
328
|
+
if (
|
|
329
|
+
// supports web, ios, android
|
|
330
|
+
platform !== currentPlatform &&
|
|
331
|
+
// supports web, native
|
|
332
|
+
platform !== "web") continue;
|
|
333
|
+
}
|
|
334
|
+
hasMedia ||= !0;
|
|
335
|
+
const mediaStyle = getSubStyle(styleState, key, val,
|
|
336
|
+
// TODO try true like pseudo
|
|
337
|
+
!1),
|
|
338
|
+
mediaKeyShort = key.slice(1);
|
|
339
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && log(` \u{1F4FA} ${key}`, {
|
|
340
|
+
key,
|
|
341
|
+
val,
|
|
342
|
+
mediaStyle,
|
|
343
|
+
props,
|
|
344
|
+
shouldDoClasses,
|
|
345
|
+
componentState
|
|
346
|
+
});
|
|
347
|
+
const hasSpace = val.space;
|
|
348
|
+
if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
|
|
349
|
+
if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
|
|
350
|
+
const importance = getMediaImportanceIfMoreImportant(mediaKeyShort, "space", usedKeys, !0);
|
|
351
|
+
importance && (space = val.space, usedKeys.space = importance, process.env.NODE_ENV === "development" && debug === "verbose" && log(`Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance})`));
|
|
325
352
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
if (
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
353
|
+
const mediaStyles = getStylesAtomic(mediaStyle, debug),
|
|
354
|
+
priority = mediaStylesSeen;
|
|
355
|
+
mediaStylesSeen += 1;
|
|
356
|
+
for (const style2 of mediaStyles) {
|
|
357
|
+
const out = createMediaStyle(style2, mediaKeyShort, mediaQueryConfig, isMedia, !1, priority);
|
|
358
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && log("\u{1F4FA} media style:", out);
|
|
359
|
+
const fullKey = `${style2.property}${PROP_SPLIT}${mediaKeyShort}`;
|
|
360
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey, out.identifier, !0, !0));
|
|
361
|
+
}
|
|
362
|
+
} else {
|
|
363
|
+
const isThemeMedia = isMedia === "theme",
|
|
364
|
+
isGroupMedia = isMedia === "group";
|
|
365
|
+
if (!isThemeMedia && !(isMedia === "platform") && !isGroupMedia && !mediaState[mediaKeyShort]) continue;
|
|
366
|
+
let importanceBump = 0;
|
|
367
|
+
if (isThemeMedia) {
|
|
368
|
+
dynamicThemeAccess = !0;
|
|
369
|
+
const mediaThemeName = mediaKeyShort.slice(6);
|
|
370
|
+
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName))) continue;
|
|
371
|
+
} else if (isGroupMedia) {
|
|
372
|
+
const groupInfo = getGroupPropParts(mediaKeyShort),
|
|
373
|
+
groupName = groupInfo.name,
|
|
374
|
+
groupContext = context?.groups.state[groupName];
|
|
375
|
+
if (!groupContext) {
|
|
376
|
+
process.env.NODE_ENV === "development" && debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
|
|
377
|
+
continue;
|
|
344
378
|
}
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
379
|
+
const groupPseudoKey = groupInfo.pseudo,
|
|
380
|
+
groupMediaKey = groupInfo.media,
|
|
381
|
+
componentGroupState = componentState.group?.[groupName];
|
|
382
|
+
if (groupMediaKey) {
|
|
383
|
+
mediaGroups ||= /* @__PURE__ */new Set(), mediaGroups.add(groupMediaKey);
|
|
384
|
+
const mediaState2 = componentGroupState?.media;
|
|
385
|
+
let isActive = mediaState2?.[groupMediaKey];
|
|
386
|
+
if (!mediaState2 && groupContext.layout && (isActive = mediaKeyMatch(groupMediaKey, groupContext.layout)), !isActive) continue;
|
|
387
|
+
importanceBump = 2;
|
|
353
388
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
if (isThemeMedia) {
|
|
360
|
-
dynamicThemeAccess = !0;
|
|
361
|
-
const mediaThemeName = mediaKeyShort.slice(6);
|
|
362
|
-
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName))) continue;
|
|
363
|
-
} else if (isGroupMedia) {
|
|
364
|
-
const groupInfo = getGroupPropParts(mediaKeyShort),
|
|
365
|
-
groupName = groupInfo.name,
|
|
366
|
-
groupContext = context?.groups.state[groupName];
|
|
367
|
-
if (!groupContext) {
|
|
368
|
-
process.env.NODE_ENV === "development" && debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
|
|
369
|
-
continue;
|
|
370
|
-
}
|
|
371
|
-
const groupPseudoKey = groupInfo.pseudo,
|
|
372
|
-
groupMediaKey = groupInfo.media,
|
|
373
|
-
componentGroupState = componentState.group?.[groupName];
|
|
374
|
-
if (groupMediaKey) {
|
|
375
|
-
mediaGroups ||= /* @__PURE__ */new Set(), mediaGroups.add(groupMediaKey);
|
|
376
|
-
const mediaState2 = componentGroupState?.media;
|
|
377
|
-
let isActive = mediaState2?.[groupMediaKey];
|
|
378
|
-
if (!mediaState2 && groupContext.layout && (isActive = mediaKeyMatch(groupMediaKey, groupContext.layout)), !isActive) continue;
|
|
379
|
-
importanceBump = 2;
|
|
380
|
-
}
|
|
381
|
-
if (groupPseudoKey) {
|
|
382
|
-
if (pseudoGroups ||= /* @__PURE__ */new Set(), pseudoGroups.add(groupName), !(componentGroupState ||
|
|
383
|
-
// fallback to context initially
|
|
384
|
-
context.groups.state[groupName]).pseudo?.[groupPseudoKey]) continue;
|
|
385
|
-
importanceBump = pseudoPriorities[groupPseudoKey];
|
|
386
|
-
}
|
|
389
|
+
if (groupPseudoKey) {
|
|
390
|
+
if (pseudoGroups ||= /* @__PURE__ */new Set(), pseudoGroups.add(groupName), !(componentGroupState ||
|
|
391
|
+
// fallback to context initially
|
|
392
|
+
context.groups.state[groupName]).pseudo?.[groupPseudoKey]) continue;
|
|
393
|
+
importanceBump = pseudoPriorities[groupPseudoKey];
|
|
387
394
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
mergeMediaByImportance(style, mediaKeyShort, subKey, mediaStyle[subKey], usedKeys, mediaState[mediaKeyShort], importanceBump), key === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
|
|
395
|
+
}
|
|
396
|
+
for (const subKey in mediaStyle) {
|
|
397
|
+
if (subKey === "space") {
|
|
398
|
+
space = valInit.space;
|
|
399
|
+
continue;
|
|
394
400
|
}
|
|
401
|
+
mergeMediaByImportance(style, mediaKeyShort, subKey, mediaStyle[subKey], usedKeys, mediaState[mediaKeyShort], importanceBump), key === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
|
|
395
402
|
}
|
|
396
|
-
continue;
|
|
397
|
-
}
|
|
398
|
-
if (
|
|
399
|
-
// is HOC we can just pass through the styles as props
|
|
400
|
-
// this fixes issues where style prop got merged with wrong priority
|
|
401
|
-
!isHOC && isValidStyleKey(key, staticConfig)) {
|
|
402
|
-
mergeStyle(styleState, key, val);
|
|
403
|
-
continue;
|
|
404
403
|
}
|
|
405
|
-
|
|
404
|
+
continue;
|
|
406
405
|
}
|
|
407
|
-
if (
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
...transforms
|
|
414
|
-
}), log("viewProps", {
|
|
415
|
-
...viewProps
|
|
416
|
-
});
|
|
417
|
-
} catch {}
|
|
418
|
-
console.groupEnd();
|
|
406
|
+
if (
|
|
407
|
+
// is HOC we can just pass through the styles as props
|
|
408
|
+
// this fixes issues where style prop got merged with wrong priority
|
|
409
|
+
!isHOC && isValidStyleKey(key, staticConfig)) {
|
|
410
|
+
mergeStyle(styleState, key, val);
|
|
411
|
+
continue;
|
|
419
412
|
}
|
|
413
|
+
isVariant || (viewProps[key] = val);
|
|
414
|
+
}
|
|
415
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
416
|
+
try {
|
|
417
|
+
log(" \u2714\uFE0F expand complete", keyInit), log("style", {
|
|
418
|
+
...style
|
|
419
|
+
}), log("transforms", {
|
|
420
|
+
...transforms
|
|
421
|
+
}), log("viewProps", {
|
|
422
|
+
...viewProps
|
|
423
|
+
});
|
|
424
|
+
} catch {}
|
|
425
|
+
console.groupEnd();
|
|
420
426
|
}
|
|
421
427
|
}
|
|
422
|
-
if (
|
|
428
|
+
if (props.style) if (isHOC) viewProps.style = props.style;else for (const style2 of [].concat(props.style)) style2 && (style2.$$css ? Object.assign(styleState.classNames, style2) : Object.assign(styleState.style, style2));
|
|
423
429
|
if (!(styleProps.noNormalize === !1) && (fixStyles(style), isWeb && !staticConfig.isReactNative && styleToCSS(style), styleState.transforms && Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
|
|
424
430
|
mergeTransform(style, key, val, !0);
|
|
425
431
|
}), !staticConfig.isReactNative && !staticConfig.isHOC && !(styleProps.isAnimated && !conf.animations.supportsCSSVars) && Array.isArray(style.transform) && (style.transform = transformsToString(style.transform)), parentSplitStyles)) {
|
|
@@ -545,8 +551,8 @@ const getSubStyle = (styleState, subKey, styleIn, avoidMergeTransform) => {
|
|
|
545
551
|
return styleProps.noNormalize || fixStyles(styleOut), styleOut;
|
|
546
552
|
},
|
|
547
553
|
useInsertEffectCompat = isWeb ? useInsertionEffect || useIsomorphicLayoutEffect : () => {},
|
|
548
|
-
useSplitStyles = (
|
|
549
|
-
const res = getSplitStyles(
|
|
554
|
+
useSplitStyles = (a, b, c, d, e, f, g, h, i, j) => {
|
|
555
|
+
const res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
|
|
550
556
|
return useInsertEffectCompat(() => {
|
|
551
557
|
insertStyleRules(res.rulesToInsert);
|
|
552
558
|
}, [res.rulesToInsert]), res;
|