@tamagui/web 3.0.0-beta.807.1 → 3.0.0-beta.831.1
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/config.cjs +1 -1
- package/dist/cjs/config.native.cjs +1 -1
- package/dist/cjs/config.native.js +1 -1
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +28 -18
- package/dist/cjs/createComponent.native.cjs +30 -20
- package/dist/cjs/createComponent.native.js +30 -20
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createStyledHOC.cjs +54 -4
- package/dist/cjs/createStyledHOC.native.cjs +55 -4
- package/dist/cjs/createStyledHOC.native.js +55 -4
- package/dist/cjs/createStyledHOC.native.js.map +1 -1
- package/dist/cjs/createTokens.cjs +1 -1
- package/dist/cjs/createTokens.native.cjs +1 -1
- package/dist/cjs/createTokens.native.js +1 -1
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/dom/html.cjs +147 -99
- package/dist/cjs/dom/htmlRuntime.native.cjs +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
- package/dist/cjs/dom/primitives.native.cjs +16 -13
- package/dist/cjs/dom/primitives.native.js +16 -13
- package/dist/cjs/dom/primitives.native.js.map +1 -1
- package/dist/cjs/helpers/componentDisplayName.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/cjs/helpers/directStyleCSS.cjs +101 -104
- package/dist/cjs/helpers/formatDiagnostic.cjs +2 -4
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +2 -4
- package/dist/cjs/helpers/formatDiagnostic.native.js +2 -4
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +10 -10
- package/dist/cjs/helpers/getSplitStyles.cjs +168 -600
- package/dist/cjs/helpers/getSplitStyles.native.cjs +168 -762
- package/dist/cjs/helpers/getSplitStyles.native.js +168 -762
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/splitStyleProps.cjs +46 -0
- package/dist/cjs/helpers/splitStyleProps.native.cjs +49 -0
- package/dist/cjs/helpers/splitStyleProps.native.js +51 -0
- package/dist/cjs/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/cjs/helpers/styleStaticConfig.cjs +76 -0
- package/dist/cjs/helpers/styleStaticConfig.native.cjs +79 -0
- package/dist/cjs/helpers/styleStaticConfig.native.js +81 -0
- package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/cjs/helpers/tokenCategories.cjs +32 -71
- package/dist/cjs/helpers/tokenCategories.native.cjs +34 -73
- package/dist/cjs/helpers/tokenCategories.native.js +34 -73
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variantResolvers.cjs +87 -0
- package/dist/cjs/helpers/variantResolvers.native.cjs +140 -0
- package/dist/cjs/helpers/variantResolvers.native.js +142 -0
- package/dist/cjs/helpers/variantResolvers.native.js.map +1 -0
- package/dist/cjs/hooks/useSplitStyles.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/cjs/index.cjs +3 -9
- package/dist/cjs/index.native.cjs +3 -9
- package/dist/cjs/index.native.js +3 -9
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +8 -7
- package/dist/cjs/internal-runtime.native.cjs +8 -7
- package/dist/cjs/internal-runtime.native.js +8 -7
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +6 -5
- package/dist/cjs/static-resolve.native.cjs +6 -5
- package/dist/cjs/static-resolve.native.js +6 -5
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/styled.cjs +4 -56
- package/dist/cjs/styled.native.cjs +4 -58
- package/dist/cjs/styled.native.js +4 -58
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/types.cjs +1 -21
- package/dist/cjs/types.native.cjs +1 -21
- package/dist/cjs/types.native.js +1 -21
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +4 -2
- package/dist/cjs/views/Text.native.cjs +4 -2
- package/dist/cjs/views/Text.native.js +4 -2
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/View.cjs +4 -2
- package/dist/cjs/views/View.native.cjs +4 -2
- package/dist/cjs/views/View.native.js +4 -2
- package/dist/cjs/views/View.native.js.map +1 -1
- package/dist/esm/config.mjs +1 -1
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +1 -1
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +29 -19
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +31 -21
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createStyledHOC.mjs +55 -5
- package/dist/esm/createStyledHOC.mjs.map +1 -1
- package/dist/esm/createStyledHOC.native.js +56 -5
- package/dist/esm/createStyledHOC.native.js.map +1 -1
- package/dist/esm/createTokens.mjs +1 -1
- package/dist/esm/createTokens.mjs.map +1 -1
- package/dist/esm/createTokens.native.js +1 -1
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/dom/html.mjs +147 -99
- package/dist/esm/dom/html.mjs.map +1 -1
- package/dist/esm/dom/htmlRuntime.native.js +7 -3
- package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
- package/dist/esm/dom/primitives.native.js +16 -13
- package/dist/esm/dom/primitives.native.js.map +1 -1
- package/dist/esm/helpers/componentDisplayName.mjs +1 -8
- package/dist/esm/helpers/componentDisplayName.mjs.map +1 -1
- package/dist/esm/helpers/componentDisplayName.native.js +1 -8
- package/dist/esm/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/esm/helpers/directStyleCSS.mjs +101 -104
- package/dist/esm/helpers/directStyleCSS.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.mjs +2 -4
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +2 -4
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +10 -10
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +166 -594
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +166 -757
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/splitStyleProps.mjs +27 -0
- package/dist/esm/helpers/splitStyleProps.mjs.map +1 -0
- package/dist/esm/helpers/splitStyleProps.native.js +28 -0
- package/dist/esm/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.mjs +57 -0
- package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.native.js +58 -0
- package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/esm/helpers/tokenCategories.mjs +33 -72
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +35 -74
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variantResolvers.mjs +65 -0
- package/dist/esm/helpers/variantResolvers.mjs.map +1 -0
- package/dist/esm/helpers/variantResolvers.native.js +116 -0
- package/dist/esm/helpers/variantResolvers.native.js.map +1 -0
- package/dist/esm/hooks/useSplitStyles.mjs +2 -2
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js +2 -2
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/esm/index.js +3 -5
- package/dist/esm/index.mjs +3 -5
- package/dist/esm/index.native.js +3 -5
- package/dist/esm/internal-runtime.mjs +8 -7
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +8 -7
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/static-resolve.mjs +8 -6
- package/dist/esm/static-resolve.mjs.map +1 -1
- package/dist/esm/static-resolve.native.js +8 -6
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/styled.mjs +6 -57
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +6 -59
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/types.mjs +1 -18
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +1 -18
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +4 -2
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +4 -2
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/View.mjs +4 -2
- package/dist/esm/views/View.mjs.map +1 -1
- package/dist/esm/views/View.native.js +4 -2
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +15 -15
- package/src/config.ts +1 -1
- package/src/createComponent.tsx +41 -30
- package/src/createStyledHOC.tsx +56 -9
- package/src/createTokens.ts +1 -1
- package/src/dom/html.tsx +778 -877
- package/src/dom/htmlRuntime.native.tsx +7 -3
- package/src/dom/primitives.native.tsx +30 -39
- package/src/helpers/componentDisplayName.ts +0 -11
- package/src/helpers/directStyleCSS.ts +91 -112
- package/src/helpers/formatDiagnostic.ts +2 -4
- package/src/helpers/getCSSStylesAtomic.ts +32 -26
- package/src/helpers/getSplitStyles.tsx +315 -1119
- package/src/helpers/getVariantExtras.tsx +3 -3
- package/src/helpers/splitStyleProps.ts +166 -0
- package/src/helpers/styleFrontend.ts +8 -4
- package/src/helpers/styleStaticConfig.ts +88 -0
- package/src/helpers/tokenCategories.ts +62 -93
- package/src/helpers/variantResolvers.ts +121 -0
- package/src/hooks/useSplitStyles.tsx +17 -2
- package/src/hooks/useTheme.tsx +1 -1
- package/src/index.ts +8 -4
- package/src/internal-runtime.ts +10 -9
- package/src/static-resolve.ts +18 -14
- package/src/styled.tsx +7 -264
- package/src/types.tsx +19 -40
- package/src/views/Text.tsx +6 -7
- package/src/views/View.tsx +6 -7
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/dom/html.d.ts.map +1 -1
- package/types/dom/htmlRuntime.native.d.ts.map +1 -1
- package/types/dom/primitives.native.d.ts.map +1 -1
- package/types/helpers/componentDisplayName.d.ts +0 -3
- package/types/helpers/componentDisplayName.d.ts.map +1 -1
- package/types/helpers/directStyleCSS.d.ts.map +1 -1
- package/types/helpers/formatDiagnostic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.d.ts +17 -15
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +6 -6
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/splitStyleProps.d.ts +44 -0
- package/types/helpers/splitStyleProps.d.ts.map +1 -0
- package/types/helpers/styleFrontend.d.ts +4 -4
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleStaticConfig.d.ts +19 -0
- package/types/helpers/styleStaticConfig.d.ts.map +1 -0
- package/types/helpers/tokenCategories.d.ts +1 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/variantResolvers.d.ts +9 -0
- package/types/helpers/variantResolvers.d.ts.map +1 -0
- package/types/hooks/useSplitStyles.d.ts.map +1 -1
- package/types/index.d.ts +2 -4
- package/types/index.d.ts.map +1 -1
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/static-resolve.d.ts +2 -2
- package/types/static-resolve.d.ts.map +1 -1
- package/types/styled.d.ts +3 -39
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +2 -12
- package/types/types.d.ts.map +1 -1
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/View.d.ts.map +1 -1
- package/dist/cjs/helpers/getDefaultProps.cjs +0 -24
- package/dist/cjs/helpers/getDefaultProps.native.cjs +0 -28
- package/dist/cjs/helpers/getDefaultProps.native.js +0 -30
- package/dist/cjs/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/cjs/helpers/themeable.cjs +0 -92
- package/dist/cjs/helpers/themeable.native.cjs +0 -95
- package/dist/cjs/helpers/themeable.native.js +0 -97
- package/dist/cjs/helpers/themeable.native.js.map +0 -1
- package/dist/cjs/hooks/useProps.cjs +0 -129
- package/dist/cjs/hooks/useProps.native.cjs +0 -135
- package/dist/cjs/hooks/useProps.native.js +0 -137
- package/dist/cjs/hooks/useProps.native.js.map +0 -1
- package/dist/esm/helpers/getDefaultProps.mjs +0 -4
- package/dist/esm/helpers/getDefaultProps.mjs.map +0 -1
- package/dist/esm/helpers/getDefaultProps.native.js +0 -6
- package/dist/esm/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/esm/helpers/themeable.mjs +0 -67
- package/dist/esm/helpers/themeable.mjs.map +0 -1
- package/dist/esm/helpers/themeable.native.js +0 -68
- package/dist/esm/helpers/themeable.native.js.map +0 -1
- package/dist/esm/hooks/useProps.mjs +0 -100
- package/dist/esm/hooks/useProps.mjs.map +0 -1
- package/dist/esm/hooks/useProps.native.js +0 -104
- package/dist/esm/hooks/useProps.native.js.map +0 -1
- package/src/helpers/getDefaultProps.ts +0 -3
- package/src/helpers/themeable.tsx +0 -96
- package/src/hooks/useProps.tsx +0 -186
- package/types/helpers/getDefaultProps.d.ts +0 -3
- package/types/helpers/getDefaultProps.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts +0 -3
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/hooks/useProps.d.ts +0 -39
- package/types/hooks/useProps.d.ts.map +0 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { isVariable } from "../createVariable.native.js";
|
|
2
|
+
|
|
3
|
+
function _type_of(obj) {
|
|
4
|
+
"@swc/helpers - typeof";
|
|
5
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
6
|
+
}
|
|
7
|
+
var variantResolverCache = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
function getCompiledVariantResolvers(variant) {
|
|
9
|
+
var compiled = variantResolverCache.get(variant);
|
|
10
|
+
if (!compiled) {
|
|
11
|
+
var next = [];
|
|
12
|
+
for (var key in variant) {
|
|
13
|
+
var parts = parseVariantResolverKey(key);
|
|
14
|
+
if (parts) next.push({
|
|
15
|
+
key,
|
|
16
|
+
parts
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
compiled = next;
|
|
20
|
+
variantResolverCache.set(variant, compiled);
|
|
21
|
+
}
|
|
22
|
+
return compiled;
|
|
23
|
+
}
|
|
24
|
+
function parseVariantResolverKey(key) {
|
|
25
|
+
if (!key) return null;
|
|
26
|
+
return key.split("|").map(function(part) {
|
|
27
|
+
return part.trim();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function getVariantDefinition(variant, value, conf, param) {
|
|
31
|
+
var { theme } = param;
|
|
32
|
+
if (!variant) return;
|
|
33
|
+
if (value === void 0) return;
|
|
34
|
+
if (typeof variant === "function") {
|
|
35
|
+
return variant;
|
|
36
|
+
}
|
|
37
|
+
if (value in variant) {
|
|
38
|
+
return variant[value];
|
|
39
|
+
}
|
|
40
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
41
|
+
try {
|
|
42
|
+
for (var _iterator = getCompiledVariantResolvers(variant)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
43
|
+
var { key, parts } = _step.value;
|
|
44
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
45
|
+
try {
|
|
46
|
+
for (var _iterator1 = parts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
47
|
+
var part = _step1.value;
|
|
48
|
+
if (matchesVariantResolver(part, value, conf, theme)) {
|
|
49
|
+
return variant[key];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
} catch (err) {
|
|
53
|
+
_didIteratorError1 = true;
|
|
54
|
+
_iteratorError1 = err;
|
|
55
|
+
} finally {
|
|
56
|
+
try {
|
|
57
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
58
|
+
_iterator1.return();
|
|
59
|
+
}
|
|
60
|
+
} finally {
|
|
61
|
+
if (_didIteratorError1) {
|
|
62
|
+
throw _iteratorError1;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} catch (err) {
|
|
68
|
+
_didIteratorError = true;
|
|
69
|
+
_iteratorError = err;
|
|
70
|
+
} finally {
|
|
71
|
+
try {
|
|
72
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
73
|
+
_iterator.return();
|
|
74
|
+
}
|
|
75
|
+
} finally {
|
|
76
|
+
if (_didIteratorError) {
|
|
77
|
+
throw _iteratorError;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function matchesVariantResolver(resolverName, value, conf, theme) {
|
|
83
|
+
var string = typeof value === "string";
|
|
84
|
+
var number = typeof value === "number";
|
|
85
|
+
var rem = string && value.length > 3 && value.endsWith("rem") && Number.isFinite(Number(value.slice(0, -3)));
|
|
86
|
+
switch (resolverName) {
|
|
87
|
+
case "Size":
|
|
88
|
+
case "Space":
|
|
89
|
+
case "Radius":
|
|
90
|
+
case "ZIndex": return value === true || number || string || resolverName !== "Size" && isVariable(value);
|
|
91
|
+
case "Color": return string;
|
|
92
|
+
case "Theme": return string && !!theme && value in theme;
|
|
93
|
+
case "FontSize":
|
|
94
|
+
var _conf_fontsParsed_body_size, _conf_fontsParsed_body;
|
|
95
|
+
return value === true || !!((_conf_fontsParsed_body = conf.fontsParsed.body) === null || _conf_fontsParsed_body === void 0 ? void 0 : (_conf_fontsParsed_body_size = _conf_fontsParsed_body.size) === null || _conf_fontsParsed_body_size === void 0 ? void 0 : _conf_fontsParsed_body_size[value]) || number || rem;
|
|
96
|
+
case "FontStyle":
|
|
97
|
+
var _conf_fontsParsed_body_style, _conf_fontsParsed_body1;
|
|
98
|
+
return !!((_conf_fontsParsed_body1 = conf.fontsParsed.body) === null || _conf_fontsParsed_body1 === void 0 ? void 0 : (_conf_fontsParsed_body_style = _conf_fontsParsed_body1.style) === null || _conf_fontsParsed_body_style === void 0 ? void 0 : _conf_fontsParsed_body_style[value]) || value === "normal" || value === "italic";
|
|
99
|
+
case "FontTransform":
|
|
100
|
+
var _conf_fontsParsed_body_transform, _conf_fontsParsed_body2;
|
|
101
|
+
return !!((_conf_fontsParsed_body2 = conf.fontsParsed.body) === null || _conf_fontsParsed_body2 === void 0 ? void 0 : (_conf_fontsParsed_body_transform = _conf_fontsParsed_body2.transform) === null || _conf_fontsParsed_body_transform === void 0 ? void 0 : _conf_fontsParsed_body_transform[value]) || value === "none" || value === "capitalize" || value === "uppercase" || value === "lowercase";
|
|
102
|
+
case "FontLineHeight":
|
|
103
|
+
var _conf_fontsParsed_body_lineHeight, _conf_fontsParsed_body3;
|
|
104
|
+
return !!((_conf_fontsParsed_body3 = conf.fontsParsed.body) === null || _conf_fontsParsed_body3 === void 0 ? void 0 : (_conf_fontsParsed_body_lineHeight = _conf_fontsParsed_body3.lineHeight) === null || _conf_fontsParsed_body_lineHeight === void 0 ? void 0 : _conf_fontsParsed_body_lineHeight[value]) || number || rem;
|
|
105
|
+
case "FontLetterSpacing":
|
|
106
|
+
var _conf_fontsParsed_body_letterSpacing, _conf_fontsParsed_body4;
|
|
107
|
+
return !!((_conf_fontsParsed_body4 = conf.fontsParsed.body) === null || _conf_fontsParsed_body4 === void 0 ? void 0 : (_conf_fontsParsed_body_letterSpacing = _conf_fontsParsed_body4.letterSpacing) === null || _conf_fontsParsed_body_letterSpacing === void 0 ? void 0 : _conf_fontsParsed_body_letterSpacing[value]) || number || rem;
|
|
108
|
+
case "number":
|
|
109
|
+
case "string":
|
|
110
|
+
case "boolean": return (typeof value === "undefined" ? "undefined" : _type_of(value)) === resolverName;
|
|
111
|
+
case "any": return true;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { getCompiledVariantResolvers, getVariantDefinition };
|
|
116
|
+
//# sourceMappingURL=variantResolvers.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variantResolvers.native.js","names":[],"sources":["esm/helpers/variantResolvers.native.js"],"sourcesContent":["import { isVariable } from \"../createVariable\";\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar variantResolverCache = /* @__PURE__ */ new WeakMap();\nfunction getCompiledVariantResolvers(variant) {\n var compiled = variantResolverCache.get(variant);\n if (!compiled) {\n var next = [];\n for (var key in variant) {\n var parts = parseVariantResolverKey(key);\n if (parts) next.push({\n key,\n parts\n });\n }\n compiled = next;\n variantResolverCache.set(variant, compiled);\n }\n return compiled;\n}\nfunction parseVariantResolverKey(key) {\n if (!key) return null;\n return key.split(\"|\").map(function(part) {\n return part.trim();\n });\n}\nfunction getVariantDefinition(variant, value, conf, param) {\n var { theme } = param;\n if (!variant) return;\n if (value === void 0) return;\n if (typeof variant === \"function\") {\n return variant;\n }\n if (value in variant) {\n return variant[value];\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = getCompiledVariantResolvers(variant)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var { key, parts } = _step.value;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = parts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var part = _step1.value;\n if (matchesVariantResolver(part, value, conf, theme)) {\n return variant[key];\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction matchesVariantResolver(resolverName, value, conf, theme) {\n var string = typeof value === \"string\";\n var number = typeof value === \"number\";\n var rem = string && value.length > 3 && value.endsWith(\"rem\") && Number.isFinite(Number(value.slice(0, -3)));\n switch (resolverName) {\n case \"Size\":\n case \"Space\":\n case \"Radius\":\n case \"ZIndex\":\n return value === true || number || string || resolverName !== \"Size\" && isVariable(value);\n // a token or theme color, otherwise any string is taken to be a raw CSS\n // color and left for the browser to resolve. checking that against a CSS\n // color-name table costs 2.3KB gzip to reject values that were never valid\n // anyway. `red/50` opacity modifiers stay limited to token and theme\n // colors, which the branches above already covered.\n case \"Color\":\n return string;\n case \"Theme\":\n return string && !!theme && value in theme;\n case \"FontSize\":\n var _conf_fontsParsed_body_size, _conf_fontsParsed_body;\n return value === true || !!((_conf_fontsParsed_body = conf.fontsParsed.body) === null || _conf_fontsParsed_body === void 0 ? void 0 : (_conf_fontsParsed_body_size = _conf_fontsParsed_body.size) === null || _conf_fontsParsed_body_size === void 0 ? void 0 : _conf_fontsParsed_body_size[value]) || number || rem;\n case \"FontStyle\":\n var _conf_fontsParsed_body_style, _conf_fontsParsed_body1;\n return !!((_conf_fontsParsed_body1 = conf.fontsParsed.body) === null || _conf_fontsParsed_body1 === void 0 ? void 0 : (_conf_fontsParsed_body_style = _conf_fontsParsed_body1.style) === null || _conf_fontsParsed_body_style === void 0 ? void 0 : _conf_fontsParsed_body_style[value]) || value === \"normal\" || value === \"italic\";\n case \"FontTransform\":\n var _conf_fontsParsed_body_transform, _conf_fontsParsed_body2;\n return !!((_conf_fontsParsed_body2 = conf.fontsParsed.body) === null || _conf_fontsParsed_body2 === void 0 ? void 0 : (_conf_fontsParsed_body_transform = _conf_fontsParsed_body2.transform) === null || _conf_fontsParsed_body_transform === void 0 ? void 0 : _conf_fontsParsed_body_transform[value]) || value === \"none\" || value === \"capitalize\" || value === \"uppercase\" || value === \"lowercase\";\n case \"FontLineHeight\":\n var _conf_fontsParsed_body_lineHeight, _conf_fontsParsed_body3;\n return !!((_conf_fontsParsed_body3 = conf.fontsParsed.body) === null || _conf_fontsParsed_body3 === void 0 ? void 0 : (_conf_fontsParsed_body_lineHeight = _conf_fontsParsed_body3.lineHeight) === null || _conf_fontsParsed_body_lineHeight === void 0 ? void 0 : _conf_fontsParsed_body_lineHeight[value]) || number || rem;\n case \"FontLetterSpacing\":\n var _conf_fontsParsed_body_letterSpacing, _conf_fontsParsed_body4;\n return !!((_conf_fontsParsed_body4 = conf.fontsParsed.body) === null || _conf_fontsParsed_body4 === void 0 ? void 0 : (_conf_fontsParsed_body_letterSpacing = _conf_fontsParsed_body4.letterSpacing) === null || _conf_fontsParsed_body_letterSpacing === void 0 ? void 0 : _conf_fontsParsed_body_letterSpacing[value]) || number || rem;\n case \"number\":\n case \"string\":\n case \"boolean\":\n return (typeof value === \"undefined\" ? \"undefined\" : _type_of(value)) === resolverName;\n case \"any\":\n return true;\n }\n}\nexport {\n getCompiledVariantResolvers,\n getVariantDefinition\n};\n//# sourceMappingURL=variantResolvers.js.map\n"],"mappings":";;;AACA,SAAS,SAAS,KAAK;CACrB;C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4BAA4B,KAAK,IAAI,KAAK,KAAK,+BAA+B,wBAAwB,WAAW,QAAQ,iCAAiC,KAAK,IAAI,KAAK,IAAI,6BAA6B,WAAW,UAAU,YAAY,UAAU;EAC9T,KAAK;GACH,IAAI,kCAAkC;GACtC,OAAO,CAAC,GAAG,0BAA0B,KAAK,YAAY,UAAU,QAAQ,4BAA4B,KAAK,IAAI,KAAK,KAAK,mCAAmC,wBAAwB,eAAe,QAAQ,qCAAqC,KAAK,IAAI,KAAK,IAAI,iCAAiC,WAAW,UAAU,UAAU,UAAU,gBAAgB,UAAU,eAAe,UAAU;EAC/X,KAAK;GACH,IAAI,mCAAmC;GACvC,OAAO,CAAC,GAAG,0BAA0B,KAAK,YAAY,UAAU,QAAQ,4BAA4B,KAAK,IAAI,KAAK,KAAK,oCAAoC,wBAAwB,gBAAgB,QAAQ,sCAAsC,KAAK,IAAI,KAAK,IAAI,kCAAkC,WAAW,UAAU;EAC5T,KAAK;GACH,IAAI,sCAAsC;GAC1C,OAAO,CAAC,GAAG,0BAA0B,KAAK,YAAY,UAAU,QAAQ,4BAA4B,KAAK,IAAI,KAAK,KAAK,uCAAuC,wBAAwB,mBAAmB,QAAQ,yCAAyC,KAAK,IAAI,KAAK,IAAI,qCAAqC,WAAW,UAAU;EACxU,KAAK;EACL,KAAK;EACL,KAAK,WACH,QAAQ,OAAO,UAAU,cAAc,cAAc,SAAS,KAAK,OAAO;EAC5E,KAAK,OACH,OAAO;CACX;AACF"}
|
|
@@ -4,9 +4,9 @@ import { getSplitStyles } from "../helpers/getSplitStyles.mjs";
|
|
|
4
4
|
import { insertStyleRules } from "../helpers/insertStyleRule.mjs";
|
|
5
5
|
|
|
6
6
|
const useInsertEffectCompat = isWeb ? React.useInsertionEffect || useIsomorphicLayoutEffect : () => {};
|
|
7
|
-
const useSplitStyles = (a, b, c, d, e, f, g, h, i, j, k, l, m) => {
|
|
7
|
+
const useSplitStyles = (a, b, c, d, e, f, g, h, i, j, k, l, m, n) => {
|
|
8
8
|
"use no memo";
|
|
9
|
-
const res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l, m);
|
|
9
|
+
const res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l, m, n);
|
|
10
10
|
if (!process.env.TAMAGUI_DID_OUTPUT_CSS && true) useInsertEffectCompat(() => {
|
|
11
11
|
if (res) insertStyleRules(res.rulesToInsert);
|
|
12
12
|
}, [res?.rulesToInsert]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSplitStyles.js","names":[],"sources":["esm/hooks/useSplitStyles.js"],"sourcesContent":["import { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport React from \"react\";\nimport { getSplitStyles } from \"../helpers/getSplitStyles\";\nimport { insertStyleRules } from \"../helpers/insertStyleRule\";\n\nconst useInsertEffectCompat = isWeb ? React.useInsertionEffect || useIsomorphicLayoutEffect : () => {};\nconst useSplitStyles = (a, b, c, d, e, f, g, h, i, j, k, l, m) => {\n\t\"use no memo\";\n\tconst res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l, m);\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS && true) useInsertEffectCompat(() => {\n\t\tif (res) insertStyleRules(res.rulesToInsert);\n\t}, [res?.rulesToInsert]);\n\treturn res;\n};\n\nexport { useSplitStyles };"],"mappings":";;;;;;AAKA,MAAM,wBAAwB,QAAQ,MAAM,sBAAsB,kCAAkC,CAAC;AACrG,MAAM,kBAAkB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"useSplitStyles.js","names":[],"sources":["esm/hooks/useSplitStyles.js"],"sourcesContent":["import { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport React from \"react\";\nimport { getSplitStyles } from \"../helpers/getSplitStyles\";\nimport { insertStyleRules } from \"../helpers/insertStyleRule\";\n\nconst useInsertEffectCompat = isWeb ? React.useInsertionEffect || useIsomorphicLayoutEffect : () => {};\nconst useSplitStyles = (a, b, c, d, e, f, g, h, i, j, k, l, m, n) => {\n\t\"use no memo\";\n\tconst res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l, m, n);\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS && true) useInsertEffectCompat(() => {\n\t\tif (res) insertStyleRules(res.rulesToInsert);\n\t}, [res?.rulesToInsert]);\n\treturn res;\n};\n\nexport { useSplitStyles };"],"mappings":";;;;;;AAKA,MAAM,wBAAwB,QAAQ,MAAM,sBAAsB,kCAAkC,CAAC;AACrG,MAAM,kBAAkB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM;CACpE;CACA,MAAM,MAAM,eAAe,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CACnE,IAAI,CAAC,QAAQ,IAAI,0BAA0B,MAAM,4BAA4B;EAC5E,IAAI,KAAK,iBAAiB,IAAI,aAAa;CAC5C,GAAG,CAAC,KAAK,aAAa,CAAC;CACvB,OAAO;AACR"}
|
|
@@ -3,9 +3,9 @@ import React from "react";
|
|
|
3
3
|
import { getSplitStyles } from "../helpers/getSplitStyles.native.js";
|
|
4
4
|
|
|
5
5
|
isWeb && React.useInsertionEffect;
|
|
6
|
-
var useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k, l, m) {
|
|
6
|
+
var useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {
|
|
7
7
|
"use no memo";
|
|
8
|
-
var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l, m);
|
|
8
|
+
var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l, m, n);
|
|
9
9
|
if (!process.env.TAMAGUI_DID_OUTPUT_CSS && false);
|
|
10
10
|
return res;
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSplitStyles.native.js","names":[],"sources":["esm/hooks/useSplitStyles.native.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport React from \"react\";\nimport { getSplitStyles } from \"../helpers/getSplitStyles\";\n\nisWeb && React.useInsertionEffect;\nvar useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k, l, m) {\n\t\"use no memo\";\n\tvar res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l, m);\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS && false);\n\treturn res;\n};\n\nexport { useSplitStyles };"],"mappings":";;;;;AAIA,SAAS,MAAM;AACf,IAAI,iBAAiB,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG;
|
|
1
|
+
{"version":3,"file":"useSplitStyles.native.js","names":[],"sources":["esm/hooks/useSplitStyles.native.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport React from \"react\";\nimport { getSplitStyles } from \"../helpers/getSplitStyles\";\n\nisWeb && React.useInsertionEffect;\nvar useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k, l, m, n) {\n\t\"use no memo\";\n\tvar res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l, m, n);\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS && false);\n\treturn res;\n};\n\nexport { useSplitStyles };"],"mappings":";;;;;AAIA,SAAS,MAAM;AACf,IAAI,iBAAiB,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG;CACvE;CACA,IAAI,MAAM,eAAe,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CACjE,IAAI,CAAC,QAAQ,IAAI,0BAA0B;CAC3C,OAAO;AACR"}
|
package/dist/esm/index.js
CHANGED
|
@@ -5,11 +5,10 @@ import { _withStableStyle } from "./_withStableStyle.mjs";
|
|
|
5
5
|
import { _withNativeStyle } from "./_withNativeStyle.mjs";
|
|
6
6
|
import { createComponent } from "./createComponent.mjs";
|
|
7
7
|
import { createStyledContext } from "./helpers/createStyledContext.mjs";
|
|
8
|
-
import { getDefaultProps } from "./helpers/getDefaultProps.mjs";
|
|
9
8
|
import { getCSSStylesAtomic } from "./helpers/getCSSStylesAtomic.mjs";
|
|
10
9
|
import { getExpandedShorthand } from "./helpers/getExpandedShorthands.mjs";
|
|
11
10
|
import { formatDiagnostic } from "./helpers/formatDiagnostic.mjs";
|
|
12
|
-
import { getSplitStyles,
|
|
11
|
+
import { getSplitStyles, getStyleStaticConfig, isValidStyleKey } from "./helpers/getSplitStyles.mjs";
|
|
13
12
|
import { getNativeStyleEngine, removeNativeStyleScope, setNativeStyleEngine, setNativeStyleEngineFlushListener, updateNativeStyleScope } from "./helpers/nativeStyleEngine.mjs";
|
|
14
13
|
import { autoVariables, getAutoVariableCSS, getMutatedAutoVariableCSS, mutatedAutoVariables } from "./helpers/registerCSSVariable.mjs";
|
|
15
14
|
import { insertStyleRules, setNonce } from "./helpers/insertStyleRule.mjs";
|
|
@@ -18,10 +17,10 @@ import { isTamaguiElement } from "./helpers/isTamaguiElement.mjs";
|
|
|
18
17
|
import { matchMedia, setupMatchMedia } from "./helpers/matchMedia.mjs";
|
|
19
18
|
import { mergeProps } from "./helpers/mergeProps.mjs";
|
|
20
19
|
import { mergeSlotStyleProps } from "./helpers/mergeSlotStyleProps.mjs";
|
|
20
|
+
import { splitStyleProps } from "./helpers/splitStyleProps.mjs";
|
|
21
21
|
import { normalizeColor } from "./helpers/normalizeColor.mjs";
|
|
22
22
|
import { normalizeStyle } from "./helpers/normalizeStyle.mjs";
|
|
23
23
|
import { containsThemeRef, themeRefKey } from "./helpers/themeRef.mjs";
|
|
24
|
-
import { themeable } from "./helpers/themeable.mjs";
|
|
25
24
|
import { getStyleTags } from "./helpers/wrapStyleTags.mjs";
|
|
26
25
|
import { createFont } from "./createFont.mjs";
|
|
27
26
|
import { createChangeEventDetails } from "./eventDetails.mjs";
|
|
@@ -41,7 +40,6 @@ import { _disableMediaTouch, _mediaListenerStats, configureMedia, mediaKeyMatch,
|
|
|
41
40
|
import { mediaObjectToString } from "./helpers/mediaObjectToString.mjs";
|
|
42
41
|
import { getMedia, mediaQueryConfig, mediaState, setMediaState } from "./helpers/mediaState.mjs";
|
|
43
42
|
import { useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver } from "./hooks/useAnimationDriver.mjs";
|
|
44
|
-
import { useProps, usePropsAndStyle, useStyle } from "./hooks/useProps.mjs";
|
|
45
43
|
import { useTheme } from "./hooks/useTheme.mjs";
|
|
46
44
|
import { usePortalThemeState } from "./hooks/usePortalThemeState.mjs";
|
|
47
45
|
import { useThemeName } from "./hooks/useThemeName.mjs";
|
|
@@ -62,4 +60,4 @@ import { ClientOnly, ClientOnlyContext, useClientValue, useDidFinishSSR, useIsCl
|
|
|
62
60
|
import { useEvent, useGet } from "@tamagui/use-event";
|
|
63
61
|
import { hooks, setupHooks } from "./setupHooks.mjs";
|
|
64
62
|
|
|
65
|
-
export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, createVariantResolver, cssShorthandLonghands, currentPlatform, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig,
|
|
63
|
+
export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, createVariantResolver, cssShorthandLonghands, currentPlatform, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig, getExpandedShorthand, getMedia, getMutatedAutoVariableCSS, getNativeStyleEngine, getPlatformDriver, getSetting, getSplitStyles, getStyleCompat, getStyleStaticConfig, getStyleTags, getThemeClassNames, getThemeProviderChainSizes, getThemes, getToken, getTokenValue, getTokens, getVariable, getVariableName, getVariableValue, getVariableVariable, hooks, html, insertFont, insertStyleRules, installTamaguiConfig, isAndroid, isBrowser, isChrome, isClient, isEqualShallow, isIos, isNativeDesktop, isServer, isTV, isTamaguiComponent, isTamaguiElement, isTouchable, isValidStyleKey, isVariable, isWeb, isWebTouchable, loadAnimationDriver, matchMedia, mediaKeyMatch, mediaObjectToString, mediaQueryConfig, mediaState, mergeIfNotShallowEqual, mergeProps, mergeSlotStyleProps, mutatedAutoVariables, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, normalizeColor, normalizeStyle, px, removeNativeStyleScope, reservedThemeProps, resolveThemeName, setConfig, setMediaState, setNativeStyleEngine, setNativeStyleEngineFlushListener, setNonce, setRef, setupDev, setupHooks, setupMatchMedia, setupPlatformDriver, shouldRenderNativePlatform, simpleHash, splitStyleProps, stylePropsAll, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, styled, supportsDynamicColorIOS, textStaticConfig, themeRefKey, tokenCategories, updateConfig, updateFont, updateMediaListeners, updateNativeStyleScope, useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver, useClientValue, useComposedRefs, useConfiguration, useCreateShallowSetState, useDidFinishSSR, useEvent, useGet, useIsClientOnly, useIsTouchDevice, useIsomorphicLayoutEffect, useMedia, usePortalThemeState, useTheme, useThemeName, validStyles, variableToString, viewStaticConfig, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -5,11 +5,10 @@ import { _withStableStyle } from "./_withStableStyle.mjs";
|
|
|
5
5
|
import { _withNativeStyle } from "./_withNativeStyle.mjs";
|
|
6
6
|
import { createComponent } from "./createComponent.mjs";
|
|
7
7
|
import { createStyledContext } from "./helpers/createStyledContext.mjs";
|
|
8
|
-
import { getDefaultProps } from "./helpers/getDefaultProps.mjs";
|
|
9
8
|
import { getCSSStylesAtomic } from "./helpers/getCSSStylesAtomic.mjs";
|
|
10
9
|
import { getExpandedShorthand } from "./helpers/getExpandedShorthands.mjs";
|
|
11
10
|
import { formatDiagnostic } from "./helpers/formatDiagnostic.mjs";
|
|
12
|
-
import { getSplitStyles,
|
|
11
|
+
import { getSplitStyles, getStyleStaticConfig, isValidStyleKey } from "./helpers/getSplitStyles.mjs";
|
|
13
12
|
import { getNativeStyleEngine, removeNativeStyleScope, setNativeStyleEngine, setNativeStyleEngineFlushListener, updateNativeStyleScope } from "./helpers/nativeStyleEngine.mjs";
|
|
14
13
|
import { autoVariables, getAutoVariableCSS, getMutatedAutoVariableCSS, mutatedAutoVariables } from "./helpers/registerCSSVariable.mjs";
|
|
15
14
|
import { insertStyleRules, setNonce } from "./helpers/insertStyleRule.mjs";
|
|
@@ -18,10 +17,10 @@ import { isTamaguiElement } from "./helpers/isTamaguiElement.mjs";
|
|
|
18
17
|
import { matchMedia, setupMatchMedia } from "./helpers/matchMedia.mjs";
|
|
19
18
|
import { mergeProps } from "./helpers/mergeProps.mjs";
|
|
20
19
|
import { mergeSlotStyleProps } from "./helpers/mergeSlotStyleProps.mjs";
|
|
20
|
+
import { splitStyleProps } from "./helpers/splitStyleProps.mjs";
|
|
21
21
|
import { normalizeColor } from "./helpers/normalizeColor.mjs";
|
|
22
22
|
import { normalizeStyle } from "./helpers/normalizeStyle.mjs";
|
|
23
23
|
import { containsThemeRef, themeRefKey } from "./helpers/themeRef.mjs";
|
|
24
|
-
import { themeable } from "./helpers/themeable.mjs";
|
|
25
24
|
import { getStyleTags } from "./helpers/wrapStyleTags.mjs";
|
|
26
25
|
import { createFont } from "./createFont.mjs";
|
|
27
26
|
import { createChangeEventDetails } from "./eventDetails.mjs";
|
|
@@ -41,7 +40,6 @@ import { _disableMediaTouch, _mediaListenerStats, configureMedia, mediaKeyMatch,
|
|
|
41
40
|
import { mediaObjectToString } from "./helpers/mediaObjectToString.mjs";
|
|
42
41
|
import { getMedia, mediaQueryConfig, mediaState, setMediaState } from "./helpers/mediaState.mjs";
|
|
43
42
|
import { useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver } from "./hooks/useAnimationDriver.mjs";
|
|
44
|
-
import { useProps, usePropsAndStyle, useStyle } from "./hooks/useProps.mjs";
|
|
45
43
|
import { useTheme } from "./hooks/useTheme.mjs";
|
|
46
44
|
import { usePortalThemeState } from "./hooks/usePortalThemeState.mjs";
|
|
47
45
|
import { useThemeName } from "./hooks/useThemeName.mjs";
|
|
@@ -62,4 +60,4 @@ import { ClientOnly, ClientOnlyContext, useClientValue, useDidFinishSSR, useIsCl
|
|
|
62
60
|
import { useEvent, useGet } from "@tamagui/use-event";
|
|
63
61
|
import { hooks, setupHooks } from "./setupHooks.mjs";
|
|
64
62
|
|
|
65
|
-
export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, createVariantResolver, cssShorthandLonghands, currentPlatform, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig,
|
|
63
|
+
export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, createVariantResolver, cssShorthandLonghands, currentPlatform, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig, getExpandedShorthand, getMedia, getMutatedAutoVariableCSS, getNativeStyleEngine, getPlatformDriver, getSetting, getSplitStyles, getStyleCompat, getStyleStaticConfig, getStyleTags, getThemeClassNames, getThemeProviderChainSizes, getThemes, getToken, getTokenValue, getTokens, getVariable, getVariableName, getVariableValue, getVariableVariable, hooks, html, insertFont, insertStyleRules, installTamaguiConfig, isAndroid, isBrowser, isChrome, isClient, isEqualShallow, isIos, isNativeDesktop, isServer, isTV, isTamaguiComponent, isTamaguiElement, isTouchable, isValidStyleKey, isVariable, isWeb, isWebTouchable, loadAnimationDriver, matchMedia, mediaKeyMatch, mediaObjectToString, mediaQueryConfig, mediaState, mergeIfNotShallowEqual, mergeProps, mergeSlotStyleProps, mutatedAutoVariables, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, normalizeColor, normalizeStyle, px, removeNativeStyleScope, reservedThemeProps, resolveThemeName, setConfig, setMediaState, setNativeStyleEngine, setNativeStyleEngineFlushListener, setNonce, setRef, setupDev, setupHooks, setupMatchMedia, setupPlatformDriver, shouldRenderNativePlatform, simpleHash, splitStyleProps, stylePropsAll, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, styled, supportsDynamicColorIOS, textStaticConfig, themeRefKey, tokenCategories, updateConfig, updateFont, updateMediaListeners, updateNativeStyleScope, useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver, useClientValue, useComposedRefs, useConfiguration, useCreateShallowSetState, useDidFinishSSR, useEvent, useGet, useIsClientOnly, useIsTouchDevice, useIsomorphicLayoutEffect, useMedia, usePortalThemeState, useTheme, useThemeName, validStyles, variableToString, viewStaticConfig, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties };
|
package/dist/esm/index.native.js
CHANGED
|
@@ -5,11 +5,10 @@ import { _withStableStyle } from "./_withStableStyle.native.js";
|
|
|
5
5
|
import { _withNativeStyle } from "./_withNativeStyle.native.js";
|
|
6
6
|
import { createComponent } from "./createComponent.native.js";
|
|
7
7
|
import { createStyledContext } from "./helpers/createStyledContext.native.js";
|
|
8
|
-
import { getDefaultProps } from "./helpers/getDefaultProps.native.js";
|
|
9
8
|
import { getCSSStylesAtomic } from "./helpers/getCSSStylesAtomic.native.js";
|
|
10
9
|
import { getExpandedShorthand } from "./helpers/getExpandedShorthands.native.js";
|
|
11
10
|
import { formatDiagnostic } from "./helpers/formatDiagnostic.native.js";
|
|
12
|
-
import { getSplitStyles,
|
|
11
|
+
import { getSplitStyles, getStyleStaticConfig, isValidStyleKey } from "./helpers/getSplitStyles.native.js";
|
|
13
12
|
import { getNativeStyleEngine, removeNativeStyleScope, setNativeStyleEngine, setNativeStyleEngineFlushListener, updateNativeStyleScope } from "./helpers/nativeStyleEngine.native.js";
|
|
14
13
|
import { autoVariables, getAutoVariableCSS, getMutatedAutoVariableCSS, mutatedAutoVariables } from "./helpers/registerCSSVariable.native.js";
|
|
15
14
|
import { insertStyleRules, setNonce } from "./helpers/insertStyleRule.native.js";
|
|
@@ -18,10 +17,10 @@ import { isTamaguiElement } from "./helpers/isTamaguiElement.native.js";
|
|
|
18
17
|
import { matchMedia, setupMatchMedia } from "./helpers/matchMedia.native.js";
|
|
19
18
|
import { mergeProps } from "./helpers/mergeProps.native.js";
|
|
20
19
|
import { mergeSlotStyleProps } from "./helpers/mergeSlotStyleProps.native.js";
|
|
20
|
+
import { splitStyleProps } from "./helpers/splitStyleProps.native.js";
|
|
21
21
|
import { normalizeColor } from "./helpers/normalizeColor.native.js";
|
|
22
22
|
import { normalizeStyle } from "./helpers/normalizeStyle.native.js";
|
|
23
23
|
import { containsThemeRef, themeRefKey } from "./helpers/themeRef.native.js";
|
|
24
|
-
import { themeable } from "./helpers/themeable.native.js";
|
|
25
24
|
import { getStyleTags } from "./helpers/wrapStyleTags.native.js";
|
|
26
25
|
import { createFont } from "./createFont.native.js";
|
|
27
26
|
import { createChangeEventDetails } from "./eventDetails.native.js";
|
|
@@ -41,7 +40,6 @@ import { _disableMediaTouch, _mediaListenerStats, configureMedia, mediaKeyMatch,
|
|
|
41
40
|
import { mediaObjectToString } from "./helpers/mediaObjectToString.native.js";
|
|
42
41
|
import { getMedia, mediaQueryConfig, mediaState, setMediaState } from "./helpers/mediaState.native.js";
|
|
43
42
|
import { useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver } from "./hooks/useAnimationDriver.native.js";
|
|
44
|
-
import { useProps, usePropsAndStyle, useStyle } from "./hooks/useProps.native.js";
|
|
45
43
|
import { useTheme } from "./hooks/useTheme.native.js";
|
|
46
44
|
import { usePortalThemeState } from "./hooks/usePortalThemeState.native.js";
|
|
47
45
|
import { useThemeName } from "./hooks/useThemeName.native.js";
|
|
@@ -62,4 +60,4 @@ import { ClientOnly, ClientOnlyContext, useClientValue, useDidFinishSSR, useIsCl
|
|
|
62
60
|
import { useEvent, useGet } from "@tamagui/use-event";
|
|
63
61
|
import { hooks, setupHooks } from "./setupHooks.native.js";
|
|
64
62
|
|
|
65
|
-
export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, createVariantResolver, cssShorthandLonghands, currentPlatform, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig,
|
|
63
|
+
export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, createVariantResolver, cssShorthandLonghands, currentPlatform, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig, getExpandedShorthand, getMedia, getMutatedAutoVariableCSS, getNativeStyleEngine, getPlatformDriver, getSetting, getSplitStyles, getStyleCompat, getStyleStaticConfig, getStyleTags, getThemeClassNames, getThemeProviderChainSizes, getThemes, getToken, getTokenValue, getTokens, getVariable, getVariableName, getVariableValue, getVariableVariable, hooks, html, insertFont, insertStyleRules, installTamaguiConfig, isAndroid, isBrowser, isChrome, isClient, isEqualShallow, isIos, isNativeDesktop, isServer, isTV, isTamaguiComponent, isTamaguiElement, isTouchable, isValidStyleKey, isVariable, isWeb, isWebTouchable, loadAnimationDriver, matchMedia, mediaKeyMatch, mediaObjectToString, mediaQueryConfig, mediaState, mergeIfNotShallowEqual, mergeProps, mergeSlotStyleProps, mutatedAutoVariables, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, normalizeColor, normalizeStyle, px, removeNativeStyleScope, reservedThemeProps, resolveThemeName, setConfig, setMediaState, setNativeStyleEngine, setNativeStyleEngineFlushListener, setNonce, setRef, setupDev, setupHooks, setupMatchMedia, setupPlatformDriver, shouldRenderNativePlatform, simpleHash, splitStyleProps, stylePropsAll, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, styled, supportsDynamicColorIOS, textStaticConfig, themeRefKey, tokenCategories, updateConfig, updateFont, updateMediaListeners, updateNativeStyleScope, useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver, useClientValue, useComposedRefs, useConfiguration, useCreateShallowSetState, useDidFinishSSR, useEvent, useGet, useIsClientOnly, useIsTouchDevice, useIsomorphicLayoutEffect, useMedia, usePortalThemeState, useTheme, useThemeName, validStyles, variableToString, viewStaticConfig, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties };
|
|
@@ -3,7 +3,6 @@ import { createComponent } from "./createComponent.mjs";
|
|
|
3
3
|
import { createVariables as createVariables$1 } from "./createVariables.mjs";
|
|
4
4
|
import { fixStyles as fixStyles$1 } from "./helpers/expandStyles.mjs";
|
|
5
5
|
import { styleToCSS as styleToCSS$1 } from "./helpers/styleToCSS.mjs";
|
|
6
|
-
import { setComponentDisplayName } from "./helpers/componentDisplayName.mjs";
|
|
7
6
|
import { getThemeCSSRules as getThemeCSSRules$1 } from "./helpers/getThemeCSSRules.mjs";
|
|
8
7
|
import { normalizeValueWithProperty as normalizeValueWithProperty$1 } from "./helpers/normalizeValueWithProperty.mjs";
|
|
9
8
|
import { proxyThemeToParents as proxyThemeToParents$1 } from "./helpers/proxyThemeToParents.mjs";
|
|
@@ -49,14 +48,16 @@ function createFrontendStyled(frontend) {
|
|
|
49
48
|
}
|
|
50
49
|
function createFrontendViews(frontend) {
|
|
51
50
|
return {
|
|
52
|
-
View:
|
|
51
|
+
View: createComponent({
|
|
53
52
|
...viewStaticConfig,
|
|
54
|
-
styleFrontend: frontend
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
styleFrontend: frontend,
|
|
54
|
+
displayName: "View"
|
|
55
|
+
}),
|
|
56
|
+
Text: createComponent({
|
|
57
57
|
...textStaticConfig,
|
|
58
|
-
styleFrontend: frontend
|
|
59
|
-
|
|
58
|
+
styleFrontend: frontend,
|
|
59
|
+
displayName: "Text"
|
|
60
|
+
})
|
|
60
61
|
};
|
|
61
62
|
}
|
|
62
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-runtime.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport {
|
|
1
|
+
{"version":3,"file":"internal-runtime.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport { getThemeCSSRules as getThemeCSSRulesImpl } from \"./helpers/getThemeCSSRules\";\nimport { normalizeValueWithProperty as normalizeValueWithPropertyImpl } from \"./helpers/normalizeValueWithProperty\";\nimport { proxyThemeToParents as proxyThemeToParentsImpl } from \"./helpers/proxyThemeToParents\";\nimport { ensureThemeVariable as ensureThemeVariableImpl } from \"./helpers/themes\";\nimport { transformsToString as transformsToStringImpl } from \"./helpers/transformsToString\";\nimport {\n parseFont as parseFontImpl,\n registerFontVariables as registerFontVariablesImpl\n} from \"./insertFont\";\nimport { createTamagui as createTamaguiImpl } from \"./createTamagui\";\nimport { setupHooks as setupHooksImpl } from \"./setupHooks\";\nimport { createFrontendStyled as createFrontendStyledImpl } from \"./styled\";\nimport { useThemeWithState as useThemeWithStateImpl } from \"./hooks/useTheme\";\nimport { TamaguiProvider as TamaguiProviderImpl } from \"./views/TamaguiProvider\";\nimport { textStaticConfig } from \"./views/Text\";\nimport { viewStaticConfig } from \"./views/View\";\nimport { regularStyleFrontend } from \"./helpers/styleFrontend\";\nconst createVariables = createVariablesImpl;\nconst parseFont = parseFontImpl;\nconst registerFontVariables = registerFontVariablesImpl;\nconst fixStyles = fixStylesImpl;\nconst getThemeCSSRules = getThemeCSSRulesImpl;\nconst normalizeValueWithProperty = normalizeValueWithPropertyImpl;\nconst proxyThemeToParents = proxyThemeToParentsImpl;\nconst ensureThemeVariable = ensureThemeVariableImpl;\nconst transformsToString = transformsToStringImpl;\nconst styleToCSS = styleToCSSImpl;\nconst useThemeWithState = useThemeWithStateImpl;\nconst plainValueToPayload = (value, property) => {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n if (property === \"rotate\" || property === \"rotateX\" || property === \"rotateY\" || property === \"rotateZ\") {\n return value === 0 ? \"0\" : `${value}deg`;\n }\n if (property === \"x\" || property === \"y\" || property === \"perspective\" || property === \"translateX\" || property === \"translateY\") {\n return value === 0 ? \"0\" : `${value}px`;\n }\n return stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nconst createTamagui = createTamaguiImpl;\nconst setupHooks = setupHooksImpl;\nconst TamaguiProvider = TamaguiProviderImpl;\nfunction createFrontendStyled(frontend) {\n return createFrontendStyledImpl(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: createComponent({\n ...viewStaticConfig,\n styleFrontend: frontend,\n displayName: \"View\"\n }),\n Text: createComponent({\n ...textStaticConfig,\n styleFrontend: frontend,\n displayName: \"Text\"\n })\n };\n}\nexport {\n TamaguiProvider,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n createVariables,\n ensureThemeVariable,\n fixStyles,\n getThemeCSSRules,\n normalizeValueWithProperty,\n parseFont,\n plainValueToPayload,\n proxyThemeToParents,\n registerFontVariables,\n regularStyleFrontend,\n setupHooks,\n styleToCSS,\n transformsToString,\n useThemeWithState\n};\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,kBAAkBA;AACxB,MAAM,YAAYC;AAClB,MAAM,wBAAwBC;AAC9B,MAAM,YAAYC;AAClB,MAAM,mBAAmBC;AACzB,MAAM,6BAA6BC;AACnC,MAAM,sBAAsBC;AAC5B,MAAM,sBAAsBC;AAC5B,MAAM,qBAAqBC;AAC3B,MAAM,aAAaC;AACnB,MAAM,oBAAoBC;AAC1B,MAAM,uBAAuB,OAAO,aAAa;CAC/C,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACjE,IAAI,aAAa,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,WAAW;EACvG,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,IAAI,aAAa,OAAO,aAAa,OAAO,aAAa,iBAAiB,aAAa,gBAAgB,aAAa,cAAc;EAChI,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,OAAO,mBAAmB,YAAY,OAAO,KAAK,IAAI,GAAG,MAAM;AACjE;AACA,MAAM,gBAAgBC;AACtB,MAAM,aAAaC;AACnB,MAAM,kBAAkBC;AACxB,SAAS,qBAAqB,UAAU;CACtC,OAAOC,uBAAyB,QAAQ;AAC1C;AACA,SAAS,oBAAoB,UAAU;CACrC,OAAO;EACL,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;EACD,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;CACH;AACF"}
|
|
@@ -3,7 +3,6 @@ import { createComponent } from "./createComponent.native.js";
|
|
|
3
3
|
import { createVariables as createVariables$1 } from "./createVariables.native.js";
|
|
4
4
|
import { fixStyles as fixStyles$1 } from "./helpers/expandStyles.native.js";
|
|
5
5
|
import { styleToCSS as styleToCSS$1 } from "./helpers/styleToCSS.native.js";
|
|
6
|
-
import { setComponentDisplayName } from "./helpers/componentDisplayName.native.js";
|
|
7
6
|
import { getThemeCSSRules as getThemeCSSRules$1 } from "./helpers/getThemeCSSRules.native.js";
|
|
8
7
|
import { normalizeValueWithProperty as normalizeValueWithProperty$1 } from "./helpers/normalizeValueWithProperty.native.js";
|
|
9
8
|
import { proxyThemeToParents as proxyThemeToParents$1 } from "./helpers/proxyThemeToParents.native.js";
|
|
@@ -49,14 +48,16 @@ function createFrontendStyled(frontend) {
|
|
|
49
48
|
}
|
|
50
49
|
function createFrontendViews(frontend) {
|
|
51
50
|
return {
|
|
52
|
-
View:
|
|
51
|
+
View: createComponent({
|
|
53
52
|
...viewStaticConfig,
|
|
54
|
-
styleFrontend: frontend
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
styleFrontend: frontend,
|
|
54
|
+
displayName: "View"
|
|
55
|
+
}),
|
|
56
|
+
Text: createComponent({
|
|
57
57
|
...textStaticConfig,
|
|
58
|
-
styleFrontend: frontend
|
|
59
|
-
|
|
58
|
+
styleFrontend: frontend,
|
|
59
|
+
displayName: "Text"
|
|
60
|
+
})
|
|
60
61
|
};
|
|
61
62
|
}
|
|
62
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-runtime.native.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.native.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport {
|
|
1
|
+
{"version":3,"file":"internal-runtime.native.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.native.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport { getThemeCSSRules as getThemeCSSRulesImpl } from \"./helpers/getThemeCSSRules\";\nimport { normalizeValueWithProperty as normalizeValueWithPropertyImpl } from \"./helpers/normalizeValueWithProperty\";\nimport { proxyThemeToParents as proxyThemeToParentsImpl } from \"./helpers/proxyThemeToParents\";\nimport { ensureThemeVariable as ensureThemeVariableImpl } from \"./helpers/themes\";\nimport { transformsToString as transformsToStringImpl } from \"./helpers/transformsToString\";\nimport { parseFont as parseFontImpl, registerFontVariables as registerFontVariablesImpl } from \"./insertFont\";\nimport { createTamagui as createTamaguiImpl } from \"./createTamagui\";\nimport { setupHooks as setupHooksImpl } from \"./setupHooks\";\nimport { createFrontendStyled as createFrontendStyledImpl } from \"./styled\";\nimport { useThemeWithState as useThemeWithStateImpl } from \"./hooks/useTheme\";\nimport { TamaguiProvider as TamaguiProviderImpl } from \"./views/TamaguiProvider\";\nimport { textStaticConfig } from \"./views/Text\";\nimport { viewStaticConfig } from \"./views/View\";\nimport { regularStyleFrontend } from \"./helpers/styleFrontend\";\nvar createVariables = createVariablesImpl;\nvar parseFont = parseFontImpl;\nvar registerFontVariables = registerFontVariablesImpl;\nvar fixStyles = fixStylesImpl;\nvar getThemeCSSRules = getThemeCSSRulesImpl;\nvar normalizeValueWithProperty = normalizeValueWithPropertyImpl;\nvar proxyThemeToParents = proxyThemeToParentsImpl;\nvar ensureThemeVariable = ensureThemeVariableImpl;\nvar transformsToString = transformsToStringImpl;\nvar styleToCSS = styleToCSSImpl;\nvar useThemeWithState = useThemeWithStateImpl;\nvar plainValueToPayload = function(value, property) {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n if (property === \"rotate\" || property === \"rotateX\" || property === \"rotateY\" || property === \"rotateZ\") {\n return value === 0 ? \"0\" : `${value}deg`;\n }\n if (property === \"x\" || property === \"y\" || property === \"perspective\" || property === \"translateX\" || property === \"translateY\") {\n return value === 0 ? \"0\" : `${value}px`;\n }\n return stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nvar createTamagui = createTamaguiImpl;\nvar setupHooks = setupHooksImpl;\nvar TamaguiProvider = TamaguiProviderImpl;\nfunction createFrontendStyled(frontend) {\n return createFrontendStyledImpl(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: createComponent({\n ...viewStaticConfig,\n styleFrontend: frontend,\n displayName: \"View\"\n }),\n Text: createComponent({\n ...textStaticConfig,\n styleFrontend: frontend,\n displayName: \"Text\"\n })\n };\n}\nexport {\n TamaguiProvider,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n createVariables,\n ensureThemeVariable,\n fixStyles,\n getThemeCSSRules,\n normalizeValueWithProperty,\n parseFont,\n plainValueToPayload,\n proxyThemeToParents,\n registerFontVariables,\n regularStyleFrontend,\n setupHooks,\n styleToCSS,\n transformsToString,\n useThemeWithState\n};\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmBA,IAAI,kBAAkBA;AACtB,IAAI,YAAYC;AAChB,IAAI,wBAAwBC;AAC5B,IAAI,YAAYC;AAChB,IAAI,mBAAmBC;AACvB,IAAI,6BAA6BC;AACjC,IAAI,sBAAsBC;AAC1B,IAAI,sBAAsBC;AAC1B,IAAI,qBAAqBC;AACzB,IAAI,aAAaC;AACjB,IAAI,oBAAoBC;AACxB,IAAI,sBAAsB,SAAS,OAAO,UAAU;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACjE,IAAI,aAAa,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,WAAW;EACvG,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,IAAI,aAAa,OAAO,aAAa,OAAO,aAAa,iBAAiB,aAAa,gBAAgB,aAAa,cAAc;EAChI,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,OAAO,mBAAmB,YAAY,OAAO,KAAK,IAAI,GAAG,MAAM;AACjE;AACA,IAAI,gBAAgBC;AACpB,IAAI,aAAaC;AACjB,IAAI,kBAAkBC;AACtB,SAAS,qBAAqB,UAAU;CACtC,OAAOC,uBAAyB,QAAQ;AAC1C;AACA,SAAS,oBAAoB,UAAU;CACrC,OAAO;EACL,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;EACD,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;CACH;AACF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectRules, stylePropsText, validStyles } from "@tamagui/helpers";
|
|
2
2
|
import { getConfig, getConfigMaybe, getThemes, getToken, getTokenValue, getTokens, setConfig, updateConfig } from "./config.mjs";
|
|
3
3
|
import { createTamagui, installTamaguiConfig } from "./createTamagui.mjs";
|
|
4
|
-
import { getSplitStyles
|
|
4
|
+
import { getSplitStyles } from "./helpers/getSplitStyles.mjs";
|
|
5
|
+
import { getStyleStaticConfig } from "./helpers/styleStaticConfig.mjs";
|
|
5
6
|
import { mergeComponentProps } from "./helpers/mergeProps.mjs";
|
|
6
7
|
|
|
7
8
|
const DEFAULT_COMPONENT_STATE = {
|
|
@@ -47,10 +48,11 @@ function resolveStaticElement(element, target = "web", defaultThemeName) {
|
|
|
47
48
|
if (target !== "native") {
|
|
48
49
|
delete baseStaticConfig.isReactNative;
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
+
const styleStaticConfig = getStyleStaticConfig(baseStaticConfig, conf);
|
|
51
52
|
let elementProps = element.props || {};
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
const { defaultProps } = styleStaticConfig;
|
|
54
|
+
if (defaultProps) {
|
|
55
|
+
const [merged] = mergeComponentProps(defaultProps, void 0, elementProps);
|
|
54
56
|
elementProps = merged;
|
|
55
57
|
}
|
|
56
58
|
const componentState = {
|
|
@@ -76,7 +78,7 @@ function resolveStaticElement(element, target = "web", defaultThemeName) {
|
|
|
76
78
|
}
|
|
77
79
|
let split = null;
|
|
78
80
|
try {
|
|
79
|
-
split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps);
|
|
81
|
+
split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps, void 0, void 0, void 0, void 0, void 0, void 0, void 0, styleStaticConfig);
|
|
80
82
|
} catch (err) {
|
|
81
83
|
return {
|
|
82
84
|
id: element.id,
|
|
@@ -190,5 +192,5 @@ function resolveStatic(batch) {
|
|
|
190
192
|
return resolveStaticBatch(batch);
|
|
191
193
|
}
|
|
192
194
|
|
|
193
|
-
export { createTamagui, getConfig, getConfigMaybe, getSplitStyles, getThemes, getToken, getTokenValue, getTokens, installTamaguiConfig,
|
|
195
|
+
export { createTamagui, getConfig, getConfigMaybe, getSplitStyles, getThemes, getToken, getTokenValue, getTokens, installTamaguiConfig, resolveStatic, resolveStaticBatch, resolveStaticElement, setConfig, updateConfig };
|
|
194
196
|
//# sourceMappingURL=static-resolve.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-resolve.js","names":["validStylesView"],"sources":["esm/static-resolve.js"],"sourcesContent":["import {\n StyleObjectIdentifier,\n StyleObjectProperty,\n StyleObjectRules,\n stylePropsText,\n validStyles as validStylesView\n} from \"@tamagui/helpers\";\nimport {\n getConfig,\n getConfigMaybe,\n getThemes,\n getToken,\n getTokens,\n getTokenValue,\n setConfig,\n updateConfig\n} from \"./config\";\nimport { createTamagui, installTamaguiConfig } from \"./createTamagui\";\nimport { getSplitStyles, prepareStyleStaticConfig } from \"./helpers/getSplitStyles\";\nimport { mergeComponentProps } from \"./helpers/mergeProps\";\nconst DEFAULT_COMPONENT_STATE = {\n hover: false,\n focus: false,\n focusVisible: false,\n focusWithin: false,\n press: false,\n pressIn: false,\n disabled: false,\n unmounted: false\n};\nconst getGlobalProcessEnv = () => {\n try {\n return typeof process !== \"undefined\" && process ? process.env : void 0;\n } catch {\n return void 0;\n }\n};\nfunction resolveStaticElement(element, target = \"web\", defaultThemeName) {\n const conf = getConfigMaybe();\n if (!conf) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"config-missing\",\n message: \"No Tamagui config installed. Call createTamagui or installTamaguiConfig first.\"\n }\n };\n }\n const themes = conf.themes || {};\n const themeName = element.themeName || defaultThemeName || (themes[\"light\"] ? \"light\" : Object.keys(themes)[0]) || \"light\";\n const theme = themes[themeName] || themes[\"light\"] || themes[\"dark\"] || Object.values(themes)[0] || {};\n const isTextLike = Boolean(\n element.staticConfig?.isText || element.staticConfig?.isInput\n );\n const baseStaticConfig = {\n validStyles: isTextLike ? stylePropsText : validStylesView,\n defaultProps: {},\n acceptsClassName: target !== \"native\",\n ...target === \"native\" && { isReactNative: true },\n ...element.staticConfig\n };\n if (target !== \"native\") {\n delete baseStaticConfig.isReactNative;\n }\n prepareStyleStaticConfig(baseStaticConfig);\n let elementProps = element.props || {};\n if (baseStaticConfig.defaultProps && Object.keys(baseStaticConfig.defaultProps).length > 0) {\n const [merged] = mergeComponentProps(\n baseStaticConfig.defaultProps,\n void 0,\n elementProps\n );\n elementProps = merged;\n }\n const componentState = {\n ...DEFAULT_COMPONENT_STATE,\n ...element.componentState\n };\n const styleProps = {\n resolveValues: element.options?.resolveValues ?? (target === \"native\" ? \"except-theme\" : \"variable\"),\n noClass: element.options?.noClass ?? target === \"native\",\n isAnimated: element.options?.isAnimated ?? false,\n displayName: element.options?.displayName ?? element.componentName ?? element.staticConfig?.Component?.displayName ?? \"TamaguiComponent\"\n };\n const env = getGlobalProcessEnv();\n const prevStatic = env ? env[\"IS_STATIC\"] : void 0;\n const prevTarget = env ? env[\"TAMAGUI_TARGET\"] : void 0;\n if (env) {\n if (target === \"native\") {\n env[\"IS_STATIC\"] = \"is_static\";\n } else {\n delete env[\"IS_STATIC\"];\n }\n env[\"TAMAGUI_TARGET\"] = target;\n }\n let split = null;\n try {\n split = getSplitStyles(\n elementProps,\n baseStaticConfig,\n theme,\n themeName,\n componentState,\n styleProps\n );\n } catch (err) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-error\",\n message: err?.message || String(err)\n }\n };\n } finally {\n if (env) {\n if (prevStatic === void 0) delete env[\"IS_STATIC\"];\n else env[\"IS_STATIC\"] = prevStatic;\n if (prevTarget === void 0) delete env[\"TAMAGUI_TARGET\"];\n else env[\"TAMAGUI_TARGET\"] = prevTarget;\n }\n }\n if (!split) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-failed\",\n message: \"getSplitStyles returned no static result\"\n }\n };\n }\n if (target === \"native\") {\n const hasMedia = split.hasMedia === true || split.hasMedia instanceof Set && split.hasMedia.size > 0;\n const hasPseudo = Boolean(split.pseudoGroups && split.pseudoGroups.size > 0) || Boolean(split.mediaGroups && split.mediaGroups.size > 0) || Boolean(split.programStates && split.programStates.size > 0);\n if (hasMedia || hasPseudo) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Native target does not support static media queries or pseudo styles\"\n }\n };\n }\n if (split.programLifecycleStyleKeys?.enter?.size || split.programLifecycleStyleKeys?.exit?.size) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Lifecycle value programs remain on the runtime path\"\n }\n };\n }\n }\n const rules = [];\n const css = [];\n if (split.rulesToInsert) {\n for (const key in split.rulesToInsert) {\n const ruleObj = split.rulesToInsert[key];\n if (ruleObj) {\n const ruleList = ruleObj[StyleObjectRules] || [];\n rules.push({\n identifier: ruleObj[StyleObjectIdentifier] || key,\n property: ruleObj[StyleObjectProperty],\n rules: ruleList\n });\n for (let i = 0; i < ruleList.length; i++) {\n css.push(ruleList[i]);\n }\n }\n }\n }\n const classNames = split.classNames || {};\n const classNamesList = Object.values(classNames).filter(Boolean);\n const fullClassName = split.viewProps?.className || void 0;\n const className = fullClassName || (classNamesList.length > 0 ? classNamesList.join(\" \") : void 0);\n return {\n id: element.id,\n ok: true,\n className,\n classNames: Object.keys(classNames).length > 0 ? classNames : void 0,\n rules: rules.length > 0 ? rules : void 0,\n css: css.length > 0 ? css : void 0,\n style: split.style || split.viewProps?.style || null,\n viewProps: split.viewProps,\n hasMedia: split.hasMedia instanceof Set ? Array.from(split.hasMedia) : split.hasMedia || void 0,\n pseudoGroups: split.pseudoGroups && split.pseudoGroups.size > 0 ? Array.from(split.pseudoGroups) : void 0,\n mediaGroups: split.mediaGroups && split.mediaGroups.size > 0 ? Array.from(split.mediaGroups) : void 0,\n programStates: split.programStates && split.programStates.size > 0 ? Array.from(split.programStates) : void 0,\n dynamicThemeAccess: split.dynamicThemeAccess,\n fontFamily: split.fontFamily,\n programLifecycleStyleKeys: split.programLifecycleStyleKeys ? {\n enter: split.programLifecycleStyleKeys.enter ? Array.from(split.programLifecycleStyleKeys.enter) : void 0,\n exit: split.programLifecycleStyleKeys.exit ? Array.from(split.programLifecycleStyleKeys.exit) : void 0\n } : void 0\n };\n}\nfunction resolveStaticBatch(batch) {\n const target = batch.target || \"web\";\n const defaultThemeName = batch.defaultThemeName;\n const elements = batch.elements || [];\n const results = new Array(elements.length);\n for (let i = 0; i < elements.length; i++) {\n results[i] = resolveStaticElement(elements[i], target, defaultThemeName);\n }\n return { results };\n}\nfunction resolveStatic(batch) {\n if (typeof batch === \"string\") {\n const parsed = JSON.parse(batch);\n const result = resolveStaticBatch(parsed);\n return JSON.stringify(result);\n }\n return resolveStaticBatch(batch);\n}\nexport {\n createTamagui,\n getConfig,\n getConfigMaybe,\n getSplitStyles,\n getThemes,\n getToken,\n getTokenValue,\n getTokens,\n installTamaguiConfig,\n prepareStyleStaticConfig,\n resolveStatic,\n resolveStaticBatch,\n resolveStaticElement,\n setConfig,\n updateConfig\n};\n//# sourceMappingUR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,KAAK,MAAM,YAAY,IAAI,KAAK;EACxG,aAAa,MAAM,eAAe,MAAM,YAAY,OAAO,IAAI,MAAM,KAAK,MAAM,WAAW,IAAI,KAAK;EACpG,eAAe,MAAM,iBAAiB,MAAM,cAAc,OAAO,IAAI,MAAM,KAAK,MAAM,aAAa,IAAI,KAAK;EAC5G,oBAAoB,MAAM;EAC1B,YAAY,MAAM;EAClB,2BAA2B,MAAM,4BAA4B;GAC3D,OAAO,MAAM,0BAA0B,QAAQ,MAAM,KAAK,MAAM,0BAA0B,KAAK,IAAI,KAAK;GACxG,MAAM,MAAM,0BAA0B,OAAO,MAAM,KAAK,MAAM,0BAA0B,IAAI,IAAI,KAAK;EACvG,IAAI,KAAK;CACX;AACF;AACA,SAAS,mBAAmB,OAAO;CACjC,MAAM,SAAS,MAAM,UAAU;CAC/B,MAAM,mBAAmB,MAAM;CAC/B,MAAM,WAAW,MAAM,YAAY,CAAC;CACpC,MAAM,UAAU,IAAI,MAAM,SAAS,MAAM;CACzC,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,QAAQ,KAAK,qBAAqB,SAAS,IAAI,QAAQ,gBAAgB;CACzE;CACA,OAAO,EAAE,QAAQ;AACnB;AACA,SAAS,cAAc,OAAO;CAC5B,IAAI,OAAO,UAAU,UAAU;EAC7B,MAAM,SAAS,KAAK,MAAM,KAAK;EAC/B,MAAM,SAAS,mBAAmB,MAAM;EACxC,OAAO,KAAK,UAAU,MAAM;CAC9B;CACA,OAAO,mBAAmB,KAAK;AACjC"}
|
|
1
|
+
{"version":3,"file":"static-resolve.js","names":["validStylesView"],"sources":["esm/static-resolve.js"],"sourcesContent":["import {\n StyleObjectIdentifier,\n StyleObjectProperty,\n StyleObjectRules,\n stylePropsText,\n validStyles as validStylesView\n} from \"@tamagui/helpers\";\nimport {\n getConfig,\n getConfigMaybe,\n getThemes,\n getToken,\n getTokens,\n getTokenValue,\n setConfig,\n updateConfig\n} from \"./config\";\nimport { createTamagui, installTamaguiConfig } from \"./createTamagui\";\nimport { getSplitStyles } from \"./helpers/getSplitStyles\";\nimport { getStyleStaticConfig } from \"./helpers/styleStaticConfig\";\nimport { mergeComponentProps } from \"./helpers/mergeProps\";\nconst DEFAULT_COMPONENT_STATE = {\n hover: false,\n focus: false,\n focusVisible: false,\n focusWithin: false,\n press: false,\n pressIn: false,\n disabled: false,\n unmounted: false\n};\nconst getGlobalProcessEnv = () => {\n try {\n return typeof process !== \"undefined\" && process ? process.env : void 0;\n } catch {\n return void 0;\n }\n};\nfunction resolveStaticElement(element, target = \"web\", defaultThemeName) {\n const conf = getConfigMaybe();\n if (!conf) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"config-missing\",\n message: \"No Tamagui config installed. Call createTamagui or installTamaguiConfig first.\"\n }\n };\n }\n const themes = conf.themes || {};\n const themeName = element.themeName || defaultThemeName || (themes[\"light\"] ? \"light\" : Object.keys(themes)[0]) || \"light\";\n const theme = themes[themeName] || themes[\"light\"] || themes[\"dark\"] || Object.values(themes)[0] || {};\n const isTextLike = Boolean(\n element.staticConfig?.isText || element.staticConfig?.isInput\n );\n const baseStaticConfig = {\n validStyles: isTextLike ? stylePropsText : validStylesView,\n defaultProps: {},\n acceptsClassName: target !== \"native\",\n ...target === \"native\" && { isReactNative: true },\n ...element.staticConfig\n };\n if (target !== \"native\") {\n delete baseStaticConfig.isReactNative;\n }\n const styleStaticConfig = getStyleStaticConfig(baseStaticConfig, conf);\n let elementProps = element.props || {};\n const { defaultProps } = styleStaticConfig;\n if (defaultProps) {\n const [merged] = mergeComponentProps(defaultProps, void 0, elementProps);\n elementProps = merged;\n }\n const componentState = {\n ...DEFAULT_COMPONENT_STATE,\n ...element.componentState\n };\n const styleProps = {\n resolveValues: element.options?.resolveValues ?? (target === \"native\" ? \"except-theme\" : \"variable\"),\n noClass: element.options?.noClass ?? target === \"native\",\n isAnimated: element.options?.isAnimated ?? false,\n displayName: element.options?.displayName ?? element.componentName ?? element.staticConfig?.Component?.displayName ?? \"TamaguiComponent\"\n };\n const env = getGlobalProcessEnv();\n const prevStatic = env ? env[\"IS_STATIC\"] : void 0;\n const prevTarget = env ? env[\"TAMAGUI_TARGET\"] : void 0;\n if (env) {\n if (target === \"native\") {\n env[\"IS_STATIC\"] = \"is_static\";\n } else {\n delete env[\"IS_STATIC\"];\n }\n env[\"TAMAGUI_TARGET\"] = target;\n }\n let split = null;\n try {\n split = getSplitStyles(\n elementProps,\n baseStaticConfig,\n theme,\n themeName,\n componentState,\n styleProps,\n void 0,\n void 0,\n void 0,\n void 0,\n void 0,\n void 0,\n void 0,\n styleStaticConfig\n );\n } catch (err) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-error\",\n message: err?.message || String(err)\n }\n };\n } finally {\n if (env) {\n if (prevStatic === void 0) delete env[\"IS_STATIC\"];\n else env[\"IS_STATIC\"] = prevStatic;\n if (prevTarget === void 0) delete env[\"TAMAGUI_TARGET\"];\n else env[\"TAMAGUI_TARGET\"] = prevTarget;\n }\n }\n if (!split) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-failed\",\n message: \"getSplitStyles returned no static result\"\n }\n };\n }\n if (target === \"native\") {\n const hasMedia = split.hasMedia === true || split.hasMedia instanceof Set && split.hasMedia.size > 0;\n const hasPseudo = Boolean(split.pseudoGroups && split.pseudoGroups.size > 0) || Boolean(split.mediaGroups && split.mediaGroups.size > 0) || Boolean(split.programStates && split.programStates.size > 0);\n if (hasMedia || hasPseudo) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Native target does not support static media queries or pseudo styles\"\n }\n };\n }\n if (split.programLifecycleStyleKeys?.enter?.size || split.programLifecycleStyleKeys?.exit?.size) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Lifecycle value programs remain on the runtime path\"\n }\n };\n }\n }\n const rules = [];\n const css = [];\n if (split.rulesToInsert) {\n for (const key in split.rulesToInsert) {\n const ruleObj = split.rulesToInsert[key];\n if (ruleObj) {\n const ruleList = ruleObj[StyleObjectRules] || [];\n rules.push({\n identifier: ruleObj[StyleObjectIdentifier] || key,\n property: ruleObj[StyleObjectProperty],\n rules: ruleList\n });\n for (let i = 0; i < ruleList.length; i++) {\n css.push(ruleList[i]);\n }\n }\n }\n }\n const classNames = split.classNames || {};\n const classNamesList = Object.values(classNames).filter(Boolean);\n const fullClassName = split.viewProps?.className || void 0;\n const className = fullClassName || (classNamesList.length > 0 ? classNamesList.join(\" \") : void 0);\n return {\n id: element.id,\n ok: true,\n className,\n classNames: Object.keys(classNames).length > 0 ? classNames : void 0,\n rules: rules.length > 0 ? rules : void 0,\n css: css.length > 0 ? css : void 0,\n style: split.style || split.viewProps?.style || null,\n viewProps: split.viewProps,\n hasMedia: split.hasMedia instanceof Set ? Array.from(split.hasMedia) : split.hasMedia || void 0,\n pseudoGroups: split.pseudoGroups && split.pseudoGroups.size > 0 ? Array.from(split.pseudoGroups) : void 0,\n mediaGroups: split.mediaGroups && split.mediaGroups.size > 0 ? Array.from(split.mediaGroups) : void 0,\n programStates: split.programStates && split.programStates.size > 0 ? Array.from(split.programStates) : void 0,\n dynamicThemeAccess: split.dynamicThemeAccess,\n fontFamily: split.fontFamily,\n programLifecycleStyleKeys: split.programLifecycleStyleKeys ? {\n enter: split.programLifecycleStyleKeys.enter ? Array.from(split.programLifecycleStyleKeys.enter) : void 0,\n exit: split.programLifecycleStyleKeys.exit ? Array.from(split.programLifecycleStyleKeys.exit) : void 0\n } : void 0\n };\n}\nfunction resolveStaticBatch(batch) {\n const target = batch.target || \"web\";\n const defaultThemeName = batch.defaultThemeName;\n const elements = batch.elements || [];\n const results = new Array(elements.length);\n for (let i = 0; i < elements.length; i++) {\n results[i] = resolveStaticElement(elements[i], target, defaultThemeName);\n }\n return { results };\n}\nfunction resolveStatic(batch) {\n if (typeof batch === \"string\") {\n const parsed = JSON.parse(batch);\n const result = resolveStaticBatch(parsed);\n return JSON.stringify(result);\n }\n return resolveStaticBatch(batch);\n}\nexport {\n createTamagui,\n getConfig,\n getConfigMaybe,\n getSplitStyles,\n getThemes,\n getToken,\n getTokenValue,\n getTokens,\n installTamaguiConfig,\n resolveStatic,\n resolveStaticBatch,\n resolveStaticElement,\n setConfig,\n updateConfig\n};\n//# sourceMappingURL=static-resolve.js.map\n"],"mappings":";;;;;;;;AAqBA,MAAM,0BAA0B;CAC9B,OAAO;CACP,OAAO;CACP,cAAc;CACd,aAAa;CACb,OAAO;CACP,SAAS;CACT,UAAU;CACV,WAAW;AACb;AACA,MAAM,4BAA4B;CAChC,IAAI;EACF,OAAO,OAAO,YAAY,eAAe,UAAU,QAAQ,MAAM,KAAK;CACxE,QAAQ;EACN,OAAO,KAAK;CACd;AACF;AACA,SAAS,qBAAqB,SAAS,SAAS,OAAO,kBAAkB;CACvE,MAAM,OAAO,eAAe;CAC5B,IAAI,CAAC,MAAM;EACT,OAAO;GACL,IAAI,QAAQ;GACZ,IAAI;GACJ,SAAS;IACP,QAAQ;IACR,SAAS;GACX;EACF;CACF;CACA,MAAM,SAAS,KAAK,UAAU,CAAC;CAC/B,MAAM,YAAY,QAAQ,aAAa,qBAAqB,OAAO,WAAW,UAAU,OAAO,KAAK,MAAM,CAAC,CAAC,OAAO;CACnH,MAAM,QAAQ,OAAO,cAAc,OAAO,YAAY,OAAO,WAAW,OAAO,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC;CACrG,MAAM,aAAa,QACjB,QAAQ,cAAc,UAAU,QAAQ,cAAc,OACxD;CACA,MAAM,mBAAmB;EACvB,aAAa,aAAa,iBAAiBA;EAC3C,cAAc,CAAC;EACf,kBAAkB,WAAW;EAC7B,GAAG,WAAW,YAAY,EAAE,eAAe,KAAK;EAChD,GAAG,QAAQ;CACb;CACA,IAAI,WAAW,UAAU;EACvB,OAAO,iBAAiB;CAC1B;CACA,MAAM,oBAAoB,qBAAqB,kBAAkB,IAAI;CACrE,IAAI,eAAe,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AAK;AACjC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectRules, stylePropsText, validStyles } from "@tamagui/helpers";
|
|
2
2
|
import { getConfig, getConfigMaybe, getThemes, getToken, getTokenValue, getTokens, setConfig, updateConfig } from "./config.native.js";
|
|
3
3
|
import { createTamagui, installTamaguiConfig } from "./createTamagui.native.js";
|
|
4
|
-
import { getSplitStyles
|
|
4
|
+
import { getSplitStyles } from "./helpers/getSplitStyles.native.js";
|
|
5
|
+
import { getStyleStaticConfig } from "./helpers/styleStaticConfig.native.js";
|
|
5
6
|
import { mergeComponentProps } from "./helpers/mergeProps.native.js";
|
|
6
7
|
|
|
7
8
|
function _instanceof(left, right) {
|
|
@@ -56,10 +57,11 @@ function resolveStaticElement(element) {
|
|
|
56
57
|
if (target !== "native") {
|
|
57
58
|
delete baseStaticConfig.isReactNative;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
var styleStaticConfig = getStyleStaticConfig(baseStaticConfig, conf);
|
|
60
61
|
var elementProps = element.props || {};
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
var { defaultProps } = styleStaticConfig;
|
|
63
|
+
if (defaultProps) {
|
|
64
|
+
var [merged] = mergeComponentProps(defaultProps, void 0, elementProps);
|
|
63
65
|
elementProps = merged;
|
|
64
66
|
}
|
|
65
67
|
var componentState = {
|
|
@@ -86,7 +88,7 @@ function resolveStaticElement(element) {
|
|
|
86
88
|
}
|
|
87
89
|
var split = null;
|
|
88
90
|
try {
|
|
89
|
-
split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps);
|
|
91
|
+
split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps, void 0, void 0, void 0, void 0, void 0, void 0, void 0, styleStaticConfig);
|
|
90
92
|
} catch (err) {
|
|
91
93
|
return {
|
|
92
94
|
id: element.id,
|
|
@@ -201,5 +203,5 @@ function resolveStatic(batch) {
|
|
|
201
203
|
return resolveStaticBatch(batch);
|
|
202
204
|
}
|
|
203
205
|
|
|
204
|
-
export { createTamagui, getConfig, getConfigMaybe, getSplitStyles, getThemes, getToken, getTokenValue, getTokens, installTamaguiConfig,
|
|
206
|
+
export { createTamagui, getConfig, getConfigMaybe, getSplitStyles, getThemes, getToken, getTokenValue, getTokens, installTamaguiConfig, resolveStatic, resolveStaticBatch, resolveStaticElement, setConfig, updateConfig };
|
|
205
207
|
//# sourceMappingURL=static-resolve.native.js.map
|