@tamagui/web 1.109.7 → 1.109.9
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/getSplitStyles.native.js +177 -169
- package/dist/cjs/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.native.js +177 -169
- package/dist/esm/helpers/getSplitStyles.native.js.map +2 -2
- package/package.json +11 -11
- package/dist/cjs/html.js +0 -219
- package/dist/cjs/html.js.map +0 -6
- package/dist/cjs/html.native.js +0 -437
- package/dist/cjs/html.native.js.map +0 -6
- package/dist/cjs/views/html.js +0 -1
- package/dist/cjs/views/html.js.map +0 -6
- package/dist/cjs/views/html.native.js +0 -2
- package/dist/cjs/views/html.native.js.map +0 -6
- package/dist/esm/html.js +0 -196
- package/dist/esm/html.js.map +0 -6
- package/dist/esm/html.mjs +0 -193
- package/dist/esm/html.mjs.map +0 -1
- package/dist/esm/html.native.js +0 -233
- package/dist/esm/html.native.js.map +0 -6
- package/dist/esm/views/html.js +0 -1
- package/dist/esm/views/html.js.map +0 -6
- package/dist/esm/views/html.mjs +0 -2
- package/dist/esm/views/html.mjs.map +0 -1
- package/dist/esm/views/html.native.js +0 -1
- package/dist/esm/views/html.native.js.map +0 -6
- package/types/html.d.ts.map +0 -1
- package/types/views/html.d.ts +0 -1
|
@@ -115,37 +115,72 @@ function isValidStyleKey(key, staticConfig) {
|
|
|
115
115
|
return validStyleProps[key] || ((_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key]);
|
|
116
116
|
}
|
|
117
117
|
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug, skipThemeTokenResolution) {
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
119
|
+
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 = {
|
|
120
|
+
// this should go away, right now we're doing really crazy cumulative props,
|
|
121
|
+
// as variants are resolved basically we go back and merge the results onto
|
|
122
|
+
// the curProps, so that each following variant function recieves the current
|
|
123
|
+
// "styles" with variants expanded. powerful, but i think too fancy
|
|
124
|
+
// there's some part of the ui kit that depends on it we'd have to find and fix
|
|
125
|
+
get curProps() {
|
|
126
|
+
return curPropsState || (curPropsState = {}), curPropsState;
|
|
127
|
+
},
|
|
128
|
+
classNames,
|
|
129
|
+
conf,
|
|
130
|
+
props,
|
|
131
|
+
styleProps,
|
|
132
|
+
componentState,
|
|
133
|
+
staticConfig,
|
|
134
|
+
style: null,
|
|
135
|
+
theme,
|
|
136
|
+
usedKeys,
|
|
137
|
+
viewProps,
|
|
138
|
+
context,
|
|
139
|
+
debug,
|
|
140
|
+
skipThemeTokenResolution
|
|
141
|
+
};
|
|
142
|
+
process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (consoleGroupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
|
|
143
|
+
props,
|
|
144
|
+
staticConfig,
|
|
145
|
+
shouldDoClasses,
|
|
146
|
+
styleProps,
|
|
147
|
+
rulesToInsert,
|
|
148
|
+
componentState,
|
|
149
|
+
styleState,
|
|
150
|
+
theme: _object_spread({}, theme)
|
|
151
|
+
}), console.groupEnd());
|
|
152
|
+
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;
|
|
153
|
+
for (var keyOg in props) {
|
|
154
|
+
var _loop = function(i2) {
|
|
120
155
|
var _parentStaticConfig_variants;
|
|
121
156
|
if (expanded) {
|
|
122
|
-
var _expanded_i = _sliced_to_array(expanded[
|
|
123
|
-
|
|
157
|
+
var _expanded_i = _sliced_to_array(expanded[i2], 2), k = _expanded_i[0], v = _expanded_i[1];
|
|
158
|
+
key = k, val = v;
|
|
124
159
|
}
|
|
125
|
-
if (
|
|
126
|
-
if (isPseudo =
|
|
160
|
+
if (val == null || key in usedKeys) return "continue";
|
|
161
|
+
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))) {
|
|
127
162
|
var _props_key;
|
|
128
|
-
viewProps[
|
|
163
|
+
viewProps[key] = (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : val;
|
|
129
164
|
}
|
|
130
165
|
var shouldPassThrough2 = styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo1 || (parentStaticConfig == null || (_parentStaticConfig_variants = parentStaticConfig.variants) === null || _parentStaticConfig_variants === void 0 ? void 0 : _parentStaticConfig_variants[keyInit]));
|
|
131
166
|
if (shouldPassThrough2)
|
|
132
|
-
return passDownProp(viewProps,
|
|
133
|
-
val
|
|
134
|
-
after: _object_spread({}, viewProps[
|
|
167
|
+
return passDownProp(viewProps, key, val, isMediaOrPseudo1), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed(" - passing down prop ".concat(key)), (0, import_log.log)({
|
|
168
|
+
val,
|
|
169
|
+
after: _object_spread({}, viewProps[key])
|
|
135
170
|
}), console.groupEnd()), "continue";
|
|
136
171
|
if (isPseudo) {
|
|
137
|
-
if (!
|
|
138
|
-
var pseudoStyleObject = getSubStyle(styleState,
|
|
172
|
+
if (!val) return "continue";
|
|
173
|
+
var pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClassNames), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
|
|
139
174
|
if (!descriptor)
|
|
140
175
|
return "continue";
|
|
141
176
|
if (!shouldDoClasses || process.env.IS_STATIC === "is_static") {
|
|
142
177
|
var _pseudos, _key;
|
|
143
|
-
if (pseudos || (pseudos = {}), (_pseudos = pseudos)[_key =
|
|
144
|
-
return Object.assign(pseudos[
|
|
178
|
+
if (pseudos || (pseudos = {}), (_pseudos = pseudos)[_key = key] || (_pseudos[_key] = {}), process.env.IS_STATIC === "is_static")
|
|
179
|
+
return Object.assign(pseudos[key], pseudoStyleObject), "continue";
|
|
145
180
|
}
|
|
146
181
|
if (shouldDoClasses && !isExit) {
|
|
147
182
|
var pseudoStyles = (0, import_getStylesAtomic.getStyleAtomic)(pseudoStyleObject, descriptor);
|
|
148
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo (classes)",
|
|
183
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo (classes)", key), (0, import_log.log)({
|
|
149
184
|
pseudoStyleObject,
|
|
150
185
|
pseudoStyles
|
|
151
186
|
}), console.groupEnd());
|
|
@@ -168,7 +203,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
168
203
|
}
|
|
169
204
|
if (!shouldDoClasses || isExit || isEnter) {
|
|
170
205
|
var descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = componentState[descriptorKey] === !1;
|
|
171
|
-
isExit && (isDisabled = !styleProps.isExiting), isEnter && componentState.unmounted === !1 && (isDisabled = !0), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo",
|
|
206
|
+
isExit && (isDisabled = !styleProps.isExiting), isEnter && componentState.unmounted === !1 && (isDisabled = !0), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo", key, {
|
|
172
207
|
isDisabled
|
|
173
208
|
}), (0, import_log.log)({
|
|
174
209
|
pseudoStyleObject,
|
|
@@ -185,7 +220,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
185
220
|
var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
186
221
|
if (shouldMerge) {
|
|
187
222
|
var _pseudos1, _key1;
|
|
188
|
-
pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 =
|
|
223
|
+
pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key] || (_pseudos1[_key1] = {}), pseudos[key][pkey] = val12, mergeStyle(styleState, pkey, val12);
|
|
189
224
|
}
|
|
190
225
|
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" subKey", pkey, shouldMerge, {
|
|
191
226
|
importance,
|
|
@@ -196,7 +231,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
196
231
|
}
|
|
197
232
|
}
|
|
198
233
|
if (!isDisabled)
|
|
199
|
-
for (var key12 in
|
|
234
|
+
for (var key12 in val) {
|
|
200
235
|
var k1 = shorthands[key12] || key12;
|
|
201
236
|
usedKeys[k1] = Math.max(importance, usedKeys[k1] || 0);
|
|
202
237
|
}
|
|
@@ -204,23 +239,23 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
204
239
|
return "continue";
|
|
205
240
|
}
|
|
206
241
|
if (isMedia) {
|
|
207
|
-
if (!
|
|
208
|
-
var hasSpace =
|
|
209
|
-
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)(
|
|
242
|
+
if (!val) return "continue";
|
|
243
|
+
var hasSpace = val.space, mediaKeyShort = key.slice(1);
|
|
244
|
+
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)(key))
|
|
210
245
|
return "continue";
|
|
211
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" \u{1F4FA} ".concat(
|
|
212
|
-
key
|
|
213
|
-
val
|
|
246
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" \u{1F4FA} ".concat(key), {
|
|
247
|
+
key,
|
|
248
|
+
val,
|
|
214
249
|
props,
|
|
215
250
|
shouldDoClasses,
|
|
216
251
|
acceptsClassName,
|
|
217
252
|
componentState,
|
|
218
253
|
mediaState
|
|
219
254
|
}), shouldDoClasses) {
|
|
220
|
-
var mediaStyle = getSubStyle(styleState,
|
|
255
|
+
var mediaStyle = getSubStyle(styleState, key, val, !1);
|
|
221
256
|
if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
|
|
222
257
|
var importance1 = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space", usedKeys, !0);
|
|
223
|
-
importance1 && (space =
|
|
258
|
+
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, ")")));
|
|
224
259
|
}
|
|
225
260
|
var mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle), priority = mediaStylesSeen;
|
|
226
261
|
mediaStylesSeen += 1;
|
|
@@ -257,7 +292,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
257
292
|
return process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" \u{1F4FA} \u274C DISABLED ".concat(mediaKeyShort)), "continue";
|
|
258
293
|
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" \u{1F4FA} \u2705 ENABLED ".concat(mediaKeyShort));
|
|
259
294
|
}
|
|
260
|
-
var mediaStyle1 = getSubStyle(styleState,
|
|
295
|
+
var mediaStyle1 = getSubStyle(styleState, key, val, !0), importanceBump = 0;
|
|
261
296
|
if (isThemeMedia) {
|
|
262
297
|
dynamicThemeAccess = !0;
|
|
263
298
|
var mediaThemeName = mediaKeyShort.slice(6);
|
|
@@ -306,163 +341,136 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
306
341
|
}
|
|
307
342
|
return "continue";
|
|
308
343
|
}
|
|
309
|
-
if (
|
|
310
|
-
return viewProps[
|
|
344
|
+
if (key === "pointerEvents")
|
|
345
|
+
return viewProps[key] = val, "continue";
|
|
311
346
|
if (
|
|
312
347
|
// is HOC we can just pass through the styles as props
|
|
313
348
|
// this fixes issues where style prop got merged with wrong priority
|
|
314
|
-
!isHOC && (isValidStyleKey(
|
|
349
|
+
!isHOC && (isValidStyleKey(key, staticConfig) || import_constants.isAndroid && key === "elevation")
|
|
315
350
|
)
|
|
316
|
-
return mergeStyle(styleState,
|
|
317
|
-
isVariant || (viewProps[
|
|
318
|
-
}, keyInit =
|
|
351
|
+
return mergeStyle(styleState, key, val), "continue";
|
|
352
|
+
isVariant || (viewProps[key] = val);
|
|
353
|
+
}, keyInit = keyOg, valInit = props[keyInit];
|
|
319
354
|
if (accept) {
|
|
320
355
|
var accepted = accept[keyInit];
|
|
321
|
-
if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit > "u" ? "undefined" : _type_of(valInit)) === "object")
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
if (keyInit in import_skipProps.skipProps && !noSkip && !isHOC) {
|
|
326
|
-
if (keyInit === "group" && 0)
|
|
327
|
-
var identifier2, containerType, containerCSS;
|
|
328
|
-
return "continue";
|
|
329
|
-
}
|
|
330
|
-
var valInitType = typeof valInit > "u" ? "undefined" : _type_of(valInit), isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
331
|
-
if (0 && isValidStyleKeyInit && valInitType === "string" && valInit[0] === "_") {
|
|
332
|
-
var isValidClassName, isMediaOrPseudo;
|
|
333
|
-
if ((isValidClassName || isMediaOrPseudo) && !shouldDoClasses)
|
|
334
|
-
var _styleState3;
|
|
335
|
-
}
|
|
336
|
-
if (!isValidStyleKeyInit) {
|
|
337
|
-
if (!import_constants.isAndroid && keyInit === "elevationAndroid")
|
|
338
|
-
return "continue";
|
|
339
|
-
if (keyInit === "userSelect")
|
|
340
|
-
keyInit = "selectable", valInit = valInit !== "none";
|
|
341
|
-
else if (keyInit.startsWith("data-"))
|
|
342
|
-
return "continue";
|
|
343
|
-
}
|
|
344
|
-
if (keyInit === "dataSet") {
|
|
345
|
-
for (var keyInit1 in valInit)
|
|
346
|
-
viewProps["data-".concat(hyphenate(keyInit1))] = valInit[keyInit1];
|
|
347
|
-
return "continue";
|
|
348
|
-
}
|
|
349
|
-
if (0 && !noExpand)
|
|
350
|
-
var didUseKeyInit;
|
|
351
|
-
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);
|
|
352
|
-
if (isMediaOrPseudo1 && keyInit.startsWith("$group-")) {
|
|
353
|
-
var name2 = keyInit.split("-")[1];
|
|
354
|
-
context != null && context.groups.subscribe && !(context != null && context.groups.state[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
|
|
355
|
-
}
|
|
356
|
-
var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo1 || isVariant && !noExpand || isShorthand;
|
|
357
|
-
if (isStyleProp && (asChild === "except-style" || asChild === "except-style-web"))
|
|
358
|
-
return "continue";
|
|
359
|
-
var shouldPassProp = !isStyleProp || // is in parent variants
|
|
360
|
-
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;
|
|
361
|
-
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)({
|
|
362
|
-
isVariant,
|
|
363
|
-
valInit,
|
|
364
|
-
shouldPassProp
|
|
365
|
-
}), import_constants.isClient && (0, import_log.log)({
|
|
366
|
-
variants,
|
|
367
|
-
variant: variants == null ? void 0 : variants[keyInit],
|
|
368
|
-
isVariant,
|
|
369
|
-
isHOCShouldPassThrough,
|
|
370
|
-
curProps: _object_spread({}, styleState.curProps),
|
|
371
|
-
parentStaticConfig
|
|
372
|
-
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant) || !noSkip && keyInit in import_skipProps.skipProps)
|
|
373
|
-
return process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd(), "continue";
|
|
374
|
-
(isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
|
|
375
|
-
var avoidPropMap = isMediaOrPseudo1 || !isVariant && !isValidStyleKeyInit, expanded = avoidPropMap ? null : (0, import_propMapper.propMapper)(keyInit, valInit, styleState);
|
|
376
|
-
if (!avoidPropMap) {
|
|
377
|
-
if (!expanded) return "continue";
|
|
378
|
-
var next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
|
|
379
|
-
next && (styleState.fontFamily = next);
|
|
356
|
+
if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit > "u" ? "undefined" : _type_of(valInit)) === "object") {
|
|
357
|
+
viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClassNames);
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
380
360
|
}
|
|
381
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
361
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd(), disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit !== "className" && !(keyInit in usedKeys)) {
|
|
362
|
+
if (keyInit in import_skipProps.skipProps && !noSkip && !isHOC) {
|
|
363
|
+
if (keyInit === "group" && 0)
|
|
364
|
+
var identifier, containerType, containerCSS;
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
var valInitType = typeof valInit > "u" ? "undefined" : _type_of(valInit), isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
368
|
+
if (0 && isValidStyleKeyInit && valInitType === "string" && valInit[0] === "_") {
|
|
369
|
+
var isValidClassName, isMediaOrPseudo;
|
|
370
|
+
if ((isValidClassName || isMediaOrPseudo) && !shouldDoClasses)
|
|
371
|
+
var _styleState;
|
|
372
|
+
}
|
|
373
|
+
if (!isValidStyleKeyInit) {
|
|
374
|
+
if (!import_constants.isAndroid && keyInit === "elevationAndroid")
|
|
375
|
+
continue;
|
|
376
|
+
if (keyInit === "userSelect")
|
|
377
|
+
keyInit = "selectable", valInit = valInit !== "none";
|
|
378
|
+
else if (keyInit.startsWith("data-"))
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
if (keyInit === "dataSet") {
|
|
382
|
+
for (var keyInit1 in valInit)
|
|
383
|
+
viewProps["data-".concat(hyphenate(keyInit1))] = valInit[keyInit1];
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
if (0 && !noExpand)
|
|
387
|
+
var didUseKeyInit;
|
|
388
|
+
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);
|
|
389
|
+
if (isMediaOrPseudo1 && keyInit.startsWith("$group-")) {
|
|
390
|
+
var name = keyInit.split("-")[1];
|
|
391
|
+
context != null && context.groups.subscribe && !(context != null && context.groups.state[name]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
|
|
392
|
+
}
|
|
393
|
+
var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo1 || isVariant && !noExpand || isShorthand;
|
|
394
|
+
if (!(isStyleProp && (asChild === "except-style" || asChild === "except-style-web"))) {
|
|
395
|
+
var shouldPassProp = !isStyleProp || // is in parent variants
|
|
396
|
+
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;
|
|
397
|
+
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)({
|
|
388
398
|
isVariant,
|
|
399
|
+
valInit,
|
|
400
|
+
shouldPassProp
|
|
401
|
+
}), import_constants.isClient && (0, import_log.log)({
|
|
402
|
+
variants,
|
|
389
403
|
variant: variants == null ? void 0 : variants[keyInit],
|
|
390
|
-
|
|
404
|
+
isVariant,
|
|
391
405
|
isHOCShouldPassThrough,
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}), (
|
|
406
|
+
curProps: _object_spread({}, styleState.curProps),
|
|
407
|
+
parentStaticConfig
|
|
408
|
+
})), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo1), !isVariant)) {
|
|
409
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
if (!noSkip && keyInit in import_skipProps.skipProps) {
|
|
413
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd();
|
|
414
|
+
continue;
|
|
415
|
+
}
|
|
416
|
+
(isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
|
|
417
|
+
var avoidPropMap = isMediaOrPseudo1 || !isVariant && !isValidStyleKeyInit, expanded = avoidPropMap ? null : (0, import_propMapper.propMapper)(keyInit, valInit, styleState);
|
|
418
|
+
if (!avoidPropMap) {
|
|
419
|
+
if (!expanded) continue;
|
|
420
|
+
var next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
|
|
421
|
+
next && (styleState.fontFamily = next);
|
|
422
|
+
}
|
|
423
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
424
|
+
consoleGroupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
425
|
+
try {
|
|
426
|
+
!import_constants.isServer && import_isDevTools.isDevTools && ((0, import_log.log)({
|
|
427
|
+
expanded,
|
|
428
|
+
styleProps,
|
|
429
|
+
componentState,
|
|
430
|
+
isVariant,
|
|
431
|
+
variant: variants == null ? void 0 : variants[keyInit],
|
|
432
|
+
shouldPassProp,
|
|
433
|
+
isHOCShouldPassThrough,
|
|
434
|
+
usedKeys: _object_spread({}, usedKeys),
|
|
435
|
+
curProps: _object_spread({}, styleState.curProps)
|
|
436
|
+
}), (0, import_log.log)("expanded", expanded, `
|
|
395
437
|
usedKeys`, _object_spread({}, usedKeys), `
|
|
396
438
|
current`, _object_spread({}, styleState.style)));
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
439
|
+
} catch {
|
|
440
|
+
}
|
|
441
|
+
console.groupEnd();
|
|
442
|
+
}
|
|
443
|
+
for (var key = keyInit, val = valInit, max = expanded ? expanded.length : 1, i = 0; i < max; i++) _loop(i);
|
|
444
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
445
|
+
try {
|
|
446
|
+
(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));
|
|
447
|
+
} catch {
|
|
448
|
+
}
|
|
449
|
+
console.groupEnd();
|
|
450
|
+
}
|
|
406
451
|
}
|
|
407
|
-
console.groupEnd();
|
|
408
452
|
}
|
|
409
|
-
}
|
|
410
|
-
conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
411
|
-
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 = {
|
|
412
|
-
// this should go away, right now we're doing really crazy cumulative props,
|
|
413
|
-
// as variants are resolved basically we go back and merge the results onto
|
|
414
|
-
// the curProps, so that each following variant function recieves the current
|
|
415
|
-
// "styles" with variants expanded. powerful, but i think too fancy
|
|
416
|
-
// there's some part of the ui kit that depends on it we'd have to find and fix
|
|
417
|
-
get curProps() {
|
|
418
|
-
return curPropsState || (curPropsState = {}), curPropsState;
|
|
419
|
-
},
|
|
420
|
-
classNames,
|
|
421
|
-
conf,
|
|
422
|
-
props,
|
|
423
|
-
styleProps,
|
|
424
|
-
componentState,
|
|
425
|
-
staticConfig,
|
|
426
|
-
style: null,
|
|
427
|
-
theme,
|
|
428
|
-
usedKeys,
|
|
429
|
-
viewProps,
|
|
430
|
-
context,
|
|
431
|
-
debug,
|
|
432
|
-
skipThemeTokenResolution
|
|
433
|
-
};
|
|
434
|
-
process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (consoleGroupCollapsed("getSplitStyles (collapsed)"), (0, import_log.log)({
|
|
435
|
-
props,
|
|
436
|
-
staticConfig,
|
|
437
|
-
shouldDoClasses,
|
|
438
|
-
styleProps,
|
|
439
|
-
rulesToInsert,
|
|
440
|
-
componentState,
|
|
441
|
-
styleState,
|
|
442
|
-
theme: _object_spread({}, theme)
|
|
443
|
-
}), console.groupEnd());
|
|
444
|
-
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;
|
|
445
|
-
for (var keyOg in props) _loop(keyOg);
|
|
453
|
+
}
|
|
446
454
|
var avoidNormalize = styleProps.noNormalize === !1;
|
|
447
455
|
if (!avoidNormalize) {
|
|
448
456
|
if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), import_constants.isWeb && !isReactNative && (0, import_getStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms) {
|
|
449
|
-
var
|
|
450
|
-
(
|
|
457
|
+
var _styleState1;
|
|
458
|
+
(_styleState1 = styleState).style || (_styleState1.style = {}), Object.entries(styleState.flatTransforms).sort(function(param, param1) {
|
|
451
459
|
var _param = _sliced_to_array(param, 1), a = _param[0], _param1 = _sliced_to_array(param1, 1), b = _param1[0];
|
|
452
460
|
return a.localeCompare(b);
|
|
453
461
|
}).forEach(function(param) {
|
|
454
|
-
var _param = _sliced_to_array(param, 2),
|
|
455
|
-
mergeTransform(styleState.style,
|
|
462
|
+
var _param = _sliced_to_array(param, 2), key5 = _param[0], val3 = _param[1];
|
|
463
|
+
mergeTransform(styleState.style, key5, val3, !0);
|
|
456
464
|
});
|
|
457
465
|
}
|
|
458
466
|
if (parentSplitStyles) {
|
|
459
467
|
if (0 && shouldDoClasses)
|
|
460
|
-
for (var
|
|
461
|
-
var
|
|
468
|
+
for (var key1 in parentSplitStyles.classNames)
|
|
469
|
+
var val1;
|
|
462
470
|
if (!shouldDoClasses)
|
|
463
|
-
for (var
|
|
464
|
-
var
|
|
465
|
-
|
|
471
|
+
for (var key2 in parentSplitStyles.style) {
|
|
472
|
+
var _styleState2;
|
|
473
|
+
key2 in classNames || styleState.style && key2 in styleState.style || ((_styleState2 = styleState).style || (_styleState2.style = {}), styleState.style[key2] = parentSplitStyles.style[key2]);
|
|
466
474
|
}
|
|
467
475
|
}
|
|
468
476
|
}
|
|
@@ -475,7 +483,7 @@ current`, _object_spread({}, styleState.style)));
|
|
|
475
483
|
var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
|
|
476
484
|
try {
|
|
477
485
|
for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)
|
|
478
|
-
var atomicStyle, _props_animateOnly, _atomicStyle,
|
|
486
|
+
var atomicStyle, _props_animateOnly, _atomicStyle, key3, value, identifier1, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
|
|
479
487
|
} catch (err) {
|
|
480
488
|
} finally {
|
|
481
489
|
try {
|
|
@@ -485,8 +493,8 @@ current`, _object_spread({}, styleState.style)));
|
|
|
485
493
|
}
|
|
486
494
|
if (transforms)
|
|
487
495
|
for (var namespace in transforms) {
|
|
488
|
-
var _transforms_namespace, hash,
|
|
489
|
-
if (import_constants.isClient && !insertedTransforms[
|
|
496
|
+
var _transforms_namespace, hash, val2, identifier2;
|
|
497
|
+
if (import_constants.isClient && !insertedTransforms[identifier2])
|
|
490
498
|
var rule;
|
|
491
499
|
}
|
|
492
500
|
}
|
|
@@ -501,14 +509,14 @@ current`, _object_spread({}, styleState.style)));
|
|
|
501
509
|
if (isHOC)
|
|
502
510
|
viewProps.style = normalizeStyle(styleProp);
|
|
503
511
|
else
|
|
504
|
-
for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1,
|
|
505
|
-
var style = isArray ? styleProp[
|
|
512
|
+
for (var isArray = Array.isArray(styleProp), len = isArray ? styleProp.length : 1, i1 = 0; i1 < len; i1++) {
|
|
513
|
+
var style = isArray ? styleProp[i1] : styleProp;
|
|
506
514
|
if (style)
|
|
507
515
|
if (style.$$css)
|
|
508
516
|
Object.assign(styleState.classNames, style);
|
|
509
517
|
else {
|
|
510
|
-
var
|
|
511
|
-
(
|
|
518
|
+
var _styleState3;
|
|
519
|
+
(_styleState3 = styleState).style || (_styleState3.style = {}), Object.assign(styleState.style, normalizeStyle(style));
|
|
512
520
|
}
|
|
513
521
|
}
|
|
514
522
|
var style1 = styleState.style;
|
|
@@ -543,7 +551,7 @@ current`, _object_spread({}, styleState.style)));
|
|
|
543
551
|
var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
|
|
544
552
|
try {
|
|
545
553
|
for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0)
|
|
546
|
-
var
|
|
554
|
+
var name1;
|
|
547
555
|
} catch (err) {
|
|
548
556
|
} finally {
|
|
549
557
|
try {
|
|
@@ -567,8 +575,8 @@ current`, _object_spread({}, styleState.style)));
|
|
|
567
575
|
rulesToInsert,
|
|
568
576
|
parentSplitStyles
|
|
569
577
|
});
|
|
570
|
-
for (var
|
|
571
|
-
(0, import_log.log)(
|
|
578
|
+
for (var key4 in logs)
|
|
579
|
+
(0, import_log.log)(key4, logs[key4]);
|
|
572
580
|
} catch {
|
|
573
581
|
}
|
|
574
582
|
console.groupEnd();
|