@tamagui/core 1.0.1-beta.26 → 1.0.1-beta.29
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/ThemeManager.js +21 -10
- package/dist/cjs/ThemeManager.js.map +2 -2
- package/dist/cjs/constants/platform.js +6 -6
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/rnw.js.map +2 -2
- package/dist/cjs/createComponent.js +23 -20
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createTamagui.js +10 -2
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/helpers/createMediaStyle.js +1 -0
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +9 -39
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/generateAtomicStyles.js +453 -0
- package/dist/cjs/helpers/generateAtomicStyles.js.map +7 -0
- package/dist/cjs/helpers/getSplitStyles.js +67 -65
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +31 -40
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/mergeTransform.js +42 -0
- package/dist/cjs/helpers/mergeTransform.js.map +7 -0
- package/dist/cjs/helpers/prefixStyles.js +192 -0
- package/dist/cjs/helpers/prefixStyles.js.map +7 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +1 -1
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useTheme.js +8 -7
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +1 -1
- package/dist/cjs/views/ThemeProvider.js.map +2 -2
- package/dist/cjs/views/ThemeReset.js +1 -0
- package/dist/cjs/views/ThemeReset.js.map +2 -2
- package/dist/esm/ThemeManager.js +21 -10
- package/dist/esm/ThemeManager.js.map +2 -2
- package/dist/esm/constants/platform.js +4 -4
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/constants/rnw.js.map +2 -2
- package/dist/esm/createComponent.js +24 -20
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createTamagui.js +8 -1
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/helpers/createMediaStyle.js +1 -0
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +9 -40
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/generateAtomicStyles.js +425 -0
- package/dist/esm/helpers/generateAtomicStyles.js.map +7 -0
- package/dist/esm/helpers/getSplitStyles.js +70 -73
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +26 -39
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/mergeTransform.js +19 -0
- package/dist/esm/helpers/mergeTransform.js.map +7 -0
- package/dist/esm/helpers/prefixStyles.js +166 -0
- package/dist/esm/helpers/prefixStyles.js.map +7 -0
- package/dist/esm/hooks/useIsTouchDevice.js +2 -2
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useTheme.js +8 -7
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +1 -1
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/dist/esm/views/ThemeReset.js +1 -0
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/dist/jsx/ThemeManager.js +21 -10
- package/dist/jsx/constants/platform.js +4 -4
- package/dist/jsx/createComponent.js +24 -20
- package/dist/jsx/createTamagui.js +8 -1
- package/dist/jsx/helpers/createMediaStyle.js +1 -0
- package/dist/jsx/helpers/createPropMapper.js +9 -40
- package/dist/jsx/helpers/generateAtomicStyles.js +424 -0
- package/dist/jsx/helpers/getSplitStyles.js +70 -73
- package/dist/jsx/helpers/getStylesAtomic.js +26 -39
- package/dist/jsx/helpers/mergeTransform.js +18 -0
- package/dist/jsx/helpers/prefixStyles.js +165 -0
- package/dist/jsx/hooks/useIsTouchDevice.js +2 -2
- package/dist/jsx/hooks/useTheme.js +8 -7
- package/dist/jsx/views/ThemeProvider.js +1 -1
- package/dist/jsx/views/ThemeReset.js +1 -1
- package/package.json +8 -5
- package/reset.css +3 -2
- package/types/Tamagui.d.ts +1 -1
- package/types/Tamagui.d.ts.map +1 -1
- package/types/ThemeManager.d.ts +9 -6
- package/types/ThemeManager.d.ts.map +1 -1
- package/types/constants/platform.d.ts +2 -2
- package/types/constants/platform.d.ts.map +1 -1
- package/types/constants/rnw.d.ts +1 -1
- package/types/constants/rnw.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts +1 -0
- package/types/createTamagui.d.ts.map +1 -1
- package/types/helpers/createMediaStyle.d.ts.map +1 -1
- package/types/helpers/createPropMapper.d.ts +2 -2
- package/types/helpers/createPropMapper.d.ts.map +1 -1
- package/types/helpers/generateAtomicStyles.d.ts +22 -0
- package/types/helpers/generateAtomicStyles.d.ts.map +1 -0
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts +10 -10
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/mergeTransform.d.ts +7 -0
- package/types/helpers/mergeTransform.d.ts.map +1 -0
- package/types/helpers/prefixStyles.d.ts +5 -0
- package/types/helpers/prefixStyles.d.ts.map +1 -0
- package/types/hooks/useTheme.d.ts +13 -4
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/types.d.ts +3 -4
- package/types/types.d.ts.map +1 -1
- package/types/views/Theme.d.ts +1 -9
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +1 -0
- package/types/views/ThemeProvider.d.ts.map +1 -1
|
@@ -3,6 +3,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
3
3
|
import { getConfig } from "../conf";
|
|
4
4
|
import { isWeb } from "../constants/platform";
|
|
5
5
|
import { isVariable } from "../createVariable";
|
|
6
|
+
import { expandStyle, expandStyles } from "./generateAtomicStyles";
|
|
6
7
|
import { getVariantExtras } from "./getVariantExtras";
|
|
7
8
|
import { isObj } from "./isObj";
|
|
8
9
|
function getVariantFunction(variant, key, value) {
|
|
@@ -32,12 +33,14 @@ __name(getVariantFunction, "getVariantFunction");
|
|
|
32
33
|
const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
|
|
33
34
|
const variants = staticConfig.variants || {};
|
|
34
35
|
const defaultProps = staticConfig.defaultProps || {};
|
|
35
|
-
|
|
36
|
+
const mapper = /* @__PURE__ */ __name((key, value, theme, propsIn, state, avoidDefaultProps = false) => {
|
|
36
37
|
const conf = getConfig();
|
|
37
38
|
if (!conf) {
|
|
38
39
|
console.trace("no conf! err");
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
42
|
+
const props = state.fallbackProps || propsIn;
|
|
43
|
+
const returnVariablesAs = state.resolveVariablesAs || !!props.animation ? "value" : "auto";
|
|
41
44
|
const fontFamily = props.fontFamily || defaultProps.fontFamily || "$body";
|
|
42
45
|
const variant = variants && variants[key];
|
|
43
46
|
if (variant && value !== void 0) {
|
|
@@ -50,16 +53,15 @@ const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
|
|
|
50
53
|
if (isObj(variantValue)) {
|
|
51
54
|
variantValue = resolveTokens(variantValue, conf, theme, fontFamily, returnVariablesAs);
|
|
52
55
|
}
|
|
53
|
-
return
|
|
56
|
+
return Object.entries(expandStyles(variantValue));
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
|
-
let shouldReturn =
|
|
59
|
+
let shouldReturn = value !== void 0 && value !== null;
|
|
57
60
|
if (conf.shorthands[key]) {
|
|
58
61
|
shouldReturn = true;
|
|
59
62
|
key = conf.shorthands[key];
|
|
60
63
|
}
|
|
61
64
|
if (value) {
|
|
62
|
-
shouldReturn = true;
|
|
63
65
|
if (value[0] === "$") {
|
|
64
66
|
value = getToken(key, value, conf, theme, fontFamily, returnVariablesAs);
|
|
65
67
|
} else if (isVariable(value)) {
|
|
@@ -67,11 +69,10 @@ const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
|
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
if (shouldReturn) {
|
|
70
|
-
return
|
|
71
|
-
[key]: value
|
|
72
|
-
});
|
|
72
|
+
return expandStyle(key, value) || [[key, value]];
|
|
73
73
|
}
|
|
74
|
-
};
|
|
74
|
+
}, "mapper");
|
|
75
|
+
return mapper;
|
|
75
76
|
}, "createPropMapper");
|
|
76
77
|
const resolveTokens = /* @__PURE__ */ __name((input, conf, theme, fontFamily, resolveAs) => {
|
|
77
78
|
var _a;
|
|
@@ -194,38 +195,6 @@ const tokenCategories = {
|
|
|
194
195
|
borderRightColor: true
|
|
195
196
|
}
|
|
196
197
|
};
|
|
197
|
-
const sidesX = ["Left", "Right"];
|
|
198
|
-
const sidesY = ["Top", "Bottom"];
|
|
199
|
-
const sidesXY = [...sidesX, ...sidesY];
|
|
200
|
-
const expand = {
|
|
201
|
-
padding: sidesXY.map((x) => `padding${x}`),
|
|
202
|
-
paddingHorizontal: sidesX.map((x) => `padding${x}`),
|
|
203
|
-
paddingVertical: sidesY.map((x) => `padding${x}`),
|
|
204
|
-
margin: sidesXY.map((x) => `margin${x}`),
|
|
205
|
-
marginHorizontal: sidesX.map((x) => `margin${x}`),
|
|
206
|
-
marginVertical: sidesY.map((x) => `margin${x}`),
|
|
207
|
-
borderWidth: sidesXY.map((x) => `border${x}Width`)
|
|
208
|
-
};
|
|
209
|
-
function expansions(styleObj) {
|
|
210
|
-
var _a, _b;
|
|
211
|
-
for (const key in expand) {
|
|
212
|
-
if (key in styleObj) {
|
|
213
|
-
for (const expandKey of expand[key]) {
|
|
214
|
-
styleObj[expandKey] = styleObj[key];
|
|
215
|
-
}
|
|
216
|
-
delete styleObj[key];
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
if ("flex" in styleObj) {
|
|
220
|
-
if (typeof styleObj.flex === "number") {
|
|
221
|
-
styleObj.flexGrow = (_a = styleObj.flexGrow) != null ? _a : styleObj.flex;
|
|
222
|
-
styleObj.flexShrink = (_b = styleObj.flexShrink) != null ? _b : 1;
|
|
223
|
-
delete styleObj.flex;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
return styleObj;
|
|
227
|
-
}
|
|
228
|
-
__name(expansions, "expansions");
|
|
229
198
|
export {
|
|
230
199
|
createPropMapper
|
|
231
200
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/createPropMapper.ts"],
|
|
4
|
-
"sourcesContent": ["import { getConfig } from '../conf'\nimport { isWeb } from '../constants/platform'\nimport { Variable, isVariable } from '../createVariable'\nimport {
|
|
5
|
-
"mappings": ";;AAAA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["import { getConfig } from '../conf'\nimport { isWeb } from '../constants/platform'\nimport { Variable, isVariable } from '../createVariable'\nimport {\n PropMapper,\n SplitStyleState,\n StaticConfig,\n TamaguiInternalConfig,\n ThemeObject,\n VariantSpreadFunction,\n} from '../types'\nimport { expandStyle, expandStyles } from './generateAtomicStyles'\nimport { getVariantExtras } from './getVariantExtras'\nimport { isObj } from './isObj'\n\nexport type ResolveVariableTypes = 'auto' | 'value' | 'variable' | 'both'\n\n// goes through specificity finding best matching variant function\nfunction getVariantFunction(variant: any, key: string, value: any) {\n if (typeof variant === 'function') {\n return variant\n }\n for (const cat in tokenCategories) {\n if (key in tokenCategories[cat]) {\n const spreadVariant = variant[`...${cat}`]\n if (spreadVariant) {\n return spreadVariant\n }\n }\n }\n let fn: any\n if (typeof value === 'number') {\n fn = variant[':number']\n } else if (typeof value === 'string') {\n fn = variant[':string']\n } else if (value === true || value === false) {\n fn = variant[':boolean']\n }\n fn = fn || variant[value]\n // fallback to size ultimately - could do token level detection\n return fn || variant['...'] || variant['...size']\n}\n\nexport const createPropMapper = (staticConfig: Partial<StaticConfig>) => {\n const variants = staticConfig.variants || {}\n const defaultProps = staticConfig.defaultProps || {}\n\n const mapper: PropMapper = (key, value, theme, propsIn, state, avoidDefaultProps = false) => {\n const conf = getConfig()\n if (!conf) {\n console.trace('no conf! err')\n return\n }\n\n const props = state.fallbackProps || propsIn\n const returnVariablesAs = state.resolveVariablesAs || !!props.animation ? 'value' : 'auto'\n\n // handled here because we need to resolve this off tokens, its the only one-off like this\n const fontFamily = props.fontFamily || defaultProps.fontFamily || '$body'\n const variant = variants && variants[key]\n\n if (variant && value !== undefined) {\n let variantValue = getVariantFunction(variant, key, value)\n\n if (variantValue) {\n if (typeof variantValue === 'function') {\n const fn = variantValue as VariantSpreadFunction<any>\n variantValue = fn(value, getVariantExtras(props, theme, defaultProps, avoidDefaultProps))\n }\n\n if (isObj(variantValue)) {\n variantValue = resolveTokens(variantValue, conf, theme, fontFamily, returnVariablesAs)\n }\n\n return Object.entries(expandStyles(variantValue))\n }\n }\n\n let shouldReturn = value !== undefined && value !== null\n\n // handle shorthands\n if (conf.shorthands[key]) {\n shouldReturn = true\n key = conf.shorthands[key]\n }\n\n if (value) {\n if (value[0] === '$') {\n value = getToken(key, value, conf, theme, fontFamily, returnVariablesAs)\n } else if (isVariable(value)) {\n value = getVariableValue(value, returnVariablesAs)\n }\n }\n\n if (shouldReturn) {\n return expandStyle(key, value) || [[key, value]]\n }\n }\n\n return mapper\n}\n\nconst resolveTokens = (\n input: Object,\n conf: TamaguiInternalConfig,\n theme: any,\n fontFamily: any,\n resolveAs?: ResolveVariableTypes\n) => {\n let res = {}\n for (const rKey in input) {\n const fKey = conf.shorthands[rKey] || rKey\n const val = input[rKey]\n if (isVariable(val)) {\n res[fKey] =\n resolveAs === 'variable' ? val : !isWeb || resolveAs === 'value' ? val.val : val.variable\n } else if (typeof val === 'string') {\n const fVal = val[0] === '$' ? getToken(fKey, val, conf, theme, fontFamily, resolveAs) : val\n res[fKey] = fVal\n } else {\n if (isObj(val)) {\n // for things like shadowOffset, hoverStyle which is a sub-object\n res[fKey] = resolveTokens(val, conf, theme, fontFamily, resolveAs)\n } else {\n // nullish values cant be tokens so need no exrta parsing\n res[fKey] = input[fKey]\n }\n }\n if (process.env.NODE_ENV === 'development') {\n if (res[fKey]?.[0] === '$') {\n console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey])\n }\n }\n }\n return res\n}\n\nconst fontShorthand = {\n fontSize: 'size',\n fontWeight: 'weight',\n}\n\nconst getToken = (\n key: string,\n value: string,\n { tokensParsed, fontsParsed }: TamaguiInternalConfig,\n theme: any,\n fontFamily: string | undefined = '$body',\n resolveAs?: ResolveVariableTypes\n) => {\n let valOrVar: any\n let hasSet = false\n if (value in theme) {\n valOrVar = theme[value]\n hasSet = true\n } else {\n switch (key) {\n case 'fontFamily':\n valOrVar = fontsParsed[value]?.family || value\n hasSet = true\n break\n case 'fontSize':\n case 'lineHeight':\n case 'letterSpacing':\n case 'fontWeight':\n valOrVar = fontsParsed[fontFamily]?.[fontShorthand[key] || key]?.[value] || value\n hasSet = true\n break\n }\n for (const cat in tokenCategories) {\n if (key in tokenCategories[cat]) {\n const res = tokensParsed[cat][value]\n if (res) {\n valOrVar = res\n hasSet = true\n }\n }\n }\n if (!hasSet) {\n const spaceVar = tokensParsed.space[value]\n if (spaceVar) {\n valOrVar = spaceVar\n hasSet = true\n }\n }\n }\n if (hasSet) {\n return getVariableValue(valOrVar, resolveAs)\n }\n if (process.env.NODE_ENV === 'development') {\n if (value && value[0] === '$') {\n console.warn(`\u26A0\uFE0F Missing token:`, key, value, fontFamily, theme, fontsParsed)\n return null\n }\n }\n return value\n}\n\nfunction getVariableValue(valOrVar: Variable | any, resolveAs: ResolveVariableTypes = 'auto') {\n if (isVariable(valOrVar)) {\n if (resolveAs === 'variable') {\n return valOrVar\n }\n if (!isWeb || resolveAs === 'value') {\n return valOrVar.val\n }\n return valOrVar.variable\n }\n return valOrVar\n}\n\n// just specificy the least costly, all else go to `space` (most keys - we can exclude)\nconst tokenCategories = {\n radius: {\n borderRadius: true,\n },\n size: {\n width: true,\n height: true,\n minWidth: true,\n minHeight: true,\n maxWidth: true,\n maxHeight: true,\n padding: true,\n paddingLeft: true,\n paddingRight: true,\n paddingTop: true,\n paddingBottom: true,\n paddingVertical: true,\n paddingHorizontal: true,\n },\n color: {\n color: true,\n backgroundColor: true,\n borderColor: true,\n borderBottomColor: true,\n borderTopColor: true,\n borderLeftColor: true,\n borderRightColor: true,\n },\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA;AACA;AACA;AASA;AACA;AACA;AAKA,4BAA4B,SAAc,KAAa,OAAY;AACjE,MAAI,OAAO,YAAY,YAAY;AACjC,WAAO;AAAA,EACT;AACA,aAAW,OAAO,iBAAiB;AACjC,QAAI,OAAO,gBAAgB,MAAM;AAC/B,YAAM,gBAAgB,QAAQ,MAAM;AACpC,UAAI,eAAe;AACjB,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACA,MAAI;AACJ,MAAI,OAAO,UAAU,UAAU;AAC7B,SAAK,QAAQ;AAAA,EACf,WAAW,OAAO,UAAU,UAAU;AACpC,SAAK,QAAQ;AAAA,EACf,WAAW,UAAU,QAAQ,UAAU,OAAO;AAC5C,SAAK,QAAQ;AAAA,EACf;AACA,OAAK,MAAM,QAAQ;AAEnB,SAAO,MAAM,QAAQ,UAAU,QAAQ;AACzC;AAvBS;AAyBF,MAAM,mBAAmB,wBAAC,iBAAwC;AACvE,QAAM,WAAW,aAAa,YAAY,CAAC;AAC3C,QAAM,eAAe,aAAa,gBAAgB,CAAC;AAEnD,QAAM,SAAqB,wBAAC,KAAK,OAAO,OAAO,SAAS,OAAO,oBAAoB,UAAU;AAC3F,UAAM,OAAO,UAAU;AACvB,QAAI,CAAC,MAAM;AACT,c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target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { simpleHash } from "@tamagui/helpers";
|
|
4
|
+
import hyphenateStyleName from "hyphenate-style-name";
|
|
5
|
+
import normalizeCSSColor from "normalize-css-color";
|
|
6
|
+
import { isWeb } from "../constants/platform";
|
|
7
|
+
import { prefixInlineStyles, prefixStyles } from "./prefixStyles";
|
|
8
|
+
function expandStyles(style) {
|
|
9
|
+
const res = {};
|
|
10
|
+
for (const key in style) {
|
|
11
|
+
updateReactDOMStyle(res, key, style[key]);
|
|
12
|
+
}
|
|
13
|
+
return res;
|
|
14
|
+
}
|
|
15
|
+
__name(expandStyles, "expandStyles");
|
|
16
|
+
function inline(style) {
|
|
17
|
+
return prefixInlineStyles(expandStyles(style));
|
|
18
|
+
}
|
|
19
|
+
__name(inline, "inline");
|
|
20
|
+
const STYLE_SHORT_FORM_EXPANSIONS = {
|
|
21
|
+
borderColor: ["borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor"],
|
|
22
|
+
borderRadius: [
|
|
23
|
+
"borderTopLeftRadius",
|
|
24
|
+
"borderTopRightRadius",
|
|
25
|
+
"borderBottomRightRadius",
|
|
26
|
+
"borderBottomLeftRadius"
|
|
27
|
+
],
|
|
28
|
+
borderStyle: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
|
|
29
|
+
borderWidth: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
|
|
30
|
+
margin: ["marginTop", "marginRight", "marginBottom", "marginLeft"],
|
|
31
|
+
marginHorizontal: ["marginRight", "marginLeft"],
|
|
32
|
+
marginVertical: ["marginTop", "marginBottom"],
|
|
33
|
+
overflow: ["overflowX", "overflowY"],
|
|
34
|
+
overscrollBehavior: ["overscrollBehaviorX", "overscrollBehaviorY"],
|
|
35
|
+
padding: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
|
|
36
|
+
paddingHorizontal: ["paddingRight", "paddingLeft"],
|
|
37
|
+
paddingVertical: ["paddingTop", "paddingBottom"]
|
|
38
|
+
};
|
|
39
|
+
const generateAtomicStyles = /* @__PURE__ */ __name((style) => {
|
|
40
|
+
const res = expandStyles(style);
|
|
41
|
+
if (style.shadowColor != null || style.shadowOffset != null || style.shadowOpacity != null || style.shadowRadius != null) {
|
|
42
|
+
boxShadowReducer(res, style);
|
|
43
|
+
}
|
|
44
|
+
if (style.textShadowColor != null || style.textShadowOffset != null || style.textShadowRadius != null) {
|
|
45
|
+
textShadowReducer(res, style);
|
|
46
|
+
}
|
|
47
|
+
const out = {};
|
|
48
|
+
for (const key in res) {
|
|
49
|
+
const value = res[key];
|
|
50
|
+
if (value != null) {
|
|
51
|
+
const valueString = stringifyValueWithProperty(value, key);
|
|
52
|
+
const cachedResult = cache.get(key, valueString);
|
|
53
|
+
if (cachedResult != null) {
|
|
54
|
+
const { identifier } = cachedResult;
|
|
55
|
+
out[identifier] = cachedResult;
|
|
56
|
+
} else {
|
|
57
|
+
const identifier = createIdentifier("r", key, value);
|
|
58
|
+
const rules = createAtomicRules(identifier, key, value);
|
|
59
|
+
const cachedResult2 = cache.set(key, valueString, {
|
|
60
|
+
property: key,
|
|
61
|
+
value: stringifyValueWithProperty(value, key),
|
|
62
|
+
identifier,
|
|
63
|
+
rules
|
|
64
|
+
});
|
|
65
|
+
out[identifier] = cachedResult2;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return out;
|
|
70
|
+
}, "generateAtomicStyles");
|
|
71
|
+
function updateReactDOMStyle(style, key, value) {
|
|
72
|
+
value = normalizeValueWithProperty(value, key);
|
|
73
|
+
const out = expandStyle(key, value);
|
|
74
|
+
if (out) {
|
|
75
|
+
Object.assign(style, Object.fromEntries(out));
|
|
76
|
+
} else {
|
|
77
|
+
style[key] = value;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
__name(updateReactDOMStyle, "updateReactDOMStyle");
|
|
81
|
+
function expandStyle(key, value) {
|
|
82
|
+
if (key === "flex") {
|
|
83
|
+
if (value <= -1) {
|
|
84
|
+
return [
|
|
85
|
+
["flexGrow", 0],
|
|
86
|
+
["flexShrink", 1],
|
|
87
|
+
["flexBasis", "auto"]
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
if (value >= 0) {
|
|
91
|
+
return [
|
|
92
|
+
["flexGrow", value],
|
|
93
|
+
["flexShrink", 1]
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (isWeb) {
|
|
99
|
+
switch (key) {
|
|
100
|
+
case "elevation":
|
|
101
|
+
case "overlayColor":
|
|
102
|
+
case "resizeMode":
|
|
103
|
+
case "tintColor": {
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
case "aspectRatio": {
|
|
107
|
+
return [key, value.toString()];
|
|
108
|
+
}
|
|
109
|
+
case "backgroundClip": {
|
|
110
|
+
if (value === "text") {
|
|
111
|
+
return [
|
|
112
|
+
["backgroundClip", value],
|
|
113
|
+
["WebkitBackgroundClip", value]
|
|
114
|
+
];
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
case "textAlignVertical": {
|
|
119
|
+
return [["verticalAlign", value === "center" ? "middle" : value]];
|
|
120
|
+
}
|
|
121
|
+
case "textDecorationLine": {
|
|
122
|
+
return ["textDecorationLine", value];
|
|
123
|
+
}
|
|
124
|
+
case "transform": {
|
|
125
|
+
if (Array.isArray(value)) {
|
|
126
|
+
return [[key, value.map(mapTransform).join(" ")]];
|
|
127
|
+
}
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
case "writingDirection": {
|
|
131
|
+
return [["direction", value]];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const longKey = STYLE_SHORT_FORM_EXPANSIONS[key];
|
|
136
|
+
if (longKey) {
|
|
137
|
+
return longKey.map((key2) => {
|
|
138
|
+
return [key2, value];
|
|
139
|
+
});
|
|
140
|
+
} else {
|
|
141
|
+
if (isWeb && Array.isArray(value)) {
|
|
142
|
+
return [[key, value.join(",")]];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
__name(expandStyle, "expandStyle");
|
|
147
|
+
function createAtomicRules(identifier, property, value) {
|
|
148
|
+
const rules = [];
|
|
149
|
+
const selector = `.${identifier}`;
|
|
150
|
+
switch (property) {
|
|
151
|
+
case "animationKeyframes": {
|
|
152
|
+
const { animationNames, rules: keyframesRules } = processKeyframesValue(value);
|
|
153
|
+
const block = createDeclarationBlock({ animationName: animationNames.join(",") });
|
|
154
|
+
rules.push(`${selector}${block}`, ...keyframesRules);
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
case "placeholderTextColor": {
|
|
158
|
+
const block = createDeclarationBlock({ color: value, opacity: 1 });
|
|
159
|
+
rules.push(`${selector}::-webkit-input-placeholder${block}`, `${selector}::-moz-placeholder${block}`, `${selector}:-ms-input-placeholder${block}`, `${selector}::placeholder${block}`);
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
case "pointerEvents": {
|
|
163
|
+
let finalValue = value;
|
|
164
|
+
if (value === "auto" || value === "box-only") {
|
|
165
|
+
finalValue = "auto!important";
|
|
166
|
+
if (value === "box-only") {
|
|
167
|
+
const block2 = createDeclarationBlock({ pointerEvents: "none" });
|
|
168
|
+
rules.push(`${selector}>*${block2}`);
|
|
169
|
+
}
|
|
170
|
+
} else if (value === "none" || value === "box-none") {
|
|
171
|
+
finalValue = "none!important";
|
|
172
|
+
if (value === "box-none") {
|
|
173
|
+
const block2 = createDeclarationBlock({ pointerEvents: "auto" });
|
|
174
|
+
rules.push(`${selector}>*${block2}`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const block = createDeclarationBlock({ pointerEvents: finalValue });
|
|
178
|
+
rules.push(`${selector}${block}`);
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
case "scrollbarWidth": {
|
|
182
|
+
if (value === "none") {
|
|
183
|
+
rules.push(`${selector}::-webkit-scrollbar{display:none}`);
|
|
184
|
+
}
|
|
185
|
+
const block = createDeclarationBlock({ scrollbarWidth: value });
|
|
186
|
+
rules.push(`${selector}${block}`);
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
default: {
|
|
190
|
+
const block = createDeclarationBlock({ [property]: value });
|
|
191
|
+
rules.push(`${selector}${block}`);
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return rules;
|
|
196
|
+
}
|
|
197
|
+
__name(createAtomicRules, "createAtomicRules");
|
|
198
|
+
function processKeyframesValue(keyframesValue) {
|
|
199
|
+
if (typeof keyframesValue === "number") {
|
|
200
|
+
throw new Error(`Invalid CSS keyframes type: ${typeof keyframesValue}`);
|
|
201
|
+
}
|
|
202
|
+
const animationNames = [];
|
|
203
|
+
const rules = [];
|
|
204
|
+
const value = Array.isArray(keyframesValue) ? keyframesValue : [keyframesValue];
|
|
205
|
+
for (const keyframes of value) {
|
|
206
|
+
if (typeof keyframes === "string") {
|
|
207
|
+
animationNames.push(keyframes);
|
|
208
|
+
} else {
|
|
209
|
+
const { identifier, rules: keyframesRules } = createKeyframes(keyframes);
|
|
210
|
+
animationNames.push(identifier);
|
|
211
|
+
rules.push(...keyframesRules);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return { animationNames, rules };
|
|
215
|
+
}
|
|
216
|
+
__name(processKeyframesValue, "processKeyframesValue");
|
|
217
|
+
function createKeyframes(keyframes) {
|
|
218
|
+
const prefixes2 = ["-webkit-", ""];
|
|
219
|
+
const identifier = createIdentifier("r", "animation", keyframes);
|
|
220
|
+
const steps = "{" + Object.keys(keyframes).map((stepName) => {
|
|
221
|
+
const rule = keyframes[stepName];
|
|
222
|
+
const block = createDeclarationBlock(rule);
|
|
223
|
+
return `${stepName}${block}`;
|
|
224
|
+
}).join("") + "}";
|
|
225
|
+
const rules = prefixes2.map((prefix) => {
|
|
226
|
+
return `@${prefix}keyframes ${identifier}${steps}`;
|
|
227
|
+
});
|
|
228
|
+
return { identifier, rules };
|
|
229
|
+
}
|
|
230
|
+
__name(createKeyframes, "createKeyframes");
|
|
231
|
+
function createDeclarationBlock(style) {
|
|
232
|
+
const domStyle = prefixStyles(expandStyles(style));
|
|
233
|
+
const declarationsString = Object.keys(domStyle).map((property) => {
|
|
234
|
+
const value = domStyle[property];
|
|
235
|
+
const prop = hyphenateStyleName(property);
|
|
236
|
+
if (Array.isArray(value)) {
|
|
237
|
+
return value.map((v) => `${prop}:${v}`).join(";");
|
|
238
|
+
} else {
|
|
239
|
+
return `${prop}:${value}`;
|
|
240
|
+
}
|
|
241
|
+
}).sort().join(";");
|
|
242
|
+
return `{${declarationsString};}`;
|
|
243
|
+
}
|
|
244
|
+
__name(createDeclarationBlock, "createDeclarationBlock");
|
|
245
|
+
function createIdentifier(prefix, name, value) {
|
|
246
|
+
const hashedString = simpleHash(name + stringifyValueWithProperty(value, name));
|
|
247
|
+
return `${prefix}-${hashedString}`;
|
|
248
|
+
}
|
|
249
|
+
__name(createIdentifier, "createIdentifier");
|
|
250
|
+
const cache = {
|
|
251
|
+
get(property, value) {
|
|
252
|
+
if (cache[property] != null && cache[property].hasOwnProperty(value) && cache[property][value] != null) {
|
|
253
|
+
return cache[property][value];
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
set(property, value, object) {
|
|
257
|
+
if (cache[property] == null) {
|
|
258
|
+
cache[property] = {};
|
|
259
|
+
}
|
|
260
|
+
return cache[property][value] = object;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
function stringifyValueWithProperty(value, property) {
|
|
264
|
+
const normalizedValue = normalizeValueWithProperty(value, property);
|
|
265
|
+
return typeof normalizedValue !== "string" ? JSON.stringify(normalizedValue || "") : normalizedValue;
|
|
266
|
+
}
|
|
267
|
+
__name(stringifyValueWithProperty, "stringifyValueWithProperty");
|
|
268
|
+
const mapTransform = /* @__PURE__ */ __name((transform) => {
|
|
269
|
+
const type = Object.keys(transform)[0];
|
|
270
|
+
const value = transform[type];
|
|
271
|
+
if (type === "matrix" || type === "matrix3d") {
|
|
272
|
+
return `${type}(${value.join(",")})`;
|
|
273
|
+
} else {
|
|
274
|
+
const normalizedValue = normalizeValueWithProperty(value, type);
|
|
275
|
+
return `${type}(${normalizedValue})`;
|
|
276
|
+
}
|
|
277
|
+
}, "mapTransform");
|
|
278
|
+
const colorProps = {
|
|
279
|
+
backgroundColor: true,
|
|
280
|
+
borderColor: true,
|
|
281
|
+
borderTopColor: true,
|
|
282
|
+
borderRightColor: true,
|
|
283
|
+
borderBottomColor: true,
|
|
284
|
+
borderLeftColor: true,
|
|
285
|
+
color: true,
|
|
286
|
+
shadowColor: true,
|
|
287
|
+
textDecorationColor: true,
|
|
288
|
+
textShadowColor: true
|
|
289
|
+
};
|
|
290
|
+
function normalizeValueWithProperty(value, property) {
|
|
291
|
+
if (isWeb) {
|
|
292
|
+
if ((property == null || !unitlessNumbers[property]) && typeof value === "number") {
|
|
293
|
+
return `${value}px`;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (property && colorProps[property]) {
|
|
297
|
+
return normalizeColor(value);
|
|
298
|
+
}
|
|
299
|
+
return value;
|
|
300
|
+
}
|
|
301
|
+
__name(normalizeValueWithProperty, "normalizeValueWithProperty");
|
|
302
|
+
const normalizeColor = /* @__PURE__ */ __name((color, opacity = 1) => {
|
|
303
|
+
if (color == null || color == void 0) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
if (typeof color === "string" && isWebColor(color)) {
|
|
307
|
+
return color;
|
|
308
|
+
}
|
|
309
|
+
const colorInt = processColor(color);
|
|
310
|
+
if (colorInt != null) {
|
|
311
|
+
const r = colorInt >> 16 & 255;
|
|
312
|
+
const g = colorInt >> 8 & 255;
|
|
313
|
+
const b = colorInt & 255;
|
|
314
|
+
const a = (colorInt >> 24 & 255) / 255;
|
|
315
|
+
const alpha = (a * opacity).toFixed(2);
|
|
316
|
+
return `rgba(${r},${g},${b},${alpha})`;
|
|
317
|
+
}
|
|
318
|
+
}, "normalizeColor");
|
|
319
|
+
const isWebColor = /* @__PURE__ */ __name((color) => color === "currentcolor" || color === "currentColor" || color === "inherit" || color.indexOf("var(") === 0, "isWebColor");
|
|
320
|
+
const processColor = /* @__PURE__ */ __name((color) => {
|
|
321
|
+
if (color === void 0 || color === null) {
|
|
322
|
+
return color;
|
|
323
|
+
}
|
|
324
|
+
let intColor = normalizeCSSColor(color);
|
|
325
|
+
if (intColor === void 0 || intColor === null) {
|
|
326
|
+
return void 0;
|
|
327
|
+
}
|
|
328
|
+
return (+intColor << 24 | +intColor >>> 8) >>> 0;
|
|
329
|
+
}, "processColor");
|
|
330
|
+
const unitlessNumbers = {
|
|
331
|
+
animationIterationCount: true,
|
|
332
|
+
aspectRatio: true,
|
|
333
|
+
borderImageOutset: true,
|
|
334
|
+
borderImageSlice: true,
|
|
335
|
+
borderImageWidth: true,
|
|
336
|
+
boxFlex: true,
|
|
337
|
+
boxFlexGroup: true,
|
|
338
|
+
boxOrdinalGroup: true,
|
|
339
|
+
columnCount: true,
|
|
340
|
+
flex: true,
|
|
341
|
+
flexGrow: true,
|
|
342
|
+
flexOrder: true,
|
|
343
|
+
flexPositive: true,
|
|
344
|
+
flexShrink: true,
|
|
345
|
+
flexNegative: true,
|
|
346
|
+
fontWeight: true,
|
|
347
|
+
gridRow: true,
|
|
348
|
+
gridRowEnd: true,
|
|
349
|
+
gridRowGap: true,
|
|
350
|
+
gridRowStart: true,
|
|
351
|
+
gridColumn: true,
|
|
352
|
+
gridColumnEnd: true,
|
|
353
|
+
gridColumnGap: true,
|
|
354
|
+
gridColumnStart: true,
|
|
355
|
+
lineClamp: true,
|
|
356
|
+
opacity: true,
|
|
357
|
+
order: true,
|
|
358
|
+
orphans: true,
|
|
359
|
+
tabSize: true,
|
|
360
|
+
widows: true,
|
|
361
|
+
zIndex: true,
|
|
362
|
+
zoom: true,
|
|
363
|
+
fillOpacity: true,
|
|
364
|
+
floodOpacity: true,
|
|
365
|
+
stopOpacity: true,
|
|
366
|
+
strokeDasharray: true,
|
|
367
|
+
strokeDashoffset: true,
|
|
368
|
+
strokeMiterlimit: true,
|
|
369
|
+
strokeOpacity: true,
|
|
370
|
+
strokeWidth: true,
|
|
371
|
+
scale: true,
|
|
372
|
+
scaleX: true,
|
|
373
|
+
scaleY: true,
|
|
374
|
+
scaleZ: true,
|
|
375
|
+
shadowOpacity: true
|
|
376
|
+
};
|
|
377
|
+
const prefixes = ["ms", "Moz", "O", "Webkit"];
|
|
378
|
+
const prefixKey = /* @__PURE__ */ __name((prefix, key) => {
|
|
379
|
+
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
|
380
|
+
}, "prefixKey");
|
|
381
|
+
Object.keys(unitlessNumbers).forEach((prop) => {
|
|
382
|
+
prefixes.forEach((prefix) => {
|
|
383
|
+
unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
const resolveShadowValue = /* @__PURE__ */ __name((style) => {
|
|
387
|
+
const { shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style;
|
|
388
|
+
const { height, width } = shadowOffset || defaultOffset;
|
|
389
|
+
const offsetX = normalizeValueWithProperty(width);
|
|
390
|
+
const offsetY = normalizeValueWithProperty(height);
|
|
391
|
+
const blurRadius = normalizeValueWithProperty(shadowRadius || 0);
|
|
392
|
+
const color = normalizeColor(shadowColor || "black", shadowOpacity);
|
|
393
|
+
if (color != null && offsetX != null && offsetY != null && blurRadius != null) {
|
|
394
|
+
return `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
395
|
+
}
|
|
396
|
+
}, "resolveShadowValue");
|
|
397
|
+
function boxShadowReducer(resolvedStyle, style) {
|
|
398
|
+
const { boxShadow } = style;
|
|
399
|
+
const shadow = resolveShadowValue(style);
|
|
400
|
+
if (shadow != null) {
|
|
401
|
+
resolvedStyle.boxShadow = boxShadow ? `${boxShadow}, ${shadow}` : shadow;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
__name(boxShadowReducer, "boxShadowReducer");
|
|
405
|
+
const defaultOffset = { height: 0, width: 0 };
|
|
406
|
+
function textShadowReducer(resolvedStyle, style) {
|
|
407
|
+
const { textShadowColor, textShadowOffset, textShadowRadius } = style;
|
|
408
|
+
const { height, width } = textShadowOffset || defaultOffset;
|
|
409
|
+
const radius = textShadowRadius || 0;
|
|
410
|
+
const offsetX = normalizeValueWithProperty(width);
|
|
411
|
+
const offsetY = normalizeValueWithProperty(height);
|
|
412
|
+
const blurRadius = normalizeValueWithProperty(radius);
|
|
413
|
+
const color = normalizeValueWithProperty(textShadowColor, "textShadowColor");
|
|
414
|
+
if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) {
|
|
415
|
+
resolvedStyle.textShadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
__name(textShadowReducer, "textShadowReducer");
|
|
419
|
+
export {
|
|
420
|
+
expandStyle,
|
|
421
|
+
expandStyles,
|
|
422
|
+
generateAtomicStyles,
|
|
423
|
+
inline
|
|
424
|
+
};
|
|
425
|
+
//# sourceMappingURL=generateAtomicStyles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 { simpleHash } from '@tamagui/helpers'\nimport hyphenateStyleName from 'hyphenate-style-name'\nimport normalizeCSSColor from 'normalize-css-color'\nimport { TextStyle, ViewStyle } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { prefixInlineStyles, prefixStyles } from './prefixStyles'\n\nexport function expandStyles(style: any) {\n const res = {}\n for (const key in style) {\n updateReactDOMStyle(res, key, style[key])\n }\n return res\n}\n\n// TODO can use for inline styles...\n/**\n * Compile simple style object to inline DOM styles.\n * No support for 'animationKeyframes', 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.\n */\nexport function inline(style: Style): Object {\n return prefixInlineStyles(expandStyles(style))\n}\n\ntype Rule = string\ntype Rules = Array<Rule>\nexport type RulesData = {\n property?: string\n value?: string\n identifier: string\n rules: Rules\n}\ntype CompilerOutput = { [key: string]: RulesData }\ntype Value = Object | Array<any> | string | number\nexport type Style = { [key: string]: Value }\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 overflow: ['overflowX', 'overflowY'],\n overscrollBehavior: ['overscrollBehaviorX', 'overscrollBehaviorY'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n paddingHorizontal: ['paddingRight', 'paddingLeft'],\n paddingVertical: ['paddingTop', 'paddingBottom'],\n}\n\nexport const generateAtomicStyles = (style: ViewStyle & TextStyle): CompilerOutput => {\n const res = expandStyles(style)\n\n if (\n style.shadowColor != null ||\n style.shadowOffset != null ||\n style.shadowOpacity != null ||\n style.shadowRadius != null\n ) {\n boxShadowReducer(res, style)\n }\n\n if (\n style.textShadowColor != null ||\n style.textShadowOffset != null ||\n style.textShadowRadius != null\n ) {\n textShadowReducer(res, style)\n }\n\n const out = {}\n for (const key in res) {\n const value = res[key]\n if (value != null) {\n const valueString = stringifyValueWithProperty(value, key)\n const cachedResult = cache.get(key, valueString)\n if (cachedResult != null) {\n const { identifier } = cachedResult\n out[identifier] = cachedResult\n } else {\n const identifier = createIdentifier('r', key, value)\n const rules = createAtomicRules(identifier, key, value)\n const cachedResult = cache.set(key, valueString, {\n property: key,\n value: stringifyValueWithProperty(value, key),\n identifier,\n rules,\n })\n out[identifier] = cachedResult\n }\n }\n }\n\n return out\n}\n\nfunction updateReactDOMStyle(style: Object, key: string, value: any) {\n value = normalizeValueWithProperty(value, key)\n const out = expandStyle(key, value)\n if (out) {\n Object.assign(style, Object.fromEntries(out))\n } else {\n style[key] = value\n }\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 if (isWeb) {\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\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\nfunction createAtomicRules(identifier: string, property, value): Rules {\n const rules: string[] = []\n const selector = `.${identifier}`\n\n // Handle non-standard properties and object values that require multiple\n // CSS rules to be created.\n switch (property) {\n case 'animationKeyframes': {\n const { animationNames, rules: keyframesRules } = processKeyframesValue(value)\n const block = createDeclarationBlock({ animationName: animationNames.join(',') })\n rules.push(`${selector}${block}`, ...keyframesRules)\n break\n }\n\n // Equivalent to using '::placeholder'\n case 'placeholderTextColor': {\n const block = createDeclarationBlock({ color: value, opacity: 1 })\n rules.push(\n `${selector}::-webkit-input-placeholder${block}`,\n `${selector}::-moz-placeholder${block}`,\n `${selector}:-ms-input-placeholder${block}`,\n `${selector}::placeholder${block}`\n )\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' })\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' })\n rules.push(`${selector}>*${block}`)\n }\n }\n const block = createDeclarationBlock({ pointerEvents: finalValue })\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 })\n rules.push(`${selector}${block}`)\n break\n }\n\n default: {\n const block = createDeclarationBlock({ [property]: value })\n rules.push(`${selector}${block}`)\n break\n }\n }\n\n return rules\n}\n\n/**\n * Create CSS keyframes rules and names from a StyleSheet keyframes object.\n */\nfunction processKeyframesValue(keyframesValue: number | string[]) {\n if (typeof keyframesValue === 'number') {\n throw new Error(`Invalid CSS keyframes type: ${typeof keyframesValue}`)\n }\n\n const animationNames: string[] = []\n const rules: string[] = []\n const value = Array.isArray(keyframesValue) ? keyframesValue : [keyframesValue]\n\n for (const keyframes of value) {\n if (typeof keyframes === 'string') {\n // Support external animation libraries (identifiers only)\n animationNames.push(keyframes)\n } else {\n // Create rules for each of the keyframes\n const { identifier, rules: keyframesRules } = createKeyframes(keyframes)\n animationNames.push(identifier)\n rules.push(...keyframesRules)\n }\n }\n\n return { animationNames, rules }\n}\n\n/**\n * Create individual CSS keyframes rules.\n */\nfunction createKeyframes(keyframes) {\n const prefixes = ['-webkit-', '']\n const identifier = createIdentifier('r', 'animation', keyframes)\n\n const steps =\n '{' +\n Object.keys(keyframes)\n .map((stepName) => {\n const rule = keyframes[stepName]\n const block = createDeclarationBlock(rule)\n return `${stepName}${block}`\n })\n .join('') +\n '}'\n\n const rules = prefixes.map((prefix) => {\n return `@${prefix}keyframes ${identifier}${steps}`\n })\n return { identifier, rules }\n}\n\n/**\n * Creates a CSS declaration block from a StyleSheet object.\n */\nfunction createDeclarationBlock(style: Style) {\n const domStyle = prefixStyles(expandStyles(style))\n const declarationsString = Object.keys(domStyle)\n .map((property) => {\n const value = domStyle[property]\n const prop = hyphenateStyleName(property)\n // The prefixer may return an array of values:\n // { display: [ '-webkit-flex', 'flex' ] }\n // to represent \"fallback\" declarations\n // { display: -webkit-flex; display: flex; }\n if (Array.isArray(value)) {\n return value.map((v) => `${prop}:${v}`).join(';')\n } else {\n return `${prop}:${value}`\n }\n })\n // Once properties are hyphenated, this will put the vendor\n // prefixed and short-form properties first in the list.\n .sort()\n .join(';')\n\n return `{${declarationsString};}`\n}\n\nfunction createIdentifier(prefix: string, name: string, value): string {\n const hashedString = simpleHash(name + stringifyValueWithProperty(value, name))\n return `${prefix}-${hashedString}`\n}\n\nconst cache = {\n get(property, value) {\n if (\n cache[property] != null &&\n cache[property].hasOwnProperty(value) &&\n cache[property][value] != null\n ) {\n return cache[property][value]\n }\n },\n set(property, value, object) {\n if (cache[property] == null) {\n cache[property] = {}\n }\n return (cache[property][value] = object)\n },\n}\n\nfunction stringifyValueWithProperty(value: Value, property?: string): string {\n // e.g., 0 => '0px', 'black' => 'rgba(0,0,0,1)'\n const normalizedValue = normalizeValueWithProperty(value, property)\n return typeof normalizedValue !== 'string'\n ? JSON.stringify(normalizedValue || '')\n : normalizedValue\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 (isWeb) {\n if ((property == null || !unitlessNumbers[property]) && typeof value === 'number') {\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 (typeof color === 'string' && isWebColor(color)) {\n return color\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}\n\nconst isWebColor = (color: string): boolean =>\n color === 'currentcolor' ||\n color === 'currentColor' ||\n color === 'inherit' ||\n 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 boxFlexGroup: 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\n/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\nconst prefixes = ['ms', 'Moz', 'O', 'Webkit']\nconst prefixKey = (prefix: string, key: string) => {\n return prefix + key.charAt(0).toUpperCase() + key.substring(1)\n}\nObject.keys(unitlessNumbers).forEach((prop) => {\n prefixes.forEach((prefix) => {\n unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop]\n })\n})\n\nconst resolveShadowValue = (style: ViewStyle): void | string => {\n const { shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style\n const { height, width } = shadowOffset || defaultOffset\n const offsetX = normalizeValueWithProperty(width)\n const offsetY = normalizeValueWithProperty(height)\n const blurRadius = normalizeValueWithProperty(shadowRadius || 0)\n // @ts-ignore\n const color = normalizeColor(shadowColor || 'black', shadowOpacity)\n if (color != null && offsetX != null && offsetY != null && blurRadius != null) {\n return `${offsetX} ${offsetY} ${blurRadius} ${color}`\n }\n}\n\nfunction boxShadowReducer(resolvedStyle, style) {\n const { boxShadow } = style\n const shadow = resolveShadowValue(style)\n if (shadow != null) {\n resolvedStyle.boxShadow = boxShadow ? `${boxShadow}, ${shadow}` : shadow\n }\n}\n\nconst defaultOffset = { height: 0, width: 0 }\nfunction textShadowReducer(resolvedStyle, style) {\n const { textShadowColor, textShadowOffset, textShadowRadius } = style\n const { height, width } = textShadowOffset || defaultOffset\n const radius = textShadowRadius || 0\n const offsetX = normalizeValueWithProperty(width)\n const offsetY = normalizeValueWithProperty(height)\n const blurRadius = normalizeValueWithProperty(radius)\n const color = normalizeValueWithProperty(textShadowColor, 'textShadowColor')\n\n if (\n color &&\n (height !== 0 || width !== 0 || radius !== 0) &&\n offsetX != null &&\n offsetY != null &&\n blurRadius != null\n ) {\n resolvedStyle.textShadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`\n }\n}\n"],
|
|
5
|
+
"mappings": ";;AAKA;AACA;AACA;AAGA;AACA;AAEO,sBAAsB,OAAY;AACvC,QAAM,MAAM,CAAC;AACb,aAAW,OAAO,OAAO;AACvB,wBAAoB,KAAK,KAAK,MAAM,IAAI;AAAA,EAC1C;AACA,SAAO;AACT;AANgB;AAaT,gBAAgB,OAAsB;AAC3C,SAAO,mBAAmB,aAAa,KAAK,CAAC;AAC/C;AAFgB;AAgBhB,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,e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