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