@tamagui/web 1.106.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/createComponent.js +1 -1
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/createComponent.native.js +2 -2
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/helpers/createMediaStyle.js +23 -11
- package/dist/cjs/helpers/createMediaStyle.js.map +1 -1
- package/dist/cjs/helpers/createMediaStyle.native.js +17 -9
- 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 +42 -26
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +332 -336
- 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/createComponent.js +1 -1
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.mjs +1 -1
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +2 -2
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/helpers/createMediaStyle.js +24 -12
- 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 +18 -10
- 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 +42 -26
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +25 -16
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +333 -336
- 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/createComponent.tsx +1 -1
- package/src/helpers/createMediaStyle.ts +40 -21
- package/src/helpers/getGroupPropParts.ts +3 -1
- package/src/helpers/getSplitStyles.tsx +62 -27
- 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,327 +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
|
-
var defaultValues = animatableDefaults[pkey];
|
|
300
|
-
defaultValues != null && !(pkey in usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
|
|
301
|
-
} else {
|
|
302
|
-
var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
303
|
-
if (shouldMerge) {
|
|
304
|
-
var _pseudos1, _key1;
|
|
305
|
-
pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key] || (_pseudos1[_key1] = {}), pseudos[key][pkey] = val1, mergeStyle(styleState, pkey, val1);
|
|
306
|
-
}
|
|
307
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && log(" subKey", pkey, shouldMerge, {
|
|
308
|
-
importance,
|
|
309
|
-
curImportance,
|
|
310
|
-
pkey,
|
|
311
|
-
val: val1
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
if (!isDisabled)
|
|
316
|
-
for (var key1 in val) {
|
|
317
|
-
var k1 = shorthands[key1] || key1;
|
|
318
|
-
usedKeys[k1] = Math.max(importance, usedKeys[k1] || 0);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
continue;
|
|
322
|
-
}
|
|
323
|
-
if (isMedia) {
|
|
324
|
-
if (!val) continue;
|
|
325
|
-
var hasSpace = val.space, mediaKeyShort = key.slice(1);
|
|
326
|
-
if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && ((typeof hasMedia > "u" ? "undefined" : _type_of(hasMedia)) !== "object" && (hasMedia = {}), hasMedia[mediaKeyShort] = !0), isMedia === "platform") {
|
|
327
|
-
var platform = key.slice(10);
|
|
328
|
-
if (
|
|
329
|
-
// supports web, ios, android
|
|
330
|
-
platform !== currentPlatform && // supports web, native
|
|
331
|
-
platform !== "native"
|
|
332
|
-
)
|
|
333
|
-
continue;
|
|
334
|
-
}
|
|
335
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F4FA} ".concat(key), {
|
|
336
|
-
key,
|
|
337
|
-
val,
|
|
338
|
-
props,
|
|
339
|
-
shouldDoClasses,
|
|
340
|
-
acceptsClassName,
|
|
341
|
-
componentState,
|
|
342
|
-
mediaState
|
|
343
|
-
}), shouldDoClasses) {
|
|
344
|
-
var mediaStyle = getSubStyle(styleState, key, val, !1);
|
|
345
|
-
if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
|
|
346
|
-
var importance1 = getMediaImportanceIfMoreImportant(mediaKeyShort, "space", usedKeys, !0);
|
|
347
|
-
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, ")")));
|
|
348
|
-
}
|
|
349
|
-
var mediaStyles = getStylesAtomic(mediaStyle), priority = mediaStylesSeen;
|
|
350
|
-
mediaStylesSeen += 1;
|
|
351
|
-
var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
|
|
352
|
-
try {
|
|
353
|
-
for (var _iterator1 = mediaStyles[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
|
|
354
|
-
var style = _step1.value, out = createMediaStyle(style, mediaKeyShort, mediaQueryConfig, isMedia, !1, priority);
|
|
355
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && log("\u{1F4FA} media style:", out);
|
|
356
|
-
var fullKey1 = "".concat(style[StyleObjectProperty]).concat(PROP_SPLIT).concat(mediaKeyShort).concat(style[StyleObjectPseudo] || "");
|
|
357
|
-
fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey1, out[StyleObjectIdentifier], !0, !0));
|
|
358
|
-
}
|
|
359
|
-
} catch (err) {
|
|
360
|
-
_didIteratorError1 = !0, _iteratorError1 = err;
|
|
361
|
-
} finally {
|
|
362
|
-
try {
|
|
363
|
-
!_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
|
|
364
|
-
} finally {
|
|
365
|
-
if (_didIteratorError1)
|
|
366
|
-
throw _iteratorError1;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
} else {
|
|
370
|
-
var isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
|
|
371
|
-
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
372
|
-
if (!mediaState[mediaKeyShort]) {
|
|
373
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F4FA} \u274C DISABLED ".concat(mediaKeyShort));
|
|
374
|
-
continue;
|
|
375
|
-
}
|
|
376
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F4FA} \u2705 ENABLED ".concat(mediaKeyShort));
|
|
377
|
-
}
|
|
378
|
-
var mediaStyle1 = getSubStyle(styleState, key, val, !0), importanceBump = 0;
|
|
379
|
-
if (isThemeMedia) {
|
|
380
|
-
dynamicThemeAccess = !0;
|
|
381
|
-
var mediaThemeName = mediaKeyShort.slice(6);
|
|
382
|
-
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName)))
|
|
383
|
-
continue;
|
|
384
|
-
} else if (isGroupMedia) {
|
|
385
|
-
var _componentState_group, groupInfo = getGroupPropParts(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
|
|
386
|
-
if (!groupContext) {
|
|
387
|
-
process.env.NODE_ENV === "development" && debug && log("No parent with group prop, skipping styles: ".concat(groupName));
|
|
388
|
-
continue;
|
|
389
|
-
}
|
|
390
|
-
var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
|
|
391
|
-
if (groupMediaKey) {
|
|
392
|
-
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
|
|
393
|
-
var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
|
|
394
|
-
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) continue;
|
|
395
|
-
importanceBump = 2;
|
|
396
|
-
}
|
|
397
|
-
if (groupPseudoKey) {
|
|
398
|
-
pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
|
|
399
|
-
var componentGroupPseudoState = (componentGroupState || // fallback to context initially
|
|
400
|
-
context.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = pseudoPriorities[groupPseudoKey];
|
|
401
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && log(" \u{1F3D8}\uFE0F GROUP pseudo ".concat(groupMediaKey, " active? ").concat(isActive1, ", priority ").concat(priority1)), !isActive1) continue;
|
|
402
|
-
importanceBump = priority1;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
for (var subKey in mediaStyle1) {
|
|
406
|
-
var _styleState1;
|
|
407
|
-
if (subKey === "space") {
|
|
408
|
-
space = valInit.space;
|
|
409
|
-
continue;
|
|
410
|
-
}
|
|
411
|
-
(_styleState1 = styleState).style || (_styleState1.style = {}), mergeMediaByImportance(styleState, mediaKeyShort, subKey, mediaStyle1[subKey], usedKeys, mediaState[mediaKeyShort], importanceBump, debug), key === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
continue;
|
|
415
|
-
}
|
|
416
|
-
if (key === "pointerEvents") {
|
|
417
|
-
viewProps[key] = val;
|
|
418
|
-
continue;
|
|
419
|
-
}
|
|
420
|
-
if (
|
|
421
|
-
// is HOC we can just pass through the styles as props
|
|
422
|
-
// this fixes issues where style prop got merged with wrong priority
|
|
423
|
-
!isHOC && (isValidStyleKey(key, staticConfig) || isAndroid && key === "elevation")
|
|
424
|
-
) {
|
|
425
|
-
mergeStyle(styleState, key, val);
|
|
426
|
-
continue;
|
|
427
|
-
}
|
|
428
|
-
isVariant || (viewProps[key] = val);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
432
|
-
try {
|
|
433
|
-
log(" \u2714\uFE0F expand complete", keyInit), log("style", _object_spread({}, styleState.style)), log("transforms", _object_spread({}, transforms)), log("viewProps", _object_spread({}, viewProps));
|
|
434
|
-
} catch {
|
|
435
|
-
}
|
|
436
|
-
console.groupEnd();
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
}
|
|
433
|
+
for (var keyOg in props) _loop(keyOg);
|
|
441
434
|
var avoidNormalize = styleProps.noNormalize === !1;
|
|
442
435
|
if (!avoidNormalize) {
|
|
443
436
|
if (styleState.style && (fixStyles(styleState.style), isWeb && !isReactNative && styleToCSS(styleState.style)), styleState.flatTransforms) {
|
|
444
|
-
var
|
|
445
|
-
(
|
|
437
|
+
var _styleState;
|
|
438
|
+
(_styleState = styleState).style || (_styleState.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
|
|
446
439
|
var _param = _sliced_to_array(param, 1), a = _param[0], _param1 = _sliced_to_array(param1, 1), b = _param1[0];
|
|
447
440
|
return a.localeCompare(b);
|
|
448
441
|
}).forEach(function(param) {
|
|
449
|
-
var _param = _sliced_to_array(param, 2),
|
|
450
|
-
mergeTransform(styleState.style,
|
|
442
|
+
var _param = _sliced_to_array(param, 2), key4 = _param[0], val2 = _param[1];
|
|
443
|
+
mergeTransform(styleState.style, key4, val2, !0);
|
|
451
444
|
});
|
|
452
445
|
}
|
|
453
446
|
if (parentSplitStyles) {
|
|
454
447
|
if (0 && shouldDoClasses)
|
|
455
|
-
for (var
|
|
456
|
-
var
|
|
448
|
+
for (var key in parentSplitStyles.classNames)
|
|
449
|
+
var val;
|
|
457
450
|
if (!shouldDoClasses)
|
|
458
|
-
for (var
|
|
459
|
-
var
|
|
460
|
-
|
|
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]);
|
|
461
454
|
}
|
|
462
455
|
}
|
|
463
456
|
}
|
|
@@ -467,10 +460,10 @@ current`, _object_spread({}, styleState.style)));
|
|
|
467
460
|
if (styleState.style && shouldDoClasses) {
|
|
468
461
|
var retainedStyles, shouldRetain;
|
|
469
462
|
if (!styleState.style.$$css) {
|
|
470
|
-
var atomic,
|
|
463
|
+
var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
|
|
471
464
|
try {
|
|
472
|
-
for (var
|
|
473
|
-
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;
|
|
474
467
|
} catch (err) {
|
|
475
468
|
} finally {
|
|
476
469
|
try {
|
|
@@ -480,8 +473,8 @@ current`, _object_spread({}, styleState.style)));
|
|
|
480
473
|
}
|
|
481
474
|
if (transforms)
|
|
482
475
|
for (var namespace in transforms) {
|
|
483
|
-
var _transforms_namespace, hash,
|
|
484
|
-
if (isClient && !insertedTransforms[
|
|
476
|
+
var _transforms_namespace, hash, val1, identifier1;
|
|
477
|
+
if (isClient && !insertedTransforms[identifier1])
|
|
485
478
|
var rule;
|
|
486
479
|
}
|
|
487
480
|
}
|
|
@@ -496,24 +489,24 @@ current`, _object_spread({}, styleState.style)));
|
|
|
496
489
|
if (isHOC)
|
|
497
490
|
viewProps.style = normalizeStyle(styleProp);
|
|
498
491
|
else
|
|
499
|
-
for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1,
|
|
500
|
-
var
|
|
501
|
-
if (
|
|
502
|
-
if (
|
|
503
|
-
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);
|
|
504
497
|
else {
|
|
505
|
-
var
|
|
506
|
-
(
|
|
498
|
+
var _styleState2;
|
|
499
|
+
(_styleState2 = styleState).style || (_styleState2.style = {}), Object.assign(styleState.style, normalizeStyle(style));
|
|
507
500
|
}
|
|
508
501
|
}
|
|
509
|
-
var
|
|
510
|
-
if (
|
|
511
|
-
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;
|
|
512
505
|
if (faceInfo) {
|
|
513
|
-
var _faceInfo_style_fontWeight_, _faceInfo_style_fontWeight, overrideFace = (_faceInfo_style_fontWeight = faceInfo[
|
|
514
|
-
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);
|
|
515
508
|
}
|
|
516
|
-
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);
|
|
517
510
|
}
|
|
518
511
|
var result = {
|
|
519
512
|
space,
|
|
@@ -529,16 +522,16 @@ current`, _object_spread({}, styleState.style)));
|
|
|
529
522
|
mediaGroups
|
|
530
523
|
}, asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
531
524
|
if (!asChildExceptStyleLike) {
|
|
532
|
-
var
|
|
525
|
+
var style2 = styleState.style;
|
|
533
526
|
if (0) {
|
|
534
527
|
var _staticConfig_defaultProps, fontFamily, fontFamilyClassName, groupClassName, componentNameFinal, componentClassName, classList, finalClassName;
|
|
535
528
|
if (!styleProps.noMergeStyle) {
|
|
536
529
|
if (!(styleProps.isAnimated && !conf.animations.supportsCSSVars && isReactNative)) {
|
|
537
530
|
if (isReactNative) {
|
|
538
|
-
var cnStyles,
|
|
531
|
+
var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
|
|
539
532
|
try {
|
|
540
|
-
for (var
|
|
541
|
-
var
|
|
533
|
+
for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0)
|
|
534
|
+
var name;
|
|
542
535
|
} catch (err) {
|
|
543
536
|
} finally {
|
|
544
537
|
try {
|
|
@@ -549,7 +542,7 @@ current`, _object_spread({}, styleState.style)));
|
|
|
549
542
|
}
|
|
550
543
|
}
|
|
551
544
|
} else
|
|
552
|
-
|
|
545
|
+
style2 && !styleProps.noMergeStyle && (viewProps.style = style2);
|
|
553
546
|
}
|
|
554
547
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && isDevTools) {
|
|
555
548
|
consoleGroupCollapsed("\u{1F539} getSplitStyles ===>");
|
|
@@ -562,8 +555,8 @@ current`, _object_spread({}, styleState.style)));
|
|
|
562
555
|
rulesToInsert,
|
|
563
556
|
parentSplitStyles
|
|
564
557
|
});
|
|
565
|
-
for (var
|
|
566
|
-
log(
|
|
558
|
+
for (var key3 in logs)
|
|
559
|
+
log(key3, logs[key3]);
|
|
567
560
|
} catch {
|
|
568
561
|
}
|
|
569
562
|
console.groupEnd();
|
|
@@ -688,6 +681,10 @@ function normalizeStyle(style) {
|
|
|
688
681
|
}
|
|
689
682
|
return isWeb && Array.isArray(out.transform) && (out.transform = transformsToString(out.transform)), fixStyles(out), out;
|
|
690
683
|
}
|
|
684
|
+
function applyDefaultStyle(pkey, styleState) {
|
|
685
|
+
var defaultValues = animatableDefaults[pkey];
|
|
686
|
+
defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
|
|
687
|
+
}
|
|
691
688
|
export {
|
|
692
689
|
PROP_SPLIT,
|
|
693
690
|
getSplitStyles,
|