@tamagui/core 1.0.1-beta.47 → 1.0.1-beta.50
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/Tamagui.js +3 -0
- package/dist/cjs/Tamagui.js.map +2 -2
- package/dist/cjs/ThemeManager.js.map +2 -2
- package/dist/cjs/conf.js +0 -4
- package/dist/cjs/conf.js.map +2 -2
- package/dist/cjs/createComponent.js +173 -169
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createTamagui.js +71 -29
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTheme.js +3 -1
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/createTokens.js +4 -19
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createVariable.js +22 -8
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariables.js +57 -0
- package/dist/cjs/createVariables.js.map +7 -0
- package/dist/cjs/helpers/createPropMapper.js +81 -51
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/generateAtomicStyles.js +41 -36
- package/dist/cjs/helpers/generateAtomicStyles.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +39 -5
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStackSize.js +4 -4
- package/dist/cjs/helpers/getStackSize.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +9 -2
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/insertStyleRule.js +2 -0
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/validate.js +2 -2
- package/dist/cjs/helpers/validate.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js +2 -2
- package/dist/cjs/hooks/useIsMounted.js.map +2 -2
- package/dist/cjs/index.js +2 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/styled.js +5 -0
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Theme.js +3 -2
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/esm/Tamagui.js +3 -0
- package/dist/esm/Tamagui.js.map +2 -2
- package/dist/esm/ThemeManager.js.map +2 -2
- package/dist/esm/conf.js +0 -4
- package/dist/esm/conf.js.map +2 -2
- package/dist/esm/createComponent.js +173 -170
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createTamagui.js +70 -29
- 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/createTokens.js +3 -17
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createVariable.js +22 -7
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariables.js +35 -0
- package/dist/esm/createVariables.js.map +7 -0
- package/dist/esm/helpers/createPropMapper.js +70 -51
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/generateAtomicStyles.js +41 -36
- package/dist/esm/helpers/generateAtomicStyles.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +40 -6
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStackSize.js +1 -1
- package/dist/esm/helpers/getStackSize.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +7 -1
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +2 -0
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/helpers/validate.js +2 -2
- package/dist/esm/helpers/validate.js.map +2 -2
- package/dist/esm/hooks/useIsMounted.js +1 -1
- package/dist/esm/hooks/useIsMounted.js.map +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/styled.js +5 -0
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/views/Theme.js +3 -2
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/jsx/Tamagui.js +3 -0
- package/dist/jsx/conf.js +0 -4
- package/dist/jsx/createComponent.js +173 -170
- package/dist/jsx/createTamagui.js +70 -29
- package/dist/jsx/createTheme.js +3 -1
- package/dist/jsx/createTokens.js +3 -17
- package/dist/jsx/createVariable.js +22 -7
- package/dist/jsx/createVariables.js +34 -0
- package/dist/jsx/helpers/createPropMapper.js +70 -51
- package/dist/jsx/helpers/generateAtomicStyles.js +41 -36
- package/dist/jsx/helpers/getSplitStyles.js +40 -6
- package/dist/jsx/helpers/getStackSize.js +1 -1
- package/dist/jsx/helpers/getStylesAtomic.js +7 -1
- package/dist/jsx/helpers/insertStyleRule.js +2 -0
- package/dist/jsx/helpers/validate.js +2 -2
- package/dist/jsx/hooks/useIsMounted.js +1 -1
- package/dist/jsx/index.js +2 -2
- package/dist/jsx/styled.js +5 -0
- package/dist/jsx/views/Theme.js +3 -2
- package/package.json +5 -5
- package/types/ThemeManager.d.ts.map +1 -1
- package/types/conf.d.ts +1 -1
- package/types/conf.d.ts.map +1 -1
- package/types/createComponent.d.ts +1 -0
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTheme.d.ts +1 -1
- package/types/createTheme.d.ts.map +1 -1
- package/types/createTokens.d.ts +0 -1
- package/types/createTokens.d.ts.map +1 -1
- package/types/createVariable.d.ts +15 -13
- package/types/createVariable.d.ts.map +1 -1
- package/types/createVariables.d.ts +10 -0
- package/types/createVariables.d.ts.map +1 -0
- package/types/helpers/createPropMapper.d.ts.map +1 -1
- package/types/helpers/generateAtomicStyles.d.ts.map +1 -1
- package/types/helpers/getSize.d.ts +1 -1
- package/types/helpers/getSize.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStackSize.d.ts +4 -5
- package/types/helpers/getStackSize.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts +5 -0
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/hooks/useIsMounted.d.ts.map +1 -1
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +10 -7
- package/types/types.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
package/dist/cjs/Tamagui.js
CHANGED
|
@@ -60,6 +60,9 @@ const getValueFromIdentifier = /* @__PURE__ */ __name((identifier) => {
|
|
|
60
60
|
const setIdentifierValue = /* @__PURE__ */ __name((identifier, value) => {
|
|
61
61
|
identifierToValue.set(identifier, value);
|
|
62
62
|
}, "setIdentifierValue");
|
|
63
|
+
if (!globalThis["Tamagui"]) {
|
|
64
|
+
globalThis["Tamagui"] = Tamagui;
|
|
65
|
+
}
|
|
63
66
|
// Annotate the CommonJS export names for ESM import in node:
|
|
64
67
|
0 && (module.exports = {
|
|
65
68
|
Tamagui,
|
package/dist/cjs/Tamagui.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Tamagui.ts"],
|
|
4
|
-
"sourcesContent": ["import * as Helpers from '@tamagui/helpers'\n\nimport { getConfig } from './conf'\nimport { rnw } from './constants/rnw'\nimport { getAllSelectors, getAllTransforms, getInsertedRules } from './helpers/insertStyleRule'\nimport { TamaguiInternalConfig } from './types'\n\n// serves a central store for state\n\nclass TamaguiManager {\n rnw = rnw\n Helpers = Helpers\n\n get config() {\n return getConfig()\n }\n\n get insertedRules() {\n return getInsertedRules()\n }\n\n get allSelectors() {\n return getAllSelectors()\n }\n\n get allTransforms() {\n return getAllTransforms()\n }\n\n get identifierToValue() {\n return identifierToValue\n }\n}\n\nexport const Tamagui = new TamaguiManager()\n\nconst identifierToValue = new Map<string, any>()\n\nexport const getValueFromIdentifier = (identifier: string) => {\n return identifierToValue.get(identifier)\n}\n\nexport const setIdentifierValue = (identifier: string, value: any) => {\n identifierToValue.set(identifier, value)\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAyB;AAEzB,kBAA0B;AAC1B,iBAAoB;AACpB,6BAAoE;AAKpE,MAAM,eAAe;AAAA,EAArB;AACE,eAAM;AACN,mBAAU;AAAA;AAAA,EAEV,IAAI,SAAS;AACX,WAAO,2BAAU;AAAA,EACnB;AAAA,EAEA,IAAI,gBAAgB;AAClB,WAAO,6CAAiB;AAAA,EAC1B;AAAA,EAEA,IAAI,eAAe;AACjB,WAAO,4CAAgB;AAAA,EACzB;AAAA,EAEA,IAAI,gBAAgB;AAClB,WAAO,6CAAiB;AAAA,EAC1B;AAAA,EAEA,IAAI,oBAAoB;AACtB,WAAO;AAAA,EACT;AACF;AAvBM;AAyBC,MAAM,UAAU,IAAI,eAAe;AAE1C,MAAM,oBAAoB,oBAAI,IAAiB;AAExC,MAAM,yBAAyB,wBAAC,eAAuB;AAC5D,SAAO,kBAAkB,IAAI,UAAU;AACzC,GAFsC;AAI/B,MAAM,qBAAqB,wBAAC,YAAoB,UAAe;AACpE,oBAAkB,IAAI,YAAY,KAAK;AACzC,GAFkC;",
|
|
4
|
+
"sourcesContent": ["import * as Helpers from '@tamagui/helpers'\n\nimport { getConfig } from './conf'\nimport { rnw } from './constants/rnw'\nimport { getAllSelectors, getAllTransforms, getInsertedRules } from './helpers/insertStyleRule'\nimport { TamaguiInternalConfig } from './types'\n\n// serves a central store for state\n\nclass TamaguiManager {\n rnw = rnw\n Helpers = Helpers\n\n get config() {\n return getConfig()\n }\n\n get insertedRules() {\n return getInsertedRules()\n }\n\n get allSelectors() {\n return getAllSelectors()\n }\n\n get allTransforms() {\n return getAllTransforms()\n }\n\n get identifierToValue() {\n return identifierToValue\n }\n}\n\nexport const Tamagui = new TamaguiManager()\n\nconst identifierToValue = new Map<string, any>()\n\nexport const getValueFromIdentifier = (identifier: string) => {\n return identifierToValue.get(identifier)\n}\n\nexport const setIdentifierValue = (identifier: string, value: any) => {\n identifierToValue.set(identifier, value)\n}\n\nif (!globalThis['Tamagui']) {\n globalThis['Tamagui'] = Tamagui\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAyB;AAEzB,kBAA0B;AAC1B,iBAAoB;AACpB,6BAAoE;AAKpE,MAAM,eAAe;AAAA,EAArB;AACE,eAAM;AACN,mBAAU;AAAA;AAAA,EAEV,IAAI,SAAS;AACX,WAAO,2BAAU;AAAA,EACnB;AAAA,EAEA,IAAI,gBAAgB;AAClB,WAAO,6CAAiB;AAAA,EAC1B;AAAA,EAEA,IAAI,eAAe;AACjB,WAAO,4CAAgB;AAAA,EACzB;AAAA,EAEA,IAAI,gBAAgB;AAClB,WAAO,6CAAiB;AAAA,EAC1B;AAAA,EAEA,IAAI,oBAAoB;AACtB,WAAO;AAAA,EACT;AACF;AAvBM;AAyBC,MAAM,UAAU,IAAI,eAAe;AAE1C,MAAM,oBAAoB,oBAAI,IAAiB;AAExC,MAAM,yBAAyB,wBAAC,eAAuB;AAC5D,SAAO,kBAAkB,IAAI,UAAU;AACzC,GAFsC;AAI/B,MAAM,qBAAqB,wBAAC,YAAoB,UAAe;AACpE,oBAAkB,IAAI,YAAY,KAAK;AACzC,GAFkC;AAIlC,IAAI,CAAC,WAAW,YAAY;AAC1B,aAAW,aAAa;AAC1B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ThemeManager.tsx"],
|
|
4
|
-
"sourcesContent": ["import { createContext } from 'react'\n\nimport { getThemes } from './conf'\nimport { THEME_CLASSNAME_PREFIX, THEME_NAME_SEPARATOR } from './constants/constants'\nimport { ThemeObject, Themes } 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}\n\nexport type GetNextThemeProps = {\n themes?: Themes\n name?: string | null\n componentName?: string | null\n reset?: boolean\n}\n\nexport class ThemeManager {\n keys = new Map<any, Set<string>>()\n listeners = new Map<any, Function>()\n themeListeners = new Set<ThemeListener>()\n className: string | null = null\n\n constructor(\n public name: string = '',\n public theme: ThemeObject | null = null,\n public parentManager: ThemeManager | null = null,\n public reset: boolean = false\n ) {\n // find the nearest different parentManager\n let parent = parentManager\n let tries = 0\n while (true) {\n tries++\n if (tries > 10) {\n throw new Error(`Nested 10 of the same theme in a row, likely error`)\n }\n if (!parent) break\n if (parent.name === name) {\n // go up if same\n parent = parent.parentManager\n } else {\n this.parentManager = parent\n break\n }\n }\n }\n\n get parentName() {\n return this.parentManager?.name || null\n }\n\n get fullName(): string {\n return this.getNextTheme().name || this.name || ''\n // const parentName = this.parentManager?.fullName || ''\n // const name = this.name || ''\n // const parts = [...new Set([...`${parentName}_${name}`.split('_')])].filter(Boolean)\n // return parts.join('_')\n }\n\n // gets value going up to parents\n getValue(key: string) {\n let theme = this.theme\n let manager = this as ThemeManager | null\n while (true) {\n if (!theme) return\n if (key in theme) {\n return theme[key]\n }\n manager = this.parentManager\n if (!manager) {\n return\n }\n if (manager.theme === theme) {\n return\n }\n theme = manager.theme\n }\n }\n\n update({ name, theme, className }: SetActiveThemeProps = {}) {\n // className compare on web, avoids light/dark re-renders\n const nameChanged = name !== this.name\n if (!nameChanged) {\n return false\n }\n this.className = className || null\n this.name = name || ''\n this.theme = theme\n this.notifyListeners()\n return true\n }\n\n getNextTheme(props: GetNextThemeProps = {}, debug?: any) {\n const { themes = getThemes(), name, componentName } = props\n\n if (props.reset && name) {\n return {\n name: name,\n theme: themes[name],\n className: this.#getClassName(name),\n }\n }\n\n const parentIsReset = this.parentManager?.reset\n\n if (!name) {\n if (componentName) {\n // allow for _Card_Button or just _Button\n const names = [\n `${this.name}_${componentName}`,\n `${withoutComponentName(this.name)}_${componentName}`,\n ]\n for (const name of names) {\n if (name in themes) {\n const className = this.#getClassName(name)\n return { name, theme: themes[name], className }\n }\n }\n }\n return {\n name: this.name,\n theme: this.theme,\n }\n }\n\n let nextName = name || this.name || ''\n let parentName = parentIsReset ? this.parentName || this.fullName : this.fullName\n\n while (true) {\n if (nextName in themes) {\n break\n }\n nextName = `${parentName}_${name}`\n if (nextName in themes) {\n break\n }\n if (!parentName.includes(THEME_NAME_SEPARATOR)) {\n // not found!\n console.warn('theme not found', name)\n break\n }\n // go up one\n parentName = parentName.slice(0, parentName.lastIndexOf(THEME_NAME_SEPARATOR))\n }\n\n if (componentName) {\n // allow for _Card_Button or just _Button\n const names = [\n `${nextName}_${componentName}`,\n `${withoutComponentName(nextName)}_${componentName}`,\n ]\n for (const name of names) {\n if (name in themes) {\n nextName = name\n }\n }\n }\n\n let theme = themes[nextName]\n if (!theme) {\n theme = themes[`light_${nextName}`]\n }\n\n if (process.env.NODE_ENV === 'development' && debug) {\n console.log('getNextTheme', { props, nextName, parentName }, this)\n }\n\n return {\n name: nextName,\n theme,\n className: this.#getClassName(nextName),\n }\n }\n\n #getClassName(name: string) {\n return `${THEME_CLASSNAME_PREFIX}${name} tui_theme`.replace('light_', '').replace('dark_', '')\n }\n\n track(uuid: any, keys: Set<string>) {\n if (!this.name) return\n this.keys.set(uuid, keys)\n }\n\n notifyListeners() {\n if (!this.name) {\n this.keys.clear()\n }\n for (const [uuid, keys] of this.keys.entries()) {\n if (keys.size) {\n this.listeners.get(uuid)?.()\n }\n }\n this.themeListeners.forEach((cb) => cb(this.name, this))\n }\n\n onChangeTheme(cb: ThemeListener) {\n this.themeListeners.add(cb)\n return () => {\n this.themeListeners.delete(cb)\n }\n }\n\n onUpdate(uuid: any, cb: Function) {\n this.listeners.set(uuid, cb)\n return () => {\n this.listeners.delete(uuid)\n this.keys.delete(uuid)\n }\n }\n}\n\nexport const ThemeManagerContext = createContext<ThemeManager | null>(null)\nexport const emptyManager = new ThemeManager()\n\nconst withoutComponentName = (name: string) => name.replace(/(\\_[A-Z][a-zA-Z]+)+$/g, '')\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8B;AAE9B,kBAA0B;AAC1B,uBAA6D;AAH7D;AAsBO,MAAM,aAAa;AAAA,EAMxB,YACS,OAAe,IACf,QAA4B,MAC5B,gBAAqC,MACrC,QAAiB,OACxB;AAJO;AACA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["import { createContext } from 'react'\n\nimport { getThemes } from './conf'\nimport { THEME_CLASSNAME_PREFIX, THEME_NAME_SEPARATOR } from './constants/constants'\nimport { ThemeObject, Themes } 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}\n\nexport type GetNextThemeProps = {\n themes?: Themes\n name?: string | null\n componentName?: string | null\n reset?: boolean\n}\n\nexport class ThemeManager {\n keys = new Map<any, Set<string>>()\n listeners = new Map<any, Function>()\n themeListeners = new Set<ThemeListener>()\n className: string | null = null\n\n constructor(\n public name: string = '',\n public theme: ThemeObject | null = null,\n public parentManager: ThemeManager | null = null,\n public reset: boolean = false\n ) {\n // find the nearest different parentManager\n let parent = parentManager\n let tries = 0\n while (true) {\n tries++\n if (tries > 10) {\n throw new Error(`Nested 10 of the same theme in a row, likely error`)\n }\n if (!parent) break\n if (parent.name === name) {\n // go up if same\n parent = parent.parentManager\n } else {\n this.parentManager = parent\n break\n }\n }\n }\n\n get parentName() {\n return this.parentManager?.name || null\n }\n\n get fullName(): string {\n return this.getNextTheme().name || this.name || ''\n // const parentName = this.parentManager?.fullName || ''\n // const name = this.name || ''\n // const parts = [...new Set([...`${parentName}_${name}`.split('_')])].filter(Boolean)\n // return parts.join('_')\n }\n\n // gets value going up to parents\n getValue(key: string) {\n let theme = this.theme\n let manager = this as ThemeManager | null\n while (true) {\n if (!theme) return\n if (key in theme) {\n return theme[key]\n }\n manager = this.parentManager\n if (!manager) {\n return\n }\n if (manager.theme === theme) {\n return\n }\n theme = manager.theme\n }\n }\n\n update({ name, theme, className }: SetActiveThemeProps = {}) {\n // className compare on web, avoids light/dark re-renders\n const nameChanged = name !== this.name\n if (!nameChanged) {\n return false\n }\n this.className = className || null\n this.name = name || ''\n this.theme = theme\n this.notifyListeners()\n return true\n }\n\n getNextTheme(props: GetNextThemeProps = {}, debug?: any) {\n const { themes = getThemes(), name, componentName } = props\n\n if (props.reset && name) {\n return {\n name: name,\n theme: themes[name],\n className: this.#getClassName(name),\n }\n }\n\n const parentIsReset = this.parentManager?.reset\n\n if (!name) {\n if (componentName) {\n // allow for _Card_Button or just _Button\n const names = [\n `${this.name}_${componentName}`,\n `${withoutComponentName(this.name)}_${componentName}`,\n ]\n for (const name of names) {\n if (name in themes) {\n const className = this.#getClassName(name)\n return { name, theme: themes[name], className }\n }\n }\n }\n return {\n name: this.name,\n theme: this.theme,\n }\n }\n\n let nextName = name || this.name || ''\n let parentName = parentIsReset ? this.parentName || this.fullName : this.fullName\n\n while (true) {\n if (nextName in themes) {\n break\n }\n nextName = `${parentName}_${name}`\n if (nextName in themes) {\n break\n }\n if (!parentName.includes(THEME_NAME_SEPARATOR)) {\n // not found!\n console.warn('theme not found', name)\n // this happens in next during _document.getInitialProps and has a terrible/non-existent stack trace\n // throw new Error(`Theme not found: ${name}`)\n break\n }\n // go up one\n parentName = parentName.slice(0, parentName.lastIndexOf(THEME_NAME_SEPARATOR))\n }\n\n if (componentName) {\n // allow for _Card_Button or just _Button\n const names = [\n `${nextName}_${componentName}`,\n `${withoutComponentName(nextName)}_${componentName}`,\n ]\n for (const name of names) {\n if (name in themes) {\n nextName = name\n }\n }\n }\n\n let theme = themes[nextName]\n if (!theme) {\n theme = themes[`light_${nextName}`]\n }\n\n if (process.env.NODE_ENV === 'development' && debug) {\n console.log('getNextTheme', { props, nextName, parentName }, this)\n }\n\n return {\n name: nextName,\n theme,\n className: this.#getClassName(nextName),\n }\n }\n\n #getClassName(name: string) {\n return `${THEME_CLASSNAME_PREFIX}${name} tui_theme`.replace('light_', '').replace('dark_', '')\n }\n\n track(uuid: any, keys: Set<string>) {\n if (!this.name) return\n this.keys.set(uuid, keys)\n }\n\n notifyListeners() {\n if (!this.name) {\n this.keys.clear()\n }\n for (const [uuid, keys] of this.keys.entries()) {\n if (keys.size) {\n this.listeners.get(uuid)?.()\n }\n }\n this.themeListeners.forEach((cb) => cb(this.name, this))\n }\n\n onChangeTheme(cb: ThemeListener) {\n this.themeListeners.add(cb)\n return () => {\n this.themeListeners.delete(cb)\n }\n }\n\n onUpdate(uuid: any, cb: Function) {\n this.listeners.set(uuid, cb)\n return () => {\n this.listeners.delete(uuid)\n this.keys.delete(uuid)\n }\n }\n}\n\nexport const ThemeManagerContext = createContext<ThemeManager | null>(null)\nexport const emptyManager = new ThemeManager()\n\nconst withoutComponentName = (name: string) => name.replace(/(\\_[A-Z][a-zA-Z]+)+$/g, '')\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/conf.js
CHANGED
|
@@ -27,7 +27,6 @@ __export(conf_exports, {
|
|
|
27
27
|
setConfig: () => setConfig
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(conf_exports);
|
|
30
|
-
var import_Tamagui = require("./Tamagui");
|
|
31
30
|
let conf;
|
|
32
31
|
const setConfig = /* @__PURE__ */ __name((next) => {
|
|
33
32
|
conf = next;
|
|
@@ -47,9 +46,6 @@ const onConfiguredOnce = /* @__PURE__ */ __name((cb) => {
|
|
|
47
46
|
} else {
|
|
48
47
|
configListeners.add(cb);
|
|
49
48
|
}
|
|
50
|
-
if (!globalThis["Tamagui"]) {
|
|
51
|
-
globalThis["Tamagui"] = import_Tamagui.Tamagui;
|
|
52
|
-
}
|
|
53
49
|
}, "onConfiguredOnce");
|
|
54
50
|
// Annotate the CommonJS export names for ESM import in node:
|
|
55
51
|
0 && (module.exports = {
|
package/dist/cjs/conf.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/conf.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import { ConfigListener, TamaguiInternalConfig } from './types'\n\nlet conf: TamaguiInternalConfig | null\n\nexport const setConfig = (next: TamaguiInternalConfig) => {\n conf = next\n if (configListeners.size) {\n configListeners.forEach((cb) => cb(conf!))\n configListeners.clear()\n }\n}\n\nexport const getHasConfigured = () => !!conf\nexport const getConfig = () => conf!\nexport const getTokens = () => conf!.tokensParsed\nexport const getThemes = () => conf!.themes\n\nexport const configListeners = new Set<ConfigListener>()\n\nexport const onConfiguredOnce = (cb: ConfigListener) => {\n if (conf) {\n cb(conf!)\n } else {\n configListeners.add(cb)\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAI;AAEG,MAAM,YAAY,wBAAC,SAAgC;AACxD,SAAO;AACP,MAAI,gBAAgB,MAAM;AACxB,oBAAgB,QAAQ,CAAC,OAAO,GAAG,IAAK,CAAC;AACzC,oBAAgB,MAAM;AAAA,EACxB;AACF,GANyB;AAQlB,MAAM,mBAAmB,6BAAM,CAAC,CAAC,MAAR;AACzB,MAAM,YAAY,6BAAM,MAAN;AAClB,MAAM,YAAY,6BAAM,KAAM,cAAZ;AAClB,MAAM,YAAY,6BAAM,KAAM,QAAZ;AAElB,MAAM,kBAAkB,oBAAI,IAAoB;AAEhD,MAAM,mBAAmB,wBAAC,OAAuB;AACtD,MAAI,MAAM;AACR,OAAG,IAAK;AAAA,EACV,OAAO;AACL,oBAAgB,IAAI,EAAE;AAAA,EACxB;AACF,GANgC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -53,6 +53,7 @@ __export(createComponent_exports, {
|
|
|
53
53
|
AbsoluteFill: () => AbsoluteFill,
|
|
54
54
|
Spacer: () => Spacer,
|
|
55
55
|
Unspaced: () => Unspaced,
|
|
56
|
+
assignNativePropsToWeb: () => assignNativePropsToWeb,
|
|
56
57
|
createComponent: () => createComponent,
|
|
57
58
|
mouseUps: () => mouseUps,
|
|
58
59
|
spacedChildren: () => spacedChildren
|
|
@@ -378,164 +379,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
378
379
|
"onLayout"
|
|
379
380
|
]);
|
|
380
381
|
viewProps = webProps;
|
|
381
|
-
|
|
382
|
-
if (accessibilityRole === "none") {
|
|
383
|
-
viewProps.role = "presentation";
|
|
384
|
-
} else {
|
|
385
|
-
const webRole = accessibilityRoleToWebRole[accessibilityRole];
|
|
386
|
-
if (webRole != null) {
|
|
387
|
-
viewProps.role = webRole || accessibilityRole;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
const role = viewProps.role;
|
|
392
|
-
if (accessibilityActiveDescendant != null) {
|
|
393
|
-
viewProps["aria-activedescendant"] = accessibilityActiveDescendant;
|
|
394
|
-
}
|
|
395
|
-
if (accessibilityAtomic != null) {
|
|
396
|
-
viewProps["aria-atomic"] = accessibilityAtomic;
|
|
397
|
-
}
|
|
398
|
-
if (accessibilityAutoComplete != null) {
|
|
399
|
-
viewProps["aria-autocomplete"] = accessibilityAutoComplete;
|
|
400
|
-
}
|
|
401
|
-
if (accessibilityBusy != null) {
|
|
402
|
-
viewProps["aria-busy"] = accessibilityBusy;
|
|
403
|
-
}
|
|
404
|
-
if (accessibilityChecked != null) {
|
|
405
|
-
viewProps["aria-checked"] = accessibilityChecked;
|
|
406
|
-
}
|
|
407
|
-
if (accessibilityColumnCount != null) {
|
|
408
|
-
viewProps["aria-colcount"] = accessibilityColumnCount;
|
|
409
|
-
}
|
|
410
|
-
if (accessibilityColumnIndex != null) {
|
|
411
|
-
viewProps["aria-colindex"] = accessibilityColumnIndex;
|
|
412
|
-
}
|
|
413
|
-
if (accessibilityColumnSpan != null) {
|
|
414
|
-
viewProps["aria-colspan"] = accessibilityColumnSpan;
|
|
415
|
-
}
|
|
416
|
-
if (accessibilityControls != null) {
|
|
417
|
-
viewProps["aria-controls"] = processIDRefList(accessibilityControls);
|
|
418
|
-
}
|
|
419
|
-
if (accessibilityCurrent != null) {
|
|
420
|
-
viewProps["aria-current"] = accessibilityCurrent;
|
|
421
|
-
}
|
|
422
|
-
if (accessibilityDescribedBy != null) {
|
|
423
|
-
viewProps["aria-describedby"] = processIDRefList(accessibilityDescribedBy);
|
|
424
|
-
}
|
|
425
|
-
if (accessibilityDetails != null) {
|
|
426
|
-
viewProps["aria-details"] = accessibilityDetails;
|
|
427
|
-
}
|
|
428
|
-
if (disabled === true) {
|
|
429
|
-
viewProps["aria-disabled"] = true;
|
|
430
|
-
if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
431
|
-
viewProps.disabled = true;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
if (accessibilityErrorMessage != null) {
|
|
435
|
-
viewProps["aria-errormessage"] = accessibilityErrorMessage;
|
|
436
|
-
}
|
|
437
|
-
if (accessibilityExpanded != null) {
|
|
438
|
-
viewProps["aria-expanded"] = accessibilityExpanded;
|
|
439
|
-
}
|
|
440
|
-
if (accessibilityFlowTo != null) {
|
|
441
|
-
viewProps["aria-flowto"] = processIDRefList(accessibilityFlowTo);
|
|
442
|
-
}
|
|
443
|
-
if (accessibilityHasPopup != null) {
|
|
444
|
-
viewProps["aria-haspopup"] = accessibilityHasPopup;
|
|
445
|
-
}
|
|
446
|
-
if (accessibilityHidden === true) {
|
|
447
|
-
viewProps["aria-hidden"] = accessibilityHidden;
|
|
448
|
-
}
|
|
449
|
-
if (accessibilityInvalid != null) {
|
|
450
|
-
viewProps["aria-invalid"] = accessibilityInvalid;
|
|
451
|
-
}
|
|
452
|
-
if (accessibilityKeyShortcuts != null && Array.isArray(accessibilityKeyShortcuts)) {
|
|
453
|
-
viewProps["aria-keyshortcuts"] = accessibilityKeyShortcuts.join(" ");
|
|
454
|
-
}
|
|
455
|
-
if (accessibilityLabel != null) {
|
|
456
|
-
viewProps["aria-label"] = accessibilityLabel;
|
|
457
|
-
}
|
|
458
|
-
if (accessibilityLabelledBy != null) {
|
|
459
|
-
viewProps["aria-labelledby"] = processIDRefList(accessibilityLabelledBy);
|
|
460
|
-
}
|
|
461
|
-
if (accessibilityLevel != null) {
|
|
462
|
-
viewProps["aria-level"] = accessibilityLevel;
|
|
463
|
-
}
|
|
464
|
-
if (accessibilityLiveRegion != null) {
|
|
465
|
-
viewProps["aria-live"] = accessibilityLiveRegion === "none" ? "off" : accessibilityLiveRegion;
|
|
466
|
-
}
|
|
467
|
-
if (accessibilityModal != null) {
|
|
468
|
-
viewProps["aria-modal"] = accessibilityModal;
|
|
469
|
-
}
|
|
470
|
-
if (accessibilityMultiline != null) {
|
|
471
|
-
viewProps["aria-multiline"] = accessibilityMultiline;
|
|
472
|
-
}
|
|
473
|
-
if (accessibilityMultiSelectable != null) {
|
|
474
|
-
viewProps["aria-multiselectable"] = accessibilityMultiSelectable;
|
|
475
|
-
}
|
|
476
|
-
if (accessibilityOrientation != null) {
|
|
477
|
-
viewProps["aria-orientation"] = accessibilityOrientation;
|
|
478
|
-
}
|
|
479
|
-
if (accessibilityOwns != null) {
|
|
480
|
-
viewProps["aria-owns"] = processIDRefList(accessibilityOwns);
|
|
481
|
-
}
|
|
482
|
-
if (accessibilityPlaceholder != null) {
|
|
483
|
-
viewProps["aria-placeholder"] = accessibilityPlaceholder;
|
|
484
|
-
}
|
|
485
|
-
if (accessibilityPosInSet != null) {
|
|
486
|
-
viewProps["aria-posinset"] = accessibilityPosInSet;
|
|
487
|
-
}
|
|
488
|
-
if (accessibilityPressed != null) {
|
|
489
|
-
viewProps["aria-pressed"] = accessibilityPressed;
|
|
490
|
-
}
|
|
491
|
-
if (accessibilityReadOnly != null) {
|
|
492
|
-
viewProps["aria-readonly"] = accessibilityReadOnly;
|
|
493
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
494
|
-
viewProps.readOnly = true;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
if (accessibilityRequired != null) {
|
|
498
|
-
viewProps["aria-required"] = accessibilityRequired;
|
|
499
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
500
|
-
viewProps.required = true;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
if (accessibilityRoleDescription != null) {
|
|
504
|
-
viewProps["aria-roledescription"] = accessibilityRoleDescription;
|
|
505
|
-
}
|
|
506
|
-
if (accessibilityRowCount != null) {
|
|
507
|
-
viewProps["aria-rowcount"] = accessibilityRowCount;
|
|
508
|
-
}
|
|
509
|
-
if (accessibilityRowIndex != null) {
|
|
510
|
-
viewProps["aria-rowindex"] = accessibilityRowIndex;
|
|
511
|
-
}
|
|
512
|
-
if (accessibilityRowSpan != null) {
|
|
513
|
-
viewProps["aria-rowspan"] = accessibilityRowSpan;
|
|
514
|
-
}
|
|
515
|
-
if (accessibilitySelected != null) {
|
|
516
|
-
viewProps["aria-selected"] = accessibilitySelected;
|
|
517
|
-
}
|
|
518
|
-
if (accessibilitySetSize != null) {
|
|
519
|
-
viewProps["aria-setsize"] = accessibilitySetSize;
|
|
520
|
-
}
|
|
521
|
-
if (accessibilitySort != null) {
|
|
522
|
-
viewProps["aria-sort"] = accessibilitySort;
|
|
523
|
-
}
|
|
524
|
-
if (accessibilityValueMax != null) {
|
|
525
|
-
viewProps["aria-valuemax"] = accessibilityValueMax;
|
|
526
|
-
}
|
|
527
|
-
if (accessibilityValueMin != null) {
|
|
528
|
-
viewProps["aria-valuemin"] = accessibilityValueMin;
|
|
529
|
-
}
|
|
530
|
-
if (accessibilityValueNow != null) {
|
|
531
|
-
viewProps["aria-valuenow"] = accessibilityValueNow;
|
|
532
|
-
}
|
|
533
|
-
if (accessibilityValueText != null) {
|
|
534
|
-
viewProps["aria-valuetext"] = accessibilityValueText;
|
|
535
|
-
}
|
|
536
|
-
if (nativeID) {
|
|
537
|
-
viewProps.id = nativeID;
|
|
538
|
-
}
|
|
382
|
+
assignNativePropsToWeb(elementType, viewProps, nonTamaguiProps);
|
|
539
383
|
if (!asChild) {
|
|
540
384
|
import_rnw.rnw.useElementLayout(hostRef, onLayout);
|
|
541
385
|
import_rnw.rnw.useResponderEvents(hostRef, {
|
|
@@ -578,6 +422,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
578
422
|
viewProps.target = target.charAt(0) !== "_" ? "_" + target : target;
|
|
579
423
|
}
|
|
580
424
|
}
|
|
425
|
+
const role = viewProps.role;
|
|
581
426
|
const _focusable = focusable != null ? focusable : accessible;
|
|
582
427
|
if (_focusable === false) {
|
|
583
428
|
viewProps.tabIndex = "-1";
|
|
@@ -849,10 +694,10 @@ function createComponent(configIn, ParentComponent) {
|
|
|
849
694
|
});
|
|
850
695
|
const defaults = __spreadValues(__spreadValues({}, component.defaultProps), initialSplitStyles.viewProps);
|
|
851
696
|
defaultNativeStyle = {};
|
|
852
|
-
const
|
|
697
|
+
const validStyles2 = staticConfig.validStyles || import_helpers.stylePropsView;
|
|
853
698
|
for (const key in staticConfig.defaultProps) {
|
|
854
699
|
const val = staticConfig.defaultProps[key];
|
|
855
|
-
if (typeof val === "string" && val[0] === "$" || !
|
|
700
|
+
if (typeof val === "string" && val[0] === "$" || !validStyles2[key]) {
|
|
856
701
|
defaults[key] = val;
|
|
857
702
|
} else {
|
|
858
703
|
defaultNativeStyle[key] = val;
|
|
@@ -880,17 +725,15 @@ function createComponent(configIn, ParentComponent) {
|
|
|
880
725
|
if (configIn.memo) {
|
|
881
726
|
res = (0, import_react.memo)(res);
|
|
882
727
|
}
|
|
883
|
-
res
|
|
728
|
+
res.staticConfig = __spreadValues({
|
|
884
729
|
validStyles: staticConfig.validStyles || import_helpers.stylePropsView
|
|
885
730
|
}, staticConfig);
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
}
|
|
889
|
-
res["extractable"] = (Component, conf) => {
|
|
890
|
-
Component["staticConfig"] = (0, import_extendStaticConfig.extendStaticConfig)(__spreadProps(__spreadValues({
|
|
731
|
+
res.extractable = (Component, conf) => {
|
|
732
|
+
Component.staticConfig = (0, import_extendStaticConfig.extendStaticConfig)(__spreadProps(__spreadValues({
|
|
891
733
|
Component
|
|
892
734
|
}, conf), {
|
|
893
735
|
neverFlatten: true,
|
|
736
|
+
isExtractable: true,
|
|
894
737
|
defaultProps: __spreadValues(__spreadValues({}, Component.defaultProps), conf == null ? void 0 : conf.defaultProps)
|
|
895
738
|
}), res);
|
|
896
739
|
return Component;
|
|
@@ -905,6 +748,7 @@ Unspaced["isUnspaced"] = true;
|
|
|
905
748
|
const Spacer = createComponent({
|
|
906
749
|
memo: true,
|
|
907
750
|
componentName: "Spacer",
|
|
751
|
+
validStyles: import_helpers.validStyles,
|
|
908
752
|
defaultProps: __spreadProps(__spreadValues({}, import_constants.stackDefaultStyles), {
|
|
909
753
|
size: true
|
|
910
754
|
}),
|
|
@@ -923,9 +767,8 @@ const Spacer = createComponent({
|
|
|
923
767
|
},
|
|
924
768
|
flex: {
|
|
925
769
|
true: {
|
|
926
|
-
|
|
927
|
-
}
|
|
928
|
-
":number": (flex) => ({ flex })
|
|
770
|
+
flexGrow: 1
|
|
771
|
+
}
|
|
929
772
|
},
|
|
930
773
|
direction: {
|
|
931
774
|
horizontal: {
|
|
@@ -1049,11 +892,172 @@ const accessibilityRoleToWebRole = {
|
|
|
1049
892
|
summary: "region",
|
|
1050
893
|
text: null
|
|
1051
894
|
};
|
|
895
|
+
function assignNativePropsToWeb(elementType, viewProps, nativeProps) {
|
|
896
|
+
if (!viewProps.role && nativeProps.accessibilityRole) {
|
|
897
|
+
if (nativeProps.accessibilityRole === "none") {
|
|
898
|
+
viewProps.role = "presentation";
|
|
899
|
+
} else {
|
|
900
|
+
const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole];
|
|
901
|
+
if (webRole != null) {
|
|
902
|
+
viewProps.role = webRole || nativeProps.accessibilityRole;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
if (nativeProps.accessibilityActiveDescendant != null) {
|
|
907
|
+
viewProps["aria-activedescendant"] = nativeProps.accessibilityActiveDescendant;
|
|
908
|
+
}
|
|
909
|
+
if (nativeProps.accessibilityAtomic != null) {
|
|
910
|
+
viewProps["aria-atomic"] = nativeProps.accessibilityAtomic;
|
|
911
|
+
}
|
|
912
|
+
if (nativeProps.accessibilityAutoComplete != null) {
|
|
913
|
+
viewProps["aria-autocomplete"] = nativeProps.accessibilityAutoComplete;
|
|
914
|
+
}
|
|
915
|
+
if (nativeProps.accessibilityBusy != null) {
|
|
916
|
+
viewProps["aria-busy"] = nativeProps.accessibilityBusy;
|
|
917
|
+
}
|
|
918
|
+
if (nativeProps.accessibilityChecked != null) {
|
|
919
|
+
viewProps["aria-checked"] = nativeProps.accessibilityChecked;
|
|
920
|
+
}
|
|
921
|
+
if (nativeProps.accessibilityColumnCount != null) {
|
|
922
|
+
viewProps["aria-colcount"] = nativeProps.accessibilityColumnCount;
|
|
923
|
+
}
|
|
924
|
+
if (nativeProps.accessibilityColumnIndex != null) {
|
|
925
|
+
viewProps["aria-colindex"] = nativeProps.accessibilityColumnIndex;
|
|
926
|
+
}
|
|
927
|
+
if (nativeProps.accessibilityColumnSpan != null) {
|
|
928
|
+
viewProps["aria-colspan"] = nativeProps.accessibilityColumnSpan;
|
|
929
|
+
}
|
|
930
|
+
if (nativeProps.accessibilityControls != null) {
|
|
931
|
+
viewProps["aria-controls"] = processIDRefList(nativeProps.accessibilityControls);
|
|
932
|
+
}
|
|
933
|
+
if (nativeProps.accessibilityCurrent != null) {
|
|
934
|
+
viewProps["aria-current"] = nativeProps.accessibilityCurrent;
|
|
935
|
+
}
|
|
936
|
+
if (nativeProps.accessibilityDescribedBy != null) {
|
|
937
|
+
viewProps["aria-describedby"] = processIDRefList(nativeProps.accessibilityDescribedBy);
|
|
938
|
+
}
|
|
939
|
+
if (nativeProps.accessibilityDetails != null) {
|
|
940
|
+
viewProps["aria-details"] = nativeProps.accessibilityDetails;
|
|
941
|
+
}
|
|
942
|
+
if (nativeProps.disabled === true) {
|
|
943
|
+
viewProps["aria-disabled"] = true;
|
|
944
|
+
if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
945
|
+
viewProps.disabled = true;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
if (nativeProps.accessibilityErrorMessage != null) {
|
|
949
|
+
viewProps["aria-errormessage"] = nativeProps.accessibilityErrorMessage;
|
|
950
|
+
}
|
|
951
|
+
if (nativeProps.accessibilityExpanded != null) {
|
|
952
|
+
viewProps["aria-expanded"] = nativeProps.accessibilityExpanded;
|
|
953
|
+
}
|
|
954
|
+
if (nativeProps.accessibilityFlowTo != null) {
|
|
955
|
+
viewProps["aria-flowto"] = processIDRefList(nativeProps.accessibilityFlowTo);
|
|
956
|
+
}
|
|
957
|
+
if (nativeProps.accessibilityHasPopup != null) {
|
|
958
|
+
viewProps["aria-haspopup"] = nativeProps.accessibilityHasPopup;
|
|
959
|
+
}
|
|
960
|
+
if (nativeProps.accessibilityHidden === true) {
|
|
961
|
+
viewProps["aria-hidden"] = nativeProps.accessibilityHidden;
|
|
962
|
+
}
|
|
963
|
+
if (nativeProps.accessibilityInvalid != null) {
|
|
964
|
+
viewProps["aria-invalid"] = nativeProps.accessibilityInvalid;
|
|
965
|
+
}
|
|
966
|
+
if (nativeProps.accessibilityKeyShortcuts != null && Array.isArray(nativeProps.accessibilityKeyShortcuts)) {
|
|
967
|
+
viewProps["aria-keyshortcuts"] = nativeProps.accessibilityKeyShortcuts.join(" ");
|
|
968
|
+
}
|
|
969
|
+
if (nativeProps.accessibilityLabel != null) {
|
|
970
|
+
viewProps["aria-label"] = nativeProps.accessibilityLabel;
|
|
971
|
+
}
|
|
972
|
+
if (nativeProps.accessibilityLabelledBy != null) {
|
|
973
|
+
viewProps["aria-labelledby"] = processIDRefList(nativeProps.accessibilityLabelledBy);
|
|
974
|
+
}
|
|
975
|
+
if (nativeProps.accessibilityLevel != null) {
|
|
976
|
+
viewProps["aria-level"] = nativeProps.accessibilityLevel;
|
|
977
|
+
}
|
|
978
|
+
if (nativeProps.accessibilityLiveRegion != null) {
|
|
979
|
+
viewProps["aria-live"] = nativeProps.accessibilityLiveRegion === "none" ? "off" : nativeProps.accessibilityLiveRegion;
|
|
980
|
+
}
|
|
981
|
+
if (nativeProps.accessibilityModal != null) {
|
|
982
|
+
viewProps["aria-modal"] = nativeProps.accessibilityModal;
|
|
983
|
+
}
|
|
984
|
+
if (nativeProps.accessibilityMultiline != null) {
|
|
985
|
+
viewProps["aria-multiline"] = nativeProps.accessibilityMultiline;
|
|
986
|
+
}
|
|
987
|
+
if (nativeProps.accessibilityMultiSelectable != null) {
|
|
988
|
+
viewProps["aria-multiselectable"] = nativeProps.accessibilityMultiSelectable;
|
|
989
|
+
}
|
|
990
|
+
if (nativeProps.accessibilityOrientation != null) {
|
|
991
|
+
viewProps["aria-orientation"] = nativeProps.accessibilityOrientation;
|
|
992
|
+
}
|
|
993
|
+
if (nativeProps.accessibilityOwns != null) {
|
|
994
|
+
viewProps["aria-owns"] = processIDRefList(nativeProps.accessibilityOwns);
|
|
995
|
+
}
|
|
996
|
+
if (nativeProps.accessibilityPlaceholder != null) {
|
|
997
|
+
viewProps["aria-placeholder"] = nativeProps.accessibilityPlaceholder;
|
|
998
|
+
}
|
|
999
|
+
if (nativeProps.accessibilityPosInSet != null) {
|
|
1000
|
+
viewProps["aria-posinset"] = nativeProps.accessibilityPosInSet;
|
|
1001
|
+
}
|
|
1002
|
+
if (nativeProps.accessibilityPressed != null) {
|
|
1003
|
+
viewProps["aria-pressed"] = nativeProps.accessibilityPressed;
|
|
1004
|
+
}
|
|
1005
|
+
if (nativeProps.accessibilityReadOnly != null) {
|
|
1006
|
+
viewProps["aria-readonly"] = nativeProps.accessibilityReadOnly;
|
|
1007
|
+
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
1008
|
+
viewProps.readOnly = true;
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
if (nativeProps.accessibilityRequired != null) {
|
|
1012
|
+
viewProps["aria-required"] = nativeProps.accessibilityRequired;
|
|
1013
|
+
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
1014
|
+
viewProps.required = true;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
if (nativeProps.accessibilityRoleDescription != null) {
|
|
1018
|
+
viewProps["aria-roledescription"] = nativeProps.accessibilityRoleDescription;
|
|
1019
|
+
}
|
|
1020
|
+
if (nativeProps.accessibilityRowCount != null) {
|
|
1021
|
+
viewProps["aria-rowcount"] = nativeProps.accessibilityRowCount;
|
|
1022
|
+
}
|
|
1023
|
+
if (nativeProps.accessibilityRowIndex != null) {
|
|
1024
|
+
viewProps["aria-rowindex"] = nativeProps.accessibilityRowIndex;
|
|
1025
|
+
}
|
|
1026
|
+
if (nativeProps.accessibilityRowSpan != null) {
|
|
1027
|
+
viewProps["aria-rowspan"] = nativeProps.accessibilityRowSpan;
|
|
1028
|
+
}
|
|
1029
|
+
if (nativeProps.accessibilitySelected != null) {
|
|
1030
|
+
viewProps["aria-selected"] = nativeProps.accessibilitySelected;
|
|
1031
|
+
}
|
|
1032
|
+
if (nativeProps.accessibilitySetSize != null) {
|
|
1033
|
+
viewProps["aria-setsize"] = nativeProps.accessibilitySetSize;
|
|
1034
|
+
}
|
|
1035
|
+
if (nativeProps.accessibilitySort != null) {
|
|
1036
|
+
viewProps["aria-sort"] = nativeProps.accessibilitySort;
|
|
1037
|
+
}
|
|
1038
|
+
if (nativeProps.accessibilityValueMax != null) {
|
|
1039
|
+
viewProps["aria-valuemax"] = nativeProps.accessibilityValueMax;
|
|
1040
|
+
}
|
|
1041
|
+
if (nativeProps.accessibilityValueMin != null) {
|
|
1042
|
+
viewProps["aria-valuemin"] = nativeProps.accessibilityValueMin;
|
|
1043
|
+
}
|
|
1044
|
+
if (nativeProps.accessibilityValueNow != null) {
|
|
1045
|
+
viewProps["aria-valuenow"] = nativeProps.accessibilityValueNow;
|
|
1046
|
+
}
|
|
1047
|
+
if (nativeProps.accessibilityValueText != null) {
|
|
1048
|
+
viewProps["aria-valuetext"] = nativeProps.accessibilityValueText;
|
|
1049
|
+
}
|
|
1050
|
+
if (nativeProps.nativeID) {
|
|
1051
|
+
viewProps.id = nativeProps.nativeID;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
__name(assignNativePropsToWeb, "assignNativePropsToWeb");
|
|
1052
1055
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1053
1056
|
0 && (module.exports = {
|
|
1054
1057
|
AbsoluteFill,
|
|
1055
1058
|
Spacer,
|
|
1056
1059
|
Unspaced,
|
|
1060
|
+
assignNativePropsToWeb,
|
|
1057
1061
|
createComponent,
|
|
1058
1062
|
mouseUps,
|
|
1059
1063
|
spacedChildren
|