@tamagui/core 1.0.1-beta.90 → 1.0.1-beta.93
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/constants/rnw.js +5 -7
- package/dist/cjs/constants/rnw.js.map +2 -2
- package/dist/cjs/constants/rnw.native.js +28 -0
- package/dist/cjs/constants/rnw.native.js.map +7 -0
- package/dist/cjs/helpers/generateAtomicStyles.js +32 -27
- package/dist/cjs/helpers/generateAtomicStyles.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +83 -77
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/static.js +13 -1
- package/dist/cjs/static.js.map +2 -2
- package/dist/esm/constants/rnw.js +2 -7
- package/dist/esm/constants/rnw.js.map +2 -2
- package/dist/esm/constants/rnw.native.js +5 -0
- package/dist/esm/constants/rnw.native.js.map +7 -0
- package/dist/esm/helpers/generateAtomicStyles.js +32 -27
- package/dist/esm/helpers/generateAtomicStyles.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +83 -77
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/static.js +5 -1
- package/dist/esm/static.js.map +2 -2
- package/package.json +7 -7
- package/reset.css +1 -1
- package/types/constants/rnw.d.ts.map +1 -1
- package/types/constants/rnw.native.d.ts +2 -0
- package/types/constants/rnw.native.d.ts.map +1 -0
- package/types/helpers/createTamaguiProvider.d.ts +1 -0
- package/types/helpers/createTamaguiProvider.d.ts.map +1 -1
- package/types/helpers/generateAtomicStyles.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/static.d.ts +1 -1
- package/types/static.d.ts.map +1 -1
- package/dist/cjs/assignNativePropsToWeb.js +0 -187
- package/dist/cjs/assignNativePropsToWeb.js.map +0 -7
- package/dist/esm/assignNativePropsToWeb.js +0 -164
- package/dist/esm/assignNativePropsToWeb.js.map +0 -7
- package/types/assignNativePropsToWeb.d.ts +0 -2
- package/types/assignNativePropsToWeb.d.ts.map +0 -1
package/dist/cjs/static.js
CHANGED
|
@@ -2,6 +2,10 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
5
9
|
var __copyProps = (to, from, except, desc) => {
|
|
6
10
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
11
|
for (let key of __getOwnPropNames(from))
|
|
@@ -13,6 +17,9 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
17
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
19
|
var static_exports = {};
|
|
20
|
+
__export(static_exports, {
|
|
21
|
+
rnw: () => rnw
|
|
22
|
+
});
|
|
16
23
|
module.exports = __toCommonJS(static_exports);
|
|
17
24
|
__reExport(static_exports, require("./styled"), module.exports);
|
|
18
25
|
__reExport(static_exports, require("./createComponent"), module.exports);
|
|
@@ -30,6 +37,11 @@ __reExport(static_exports, require("./helpers/pseudoDescriptors"), module.export
|
|
|
30
37
|
__reExport(static_exports, require("./helpers/proxyThemeVariables"), module.exports);
|
|
31
38
|
__reExport(static_exports, require("./helpers/getSplitStyles"), module.exports);
|
|
32
39
|
__reExport(static_exports, require("@tamagui/helpers"), module.exports);
|
|
33
|
-
__reExport(static_exports, require("./constants/rnw"), module.exports);
|
|
34
40
|
__reExport(static_exports, require("./types"), module.exports);
|
|
41
|
+
const interopRequire = (x) => "default" in x ? x.default : x;
|
|
42
|
+
const rnw = interopRequire(require("react-native-web/dist/cjs/tamagui-exports"));
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
rnw
|
|
46
|
+
});
|
|
35
47
|
//# sourceMappingURL=static.js.map
|
package/dist/cjs/static.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/static.ts"],
|
|
4
|
-
"sourcesContent": ["// only stuff that gets extracted or needed by tamagui-static\n\nexport * from './styled'\nexport * from './createComponent'\nexport * from './createFont'\nexport * from './createTokens'\nexport * from './createTamagui'\nexport * from './createVariable'\nexport * from './constants/constants'\n\nexport * from './hooks/useMedia'\nexport * from './hooks/useTheme'\n\nexport * from './helpers/isObj'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/generateAtomicStyles'\nexport * from './helpers/pseudoDescriptors'\nexport * from './helpers/proxyThemeVariables'\nexport * from './helpers/getSplitStyles'\nexport * from '@tamagui/helpers'\n\nexport * from './
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["// only stuff that gets extracted or needed by tamagui-static\n\nexport * from './styled'\nexport * from './createComponent'\nexport * from './createFont'\nexport * from './createTokens'\nexport * from './createTamagui'\nexport * from './createVariable'\nexport * from './constants/constants'\n\nexport * from './hooks/useMedia'\nexport * from './hooks/useTheme'\n\nexport * from './helpers/isObj'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/generateAtomicStyles'\nexport * from './helpers/pseudoDescriptors'\nexport * from './helpers/proxyThemeVariables'\nexport * from './helpers/getSplitStyles'\nexport * from '@tamagui/helpers'\n\nexport * from './types'\n\n// node only rnw export\nconst interopRequire = (x: any) => ('default' in x ? x.default : x)\nexport const rnw: any = interopRequire(require('react-native-web/dist/cjs/tamagui-exports'))\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2BAAc,qBAFd;AAGA,2BAAc,8BAHd;AAIA,2BAAc,yBAJd;AAKA,2BAAc,2BALd;AAMA,2BAAc,4BANd;AAOA,2BAAc,6BAPd;AAQA,2BAAc,kCARd;AAUA,2BAAc,6BAVd;AAWA,2BAAc,6BAXd;AAaA,2BAAc,4BAbd;AAcA,2BAAc,sCAdd;AAeA,2BAAc,2CAfd;AAgBA,2BAAc,wCAhBd;AAiBA,2BAAc,0CAjBd;AAkBA,2BAAc,qCAlBd;AAmBA,2BAAc,6BAnBd;AAqBA,2BAAc,oBArBd;AAwBA,MAAM,iBAAiB,CAAC,MAAY,aAAa,IAAI,EAAE,UAAU;AAC1D,MAAM,MAAW,eAAe,QAAQ,2CAA2C,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
const rnw =
|
|
3
|
-
if (process.env.IS_STATIC === "is_static") {
|
|
4
|
-
Object.assign(rnw, interopRequire(require("react-native-web/dist/cjs/tamagui-exports")));
|
|
5
|
-
} else if (process.env.TAMAGUI_TARGET === "web") {
|
|
6
|
-
Object.assign(rnw, interopRequire(require("react-native-web")).TamaguiExports);
|
|
7
|
-
}
|
|
1
|
+
import * as RNW from "react-native-web";
|
|
2
|
+
const rnw = RNW["TamaguiExports"];
|
|
8
3
|
export {
|
|
9
4
|
rnw
|
|
10
5
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/constants/rnw.tsx"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "AAAA,MAAM,
|
|
4
|
+
"sourcesContent": ["import * as RNW from 'react-native-web'\n\nexport const rnw = RNW['TamaguiExports']\n"],
|
|
5
|
+
"mappings": "AAAA;AAEO,MAAM,MAAM,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -78,33 +78,35 @@ const reducedStyleKeys = {
|
|
|
78
78
|
let shorthands = null;
|
|
79
79
|
function expandStyles(style) {
|
|
80
80
|
const res = {};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const { textShadowColor, textShadowOffset, textShadowRadius } = style;
|
|
94
|
-
if (textShadowColor || textShadowOffset || textShadowRadius) {
|
|
95
|
-
const { height, width } = textShadowOffset || defaultOffset;
|
|
96
|
-
const radius = textShadowRadius || 0;
|
|
97
|
-
const color = normalizeValueWithProperty(textShadowColor, "textShadowColor");
|
|
98
|
-
if (color && (height !== 0 || width !== 0 || radius !== 0)) {
|
|
99
|
-
const blurRadius = normalizeValueWithProperty(radius);
|
|
100
|
-
const offsetX = normalizeValueWithProperty(width);
|
|
101
|
-
const offsetY = normalizeValueWithProperty(height);
|
|
102
|
-
res.textShadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
81
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
82
|
+
const { boxShadow, shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style;
|
|
83
|
+
if (shadowRadius !== void 0) {
|
|
84
|
+
const { height, width } = shadowOffset || defaultOffset;
|
|
85
|
+
const offsetX = normalizeValueWithProperty(width || 0);
|
|
86
|
+
const offsetY = normalizeValueWithProperty(height || 0);
|
|
87
|
+
const blurRadius = normalizeValueWithProperty(shadowRadius || 0);
|
|
88
|
+
const color = normalizeColor(String(shadowColor || "black"), shadowOpacity);
|
|
89
|
+
const shadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
90
|
+
res.boxShadow = boxShadow ? `${boxShadow}, ${shadow}` : shadow;
|
|
91
|
+
} else if (boxShadow) {
|
|
92
|
+
res.boxShadow = boxShadow;
|
|
103
93
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
94
|
+
const { textShadowColor, textShadowOffset, textShadowRadius } = style;
|
|
95
|
+
if (textShadowColor || textShadowOffset || textShadowRadius) {
|
|
96
|
+
const { height, width } = textShadowOffset || defaultOffset;
|
|
97
|
+
const radius = textShadowRadius || 0;
|
|
98
|
+
const color = normalizeValueWithProperty(textShadowColor, "textShadowColor");
|
|
99
|
+
if (color && (height !== 0 || width !== 0 || radius !== 0)) {
|
|
100
|
+
const blurRadius = normalizeValueWithProperty(radius);
|
|
101
|
+
const offsetX = normalizeValueWithProperty(width);
|
|
102
|
+
const offsetY = normalizeValueWithProperty(height);
|
|
103
|
+
res.textShadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
for (const key in borderDefaults) {
|
|
107
|
+
if (key in style) {
|
|
108
|
+
res[borderDefaults[key]] = style[borderDefaults[key]] || "solid";
|
|
109
|
+
}
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
112
|
for (let key in style) {
|
|
@@ -201,6 +203,9 @@ function createAtomicRules(identifier, property, value, pseudo) {
|
|
|
201
203
|
return rules;
|
|
202
204
|
}
|
|
203
205
|
function expandStyle(key, value) {
|
|
206
|
+
if (process.env.TAMAGUI_TARGET !== "web") {
|
|
207
|
+
return [[key, value]];
|
|
208
|
+
}
|
|
204
209
|
if (key === "flex") {
|
|
205
210
|
if (value <= -1) {
|
|
206
211
|
return [
|
|
@@ -258,7 +263,7 @@ function expandStyle(key, value) {
|
|
|
258
263
|
return [key2, value];
|
|
259
264
|
});
|
|
260
265
|
} else {
|
|
261
|
-
if (
|
|
266
|
+
if (Array.isArray(value)) {
|
|
262
267
|
return [[key, value.join(",")]];
|
|
263
268
|
}
|
|
264
269
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/generateAtomicStyles.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Some parts adapted from react-native-web\n * Copyright (c) Nicolas Gallagher licensed under the MIT license.\n */\n\nimport { StyleObject, simpleHash } from '@tamagui/helpers'\nimport hyphenateStyleName from 'hyphenate-style-name'\nimport normalizeCSSColor from 'normalize-css-color'\nimport { TextStyle, ViewStyle } from 'react-native'\n\nimport { getConfig } from '../conf'\nimport { isWeb } from '../constants/platform'\nimport { reversedShorthands } from '../createTamagui'\nimport { PseudoDescriptor, pseudoDescriptors } from './pseudoDescriptors'\n\ntype Value = Object | Array<any> | string | number\nexport type Style = { [key: string]: Value }\n\nclass Cache {\n values: Record<string, any> = {}\n\n get(key: string, valStr: string) {\n return this.values[key]?.[valStr]\n }\n\n set(key: string, valStr: string, object: any) {\n this.values[key] ??= {}\n this.values[key][valStr] = object\n }\n}\n\nconst cache = new Cache()\n\nexport const generateAtomicStyles = (\n style: ViewStyle & TextStyle,\n pseudo?: PseudoDescriptor\n): StyleObject[] => {\n const res = expandStyles(style)\n const out: StyleObject[] = []\n for (const key in res) {\n const value = res[key]\n if (value != null && value != undefined) {\n const valueString = normalizeValueWithProperty(value, key)\n const uid = key + (pseudo?.name || '')\n const cachedResult = cache.get(uid, valueString)\n if (cachedResult != undefined) {\n out.push(cachedResult)\n } else {\n const hash = simpleHash(uid + valueString)\n const pseudoPrefix = pseudo ? `0${pseudo.name}-` : ''\n const shortProp = reversedShorthands[key] || key\n const identifier = `_${shortProp}-${pseudoPrefix}${hash}`\n const rules = createAtomicRules(identifier, key, valueString, pseudo)\n const styleObject: StyleObject = {\n property: key,\n pseudo: pseudo?.name,\n value,\n identifier,\n rules,\n }\n cache.set(uid, valueString, styleObject)\n out.push(styleObject)\n }\n }\n }\n return out\n}\n\nconst reducedStyleKeys = {\n shadowColor: true,\n shadowOffset: true,\n shadowOpacity: true,\n shadowRadius: true,\n textShadowColor: true,\n textShadowOffset: true,\n textShadowRadius: true,\n}\n\nlet shorthands: Record<string, string> | null = null\n\n// can likely remove this and include in other loops\nexport function expandStyles(style: any) {\n const res: Record<string, any> = {}\n\n // box-shadow\n const { boxShadow, shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style\n if (shadowRadius !== undefined) {\n const { height, width } = shadowOffset || defaultOffset\n const offsetX = normalizeValueWithProperty(width || 0)\n const offsetY = normalizeValueWithProperty(height || 0)\n const blurRadius = normalizeValueWithProperty(shadowRadius || 0)\n const color = normalizeColor(String(shadowColor || 'black'), shadowOpacity)\n const shadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`\n res.boxShadow = boxShadow ? `${boxShadow}, ${shadow}` : shadow\n } else if (boxShadow) {\n res.boxShadow = boxShadow\n }\n\n // text-shadow\n const { textShadowColor, textShadowOffset, textShadowRadius } = style\n if (textShadowColor || textShadowOffset || textShadowRadius) {\n const { height, width } = textShadowOffset || defaultOffset\n const radius = textShadowRadius || 0\n const color = normalizeValueWithProperty(textShadowColor, 'textShadowColor')\n if (color && (height !== 0 || width !== 0 || radius !== 0)) {\n const blurRadius = normalizeValueWithProperty(radius)\n const offsetX = normalizeValueWithProperty(width)\n const offsetY = normalizeValueWithProperty(height)\n res.textShadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`\n }\n }\n\n // ensure border style set by default to solid\n for (const key in borderDefaults) {\n if (key in style) {\n res[borderDefaults[key]] = style[borderDefaults[key]] || 'solid'\n }\n }\n\n for (let key in style) {\n shorthands = shorthands || getConfig().shorthands\n if (shorthands) {\n key = shorthands[key] || key\n }\n if (reducedStyleKeys[key]) continue\n if (key in pseudoDescriptors) {\n res[key] = expandStyles(style[key])\n } else {\n const val = normalizeValueWithProperty(style[key], key)\n const out = expandStyle(key, val)\n if (out) {\n Object.assign(res, Object.fromEntries(out))\n } else {\n res[key] = val\n }\n }\n }\n return res\n}\n\nconst borderDefaults = {\n borderWidth: 'borderStyle',\n borderBottomWidth: 'borderBottomStyle',\n borderTopWidth: 'borderTopStyle',\n borderLeftWidth: 'borderLeftStyle',\n borderRightWidth: 'borderRightStyle',\n}\n\nfunction createDeclarationBlock(style: Style, important = false) {\n let declarations = ''\n for (const key in style) {\n const prop = hyphenateStyleName(key)\n const value = style[key]\n declarations += `${prop}:${value}`\n }\n return `{${declarations}${important ? ` !important` : ''};}`\n}\n\nconst pseudoSelectorPrefixes = (() => {\n const res: Record<string, string> = {}\n for (const key in pseudoDescriptors) {\n const pseudo = pseudoDescriptors[key]\n res[pseudo.name] = [...Array(pseudo.priority)].map(() => ':root').join('') + ' '\n }\n return res\n})()\n\nfunction createAtomicRules(\n identifier: string,\n property: string,\n value: any,\n pseudo?: PseudoDescriptor\n): string[] {\n const selector = pseudo\n ? `${pseudoSelectorPrefixes[pseudo.name]} .${identifier}:${pseudo.name}`\n : `.${identifier}`\n const important = !!pseudo\n\n let rules: string[] = []\n\n // Handle non-standard properties and object values that require multiple\n // CSS rules to be created.\n switch (property) {\n // Equivalent to using '::placeholder'\n case 'placeholderTextColor': {\n const block = createDeclarationBlock({ color: value, opacity: 1 }, important)\n rules.push(`${selector}::placeholder${block}`)\n break\n }\n\n // Polyfill for additional 'pointer-events' values\n // See d13f78622b233a0afc0c7a200c0a0792c8ca9e58\n case 'pointerEvents': {\n let finalValue = value\n if (value === 'auto' || value === 'box-only') {\n finalValue = 'auto!important'\n if (value === 'box-only') {\n const block = createDeclarationBlock({ pointerEvents: 'none' }, important)\n rules.push(`${selector}>*${block}`)\n }\n } else if (value === 'none' || value === 'box-none') {\n finalValue = 'none!important'\n if (value === 'box-none') {\n const block = createDeclarationBlock({ pointerEvents: 'auto' }, important)\n rules.push(`${selector}>*${block}`)\n }\n }\n const block = createDeclarationBlock({ pointerEvents: finalValue }, important)\n rules.push(`${selector}${block}`)\n break\n }\n\n // Polyfill for draft spec\n // https://drafts.csswg.org/css-scrollbars-1/\n case 'scrollbarWidth': {\n if (value === 'none') {\n rules.push(`${selector}::-webkit-scrollbar{display:none}`)\n }\n const block = createDeclarationBlock({ scrollbarWidth: value }, important)\n rules.push(`${selector}${block}`)\n break\n }\n\n default: {\n const block = createDeclarationBlock({ [property]: value }, important)\n rules.push(`${selector}${block}`)\n break\n }\n }\n\n // hover styles need to be conditional\n // perhaps this can be generalized but for now lets just shortcut\n // and hardcode for hover styles, if we need to later we can\n // WEIRD SYNTAX, SEE:\n // https://stackoverflow.com/questions/40532204/media-query-for-devices-supporting-hover\n if (pseudo?.name === 'hover') {\n rules = rules.map((r) => `@media not all and (hover: none) { ${r} }`)\n }\n\n return rules\n}\n\nexport function expandStyle(key: string, value: any) {\n if (key === 'flex') {\n // The 'flex' property value in React Native must be a positive integer,\n // 0, or -1.\n if (value <= -1) {\n return [\n ['flexGrow', 0],\n ['flexShrink', 1],\n ['flexBasis', 'auto'],\n ]\n }\n // normalizing to better align with native\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n if (value >= 0) {\n return [\n ['flexGrow', value],\n ['flexShrink', 1],\n ]\n }\n return\n }\n\n // web only\n switch (key) {\n // Ignore some React Native styles\n case 'elevation':\n case 'overlayColor':\n case 'resizeMode':\n case 'tintColor': {\n break\n }\n\n case 'aspectRatio': {\n return [[key, value.toString()]]\n }\n\n // TODO: remove once this issue is fixed\n // https://github.com/rofrischmann/inline-style-prefixer/issues/159\n case 'backgroundClip': {\n if (value === 'text') {\n return [\n ['backgroundClip', value],\n ['WebkitBackgroundClip', value],\n ]\n }\n break\n }\n\n case 'textAlignVertical': {\n return [['verticalAlign', value === 'center' ? 'middle' : value]]\n }\n\n case 'textDecorationLine': {\n return [['textDecorationLine', value]]\n }\n\n case 'transform': {\n if (Array.isArray(value)) {\n return [[key, value.map(mapTransform).join(' ')]]\n }\n break\n }\n\n case 'writingDirection': {\n return [['direction', value]]\n }\n }\n\n const longKey = STYLE_SHORT_FORM_EXPANSIONS[key]\n if (longKey) {\n return longKey.map((key) => {\n return [key, value]\n })\n } else {\n if (isWeb && Array.isArray(value)) {\n return [[key, value.join(',')]]\n }\n }\n}\n\n// { scale: 2 } => 'scale(2)'\n// { translateX: 20 } => 'translateX(20px)'\n// { matrix: [1,2,3,4,5,6] } => 'matrix(1,2,3,4,5,6)'\nconst mapTransform = (transform) => {\n const type = Object.keys(transform)[0]\n const value = transform[type]\n if (type === 'matrix' || type === 'matrix3d') {\n return `${type}(${value.join(',')})`\n } else {\n const normalizedValue = normalizeValueWithProperty(value, type)\n return `${type}(${normalizedValue})`\n }\n}\n\nconst colorProps = {\n backgroundColor: true,\n borderColor: true,\n borderTopColor: true,\n borderRightColor: true,\n borderBottomColor: true,\n borderLeftColor: true,\n color: true,\n shadowColor: true,\n textDecorationColor: true,\n textShadowColor: true,\n}\n\nfunction normalizeValueWithProperty(value: any, property?: string): any {\n if (process.env.TAMAGUI_TARGET === 'web') {\n const shouldCoerceToPx =\n typeof value === 'number' &&\n (property === undefined || property === null || !unitlessNumbers[property])\n if (shouldCoerceToPx) {\n return `${value}px`\n }\n }\n if (property && colorProps[property]) {\n return normalizeColor(value)\n }\n return value\n}\n\nconst normalizeColor = (color?: number | string, opacity = 1): void | string => {\n if (color == null || color == undefined) {\n return\n }\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (typeof color === 'string' && isWebColor(color)) {\n return color\n }\n }\n const colorInt = processColor(color)\n if (colorInt != null) {\n const r = (colorInt >> 16) & 255\n const g = (colorInt >> 8) & 255\n const b = colorInt & 255\n const a = ((colorInt >> 24) & 255) / 255\n const alpha = (a * opacity).toFixed(2)\n return `rgba(${r},${g},${b},${alpha})`\n }\n return `${color}`\n}\n\nconst webColors = {\n currentColor: true,\n currentcolor: true,\n transparent: true,\n inherit: true,\n}\n\nconst isWebColor = (color: string): boolean => webColors[color] || color.indexOf('var(') === 0\n\nconst processColor = (color?: number | string): number | undefined | null => {\n if (color === undefined || color === null) {\n return color\n }\n let intColor = normalizeCSSColor(color)\n if (intColor === undefined || intColor === null) {\n return undefined\n }\n return ((+intColor << 24) | (+intColor >>> 8)) >>> 0\n}\n\nconst unitlessNumbers = {\n animationIterationCount: true,\n aspectRatio: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFleGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n flex: true,\n flexGrow: true,\n flexOrder: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n fontWeight: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowGap: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnGap: true,\n gridColumnStart: true,\n lineClamp: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true,\n scale: true,\n scaleX: true,\n scaleY: true,\n scaleZ: true,\n shadowOpacity: true,\n}\n\nconst defaultOffset = { height: 0, width: 0 }\n\nconst STYLE_SHORT_FORM_EXPANSIONS = {\n borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],\n borderRadius: [\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n 'borderBottomRightRadius',\n 'borderBottomLeftRadius',\n ],\n borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],\n borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n marginHorizontal: ['marginRight', 'marginLeft'],\n marginVertical: ['marginTop', 'marginBottom'],\n overscrollBehavior: ['overscrollBehaviorX', 'overscrollBehaviorY'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n paddingHorizontal: ['paddingRight', 'paddingLeft'],\n paddingVertical: ['paddingTop', 'paddingBottom'],\n ...(isWeb && {\n // react-native doesn't support X / Y\n overflow: ['overflowX', 'overflowY'],\n }),\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAKA;AACA;AACA;AAGA;AACA;AACA;AACA;AAKA,MAAM,MAAM;AAAA,EAAZ;AACE,kBAA8B,C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B,OAAY;AACvC,QAAM,MAA2B,CAAC;
|
|
4
|
+
"sourcesContent": ["/**\n * Some parts adapted from react-native-web\n * Copyright (c) Nicolas Gallagher licensed under the MIT license.\n */\n\nimport { StyleObject, simpleHash } from '@tamagui/helpers'\nimport hyphenateStyleName from 'hyphenate-style-name'\nimport normalizeCSSColor from 'normalize-css-color'\nimport { TextStyle, ViewStyle } from 'react-native'\n\nimport { getConfig } from '../conf'\nimport { isWeb } from '../constants/platform'\nimport { reversedShorthands } from '../createTamagui'\nimport { PseudoDescriptor, pseudoDescriptors } from './pseudoDescriptors'\n\ntype Value = Object | Array<any> | string | number\nexport type Style = { [key: string]: Value }\n\nclass Cache {\n values: Record<string, any> = {}\n\n get(key: string, valStr: string) {\n return this.values[key]?.[valStr]\n }\n\n set(key: string, valStr: string, object: any) {\n this.values[key] ??= {}\n this.values[key][valStr] = object\n }\n}\n\nconst cache = new Cache()\n\nexport const generateAtomicStyles = (\n style: ViewStyle & TextStyle,\n pseudo?: PseudoDescriptor\n): StyleObject[] => {\n const res = expandStyles(style)\n const out: StyleObject[] = []\n for (const key in res) {\n const value = res[key]\n if (value != null && value != undefined) {\n const valueString = normalizeValueWithProperty(value, key)\n const uid = key + (pseudo?.name || '')\n const cachedResult = cache.get(uid, valueString)\n if (cachedResult != undefined) {\n out.push(cachedResult)\n } else {\n const hash = simpleHash(uid + valueString)\n const pseudoPrefix = pseudo ? `0${pseudo.name}-` : ''\n const shortProp = reversedShorthands[key] || key\n const identifier = `_${shortProp}-${pseudoPrefix}${hash}`\n const rules = createAtomicRules(identifier, key, valueString, pseudo)\n const styleObject: StyleObject = {\n property: key,\n pseudo: pseudo?.name,\n value,\n identifier,\n rules,\n }\n cache.set(uid, valueString, styleObject)\n out.push(styleObject)\n }\n }\n }\n return out\n}\n\nconst reducedStyleKeys = {\n shadowColor: true,\n shadowOffset: true,\n shadowOpacity: true,\n shadowRadius: true,\n textShadowColor: true,\n textShadowOffset: true,\n textShadowRadius: true,\n}\n\nlet shorthands: Record<string, string> | null = null\n\n// can likely remove this and include in other loops\nexport function expandStyles(style: any) {\n const res: Record<string, any> = {}\n\n if (process.env.TAMAGUI_TARGET === 'web') {\n // box-shadow\n const { boxShadow, shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style\n if (shadowRadius !== undefined) {\n const { height, width } = shadowOffset || defaultOffset\n const offsetX = normalizeValueWithProperty(width || 0)\n const offsetY = normalizeValueWithProperty(height || 0)\n const blurRadius = normalizeValueWithProperty(shadowRadius || 0)\n const color = normalizeColor(String(shadowColor || 'black'), shadowOpacity)\n const shadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`\n res.boxShadow = boxShadow ? `${boxShadow}, ${shadow}` : shadow\n } else if (boxShadow) {\n res.boxShadow = boxShadow\n }\n\n // text-shadow\n const { textShadowColor, textShadowOffset, textShadowRadius } = style\n if (textShadowColor || textShadowOffset || textShadowRadius) {\n const { height, width } = textShadowOffset || defaultOffset\n const radius = textShadowRadius || 0\n const color = normalizeValueWithProperty(textShadowColor, 'textShadowColor')\n if (color && (height !== 0 || width !== 0 || radius !== 0)) {\n const blurRadius = normalizeValueWithProperty(radius)\n const offsetX = normalizeValueWithProperty(width)\n const offsetY = normalizeValueWithProperty(height)\n res.textShadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`\n }\n }\n\n // ensure border style set by default to solid\n for (const key in borderDefaults) {\n if (key in style) {\n res[borderDefaults[key]] = style[borderDefaults[key]] || 'solid'\n }\n }\n }\n\n for (let key in style) {\n shorthands = shorthands || getConfig().shorthands\n if (shorthands) {\n key = shorthands[key] || key\n }\n if (reducedStyleKeys[key]) continue\n if (key in pseudoDescriptors) {\n res[key] = expandStyles(style[key])\n } else {\n const val = normalizeValueWithProperty(style[key], key)\n const out = expandStyle(key, val)\n if (out) {\n Object.assign(res, Object.fromEntries(out))\n } else {\n res[key] = val\n }\n }\n }\n\n return res\n}\n\nconst borderDefaults = {\n borderWidth: 'borderStyle',\n borderBottomWidth: 'borderBottomStyle',\n borderTopWidth: 'borderTopStyle',\n borderLeftWidth: 'borderLeftStyle',\n borderRightWidth: 'borderRightStyle',\n}\n\nfunction createDeclarationBlock(style: Style, important = false) {\n let declarations = ''\n for (const key in style) {\n const prop = hyphenateStyleName(key)\n const value = style[key]\n declarations += `${prop}:${value}`\n }\n return `{${declarations}${important ? ` !important` : ''};}`\n}\n\nconst pseudoSelectorPrefixes = (() => {\n const res: Record<string, string> = {}\n for (const key in pseudoDescriptors) {\n const pseudo = pseudoDescriptors[key]\n res[pseudo.name] = [...Array(pseudo.priority)].map(() => ':root').join('') + ' '\n }\n return res\n})()\n\nfunction createAtomicRules(\n identifier: string,\n property: string,\n value: any,\n pseudo?: PseudoDescriptor\n): string[] {\n const selector = pseudo\n ? `${pseudoSelectorPrefixes[pseudo.name]} .${identifier}:${pseudo.name}`\n : `.${identifier}`\n const important = !!pseudo\n\n let rules: string[] = []\n\n // Handle non-standard properties and object values that require multiple\n // CSS rules to be created.\n switch (property) {\n // Equivalent to using '::placeholder'\n case 'placeholderTextColor': {\n const block = createDeclarationBlock({ color: value, opacity: 1 }, important)\n rules.push(`${selector}::placeholder${block}`)\n break\n }\n\n // Polyfill for additional 'pointer-events' values\n // See d13f78622b233a0afc0c7a200c0a0792c8ca9e58\n case 'pointerEvents': {\n let finalValue = value\n if (value === 'auto' || value === 'box-only') {\n finalValue = 'auto!important'\n if (value === 'box-only') {\n const block = createDeclarationBlock({ pointerEvents: 'none' }, important)\n rules.push(`${selector}>*${block}`)\n }\n } else if (value === 'none' || value === 'box-none') {\n finalValue = 'none!important'\n if (value === 'box-none') {\n const block = createDeclarationBlock({ pointerEvents: 'auto' }, important)\n rules.push(`${selector}>*${block}`)\n }\n }\n const block = createDeclarationBlock({ pointerEvents: finalValue }, important)\n rules.push(`${selector}${block}`)\n break\n }\n\n // Polyfill for draft spec\n // https://drafts.csswg.org/css-scrollbars-1/\n case 'scrollbarWidth': {\n if (value === 'none') {\n rules.push(`${selector}::-webkit-scrollbar{display:none}`)\n }\n const block = createDeclarationBlock({ scrollbarWidth: value }, important)\n rules.push(`${selector}${block}`)\n break\n }\n\n default: {\n const block = createDeclarationBlock({ [property]: value }, important)\n rules.push(`${selector}${block}`)\n break\n }\n }\n\n // hover styles need to be conditional\n // perhaps this can be generalized but for now lets just shortcut\n // and hardcode for hover styles, if we need to later we can\n // WEIRD SYNTAX, SEE:\n // https://stackoverflow.com/questions/40532204/media-query-for-devices-supporting-hover\n if (pseudo?.name === 'hover') {\n rules = rules.map((r) => `@media not all and (hover: none) { ${r} }`)\n }\n\n return rules\n}\n\nexport function expandStyle(key: string, value: any) {\n if (process.env.TAMAGUI_TARGET !== 'web') {\n return [[key, value]]\n }\n\n if (key === 'flex') {\n // The 'flex' property value in React Native must be a positive integer,\n // 0, or -1.\n if (value <= -1) {\n return [\n ['flexGrow', 0],\n ['flexShrink', 1],\n ['flexBasis', 'auto'],\n ]\n }\n // normalizing to better align with native\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n if (value >= 0) {\n return [\n ['flexGrow', value],\n ['flexShrink', 1],\n ]\n }\n return\n }\n\n // web only\n switch (key) {\n // Ignore some React Native styles\n case 'elevation':\n case 'overlayColor':\n case 'resizeMode':\n case 'tintColor': {\n break\n }\n\n case 'aspectRatio': {\n return [[key, value.toString()]]\n }\n\n // TODO: remove once this issue is fixed\n // https://github.com/rofrischmann/inline-style-prefixer/issues/159\n case 'backgroundClip': {\n if (value === 'text') {\n return [\n ['backgroundClip', value],\n ['WebkitBackgroundClip', value],\n ]\n }\n break\n }\n\n case 'textAlignVertical': {\n return [['verticalAlign', value === 'center' ? 'middle' : value]]\n }\n\n case 'textDecorationLine': {\n return [['textDecorationLine', value]]\n }\n\n case 'transform': {\n if (Array.isArray(value)) {\n return [[key, value.map(mapTransform).join(' ')]]\n }\n break\n }\n\n case 'writingDirection': {\n return [['direction', value]]\n }\n }\n\n const longKey = STYLE_SHORT_FORM_EXPANSIONS[key]\n if (longKey) {\n return longKey.map((key) => {\n return [key, value]\n })\n } else {\n if (Array.isArray(value)) {\n return [[key, value.join(',')]]\n }\n }\n}\n\n// { scale: 2 } => 'scale(2)'\n// { translateX: 20 } => 'translateX(20px)'\n// { matrix: [1,2,3,4,5,6] } => 'matrix(1,2,3,4,5,6)'\nconst mapTransform = (transform) => {\n const type = Object.keys(transform)[0]\n const value = transform[type]\n if (type === 'matrix' || type === 'matrix3d') {\n return `${type}(${value.join(',')})`\n } else {\n const normalizedValue = normalizeValueWithProperty(value, type)\n return `${type}(${normalizedValue})`\n }\n}\n\nconst colorProps = {\n backgroundColor: true,\n borderColor: true,\n borderTopColor: true,\n borderRightColor: true,\n borderBottomColor: true,\n borderLeftColor: true,\n color: true,\n shadowColor: true,\n textDecorationColor: true,\n textShadowColor: true,\n}\n\nfunction normalizeValueWithProperty(value: any, property?: string): any {\n if (process.env.TAMAGUI_TARGET === 'web') {\n const shouldCoerceToPx =\n typeof value === 'number' &&\n (property === undefined || property === null || !unitlessNumbers[property])\n if (shouldCoerceToPx) {\n return `${value}px`\n }\n }\n if (property && colorProps[property]) {\n return normalizeColor(value)\n }\n return value\n}\n\nconst normalizeColor = (color?: number | string, opacity = 1): void | string => {\n if (color == null || color == undefined) {\n return\n }\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (typeof color === 'string' && isWebColor(color)) {\n return color\n }\n }\n const colorInt = processColor(color)\n if (colorInt != null) {\n const r = (colorInt >> 16) & 255\n const g = (colorInt >> 8) & 255\n const b = colorInt & 255\n const a = ((colorInt >> 24) & 255) / 255\n const alpha = (a * opacity).toFixed(2)\n return `rgba(${r},${g},${b},${alpha})`\n }\n return `${color}`\n}\n\nconst webColors = {\n currentColor: true,\n currentcolor: true,\n transparent: true,\n inherit: true,\n}\n\nconst isWebColor = (color: string): boolean => webColors[color] || color.indexOf('var(') === 0\n\nconst processColor = (color?: number | string): number | undefined | null => {\n if (color === undefined || color === null) {\n return color\n }\n let intColor = normalizeCSSColor(color)\n if (intColor === undefined || intColor === null) {\n return undefined\n }\n return ((+intColor << 24) | (+intColor >>> 8)) >>> 0\n}\n\nconst unitlessNumbers = {\n animationIterationCount: true,\n aspectRatio: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFleGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n flex: true,\n flexGrow: true,\n flexOrder: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n fontWeight: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowGap: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnGap: true,\n gridColumnStart: true,\n lineClamp: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true,\n scale: true,\n scaleX: true,\n scaleY: true,\n scaleZ: true,\n shadowOpacity: true,\n}\n\nconst defaultOffset = { height: 0, width: 0 }\n\nconst STYLE_SHORT_FORM_EXPANSIONS = {\n borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],\n borderRadius: [\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n 'borderBottomRightRadius',\n 'borderBottomLeftRadius',\n ],\n borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],\n borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n marginHorizontal: ['marginRight', 'marginLeft'],\n marginVertical: ['marginTop', 'marginBottom'],\n overscrollBehavior: ['overscrollBehaviorX', 'overscrollBehaviorY'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n paddingHorizontal: ['paddingRight', 'paddingLeft'],\n paddingVertical: ['paddingTop', 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A,EACjB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,aAAa;AAAA,EACb,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,eAAe;AACjB;AAEA,MAAM,gBAAgB,EAAE,QAAQ,GAAG,OAAO,EAAE;AAE5C,MAAM,8BAA8B;AAAA,EAClC,aAAa,CAAC,kBAAkB,oBAAoB,qBAAqB,iBAAiB;AAAA,EAC1F,cAAc;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,aAAa,CAAC,kBAAkB,oBAAoB,qBAAqB,iBAAiB;AAAA,EAC1F,aAAa,CAAC,kBAAkB,oBAAoB,qBAAqB,iBAAiB;AAAA,EAC1F,QAAQ,CAAC,aAAa,eAAe,gBAAgB,YAAY;AAAA,EACjE,kBAAkB,CAAC,eAAe,YAAY;AAAA,EAC9C,gBAAgB,CAAC,aAAa,cAAc;AAAA,EAC5C,oBAAoB,CAAC,uBAAuB,qBAAqB;AAAA,EACjE,SAAS,CAAC,cAAc,gBAAgB,iBAAiB,aAAa;AAAA,EACtE,mBAAmB,CAAC,gBAAgB,aAAa;AAAA,EACjD,iBAAiB,CAAC,cAAc,eAAe;AAAA,GAC3C,SAAS;AAAA,EAEX,UAAU,CAAC,aAAa,WAAW;AACrC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -71,47 +71,49 @@ const getSplitStyles = (props, staticConfig, theme, state, defaultClassNames, de
|
|
|
71
71
|
let transforms = null;
|
|
72
72
|
let rulesToInsert = null;
|
|
73
73
|
function addStyle(prop, rule) {
|
|
74
|
-
if (
|
|
75
|
-
if (updateInsertedCache(prop, rule)) {
|
|
74
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
75
|
+
if (updateInsertedCache(prop, rule) || !isClient && process.env.NODE_ENV === "production") {
|
|
76
76
|
rulesToInsert = rulesToInsert || [];
|
|
77
77
|
rulesToInsert.push([prop, rule]);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
function mergeClassName(key, val, isMediaOrPseudo = false) {
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (
|
|
93
|
-
|
|
82
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
83
|
+
if (!val)
|
|
84
|
+
return;
|
|
85
|
+
if (val.startsWith("_transform-")) {
|
|
86
|
+
const namespace = isMediaOrPseudo ? key : "transform";
|
|
87
|
+
let transform = insertedTransforms[val];
|
|
88
|
+
if (isClient) {
|
|
89
|
+
if (!transform) {
|
|
90
|
+
updateInserted();
|
|
91
|
+
transform = insertedTransforms[val];
|
|
92
|
+
if (process.env.NODE_ENV === "development") {
|
|
93
|
+
if (!transform) {
|
|
94
|
+
console.warn("no transform found", { insertedTransforms, val });
|
|
95
|
+
}
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
if (!transform) {
|
|
99
|
+
if (isWeb && val[0] !== "_") {
|
|
100
|
+
transform = val;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
104
|
+
console.log(" \xBB getSplitStyles mergeClassName transform", { key, val, namespace, transform, insertedTransforms });
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
transforms = transforms || {};
|
|
108
|
+
transforms[namespace] = transforms[namespace] || ["", ""];
|
|
109
|
+
const identifier = val.replace("_transform", "");
|
|
110
|
+
transforms[namespace][0] += identifier;
|
|
111
|
+
if (transform) {
|
|
112
|
+
transforms[namespace][1] += transform;
|
|
104
113
|
}
|
|
114
|
+
} else {
|
|
115
|
+
classNames[key] = val;
|
|
105
116
|
}
|
|
106
|
-
transforms = transforms || {};
|
|
107
|
-
transforms[namespace] = transforms[namespace] || ["", ""];
|
|
108
|
-
const identifier = val.replace("_transform", "");
|
|
109
|
-
transforms[namespace][0] += identifier;
|
|
110
|
-
if (transform) {
|
|
111
|
-
transforms[namespace][1] += transform;
|
|
112
|
-
}
|
|
113
|
-
} else {
|
|
114
|
-
classNames[key] = val;
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
119
|
const propKeys = Object.keys(props);
|
|
@@ -149,45 +151,47 @@ const getSplitStyles = (props, staticConfig, theme, state, defaultClassNames, de
|
|
|
149
151
|
}
|
|
150
152
|
continue;
|
|
151
153
|
}
|
|
152
|
-
if (
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
154
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
155
|
+
if (keyInit === "className") {
|
|
156
|
+
let nonTamaguis = "";
|
|
157
|
+
if (!valInit)
|
|
158
|
+
continue;
|
|
159
|
+
for (const cn of valInit.split(" ")) {
|
|
160
|
+
if (cn[0] === "_") {
|
|
161
|
+
const [shorthand, mediaOrPseudo] = cn.slice(1).split("-");
|
|
162
|
+
const isMedia2 = mediaOrPseudo[0] === "_";
|
|
163
|
+
const isPseudo2 = mediaOrPseudo[0] === "0";
|
|
164
|
+
const isMediaOrPseudo2 = isMedia2 || isPseudo2;
|
|
165
|
+
let fullKey = conf.shorthands[shorthand];
|
|
166
|
+
if (isMedia2) {
|
|
167
|
+
let mediaShortKey = mediaOrPseudo.slice(1);
|
|
168
|
+
mediaShortKey = mediaShortKey.slice(0, mediaShortKey.indexOf("_"));
|
|
169
|
+
fullKey += `${PROP_SPLIT}${mediaShortKey}`;
|
|
170
|
+
} else if (isPseudo2) {
|
|
171
|
+
const pseudoShortKey = mediaOrPseudo.slice(1);
|
|
172
|
+
fullKey += `${PROP_SPLIT}${pseudoShortKey}`;
|
|
173
|
+
}
|
|
174
|
+
usedKeys.add(fullKey);
|
|
175
|
+
mergeClassName(fullKey, cn, isMediaOrPseudo2);
|
|
176
|
+
} else {
|
|
177
|
+
nonTamaguis += " " + cn;
|
|
170
178
|
}
|
|
171
|
-
usedKeys.add(fullKey);
|
|
172
|
-
mergeClassName(fullKey, cn, isMediaOrPseudo2);
|
|
173
|
-
} else {
|
|
174
|
-
nonTamaguis += " " + cn;
|
|
175
179
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
if (valInit && valInit[0] === "_") {
|
|
184
|
-
const isValidClassName = validStyles[keyInit];
|
|
185
|
-
const isMediaOrPseudo2 = !isValidClassName && keyInit.includes(PROP_SPLIT) && validStyles[keyInit.split(PROP_SPLIT)[0]];
|
|
186
|
-
if (isValidClassName || isMediaOrPseudo2) {
|
|
187
|
-
usedKeys.add(keyInit);
|
|
188
|
-
mergeClassName(keyInit, valInit, isMediaOrPseudo2);
|
|
180
|
+
if (nonTamaguis) {
|
|
181
|
+
usedKeys.add(keyInit);
|
|
182
|
+
mergeClassName(keyInit, nonTamaguis);
|
|
183
|
+
}
|
|
189
184
|
continue;
|
|
190
185
|
}
|
|
186
|
+
if (valInit && valInit[0] === "_") {
|
|
187
|
+
const isValidClassName = validStyles[keyInit];
|
|
188
|
+
const isMediaOrPseudo2 = !isValidClassName && keyInit.includes(PROP_SPLIT) && validStyles[keyInit.split(PROP_SPLIT)[0]];
|
|
189
|
+
if (isValidClassName || isMediaOrPseudo2) {
|
|
190
|
+
usedKeys.add(keyInit);
|
|
191
|
+
mergeClassName(keyInit, valInit, isMediaOrPseudo2);
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
191
195
|
}
|
|
192
196
|
if (state.keepVariantsAsProps && staticConfig.defaultVariants && keyInit in staticConfig.defaultVariants) {
|
|
193
197
|
viewProps[keyInit] = valInit;
|
|
@@ -316,21 +320,23 @@ const getSplitStyles = (props, staticConfig, theme, state, defaultClassNames, de
|
|
|
316
320
|
}
|
|
317
321
|
}
|
|
318
322
|
}
|
|
319
|
-
if (
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
if (
|
|
329
|
-
|
|
330
|
-
|
|
323
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
324
|
+
if (transforms) {
|
|
325
|
+
for (const namespace in transforms) {
|
|
326
|
+
if (!transforms[namespace]) {
|
|
327
|
+
console.warn("Error no transform");
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
const [hash, val] = transforms[namespace];
|
|
331
|
+
const identifier = `_transform${hash}`;
|
|
332
|
+
if (isClient) {
|
|
333
|
+
if (!insertedTransforms[identifier]) {
|
|
334
|
+
const rule = `.${identifier} { transform: ${val}; }`;
|
|
335
|
+
addStyle(identifier, rule);
|
|
336
|
+
}
|
|
331
337
|
}
|
|
338
|
+
classNames[namespace] = identifier;
|
|
332
339
|
}
|
|
333
|
-
classNames[namespace] = identifier;
|
|
334
340
|
}
|
|
335
341
|
}
|
|
336
342
|
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|