@tamagui/core 1.0.1-beta.85 → 1.0.1-beta.86
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/createComponent.js +5 -3
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +2 -2
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +2 -2
- package/dist/cjs/hooks/useFeatures.js +4 -2
- package/dist/cjs/hooks/useFeatures.js.map +2 -2
- package/dist/cjs/hooks/useId.js +1 -1
- package/dist/cjs/hooks/useId.js.map +2 -2
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/esm/createComponent.js +6 -3
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +2 -2
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +1 -1
- package/dist/esm/hooks/useFeatures.js +5 -3
- package/dist/esm/hooks/useFeatures.js.map +2 -2
- package/dist/esm/hooks/useId.js +1 -1
- package/dist/esm/hooks/useId.js.map +2 -2
- package/dist/esm/views/Theme.js.map +1 -1
- package/package.json +7 -7
- package/types/createComponent.d.ts.map +1 -1
- package/types/hooks/useFeatures.d.ts.map +1 -1
- package/types/hooks/useId.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeInverse.d.ts +0 -1
- package/types/views/ThemeInverse.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +0 -1
- package/types/views/ThemeProvider.d.ts.map +1 -1
package/dist/cjs/hooks/useId.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useId.tsx"],
|
|
4
|
-
"sourcesContent": ["/*\n * Welcome to @reach/auto-id!\n\n * Let's see if we can make sense of why this hook exists and its\n * implementation.\n *\n * Some background:\n * 1. Accessibility APIs rely heavily on element IDs\n * 2. Requiring developers to put IDs on every element in Reach UI is both\n * cumbersome and error-prone\n * 3. With a component model, we can generate IDs for them!\n *\n * Solution 1: Generate random IDs.\n *\n * This works great as long as you don't server render your app. When React (in\n * the client) tries to reuse the markup from the server, the IDs won't match\n * and React will then recreate the entire DOM tree.\n *\n * Solution 2: Increment an integer\n *\n * This sounds great. Since we're rendering the exact same tree on the server\n * and client, we can increment a counter and get a deterministic result between\n * client and server. Also, JS integers can go up to nine-quadrillion. I'm\n * pretty sure the tab will be closed before an app never needs\n * 10 quadrillion IDs!\n *\n * Problem solved, right?\n *\n * Ah, but there's a catch! React's concurrent rendering makes this approach\n * non-deterministic. While the client and server will end up with the same\n * elements in the end, depending on suspense boundaries (and possibly some user\n * input during the initial render) the incrementing integers won't always match\n * up.\n *\n * Solution 3: Don't use IDs at all on the server; patch after first render.\n *\n * What we've done here is solution 2 with some tricks. With this approach, the\n * ID returned is an empty string on the first render. This way the server and\n * client have the same markup no matter how wild the concurrent rendering may\n * have gotten.\n *\n * After the render, we patch up the components with an incremented ID. This\n * causes a double render on any components with `useId`. Shouldn't be a problem\n * since the components using this hook should be small, and we're only updating\n * the ID attribute on the DOM, nothing big is happening.\n *\n * It doesn't have to be an incremented number, though--we could do generate\n * random strings instead, but incrementing a number is probably the cheapest\n * thing we can do.\n *\n * Additionally, we only do this patchup on the very first client render ever.\n * Any calls to `useId` that happen dynamically in the client will be\n * populated immediately with a value. So, we only get the double render after\n * server hydration and never again, SO BACK OFF ALRIGHT?\n */\n\nimport * as React from 'react'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\n\nlet serverHandoffComplete = false\nlet id = 0\nfunction genId() {\n return ++id\n}\n\n/* eslint-disable react-hooks/rules-of-hooks */\n\n/**\n * useId\n *\n * Autogenerate IDs to facilitate WAI-ARIA and server rendering.\n *\n * Note: The returned ID will initially be `null` and will update after a\n * component mounts. Users may need to supply their own ID if they need\n * consistent values for SSR.\n *\n * @see Docs https://reach.tech/auto-id\n */\nfunction useId(idFromProps: string): string\nfunction useId(idFromProps: number): number\nfunction useId(idFromProps: string | number): string | number\nfunction useId(idFromProps: string | undefined | null): string | undefined\nfunction useId(idFromProps: number | undefined | null): number | undefined\nfunction useId(idFromProps: string | number | undefined | null): string | number | undefined\nfunction useId(): string | undefined\n\nfunction useId(providedId?: number | string | undefined | null) {\n // TODO: Remove error flag when updating internal deps to React 18. None of\n // our tricks will play well with concurrent rendering anyway.\n\n // native doesn't support until next react-native version, need to remove eventually\n if (isWeb) {\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwDA,YAAuB;AAEvB,sBAAiD;AAEjD,IAAI,wBAAwB;AAC5B,IAAI,KAAK;AACT,iBAAiB;AACf,SAAO,EAAE;AACX;AAuBA,eAAe,YAAiD;AAK9D,MAAI,uBAAO;
|
|
4
|
+
"sourcesContent": ["/*\n * Welcome to @reach/auto-id!\n\n * Let's see if we can make sense of why this hook exists and its\n * implementation.\n *\n * Some background:\n * 1. Accessibility APIs rely heavily on element IDs\n * 2. Requiring developers to put IDs on every element in Reach UI is both\n * cumbersome and error-prone\n * 3. With a component model, we can generate IDs for them!\n *\n * Solution 1: Generate random IDs.\n *\n * This works great as long as you don't server render your app. When React (in\n * the client) tries to reuse the markup from the server, the IDs won't match\n * and React will then recreate the entire DOM tree.\n *\n * Solution 2: Increment an integer\n *\n * This sounds great. Since we're rendering the exact same tree on the server\n * and client, we can increment a counter and get a deterministic result between\n * client and server. Also, JS integers can go up to nine-quadrillion. I'm\n * pretty sure the tab will be closed before an app never needs\n * 10 quadrillion IDs!\n *\n * Problem solved, right?\n *\n * Ah, but there's a catch! React's concurrent rendering makes this approach\n * non-deterministic. While the client and server will end up with the same\n * elements in the end, depending on suspense boundaries (and possibly some user\n * input during the initial render) the incrementing integers won't always match\n * up.\n *\n * Solution 3: Don't use IDs at all on the server; patch after first render.\n *\n * What we've done here is solution 2 with some tricks. With this approach, the\n * ID returned is an empty string on the first render. This way the server and\n * client have the same markup no matter how wild the concurrent rendering may\n * have gotten.\n *\n * After the render, we patch up the components with an incremented ID. This\n * causes a double render on any components with `useId`. Shouldn't be a problem\n * since the components using this hook should be small, and we're only updating\n * the ID attribute on the DOM, nothing big is happening.\n *\n * It doesn't have to be an incremented number, though--we could do generate\n * random strings instead, but incrementing a number is probably the cheapest\n * thing we can do.\n *\n * Additionally, we only do this patchup on the very first client render ever.\n * Any calls to `useId` that happen dynamically in the client will be\n * populated immediately with a value. So, we only get the double render after\n * server hydration and never again, SO BACK OFF ALRIGHT?\n */\n\nimport * as React from 'react'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\n\nlet serverHandoffComplete = false\nlet id = 0\nfunction genId() {\n return ++id\n}\n\n/* eslint-disable react-hooks/rules-of-hooks */\n\n/**\n * useId\n *\n * Autogenerate IDs to facilitate WAI-ARIA and server rendering.\n *\n * Note: The returned ID will initially be `null` and will update after a\n * component mounts. Users may need to supply their own ID if they need\n * consistent values for SSR.\n *\n * @see Docs https://reach.tech/auto-id\n */\nfunction useId(idFromProps: string): string\nfunction useId(idFromProps: number): number\nfunction useId(idFromProps: string | number): string | number\nfunction useId(idFromProps: string | undefined | null): string | undefined\nfunction useId(idFromProps: number | undefined | null): number | undefined\nfunction useId(idFromProps: string | number | undefined | null): string | number | undefined\nfunction useId(): string | undefined\n\nfunction useId(providedId?: number | string | undefined | null) {\n // TODO: Remove error flag when updating internal deps to React 18. None of\n // our tricks will play well with concurrent rendering anyway.\n\n // native doesn't support until next react-native version, need to remove eventually\n if (isWeb) {\n if (typeof React.useId === 'function') {\n let id = React.useId()\n return providedId != null ? providedId : id\n }\n }\n\n // If this instance isn't part of the initial render, we don't have to do the\n // double render/patch-up dance. We can just generate the ID and return it.\n let initialId = providedId ?? (serverHandoffComplete ? genId() : null)\n let [id, setId] = React.useState(initialId)\n\n useIsomorphicLayoutEffect(() => {\n if (id === null) {\n // Patch the ID after render. We do this in `useLayoutEffect` to avoid any\n // rendering flicker, though it'll make the first render slower (unlikely\n // to matter, but you're welcome to measure your app and let us know if\n // it's a problem).\n setId(genId())\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n React.useEffect(() => {\n if (serverHandoffComplete === false) {\n // Flag all future uses of `useId` to skip the update dance. This is in\n // `useEffect` because it goes after `useLayoutEffect`, ensuring we don't\n // accidentally bail out of the patch-up dance prematurely.\n serverHandoffComplete = true\n }\n }, [])\n\n return providedId ?? id ?? undefined\n}\n\nexport { useId }\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwDA,YAAuB;AAEvB,sBAAiD;AAEjD,IAAI,wBAAwB;AAC5B,IAAI,KAAK;AACT,iBAAiB;AACf,SAAO,EAAE;AACX;AAuBA,eAAe,YAAiD;AAK9D,MAAI,uBAAO;AACT,QAAI,OAAO,MAAM,UAAU,YAAY;AACrC,UAAI,MAAK,MAAM,MAAM;AACrB,aAAO,cAAc,OAAO,aAAa;AAAA,IAC3C;AAAA,EACF;AAIA,MAAI,YAAY,cAAe,yBAAwB,MAAM,IAAI;AACjE,MAAI,CAAC,KAAI,SAAS,MAAM,SAAS,SAAS;AAE1C,iDAA0B,MAAM;AAC9B,QAAI,QAAO,MAAM;AAKf,YAAM,MAAM,CAAC;AAAA,IACf;AAAA,EAEF,GAAG,CAAC,CAAC;AAEL,QAAM,UAAU,MAAM;AACpB,QAAI,0BAA0B,OAAO;AAInC,8BAAwB;AAAA,IAC1B;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO,cAAc,OAAM;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Theme.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { memo, useMemo } from 'react'\n\nimport { isWeb } from '../constants/platform'\nimport { wrapThemeManagerContext } from '../helpers/wrapThemeManagerContext'\nimport { useChangeThemeEffect } from '../hooks/useTheme'\nimport { ThemeProps } from '../hooks/useTheme'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport const Theme = memo(function Theme(props: ThemeProps) {\n const { name, theme, themeManager, themes, className } = useChangeThemeEffect(\n props.name,\n props.componentName,\n props\n )\n\n const missingTheme = !themes || !name || !theme\n\n // memo here, changing theme without re-rendering all children is a critical optimization\n // may require some effort of end user to memoize but without this memo they'd have no option\n const contents = useMemo(\n () => (missingTheme ? null : wrapThemeManagerContext(props.children, themeManager)),\n [props.children, themeManager]\n )\n\n if (missingTheme) {\n if (name && !theme && process.env.NODE_ENV === 'development') {\n console.warn(`No theme found by name ${name}`)\n }\n return props.children\n }\n\n if (isWeb) {\n return (\n <span\n className={(!props.disableThemeClass\n ? [props.className, className].filter(Boolean)\n : []\n ).join(' ')}\n style={{\n display: 'contents',\n // in order to provide currentColor, set color by default\n color: themes[name]?.color?.toString(),\n }}\n >\n {contents}\n </span>\n )\n }\n\n return contents\n})\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import React, { memo, useEffect, useMemo, useRef } from 'react'\n\nimport { isWeb } from '../constants/platform'\nimport { wrapThemeManagerContext } from '../helpers/wrapThemeManagerContext'\nimport { useChangeThemeEffect } from '../hooks/useTheme'\nimport { ThemeProps } from '../hooks/useTheme'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport const Theme = memo(function Theme(props: ThemeProps) {\n const { name, theme, themeManager, themes, className } = useChangeThemeEffect(\n props.name,\n props.componentName,\n props\n )\n\n const missingTheme = !themes || !name || !theme\n\n // memo here, changing theme without re-rendering all children is a critical optimization\n // may require some effort of end user to memoize but without this memo they'd have no option\n const contents = useMemo(\n () => (missingTheme ? null : wrapThemeManagerContext(props.children, themeManager)),\n [props.children, themeManager]\n )\n\n if (missingTheme) {\n if (name && !theme && process.env.NODE_ENV === 'development') {\n console.warn(`No theme found by name ${name}`)\n }\n return props.children\n }\n\n if (isWeb) {\n return (\n <span\n className={(!props.disableThemeClass\n ? [props.className, className].filter(Boolean)\n : []\n ).join(' ')}\n style={{\n display: 'contents',\n // in order to provide currentColor, set color by default\n color: themes[name]?.color?.toString(),\n }}\n >\n {contents}\n </span>\n )\n }\n\n return contents\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwD;AAExD,sBAAsB;AACtB,qCAAwC;AACxC,sBAAqC;AAIrC,qBAAM;AAEC,MAAM,QAAQ,uBAAK,gBAAe,OAAmB;AAV5D;AAWE,QAAM,EAAE,MAAM,OAAO,cAAc,QAAQ,cAAc,0CACvD,MAAM,MACN,MAAM,eACN,KACF;AAEA,QAAM,eAAe,CAAC,UAAU,CAAC,QAAQ,CAAC;AAI1C,QAAM,WAAW,0BACf,MAAO,eAAe,OAAO,4DAAwB,MAAM,UAAU,YAAY,GACjF,CAAC,MAAM,UAAU,YAAY,CAC/B;AAEA,MAAI,cAAc;AAChB,QAAI,QAAQ,CAAC,SAAS,QAAQ,IAAI,aAAa,eAAe;AAC5D,cAAQ,KAAK,0BAA0B,MAAM;AAAA,IAC/C;AACA,WAAO,MAAM;AAAA,EACf;AAEA,MAAI,uBAAO;AACT,WACE,mDAAC;AAAA,MACC,WAAY,EAAC,MAAM,oBACf,CAAC,MAAM,WAAW,SAAS,EAAE,OAAO,OAAO,IAC3C,CAAC,GACH,KAAK,GAAG;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,QAET,OAAO,mBAAO,UAAP,mBAAc,UAAd,mBAAqB;AAAA,MAC9B;AAAA,OAEC,QACH;AAAA,EAEJ;AAEA,SAAO;AACT,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -37,6 +37,7 @@ import React, {
|
|
|
37
37
|
createElement,
|
|
38
38
|
forwardRef,
|
|
39
39
|
memo,
|
|
40
|
+
startTransition,
|
|
40
41
|
useCallback,
|
|
41
42
|
useContext,
|
|
42
43
|
useMemo,
|
|
@@ -462,8 +463,10 @@ function createComponent(configIn, ParentComponent) {
|
|
|
462
463
|
}
|
|
463
464
|
useIsomorphicLayoutEffect(() => {
|
|
464
465
|
if (typeof window !== "undefined" && (hasEnterStyle || props.animation)) {
|
|
465
|
-
|
|
466
|
-
|
|
466
|
+
startTransition(() => {
|
|
467
|
+
setStateShallow({
|
|
468
|
+
mounted: true
|
|
469
|
+
});
|
|
467
470
|
});
|
|
468
471
|
}
|
|
469
472
|
internal.current.isMounted = true;
|
|
@@ -893,7 +896,7 @@ function spacedChildren({
|
|
|
893
896
|
}
|
|
894
897
|
const final = [];
|
|
895
898
|
for (const [index, child] of childrenList.entries()) {
|
|
896
|
-
const isEmpty = child === null || child === void 0 ||
|
|
899
|
+
const isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;
|
|
897
900
|
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
898
901
|
final.push(child);
|
|
899
902
|
} else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createComponent.tsx"],
|
|
4
|
-
"sourcesContent": ["import { composeEventHandlers, stylePropsView, validStyles } from '@tamagui/helpers'\nimport { useForceUpdate } from '@tamagui/use-force-update'\nimport React, {\n Children,\n Fragment,\n createElement,\n forwardRef,\n memo,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { StyleSheet, Text, View, ViewStyle } from 'react-native'\n\nimport { getConfig, onConfiguredOnce } from './conf'\nimport { stackDefaultStyles } from './constants/constants'\nimport { isWeb, useIsomorphicLayoutEffect } from './constants/platform'\nimport { rnw } from './constants/rnw'\nimport { getReturnVariablesAs } from './helpers/createPropMapper'\nimport { createShallowUpdate } from './helpers/createShallowUpdate'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport { SplitStyleResult, insertSplitStyles, useSplitStyles } from './helpers/getSplitStyles'\nimport { getAllSelectors } from './helpers/insertStyleRule'\nimport { mergeProps } from './helpers/mergeProps'\nimport { proxyThemeVariables } from './helpers/proxyThemeVariables'\nimport { wrapThemeManagerContext } from './helpers/wrapThemeManagerContext'\nimport { useFeatures } from './hooks/useFeatures'\nimport { useIsTouchDevice } from './hooks/useIsTouchDevice'\nimport { mediaState } from './hooks/useMedia'\nimport { usePressable } from './hooks/usePressable'\nimport { getThemeManagerIfChanged, useTheme } from './hooks/useTheme'\nimport { Pressability } from './Pressability'\nimport {\n SpaceDirection,\n SpaceTokens,\n StackProps,\n StaticConfig,\n StaticConfigParsed,\n StylableComponent,\n TamaguiComponent,\n TamaguiComponentState,\n TamaguiConfig,\n TamaguiElement,\n TamaguiInternalConfig,\n UseAnimationHook,\n} from './types'\nimport { Slot, mergeEvent } from './views/Slot'\nimport { TextAncestorContext } from './views/TextAncestorContext'\n\nReact['keep']\n\nconst defaultComponentState: TamaguiComponentState = Object.freeze({\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n // only used by enterStyle\n mounted: false,\n animation: null,\n})\n\nexport const mouseUps = new Set<Function>()\nif (typeof document !== 'undefined') {\n document.addEventListener('mouseup', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n document.addEventListener('touchend', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n document.addEventListener('touchcancel', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n}\n\n// mutates\nfunction mergeShorthands({ defaultProps }: StaticConfigParsed, { shorthands }: TamaguiConfig) {\n // they are defined in correct order already { ...parent, ...child }\n for (const key in defaultProps) {\n defaultProps[shorthands[key] || key] = defaultProps[key]\n }\n}\n\nlet initialTheme: any\n\nexport function createComponent<\n ComponentPropTypes extends Object = {},\n Ref = TamaguiElement,\n BaseProps = never\n>(configIn: Partial<StaticConfig> | StaticConfigParsed, ParentComponent?: StylableComponent) {\n const staticConfig = (() => {\n const config = extendStaticConfig(configIn, ParentComponent)\n if ('parsed' in config) {\n return config\n } else {\n return parseStaticConfig(config)\n }\n })()\n\n const defaultComponentClassName = `is_${staticConfig.componentName}`\n let tamaguiConfig: TamaguiInternalConfig\n let AnimatedText: any\n let AnimatedView: any\n let avoidClasses = true\n let defaultNativeStyle: any\n let defaultNativeStyleSheet: StyleSheet.NamedStyles<{ base: {} }>\n let tamaguiDefaultProps: any\n let initialSplitStyles: SplitStyleResult\n\n // see onConfiguredOnce below which attaches a name then to this component\n const component = forwardRef<Ref, ComponentPropTypes>((propsIn: any, forwardedRef) => {\n // React inserts default props after your props for some reason...\n // order important so we do loops, you can't just spread because JS does weird things\n let props: any\n if (tamaguiDefaultProps && !propsIn.asChild) {\n props = mergeProps(tamaguiDefaultProps, propsIn)\n } else {\n props = propsIn\n }\n\n const { Component, isText, isZStack } = staticConfig\n const componentName = props.componentName || staticConfig.componentName\n const componentClassName = props.asChild\n ? ''\n : props.componentName\n ? `is_${props.componentName}`\n : defaultComponentClassName\n\n if (true) {\n if (props['debug']) {\n // prettier-ignore\n console.log('\u26A0\uFE0F', componentName || Component?.displayName || Component?.name || '[Unnamed Component]', 'debug on')\n // keep separate react native warn touches every value on prop causing weird behavior\n console.log('props in:', {\n propsIn,\n props,\n ordered: Object.keys(props),\n })\n if (props['debug'] === 'break') debugger\n }\n }\n\n const forceUpdate = useForceUpdate()\n const theme = useTheme(props.theme, componentName, props, forceUpdate)\n const statesUsed = useState<TamaguiComponentState>(defaultComponentState)\n const setStateShallow = createShallowUpdate(statesUsed[1])\n let state = statesUsed[0]\n\n // allow forcing a pseudo state on\n if (propsIn.forceStyle) {\n state = {\n ...state,\n [propsIn.forceStyle]: true,\n }\n }\n\n const shouldAvoidClasses = !!(props.animation && avoidClasses)\n const shouldForcePseudo = !!propsIn.forceStyle\n const hasTextAncestor = !!(isWeb ? useContext(TextAncestorContext) : false)\n const splitStyleState =\n !shouldAvoidClasses && !shouldForcePseudo\n ? {\n ...state,\n hasTextAncestor,\n dynamicStylesInline: true,\n }\n : ({\n ...state,\n noClassNames: true,\n dynamicStylesInline: true,\n hasTextAncestor,\n resolveVariablesAs: 'value',\n } as const)\n const splitStyles = useSplitStyles(\n props,\n staticConfig,\n theme,\n splitStyleState,\n props.asChild ? null : initialSplitStyles.classNames,\n props['debug']\n )\n\n const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles\n const useAnimations = tamaguiConfig.animations?.useAnimations as UseAnimationHook | undefined\n const isAnimated = !!(useAnimations && props.animation)\n const hasEnterStyle = !!props.enterStyle\n const hostRef = useRef<HTMLElement | View>(null)\n\n const animationFeatureStylesIn = props.animation ? { ...defaultNativeStyle, ...style } : null\n\n const features = useFeatures(props, {\n forceUpdate,\n setStateShallow,\n useAnimations,\n state,\n style: animationFeatureStylesIn,\n pseudos,\n staticConfig,\n theme,\n hostRef,\n onDidAnimate: props.onDidAnimate,\n })\n\n const {\n tag,\n hitSlop,\n asChild,\n children,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space: spaceProp,\n spaceDirection: _spaceDirection,\n disabled: disabledProp,\n onMouseUp,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\n separator,\n // ignore from here on out\n forceStyle: _forceStyle,\n // @ts-ignore for next/link compat etc\n onClick,\n theme: _themeProp,\n // @ts-ignore\n defaultVariants,\n\n ...nonTamaguiProps\n } = viewPropsIn\n\n // get the right component\n const isTaggable = !Component || typeof Component === 'string'\n\n // default to tag, fallback to component (when both strings)\n const element = isWeb ? (isTaggable ? tag || Component : Component) : Component\n const BaseTextComponent = !isWeb ? Text : element || 'span'\n const BaseViewComponent = !isWeb ? View : element || (hasTextAncestor ? 'span' : 'div')\n let elementType = isText\n ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent\n : (isAnimated ? AnimatedView || View : null) || BaseViewComponent\n\n elementType = Component || elementType\n const isStringElement = typeof elementType === 'string'\n\n const disabled =\n (props.accessibilityState != null && props.accessibilityState.disabled === true) ||\n props.accessibilityDisabled\n\n // these can ultimately be for DOM, react-native-web views, or animated views\n // so the type is pretty loose\n let viewProps: Record<string, any>\n\n // if react-native-web view just pass all props down\n if (isWeb && !staticConfig.isReactNativeWeb) {\n // otherwise replicate react-native-web functionality\n const {\n // event props\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n\n // react-native props\n nativeID,\n\n // react-native-web accessibility props\n // @ts-ignore\n accessibilityActiveDescendant,\n // @ts-ignore\n accessibilityAtomic,\n // @ts-ignore\n accessibilityAutoComplete,\n // @ts-ignore\n accessibilityBusy,\n // @ts-ignore\n accessibilityChecked,\n // @ts-ignore\n accessibilityColumnCount,\n // @ts-ignore\n accessibilityColumnIndex,\n // @ts-ignore\n accessibilityColumnSpan,\n // @ts-ignore\n accessibilityControls,\n // @ts-ignore\n accessibilityCurrent,\n // @ts-ignore\n accessibilityDescribedBy,\n // @ts-ignore\n accessibilityDetails,\n // @ts-ignore\n accessibilityDisabled,\n // @ts-ignore\n accessibilityErrorMessage,\n // @ts-ignore\n accessibilityExpanded,\n // @ts-ignore\n accessibilityFlowTo,\n // @ts-ignore\n accessibilityHasPopup,\n // @ts-ignore\n accessibilityHidden,\n // @ts-ignore\n accessibilityInvalid,\n // @ts-ignore\n accessibilityKeyShortcuts,\n // @ts-ignore\n accessibilityLabel,\n // @ts-ignore\n accessibilityLabelledBy,\n // @ts-ignore\n accessibilityLevel,\n // @ts-ignore\n accessibilityLiveRegion,\n // @ts-ignore\n accessibilityModal,\n // @ts-ignore\n accessibilityMultiline,\n // @ts-ignore\n accessibilityMultiSelectable,\n // @ts-ignore\n accessibilityOrientation,\n // @ts-ignore\n accessibilityOwns,\n // @ts-ignore\n accessibilityPlaceholder,\n // @ts-ignore\n accessibilityPosInSet,\n // @ts-ignore\n accessibilityPressed,\n // @ts-ignore\n accessibilityReadOnly,\n // @ts-ignore\n accessibilityRequired,\n // @ts-ignore\n accessibilityRole,\n // @ts-ignore\n accessibilityRoleDescription,\n // @ts-ignore\n accessibilityRowCount,\n // @ts-ignore\n accessibilityRowIndex,\n // @ts-ignore\n accessibilityRowSpan,\n // @ts-ignore\n accessibilitySelected,\n // @ts-ignore\n accessibilitySetSize,\n // @ts-ignore\n accessibilitySort,\n // @ts-ignore\n accessibilityValueMax,\n // @ts-ignore\n accessibilityValueMin,\n // @ts-ignore\n accessibilityValueNow,\n // @ts-ignore\n accessibilityValueText,\n\n // deprecated\n accessible,\n accessibilityState,\n accessibilityValue,\n\n // android\n collapsable,\n focusable,\n\n onLayout,\n\n ...webProps\n } = nonTamaguiProps\n\n viewProps = webProps\n\n assignNativePropsToWeb(elementType, viewProps, nonTamaguiProps)\n\n if (!asChild) {\n rnw.useElementLayout(hostRef, onLayout)\n\n // from react-native-web\n rnw.useResponderEvents(hostRef, {\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n })\n }\n\n // from react-native-web\n const platformMethodsRef = rnw.usePlatformMethods(viewProps)\n const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef)\n\n if (!isAnimated) {\n // @ts-ignore\n viewProps.ref = setRef\n } else {\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\n\n if (props.href != undefined && hrefAttrs != undefined) {\n const { download, rel, target } = hrefAttrs\n if (download != null) {\n viewProps.download = download\n }\n if (rel != null) {\n viewProps.rel = rel\n }\n if (typeof target === 'string') {\n viewProps.target = target.charAt(0) !== '_' ? '_' + target : target\n }\n }\n\n // FOCUS\n // \"focusable\" indicates that an element may be a keyboard tab-stop.\n const _focusable = focusable != undefined ? focusable : accessible\n const role = viewProps.role\n if (props['debug']) {\n console.log('_focusable', focusable)\n }\n if (_focusable === false) {\n viewProps.tabIndex = '-1'\n }\n if (\n // These native elements are focusable by default\n elementType === 'a' ||\n elementType === 'button' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n if (_focusable === false || accessibilityDisabled === true) {\n viewProps.tabIndex = '-1'\n }\n } else if (\n // These roles are made focusable by default\n role === 'button' ||\n role === 'checkbox' ||\n role === 'link' ||\n role === 'radio' ||\n role === 'textbox' ||\n role === 'switch'\n ) {\n if (_focusable !== false) {\n viewProps.tabIndex = '0'\n }\n }\n // Everything else must explicitly set the prop\n if (_focusable === true) {\n viewProps.tabIndex = '0'\n }\n } else {\n viewProps = nonTamaguiProps\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\n\n if (props['debug']) {\n console.log('viewProps', elementType, viewProps.role, viewProps.tabIndex)\n }\n\n // from react-native-web\n if (true && !isText && isWeb) {\n Children.toArray(props.children).forEach((item) => {\n if (typeof item === 'string') {\n console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`)\n }\n })\n }\n\n // isMounted\n const internal = useRef<{ isMounted: boolean; unmountEffects?: Function[] }>()\n if (!internal.current) {\n internal.current = {\n isMounted: true,\n }\n }\n\n useIsomorphicLayoutEffect(() => {\n // we need to use state to properly have mounted go from false => true\n if (typeof window !== 'undefined' && (hasEnterStyle || props.animation)) {\n // for SSR we never set mounted, ensuring enterStyle={{}} is set by default\n setStateShallow({\n mounted: true,\n })\n }\n\n internal.current!.isMounted = true\n return () => {\n mouseUps.delete(unPress)\n internal.current!.isMounted = false\n internal.current!.unmountEffects?.forEach((cb) => cb())\n }\n }, [hasEnterStyle, props.animation])\n\n let styles: any[]\n\n const animationStyles = state.animation ? state.animation.style : null\n\n if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {\n styles = {\n ...defaultNativeStyle,\n ...(animationStyles ?? style),\n ...medias,\n }\n } else {\n styles = [\n isWeb ? null : defaultNativeStyleSheet ? (defaultNativeStyleSheet.base as ViewStyle) : null,\n animationStyles ?? style,\n medias,\n ]\n if (!animationStyles) {\n const initPseudos = initialSplitStyles.pseudos\n const force = shouldForcePseudo\n !state.mounted && addPseudoToStyles(styles, initPseudos, pseudos, 'enterStyle')\n state.hover && addPseudoToStyles(styles, initPseudos, pseudos, 'hoverStyle', force)\n state.focus && addPseudoToStyles(styles, initPseudos, pseudos, 'focusStyle', force)\n state.press && addPseudoToStyles(styles, initPseudos, pseudos, 'pressStyle', force)\n }\n // ugly but for now...\n if (shouldForcePseudo) {\n const next = {}\n for (const style of styles) {\n if (style) {\n Object.assign(next, style)\n }\n }\n // @ts-ignore\n Object.assign(splitStyles.style, next)\n }\n }\n\n if (isWeb) {\n const fontFamilyName = isText\n ? props.fontFamily || staticConfig.defaultProps.fontFamily\n : null\n const fontFamily =\n fontFamilyName && fontFamilyName[0] === '$' ? fontFamilyName.slice(1) : null\n const classList = [\n componentName ? componentClassName : '',\n fontFamily ? `font_${fontFamily}` : '',\n theme.className,\n classNames ? Object.values(classNames).join(' ') : '',\n ]\n\n const className = classList.join(' ')\n const style = animationStyles ?? splitStyles.style\n\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n // prettier-ignore\n console.log(' \u00BB className', { splitStyles, style, isStringElement, pseudos, state, classNames, propsClassName: props.className, classList, className: className.trim().split(' '), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) })\n }\n\n // TODO this is specific to reanimated rn\n const isAnimatedReactNativeWeb = props.animation && avoidClasses\n\n if (staticConfig.isReactNativeWeb || isAnimatedReactNativeWeb) {\n viewProps.dataSet = {\n ...viewProps.dataSet,\n className,\n id: props.id,\n }\n if (props['data-is']) {\n viewProps.dataSet.is = props['data-is']\n }\n } else {\n viewProps.className = className\n }\n\n viewProps.style = style\n } else {\n viewProps.style = styles\n }\n\n // TODO need to loop active variants and see if they have matchin pseudos and apply as well\n const initialPseudos = initialSplitStyles.pseudos\n const attachPress = !!(\n pseudos?.pressStyle ||\n initialPseudos?.pressStyle ||\n onPress ||\n onPressOut ||\n onPressIn ||\n onClick\n )\n\n const isTouch = useIsTouchDevice()\n const isHoverable = isWeb && !isTouch\n const attachHover =\n isHoverable &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n\n const handlesPressEvents = !isStringElement && !asChild\n const pressKey = handlesPressEvents ? 'onPress' : 'onClick'\n const pressInKey = handlesPressEvents ? 'onPressIn' : 'onMouseDown'\n const pressOutKey = handlesPressEvents ? 'onPressOut' : 'onMouseUp'\n\n // check presence to prevent reparenting bugs, allows for onPress={x ? function : undefined} usage\n // while avoiding reparenting...\n // once proper reparenting is supported, we can remove this and use that...\n const shouldAttach =\n !asChild &&\n (attachPress ||\n attachHover ||\n 'pressStyle' in props ||\n 'onPress' in props ||\n 'onPressIn' in props ||\n 'onPressOut' in props ||\n (isWeb &&\n ('hoverStyle' in props ||\n 'onHoverIn' in props ||\n 'onHoverOut' in props ||\n 'onMouseEnter' in props ||\n 'onMouseLeave' in props)))\n\n const unPress = useCallback(() => {\n if (!internal.current!.isMounted) return\n setStateShallow({\n press: false,\n pressIn: false,\n })\n }, [])\n\n const events = shouldAttach\n ? {\n [pressOutKey]: attachPress\n ? (e) => {\n unPress()\n onPressOut?.(e)\n onMouseUp?.(e)\n }\n : undefined,\n ...(isHoverable && {\n onMouseEnter: attachHover\n ? (e) => {\n let next: Partial<typeof state> = {}\n if (attachHover) {\n next.hover = true\n }\n if (state.pressIn) {\n next.press = true\n }\n if (Object.keys(next).length) {\n setStateShallow(next)\n }\n onHoverIn?.(e)\n onMouseEnter?.(e)\n }\n : undefined,\n onMouseLeave: attachHover\n ? (e) => {\n let next: Partial<typeof state> = {}\n mouseUps.add(unPress)\n if (attachHover) {\n next.hover = false\n }\n if (state.pressIn) {\n next.press = false\n next.pressIn = false\n }\n if (Object.keys(next).length) {\n setStateShallow(next)\n }\n onHoverOut?.(e)\n onMouseLeave?.(e)\n }\n : undefined,\n }),\n [pressInKey]: attachPress\n ? (e) => {\n setStateShallow({\n press: true,\n pressIn: true,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n if (isWeb) {\n mouseUps.add(unPress)\n }\n }\n : null,\n [pressKey]: attachPress\n ? (e) => {\n unPress()\n onClick?.(e)\n onPress?.(e)\n }\n : null,\n\n // replicating TouchableWithoutFeedback\n ...(!isWeb && {\n cancelable: !props.rejectResponderTermination,\n disabled: props.disabled !== null ? props.disabled : props.accessibilityState?.disabled,\n hitSlop: props.hitSlop,\n delayLongPress: props.delayLongPress,\n delayPressIn: props.delayPressIn,\n delayPressOut: props.delayPressOut,\n focusable: viewProps.focusable ?? true,\n minPressDuration: 0,\n }),\n }\n : null\n\n let space = spaceProp\n // find space by media query\n if (features.enabled.mediaQuery) {\n for (const key in mediaState) {\n if (!mediaState[key]) continue\n if (props[key] && props[key].space !== undefined) {\n space = props[key].space\n }\n }\n }\n\n let childEls =\n !children || asChild\n ? children\n : wrapThemeManagerContext(\n spacedChildren({\n separator,\n children,\n space,\n direction: props.spaceDirection || 'both',\n isZStack,\n }),\n getThemeManagerIfChanged(theme)\n )\n\n let content: any\n\n if (asChild) {\n elementType = Slot\n viewProps = {\n ...viewProps,\n onPress,\n onPressIn,\n onPressOut,\n }\n }\n\n // EVENTS: web\n if (isWeb) {\n const [pressableProps] = usePressable(\n events\n ? {\n disabled,\n ...(hitSlop && {\n hitSlop,\n }),\n onPressOut: events[pressOutKey],\n onPressIn: events[pressInKey],\n onPress: events[pressKey],\n }\n : {\n disabled: true,\n }\n )\n if (events) {\n if (handlesPressEvents) {\n Object.assign(viewProps, pressableProps)\n } else {\n Object.assign(viewProps, events)\n }\n }\n }\n\n // add focus events\n if (process.env.TAMAGUI_TARGET === 'native') {\n const attachFocus = !!(\n (pseudos && pseudos.focusStyle) ||\n (initialPseudos && initialPseudos.focusStyle)\n )\n if (attachFocus) {\n viewProps.onFocus = mergeEvent(viewProps.onFocus, () => {\n setStateShallow({ focus: true })\n })\n viewProps.onBlur = mergeEvent(viewProps.onBlur, () => {\n setStateShallow({ focus: false })\n })\n }\n }\n\n // EVENTS native\n // replicates TouchableWithoutFeedback\n if (process.env.TAMAGUI_TARGET === 'native') {\n // only ever create once, use .configure() to update later\n const pressability = useMemo(() => {\n if (attachPress && events) {\n const pressability = new Pressability(events)\n internal.current!.unmountEffects = [\n () => {\n pressability.reset()\n },\n ]\n return pressability\n }\n }, [])\n\n if (attachPress && events) {\n pressability.configure(events)\n const eventHandlers = pressability.getEventHandlers()\n for (const key in eventHandlers) {\n if (key === 'onBlur' || key === 'onFocus') {\n // avoids the default\n continue\n }\n const og = props[key]\n const val = eventHandlers[key]\n viewProps[key] = og ? composeEventHandlers(og, val) : val\n }\n }\n }\n\n content = createElement(elementType, viewProps, childEls)\n\n if (isWeb) {\n // only necessary when animating because some AnimatedView which wraps RNW View doesn't forward dataSet className\n const isAnimatedRNWView = isAnimated && typeof elementType !== 'string' // assuming for now as reanimated is only driver\n const shouldWrapWithComponentTheme =\n isAnimatedRNWView && getReturnVariablesAs(props, splitStyleState) === 'non-color-value'\n const shouldWrapWithHover = events && attachHover\n\n if (shouldWrapWithHover || shouldWrapWithComponentTheme) {\n const themeClassName = shouldWrapWithComponentTheme ? `${theme.className}` : ''\n const hoverClassName = shouldWrapWithHover ? 't_Hoverable' : ''\n content = (\n <span\n className={`${hoverClassName} ${themeClassName}`}\n style={{\n display: 'contents',\n }}\n {...(shouldWrapWithHover && {\n onMouseEnter: events.onMouseEnter,\n onMouseLeave: events.onMouseLeave,\n })}\n >\n {content}\n </span>\n )\n }\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log('\u2B50\uFE0F', { propsIn: { ...props }, propsOut: { ...viewProps }, elementType, state, splitStyles, animationStyles, isStringElement, classNamesIn: props.className?.split(' '), classNamesOut: viewProps.className?.split(' '), events, shouldAttach, ViewComponent: elementType, viewProps, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles, ...(typeof window !== 'undefined' ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo } : null) })\n }\n }\n\n if (features.elements.length) {\n return (\n <>\n {features.elements}\n {content}\n </>\n )\n }\n\n return content\n })\n\n component.displayName = staticConfig.componentName\n\n // Once configuration is run and all components are registered\n // get default props + className and analyze styles\n onConfiguredOnce((conf) => {\n if (process.env.IS_STATIC === 'is_static') {\n // in static mode we just use these to lookup configuration\n return\n }\n\n tamaguiConfig = conf\n\n // do this to make sure shorthands don't duplicate with.. longhands\n mergeShorthands(staticConfig, tamaguiConfig)\n\n avoidClasses = !!tamaguiConfig.animations?.avoidClasses\n AnimatedText = tamaguiConfig.animations?.Text\n AnimatedView = tamaguiConfig?.animations?.View\n initialTheme =\n initialTheme ||\n proxyThemeVariables(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]])\n\n // adds in user defined default props\n const config = getConfig()\n\n let defaultPropsIn = staticConfig.defaultProps\n\n // because we run createTamagui after styled() defs, have to do some work here\n const parentNames = [...(staticConfig.parentNames || []), staticConfig.componentName]\n\n // gather defaults props one time and merge downwards\n // find last unprocessed and process\n if (config.defaultProps && parentNames) {\n const len = parentNames.length\n let prev\n\n for (let i = 0; i < len; i++) {\n const n = parentNames[i]\n if (!n) continue\n if (DefaultProps.has(n)) {\n prev = DefaultProps.get(n)\n continue\n }\n const props = config.defaultProps[n]\n if (!props) {\n if (prev) {\n DefaultProps.set(n, prev)\n }\n continue\n }\n prev = mergeProps(prev || {}, props)\n DefaultProps.set(n, prev)\n }\n\n // overwrite the user defined defaults on top of internal defined defaults\n const ourDefaultsMerged = DefaultProps.get(staticConfig.componentName)\n if (ourDefaultsMerged) {\n defaultPropsIn = mergeProps(defaultPropsIn, ourDefaultsMerged)\n }\n }\n\n if (process.env.NODE_ENV === 'development' && defaultPropsIn['debug'] === 'break') {\n debugger\n }\n\n initialSplitStyles = insertSplitStyles(\n defaultPropsIn,\n staticConfig,\n initialTheme,\n {\n mounted: true,\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n resolveVariablesAs: 'both',\n keepVariantsAsProps: true,\n },\n undefined,\n staticConfig.defaultProps['debug']\n )\n\n // must preserve prop order\n const defaults = mergeProps(component.defaultProps as any, initialSplitStyles.viewProps)\n\n defaultNativeStyle = {}\n\n const validStyles = staticConfig.validStyles || stylePropsView\n\n // split - keep variables on props to be processed using theme values at runtime (native)\n if (!isWeb) {\n for (const key in staticConfig.defaultProps) {\n const val = staticConfig.defaultProps[key]\n if ((typeof val === 'string' && val[0] === '$') || !validStyles[key] || val[0] === '_') {\n defaults[key] = val\n } else {\n defaultNativeStyle[key] = val\n }\n }\n }\n\n defaultNativeStyleSheet = StyleSheet.create({\n base: defaultNativeStyle,\n })\n\n if (Object.keys(defaults).length) {\n tamaguiDefaultProps = defaults\n }\n\n // add debug logs\n if (process.env.NODE_ENV === 'development' && staticConfig.defaultProps?.debug) {\n if (process.env.IS_STATIC !== 'is_static') {\n console.log(`\uD83D\uDC1B [${staticConfig.componentName || 'Component'}]`, {\n staticConfig,\n initialSplitStyles,\n tamaguiDefaultProps,\n defaultNativeStyle,\n defaults,\n })\n }\n }\n })\n\n let res: TamaguiComponent<ComponentPropTypes, Ref, BaseProps> = component as any\n\n if (configIn.memo) {\n res = memo(res) as any\n }\n\n res.staticConfig = {\n validStyles: staticConfig.validStyles || stylePropsView,\n ...staticConfig,\n }\n\n // res.extractable HoC\n res.extractable = (Component: any, conf?: Partial<StaticConfig>) => {\n Component.staticConfig = extendStaticConfig(\n {\n Component,\n ...conf,\n neverFlatten: true,\n isExtractable: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n },\n res\n )\n return Component\n }\n\n return res\n}\n\nconst DefaultProps = new Map()\n\n// for elements to avoid spacing\nexport const Unspaced = (props: { children?: any }) => {\n return props.children\n}\nUnspaced['isUnspaced'] = true\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport type SpacerProps = Omit<StackProps, 'flex' | 'direction'> & {\n size?: number | SpaceTokens\n flex?: boolean | number\n direction?: SpaceDirection\n}\nexport const Spacer = createComponent<SpacerProps>({\n memo: true,\n componentName: 'Spacer',\n validStyles,\n defaultProps: {\n ...stackDefaultStyles,\n size: true,\n },\n variants: {\n size: {\n '...size': (size, { tokens }) => {\n size = size == true ? '$true' : size\n const sizePx = tokens.space[size] ?? size\n return {\n width: sizePx,\n height: sizePx,\n minWidth: sizePx,\n minHeight: sizePx,\n }\n },\n },\n\n flex: {\n true: {\n flexGrow: 1,\n },\n },\n\n direction: {\n horizontal: {\n height: 0,\n minHeight: 0,\n },\n vertical: {\n width: 0,\n minWidth: 0,\n },\n both: {},\n },\n },\n\n defaultVariants: {\n direction: 'both',\n },\n})\n\nexport type SpacedChildrenProps = {\n isZStack?: boolean\n children?: any\n space?: any\n spaceFlex?: boolean | number\n direction?: SpaceDirection\n separator?: React.ReactNode\n}\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n direction,\n spaceFlex,\n separator,\n}: SpacedChildrenProps) {\n const hasSpace = !!(space || spaceFlex)\n const hasSeparator = !(separator === undefined || separator === null)\n if (!hasSpace && !hasSeparator && !isZStack) {\n return children\n }\n const childrenList = Children.toArray(children)\n if (childrenList.length <= 1 && !isZStack) {\n return childrenList\n }\n const final: any[] = []\n for (const [index, child] of childrenList.entries()) {\n const isEmpty =\n child === null ||\n child === undefined ||\n child === false ||\n (Array.isArray(child) && child.length === 0)\n\n // push them all, but wrap some in Fragment\n if (isEmpty || !child || (child['key'] && !isZStack)) {\n final.push(child)\n } else {\n final.push(\n <Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n }\n\n // first child unspaced avoid insert space\n if (isUnspaced(child) && index === 0) {\n continue\n }\n\n // no spacing on ZStack\n if (isZStack) {\n continue\n }\n\n const next = childrenList[index + 1]\n\n if (next && !isUnspaced(next)) {\n if (separator) {\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}_before_sep_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n final.push(\n React.isValidElement(separator)\n ? React.cloneElement(separator, { key: `sep_${index}` })\n : separator\n )\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}_after_sep_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n } else {\n final.push(\n createSpacer({\n key: `_${index}_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n }\n }\n\n return final\n}\n\ntype CreateSpacerProps = SpacedChildrenProps & { key: string }\n\nfunction createSpacer({ key, direction, space, spaceFlex }: CreateSpacerProps) {\n return (\n <Spacer\n key={key}\n size={space}\n direction={direction}\n {...(spaceFlex && {\n flex: spaceFlex,\n })}\n />\n )\n}\n\nfunction isUnspaced(child: any) {\n return child?.['type']?.['isVisuallyHidden'] || child?.['type']?.['isUnspaced']\n}\n\nexport function AbsoluteFill(props: { children?: React.ReactNode }) {\n return (\n <View pointerEvents=\"box-none\" style={StyleSheet.absoluteFill}>\n {props.children}\n </View>\n )\n}\n\n// this can be done with CSS entirely right?\n// const shouldWrapTextAncestor = isWeb && isText && !hasTextAncestor\n// if (shouldWrapTextAncestor) {\n// // from react-native-web\n// content = createElement(TextAncestorContext.Provider, { value: true }, content)\n// }\n\nfunction processIDRefList(idRefList: string | Array<string>): string {\n return Array.isArray(idRefList) ? idRefList.join(' ') : idRefList\n}\n\nconst accessibilityRoleToWebRole = {\n adjustable: 'slider',\n button: 'button',\n header: 'heading',\n image: 'img',\n imagebutton: null,\n keyboardkey: null,\n label: null,\n link: 'link',\n none: 'presentation',\n search: 'search',\n summary: 'region',\n text: null,\n}\n\n// adapted from react-native-web\nexport function assignNativePropsToWeb(elementType: string, viewProps: any, nativeProps: any) {\n if (!viewProps.role && nativeProps.accessibilityRole) {\n if (nativeProps.accessibilityRole === 'none') {\n viewProps.role = 'presentation'\n } else {\n const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole]\n if (webRole != null) {\n viewProps.role = webRole || nativeProps.accessibilityRole\n }\n }\n }\n\n if (nativeProps.accessibilityActiveDescendant != null) {\n viewProps['aria-activedescendant'] = nativeProps.accessibilityActiveDescendant\n }\n if (nativeProps.accessibilityAtomic != null) {\n viewProps['aria-atomic'] = nativeProps.accessibilityAtomic\n }\n if (nativeProps.accessibilityAutoComplete != null) {\n viewProps['aria-autocomplete'] = nativeProps.accessibilityAutoComplete\n }\n if (nativeProps.accessibilityBusy != null) {\n viewProps['aria-busy'] = nativeProps.accessibilityBusy\n }\n if (nativeProps.accessibilityChecked != null) {\n viewProps['aria-checked'] = nativeProps.accessibilityChecked\n }\n if (nativeProps.accessibilityColumnCount != null) {\n viewProps['aria-colcount'] = nativeProps.accessibilityColumnCount\n }\n if (nativeProps.accessibilityColumnIndex != null) {\n viewProps['aria-colindex'] = nativeProps.accessibilityColumnIndex\n }\n if (nativeProps.accessibilityColumnSpan != null) {\n viewProps['aria-colspan'] = nativeProps.accessibilityColumnSpan\n }\n if (nativeProps.accessibilityControls != null) {\n viewProps['aria-controls'] = processIDRefList(nativeProps.accessibilityControls)\n }\n if (nativeProps.accessibilityCurrent != null) {\n viewProps['aria-current'] = nativeProps.accessibilityCurrent\n }\n if (nativeProps.accessibilityDescribedBy != null) {\n viewProps['aria-describedby'] = processIDRefList(nativeProps.accessibilityDescribedBy)\n }\n if (nativeProps.accessibilityDetails != null) {\n viewProps['aria-details'] = nativeProps.accessibilityDetails\n }\n if (nativeProps.disabled === true) {\n viewProps['aria-disabled'] = true\n // Enhance with native semantics\n if (\n elementType === 'button' ||\n elementType === 'form' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.disabled = true\n }\n }\n if (nativeProps.accessibilityErrorMessage != null) {\n viewProps['aria-errormessage'] = nativeProps.accessibilityErrorMessage\n }\n if (nativeProps.accessibilityExpanded != null) {\n viewProps['aria-expanded'] = nativeProps.accessibilityExpanded\n }\n if (nativeProps.accessibilityFlowTo != null) {\n viewProps['aria-flowto'] = processIDRefList(nativeProps.accessibilityFlowTo)\n }\n if (nativeProps.accessibilityHasPopup != null) {\n viewProps['aria-haspopup'] = nativeProps.accessibilityHasPopup\n }\n if (nativeProps.accessibilityHidden === true) {\n viewProps['aria-hidden'] = nativeProps.accessibilityHidden\n }\n if (nativeProps.accessibilityInvalid != null) {\n viewProps['aria-invalid'] = nativeProps.accessibilityInvalid\n }\n if (\n nativeProps.accessibilityKeyShortcuts != null &&\n Array.isArray(nativeProps.accessibilityKeyShortcuts)\n ) {\n viewProps['aria-keyshortcuts'] = nativeProps.accessibilityKeyShortcuts.join(' ')\n }\n if (nativeProps.accessibilityLabel != null) {\n viewProps['aria-label'] = nativeProps.accessibilityLabel\n }\n if (nativeProps.accessibilityLabelledBy != null) {\n viewProps['aria-labelledby'] = processIDRefList(nativeProps.accessibilityLabelledBy)\n }\n if (nativeProps.accessibilityLevel != null) {\n viewProps['aria-level'] = nativeProps.accessibilityLevel\n }\n if (nativeProps.accessibilityLiveRegion != null) {\n viewProps['aria-live'] =\n nativeProps.accessibilityLiveRegion === 'none' ? 'off' : nativeProps.accessibilityLiveRegion\n }\n if (nativeProps.accessibilityModal != null) {\n viewProps['aria-modal'] = nativeProps.accessibilityModal\n }\n if (nativeProps.accessibilityMultiline != null) {\n viewProps['aria-multiline'] = nativeProps.accessibilityMultiline\n }\n if (nativeProps.accessibilityMultiSelectable != null) {\n viewProps['aria-multiselectable'] = nativeProps.accessibilityMultiSelectable\n }\n if (nativeProps.accessibilityOrientation != null) {\n viewProps['aria-orientation'] = nativeProps.accessibilityOrientation\n }\n if (nativeProps.accessibilityOwns != null) {\n viewProps['aria-owns'] = processIDRefList(nativeProps.accessibilityOwns)\n }\n if (nativeProps.accessibilityPlaceholder != null) {\n viewProps['aria-placeholder'] = nativeProps.accessibilityPlaceholder\n }\n if (nativeProps.accessibilityPosInSet != null) {\n viewProps['aria-posinset'] = nativeProps.accessibilityPosInSet\n }\n if (nativeProps.accessibilityPressed != null) {\n viewProps['aria-pressed'] = nativeProps.accessibilityPressed\n }\n if (nativeProps.accessibilityReadOnly != null) {\n viewProps['aria-readonly'] = nativeProps.accessibilityReadOnly\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.readOnly = true\n }\n }\n if (nativeProps.accessibilityRequired != null) {\n viewProps['aria-required'] = nativeProps.accessibilityRequired\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.required = true\n }\n }\n if (nativeProps.accessibilityRoleDescription != null) {\n viewProps['aria-roledescription'] = nativeProps.accessibilityRoleDescription\n }\n if (nativeProps.accessibilityRowCount != null) {\n viewProps['aria-rowcount'] = nativeProps.accessibilityRowCount\n }\n if (nativeProps.accessibilityRowIndex != null) {\n viewProps['aria-rowindex'] = nativeProps.accessibilityRowIndex\n }\n if (nativeProps.accessibilityRowSpan != null) {\n viewProps['aria-rowspan'] = nativeProps.accessibilityRowSpan\n }\n if (nativeProps.accessibilitySelected != null) {\n viewProps['aria-selected'] = nativeProps.accessibilitySelected\n }\n if (nativeProps.accessibilitySetSize != null) {\n viewProps['aria-setsize'] = nativeProps.accessibilitySetSize\n }\n if (nativeProps.accessibilitySort != null) {\n viewProps['aria-sort'] = nativeProps.accessibilitySort\n }\n if (nativeProps.accessibilityValueMax != null) {\n viewProps['aria-valuemax'] = nativeProps.accessibilityValueMax\n }\n if (nativeProps.accessibilityValueMin != null) {\n viewProps['aria-valuemin'] = nativeProps.accessibilityValueMin\n }\n if (nativeProps.accessibilityValueNow != null) {\n viewProps['aria-valuenow'] = nativeProps.accessibilityValueNow\n }\n if (nativeProps.accessibilityValueText != null) {\n viewProps['aria-valuetext'] = nativeProps.accessibilityValueText\n }\n\n if (nativeProps.nativeID) {\n viewProps.id = nativeProps.nativeID\n }\n}\n\nfunction addPseudoToStyles(\n styles: any[],\n initialPseudos: SplitStyleResult['pseudos'],\n pseudos: any,\n name: string,\n force = false\n) {\n // on web use pseudo object { hoverStyle } to keep specificity with concatClassName\n const pseudoStyle = pseudos[name]\n const shouldNestObject = isWeb && name !== 'enterStyle' && name !== 'exitStyle'\n const defaultPseudoStyle = initialPseudos[name]\n const style = defaultPseudoStyle ? { ...defaultPseudoStyle, ...pseudoStyle } : pseudoStyle\n if (style) {\n styles.push(shouldNestObject && !force ? { [name]: style } : style)\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAeA;AACA;AAEA,MAAM;AAEN,MAAM,wBAA+C,OAAO,OAAO;AAAA,EACjE,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EAEP,SAAS;AAAA,EACT,WAAW;AACb,CAAC;AAEM,MAAM,WAAW,oBAAI,IAAc;AAC1C,IAAI,OAAO,aAAa,aAAa;AACnC,WAAS,iBAAiB,WAAW,MAAM;AACzC,aAAS,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC3B,aAAS,MAAM;AAAA,EACjB,CAAC;A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yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,0BAA0B,MAAM;AAC9C,cAAU,oBAAoB,YAAY;AAAA,EAC5C;AAEA,MAAI,YAAY,UAAU;AACxB,cAAU,KAAK,YAAY;AAAA,EAC7B;AACF;AAEA,2BACE,QACA,gBACA,SACA,MACA,QAAQ,OACR;AAEA,QAAM,cAAc,QAAQ;AAC5B,QAAM,mBAAmB,SAAS,SAAS,gBAAgB,SAAS;AACpE,QAAM,qBAAqB,eAAe;AAC1C,QAAM,QAAQ,qBAAqB,kCAAK,qBAAuB,eAAgB;AAC/E,MAAI,OAAO;AACT,WAAO,KAAK,oBAAoB,CAAC,QAAQ,EAAE,CAAC,OAAO,MAAM,IAAI,KAAK;AAAA,EACpE;AACF;",
|
|
4
|
+
"sourcesContent": ["import { composeEventHandlers, stylePropsView, validStyles } from '@tamagui/helpers'\nimport { useForceUpdate } from '@tamagui/use-force-update'\nimport React, {\n Children,\n Fragment,\n createElement,\n forwardRef,\n memo,\n startTransition,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { StyleSheet, Text, View, ViewStyle } from 'react-native'\n\nimport { getConfig, onConfiguredOnce } from './conf'\nimport { stackDefaultStyles } from './constants/constants'\nimport { isWeb, useIsomorphicLayoutEffect } from './constants/platform'\nimport { rnw } from './constants/rnw'\nimport { getReturnVariablesAs } from './helpers/createPropMapper'\nimport { createShallowUpdate } from './helpers/createShallowUpdate'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport { SplitStyleResult, insertSplitStyles, useSplitStyles } from './helpers/getSplitStyles'\nimport { getAllSelectors } from './helpers/insertStyleRule'\nimport { mergeProps } from './helpers/mergeProps'\nimport { proxyThemeVariables } from './helpers/proxyThemeVariables'\nimport { wrapThemeManagerContext } from './helpers/wrapThemeManagerContext'\nimport { useFeatures } from './hooks/useFeatures'\nimport { useIsTouchDevice } from './hooks/useIsTouchDevice'\nimport { mediaState } from './hooks/useMedia'\nimport { usePressable } from './hooks/usePressable'\nimport { getThemeManagerIfChanged, useTheme } from './hooks/useTheme'\nimport { Pressability } from './Pressability'\nimport {\n SpaceDirection,\n SpaceTokens,\n StackProps,\n StaticConfig,\n StaticConfigParsed,\n StylableComponent,\n TamaguiComponent,\n TamaguiComponentState,\n TamaguiConfig,\n TamaguiElement,\n TamaguiInternalConfig,\n UseAnimationHook,\n} from './types'\nimport { Slot, mergeEvent } from './views/Slot'\nimport { TextAncestorContext } from './views/TextAncestorContext'\n\nReact['keep']\n\nconst defaultComponentState: TamaguiComponentState = Object.freeze({\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n // only used by enterStyle\n mounted: false,\n animation: null,\n})\n\nexport const mouseUps = new Set<Function>()\nif (typeof document !== 'undefined') {\n document.addEventListener('mouseup', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n document.addEventListener('touchend', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n document.addEventListener('touchcancel', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n}\n\n// mutates\nfunction mergeShorthands({ defaultProps }: StaticConfigParsed, { shorthands }: TamaguiConfig) {\n // they are defined in correct order already { ...parent, ...child }\n for (const key in defaultProps) {\n defaultProps[shorthands[key] || key] = defaultProps[key]\n }\n}\n\nlet initialTheme: any\n\nexport function createComponent<\n ComponentPropTypes extends Object = {},\n Ref = TamaguiElement,\n BaseProps = never\n>(configIn: Partial<StaticConfig> | StaticConfigParsed, ParentComponent?: StylableComponent) {\n const staticConfig = (() => {\n const config = extendStaticConfig(configIn, ParentComponent)\n if ('parsed' in config) {\n return config\n } else {\n return parseStaticConfig(config)\n }\n })()\n\n const defaultComponentClassName = `is_${staticConfig.componentName}`\n let tamaguiConfig: TamaguiInternalConfig\n let AnimatedText: any\n let AnimatedView: any\n let avoidClasses = true\n let defaultNativeStyle: any\n let defaultNativeStyleSheet: StyleSheet.NamedStyles<{ base: {} }>\n let tamaguiDefaultProps: any\n let initialSplitStyles: SplitStyleResult\n\n // see onConfiguredOnce below which attaches a name then to this component\n const component = forwardRef<Ref, ComponentPropTypes>((propsIn: any, forwardedRef) => {\n // React inserts default props after your props for some reason...\n // order important so we do loops, you can't just spread because JS does weird things\n let props: any\n if (tamaguiDefaultProps && !propsIn.asChild) {\n props = mergeProps(tamaguiDefaultProps, propsIn)\n } else {\n props = propsIn\n }\n\n const { Component, isText, isZStack } = staticConfig\n const componentName = props.componentName || staticConfig.componentName\n const componentClassName = props.asChild\n ? ''\n : props.componentName\n ? `is_${props.componentName}`\n : defaultComponentClassName\n\n if (true) {\n if (props['debug']) {\n // prettier-ignore\n console.log('\u26A0\uFE0F', componentName || Component?.displayName || Component?.name || '[Unnamed Component]', 'debug on')\n // keep separate react native warn touches every value on prop causing weird behavior\n console.log('props in:', {\n propsIn,\n props,\n ordered: Object.keys(props),\n })\n if (props['debug'] === 'break') debugger\n }\n }\n\n const forceUpdate = useForceUpdate()\n const theme = useTheme(props.theme, componentName, props, forceUpdate)\n const statesUsed = useState<TamaguiComponentState>(defaultComponentState)\n const setStateShallow = createShallowUpdate(statesUsed[1])\n let state = statesUsed[0]\n\n // allow forcing a pseudo state on\n if (propsIn.forceStyle) {\n state = {\n ...state,\n [propsIn.forceStyle]: true,\n }\n }\n\n const shouldAvoidClasses = !!(props.animation && avoidClasses)\n const shouldForcePseudo = !!propsIn.forceStyle\n const hasTextAncestor = !!(isWeb ? useContext(TextAncestorContext) : false)\n const splitStyleState =\n !shouldAvoidClasses && !shouldForcePseudo\n ? {\n ...state,\n hasTextAncestor,\n dynamicStylesInline: true,\n }\n : ({\n ...state,\n noClassNames: true,\n dynamicStylesInline: true,\n hasTextAncestor,\n resolveVariablesAs: 'value',\n } as const)\n const splitStyles = useSplitStyles(\n props,\n staticConfig,\n theme,\n splitStyleState,\n props.asChild ? null : initialSplitStyles.classNames,\n props['debug']\n )\n\n const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles\n const useAnimations = tamaguiConfig.animations?.useAnimations as UseAnimationHook | undefined\n const isAnimated = !!(useAnimations && props.animation)\n const hasEnterStyle = !!props.enterStyle\n const hostRef = useRef<HTMLElement | View>(null)\n\n const animationFeatureStylesIn = props.animation ? { ...defaultNativeStyle, ...style } : null\n\n const features = useFeatures(props, {\n forceUpdate,\n setStateShallow,\n useAnimations,\n state,\n style: animationFeatureStylesIn,\n pseudos,\n staticConfig,\n theme,\n hostRef,\n onDidAnimate: props.onDidAnimate,\n })\n\n const {\n tag,\n hitSlop,\n asChild,\n children,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space: spaceProp,\n spaceDirection: _spaceDirection,\n disabled: disabledProp,\n onMouseUp,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\n separator,\n // ignore from here on out\n forceStyle: _forceStyle,\n // @ts-ignore for next/link compat etc\n onClick,\n theme: _themeProp,\n // @ts-ignore\n defaultVariants,\n\n ...nonTamaguiProps\n } = viewPropsIn\n\n // get the right component\n const isTaggable = !Component || typeof Component === 'string'\n\n // default to tag, fallback to component (when both strings)\n const element = isWeb ? (isTaggable ? tag || Component : Component) : Component\n const BaseTextComponent = !isWeb ? Text : element || 'span'\n const BaseViewComponent = !isWeb ? View : element || (hasTextAncestor ? 'span' : 'div')\n let elementType = isText\n ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent\n : (isAnimated ? AnimatedView || View : null) || BaseViewComponent\n\n elementType = Component || elementType\n const isStringElement = typeof elementType === 'string'\n\n const disabled =\n (props.accessibilityState != null && props.accessibilityState.disabled === true) ||\n props.accessibilityDisabled\n\n // these can ultimately be for DOM, react-native-web views, or animated views\n // so the type is pretty loose\n let viewProps: Record<string, any>\n\n // if react-native-web view just pass all props down\n if (isWeb && !staticConfig.isReactNativeWeb) {\n // otherwise replicate react-native-web functionality\n const {\n // event props\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n\n // react-native props\n nativeID,\n\n // react-native-web accessibility props\n // @ts-ignore\n accessibilityActiveDescendant,\n // @ts-ignore\n accessibilityAtomic,\n // @ts-ignore\n accessibilityAutoComplete,\n // @ts-ignore\n accessibilityBusy,\n // @ts-ignore\n accessibilityChecked,\n // @ts-ignore\n accessibilityColumnCount,\n // @ts-ignore\n accessibilityColumnIndex,\n // @ts-ignore\n accessibilityColumnSpan,\n // @ts-ignore\n accessibilityControls,\n // @ts-ignore\n accessibilityCurrent,\n // @ts-ignore\n accessibilityDescribedBy,\n // @ts-ignore\n accessibilityDetails,\n // @ts-ignore\n accessibilityDisabled,\n // @ts-ignore\n accessibilityErrorMessage,\n // @ts-ignore\n accessibilityExpanded,\n // @ts-ignore\n accessibilityFlowTo,\n // @ts-ignore\n accessibilityHasPopup,\n // @ts-ignore\n accessibilityHidden,\n // @ts-ignore\n accessibilityInvalid,\n // @ts-ignore\n accessibilityKeyShortcuts,\n // @ts-ignore\n accessibilityLabel,\n // @ts-ignore\n accessibilityLabelledBy,\n // @ts-ignore\n accessibilityLevel,\n // @ts-ignore\n accessibilityLiveRegion,\n // @ts-ignore\n accessibilityModal,\n // @ts-ignore\n accessibilityMultiline,\n // @ts-ignore\n accessibilityMultiSelectable,\n // @ts-ignore\n accessibilityOrientation,\n // @ts-ignore\n accessibilityOwns,\n // @ts-ignore\n accessibilityPlaceholder,\n // @ts-ignore\n accessibilityPosInSet,\n // @ts-ignore\n accessibilityPressed,\n // @ts-ignore\n accessibilityReadOnly,\n // @ts-ignore\n accessibilityRequired,\n // @ts-ignore\n accessibilityRole,\n // @ts-ignore\n accessibilityRoleDescription,\n // @ts-ignore\n accessibilityRowCount,\n // @ts-ignore\n accessibilityRowIndex,\n // @ts-ignore\n accessibilityRowSpan,\n // @ts-ignore\n accessibilitySelected,\n // @ts-ignore\n accessibilitySetSize,\n // @ts-ignore\n accessibilitySort,\n // @ts-ignore\n accessibilityValueMax,\n // @ts-ignore\n accessibilityValueMin,\n // @ts-ignore\n accessibilityValueNow,\n // @ts-ignore\n accessibilityValueText,\n\n // deprecated\n accessible,\n accessibilityState,\n accessibilityValue,\n\n // android\n collapsable,\n focusable,\n\n onLayout,\n\n ...webProps\n } = nonTamaguiProps\n\n viewProps = webProps\n\n assignNativePropsToWeb(elementType, viewProps, nonTamaguiProps)\n\n if (!asChild) {\n rnw.useElementLayout(hostRef, onLayout)\n\n // from react-native-web\n rnw.useResponderEvents(hostRef, {\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n })\n }\n\n // from react-native-web\n const platformMethodsRef = rnw.usePlatformMethods(viewProps)\n const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef)\n\n if (!isAnimated) {\n // @ts-ignore\n viewProps.ref = setRef\n } else {\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\n\n if (props.href != undefined && hrefAttrs != undefined) {\n const { download, rel, target } = hrefAttrs\n if (download != null) {\n viewProps.download = download\n }\n if (rel != null) {\n viewProps.rel = rel\n }\n if (typeof target === 'string') {\n viewProps.target = target.charAt(0) !== '_' ? '_' + target : target\n }\n }\n\n // FOCUS\n // \"focusable\" indicates that an element may be a keyboard tab-stop.\n const _focusable = focusable != undefined ? focusable : accessible\n const role = viewProps.role\n if (props['debug']) {\n console.log('_focusable', focusable)\n }\n if (_focusable === false) {\n viewProps.tabIndex = '-1'\n }\n if (\n // These native elements are focusable by default\n elementType === 'a' ||\n elementType === 'button' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n if (_focusable === false || accessibilityDisabled === true) {\n viewProps.tabIndex = '-1'\n }\n } else if (\n // These roles are made focusable by default\n role === 'button' ||\n role === 'checkbox' ||\n role === 'link' ||\n role === 'radio' ||\n role === 'textbox' ||\n role === 'switch'\n ) {\n if (_focusable !== false) {\n viewProps.tabIndex = '0'\n }\n }\n // Everything else must explicitly set the prop\n if (_focusable === true) {\n viewProps.tabIndex = '0'\n }\n } else {\n viewProps = nonTamaguiProps\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\n\n if (props['debug']) {\n console.log('viewProps', elementType, viewProps.role, viewProps.tabIndex)\n }\n\n // from react-native-web\n if (true && !isText && isWeb) {\n Children.toArray(props.children).forEach((item) => {\n if (typeof item === 'string') {\n console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`)\n }\n })\n }\n\n // isMounted\n const internal = useRef<{ isMounted: boolean; unmountEffects?: Function[] }>()\n if (!internal.current) {\n internal.current = {\n isMounted: true,\n }\n }\n\n useIsomorphicLayoutEffect(() => {\n // we need to use state to properly have mounted go from false => true\n if (typeof window !== 'undefined' && (hasEnterStyle || props.animation)) {\n // for SSR we never set mounted, ensuring enterStyle={{}} is set by default\n startTransition(() => {\n setStateShallow({\n mounted: true,\n })\n })\n }\n\n internal.current!.isMounted = true\n return () => {\n mouseUps.delete(unPress)\n internal.current!.isMounted = false\n internal.current!.unmountEffects?.forEach((cb) => cb())\n }\n }, [hasEnterStyle, props.animation])\n\n let styles: any[]\n\n const animationStyles = state.animation ? state.animation.style : null\n\n if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {\n styles = {\n ...defaultNativeStyle,\n ...(animationStyles ?? style),\n ...medias,\n }\n } else {\n styles = [\n isWeb ? null : defaultNativeStyleSheet ? (defaultNativeStyleSheet.base as ViewStyle) : null,\n animationStyles ?? style,\n medias,\n ]\n if (!animationStyles) {\n const initPseudos = initialSplitStyles.pseudos\n const force = shouldForcePseudo\n !state.mounted && addPseudoToStyles(styles, initPseudos, pseudos, 'enterStyle')\n state.hover && addPseudoToStyles(styles, initPseudos, pseudos, 'hoverStyle', force)\n state.focus && addPseudoToStyles(styles, initPseudos, pseudos, 'focusStyle', force)\n state.press && addPseudoToStyles(styles, initPseudos, pseudos, 'pressStyle', force)\n }\n // ugly but for now...\n if (shouldForcePseudo) {\n const next = {}\n for (const style of styles) {\n if (style) {\n Object.assign(next, style)\n }\n }\n // @ts-ignore\n Object.assign(splitStyles.style, next)\n }\n }\n\n if (isWeb) {\n const fontFamilyName = isText\n ? props.fontFamily || staticConfig.defaultProps.fontFamily\n : null\n const fontFamily =\n fontFamilyName && fontFamilyName[0] === '$' ? fontFamilyName.slice(1) : null\n const classList = [\n componentName ? componentClassName : '',\n fontFamily ? `font_${fontFamily}` : '',\n theme.className,\n classNames ? Object.values(classNames).join(' ') : '',\n ]\n\n const className = classList.join(' ')\n const style = animationStyles ?? splitStyles.style\n\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n // prettier-ignore\n console.log(' \u00BB className', { splitStyles, style, isStringElement, pseudos, state, classNames, propsClassName: props.className, classList, className: className.trim().split(' '), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) })\n }\n\n // TODO this is specific to reanimated rn\n const isAnimatedReactNativeWeb = props.animation && avoidClasses\n\n if (staticConfig.isReactNativeWeb || isAnimatedReactNativeWeb) {\n viewProps.dataSet = {\n ...viewProps.dataSet,\n className,\n id: props.id,\n }\n if (props['data-is']) {\n viewProps.dataSet.is = props['data-is']\n }\n } else {\n viewProps.className = className\n }\n\n viewProps.style = style\n } else {\n viewProps.style = styles\n }\n\n // TODO need to loop active variants and see if they have matchin pseudos and apply as well\n const initialPseudos = initialSplitStyles.pseudos\n const attachPress = !!(\n pseudos?.pressStyle ||\n initialPseudos?.pressStyle ||\n onPress ||\n onPressOut ||\n onPressIn ||\n onClick\n )\n\n const isTouch = useIsTouchDevice()\n const isHoverable = isWeb && !isTouch\n const attachHover =\n isHoverable &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n\n const handlesPressEvents = !isStringElement && !asChild\n const pressKey = handlesPressEvents ? 'onPress' : 'onClick'\n const pressInKey = handlesPressEvents ? 'onPressIn' : 'onMouseDown'\n const pressOutKey = handlesPressEvents ? 'onPressOut' : 'onMouseUp'\n\n // check presence to prevent reparenting bugs, allows for onPress={x ? function : undefined} usage\n // while avoiding reparenting...\n // once proper reparenting is supported, we can remove this and use that...\n const shouldAttach =\n !asChild &&\n (attachPress ||\n attachHover ||\n 'pressStyle' in props ||\n 'onPress' in props ||\n 'onPressIn' in props ||\n 'onPressOut' in props ||\n (isWeb &&\n ('hoverStyle' in props ||\n 'onHoverIn' in props ||\n 'onHoverOut' in props ||\n 'onMouseEnter' in props ||\n 'onMouseLeave' in props)))\n\n const unPress = useCallback(() => {\n if (!internal.current!.isMounted) return\n setStateShallow({\n press: false,\n pressIn: false,\n })\n }, [])\n\n const events = shouldAttach\n ? {\n [pressOutKey]: attachPress\n ? (e) => {\n unPress()\n onPressOut?.(e)\n onMouseUp?.(e)\n }\n : undefined,\n ...(isHoverable && {\n onMouseEnter: attachHover\n ? (e) => {\n let next: Partial<typeof state> = {}\n if (attachHover) {\n next.hover = true\n }\n if (state.pressIn) {\n next.press = true\n }\n if (Object.keys(next).length) {\n setStateShallow(next)\n }\n onHoverIn?.(e)\n onMouseEnter?.(e)\n }\n : undefined,\n onMouseLeave: attachHover\n ? (e) => {\n let next: Partial<typeof state> = {}\n mouseUps.add(unPress)\n if (attachHover) {\n next.hover = false\n }\n if (state.pressIn) {\n next.press = false\n next.pressIn = false\n }\n if (Object.keys(next).length) {\n setStateShallow(next)\n }\n onHoverOut?.(e)\n onMouseLeave?.(e)\n }\n : undefined,\n }),\n [pressInKey]: attachPress\n ? (e) => {\n setStateShallow({\n press: true,\n pressIn: true,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n if (isWeb) {\n mouseUps.add(unPress)\n }\n }\n : null,\n [pressKey]: attachPress\n ? (e) => {\n unPress()\n onClick?.(e)\n onPress?.(e)\n }\n : null,\n\n // replicating TouchableWithoutFeedback\n ...(!isWeb && {\n cancelable: !props.rejectResponderTermination,\n disabled: props.disabled !== null ? props.disabled : props.accessibilityState?.disabled,\n hitSlop: props.hitSlop,\n delayLongPress: props.delayLongPress,\n delayPressIn: props.delayPressIn,\n delayPressOut: props.delayPressOut,\n focusable: viewProps.focusable ?? true,\n minPressDuration: 0,\n }),\n }\n : null\n\n let space = spaceProp\n // find space by media query\n if (features.enabled.mediaQuery) {\n for (const key in mediaState) {\n if (!mediaState[key]) continue\n if (props[key] && props[key].space !== undefined) {\n space = props[key].space\n }\n }\n }\n\n let childEls =\n !children || asChild\n ? children\n : wrapThemeManagerContext(\n spacedChildren({\n separator,\n children,\n space,\n direction: props.spaceDirection || 'both',\n isZStack,\n }),\n getThemeManagerIfChanged(theme)\n )\n\n let content: any\n\n if (asChild) {\n elementType = Slot\n viewProps = {\n ...viewProps,\n onPress,\n onPressIn,\n onPressOut,\n }\n }\n\n // EVENTS: web\n if (isWeb) {\n const [pressableProps] = usePressable(\n events\n ? {\n disabled,\n ...(hitSlop && {\n hitSlop,\n }),\n onPressOut: events[pressOutKey],\n onPressIn: events[pressInKey],\n onPress: events[pressKey],\n }\n : {\n disabled: true,\n }\n )\n if (events) {\n if (handlesPressEvents) {\n Object.assign(viewProps, pressableProps)\n } else {\n Object.assign(viewProps, events)\n }\n }\n }\n\n // add focus events\n if (process.env.TAMAGUI_TARGET === 'native') {\n const attachFocus = !!(\n (pseudos && pseudos.focusStyle) ||\n (initialPseudos && initialPseudos.focusStyle)\n )\n if (attachFocus) {\n viewProps.onFocus = mergeEvent(viewProps.onFocus, () => {\n setStateShallow({ focus: true })\n })\n viewProps.onBlur = mergeEvent(viewProps.onBlur, () => {\n setStateShallow({ focus: false })\n })\n }\n }\n\n // EVENTS native\n // replicates TouchableWithoutFeedback\n if (process.env.TAMAGUI_TARGET === 'native') {\n // only ever create once, use .configure() to update later\n const pressability = useMemo(() => {\n if (attachPress && events) {\n const pressability = new Pressability(events)\n internal.current!.unmountEffects = [\n () => {\n pressability.reset()\n },\n ]\n return pressability\n }\n }, [])\n\n if (attachPress && events) {\n pressability.configure(events)\n const eventHandlers = pressability.getEventHandlers()\n for (const key in eventHandlers) {\n if (key === 'onBlur' || key === 'onFocus') {\n // avoids the default\n continue\n }\n const og = props[key]\n const val = eventHandlers[key]\n viewProps[key] = og ? composeEventHandlers(og, val) : val\n }\n }\n }\n\n content = createElement(elementType, viewProps, childEls)\n\n if (isWeb) {\n // only necessary when animating because some AnimatedView which wraps RNW View doesn't forward dataSet className\n const isAnimatedRNWView = isAnimated && typeof elementType !== 'string' // assuming for now as reanimated is only driver\n const shouldWrapWithComponentTheme =\n isAnimatedRNWView && getReturnVariablesAs(props, splitStyleState) === 'non-color-value'\n const shouldWrapWithHover = events && attachHover\n\n if (shouldWrapWithHover || shouldWrapWithComponentTheme) {\n const themeClassName = shouldWrapWithComponentTheme ? `${theme.className}` : ''\n const hoverClassName = shouldWrapWithHover ? 't_Hoverable' : ''\n content = (\n <span\n className={`${hoverClassName} ${themeClassName}`}\n style={{\n display: 'contents',\n }}\n {...(shouldWrapWithHover && {\n onMouseEnter: events.onMouseEnter,\n onMouseLeave: events.onMouseLeave,\n })}\n >\n {content}\n </span>\n )\n }\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log('\u2B50\uFE0F', { propsIn: { ...props }, propsOut: { ...viewProps }, elementType, state, splitStyles, animationStyles, isStringElement, classNamesIn: props.className?.split(' '), classNamesOut: viewProps.className?.split(' '), events, shouldAttach, ViewComponent: elementType, viewProps, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles, ...(typeof window !== 'undefined' ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo } : null) })\n }\n }\n\n if (features.elements.length) {\n return (\n <>\n {features.elements}\n {content}\n </>\n )\n }\n\n return content\n })\n\n component.displayName = staticConfig.componentName\n\n // Once configuration is run and all components are registered\n // get default props + className and analyze styles\n onConfiguredOnce((conf) => {\n if (process.env.IS_STATIC === 'is_static') {\n // in static mode we just use these to lookup configuration\n return\n }\n\n tamaguiConfig = conf\n\n // do this to make sure shorthands don't duplicate with.. longhands\n mergeShorthands(staticConfig, tamaguiConfig)\n\n avoidClasses = !!tamaguiConfig.animations?.avoidClasses\n AnimatedText = tamaguiConfig.animations?.Text\n AnimatedView = tamaguiConfig?.animations?.View\n initialTheme =\n initialTheme ||\n proxyThemeVariables(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]])\n\n // adds in user defined default props\n const config = getConfig()\n\n let defaultPropsIn = staticConfig.defaultProps\n\n // because we run createTamagui after styled() defs, have to do some work here\n const parentNames = [...(staticConfig.parentNames || []), staticConfig.componentName]\n\n // gather defaults props one time and merge downwards\n // find last unprocessed and process\n if (config.defaultProps && parentNames) {\n const len = parentNames.length\n let prev\n\n for (let i = 0; i < len; i++) {\n const n = parentNames[i]\n if (!n) continue\n if (DefaultProps.has(n)) {\n prev = DefaultProps.get(n)\n continue\n }\n const props = config.defaultProps[n]\n if (!props) {\n if (prev) {\n DefaultProps.set(n, prev)\n }\n continue\n }\n prev = mergeProps(prev || {}, props)\n DefaultProps.set(n, prev)\n }\n\n // overwrite the user defined defaults on top of internal defined defaults\n const ourDefaultsMerged = DefaultProps.get(staticConfig.componentName)\n if (ourDefaultsMerged) {\n defaultPropsIn = mergeProps(defaultPropsIn, ourDefaultsMerged)\n }\n }\n\n if (process.env.NODE_ENV === 'development' && defaultPropsIn['debug'] === 'break') {\n debugger\n }\n\n initialSplitStyles = insertSplitStyles(\n defaultPropsIn,\n staticConfig,\n initialTheme,\n {\n mounted: true,\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n resolveVariablesAs: 'both',\n keepVariantsAsProps: true,\n },\n undefined,\n staticConfig.defaultProps['debug']\n )\n\n // must preserve prop order\n const defaults = mergeProps(component.defaultProps as any, initialSplitStyles.viewProps)\n\n defaultNativeStyle = {}\n\n const validStyles = staticConfig.validStyles || stylePropsView\n\n // split - keep variables on props to be processed using theme values at runtime (native)\n if (!isWeb) {\n for (const key in staticConfig.defaultProps) {\n const val = staticConfig.defaultProps[key]\n if ((typeof val === 'string' && val[0] === '$') || !validStyles[key] || val[0] === '_') {\n defaults[key] = val\n } else {\n defaultNativeStyle[key] = val\n }\n }\n }\n\n defaultNativeStyleSheet = StyleSheet.create({\n base: defaultNativeStyle,\n })\n\n if (Object.keys(defaults).length) {\n tamaguiDefaultProps = defaults\n }\n\n // add debug logs\n if (process.env.NODE_ENV === 'development' && staticConfig.defaultProps?.debug) {\n if (process.env.IS_STATIC !== 'is_static') {\n console.log(`\uD83D\uDC1B [${staticConfig.componentName || 'Component'}]`, {\n staticConfig,\n initialSplitStyles,\n tamaguiDefaultProps,\n defaultNativeStyle,\n defaults,\n })\n }\n }\n })\n\n let res: TamaguiComponent<ComponentPropTypes, Ref, BaseProps> = component as any\n\n if (configIn.memo) {\n res = memo(res) as any\n }\n\n res.staticConfig = {\n validStyles: staticConfig.validStyles || stylePropsView,\n ...staticConfig,\n }\n\n // res.extractable HoC\n res.extractable = (Component: any, conf?: Partial<StaticConfig>) => {\n Component.staticConfig = extendStaticConfig(\n {\n Component,\n ...conf,\n neverFlatten: true,\n isExtractable: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n },\n res\n )\n return Component\n }\n\n return res\n}\n\nconst DefaultProps = new Map()\n\n// for elements to avoid spacing\nexport const Unspaced = (props: { children?: any }) => {\n return props.children\n}\nUnspaced['isUnspaced'] = true\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport type SpacerProps = Omit<StackProps, 'flex' | 'direction'> & {\n size?: number | SpaceTokens\n flex?: boolean | number\n direction?: SpaceDirection\n}\nexport const Spacer = createComponent<SpacerProps>({\n memo: true,\n componentName: 'Spacer',\n validStyles,\n defaultProps: {\n ...stackDefaultStyles,\n size: true,\n },\n variants: {\n size: {\n '...size': (size, { tokens }) => {\n size = size == true ? '$true' : size\n const sizePx = tokens.space[size] ?? size\n return {\n width: sizePx,\n height: sizePx,\n minWidth: sizePx,\n minHeight: sizePx,\n }\n },\n },\n\n flex: {\n true: {\n flexGrow: 1,\n },\n },\n\n direction: {\n horizontal: {\n height: 0,\n minHeight: 0,\n },\n vertical: {\n width: 0,\n minWidth: 0,\n },\n both: {},\n },\n },\n\n defaultVariants: {\n direction: 'both',\n },\n})\n\nexport type SpacedChildrenProps = {\n isZStack?: boolean\n children?: any\n space?: any\n spaceFlex?: boolean | number\n direction?: SpaceDirection\n separator?: React.ReactNode\n}\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n direction,\n spaceFlex,\n separator,\n}: SpacedChildrenProps) {\n const hasSpace = !!(space || spaceFlex)\n const hasSeparator = !(separator === undefined || separator === null)\n if (!hasSpace && !hasSeparator && !isZStack) {\n return children\n }\n const childrenList = Children.toArray(children)\n if (childrenList.length <= 1 && !isZStack) {\n return childrenList\n }\n const final: any[] = []\n for (const [index, child] of childrenList.entries()) {\n const isEmpty =\n child === null || child === undefined || (Array.isArray(child) && child.length === 0)\n\n // push them all, but wrap some in Fragment\n if (isEmpty || !child || (child['key'] && !isZStack)) {\n final.push(child)\n } else {\n final.push(\n <Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n }\n\n // first child unspaced avoid insert space\n if (isUnspaced(child) && index === 0) {\n continue\n }\n\n // no spacing on ZStack\n if (isZStack) {\n continue\n }\n\n const next = childrenList[index + 1]\n\n if (next && !isUnspaced(next)) {\n if (separator) {\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}_before_sep_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n final.push(\n React.isValidElement(separator)\n ? React.cloneElement(separator, { key: `sep_${index}` })\n : separator\n )\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}_after_sep_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n } else {\n final.push(\n createSpacer({\n key: `_${index}_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n }\n }\n\n return final\n}\n\ntype CreateSpacerProps = SpacedChildrenProps & { key: string }\n\nfunction createSpacer({ key, direction, space, spaceFlex }: CreateSpacerProps) {\n return (\n <Spacer\n key={key}\n size={space}\n direction={direction}\n {...(spaceFlex && {\n flex: spaceFlex,\n })}\n />\n )\n}\n\nfunction isUnspaced(child: any) {\n return child?.['type']?.['isVisuallyHidden'] || child?.['type']?.['isUnspaced']\n}\n\nexport function AbsoluteFill(props: { children?: React.ReactNode }) {\n return (\n <View pointerEvents=\"box-none\" style={StyleSheet.absoluteFill}>\n {props.children}\n </View>\n )\n}\n\n// this can be done with CSS entirely right?\n// const shouldWrapTextAncestor = isWeb && isText && !hasTextAncestor\n// if (shouldWrapTextAncestor) {\n// // from react-native-web\n// content = createElement(TextAncestorContext.Provider, { value: true }, content)\n// }\n\nfunction processIDRefList(idRefList: string | Array<string>): string {\n return Array.isArray(idRefList) ? idRefList.join(' ') : idRefList\n}\n\nconst accessibilityRoleToWebRole = {\n adjustable: 'slider',\n button: 'button',\n header: 'heading',\n image: 'img',\n imagebutton: null,\n keyboardkey: null,\n label: null,\n link: 'link',\n none: 'presentation',\n search: 'search',\n summary: 'region',\n text: null,\n}\n\n// adapted from react-native-web\nexport function assignNativePropsToWeb(elementType: string, viewProps: any, nativeProps: any) {\n if (!viewProps.role && nativeProps.accessibilityRole) {\n if (nativeProps.accessibilityRole === 'none') {\n viewProps.role = 'presentation'\n } else {\n const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole]\n if (webRole != null) {\n viewProps.role = webRole || nativeProps.accessibilityRole\n }\n }\n }\n\n if (nativeProps.accessibilityActiveDescendant != null) {\n viewProps['aria-activedescendant'] = nativeProps.accessibilityActiveDescendant\n }\n if (nativeProps.accessibilityAtomic != null) {\n viewProps['aria-atomic'] = nativeProps.accessibilityAtomic\n }\n if (nativeProps.accessibilityAutoComplete != null) {\n viewProps['aria-autocomplete'] = nativeProps.accessibilityAutoComplete\n }\n if (nativeProps.accessibilityBusy != null) {\n viewProps['aria-busy'] = nativeProps.accessibilityBusy\n }\n if (nativeProps.accessibilityChecked != null) {\n viewProps['aria-checked'] = nativeProps.accessibilityChecked\n }\n if (nativeProps.accessibilityColumnCount != null) {\n viewProps['aria-colcount'] = nativeProps.accessibilityColumnCount\n }\n if (nativeProps.accessibilityColumnIndex != null) {\n viewProps['aria-colindex'] = nativeProps.accessibilityColumnIndex\n }\n if (nativeProps.accessibilityColumnSpan != null) {\n viewProps['aria-colspan'] = nativeProps.accessibilityColumnSpan\n }\n if (nativeProps.accessibilityControls != null) {\n viewProps['aria-controls'] = processIDRefList(nativeProps.accessibilityControls)\n }\n if (nativeProps.accessibilityCurrent != null) {\n viewProps['aria-current'] = nativeProps.accessibilityCurrent\n }\n if (nativeProps.accessibilityDescribedBy != null) {\n viewProps['aria-describedby'] = processIDRefList(nativeProps.accessibilityDescribedBy)\n }\n if (nativeProps.accessibilityDetails != null) {\n viewProps['aria-details'] = nativeProps.accessibilityDetails\n }\n if (nativeProps.disabled === true) {\n viewProps['aria-disabled'] = true\n // Enhance with native semantics\n if (\n elementType === 'button' ||\n elementType === 'form' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.disabled = true\n }\n }\n if (nativeProps.accessibilityErrorMessage != null) {\n viewProps['aria-errormessage'] = nativeProps.accessibilityErrorMessage\n }\n if (nativeProps.accessibilityExpanded != null) {\n viewProps['aria-expanded'] = nativeProps.accessibilityExpanded\n }\n if (nativeProps.accessibilityFlowTo != null) {\n viewProps['aria-flowto'] = processIDRefList(nativeProps.accessibilityFlowTo)\n }\n if (nativeProps.accessibilityHasPopup != null) {\n viewProps['aria-haspopup'] = nativeProps.accessibilityHasPopup\n }\n if (nativeProps.accessibilityHidden === true) {\n viewProps['aria-hidden'] = nativeProps.accessibilityHidden\n }\n if (nativeProps.accessibilityInvalid != null) {\n viewProps['aria-invalid'] = nativeProps.accessibilityInvalid\n }\n if (\n nativeProps.accessibilityKeyShortcuts != null &&\n Array.isArray(nativeProps.accessibilityKeyShortcuts)\n ) {\n viewProps['aria-keyshortcuts'] = nativeProps.accessibilityKeyShortcuts.join(' ')\n }\n if (nativeProps.accessibilityLabel != null) {\n viewProps['aria-label'] = nativeProps.accessibilityLabel\n }\n if (nativeProps.accessibilityLabelledBy != null) {\n viewProps['aria-labelledby'] = processIDRefList(nativeProps.accessibilityLabelledBy)\n }\n if (nativeProps.accessibilityLevel != null) {\n viewProps['aria-level'] = nativeProps.accessibilityLevel\n }\n if (nativeProps.accessibilityLiveRegion != null) {\n viewProps['aria-live'] =\n nativeProps.accessibilityLiveRegion === 'none' ? 'off' : nativeProps.accessibilityLiveRegion\n }\n if (nativeProps.accessibilityModal != null) {\n viewProps['aria-modal'] = nativeProps.accessibilityModal\n }\n if (nativeProps.accessibilityMultiline != null) {\n viewProps['aria-multiline'] = nativeProps.accessibilityMultiline\n }\n if (nativeProps.accessibilityMultiSelectable != null) {\n viewProps['aria-multiselectable'] = nativeProps.accessibilityMultiSelectable\n }\n if (nativeProps.accessibilityOrientation != null) {\n viewProps['aria-orientation'] = nativeProps.accessibilityOrientation\n }\n if (nativeProps.accessibilityOwns != null) {\n viewProps['aria-owns'] = processIDRefList(nativeProps.accessibilityOwns)\n }\n if (nativeProps.accessibilityPlaceholder != null) {\n viewProps['aria-placeholder'] = nativeProps.accessibilityPlaceholder\n }\n if (nativeProps.accessibilityPosInSet != null) {\n viewProps['aria-posinset'] = nativeProps.accessibilityPosInSet\n }\n if (nativeProps.accessibilityPressed != null) {\n viewProps['aria-pressed'] = nativeProps.accessibilityPressed\n }\n if (nativeProps.accessibilityReadOnly != null) {\n viewProps['aria-readonly'] = nativeProps.accessibilityReadOnly\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.readOnly = true\n }\n }\n if (nativeProps.accessibilityRequired != null) {\n viewProps['aria-required'] = nativeProps.accessibilityRequired\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.required = true\n }\n }\n if (nativeProps.accessibilityRoleDescription != null) {\n viewProps['aria-roledescription'] = nativeProps.accessibilityRoleDescription\n }\n if (nativeProps.accessibilityRowCount != null) {\n viewProps['aria-rowcount'] = nativeProps.accessibilityRowCount\n }\n if (nativeProps.accessibilityRowIndex != null) {\n viewProps['aria-rowindex'] = nativeProps.accessibilityRowIndex\n }\n if (nativeProps.accessibilityRowSpan != null) {\n viewProps['aria-rowspan'] = nativeProps.accessibilityRowSpan\n }\n if (nativeProps.accessibilitySelected != null) {\n viewProps['aria-selected'] = nativeProps.accessibilitySelected\n }\n if (nativeProps.accessibilitySetSize != null) {\n viewProps['aria-setsize'] = nativeProps.accessibilitySetSize\n }\n if (nativeProps.accessibilitySort != null) {\n viewProps['aria-sort'] = nativeProps.accessibilitySort\n }\n if (nativeProps.accessibilityValueMax != null) {\n viewProps['aria-valuemax'] = nativeProps.accessibilityValueMax\n }\n if (nativeProps.accessibilityValueMin != null) {\n viewProps['aria-valuemin'] = nativeProps.accessibilityValueMin\n }\n if (nativeProps.accessibilityValueNow != null) {\n viewProps['aria-valuenow'] = nativeProps.accessibilityValueNow\n }\n if (nativeProps.accessibilityValueText != null) {\n viewProps['aria-valuetext'] = nativeProps.accessibilityValueText\n }\n\n if (nativeProps.nativeID) {\n viewProps.id = nativeProps.nativeID\n }\n}\n\nfunction addPseudoToStyles(\n styles: any[],\n initialPseudos: SplitStyleResult['pseudos'],\n pseudos: any,\n name: string,\n force = false\n) {\n // on web use pseudo object { hoverStyle } to keep specificity with concatClassName\n const pseudoStyle = pseudos[name]\n const shouldNestObject = isWeb && name !== 'enterStyle' && name !== 'exitStyle'\n const defaultPseudoStyle = initialPseudos[name]\n const style = defaultPseudoStyle ? { ...defaultPseudoStyle, ...pseudoStyle } : pseudoStyle\n if (style) {\n styles.push(shouldNestObject && !force ? { [name]: style } : style)\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAeA;AACA;AAEA,MAAM;AAEN,MAAM,wBAA+C,OAAO,OAAO;AAAA,EACjE,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EAEP,SAAS;AAAA,EACT,WAAW;AACb,CAAC;AAEM,MAAM,WAAW,oBAAI,IAAc;AAC1C,IAAI,OAAO,aAAa,aAAa;AACnC,WAAS,iBAAiB,WAAW,MAAM;AACzC,aAAS,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC3B,aAAS,MAAM;AAAA,EACjB,CAAC;AACD,WAAS,iBAAiB,YAAY,MAAM;AAC1C,aAAS,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC3B,aAAS,MAAM;AAAA,EACjB,CAAC;AACD,WAAS,iBAAiB,eAAe,MAAM;AAC7C,aAAS,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC3B,aAAS,MAAM;AAAA,EACjB,CAAC;AACH;AAGA,yBAAyB,EAAE,gBAAoC,EAAE,cAA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K,YAAY;AAAA,EAC7B;AACF;AAEA,2BACE,QACA,gBACA,SACA,MACA,QAAQ,OACR;AAEA,QAAM,cAAc,QAAQ;AAC5B,QAAM,mBAAmB,SAAS,SAAS,gBAAgB,SAAS;AACpE,QAAM,qBAAqB,eAAe;AAC1C,QAAM,QAAQ,qBAAqB,kCAAK,qBAAuB,eAAgB;AAC/E,MAAI,OAAO;AACT,WAAO,KAAK,oBAAoB,CAAC,QAAQ,EAAE,CAAC,OAAO,MAAM,IAAI,KAAK;AAAA,EACpE;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -71,7 +71,7 @@ const getSplitStyles = (props, staticConfig, theme, state, defaultClassNames, de
|
|
|
71
71
|
let transforms = null;
|
|
72
72
|
let rulesToInsert = null;
|
|
73
73
|
function addStyle(prop, rule) {
|
|
74
|
-
if (
|
|
74
|
+
if (!isClient || updateInsertedCache(prop, rule)) {
|
|
75
75
|
rulesToInsert = rulesToInsert || [];
|
|
76
76
|
rulesToInsert.push([prop, rule]);
|
|
77
77
|
}
|
|
@@ -88,7 +88,7 @@ const getSplitStyles = (props, staticConfig, theme, state, defaultClassNames, de
|
|
|
88
88
|
transform = insertedTransforms[val];
|
|
89
89
|
if (process.env.NODE_ENV === "development") {
|
|
90
90
|
if (!transform) {
|
|
91
|
-
console.warn("no transform
|
|
91
|
+
console.warn("no transform found", { insertedTransforms, val });
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/getSplitStyles.tsx"],
|
|
4
|
-
"sourcesContent": ["import { stylePropsText, stylePropsTransform, validPseudoKeys, validStyles } from '@tamagui/helpers'\n// @ts-ignore\nimport { useInsertionEffect } from 'react'\nimport { ViewStyle } from 'react-native'\n\nimport { getConfig } from '../conf'\nimport { isClient, isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\nimport { mediaQueryConfig, mediaState } from '../hooks/useMedia'\nimport {\n DebugProp,\n MediaKeys,\n MediaQueryKey,\n PseudoPropKeys,\n PseudoStyles,\n SplitStyleState,\n StackProps,\n StaticConfigParsed,\n TamaguiInternalConfig,\n ThemeObject,\n} from '../types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { fixNativeShadow } from './fixNativeShadow'\nimport { getAtomicStyle, getStylesAtomic } from './getStylesAtomic'\nimport {\n insertStyleRule,\n insertedTransforms,\n updateInserted,\n updateInsertedCache,\n} from './insertStyleRule'\nimport { mergeTransform } from './mergeTransform'\nimport { pseudoDescriptors } from './pseudoDescriptors'\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\nexport type ClassNamesObject = Record<string, string>\nexport type SplitStyleResult = ReturnType<typeof getSplitStyles>\n\nconst skipProps = {\n animation: true,\n animateOnly: true,\n debug: true,\n componentName: true,\n\n ...(!isWeb && {\n tag: true,\n whiteSpace: true,\n wordWrap: true,\n textOverflow: true,\n textDecorationDistance: true,\n userSelect: true,\n selectable: true,\n cursor: true,\n contain: true,\n boxSizing: true,\n boxShadow: true,\n }),\n}\n\ntype TransformNamespaceKey = 'transform' | PseudoPropKeys | MediaQueryKey\n\nlet conf: TamaguiInternalConfig\n\ntype StyleSplitter = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n state: SplitStyleState & {\n keepVariantsAsProps?: boolean\n hasTextAncestor?: boolean\n },\n defaultClassNames?: any,\n debug?: DebugProp\n) => {\n pseudos: PseudoStyles\n medias: Record<MediaKeys, ViewStyle>\n style: ViewStyle\n classNames: ClassNamesObject\n rulesToInsert: [string, string][] | null\n viewProps: StackProps\n}\n\nexport const PROP_SPLIT = '-'\n\n// this is how compiler outputs psueodo identifier\n// TODO remove in next refactor\nexport const pseudoCNInverse = {\n hover: 'hoverStyle',\n focus: 'focusStyle',\n press: 'pressStyle',\n}\n\n// loop props backwards\n// track used keys:\n// const keys = new Set<string>()\n// keep classnames and styles separate:\n// const styles = {}\n// const classNames = {}\n\nexport const getSplitStyles: StyleSplitter = (\n props,\n staticConfig,\n theme,\n state,\n defaultClassNames,\n debug\n) => {\n conf = conf || getConfig()\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: StackProps = {}\n const pseudos: PseudoStyles = {}\n const medias: Record<MediaKeys, ViewStyle> = {}\n const usedKeys = new Set<string>()\n\n let style: ViewStyle = {}\n if (state.hasTextAncestor) {\n // parity with react-native-web\n style.display = 'inline-flex' as any\n }\n let classNames: ClassNamesObject = {}\n // we need to gather these specific to each media query / pseudo\n // value is [hash, val], so [\"-jnjad-asdnjk\", \"scaleX(1) rotate(10deg)\"]\n let transforms = null as Record<TransformNamespaceKey, [string, string]> | null\n\n let rulesToInsert: [string, string][] | null = null\n function addStyle(prop: string, rule: string) {\n if (process.env.IS_STATIC === 'is_static' || updateInsertedCache(prop, rule)) {\n rulesToInsert = rulesToInsert || []\n rulesToInsert.push([prop, rule])\n }\n }\n\n function mergeClassName(key: string, val: string, isMediaOrPseudo = false) {\n // empty classnames passed by compiler sometimes\n if (!val) return\n if (val.startsWith('_transform-')) {\n const namespace: TransformNamespaceKey = isMediaOrPseudo ? key : 'transform'\n\n let transform = insertedTransforms[val]\n if (isClient) {\n if (!transform) {\n // HMR or loaded a new chunk\n updateInserted()\n transform = insertedTransforms[val]\n if (process.env.NODE_ENV === 'development') {\n if (!transform) {\n console.warn('no transform, error', { insertedTransforms, val })\n }\n }\n }\n if (!transform) {\n if (isWeb && val[0] !== '_') {\n // runtime insert\n transform = val\n }\n }\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles mergeClassName transform', { key, val, namespace, transform, insertedTransforms })\n }\n // debugger\n }\n transforms = transforms || {}\n transforms[namespace] = transforms[namespace] || ['', '']\n const identifier = val.replace('_transform', '')\n transforms[namespace][0] += identifier\n // ssr doesn't need to do anything just make the right classname\n if (transform) {\n transforms[namespace][1] += transform\n }\n } else {\n classNames[key] = val\n }\n }\n\n const propKeys = Object.keys(props)\n const shouldDoClasses = (isWeb || process.env.IS_STATIC === 'is_static') && !state.noClassNames\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n console.log('propKeys', propKeys)\n }\n\n for (let i = propKeys.length - 1; i >= 0; i--) {\n const keyInit = propKeys[i]\n if (usedKeys.has(keyInit)) continue\n if (skipProps[keyInit]) continue\n if (!isWeb && keyInit.startsWith('data-')) continue\n\n const valInit = props[keyInit]\n if (keyInit === 'style' || keyInit.startsWith('_style')) {\n if (!valInit) continue\n for (const key in valInit) {\n if (usedKeys.has(key)) continue\n if (valInit && typeof valInit === 'object') {\n // newer react native versions return a full object instead of ID\n for (const skey in valInit) {\n if (usedKeys.has(skey)) continue\n usedKeys.add(skey)\n style[skey] = valInit[skey]\n }\n } else {\n usedKeys.add(key)\n style[key] = valInit\n }\n }\n continue\n }\n\n if (keyInit === 'className') {\n let nonTamaguis = ''\n if (!valInit) continue\n for (const cn of valInit.split(' ')) {\n if (cn[0] === '_') {\n // tamagui, merge it expanded on key, eventually this will go away with better compiler\n const [shorthand, mediaOrPseudo] = cn.slice(1).split('-')\n const isMedia = mediaOrPseudo[0] === '_'\n const isPseudo = mediaOrPseudo[0] === '0'\n const isMediaOrPseudo = isMedia || isPseudo\n let fullKey = conf.shorthands[shorthand]\n if (isMedia) {\n // is media\n let mediaShortKey = mediaOrPseudo.slice(1)\n mediaShortKey = mediaShortKey.slice(0, mediaShortKey.indexOf('_'))\n fullKey += `${PROP_SPLIT}${mediaShortKey}`\n } else if (isPseudo) {\n // is pseudo\n const pseudoShortKey = mediaOrPseudo.slice(1)\n fullKey += `${PROP_SPLIT}${pseudoShortKey}`\n }\n usedKeys.add(fullKey)\n mergeClassName(fullKey, cn, isMediaOrPseudo)\n } else {\n nonTamaguis += ' ' + cn\n }\n }\n if (nonTamaguis) {\n usedKeys.add(keyInit)\n mergeClassName(keyInit, nonTamaguis)\n }\n continue\n }\n\n if (valInit && valInit[0] === '_') {\n // if valid style key (or pseudo like color-hover):\n // this conditional and esp the pseudo check rarely runs so not a perf issue\n const isValidClassName = validStyles[keyInit]\n const isMediaOrPseudo =\n !isValidClassName &&\n keyInit.includes(PROP_SPLIT) &&\n validStyles[keyInit.split(PROP_SPLIT)[0]]\n if (isValidClassName || isMediaOrPseudo) {\n usedKeys.add(keyInit)\n mergeClassName(keyInit, valInit, isMediaOrPseudo)\n continue\n }\n }\n\n if (\n state.keepVariantsAsProps &&\n staticConfig.defaultVariants &&\n keyInit in staticConfig.defaultVariants\n ) {\n viewProps[keyInit] = valInit\n }\n\n let isMedia = keyInit[0] === '$'\n let isPseudo = validPseudoKeys[keyInit]\n\n if (\n !isMedia &&\n !isPseudo &&\n !staticConfig.variants?.[keyInit] &&\n !validStyleProps[keyInit] &&\n !conf.shorthands[keyInit]\n ) {\n usedKeys.add(keyInit)\n viewProps[keyInit] = valInit\n continue\n }\n\n const expanded =\n isMedia || isPseudo\n ? [[keyInit, valInit]]\n : staticConfig.propMapper(keyInit, valInit, theme, props, state, undefined, debug)\n\n let isMediaOrPseudo = isMedia || isPseudo\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n console.log(' \u00BB getSplitStyles', keyInit, expanded)\n }\n\n if (!expanded) {\n continue\n }\n\n for (const [key, val] of expanded) {\n if (val === undefined) continue\n\n isMedia = key[0] === '$'\n isPseudo = validPseudoKeys[key]\n isMediaOrPseudo = isMedia || isPseudo\n\n if (!isMediaOrPseudo) {\n if (usedKeys.has(key)) continue\n }\n\n if (\n (staticConfig.deoptProps && staticConfig.deoptProps.has(key)) ||\n (staticConfig.inlineProps && staticConfig.inlineProps.has(key))\n ) {\n usedKeys.add(key)\n viewProps[key] = val\n }\n\n // pseudo\n if (isPseudo) {\n if (!val) continue\n if (key === 'enterStyle' && state.mounted) {\n // once mounted we can ignore enterStyle\n continue\n }\n pseudos[key] = pseudos[key] || {}\n pseudos[key] = getSubStyle(val, staticConfig, theme, props, state, true)\n if (shouldDoClasses) {\n const pseudoStyles = getAtomicStyle(pseudos[key], pseudoDescriptors[key])\n for (const style of pseudoStyles) {\n const postfix = pseudoDescriptors[key]?.name || key // exitStyle/enterStyle dont have pseudoDescriptors\n const fullKey = `${style.property}${PROP_SPLIT}${postfix}`\n if (!usedKeys.has(fullKey)) {\n usedKeys.add(fullKey)\n addStyle(style.identifier, style.rules.join(';'))\n mergeClassName(fullKey, style.identifier, isMediaOrPseudo)\n }\n }\n }\n continue\n }\n\n // media\n if (isMedia) {\n const mediaKey = key\n const mediaKeyShort = mediaKey.slice(1)\n\n if (!mediaQueryConfig[mediaKeyShort]) {\n if (!usedKeys.has(key)) {\n // this isn't a media key, pass through\n viewProps[key] = val\n }\n continue\n }\n\n // dont check if media is active, we just apply *all* media styles\n // we combine the media props on top regular props, could proxy this\n // TODO test proxy here instead of merge\n // THIS USED TO PROXY BACK TO REGULAR PROPS BUT THAT IS THE WRONG BEHAVIOR\n // we avoid passing in default props for media queries because that would confuse things like SizableText.size:\n const mediaStyle = getSubStyle(val, staticConfig, theme, props, state)\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles mediaStyle', { mediaKey, mediaStyle, props, shouldDoClasses })\n }\n\n if (shouldDoClasses) {\n const mediaStyles = getStylesAtomic(mediaStyle)\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKeyShort, mediaQueryConfig)\n // TODO handle pseudo + media, not too hard just need to set up example case\n const fullKey = `${style.property}${PROP_SPLIT}${mediaKeyShort}`\n if (!usedKeys.has(fullKey)) {\n usedKeys.add(fullKey)\n addStyle(out.identifier, out.styleRule)\n mergeClassName(fullKey, out.identifier, true)\n }\n }\n } else {\n if (mediaState[mediaKey]) {\n if (process.env.NODE_ENV === 'development' && debug) {\n console.log('apply media style', mediaKey, mediaState)\n }\n Object.assign(shouldDoClasses ? medias : style, mediaStyle)\n }\n }\n continue\n }\n\n if (!isWeb && key === 'pointerEvents') {\n usedKeys.add(key)\n viewProps[key] = val\n continue\n }\n\n if (validStyleProps[key]) {\n usedKeys.add(key)\n if (val && val[0] === '_') {\n classNames[key] = val\n } else if (key in stylePropsTransform) {\n mergeTransform(style, key, val, true)\n } else {\n style[key] = val\n }\n continue\n }\n\n // pass to view props\n if (!staticConfig.variants || !(key in staticConfig.variants)) {\n if (!skipProps[key]) {\n viewProps[key] = val\n usedKeys.add(key)\n }\n }\n }\n }\n\n // add in defaults if not set:\n if (defaultClassNames) {\n classNames = {\n ...defaultClassNames,\n ...classNames,\n }\n }\n\n if (shouldDoClasses) {\n const atomic = getStylesAtomic(style)\n for (const atomicStyle of atomic) {\n const key = atomicStyle.property\n if (!state.dynamicStylesInline) {\n addStyle(atomicStyle.identifier, atomicStyle.rules.join(';'))\n mergeClassName(key, atomicStyle.identifier)\n } else {\n style[key] = atomicStyle.value\n }\n }\n }\n\n if (transforms) {\n for (const namespace in transforms) {\n if (!transforms[namespace]) {\n console.warn('Error no transform')\n continue\n }\n const [hash, val] = transforms[namespace]\n const identifier = `_transform${hash}`\n if (isClient) {\n if (!insertedTransforms[identifier]) {\n const rule = `.${identifier} { transform: ${val}; }`\n addStyle(identifier, rule)\n }\n }\n classNames[namespace] = identifier\n }\n }\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n if (typeof document !== 'undefined') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles out', { style, pseudos, medias, classNames, viewProps, state })\n }\n }\n\n // @ts-ignore\n if (viewProps['direction'] === 'both') {\n console.warn('???????', viewProps, props)\n }\n\n return {\n viewProps,\n style,\n medias,\n pseudos,\n classNames,\n rulesToInsert,\n }\n}\n\nexport const insertSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n if (res.rulesToInsert) {\n for (const [prop, rule] of res.rulesToInsert) {\n insertStyleRule(prop, rule)\n }\n }\n return res\n}\n\nconst effect = isWeb ? useInsertionEffect || useIsomorphicLayoutEffect : useIsomorphicLayoutEffect\n\nexport const useSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n effect(() => {\n if (!res.rulesToInsert) return\n for (const [prop, rule] of res.rulesToInsert) {\n insertStyleRule(prop, rule)\n }\n })\n return res\n}\n\nexport const getSubStyle = (\n styleIn: Object,\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n props: any,\n state: SplitStyleState,\n avoidDefaultProps?: boolean\n): ViewStyle => {\n const styleOut: ViewStyle = {}\n for (const key in styleIn) {\n const val = styleIn[key]\n const expanded = staticConfig.propMapper(key, val, theme, props, state, avoidDefaultProps)\n if (!expanded) continue\n for (const [skey, sval] of expanded) {\n if (skey in stylePropsTransform) {\n mergeTransform(styleOut, skey, sval)\n } else {\n styleOut[skey] = sval\n }\n }\n }\n return styleOut\n}\n\nexport function normalizeStyleObject(style: any) {\n if (!isWeb) {\n fixNativeShadow(style)\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAEA;AAGA;AACA;AACA;AAaA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AAMA,MAAM,YAAY;AAAA,EAChB,WAAW;AAAA,EACX,aAAa;AAAA,EACb,OAAO;AAAA,EACP,eAAe;AAAA,GAEX,CAAC,SAAS;AAAA,EACZ,KAAK;AAAA,EACL,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,cAAc;AAAA,EACd,wBAAwB;AAAA,EACxB,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,WAAW;AACb;AAKF,IAAI;AAqBG,MAAM,aAAa;AAInB,MAAM,kBAAkB;AAAA,EAC7B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT;AASO,MAAM,iBAAgC,CAC3C,OACA,cACA,OACA,OACA,mBACA,UACG;AAxGL;AAyGE,SAAO,QAAQ,UAAU;AACzB,QAAM,kBAAkB,aAAa,SAAS,iBAAiB;AAC/D,QAAM,YAAwB,CAAC;AAC/B,QAAM,UAAwB,CAAC;AAC/B,QAAM,SAAuC,CAAC;AAC9C,QAAM,WAAW,oBAAI,IAAY;AAEjC,MAAI,QAAmB,CAAC;AACxB,MAAI,MAAM,iBAAiB;AAEzB,UAAM,UAAU;AAAA,EAClB;AACA,MAAI,aAA+B,CAAC;AAGpC,MAAI,aAAa;AAEjB,MAAI,gBAA2C;AAC/C,oBAAkB,MAAc,MAAc;AAC5C,QAAI,
|
|
4
|
+
"sourcesContent": ["import { stylePropsText, stylePropsTransform, validPseudoKeys, validStyles } from '@tamagui/helpers'\n// @ts-ignore\nimport { useInsertionEffect } from 'react'\nimport { ViewStyle } from 'react-native'\n\nimport { getConfig } from '../conf'\nimport { isClient, isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\nimport { mediaQueryConfig, mediaState } from '../hooks/useMedia'\nimport {\n DebugProp,\n MediaKeys,\n MediaQueryKey,\n PseudoPropKeys,\n PseudoStyles,\n SplitStyleState,\n StackProps,\n StaticConfigParsed,\n TamaguiInternalConfig,\n ThemeObject,\n} from '../types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { fixNativeShadow } from './fixNativeShadow'\nimport { getAtomicStyle, getStylesAtomic } from './getStylesAtomic'\nimport {\n insertStyleRule,\n insertedTransforms,\n updateInserted,\n updateInsertedCache,\n} from './insertStyleRule'\nimport { mergeTransform } from './mergeTransform'\nimport { pseudoDescriptors } from './pseudoDescriptors'\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\nexport type ClassNamesObject = Record<string, string>\nexport type SplitStyleResult = ReturnType<typeof getSplitStyles>\n\nconst skipProps = {\n animation: true,\n animateOnly: true,\n debug: true,\n componentName: true,\n\n ...(!isWeb && {\n tag: true,\n whiteSpace: true,\n wordWrap: true,\n textOverflow: true,\n textDecorationDistance: true,\n userSelect: true,\n selectable: true,\n cursor: true,\n contain: true,\n boxSizing: true,\n boxShadow: true,\n }),\n}\n\ntype TransformNamespaceKey = 'transform' | PseudoPropKeys | MediaQueryKey\n\nlet conf: TamaguiInternalConfig\n\ntype StyleSplitter = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n state: SplitStyleState & {\n keepVariantsAsProps?: boolean\n hasTextAncestor?: boolean\n },\n defaultClassNames?: any,\n debug?: DebugProp\n) => {\n pseudos: PseudoStyles\n medias: Record<MediaKeys, ViewStyle>\n style: ViewStyle\n classNames: ClassNamesObject\n rulesToInsert: [string, string][] | null\n viewProps: StackProps\n}\n\nexport const PROP_SPLIT = '-'\n\n// this is how compiler outputs psueodo identifier\n// TODO remove in next refactor\nexport const pseudoCNInverse = {\n hover: 'hoverStyle',\n focus: 'focusStyle',\n press: 'pressStyle',\n}\n\n// loop props backwards\n// track used keys:\n// const keys = new Set<string>()\n// keep classnames and styles separate:\n// const styles = {}\n// const classNames = {}\n\nexport const getSplitStyles: StyleSplitter = (\n props,\n staticConfig,\n theme,\n state,\n defaultClassNames,\n debug\n) => {\n conf = conf || getConfig()\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: StackProps = {}\n const pseudos: PseudoStyles = {}\n const medias: Record<MediaKeys, ViewStyle> = {}\n const usedKeys = new Set<string>()\n\n let style: ViewStyle = {}\n if (state.hasTextAncestor) {\n // parity with react-native-web\n style.display = 'inline-flex' as any\n }\n let classNames: ClassNamesObject = {}\n // we need to gather these specific to each media query / pseudo\n // value is [hash, val], so [\"-jnjad-asdnjk\", \"scaleX(1) rotate(10deg)\"]\n let transforms = null as Record<TransformNamespaceKey, [string, string]> | null\n\n let rulesToInsert: [string, string][] | null = null\n function addStyle(prop: string, rule: string) {\n if (!isClient || updateInsertedCache(prop, rule)) {\n rulesToInsert = rulesToInsert || []\n rulesToInsert.push([prop, rule])\n }\n }\n\n function mergeClassName(key: string, val: string, isMediaOrPseudo = false) {\n // empty classnames passed by compiler sometimes\n if (!val) return\n if (val.startsWith('_transform-')) {\n const namespace: TransformNamespaceKey = isMediaOrPseudo ? key : 'transform'\n\n let transform = insertedTransforms[val]\n if (isClient) {\n if (!transform) {\n // HMR or loaded a new chunk\n updateInserted()\n transform = insertedTransforms[val]\n if (process.env.NODE_ENV === 'development') {\n if (!transform) {\n console.warn('no transform found', { insertedTransforms, val })\n }\n }\n }\n if (!transform) {\n if (isWeb && val[0] !== '_') {\n // runtime insert\n transform = val\n }\n }\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles mergeClassName transform', { key, val, namespace, transform, insertedTransforms })\n }\n // debugger\n }\n transforms = transforms || {}\n transforms[namespace] = transforms[namespace] || ['', '']\n const identifier = val.replace('_transform', '')\n transforms[namespace][0] += identifier\n // ssr doesn't need to do anything just make the right classname\n if (transform) {\n transforms[namespace][1] += transform\n }\n } else {\n classNames[key] = val\n }\n }\n\n const propKeys = Object.keys(props)\n const shouldDoClasses = (isWeb || process.env.IS_STATIC === 'is_static') && !state.noClassNames\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n console.log('propKeys', propKeys)\n }\n\n for (let i = propKeys.length - 1; i >= 0; i--) {\n const keyInit = propKeys[i]\n if (usedKeys.has(keyInit)) continue\n if (skipProps[keyInit]) continue\n if (!isWeb && keyInit.startsWith('data-')) continue\n\n const valInit = props[keyInit]\n if (keyInit === 'style' || keyInit.startsWith('_style')) {\n if (!valInit) continue\n for (const key in valInit) {\n if (usedKeys.has(key)) continue\n if (valInit && typeof valInit === 'object') {\n // newer react native versions return a full object instead of ID\n for (const skey in valInit) {\n if (usedKeys.has(skey)) continue\n usedKeys.add(skey)\n style[skey] = valInit[skey]\n }\n } else {\n usedKeys.add(key)\n style[key] = valInit\n }\n }\n continue\n }\n\n if (keyInit === 'className') {\n let nonTamaguis = ''\n if (!valInit) continue\n for (const cn of valInit.split(' ')) {\n if (cn[0] === '_') {\n // tamagui, merge it expanded on key, eventually this will go away with better compiler\n const [shorthand, mediaOrPseudo] = cn.slice(1).split('-')\n const isMedia = mediaOrPseudo[0] === '_'\n const isPseudo = mediaOrPseudo[0] === '0'\n const isMediaOrPseudo = isMedia || isPseudo\n let fullKey = conf.shorthands[shorthand]\n if (isMedia) {\n // is media\n let mediaShortKey = mediaOrPseudo.slice(1)\n mediaShortKey = mediaShortKey.slice(0, mediaShortKey.indexOf('_'))\n fullKey += `${PROP_SPLIT}${mediaShortKey}`\n } else if (isPseudo) {\n // is pseudo\n const pseudoShortKey = mediaOrPseudo.slice(1)\n fullKey += `${PROP_SPLIT}${pseudoShortKey}`\n }\n usedKeys.add(fullKey)\n mergeClassName(fullKey, cn, isMediaOrPseudo)\n } else {\n nonTamaguis += ' ' + cn\n }\n }\n if (nonTamaguis) {\n usedKeys.add(keyInit)\n mergeClassName(keyInit, nonTamaguis)\n }\n continue\n }\n\n if (valInit && valInit[0] === '_') {\n // if valid style key (or pseudo like color-hover):\n // this conditional and esp the pseudo check rarely runs so not a perf issue\n const isValidClassName = validStyles[keyInit]\n const isMediaOrPseudo =\n !isValidClassName &&\n keyInit.includes(PROP_SPLIT) &&\n validStyles[keyInit.split(PROP_SPLIT)[0]]\n if (isValidClassName || isMediaOrPseudo) {\n usedKeys.add(keyInit)\n mergeClassName(keyInit, valInit, isMediaOrPseudo)\n continue\n }\n }\n\n if (\n state.keepVariantsAsProps &&\n staticConfig.defaultVariants &&\n keyInit in staticConfig.defaultVariants\n ) {\n viewProps[keyInit] = valInit\n }\n\n let isMedia = keyInit[0] === '$'\n let isPseudo = validPseudoKeys[keyInit]\n\n if (\n !isMedia &&\n !isPseudo &&\n !staticConfig.variants?.[keyInit] &&\n !validStyleProps[keyInit] &&\n !conf.shorthands[keyInit]\n ) {\n usedKeys.add(keyInit)\n viewProps[keyInit] = valInit\n continue\n }\n\n const expanded =\n isMedia || isPseudo\n ? [[keyInit, valInit]]\n : staticConfig.propMapper(keyInit, valInit, theme, props, state, undefined, debug)\n\n let isMediaOrPseudo = isMedia || isPseudo\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n console.log(' \u00BB getSplitStyles', keyInit, expanded)\n }\n\n if (!expanded) {\n continue\n }\n\n for (const [key, val] of expanded) {\n if (val === undefined) continue\n\n isMedia = key[0] === '$'\n isPseudo = validPseudoKeys[key]\n isMediaOrPseudo = isMedia || isPseudo\n\n if (!isMediaOrPseudo) {\n if (usedKeys.has(key)) continue\n }\n\n if (\n (staticConfig.deoptProps && staticConfig.deoptProps.has(key)) ||\n (staticConfig.inlineProps && staticConfig.inlineProps.has(key))\n ) {\n usedKeys.add(key)\n viewProps[key] = val\n }\n\n // pseudo\n if (isPseudo) {\n if (!val) continue\n if (key === 'enterStyle' && state.mounted) {\n // once mounted we can ignore enterStyle\n continue\n }\n pseudos[key] = pseudos[key] || {}\n pseudos[key] = getSubStyle(val, staticConfig, theme, props, state, true)\n if (shouldDoClasses) {\n const pseudoStyles = getAtomicStyle(pseudos[key], pseudoDescriptors[key])\n for (const style of pseudoStyles) {\n const postfix = pseudoDescriptors[key]?.name || key // exitStyle/enterStyle dont have pseudoDescriptors\n const fullKey = `${style.property}${PROP_SPLIT}${postfix}`\n if (!usedKeys.has(fullKey)) {\n usedKeys.add(fullKey)\n addStyle(style.identifier, style.rules.join(';'))\n mergeClassName(fullKey, style.identifier, isMediaOrPseudo)\n }\n }\n }\n continue\n }\n\n // media\n if (isMedia) {\n const mediaKey = key\n const mediaKeyShort = mediaKey.slice(1)\n\n if (!mediaQueryConfig[mediaKeyShort]) {\n if (!usedKeys.has(key)) {\n // this isn't a media key, pass through\n viewProps[key] = val\n }\n continue\n }\n\n // dont check if media is active, we just apply *all* media styles\n // we combine the media props on top regular props, could proxy this\n // TODO test proxy here instead of merge\n // THIS USED TO PROXY BACK TO REGULAR PROPS BUT THAT IS THE WRONG BEHAVIOR\n // we avoid passing in default props for media queries because that would confuse things like SizableText.size:\n const mediaStyle = getSubStyle(val, staticConfig, theme, props, state)\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles mediaStyle', { mediaKey, mediaStyle, props, shouldDoClasses })\n }\n\n if (shouldDoClasses) {\n const mediaStyles = getStylesAtomic(mediaStyle)\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKeyShort, mediaQueryConfig)\n // TODO handle pseudo + media, not too hard just need to set up example case\n const fullKey = `${style.property}${PROP_SPLIT}${mediaKeyShort}`\n if (!usedKeys.has(fullKey)) {\n usedKeys.add(fullKey)\n addStyle(out.identifier, out.styleRule)\n mergeClassName(fullKey, out.identifier, true)\n }\n }\n } else {\n if (mediaState[mediaKey]) {\n if (process.env.NODE_ENV === 'development' && debug) {\n console.log('apply media style', mediaKey, mediaState)\n }\n Object.assign(shouldDoClasses ? medias : style, mediaStyle)\n }\n }\n continue\n }\n\n if (!isWeb && key === 'pointerEvents') {\n usedKeys.add(key)\n viewProps[key] = val\n continue\n }\n\n if (validStyleProps[key]) {\n usedKeys.add(key)\n if (val && val[0] === '_') {\n classNames[key] = val\n } else if (key in stylePropsTransform) {\n mergeTransform(style, key, val, true)\n } else {\n style[key] = val\n }\n continue\n }\n\n // pass to view props\n if (!staticConfig.variants || !(key in staticConfig.variants)) {\n if (!skipProps[key]) {\n viewProps[key] = val\n usedKeys.add(key)\n }\n }\n }\n }\n\n // add in defaults if not set:\n if (defaultClassNames) {\n classNames = {\n ...defaultClassNames,\n ...classNames,\n }\n }\n\n if (shouldDoClasses) {\n const atomic = getStylesAtomic(style)\n for (const atomicStyle of atomic) {\n const key = atomicStyle.property\n if (!state.dynamicStylesInline) {\n addStyle(atomicStyle.identifier, atomicStyle.rules.join(';'))\n mergeClassName(key, atomicStyle.identifier)\n } else {\n style[key] = atomicStyle.value\n }\n }\n }\n\n if (transforms) {\n for (const namespace in transforms) {\n if (!transforms[namespace]) {\n console.warn('Error no transform')\n continue\n }\n const [hash, val] = transforms[namespace]\n const identifier = `_transform${hash}`\n if (isClient) {\n if (!insertedTransforms[identifier]) {\n const rule = `.${identifier} { transform: ${val}; }`\n addStyle(identifier, rule)\n }\n }\n classNames[namespace] = identifier\n }\n }\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n if (typeof document !== 'undefined') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles out', { style, pseudos, medias, classNames, viewProps, state })\n }\n }\n\n // @ts-ignore\n if (viewProps['direction'] === 'both') {\n console.warn('???????', viewProps, props)\n }\n\n return {\n viewProps,\n style,\n medias,\n pseudos,\n classNames,\n rulesToInsert,\n }\n}\n\nexport const insertSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n if (res.rulesToInsert) {\n for (const [prop, rule] of res.rulesToInsert) {\n insertStyleRule(prop, rule)\n }\n }\n return res\n}\n\nconst effect = isWeb ? useInsertionEffect || useIsomorphicLayoutEffect : useIsomorphicLayoutEffect\n\nexport const useSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n effect(() => {\n if (!res.rulesToInsert) return\n for (const [prop, rule] of res.rulesToInsert) {\n insertStyleRule(prop, rule)\n }\n })\n return res\n}\n\nexport const getSubStyle = (\n styleIn: Object,\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n props: any,\n state: SplitStyleState,\n avoidDefaultProps?: boolean\n): ViewStyle => {\n const styleOut: ViewStyle = {}\n for (const key in styleIn) {\n const val = styleIn[key]\n const expanded = staticConfig.propMapper(key, val, theme, props, state, avoidDefaultProps)\n if (!expanded) continue\n for (const [skey, sval] of expanded) {\n if (skey in stylePropsTransform) {\n mergeTransform(styleOut, skey, sval)\n } else {\n styleOut[skey] = sval\n }\n }\n }\n return styleOut\n}\n\nexport function normalizeStyleObject(style: any) {\n if (!isWeb) {\n fixNativeShadow(style)\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAEA;AAGA;AACA;AACA;AAaA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AAMA,MAAM,YAAY;AAAA,EAChB,WAAW;AAAA,EACX,aAAa;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;AACL,iBAAS,QAAQ;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEO,8BAA8B,OAAY;AAC/C,MAAI,CAAC,OAAO;AACV,oBAAgB,KAAK;AAAA,EACvB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/wrapThemeManagerContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\n\nimport { ThemeManager, ThemeManagerContext } from '../ThemeManager'\n\nexport function wrapThemeManagerContext(children: any, themeManager?: ThemeManager | null) {\n return themeManager ? (\n <ThemeManagerContext.Provider value={themeManager}>{children}</ThemeManagerContext.Provider>\n ) : (\n children\n )\n}\n"],
|
|
4
|
+
"sourcesContent": ["import React, { useEffect } from 'react'\n\nimport { ThemeManager, ThemeManagerContext } from '../ThemeManager'\n\nexport function wrapThemeManagerContext(children: any, themeManager?: ThemeManager | null) {\n return themeManager ? (\n <ThemeManagerContext.Provider value={themeManager}>{children}</ThemeManagerContext.Provider>\n ) : (\n children\n )\n}\n"],
|
|
5
5
|
"mappings": "AAAA;AAEA;AAEO,iCAAiC,UAAe,cAAoC;AACzF,SAAO,eACL,oCAAC,oBAAoB,UAApB;AAAA,IAA6B,OAAO;AAAA,KAAe,QAAS,IAE7D;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|