@tamagui/core 1.0.1-beta.76 → 1.0.1-beta.79
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 +6 -22
- package/dist/cjs/ThemeManager.js.map +2 -2
- package/dist/cjs/constants/rnw.js +5 -7
- package/dist/cjs/constants/rnw.js.map +2 -2
- package/dist/cjs/createComponent.js +4 -3
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +1 -15
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +3 -0
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/validate.js +33 -30
- package/dist/cjs/helpers/validate.js.map +2 -2
- package/dist/cjs/index.js +0 -5
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/insertFont.js +1 -2
- package/dist/cjs/insertFont.js.map +2 -2
- package/dist/esm/ThemeManager.js +4 -4
- package/dist/esm/ThemeManager.js.map +2 -2
- package/dist/esm/constants/rnw.js +2 -7
- package/dist/esm/constants/rnw.js.map +2 -2
- package/dist/esm/createComponent.js +4 -3
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +1 -17
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +3 -0
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/validate.js +1 -1
- package/dist/esm/helpers/validate.js.map +2 -2
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/insertFont.js +1 -2
- package/dist/esm/insertFont.js.map +2 -2
- package/package.json +7 -7
- package/types/ThemeManager.d.ts +1 -1
- package/types/ThemeManager.d.ts.map +1 -1
- package/types/constants/rnw.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/createTamaguiProvider.d.ts +1 -0
- package/types/helpers/createTamaguiProvider.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/helpers/pseudos.js +0 -41
- package/dist/cjs/helpers/pseudos.js.map +0 -7
- package/dist/esm/helpers/pseudos.js +0 -18
- package/dist/esm/helpers/pseudos.js.map +0 -7
- package/dist/jsx/Pressability.js +0 -4
- package/dist/jsx/Pressability.native.js +0 -4
- package/dist/jsx/Tamagui.js +0 -38
- package/dist/jsx/ThemeContext.js +0 -5
- package/dist/jsx/ThemeManager.js +0 -194
- package/dist/jsx/conf.js +0 -38
- package/dist/jsx/constants/constants.js +0 -17
- package/dist/jsx/constants/platform.js +0 -25
- package/dist/jsx/constants/rnw.js +0 -10
- package/dist/jsx/contexts/ButtonInsideButtonContext.js +0 -5
- package/dist/jsx/createComponent.js +0 -1036
- package/dist/jsx/createFont.js +0 -25
- package/dist/jsx/createShorthands.js +0 -6
- package/dist/jsx/createTamagui.js +0 -245
- package/dist/jsx/createTheme.js +0 -6
- package/dist/jsx/createTokens.js +0 -11
- package/dist/jsx/createVariable.js +0 -64
- package/dist/jsx/createVariables.js +0 -31
- package/dist/jsx/defaultComponentState.js +0 -0
- package/dist/jsx/helpers/RNComponents.js +0 -11
- package/dist/jsx/helpers/areEqualSets.js +0 -13
- package/dist/jsx/helpers/calc.js +0 -46
- package/dist/jsx/helpers/createMediaStyle.js +0 -29
- package/dist/jsx/helpers/createPropMapper.js +0 -243
- package/dist/jsx/helpers/createShallowUpdate.js +0 -16
- package/dist/jsx/helpers/createTamaguiProvider.js +0 -28
- package/dist/jsx/helpers/extendStaticConfig.js +0 -62
- package/dist/jsx/helpers/fixNativeShadow.js +0 -5
- package/dist/jsx/helpers/fixNativeShadow.native.js +0 -28
- package/dist/jsx/helpers/generateAtomicStyles.js +0 -410
- package/dist/jsx/helpers/getExpandedShorthands.js +0 -15
- package/dist/jsx/helpers/getSize.js +0 -19
- package/dist/jsx/helpers/getSplitStyles.js +0 -380
- package/dist/jsx/helpers/getStackSize.js +0 -15
- package/dist/jsx/helpers/getStylesAtomic.js +0 -61
- package/dist/jsx/helpers/getStylesAtomic.native.js +0 -6
- package/dist/jsx/helpers/getTextSize.js +0 -31
- package/dist/jsx/helpers/getVariantExtras.js +0 -22
- package/dist/jsx/helpers/insertStyleRule.js +0 -91
- package/dist/jsx/helpers/isObj.js +0 -4
- package/dist/jsx/helpers/isTamaguiComponent.js +0 -12
- package/dist/jsx/helpers/isTamaguiElement.js +0 -8
- package/dist/jsx/helpers/matchMedia.js +0 -15
- package/dist/jsx/helpers/matchMedia.native.js +0 -6
- package/dist/jsx/helpers/mergeProps.js +0 -15
- package/dist/jsx/helpers/mergeTransform.js +0 -16
- package/dist/jsx/helpers/nativeGestureHandler.native.js +0 -1
- package/dist/jsx/helpers/proxyThemeVariables.js +0 -14
- package/dist/jsx/helpers/pseudos.js +0 -17
- package/dist/jsx/helpers/registerCSSVariable.js +0 -14
- package/dist/jsx/helpers/themeable.js +0 -22
- package/dist/jsx/helpers/validate.js +0 -73
- package/dist/jsx/helpers/withStaticProperties.js +0 -7
- package/dist/jsx/helpers/wrapThemeManagerContext.js +0 -7
- package/dist/jsx/hooks/useConstant.js +0 -11
- package/dist/jsx/hooks/useFeatures.js +0 -165
- package/dist/jsx/hooks/useId.js +0 -32
- package/dist/jsx/hooks/useIsMounted.js +0 -15
- package/dist/jsx/hooks/useIsTouchDevice.js +0 -14
- package/dist/jsx/hooks/useMedia.js +0 -153
- package/dist/jsx/hooks/usePressable.js +0 -11
- package/dist/jsx/hooks/usePrevious.js +0 -0
- package/dist/jsx/hooks/useTheme.js +0 -164
- package/dist/jsx/hooks/useUnmountEffect.js +0 -7
- package/dist/jsx/index.js +0 -64
- package/dist/jsx/insertFont.js +0 -64
- package/dist/jsx/static.js +0 -18
- package/dist/jsx/styled.js +0 -49
- package/dist/jsx/types-rnw.js +0 -0
- package/dist/jsx/types.js +0 -0
- package/dist/jsx/views/Slot.js +0 -70
- package/dist/jsx/views/Stack.js +0 -12
- package/dist/jsx/views/Text.js +0 -57
- package/dist/jsx/views/TextAncestorContext.js +0 -13
- package/dist/jsx/views/Theme.js +0 -27
- package/dist/jsx/views/ThemeInverse.js +0 -24
- package/dist/jsx/views/ThemeProvider.js +0 -34
- package/dist/jsx/views/ThemeReset.js +0 -32
- package/types/helpers/pseudos.d.ts +0 -16
- package/types/helpers/pseudos.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/validate.ts"],
|
|
4
|
-
"sourcesContent": ["// published a patched version that works on native\n// @ts-ignore\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA
|
|
4
|
+
"sourcesContent": ["// published a patched version that works on native\n// @ts-ignore\nimport { default as ow } from '@tamagui/ow/dev-only'\n\nlet Config: any\nlet Tokens: any\nlet FontRequired: any\nlet FontOptional: any\n\nexport const validateConfig = (conf: any) => {\n if (!conf) {\n console.warn('no conf?')\n return\n }\n try {\n ow(conf, Config)\n } catch (err: any) {\n console.warn('Given config:\\n', JSON.stringify(conf, null, 2), err)\n }\n}\n\nexport const validateTokens = (tokens: any) => {\n try {\n ow(tokens, Tokens)\n } catch (err: any) {\n console.warn('Given tokens:\\n', JSON.stringify(tokens, null, 2), err)\n }\n}\n\nexport const validateFont = (font: any) => {\n try {\n const { style, transform, color, ...required } = font\n ow(required, FontRequired)\n ow({ style, transform, color }, FontOptional)\n } catch (err: any) {\n console.warn('Given font:\\n', JSON.stringify(font, null, 2), err)\n }\n}\n\nif (process.env.NODE_ENV === 'development') {\n const fontReq = {\n family: ow.string,\n size: ow.object.nonEmpty.valuesOfType(ow.number),\n lineHeight: ow.object.nonEmpty.valuesOfType(ow.number),\n weight: ow.object.nonEmpty.valuesOfType(ow.string),\n letterSpacing: ow.object.nonEmpty.valuesOfType(ow.number),\n }\n const fontOpt = {\n style: ow.optional.object.valuesOfType(ow.string),\n transform: ow.optional.object.valuesOfType(ow.string),\n color: ow.optional.object.valuesOfType(ow.any(ow.string, ow.object)),\n }\n\n Config = ow.object.exactShape({\n defaultTheme: ow.optional.string,\n disableRootThemeClass: ow.optional.boolean,\n shorthands: ow.optional.object.valuesOfType(ow.string),\n themes: ow.object.valuesOfType(ow.object),\n tokens: ow.object.valuesOfType(ow.object),\n media: ow.object.valuesOfType(ow.object),\n animations: ow.object.valuesOfType(ow.object),\n fonts: ow.object.valuesOfType(\n ow.object.partialShape({\n ...fontReq,\n ...fontOpt,\n })\n ),\n })\n\n FontRequired = ow.object.exactShape(fontReq)\n FontOptional = ow.object.partialShape(fontOpt)\n\n Tokens = ow.object.exactShape({\n size: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),\n space: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),\n zIndex: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),\n radius: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),\n color: ow.object.nonEmpty.valuesOfType(ow.any(ow.string, ow.object)),\n })\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AAEA,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AAEG,MAAM,iBAAiB,CAAC,SAAc;AAC3C,MAAI,CAAC,MAAM;AACT,YAAQ,KAAK,UAAU;AACvB;AAAA,EACF;AACA,MAAI;AACF,OAAG,MAAM,MAAM;AAAA,EACjB,SAAS,KAAP;AACA,YAAQ,KAAK,mBAAmB,KAAK,UAAU,MAAM,MAAM,CAAC,GAAG,GAAG;AAAA,EACpE;AACF;AAEO,MAAM,iBAAiB,CAAC,WAAgB;AAC7C,MAAI;AACF,OAAG,QAAQ,MAAM;AAAA,EACnB,SAAS,KAAP;AACA,YAAQ,KAAK,mBAAmB,KAAK,UAAU,QAAQ,MAAM,CAAC,GAAG,GAAG;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,GAAG,OAAO,aAAa,kCAClB,UACA,QACJ,CACH;AAAA,EACF,CAAC;AAED,iBAAe,GAAG,OAAO,WAAW,OAAO;AAC3C,iBAAe,GAAG,OAAO,aAAa,OAAO;AAE7C,WAAS,GAAG,OAAO,WAAW;AAAA,IAC5B,MAAM,GAAG,OAAO,SAAS,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,IAClE,OAAO,GAAG,OAAO,SAAS,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,IACnE,QAAQ,GAAG,OAAO,SAAS,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,IACpE,QAAQ,GAAG,OAAO,SAAS,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,IACpE,OAAO,GAAG,OAAO,SAAS,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,EACrE,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -10,7 +10,6 @@ export * from "./createVariables";
|
|
|
10
10
|
export * from "./insertFont";
|
|
11
11
|
export * from "./styled";
|
|
12
12
|
export * from "./types";
|
|
13
|
-
import { RNWTextProps, RNWViewProps } from "./types-rnw";
|
|
14
13
|
import { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from "./conf";
|
|
15
14
|
export * from "./constants/constants";
|
|
16
15
|
export * from "./constants/platform";
|
|
@@ -53,8 +52,6 @@ export * from "./views/ThemeReset";
|
|
|
53
52
|
export * from "@tamagui/use-force-update";
|
|
54
53
|
export * from "@tamagui/helpers";
|
|
55
54
|
export {
|
|
56
|
-
RNWTextProps,
|
|
57
|
-
RNWViewProps,
|
|
58
55
|
expandStyles,
|
|
59
56
|
getConfig,
|
|
60
57
|
getHasConfigured,
|
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 { RNWTextProps, RNWViewProps } from './types-rnw'\nexport { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './conf'\n\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport * from './constants/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 { expandStyles } from './helpers/generateAtomicStyles'\nexport * from './helpers/getTextSize'\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/useUnmountEffect'\n\nexport * from './views/Slot'\nexport * from './views/Stack'\nexport * from './views/Text'\nexport * 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/helpers'\n"],
|
|
5
|
-
"mappings": "AAAA;AACA;AACA;AACA;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 * from './constants/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 { expandStyles } from './helpers/generateAtomicStyles'\nexport * from './helpers/getTextSize'\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/useUnmountEffect'\n\nexport * from './views/Slot'\nexport * from './views/Stack'\nexport * from './views/Text'\nexport * 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/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;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/insertFont.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isWeb } from "@tamagui/core";
|
|
2
1
|
import { setConfigFont } from "./conf";
|
|
3
2
|
import { createFont } from "./createFont";
|
|
4
3
|
import { createVariables } from "./createVariables";
|
|
@@ -7,7 +6,7 @@ function insertFont(name, fontIn) {
|
|
|
7
6
|
const font = createFont(fontIn);
|
|
8
7
|
const tokened = createVariables(font, name);
|
|
9
8
|
const parsed = parseFont(tokened);
|
|
10
|
-
if (
|
|
9
|
+
if (process.env.TAMAGUI_TARGET === "web" && typeof document !== "undefined") {
|
|
11
10
|
const css = registerFontVariables(parsed, true);
|
|
12
11
|
const style = document.createElement("style");
|
|
13
12
|
style.innerText = `:root {${css}}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/insertFont.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["\nimport { setConfigFont } from './conf'\nimport { createFont } from './createFont'\nimport { Variable } from './createVariable'\nimport { DeepVariableObject, createVariables } from './createVariables'\nimport { registerCSSVariable } from './helpers/registerCSSVariable'\nimport { GenericFont } from './types'\n\nexport function insertFont<A extends GenericFont>(name: string, fontIn: A): DeepVariableObject<A> {\n const font = createFont(fontIn)\n const tokened = createVariables(font, name) as GenericFont\n const parsed = parseFont(tokened) as DeepVariableObject<A>\n if (process.env.TAMAGUI_TARGET === 'web' && typeof document !== 'undefined') {\n const css = registerFontVariables(parsed, true)\n const style = document.createElement('style')\n style.innerText = `:root {${css}}`\n style.setAttribute('data-tamagui-font', name)\n document.head.appendChild(style)\n }\n setConfigFont(name, tokened, parsed)\n return parsed\n}\n\nexport function parseFont<A extends GenericFont>(definition: A): DeepVariableObject<A> {\n const parsed: any = {}\n for (const attrKey in definition) {\n const attr = definition[attrKey]\n if (attrKey === 'family') {\n parsed[attrKey] = attr\n continue\n }\n parsed[attrKey] = {}\n for (const key in attr) {\n let val = attr[key] as any as Variable\n // is a theme reference\n if (val.val[0] === '$') {\n val = val.val\n }\n parsed[attrKey][`$${key}`] = val\n }\n }\n return parsed\n}\n\nexport function registerFontVariables(parsedFont: any, collect = false) {\n let vals = ''\n for (const fkey in parsedFont) {\n if (fkey === 'family') {\n const val = registerCSSVariable(parsedFont[fkey])\n if (collect) vals += val + ';'\n } else {\n for (const fskey in parsedFont[fkey]) {\n const fval = parsedFont[fkey][fskey]\n if (typeof fval === 'string') {\n // no need to add its a theme reference like \"$borderColor\"\n } else {\n const val = registerCSSVariable(parsedFont[fkey][fskey])\n if (collect) vals += val + ';'\n }\n }\n }\n }\n return vals\n}\n"],
|
|
5
|
+
"mappings": "AACA;AACA;AAEA;AACA;AAGO,oBAA2C,MAAc,QAAkC;AAChG,QAAM,OAAO,WAAW,MAAM;AAC9B,QAAM,UAAU,gBAAgB,MAAM,IAAI;AAC1C,QAAM,SAAS,UAAU,OAAO;AAChC,MAAI,QAAQ,IAAI,mBAAmB,SAAS,OAAO,aAAa,aAAa;AAC3E,UAAM,MAAM,sBAAsB,QAAQ,IAAI;AAC9C,UAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,UAAM,YAAY,UAAU;AAC5B,UAAM,aAAa,qBAAqB,IAAI;AAC5C,aAAS,KAAK,YAAY,KAAK;AAAA,EACjC;AACA,gBAAc,MAAM,SAAS,MAAM;AACnC,SAAO;AACT;AAEO,mBAA0C,YAAsC;AACrF,QAAM,SAAc,CAAC;AACrB,aAAW,WAAW,YAAY;AAChC,UAAM,OAAO,WAAW;AACxB,QAAI,YAAY,UAAU;AACxB,aAAO,WAAW;AAClB;AAAA,IACF;AACA,WAAO,WAAW,CAAC;AACnB,eAAW,OAAO,MAAM;AACtB,UAAI,MAAM,KAAK;AAEf,UAAI,IAAI,IAAI,OAAO,KAAK;AACtB,cAAM,IAAI;AAAA,MACZ;AACA,aAAO,SAAS,IAAI,SAAS;AAAA,IAC/B;AAAA,EACF;AACA,SAAO;AACT;AAEO,+BAA+B,YAAiB,UAAU,OAAO;AACtE,MAAI,OAAO;AACX,aAAW,QAAQ,YAAY;AAC7B,QAAI,SAAS,UAAU;AACrB,YAAM,MAAM,oBAAoB,WAAW,KAAK;AAChD,UAAI;AAAS,gBAAQ,MAAM;AAAA,IAC7B,OAAO;AACL,iBAAW,SAAS,WAAW,OAAO;AACpC,cAAM,OAAO,WAAW,MAAM;AAC9B,YAAI,OAAO,SAAS,UAAU;AAAA,QAE9B,OAAO;AACL,gBAAM,MAAM,oBAAoB,WAAW,MAAM,MAAM;AACvD,cAAI;AAAS,oBAAQ,MAAM;AAAA,QAC7B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
|
|
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.79",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -21,11 +21,11 @@
|
|
|
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.79",
|
|
25
|
+
"@tamagui/helpers": "^1.0.1-beta.79",
|
|
26
26
|
"@tamagui/ow": "^0.28.1",
|
|
27
|
-
"@tamagui/use-debounce": "^1.0.1-beta.
|
|
28
|
-
"@tamagui/use-force-update": "^1.0.1-beta.
|
|
27
|
+
"@tamagui/use-debounce": "^1.0.1-beta.79",
|
|
28
|
+
"@tamagui/use-force-update": "^1.0.1-beta.79",
|
|
29
29
|
"expo-screen-orientation": "^4.2.0",
|
|
30
30
|
"hyphenate-style-name": "^1.0.4",
|
|
31
31
|
"normalize-css-color": "^1.0.2",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"react-native-web": "*"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
39
|
+
"@tamagui/build": "^1.0.1-beta.79",
|
|
40
40
|
"@types/react": "^17.0.35",
|
|
41
41
|
"csstype": "^3.0.10",
|
|
42
42
|
"esbuild": "^0.14.36",
|
|
43
43
|
"react-native-web": "^0.17.5",
|
|
44
|
-
"typescript": "^4.7.
|
|
44
|
+
"typescript": "^4.7.4"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
package/types/ThemeManager.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export declare type GetNextThemeProps = {
|
|
|
14
14
|
reset?: boolean;
|
|
15
15
|
};
|
|
16
16
|
export declare class ThemeManager {
|
|
17
|
-
#private;
|
|
18
17
|
name: string;
|
|
19
18
|
theme: ThemeObject | null;
|
|
20
19
|
parentManager: ThemeManager | null;
|
|
@@ -41,6 +40,7 @@ export declare class ThemeManager {
|
|
|
41
40
|
}) | null;
|
|
42
41
|
className?: undefined;
|
|
43
42
|
};
|
|
43
|
+
getClassName(name: string): string;
|
|
44
44
|
track(uuid: any, keys: Set<string>): void;
|
|
45
45
|
notifyListeners(): void;
|
|
46
46
|
onChangeTheme(cb: ThemeListener): () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeManager.d.ts","sourceRoot":"","sources":["../src/ThemeManager.tsx"],"names":[],"mappings":";AAIA,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
|
|
1
|
+
{"version":3,"file":"ThemeManager.d.ts","sourceRoot":"","sources":["../src/ThemeManager.tsx"],"names":[],"mappings":";AAIA,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,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;;;;;;;;;;;;;IAoFvD,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rnw.d.ts","sourceRoot":"","sources":["../../src/constants/rnw.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rnw.d.ts","sourceRoot":"","sources":["../../src/constants/rnw.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,KAAqB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAEA,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,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,EAAE,eAAe,CAAC,EAAE,iBAAiB,4DA47B1F;AAKD,eAAO,MAAM,QAAQ;YAAW;QAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;KAAE;;CAEjD,CAAA;AAMD,oBAAY,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG;IACjE,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;IAC3B,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,cAAc,CAAA;CAC3B,CAAA;AACD,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAEA,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,C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Config, TamaguiProviderProps } from '../types';
|
|
2
3
|
export declare function createTamaguiProvider(config: TamaguiInternalConfig): ({ disableInjectCSS, children, ...themePropsProvider }: TamaguiProviderProps) => JSX.Element;
|
|
3
4
|
//# sourceMappingURL=createTamaguiProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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
|
+
{"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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAKxC,OAAO,EACL,SAAS,EACT,SAAS,EAGT,YAAY,EACZ,eAAe,EACf,UAAU,EACV,kBAAkB,EAElB,WAAW,EACZ,MAAM,UAAU,CAAA;AAajB,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,GA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,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,EACD,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,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAAA;IACxC,SAAS,EAAE,UAAU,CAAA;CACtB,CAAA;AAID,eAAO,MAAM,eAAe;;;;CAI3B,CAAA;AASD,eAAO,MAAM,cAAc,EAAE,aAoX5B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,aAQ/B,CAAA;AAID,eAAO,MAAM,cAAc,EAAE,aAS5B,CAAA;AAED,eAAO,MAAM,WAAW,YACb,MAAM,gBACD,kBAAkB,SACzB,WAAW,SACX,GAAG,SACH,eAAe,sBACF,OAAO,KAC1B,SAeF,CAAA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,QAI9C"}
|
package/types/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export * from './createVariables';
|
|
|
10
10
|
export * from './insertFont';
|
|
11
11
|
export * from './styled';
|
|
12
12
|
export * from './types';
|
|
13
|
-
export { RNWTextProps, RNWViewProps } from './types-rnw';
|
|
13
|
+
export type { RNWTextProps, RNWViewProps } from './types-rnw';
|
|
14
14
|
export { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './conf';
|
|
15
15
|
export * from './constants/constants';
|
|
16
16
|
export * from './constants/platform';
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,m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C7D,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gCAAgC,CAAA;AAE9C,cAAc,sCAAsC,CAAA;AAEpD,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AAExC,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAElC,cAAc,2BAA2B,CAAA;AACzC,cAAc,kBAAkB,CAAA"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var pseudos_exports = {};
|
|
19
|
-
__export(pseudos_exports, {
|
|
20
|
-
pseudos: () => pseudos
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(pseudos_exports);
|
|
23
|
-
const pseudos = {
|
|
24
|
-
hoverStyle: {
|
|
25
|
-
name: "hover",
|
|
26
|
-
priority: 1
|
|
27
|
-
},
|
|
28
|
-
pressStyle: {
|
|
29
|
-
name: "active",
|
|
30
|
-
priority: 2
|
|
31
|
-
},
|
|
32
|
-
focusStyle: {
|
|
33
|
-
name: "focus",
|
|
34
|
-
priority: 3
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
pseudos
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=pseudos.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/pseudos.ts"],
|
|
4
|
-
"sourcesContent": ["// *0 order matches to *1\n\nexport const pseudos = {\n hoverStyle: {\n name: 'hover',\n priority: 1,\n },\n pressStyle: {\n name: 'active',\n priority: 2,\n },\n focusStyle: {\n name: 'focus',\n priority: 3,\n },\n} as const\n\nexport type PseudoDescriptor = typeof pseudos[keyof typeof pseudos]\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,UAAU;AAAA,EACrB,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const pseudos = {
|
|
2
|
-
hoverStyle: {
|
|
3
|
-
name: "hover",
|
|
4
|
-
priority: 1
|
|
5
|
-
},
|
|
6
|
-
pressStyle: {
|
|
7
|
-
name: "active",
|
|
8
|
-
priority: 2
|
|
9
|
-
},
|
|
10
|
-
focusStyle: {
|
|
11
|
-
name: "focus",
|
|
12
|
-
priority: 3
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
pseudos
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=pseudos.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/pseudos.ts"],
|
|
4
|
-
"sourcesContent": ["// *0 order matches to *1\n\nexport const pseudos = {\n hoverStyle: {\n name: 'hover',\n priority: 1,\n },\n pressStyle: {\n name: 'active',\n priority: 2,\n },\n focusStyle: {\n name: 'focus',\n priority: 3,\n },\n} as const\n\nexport type PseudoDescriptor = typeof pseudos[keyof typeof pseudos]\n"],
|
|
5
|
-
"mappings": "AAEO,MAAM,UAAU;AAAA,EACrB,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/jsx/Pressability.js
DELETED
package/dist/jsx/Tamagui.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as Helpers from "@tamagui/helpers";
|
|
2
|
-
import { getConfig } from "./conf";
|
|
3
|
-
import { rnw } from "./constants/rnw";
|
|
4
|
-
import { getAllSelectors, getAllTransforms, getInsertedRules } from "./helpers/insertStyleRule";
|
|
5
|
-
class TamaguiManager {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.rnw = rnw;
|
|
8
|
-
this.Helpers = Helpers;
|
|
9
|
-
}
|
|
10
|
-
get config() {
|
|
11
|
-
return getConfig();
|
|
12
|
-
}
|
|
13
|
-
get insertedRules() {
|
|
14
|
-
return getInsertedRules();
|
|
15
|
-
}
|
|
16
|
-
get allSelectors() {
|
|
17
|
-
return getAllSelectors();
|
|
18
|
-
}
|
|
19
|
-
get allTransforms() {
|
|
20
|
-
return getAllTransforms();
|
|
21
|
-
}
|
|
22
|
-
get identifierToValue() {
|
|
23
|
-
return identifierToValue;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const Tamagui = new TamaguiManager();
|
|
27
|
-
const identifierToValue = /* @__PURE__ */ new Map();
|
|
28
|
-
const getValueFromIdentifier = (identifier) => {
|
|
29
|
-
return identifierToValue.get(identifier);
|
|
30
|
-
};
|
|
31
|
-
const setIdentifierValue = (identifier, value) => {
|
|
32
|
-
identifierToValue.set(identifier, value);
|
|
33
|
-
};
|
|
34
|
-
export {
|
|
35
|
-
Tamagui,
|
|
36
|
-
getValueFromIdentifier,
|
|
37
|
-
setIdentifierValue
|
|
38
|
-
};
|
package/dist/jsx/ThemeContext.js
DELETED
package/dist/jsx/ThemeManager.js
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
var __accessCheck = (obj, member, msg) => {
|
|
2
|
-
if (!member.has(obj))
|
|
3
|
-
throw TypeError("Cannot " + msg);
|
|
4
|
-
};
|
|
5
|
-
var __privateAdd = (obj, member, value) => {
|
|
6
|
-
if (member.has(obj))
|
|
7
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
9
|
-
};
|
|
10
|
-
var __privateMethod = (obj, member, method) => {
|
|
11
|
-
__accessCheck(obj, member, "access private method");
|
|
12
|
-
return method;
|
|
13
|
-
};
|
|
14
|
-
var _getClassName, getClassName_fn;
|
|
15
|
-
import { createContext } from "react";
|
|
16
|
-
import { getThemes } from "./conf";
|
|
17
|
-
import { THEME_CLASSNAME_PREFIX, THEME_NAME_SEPARATOR } from "./constants/constants";
|
|
18
|
-
class ThemeManager {
|
|
19
|
-
constructor(name = "", theme = null, parentManager = null, reset = false) {
|
|
20
|
-
this.name = name;
|
|
21
|
-
this.theme = theme;
|
|
22
|
-
this.parentManager = parentManager;
|
|
23
|
-
this.reset = reset;
|
|
24
|
-
__privateAdd(this, _getClassName);
|
|
25
|
-
this.keys = /* @__PURE__ */ new Map();
|
|
26
|
-
this.listeners = /* @__PURE__ */ new Map();
|
|
27
|
-
this.themeListeners = /* @__PURE__ */ new Set();
|
|
28
|
-
this.className = null;
|
|
29
|
-
let parent = parentManager;
|
|
30
|
-
let tries = 0;
|
|
31
|
-
while (true) {
|
|
32
|
-
tries++;
|
|
33
|
-
if (tries > 10) {
|
|
34
|
-
throw new Error(`Nested 10 of the same theme in a row, likely error`);
|
|
35
|
-
}
|
|
36
|
-
if (!parent)
|
|
37
|
-
break;
|
|
38
|
-
if (parent.name === name) {
|
|
39
|
-
parent = parent.parentManager;
|
|
40
|
-
} else {
|
|
41
|
-
this.parentManager = parent;
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
get parentName() {
|
|
47
|
-
var _a;
|
|
48
|
-
return ((_a = this.parentManager) == null ? void 0 : _a.name) || null;
|
|
49
|
-
}
|
|
50
|
-
get fullName() {
|
|
51
|
-
return this.getNextTheme().name || this.name || "";
|
|
52
|
-
}
|
|
53
|
-
getValue(key) {
|
|
54
|
-
let theme = this.theme;
|
|
55
|
-
let manager = this;
|
|
56
|
-
while (true) {
|
|
57
|
-
if (!theme)
|
|
58
|
-
return;
|
|
59
|
-
if (key in theme) {
|
|
60
|
-
return theme[key];
|
|
61
|
-
}
|
|
62
|
-
manager = this.parentManager;
|
|
63
|
-
if (!manager) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (manager.theme === theme) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
theme = manager.theme;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
update({ name, theme, className } = {}) {
|
|
73
|
-
const nameChanged = name !== this.name;
|
|
74
|
-
if (!nameChanged) {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
this.className = className || null;
|
|
78
|
-
this.name = name || "";
|
|
79
|
-
this.theme = theme;
|
|
80
|
-
this.notifyListeners();
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
getNextTheme(props = {}, debug) {
|
|
84
|
-
var _a;
|
|
85
|
-
const { themes = getThemes(), name, componentName } = props;
|
|
86
|
-
if (props.reset && name) {
|
|
87
|
-
return {
|
|
88
|
-
name,
|
|
89
|
-
theme: themes[name],
|
|
90
|
-
className: __privateMethod(this, _getClassName, getClassName_fn).call(this, name)
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
const parentIsReset = (_a = this.parentManager) == null ? void 0 : _a.reset;
|
|
94
|
-
if (!name) {
|
|
95
|
-
if (componentName) {
|
|
96
|
-
const names = [
|
|
97
|
-
`${this.name}_${componentName}`,
|
|
98
|
-
`${withoutComponentName(this.name)}_${componentName}`
|
|
99
|
-
];
|
|
100
|
-
for (const name2 of names) {
|
|
101
|
-
if (name2 in themes) {
|
|
102
|
-
const className = __privateMethod(this, _getClassName, getClassName_fn).call(this, name2);
|
|
103
|
-
return { name: name2, theme: themes[name2], className };
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
name: this.name,
|
|
109
|
-
theme: this.theme
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
let nextName = name || this.name || "";
|
|
113
|
-
let parentName = parentIsReset ? this.parentName || this.fullName : this.fullName;
|
|
114
|
-
while (true) {
|
|
115
|
-
if (nextName in themes) {
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
nextName = `${parentName}_${name}`;
|
|
119
|
-
if (nextName in themes) {
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
if (!parentName.includes(THEME_NAME_SEPARATOR)) {
|
|
123
|
-
console.warn("theme not found", name);
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
parentName = parentName.slice(0, parentName.lastIndexOf(THEME_NAME_SEPARATOR));
|
|
127
|
-
}
|
|
128
|
-
if (componentName) {
|
|
129
|
-
const names = [
|
|
130
|
-
`${nextName}_${componentName}`,
|
|
131
|
-
`${withoutComponentName(nextName)}_${componentName}`
|
|
132
|
-
];
|
|
133
|
-
for (const name2 of names) {
|
|
134
|
-
if (name2 in themes) {
|
|
135
|
-
nextName = name2;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
let theme = themes[nextName];
|
|
140
|
-
if (!theme) {
|
|
141
|
-
theme = themes[`light_${nextName}`];
|
|
142
|
-
}
|
|
143
|
-
if (process.env.NODE_ENV === "development" && debug) {
|
|
144
|
-
console.log("getNextTheme", { props, nextName, parentName }, this);
|
|
145
|
-
}
|
|
146
|
-
return {
|
|
147
|
-
name: nextName,
|
|
148
|
-
theme,
|
|
149
|
-
className: __privateMethod(this, _getClassName, getClassName_fn).call(this, nextName)
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
track(uuid, keys) {
|
|
153
|
-
if (!this.name)
|
|
154
|
-
return;
|
|
155
|
-
this.keys.set(uuid, keys);
|
|
156
|
-
}
|
|
157
|
-
notifyListeners() {
|
|
158
|
-
var _a;
|
|
159
|
-
if (!this.name) {
|
|
160
|
-
this.keys.clear();
|
|
161
|
-
}
|
|
162
|
-
for (const [uuid, keys] of this.keys.entries()) {
|
|
163
|
-
if (keys.size) {
|
|
164
|
-
(_a = this.listeners.get(uuid)) == null ? void 0 : _a();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
this.themeListeners.forEach((cb) => cb(this.name, this));
|
|
168
|
-
}
|
|
169
|
-
onChangeTheme(cb) {
|
|
170
|
-
this.themeListeners.add(cb);
|
|
171
|
-
return () => {
|
|
172
|
-
this.themeListeners.delete(cb);
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
onUpdate(uuid, cb) {
|
|
176
|
-
this.listeners.set(uuid, cb);
|
|
177
|
-
return () => {
|
|
178
|
-
this.listeners.delete(uuid);
|
|
179
|
-
this.keys.delete(uuid);
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
_getClassName = new WeakSet();
|
|
184
|
-
getClassName_fn = function(name) {
|
|
185
|
-
return `${THEME_CLASSNAME_PREFIX}${name} t_Theme`.replace("light_", "").replace("dark_", "");
|
|
186
|
-
};
|
|
187
|
-
const ThemeManagerContext = createContext(null);
|
|
188
|
-
const emptyManager = new ThemeManager();
|
|
189
|
-
const withoutComponentName = (name) => name.replace(/(\_[A-Z][a-zA-Z]+)+$/g, "");
|
|
190
|
-
export {
|
|
191
|
-
ThemeManager,
|
|
192
|
-
ThemeManagerContext,
|
|
193
|
-
emptyManager
|
|
194
|
-
};
|
package/dist/jsx/conf.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
let conf;
|
|
2
|
-
const setConfig = (next) => {
|
|
3
|
-
conf = next;
|
|
4
|
-
if (configListeners.size) {
|
|
5
|
-
configListeners.forEach((cb) => cb(conf));
|
|
6
|
-
configListeners.clear();
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
const setConfigFont = (name, font, fontParsed) => {
|
|
10
|
-
if (process.env.NODE_ENV === "development") {
|
|
11
|
-
if (!conf)
|
|
12
|
-
throw new Error(`Haven't called createTamagui yet`);
|
|
13
|
-
}
|
|
14
|
-
Object.assign(conf.fonts, { [name]: font });
|
|
15
|
-
Object.assign(conf.fontsParsed, { [`$${name}`]: fontParsed });
|
|
16
|
-
};
|
|
17
|
-
const getHasConfigured = () => !!conf;
|
|
18
|
-
const getConfig = () => conf;
|
|
19
|
-
const getTokens = () => conf.tokensParsed;
|
|
20
|
-
const getThemes = () => conf.themes;
|
|
21
|
-
const configListeners = /* @__PURE__ */ new Set();
|
|
22
|
-
const onConfiguredOnce = (cb) => {
|
|
23
|
-
if (conf) {
|
|
24
|
-
cb(conf);
|
|
25
|
-
} else {
|
|
26
|
-
configListeners.add(cb);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
configListeners,
|
|
31
|
-
getConfig,
|
|
32
|
-
getHasConfigured,
|
|
33
|
-
getThemes,
|
|
34
|
-
getTokens,
|
|
35
|
-
onConfiguredOnce,
|
|
36
|
-
setConfig,
|
|
37
|
-
setConfigFont
|
|
38
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { isWeb } from "./platform";
|
|
2
|
-
const THEME_NAME_SEPARATOR = "_";
|
|
3
|
-
const THEME_CLASSNAME_PREFIX = `t_`;
|
|
4
|
-
const stackDefaultStyles = {
|
|
5
|
-
alignItems: "stretch",
|
|
6
|
-
flexShrink: 0,
|
|
7
|
-
...isWeb && {
|
|
8
|
-
display: "flex",
|
|
9
|
-
flexBasis: "auto",
|
|
10
|
-
boxSizing: "border-box"
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
THEME_CLASSNAME_PREFIX,
|
|
15
|
-
THEME_NAME_SEPARATOR,
|
|
16
|
-
stackDefaultStyles
|
|
17
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var _a, _b, _c;
|
|
2
|
-
import { useEffect, useLayoutEffect } from "react";
|
|
3
|
-
import { Platform } from "react-native";
|
|
4
|
-
const isAndroid = ((_a = Platform) == null ? void 0 : _a.OS) === "android";
|
|
5
|
-
const isIOS = ((_b = Platform) == null ? void 0 : _b.OS) === "ios";
|
|
6
|
-
const isWeb = process.env.TAMAGUI_TARGET !== "native" && (process.env.TAMAGUI_TARGET === "web" || ((_c = Platform) == null ? void 0 : _c.OS) === "web");
|
|
7
|
-
const isSSR = isWeb && typeof window === "undefined";
|
|
8
|
-
const isClient = isWeb && typeof window !== "undefined";
|
|
9
|
-
const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
|
|
10
|
-
const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
|
|
11
|
-
const isWebTouchable = typeof window !== "undefined" && "ontouchstart" in window;
|
|
12
|
-
const isTouchable = !isWeb || isWebTouchable;
|
|
13
|
-
const isWebIOS = isWeb && typeof navigator !== "undefined" && (/iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && !window["MSStream"];
|
|
14
|
-
export {
|
|
15
|
-
isAndroid,
|
|
16
|
-
isChrome,
|
|
17
|
-
isClient,
|
|
18
|
-
isIOS,
|
|
19
|
-
isSSR,
|
|
20
|
-
isTouchable,
|
|
21
|
-
isWeb,
|
|
22
|
-
isWebIOS,
|
|
23
|
-
isWebTouchable,
|
|
24
|
-
useIsomorphicLayoutEffect
|
|
25
|
-
};
|