@tamagui/web 1.88.18 → 1.88.20
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 +2 -1
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/createComponent.native.js +2 -1
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +189 -221
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +187 -206
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.js +37 -35
- package/dist/cjs/helpers/propMapper.js.map +1 -1
- package/dist/cjs/helpers/propMapper.native.js +37 -35
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/helpers/skipProps.js +61 -0
- package/dist/cjs/helpers/skipProps.js.map +6 -0
- package/dist/cjs/helpers/skipProps.native.js +54 -0
- package/dist/cjs/helpers/skipProps.native.js.map +6 -0
- package/dist/esm/createComponent.js +2 -1
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.mjs +3 -2
- package/dist/esm/createComponent.native.js +2 -1
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +185 -216
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +181 -212
- package/dist/esm/helpers/getSplitStyles.native.js +187 -206
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.js +37 -34
- package/dist/esm/helpers/propMapper.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +26 -23
- package/dist/esm/helpers/propMapper.native.js +37 -35
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.js +45 -0
- package/dist/esm/helpers/skipProps.js.map +6 -0
- package/dist/esm/helpers/skipProps.mjs +42 -0
- package/dist/esm/helpers/skipProps.native.js +54 -0
- package/dist/esm/helpers/skipProps.native.js.map +6 -0
- package/package.json +10 -10
- package/src/createComponent.tsx +2 -1
- package/src/helpers/getSplitStyles.tsx +24 -82
- package/src/helpers/propMapper.ts +5 -0
- package/src/helpers/skipProps.ts +69 -0
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/propMapper.d.ts.map +1 -1
- package/types/helpers/skipProps.d.ts +17 -0
- package/types/helpers/skipProps.d.ts.map +1 -0
- package/dist/cjs/hooks/getThemeProxied.js +0 -66
- package/dist/cjs/hooks/getThemeProxied.js.map +0 -6
- package/dist/cjs/hooks/getThemeProxied.native.js +0 -100
- package/dist/cjs/hooks/getThemeProxied.native.js.map +0 -6
- package/dist/esm/hooks/getThemeProxied.js +0 -52
- package/dist/esm/hooks/getThemeProxied.js.map +0 -6
- package/dist/esm/hooks/getThemeProxied.mjs +0 -41
- package/dist/esm/hooks/getThemeProxied.native.js +0 -100
- package/dist/esm/hooks/getThemeProxied.native.js.map +0 -6
- package/types/hooks/getThemeProxied.d.ts.map +0 -1
|
@@ -2,6 +2,7 @@ import { currentPlatform, isClient, isServer, isWeb, useIsomorphicLayoutEffect }
|
|
|
2
2
|
import { stylePropsText, stylePropsTransform, validPseudoKeys, validStyles, validStylesOnBaseProps } from "@tamagui/helpers";
|
|
3
3
|
import { useInsertionEffect } from "react";
|
|
4
4
|
import { getConfig } from "../config.mjs";
|
|
5
|
+
import { skipProps } from "./skipProps.mjs";
|
|
5
6
|
import { accessibilityDirectMap } from "../constants/accessibilityDirectMap.mjs";
|
|
6
7
|
import { webViewFlexCompatStyles } from "../constants/constants.mjs";
|
|
7
8
|
import { isDevTools } from "../constants/isDevTools.mjs";
|
|
@@ -208,9 +209,14 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
208
209
|
parentStaticConfig
|
|
209
210
|
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo), !isVariant) || !styleProps.noSkip && keyInit in skipProps) continue;
|
|
210
211
|
(isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
if (
|
|
212
|
+
const avoidPropMap = isMediaOrPseudo || !isVariant && !isValidStyleKeyInit,
|
|
213
|
+
expanded = avoidPropMap ? null : propMapper(keyInit, valInit, styleState);
|
|
214
|
+
if (!avoidPropMap) {
|
|
215
|
+
if (!expanded) continue;
|
|
216
|
+
const next = getPropMappedFontFamily(expanded);
|
|
217
|
+
next && (styleState.fontFamily = next);
|
|
218
|
+
}
|
|
219
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
214
220
|
console.groupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
215
221
|
try {
|
|
216
222
|
!isServer && isDevTools && (log({
|
|
@@ -238,185 +244,189 @@ current`, {
|
|
|
238
244
|
} catch {}
|
|
239
245
|
console.groupEnd();
|
|
240
246
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
let key = keyInit,
|
|
248
|
+
val = valInit;
|
|
249
|
+
const max = expanded ? expanded.length : 1;
|
|
250
|
+
for (let i = 0; i < max; i++) {
|
|
251
|
+
if (expanded) {
|
|
252
|
+
const [k, v] = expanded[i];
|
|
253
|
+
key = k, val = v;
|
|
254
|
+
}
|
|
255
|
+
if (val == null || key in usedKeys) continue;
|
|
256
|
+
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])) {
|
|
257
|
+
passDownProp(viewProps, key, val, isMediaOrPseudo), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(` - passing down prop ${key}`), log({
|
|
258
|
+
val,
|
|
259
|
+
after: {
|
|
260
|
+
...viewProps[key]
|
|
261
|
+
}
|
|
262
|
+
}), console.groupEnd());
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
if (isPseudo) {
|
|
266
|
+
if (!val) continue;
|
|
267
|
+
const pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClassNames),
|
|
268
|
+
descriptor = pseudoDescriptors[key],
|
|
269
|
+
isEnter = key === "enterStyle",
|
|
270
|
+
isExit = key === "exitStyle";
|
|
271
|
+
if (!descriptor) continue;
|
|
272
|
+
if ((!shouldDoClasses || IS_STATIC) && (pseudos ||= {}, pseudos[key] ||= {}, IS_STATIC)) {
|
|
273
|
+
Object.assign(pseudos[key], pseudoStyleObject);
|
|
251
274
|
continue;
|
|
252
275
|
}
|
|
253
|
-
if (
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
continue;
|
|
276
|
+
if (shouldDoClasses && !isExit) {
|
|
277
|
+
const pseudoStyles = generateAtomicStyles(pseudoStyleObject, descriptor);
|
|
278
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), log({
|
|
279
|
+
pseudoStyleObject,
|
|
280
|
+
pseudoStyles
|
|
281
|
+
}), console.groupEnd());
|
|
282
|
+
for (const psuedoStyle of pseudoStyles) {
|
|
283
|
+
const fullKey = `${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}`;
|
|
284
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(transforms, classNames, fullKey, psuedoStyle.identifier, isMediaOrPseudo, !0));
|
|
263
285
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
286
|
+
}
|
|
287
|
+
if (!shouldDoClasses || isExit || isEnter) {
|
|
288
|
+
const descriptorKey = descriptor.stateKey || descriptor.name;
|
|
289
|
+
let isDisabled = componentState[descriptorKey] === !1;
|
|
290
|
+
isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, {
|
|
291
|
+
isDisabled
|
|
292
|
+
}), log({
|
|
293
|
+
pseudoStyleObject,
|
|
294
|
+
isDisabled,
|
|
295
|
+
descriptor,
|
|
296
|
+
componentState
|
|
297
|
+
}), console.groupEnd());
|
|
298
|
+
const importance = descriptor.priority;
|
|
299
|
+
for (const pkey in pseudoStyleObject) {
|
|
300
|
+
const val2 = pseudoStyleObject[pkey];
|
|
301
|
+
if (isDisabled) {
|
|
302
|
+
const defaultValues = animatableDefaults[pkey];
|
|
303
|
+
defaultValues != null && !(pkey in usedKeys) && !(pkey in styleState.style) && mergeStyle(styleState, pkey, defaultValues);
|
|
304
|
+
} else {
|
|
305
|
+
const curImportance = usedKeys[pkey] || 0,
|
|
306
|
+
shouldMerge = importance >= curImportance;
|
|
307
|
+
shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2)), process.env.NODE_ENV === "development" && debug === "verbose" && log(" subKey", pkey, shouldMerge, {
|
|
308
|
+
importance,
|
|
309
|
+
curImportance,
|
|
310
|
+
pkey,
|
|
311
|
+
val: val2,
|
|
312
|
+
transforms: {
|
|
313
|
+
...styleState.transforms
|
|
314
|
+
}
|
|
315
|
+
});
|
|
273
316
|
}
|
|
274
317
|
}
|
|
275
|
-
if (!
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
isExit && (isDisabled = !styleProps.isExiting), isEnter && (isDisabled = componentState.unmounted === "should-enter" ? !0 : !componentState.unmounted), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, {
|
|
279
|
-
isDisabled
|
|
280
|
-
}), log({
|
|
281
|
-
pseudoStyleObject,
|
|
282
|
-
isDisabled,
|
|
283
|
-
descriptor,
|
|
284
|
-
componentState
|
|
285
|
-
}), console.groupEnd());
|
|
286
|
-
const importance = descriptor.priority;
|
|
287
|
-
for (const pkey in pseudoStyleObject) {
|
|
288
|
-
const val2 = pseudoStyleObject[pkey];
|
|
289
|
-
if (isDisabled) {
|
|
290
|
-
const defaultValues = animatableDefaults[pkey];
|
|
291
|
-
defaultValues != null && !(pkey in usedKeys) && !(pkey in styleState.style) && mergeStyle(styleState, pkey, defaultValues);
|
|
292
|
-
} else {
|
|
293
|
-
const curImportance = usedKeys[pkey] || 0,
|
|
294
|
-
shouldMerge = importance >= curImportance;
|
|
295
|
-
shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2)), process.env.NODE_ENV === "development" && debug === "verbose" && log(" subKey", pkey, shouldMerge, {
|
|
296
|
-
importance,
|
|
297
|
-
curImportance,
|
|
298
|
-
pkey,
|
|
299
|
-
val: val2,
|
|
300
|
-
transforms: {
|
|
301
|
-
...styleState.transforms
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
if (!isDisabled) for (const key2 in val) {
|
|
307
|
-
const k = shorthands[key2] || key2;
|
|
308
|
-
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
309
|
-
}
|
|
318
|
+
if (!isDisabled) for (const key2 in val) {
|
|
319
|
+
const k = shorthands[key2] || key2;
|
|
320
|
+
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
310
321
|
}
|
|
311
|
-
continue;
|
|
312
322
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
if (isMedia) {
|
|
326
|
+
if (!val) continue;
|
|
327
|
+
if (isMedia === "platform") {
|
|
328
|
+
const platform = key.slice(10);
|
|
329
|
+
if (
|
|
330
|
+
// supports web, ios, android
|
|
331
|
+
platform !== currentPlatform &&
|
|
332
|
+
// supports web, native
|
|
333
|
+
platform !== "web") continue;
|
|
334
|
+
}
|
|
335
|
+
hasMedia ||= !0;
|
|
336
|
+
const mediaStyle = getSubStyle(styleState, key, val,
|
|
337
|
+
// TODO try true like pseudo
|
|
338
|
+
!1),
|
|
339
|
+
mediaKeyShort = key.slice(1);
|
|
340
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && log(` \u{1F4FA} ${key}`, {
|
|
341
|
+
key,
|
|
342
|
+
val,
|
|
343
|
+
mediaStyle,
|
|
344
|
+
props,
|
|
345
|
+
shouldDoClasses,
|
|
346
|
+
componentState
|
|
347
|
+
});
|
|
348
|
+
const hasSpace = val.space;
|
|
349
|
+
if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
|
|
350
|
+
if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
|
|
351
|
+
const importance = getMediaImportanceIfMoreImportant(mediaKeyShort, "space", usedKeys, !0);
|
|
352
|
+
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})`));
|
|
322
353
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
if (
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
354
|
+
const mediaStyles = getStylesAtomic(mediaStyle, debug),
|
|
355
|
+
priority = mediaStylesSeen;
|
|
356
|
+
mediaStylesSeen += 1;
|
|
357
|
+
for (const style2 of mediaStyles) {
|
|
358
|
+
const out = createMediaStyle(style2, mediaKeyShort, mediaQueryConfig, isMedia, !1, priority);
|
|
359
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && log("\u{1F4FA} media style:", out);
|
|
360
|
+
const fullKey = `${style2.property}${PROP_SPLIT}${mediaKeyShort}`;
|
|
361
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey, out.identifier, !0, !0));
|
|
362
|
+
}
|
|
363
|
+
} else {
|
|
364
|
+
const isThemeMedia = isMedia === "theme",
|
|
365
|
+
isGroupMedia = isMedia === "group";
|
|
366
|
+
if (!isThemeMedia && !(isMedia === "platform") && !isGroupMedia && !mediaState[mediaKeyShort]) continue;
|
|
367
|
+
let importanceBump = 0;
|
|
368
|
+
if (isThemeMedia) {
|
|
369
|
+
dynamicThemeAccess = !0;
|
|
370
|
+
const mediaThemeName = mediaKeyShort.slice(6);
|
|
371
|
+
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName))) continue;
|
|
372
|
+
} else if (isGroupMedia) {
|
|
373
|
+
const groupInfo = getGroupPropParts(mediaKeyShort),
|
|
374
|
+
groupName = groupInfo.name,
|
|
375
|
+
groupContext = context?.groups.state[groupName];
|
|
376
|
+
if (!groupContext) {
|
|
377
|
+
process.env.NODE_ENV === "development" && debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
|
|
378
|
+
continue;
|
|
341
379
|
}
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
380
|
+
const groupPseudoKey = groupInfo.pseudo,
|
|
381
|
+
groupMediaKey = groupInfo.media,
|
|
382
|
+
componentGroupState = componentState.group?.[groupName];
|
|
383
|
+
if (groupMediaKey) {
|
|
384
|
+
mediaGroups ||= /* @__PURE__ */new Set(), mediaGroups.add(groupMediaKey);
|
|
385
|
+
const mediaState2 = componentGroupState?.media;
|
|
386
|
+
let isActive = mediaState2?.[groupMediaKey];
|
|
387
|
+
if (!mediaState2 && groupContext.layout && (isActive = mediaKeyMatch(groupMediaKey, groupContext.layout)), !isActive) continue;
|
|
388
|
+
importanceBump = 2;
|
|
350
389
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
if (isThemeMedia) {
|
|
357
|
-
dynamicThemeAccess = !0;
|
|
358
|
-
const mediaThemeName = mediaKeyShort.slice(6);
|
|
359
|
-
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName))) continue;
|
|
360
|
-
} else if (isGroupMedia) {
|
|
361
|
-
const groupInfo = getGroupPropParts(mediaKeyShort),
|
|
362
|
-
groupName = groupInfo.name,
|
|
363
|
-
groupContext = context?.groups.state[groupName];
|
|
364
|
-
if (!groupContext) {
|
|
365
|
-
process.env.NODE_ENV === "development" && debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
|
|
366
|
-
continue;
|
|
367
|
-
}
|
|
368
|
-
const groupPseudoKey = groupInfo.pseudo,
|
|
369
|
-
groupMediaKey = groupInfo.media,
|
|
370
|
-
componentGroupState = componentState.group?.[groupName];
|
|
371
|
-
if (groupMediaKey) {
|
|
372
|
-
mediaGroups ||= /* @__PURE__ */new Set(), mediaGroups.add(groupMediaKey);
|
|
373
|
-
const mediaState2 = componentGroupState?.media;
|
|
374
|
-
let isActive = mediaState2?.[groupMediaKey];
|
|
375
|
-
if (!mediaState2 && groupContext.layout && (isActive = mediaKeyMatch(groupMediaKey, groupContext.layout)), !isActive) continue;
|
|
376
|
-
importanceBump = 2;
|
|
377
|
-
}
|
|
378
|
-
if (groupPseudoKey) {
|
|
379
|
-
if (pseudoGroups ||= /* @__PURE__ */new Set(), pseudoGroups.add(groupName), !(componentGroupState ||
|
|
380
|
-
// fallback to context initially
|
|
381
|
-
context.groups.state[groupName]).pseudo?.[groupPseudoKey]) continue;
|
|
382
|
-
importanceBump = pseudoPriorities[groupPseudoKey];
|
|
383
|
-
}
|
|
390
|
+
if (groupPseudoKey) {
|
|
391
|
+
if (pseudoGroups ||= /* @__PURE__ */new Set(), pseudoGroups.add(groupName), !(componentGroupState ||
|
|
392
|
+
// fallback to context initially
|
|
393
|
+
context.groups.state[groupName]).pseudo?.[groupPseudoKey]) continue;
|
|
394
|
+
importanceBump = pseudoPriorities[groupPseudoKey];
|
|
384
395
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
mergeMediaByImportance(style, mediaKeyShort, subKey, mediaStyle[subKey], usedKeys, mediaState[mediaKeyShort], importanceBump), key === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
|
|
396
|
+
}
|
|
397
|
+
for (const subKey in mediaStyle) {
|
|
398
|
+
if (subKey === "space") {
|
|
399
|
+
space = valInit.space;
|
|
400
|
+
continue;
|
|
391
401
|
}
|
|
402
|
+
mergeMediaByImportance(style, mediaKeyShort, subKey, mediaStyle[subKey], usedKeys, mediaState[mediaKeyShort], importanceBump), key === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
|
|
392
403
|
}
|
|
393
|
-
continue;
|
|
394
|
-
}
|
|
395
|
-
if (
|
|
396
|
-
// is HOC we can just pass through the styles as props
|
|
397
|
-
// this fixes issues where style prop got merged with wrong priority
|
|
398
|
-
!isHOC && isValidStyleKey(key, staticConfig)) {
|
|
399
|
-
mergeStyle(styleState, key, val);
|
|
400
|
-
continue;
|
|
401
404
|
}
|
|
402
|
-
|
|
405
|
+
continue;
|
|
403
406
|
}
|
|
404
|
-
if (
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
...transforms
|
|
411
|
-
}), log("viewProps", {
|
|
412
|
-
...viewProps
|
|
413
|
-
});
|
|
414
|
-
} catch {}
|
|
415
|
-
console.groupEnd();
|
|
407
|
+
if (
|
|
408
|
+
// is HOC we can just pass through the styles as props
|
|
409
|
+
// this fixes issues where style prop got merged with wrong priority
|
|
410
|
+
!isHOC && isValidStyleKey(key, staticConfig)) {
|
|
411
|
+
mergeStyle(styleState, key, val);
|
|
412
|
+
continue;
|
|
416
413
|
}
|
|
414
|
+
isVariant || (viewProps[key] = val);
|
|
415
|
+
}
|
|
416
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
417
|
+
try {
|
|
418
|
+
log(" \u2714\uFE0F expand complete", keyInit), log("style", {
|
|
419
|
+
...style
|
|
420
|
+
}), log("transforms", {
|
|
421
|
+
...transforms
|
|
422
|
+
}), log("viewProps", {
|
|
423
|
+
...viewProps
|
|
424
|
+
});
|
|
425
|
+
} catch {}
|
|
426
|
+
console.groupEnd();
|
|
417
427
|
}
|
|
418
428
|
}
|
|
419
|
-
if (
|
|
429
|
+
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));
|
|
420
430
|
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]) => {
|
|
421
431
|
mergeTransform(style, key, val, !0);
|
|
422
432
|
}), !staticConfig.isReactNative && !staticConfig.isHOC && !(styleProps.isAnimated && !conf.animations.supportsCSSVars) && Array.isArray(style.transform) && (style.transform = transformsToString(style.transform)), parentSplitStyles)) {
|
|
@@ -574,55 +584,14 @@ const animatableDefaults = {
|
|
|
574
584
|
x: "translateX",
|
|
575
585
|
y: "translateY"
|
|
576
586
|
},
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
componentName: 1,
|
|
585
|
-
disableOptimization: 1,
|
|
586
|
-
tag: 1,
|
|
587
|
-
style: 1,
|
|
588
|
-
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
589
|
-
group: 1
|
|
587
|
+
accessibilityRoleToWebRole = {
|
|
588
|
+
adjustable: "slider",
|
|
589
|
+
header: "heading",
|
|
590
|
+
image: "img",
|
|
591
|
+
link: "link",
|
|
592
|
+
none: "presentation",
|
|
593
|
+
summary: "region"
|
|
590
594
|
};
|
|
591
|
-
process.env.NODE_ENV === "test" && (skipProps["data-test-renders"] = 1);
|
|
592
|
-
process.env.NODE_ENV !== "production" && Object.assign(skipProps, {
|
|
593
|
-
accessibilityElementsHidden: 1,
|
|
594
|
-
accessibilityIgnoresInvertColors: 1,
|
|
595
|
-
accessibilityLanguage: 1,
|
|
596
|
-
adjustsFontSizeToFit: 1,
|
|
597
|
-
allowFontScaling: 1,
|
|
598
|
-
dataDetectorType: 1,
|
|
599
|
-
dynamicTypeRamp: 1,
|
|
600
|
-
elevationAndroid: 1,
|
|
601
|
-
hapticFeedback: 1,
|
|
602
|
-
importantForAccessibility: 1,
|
|
603
|
-
lineBreakStrategyIOS: 1,
|
|
604
|
-
maxFontSizeMultiplier: 1,
|
|
605
|
-
minimumFontScale: 1,
|
|
606
|
-
needsOffscreenAlphaCompositing: 1,
|
|
607
|
-
nextFocusDown: 1,
|
|
608
|
-
nextFocusForward: 1,
|
|
609
|
-
nextFocusLeft: 1,
|
|
610
|
-
nextFocusRight: 1,
|
|
611
|
-
nextFocusUp: 1,
|
|
612
|
-
onMagicTap: 1,
|
|
613
|
-
selectionColor: 1,
|
|
614
|
-
shouldRasterizeIOS: 1,
|
|
615
|
-
suppressHighlighting: 1,
|
|
616
|
-
textBreakStrategy: 1
|
|
617
|
-
});
|
|
618
|
-
const accessibilityRoleToWebRole = {
|
|
619
|
-
adjustable: "slider",
|
|
620
|
-
header: "heading",
|
|
621
|
-
image: "img",
|
|
622
|
-
link: "link",
|
|
623
|
-
none: "presentation",
|
|
624
|
-
summary: "region"
|
|
625
|
-
};
|
|
626
595
|
function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
|
|
627
596
|
if (shouldMergeObject) {
|
|
628
597
|
const next = {
|