@tamagui/web 1.107.0 → 1.108.0
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/helpers/createMediaStyle.js +22 -10
- package/dist/cjs/helpers/createMediaStyle.js.map +1 -1
- package/dist/cjs/helpers/createMediaStyle.native.js +16 -8
- package/dist/cjs/helpers/createMediaStyle.native.js.map +2 -2
- package/dist/cjs/helpers/getGroupPropParts.js.map +1 -1
- package/dist/cjs/helpers/getGroupPropParts.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +25 -20
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +328 -345
- package/dist/cjs/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +6 -1
- package/dist/cjs/helpers/getStylesAtomic.js.map +1 -1
- package/dist/cjs/helpers/isActivePlatform.js +29 -0
- package/dist/cjs/helpers/isActivePlatform.js.map +6 -0
- package/dist/cjs/helpers/isActivePlatform.native.js +34 -0
- package/dist/cjs/helpers/isActivePlatform.native.js.map +6 -0
- package/dist/cjs/helpers/transformsToString.js.map +1 -1
- package/dist/cjs/helpers/transformsToString.native.js.map +1 -1
- package/dist/esm/helpers/createMediaStyle.js +23 -11
- package/dist/esm/helpers/createMediaStyle.js.map +1 -1
- package/dist/esm/helpers/createMediaStyle.mjs +62 -60
- package/dist/esm/helpers/createMediaStyle.mjs.map +1 -1
- package/dist/esm/helpers/createMediaStyle.native.js +17 -9
- package/dist/esm/helpers/createMediaStyle.native.js.map +2 -2
- package/dist/esm/helpers/getGroupPropParts.js.map +1 -1
- package/dist/esm/helpers/getGroupPropParts.mjs.map +1 -1
- package/dist/esm/helpers/getGroupPropParts.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +25 -20
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +12 -10
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +329 -345
- package/dist/esm/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +6 -0
- package/dist/esm/helpers/getStylesAtomic.js.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.mjs +5 -1
- package/dist/esm/helpers/getStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/isActivePlatform.js +13 -0
- package/dist/esm/helpers/isActivePlatform.js.map +6 -0
- package/dist/esm/helpers/isActivePlatform.mjs +12 -0
- package/dist/esm/helpers/isActivePlatform.mjs.map +1 -0
- package/dist/esm/helpers/isActivePlatform.native.js +13 -0
- package/dist/esm/helpers/isActivePlatform.native.js.map +6 -0
- package/dist/esm/helpers/transformsToString.js.map +1 -1
- package/dist/esm/helpers/transformsToString.mjs.map +1 -1
- package/dist/esm/helpers/transformsToString.native.js.map +1 -1
- package/package.json +11 -11
- package/src/helpers/createMediaStyle.ts +39 -20
- package/src/helpers/getGroupPropParts.ts +3 -1
- package/src/helpers/getSplitStyles.tsx +32 -15
- package/src/helpers/getStylesAtomic.ts +9 -0
- package/src/helpers/isActivePlatform.ts +11 -0
- package/src/helpers/transformsToString.ts +0 -2
- package/src/types.tsx +15 -10
- package/types/helpers/createMediaStyle.d.ts.map +1 -1
- package/types/helpers/getGroupPropParts.d.ts +4 -3
- package/types/helpers/getGroupPropParts.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/isActivePlatform.d.ts +2 -0
- package/types/helpers/isActivePlatform.d.ts.map +1 -0
- package/types/helpers/transformsToString.d.ts.map +1 -1
- package/types/types.d.ts +3 -1
- package/types/types.d.ts.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isAndroid, isClient, isServer, isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
2
2
|
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, stylePropsText, stylePropsTransform, tokenCategories, validPseudoKeys, validStyles } from "@tamagui/helpers";
|
|
3
3
|
import { useInsertionEffect } from "react";
|
|
4
4
|
import { getConfig, getFont } from "../config";
|
|
@@ -17,6 +17,7 @@ import { getPropMappedFontFamily, propMapper } from "./propMapper";
|
|
|
17
17
|
import { pseudoDescriptors, pseudoPriorities } from "./pseudoDescriptors";
|
|
18
18
|
import { skipProps } from "./skipProps";
|
|
19
19
|
import { transformsToString } from "./transformsToString";
|
|
20
|
+
import { isActivePlatform } from "./isActivePlatform";
|
|
20
21
|
function _array_like_to_array(arr, len) {
|
|
21
22
|
(len == null || len > arr.length) && (len = arr.length);
|
|
22
23
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
@@ -102,6 +103,298 @@ function isValidStyleKey(key, staticConfig) {
|
|
|
102
103
|
return validStyleProps[key] || ((_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key]);
|
|
103
104
|
}
|
|
104
105
|
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug, skipThemeTokenResolution) {
|
|
106
|
+
var _loop = function(keyOg2) {
|
|
107
|
+
var _loop2 = function(i3) {
|
|
108
|
+
var _parentStaticConfig_variants;
|
|
109
|
+
if (expanded) {
|
|
110
|
+
var _expanded_i = _sliced_to_array(expanded[i3], 2), k = _expanded_i[0], v = _expanded_i[1];
|
|
111
|
+
key4 = k, val2 = v;
|
|
112
|
+
}
|
|
113
|
+
if (val2 == null || key4 in usedKeys) return "continue";
|
|
114
|
+
if (isPseudo = key4 in validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && isMediaKey(key4), isMediaOrPseudo1 = !!(isMedia || isPseudo), isVariant = variants && key4 in variants, inlineProps != null && inlineProps.has(key4) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened != null && inlineWhenUnflattened.has(key4))) {
|
|
115
|
+
var _props_key;
|
|
116
|
+
viewProps[key4] = (_props_key = props[key4]) !== null && _props_key !== void 0 ? _props_key : val2;
|
|
117
|
+
}
|
|
118
|
+
var shouldPassThrough2 = styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo1 || (parentStaticConfig == null || (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit]));
|
|
119
|
+
if (shouldPassThrough2)
|
|
120
|
+
return passDownProp(viewProps, key4, val2, isMediaOrPseudo1), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed(" - passing down prop ".concat(key4)), log({
|
|
121
|
+
val: val2,
|
|
122
|
+
after: _object_spread({}, viewProps[key4])
|
|
123
|
+
}), console.groupEnd()), "continue";
|
|
124
|
+
if (isPseudo) {
|
|
125
|
+
if (!val2) return "continue";
|
|
126
|
+
var pseudoStyleObject = getSubStyle(styleState, key4, val2, styleProps.noClassNames), descriptor = pseudoDescriptors[key4], isEnter = key4 === "enterStyle", isExit = key4 === "exitStyle";
|
|
127
|
+
if (!descriptor)
|
|
128
|
+
return "continue";
|
|
129
|
+
if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
|
|
130
|
+
var _pseudos, _key;
|
|
131
|
+
if (pseudos || (pseudos = {}), (_pseudos = pseudos)[_key = key4] || (_pseudos[_key] = {}), process.env.IS_STATIC === "is_static")
|
|
132
|
+
return Object.assign(pseudos[key4], pseudoStyleObject), "continue";
|
|
133
|
+
}
|
|
134
|
+
if (shouldDoClasses && !isExit) {
|
|
135
|
+
var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
|
|
136
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo (classes)", key4), log({
|
|
137
|
+
pseudoStyleObject,
|
|
138
|
+
pseudoStyles
|
|
139
|
+
}), console.groupEnd());
|
|
140
|
+
var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
|
|
141
|
+
try {
|
|
142
|
+
for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
|
143
|
+
var psuedoStyle = _step2.value, fullKey = "".concat(psuedoStyle[StyleObjectProperty]).concat(PROP_SPLIT).concat(descriptor.name);
|
|
144
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(transforms, classNames, fullKey, psuedoStyle[StyleObjectIdentifier], isMediaOrPseudo1, !0));
|
|
145
|
+
}
|
|
146
|
+
} catch (err) {
|
|
147
|
+
_didIteratorError2 = !0, _iteratorError2 = err;
|
|
148
|
+
} finally {
|
|
149
|
+
try {
|
|
150
|
+
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
|
151
|
+
} finally {
|
|
152
|
+
if (_didIteratorError2)
|
|
153
|
+
throw _iteratorError2;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (!shouldDoClasses || isExit || isEnter) {
|
|
158
|
+
var descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
|
|
159
|
+
isExit && (isDisabled = !styleProps.isExiting), isEnter && componentState.unmounted === !1 && (isDisabled = !0), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo", key4, {
|
|
160
|
+
isDisabled
|
|
161
|
+
}), log({
|
|
162
|
+
pseudoStyleObject,
|
|
163
|
+
isDisabled,
|
|
164
|
+
descriptor,
|
|
165
|
+
componentState
|
|
166
|
+
}), console.groupEnd());
|
|
167
|
+
var importance = descriptor.priority;
|
|
168
|
+
for (var pkey in pseudoStyleObject) {
|
|
169
|
+
var val12 = pseudoStyleObject[pkey];
|
|
170
|
+
if (isDisabled)
|
|
171
|
+
applyDefaultStyle(pkey, styleState);
|
|
172
|
+
else {
|
|
173
|
+
var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
174
|
+
if (shouldMerge) {
|
|
175
|
+
var _pseudos1, _key1;
|
|
176
|
+
pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key4] || (_pseudos1[_key1] = {}), pseudos[key4][pkey] = val12, mergeStyle(styleState, pkey, val12);
|
|
177
|
+
}
|
|
178
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && log(" subKey", pkey, shouldMerge, {
|
|
179
|
+
importance,
|
|
180
|
+
curImportance,
|
|
181
|
+
pkey,
|
|
182
|
+
val: val12
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (!isDisabled)
|
|
187
|
+
for (var key12 in val2) {
|
|
188
|
+
var k1 = shorthands[key12] || key12;
|
|
189
|
+
usedKeys[k1] = Math.max(importance, usedKeys[k1] || 0);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return "continue";
|
|
193
|
+
}
|
|
194
|
+
if (isMedia) {
|
|
195
|
+
if (!val2) return "continue";
|
|
196
|
+
var hasSpace = val2.space, mediaKeyShort = key4.slice(1);
|
|
197
|
+
if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && ((typeof hasMedia > "u" ? "undefined" : _type_of(hasMedia)) !== "object" && (hasMedia = {}), hasMedia[mediaKeyShort] = !0), isMedia === "platform" && !isActivePlatform(key4))
|
|
198
|
+
return "continue";
|
|
199
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F4FA} ".concat(key4), {
|
|
200
|
+
key: key4,
|
|
201
|
+
val: val2,
|
|
202
|
+
props,
|
|
203
|
+
shouldDoClasses,
|
|
204
|
+
acceptsClassName,
|
|
205
|
+
componentState,
|
|
206
|
+
mediaState
|
|
207
|
+
}), shouldDoClasses) {
|
|
208
|
+
var mediaStyle = getSubStyle(styleState, key4, val2, !1);
|
|
209
|
+
if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
|
|
210
|
+
var importance1 = getMediaImportanceIfMoreImportant(mediaKeyShort, "space", usedKeys, !0);
|
|
211
|
+
importance1 && (space = val2.space, usedKeys.space = importance1, process.env.NODE_ENV === "development" && debug === "verbose" && log("Found more important space for current media ".concat(mediaKeyShort, ": ").concat(val2, " (importance: ").concat(importance1, ")")));
|
|
212
|
+
}
|
|
213
|
+
var mediaStyles = getStylesAtomic(mediaStyle), priority = mediaStylesSeen;
|
|
214
|
+
mediaStylesSeen += 1;
|
|
215
|
+
var _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
|
|
216
|
+
try {
|
|
217
|
+
for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
|
|
218
|
+
var style3 = _step12.value, property = style3[0];
|
|
219
|
+
if (!(property[0] === "$" && property.startsWith("$platform") && !isActivePlatform(property))) {
|
|
220
|
+
var out = createMediaStyle(style3, mediaKeyShort, mediaQueryConfig, isMedia, !1, priority);
|
|
221
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && log("\u{1F4FA} media style:", out);
|
|
222
|
+
var fullKey1 = "".concat(style3[StyleObjectProperty]).concat(PROP_SPLIT).concat(mediaKeyShort).concat(style3[StyleObjectPseudo] || "");
|
|
223
|
+
fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey1, out[StyleObjectIdentifier], !0, !0));
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
} catch (err) {
|
|
227
|
+
_didIteratorError12 = !0, _iteratorError12 = err;
|
|
228
|
+
} finally {
|
|
229
|
+
try {
|
|
230
|
+
!_iteratorNormalCompletion12 && _iterator12.return != null && _iterator12.return();
|
|
231
|
+
} finally {
|
|
232
|
+
if (_didIteratorError12)
|
|
233
|
+
throw _iteratorError12;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
} else {
|
|
237
|
+
var mergeMediaStyle = function(key5, val3) {
|
|
238
|
+
var _styleState4;
|
|
239
|
+
(_styleState4 = styleState).style || (_styleState4.style = {});
|
|
240
|
+
var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, usedKeys, mediaState[mediaKeyShort], importanceBump, debug);
|
|
241
|
+
didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
|
|
242
|
+
}, isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
|
|
243
|
+
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
244
|
+
if (!mediaState[mediaKeyShort])
|
|
245
|
+
return process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F4FA} \u274C DISABLED ".concat(mediaKeyShort)), "continue";
|
|
246
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F4FA} \u2705 ENABLED ".concat(mediaKeyShort));
|
|
247
|
+
}
|
|
248
|
+
var mediaStyle1 = getSubStyle(styleState, key4, val2, !0), importanceBump = 0;
|
|
249
|
+
if (isThemeMedia) {
|
|
250
|
+
dynamicThemeAccess = !0;
|
|
251
|
+
var mediaThemeName = mediaKeyShort.slice(6);
|
|
252
|
+
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName)))
|
|
253
|
+
return "continue";
|
|
254
|
+
} else if (isGroupMedia) {
|
|
255
|
+
var _componentState_group, groupInfo = getGroupPropParts(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
|
|
256
|
+
if (!groupContext)
|
|
257
|
+
return process.env.NODE_ENV === "development" && debug && log("No parent with group prop, skipping styles: ".concat(groupName)), "continue";
|
|
258
|
+
var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
|
|
259
|
+
if (groupMediaKey) {
|
|
260
|
+
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
|
|
261
|
+
var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
|
|
262
|
+
if (!mediaState1 && groupContext.layout && (isActive = mediaKeyMatch(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F3D8}\uFE0F GROUP media ".concat(groupMediaKey, " active? ").concat(isActive)), !isActive) {
|
|
263
|
+
for (var pkey1 in mediaStyle1)
|
|
264
|
+
applyDefaultStyle(pkey1, styleState);
|
|
265
|
+
return "continue";
|
|
266
|
+
}
|
|
267
|
+
importanceBump = 2;
|
|
268
|
+
}
|
|
269
|
+
if (groupPseudoKey) {
|
|
270
|
+
pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
|
|
271
|
+
var componentGroupPseudoState = (componentGroupState || // fallback to context initially
|
|
272
|
+
context.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = pseudoPriorities[groupPseudoKey];
|
|
273
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F3D8}\uFE0F GROUP pseudo ".concat(groupMediaKey, " active? ").concat(isActive1, ", priority ").concat(priority1)), !isActive1) {
|
|
274
|
+
for (var pkey2 in mediaStyle1)
|
|
275
|
+
applyDefaultStyle(pkey2, styleState);
|
|
276
|
+
return "continue";
|
|
277
|
+
}
|
|
278
|
+
importanceBump = priority1;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
for (var subKey in mediaStyle1) {
|
|
282
|
+
if (subKey === "space") {
|
|
283
|
+
space = valInit.space;
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
if (subKey[0] === "$") {
|
|
287
|
+
if (!isActivePlatform(subKey))
|
|
288
|
+
continue;
|
|
289
|
+
for (var subSubKey in mediaStyle1[subKey])
|
|
290
|
+
mergeMediaStyle(subSubKey, mediaStyle1[subKey][subSubKey]);
|
|
291
|
+
} else
|
|
292
|
+
mergeMediaStyle(subKey, mediaStyle1[subKey]);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return "continue";
|
|
296
|
+
}
|
|
297
|
+
if (key4 === "pointerEvents")
|
|
298
|
+
return viewProps[key4] = val2, "continue";
|
|
299
|
+
if (
|
|
300
|
+
// is HOC we can just pass through the styles as props
|
|
301
|
+
// this fixes issues where style prop got merged with wrong priority
|
|
302
|
+
!isHOC && (isValidStyleKey(key4, staticConfig) || isAndroid && key4 === "elevation")
|
|
303
|
+
)
|
|
304
|
+
return mergeStyle(styleState, key4, val2), "continue";
|
|
305
|
+
isVariant || (viewProps[key4] = val2);
|
|
306
|
+
}, keyInit = keyOg2, valInit = props[keyInit];
|
|
307
|
+
if (accept) {
|
|
308
|
+
var accepted = accept[keyInit];
|
|
309
|
+
if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit > "u" ? "undefined" : _type_of(valInit)) === "object")
|
|
310
|
+
return viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClassNames), "continue";
|
|
311
|
+
}
|
|
312
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd(), disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys) return "continue";
|
|
313
|
+
if (keyInit in skipProps && !noSkip && !isHOC) {
|
|
314
|
+
if (keyInit === "group" && 0)
|
|
315
|
+
var identifier2, containerType, containerCSS;
|
|
316
|
+
return "continue";
|
|
317
|
+
}
|
|
318
|
+
var valInitType = typeof valInit > "u" ? "undefined" : _type_of(valInit), isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
319
|
+
if (0 && isValidStyleKeyInit && valInitType === "string" && valInit[0] === "_") {
|
|
320
|
+
var isValidClassName, isMediaOrPseudo;
|
|
321
|
+
if ((isValidClassName || isMediaOrPseudo) && !shouldDoClasses)
|
|
322
|
+
var _styleState3;
|
|
323
|
+
}
|
|
324
|
+
if (!isValidStyleKeyInit) {
|
|
325
|
+
if (!isAndroid && keyInit === "elevationAndroid")
|
|
326
|
+
return "continue";
|
|
327
|
+
if (keyInit === "userSelect")
|
|
328
|
+
keyInit = "selectable", valInit = valInit !== "none";
|
|
329
|
+
else if (keyInit.startsWith("data-"))
|
|
330
|
+
return "continue";
|
|
331
|
+
}
|
|
332
|
+
if (keyInit === "dataSet") {
|
|
333
|
+
for (var keyInit1 in valInit)
|
|
334
|
+
viewProps["data-".concat(hyphenate(keyInit1))] = valInit[keyInit1];
|
|
335
|
+
return "continue";
|
|
336
|
+
}
|
|
337
|
+
if (0 && !noExpand)
|
|
338
|
+
var didUseKeyInit;
|
|
339
|
+
var isShorthand = keyInit in shorthands, isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant, isPseudo = keyInit in validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && isMediaKey(keyInit), isMediaOrPseudo1 = !!(isMedia || isPseudo);
|
|
340
|
+
if (isMediaOrPseudo1 && keyInit.startsWith("$group-")) {
|
|
341
|
+
var name2 = keyInit.split("-")[1];
|
|
342
|
+
context != null && context.groups.subscribe && !(context != null && context.groups.state[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
|
|
343
|
+
}
|
|
344
|
+
var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo1 || isVariant && !noExpand || isShorthand;
|
|
345
|
+
if (isStyleProp && (asChild === "except-style" || asChild === "except-style-web"))
|
|
346
|
+
return "continue";
|
|
347
|
+
var shouldPassProp = !isStyleProp || // is in parent variants
|
|
348
|
+
isHOC && parentVariants && keyInit in parentVariants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = parentVariants == null ? void 0 : parentVariants[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo1 || parentVariant || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
349
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupEnd(), console.groupEnd(), consoleGroupCollapsed(" \u{1F511} ".concat(keyOg2).concat(keyInit !== keyOg2 ? " (shorthand for ".concat(keyInit, ")") : "", " ").concat(shouldPassThrough ? "(pass)" : "")), log({
|
|
350
|
+
isVariant,
|
|
351
|
+
valInit,
|
|
352
|
+
shouldPassProp
|
|
353
|
+
}), isClient && log({
|
|
354
|
+
variants,
|
|
355
|
+
variant: variants == null ? void 0 : variants[keyInit],
|
|
356
|
+
isVariant,
|
|
357
|
+
isHOCShouldPassThrough,
|
|
358
|
+
curProps: _object_spread({}, styleState.curProps),
|
|
359
|
+
parentStaticConfig
|
|
360
|
+
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant) || !noSkip && keyInit in skipProps)
|
|
361
|
+
return process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd(), "continue";
|
|
362
|
+
(isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
|
|
363
|
+
var avoidPropMap = isMediaOrPseudo1 || !isVariant && !isValidStyleKeyInit, expanded = avoidPropMap ? null : propMapper(keyInit, valInit, styleState);
|
|
364
|
+
if (!avoidPropMap) {
|
|
365
|
+
if (!expanded) return "continue";
|
|
366
|
+
var next = getPropMappedFontFamily(expanded);
|
|
367
|
+
next && (styleState.fontFamily = next);
|
|
368
|
+
}
|
|
369
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
370
|
+
consoleGroupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
371
|
+
try {
|
|
372
|
+
!isServer && isDevTools && (log({
|
|
373
|
+
expanded,
|
|
374
|
+
styleProps,
|
|
375
|
+
componentState,
|
|
376
|
+
isVariant,
|
|
377
|
+
variant: variants == null ? void 0 : variants[keyInit],
|
|
378
|
+
shouldPassProp,
|
|
379
|
+
isHOCShouldPassThrough,
|
|
380
|
+
usedKeys: _object_spread({}, usedKeys),
|
|
381
|
+
curProps: _object_spread({}, styleState.curProps)
|
|
382
|
+
}), log("expanded", expanded, `
|
|
383
|
+
usedKeys`, _object_spread({}, usedKeys), `
|
|
384
|
+
current`, _object_spread({}, styleState.style)));
|
|
385
|
+
} catch {
|
|
386
|
+
}
|
|
387
|
+
console.groupEnd();
|
|
388
|
+
}
|
|
389
|
+
for (var key4 = keyInit, val2 = valInit, max = expanded ? expanded.length : 1, i2 = 0; i2 < max; i2++) _loop2(i2);
|
|
390
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
391
|
+
try {
|
|
392
|
+
log(" \u2714\uFE0F expand complete", keyInit), log("style", _object_spread({}, styleState.style)), log("transforms", _object_spread({}, transforms)), log("viewProps", _object_spread({}, viewProps));
|
|
393
|
+
} catch {
|
|
394
|
+
}
|
|
395
|
+
console.groupEnd();
|
|
396
|
+
}
|
|
397
|
+
};
|
|
105
398
|
conf = conf || getConfig(), isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
106
399
|
var shorthands = conf.shorthands, isHOC = staticConfig.isHOC, isText = staticConfig.isText, isInput = staticConfig.isInput, variants = staticConfig.variants, isReactNative = staticConfig.isReactNative, inlineProps = staticConfig.inlineProps, inlineWhenUnflattened = staticConfig.inlineWhenUnflattened, parentStaticConfig = staticConfig.parentStaticConfig, acceptsClassName = staticConfig.acceptsClassName, viewProps = {}, mediaState = styleProps.mediaState || globalMediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && isWeb && !styleProps.noClassNames, rulesToInsert = void 0, classNames = {}, transforms = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, curPropsState, styleState = {
|
|
107
400
|
// this should go away, right now we're doing really crazy cumulative props,
|
|
@@ -137,336 +430,27 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
137
430
|
theme: _object_spread({}, theme)
|
|
138
431
|
}), console.groupEnd());
|
|
139
432
|
var asChild = props.asChild, accept = staticConfig.accept, noSkip = styleProps.noSkip, disableExpandShorthands = styleProps.disableExpandShorthands, noExpand = styleProps.noExpand, webContainerType = conf.settings.webContainerType, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
|
|
140
|
-
for (var keyOg in props)
|
|
141
|
-
var keyInit = keyOg, valInit = props[keyInit];
|
|
142
|
-
if (accept) {
|
|
143
|
-
var accepted = accept[keyInit];
|
|
144
|
-
if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit > "u" ? "undefined" : _type_of(valInit)) === "object") {
|
|
145
|
-
viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClassNames);
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd(), disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit !== "className" && !(keyInit in usedKeys)) {
|
|
150
|
-
if (keyInit in skipProps && !noSkip && !isHOC) {
|
|
151
|
-
if (keyInit === "group" && 0)
|
|
152
|
-
var identifier, containerType, containerCSS;
|
|
153
|
-
continue;
|
|
154
|
-
}
|
|
155
|
-
var valInitType = typeof valInit > "u" ? "undefined" : _type_of(valInit), isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
156
|
-
if (0 && isValidStyleKeyInit && valInitType === "string" && valInit[0] === "_") {
|
|
157
|
-
var isValidClassName, isMediaOrPseudo;
|
|
158
|
-
if ((isValidClassName || isMediaOrPseudo) && !shouldDoClasses)
|
|
159
|
-
var _styleState;
|
|
160
|
-
}
|
|
161
|
-
if (!isValidStyleKeyInit) {
|
|
162
|
-
if (!isAndroid && keyInit === "elevationAndroid")
|
|
163
|
-
continue;
|
|
164
|
-
if (keyInit === "userSelect")
|
|
165
|
-
keyInit = "selectable", valInit = valInit !== "none";
|
|
166
|
-
else if (keyInit.startsWith("data-"))
|
|
167
|
-
continue;
|
|
168
|
-
}
|
|
169
|
-
if (keyInit === "dataSet") {
|
|
170
|
-
for (var keyInit1 in valInit)
|
|
171
|
-
viewProps["data-".concat(hyphenate(keyInit1))] = valInit[keyInit1];
|
|
172
|
-
continue;
|
|
173
|
-
}
|
|
174
|
-
if (0 && !noExpand)
|
|
175
|
-
var didUseKeyInit;
|
|
176
|
-
var isShorthand = keyInit in shorthands, isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant, isPseudo = keyInit in validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && isMediaKey(keyInit), isMediaOrPseudo1 = !!(isMedia || isPseudo);
|
|
177
|
-
if (isMediaOrPseudo1 && keyInit.startsWith("$group-")) {
|
|
178
|
-
var name = keyInit.split("-")[1];
|
|
179
|
-
context != null && context.groups.subscribe && !(context != null && context.groups.state[name]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
|
|
180
|
-
}
|
|
181
|
-
var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo1 || isVariant && !noExpand || isShorthand;
|
|
182
|
-
if (!(isStyleProp && (asChild === "except-style" || asChild === "except-style-web"))) {
|
|
183
|
-
var shouldPassProp = !isStyleProp || // is in parent variants
|
|
184
|
-
isHOC && parentVariants && keyInit in parentVariants || (inlineProps == null ? void 0 : inlineProps.has(keyInit)), parentVariant = parentVariants == null ? void 0 : parentVariants[keyInit], isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo1 || parentVariant || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
185
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupEnd(), console.groupEnd(), consoleGroupCollapsed(" \u{1F511} ".concat(keyOg).concat(keyInit !== keyOg ? " (shorthand for ".concat(keyInit, ")") : "", " ").concat(shouldPassThrough ? "(pass)" : "")), log({
|
|
186
|
-
isVariant,
|
|
187
|
-
valInit,
|
|
188
|
-
shouldPassProp
|
|
189
|
-
}), isClient && log({
|
|
190
|
-
variants,
|
|
191
|
-
variant: variants == null ? void 0 : variants[keyInit],
|
|
192
|
-
isVariant,
|
|
193
|
-
isHOCShouldPassThrough,
|
|
194
|
-
curProps: _object_spread({}, styleState.curProps),
|
|
195
|
-
parentStaticConfig
|
|
196
|
-
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant)) {
|
|
197
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
if (!noSkip && keyInit in skipProps) {
|
|
201
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
|
|
202
|
-
continue;
|
|
203
|
-
}
|
|
204
|
-
(isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
|
|
205
|
-
var avoidPropMap = isMediaOrPseudo1 || !isVariant && !isValidStyleKeyInit, expanded = avoidPropMap ? null : propMapper(keyInit, valInit, styleState);
|
|
206
|
-
if (!avoidPropMap) {
|
|
207
|
-
if (!expanded) continue;
|
|
208
|
-
var next = getPropMappedFontFamily(expanded);
|
|
209
|
-
next && (styleState.fontFamily = next);
|
|
210
|
-
}
|
|
211
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
212
|
-
consoleGroupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
213
|
-
try {
|
|
214
|
-
!isServer && isDevTools && (log({
|
|
215
|
-
expanded,
|
|
216
|
-
styleProps,
|
|
217
|
-
componentState,
|
|
218
|
-
isVariant,
|
|
219
|
-
variant: variants == null ? void 0 : variants[keyInit],
|
|
220
|
-
shouldPassProp,
|
|
221
|
-
isHOCShouldPassThrough,
|
|
222
|
-
usedKeys: _object_spread({}, usedKeys),
|
|
223
|
-
curProps: _object_spread({}, styleState.curProps)
|
|
224
|
-
}), log("expanded", expanded, `
|
|
225
|
-
usedKeys`, _object_spread({}, usedKeys), `
|
|
226
|
-
current`, _object_spread({}, styleState.style)));
|
|
227
|
-
} catch {
|
|
228
|
-
}
|
|
229
|
-
console.groupEnd();
|
|
230
|
-
}
|
|
231
|
-
for (var key = keyInit, val = valInit, max = expanded ? expanded.length : 1, i = 0; i < max; i++) {
|
|
232
|
-
var _parentStaticConfig_variants;
|
|
233
|
-
if (expanded) {
|
|
234
|
-
var _expanded_i = _sliced_to_array(expanded[i], 2), k = _expanded_i[0], v = _expanded_i[1];
|
|
235
|
-
key = k, val = v;
|
|
236
|
-
}
|
|
237
|
-
if (val != null && !(key in usedKeys)) {
|
|
238
|
-
if (isPseudo = key in validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && isMediaKey(key), isMediaOrPseudo1 = !!(isMedia || isPseudo), isVariant = variants && key in variants, inlineProps != null && inlineProps.has(key) || process.env.IS_STATIC === "is_static" && (inlineWhenUnflattened != null && inlineWhenUnflattened.has(key))) {
|
|
239
|
-
var _props_key;
|
|
240
|
-
viewProps[key] = (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : val;
|
|
241
|
-
}
|
|
242
|
-
var shouldPassThrough1 = styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo1 || (parentStaticConfig == null || (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit]));
|
|
243
|
-
if (shouldPassThrough1) {
|
|
244
|
-
passDownProp(viewProps, key, val, isMediaOrPseudo1), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed(" - passing down prop ".concat(key)), log({
|
|
245
|
-
val,
|
|
246
|
-
after: _object_spread({}, viewProps[key])
|
|
247
|
-
}), console.groupEnd());
|
|
248
|
-
continue;
|
|
249
|
-
}
|
|
250
|
-
if (isPseudo) {
|
|
251
|
-
if (!val) continue;
|
|
252
|
-
var pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClassNames), descriptor = pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
|
|
253
|
-
if (!descriptor)
|
|
254
|
-
continue;
|
|
255
|
-
if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
|
|
256
|
-
var _pseudos, _key;
|
|
257
|
-
if (pseudos || (pseudos = {}), (_pseudos = pseudos)[_key = key] || (_pseudos[_key] = {}), process.env.IS_STATIC === "is_static") {
|
|
258
|
-
Object.assign(pseudos[key], pseudoStyleObject);
|
|
259
|
-
continue;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
if (shouldDoClasses && !isExit) {
|
|
263
|
-
var pseudoStyles = getStyleAtomic(pseudoStyleObject, descriptor);
|
|
264
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo (classes)", key), log({
|
|
265
|
-
pseudoStyleObject,
|
|
266
|
-
pseudoStyles
|
|
267
|
-
}), console.groupEnd());
|
|
268
|
-
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
269
|
-
try {
|
|
270
|
-
for (var _iterator = pseudoStyles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
271
|
-
var psuedoStyle = _step.value, fullKey = "".concat(psuedoStyle[StyleObjectProperty]).concat(PROP_SPLIT).concat(descriptor.name);
|
|
272
|
-
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(transforms, classNames, fullKey, psuedoStyle[StyleObjectIdentifier], isMediaOrPseudo1, !0));
|
|
273
|
-
}
|
|
274
|
-
} catch (err) {
|
|
275
|
-
_didIteratorError = !0, _iteratorError = err;
|
|
276
|
-
} finally {
|
|
277
|
-
try {
|
|
278
|
-
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
279
|
-
} finally {
|
|
280
|
-
if (_didIteratorError)
|
|
281
|
-
throw _iteratorError;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
if (!shouldDoClasses || isExit || isEnter) {
|
|
286
|
-
var descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
|
|
287
|
-
isExit && (isDisabled = !styleProps.isExiting), isEnter && componentState.unmounted === !1 && (isDisabled = !0), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo", key, {
|
|
288
|
-
isDisabled
|
|
289
|
-
}), log({
|
|
290
|
-
pseudoStyleObject,
|
|
291
|
-
isDisabled,
|
|
292
|
-
descriptor,
|
|
293
|
-
componentState
|
|
294
|
-
}), console.groupEnd());
|
|
295
|
-
var importance = descriptor.priority;
|
|
296
|
-
for (var pkey in pseudoStyleObject) {
|
|
297
|
-
var val1 = pseudoStyleObject[pkey];
|
|
298
|
-
if (isDisabled)
|
|
299
|
-
applyDefaultStyle(pkey, styleState);
|
|
300
|
-
else {
|
|
301
|
-
var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
302
|
-
if (shouldMerge) {
|
|
303
|
-
var _pseudos1, _key1;
|
|
304
|
-
pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key] || (_pseudos1[_key1] = {}), pseudos[key][pkey] = val1, mergeStyle(styleState, pkey, val1);
|
|
305
|
-
}
|
|
306
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && log(" subKey", pkey, shouldMerge, {
|
|
307
|
-
importance,
|
|
308
|
-
curImportance,
|
|
309
|
-
pkey,
|
|
310
|
-
val: val1
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
if (!isDisabled)
|
|
315
|
-
for (var key1 in val) {
|
|
316
|
-
var k1 = shorthands[key1] || key1;
|
|
317
|
-
usedKeys[k1] = Math.max(importance, usedKeys[k1] || 0);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
if (isMedia) {
|
|
323
|
-
if (!val) continue;
|
|
324
|
-
var hasSpace = val.space, mediaKeyShort = key.slice(1);
|
|
325
|
-
if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && ((typeof hasMedia > "u" ? "undefined" : _type_of(hasMedia)) !== "object" && (hasMedia = {}), hasMedia[mediaKeyShort] = !0), isMedia === "platform") {
|
|
326
|
-
var platform = key.slice(10);
|
|
327
|
-
if (
|
|
328
|
-
// supports web, ios, android
|
|
329
|
-
platform !== currentPlatform && // supports web, native
|
|
330
|
-
platform !== "native"
|
|
331
|
-
)
|
|
332
|
-
continue;
|
|
333
|
-
}
|
|
334
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F4FA} ".concat(key), {
|
|
335
|
-
key,
|
|
336
|
-
val,
|
|
337
|
-
props,
|
|
338
|
-
shouldDoClasses,
|
|
339
|
-
acceptsClassName,
|
|
340
|
-
componentState,
|
|
341
|
-
mediaState
|
|
342
|
-
}), shouldDoClasses) {
|
|
343
|
-
var mediaStyle = getSubStyle(styleState, key, val, !1);
|
|
344
|
-
if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
|
|
345
|
-
var importance1 = getMediaImportanceIfMoreImportant(mediaKeyShort, "space", usedKeys, !0);
|
|
346
|
-
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, ")")));
|
|
347
|
-
}
|
|
348
|
-
var mediaStyles = getStylesAtomic(mediaStyle), priority = mediaStylesSeen;
|
|
349
|
-
mediaStylesSeen += 1;
|
|
350
|
-
var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
|
|
351
|
-
try {
|
|
352
|
-
for (var _iterator1 = mediaStyles[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
|
|
353
|
-
var style = _step1.value, out = createMediaStyle(style, mediaKeyShort, mediaQueryConfig, isMedia, !1, priority);
|
|
354
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && log("\u{1F4FA} media style:", out);
|
|
355
|
-
var fullKey1 = "".concat(style[StyleObjectProperty]).concat(PROP_SPLIT).concat(mediaKeyShort).concat(style[StyleObjectPseudo] || "");
|
|
356
|
-
fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey1, out[StyleObjectIdentifier], !0, !0));
|
|
357
|
-
}
|
|
358
|
-
} catch (err) {
|
|
359
|
-
_didIteratorError1 = !0, _iteratorError1 = err;
|
|
360
|
-
} finally {
|
|
361
|
-
try {
|
|
362
|
-
!_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
|
|
363
|
-
} finally {
|
|
364
|
-
if (_didIteratorError1)
|
|
365
|
-
throw _iteratorError1;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
} else {
|
|
369
|
-
var isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
|
|
370
|
-
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
371
|
-
if (!mediaState[mediaKeyShort]) {
|
|
372
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F4FA} \u274C DISABLED ".concat(mediaKeyShort));
|
|
373
|
-
continue;
|
|
374
|
-
}
|
|
375
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F4FA} \u2705 ENABLED ".concat(mediaKeyShort));
|
|
376
|
-
}
|
|
377
|
-
var mediaStyle1 = getSubStyle(styleState, key, val, !0), importanceBump = 0;
|
|
378
|
-
if (isThemeMedia) {
|
|
379
|
-
dynamicThemeAccess = !0;
|
|
380
|
-
var mediaThemeName = mediaKeyShort.slice(6);
|
|
381
|
-
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName)))
|
|
382
|
-
continue;
|
|
383
|
-
} else if (isGroupMedia) {
|
|
384
|
-
var _componentState_group, groupInfo = getGroupPropParts(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
|
|
385
|
-
if (!groupContext) {
|
|
386
|
-
process.env.NODE_ENV === "development" && debug && log("No parent with group prop, skipping styles: ".concat(groupName));
|
|
387
|
-
continue;
|
|
388
|
-
}
|
|
389
|
-
var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
|
|
390
|
-
if (groupMediaKey) {
|
|
391
|
-
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
|
|
392
|
-
var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
|
|
393
|
-
if (!mediaState1 && groupContext.layout && (isActive = mediaKeyMatch(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F3D8}\uFE0F GROUP media ".concat(groupMediaKey, " active? ").concat(isActive)), !isActive) {
|
|
394
|
-
for (var pkey1 in mediaStyle1)
|
|
395
|
-
applyDefaultStyle(pkey1, styleState);
|
|
396
|
-
continue;
|
|
397
|
-
}
|
|
398
|
-
importanceBump = 2;
|
|
399
|
-
}
|
|
400
|
-
if (groupPseudoKey) {
|
|
401
|
-
pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
|
|
402
|
-
var componentGroupPseudoState = (componentGroupState || // fallback to context initially
|
|
403
|
-
context.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = pseudoPriorities[groupPseudoKey];
|
|
404
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F3D8}\uFE0F GROUP pseudo ".concat(groupMediaKey, " active? ").concat(isActive1, ", priority ").concat(priority1)), !isActive1) {
|
|
405
|
-
for (var pkey2 in mediaStyle1)
|
|
406
|
-
applyDefaultStyle(pkey2, styleState);
|
|
407
|
-
continue;
|
|
408
|
-
}
|
|
409
|
-
importanceBump = priority1;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
for (var subKey in mediaStyle1) {
|
|
413
|
-
var _styleState1;
|
|
414
|
-
if (subKey === "space") {
|
|
415
|
-
space = valInit.space;
|
|
416
|
-
continue;
|
|
417
|
-
}
|
|
418
|
-
(_styleState1 = styleState).style || (_styleState1.style = {});
|
|
419
|
-
var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, subKey, mediaStyle1[subKey], usedKeys, mediaState[mediaKeyShort], importanceBump, debug);
|
|
420
|
-
didMerge && key === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
continue;
|
|
424
|
-
}
|
|
425
|
-
if (key === "pointerEvents") {
|
|
426
|
-
viewProps[key] = val;
|
|
427
|
-
continue;
|
|
428
|
-
}
|
|
429
|
-
if (
|
|
430
|
-
// is HOC we can just pass through the styles as props
|
|
431
|
-
// this fixes issues where style prop got merged with wrong priority
|
|
432
|
-
!isHOC && (isValidStyleKey(key, staticConfig) || isAndroid && key === "elevation")
|
|
433
|
-
) {
|
|
434
|
-
mergeStyle(styleState, key, val);
|
|
435
|
-
continue;
|
|
436
|
-
}
|
|
437
|
-
isVariant || (viewProps[key] = val);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
441
|
-
try {
|
|
442
|
-
log(" \u2714\uFE0F expand complete", keyInit), log("style", _object_spread({}, styleState.style)), log("transforms", _object_spread({}, transforms)), log("viewProps", _object_spread({}, viewProps));
|
|
443
|
-
} catch {
|
|
444
|
-
}
|
|
445
|
-
console.groupEnd();
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
}
|
|
433
|
+
for (var keyOg in props) _loop(keyOg);
|
|
450
434
|
var avoidNormalize = styleProps.noNormalize === !1;
|
|
451
435
|
if (!avoidNormalize) {
|
|
452
436
|
if (styleState.style && (fixStyles(styleState.style), isWeb && !isReactNative && styleToCSS(styleState.style)), styleState.flatTransforms) {
|
|
453
|
-
var
|
|
454
|
-
(
|
|
437
|
+
var _styleState;
|
|
438
|
+
(_styleState = styleState).style || (_styleState.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
|
|
455
439
|
var _param = _sliced_to_array(param, 1), a = _param[0], _param1 = _sliced_to_array(param1, 1), b = _param1[0];
|
|
456
440
|
return a.localeCompare(b);
|
|
457
441
|
}).forEach(function(param) {
|
|
458
|
-
var _param = _sliced_to_array(param, 2),
|
|
459
|
-
mergeTransform(styleState.style,
|
|
442
|
+
var _param = _sliced_to_array(param, 2), key4 = _param[0], val2 = _param[1];
|
|
443
|
+
mergeTransform(styleState.style, key4, val2, !0);
|
|
460
444
|
});
|
|
461
445
|
}
|
|
462
446
|
if (parentSplitStyles) {
|
|
463
447
|
if (0 && shouldDoClasses)
|
|
464
|
-
for (var
|
|
465
|
-
var
|
|
448
|
+
for (var key in parentSplitStyles.classNames)
|
|
449
|
+
var val;
|
|
466
450
|
if (!shouldDoClasses)
|
|
467
|
-
for (var
|
|
468
|
-
var
|
|
469
|
-
|
|
451
|
+
for (var key1 in parentSplitStyles.style) {
|
|
452
|
+
var _styleState1;
|
|
453
|
+
key1 in classNames || styleState.style && key1 in styleState.style || ((_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key1] = parentSplitStyles.style[key1]);
|
|
470
454
|
}
|
|
471
455
|
}
|
|
472
456
|
}
|
|
@@ -476,10 +460,10 @@ current`, _object_spread({}, styleState.style)));
|
|
|
476
460
|
if (styleState.style && shouldDoClasses) {
|
|
477
461
|
var retainedStyles, shouldRetain;
|
|
478
462
|
if (!styleState.style.$$css) {
|
|
479
|
-
var atomic,
|
|
463
|
+
var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
|
|
480
464
|
try {
|
|
481
|
-
for (var
|
|
482
|
-
var atomicStyle, _props_animateOnly, _atomicStyle,
|
|
465
|
+
for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)
|
|
466
|
+
var atomicStyle, _props_animateOnly, _atomicStyle, key2, value, identifier, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
|
|
483
467
|
} catch (err) {
|
|
484
468
|
} finally {
|
|
485
469
|
try {
|
|
@@ -489,8 +473,8 @@ current`, _object_spread({}, styleState.style)));
|
|
|
489
473
|
}
|
|
490
474
|
if (transforms)
|
|
491
475
|
for (var namespace in transforms) {
|
|
492
|
-
var _transforms_namespace, hash,
|
|
493
|
-
if (isClient && !insertedTransforms[
|
|
476
|
+
var _transforms_namespace, hash, val1, identifier1;
|
|
477
|
+
if (isClient && !insertedTransforms[identifier1])
|
|
494
478
|
var rule;
|
|
495
479
|
}
|
|
496
480
|
}
|
|
@@ -505,24 +489,24 @@ current`, _object_spread({}, styleState.style)));
|
|
|
505
489
|
if (isHOC)
|
|
506
490
|
viewProps.style = normalizeStyle(styleProp);
|
|
507
491
|
else
|
|
508
|
-
for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1,
|
|
509
|
-
var
|
|
510
|
-
if (
|
|
511
|
-
if (
|
|
512
|
-
Object.assign(styleState.classNames,
|
|
492
|
+
for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1, i = 0; i < len; i++) {
|
|
493
|
+
var style = isArray ? styleProp[i] : styleProp;
|
|
494
|
+
if (style)
|
|
495
|
+
if (style.$$css)
|
|
496
|
+
Object.assign(styleState.classNames, style);
|
|
513
497
|
else {
|
|
514
|
-
var
|
|
515
|
-
(
|
|
498
|
+
var _styleState2;
|
|
499
|
+
(_styleState2 = styleState).style || (_styleState2.style = {}), Object.assign(styleState.style, normalizeStyle(style));
|
|
516
500
|
}
|
|
517
501
|
}
|
|
518
|
-
var
|
|
519
|
-
if (
|
|
520
|
-
var _getFont, faceInfo = (_getFont = getFont(
|
|
502
|
+
var style1 = styleState.style;
|
|
503
|
+
if (style1 != null && style1.fontFamily) {
|
|
504
|
+
var _getFont, faceInfo = (_getFont = getFont(style1.fontFamily)) === null || _getFont === void 0 ? void 0 : _getFont.face;
|
|
521
505
|
if (faceInfo) {
|
|
522
|
-
var _faceInfo_style_fontWeight_, _faceInfo_style_fontWeight, overrideFace = (_faceInfo_style_fontWeight = faceInfo[
|
|
523
|
-
overrideFace && (
|
|
506
|
+
var _faceInfo_style_fontWeight_, _faceInfo_style_fontWeight, overrideFace = (_faceInfo_style_fontWeight = faceInfo[style1.fontWeight]) === null || _faceInfo_style_fontWeight === void 0 || (_faceInfo_style_fontWeight_ = _faceInfo_style_fontWeight[style1.fontStyle || "normal"]) === null || _faceInfo_style_fontWeight_ === void 0 ? void 0 : _faceInfo_style_fontWeight_.val;
|
|
507
|
+
overrideFace && (style1.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style1.fontWeight, delete style1.fontStyle);
|
|
524
508
|
}
|
|
525
|
-
process.env.NODE_ENV === "development" && debug && debug !== "profile" && log("Found fontFamily native: ".concat(
|
|
509
|
+
process.env.NODE_ENV === "development" && debug && debug !== "profile" && log("Found fontFamily native: ".concat(style1.fontFamily), faceInfo);
|
|
526
510
|
}
|
|
527
511
|
var result = {
|
|
528
512
|
space,
|
|
@@ -538,16 +522,16 @@ current`, _object_spread({}, styleState.style)));
|
|
|
538
522
|
mediaGroups
|
|
539
523
|
}, asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
540
524
|
if (!asChildExceptStyleLike) {
|
|
541
|
-
var
|
|
525
|
+
var style2 = styleState.style;
|
|
542
526
|
if (0) {
|
|
543
527
|
var _staticConfig_defaultProps, fontFamily, fontFamilyClassName, groupClassName, componentNameFinal, componentClassName, classList, finalClassName;
|
|
544
528
|
if (!styleProps.noMergeStyle) {
|
|
545
529
|
if (!(styleProps.isAnimated && !conf.animations.supportsCSSVars && isReactNative)) {
|
|
546
530
|
if (isReactNative) {
|
|
547
|
-
var cnStyles,
|
|
531
|
+
var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
|
|
548
532
|
try {
|
|
549
|
-
for (var
|
|
550
|
-
var
|
|
533
|
+
for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0)
|
|
534
|
+
var name;
|
|
551
535
|
} catch (err) {
|
|
552
536
|
} finally {
|
|
553
537
|
try {
|
|
@@ -558,7 +542,7 @@ current`, _object_spread({}, styleState.style)));
|
|
|
558
542
|
}
|
|
559
543
|
}
|
|
560
544
|
} else
|
|
561
|
-
|
|
545
|
+
style2 && !styleProps.noMergeStyle && (viewProps.style = style2);
|
|
562
546
|
}
|
|
563
547
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && isDevTools) {
|
|
564
548
|
consoleGroupCollapsed("\u{1F539} getSplitStyles ===>");
|
|
@@ -571,8 +555,8 @@ current`, _object_spread({}, styleState.style)));
|
|
|
571
555
|
rulesToInsert,
|
|
572
556
|
parentSplitStyles
|
|
573
557
|
});
|
|
574
|
-
for (var
|
|
575
|
-
log(
|
|
558
|
+
for (var key3 in logs)
|
|
559
|
+
log(key3, logs[key3]);
|
|
576
560
|
} catch {
|
|
577
561
|
}
|
|
578
562
|
console.groupEnd();
|