@tamagui/web 3.0.0-beta.1604.1 → 3.0.0-beta.1648.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/createTamagui.cjs +10 -8
- package/dist/cjs/createTamagui.native.cjs +10 -8
- package/dist/cjs/createTamagui.native.js +10 -8
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +5 -7
- package/dist/cjs/helpers/getSplitStyles.native.cjs +6 -8
- package/dist/cjs/helpers/getSplitStyles.native.js +6 -8
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.cjs +2 -1
- package/dist/cjs/helpers/proxyThemeToParents.native.cjs +2 -1
- package/dist/cjs/helpers/proxyThemeToParents.native.js +2 -1
- package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/cjs/helpers/themes.cjs +19 -11
- package/dist/cjs/helpers/themes.native.cjs +19 -11
- package/dist/cjs/helpers/themes.native.js +19 -11
- package/dist/cjs/helpers/themes.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +9 -19
- package/dist/cjs/hooks/useThemeState.native.cjs +16 -22
- package/dist/cjs/hooks/useThemeState.native.js +16 -22
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +2 -0
- package/dist/cjs/internal-runtime.native.cjs +2 -0
- package/dist/cjs/internal-runtime.native.js +2 -0
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +11 -9
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +11 -9
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +5 -7
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +6 -8
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.mjs +3 -1
- package/dist/esm/helpers/proxyThemeToParents.mjs.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.native.js +3 -1
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/esm/helpers/themes.mjs +15 -11
- package/dist/esm/helpers/themes.mjs.map +1 -1
- package/dist/esm/helpers/themes.native.js +15 -11
- package/dist/esm/helpers/themes.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +8 -20
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +16 -22
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/internal-runtime.mjs +3 -2
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +3 -2
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/package.json +17 -17
- package/src/createTamagui.ts +17 -21
- package/src/helpers/getSplitStyles.tsx +13 -8
- package/src/helpers/proxyThemeToParents.ts +2 -1
- package/src/helpers/themes.ts +17 -11
- package/src/hooks/useThemeState.ts +15 -35
- package/src/internal-runtime.ts +6 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/proxyThemeToParents.d.ts.map +1 -1
- package/types/helpers/themes.d.ts +2 -0
- package/types/helpers/themes.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/internal-runtime.d.ts +1 -0
- package/types/internal-runtime.d.ts.map +1 -1
|
@@ -7,7 +7,7 @@ import { styleToCSS as styleToCSS$1 } from "./helpers/styleToCSS.mjs";
|
|
|
7
7
|
import { getThemeCSSRules as getThemeCSSRules$1 } from "./helpers/getThemeCSSRules.mjs";
|
|
8
8
|
import { normalizeValueWithProperty as normalizeValueWithProperty$1 } from "./helpers/normalizeValueWithProperty.mjs";
|
|
9
9
|
import { proxyThemeToParents as proxyThemeToParents$1 } from "./helpers/proxyThemeToParents.mjs";
|
|
10
|
-
import { ensureThemeVariable as ensureThemeVariable$1 } from "./helpers/themes.mjs";
|
|
10
|
+
import { copyAuthoredThemeScheme as copyAuthoredThemeScheme$1, ensureThemeVariable as ensureThemeVariable$1 } from "./helpers/themes.mjs";
|
|
11
11
|
import { transformsToString as transformsToString$1 } from "./helpers/transformsToString.mjs";
|
|
12
12
|
import { parseFont as parseFont$1, registerFontVariables as registerFontVariables$1 } from "./insertFont.mjs";
|
|
13
13
|
import { createTamagui as createTamagui$1 } from "./createTamagui.mjs";
|
|
@@ -27,6 +27,7 @@ const getThemeCSSRules = getThemeCSSRules$1;
|
|
|
27
27
|
const normalizeValueWithProperty = normalizeValueWithProperty$1;
|
|
28
28
|
const proxyThemeToParents = proxyThemeToParents$1;
|
|
29
29
|
const ensureThemeVariable = ensureThemeVariable$1;
|
|
30
|
+
const copyAuthoredThemeScheme = copyAuthoredThemeScheme$1;
|
|
30
31
|
const transformsToString = transformsToString$1;
|
|
31
32
|
const styleToCSS = styleToCSS$1;
|
|
32
33
|
const useThemeWithState = useThemeWithState$1;
|
|
@@ -79,5 +80,5 @@ function createFrontendHTML(frontend) {
|
|
|
79
80
|
return out;
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
export { TamaguiProvider, createFrontendHTML, createFrontendStyled, createFrontendViews, createTamagui, createVariables, ensureThemeVariable, fixStyles, getThemeCSSRules, mergeFrontendCondition, normalizeValueWithProperty, parseFont, plainValueToPayload, proxyThemeToParents, registerFontVariables, regularStyleFrontend, setupHooks, styleToCSS, transformsToString, useThemeWithState };
|
|
83
|
+
export { TamaguiProvider, copyAuthoredThemeScheme, createFrontendHTML, createFrontendStyled, createFrontendViews, createTamagui, createVariables, ensureThemeVariable, fixStyles, getThemeCSSRules, mergeFrontendCondition, normalizeValueWithProperty, parseFont, plainValueToPayload, proxyThemeToParents, registerFontVariables, regularStyleFrontend, setupHooks, styleToCSS, transformsToString, useThemeWithState };
|
|
83
84
|
//# sourceMappingURL=internal-runtime.mjs.map
|
|
@@ -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 { html } from \"./dom/html\";\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
|
|
1
|
+
{"version":3,"file":"internal-runtime.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","copyAuthoredThemeSchemeImpl","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 { html } from \"./dom/html\";\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 {\n copyAuthoredThemeScheme as copyAuthoredThemeSchemeImpl,\n ensureThemeVariable as ensureThemeVariableImpl\n} 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 { mergeFrontendCondition, 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 copyAuthoredThemeScheme = copyAuthoredThemeSchemeImpl;\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}\nfunction createFrontendHTML(frontend) {\n const out = {};\n for (const tag in html) {\n const source = html[tag];\n if (!source.staticConfig) {\n out[tag] = source;\n continue;\n }\n const rebuilt = createComponent({\n ...source.staticConfig,\n styleFrontend: frontend,\n displayName: tag\n });\n out[tag] = source.rebindDOMTag ? source.rebindDOMTag(rebuilt) : rebuilt;\n }\n return out;\n}\nexport {\n TamaguiProvider,\n copyAuthoredThemeScheme,\n createFrontendHTML,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n createVariables,\n ensureThemeVariable,\n fixStyles,\n getThemeCSSRules,\n mergeFrontendCondition,\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":";;;;;;;;;;;;;;;;;;;;;;AA0BA,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,0BAA0BC;AAChC,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;AACA,SAAS,mBAAmB,UAAU;CACpC,MAAM,MAAM,CAAC;CACb,KAAK,MAAM,OAAO,MAAM;EACtB,MAAM,SAAS,KAAK;EACpB,IAAI,CAAC,OAAO,cAAc;GACxB,IAAI,OAAO;GACX;EACF;EACA,MAAM,UAAU,gBAAgB;GAC9B,GAAG,OAAO;GACV,eAAe;GACf,aAAa;EACf,CAAC;EACD,IAAI,OAAO,OAAO,eAAe,OAAO,aAAa,OAAO,IAAI;CAClE;CACA,OAAO;AACT"}
|
|
@@ -7,7 +7,7 @@ import { styleToCSS as styleToCSS$1 } from "./helpers/styleToCSS.native.js";
|
|
|
7
7
|
import { getThemeCSSRules as getThemeCSSRules$1 } from "./helpers/getThemeCSSRules.native.js";
|
|
8
8
|
import { normalizeValueWithProperty as normalizeValueWithProperty$1 } from "./helpers/normalizeValueWithProperty.native.js";
|
|
9
9
|
import { proxyThemeToParents as proxyThemeToParents$1 } from "./helpers/proxyThemeToParents.native.js";
|
|
10
|
-
import { ensureThemeVariable as ensureThemeVariable$1 } from "./helpers/themes.native.js";
|
|
10
|
+
import { copyAuthoredThemeScheme as copyAuthoredThemeScheme$1, ensureThemeVariable as ensureThemeVariable$1 } from "./helpers/themes.native.js";
|
|
11
11
|
import { transformsToString as transformsToString$1 } from "./helpers/transformsToString.native.js";
|
|
12
12
|
import { parseFont as parseFont$1, registerFontVariables as registerFontVariables$1 } from "./insertFont.native.js";
|
|
13
13
|
import { createTamagui as createTamagui$1 } from "./createTamagui.native.js";
|
|
@@ -27,6 +27,7 @@ var getThemeCSSRules = getThemeCSSRules$1;
|
|
|
27
27
|
var normalizeValueWithProperty = normalizeValueWithProperty$1;
|
|
28
28
|
var proxyThemeToParents = proxyThemeToParents$1;
|
|
29
29
|
var ensureThemeVariable = ensureThemeVariable$1;
|
|
30
|
+
var copyAuthoredThemeScheme = copyAuthoredThemeScheme$1;
|
|
30
31
|
var transformsToString = transformsToString$1;
|
|
31
32
|
var styleToCSS = styleToCSS$1;
|
|
32
33
|
var useThemeWithState = useThemeWithState$1;
|
|
@@ -79,5 +80,5 @@ function createFrontendHTML(frontend) {
|
|
|
79
80
|
return out;
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
export { TamaguiProvider, createFrontendHTML, createFrontendStyled, createFrontendViews, createTamagui, createVariables, ensureThemeVariable, fixStyles, getThemeCSSRules, mergeFrontendCondition, normalizeValueWithProperty, parseFont, plainValueToPayload, proxyThemeToParents, registerFontVariables, regularStyleFrontend, setupHooks, styleToCSS, transformsToString, useThemeWithState };
|
|
83
|
+
export { TamaguiProvider, copyAuthoredThemeScheme, createFrontendHTML, createFrontendStyled, createFrontendViews, createTamagui, createVariables, ensureThemeVariable, fixStyles, getThemeCSSRules, mergeFrontendCondition, normalizeValueWithProperty, parseFont, plainValueToPayload, proxyThemeToParents, registerFontVariables, regularStyleFrontend, setupHooks, styleToCSS, transformsToString, useThemeWithState };
|
|
83
84
|
//# sourceMappingURL=internal-runtime.native.js.map
|
|
@@ -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 { html } from \"./dom/html\";\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 { mergeFrontendCondition, 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}\nfunction createFrontendHTML(frontend) {\n var out = {};\n for (var tag in html) {\n var source = html[tag];\n if (!source.staticConfig) {\n out[tag] = source;\n continue;\n }\n var rebuilt = createComponent({\n ...source.staticConfig,\n styleFrontend: frontend,\n displayName: tag\n });\n out[tag] = source.rebindDOMTag ? source.rebindDOMTag(rebuilt) : rebuilt;\n }\n return out;\n}\nexport {\n TamaguiProvider,\n createFrontendHTML,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n createVariables,\n ensureThemeVariable,\n fixStyles,\n getThemeCSSRules,\n mergeFrontendCondition,\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":";;;;;;;;;;;;;;;;;;;;;;AAoBA,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;AACA,SAAS,mBAAmB,UAAU;CACpC,IAAI,MAAM,CAAC;CACX,KAAK,IAAI,OAAO,MAAM;EACpB,IAAI,SAAS,KAAK;EAClB,IAAI,CAAC,OAAO,cAAc;GACxB,IAAI,OAAO;GACX;EACF;EACA,IAAI,UAAU,gBAAgB;GAC5B,GAAG,OAAO;GACV,eAAe;GACf,aAAa;EACf,CAAC;EACD,IAAI,OAAO,OAAO,eAAe,OAAO,aAAa,OAAO,IAAI;CAClE;CACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"internal-runtime.native.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","copyAuthoredThemeSchemeImpl","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 { html } from \"./dom/html\";\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 { copyAuthoredThemeScheme as copyAuthoredThemeSchemeImpl, 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 { mergeFrontendCondition, 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 copyAuthoredThemeScheme = copyAuthoredThemeSchemeImpl;\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}\nfunction createFrontendHTML(frontend) {\n var out = {};\n for (var tag in html) {\n var source = html[tag];\n if (!source.staticConfig) {\n out[tag] = source;\n continue;\n }\n var rebuilt = createComponent({\n ...source.staticConfig,\n styleFrontend: frontend,\n displayName: tag\n });\n out[tag] = source.rebindDOMTag ? source.rebindDOMTag(rebuilt) : rebuilt;\n }\n return out;\n}\nexport {\n TamaguiProvider,\n copyAuthoredThemeScheme,\n createFrontendHTML,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n createVariables,\n ensureThemeVariable,\n fixStyles,\n getThemeCSSRules,\n mergeFrontendCondition,\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":";;;;;;;;;;;;;;;;;;;;;;AAoBA,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,0BAA0BC;AAC9B,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;AACA,SAAS,mBAAmB,UAAU;CACpC,IAAI,MAAM,CAAC;CACX,KAAK,IAAI,OAAO,MAAM;EACpB,IAAI,SAAS,KAAK;EAClB,IAAI,CAAC,OAAO,cAAc;GACxB,IAAI,OAAO;GACX;EACF;EACA,IAAI,UAAU,gBAAgB;GAC5B,GAAG,OAAO;GACV,eAAe;GACf,aAAa;EACf,CAAC;EACD,IAAI,OAAO,OAAO,eAAe,OAAO,aAAa,OAAO,IAAI;CAClE;CACA,OAAO;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.1648.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Nate Wienert"
|
|
@@ -100,23 +100,23 @@
|
|
|
100
100
|
"test:web": "vitest --typecheck --run"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@tamagui/animation-helpers": "3.0.0-beta.
|
|
104
|
-
"@tamagui/compose-refs": "3.0.0-beta.
|
|
105
|
-
"@tamagui/constants": "3.0.0-beta.
|
|
106
|
-
"@tamagui/dom": "3.0.0-beta.
|
|
107
|
-
"@tamagui/helpers": "3.0.0-beta.
|
|
108
|
-
"@tamagui/is-equal-shallow": "3.0.0-beta.
|
|
109
|
-
"@tamagui/native": "3.0.0-beta.
|
|
110
|
-
"@tamagui/normalize-css-color": "3.0.0-beta.
|
|
111
|
-
"@tamagui/react-native-types": "3.0.0-beta.
|
|
112
|
-
"@tamagui/style-grammar": "3.0.0-beta.
|
|
113
|
-
"@tamagui/types": "3.0.0-beta.
|
|
114
|
-
"@tamagui/use-did-finish-ssr": "3.0.0-beta.
|
|
115
|
-
"@tamagui/use-event": "3.0.0-beta.
|
|
116
|
-
"@tamagui/use-force-update": "3.0.0-beta.
|
|
103
|
+
"@tamagui/animation-helpers": "3.0.0-beta.1648.1",
|
|
104
|
+
"@tamagui/compose-refs": "3.0.0-beta.1648.1",
|
|
105
|
+
"@tamagui/constants": "3.0.0-beta.1648.1",
|
|
106
|
+
"@tamagui/dom": "3.0.0-beta.1648.1",
|
|
107
|
+
"@tamagui/helpers": "3.0.0-beta.1648.1",
|
|
108
|
+
"@tamagui/is-equal-shallow": "3.0.0-beta.1648.1",
|
|
109
|
+
"@tamagui/native": "3.0.0-beta.1648.1",
|
|
110
|
+
"@tamagui/normalize-css-color": "3.0.0-beta.1648.1",
|
|
111
|
+
"@tamagui/react-native-types": "3.0.0-beta.1648.1",
|
|
112
|
+
"@tamagui/style-grammar": "3.0.0-beta.1648.1",
|
|
113
|
+
"@tamagui/types": "3.0.0-beta.1648.1",
|
|
114
|
+
"@tamagui/use-did-finish-ssr": "3.0.0-beta.1648.1",
|
|
115
|
+
"@tamagui/use-event": "3.0.0-beta.1648.1",
|
|
116
|
+
"@tamagui/use-force-update": "3.0.0-beta.1648.1"
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
|
-
"@tamagui/build": "3.0.0-beta.
|
|
119
|
+
"@tamagui/build": "3.0.0-beta.1648.1",
|
|
120
120
|
"@testing-library/react": "^16.1.0",
|
|
121
121
|
"csstype": "^3.0.10",
|
|
122
122
|
"react": "19.2.3",
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
"react": ">=19",
|
|
130
130
|
"react-dom": "*"
|
|
131
131
|
},
|
|
132
|
-
"releaseSourceCommit": "
|
|
132
|
+
"releaseSourceCommit": "302078aa9222bfff888df41f1679e1179a20b18a"
|
|
133
133
|
}
|
package/src/createTamagui.ts
CHANGED
|
@@ -14,7 +14,11 @@ import {
|
|
|
14
14
|
} from './helpers/createDesignSystem'
|
|
15
15
|
import { scanAllSheets } from './helpers/insertStyleRule'
|
|
16
16
|
import { proxyThemesToParents } from './helpers/proxyThemeToParents'
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
copyAuthoredThemeScheme,
|
|
19
|
+
ensureThemeVariable,
|
|
20
|
+
getAuthoredThemeScheme,
|
|
21
|
+
} from './helpers/themes'
|
|
18
22
|
import { mergeConfigVariablesIntoTheme } from './helpers/configVariables'
|
|
19
23
|
import { configureMedia } from './hooks/useMedia'
|
|
20
24
|
import { parseFont, registerFontVariables } from './insertFont'
|
|
@@ -232,10 +236,7 @@ export function createTamagui<Conf extends CreateTamaguiProps>(
|
|
|
232
236
|
|
|
233
237
|
const themesIn = configIn.themes as ThemesLikeObject
|
|
234
238
|
const dedupedThemes =
|
|
235
|
-
foundThemes ??
|
|
236
|
-
getThemesDeduped(themesIn, tokens.color, configIn.variables, {
|
|
237
|
-
tokensParsed,
|
|
238
|
-
})
|
|
239
|
+
foundThemes ?? getThemesDeduped(themesIn, tokensParsed, configIn.variables)
|
|
239
240
|
const themes = proxyThemesToParents(dedupedThemes, Object.keys(themesIn))
|
|
240
241
|
|
|
241
242
|
return {
|
|
@@ -330,11 +331,8 @@ export function createTamagui<Conf extends CreateTamaguiProps>(
|
|
|
330
331
|
// dedupes the themes if given them via JS config
|
|
331
332
|
function getThemesDeduped(
|
|
332
333
|
themes: ThemesLikeObject,
|
|
333
|
-
|
|
334
|
-
variables?: CreateTamaguiProps['variables']
|
|
335
|
-
variablesCtx?: {
|
|
336
|
-
tokensParsed: TokensParsed
|
|
337
|
-
}
|
|
334
|
+
tokensParsed: TokensParsed,
|
|
335
|
+
variables?: CreateTamaguiProps['variables']
|
|
338
336
|
): DedupedThemes {
|
|
339
337
|
const dedupedThemes: DedupedThemes = []
|
|
340
338
|
const existing = new Map<string, DedupedTheme>()
|
|
@@ -351,11 +349,12 @@ function getThemesDeduped(
|
|
|
351
349
|
const rawTheme = themes[themeName]
|
|
352
350
|
|
|
353
351
|
// dont force referential equality but may need something more consistent than JSON.stringify
|
|
354
|
-
const
|
|
352
|
+
const scheme = getAuthoredThemeScheme(rawTheme)
|
|
353
|
+
const key = JSON.stringify(rawTheme) + scheme
|
|
355
354
|
|
|
356
355
|
// if existing, avoid
|
|
357
|
-
|
|
358
|
-
|
|
356
|
+
const e = existing.get(key)
|
|
357
|
+
if (e) {
|
|
359
358
|
e.names.push(themeName)
|
|
360
359
|
continue
|
|
361
360
|
}
|
|
@@ -363,7 +362,7 @@ function getThemesDeduped(
|
|
|
363
362
|
// ensure each theme object unique for dedupe
|
|
364
363
|
// is ThemeParsed because we call ensureThemeVariable
|
|
365
364
|
// color tokens are spread first as fallbacks, theme values take precedence
|
|
366
|
-
const theme = { ...
|
|
365
|
+
const theme = { ...tokensParsed.color, ...rawTheme } as any as ThemeParsed
|
|
367
366
|
|
|
368
367
|
// parse into variables
|
|
369
368
|
for (const key in theme) {
|
|
@@ -371,16 +370,13 @@ function getThemesDeduped(
|
|
|
371
370
|
ensureThemeVariable(theme, key)
|
|
372
371
|
}
|
|
373
372
|
|
|
373
|
+
copyAuthoredThemeScheme(theme, rawTheme)
|
|
374
|
+
|
|
374
375
|
// custom variables merge into base themes only; sub-themes inherit them
|
|
375
376
|
// via proxyThemesToParents (native) and the CSS cascade (web), so a
|
|
376
377
|
// a ThemeUpdate patch survives sub-theme switches below it
|
|
377
|
-
if (variables &&
|
|
378
|
-
mergeConfigVariablesIntoTheme(
|
|
379
|
-
theme as any,
|
|
380
|
-
themeName,
|
|
381
|
-
variables,
|
|
382
|
-
variablesCtx.tokensParsed
|
|
383
|
-
)
|
|
378
|
+
if (variables && !themeName.includes('_')) {
|
|
379
|
+
mergeConfigVariablesIntoTheme(theme as any, themeName, variables, tokensParsed)
|
|
384
380
|
}
|
|
385
381
|
|
|
386
382
|
// set deduped
|
|
@@ -534,7 +534,6 @@ function contributeProp(
|
|
|
534
534
|
const shouldCheckSkipProps = !noSkip
|
|
535
535
|
const asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag)
|
|
536
536
|
const isTextOrInput = isText || isInput
|
|
537
|
-
const hocParentVariants = isHOC ? parentVariants : undefined
|
|
538
537
|
let keyInit = keyOg
|
|
539
538
|
let valInit = valOg
|
|
540
539
|
|
|
@@ -1008,11 +1007,10 @@ function contributeProp(
|
|
|
1008
1007
|
const shouldPassProp =
|
|
1009
1008
|
(!isStyleProp && isHOC) ||
|
|
1010
1009
|
// is in parent variants
|
|
1011
|
-
(
|
|
1010
|
+
(parentVariants && keyInit in parentVariants) ||
|
|
1012
1011
|
inlineProps?.has(keyInit)
|
|
1013
1012
|
|
|
1014
|
-
const
|
|
1015
|
-
const isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in skipProps))
|
|
1013
|
+
const isHOCShouldPassThrough = isHOC && keyInit in skipProps
|
|
1016
1014
|
|
|
1017
1015
|
const shouldPassThrough = shouldPassProp || isHOCShouldPassThrough
|
|
1018
1016
|
|
|
@@ -1342,8 +1340,10 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1342
1340
|
let frontendContainer: boolean | string | undefined
|
|
1343
1341
|
let frontendContainerType: string | undefined
|
|
1344
1342
|
const processedProps = props
|
|
1345
|
-
|
|
1346
|
-
|
|
1343
|
+
// only variant names determine HOC forwarding; their style values resolve
|
|
1344
|
+
// in the renderer, so this needs no normalized style snapshot.
|
|
1345
|
+
const parentVariants = isHOC
|
|
1346
|
+
? staticConfig.Component?.staticConfig?.variants
|
|
1347
1347
|
: undefined
|
|
1348
1348
|
const defaultProps = asChild ? styleStaticConfig.defaultProps : undefined
|
|
1349
1349
|
const asChildExceptStyleLike =
|
|
@@ -1382,7 +1382,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1382
1382
|
styledContextKeys,
|
|
1383
1383
|
stylePassFlags,
|
|
1384
1384
|
debug,
|
|
1385
|
-
parentStaticConfig,
|
|
1385
|
+
process.env.NODE_ENV === 'development' ? parentStaticConfig : undefined,
|
|
1386
1386
|
defaultProps,
|
|
1387
1387
|
driverAnimations,
|
|
1388
1388
|
driverOutputStyle,
|
|
@@ -3480,7 +3480,12 @@ function emitValue(
|
|
|
3480
3480
|
}
|
|
3481
3481
|
if (typeof raw === 'string' && property === 'background') {
|
|
3482
3482
|
const parts = splitComponents(raw)
|
|
3483
|
-
if (
|
|
3483
|
+
if (
|
|
3484
|
+
parts.length === 1 &&
|
|
3485
|
+
(!startsValueFunction(parts[0]) ||
|
|
3486
|
+
(process.env.TAMAGUI_TARGET === 'native' &&
|
|
3487
|
+
classifyBorderComponents(parts[0]).color))
|
|
3488
|
+
) {
|
|
3484
3489
|
emitResolved(state, 'backgroundColor', parts[0], cursor, originalValue, contextOnly)
|
|
3485
3490
|
return
|
|
3486
3491
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DedupedThemes, ThemeParsed } from '../types'
|
|
2
|
+
import { copyAuthoredThemeScheme } from './themes'
|
|
2
3
|
|
|
3
4
|
const themesRaw: Record<string, ThemeParsed> = {}
|
|
4
5
|
|
|
@@ -58,5 +59,5 @@ export function proxyThemeToParents(themeName: string, theme: ThemeParsed) {
|
|
|
58
59
|
Object.assign(out, themesRaw[parent])
|
|
59
60
|
}
|
|
60
61
|
Object.assign(out, theme)
|
|
61
|
-
return out
|
|
62
|
+
return copyAuthoredThemeScheme(out, theme)
|
|
62
63
|
}
|
package/src/helpers/themes.ts
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { createVariable, isVariable } from '../createVariable'
|
|
2
2
|
|
|
3
|
+
const schemeKey = /* @__PURE__ */ Symbol.for('tamagui.theme.scheme')
|
|
4
|
+
|
|
5
|
+
export function getAuthoredThemeScheme(theme: any): 'light' | 'dark' | undefined {
|
|
6
|
+
const scheme = theme[schemeKey]
|
|
7
|
+
return scheme === 'light' || scheme === 'dark' ? scheme : undefined
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function copyAuthoredThemeScheme<T>(target: T, source: any): T {
|
|
11
|
+
const scheme = getAuthoredThemeScheme(source)
|
|
12
|
+
if (scheme) Object.defineProperty(target, schemeKey, { value: scheme })
|
|
13
|
+
return target
|
|
14
|
+
}
|
|
15
|
+
|
|
3
16
|
// mutates, freeze after
|
|
4
17
|
// shared by createTamagui so extracted here
|
|
5
18
|
export function ensureThemeVariable(theme: any, key: string) {
|
|
6
19
|
const val = theme[key]
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
9
|
-
theme[key] = createVariable({
|
|
10
|
-
key,
|
|
11
|
-
name: key,
|
|
12
|
-
val: value,
|
|
13
|
-
})
|
|
14
|
-
} else if (val.name !== key) {
|
|
15
|
-
// rename to theme name
|
|
20
|
+
const variable = isVariable(val)
|
|
21
|
+
if (!variable || val.name !== key) {
|
|
16
22
|
theme[key] = createVariable({
|
|
17
|
-
key: val.name,
|
|
23
|
+
key: variable ? val.name : key,
|
|
18
24
|
name: key,
|
|
19
|
-
val:
|
|
25
|
+
val: variable ? val.val : val,
|
|
20
26
|
})
|
|
21
27
|
}
|
|
22
28
|
}
|
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
UseThemeWithStateProps,
|
|
19
19
|
} from '../types'
|
|
20
20
|
import type { ThemeUpdateState } from '../helpers/themeUpdateState'
|
|
21
|
+
import { getAuthoredThemeScheme } from '../helpers/themes'
|
|
21
22
|
|
|
22
23
|
type ID = string
|
|
23
24
|
|
|
@@ -110,7 +111,7 @@ export const useThemeState = (
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
const id = useId()
|
|
113
|
-
const propsKey =
|
|
114
|
+
const propsKey = `${props.name || ''}${props.forceClassName || ''}${props._themeUpdate?.key || ''}`
|
|
114
115
|
|
|
115
116
|
if (cascadeOnChange) {
|
|
116
117
|
registerThemeProviderChain(id, parentId, props)
|
|
@@ -119,20 +120,14 @@ export const useThemeState = (
|
|
|
119
120
|
const ref = useRef<ThemeStateRef>(null as any)
|
|
120
121
|
const r = (ref.current ||= {
|
|
121
122
|
id,
|
|
122
|
-
parentId,
|
|
123
|
-
props,
|
|
124
|
-
propsKey,
|
|
125
|
-
isRoot,
|
|
126
|
-
keys,
|
|
127
|
-
schemeKeys,
|
|
128
123
|
optimizeForFirstRender,
|
|
129
124
|
renderVersion: 0,
|
|
130
|
-
})
|
|
125
|
+
} as ThemeStateRef)
|
|
131
126
|
r.props = props
|
|
132
127
|
r.propsKey = propsKey
|
|
133
128
|
r.isRoot = isRoot
|
|
134
129
|
r.keys = keys
|
|
135
|
-
r.schemeKeys = schemeKeys
|
|
130
|
+
if (process.env.TAMAGUI_TARGET === 'native') r.schemeKeys = schemeKeys
|
|
136
131
|
r.parentId = parentId
|
|
137
132
|
r.renderVersion++
|
|
138
133
|
|
|
@@ -153,7 +148,7 @@ export const useThemeState = (
|
|
|
153
148
|
}
|
|
154
149
|
|
|
155
150
|
if (r.unsubscribe && r.subscribedTo !== r.parentId) {
|
|
156
|
-
|
|
151
|
+
r.unsubscribe?.()
|
|
157
152
|
}
|
|
158
153
|
|
|
159
154
|
if (shouldSubscribeToTheme(r, cascadeOnChange)) {
|
|
@@ -189,7 +184,7 @@ export const useThemeState = (
|
|
|
189
184
|
}
|
|
190
185
|
}
|
|
191
186
|
} else if (r.unsubscribe) {
|
|
192
|
-
|
|
187
|
+
r.unsubscribe?.()
|
|
193
188
|
}
|
|
194
189
|
|
|
195
190
|
return () => {
|
|
@@ -250,13 +245,9 @@ const shouldSubscribeToTheme = (r: ThemeStateRef, cascadeOnChange: boolean): boo
|
|
|
250
245
|
r.props.needsUpdate?.()
|
|
251
246
|
)
|
|
252
247
|
|
|
253
|
-
function cleanupThemeSubscription(r: ThemeStateRef) {
|
|
254
|
-
r.unsubscribe?.()
|
|
255
|
-
}
|
|
256
|
-
|
|
257
248
|
function cleanupThemeState(r: ThemeStateRef) {
|
|
258
249
|
if (r.unsubscribe) {
|
|
259
|
-
|
|
250
|
+
r.unsubscribe()
|
|
260
251
|
} else {
|
|
261
252
|
r.state = undefined
|
|
262
253
|
states.delete(r.id)
|
|
@@ -267,16 +258,8 @@ function cleanupThemeState(r: ThemeStateRef) {
|
|
|
267
258
|
}
|
|
268
259
|
|
|
269
260
|
const getSnapshotImpl = (r: SnapshotRef): ThemeState => {
|
|
270
|
-
const {
|
|
271
|
-
|
|
272
|
-
parentId,
|
|
273
|
-
props,
|
|
274
|
-
propsKey,
|
|
275
|
-
isRoot,
|
|
276
|
-
keys,
|
|
277
|
-
schemeKeys,
|
|
278
|
-
optimizeForFirstRender,
|
|
279
|
-
} = r
|
|
261
|
+
const { id, parentId, props, propsKey, isRoot, keys, optimizeForFirstRender } = r
|
|
262
|
+
const schemeKeys = process.env.TAMAGUI_TARGET === 'native' ? r.schemeKeys : undefined
|
|
280
263
|
// useId values repeat across server renders; each hook owns its snapshot.
|
|
281
264
|
let local = r.state
|
|
282
265
|
const parentState = states.get(parentId)
|
|
@@ -302,11 +285,11 @@ const getSnapshotImpl = (r: SnapshotRef): ThemeState => {
|
|
|
302
285
|
local.scheme !== parentState.scheme &&
|
|
303
286
|
getThemeBaseName(local.name) === getThemeBaseName(parentState.name)
|
|
304
287
|
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
288
|
+
const canSkipForSchemeChange = Boolean(
|
|
289
|
+
isSchemeOnlyChange &&
|
|
290
|
+
keys.current?.size &&
|
|
291
|
+
schemeKeys?.current?.size === keys.current.size
|
|
292
|
+
)
|
|
310
293
|
|
|
311
294
|
// forceClassName renders its resolved name as classes, so a nameless one that
|
|
312
295
|
// mirrors its parent still has to re-render when the parent's scheme flips
|
|
@@ -445,7 +428,7 @@ const getNextState = (
|
|
|
445
428
|
}
|
|
446
429
|
|
|
447
430
|
// a same-name pin still introduces its own scope.
|
|
448
|
-
const scheme = getScheme(resolvedName)
|
|
431
|
+
const scheme = getAuthoredThemeScheme(themes[resolvedName]) || getScheme(resolvedName)
|
|
449
432
|
const parentInverses = parentState?.inverses ?? 0
|
|
450
433
|
const isInverse = Boolean(parentState && scheme !== parentState.scheme)
|
|
451
434
|
const inverses = parentInverses + (isInverse ? 1 : 0)
|
|
@@ -556,8 +539,5 @@ export function resolveThemeName(
|
|
|
556
539
|
return found
|
|
557
540
|
}
|
|
558
541
|
|
|
559
|
-
const getPropsKey = ({ name, forceClassName, _themeUpdate }: UseThemeWithStateProps) =>
|
|
560
|
-
`${name || ''}${forceClassName || ''}${_themeUpdate?.key || ''}`
|
|
561
|
-
|
|
562
542
|
export const hasThemeUpdatingProps = (props: UseThemeWithStateProps) =>
|
|
563
543
|
'name' in props || 'forceClassName' in props || '_themeUpdate' in props
|
package/src/internal-runtime.ts
CHANGED
|
@@ -19,7 +19,10 @@ import { getThemeCSSRules as getThemeCSSRulesImpl } from './helpers/getThemeCSSR
|
|
|
19
19
|
import { normalizeValueWithProperty as normalizeValueWithPropertyImpl } from './helpers/normalizeValueWithProperty'
|
|
20
20
|
import { proxyThemeToParents as proxyThemeToParentsImpl } from './helpers/proxyThemeToParents'
|
|
21
21
|
import type { FrontendComponent, StyleFrontend } from './helpers/styleFrontend'
|
|
22
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
copyAuthoredThemeScheme as copyAuthoredThemeSchemeImpl,
|
|
24
|
+
ensureThemeVariable as ensureThemeVariableImpl,
|
|
25
|
+
} from './helpers/themes'
|
|
23
26
|
import { transformsToString as transformsToStringImpl } from './helpers/transformsToString'
|
|
24
27
|
import {
|
|
25
28
|
parseFont as parseFontImpl,
|
|
@@ -59,6 +62,8 @@ export const proxyThemeToParents: (themeName: string, theme: any) => any =
|
|
|
59
62
|
proxyThemeToParentsImpl
|
|
60
63
|
export const ensureThemeVariable: (theme: any, key: string) => void =
|
|
61
64
|
ensureThemeVariableImpl
|
|
65
|
+
export const copyAuthoredThemeScheme: <T>(target: T, source: any) => T =
|
|
66
|
+
copyAuthoredThemeSchemeImpl
|
|
62
67
|
export const transformsToString: (transforms: object[]) => string = transformsToStringImpl
|
|
63
68
|
export const styleToCSS: (style: Record<string, any>) => void = styleToCSSImpl
|
|
64
69
|
export const useThemeWithState: (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,kBAAkB,EAMlB,kBAAkB,EAClB,qBAAqB,EAKtB,MAAM,SAAS,CAAA;AAwDhB,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,qBAAqB,yBAIjE;AAwBD,wBAAgB,aAAa,CAAC,IAAI,SAAS,kBAAkB,EAC3D,QAAQ,EAAE,IAAI,GACb,kBAAkB,CAAC,IAAI,CAAC,CA4M1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EACV,gBAAgB,EAEhB,mBAAmB,EAEnB,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,aAAa,EAGb,eAAe,EACf,YAAY,EAGZ,qBAAqB,EACrB,qBAAqB,EAErB,WAAW,EAGZ,MAAM,UAAU,CAAA;AAkBjB,OAAO,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAKlF,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAqB/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAe3D,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AACvF,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,mBAAmB,CA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gBAAgB,CAAC,EAAE,OAAO,EAC1B,aAAa,CAAC,EAAE,GAAG,KAChB,IAAI,CAAA;AAk4CT,KAAK,oBAAoB,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,IAAI,CAAA;AAgCnF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,oBAAoB,GAAG,IAAI,EACjC,QAAQ,SAAI,EACZ,WAAW,UAAQ,WA4OpB;AA6HD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,aAAa,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,GAAG,EACb,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,OAAO,QAyBlB;AAID,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,sBAgBtF;AAMD,cAAc,mBAAmB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxyThemeToParents.d.ts","sourceRoot":"","sources":["../../src/helpers/proxyThemeToParents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"proxyThemeToParents.d.ts","sourceRoot":"","sources":["../../src/helpers/proxyThemeToParents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAO1D,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAC1B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CA+B7B;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,MAmBxE"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export declare function getAuthoredThemeScheme(theme: any): 'light' | 'dark' | undefined;
|
|
2
|
+
export declare function copyAuthoredThemeScheme<T>(target: T, source: any): T;
|
|
1
3
|
export declare function ensureThemeVariable(theme: any, key: string): void;
|
|
2
4
|
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/helpers/themes.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/helpers/themes.ts"],"names":[],"mappings":"AAIA,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAG/E;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,CAIpE;AAID,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,QAU1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemeState.d.ts","sourceRoot":"","sources":["../../src/hooks/useThemeState.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,OAAO,CAAA;AAId,OAAO,KAAK,EAGV,UAAU,EACV,sBAAsB,EACvB,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"useThemeState.d.ts","sourceRoot":"","sources":["../../src/hooks/useThemeState.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,OAAO,CAAA;AAId,OAAO,KAAK,EAGV,UAAU,EACV,sBAAsB,EACvB,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAGnE,KAAK,EAAE,GAAG,MAAM,CAAA;AAEhB,eAAO,MAAM,iBAAiB,iCAAwB,CAAA;AAWtD,eAAO,MAAM,iBAAiB,YAK7B,CAAA;AAED,eAAO,MAAM,aAAa,OAAQ,EAAE,2BAAmB,CAAA;AAKvD,eAAO,MAAM,mBAAmB,OAAQ,EAAE,iCAA8B,CAAA;AACxE,eAAO,MAAM,sBAAsB,OAAQ,EAAE,uBAAiC,CAAA;AAE9E,eAAO,MAAM,0BAA0B;IACrC,MAAM;IACN,OAAO;CACP,CAAA;AAsBF,eAAO,MAAM,iBAAiB,yBAAuB,CAAA;AAMrD,eAAO,MAAM,aAAa,UACjB,sBAAsB,qCAEvB,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,eAC7B,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,kEAGhD,UAgIF,CAAA;AAqQD,wBAAgB,eAAe,CAC7B,UAAU,oBAAK,EACf,KAAK,EAAE,sBAAsB,EAC7B,WAAW,UAAQ,GAClB,MAAM,GAAG,IAAI,CAuBf;AAED,eAAO,MAAM,qBAAqB,cAA4B,CAAA;AAE9D,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,WAAW,UAAQ,GAClB,MAAM,GAAG,IAAI,CA0Bf;AAED,eAAO,MAAM,qBAAqB,UAAW,sBAAsB,YACM,CAAA"}
|
|
@@ -27,6 +27,7 @@ export declare const getThemeCSSRules: (props: {
|
|
|
27
27
|
export declare const normalizeValueWithProperty: (value: any, property?: string) => any;
|
|
28
28
|
export declare const proxyThemeToParents: (themeName: string, theme: any) => any;
|
|
29
29
|
export declare const ensureThemeVariable: (theme: any, key: string) => void;
|
|
30
|
+
export declare const copyAuthoredThemeScheme: <T>(target: T, source: any) => T;
|
|
30
31
|
export declare const transformsToString: (transforms: object[]) => string;
|
|
31
32
|
export declare const styleToCSS: (style: Record<string, any>) => void;
|
|
32
33
|
export declare const useThemeWithState: (props: any, isRoot?: boolean, forThemeView?: boolean) => [any, any];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-runtime.d.ts","sourceRoot":"","sources":["../src/internal-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAS3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"internal-runtime.d.ts","sourceRoot":"","sources":["../src/internal-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAS3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAkB/E,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AACtF,mBAAmB,wBAAwB,CAAA;AAE3C,eAAO,MAAM,eAAe,EAAE,CAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,UAAU,CAAC,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,OAAO,KACb,GAAgC,CAAA;AACrC,eAAO,MAAM,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,GAA0B,CAAA;AACvF,eAAO,MAAM,qBAAqB,EAAE,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