@tamagui/web 1.99.1 → 1.100.0
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/_withStableStyle.native.js +2 -4
- package/dist/cjs/_withStableStyle.native.js.map +1 -1
- package/dist/cjs/config.native.js +6 -12
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants/webToNativeProps.native.js +1 -2
- package/dist/cjs/constants/webToNativeProps.native.js.map +1 -1
- package/dist/cjs/createComponent.js +28 -12
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/createComponent.native.js +45 -32
- package/dist/cjs/createComponent.native.js.map +2 -2
- package/dist/cjs/createFont.js +1 -2
- package/dist/cjs/createFont.js.map +1 -1
- package/dist/cjs/createFont.native.js +9 -18
- package/dist/cjs/createFont.native.js.map +1 -1
- package/dist/cjs/createTamagui.native.js +8 -16
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/createVariable.js +15 -10
- package/dist/cjs/createVariable.js.map +1 -1
- package/dist/cjs/createVariable.native.js +22 -18
- package/dist/cjs/createVariable.native.js.map +2 -2
- package/dist/cjs/createVariables.js +1 -2
- package/dist/cjs/createVariables.js.map +1 -1
- package/dist/cjs/createVariables.native.js +1 -2
- package/dist/cjs/createVariables.native.js.map +1 -1
- package/dist/cjs/helpers/ThemeManager.native.js +8 -16
- package/dist/cjs/helpers/ThemeManager.native.js.map +1 -1
- package/dist/cjs/helpers/createShallowSetState.js +8 -2
- package/dist/cjs/helpers/createShallowSetState.js.map +1 -1
- package/dist/cjs/helpers/createShallowSetState.native.js +10 -3
- package/dist/cjs/helpers/createShallowSetState.native.js.map +2 -2
- package/dist/cjs/helpers/createStyledContext.native.js +2 -4
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.native.js +1 -2
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.js +1 -2
- package/dist/cjs/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.native.js +1 -2
- package/dist/cjs/helpers/getExpandedShorthands.native.js.map +1 -1
- package/dist/cjs/helpers/getGroupPropParts.native.js +6 -12
- package/dist/cjs/helpers/getGroupPropParts.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +10 -15
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +13 -23
- package/dist/cjs/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +2 -4
- package/dist/cjs/helpers/getStylesAtomic.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +1 -2
- package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.js +14 -9
- package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.native.js +18 -19
- package/dist/cjs/helpers/getVariantExtras.native.js.map +2 -2
- package/dist/cjs/helpers/insertStyleRule.js +37 -30
- package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +44 -31
- package/dist/cjs/helpers/insertStyleRule.native.js.map +2 -2
- package/dist/cjs/helpers/log.native.js +6 -12
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.js +6 -12
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeColor.js +1 -2
- package/dist/cjs/helpers/normalizeColor.js.map +1 -1
- package/dist/cjs/helpers/normalizeColor.native.js +1 -2
- package/dist/cjs/helpers/normalizeColor.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeStyle.js +1 -2
- package/dist/cjs/helpers/normalizeStyle.js.map +1 -1
- package/dist/cjs/helpers/propMapper.js +4 -8
- package/dist/cjs/helpers/propMapper.js.map +1 -1
- package/dist/cjs/helpers/propMapper.native.js +8 -16
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/helpers/themeable.native.js +2 -4
- package/dist/cjs/helpers/themeable.native.js.map +1 -1
- package/dist/cjs/hooks/useConfiguration.native.js +2 -4
- package/dist/cjs/hooks/useConfiguration.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.js +4 -8
- package/dist/cjs/hooks/useMedia.js.map +1 -1
- package/dist/cjs/hooks/useMedia.native.js +13 -26
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useProps.native.js +8 -16
- package/dist/cjs/hooks/useProps.native.js.map +1 -1
- package/dist/cjs/hooks/useTheme.js +5 -10
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/hooks/useTheme.native.js +13 -26
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeName.native.js +6 -12
- package/dist/cjs/hooks/useThemeName.native.js.map +1 -1
- package/dist/cjs/styled.native.js +2 -4
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/views/FontLanguage.native.js +2 -4
- package/dist/cjs/views/FontLanguage.native.js.map +1 -1
- package/dist/cjs/views/Slot.native.js +2 -4
- package/dist/cjs/views/Slot.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.native.js +2 -4
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/Theme.native.js +2 -4
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.js +1 -2
- package/dist/cjs/views/ThemeProvider.js.map +1 -1
- package/dist/esm/_withStableStyle.native.js +2 -4
- package/dist/esm/_withStableStyle.native.js.map +1 -1
- package/dist/esm/config.native.js +6 -12
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants/webToNativeProps.native.js +1 -2
- package/dist/esm/constants/webToNativeProps.native.js.map +1 -1
- package/dist/esm/createComponent.js +30 -15
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createComponent.mjs +31 -19
- package/dist/esm/createComponent.native.js +47 -35
- package/dist/esm/createComponent.native.js.map +2 -2
- package/dist/esm/createFont.js +1 -2
- package/dist/esm/createFont.js.map +1 -1
- package/dist/esm/createFont.native.js +9 -18
- package/dist/esm/createFont.native.js.map +1 -1
- package/dist/esm/createTamagui.native.js +8 -16
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createVariable.js +15 -10
- package/dist/esm/createVariable.js.map +1 -1
- package/dist/esm/createVariable.mjs +12 -8
- package/dist/esm/createVariable.native.js +22 -18
- package/dist/esm/createVariable.native.js.map +2 -2
- package/dist/esm/createVariables.js +1 -2
- package/dist/esm/createVariables.js.map +1 -1
- package/dist/esm/createVariables.native.js +1 -2
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/helpers/ThemeManager.native.js +8 -16
- package/dist/esm/helpers/ThemeManager.native.js.map +1 -1
- package/dist/esm/helpers/createShallowSetState.js +8 -2
- package/dist/esm/helpers/createShallowSetState.js.map +1 -1
- package/dist/esm/helpers/createShallowSetState.mjs +8 -2
- package/dist/esm/helpers/createShallowSetState.native.js +10 -3
- package/dist/esm/helpers/createShallowSetState.native.js.map +2 -2
- package/dist/esm/helpers/createStyledContext.native.js +2 -4
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +1 -2
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.js +1 -2
- package/dist/esm/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.native.js +1 -2
- package/dist/esm/helpers/getExpandedShorthands.native.js.map +1 -1
- package/dist/esm/helpers/getGroupPropParts.native.js +6 -12
- package/dist/esm/helpers/getGroupPropParts.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +10 -15
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +4 -3
- package/dist/esm/helpers/getSplitStyles.native.js +13 -23
- package/dist/esm/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +2 -4
- package/dist/esm/helpers/getStylesAtomic.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +1 -2
- package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.js +14 -9
- package/dist/esm/helpers/getVariantExtras.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.mjs +34 -29
- package/dist/esm/helpers/getVariantExtras.native.js +18 -19
- package/dist/esm/helpers/getVariantExtras.native.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +37 -30
- package/dist/esm/helpers/insertStyleRule.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +28 -20
- package/dist/esm/helpers/insertStyleRule.native.js +44 -31
- package/dist/esm/helpers/insertStyleRule.native.js.map +2 -2
- package/dist/esm/helpers/log.native.js +6 -12
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/matchMedia.native.js +6 -12
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/normalizeColor.js +1 -2
- package/dist/esm/helpers/normalizeColor.js.map +1 -1
- package/dist/esm/helpers/normalizeColor.native.js +1 -2
- package/dist/esm/helpers/normalizeColor.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStyle.js +1 -2
- package/dist/esm/helpers/normalizeStyle.js.map +1 -1
- package/dist/esm/helpers/propMapper.js +4 -8
- package/dist/esm/helpers/propMapper.js.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +8 -16
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/themeable.native.js +2 -4
- package/dist/esm/helpers/themeable.native.js.map +1 -1
- package/dist/esm/hooks/useConfiguration.native.js +2 -4
- package/dist/esm/hooks/useConfiguration.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.js +4 -8
- package/dist/esm/hooks/useMedia.js.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +13 -26
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useProps.native.js +8 -16
- package/dist/esm/hooks/useProps.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +5 -10
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +13 -26
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeName.native.js +6 -12
- package/dist/esm/hooks/useThemeName.native.js.map +1 -1
- package/dist/esm/styled.native.js +2 -4
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/views/FontLanguage.native.js +2 -4
- package/dist/esm/views/FontLanguage.native.js.map +1 -1
- package/dist/esm/views/Slot.native.js +2 -4
- package/dist/esm/views/Slot.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +2 -4
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Theme.native.js +2 -4
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeProvider.js +1 -2
- package/dist/esm/views/ThemeProvider.js.map +1 -1
- package/package.json +11 -11
- package/src/createComponent.tsx +59 -33
- package/src/createVariable.ts +22 -12
- package/src/helpers/createShallowSetState.tsx +10 -2
- package/src/helpers/getSplitStyles.tsx +11 -9
- package/src/helpers/getVariantExtras.tsx +19 -10
- package/src/helpers/insertStyleRule.tsx +84 -79
- package/src/hooks/useTheme.tsx +1 -2
- package/src/types.tsx +3 -1
- package/types/createComponent.d.ts +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createVariable.d.ts +4 -4
- package/types/createVariable.d.ts.map +1 -1
- package/types/helpers/createShallowSetState.d.ts +1 -1
- package/types/helpers/createShallowSetState.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts +1 -1
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/hooks/useConfiguration.d.ts +5 -5
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/types.d.ts +2 -1
- package/types/types.d.ts.map +1 -1
|
@@ -2,8 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { ComponentContext } from "../contexts/ComponentContext";
|
|
4
4
|
function _object_without_properties(source, excluded) {
|
|
5
|
-
if (source == null)
|
|
6
|
-
return {};
|
|
5
|
+
if (source == null) return {};
|
|
7
6
|
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
8
7
|
if (Object.getOwnPropertySymbols) {
|
|
9
8
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -13,8 +12,7 @@ function _object_without_properties(source, excluded) {
|
|
|
13
12
|
return target;
|
|
14
13
|
}
|
|
15
14
|
function _object_without_properties_loose(source, excluded) {
|
|
16
|
-
if (source == null)
|
|
17
|
-
return {};
|
|
15
|
+
if (source == null) return {};
|
|
18
16
|
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
19
17
|
for (i = 0; i < sourceKeys.length; i++)
|
|
20
18
|
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Users/n8/tamagui/packages/web/src/views/FontLanguage.native.tsx"],
|
|
4
|
-
"mappings": ";AAAA,SAASA,eAAe;AAExB,SAASC,wBAAwB
|
|
4
|
+
"mappings": ";AAAA,SAASA,eAAe;AAExB,SAASC,wBAAwB;;;;;;;;;;;;;;;;;;AAG1B,IAAMC,eAAe,SAAA,QAAA;MAAGC,WAAAA,OAAAA,UAAaC,QAAAA,2BAAAA,QAAAA;IAAbD;MACvBE,WAAWL,QAAQ,WAAA;WAAMI;KAAO;IAACE,KAAKC,UAAUH,KAAAA;GAAO;AAC7D,SACE,qBAACH,iBAAiBO,UAAQ;IAACH;;;AAE/B;AAEAH,aAAa,cAAiB;",
|
|
5
5
|
"names": ["useMemo", "ComponentContext", "FontLanguage", "children", "props", "language", "JSON", "stringify", "Provider"]
|
|
6
6
|
}
|
|
@@ -38,8 +38,7 @@ function _object_spread_props(target, source) {
|
|
|
38
38
|
}), target;
|
|
39
39
|
}
|
|
40
40
|
function _object_without_properties(source, excluded) {
|
|
41
|
-
if (source == null)
|
|
42
|
-
return {};
|
|
41
|
+
if (source == null) return {};
|
|
43
42
|
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
44
43
|
if (Object.getOwnPropertySymbols) {
|
|
45
44
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -49,8 +48,7 @@ function _object_without_properties(source, excluded) {
|
|
|
49
48
|
return target;
|
|
50
49
|
}
|
|
51
50
|
function _object_without_properties_loose(source, excluded) {
|
|
52
|
-
if (source == null)
|
|
53
|
-
return {};
|
|
51
|
+
if (source == null) return {};
|
|
54
52
|
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
55
53
|
for (i = 0; i < sourceKeys.length; i++)
|
|
56
54
|
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Users/n8/tamagui/packages/web/src/views/Slot.tsx"],
|
|
4
|
-
"mappings": ";AAEA,SAASA,mBAAmB;AAC5B,SAASC,aAAa;AACtB,SAASC,4BAA4B;AAErC,SAASC,UAAUC,cAAcC,YAAYC,gBAAgBC,eAAe
|
|
4
|
+
"mappings": ";AAEA,SAASA,mBAAmB;AAC5B,SAASC,aAAa;AACtB,SAASC,4BAA4B;AAErC,SAASC,UAAUC,cAAcC,YAAYC,gBAAgBC,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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YACFN,cAAcG,QAAAA,IAAY7B,qBAAqB+B,gBAAgBD,aAAAA,IAGxDD,aAAa,UACpBH,cAAcG,QAAAA,IAAY,eAAA,CAAA,GAAKC,eAAkBC,cAAAA,IACxCF,aAAa,gBACtBH,cAAcG,QAAAA,IAAY;MAACC;MAAeC;MAAgBI,OAAOC,OAAAA,EAASC,KAAK,GAAA;EAEnF;AAEA,SAAO,eAAA,CAAA,GAAKzB,WAAcc,aAAAA;AAC5B;AAEA,IAAMO,cAAc;",
|
|
5
5
|
"names": ["composeRefs", "isWeb", "composeEventHandlers", "Children", "cloneElement", "forwardRef", "isValidElement", "version", "is19", "startsWith", "Slot", "props", "forwardedRef", "children", "slotProps", "mergedProps", "mergeSlotProps", "type", "ref", "count", "only", "Slottable", "pressMap", "onPress", "onPressOut", "onPressIn", "child", "childProps", "overrideProps", "isHTMLChild", "key", "propName", "slotPropValue", "childPropValue", "isHandler", "handleRegex", "test", "filter", "Boolean", "join"]
|
|
6
6
|
}
|
|
@@ -39,8 +39,7 @@ function _object_spread_props(target, source) {
|
|
|
39
39
|
}), target;
|
|
40
40
|
}
|
|
41
41
|
function _object_without_properties(source, excluded) {
|
|
42
|
-
if (source == null)
|
|
43
|
-
return {};
|
|
42
|
+
if (source == null) return {};
|
|
44
43
|
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
45
44
|
if (Object.getOwnPropertySymbols) {
|
|
46
45
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -50,8 +49,7 @@ function _object_without_properties(source, excluded) {
|
|
|
50
49
|
return target;
|
|
51
50
|
}
|
|
52
51
|
function _object_without_properties_loose(source, excluded) {
|
|
53
|
-
if (source == null)
|
|
54
|
-
return {};
|
|
52
|
+
if (source == null) return {};
|
|
55
53
|
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
56
54
|
for (i = 0; i < sourceKeys.length; i++)
|
|
57
55
|
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Users/n8/tamagui/packages/web/src/views/TamaguiProvider.tsx"],
|
|
4
|
-
"mappings": ";AAAA,SAASA,gBAAgB;AACzB,YAAYC,WAAW;AAEvB,SAASC,wBAAwB;AACjC,SAASC,2BAA2B;AAEpC,SAASC,qBAAqB
|
|
4
|
+
"mappings": ";AAAA,SAASA,gBAAgB;AACzB,YAAYC,WAAW;AAEvB,SAASC,wBAAwB;AACjC,SAASC,2BAA2B;AAEpC,SAASC,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEvB,SAASC,gBAAgB,QAAA;MAC9BC,WAD8B,OAC9BA,UACAC,mBAF8B,OAE9BA,kBACAC,SAH8B,OAG9BA,QACGC,qBAAAA,2BAJ2B,QAAA;IAC9BH;IACAC;IACAC;;AAGAL,sBAAAA,GAEIH,YAGFC,MAAMS,mBAAmB,WAAA;AACvB,QAAKF,WACAA,OAAOG,cAGNC,SAASC,gBAAgBC,UAAUC,SAAS,aAAA,KAC9CH,SAASC,gBAAgBC,UAAUE,OAAO,aAAA,GAI1C,CAACT,mBAAkB;AACrB,UAAMU,QAAQL,SAASM,cAAc,OAAA;AACrCD,mBAAME,YAAYP,SAASQ,eAAeZ,OAAOa,OAAM,CAAA,CAAA,GACvDT,SAASU,KAAKH,YAAYF,KAAAA,GACnB,WAAA;AACLL,iBAASU,KAAKC,YAAYN,KAAAA;MAC5B;IACF;EACF,GAAG;IAACT;IAAQD;GAAiB;MAUvBE;AAPR,SACE,qBAACP,iBAAiBsB,UAAQ;IAACC,iBAAiBjB,UAAAA,OAAAA,SAAAA,OAAQkB;cAClD,qBAACtB,eAAAA,qBAAAA,eAAAA;MACCuB,sBAAsBnB,UAAAA,OAAAA,SAAAA,OAAQmB;MAC9BC,uBAAuBpB,UAAAA,OAAAA,SAAAA,OAAQoB;OAC3BnB,kBAAAA,GAAAA;MACJoB,eACEpB,mCAAAA,mBAAmBoB,kBAAY,QAA/BpB,qCAAAA,SAAAA,mCAAoCD,SAASsB,OAAOC,KAAKvB,OAAOwB,MAAM,EAAE,CAAA,IAAK;;;;AAOvF;AAEA3B,gBAAgB,cAAiB;",
|
|
5
5
|
"names": ["isClient", "React", "ComponentContext", "setupMediaListeners", "ThemeProvider", "TamaguiProvider", "children", "disableInjectCSS", "config", "themePropsProvider", "useInsertionEffect", "disableSSR", "document", "documentElement", "classList", "contains", "remove", "style", "createElement", "appendChild", "createTextNode", "getCSS", "head", "removeChild", "Provider", "animationDriver", "animations", "themeClassNameOnRoot", "disableRootThemeClass", "defaultTheme", "Object", "keys", "themes"]
|
|
6
6
|
}
|
|
@@ -14,8 +14,7 @@ function _define_property(obj, key, value) {
|
|
|
14
14
|
}) : obj[key] = value, obj;
|
|
15
15
|
}
|
|
16
16
|
function _object_without_properties(source, excluded) {
|
|
17
|
-
if (source == null)
|
|
18
|
-
return {};
|
|
17
|
+
if (source == null) return {};
|
|
19
18
|
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
20
19
|
if (Object.getOwnPropertySymbols) {
|
|
21
20
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -25,8 +24,7 @@ function _object_without_properties(source, excluded) {
|
|
|
25
24
|
return target;
|
|
26
25
|
}
|
|
27
26
|
function _object_without_properties_loose(source, excluded) {
|
|
28
|
-
if (source == null)
|
|
29
|
-
return {};
|
|
27
|
+
if (source == null) return {};
|
|
30
28
|
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
31
29
|
for (i = 0; i < sourceKeys.length; i++)
|
|
32
30
|
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Users/n8/tamagui/packages/web/src/views/Theme.tsx"],
|
|
4
|
-
"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QAAAA;IAAKH,WAAY,GAAY,OAAVA,WAAU,yBAAA;IAA0BC;;;AAM1D,MAAIH,sBAAsB;QACXlC,mBAAPwB,SAAOxB,oBAAAA,WAAWyB,WAAK,QAAhBzB,sBAAAA,SAAAA,SAAAA,kBAAkBwB,SAAQ,IACjCgB,mBAAmBhB,KAAKiB,WAAW,OAAA,IACrC,wBACAjB,KAAKiB,WAAW,MAAA,IACd,uBACA;AACNH,qBACE,qBAACC,QAAAA;MAAKH,WAAY,GAAkC,OAAhCJ,UAAUQ,mBAAmB,IAAG,gBAAA;gBACjDF;;EAGP;AAEA,SAAOA;AACT;AAEA,IAAMI,WAAW,CAAC;AAElB,SAASP,0BAA0BnC,YAAgC;MAAED,SAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAS,IAO1EC,mBAUcA;AAhBhB,MAAI,CAACA,WAAWe;AACd,WAAO;MAAEqB,WAAW;MAAIC,OAAOK;IAAS;AAI1C,MAAMC,aACJ3C,uBAAAA,WAAWyB,WAAK,QAAhBzB,sBAAAA,WAAAA,kBAAkB4C,SAAS5C,WAAWe,aAClCzB,iBAAiBU,WAAWyB,MAAMmB,MAAMC,KAAK,IAC7C,IAEAR,QAAQM,aACV;IACEE,OAAOF;EACT,IACApB,QAEAa,cAAYpC,qBAAAA,WAAWyB,WAAK,QAAhBzB,uBAAAA,SAAAA,SAAAA,mBAAkBoC,cAAa;AAC/C,SAAIrC,WACFqC,YAAYA,UAAUU,QAAQ,eAAe,EAAA,IAExC;IAAET;IAAOD;EAAU;AAC5B;",
|
|
5
5
|
"names": ["isWeb", "React", "Children", "cloneElement", "forwardRef", "isValidElement", "useRef", "variableToString", "ThemeManagerIDContext", "useChangeThemeEffect", "ThemeDebug", "Theme", "ref", "children", "props", "disable", "isRoot", "themeState", "disableDirectChildTheme", "finalChildren", "map", "child", "only", "process", "env", "NODE_ENV", "debug", "themeProps", "stateRef", "hasEverThemed", "getThemedChildren", "themeManager", "isNewTheme", "Error", "shallow", "forceClassName", "shouldRenderChildrenWithTheme", "current", "next", "toArray", "undefined", "name", "state", "parentName", "elementsWithContext", "Provider", "value", "id", "wrapThemeElements", "inverse", "inversed", "requiresExtraWrapper", "getThemeClassNameAndStyle", "className", "style", "themedChildren", "span", "inverseClassName", "startsWith", "emptyObj", "themeColor", "theme", "color", "replace"]
|
|
6
6
|
}
|
|
@@ -4,8 +4,7 @@ import { THEME_CLASSNAME_PREFIX } from "../constants/constants";
|
|
|
4
4
|
import { Theme } from "./Theme";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
const ThemeProvider = (props) => (isClient && useLayoutEffect(() => {
|
|
7
|
-
if (props.disableRootThemeClass)
|
|
8
|
-
return;
|
|
7
|
+
if (props.disableRootThemeClass) return;
|
|
9
8
|
const cn = `${THEME_CLASSNAME_PREFIX}${props.defaultTheme}`, target = props.themeClassNameOnRoot ? document.documentElement : document.body;
|
|
10
9
|
return target.classList.add(cn), () => {
|
|
11
10
|
target.classList.remove(cn);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/ThemeProvider.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAEhC,SAAS,8BAA8B;AACvC,SAAS,aAAa;AA0BlB;AAfG,MAAM,gBAAgB,CAAC,WAExB,YACF,gBAAgB,MAAM;AACpB,MAAI,MAAM;
|
|
4
|
+
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAEhC,SAAS,8BAA8B;AACvC,SAAS,aAAa;AA0BlB;AAfG,MAAM,gBAAgB,CAAC,WAExB,YACF,gBAAgB,MAAM;AACpB,MAAI,MAAM,sBAAuB;AACjC,QAAM,KAAK,GAAG,sBAAsB,GAAG,MAAM,YAAY,IACnD,SAAS,MAAM,uBAAuB,SAAS,kBAAkB,SAAS;AAChF,gBAAO,UAAU,IAAI,EAAE,GAChB,MAAM;AACX,WAAO,UAAU,OAAO,EAAE;AAAA,EAC5B;AACF,GAAG,CAAC,MAAM,cAAc,MAAM,uBAAuB,MAAM,oBAAoB,CAAC,GAIhF;AAAA,EAAC;AAAA;AAAA,IACC,WAAW,MAAM;AAAA,IACjB,MAAM,MAAM;AAAA,IAEZ,gBAAgB,CAAC,MAAM;AAAA,IAEvB,SAAO;AAAA,IAEN,gBAAM;AAAA;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.100.0",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"reset.css"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/compose-refs": "1.
|
|
31
|
-
"@tamagui/constants": "1.
|
|
32
|
-
"@tamagui/helpers": "1.
|
|
33
|
-
"@tamagui/normalize-css-color": "1.
|
|
34
|
-
"@tamagui/timer": "1.
|
|
35
|
-
"@tamagui/types": "1.
|
|
36
|
-
"@tamagui/use-did-finish-ssr": "1.
|
|
37
|
-
"@tamagui/use-event": "1.
|
|
38
|
-
"@tamagui/use-force-update": "1.
|
|
30
|
+
"@tamagui/compose-refs": "1.100.0",
|
|
31
|
+
"@tamagui/constants": "1.100.0",
|
|
32
|
+
"@tamagui/helpers": "1.100.0",
|
|
33
|
+
"@tamagui/normalize-css-color": "1.100.0",
|
|
34
|
+
"@tamagui/timer": "1.100.0",
|
|
35
|
+
"@tamagui/types": "1.100.0",
|
|
36
|
+
"@tamagui/use-did-finish-ssr": "1.100.0",
|
|
37
|
+
"@tamagui/use-event": "1.100.0",
|
|
38
|
+
"@tamagui/use-force-update": "1.100.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@tamagui/build": "1.
|
|
41
|
+
"@tamagui/build": "1.100.0",
|
|
42
42
|
"@testing-library/react": "^14.0.0",
|
|
43
43
|
"csstype": "^3.0.10",
|
|
44
44
|
"react": "^18.2.0",
|
package/src/createComponent.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { composeRefs } from '@tamagui/compose-refs'
|
|
2
2
|
import { isClient, isServer, isWeb } from '@tamagui/constants'
|
|
3
3
|
import { composeEventHandlers, validStyles } from '@tamagui/helpers'
|
|
4
|
-
import { useDidFinishSSR } from '@tamagui/use-did-finish-ssr'
|
|
5
4
|
import React, {
|
|
6
5
|
Children,
|
|
7
6
|
Fragment,
|
|
@@ -18,6 +17,7 @@ import React, {
|
|
|
18
17
|
|
|
19
18
|
import { devConfig, getConfig, onConfiguredOnce } from './config'
|
|
20
19
|
import { stackDefaultStyles } from './constants/constants'
|
|
20
|
+
import { isDevTools } from './constants/isDevTools'
|
|
21
21
|
import { ComponentContext } from './contexts/ComponentContext'
|
|
22
22
|
import { didGetVariableValue, setDidGetVariableValue } from './createVariable'
|
|
23
23
|
import {
|
|
@@ -33,9 +33,13 @@ import { useSplitStyles } from './helpers/getSplitStyles'
|
|
|
33
33
|
import { isObj } from './helpers/isObj'
|
|
34
34
|
import { log } from './helpers/log'
|
|
35
35
|
import { mergeProps } from './helpers/mergeProps'
|
|
36
|
+
import { setElementProps } from './helpers/setElementProps'
|
|
36
37
|
import { themeable } from './helpers/themeable'
|
|
37
38
|
import { mediaKeyMatch, setMediaShouldUpdate, useMedia } from './hooks/useMedia'
|
|
38
39
|
import { useThemeWithState } from './hooks/useTheme'
|
|
40
|
+
import type { TamaguiComponentEvents } from './interfaces/TamaguiComponentEvents'
|
|
41
|
+
import type { TamaguiComponentState } from './interfaces/TamaguiComponentState'
|
|
42
|
+
import type { WebOnlyPressEvents } from './interfaces/WebOnlyPressEvents'
|
|
39
43
|
import { hooks } from './setupHooks'
|
|
40
44
|
import type {
|
|
41
45
|
ComponentContextI,
|
|
@@ -61,14 +65,9 @@ import type {
|
|
|
61
65
|
UseAnimationProps,
|
|
62
66
|
UseThemeWithStateProps,
|
|
63
67
|
} from './types'
|
|
64
|
-
import type { WebOnlyPressEvents } from './interfaces/WebOnlyPressEvents'
|
|
65
|
-
import type { TamaguiComponentState } from './interfaces/TamaguiComponentState'
|
|
66
|
-
import type { TamaguiComponentEvents } from './interfaces/TamaguiComponentEvents'
|
|
67
68
|
import { Slot } from './views/Slot'
|
|
68
69
|
import { getThemedChildren } from './views/Theme'
|
|
69
70
|
import { ThemeDebug } from './views/ThemeDebug'
|
|
70
|
-
import { isDevTools } from './constants/isDevTools'
|
|
71
|
-
import { setElementProps } from './helpers/setElementProps'
|
|
72
71
|
|
|
73
72
|
/**
|
|
74
73
|
* All things that need one-time setup after createTamagui is called
|
|
@@ -178,9 +177,6 @@ export const useComponentState = (
|
|
|
178
177
|
curStateRef.hasAnimated = true
|
|
179
178
|
}
|
|
180
179
|
|
|
181
|
-
// HOOK
|
|
182
|
-
const isHydrated = config?.disableSSR ? true : useDidFinishSSR()
|
|
183
|
-
|
|
184
180
|
// HOOK
|
|
185
181
|
const presence =
|
|
186
182
|
(willBeAnimated &&
|
|
@@ -194,25 +190,17 @@ export const useComponentState = (
|
|
|
194
190
|
const hasEnterStyle = !!props.enterStyle
|
|
195
191
|
// finish animated logic, avoid isAnimated when unmounted
|
|
196
192
|
const hasRNAnimation = hasAnimationProp && animationDriver?.isReactNative
|
|
197
|
-
const isReactNative = staticConfig.isReactNative
|
|
198
|
-
|
|
199
|
-
// only web server + initial client render run this when not hydrated:
|
|
200
|
-
let isAnimated = willBeAnimated
|
|
201
|
-
if (!isReactNative && hasRNAnimation && !staticConfig.isHOC && !isHydrated) {
|
|
202
|
-
isAnimated = false
|
|
203
|
-
curStateRef.willHydrate = true
|
|
204
|
-
}
|
|
205
193
|
|
|
206
194
|
if (process.env.NODE_ENV === 'development' && time) time`pre-use-state`
|
|
207
195
|
|
|
208
196
|
const hasEnterState = hasEnterStyle || isEntering
|
|
209
|
-
const needsToMount = !isHydrated || !curStateRef.host
|
|
210
197
|
|
|
211
|
-
const initialState =
|
|
212
|
-
|
|
213
|
-
?
|
|
214
|
-
|
|
215
|
-
|
|
198
|
+
const initialState =
|
|
199
|
+
hasEnterState || hasRNAnimation
|
|
200
|
+
? isWeb
|
|
201
|
+
? defaultComponentState
|
|
202
|
+
: defaultComponentStateShouldEnter
|
|
203
|
+
: defaultComponentStateMounted
|
|
216
204
|
|
|
217
205
|
// will be nice to deprecate half of these:
|
|
218
206
|
const disabled = isDisabled(props)
|
|
@@ -227,6 +215,15 @@ export const useComponentState = (
|
|
|
227
215
|
const state = props.forceStyle ? { ...states[0], [props.forceStyle]: true } : states[0]
|
|
228
216
|
const setState = states[1]
|
|
229
217
|
|
|
218
|
+
const isHydrated = state.unmounted === false || state.unmounted === 'should-enter'
|
|
219
|
+
|
|
220
|
+
// only web server + initial client render run this when not hydrated:
|
|
221
|
+
let isAnimated = willBeAnimated
|
|
222
|
+
if (isWeb && hasRNAnimation && !staticConfig.isHOC && state.unmounted === true) {
|
|
223
|
+
isAnimated = false
|
|
224
|
+
curStateRef.willHydrate = true
|
|
225
|
+
}
|
|
226
|
+
|
|
230
227
|
// immediately update disabled state and reset component state
|
|
231
228
|
if (disabled !== state.disabled) {
|
|
232
229
|
state.disabled = disabled
|
|
@@ -237,11 +234,11 @@ export const useComponentState = (
|
|
|
237
234
|
setState({ ...state })
|
|
238
235
|
}
|
|
239
236
|
|
|
240
|
-
let setStateShallow = createShallowSetState(setState, disabled, props.debug)
|
|
237
|
+
let setStateShallow = createShallowSetState(setState, disabled, false, props.debug)
|
|
241
238
|
|
|
242
|
-
if (isHydrated && state.unmounted === 'should-enter') {
|
|
243
|
-
|
|
244
|
-
}
|
|
239
|
+
// if (isHydrated && state.unmounted === 'should-enter') {
|
|
240
|
+
// state.unmounted = true
|
|
241
|
+
// }
|
|
245
242
|
|
|
246
243
|
// set enter/exit variants onto our new props object
|
|
247
244
|
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
@@ -815,12 +812,10 @@ export function createComponent<
|
|
|
815
812
|
// once you set animation prop don't remove it, you can set to undefined/false
|
|
816
813
|
// reason is animations are heavy - no way around it, and must be run inline here (🙅 loading as a sub-component)
|
|
817
814
|
let animationStyles: any
|
|
818
|
-
if
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
!isHOC
|
|
823
|
-
) {
|
|
815
|
+
const shouldUseAnimation = // if it supports css vars we run it on server too to get matching initial style
|
|
816
|
+
(supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
|
|
817
|
+
|
|
818
|
+
if (shouldUseAnimation) {
|
|
824
819
|
// HOOK 16... (depends on driver) (-1 if no animation, -1 if disableSSR, -1 if no context, -1 if production)
|
|
825
820
|
const animations = useAnimations({
|
|
826
821
|
props: propsWithAnimation,
|
|
@@ -917,6 +912,11 @@ export function createComponent<
|
|
|
917
912
|
return
|
|
918
913
|
}
|
|
919
914
|
|
|
915
|
+
if (state.unmounted === true) {
|
|
916
|
+
setStateShallow({ unmounted: 'should-enter' })
|
|
917
|
+
return
|
|
918
|
+
}
|
|
919
|
+
|
|
920
920
|
if (state.unmounted) {
|
|
921
921
|
setStateShallow({ unmounted: false })
|
|
922
922
|
return
|
|
@@ -936,6 +936,7 @@ export function createComponent<
|
|
|
936
936
|
componentSetStates.delete(setState)
|
|
937
937
|
}
|
|
938
938
|
}, [
|
|
939
|
+
state.unmounted,
|
|
939
940
|
disabled,
|
|
940
941
|
pseudoGroups ? Object.keys([...pseudoGroups]).join('') : 0,
|
|
941
942
|
mediaGroups ? Object.keys([...mediaGroups]).join('') : 0,
|
|
@@ -1277,6 +1278,31 @@ export function createComponent<
|
|
|
1277
1278
|
)
|
|
1278
1279
|
}
|
|
1279
1280
|
|
|
1281
|
+
// add in <style> tags inline
|
|
1282
|
+
if (process.env.TAMAGUI_REACT_19) {
|
|
1283
|
+
if (splitStyles.rulesToInsert.length) {
|
|
1284
|
+
content = (
|
|
1285
|
+
<>
|
|
1286
|
+
{content}
|
|
1287
|
+
{/* lets see if we can put a single style tag per rule for optimal de-duping */}
|
|
1288
|
+
{splitStyles.rulesToInsert.map(({ rules, identifier }) => {
|
|
1289
|
+
return (
|
|
1290
|
+
<style
|
|
1291
|
+
key={identifier}
|
|
1292
|
+
// @ts-ignore
|
|
1293
|
+
href={`t_${identifier}`}
|
|
1294
|
+
// @ts-ignore
|
|
1295
|
+
precedence="default"
|
|
1296
|
+
>
|
|
1297
|
+
{rules.join('\n')}
|
|
1298
|
+
</style>
|
|
1299
|
+
)
|
|
1300
|
+
})}
|
|
1301
|
+
</>
|
|
1302
|
+
)
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1280
1306
|
if (process.env.NODE_ENV === 'development') {
|
|
1281
1307
|
if (debugProp && debugProp !== 'profile') {
|
|
1282
1308
|
const element = typeof elementType === 'string' ? elementType : 'Component'
|
package/src/createVariable.ts
CHANGED
|
@@ -2,16 +2,15 @@ import { isWeb } from '@tamagui/constants'
|
|
|
2
2
|
import { simpleHash } from '@tamagui/helpers'
|
|
3
3
|
|
|
4
4
|
import { getConfig } from './config'
|
|
5
|
+
import type { TokenCategories } from './types'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Should rename this to Token
|
|
8
9
|
* Moving to objects for React Server Components support
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
|
-
const IS_VAR = 'isVar'
|
|
12
|
-
|
|
13
12
|
export interface Variable<A = any> {
|
|
14
|
-
|
|
13
|
+
isVar: true
|
|
15
14
|
variable?: string
|
|
16
15
|
val: A
|
|
17
16
|
name: string
|
|
@@ -25,18 +24,18 @@ function constructCSSVariableName(name: string) {
|
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
type VariableIn<A = any> = Pick<Variable<A>, 'key' | 'name' | 'val'>
|
|
27
|
+
|
|
28
28
|
export const createVariable = <A extends string | number | Variable = any>(
|
|
29
29
|
props: VariableIn<A>,
|
|
30
30
|
skipHash = false
|
|
31
31
|
): Variable<A> => {
|
|
32
32
|
if (!skipHash && isVariable(props)) return props
|
|
33
|
-
|
|
34
33
|
const { key, name, val } = props
|
|
35
34
|
return {
|
|
36
|
-
|
|
37
|
-
key
|
|
38
|
-
name: skipHash ?
|
|
39
|
-
val
|
|
35
|
+
isVar: true,
|
|
36
|
+
key,
|
|
37
|
+
name: skipHash ? name : simpleHash(name, 40),
|
|
38
|
+
val,
|
|
40
39
|
variable: isWeb
|
|
41
40
|
? skipHash
|
|
42
41
|
? constructCSSVariableName(name)
|
|
@@ -57,27 +56,38 @@ export function variableToString(vrble?: any, getValue = false) {
|
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
export function isVariable(v: Variable | any): v is Variable {
|
|
60
|
-
return v && typeof v === 'object' &&
|
|
59
|
+
return v && typeof v === 'object' && 'isVar' in v
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
export function getVariable(
|
|
62
|
+
export function getVariable(
|
|
63
|
+
nameOrVariable: Variable | string | any,
|
|
64
|
+
group: TokenCategories = 'size'
|
|
65
|
+
) {
|
|
64
66
|
setDidGetVariableValue(true)
|
|
65
67
|
if (isVariable(nameOrVariable)) {
|
|
66
68
|
return variableToString(nameOrVariable)
|
|
67
69
|
}
|
|
68
70
|
const tokens = getConfig().tokensParsed
|
|
69
|
-
return variableToString(tokens[nameOrVariable] ?? nameOrVariable)
|
|
71
|
+
return variableToString(tokens[group]?.[nameOrVariable] ?? nameOrVariable)
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
let accessed = false
|
|
73
75
|
export const setDidGetVariableValue = (val: boolean) => (accessed = val)
|
|
74
76
|
export const didGetVariableValue = () => accessed
|
|
75
77
|
|
|
76
|
-
export function getVariableValue(v: Variable | any) {
|
|
78
|
+
export function getVariableValue(v: Variable | any, group?: TokenCategories) {
|
|
77
79
|
if (isVariable(v)) {
|
|
78
80
|
setDidGetVariableValue(true)
|
|
79
81
|
return v.val
|
|
80
82
|
}
|
|
83
|
+
if (group) {
|
|
84
|
+
const tokens = getConfig().tokensParsed
|
|
85
|
+
const token = tokens[group]?.[v]
|
|
86
|
+
if (token) {
|
|
87
|
+
setDidGetVariableValue(true)
|
|
88
|
+
return token.val
|
|
89
|
+
}
|
|
90
|
+
}
|
|
81
91
|
return v
|
|
82
92
|
}
|
|
83
93
|
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import type React from 'react'
|
|
2
2
|
import type { DebugProp } from '../types'
|
|
3
|
+
import { startTransition } from 'react'
|
|
4
|
+
|
|
5
|
+
const callImmediate = (cb) => cb()
|
|
3
6
|
|
|
4
7
|
export function createShallowSetState<State extends Object>(
|
|
5
8
|
setter: React.Dispatch<React.SetStateAction<State>>,
|
|
6
9
|
isDisabled?: boolean,
|
|
10
|
+
transition?: boolean,
|
|
7
11
|
debug?: DebugProp
|
|
8
12
|
) {
|
|
9
|
-
return (next?: Partial<State>) =>
|
|
10
|
-
|
|
13
|
+
return (next?: Partial<State>) => {
|
|
14
|
+
const wrap = transition ? startTransition : callImmediate
|
|
15
|
+
wrap(() => {
|
|
16
|
+
setter((prev) => mergeIfNotShallowEqual(prev, next, isDisabled, debug))
|
|
17
|
+
})
|
|
18
|
+
}
|
|
11
19
|
}
|
|
12
20
|
|
|
13
21
|
export function mergeIfNotShallowEqual(
|
|
@@ -739,11 +739,8 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
739
739
|
if (isExit) {
|
|
740
740
|
isDisabled = !styleProps.isExiting
|
|
741
741
|
}
|
|
742
|
-
if (isEnter) {
|
|
743
|
-
isDisabled =
|
|
744
|
-
componentState.unmounted === 'should-enter'
|
|
745
|
-
? true
|
|
746
|
-
: !componentState.unmounted
|
|
742
|
+
if (isEnter && componentState.unmounted === false) {
|
|
743
|
+
isDisabled = true
|
|
747
744
|
}
|
|
748
745
|
|
|
749
746
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
@@ -1467,12 +1464,15 @@ const useInsertEffectCompat = isWeb
|
|
|
1467
1464
|
|
|
1468
1465
|
// perf: ...args a bit expensive on native
|
|
1469
1466
|
export const useSplitStyles: StyleSplitter = (a, b, c, d, e, f, g, h, i, j) => {
|
|
1467
|
+
conf = conf || getConfig()
|
|
1470
1468
|
const res = getSplitStyles(a, b, c, d, e, f, g, h, i, j)
|
|
1471
1469
|
|
|
1472
1470
|
if (process.env.TAMAGUI_TARGET !== 'native') {
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1471
|
+
if (!process.env.TAMAGUI_REACT_19) {
|
|
1472
|
+
useInsertEffectCompat(() => {
|
|
1473
|
+
insertStyleRules(res.rulesToInsert)
|
|
1474
|
+
}, [res.rulesToInsert])
|
|
1475
|
+
}
|
|
1476
1476
|
}
|
|
1477
1477
|
|
|
1478
1478
|
return res
|
|
@@ -1483,7 +1483,9 @@ function addStyleToInsertRules(rulesToInsert: RulesToInsert, styleObject: StyleO
|
|
|
1483
1483
|
if (!shouldInsertStyleRules(styleObject.identifier)) {
|
|
1484
1484
|
return
|
|
1485
1485
|
}
|
|
1486
|
-
|
|
1486
|
+
if (!process.env.TAMAGUI_REACT_19) {
|
|
1487
|
+
updateRules(styleObject.identifier, styleObject.rules)
|
|
1488
|
+
}
|
|
1487
1489
|
rulesToInsert.push(styleObject)
|
|
1488
1490
|
}
|
|
1489
1491
|
}
|
|
@@ -2,26 +2,33 @@ import { getVariableValue } from '../createVariable'
|
|
|
2
2
|
import type { GenericFonts, GetStyleState } from '../types'
|
|
3
3
|
import type { LanguageContextType } from '../views/FontLanguage.types'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const cache = new WeakMap()
|
|
6
|
+
|
|
7
|
+
export const getVariantExtras = (styleState: GetStyleState) => {
|
|
8
|
+
if (cache.has(styleState)) {
|
|
9
|
+
return cache.get(styleState)
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
const { curProps, props, conf, context, theme } = styleState
|
|
7
13
|
let fonts = conf.fontsParsed
|
|
8
14
|
if (context?.language) {
|
|
9
15
|
fonts = getFontsForLanguage(conf.fontsParsed, context.language)
|
|
10
16
|
}
|
|
11
17
|
|
|
12
|
-
// should be able to just use styleState.fontFamily but no time to test for now
|
|
13
|
-
const fontFamily = getVariableValue(
|
|
14
|
-
styleState.fontFamily || styleState.curProps.fontFamily || styleState.conf.defaultFont
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
const font = fonts[fontFamily] || fonts[styleState.conf.defaultFont!]
|
|
18
|
-
|
|
19
18
|
const next = {
|
|
20
19
|
fonts,
|
|
21
20
|
tokens: conf.tokensParsed,
|
|
22
21
|
theme,
|
|
23
|
-
fontFamily
|
|
24
|
-
|
|
22
|
+
get fontFamily() {
|
|
23
|
+
return getVariableValue(
|
|
24
|
+
styleState.fontFamily ||
|
|
25
|
+
styleState.curProps.fontFamily ||
|
|
26
|
+
styleState.conf.defaultFont
|
|
27
|
+
)
|
|
28
|
+
},
|
|
29
|
+
get font() {
|
|
30
|
+
return fonts[this.fontFamily] || fonts[styleState.conf.defaultFont!]
|
|
31
|
+
},
|
|
25
32
|
// TODO do this in splitstlye
|
|
26
33
|
// we avoid passing in default props for media queries because that would confuse things like SizableText.size:
|
|
27
34
|
props: new Proxy(props, {
|
|
@@ -36,6 +43,8 @@ export function getVariantExtras(styleState: GetStyleState) {
|
|
|
36
43
|
}),
|
|
37
44
|
}
|
|
38
45
|
|
|
46
|
+
cache.set(styleState, next)
|
|
47
|
+
|
|
39
48
|
return next as any
|
|
40
49
|
}
|
|
41
50
|
|