@tamagui/core 1.0.0-alpha.55 → 1.0.0-alpha.56
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/platform.js +1 -1
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +13 -20
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/constants/platform.js +1 -1
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +13 -6
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/jsx/constants/platform.js +1 -1
- package/dist/jsx/helpers/createPropMapper.js +13 -6
- package/package.json +2 -2
- package/types/constants/platform.d.ts.map +1 -1
- package/types/helpers/createPropMapper.d.ts.map +1 -1
- package/dist/cjs/getThemeParentClassName.js +0 -34
- package/dist/cjs/getThemeParentClassName.js.map +0 -7
- package/dist/esm/getThemeParentClassName.js +0 -11
- package/dist/esm/getThemeParentClassName.js.map +0 -7
- package/dist/jsx/getThemeParentClassName.js +0 -10
|
@@ -33,7 +33,7 @@ __export(platform_exports, {
|
|
|
33
33
|
var import_react = require("react");
|
|
34
34
|
var import_react_native = require("react-native");
|
|
35
35
|
var _a;
|
|
36
|
-
const isWeb = process.env.TAMAGUI_TARGET === "web"
|
|
36
|
+
const isWeb = process.env.TAMAGUI_TARGET !== "native" && (process.env.TAMAGUI_TARGET === "web" || ((_a = import_react_native.Platform) == null ? void 0 : _a.OS) === "web");
|
|
37
37
|
const isSSR = isWeb && typeof window === "undefined";
|
|
38
38
|
const useIsomorphicLayoutEffect = isSSR ? import_react.useEffect : import_react.useLayoutEffect;
|
|
39
39
|
const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/constants/platform.ts"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isWeb
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;AAC3C,0BAAyB;AADzB;AAGO,MAAM,
|
|
4
|
+
"sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isWeb =\n process.env.TAMAGUI_TARGET !== 'native' &&\n (process.env.TAMAGUI_TARGET === 'web' || Platform?.OS === 'web')\n\nexport const isSSR = isWeb && typeof window === 'undefined'\nexport const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const supportsTouchWeb = typeof window !== 'undefined' && 'ontouchstart' in window\nexport const isTouchDevice = !isWeb || supportsTouchWeb\nexport const isWebIOS =\n isWeb &&\n typeof navigator !== 'undefined' &&\n (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !window['MSStream']\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;AAC3C,0BAAyB;AADzB;AAGO,MAAM,QACX,QAAQ,IAAI,mBAAmB,YAC9B,SAAQ,IAAI,mBAAmB,SAAS,2DAAU,QAAO;AAErD,MAAM,QAAQ,SAAS,OAAO,WAAW;AACzC,MAAM,4BAA4B,QAAQ,yBAAY;AACtD,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa;AAC1F,MAAM,mBAAmB,OAAO,WAAW,eAAe,kBAAkB;AAC5E,MAAM,gBAAgB,CAAC,SAAS;AAChC,MAAM,WACX,SACA,OAAO,cAAc,eACpB,oBAAmB,KAAK,UAAU,aAChC,UAAU,aAAa,cAAc,UAAU,iBAAiB,MACnE,CAAC,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
5
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
20
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
21
7
|
var __export = (target, all) => {
|
|
@@ -60,9 +46,12 @@ const createPropMapper = /* @__PURE__ */ __name((c) => {
|
|
|
60
46
|
const variant = variantsParsed == null ? void 0 : variantsParsed[key];
|
|
61
47
|
if (variant && typeof value !== "undefined") {
|
|
62
48
|
const val = value === true ? variant["$true"] || variant["true"] : variant[value] ?? variant["..."] ?? value;
|
|
63
|
-
|
|
49
|
+
let res = val;
|
|
50
|
+
if (typeof res === "function") {
|
|
51
|
+
res = res(value, { tokens: conf.tokensParsed, theme, props });
|
|
52
|
+
}
|
|
64
53
|
if ((0, import_isObj.isObj)(res)) {
|
|
65
|
-
resolveTokens(res, conf, theme, fontFamily);
|
|
54
|
+
res = resolveTokens(res, conf, theme, fontFamily);
|
|
66
55
|
}
|
|
67
56
|
return res;
|
|
68
57
|
}
|
|
@@ -86,10 +75,11 @@ const createPropMapper = /* @__PURE__ */ __name((c) => {
|
|
|
86
75
|
}
|
|
87
76
|
};
|
|
88
77
|
}, "createPropMapper");
|
|
89
|
-
const resolveTokens = /* @__PURE__ */ __name((
|
|
90
|
-
|
|
78
|
+
const resolveTokens = /* @__PURE__ */ __name((input, conf, theme, fontFamily) => {
|
|
79
|
+
let res = {};
|
|
80
|
+
for (const rKey in input) {
|
|
91
81
|
const fKey = conf.shorthands[rKey] || rKey;
|
|
92
|
-
const val =
|
|
82
|
+
const val = input[rKey];
|
|
93
83
|
if (val instanceof import_createVariable.Variable) {
|
|
94
84
|
res[fKey] = val.variable;
|
|
95
85
|
} else if (typeof val === "string") {
|
|
@@ -97,10 +87,13 @@ const resolveTokens = /* @__PURE__ */ __name((res, conf, theme, fontFamily) => {
|
|
|
97
87
|
res[fKey] = fVal;
|
|
98
88
|
} else {
|
|
99
89
|
if ((0, import_isObj.isObj)(val)) {
|
|
100
|
-
resolveTokens(val, conf, theme, fontFamily);
|
|
90
|
+
res[fKey] = resolveTokens(val, conf, theme, fontFamily);
|
|
91
|
+
} else {
|
|
92
|
+
res[fKey] = input[fKey];
|
|
101
93
|
}
|
|
102
94
|
}
|
|
103
95
|
}
|
|
96
|
+
return res;
|
|
104
97
|
}, "resolveTokens");
|
|
105
98
|
const getToken = /* @__PURE__ */ __name((key, value, { tokensParsed, themeParsed }, theme, fontFamily = "$body") => {
|
|
106
99
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/createPropMapper.ts"],
|
|
4
|
-
"sourcesContent": ["import { getTamagui } from '../conf'\nimport { isWeb } from '../constants/platform'\nimport { Variable } from '../createVariable'\nimport { StaticConfig, TamaguiInternalConfig } from '../types'\nimport { isObj } from './isObj'\n\nexport const createPropMapper = (c: StaticConfig) => {\n const variants = c.variants\n let variantsParsed\n const defaultProps = c.defaultProps || {}\n\n return (key: string, value: any, theme: any, props: any) => {\n const conf = getTamagui()\n if (!conf) {\n console.trace('no conf! err')\n return\n }\n if (variants && !variantsParsed) {\n variantsParsed = parseVariants(variants, conf)\n }\n\n // handled here because we need to resolve this off tokens, its the only one-off like this\n let fontFamily = props.fontFamily || defaultProps.fontFamily || '$body'\n\n // expand variants\n const variant = variantsParsed?.[key]\n if (variant && typeof value !== 'undefined') {\n const val =\n value === true\n ? variant['$true'] || variant['true']\n : variant[value] ?? variant['...'] ?? value\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { getTamagui } from '../conf'\nimport { isWeb } from '../constants/platform'\nimport { Variable } from '../createVariable'\nimport { StaticConfig, TamaguiInternalConfig } from '../types'\nimport { isObj } from './isObj'\n\nexport const createPropMapper = (c: StaticConfig) => {\n const variants = c.variants\n let variantsParsed\n const defaultProps = c.defaultProps || {}\n\n return (key: string, value: any, theme: any, props: any) => {\n const conf = getTamagui()\n if (!conf) {\n console.trace('no conf! err')\n return\n }\n if (variants && !variantsParsed) {\n variantsParsed = parseVariants(variants, conf)\n }\n\n // handled here because we need to resolve this off tokens, its the only one-off like this\n let fontFamily = props.fontFamily || defaultProps.fontFamily || '$body'\n\n // expand variants\n const variant = variantsParsed?.[key]\n if (variant && typeof value !== 'undefined') {\n const val =\n value === true\n ? variant['$true'] || variant['true']\n : variant[value] ?? variant['...'] ?? value\n let res = val\n if (typeof res === 'function') {\n res = res(value, { tokens: conf.tokensParsed, theme, props })\n }\n if (isObj(res)) {\n res = resolveTokens(res, conf, theme, fontFamily)\n }\n return res\n }\n\n let shouldReturn = false\n\n // handle shorthands\n if (conf.shorthands[key]) {\n shouldReturn = true\n key = conf.shorthands[key]\n }\n\n if (value && value[0] === '$') {\n shouldReturn = true\n value = getToken(key, value, conf, theme, fontFamily)\n }\n\n if (value instanceof Variable) {\n shouldReturn = true\n value = value.variable\n }\n\n if (shouldReturn) {\n return {\n [key]: value,\n }\n }\n }\n}\n\nconst resolveTokens = (input: Object, conf: TamaguiInternalConfig, theme: any, fontFamily: any) => {\n let res = {}\n for (const rKey in input) {\n const fKey = conf.shorthands[rKey] || rKey\n const val = input[rKey]\n if (val instanceof Variable) {\n res[fKey] = val.variable\n } else if (typeof val === 'string') {\n const fVal = val[0] === '$' ? getToken(fKey, val, conf, theme, fontFamily) : 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)\n } else {\n // nullish values cant be tokens so need no exrta parsing\n res[fKey] = input[fKey]\n }\n }\n }\n return res\n}\n\nconst getToken = (\n key: string,\n value: string,\n { tokensParsed, themeParsed }: TamaguiInternalConfig,\n theme: any,\n fontFamily: string | undefined = '$body'\n) => {\n if (themeParsed[value]) {\n if (isWeb && themeParsed[value].variable) {\n return themeParsed[value].variable\n } else {\n if (value && value[0] === '$') {\n return theme[`${value.slice(1)}`]?.val || themeParsed[value]?.val\n }\n }\n }\n let valOrVar: any\n if (key === 'fontFamily') {\n valOrVar = tokensParsed.font[value]?.family || value\n }\n if (key === 'fontSize') {\n valOrVar = tokensParsed.font[fontFamily]?.size[value] || value\n }\n if (key === 'lineHeight') {\n valOrVar = tokensParsed.font[fontFamily]?.lineHeight[value] || value\n }\n if (key === 'letterSpacing') {\n valOrVar = tokensParsed.font[fontFamily]?.letterSpacing[value] || value\n }\n if (key === 'fontWeight') {\n valOrVar = tokensParsed.font[fontFamily]?.weight[value] || value\n }\n if (typeof valOrVar !== 'undefined') {\n if (valOrVar instanceof Variable) {\n return valOrVar.variable\n } else {\n return valOrVar\n }\n }\n for (const cat in tokenCategories) {\n if (tokenCategories[cat][key]) {\n const res = tokensParsed[cat][value]\n if (res) {\n return res.variable\n } else {\n const themeVar = themeParsed[value]\n if (themeVar) {\n return themeVar.variable\n }\n }\n }\n }\n const spaceVar = tokensParsed.space[value]\n if (spaceVar) {\n return spaceVar.variable\n }\n return value\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 },\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\n// turns variant spreads into individual lookups\nfunction parseVariants(variants: any, conf: TamaguiInternalConfig) {\n return Object.keys(variants).reduce((acc, key) => {\n acc[key] = Object.keys(variants[key]).reduce((vacc, vkey) => {\n const variantVal = variants[key][vkey]\n if (vkey.startsWith('...')) {\n // set the default one at '...' for easy fallback on non-exact-variant-match\n vacc['...'] = variantVal\n const tokenKey = vkey.slice(3)\n const tokens = conf.tokens[tokenKey]\n for (const tkey in tokens) {\n vacc[`$${tkey}`] = variantVal\n }\n } else {\n vacc[vkey] = variantVal\n }\n return vacc\n }, {})\n return acc\n }, {})\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAC3B,sBAAsB;AACtB,4BAAyB;AAEzB,mBAAsB;AAEf,MAAM,mBAAmB,wBAAC,MAAoB;AACnD,QAAM,WAAW,EAAE;AACnB,MAAI;AACJ,QAAM,eAAe,EAAE,gBAAgB;AAEvC,SAAO,CAAC,KAAa,OAAY,OAAY,UAAe;AAC1D,UAAM,OAAO;AACb,QAAI,CAAC,MAAM;AACT,cAAQ,MAAM;AACd;AAAA;AAEF,QAAI,YAAY,CAAC,gBAAgB;AAC/B,uBAAiB,cAAc,UAAU;AAAA;AAI3C,QAAI,aAAa,MAAM,cAAc,aA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A,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,WAAW;AAAA,IACX,UAAU;AAAA,IACV,WAAW;AAAA;AAAA,EAEb,OAAO;AAAA,IACL,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA;AAAA;AAKtB,uBAAuB,UAAe,MAA6B;AACjE,SAAO,OAAO,KAAK,UAAU,OAAO,CAAC,KAAK,QAAQ;AAChD,QAAI,OAAO,OAAO,KAAK,SAAS,MAAM,OAAO,CAAC,MAAM,SAAS;AAC3D,YAAM,aAAa,SAAS,KAAK;AACjC,UAAI,KAAK,WAAW,QAAQ;AAE1B,aAAK,SAAS;AACd,cAAM,WAAW,KAAK,MAAM;AAC5B,cAAM,SAAS,KAAK,OAAO;AAC3B,mBAAW,QAAQ,QAAQ;AACzB,eAAK,IAAI,UAAU;AAAA;AAAA,aAEhB;AACL,aAAK,QAAQ;AAAA;AAEf,aAAO;AAAA,OACN;AACH,WAAO;AAAA,KACN;AAAA;AAlBI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { useEffect, useLayoutEffect } from "react";
|
|
3
3
|
import { Platform } from "react-native";
|
|
4
|
-
const isWeb = process.env.TAMAGUI_TARGET === "web"
|
|
4
|
+
const isWeb = process.env.TAMAGUI_TARGET !== "native" && (process.env.TAMAGUI_TARGET === "web" || ((_a = Platform) == null ? void 0 : _a.OS) === "web");
|
|
5
5
|
const isSSR = isWeb && typeof window === "undefined";
|
|
6
6
|
const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
|
|
7
7
|
const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/constants/platform.ts"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isWeb
|
|
5
|
-
"mappings": "AAAA;AAAA;AACA;AAEO,MAAM,
|
|
4
|
+
"sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isWeb =\n process.env.TAMAGUI_TARGET !== 'native' &&\n (process.env.TAMAGUI_TARGET === 'web' || Platform?.OS === 'web')\n\nexport const isSSR = isWeb && typeof window === 'undefined'\nexport const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const supportsTouchWeb = typeof window !== 'undefined' && 'ontouchstart' in window\nexport const isTouchDevice = !isWeb || supportsTouchWeb\nexport const isWebIOS =\n isWeb &&\n typeof navigator !== 'undefined' &&\n (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !window['MSStream']\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AACA;AAEO,MAAM,QACX,QAAQ,IAAI,mBAAmB,YAC9B,SAAQ,IAAI,mBAAmB,SAAS,uCAAU,QAAO;AAErD,MAAM,QAAQ,SAAS,OAAO,WAAW;AACzC,MAAM,4BAA4B,QAAQ,YAAY;AACtD,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa;AAC1F,MAAM,mBAAmB,OAAO,WAAW,eAAe,kBAAkB;AAC5E,MAAM,gBAAgB,CAAC,SAAS;AAChC,MAAM,WACX,SACA,OAAO,cAAc,eACpB,oBAAmB,KAAK,UAAU,aAChC,UAAU,aAAa,cAAc,UAAU,iBAAiB,MACnE,CAAC,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -22,9 +22,12 @@ const createPropMapper = /* @__PURE__ */ __name((c) => {
|
|
|
22
22
|
const variant = variantsParsed == null ? void 0 : variantsParsed[key];
|
|
23
23
|
if (variant && typeof value !== "undefined") {
|
|
24
24
|
const val = value === true ? variant["$true"] || variant["true"] : (_b = (_a = variant[value]) != null ? _a : variant["..."]) != null ? _b : value;
|
|
25
|
-
|
|
25
|
+
let res = val;
|
|
26
|
+
if (typeof res === "function") {
|
|
27
|
+
res = res(value, { tokens: conf.tokensParsed, theme, props });
|
|
28
|
+
}
|
|
26
29
|
if (isObj(res)) {
|
|
27
|
-
resolveTokens(res, conf, theme, fontFamily);
|
|
30
|
+
res = resolveTokens(res, conf, theme, fontFamily);
|
|
28
31
|
}
|
|
29
32
|
return res;
|
|
30
33
|
}
|
|
@@ -48,10 +51,11 @@ const createPropMapper = /* @__PURE__ */ __name((c) => {
|
|
|
48
51
|
}
|
|
49
52
|
};
|
|
50
53
|
}, "createPropMapper");
|
|
51
|
-
const resolveTokens = /* @__PURE__ */ __name((
|
|
52
|
-
|
|
54
|
+
const resolveTokens = /* @__PURE__ */ __name((input, conf, theme, fontFamily) => {
|
|
55
|
+
let res = {};
|
|
56
|
+
for (const rKey in input) {
|
|
53
57
|
const fKey = conf.shorthands[rKey] || rKey;
|
|
54
|
-
const val =
|
|
58
|
+
const val = input[rKey];
|
|
55
59
|
if (val instanceof Variable) {
|
|
56
60
|
res[fKey] = val.variable;
|
|
57
61
|
} else if (typeof val === "string") {
|
|
@@ -59,10 +63,13 @@ const resolveTokens = /* @__PURE__ */ __name((res, conf, theme, fontFamily) => {
|
|
|
59
63
|
res[fKey] = fVal;
|
|
60
64
|
} else {
|
|
61
65
|
if (isObj(val)) {
|
|
62
|
-
resolveTokens(val, conf, theme, fontFamily);
|
|
66
|
+
res[fKey] = resolveTokens(val, conf, theme, fontFamily);
|
|
67
|
+
} else {
|
|
68
|
+
res[fKey] = input[fKey];
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
71
|
}
|
|
72
|
+
return res;
|
|
66
73
|
}, "resolveTokens");
|
|
67
74
|
const getToken = /* @__PURE__ */ __name((key, value, { tokensParsed, themeParsed }, theme, fontFamily = "$body") => {
|
|
68
75
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/createPropMapper.ts"],
|
|
4
|
-
"sourcesContent": ["import { getTamagui } from '../conf'\nimport { isWeb } from '../constants/platform'\nimport { Variable } from '../createVariable'\nimport { StaticConfig, TamaguiInternalConfig } from '../types'\nimport { isObj } from './isObj'\n\nexport const createPropMapper = (c: StaticConfig) => {\n const variants = c.variants\n let variantsParsed\n const defaultProps = c.defaultProps || {}\n\n return (key: string, value: any, theme: any, props: any) => {\n const conf = getTamagui()\n if (!conf) {\n console.trace('no conf! err')\n return\n }\n if (variants && !variantsParsed) {\n variantsParsed = parseVariants(variants, conf)\n }\n\n // handled here because we need to resolve this off tokens, its the only one-off like this\n let fontFamily = props.fontFamily || defaultProps.fontFamily || '$body'\n\n // expand variants\n const variant = variantsParsed?.[key]\n if (variant && typeof value !== 'undefined') {\n const val =\n value === true\n ? variant['$true'] || variant['true']\n : variant[value] ?? variant['...'] ?? value\n
|
|
5
|
-
"mappings": ";;AAAA;AACA;AACA;AAEA;AAEO,MAAM,mBAAmB,wBAAC,MAAoB;AACnD,QAAM,WAAW,EAAE;AACnB,MAAI;AACJ,QAAM,eAAe,EAAE,gBAAgB;AAEvC,SAAO,CAAC,KAAa,OAAY,OAAY,UAAe;AAX9D;AAYI,UAAM,OAAO;AACb,QAAI,CAAC,MAAM;AACT,cAAQ,MAAM;AACd;AAAA;AAEF,QAAI,YAAY,CAAC,gBAAgB;AAC/B,uBAAiB,cAAc,UAAU;AAAA;AAI3C,QAAI,aAAa,MAAM,cAAc,aAAa,cAAc;AAGhE,UAAM,UAAU,iDAAiB;AACjC,QAAI,WAAW,OAAO,UAAU,aAAa;AAC3C,YAAM,MACJ,UAAU,OACN,QAAQ,YAAY,QAAQ,UAC5B,oBAAQ,WAAR,YAAkB,QAAQ,WAA1B,YAAoC;
|
|
4
|
+
"sourcesContent": ["import { getTamagui } from '../conf'\nimport { isWeb } from '../constants/platform'\nimport { Variable } from '../createVariable'\nimport { StaticConfig, TamaguiInternalConfig } from '../types'\nimport { isObj } from './isObj'\n\nexport const createPropMapper = (c: StaticConfig) => {\n const variants = c.variants\n let variantsParsed\n const defaultProps = c.defaultProps || {}\n\n return (key: string, value: any, theme: any, props: any) => {\n const conf = getTamagui()\n if (!conf) {\n console.trace('no conf! err')\n return\n }\n if (variants && !variantsParsed) {\n variantsParsed = parseVariants(variants, conf)\n }\n\n // handled here because we need to resolve this off tokens, its the only one-off like this\n let fontFamily = props.fontFamily || defaultProps.fontFamily || '$body'\n\n // expand variants\n const variant = variantsParsed?.[key]\n if (variant && typeof value !== 'undefined') {\n const val =\n value === true\n ? variant['$true'] || variant['true']\n : variant[value] ?? variant['...'] ?? value\n let res = val\n if (typeof res === 'function') {\n res = res(value, { tokens: conf.tokensParsed, theme, props })\n }\n if (isObj(res)) {\n res = resolveTokens(res, conf, theme, fontFamily)\n }\n return res\n }\n\n let shouldReturn = false\n\n // handle shorthands\n if (conf.shorthands[key]) {\n shouldReturn = true\n key = conf.shorthands[key]\n }\n\n if (value && value[0] === '$') {\n shouldReturn = true\n value = getToken(key, value, conf, theme, fontFamily)\n }\n\n if (value instanceof Variable) {\n shouldReturn = true\n value = value.variable\n }\n\n if (shouldReturn) {\n return {\n [key]: value,\n }\n }\n }\n}\n\nconst resolveTokens = (input: Object, conf: TamaguiInternalConfig, theme: any, fontFamily: any) => {\n let res = {}\n for (const rKey in input) {\n const fKey = conf.shorthands[rKey] || rKey\n const val = input[rKey]\n if (val instanceof Variable) {\n res[fKey] = val.variable\n } else if (typeof val === 'string') {\n const fVal = val[0] === '$' ? getToken(fKey, val, conf, theme, fontFamily) : 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)\n } else {\n // nullish values cant be tokens so need no exrta parsing\n res[fKey] = input[fKey]\n }\n }\n }\n return res\n}\n\nconst getToken = (\n key: string,\n value: string,\n { tokensParsed, themeParsed }: TamaguiInternalConfig,\n theme: any,\n fontFamily: string | undefined = '$body'\n) => {\n if (themeParsed[value]) {\n if (isWeb && themeParsed[value].variable) {\n return themeParsed[value].variable\n } else {\n if (value && value[0] === '$') {\n return theme[`${value.slice(1)}`]?.val || themeParsed[value]?.val\n }\n }\n }\n let valOrVar: any\n if (key === 'fontFamily') {\n valOrVar = tokensParsed.font[value]?.family || value\n }\n if (key === 'fontSize') {\n valOrVar = tokensParsed.font[fontFamily]?.size[value] || value\n }\n if (key === 'lineHeight') {\n valOrVar = tokensParsed.font[fontFamily]?.lineHeight[value] || value\n }\n if (key === 'letterSpacing') {\n valOrVar = tokensParsed.font[fontFamily]?.letterSpacing[value] || value\n }\n if (key === 'fontWeight') {\n valOrVar = tokensParsed.font[fontFamily]?.weight[value] || value\n }\n if (typeof valOrVar !== 'undefined') {\n if (valOrVar instanceof Variable) {\n return valOrVar.variable\n } else {\n return valOrVar\n }\n }\n for (const cat in tokenCategories) {\n if (tokenCategories[cat][key]) {\n const res = tokensParsed[cat][value]\n if (res) {\n return res.variable\n } else {\n const themeVar = themeParsed[value]\n if (themeVar) {\n return themeVar.variable\n }\n }\n }\n }\n const spaceVar = tokensParsed.space[value]\n if (spaceVar) {\n return spaceVar.variable\n }\n return value\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 },\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\n// turns variant spreads into individual lookups\nfunction parseVariants(variants: any, conf: TamaguiInternalConfig) {\n return Object.keys(variants).reduce((acc, key) => {\n acc[key] = Object.keys(variants[key]).reduce((vacc, vkey) => {\n const variantVal = variants[key][vkey]\n if (vkey.startsWith('...')) {\n // set the default one at '...' for easy fallback on non-exact-variant-match\n vacc['...'] = variantVal\n const tokenKey = vkey.slice(3)\n const tokens = conf.tokens[tokenKey]\n for (const tkey in tokens) {\n vacc[`$${tkey}`] = variantVal\n }\n } else {\n vacc[vkey] = variantVal\n }\n return vacc\n }, {})\n return acc\n }, {})\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA;AACA;AACA;AAEA;AAEO,MAAM,mBAAmB,wBAAC,MAAoB;AACnD,QAAM,WAAW,EAAE;AACnB,MAAI;AACJ,QAAM,eAAe,EAAE,gBAAgB;AAEvC,SAAO,CAAC,KAAa,OAAY,OAAY,UAAe;AAX9D;AAYI,UAAM,OAAO;AACb,QAAI,CAAC,MAAM;AACT,cAAQ,MAAM;AACd;AAAA;AAEF,QAAI,YAAY,CAAC,gBAAgB;AAC/B,uBAAiB,cAAc,UAAU;AAAA;AAI3C,QAAI,aAAa,MAAM,cAAc,aAAa,cAAc;AAGhE,UAAM,UAAU,iDAAiB;AACjC,QAAI,WAAW,OAAO,UAAU,aAAa;AAC3C,YAAM,MACJ,UAAU,OACN,QAAQ,YAAY,QAAQ,UAC5B,oBAAQ,WAAR,YAAkB,QAAQ,WAA1B,YAAoC;AAC1C,UAAI,MAAM;AACV,UAAI,OAAO,QAAQ,YAAY;AAC7B,cAAM,IAAI,OAAO,EAAE,QAAQ,KAAK,cAAc,OAAO;AAAA;AAEvD,UAAI,MAAM,MAAM;AACd,cAAM,cAAc,KAAK,MAAM,OAAO;AAAA;AAExC,aAAO;AAAA;AAGT,QAAI,eAAe;AAGnB,QAAI,KAAK,WAAW,MAAM;AACxB,qBAAe;AACf,YAAM,KAAK,WAAW;AAAA;AAGxB,QAAI,SAAS,MAAM,OAAO,KAAK;AAC7B,qBAAe;AACf,cAAQ,SAAS,KAAK,OAAO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AC5B,cAAM,SAAS,KAAK,OAAO;AAC3B,mBAAW,QAAQ,QAAQ;AACzB,eAAK,IAAI,UAAU;AAAA;AAAA,aAEhB;AACL,aAAK,QAAQ;AAAA;AAEf,aAAO;AAAA,OACN;AACH,WAAO;AAAA,KACN;AAAA;AAlBI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { useEffect, useLayoutEffect } from "react";
|
|
3
3
|
import { Platform } from "react-native";
|
|
4
|
-
const isWeb = process.env.TAMAGUI_TARGET === "web"
|
|
4
|
+
const isWeb = process.env.TAMAGUI_TARGET !== "native" && (process.env.TAMAGUI_TARGET === "web" || ((_a = Platform) == null ? void 0 : _a.OS) === "web");
|
|
5
5
|
const isSSR = isWeb && typeof window === "undefined";
|
|
6
6
|
const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
|
|
7
7
|
const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
|
|
@@ -22,9 +22,12 @@ const createPropMapper = /* @__PURE__ */ __name((c) => {
|
|
|
22
22
|
const variant = variantsParsed == null ? void 0 : variantsParsed[key];
|
|
23
23
|
if (variant && typeof value !== "undefined") {
|
|
24
24
|
const val = value === true ? variant["$true"] || variant["true"] : (_b = (_a = variant[value]) != null ? _a : variant["..."]) != null ? _b : value;
|
|
25
|
-
|
|
25
|
+
let res = val;
|
|
26
|
+
if (typeof res === "function") {
|
|
27
|
+
res = res(value, { tokens: conf.tokensParsed, theme, props });
|
|
28
|
+
}
|
|
26
29
|
if (isObj(res)) {
|
|
27
|
-
resolveTokens(res, conf, theme, fontFamily);
|
|
30
|
+
res = resolveTokens(res, conf, theme, fontFamily);
|
|
28
31
|
}
|
|
29
32
|
return res;
|
|
30
33
|
}
|
|
@@ -48,10 +51,11 @@ const createPropMapper = /* @__PURE__ */ __name((c) => {
|
|
|
48
51
|
}
|
|
49
52
|
};
|
|
50
53
|
}, "createPropMapper");
|
|
51
|
-
const resolveTokens = /* @__PURE__ */ __name((
|
|
52
|
-
|
|
54
|
+
const resolveTokens = /* @__PURE__ */ __name((input, conf, theme, fontFamily) => {
|
|
55
|
+
let res = {};
|
|
56
|
+
for (const rKey in input) {
|
|
53
57
|
const fKey = conf.shorthands[rKey] || rKey;
|
|
54
|
-
const val =
|
|
58
|
+
const val = input[rKey];
|
|
55
59
|
if (val instanceof Variable) {
|
|
56
60
|
res[fKey] = val.variable;
|
|
57
61
|
} else if (typeof val === "string") {
|
|
@@ -59,10 +63,13 @@ const resolveTokens = /* @__PURE__ */ __name((res, conf, theme, fontFamily) => {
|
|
|
59
63
|
res[fKey] = fVal;
|
|
60
64
|
} else {
|
|
61
65
|
if (isObj(val)) {
|
|
62
|
-
resolveTokens(val, conf, theme, fontFamily);
|
|
66
|
+
res[fKey] = resolveTokens(val, conf, theme, fontFamily);
|
|
67
|
+
} else {
|
|
68
|
+
res[fKey] = input[fKey];
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
71
|
}
|
|
72
|
+
return res;
|
|
66
73
|
}, "resolveTokens");
|
|
67
74
|
const getToken = /* @__PURE__ */ __name((key, value, { tokensParsed, themeParsed }, theme, fontFamily = "$body") => {
|
|
68
75
|
var _a, _b, _c, _d, _e, _f, _g;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.56",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "b447f26dfe9774656a9ffd16e82d06e588832ee0"
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/constants/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAA;AAGlD,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/constants/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAA;AAGlD,eAAO,MAAM,KAAK,SAEgD,CAAA;AAElE,eAAO,MAAM,KAAK,SAAyC,CAAA;AAC3D,eAAO,MAAM,yBAAyB,kBAAsC,CAAA;AAC5E,eAAO,MAAM,QAAQ,SAA+E,CAAA;AACpG,eAAO,MAAM,gBAAgB,SAA4D,CAAA;AACzF,eAAO,MAAM,aAAa,SAA6B,CAAA;AACvD,eAAO,MAAM,QAAQ,SAKA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPropMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/createPropMapper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAyB,MAAM,UAAU,CAAA;AAG9D,eAAO,MAAM,gBAAgB,MAAO,YAAY,WAKjC,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"createPropMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/createPropMapper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAyB,MAAM,UAAU,CAAA;AAG9D,eAAO,MAAM,gBAAgB,MAAO,YAAY,WAKjC,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAsDxD,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
12
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(module2))
|
|
14
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
15
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return target;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var getThemeParentClassName_exports = {};
|
|
25
|
-
__export(getThemeParentClassName_exports, {
|
|
26
|
-
getThemeParentClassName: () => getThemeParentClassName
|
|
27
|
-
});
|
|
28
|
-
var import_constants = require("./constants/constants");
|
|
29
|
-
function getThemeParentClassName(themeName) {
|
|
30
|
-
return `theme-parent ${themeName ? `${import_constants.PREFIX}${themeName}` : ""}`;
|
|
31
|
-
}
|
|
32
|
-
__name(getThemeParentClassName, "getThemeParentClassName");
|
|
33
|
-
module.exports = __toCommonJS(getThemeParentClassName_exports);
|
|
34
|
-
//# sourceMappingURL=getThemeParentClassName.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/getThemeParentClassName.ts"],
|
|
4
|
-
"sourcesContent": ["import { PREFIX } from './constants/constants'\n\nexport function getThemeParentClassName(themeName?: string | null) {\n return `theme-parent ${themeName ? `${PREFIX}${themeName}` : ''}`\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAuB;AAEhB,iCAAiC,WAA2B;AACjE,SAAO,gBAAgB,YAAY,GAAG,0BAAS,cAAc;AAAA;AAD/C;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { PREFIX } from "./constants/constants";
|
|
4
|
-
function getThemeParentClassName(themeName) {
|
|
5
|
-
return `theme-parent ${themeName ? `${PREFIX}${themeName}` : ""}`;
|
|
6
|
-
}
|
|
7
|
-
__name(getThemeParentClassName, "getThemeParentClassName");
|
|
8
|
-
export {
|
|
9
|
-
getThemeParentClassName
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=getThemeParentClassName.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/getThemeParentClassName.ts"],
|
|
4
|
-
"sourcesContent": ["import { PREFIX } from './constants/constants'\n\nexport function getThemeParentClassName(themeName?: string | null) {\n return `theme-parent ${themeName ? `${PREFIX}${themeName}` : ''}`\n}\n"],
|
|
5
|
-
"mappings": ";;AAAA;AAEO,iCAAiC,WAA2B;AACjE,SAAO,gBAAgB,YAAY,GAAG,SAAS,cAAc;AAAA;AAD/C;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { PREFIX } from "./constants/constants";
|
|
4
|
-
function getThemeParentClassName(themeName) {
|
|
5
|
-
return `theme-parent ${themeName ? `${PREFIX}${themeName}` : ""}`;
|
|
6
|
-
}
|
|
7
|
-
__name(getThemeParentClassName, "getThemeParentClassName");
|
|
8
|
-
export {
|
|
9
|
-
getThemeParentClassName
|
|
10
|
-
};
|