@tamagui/core 1.0.1-beta.101 → 1.0.1-beta.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ThemeManager.js +9 -3
- package/dist/cjs/ThemeManager.js.map +2 -2
- package/dist/cjs/constants/platform.js +7 -7
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/createComponent.js +16 -16
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createTamagui.js +14 -2
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTheme.js +5 -2
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/helpers/calc.js.map +2 -2
- package/dist/cjs/helpers/createMediaStyle.js +3 -2
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +27 -29
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +7 -7
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/insertStyleRule.js +15 -11
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.js +6 -5
- package/dist/cjs/helpers/matchMedia.js.map +2 -2
- package/dist/cjs/helpers/startTransition.js +32 -0
- package/dist/cjs/helpers/startTransition.js.map +7 -0
- package/dist/cjs/helpers/wrapThemeManagerContext.js +5 -2
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +2 -2
- package/dist/cjs/hooks/getThemeUnwrapped.js +36 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/cjs/hooks/useIsSSR.js +41 -0
- package/dist/cjs/hooks/useIsSSR.js.map +7 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +8 -6
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useTheme.js +17 -21
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/startTransition.js +32 -0
- package/dist/cjs/startTransition.js.map +7 -0
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Slot.js +20 -0
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/esm/ThemeManager.js +9 -3
- package/dist/esm/ThemeManager.js.map +2 -2
- package/dist/esm/constants/platform.js +6 -6
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/createComponent.js +17 -17
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createTamagui.js +14 -2
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createTheme.js +3 -1
- package/dist/esm/createTheme.js.map +2 -2
- package/dist/esm/helpers/calc.js.map +1 -1
- package/dist/esm/helpers/createMediaStyle.js +3 -2
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createShallowUpdate.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +34 -31
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +7 -7
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +14 -10
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/helpers/matchMedia.js +6 -5
- package/dist/esm/helpers/matchMedia.js.map +2 -2
- package/dist/esm/helpers/startTransition.js +6 -0
- package/dist/esm/helpers/startTransition.js.map +7 -0
- package/dist/esm/helpers/wrapThemeManagerContext.js +5 -2
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +2 -2
- package/dist/esm/hooks/getThemeUnwrapped.js +12 -0
- package/dist/esm/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/esm/hooks/useIsSSR.js +18 -0
- package/dist/esm/hooks/useIsSSR.js.map +7 -0
- package/dist/esm/hooks/useIsTouchDevice.js +9 -7
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useTheme.js +16 -20
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/index.js +3 -2
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/startTransition.js +6 -0
- package/dist/esm/startTransition.js.map +7 -0
- package/dist/esm/views/Slot.js +20 -0
- package/dist/esm/views/Slot.js.map +2 -2
- package/package.json +8 -8
- package/types/ThemeManager.d.ts +5 -6
- package/types/ThemeManager.d.ts.map +1 -1
- package/types/constants/platform.d.ts +3 -3
- package/types/constants/platform.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTheme.d.ts +1 -0
- package/types/createTheme.d.ts.map +1 -1
- package/types/helpers/createMediaStyle.d.ts +2 -4
- package/types/helpers/createMediaStyle.d.ts.map +1 -1
- package/types/helpers/createShallowUpdate.d.ts.map +1 -1
- package/types/helpers/createTamaguiProvider.d.ts +0 -1
- package/types/helpers/createTamaguiProvider.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +2 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts +5 -2
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/matchMedia.d.ts +1 -1
- package/types/helpers/matchMedia.d.ts.map +1 -1
- package/types/helpers/startTransition.d.ts +3 -0
- package/types/helpers/startTransition.d.ts.map +1 -0
- package/types/helpers/wrapThemeManagerContext.d.ts +1 -1
- package/types/helpers/wrapThemeManagerContext.d.ts.map +1 -1
- package/types/hooks/getThemeUnwrapped.d.ts +3 -0
- package/types/hooks/getThemeUnwrapped.d.ts.map +1 -0
- package/types/hooks/useIsSSR.d.ts +2 -0
- package/types/hooks/useIsSSR.d.ts.map +1 -0
- package/types/hooks/useIsTouchDevice.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts +6 -10
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/index.d.ts +3 -2
- package/types/index.d.ts.map +1 -1
- package/types/startTransition.d.ts +3 -0
- package/types/startTransition.d.ts.map +1 -0
- package/types/types.d.ts +1 -0
- package/types/types.d.ts.map +1 -1
- package/types/views/Slot.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +0 -1
- package/types/views/ThemeProvider.d.ts.map +1 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
|
-
import { isTouchable, useIsomorphicLayoutEffect } from "../constants/platform";
|
|
2
|
+
import { isSSR, isTouchable, isWeb, useIsomorphicLayoutEffect } from "../constants/platform";
|
|
3
3
|
const useIsTouchDevice = () => {
|
|
4
|
-
const [touchOnly, setTouchOnly] = useState(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const [touchOnly, setTouchOnly] = useState(isTouchable);
|
|
5
|
+
if (isWeb && !isSSR) {
|
|
6
|
+
useIsomorphicLayoutEffect(() => {
|
|
7
|
+
if (isTouchable) {
|
|
8
|
+
setTouchOnly(true);
|
|
9
|
+
}
|
|
10
|
+
}, []);
|
|
11
|
+
}
|
|
10
12
|
return touchOnly;
|
|
11
13
|
};
|
|
12
14
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useIsTouchDevice.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useState } from 'react'\n\nimport { isTouchable, useIsomorphicLayoutEffect } from '../constants/platform'\n\n// ssr friendly\n\nexport const useIsTouchDevice = () => {\n const [touchOnly, setTouchOnly] = useState(false)\n\n
|
|
5
|
-
"mappings": "AAAA;AAEA;AAIO,MAAM,mBAAmB,MAAM;AACpC,QAAM,CAAC,WAAW,gBAAgB,SAAS,
|
|
4
|
+
"sourcesContent": ["import { useState } from 'react'\n\nimport { isSSR, isTouchable, isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\n\n// ssr friendly\n\nexport const useIsTouchDevice = () => {\n const [touchOnly, setTouchOnly] = useState(isTouchable)\n\n if (isWeb && !isSSR) {\n // only ever false on web SSR (env), so run effect conditionally\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useIsomorphicLayoutEffect(() => {\n if (isTouchable) {\n setTouchOnly(true)\n }\n }, [])\n }\n\n return touchOnly\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAEA;AAIO,MAAM,mBAAmB,MAAM;AACpC,QAAM,CAAC,WAAW,gBAAgB,SAAS,WAAW;AAEtD,MAAI,SAAS,CAAC,OAAO;AAGnB,8BAA0B,MAAM;AAC9B,UAAI,aAAa;AACf,qBAAa,IAAI;AAAA,MACnB;AAAA,IACF,GAAG,CAAC,CAAC;AAAA,EACP;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -24,9 +24,10 @@ import { isWeb, useIsomorphicLayoutEffect } from "../constants/platform";
|
|
|
24
24
|
import { areEqualSets } from "../helpers/areEqualSets";
|
|
25
25
|
import { ThemeContext } from "../ThemeContext";
|
|
26
26
|
import { ThemeManager, ThemeManagerContext, emptyManager } from "../ThemeManager";
|
|
27
|
+
import { GetThemeUnwrapped } from "./getThemeUnwrapped";
|
|
27
28
|
import { useConstant } from "./useConstant";
|
|
28
29
|
const useTheme = (themeName, componentName, props, forceUpdate) => {
|
|
29
|
-
const { name, theme, themes, themeManager, className
|
|
30
|
+
const { name, theme, themes, themeManager, className } = useChangeThemeEffect(themeName, componentName, props, forceUpdate);
|
|
30
31
|
if (process.env.NODE_ENV === "development") {
|
|
31
32
|
if ((props == null ? void 0 : props.debug) === "verbose") {
|
|
32
33
|
console.log(" \xBB useTheme", { themeName, componentName, name, className });
|
|
@@ -66,19 +67,11 @@ const useTheme = (themeName, componentName, props, forceUpdate) => {
|
|
|
66
67
|
return Reflect.has(theme, key);
|
|
67
68
|
},
|
|
68
69
|
get(_, key) {
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
if (process.env.NODE_ENV === "development" && (props == null ? void 0 : props.debug) && typeof window !== "undefined") {
|
|
72
|
-
console.log(">>", { themeName, didChangeTheme, name, componentName }, themeManager);
|
|
73
|
-
}
|
|
74
|
-
if (!didChangeTheme)
|
|
75
|
-
return null;
|
|
76
|
-
return themeManager;
|
|
77
|
-
}
|
|
78
|
-
return Reflect.get(_, key);
|
|
70
|
+
if (key === GetThemeUnwrapped) {
|
|
71
|
+
return theme;
|
|
79
72
|
}
|
|
80
|
-
if (
|
|
81
|
-
return
|
|
73
|
+
if (key === GetThemeManager) {
|
|
74
|
+
return themeManager;
|
|
82
75
|
}
|
|
83
76
|
if (key === "name") {
|
|
84
77
|
return name;
|
|
@@ -86,6 +79,9 @@ const useTheme = (themeName, componentName, props, forceUpdate) => {
|
|
|
86
79
|
if (key === "className") {
|
|
87
80
|
return className;
|
|
88
81
|
}
|
|
82
|
+
if (!name || key === "__proto__" || typeof key === "symbol" || key === "$typeof") {
|
|
83
|
+
return Reflect.get(_, key);
|
|
84
|
+
}
|
|
89
85
|
if (!themeManager) {
|
|
90
86
|
console.error("No themeManager");
|
|
91
87
|
return;
|
|
@@ -107,11 +103,13 @@ const useTheme = (themeName, componentName, props, forceUpdate) => {
|
|
|
107
103
|
}
|
|
108
104
|
}
|
|
109
105
|
});
|
|
110
|
-
}, [name, theme, className
|
|
106
|
+
}, [name, theme, className]);
|
|
111
107
|
};
|
|
112
|
-
const GetThemeManager = Symbol(
|
|
113
|
-
const
|
|
114
|
-
|
|
108
|
+
const GetThemeManager = Symbol();
|
|
109
|
+
const getThemeManager = (theme) => {
|
|
110
|
+
if (!theme)
|
|
111
|
+
return;
|
|
112
|
+
return theme[GetThemeManager];
|
|
115
113
|
};
|
|
116
114
|
const useThemeName = (opts) => {
|
|
117
115
|
const parent = useContext(ThemeManagerContext);
|
|
@@ -162,18 +160,16 @@ const useChangeThemeEffect = (name, componentName, props, forceUpdateProp) => {
|
|
|
162
160
|
});
|
|
163
161
|
}, [themes, name, componentName, debug, next == null ? void 0 : next.name]);
|
|
164
162
|
}
|
|
165
|
-
const didChangeTheme = next && parentManager && next.name !== parentManager.fullName;
|
|
166
163
|
return __spreadProps(__spreadValues(__spreadValues({}, parentManager && {
|
|
167
164
|
name: parentManager.name,
|
|
168
165
|
theme: parentManager.theme
|
|
169
166
|
}), next), {
|
|
170
|
-
didChangeTheme,
|
|
171
167
|
themes,
|
|
172
168
|
themeManager
|
|
173
169
|
});
|
|
174
170
|
};
|
|
175
171
|
export {
|
|
176
|
-
|
|
172
|
+
getThemeManager,
|
|
177
173
|
useChangeThemeEffect,
|
|
178
174
|
useDefaultThemeName,
|
|
179
175
|
useTheme,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useTheme.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useForceUpdate } from '@tamagui/use-force-update'\nimport React, { useContext, useLayoutEffect, useMemo, useRef, useState } from 'react'\n\nimport { getConfig } from '../conf'\nimport { isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\nimport { areEqualSets } from '../helpers/areEqualSets'\nimport { ThemeContext } from '../ThemeContext'\nimport { GetNextThemeProps, ThemeManager, ThemeManagerContext, emptyManager } from '../ThemeManager'\nimport { ThemeName, ThemeObject } from '../types'\nimport { useConstant } from './useConstant'\n\nexport type ThemeProps = {\n className?: string\n disableThemeClass?: boolean\n name: Exclude<ThemeName, number> | null\n componentName?: string\n children?: any\n reset?: boolean\n debug?: boolean | 'verbose'\n}\n\ntype UseThemeState = {\n uuid: Object\n keys: Set<string>\n isRendering: boolean\n}\n\nexport const useTheme = (\n themeName?: string | null,\n componentName?: string,\n props?: ThemeProps,\n forceUpdate?: any\n): ThemeObject => {\n const { name, theme, themes, themeManager, className
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAkBO,MAAM,WAAW,CACtB,WACA,eACA,OACA,gBACgB;AAChB,QAAM,EAAE,MAAM,OAAO,QAAQ,cAAc,
|
|
4
|
+
"sourcesContent": ["import { useForceUpdate } from '@tamagui/use-force-update'\nimport React, { useContext, useLayoutEffect, useMemo, useRef, useState } from 'react'\n\nimport { getConfig } from '../conf'\nimport { isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\nimport { areEqualSets } from '../helpers/areEqualSets'\nimport { ThemeContext } from '../ThemeContext'\nimport { GetNextThemeProps, ThemeManager, ThemeManagerContext, emptyManager } from '../ThemeManager'\nimport { ThemeName, ThemeObject } from '../types'\nimport { GetThemeUnwrapped } from './getThemeUnwrapped'\nimport { useConstant } from './useConstant'\n\nexport type ThemeProps = {\n className?: string\n disableThemeClass?: boolean\n name: Exclude<ThemeName, number> | null\n componentName?: string\n children?: any\n reset?: boolean\n debug?: boolean | 'verbose'\n}\n\ntype UseThemeState = {\n uuid: Object\n keys: Set<string>\n isRendering: boolean\n}\n\nexport const useTheme = (\n themeName?: string | null,\n componentName?: string,\n props?: ThemeProps,\n forceUpdate?: any\n): ThemeObject => {\n const { name, theme, themes, themeManager, className } = useChangeThemeEffect(\n themeName,\n componentName,\n props,\n forceUpdate\n )\n\n if (process.env.NODE_ENV === 'development') {\n if (props?.debug === 'verbose') {\n console.log(' \u00BB useTheme', { themeName, componentName, name, className })\n }\n }\n\n const state = useRef() as React.MutableRefObject<UseThemeState>\n if (!state.current) {\n state.current = {\n uuid: {},\n keys: new Set(),\n isRendering: true,\n }\n }\n state.current.isRendering = true\n\n // track usage\n useIsomorphicLayoutEffect(() => {\n const st = state.current\n st.isRendering = false\n const cur = themeManager?.keys.get(st.uuid)\n if (!cur || !areEqualSets(st.keys, cur)) {\n themeManager?.track(st.uuid, st.keys)\n }\n })\n\n return useMemo(() => {\n if (!theme) {\n if (process.env.NODE_ENV === 'development') {\n console.warn('No theme', { themeName, theme, componentName, className })\n }\n return themes[getConfig().defaultTheme || 'light' || Object.keys(themes)[0]]\n }\n return new Proxy(theme, {\n has(_, key) {\n if (typeof key === 'string') {\n if (key[0] === '$') {\n key = key.slice(1)\n }\n }\n return Reflect.has(theme, key)\n },\n get(_, key) {\n if (key === GetThemeUnwrapped) {\n return theme\n }\n if (key === GetThemeManager) {\n return themeManager\n }\n if (key === 'name') {\n return name\n }\n if (key === 'className') {\n return className\n }\n if (!name || key === '__proto__' || typeof key === 'symbol' || key === '$typeof') {\n return Reflect.get(_, key)\n }\n if (!themeManager) {\n console.error('No themeManager')\n return\n }\n // auto convert variables to plain\n if (key[0] === '$') {\n key = key.slice(1)\n }\n const val = themeManager.getValue(key)\n if (val) {\n if (state.current.isRendering) {\n state.current.keys.add(key)\n if (process.env.NODE_ENV === 'development') {\n if (props?.['debug'] === 'verbose') {\n console.log(' \u00BB tracking theme key', key)\n }\n }\n }\n return val\n }\n },\n })\n }, [name, theme, className])\n}\n\nconst GetThemeManager = Symbol()\n\nexport const getThemeManager = (theme: any): ThemeManager | undefined => {\n if (!theme) return\n return theme[GetThemeManager]\n}\n\nexport const useThemeName = (opts?: { parent?: true }) => {\n const parent = useContext(ThemeManagerContext)\n const [name, setName] = useState(parent?.name || '')\n\n useIsomorphicLayoutEffect(() => {\n if (!parent) return\n return parent.onChangeTheme((next, manager) => {\n const name = opts?.parent ? manager.parentName || next : next\n if (!name) return\n setName(name)\n })\n }, [parent])\n\n return name\n}\n\nexport const useDefaultThemeName = () => {\n return useContext(ThemeContext)?.defaultTheme\n}\n\nexport const useChangeThemeEffect = (\n name?: string | null,\n componentName?: string,\n props?: ThemeProps,\n forceUpdateProp?: any\n) => {\n const debug = props && props['debug']\n const parentManager = useContext(ThemeManagerContext) || emptyManager\n const { themes } = useContext(ThemeContext)!\n const reset = props?.reset || false\n const getThemeProps: GetNextThemeProps = { name, componentName, themes, reset }\n const next = parentManager.getNextTheme(getThemeProps, debug)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const forceUpdate = forceUpdateProp || useForceUpdate()\n const themeManager = useConstant<ThemeManager | null>(() => {\n if (!next) return null\n return new ThemeManager(next.name, next.theme, parentManager, reset)\n })\n\n if (!isWeb || typeof document !== 'undefined') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(() => {\n if (!themeManager) return\n if (next?.name) {\n themeManager.update(next)\n }\n return parentManager.onChangeTheme(() => {\n const next = parentManager.getNextTheme(getThemeProps, debug)\n if (!next) return\n if (themeManager.update(next)) {\n forceUpdate()\n }\n })\n }, [themes, name, componentName, debug, next?.name])\n }\n\n return {\n ...(parentManager && {\n name: parentManager.name,\n theme: parentManager.theme,\n }),\n ...next,\n themes,\n themeManager,\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAkBO,MAAM,WAAW,CACtB,WACA,eACA,OACA,gBACgB;AAChB,QAAM,EAAE,MAAM,OAAO,QAAQ,cAAc,cAAc,qBACvD,WACA,eACA,OACA,WACF;AAEA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,gCAAO,WAAU,WAAW;AAC9B,cAAQ,IAAI,mBAAgB,EAAE,WAAW,eAAe,MAAM,UAAU,CAAC;AAAA,IAC3E;AAAA,EACF;AAEA,QAAM,QAAQ,OAAO;AACrB,MAAI,CAAC,MAAM,SAAS;AAClB,UAAM,UAAU;AAAA,MACd,MAAM,CAAC;AAAA,MACP,MAAM,oBAAI,IAAI;AAAA,MACd,aAAa;AAAA,IACf;AAAA,EACF;AACA,QAAM,QAAQ,cAAc;AAG5B,4BAA0B,MAAM;AAC9B,UAAM,KAAK,MAAM;AACjB,OAAG,cAAc;AACjB,UAAM,MAAM,6CAAc,KAAK,IAAI,GAAG;AACtC,QAAI,CAAC,OAAO,CAAC,aAAa,GAAG,MAAM,GAAG,GAAG;AACvC,mDAAc,MAAM,GAAG,MAAM,GAAG;AAAA,IAClC;AAAA,EACF,C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;AAAA,MAC1B;AACA,aAAO,cAAc,cAAc,MAAM;AACvC,cAAM,QAAO,cAAc,aAAa,eAAe,KAAK;AAC5D,YAAI,CAAC;AAAM;AACX,YAAI,aAAa,OAAO,KAAI,GAAG;AAC7B,sBAAY;AAAA,QACd;AAAA,MACF,CAAC;AAAA,IACH,GAAG,CAAC,QAAQ,MAAM,eAAe,OAAO,6BAAM,IAAI,CAAC;AAAA,EACrD;AAEA,SAAO,gDACD,iBAAiB;AAAA,IACnB,MAAM,cAAc;AAAA,IACpB,OAAO,cAAc;AAAA,EACvB,IACG,OALE;AAAA,IAML;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -30,6 +30,7 @@ export * from "./helpers/isObj";
|
|
|
30
30
|
export * from "./helpers/isTamaguiElement";
|
|
31
31
|
export * from "./helpers/isTamaguiComponent";
|
|
32
32
|
export * from "./helpers/matchMedia";
|
|
33
|
+
export * from "./helpers/startTransition";
|
|
33
34
|
export * from "./helpers/themeable";
|
|
34
35
|
export * from "./helpers/withStaticProperties";
|
|
35
36
|
export * from "./contexts/ButtonInsideButtonContext";
|
|
@@ -40,9 +41,8 @@ export * from "./hooks/useIsTouchDevice";
|
|
|
40
41
|
export * from "./hooks/useMedia";
|
|
41
42
|
export * from "./hooks/usePressable";
|
|
42
43
|
export * from "./hooks/useTheme";
|
|
43
|
-
export * from "./hooks/
|
|
44
|
+
export * from "./hooks/useIsSSR";
|
|
44
45
|
export * from "./hooks/useUnmountEffect";
|
|
45
|
-
export * from "./hooks/useEvent";
|
|
46
46
|
export * from "./views/Slot";
|
|
47
47
|
export * from "./views/Stack";
|
|
48
48
|
export * from "./views/Text";
|
|
@@ -52,6 +52,7 @@ export * from "./views/ThemeInverse";
|
|
|
52
52
|
export * from "./views/ThemeProvider";
|
|
53
53
|
export * from "./views/ThemeReset";
|
|
54
54
|
export * from "@tamagui/use-force-update";
|
|
55
|
+
export * from "@tamagui/use-event";
|
|
55
56
|
export * from "@tamagui/helpers";
|
|
56
57
|
export {
|
|
57
58
|
TextAncestorContext,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './Tamagui'\nexport * from './createComponent'\nexport * from './createShorthands'\nexport * from './createTheme'\nexport * from './createTamagui'\nexport * from './createFont'\nexport * from './createTokens'\nexport * from './createVariable'\nexport * from './createVariables'\nexport * from './insertFont'\nexport * from './styled'\nexport * from './types'\n// for type portability\nexport type { RNWTextProps, RNWViewProps } from './types-rnw'\nexport { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './conf'\n\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport { createDOMProps } from '@tamagui/rnw'\n\nexport * from './helpers/calc'\nexport * from './helpers/createShallowUpdate'\nexport * from './helpers/getStackSize'\nexport * from './helpers/getVariantExtras'\nexport * from './helpers/getExpandedShorthands'\nexport * from './helpers/getSize'\nexport * from './helpers/getSplitStyles'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/pseudoDescriptors'\nexport * from './helpers/mergeProps'\nexport * from './helpers/expandStyles'\nexport * from './helpers/getFont'\nexport * from './helpers/isObj'\nexport * from './helpers/isTamaguiElement'\nexport * from './helpers/isTamaguiComponent'\nexport * from './helpers/matchMedia'\nexport * from './helpers/themeable'\nexport * from './helpers/withStaticProperties'\n\nexport * from './contexts/ButtonInsideButtonContext'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/useId'\nexport * from './hooks/useIsMounted'\nexport * from './hooks/useIsTouchDevice'\nexport * from './hooks/useMedia'\nexport * from './hooks/usePressable'\nexport * from './hooks/useTheme'\nexport * from './hooks/
|
|
5
|
-
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["export * from './Tamagui'\nexport * from './createComponent'\nexport * from './createShorthands'\nexport * from './createTheme'\nexport * from './createTamagui'\nexport * from './createFont'\nexport * from './createTokens'\nexport * from './createVariable'\nexport * from './createVariables'\nexport * from './insertFont'\nexport * from './styled'\nexport * from './types'\n// for type portability\nexport type { RNWTextProps, RNWViewProps } from './types-rnw'\nexport { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './conf'\n\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport { createDOMProps } from '@tamagui/rnw'\n\nexport * from './helpers/calc'\nexport * from './helpers/createShallowUpdate'\nexport * from './helpers/getStackSize'\nexport * from './helpers/getVariantExtras'\nexport * from './helpers/getExpandedShorthands'\nexport * from './helpers/getSize'\nexport * from './helpers/getSplitStyles'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/pseudoDescriptors'\nexport * from './helpers/mergeProps'\nexport * from './helpers/expandStyles'\nexport * from './helpers/getFont'\nexport * from './helpers/isObj'\nexport * from './helpers/isTamaguiElement'\nexport * from './helpers/isTamaguiComponent'\nexport * from './helpers/matchMedia'\nexport * from './helpers/startTransition'\nexport * from './helpers/themeable'\nexport * from './helpers/withStaticProperties'\n\nexport * from './contexts/ButtonInsideButtonContext'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/useId'\nexport * from './hooks/useIsMounted'\nexport * from './hooks/useIsTouchDevice'\nexport * from './hooks/useMedia'\nexport * from './hooks/usePressable'\nexport * from './hooks/useTheme'\nexport * from './hooks/useIsSSR'\nexport * from './hooks/useUnmountEffect'\n\nexport * from './views/Slot'\nexport * from './views/Stack'\nexport * from './views/Text'\nexport { TextAncestorProvider, TextAncestorContext } from './views/TextAncestorContext'\nexport * from './views/Theme'\nexport * from './views/ThemeInverse'\nexport * from './views/ThemeProvider'\nexport * from './views/ThemeReset'\n\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/use-event'\nexport * from '@tamagui/helpers'\n"],
|
|
5
|
+
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/startTransition.ts"],
|
|
4
|
+
"sourcesContent": ["import React from 'react'\n\n// backwards compat\nexport const startTransition = React.startTransition || ((cb) => cb())\n"],
|
|
5
|
+
"mappings": "AAAA;AAGO,MAAM,kBAAkB,MAAM,mBAAoB,EAAC,OAAO,GAAG;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/views/Slot.js
CHANGED
|
@@ -34,6 +34,23 @@ import * as React from "react";
|
|
|
34
34
|
import { isWeb } from "../constants/platform";
|
|
35
35
|
const Slot = React.forwardRef((props, forwardedRef) => {
|
|
36
36
|
const _a = props, { children } = _a, slotProps = __objRest(_a, ["children"]);
|
|
37
|
+
const childrenArray = React.Children.toArray(children);
|
|
38
|
+
const slottable = childrenArray.find(isSlottable);
|
|
39
|
+
if (slottable) {
|
|
40
|
+
const newElement = slottable.props.children;
|
|
41
|
+
const newChildren = childrenArray.map((child) => {
|
|
42
|
+
if (child === slottable) {
|
|
43
|
+
if (React.Children.count(newElement) > 1)
|
|
44
|
+
return React.Children.only(null);
|
|
45
|
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
46
|
+
} else {
|
|
47
|
+
return child;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return /* @__PURE__ */ React.createElement(SlotClone, __spreadProps(__spreadValues({}, slotProps), {
|
|
51
|
+
ref: forwardedRef
|
|
52
|
+
}), React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null);
|
|
53
|
+
}
|
|
37
54
|
return /* @__PURE__ */ React.createElement(SlotClone, __spreadProps(__spreadValues({}, slotProps), {
|
|
38
55
|
ref: forwardedRef
|
|
39
56
|
}), children);
|
|
@@ -53,6 +70,9 @@ SlotClone.displayName = "SlotClone";
|
|
|
53
70
|
const Slottable = ({ children }) => {
|
|
54
71
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
55
72
|
};
|
|
73
|
+
function isSlottable(child) {
|
|
74
|
+
return React.isValidElement(child) && child.type === Slottable;
|
|
75
|
+
}
|
|
56
76
|
const pressMap = isWeb ? {
|
|
57
77
|
onPress: "onClick",
|
|
58
78
|
onPressOut: "onMouseUp",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Slot.tsx"],
|
|
4
|
-
"sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\nimport { isWeb } from '../constants/platform'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: React.ReactNode\n}\n\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode\n}\n\nconst SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.isValidElement(children)) {\n const childProps = {\n ...mergeProps(children, slotProps),\n ref: composeRefs(forwardedRef, (children as any).ref),\n }\n return React.cloneElement(children, childProps)\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AAEA;AAUO,MAAM,OAAO,MAAM,WAAmC,CAAC,OAAO,iBAAiB;AACpF,QAAmC,YAA3B,eAA2B,IAAd,sBAAc,IAAd,CAAb;AACR,SACE,oCAAC,4CAAc,YAAd;AAAA,IAAyB,KAAK;AAAA,MAC5B,QACH;AAEJ,CAAC;AAED,KAAK,cAAc;AAUnB,MAAM,YAAY,MAAM,WAAgC,CAAC,OAAO,iBAAiB;AAC/E,QAAmC,YAA3B,eAA2B,IAAd,sBAAc,IAAd,CAAb;AAER,MAAI,MAAM,eAAe,QAAQ,GAAG;AAClC,UAAM,aAAa,iCACd,WAAW,UAAU,SAAS,IADhB;AAAA,MAEjB,KAAK,YAAY,cAAe,SAAiB,GAAG;AAAA,IACtD;AACA,WAAO,MAAM,aAAa,UAAU,UAAU;AAAA,EAChD;AAEA,SAAO,MAAM,SAAS,MAAM,QAAQ,IAAI,IAAI,MAAM,SAAS,KAAK,IAAI,IAAI;AAC1E,CAAC;AAED,UAAU,cAAc;AAMjB,MAAM,YAAY,CAAC,EAAE,eAA8C;AACxE,SAAO,0DAAG,QAAS;AACrB;
|
|
4
|
+
"sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\nimport { isWeb } from '../constants/platform'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: React.ReactNode\n}\n\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n const childrenArray = React.Children.toArray(children)\n const slottable = childrenArray.find(isSlottable)\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children as React.ReactNode\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null)\n return React.isValidElement(newElement)\n ? (newElement.props.children as React.ReactNode)\n : null\n } else {\n return child\n }\n })\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n )\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode\n}\n\nconst SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.isValidElement(children)) {\n const childProps = {\n ...mergeProps(children, slotProps),\n ref: composeRefs(forwardedRef, (children as any).ref),\n }\n return React.cloneElement(children, childProps)\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n return React.isValidElement(child) && child.type === Slottable\n}\n\nconst pressMap = isWeb\n ? {\n onPress: 'onClick',\n onPressOut: 'onMouseUp',\n onPressIn: 'onMouseDown',\n }\n : {}\n\nfunction mergeProps(child: any, slotProps: AnyProps) {\n const childProps = child.props\n\n // all child props should override\n const overrideProps = { ...childProps }\n const isHTMLChild = typeof child.type === 'string'\n\n if (isHTMLChild) {\n for (const key in pressMap) {\n if (key in slotProps) {\n slotProps[pressMap[key]] = slotProps[key]\n delete slotProps[key]\n }\n }\n }\n\n for (let propName in childProps) {\n const slotPropValue = slotProps[propName]\n const childPropValue = childProps[propName]\n\n if (isHTMLChild && pressMap[propName]) {\n propName = pressMap[propName]\n delete overrideProps[propName]\n }\n\n const isHandler = handleRegex.test(propName)\n // if it's a handler, modify the override by composing the base handler\n if (isHandler) {\n overrideProps[propName] = mergeEvent(childPropValue, slotPropValue)\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue }\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ')\n }\n }\n\n return { ...slotProps, ...overrideProps }\n}\n\nconst handleRegex = /^on[A-Z]/\n\nexport function mergeEvent(a?: Function, b?: Function) {\n return (...args: unknown[]) => {\n a?.(...args)\n b?.(...args)\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AAEA;AAUO,MAAM,OAAO,MAAM,WAAmC,CAAC,OAAO,iBAAiB;AACpF,QAAmC,YAA3B,eAA2B,IAAd,sBAAc,IAAd,CAAb;AACR,QAAM,gBAAgB,MAAM,SAAS,QAAQ,QAAQ;AACrD,QAAM,YAAY,cAAc,KAAK,WAAW;AAEhD,MAAI,WAAW;AAEb,UAAM,aAAa,UAAU,MAAM;AAEnC,UAAM,cAAc,cAAc,IAAI,CAAC,UAAU;AAC/C,UAAI,UAAU,WAAW;AAGvB,YAAI,MAAM,SAAS,MAAM,UAA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U,SAAS,QAAQ,UAAU;AACrC,eAAO,UAAU;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAEA,WAAS,YAAY,YAAY;AAC/B,UAAM,gBAAgB,UAAU;AAChC,UAAM,iBAAiB,WAAW;AAElC,QAAI,eAAe,SAAS,WAAW;AACrC,iBAAW,SAAS;AACpB,aAAO,cAAc;AAAA,IACvB;AAEA,UAAM,YAAY,YAAY,KAAK,QAAQ;AAE3C,QAAI,WAAW;AACb,oBAAc,YAAY,WAAW,gBAAgB,aAAa;AAAA,IACpE,WAES,aAAa,SAAS;AAC7B,oBAAc,YAAY,kCAAK,gBAAkB;AAAA,IACnD,WAAW,aAAa,aAAa;AACnC,oBAAc,YAAY,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,kCAAK,YAAc;AAC5B;AAEA,MAAM,cAAc;AAEb,oBAAoB,GAAc,GAAc;AACrD,SAAO,IAAI,SAAoB;AAC7B,2BAAI,GAAG;AACP,2BAAI,GAAG;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.104",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@expo/match-media": "^0.3.0",
|
|
24
|
-
"@tamagui/compose-refs": "^1.0.1-beta.
|
|
25
|
-
"@tamagui/helpers": "^1.0.1-beta.
|
|
24
|
+
"@tamagui/compose-refs": "^1.0.1-beta.104",
|
|
25
|
+
"@tamagui/helpers": "^1.0.1-beta.104",
|
|
26
26
|
"@tamagui/ow": "^0.28.1",
|
|
27
|
-
"@tamagui/rnw": "^1.0.1-beta.
|
|
28
|
-
"@tamagui/use-debounce": "^1.0.1-beta.
|
|
29
|
-
"@tamagui/use-event": "^1.0.1-beta.
|
|
30
|
-
"@tamagui/use-force-update": "^1.0.1-beta.
|
|
27
|
+
"@tamagui/rnw": "^1.0.1-beta.104",
|
|
28
|
+
"@tamagui/use-debounce": "^1.0.1-beta.104",
|
|
29
|
+
"@tamagui/use-event": "^1.0.1-beta.104",
|
|
30
|
+
"@tamagui/use-force-update": "^1.0.1-beta.104",
|
|
31
31
|
"expo-screen-orientation": "^4.2.0",
|
|
32
32
|
"hyphenate-style-name": "^1.0.4",
|
|
33
33
|
"normalize-css-color": "^1.0.2",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react-native-web": "*"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
41
|
+
"@tamagui/build": "^1.0.1-beta.104",
|
|
42
42
|
"@types/react": "^18.0.14",
|
|
43
43
|
"csstype": "^3.0.10",
|
|
44
44
|
"esbuild": "^0.14.48",
|
package/types/ThemeManager.d.ts
CHANGED
|
@@ -23,22 +23,21 @@ export declare class ThemeManager {
|
|
|
23
23
|
themeListeners: Set<ThemeListener>;
|
|
24
24
|
className: string | null;
|
|
25
25
|
constructor(name?: string, theme?: ThemeObject | null, parentManager?: ThemeManager | null, reset?: boolean);
|
|
26
|
+
get didChangeTheme(): boolean | null;
|
|
26
27
|
get parentName(): string | null;
|
|
27
28
|
get fullName(): string;
|
|
28
29
|
getValue(key: string): import("./types").VariableVal | undefined;
|
|
29
30
|
update({ name, theme, className }?: SetActiveThemeProps): boolean;
|
|
30
31
|
getNextTheme(props?: GetNextThemeProps, debug?: any): {
|
|
31
|
-
name: string;
|
|
32
|
-
theme: Partial<import("./types").TamaguiBaseTheme> & {
|
|
33
|
-
[key: string]: import("./types").VariableVal;
|
|
34
|
-
};
|
|
35
|
-
className: string;
|
|
36
|
-
} | {
|
|
37
32
|
name: string;
|
|
38
33
|
theme: (Partial<import("./types").TamaguiBaseTheme> & {
|
|
39
34
|
[key: string]: import("./types").VariableVal;
|
|
40
35
|
}) | null;
|
|
41
36
|
className?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
name: string;
|
|
39
|
+
theme: any;
|
|
40
|
+
className: string;
|
|
42
41
|
};
|
|
43
42
|
getClassName(name: string): string;
|
|
44
43
|
track(uuid: any, keys: Set<string>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeManager.d.ts","sourceRoot":"","sources":["../src/ThemeManager.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ThemeManager.d.ts","sourceRoot":"","sources":["../src/ThemeManager.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAE7C,aAAK,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,YAAY,EAAE,YAAY,KAAK,IAAI,CAAA;AAE9E,oBAAY,mBAAmB,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,GAAG,CAAA;CACZ,CAAA;AAED,oBAAY,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,qBAAa,YAAY;IAOd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,WAAW,GAAG,IAAI;IACzB,aAAa,EAAE,YAAY,GAAG,IAAI;IAClC,KAAK,EAAE,OAAO;IATvB,IAAI,wBAA8B;IAClC,SAAS,qBAA2B;IACpC,cAAc,qBAA2B;IACzC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAO;gBAGtB,IAAI,GAAE,MAAW,EACjB,KAAK,GAAE,WAAW,GAAG,IAAW,EAChC,aAAa,GAAE,YAAY,GAAG,IAAW,EACzC,KAAK,GAAE,OAAe;IAqB/B,IAAI,cAAc,mBAEjB;IAED,IAAI,UAAU,kBAEb;IAED,IAAI,QAAQ,IAAI,MAAM,CAMrB;IAGD,QAAQ,CAAC,GAAG,EAAE,MAAM;IAmBpB,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,GAAE,mBAAwB;IAa3D,YAAY,CAAC,KAAK,GAAE,iBAAsB,EAAE,KAAK,CAAC,EAAE,GAAG;;;;;;;;;;;IAsFvD,YAAY,CAAC,IAAI,EAAE,MAAM;IAIzB,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC;IAKlC,eAAe;IAYf,aAAa,CAAC,EAAE,EAAE,aAAa;IAO/B,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ;CAOjC;AAED,eAAO,MAAM,mBAAmB,8CAA2C,CAAA;AAC3E,eAAO,MAAM,YAAY,cAAqB,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
2
|
export declare const isAndroid: boolean;
|
|
3
3
|
export declare const isIOS: boolean;
|
|
4
4
|
export declare const isWeb: boolean;
|
|
5
|
+
export declare const isWindowDefined: boolean;
|
|
5
6
|
export declare const isSSR: boolean;
|
|
6
7
|
export declare const isClient: boolean;
|
|
7
|
-
export declare const useIsomorphicLayoutEffect: typeof
|
|
8
|
+
export declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
8
9
|
export declare const isChrome: boolean;
|
|
9
10
|
export declare const isWebTouchable: boolean;
|
|
10
11
|
export declare const isTouchable: boolean;
|
|
11
|
-
export declare const isWebIOS: boolean;
|
|
12
12
|
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/constants/platform.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/constants/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAA;AAGlD,eAAO,MAAM,SAAS,SAA6B,CAAA;AACnD,eAAO,MAAM,KAAK,SAAyB,CAAA;AAC3C,eAAO,MAAM,KAAK,SAAuC,CAAA;AACzD,eAAO,MAAM,eAAe,SAAgC,CAAA;AAC5D,eAAO,MAAM,KAAK,SAA4B,CAAA;AAC9C,eAAO,MAAM,QAAQ,SAA2B,CAAA;AAChD,eAAO,MAAM,yBAAyB,kBAAsC,CAAA;AAC5E,eAAO,MAAM,QAAQ,SAA+E,CAAA;AACpG,eAAO,MAAM,cAAc,SAAuC,CAAA;AAClE,eAAO,MAAM,WAAW,SAA2B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AASA,OAAO,KAWN,MAAM,OAAO,CAAA;AAqBd,OAAO,EACL,cAAc,EACd,WAAW,EACX,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAGhB,cAAc,EAGf,MAAM,SAAS,CAAA;AAgBhB,eAAO,MAAM,QAAQ,eAAsB,CAAA;AA0B3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,GAAG,EAAE,EACtC,GAAG,GAAG,cAAc,EACpB,SAAS,GAAG,KAAK,EACjB,QAAQ,EAAE,OAA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AO,CACpF,mBAAmB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAC1E,GACG,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GACvC,OAAO,CAAA;AAEX,wBAAgB,aAAa,CAAC,IAAI,SAAS,kBAAkB,EAC3D,MAAM,EAAE,IAAI,GACX,kBAAkB,CAAC,IAAI,CAAC,CA+Q1B;AAED,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,CAAA"}
|
package/types/createTheme.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Variable } from './createVariable';
|
|
|
2
2
|
declare type GenericTheme = {
|
|
3
3
|
[key: string]: string | Variable;
|
|
4
4
|
};
|
|
5
|
+
export declare const themeToVariableToValueMap: WeakMap<any, Record<string, string>>;
|
|
5
6
|
export declare const createTheme: <Theme extends GenericTheme>(theme: Theme) => { [K in keyof Theme]: string | Variable<any> | Theme[K]; };
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=createTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.d.ts","sourceRoot":"","sources":["../src/createTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,aAAK,YAAY,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAA;AAExD,eAAO,MAAM,WAAW,0GAMvB,CAAA"}
|
|
1
|
+
{"version":3,"file":"createTheme.d.ts","sourceRoot":"","sources":["../src/createTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,aAAK,YAAY,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAA;AAExD,eAAO,MAAM,yBAAyB,sCAA6C,CAAA;AAEnF,eAAO,MAAM,WAAW,0GAMvB,CAAA"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { StyleObject } from '@tamagui/helpers';
|
|
2
2
|
import { MediaQueries } from '../types';
|
|
3
|
+
import { PartialStyleObject } from './insertStyleRule';
|
|
3
4
|
export declare const MEDIA_SEP = "_";
|
|
4
|
-
export declare const createMediaStyle: ({ identifier, rules }: StyleObject, mediaKey: string, mediaQueries: MediaQueries, negate?: boolean, importance?: number) =>
|
|
5
|
-
styleRule: string;
|
|
6
|
-
identifier: string;
|
|
7
|
-
};
|
|
5
|
+
export declare const createMediaStyle: ({ property, identifier, rules }: StyleObject, mediaKey: string, mediaQueries: MediaQueries, negate?: boolean, importance?: number) => PartialStyleObject;
|
|
8
6
|
//# sourceMappingURL=createMediaStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMediaStyle.d.ts","sourceRoot":"","sources":["../../src/helpers/createMediaStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"createMediaStyle.d.ts","sourceRoot":"","sources":["../../src/helpers/createMediaStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAItD,eAAO,MAAM,SAAS,MAAM,CAAA;AAE5B,eAAO,MAAM,gBAAgB,oCACM,WAAW,YAClC,MAAM,gBACF,YAAY,WACjB,OAAO,eACH,MAAM,KAClB,kBA+BF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createShallowUpdate.d.ts","sourceRoot":"","sources":["../../src/helpers/createShallowUpdate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,MAAM,EACtD,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"createShallowUpdate.d.ts","sourceRoot":"","sources":["../../src/helpers/createShallowUpdate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,MAAM,EACtD,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,UAI1C,QAAQ,KAAK,CAAC,UAYxB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TamaguiInternalConfig, TamaguiProviderProps } from '../types';
|
|
3
2
|
export declare function createTamaguiProvider(config: TamaguiInternalConfig): ({ disableInjectCSS, children, ...themePropsProvider }: TamaguiProviderProps) => JSX.Element;
|
|
4
3
|
//# sourceMappingURL=createTamaguiProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTamaguiProvider.d.ts","sourceRoot":"","sources":["../../src/helpers/createTamaguiProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createTamaguiProvider.d.ts","sourceRoot":"","sources":["../../src/helpers/createTamaguiProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAItE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,2DAK9D,oBAAoB,iBA8BxB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ViewStyle } from 'react-native';
|
|
2
2
|
import { DebugProp, MediaKeys, PseudoStyles, SplitStyleState, StackProps, StaticConfigParsed, TamaguiInternalConfig, ThemeObject } from '../types';
|
|
3
|
+
import { RulesToInsert } from './insertStyleRule';
|
|
3
4
|
export declare type SplitStyles = ReturnType<typeof getSplitStyles>;
|
|
4
5
|
export declare type ClassNamesObject = Record<string, string>;
|
|
5
6
|
export declare type SplitStyleResult = ReturnType<typeof getSplitStyles>;
|
|
@@ -10,7 +11,7 @@ declare type StyleSplitter = (props: {
|
|
|
10
11
|
medias: Record<MediaKeys, ViewStyle>;
|
|
11
12
|
style: ViewStyle;
|
|
12
13
|
classNames: ClassNamesObject;
|
|
13
|
-
rulesToInsert:
|
|
14
|
+
rulesToInsert: RulesToInsert;
|
|
14
15
|
viewProps: StackProps;
|
|
15
16
|
};
|
|
16
17
|
export declare const PROP_SPLIT = "-";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAOxC,OAAO,EACL,SAAS,EACT,SAAS,EAGT,YAAY,EACZ,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACZ,MAAM,UAAU,CAAA;AAIjB,OAAO,EAEL,aAAa,EAMd,MAAM,mBAAmB,CAAA;AAK1B,oBAAY,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAC3D,oBAAY,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACrD,oBAAY,gBAAgB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AA2BhE,aAAK,aAAa,GAAG,CACnB,KAAK,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC7B,YAAY,EAAE,kBAAkB,EAChC,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,eAAe,EACtB,iBAAiB,CAAC,EAAE,GAAG,EACvB,KAAK,CAAC,EAAE,SAAS,KACd;IACH,OAAO,EAAE,YAAY,CAAA;IACrB,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IACpC,KAAK,EAAE,SAAS,CAAA;IAChB,UAAU,EAAE,gBAAgB,CAAA;IAC5B,aAAa,EAAE,aAAa,CAAA;IAC5B,SAAS,EAAE,UAAU,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,UAAU,MAAM,CAAA;AAI7B,eAAO,MAAM,eAAe;;;;CAI3B,CAAA;AASD,eAAO,MAAM,cAAc,EAAE,aAya5B,CAAA;AAED,eAAO,MAAM,WAAW,YACb,MAAM,gBACD,kBAAkB,SACzB,WAAW,SACX,GAAG,SACH,eAAe,QAChB,qBAAqB,sBACP,OAAO,KAC1B,SAmBF,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,aAI/B,CAAA;AAKD,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStylesAtomic.d.ts","sourceRoot":"","sources":["../../src/helpers/getStylesAtomic.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAA;AAE1D,OAAO,EAAa,SAAS,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"getStylesAtomic.d.ts","sourceRoot":"","sources":["../../src/helpers/getStylesAtomic.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAA;AAE1D,OAAO,EAAa,SAAS,EAAE,MAAM,cAAc,CAAA;AAKnD,OAAO,EAAE,gBAAgB,EAAqB,MAAM,qBAAqB,CAAA;AAIzE,oBAAY,oBAAoB,GAAG,SAAS,GAAG;IAC7C,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,UAAU,CAAC,EAAE,SAAS,CAAA;CACvB,CAAA;AAID,wBAAgB,eAAe,CAAC,QAAQ,EAAE,oBAAoB,iBAgB7D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,gBAAgB,GAAG,WAAW,EAAE,CAazF;AAuDD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QA4BpD;AAiBD,aAAK,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,MAAM,CAAA;AAClD,oBAAY,KAAK,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;CAAE,CAAA"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { StyleObject } from '@tamagui/helpers';
|
|
1
2
|
export declare const insertedTransforms: {};
|
|
2
3
|
export declare const getAllSelectors: () => {};
|
|
3
4
|
export declare const getInsertedRules: () => unknown[];
|
|
4
5
|
export declare const getAllTransforms: () => {};
|
|
5
6
|
export declare function updateInserted(): void;
|
|
6
|
-
export declare function updateInsertedCache(identifier: string,
|
|
7
|
-
export declare
|
|
7
|
+
export declare function updateInsertedCache(identifier: string, rules: string[]): boolean;
|
|
8
|
+
export declare type PartialStyleObject = Pick<StyleObject, 'identifier' | 'property' | 'rules'>;
|
|
9
|
+
export declare type RulesToInsert = PartialStyleObject[];
|
|
10
|
+
export declare function insertStyleRules(rulesToInsert: RulesToInsert): void;
|
|
8
11
|
//# sourceMappingURL=insertStyleRule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertStyleRule.d.ts","sourceRoot":"","sources":["../../src/helpers/insertStyleRule.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"insertStyleRule.d.ts","sourceRoot":"","sources":["../../src/helpers/insertStyleRule.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAI9C,eAAO,MAAM,kBAAkB,IAAK,CAAA;AAEpC,eAAO,MAAM,eAAe,UAAqB,CAAA;AACjD,eAAO,MAAM,gBAAgB,iBAAyC,CAAA;AACtE,eAAO,MAAM,gBAAgB,UAA2B,CAAA;AAyCxD,wBAAgB,cAAc,SA8B7B;AA4BD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAOtE;AAGD,oBAAY,kBAAkB,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,GAAG,UAAU,GAAG,OAAO,CAAC,CAAA;AACvF,oBAAY,aAAa,GAAG,kBAAkB,EAAE,CAAA;AAEhD,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,aAAa,QAU5D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const matchMedia:
|
|
1
|
+
export declare const matchMedia: ((query: string) => MediaQueryList) & typeof globalThis.matchMedia;
|
|
2
2
|
//# sourceMappingURL=matchMedia.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchMedia.d.ts","sourceRoot":"","sources":["../../src/helpers/matchMedia.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"matchMedia.d.ts","sourceRoot":"","sources":["../../src/helpers/matchMedia.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,oEAA6E,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startTransition.d.ts","sourceRoot":"","sources":["../../src/helpers/startTransition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,eAAe,8BAA0C,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ThemeManager } from '../ThemeManager';
|
|
2
|
-
export declare function wrapThemeManagerContext(children: any, themeManager?: ThemeManager | null): any;
|
|
2
|
+
export declare function wrapThemeManagerContext(children: any, themeManager?: ThemeManager | null, shouldSetChildrenThemeToParent?: boolean): any;
|
|
3
3
|
//# sourceMappingURL=wrapThemeManagerContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapThemeManagerContext.d.ts","sourceRoot":"","sources":["../../src/helpers/wrapThemeManagerContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAuB,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"wrapThemeManagerContext.d.ts","sourceRoot":"","sources":["../../src/helpers/wrapThemeManagerContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAuB,MAAM,iBAAiB,CAAA;AAGnE,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,GAAG,EACb,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,EAClC,8BAA8B,CAAC,EAAE,OAAO,OAazC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getThemeUnwrapped.d.ts","sourceRoot":"","sources":["../../src/hooks/getThemeUnwrapped.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,UAAW,GAAG,QAI3C,CAAA;AAED,eAAO,MAAM,iBAAiB,eAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsSSR.d.ts","sourceRoot":"","sources":["../../src/hooks/useIsSSR.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,QAAQ,eAYpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsTouchDevice.d.ts","sourceRoot":"","sources":["../../src/hooks/useIsTouchDevice.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"useIsTouchDevice.d.ts","sourceRoot":"","sources":["../../src/hooks/useIsTouchDevice.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,eAc5B,CAAA"}
|