@tamagui/core 1.0.0-beta.207 → 1.0.0-beta.230
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 +20 -43
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +24 -25
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +16 -8
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +1 -0
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/insertStyleRule.js +5 -1
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/hooks/useFeatures.js +88 -7
- package/dist/cjs/hooks/useFeatures.js.map +2 -2
- package/dist/cjs/hooks/useTheme.js +7 -7
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Stack.js +1 -0
- package/dist/cjs/views/Stack.js.map +2 -2
- package/dist/cjs/views/Text.js +1 -0
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/esm/createComponent.js +22 -48
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +24 -25
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +16 -8
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +1 -0
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +5 -1
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/hooks/useFeatures.js +88 -13
- package/dist/esm/hooks/useFeatures.js.map +2 -2
- package/dist/esm/hooks/useTheme.js +7 -7
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/views/Stack.js +1 -0
- package/dist/esm/views/Stack.js.map +2 -2
- package/dist/esm/views/Text.js +1 -0
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/jsx/createComponent.js +22 -48
- package/dist/jsx/helpers/createPropMapper.js +24 -25
- package/dist/jsx/helpers/getSplitStyles.js +16 -8
- package/dist/jsx/helpers/getStylesAtomic.js +1 -0
- package/dist/jsx/helpers/insertStyleRule.js +5 -1
- package/dist/jsx/hooks/useFeatures.js +88 -13
- package/dist/jsx/hooks/useTheme.js +7 -7
- package/dist/jsx/views/Stack.js +1 -0
- package/dist/jsx/views/Text.js +1 -0
- package/package.json +6 -6
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/createPropMapper.d.ts +1 -1
- package/types/helpers/createPropMapper.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +3 -13
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/hooks/useFeatures.d.ts +6 -3
- package/types/hooks/useFeatures.d.ts.map +1 -1
- package/types/styled.d.ts +2 -2
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +24 -10
- package/types/types.d.ts.map +1 -1
- package/types/views/Stack.d.ts.map +1 -1
- package/types/views/Text.d.ts.map +1 -1
package/dist/esm/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styled.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { extendStaticConfig } from './helpers/extendStaticConfig'\nimport { RNComponents } from './helpers/RNComponents'\nimport {\n GetProps,\n GetVariantProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n VariantDefinitions,\n} from './types'\n\nexport function styled<\n ParentComponent extends StylableComponent,\n // = VariantDefinitions<GetProps<ParentComponent>> gives type inference to variants: { true: { ... } }\n // but causes \"Type instantiation is excessively deep and possibly infinite.\"...\n Variants extends VariantDefinitions<
|
|
5
|
-
"mappings": ";;AAAA;AAEA;AACA;AACA;AAaO,
|
|
4
|
+
"sourcesContent": ["import { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { extendStaticConfig } from './helpers/extendStaticConfig'\nimport { RNComponents } from './helpers/RNComponents'\nimport {\n GetProps,\n GetVariantProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n VariantDefinitions,\n} from './types'\n\nexport function styled<\n ParentComponent extends StylableComponent,\n // = VariantDefinitions<GetProps<ParentComponent>> gives type inference to variants: { true: { ... } }\n // but causes \"Type instantiation is excessively deep and possibly infinite.\"...\n Variants extends VariantDefinitions<ParentComponent> | symbol =\n | VariantDefinitions<ParentComponent>\n | symbol\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n defaultVariants?: Variants extends Object ? GetVariantProps<Variants> : never\n },\n staticExtractionOptions?: StaticConfig\n) {\n const staticConfigProps = (() => {\n if (options) {\n const { variants, name, defaultVariants, ...defaultProps } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNativeWeb = RNComponents.has(Component)\n const isTamagui = !isReactNativeWeb && 'staticConfig' in Component\n const Comp = Component as any\n const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === Image : false))\n const isInput = !!(defaultProps.isInput || (!isTamagui ? Comp === TextInput : false))\n const isText = !!(defaultProps.isText || (!isTamagui ? isInput || Comp === Text : false))\n const conf: StaticConfig = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\n isTamagui,\n // this type gets messed up by options?: Partial<GetProps<ParentComponent>> above\n // take away the Partial<> and it's fine\n variants,\n defaultProps,\n componentName: name,\n isReactNativeWeb,\n isInput,\n isText,\n isImage,\n }\n return conf\n }\n return {}\n })()\n const config = extendStaticConfig(Component, staticConfigProps)\n const component = createComponent(config!) // error is good here its on init\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = ParentComponent extends TamaguiComponent<any, any, infer P>\n ? P\n : GetProps<ParentComponent>\n type ParentVariants = ParentComponent extends TamaguiComponent<any, any, any, infer V>\n ? V\n : Object\n\n // sprinkle in our variants\n type OurVariants = Variants extends symbol\n ? {}\n : {\n [Key in keyof Variants]?: GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void | symbol\n ? GetProps<ParentComponent>\n : // start with base props\n OurPropsBase &\n // add in media (+ pseudos nested)\n MediaProps<Partial<OurPropsBase>> &\n // add in pseudos\n PseudoProps<Partial<OurPropsBase>>\n\n return component as TamaguiComponent<\n Props,\n // TODO infer ref\n any,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n}\n\n// test types:\n\n// export const SizableText = styled(Stack, {\n// name: 'SizableText',\n// backgroundColor: 'red',\n// variants: {\n// size: {\n// '...fontSize': (val, { props }) => {\n// return {\n// backgroundColor: '',\n// }\n// },\n// },\n// },\n// })\n// export const Heading = styled(SizableText, {\n// tag: 'span',\n// name: 'Heading',\n// accessibilityRole: 'header',\n// size: '$8',\n// margin: 0,\n// })\n// export const Paragraph = styled(SizableText, {\n// tag: 'p',\n// margin: 10,\n// variants: {\n// another: {\n// true: {},\n// },\n// },\n// })\n// export const Paragraph2 = styled(Paragraph, {\n// tag: 'p',\n// variants: {\n// another: {\n// '...color': (val) => ({\n// backgroundColor: 'red',\n// }),\n// },\n// },\n// })\n// const a = <SizableText size=\"$10\" />\n// const b = <Paragraph size=\"$10\" another />\n// const c = <Paragraph2 size=\"$10\" another=\"aliceblue\" />\n// export const SizableText2 = styled(SizableText, {\n// })\n// const xx = <SizableText2 abc />\n// export const Paragraph = styled(SizableText, {\n// name: 'Paragraph',\n// })\n// export const Heading = styled(Paragraph, {\n// tag: 'span',\n// margin: 0,\n// })\n// export const H2 = styled(Heading, {\n// name: 'H2',\n// })\n// const x = <H2 color=\"red\" />\n"],
|
|
5
|
+
"mappings": ";;AAAA;AAEA;AACA;AACA;AAaO,gBAQL,WAEA,SAKA,yBACA;AACA,QAAM,oBAAqB,OAAM;AAC/B,QAAI,SAAS;AACX,YAAM,EAAE,UAAU,MAAM,oBAAoB,iBAAiB;AAC7D,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,mBAAmB,aAAa,IAAI,SAAS;AACnD,YAAM,YAAY,CAAC,oBAAoB,kBAAkB;AACzD,YAAM,OAAO;AACb,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,QAAQ;AAC1E,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,YAAY;AAC9E,YAAM,SAAS,CAAC,CAAE,cAAa,UAAW,EAAC,YAAY,WAAW,SAAS,OAAO;AAClF,YAAM,OAAqB;AAAA,WACtB;AAAA,WACC,CAAC,aAAa;AAAA,UAChB,WAAW;AAAA,QACb;AAAA,QACA;AAAA,QAGA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AACA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AACH,QAAM,SAAS,mBAAmB,WAAW,iBAAiB;AAC9D,QAAM,YAAY,gBAAgB,MAAO;AA6BzC,SAAO;AAOT;AAtFgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/views/Stack.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Stack.tsx"],
|
|
4
|
-
"sourcesContent": ["import { View } from 'react-native'\n\nimport { stackDefaultStyles } from '../constants/constants'\nimport { createComponent } from '../createComponent'\nimport { StackProps, StackPropsBase } from '../types'\n\nexport const Stack = createComponent<StackProps, View, StackPropsBase>({\n defaultProps: {\n ...stackDefaultStyles,\n flexDirection: 'column',\n },\n})\n\n// test types\n// export const YStack = styled(Stack, {\n// flexDirection: 'column',\n// })\n// // test types\n// const x00 = <Stack missing={0} /> // should err\n// const x0 = <YStack missing={0} /> // should err\n// const x1 = (props: StackProps) => <YStack {...props} />\n// type ys = typeof YStack\n// type ysv = ys extends StaticComponent<any, infer V> ? V : unknown\n"],
|
|
5
|
-
"mappings": "AAEA;AACA;AAGO,MAAM,QAAQ,gBAAkD;AAAA,EACrE,cAAc;AAAA,OACT;AAAA,IACH,eAAe;AAAA,EACjB;AACF,CAAC;",
|
|
4
|
+
"sourcesContent": ["import { View } from 'react-native'\n\nimport { stackDefaultStyles } from '../constants/constants'\nimport { createComponent } from '../createComponent'\nimport { StackProps, StackPropsBase } from '../types'\n\nexport const Stack = createComponent<StackProps, View, StackPropsBase>({\n componentName: 'Stack',\n defaultProps: {\n ...stackDefaultStyles,\n flexDirection: 'column',\n },\n})\n\n// test types\n// export const YStack = styled(Stack, {\n// flexDirection: 'column',\n// })\n// // test types\n// const x00 = <Stack missing={0} /> // should err\n// const x0 = <YStack missing={0} /> // should err\n// const x1 = (props: StackProps) => <YStack {...props} />\n// type ys = typeof YStack\n// type ysv = ys extends StaticComponent<any, infer V> ? V : unknown\n"],
|
|
5
|
+
"mappings": "AAEA;AACA;AAGO,MAAM,QAAQ,gBAAkD;AAAA,EACrE,eAAe;AAAA,EACf,cAAc;AAAA,OACT;AAAA,IACH,eAAe;AAAA,EACjB;AACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/views/Text.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Text.tsx"],
|
|
4
|
-
"sourcesContent": ["import { stylePropsTextOnly, validStyles } from '@tamagui/helpers'\nimport { Text as TextView } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { createComponent } from '../createComponent'\nimport { TextProps, TextPropsBase } from '../types'\n\nconst ellipseStyle = {\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n}\n\nexport const Text = createComponent<TextProps, TextView, TextPropsBase>({\n isText: true,\n defaultProps: {\n display: isWeb ? 'inline' : 'flex',\n boxSizing: 'border-box',\n fontFamily: 'System',\n wordWrap: 'break-word',\n },\n variants: {\n numberOfLines: {\n 1: ellipseStyle,\n // TODO imply fn, test 1, could do types `>1` `<2`\n ':number': (lines) => (lines > 1 ? { WebkitLineClamp: 1 } : null),\n },\n\n selectable: {\n true: {\n userSelect: 'text',\n cursor: 'text',\n },\n false: {\n userSelect: 'none',\n },\n },\n\n pressable: {\n true: {\n cursor: 'pointer',\n },\n },\n\n ellipse: {\n true: isWeb\n ? ellipseStyle\n : {\n numberOfLines: 1,\n lineBreakMode: 'clip',\n },\n },\n },\n deoptProps: new Set(isWeb ? [] : ['ellipse']),\n validStyles: {\n ...validStyles,\n ...stylePropsTextOnly,\n ...(isWeb && {\n userSelect: true,\n textOverflow: true,\n whiteSpace: true,\n wordWrap: true,\n selectable: true,\n cursor: true,\n }),\n },\n})\n"],
|
|
5
|
-
"mappings": "AAAA;AAGA;AACA;AAGA,MAAM,eAAe;AAAA,EACnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AACd;AAEO,MAAM,OAAO,gBAAoD;AAAA,EACtE,QAAQ;AAAA,EACR,cAAc;AAAA,IACZ,SAAS,QAAQ,WAAW;AAAA,IAC5B,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,IACR,eAAe;AAAA,MACb,GAAG;AAAA,MAEH,WAAW,CAAC,UAAW,QAAQ,IAAI,EAAE,iBAAiB,EAAE,IAAI;AAAA,IAC9D;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,MACA,OAAO;AAAA,QACL,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IAEA,SAAS;AAAA,MACP,MAAM,QACF,eACA;AAAA,QACE,eAAe;AAAA,QACf,eAAe;AAAA,MACjB;AAAA,IACN;AAAA,EACF;AAAA,EACA,YAAY,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AAAA,EAC5C,aAAa;AAAA,OACR;AAAA,OACA;AAAA,OACC,SAAS;AAAA,MACX,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,QAAQ;AAAA,IACV;AAAA,EACF;AACF,CAAC;",
|
|
4
|
+
"sourcesContent": ["import { stylePropsTextOnly, validStyles } from '@tamagui/helpers'\nimport { Text as TextView } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { createComponent } from '../createComponent'\nimport { TextProps, TextPropsBase } from '../types'\n\nconst ellipseStyle = {\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n}\n\nexport const Text = createComponent<TextProps, TextView, TextPropsBase>({\n componentName: 'Text',\n isText: true,\n defaultProps: {\n display: isWeb ? 'inline' : 'flex',\n boxSizing: 'border-box',\n fontFamily: 'System',\n wordWrap: 'break-word',\n },\n variants: {\n numberOfLines: {\n 1: ellipseStyle,\n // TODO imply fn, test 1, could do types `>1` `<2`\n ':number': (lines) => (lines > 1 ? { WebkitLineClamp: 1 } : null),\n },\n\n selectable: {\n true: {\n userSelect: 'text',\n cursor: 'text',\n },\n false: {\n userSelect: 'none',\n },\n },\n\n pressable: {\n true: {\n cursor: 'pointer',\n },\n },\n\n ellipse: {\n true: isWeb\n ? ellipseStyle\n : {\n numberOfLines: 1,\n lineBreakMode: 'clip',\n },\n },\n },\n deoptProps: new Set(isWeb ? [] : ['ellipse']),\n validStyles: {\n ...validStyles,\n ...stylePropsTextOnly,\n ...(isWeb && {\n userSelect: true,\n textOverflow: true,\n whiteSpace: true,\n wordWrap: true,\n selectable: true,\n cursor: true,\n }),\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA;AAGA;AACA;AAGA,MAAM,eAAe;AAAA,EACnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AACd;AAEO,MAAM,OAAO,gBAAoD;AAAA,EACtE,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,cAAc;AAAA,IACZ,SAAS,QAAQ,WAAW;AAAA,IAC5B,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,IACR,eAAe;AAAA,MACb,GAAG;AAAA,MAEH,WAAW,CAAC,UAAW,QAAQ,IAAI,EAAE,iBAAiB,EAAE,IAAI;AAAA,IAC9D;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,MACA,OAAO;AAAA,QACL,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IAEA,SAAS;AAAA,MACP,MAAM,QACF,eACA;AAAA,QACE,eAAe;AAAA,QACf,eAAe;AAAA,MACjB;AAAA,IACN;AAAA,EACF;AAAA,EACA,YAAY,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AAAA,EAC5C,aAAa;AAAA,OACR;AAAA,OACA;AAAA,OACC,SAAS;AAAA,MACX,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,QAAQ;AAAA,IACV;AAAA,EACF;AACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,21 +10,18 @@ import React, {
|
|
|
10
10
|
memo,
|
|
11
11
|
useCallback,
|
|
12
12
|
useContext,
|
|
13
|
-
useEffect,
|
|
14
13
|
useRef,
|
|
15
14
|
useState
|
|
16
15
|
} from "react";
|
|
17
16
|
import { StyleSheet, Text, View } from "react-native";
|
|
18
17
|
import { onConfiguredOnce } from "./conf";
|
|
19
18
|
import { stackDefaultStyles } from "./constants/constants";
|
|
20
|
-
import { isAndroid, isTouchDevice, isWeb } from "./constants/platform";
|
|
19
|
+
import { isAndroid, isTouchDevice, isWeb, useIsomorphicLayoutEffect } from "./constants/platform";
|
|
21
20
|
import { rnw } from "./constants/rnw";
|
|
22
21
|
import { isVariable } from "./createVariable";
|
|
23
22
|
import { createShallowUpdate } from "./helpers/createShallowUpdate";
|
|
24
23
|
import { extendStaticConfig, parseStaticConfig } from "./helpers/extendStaticConfig";
|
|
25
|
-
import {
|
|
26
|
-
getSplitStyles
|
|
27
|
-
} from "./helpers/getSplitStyles";
|
|
24
|
+
import { getSplitStyles } from "./helpers/getSplitStyles";
|
|
28
25
|
import { getAllSelectors } from "./helpers/insertStyleRule";
|
|
29
26
|
import { wrapThemeManagerContext } from "./helpers/wrapThemeManagerContext";
|
|
30
27
|
import { useFeatures } from "./hooks/useFeatures";
|
|
@@ -97,14 +94,16 @@ function createComponent(configIn) {
|
|
|
97
94
|
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
98
95
|
const isAnimated = !!(useAnimations && props.animation);
|
|
99
96
|
const hasEnterStyle = !!props.enterStyle;
|
|
100
|
-
const styleWithPseudos = props.animation ? merge({ ...defaultNativeStyle, ...style }, state.hover && pseudos.hoverStyle, state.press && pseudos.pressStyle, state.focus && pseudos.focusStyle, hasEnterStyle && !state.mounted && pseudos.enterStyle, ...Object.values(medias)) : null;
|
|
101
97
|
const features = useFeatures(props, {
|
|
102
98
|
forceUpdate,
|
|
103
99
|
setStateShallow,
|
|
104
100
|
useAnimations,
|
|
105
101
|
state,
|
|
106
|
-
style:
|
|
107
|
-
pseudos
|
|
102
|
+
style: props.animation ? { ...defaultNativeStyle, ...style } : null,
|
|
103
|
+
pseudos,
|
|
104
|
+
staticConfig,
|
|
105
|
+
theme,
|
|
106
|
+
onDidAnimate: props.onDidAnimate
|
|
108
107
|
});
|
|
109
108
|
const {
|
|
110
109
|
tag,
|
|
@@ -164,18 +163,16 @@ function createComponent(configIn) {
|
|
|
164
163
|
isMounted: true
|
|
165
164
|
};
|
|
166
165
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
});
|
|
172
|
-
}
|
|
166
|
+
useIsomorphicLayoutEffect(() => {
|
|
167
|
+
setStateShallow({
|
|
168
|
+
mounted: true
|
|
169
|
+
});
|
|
173
170
|
internal.current.isMounted = true;
|
|
174
171
|
return () => {
|
|
175
172
|
mouseUps.delete(unPress);
|
|
176
173
|
internal.current.isMounted = false;
|
|
177
174
|
};
|
|
178
|
-
}, []);
|
|
175
|
+
}, [hasEnterStyle]);
|
|
179
176
|
if (nativeID) {
|
|
180
177
|
viewProps.id = nativeID;
|
|
181
178
|
}
|
|
@@ -407,7 +404,7 @@ function createComponent(configIn) {
|
|
|
407
404
|
if (process.env.NODE_ENV === "development") {
|
|
408
405
|
if (props["debug"]) {
|
|
409
406
|
viewProps["debug"] = true;
|
|
410
|
-
console.log(" \xBB ", { propsIn: { ...props }, propsOut: { ...viewProps }, state,
|
|
407
|
+
console.log(" \xBB ", { propsIn: { ...props }, propsOut: { ...viewProps }, state, splitStyles, defaultsClassName, animationStyles, isStringElement, classNamesIn: (_c = props.className) == null ? void 0 : _c.split(" "), classNamesOut: (_d = viewProps.className) == null ? void 0 : _d.split(" "), pressProps, events, shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, defaultSplitStyleResult, ...typeof window !== "undefined" ? { theme, themeState: theme.__state, themeClassName: theme.className, staticConfig, tamaguiConfig } : null });
|
|
411
408
|
}
|
|
412
409
|
}
|
|
413
410
|
if (features.length) {
|
|
@@ -420,6 +417,9 @@ function createComponent(configIn) {
|
|
|
420
417
|
});
|
|
421
418
|
onConfiguredOnce((conf) => {
|
|
422
419
|
var _a, _b, _c, _d;
|
|
420
|
+
if (process.env.IS_STATIC === "is_static") {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
423
|
const shouldDebug = (_a = staticConfig.defaultProps) == null ? void 0 : _a.debug;
|
|
424
424
|
tamaguiConfig = conf;
|
|
425
425
|
avoidClasses = !!((_b = tamaguiConfig.animations) == null ? void 0 : _b.avoidClasses);
|
|
@@ -428,6 +428,10 @@ function createComponent(configIn) {
|
|
|
428
428
|
initialTheme = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]];
|
|
429
429
|
defaultSplitStyleResult = getSplitStyles(staticConfig.defaultProps, staticConfig, initialTheme, {
|
|
430
430
|
mounted: true,
|
|
431
|
+
hover: false,
|
|
432
|
+
press: false,
|
|
433
|
+
pressIn: false,
|
|
434
|
+
focus: false,
|
|
431
435
|
resolveVariablesAs: "both"
|
|
432
436
|
});
|
|
433
437
|
const { classNames, pseudos, style, viewProps } = defaultSplitStyleResult;
|
|
@@ -456,6 +460,7 @@ function createComponent(configIn) {
|
|
|
456
460
|
if (configIn.memo) {
|
|
457
461
|
res = memo(res);
|
|
458
462
|
}
|
|
463
|
+
res["whyDidYouRender"] = true;
|
|
459
464
|
res["staticConfig"] = {
|
|
460
465
|
validStyles: validStyleProps,
|
|
461
466
|
...staticConfig
|
|
@@ -476,6 +481,7 @@ function createComponent(configIn) {
|
|
|
476
481
|
__name(createComponent, "createComponent");
|
|
477
482
|
const Spacer = createComponent({
|
|
478
483
|
memo: true,
|
|
484
|
+
componentName: "Spacer",
|
|
479
485
|
defaultProps: {
|
|
480
486
|
...stackDefaultStyles,
|
|
481
487
|
size: true
|
|
@@ -548,38 +554,6 @@ function spacedChildren({
|
|
|
548
554
|
return next;
|
|
549
555
|
}
|
|
550
556
|
__name(spacedChildren, "spacedChildren");
|
|
551
|
-
const merge = /* @__PURE__ */ __name((...styles) => {
|
|
552
|
-
if (!styles[0])
|
|
553
|
-
return;
|
|
554
|
-
const res = {};
|
|
555
|
-
const len = styles.length;
|
|
556
|
-
for (let i = len - 1; i >= 0; i--) {
|
|
557
|
-
const cur = styles[i];
|
|
558
|
-
if (!cur)
|
|
559
|
-
continue;
|
|
560
|
-
for (const key in cur) {
|
|
561
|
-
const val = cur[key];
|
|
562
|
-
if (key !== "transform") {
|
|
563
|
-
if (!(key in res)) {
|
|
564
|
-
res[key] = val;
|
|
565
|
-
}
|
|
566
|
-
continue;
|
|
567
|
-
}
|
|
568
|
-
if (!res.transform) {
|
|
569
|
-
res.transform = val;
|
|
570
|
-
continue;
|
|
571
|
-
}
|
|
572
|
-
for (const t of val) {
|
|
573
|
-
const tkey = Object.keys(t)[0];
|
|
574
|
-
if (res.transform.find((existing) => tkey in existing)) {
|
|
575
|
-
continue;
|
|
576
|
-
}
|
|
577
|
-
res.transform.push(t);
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
return res;
|
|
582
|
-
}, "merge");
|
|
583
557
|
const AbsoluteFill = /* @__PURE__ */ __name((props) => isWeb ? <div style={{
|
|
584
558
|
position: "absolute",
|
|
585
559
|
top: 0,
|
|
@@ -4,8 +4,8 @@ import { getConfig } from "../conf";
|
|
|
4
4
|
import { isWeb } from "../constants/platform";
|
|
5
5
|
import { isVariable } from "../createVariable";
|
|
6
6
|
import { isObj } from "./isObj";
|
|
7
|
-
const createPropMapper = /* @__PURE__ */ __name((
|
|
8
|
-
const variants =
|
|
7
|
+
const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
|
|
8
|
+
const variants = staticConfig.variants || {};
|
|
9
9
|
function getVariantFunction(variant, key, value) {
|
|
10
10
|
for (const cat in tokenCategories) {
|
|
11
11
|
if (key in tokenCategories[cat]) {
|
|
@@ -27,8 +27,8 @@ const createPropMapper = /* @__PURE__ */ __name((c) => {
|
|
|
27
27
|
return fn || variant["..."] || variant["...size"];
|
|
28
28
|
}
|
|
29
29
|
__name(getVariantFunction, "getVariantFunction");
|
|
30
|
-
const defaultProps =
|
|
31
|
-
return (key, value, theme, props,
|
|
30
|
+
const defaultProps = staticConfig.defaultProps || {};
|
|
31
|
+
return (key, value, theme, props, returnVariablesAs = !!props.animation ? "value" : "auto", avoidDefaultProps = false) => {
|
|
32
32
|
const conf = getConfig();
|
|
33
33
|
if (!conf) {
|
|
34
34
|
console.trace("no conf! err");
|
|
@@ -38,29 +38,28 @@ const createPropMapper = /* @__PURE__ */ __name((c) => {
|
|
|
38
38
|
const variant = variants && variants[key];
|
|
39
39
|
if (variant && value !== void 0) {
|
|
40
40
|
let variantValue = getVariantFunction(variant, key, value);
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return Reflect.get(staticConfig.defaultProps, key2);
|
|
41
|
+
if (variantValue) {
|
|
42
|
+
if (typeof variantValue === "function") {
|
|
43
|
+
variantValue = variantValue(value, {
|
|
44
|
+
tokens: conf.tokensParsed,
|
|
45
|
+
theme,
|
|
46
|
+
props: avoidDefaultProps ? props : new Proxy(props, {
|
|
47
|
+
get(target, key2) {
|
|
48
|
+
if (Reflect.has(target, key2)) {
|
|
49
|
+
return Reflect.get(target, key2);
|
|
50
|
+
}
|
|
51
|
+
if (staticConfig.defaultProps) {
|
|
52
|
+
return Reflect.get(staticConfig.defaultProps, key2);
|
|
53
|
+
}
|
|
55
54
|
}
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (isObj(variantValue)) {
|
|
59
|
+
variantValue = resolveTokens(variantValue, conf, theme, fontFamily, returnVariablesAs);
|
|
60
|
+
}
|
|
61
|
+
return variantValue;
|
|
62
62
|
}
|
|
63
|
-
return variantValue;
|
|
64
63
|
}
|
|
65
64
|
let shouldReturn = false;
|
|
66
65
|
if (conf.shorthands[key]) {
|
|
@@ -50,12 +50,16 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
50
50
|
if (val.startsWith("_transform-")) {
|
|
51
51
|
const isMediaOrPseudo = key !== "transform";
|
|
52
52
|
const isMedia = isMediaOrPseudo && key[11] === "_";
|
|
53
|
-
const isPsuedo = isMediaOrPseudo &&
|
|
53
|
+
const isPsuedo = isMediaOrPseudo && key[11] === "0";
|
|
54
54
|
const namespace = isMedia ? key.split("_")[2] : isPsuedo ? key.split("-")[1] : "transform";
|
|
55
55
|
if (!insertedTransforms[val]) {
|
|
56
56
|
updateInserted();
|
|
57
57
|
}
|
|
58
58
|
const transform = insertedTransforms[val];
|
|
59
|
+
if (!transform || transform === "undefined") {
|
|
60
|
+
console.trace("NO TRANSFORM", { key, val }, state);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
59
63
|
transforms[namespace] = transforms[namespace] || ["", ""];
|
|
60
64
|
transforms[namespace][0] += val.replace("_transform", "");
|
|
61
65
|
transforms[namespace][1] += transform;
|
|
@@ -109,7 +113,7 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
109
113
|
}
|
|
110
114
|
let isMedia = keyInit[0] === "$";
|
|
111
115
|
let isPseudo = validPseudoKeys[keyInit];
|
|
112
|
-
const out = isMedia || isPseudo ? true : staticConfig.propMapper(keyInit, valInit, theme, props,
|
|
116
|
+
const out = isMedia || isPseudo ? true : staticConfig.propMapper(keyInit, valInit, theme, state.fallbackProps || props, state.resolveVariablesAs);
|
|
113
117
|
const expanded = out === true || !out ? [[keyInit, valInit]] : Object.entries(out);
|
|
114
118
|
if (process.env.NODE_ENV === "development" && props["debug"] === "verbose") {
|
|
115
119
|
console.log("split style", keyInit, expanded);
|
|
@@ -118,7 +122,7 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
118
122
|
if (val === void 0) {
|
|
119
123
|
continue;
|
|
120
124
|
}
|
|
121
|
-
if (val && val[0] === "_") {
|
|
125
|
+
if (key !== "target" && val && val[0] === "_") {
|
|
122
126
|
mergeClassName(key, val);
|
|
123
127
|
continue;
|
|
124
128
|
}
|
|
@@ -134,7 +138,7 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
134
138
|
continue;
|
|
135
139
|
}
|
|
136
140
|
pseudos[key] = pseudos[key] || {};
|
|
137
|
-
pseudos[key] = getSubStyle(val, staticConfig, theme, props, state
|
|
141
|
+
pseudos[key] = getSubStyle(val, staticConfig, theme, props, state, true);
|
|
138
142
|
if (isWeb && !state.noClassNames) {
|
|
139
143
|
const pseudoStyles = getStylesAtomic({ [key]: pseudos[key] });
|
|
140
144
|
for (const style2 of pseudoStyles) {
|
|
@@ -150,7 +154,7 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
150
154
|
viewProps[key] = val;
|
|
151
155
|
continue;
|
|
152
156
|
}
|
|
153
|
-
const mediaStyle = getSubStyle(val, staticConfig, theme, props, state
|
|
157
|
+
const mediaStyle = getSubStyle(val, staticConfig, theme, props, state, true);
|
|
154
158
|
if (isWeb) {
|
|
155
159
|
const mediaStyles = getStylesAtomic(mediaStyle);
|
|
156
160
|
for (const style2 of mediaStyles) {
|
|
@@ -202,6 +206,9 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
202
206
|
classNames[namespace] = identifier;
|
|
203
207
|
}
|
|
204
208
|
}
|
|
209
|
+
if (process.env.NODE_ENV === "development" && props["debug"] === "verbose") {
|
|
210
|
+
console.log("out", pseudos);
|
|
211
|
+
}
|
|
205
212
|
return {
|
|
206
213
|
viewProps,
|
|
207
214
|
style,
|
|
@@ -210,11 +217,11 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
210
217
|
classNames
|
|
211
218
|
};
|
|
212
219
|
}, "getSplitStyles");
|
|
213
|
-
const getSubStyle = /* @__PURE__ */ __name((styleIn, staticConfig, theme, props,
|
|
220
|
+
const getSubStyle = /* @__PURE__ */ __name((styleIn, staticConfig, theme, props, state, avoidDefaultProps) => {
|
|
214
221
|
const styleOut = {};
|
|
215
222
|
for (const key in styleIn) {
|
|
216
223
|
const val = styleIn[key];
|
|
217
|
-
const out = staticConfig.propMapper(key, val, theme, props,
|
|
224
|
+
const out = staticConfig.propMapper(key, val, theme, state.fallbackProps || props, state.resolveVariablesAs, avoidDefaultProps);
|
|
218
225
|
const expanded = out === true || !out ? [[key, val]] : Object.entries(out);
|
|
219
226
|
for (const [skey, sval] of expanded) {
|
|
220
227
|
if (skey in stylePropsTransform) {
|
|
@@ -228,5 +235,6 @@ const getSubStyle = /* @__PURE__ */ __name((styleIn, staticConfig, theme, props,
|
|
|
228
235
|
return styleOut;
|
|
229
236
|
}, "getSubStyle");
|
|
230
237
|
export {
|
|
231
|
-
getSplitStyles
|
|
238
|
+
getSplitStyles,
|
|
239
|
+
getSubStyle
|
|
232
240
|
};
|
|
@@ -19,8 +19,9 @@ function addTransform(identifier, rule) {
|
|
|
19
19
|
}
|
|
20
20
|
__name(addTransform, "addTransform");
|
|
21
21
|
let hasInsertedSinceUpdate = true;
|
|
22
|
+
const isClient = typeof document !== "undefined";
|
|
22
23
|
function updateInserted() {
|
|
23
|
-
if (
|
|
24
|
+
if (!isClient) {
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
27
|
if (!hasInsertedSinceUpdate) {
|
|
@@ -61,6 +62,9 @@ function insertStyleRule(identifier, rule) {
|
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
63
64
|
hasInsertedSinceUpdate = true;
|
|
65
|
+
if (identifier === "_transform-1abwpjw") {
|
|
66
|
+
console.trace("inserting", identifier, rule);
|
|
67
|
+
}
|
|
64
68
|
insertedSelectors[identifier] = rule;
|
|
65
69
|
allSelectors[identifier] = process.env.NODE_ENV === "development" ? rule : true;
|
|
66
70
|
if (identifier.startsWith("_transform")) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import { isWeb, useIsomorphicLayoutEffect } from "../constants/platform";
|
|
4
|
+
import { getSubStyle } from "../helpers/getSplitStyles";
|
|
4
5
|
import { addMediaQueryListener, mediaState, removeMediaQueryListener } from "./useMedia";
|
|
5
6
|
const createDefinition = /* @__PURE__ */ __name(({
|
|
6
7
|
Component,
|
|
@@ -35,39 +36,113 @@ __name(loadFeatures, "loadFeatures");
|
|
|
35
36
|
function loadAnimationFeature() {
|
|
36
37
|
return createDefinition({
|
|
37
38
|
Component: ({ _utils, ...props }) => {
|
|
38
|
-
const {
|
|
39
|
+
const {
|
|
40
|
+
state,
|
|
41
|
+
useAnimations,
|
|
42
|
+
pseudos,
|
|
43
|
+
style: inStyle,
|
|
44
|
+
setStateShallow,
|
|
45
|
+
staticConfig,
|
|
46
|
+
theme,
|
|
47
|
+
onDidAnimate
|
|
48
|
+
} = _utils;
|
|
39
49
|
if (!useAnimations) {
|
|
40
50
|
console.error("no useAnimations hook provided");
|
|
41
51
|
return null;
|
|
42
52
|
}
|
|
43
53
|
const propsWithAnimation = props;
|
|
44
|
-
const styleKey = JSON.stringify(style);
|
|
45
54
|
const res = useAnimations(propsWithAnimation, {
|
|
46
|
-
styleKey,
|
|
47
|
-
style: style || {},
|
|
48
55
|
state,
|
|
49
56
|
pseudos,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
onDidAnimate,
|
|
58
|
+
staticConfig,
|
|
59
|
+
getStyle({ isEntering, exitVariant, enterVariant } = {}) {
|
|
60
|
+
var _a, _b, _c, _d;
|
|
61
|
+
const style = inStyle || {};
|
|
62
|
+
const enterStyle = isEntering === true || state.mounted === false ? enterVariant && ((_a = staticConfig.variants) == null ? void 0 : _a[enterVariant]["true"]) ? getSubStyle((_b = staticConfig.variants) == null ? void 0 : _b[enterVariant]["true"], staticConfig, theme, props, state) || pseudos.enterStyle : pseudos.enterStyle : null;
|
|
63
|
+
const exitStyle = isEntering === false ? exitVariant && ((_c = staticConfig.variants) == null ? void 0 : _c[exitVariant]["true"]) ? getSubStyle((_d = staticConfig.variants) == null ? void 0 : _d[exitVariant]["true"], staticConfig, theme, props, state) || pseudos.exitStyle : pseudos.exitStyle : null;
|
|
64
|
+
ensureBaseHasDefaults(style, enterStyle, pseudos.hoverStyle, pseudos.focusStyle, pseudos.pressStyle, pseudos.pressStyle);
|
|
65
|
+
enterStyle && merge(style, enterStyle);
|
|
66
|
+
state.hover && pseudos.hoverStyle && merge(style, pseudos.hoverStyle);
|
|
67
|
+
state.focus && pseudos.focusStyle && merge(style, pseudos.focusStyle);
|
|
68
|
+
state.press && pseudos.pressStyle && merge(style, pseudos.pressStyle);
|
|
69
|
+
exitStyle && merge(style, exitStyle);
|
|
70
|
+
return style;
|
|
58
71
|
}
|
|
59
72
|
});
|
|
60
73
|
useIsomorphicLayoutEffect(() => {
|
|
61
74
|
setStateShallow({
|
|
62
75
|
animation: res
|
|
63
76
|
});
|
|
64
|
-
}, [
|
|
77
|
+
}, [res]);
|
|
65
78
|
return null;
|
|
66
79
|
},
|
|
67
80
|
propNames: ["animation"]
|
|
68
81
|
});
|
|
69
82
|
}
|
|
70
83
|
__name(loadAnimationFeature, "loadAnimationFeature");
|
|
84
|
+
const defaults = {
|
|
85
|
+
left: 0,
|
|
86
|
+
right: 0,
|
|
87
|
+
top: 0,
|
|
88
|
+
bottom: 0,
|
|
89
|
+
opacity: 1,
|
|
90
|
+
translateX: 0,
|
|
91
|
+
translateY: 0,
|
|
92
|
+
skew: 0,
|
|
93
|
+
skewX: 0,
|
|
94
|
+
skewY: 0,
|
|
95
|
+
scale: 1,
|
|
96
|
+
rotate: "0deg",
|
|
97
|
+
rotateY: "0deg",
|
|
98
|
+
rotateX: "0deg"
|
|
99
|
+
};
|
|
100
|
+
function ensureBaseHasDefaults(base, ...pseudos) {
|
|
101
|
+
for (const pseudo of pseudos) {
|
|
102
|
+
if (!pseudo)
|
|
103
|
+
continue;
|
|
104
|
+
for (const key in pseudo) {
|
|
105
|
+
const val = pseudo[key];
|
|
106
|
+
if (key === "transform") {
|
|
107
|
+
for (const t of val) {
|
|
108
|
+
const tkey = Object.keys(t)[0];
|
|
109
|
+
const defaultVal = defaults[tkey];
|
|
110
|
+
const tDefaultVal = { [tkey]: defaultVal };
|
|
111
|
+
if (!base.transform) {
|
|
112
|
+
base.transform = [tDefaultVal];
|
|
113
|
+
} else {
|
|
114
|
+
if (!base.transform.find((x) => x[tkey])) {
|
|
115
|
+
base.transform.push(tDefaultVal);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
if (!(key in base)) {
|
|
121
|
+
base[key] = defaults[key];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
__name(ensureBaseHasDefaults, "ensureBaseHasDefaults");
|
|
128
|
+
function merge(base, next) {
|
|
129
|
+
if (!next.transform || !base.transform) {
|
|
130
|
+
Object.assign(base, next);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const { transform, ...rest } = next;
|
|
134
|
+
Object.assign(base, rest);
|
|
135
|
+
for (const t of transform) {
|
|
136
|
+
const key = Object.keys(t)[0];
|
|
137
|
+
const existing = base.transform.find((x) => key in x);
|
|
138
|
+
if (existing) {
|
|
139
|
+
existing[key] = t[key];
|
|
140
|
+
} else {
|
|
141
|
+
base.transform.push(t);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
__name(merge, "merge");
|
|
71
146
|
function loadMediaQueryFeature() {
|
|
72
147
|
const mediaPropNames = Object.keys(mediaState);
|
|
73
148
|
return createDefinition({
|
|
@@ -49,14 +49,14 @@ const useTheme = /* @__PURE__ */ __name((themeName, componentName, props, forceU
|
|
|
49
49
|
return Reflect.has(theme, key);
|
|
50
50
|
},
|
|
51
51
|
get(_, key) {
|
|
52
|
-
if (!name || key === "__proto__") {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return
|
|
52
|
+
if (!name || key === "__proto__" || typeof key === "symbol") {
|
|
53
|
+
if (key === GetThemeManager) {
|
|
54
|
+
if (!didChangeTheme) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return themeManager;
|
|
58
58
|
}
|
|
59
|
-
return
|
|
59
|
+
return Reflect.get(_, key);
|
|
60
60
|
}
|
|
61
61
|
if (process.env.NODE_ENV === "development") {
|
|
62
62
|
if (key === "__state") {
|
package/dist/jsx/views/Stack.js
CHANGED
package/dist/jsx/views/Text.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.230+fab00413",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tamagui/helpers": "^1.0.0-beta.
|
|
22
|
+
"@tamagui/helpers": "^1.0.0-beta.230+fab00413",
|
|
23
23
|
"@tamagui/ow": "^0.28.1",
|
|
24
|
-
"@tamagui/use-debounce": "^1.0.0-beta.
|
|
25
|
-
"@tamagui/use-force-update": "^1.0.0-beta.
|
|
24
|
+
"@tamagui/use-debounce": "^1.0.0-beta.230+fab00413",
|
|
25
|
+
"@tamagui/use-force-update": "^1.0.0-beta.230+fab00413",
|
|
26
26
|
"react": "*",
|
|
27
27
|
"react-dom": "*"
|
|
28
28
|
},
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"react-native-web": "*"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@tamagui/build": "^1.0.0-beta.
|
|
33
|
+
"@tamagui/build": "^1.0.0-beta.230+fab00413",
|
|
34
34
|
"@types/react": "^17.0.35",
|
|
35
35
|
"csstype": "^3.0.10",
|
|
36
36
|
"esbuild": "^0.14.36",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "fab0041356da84bd32620811a57a156d11514d2b"
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAoB,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAehE,OAAO,EAEL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EAGtB,MAAM,SAAS,CAAA;AAKhB,eAAO,MAAM,qBAAqB,EAAE,qBAQnC,CAAA;AAED,eAAO,MAAM,QAAQ,eAAsB,CAAA;AAQ3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,GAAG,EAAE,EACtC,GAAG,GAAG,IAAI,EACV,SAAS,GAAG,KAAK,EACjB,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,4DAomBrD;AAKD,eAAO,MAAM,MAAM;;;;mBA4CjB,CAAA;AAEF,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,aAAa,EACb,SAAS,GACV,EAAE;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,GAAG,CAAA;IACb,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,aAAa,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,CAAA;CAC3C,SA2CA;AAED,eAAO,MAAM,YAAY,UAAW,GAAG,gBAiBpC,CAAA"}
|