@tamagui/core 1.0.1-rc.9 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/config.js +3 -5
- package/dist/cjs/config.js.map +2 -2
- package/dist/cjs/constants/constants.js.map +2 -2
- package/dist/cjs/createComponent.js +25 -27
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createFont.js.map +2 -2
- package/dist/cjs/createTamagui.js +2 -1
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/helpers/ThemeManager.js +7 -17
- package/dist/cjs/helpers/ThemeManager.js.map +2 -2
- package/dist/cjs/helpers/Unwrap.js +29 -0
- package/dist/cjs/helpers/Unwrap.js.map +7 -0
- package/dist/cjs/helpers/cache.js +9 -13
- package/dist/cjs/helpers/cache.js.map +2 -2
- package/dist/cjs/helpers/expandStyle.js +29 -41
- package/dist/cjs/helpers/expandStyle.js.map +2 -2
- package/dist/cjs/helpers/getBoundingClientRect.js +3 -6
- package/dist/cjs/helpers/getBoundingClientRect.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +8 -14
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +12 -18
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/insertStyleRule.js +0 -2
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/isTamaguiComponent.js +2 -7
- package/dist/cjs/helpers/isTamaguiComponent.js.map +2 -2
- package/dist/cjs/helpers/mergeProps.js +1 -1
- package/dist/cjs/helpers/mergeProps.js.map +2 -2
- package/dist/cjs/hooks/getThemeUnwrapped.js +1 -4
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +2 -2
- package/dist/cjs/hooks/useTheme.js +45 -50
- package/dist/cjs/hooks/useTheme.js.map +3 -3
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/views/FontLanguage.js.map +2 -2
- package/dist/cjs/views/TamaguiProvider.js +3 -0
- package/dist/cjs/views/TamaguiProvider.js.map +2 -2
- package/dist/cjs/views/Text.js +0 -5
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/Theme.js +15 -21
- package/dist/cjs/views/Theme.js.map +3 -3
- package/dist/cjs/views/ThemeProvider.js +5 -6
- package/dist/cjs/views/ThemeProvider.js.map +2 -2
- package/dist/esm/config.js +3 -5
- package/dist/esm/config.js.map +2 -2
- package/dist/esm/constants/constants.js.map +2 -2
- package/dist/esm/createComponent.js +26 -28
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createFont.js.map +2 -2
- package/dist/esm/createTamagui.js +2 -1
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/helpers/ThemeManager.js +7 -17
- package/dist/esm/helpers/ThemeManager.js.map +2 -2
- package/dist/esm/helpers/Unwrap.js +5 -0
- package/dist/esm/helpers/Unwrap.js.map +7 -0
- package/dist/esm/helpers/cache.js +9 -12
- package/dist/esm/helpers/cache.js.map +2 -2
- package/dist/esm/helpers/expandStyle.js +26 -38
- package/dist/esm/helpers/expandStyle.js.map +2 -2
- package/dist/esm/helpers/getBoundingClientRect.js +3 -6
- package/dist/esm/helpers/getBoundingClientRect.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +8 -14
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +12 -18
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +0 -2
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/helpers/isTamaguiComponent.js +2 -7
- package/dist/esm/helpers/isTamaguiComponent.js.map +2 -2
- package/dist/esm/helpers/mergeProps.js +1 -1
- package/dist/esm/helpers/mergeProps.js.map +2 -2
- package/dist/esm/hooks/getThemeUnwrapped.js +1 -4
- package/dist/esm/hooks/getThemeUnwrapped.js.map +2 -2
- package/dist/esm/hooks/useTheme.js +45 -50
- package/dist/esm/hooks/useTheme.js.map +3 -3
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/views/FontLanguage.js.map +2 -2
- package/dist/esm/views/TamaguiProvider.js +3 -0
- package/dist/esm/views/TamaguiProvider.js.map +2 -2
- package/dist/esm/views/Text.js +0 -5
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/Theme.js +14 -14
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +5 -6
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/package.json +13 -13
- package/src/config.ts +4 -6
- package/src/constants/constants.ts +0 -2
- package/src/createComponent.tsx +47 -43
- package/src/createFont.ts +0 -2
- package/src/createTamagui.ts +2 -1
- package/src/helpers/ThemeManager.tsx +10 -21
- package/src/helpers/cache.ts +8 -13
- package/src/helpers/expandStyle.ts +27 -41
- package/src/helpers/getBoundingClientRect.tsx +2 -5
- package/src/helpers/getSplitStyles.tsx +23 -14
- package/src/helpers/getStylesAtomic.ts +16 -24
- package/src/helpers/insertStyleRule.tsx +0 -2
- package/src/helpers/isTamaguiComponent.tsx +2 -6
- package/src/helpers/mergeProps.ts +1 -1
- package/src/hooks/getThemeUnwrapped.tsx +1 -3
- package/src/hooks/useTheme.tsx +67 -48
- package/src/styled.tsx +1 -1
- package/src/views/FontLanguage.tsx +0 -2
- package/src/views/TamaguiProvider.tsx +6 -0
- package/src/views/Text.tsx +0 -6
- package/src/views/Theme.tsx +15 -22
- package/src/views/ThemeProvider.tsx +8 -8
- package/types/createComponent.d.ts +1 -1
- package/types/helpers/ThemeManager.d.ts +1 -1
- package/types/helpers/cache.d.ts +4 -6
- package/types/hooks/useTheme.d.ts +1 -1
- package/types/views/Theme.d.ts +1 -1
|
@@ -59,9 +59,9 @@ class ThemeManager {
|
|
|
59
59
|
this.updateState(props, false);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
if (!parentManager)
|
|
63
|
-
throw
|
|
64
|
-
|
|
62
|
+
if (!parentManager)
|
|
63
|
+
throw `\u274C`;
|
|
64
|
+
this.themeListeners = parentManager.themeListeners;
|
|
65
65
|
if (hasNoThemeUpdatingProps(props)) {
|
|
66
66
|
return parentManager;
|
|
67
67
|
}
|
|
@@ -105,9 +105,9 @@ class ThemeManager {
|
|
|
105
105
|
}
|
|
106
106
|
getStateShouldChange(nextState, state = this.state) {
|
|
107
107
|
if (!(nextState == null ? void 0 : nextState.theme) || nextState.theme === (state == null ? void 0 : state.theme)) {
|
|
108
|
-
return
|
|
108
|
+
return false;
|
|
109
109
|
}
|
|
110
|
-
return
|
|
110
|
+
return true;
|
|
111
111
|
}
|
|
112
112
|
getState(props = this.props, parentManager = this.parentManager) {
|
|
113
113
|
return getState(props, parentManager) || (process.env.TAMAGUI_TARGET === "native" ? (parentManager == null ? void 0 : parentManager.state) || null : null);
|
|
@@ -132,6 +132,7 @@ class ThemeManager {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
notify() {
|
|
135
|
+
console.log("notify", this.themeListeners.size, this.themeListeners);
|
|
135
136
|
this.themeListeners.forEach((cb) => cb(this.state.name, this));
|
|
136
137
|
}
|
|
137
138
|
onChangeTheme(cb) {
|
|
@@ -177,18 +178,7 @@ function getState(props, parentManager) {
|
|
|
177
178
|
const max = base.length;
|
|
178
179
|
const min = componentName && !nextName ? max : 0;
|
|
179
180
|
if (process.env.NODE_ENV === "development" && props.debug === "verbose")
|
|
180
|
-
[
|
|
181
|
-
console.groupCollapsed("ThemeManager.getState()", props, {
|
|
182
|
-
parentName,
|
|
183
|
-
parentBaseTheme,
|
|
184
|
-
base,
|
|
185
|
-
min,
|
|
186
|
-
max,
|
|
187
|
-
isParentAComponentTheme
|
|
188
|
-
}),
|
|
189
|
-
console.trace(),
|
|
190
|
-
console.groupEnd()
|
|
191
|
-
];
|
|
181
|
+
[console.groupCollapsed("ThemeManager.getState()", props, { parentName, parentBaseTheme, base, min, max, isParentAComponentTheme }), console.trace(), console.groupEnd()];
|
|
192
182
|
for (let i = max; i >= min; i--) {
|
|
193
183
|
let prefix = base.slice(0, i).join(import_constants.THEME_NAME_SEPARATOR);
|
|
194
184
|
if (props.inverse) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/ThemeManager.tsx"],
|
|
4
|
-
"sourcesContent": ["import { getThemes } from '../config'\nimport { THEME_CLASSNAME_PREFIX, THEME_NAME_SEPARATOR } from '../constants/constants'\nimport { getThemeUnwrapped } from '../hooks/getThemeUnwrapped'\nimport { ThemeParsed, ThemeProps } from '../types'\n\ntype ThemeListener = (name: string | null, themeManager: ThemeManager) => void\n\nexport type SetActiveThemeProps = {\n className?: string\n parentManager?: ThemeManager | null\n name?: string | null\n theme?: any\n reset?: boolean\n}\n\nexport type ThemeManagerState = {\n name: string\n theme?: ThemeParsed | null\n className?: string\n parentName?: string\n}\n\nconst emptyState: ThemeManagerState = { name: '' }\n\nexport function hasNoThemeUpdatingProps(props: ThemeProps) {\n return !(props.name || props.componentName || props.inverse || props.reset)\n}\n\nexport class ThemeManager {\n themeListeners = new Set<ThemeListener>()\n parentManager: ThemeManager | null = null\n state: ThemeManagerState = emptyState\n\n constructor(\n public props: ThemeProps = {},\n parentManager?: ThemeManager | 'root' | null | undefined\n ) {\n if (parentManager === 'root') {\n this.updateState(props, false)\n return\n }\n if (!parentManager)
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA0B;AAC1B,uBAA6D;AAC7D,+BAAkC;AAFlC;AAsBA,MAAM,aAAgC,EAAE,MAAM,GAAG;AAE1C,SAAS,wBAAwB,OAAmB;AACzD,SAAO,EAAE,MAAM,QAAQ,MAAM,iBAAiB,MAAM,WAAW,MAAM;AACvE;AAEO,MAAM,aAAa;AAAA,EAKxB,YACS,QAAoB,CAAC,GAC5B,eACA;AAFO;AALT,0BAAiB,oBAAI,IAAmB;AACxC,yBAAqC;AACrC,iBAA2B;
|
|
4
|
+
"sourcesContent": ["import { getThemes } from '../config'\nimport { THEME_CLASSNAME_PREFIX, THEME_NAME_SEPARATOR } from '../constants/constants'\nimport { getThemeUnwrapped } from '../hooks/getThemeUnwrapped'\nimport { ThemeParsed, ThemeProps } from '../types'\n\ntype ThemeListener = (name: string | null, themeManager: ThemeManager) => void\n\nexport type SetActiveThemeProps = {\n className?: string\n parentManager?: ThemeManager | null\n name?: string | null\n theme?: any\n reset?: boolean\n}\n\nexport type ThemeManagerState = {\n name: string\n theme?: ThemeParsed | null\n className?: string\n parentName?: string\n}\n\nconst emptyState: ThemeManagerState = { name: '' }\n\nexport function hasNoThemeUpdatingProps(props: ThemeProps) {\n return !(props.name || props.componentName || props.inverse || props.reset)\n}\n\nexport class ThemeManager {\n themeListeners = new Set<ThemeListener>()\n parentManager: ThemeManager | null = null\n state: ThemeManagerState = emptyState\n\n constructor(\n public props: ThemeProps = {},\n parentManager?: ThemeManager | 'root' | null | undefined\n ) {\n if (parentManager === 'root') {\n this.updateState(props, false)\n return\n }\n if (!parentManager) throw `\u274C`\n // copy over listeners\n this.themeListeners = parentManager.themeListeners\n\n // no change no props\n if (hasNoThemeUpdatingProps(props)) {\n return parentManager\n }\n if (parentManager) {\n this.parentManager = parentManager\n }\n const updatedState = this.getStateIfChanged(props)\n if (updatedState) {\n this.state = updatedState\n return\n }\n return parentManager || this\n }\n\n updateState(\n props: ThemeProps & { forceTheme?: ThemeParsed } = this.props || {},\n notify = true\n ) {\n const shouldFlush = (() => {\n if (props.forceTheme) {\n this.state.theme = props.forceTheme\n this.state.name = props.name || ''\n return true\n }\n const nextState = this.getStateIfChanged(props)\n if (nextState) {\n this.state = nextState\n return true\n }\n })()\n if (shouldFlush) {\n // reset any derived state\n this.#allKeys = null\n notify && this.notify()\n return this.state\n }\n }\n\n getStateIfChanged(\n props = this.props,\n state: ThemeManagerState | null = this.state,\n parentManager = this.parentManager\n ) {\n const _ = this.getState(props, parentManager)\n // is removing\n if (state && state !== emptyState && !_) {\n return parentManager?.state\n }\n if (this.getStateShouldChange(_, state)) {\n return _\n }\n }\n\n getStateShouldChange(\n nextState: ThemeManagerState | null,\n state: ThemeManagerState | null = this.state\n ) {\n if (!nextState?.theme || nextState.theme === state?.theme) {\n return false\n }\n return true\n }\n\n getState(props = this.props, parentManager = this.parentManager) {\n return (\n getState(props, parentManager) ||\n (process.env.TAMAGUI_TARGET === 'native' ? parentManager?.state || null : null)\n )\n }\n\n #allKeys: Set<string> | null = null\n get allKeys() {\n this.#allKeys ??= new Set([\n ...(this.parentManager?.allKeys || []),\n ...Object.keys(this.state.theme || {}),\n ])\n return this.#allKeys\n }\n\n // gets value going up to parents\n getValue(key: string, state?: ThemeManagerState) {\n let theme = (state || this.state).theme\n let manager = this as ThemeManager | null\n while (theme && manager) {\n if (key in theme) {\n return theme[key]\n }\n manager = manager.parentManager\n theme = manager?.state.theme\n }\n }\n\n notify() {\n console.log('notify', this.themeListeners.size, this.themeListeners)\n this.themeListeners.forEach((cb) => cb(this.state.name, this))\n }\n\n onChangeTheme(cb: ThemeListener) {\n this.themeListeners.add(cb)\n return () => {\n this.themeListeners.delete(cb)\n }\n }\n}\n\nfunction getNextThemeClassName(name: string, isInverting = false) {\n const next = `${THEME_CLASSNAME_PREFIX}${name}`\n if (isInverting) {\n return next\n }\n return next.replace('light_', '').replace('dark_', '')\n}\n\nconst cache = new WeakMap<ThemeProps, [ThemeManager, ThemeManagerState | null]>()\n\nfunction getState(\n props: ThemeProps,\n parentManager?: ThemeManager | null\n): ThemeManagerState | null {\n const cached = cache.get(props)\n if (cached && cached[0] === parentManager) {\n return cached[1]\n }\n\n const themes = getThemes()\n\n if (props.name && props.reset) {\n throw new Error('Cannot reset + set new name')\n }\n if (props.reset && !parentManager?.parentManager) {\n throw new Error('Cannot reset no grandparent exists')\n }\n\n let result: ThemeManagerState | null = null\n\n const nextName = props.reset\n ? parentManager?.parentManager?.state?.name || ''\n : props.name || ''\n const { componentName } = props\n const parentName = parentManager?.state?.name || ''\n\n // components look for most specific, fallback upwards\n const base = parentName.split(THEME_NAME_SEPARATOR)\n const lastSegment = base[base.length - 1]\n const isParentAComponentTheme =\n parentName && lastSegment[0].toUpperCase() === lastSegment[0]\n if (isParentAComponentTheme) {\n base.pop() // always remove componentName they can't nest\n }\n const parentBaseTheme = isParentAComponentTheme\n ? base.slice(0, base.length).join(THEME_NAME_SEPARATOR)\n : parentName\n const max = base.length\n const min =\n componentName && !nextName\n ? max // component name only don't search upwards\n : 0\n\n // prettier-ignore\n // eslint-disable-next-line no-console\n if (process.env.NODE_ENV === 'development' && props.debug === 'verbose') [ console.groupCollapsed('ThemeManager.getState()', props, { parentName, parentBaseTheme, base, min, max, isParentAComponentTheme }), console.trace(), console.groupEnd() ]\n\n for (let i = max; i >= min; i--) {\n let prefix = base.slice(0, i).join(THEME_NAME_SEPARATOR)\n if (props.inverse) {\n prefix = inverseThemeName(prefix)\n }\n const potentials: string[] = []\n if (prefix && prefix !== parentBaseTheme) {\n potentials.push(prefix)\n }\n if (nextName) {\n potentials.unshift(prefix ? `${prefix}_${nextName}` : nextName)\n }\n if (i === 1) {\n const lastSegment = potentials.findIndex((x) => !x.includes('_'))\n if (lastSegment > 0) {\n potentials.splice(lastSegment, 0, nextName) // last try prefer our new name to parent\n }\n }\n if (componentName) {\n // components only look for component themes\n if (nextName) {\n potentials.push(\n `${prefix.slice(\n 0,\n prefix.indexOf(THEME_NAME_SEPARATOR)\n )}_${nextName}_${componentName}`\n )\n }\n potentials.push(`${prefix}_${componentName}`)\n if (nextName) {\n potentials.unshift(`${prefix}_${nextName}_${componentName}`)\n }\n }\n\n const found = potentials.find((t) => t in themes)\n\n // eslint-disable-next-line no-console\n if (process.env.NODE_ENV === 'development' && props.debug === 'verbose')\n console.log('getState found', found, 'from', potentials, 'parentName', parentName)\n\n if (found) {\n // optimization return null if not changed\n if (found === parentName) {\n break\n }\n result = {\n name: found,\n theme: getThemeUnwrapped(themes[found]),\n className: getNextThemeClassName(found, props.inverse),\n parentName,\n }\n break\n }\n }\n\n if (parentManager) {\n cache.set(props, [parentManager, result])\n }\n\n return result\n}\n\nconst inverseThemeName = (themeName: string) => {\n return themeName.startsWith('light')\n ? themeName.replace(/^light/, 'dark')\n : themeName.replace(/^dark/, 'light')\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA0B;AAC1B,uBAA6D;AAC7D,+BAAkC;AAFlC;AAsBA,MAAM,aAAgC,EAAE,MAAM,GAAG;AAE1C,SAAS,wBAAwB,OAAmB;AACzD,SAAO,EAAE,MAAM,QAAQ,MAAM,iBAAiB,MAAM,WAAW,MAAM;AACvE;AAEO,MAAM,aAAa;AAAA,EAKxB,YACS,QAAoB,CAAC,GAC5B,eACA;AAFO;AALT,0BAAiB,oBAAI,IAAmB;AACxC,yBAAqC;AACrC,iBAA2B;AAqF3B,iCAA+B;AA/E7B,QAAI,kBAAkB,QAAQ;AAC5B,WAAK,YAAY,OAAO,KAAK;AAC7B;AAAA,IACF;AACA,QAAI,CAAC;AAAe,YAAM;AAE1B,SAAK,iBAAiB,cAAc;AAGpC,QAAI,wBAAwB,KAAK,GAAG;AAClC,aAAO;AAAA,IACT;AACA,QAAI,eAAe;AACjB,WAAK,gBAAgB;AAAA,IACvB;AACA,UAAM,eAAe,KAAK,kBAAkB,KAAK;AACjD,QAAI,cAAc;AAChB,WAAK,QAAQ;AACb;AAAA,IACF;AACA,WAAO,iBAAiB;AAAA,EAC1B;AAAA,EAEA,YACE,QAAmD,KAAK,SAAS,CAAC,GAClE,SAAS,MACT;AACA,UAAM,eAAe,MAAM;AACzB,UAAI,MAAM,YAAY;AACpB,aAAK,MAAM,QAAQ,MAAM;AACzB,aAAK,MAAM,OAAO,MAAM,QAAQ;AAChC,eAAO;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AM;AAGhD,QAAI,QAAQ,IAAI,aAAa,iBAAiB,MAAM,UAAU;AAC5D,cAAQ,IAAI,kBAAkB,OAAO,QAAQ,YAAY,cAAc,UAAU;AAEnF,QAAI,OAAO;AAET,UAAI,UAAU,YAAY;AACxB;AAAA,MACF;AACA,eAAS;AAAA,QACP,MAAM;AAAA,QACN,WAAO,4CAAkB,OAAO,MAAM;AAAA,QACtC,WAAW,sBAAsB,OAAO,MAAM,OAAO;AAAA,QACrD;AAAA,MACF;AACA;AAAA,IACF;AAAA,EACF;AAEA,MAAI,eAAe;AACjB,UAAM,IAAI,OAAO,CAAC,eAAe,MAAM,CAAC;AAAA,EAC1C;AAEA,SAAO;AACT;AAEA,MAAM,mBAAmB,CAAC,cAAsB;AAC9C,SAAO,UAAU,WAAW,OAAO,IAC/B,UAAU,QAAQ,UAAU,MAAM,IAClC,UAAU,QAAQ,SAAS,OAAO;AACxC;",
|
|
6
6
|
"names": ["lastSegment"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Unwrap_exports = {};
|
|
20
|
+
__export(Unwrap_exports, {
|
|
21
|
+
Unwrap: () => Unwrap
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Unwrap_exports);
|
|
24
|
+
const Unwrap = Symbol();
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
Unwrap
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=Unwrap.js.map
|
|
@@ -21,21 +21,17 @@ __export(cache_exports, {
|
|
|
21
21
|
cache: () => cache
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(cache_exports);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
get(key, valStr) {
|
|
29
|
-
var _a;
|
|
30
|
-
return (_a = this.v[key]) == null ? void 0 : _a[valStr];
|
|
31
|
-
}
|
|
32
|
-
set(key, valStr, object) {
|
|
24
|
+
const v = {};
|
|
25
|
+
const cache = {
|
|
26
|
+
get: (key, valStr) => {
|
|
33
27
|
var _a;
|
|
34
|
-
(_a =
|
|
35
|
-
|
|
28
|
+
return (_a = v[key]) == null ? void 0 : _a[valStr];
|
|
29
|
+
},
|
|
30
|
+
set: (key, valStr, object) => {
|
|
31
|
+
v[key] ?? (v[key] = {});
|
|
32
|
+
v[key][valStr] = object;
|
|
36
33
|
}
|
|
37
|
-
}
|
|
38
|
-
const cache = new Cache();
|
|
34
|
+
};
|
|
39
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40
36
|
0 && (module.exports = {
|
|
41
37
|
cache
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/cache.ts"],
|
|
4
|
-
"sourcesContent": ["type Value = Object | Array<any> | string | number\n\nexport type Style = { [key: string]: Value }\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,MAAM,
|
|
4
|
+
"sourcesContent": ["type Value = Object | Array<any> | string | number\n\nexport type Style = { [key: string]: Value }\n\nconst v: Record<string, any> = {}\n\nexport const cache = {\n get: (key: string, valStr: string) => v[key]?.[valStr],\n set: (key: string, valStr: string, object: any) => {\n v[key] ??= {}\n v[key][valStr] = object\n },\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,MAAM,IAAyB,CAAC;AAEzB,MAAM,QAAQ;AAAA,EACnB,KAAK,CAAC,KAAa,WAAgB;AAPrC;AAOwC,mBAAE,SAAF,mBAAS;AAAA;AAAA,EAC/C,KAAK,CAAC,KAAa,QAAgB,WAAgB;AACjD,wBAAW,CAAC;AACZ,MAAE,KAAK,UAAU;AAAA,EACnB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,9 +3,9 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target,
|
|
7
|
-
for (var name in
|
|
8
|
-
__defProp(target, name, { get:
|
|
6
|
+
var __export = (target, all2) => {
|
|
7
|
+
for (var name in all2)
|
|
8
|
+
__defProp(target, name, { get: all2[name], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -22,6 +22,7 @@ __export(expandStyle_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(expandStyle_exports);
|
|
24
24
|
var import_constants = require("@tamagui/constants");
|
|
25
|
+
var _a;
|
|
25
26
|
function expandStyle(key, value) {
|
|
26
27
|
if (process.env.TAMAGUI_TARGET === "web") {
|
|
27
28
|
if (key === "flex") {
|
|
@@ -41,63 +42,50 @@ function expandStyle(key, value) {
|
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
44
|
switch (key) {
|
|
44
|
-
case "aspectRatio": {
|
|
45
|
-
return [[key, value.toString()]];
|
|
46
|
-
}
|
|
47
45
|
case "textAlignVertical": {
|
|
48
46
|
return [["verticalAlign", value === "center" ? "middle" : value]];
|
|
49
47
|
}
|
|
50
|
-
case "textDecorationLine": {
|
|
51
|
-
return [["textDecorationLine", value]];
|
|
52
|
-
}
|
|
53
48
|
case "writingDirection": {
|
|
54
49
|
return [["direction", value]];
|
|
55
50
|
}
|
|
56
51
|
}
|
|
57
52
|
}
|
|
58
|
-
const longKey =
|
|
53
|
+
const longKey = EXPANSIONS[key];
|
|
59
54
|
if (longKey) {
|
|
60
55
|
return longKey.map((key2) => {
|
|
61
56
|
return [key2, value];
|
|
62
57
|
});
|
|
63
58
|
}
|
|
64
59
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
],
|
|
60
|
+
const all = ["Top", "Right", "Bottom", "Left"];
|
|
61
|
+
const horiz = ["Right", "Left"];
|
|
62
|
+
const vert = ["Top", "Bottom"];
|
|
63
|
+
const xy = ["X", "Y"];
|
|
64
|
+
const EXPANSIONS = {
|
|
65
|
+
borderColor: ["TopColor", "RightColor", "BottomColor", "LeftColor"],
|
|
72
66
|
borderRadius: [
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
67
|
+
"TopLeftRadius",
|
|
68
|
+
"TopRightRadius",
|
|
69
|
+
"BottomRightRadius",
|
|
70
|
+
"BottomLeftRadius"
|
|
77
71
|
],
|
|
78
|
-
borderWidth: [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
marginVertical: ["marginTop", "marginBottom"],
|
|
87
|
-
overscrollBehavior: ["overscrollBehaviorX", "overscrollBehaviorY"],
|
|
88
|
-
padding: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
|
|
89
|
-
paddingHorizontal: ["paddingRight", "paddingLeft"],
|
|
90
|
-
paddingVertical: ["paddingTop", "paddingBottom"],
|
|
72
|
+
borderWidth: ["TopWidth", "RightWidth", "BottomWidth", "LeftWidth"],
|
|
73
|
+
margin: all,
|
|
74
|
+
marginHorizontal: horiz,
|
|
75
|
+
marginVertical: vert,
|
|
76
|
+
overscrollBehavior: xy,
|
|
77
|
+
padding: all,
|
|
78
|
+
paddingHorizontal: horiz,
|
|
79
|
+
paddingVertical: vert,
|
|
91
80
|
...import_constants.isWeb && {
|
|
92
|
-
borderStyle: [
|
|
93
|
-
|
|
94
|
-
"borderRightStyle",
|
|
95
|
-
"borderBottomStyle",
|
|
96
|
-
"borderLeftStyle"
|
|
97
|
-
],
|
|
98
|
-
overflow: ["overflowX", "overflowY"]
|
|
81
|
+
borderStyle: ["TopStyle", "RightStyle", "BottomStyle", "LeftStyle"],
|
|
82
|
+
overflow: xy
|
|
99
83
|
}
|
|
100
84
|
};
|
|
85
|
+
for (const parent in EXPANSIONS) {
|
|
86
|
+
const prefix = parent.slice(0, ((_a = /[A-Z]/.exec(parent)) == null ? void 0 : _a.index) ?? parent.length);
|
|
87
|
+
EXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`);
|
|
88
|
+
}
|
|
101
89
|
// Annotate the CommonJS export names for ESM import in node:
|
|
102
90
|
0 && (module.exports = {
|
|
103
91
|
expandStyle
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/expandStyle.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Some parts adapted from react-native-web\n * Copyright (c) Nicolas Gallagher licensed under the MIT license.\n */\n\nimport { isWeb } from '@tamagui/constants'\n\nexport function expandStyle(key: string, value: any) {\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (key === 'flex') {\n // The 'flex' property value in React Native must be a positive integer,\n // 0, or -1.\n if (value <= -1) {\n return [\n ['flexGrow', 0],\n ['flexShrink', 1],\n ['flexBasis', 'auto'],\n ]\n }\n // normalizing to better align with native\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n if (value >= 0) {\n return [\n ['flexGrow', value],\n ['flexShrink', 1],\n ]\n }\n return\n }\n\n // web only\n switch (key) {\n case '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,uBAAsB;
|
|
4
|
+
"sourcesContent": ["/**\n * Some parts adapted from react-native-web\n * Copyright (c) Nicolas Gallagher licensed under the MIT license.\n */\n\nimport { isWeb } from '@tamagui/constants'\n\nexport function expandStyle(key: string, value: any) {\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (key === 'flex') {\n // The 'flex' property value in React Native must be a positive integer,\n // 0, or -1.\n if (value <= -1) {\n return [\n ['flexGrow', 0],\n ['flexShrink', 1],\n ['flexBasis', 'auto'],\n ]\n }\n // normalizing to better align with native\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n if (value >= 0) {\n return [\n ['flexGrow', value],\n ['flexShrink', 1],\n ]\n }\n return\n }\n\n // web only\n switch (key) {\n case 'textAlignVertical': {\n return [['verticalAlign', value === 'center' ? 'middle' : value]]\n }\n case 'writingDirection': {\n return [['direction', value]]\n }\n }\n }\n\n const longKey = EXPANSIONS[key]\n if (longKey) {\n return longKey.map((key) => {\n return [key, value]\n })\n }\n}\n\nconst all = ['Top', 'Right', 'Bottom', 'Left']\nconst horiz = ['Right', 'Left']\nconst vert = ['Top', 'Bottom']\nconst xy = ['X', 'Y']\n\nconst EXPANSIONS: Record<string, string[]> = {\n borderColor: ['TopColor', 'RightColor', 'BottomColor', 'LeftColor'],\n borderRadius: [\n 'TopLeftRadius',\n 'TopRightRadius',\n 'BottomRightRadius',\n 'BottomLeftRadius',\n ],\n borderWidth: ['TopWidth', 'RightWidth', 'BottomWidth', 'LeftWidth'],\n margin: all,\n marginHorizontal: horiz,\n marginVertical: vert,\n overscrollBehavior: xy,\n padding: all,\n paddingHorizontal: horiz,\n paddingVertical: vert,\n ...(isWeb && {\n // react-native only supports borderStyle\n borderStyle: ['TopStyle', 'RightStyle', 'BottomStyle', 'LeftStyle'],\n // react-native doesn't support X / Y\n overflow: xy,\n }),\n}\n\nfor (const parent in EXPANSIONS) {\n const prefix = parent.slice(0, /[A-Z]/.exec(parent)?.index ?? parent.length)\n EXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`)\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,uBAAsB;AALtB;AAOO,SAAS,YAAY,KAAa,OAAY;AACnD,MAAI,QAAQ,IAAI,mBAAmB,OAAO;AACxC,QAAI,QAAQ,QAAQ;AAGlB,UAAI,SAAS,IAAI;AACf,eAAO;AAAA,UACL,CAAC,YAAY,CAAC;AAAA,UACd,CAAC,cAAc,CAAC;AAAA,UAChB,CAAC,aAAa,MAAM;AAAA,QACtB;AAAA,MACF;AAGA,UAAI,SAAS,GAAG;AACd,eAAO;AAAA,UACL,CAAC,YAAY,KAAK;AAAA,UAClB,CAAC,cAAc,CAAC;AAAA,QAClB;AAAA,MACF;AACA;AAAA,IACF;AAGA,YAAQ;AAAA,WACD,qBAAqB;AACxB,eAAO,CAAC,CAAC,iBAAiB,UAAU,WAAW,WAAW,KAAK,CAAC;AAAA,MAClE;AAAA,WACK,oBAAoB;AACvB,eAAO,CAAC,CAAC,aAAa,KAAK,CAAC;AAAA,MAC9B;AAAA;AAAA,EAEJ;AAEA,QAAM,UAAU,WAAW;AAC3B,MAAI,SAAS;AACX,WAAO,QAAQ,IAAI,CAACA,SAAQ;AAC1B,aAAO,CAACA,MAAK,KAAK;AAAA,IACpB,CAAC;AAAA,EACH;AACF;AAEA,MAAM,MAAM,CAAC,OAAO,SAAS,UAAU,MAAM;AAC7C,MAAM,QAAQ,CAAC,SAAS,MAAM;AAC9B,MAAM,OAAO,CAAC,OAAO,QAAQ;AAC7B,MAAM,KAAK,CAAC,KAAK,GAAG;AAEpB,MAAM,aAAuC;AAAA,EAC3C,aAAa,CAAC,YAAY,cAAc,eAAe,WAAW;AAAA,EAClE,cAAc;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,aAAa,CAAC,YAAY,cAAc,eAAe,WAAW;AAAA,EAClE,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,GAAI,0BAAS;AAAA,IAEX,aAAa,CAAC,YAAY,cAAc,eAAe,WAAW;AAAA,IAElE,UAAU;AAAA,EACZ;AACF;AAEA,WAAW,UAAU,YAAY;AAC/B,QAAM,SAAS,OAAO,MAAM,KAAG,aAAQ,KAAK,MAAM,MAAnB,mBAAsB,UAAS,OAAO,MAAM;AAC3E,aAAW,UAAU,WAAW,QAAQ,IAAI,CAAC,MAAM,GAAG,SAAS,GAAG;AACpE;",
|
|
6
6
|
"names": ["key"]
|
|
7
7
|
}
|
|
@@ -22,13 +22,10 @@ __export(getBoundingClientRect_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(getBoundingClientRect_exports);
|
|
24
24
|
const getBoundingClientRect = (node) => {
|
|
25
|
-
|
|
25
|
+
var _a;
|
|
26
|
+
if (!node || node.nodeType !== 1)
|
|
26
27
|
return;
|
|
27
|
-
|
|
28
|
-
return;
|
|
29
|
-
if (node.getBoundingClientRect) {
|
|
30
|
-
return node.getBoundingClientRect();
|
|
31
|
-
}
|
|
28
|
+
return (_a = node.getBoundingClientRect) == null ? void 0 : _a.call(node);
|
|
32
29
|
};
|
|
33
30
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34
31
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/getBoundingClientRect.tsx"],
|
|
4
|
-
"sourcesContent": ["export const getBoundingClientRect = (node: HTMLElement | null): void | DOMRect => {\n if (!node
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,wBAAwB,CAAC,SAA6C;
|
|
4
|
+
"sourcesContent": ["export const getBoundingClientRect = (node: HTMLElement | null): void | DOMRect => {\n if (!node || node.nodeType !== 1) return\n return node.getBoundingClientRect?.()\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,wBAAwB,CAAC,SAA6C;AAAnF;AACE,MAAI,CAAC,QAAQ,KAAK,aAAa;AAAG;AAClC,UAAO,UAAK,0BAAL;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -302,20 +302,11 @@ const getSplitStyles = (props, staticConfig, theme, state, parentSplitStyles, la
|
|
|
302
302
|
}
|
|
303
303
|
break;
|
|
304
304
|
}
|
|
305
|
-
case "
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
305
|
+
case "accessibilityLabelledBy":
|
|
306
|
+
case "accessibilityFlowTo":
|
|
307
|
+
case "accessibilityControls":
|
|
309
308
|
case "accessibilityDescribedBy": {
|
|
310
|
-
viewProps[
|
|
311
|
-
break;
|
|
312
|
-
}
|
|
313
|
-
case "accessibilityFlowTo": {
|
|
314
|
-
viewProps["aria-flowto"] = processIDRefList(valInit);
|
|
315
|
-
break;
|
|
316
|
-
}
|
|
317
|
-
case "accessibilityLabelledBy": {
|
|
318
|
-
viewProps["aria-labelledby"] = processIDRefList(valInit);
|
|
309
|
+
viewProps[`aria-${keyInit.replace("accessibility", "").toLowerCase()}`] = processIDRefList(valInit);
|
|
319
310
|
break;
|
|
320
311
|
}
|
|
321
312
|
case "accessibilityKeyShortcuts": {
|
|
@@ -455,7 +446,10 @@ const getSplitStyles = (props, staticConfig, theme, state, parentSplitStyles, la
|
|
|
455
446
|
}
|
|
456
447
|
}
|
|
457
448
|
} else {
|
|
458
|
-
|
|
449
|
+
let isDisabled = !state[descriptor.stateKey || descriptor.name];
|
|
450
|
+
if (import_constants.isWeb && !import_constants.isClient && isEnter) {
|
|
451
|
+
isDisabled = false;
|
|
452
|
+
}
|
|
459
453
|
if (!isDisabled) {
|
|
460
454
|
usedKeys[key] || (usedKeys[key] = 1);
|
|
461
455
|
}
|