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