@tamagui/core 1.0.0-beta.179 → 1.0.0-beta.200
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/constants/pseudos.js +37 -0
- package/dist/cjs/constants/pseudos.js.map +7 -0
- package/dist/cjs/createComponent.js +22 -19
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createShallowUpdate.js +1 -0
- package/dist/cjs/createShallowUpdate.js.map +7 -0
- package/dist/cjs/devtools.js +32 -0
- package/dist/cjs/devtools.js.map +7 -0
- package/dist/cjs/helpers/RNComponents.js +34 -0
- package/dist/cjs/helpers/RNComponents.js.map +7 -0
- package/dist/cjs/helpers/createMediaStyle.js +3 -6
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js +51 -0
- package/dist/cjs/helpers/createShallowUpdate.js.map +7 -0
- package/dist/cjs/helpers/createTamaguiProvider.js +1 -5
- package/dist/cjs/helpers/createTamaguiProvider.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +0 -4
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/hooks/useFeatures.js +1 -0
- package/dist/cjs/hooks/useFeatures.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +5 -31
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/styled.js +2 -12
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/tamagui-base.css +8 -0
- package/dist/cjs/tamagui-base.css.map +7 -0
- package/dist/cjs/types-rnw.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Stack.js.map +2 -2
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/Theme.js +4 -16
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/esm/constants/pseudos.js +18 -0
- package/dist/esm/constants/pseudos.js.map +7 -0
- package/dist/esm/createComponent.js +22 -19
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createShallowUpdate.js +1 -0
- package/dist/esm/createShallowUpdate.js.map +7 -0
- package/dist/esm/devtools.js +14 -0
- package/dist/esm/devtools.js.map +7 -0
- package/dist/esm/helpers/RNComponents.js +12 -0
- package/dist/esm/helpers/RNComponents.js.map +7 -0
- package/dist/esm/helpers/createMediaStyle.js +3 -6
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createShallowUpdate.js +19 -0
- package/dist/esm/helpers/createShallowUpdate.js.map +7 -0
- package/dist/esm/helpers/createTamaguiProvider.js +1 -4
- package/dist/esm/helpers/createTamaguiProvider.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +0 -4
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/hooks/useFeatures.js +1 -0
- package/dist/esm/hooks/useFeatures.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +5 -31
- package/dist/esm/hooks/useMedia.js.map +2 -2
- package/dist/esm/styled.js +1 -8
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/tamagui-base.css +8 -0
- package/dist/esm/tamagui-base.css.map +7 -0
- package/dist/esm/views/Stack.js.map +2 -2
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/Theme.js +4 -16
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/jsx/constants/pseudos.js +17 -0
- package/dist/jsx/createComponent.js +18 -15
- package/dist/jsx/createShallowUpdate.js +0 -0
- package/dist/jsx/devtools.js +13 -0
- package/dist/jsx/helpers/RNComponents.js +11 -0
- package/dist/jsx/helpers/createMediaStyle.js +3 -6
- package/dist/jsx/helpers/createShallowUpdate.js +18 -0
- package/dist/jsx/helpers/createTamaguiProvider.js +1 -2
- package/dist/jsx/helpers/getSplitStyles.js +0 -4
- package/dist/jsx/hooks/useFeatures.js +1 -0
- package/dist/jsx/hooks/useMedia.js +5 -31
- package/dist/jsx/styled.js +1 -8
- package/dist/jsx/tamagui-base.css +7 -0
- package/dist/jsx/views/Theme.js +4 -16
- package/package.json +6 -6
- package/types/createComponent.d.ts +5 -6
- package/types/createComponent.d.ts.map +1 -1
- package/types/defaultComponentState.d.ts +0 -12
- package/types/defaultComponentState.d.ts.map +1 -1
- package/types/helpers/RNComponents.d.ts +2 -0
- package/types/helpers/RNComponents.d.ts.map +1 -0
- package/types/helpers/createMediaStyle.d.ts +1 -1
- package/types/helpers/createMediaStyle.d.ts.map +1 -1
- package/types/helpers/createPropMapper.d.ts +2 -2
- package/types/helpers/createPropMapper.d.ts.map +1 -1
- package/types/helpers/createShallowUpdate.d.ts +4 -0
- package/types/helpers/createShallowUpdate.d.ts.map +1 -0
- package/types/helpers/createTamaguiProvider.d.ts +1 -1
- package/types/helpers/createTamaguiProvider.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +3 -14
- 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 +7 -5
- package/types/hooks/useFeatures.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/styled.d.ts +3 -7
- package/types/styled.d.ts.map +1 -1
- package/types/types-rnw.d.ts +0 -5
- package/types/types-rnw.d.ts.map +1 -1
- package/types/types.d.ts +77 -64
- package/types/types.d.ts.map +1 -1
- package/types/views/Stack.d.ts +2 -2
- package/types/views/Stack.d.ts.map +1 -1
- package/types/views/Text.d.ts +2 -2
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
|
@@ -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 '../static'\nimport { ThemeName } from '../types'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport type ThemeProps = {\n className?: string\n disableThemeClass?: boolean\n name: Exclude<ThemeName, number> | null\n children?: any\n debug?: boolean\n}\n\nexport const Theme = memo(function Theme(props: ThemeProps) {\n const { name, theme, themeManager, themes, className } = useChangeThemeEffect(\n props.name,\n undefined,\n props\n )\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(
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC;AAErC,sBAAsB;AACtB,qCAAwC;AACxC,oBAAqC;AAIrC,qBAAM;AAUC,MAAM,QAAQ,uBAAK,uCAAe,OAAmB;AAlB5D;AAmBE,QAAM,EAAE,MAAM,OAAO,cAAc,QAAQ,cAAc,wCACvD,MAAM,MACN,QACA,KACF;
|
|
4
|
+
"sourcesContent": ["import React, { memo, useMemo } from 'react'\n\nimport { isWeb } from '../constants/platform'\nimport { wrapThemeManagerContext } from '../helpers/wrapThemeManagerContext'\nimport { useChangeThemeEffect } from '../static'\nimport { ThemeName } from '../types'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport type ThemeProps = {\n className?: string\n disableThemeClass?: boolean\n name: Exclude<ThemeName, number> | null\n children?: any\n debug?: boolean\n}\n\nexport const Theme = memo(function Theme(props: ThemeProps) {\n const { name, theme, themeManager, themes, className } = useChangeThemeEffect(\n props.name,\n undefined,\n props\n )\n\n if (!themes || !name || !theme) {\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 // 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 () => wrapThemeManagerContext(props.children, themeManager),\n [props.children, themeManager]\n )\n\n if (isWeb) {\n return (\n <div\n className={\n props.disableThemeClass\n ? ''\n : props.className\n ? `${className || ''} ${props.className || ''}`\n : className || ''\n }\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 </div>\n )\n }\n\n return contents\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC;AAErC,sBAAsB;AACtB,qCAAwC;AACxC,oBAAqC;AAIrC,qBAAM;AAUC,MAAM,QAAQ,uBAAK,uCAAe,OAAmB;AAlB5D;AAmBE,QAAM,EAAE,MAAM,OAAO,cAAc,QAAQ,cAAc,wCACvD,MAAM,MACN,QACA,KACF;AAEA,MAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO;AAC9B,QAAI,QAAQ,CAAC,SAAS,QAAQ,IAAI,aAAa,eAAe;AAC5D,cAAQ,KAAK,0BAA0B,MAAM;AAAA,IAC/C;AACA,WAAO,MAAM;AAAA,EACf;AAIA,QAAM,WAAW,0BACf,MAAM,4DAAwB,MAAM,UAAU,YAAY,GAC1D,CAAC,MAAM,UAAU,YAAY,CAC/B;AAEA,MAAI,uBAAO;AACT,WACE,mDAAC;AAAA,MACC,WACE,MAAM,oBACF,KACA,MAAM,YACN,GAAG,aAAa,MAAM,MAAM,aAAa,OACzC,aAAa;AAAA,MAEnB,OAAO;AAAA,QACL,SAAS;AAAA,QAET,OAAO,mBAAO,UAAP,mBAAc,UAAd,mBAAqB;AAAA,MAC9B;AAAA,OAEC,QACH;AAAA,EAEJ;AAEA,SAAO;AACT,GA3C0B,QA2CzB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const pseudos = {
|
|
2
|
+
focusStyle: {
|
|
3
|
+
name: "focus",
|
|
4
|
+
priority: 3
|
|
5
|
+
},
|
|
6
|
+
pressStyle: {
|
|
7
|
+
name: "active",
|
|
8
|
+
priority: 2
|
|
9
|
+
},
|
|
10
|
+
hoverStyle: {
|
|
11
|
+
name: "hover",
|
|
12
|
+
priority: 1
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
pseudos
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=pseudos.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/constants/pseudos.ts"],
|
|
4
|
+
"sourcesContent": ["export const pseudos = {\n focusStyle: {\n name: 'focus',\n priority: 3,\n },\n pressStyle: {\n name: 'active',\n priority: 2,\n },\n hoverStyle: {\n name: 'hover',\n priority: 1,\n },\n}\n"],
|
|
5
|
+
"mappings": "AAAO,MAAM,UAAU;AAAA,EACrB,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -63,7 +63,7 @@ function createComponent(configIn) {
|
|
|
63
63
|
let tamaguiConfig;
|
|
64
64
|
let AnimatedText;
|
|
65
65
|
let AnimatedView;
|
|
66
|
-
let avoidClasses =
|
|
66
|
+
let avoidClasses = true;
|
|
67
67
|
let defaultPseudos = {};
|
|
68
68
|
let defaultNativeStyle;
|
|
69
69
|
let defaultNativeStyleSheet = null;
|
|
@@ -99,7 +99,8 @@ function createComponent(configIn) {
|
|
|
99
99
|
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitInfo;
|
|
100
100
|
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
101
101
|
const isAnimated = !!(useAnimations && props.animation);
|
|
102
|
-
const
|
|
102
|
+
const hasEnterStyle = !!props.enterStyle;
|
|
103
|
+
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;
|
|
103
104
|
const features = useFeatures(props, {
|
|
104
105
|
forceUpdate,
|
|
105
106
|
setStateShallow,
|
|
@@ -160,7 +161,6 @@ function createComponent(configIn) {
|
|
|
160
161
|
}
|
|
161
162
|
const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false;
|
|
162
163
|
const hostRef = useRef(null);
|
|
163
|
-
const hasEnterStyle = !!props.enterStyle;
|
|
164
164
|
const internal = useRef();
|
|
165
165
|
if (!internal.current) {
|
|
166
166
|
internal.current = {
|
|
@@ -258,6 +258,7 @@ function createComponent(configIn) {
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
viewProps.className = className;
|
|
261
|
+
viewProps.style = animationStyles;
|
|
261
262
|
} else {
|
|
262
263
|
viewProps.style = styles;
|
|
263
264
|
}
|
|
@@ -307,6 +308,7 @@ function createComponent(configIn) {
|
|
|
307
308
|
pressIn: false
|
|
308
309
|
});
|
|
309
310
|
}, []);
|
|
311
|
+
console.log("attachHover, attachHover", attachHover, pseudos && pseudos.hoverStyle);
|
|
310
312
|
const events = shouldAttach ? {
|
|
311
313
|
...!isWeb && {
|
|
312
314
|
onPressOut: (e) => {
|
|
@@ -377,22 +379,6 @@ function createComponent(configIn) {
|
|
|
377
379
|
} : {
|
|
378
380
|
disabled: true
|
|
379
381
|
});
|
|
380
|
-
if (events) {
|
|
381
|
-
if (!isStringElement) {
|
|
382
|
-
Object.assign(viewProps, pressProps);
|
|
383
|
-
} else {
|
|
384
|
-
Object.assign(viewProps, events);
|
|
385
|
-
}
|
|
386
|
-
if (isWeb && isHoverable) {
|
|
387
|
-
childEls = /* @__PURE__ */ React.createElement("span", {
|
|
388
|
-
style: {
|
|
389
|
-
display: "contents"
|
|
390
|
-
},
|
|
391
|
-
onMouseEnter: events.onMouseEnter,
|
|
392
|
-
onMouseLeave: events.onMouseLeave
|
|
393
|
-
}, children);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
382
|
let content;
|
|
397
383
|
if (isWeb) {
|
|
398
384
|
if (staticConfig.isReactNativeWeb) {
|
|
@@ -409,7 +395,24 @@ function createComponent(configIn) {
|
|
|
409
395
|
}
|
|
410
396
|
}
|
|
411
397
|
}
|
|
398
|
+
if (events) {
|
|
399
|
+
if (!isStringElement) {
|
|
400
|
+
Object.assign(viewProps, pressProps);
|
|
401
|
+
} else {
|
|
402
|
+
Object.assign(viewProps, events);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
412
405
|
content = createElement(ViewComponent, viewProps, childEls);
|
|
406
|
+
console.log("should", attachHover);
|
|
407
|
+
if (isWeb && events && attachHover) {
|
|
408
|
+
content = /* @__PURE__ */ React.createElement("span", {
|
|
409
|
+
style: {
|
|
410
|
+
display: "contents"
|
|
411
|
+
},
|
|
412
|
+
onMouseEnter: events.onMouseEnter,
|
|
413
|
+
onMouseLeave: events.onMouseLeave
|
|
414
|
+
}, content);
|
|
415
|
+
}
|
|
413
416
|
if (process.env.NODE_ENV === "development") {
|
|
414
417
|
if (props["debug"]) {
|
|
415
418
|
viewProps["debug"] = true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createComponent.tsx"],
|
|
4
|
-
"sourcesContent": ["import { stylePropsView } 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 useEffect,\n useRef,\n useState,\n} from 'react'\nimport { StyleSheet, Text, View, ViewStyle } from 'react-native'\n\nimport { onConfiguredOnce } from './conf'\nimport { stackDefaultStyles } from './constants/constants'\nimport { isAndroid, isTouchDevice, isWeb } from './constants/platform'\nimport { rnw } from './constants/rnw'\nimport { isVariable } from './createVariable'\nimport { ComponentState, defaultComponentState } from './defaultComponentState'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport {\n ClassNamesObject,\n PseudoStyles,\n SplitStyleResult,\n getSplitStyles,\n} from './helpers/getSplitStyles'\nimport { wrapThemeManagerContext } from './helpers/wrapThemeManagerContext'\nimport { useFeatures } from './hooks/useFeatures'\nimport { usePressable } from './hooks/usePressable'\nimport { getThemeManagerIfChanged, useTheme } from './hooks/useTheme'\nimport {\n SpaceTokens,\n StackProps,\n StaticComponent,\n StaticConfig,\n StaticConfigParsed,\n TamaguiInternalConfig,\n UseAnimationHook,\n} from './types'\nimport { TextAncestorContext } from './views/TextAncestorContext'\n\nexport const mouseUps = new Set<Function>()\n\nif (typeof document !== 'undefined') {\n document.addEventListener('mouseup', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n}\n\ntype DefaultProps = {}\n\nfunction createShallowUpdate(setter: React.Dispatch<React.SetStateAction<ComponentState>>) {\n return (next: Partial<ComponentState>) => {\n setter((prev) => {\n for (const key in next) {\n if (prev[key] !== next[key]) {\n return { ...prev, ...next }\n }\n }\n return prev\n })\n }\n}\n\nexport function createComponent<ComponentPropTypes extends Object = DefaultProps, Ref = View>(\n configIn: Partial<StaticConfig> | StaticConfigParsed\n) {\n let staticConfig: StaticConfigParsed\n if ('parsed' in configIn) {\n staticConfig = configIn\n } else {\n staticConfig = parseStaticConfig(configIn)\n }\n\n const { Component, validStyles, isText, isZStack, componentName } = staticConfig\n const componentClassName = `is_${componentName}`\n const validStyleProps = validStyles || stylePropsView\n\n // split out default styles vs props so we can assign it to component.defaultProps\n let tamaguiConfig: TamaguiInternalConfig\n let AnimatedText: any\n let AnimatedView: any\n let avoidClasses = false\n\n // web uses className, native uses style\n let defaultPseudos: PseudoStyles = {}\n let defaultNativeStyle: any\n let defaultNativeStyleSheet: StyleSheet.NamedStyles<{ base: {} }> | null = null\n let defaultsClassName: ClassNamesObject | null = null\n let initialTheme: any\n let splitStyleResult: SplitStyleResult | null = null\n\n function addPseudoToStyles(styles: any[], name: string, pseudos: any) {\n // on web use pseudo object { hoverStyle } to keep specificity with concatClassName\n const pseudoStyle = pseudos[name]\n if (pseudoStyle) {\n styles.push(isWeb ? { [name]: pseudoStyle } : pseudoStyle)\n }\n const defaultPseudoStyle = defaultPseudos[name]\n if (defaultPseudoStyle) {\n styles.push(isWeb ? { [name]: defaultPseudoStyle } : defaultPseudoStyle)\n }\n }\n\n // see onConfiguredOnce below which attaches a name then to this component\n const component = forwardRef<Ref, ComponentPropTypes>((props: any, forwardedRef) => {\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.warn(componentName || Component?.displayName || Component?.name || '[Unnamed Component]', ' debug prop on:', { props: Object.entries(props) })\n if (props['debug'] === 'break') debugger\n }\n }\n\n const forceUpdate = useForceUpdate()\n const theme = useTheme(props.theme, componentName, props, forceUpdate)\n const [state, set_] = useState<ComponentState>(defaultComponentState)\n const setStateShallow = createShallowUpdate(set_)\n\n const shouldAvoidClasses = !!(state.animation && avoidClasses)\n const splitInfo = getSplitStyles(\n props,\n staticConfig,\n theme,\n shouldAvoidClasses ? { ...state, noClassNames: true, resolveVariablesAs: 'value' } : state,\n defaultsClassName\n )\n\n const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitInfo\n const useAnimations = tamaguiConfig.animations?.useAnimations as UseAnimationHook | undefined\n const isAnimated = !!(useAnimations && props.animation)\n\n const styleWithPseudos = props.animation\n ? merge(\n { ...defaultNativeStyle, ...style },\n state.hover && pseudos.hoverStyle,\n state.press && pseudos.pressStyle,\n state.focus && pseudos.focusStyle,\n ...Object.values(medias)\n )\n : null\n\n const features = useFeatures(props, {\n forceUpdate,\n setStateShallow,\n useAnimations,\n state,\n style: styleWithPseudos,\n pseudos,\n })\n\n const {\n tag,\n hitSlop,\n children,\n pointerEvents,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space,\n disabled,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\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 onMouseDown,\n nativeID,\n\n accessible,\n accessibilityRole,\n\n // android\n collapsable,\n focusable,\n\n // ignore from here on out\n theme: _themeProp,\n // @ts-ignore\n defaultVariants,\n\n // TODO feature load layout hook\n onLayout,\n ...viewPropsRest\n } = viewPropsIn\n\n let viewProps: StackProps = viewPropsRest\n\n // from react-native-web\n if (process.env.NODE_ENV === 'development' && !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 const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false\n const hostRef = useRef(null)\n const hasEnterStyle = !!props.enterStyle\n\n // isMounted\n const internal = useRef<{ isMounted: boolean }>()\n if (!internal.current) {\n internal.current = {\n isMounted: true,\n }\n }\n useEffect(() => {\n if (hasEnterStyle) {\n // we need to use state to properly have mounted go from false => true\n setStateShallow({\n mounted: true,\n })\n }\n internal.current!.isMounted = true\n return () => {\n mouseUps.delete(unPress)\n internal.current!.isMounted = false\n }\n }, [])\n\n if (nativeID) {\n viewProps.id = nativeID\n }\n\n if (isAndroid) {\n if (collapsable) viewProps.collapsable = collapsable\n if (focusable) viewProps.focusable = focusable\n }\n\n if (!isWeb) {\n if (accessible) viewProps.accessible = accessible\n if (accessibilityRole) viewProps.accessibilityRole = accessibilityRole\n }\n\n if (isWeb) {\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 // 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 ViewComponent = isText\n ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent\n : (isAnimated ? AnimatedView || View : null) || BaseViewComponent\n\n ViewComponent = Component || ViewComponent\n\n let styles: any[]\n\n const isStringElement = typeof ViewComponent === 'string'\n const animationStyles = state.animation ? state.animation.style : null\n\n if (isStringElement && shouldAvoidClasses) {\n styles = {\n ...defaultNativeStyle,\n ...animationStyles,\n ...medias,\n }\n } else {\n styles = [\n isWeb ? null : defaultNativeStyleSheet ? (defaultNativeStyleSheet.base as ViewStyle) : null,\n // parity w react-native-web, only for text in text\n // TODO this should be able to be done w css to replicate after extraction:\n // (.text .text { display: inline-flex; }) (but if they set display we'd need stronger precendence)\n // isText && hasTextAncestor && isWeb ? { display: 'inline-flex' } : null,\n // style,\n animationStyles ? animationStyles : style,\n medias,\n ]\n if (!animationStyles) {\n state.hover && addPseudoToStyles(styles, 'hoverStyle', pseudos)\n state.focus && addPseudoToStyles(styles, 'focusStyle', pseudos)\n state.press && addPseudoToStyles(styles, 'pressStyle', pseudos)\n }\n }\n\n // TODO i think can still render this first part using reanimated\n // that way we get some of the classnames we probably want here (componentName/font/etc)\n // can just remove && !shouldAvoidClasses and add in a viewProps.style = styles in isWeb\n\n if (isWeb) {\n // const hasntSetInitialAnimationState = props.animation && !state.animation\n // const disableInsertStyles = hasntSetInitialAnimationState || shouldAvoidClasses || false\n // const stylesClassNames = useStylesAsClassname(\n // Array.isArray(styles) ? styles : [styles],\n // disableInsertStyles,\n // props.debug\n // )\n if (!shouldAvoidClasses) {\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 // TODO restore this to isText classList\n // hasTextAncestor === true && cssText.textHasAncestor,\n // TODO MOVE TO VARIANTS [number] [any]\n // numberOfLines != null && numberOfLines > 1 && cssText.textMultiLine,\n\n const className = classList.join(' ')\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log(' \u00BB className', { isStringElement, pseudos, state, defaultsClassName, classNames, propsClassName: props.className, style, classList, className: className.trim().split(' '), themeClassName: theme.className })\n }\n }\n viewProps.className = className\n } else {\n viewProps.style = styles\n }\n } else {\n viewProps.style = styles\n }\n\n if (pointerEvents) {\n viewProps.pointerEvents = pointerEvents\n }\n\n if (isWeb) {\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 != null && hrefAttrs != null) {\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 } else {\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\n\n // TODO need to loop active variants and see if they have matchin pseudos and apply as well\n const attachPress = !!((pseudos && pseudos.pressStyle) || onPress || onPressOut || onPressIn)\n const isHoverable = isWeb && !isTouchDevice\n const attachHover =\n isHoverable &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n const pressEventKey = isStringElement ? 'onClick' : 'onPress'\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 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 ...(!isWeb && {\n // non web\n onPressOut: (e) => {\n unPress()\n onPressOut?.(e)\n },\n }),\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 onMouseDown: attachPress\n ? (e) => {\n setStateShallow({\n press: true,\n pressIn: true,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n }\n : null,\n [pressEventKey]: attachPress\n ? (e) => {\n // this caused issue with next.js passing href\n // e.preventDefault()\n onPress?.(e)\n unPress()\n onPressOut?.(e)\n }\n : null,\n }\n : null\n\n let childEls = !children\n ? children\n : wrapThemeManagerContext(\n spacedChildren({\n children,\n space,\n flexDirection: props.flexDirection || staticConfig.defaultProps?.flexDirection,\n isZStack: isZStack,\n }),\n getThemeManagerIfChanged(theme)\n )\n\n // TODO once we do the above we can then rely entirely on pressStyle returned here isntead of above pressStyle logic\n const [pressProps] = usePressable(\n events\n ? {\n disabled,\n ...(hitSlop && {\n hitSlop,\n }),\n onPressIn: events.onMouseDown,\n onPressOut: events.onPressOut,\n onPress: events[pressEventKey],\n }\n : {\n disabled: true,\n }\n )\n\n if (events) {\n if (!isStringElement) {\n Object.assign(viewProps, pressProps)\n } else {\n Object.assign(viewProps, events)\n }\n if (isWeb && isHoverable) {\n childEls = (\n <span\n style={{\n display: 'contents',\n }}\n onMouseEnter={events.onMouseEnter}\n onMouseLeave={events.onMouseLeave}\n >\n {children}\n </span>\n )\n }\n }\n\n let content: any\n\n // replicate react-native-web's `createElement`\n if (isWeb) {\n if (staticConfig.isReactNativeWeb) {\n viewProps.dataSet = {\n ...viewProps.dataSet,\n className: viewProps.className,\n }\n } else {\n const rnProps = rnw.createDOMProps(viewProps)\n const className =\n rnProps.className && rnProps.className !== viewProps.className\n ? `${rnProps.className} ${viewProps.className}`\n : viewProps.className\n\n // additive\n Object.assign(viewProps, rnProps)\n\n // we already handle Text/View properly\n if (className) {\n viewProps.className = className\n }\n }\n }\n\n content = createElement(ViewComponent, viewProps, childEls)\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n viewProps['debug'] = true\n // prettier-ignore\n console.log(' \u00BB ', { propsIn: { ...props }, propsOut: { ...viewProps }, animationStyles, isStringElement, classNamesIn: props.className?.split(' '), classNamesOut: viewProps.className?.split(' '), pressProps, events, shouldAttach, ViewComponent, viewProps, state, styles, pseudos, content, childEls, shouldAvoidClasses, animation: props.animation, style, defaultNativeStyle, splitStyleResult, ...(typeof window !== 'undefined' ? { theme, themeState: theme.__state, themeClassName: theme.className, staticConfig, tamaguiConfig } : null) })\n }\n }\n\n if (features.length) {\n return (\n <>\n {features}\n {content}\n </>\n )\n }\n\n return content\n })\n\n // Once configuration is run and all components are registered\n // get default props + className and analyze styles\n onConfiguredOnce((conf) => {\n const shouldDebug = staticConfig.defaultProps?.debug\n tamaguiConfig = conf\n avoidClasses = !!tamaguiConfig.animations?.avoidClasses\n AnimatedText = tamaguiConfig.animations?.Text\n AnimatedView = tamaguiConfig?.animations?.View\n initialTheme = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]\n splitStyleResult = getSplitStyles(staticConfig.defaultProps, staticConfig, initialTheme, {\n mounted: true,\n resolveVariablesAs: 'variable',\n })\n\n const { classNames, pseudos, style, viewProps } = splitStyleResult\n\n if (isWeb) {\n defaultsClassName = classNames\n }\n\n // for use in animations + native\n defaultPseudos = pseudos\n defaultNativeStyle = {}\n for (const key in style) {\n const v = style[key]\n defaultNativeStyle[key] = isVariable(v) ? v.val : v\n }\n defaultNativeStyleSheet = StyleSheet.create({\n base: defaultNativeStyle,\n })\n\n component.displayName = staticConfig.componentName\n\n // @ts-ignore\n component.defaultProps = {\n ...viewProps,\n ...component.defaultProps,\n }\n\n // prettier-ignore\n if (process.env.NODE_ENV === 'development' && shouldDebug && process.env.IS_STATIC !== 'is_static') {\n // prettier-ignore\n console.log(`\uD83D\uDC1B [${staticConfig.componentName || 'Component'}]`, { staticConfig, ...splitStyleResult })\n }\n })\n\n let res: StaticComponent<ComponentPropTypes, {}, Ref> = component as any\n\n if (configIn.memo) {\n res = memo(res) as any\n }\n\n res['staticConfig'] = {\n validStyles: validStyleProps,\n ...staticConfig,\n }\n\n // res.extractable HoC\n res['extractable'] = (Component: any, conf?: StaticConfig) => {\n Component['staticConfig'] = extendStaticConfig(res, {\n ...conf,\n neverFlatten: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n })\n return Component\n }\n\n return res\n}\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport const Spacer = createComponent<\n Omit<StackProps, 'flex' | 'direction'> & {\n size?: number | SpaceTokens\n flex?: boolean | number\n direction?: 'horizontal' | 'vertical'\n }\n>({\n memo: true,\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.size[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 flex: 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 },\n },\n})\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n flexDirection,\n spaceFlex,\n}: {\n isZStack?: boolean\n children: any\n space?: any\n spaceFlex?: boolean | number\n flexDirection?: ViewStyle['flexDirection']\n}) {\n const childrenList = Children.toArray(children)\n const len = childrenList.length\n if (len === 1) {\n return childrenList\n }\n const next: any[] = []\n for (const [index, child] of childrenList.entries()) {\n if (child === null || child === undefined) {\n continue\n }\n\n if (!child || (child['key'] && !isZStack)) {\n next.push(child)\n } else {\n next.push(\n <Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n }\n\n // allows for custom visually hidden components that dont insert spacing\n if (child['type']?.['isVisuallyHidden']) {\n continue\n }\n\n if (index !== len - 1) {\n if (space) {\n next.push(\n <Spacer\n key={`_${index}_spacer`}\n direction={\n flexDirection === 'row' || flexDirection === 'row-reverse' ? 'horizontal' : 'vertical'\n }\n size={space}\n {...(spaceFlex && {\n flex: spaceFlex,\n })}\n />\n )\n }\n }\n }\n return next\n}\n\n// TODO this can be removed likey for bundle size, didnt help reanimated fix as i thought\nconst merge = (...styles: (ViewStyle | null | false | undefined)[]) => {\n // ensure transforms get merged without duplicates:\n // so if you have a:\n // transform: [{ scale: 1 }]\n // rest[0]:\n // transform: [{ scale: 1.1 }]\n // it gets properly merged so that rest[0] overwrites a\n if (!styles[0]) return // never happens\n const res: ViewStyle = {}\n\n const len = styles.length\n for (let i = len - 1; i >= 0; i--) {\n const cur = styles[i]\n if (!cur) continue\n\n for (const key in cur) {\n const val = cur[key]\n if (key !== 'transform') {\n if (!(key in res)) {\n res[key] = val\n }\n continue\n }\n if (!res.transform) {\n res.transform = val\n continue\n }\n // transform\n for (const t of val) {\n const tkey = Object.keys(t)[0]\n if (res.transform.find((existing) => tkey in existing)) {\n continue\n }\n res.transform.push(t)\n }\n }\n }\n\n return res\n}\n\nexport const AbsoluteFill = (props: any) =>\n isWeb ? (\n <div\n style={{\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n }}\n >\n {props.children}\n </div>\n ) : (\n <View style={StyleSheet.absoluteFill}>{props.child}</View>\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"],
|
|
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;AAAA;AAAA;AAMA;AACA;AACA;AACA;AAUA;AAEO,MAAM,WAAW,oBAAI,IAAc;AAE1C,IAAI,OAAO,aAAa,aAAa;AACnC,WAAS,iBAAiB,WAAW,MAAM;AACzC,aAAS,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC3B,aAAS,MAAM;AAAA,EACjB,CAAC;AACH;AAIA,6BAA6B,QAA8D;AACzF,SAAO,CAAC,SAAkC;AACxC,WAAO,CAAC,SAAS;AACf,iBAAW,OAAO,MAAM;AACtB,YAAI,KAAK,SAAS,KAAK,MAAM;AAC3B,iBAAO,KAAK,SAAS,KAAK;AAAA,QAC5B;AAAA,MACF;AACA,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AACF;AAXS;AAaF,y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A,EACC,OAAO;AAAA,IACL,UAAU;AAAA,IACV,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,GAEC,MAAM,QACT,IAEA,oCAAC;AAAA,EAAK,OAAO,WAAW;AAAA,GAAe,MAAM,KAAM,GAd3B;",
|
|
4
|
+
"sourcesContent": ["import { stylePropsView } 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 useEffect,\n useRef,\n useState,\n} from 'react'\nimport { StyleSheet, Text, View, ViewStyle } from 'react-native'\n\nimport { onConfiguredOnce } from './conf'\nimport { stackDefaultStyles } from './constants/constants'\nimport { isAndroid, isTouchDevice, isWeb } from './constants/platform'\nimport { rnw } from './constants/rnw'\nimport { isVariable } from './createVariable'\nimport { ComponentState, defaultComponentState } from './defaultComponentState'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport {\n ClassNamesObject,\n PseudoStyles,\n SplitStyleResult,\n getSplitStyles,\n} from './helpers/getSplitStyles'\nimport { wrapThemeManagerContext } from './helpers/wrapThemeManagerContext'\nimport { useFeatures } from './hooks/useFeatures'\nimport { usePressable } from './hooks/usePressable'\nimport { getThemeManagerIfChanged, useTheme } from './hooks/useTheme'\nimport {\n SpaceTokens,\n StackProps,\n StaticConfig,\n StaticConfigParsed,\n TamaguiComponent,\n TamaguiInternalConfig,\n UseAnimationHook,\n} from './types'\nimport { TextAncestorContext } from './views/TextAncestorContext'\n\nexport const mouseUps = new Set<Function>()\n\nif (typeof document !== 'undefined') {\n document.addEventListener('mouseup', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n}\n\ntype DefaultProps = {}\n\nfunction createShallowUpdate(setter: React.Dispatch<React.SetStateAction<ComponentState>>) {\n return (next: Partial<ComponentState>) => {\n setter((prev) => {\n for (const key in next) {\n if (prev[key] !== next[key]) {\n return { ...prev, ...next }\n }\n }\n return prev\n })\n }\n}\n\nexport function createComponent<\n ComponentPropTypes extends Object = DefaultProps,\n Ref = View,\n BaseProps = never\n>(configIn: Partial<StaticConfig> | StaticConfigParsed) {\n let staticConfig: StaticConfigParsed\n if ('parsed' in configIn) {\n staticConfig = configIn\n } else {\n staticConfig = parseStaticConfig(configIn)\n }\n\n const { Component, validStyles, isText, isZStack, componentName } = staticConfig\n const componentClassName = `is_${componentName}`\n const validStyleProps = validStyles || stylePropsView\n\n // split out default styles vs props so we can assign it to component.defaultProps\n let tamaguiConfig: TamaguiInternalConfig\n let AnimatedText: any\n let AnimatedView: any\n let avoidClasses = true\n\n // web uses className, native uses style\n let defaultPseudos: PseudoStyles = {}\n let defaultNativeStyle: any\n let defaultNativeStyleSheet: StyleSheet.NamedStyles<{ base: {} }> | null = null\n let defaultsClassName: ClassNamesObject | null = null\n let initialTheme: any\n let splitStyleResult: SplitStyleResult | null = null\n\n function addPseudoToStyles(styles: any[], name: string, pseudos: any) {\n // on web use pseudo object { hoverStyle } to keep specificity with concatClassName\n const pseudoStyle = pseudos[name]\n if (pseudoStyle) {\n styles.push(isWeb ? { [name]: pseudoStyle } : pseudoStyle)\n }\n const defaultPseudoStyle = defaultPseudos[name]\n if (defaultPseudoStyle) {\n styles.push(isWeb ? { [name]: defaultPseudoStyle } : defaultPseudoStyle)\n }\n }\n\n // see onConfiguredOnce below which attaches a name then to this component\n const component = forwardRef<Ref, ComponentPropTypes>((props: any, forwardedRef) => {\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.warn(componentName || Component?.displayName || Component?.name || '[Unnamed Component]', ' debug prop on:', { props: Object.entries(props) })\n if (props['debug'] === 'break') debugger\n }\n }\n\n const forceUpdate = useForceUpdate()\n const theme = useTheme(props.theme, componentName, props, forceUpdate)\n const [state, set_] = useState<ComponentState>(defaultComponentState)\n const setStateShallow = createShallowUpdate(set_)\n\n const shouldAvoidClasses = !!(state.animation && avoidClasses)\n const splitInfo = getSplitStyles(\n props,\n staticConfig,\n theme,\n shouldAvoidClasses ? { ...state, noClassNames: true, resolveVariablesAs: 'value' } : state,\n defaultsClassName\n )\n\n const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitInfo\n const useAnimations = tamaguiConfig.animations?.useAnimations as UseAnimationHook | undefined\n const isAnimated = !!(useAnimations && props.animation)\n const hasEnterStyle = !!props.enterStyle\n\n const styleWithPseudos = props.animation\n ? merge(\n { ...defaultNativeStyle, ...style },\n state.hover && pseudos.hoverStyle,\n state.press && pseudos.pressStyle,\n state.focus && pseudos.focusStyle,\n hasEnterStyle && !state.mounted && pseudos.enterStyle,\n ...Object.values(medias)\n )\n : null\n\n const features = useFeatures(props, {\n forceUpdate,\n setStateShallow,\n useAnimations,\n state,\n style: styleWithPseudos,\n pseudos,\n })\n\n const {\n tag,\n hitSlop,\n children,\n pointerEvents,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space,\n disabled,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\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 onMouseDown,\n nativeID,\n\n accessible,\n accessibilityRole,\n\n // android\n collapsable,\n focusable,\n\n // ignore from here on out\n theme: _themeProp,\n // @ts-ignore\n defaultVariants,\n\n // TODO feature load layout hook\n onLayout,\n ...viewPropsRest\n } = viewPropsIn\n\n let viewProps: StackProps = viewPropsRest\n\n // from react-native-web\n if (process.env.NODE_ENV === 'development' && !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 const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false\n const hostRef = useRef(null)\n\n // isMounted\n const internal = useRef<{ isMounted: boolean }>()\n if (!internal.current) {\n internal.current = {\n isMounted: true,\n }\n }\n useEffect(() => {\n if (hasEnterStyle) {\n // we need to use state to properly have mounted go from false => true\n setStateShallow({\n mounted: true,\n })\n }\n internal.current!.isMounted = true\n return () => {\n mouseUps.delete(unPress)\n internal.current!.isMounted = false\n }\n }, [])\n\n if (nativeID) {\n viewProps.id = nativeID\n }\n\n if (isAndroid) {\n if (collapsable) viewProps.collapsable = collapsable\n if (focusable) viewProps.focusable = focusable\n }\n\n if (!isWeb) {\n if (accessible) viewProps.accessible = accessible\n if (accessibilityRole) viewProps.accessibilityRole = accessibilityRole\n }\n\n if (isWeb) {\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 // 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 ViewComponent = isText\n ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent\n : (isAnimated ? AnimatedView || View : null) || BaseViewComponent\n\n ViewComponent = Component || ViewComponent\n\n let styles: any[]\n\n const isStringElement = typeof ViewComponent === 'string'\n const animationStyles = state.animation ? state.animation.style : null\n\n if (isStringElement && shouldAvoidClasses) {\n styles = {\n ...defaultNativeStyle,\n ...animationStyles,\n ...medias,\n }\n } else {\n styles = [\n isWeb ? null : defaultNativeStyleSheet ? (defaultNativeStyleSheet.base as ViewStyle) : null,\n // parity w react-native-web, only for text in text\n // TODO this should be able to be done w css to replicate after extraction:\n // (.text .text { display: inline-flex; }) (but if they set display we'd need stronger precendence)\n // isText && hasTextAncestor && isWeb ? { display: 'inline-flex' } : null,\n // style,\n animationStyles ? animationStyles : style,\n medias,\n ]\n if (!animationStyles) {\n state.hover && addPseudoToStyles(styles, 'hoverStyle', pseudos)\n state.focus && addPseudoToStyles(styles, 'focusStyle', pseudos)\n state.press && addPseudoToStyles(styles, 'pressStyle', pseudos)\n }\n }\n\n // TODO i think can still render this first part using reanimated\n // that way we get some of the classnames we probably want here (componentName/font/etc)\n // can just remove && !shouldAvoidClasses and add in a viewProps.style = styles in isWeb\n\n if (isWeb) {\n // const hasntSetInitialAnimationState = props.animation && !state.animation\n // const disableInsertStyles = hasntSetInitialAnimationState || shouldAvoidClasses || false\n // const stylesClassNames = useStylesAsClassname(\n // Array.isArray(styles) ? styles : [styles],\n // disableInsertStyles,\n // props.debug\n // )\n if (!shouldAvoidClasses) {\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 // TODO restore this to isText classList\n // hasTextAncestor === true && cssText.textHasAncestor,\n // TODO MOVE TO VARIANTS [number] [any]\n // numberOfLines != null && numberOfLines > 1 && cssText.textMultiLine,\n\n const className = classList.join(' ')\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log(' \u00BB className', { isStringElement, pseudos, state, defaultsClassName, classNames, propsClassName: props.className, style, classList, className: className.trim().split(' '), themeClassName: theme.className })\n }\n }\n viewProps.className = className\n viewProps.style = animationStyles\n } else {\n viewProps.style = styles\n }\n } else {\n viewProps.style = styles\n }\n\n if (pointerEvents) {\n viewProps.pointerEvents = pointerEvents\n }\n\n if (isWeb) {\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 != null && hrefAttrs != null) {\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 } else {\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\n\n // TODO need to loop active variants and see if they have matchin pseudos and apply as well\n const attachPress = !!((pseudos && pseudos.pressStyle) || onPress || onPressOut || onPressIn)\n const isHoverable = isWeb && !isTouchDevice\n const attachHover =\n isHoverable &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n const pressEventKey = isStringElement ? 'onClick' : 'onPress'\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 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 console.log('attachHover, attachHover', attachHover, pseudos && pseudos.hoverStyle)\n\n const events = shouldAttach\n ? {\n ...(!isWeb && {\n // non web\n onPressOut: (e) => {\n unPress()\n onPressOut?.(e)\n },\n }),\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 onMouseDown: attachPress\n ? (e) => {\n setStateShallow({\n press: true,\n pressIn: true,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n }\n : null,\n [pressEventKey]: attachPress\n ? (e) => {\n // this caused issue with next.js passing href\n // e.preventDefault()\n onPress?.(e)\n unPress()\n onPressOut?.(e)\n }\n : null,\n }\n : null\n\n let childEls = !children\n ? children\n : wrapThemeManagerContext(\n spacedChildren({\n children,\n space,\n flexDirection: props.flexDirection || staticConfig.defaultProps?.flexDirection,\n isZStack: isZStack,\n }),\n getThemeManagerIfChanged(theme)\n )\n\n // TODO once we do the above we can then rely entirely on pressStyle returned here isntead of above pressStyle logic\n const [pressProps] = usePressable(\n events\n ? {\n disabled,\n ...(hitSlop && {\n hitSlop,\n }),\n onPressIn: events.onMouseDown,\n onPressOut: events.onPressOut,\n onPress: events[pressEventKey],\n }\n : {\n disabled: true,\n }\n )\n\n let content: any\n\n // replicate react-native-web's `createElement`\n if (isWeb) {\n if (staticConfig.isReactNativeWeb) {\n viewProps.dataSet = {\n ...viewProps.dataSet,\n className: viewProps.className,\n }\n } else {\n const rnProps = rnw.createDOMProps(viewProps)\n const className =\n rnProps.className && rnProps.className !== viewProps.className\n ? `${rnProps.className} ${viewProps.className}`\n : viewProps.className\n\n // additive\n Object.assign(viewProps, rnProps)\n\n // we already handle Text/View properly\n if (className) {\n viewProps.className = className\n }\n }\n }\n\n if (events) {\n if (!isStringElement) {\n Object.assign(viewProps, pressProps)\n } else {\n Object.assign(viewProps, events)\n }\n }\n\n content = createElement(ViewComponent, viewProps, childEls)\n\n console.log('should', attachHover)\n if (isWeb && events && attachHover) {\n content = (\n <span\n style={{\n display: 'contents',\n }}\n onMouseEnter={events.onMouseEnter}\n onMouseLeave={events.onMouseLeave}\n >\n {content}\n </span>\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n viewProps['debug'] = true\n // prettier-ignore\n console.log(' \u00BB ', { propsIn: { ...props }, propsOut: { ...viewProps }, animationStyles, isStringElement, classNamesIn: props.className?.split(' '), classNamesOut: viewProps.className?.split(' '), pressProps, events, shouldAttach, ViewComponent, viewProps, state, styles, pseudos, content, childEls, shouldAvoidClasses, animation: props.animation, style, defaultNativeStyle, splitStyleResult, ...(typeof window !== 'undefined' ? { theme, themeState: theme.__state, themeClassName: theme.className, staticConfig, tamaguiConfig } : null) })\n }\n }\n\n if (features.length) {\n return (\n <>\n {features}\n {content}\n </>\n )\n }\n\n return content\n })\n\n // Once configuration is run and all components are registered\n // get default props + className and analyze styles\n onConfiguredOnce((conf) => {\n const shouldDebug = staticConfig.defaultProps?.debug\n tamaguiConfig = conf\n avoidClasses = !!tamaguiConfig.animations?.avoidClasses\n AnimatedText = tamaguiConfig.animations?.Text\n AnimatedView = tamaguiConfig?.animations?.View\n initialTheme = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]\n splitStyleResult = getSplitStyles(staticConfig.defaultProps, staticConfig, initialTheme, {\n mounted: true,\n resolveVariablesAs: 'variable',\n })\n\n const { classNames, pseudos, style, viewProps } = splitStyleResult\n\n if (isWeb) {\n defaultsClassName = classNames\n }\n\n // for use in animations + native\n defaultPseudos = pseudos\n defaultNativeStyle = {}\n for (const key in style) {\n const v = style[key]\n defaultNativeStyle[key] = isVariable(v) ? v.val : v\n }\n defaultNativeStyleSheet = StyleSheet.create({\n base: defaultNativeStyle,\n })\n\n component.displayName = staticConfig.componentName\n\n // @ts-ignore\n component.defaultProps = {\n ...viewProps,\n ...component.defaultProps,\n }\n\n // prettier-ignore\n if (process.env.NODE_ENV === 'development' && shouldDebug && process.env.IS_STATIC !== 'is_static') {\n // prettier-ignore\n console.log(`\uD83D\uDC1B [${staticConfig.componentName || 'Component'}]`, { staticConfig, ...splitStyleResult })\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: validStyleProps,\n ...staticConfig,\n }\n\n // res.extractable HoC\n res['extractable'] = (Component: any, conf?: StaticConfig) => {\n Component['staticConfig'] = extendStaticConfig(res, {\n ...conf,\n neverFlatten: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n })\n return Component\n }\n\n return res\n}\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport const Spacer = createComponent<\n Omit<StackProps, 'flex' | 'direction'> & {\n size?: number | SpaceTokens\n flex?: boolean | number\n direction?: 'horizontal' | 'vertical'\n }\n>({\n memo: true,\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.size[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 flex: 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 },\n },\n})\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n flexDirection,\n spaceFlex,\n}: {\n isZStack?: boolean\n children: any\n space?: any\n spaceFlex?: boolean | number\n flexDirection?: ViewStyle['flexDirection']\n}) {\n const childrenList = Children.toArray(children)\n const len = childrenList.length\n if (len === 1) {\n return childrenList\n }\n const next: any[] = []\n for (const [index, child] of childrenList.entries()) {\n if (child === null || child === undefined) {\n continue\n }\n\n if (!child || (child['key'] && !isZStack)) {\n next.push(child)\n } else {\n next.push(\n <Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n }\n\n // allows for custom visually hidden components that dont insert spacing\n if (child['type']?.['isVisuallyHidden']) {\n continue\n }\n\n if (index !== len - 1) {\n if (space) {\n next.push(\n <Spacer\n key={`_${index}_spacer`}\n direction={\n flexDirection === 'row' || flexDirection === 'row-reverse' ? 'horizontal' : 'vertical'\n }\n size={space}\n {...(spaceFlex && {\n flex: spaceFlex,\n })}\n />\n )\n }\n }\n }\n return next\n}\n\n// TODO this can be removed likey for bundle size, didnt help reanimated fix as i thought\nconst merge = (...styles: (ViewStyle | null | false | undefined)[]) => {\n // ensure transforms get merged without duplicates:\n // so if you have a:\n // transform: [{ scale: 1 }]\n // rest[0]:\n // transform: [{ scale: 1.1 }]\n // it gets properly merged so that rest[0] overwrites a\n if (!styles[0]) return // never happens\n const res: ViewStyle = {}\n\n const len = styles.length\n for (let i = len - 1; i >= 0; i--) {\n const cur = styles[i]\n if (!cur) continue\n\n for (const key in cur) {\n const val = cur[key]\n if (key !== 'transform') {\n if (!(key in res)) {\n res[key] = val\n }\n continue\n }\n if (!res.transform) {\n res.transform = val\n continue\n }\n // transform\n for (const t of val) {\n const tkey = Object.keys(t)[0]\n if (res.transform.find((existing) => tkey in existing)) {\n continue\n }\n res.transform.push(t)\n }\n }\n }\n\n return res\n}\n\nexport const AbsoluteFill = (props: any) =>\n isWeb ? (\n <div\n style={\n {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n } as any\n }\n >\n {props.children}\n </div>\n ) : (\n <View style={StyleSheet.absoluteFill}>{props.child}</View>\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"],
|
|
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;AAAA;AAAA;AAMA;AACA;AACA;AACA;AAUA;AAEO,MAAM,WAAW,oBAAI,IAAc;AAE1C,IAAI,OAAO,aAAa,aAAa;AACnC,WAAS,iBAAiB,WAAW,MAAM;AACzC,aAAS,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC3B,aAAS,MAAM;AAAA,EACjB,CAAC;AACH;AAIA,6BAA6B,QAA8D;AACzF,SAAO,CAAC,SAAkC;AACxC,WAAO,CAAC,SAAS;AACf,iBAAW,OAAO,MAAM;AACtB,YAAI,KAAK,SAAS,KAAK,MAAM;AAC3B,iBAAO,KAAK,SAAS,KAAK;AAAA,QAC5B;AAAA,MACF;AACA,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AACF;AAXS;AAaF,yBAIL,UAAsD;AACtD,MAAI;AACJ,MAAI,YAAY,UAAU;AACxB,mBAAe;AAAA,EACjB,OAAO;AACL,mBAAe,kBAAkB,QAAQ;AAAA,EAC3C;AAEA,QAAM,EAAE,WAAW,aAAa,QAAQ,UAAU,kBAAkB;AACpE,QAAM,qBAAqB,MAAM;AACjC,QAAM,kBAAkB,eAAe;AAGvC,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,MAAI,eAAe;AAGnB,MAAI,iBAA+B,CAAC;AACpC,MAAI;AACJ,MAAI,0BAAuE;AAC3E,MAAI,oBAA6C;AACjD,MAAI;AACJ,MAAI,mBAA4C;AAEhD,6BAA2B,QAAe,MAAc,SAAc;AAEpE,UAAM,cAAc,QAAQ;AAC5B,QAAI,aAAa;AACf,aAAO,KAAK,QAAQ,GAAG,OAAO,Y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"./conf";
|
|
2
|
+
import { insertedSelectors } from "./helpers/insertStyleRule";
|
|
3
|
+
onConfiguredOnce((conf) => {
|
|
4
|
+
if (globalThis["Tamagui"]) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
globalThis["Tamagui"] = {
|
|
8
|
+
...conf,
|
|
9
|
+
get insertedCSS() {
|
|
10
|
+
return insertedSelectors;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=devtools.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/devtools.ts"],
|
|
4
|
+
"sourcesContent": ["import { onConfiguredOnce } from './conf'\nimport { insertedSelectors } from './helpers/insertStyleRule'\n\nonConfiguredOnce((conf) => {\n if (globalThis['Tamagui']) {\n return\n }\n globalThis['Tamagui'] = {\n ...conf,\n get insertedCSS() {\n return insertedSelectors\n },\n }\n})\n"],
|
|
5
|
+
"mappings": "AAAA;AACA;AAEA,iBAAiB,CAAC,SAAS;AACzB,MAAI,WAAW,YAAY;AACzB;AAAA,EACF;AACA,aAAW,aAAa;AAAA,OACnB;AAAA,QACC,cAAc;AAChB,aAAO;AAAA,IACT;AAAA,EACF;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as ReactNative from "react-native";
|
|
2
|
+
const RNComponents = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
for (const key of ["Image", "TextInput", "Text", "View"]) {
|
|
4
|
+
const val = ReactNative[key];
|
|
5
|
+
if (val && typeof val === "object") {
|
|
6
|
+
RNComponents.set(val, true);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
RNComponents
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=RNComponents.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/RNComponents.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as ReactNative from 'react-native'\n\n// bye bye tree shaking... but only way to properly detect react-native components...\n// also neither rnw nor react support tree shaking atm\nexport const RNComponents = new WeakMap()\n\n// I was looping over all of them, but casuses deprecation warnings and there's only a few\n// we realistically support - lets whitelist rather than blacklist\nfor (const key of ['Image', 'TextInput', 'Text', 'View']) {\n const val = ReactNative[key]\n if (val && typeof val === 'object') {\n RNComponents.set(val, true)\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAIO,MAAM,eAAe,oBAAI,QAAQ;AAIxC,WAAW,OAAO,CAAC,SAAS,aAAa,QAAQ,MAAM,GAAG;AACxD,QAAM,MAAM,YAAY;AACxB,MAAI,OAAO,OAAO,QAAQ,UAAU;AAClC,iBAAa,IAAI,KAAK,IAAI;AAAA,EAC5B;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -2,19 +2,16 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import { mediaObjectToString } from "../hooks/useMedia";
|
|
4
4
|
const MEDIA_SEP = "_";
|
|
5
|
-
const createMediaStyle = /* @__PURE__ */ __name(({ identifier, rules }, mediaKey, mediaQueries, negate, importance
|
|
5
|
+
const createMediaStyle = /* @__PURE__ */ __name(({ identifier, rules }, mediaKey, mediaQueries, negate, importance) => {
|
|
6
6
|
const mediaKeys = Object.keys(mediaQueries);
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
return acc;
|
|
10
|
-
}, {});
|
|
7
|
+
const importance_ = Math.max(0, importance == void 0 ? mediaKeys.indexOf(mediaKey) : importance || 0);
|
|
8
|
+
const precendencePrefix = new Array(importance_ + 1).fill(":root").join("");
|
|
11
9
|
const negKey = negate ? "0" : "";
|
|
12
10
|
const ogPrefix = identifier.slice(0, identifier.indexOf("-") + 1);
|
|
13
11
|
const nextIdentifier = `${identifier.replace(ogPrefix, `${ogPrefix}${MEDIA_SEP}${mediaKey}${negKey}${MEDIA_SEP}`)}`;
|
|
14
12
|
const screenStr = negate ? "not all" : "screen";
|
|
15
13
|
const mediaSelector = mediaObjectToString(mediaQueries[mediaKey]);
|
|
16
14
|
const mediaQuery = `${screenStr} and ${mediaSelector}`;
|
|
17
|
-
const precendencePrefix = mediaKeyPrecendence[mediaKey];
|
|
18
15
|
const styleInner = rules[0].replace(identifier, nextIdentifier);
|
|
19
16
|
let styleRule = "";
|
|
20
17
|
if (styleInner.includes("@media")) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/createMediaStyle.ts"],
|
|
4
|
-
"sourcesContent": ["import { StyleObject } from '@tamagui/helpers'\n\nimport { mediaObjectToString } from '../hooks/useMedia'\nimport { MediaQueries } from '../types'\n\n// TODO have this be used by extractMediaStyle in tamagui static\n
|
|
5
|
-
"mappings": ";;AAEA;
|
|
4
|
+
"sourcesContent": ["import { StyleObject } from '@tamagui/helpers'\n\nimport { mediaObjectToString } from '../hooks/useMedia'\nimport { MediaQueries } from '../types'\n\n// TODO have this be used by extractMediaStyle in tamagui static\n// not synced to static/constants for now\nexport const MEDIA_SEP = '_'\n\nexport const createMediaStyle = (\n { identifier, rules }: StyleObject,\n mediaKey: string,\n mediaQueries: MediaQueries,\n negate?: boolean,\n importance?: number\n) => {\n const mediaKeys = Object.keys(mediaQueries)\n const importance_ = Math.max(\n 0,\n importance == undefined ? mediaKeys.indexOf(mediaKey) : importance || 0\n )\n const precendencePrefix = new Array(importance_ + 1).fill(':root').join('')\n const negKey = negate ? '0' : ''\n const ogPrefix = identifier.slice(0, identifier.indexOf('-') + 1)\n const nextIdentifier = `${identifier.replace(\n ogPrefix,\n `${ogPrefix}${MEDIA_SEP}${mediaKey}${negKey}${MEDIA_SEP}`\n )}`\n const screenStr = negate ? 'not all' : 'screen'\n const mediaSelector = mediaObjectToString(mediaQueries[mediaKey])\n const mediaQuery = `${screenStr} and ${mediaSelector}`\n const styleInner = rules[0].replace(identifier, nextIdentifier)\n // combines media queries if they already exist\n let styleRule = ''\n if (styleInner.includes('@media')) {\n // combine\n styleRule = styleInner.replace('{', ` and ${mediaQuery} {`)\n } else {\n styleRule = `@media ${mediaQuery} { ${precendencePrefix} ${styleInner} }`\n }\n return {\n styleRule,\n identifier: nextIdentifier,\n }\n}\n"],
|
|
5
|
+
"mappings": ";;AAEA;AAKO,MAAM,YAAY;AAElB,MAAM,mBAAmB,wBAC9B,EAAE,YAAY,SACd,UACA,cACA,QACA,eACG;AACH,QAAM,YAAY,OAAO,KAAK,YAAY;AAC1C,QAAM,cAAc,KAAK,IACvB,GACA,cAAc,SAAY,UAAU,QAAQ,QAAQ,IAAI,cAAc,CACxE;AACA,QAAM,oBAAoB,IAAI,MAAM,cAAc,CAAC,EAAE,KAAK,OAAO,EAAE,KAAK,EAAE;AAC1E,QAAM,SAAS,SAAS,MAAM;AAC9B,QAAM,WAAW,WAAW,MAAM,GAAG,WAAW,QAAQ,GAAG,IAAI,CAAC;AAChE,QAAM,iBAAiB,GAAG,WAAW,QACnC,UACA,GAAG,WAAW,YAAY,WAAW,SAAS,WAChD;AACA,QAAM,YAAY,SAAS,YAAY;AACvC,QAAM,gBAAgB,oBAAoB,aAAa,SAAS;AAChE,QAAM,aAAa,GAAG,iBAAiB;AACvC,QAAM,aAAa,MAAM,GAAG,QAAQ,YAAY,cAAc;AAE9D,MAAI,YAAY;AAChB,MAAI,WAAW,SAAS,QAAQ,GAAG;AAEjC,gBAAY,WAAW,QAAQ,KAAK,QAAQ,cAAc;AAAA,EAC5D,OAAO;AACL,gBAAY,UAAU,gBAAgB,qBAAqB;AAAA,EAC7D;AACA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,EACd;AACF,GAnCgC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
function createShallowUpdate(setter) {
|
|
4
|
+
return (next) => {
|
|
5
|
+
setter((prev) => {
|
|
6
|
+
for (const key in next) {
|
|
7
|
+
if (prev[key] !== next[key]) {
|
|
8
|
+
return { ...prev, ...next };
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return prev;
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
__name(createShallowUpdate, "createShallowUpdate");
|
|
16
|
+
export {
|
|
17
|
+
createShallowUpdate
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=createShallowUpdate.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/createShallowUpdate.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react'\n\nimport { TamaguiComponentState } from '../types'\n\nexport function createShallowUpdate(\n setter: React.Dispatch<React.SetStateAction<TamaguiComponentState>>\n) {\n return (next: Partial<TamaguiComponentState>) => {\n setter((prev) => {\n for (const key in next) {\n if (prev[key] !== next[key]) {\n return { ...prev, ...next }\n }\n }\n return prev\n })\n }\n}\n"],
|
|
5
|
+
"mappings": ";;AAIO,6BACL,QACA;AACA,SAAO,CAAC,SAAyC;AAC/C,WAAO,CAAC,SAAS;AACf,iBAAW,OAAO,MAAM;AACtB,YAAI,KAAK,SAAS,KAAK,MAAM;AAC3B,iBAAO,KAAK,SAAS,KAAK;AAAA,QAC5B;AAAA,MACF;AACA,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AACF;AAbgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -10,7 +10,6 @@ function createTamaguiProvider({
|
|
|
10
10
|
}) {
|
|
11
11
|
return /* @__PURE__ */ __name(function TamaguiProvider({
|
|
12
12
|
injectCSS,
|
|
13
|
-
fallback,
|
|
14
13
|
children,
|
|
15
14
|
...themePropsProvider
|
|
16
15
|
}) {
|
|
@@ -31,9 +30,7 @@ function createTamaguiProvider({
|
|
|
31
30
|
}, /* @__PURE__ */ React.createElement(TextAncestorProvider, null, /* @__PURE__ */ React.createElement(ThemeProvider, {
|
|
32
31
|
...themeProps,
|
|
33
32
|
...themePropsProvider
|
|
34
|
-
},
|
|
35
|
-
fallback: fallback || null
|
|
36
|
-
}, children))));
|
|
33
|
+
}, children)));
|
|
37
34
|
}, "TamaguiProvider");
|
|
38
35
|
}
|
|
39
36
|
__name(createTamaguiProvider, "createTamaguiProvider");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/createTamaguiProvider.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react'\n\nimport { ButtonInsideButtonContext } from '../contexts/ButtonInsideButtonContext'\nimport { TamaguiProviderProps } from '../types'\nimport { TextAncestorProvider } from '../views/TextAncestorContext'\nimport { ThemeProvider, ThemeProviderProps } from '../views/ThemeProvider'\n\nexport function createTamaguiProvider({\n getCSS,\n ...themeProps\n}: ThemeProviderProps & {\n getCSS: () => string\n}) {\n return function TamaguiProvider({\n injectCSS,\n
|
|
5
|
-
"mappings": ";;AAAA;AAEA;AAEA;AACA;AAEO,+BAA+B;AAAA,EACpC;AAAA,KACG;AAAA,GAGF;AACD,SAAO,gDAAyB;AAAA,IAC9B;AAAA,IACA;AAAA,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react'\n\nimport { ButtonInsideButtonContext } from '../contexts/ButtonInsideButtonContext'\nimport { TamaguiProviderProps } from '../types'\nimport { TextAncestorProvider } from '../views/TextAncestorContext'\nimport { ThemeProvider, ThemeProviderProps } from '../views/ThemeProvider'\n\nexport function createTamaguiProvider({\n getCSS,\n ...themeProps\n}: ThemeProviderProps & {\n getCSS: () => string\n}) {\n return function TamaguiProvider({\n injectCSS,\n children,\n ...themePropsProvider\n }: TamaguiProviderProps) {\n // inject CSS if asked to (not SSR compliant)\n if (typeof document !== 'undefined') {\n React.useLayoutEffect(() => {\n if (!injectCSS) return\n const style = document.createElement('style')\n style.appendChild(document.createTextNode(getCSS()))\n document.head.appendChild(style)\n return () => {\n document.head.removeChild(style)\n }\n }, [])\n }\n\n return (\n <ButtonInsideButtonContext.Provider value={false}>\n <TextAncestorProvider>\n <ThemeProvider {...themeProps} {...themePropsProvider}>\n {children}\n </ThemeProvider>\n </TextAncestorProvider>\n </ButtonInsideButtonContext.Provider>\n )\n }\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA;AAEA;AAEA;AACA;AAEO,+BAA+B;AAAA,EACpC;AAAA,KACG;AAAA,GAGF;AACD,SAAO,gDAAyB;AAAA,IAC9B;AAAA,IACA;AAAA,OACG;AAAA,KACoB;AAEvB,QAAI,OAAO,aAAa,aAAa;AACnC,YAAM,gBAAgB,MAAM;AAC1B,YAAI,CAAC;AAAW;AAChB,cAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,cAAM,YAAY,SAAS,eAAe,OAAO,CAAC,CAAC;AACnD,iBAAS,KAAK,YAAY,KAAK;AAC/B,eAAO,MAAM;AACX,mBAAS,KAAK,YAAY,KAAK;AAAA,QACjC;AAAA,MACF,GAAG,CAAC,CAAC;AAAA,IACP;AAEA,WACE,oCAAC,0BAA0B,UAA1B;AAAA,MAAmC,OAAO;AAAA,OACzC,oCAAC,4BACC,oCAAC;AAAA,SAAkB;AAAA,SAAgB;AAAA,OAChC,QACH,CACF,CACF;AAAA,EAEJ,GA3BO;AA4BT;AAlCgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -34,7 +34,6 @@ function normalizeStyleObject(style) {
|
|
|
34
34
|
}
|
|
35
35
|
__name(normalizeStyleObject, "normalizeStyleObject");
|
|
36
36
|
const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state, defaultClassNames) => {
|
|
37
|
-
var _a, _b, _c;
|
|
38
37
|
const validStyleProps = staticConfig.isText ? stylePropsText : validStyles;
|
|
39
38
|
const viewProps = {};
|
|
40
39
|
const style = {};
|
|
@@ -134,9 +133,6 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
134
133
|
pseudos[key] = getSubStyle(val, staticConfig, theme, props, state.resolveVariablesAs, true);
|
|
135
134
|
if (isWeb && !state.noClassNames) {
|
|
136
135
|
const pseudoStyles = getStylesAtomic({ [key]: pseudos[key] });
|
|
137
|
-
if ((_b = (_a = pseudoStyles[0]) == null ? void 0 : _a.identifier) == null ? void 0 : _b.includes("undefined")) {
|
|
138
|
-
console.warn("undefined bug?", (_c = pseudoStyles[0]) == null ? void 0 : _c.identifier);
|
|
139
|
-
}
|
|
140
136
|
for (const style2 of pseudoStyles) {
|
|
141
137
|
mergeClassName(`${style2.property}-${key}`, style2.identifier);
|
|
142
138
|
insertStyleRule(style2.identifier, style2.rules[0]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/getSplitStyles.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n mergeTransform,\n stylePropsText,\n stylePropsTransform,\n validPseudoKeys,\n validStyles,\n} from '@tamagui/helpers'\nimport { ViewStyle } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { ComponentState } from '../defaultComponentState'\nimport { mediaQueryConfig, mediaState } from '../hooks/useMedia'\nimport {\n MediaKeys,\n MediaQueryKey,\n PsuedoPropKeys,\n StackProps,\n StaticConfigParsed,\n ThemeObject,\n} from '../types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { ResolveVariableTypes } from './createPropMapper'\nimport { fixNativeShadow } from './fixNativeShadow'\nimport { ViewStyleWithPseudos, getStylesAtomic } from './getStylesAtomic'\nimport { insertStyleRule, insertedTransforms, updateInserted } from './insertStyleRule'\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\n\nconst skipKeys = {\n // could put events in here\n animation: true,\n animated: true,\n children: true,\n key: true,\n ref: true,\n}\n\nexport type PseudoStyles = {\n hoverStyle?: ViewStyle\n pressStyle?: ViewStyle\n focusStyle?: ViewStyle\n enterStyle?: ViewStyle\n exitStyle?: ViewStyle\n}\n\nexport type ClassNamesObject = Record<string, string>\n\nexport type SplitStyleResult = ReturnType<typeof getSplitStyles>\n\nfunction normalizeStyleObject(style: any) {\n // fix flex to match web\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n if (typeof style.flex === 'number') {\n const val = style.flex\n delete style.flex\n style.flexGrow = style.flexGrow ?? val\n style.flexShrink = style.flexShrink ?? 1\n }\n\n if (!isWeb) {\n fixNativeShadow(style)\n }\n}\n\ntype TransformNamespaceKey = 'transform' | PsuedoPropKeys | MediaQueryKey\n\n// TODO can make a few of these objects lazy if profiling seems slow\n\nexport const getSplitStyles = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n state: Partial<ComponentState> & {\n noClassNames?: boolean\n resolveVariablesAs?: ResolveVariableTypes\n },\n defaultClassNames?: ClassNamesObject | null\n) => {\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: StackProps = {}\n const style: ViewStyle = {}\n const classNames: ClassNamesObject = {\n ...defaultClassNames,\n }\n const pseudos: PseudoStyles = {}\n const medias: Record<MediaKeys, ViewStyle> = {}\n let cur: ViewStyleWithPseudos | null = null\n\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: Record<TransformNamespaceKey, [string, string]> = {}\n\n function mergeClassName(key: string, val: string) {\n if (!val) return\n if (val.startsWith('_transform-')) {\n const isMediaOrPseudo = key !== 'transform'\n const isMedia = isMediaOrPseudo && key[11] === '_'\n const isPsuedo = isMediaOrPseudo && !isMedia\n const namespace: TransformNamespaceKey = isMedia\n ? key.split('_')[2]\n : isPsuedo\n ? key.split('-')[1]\n : 'transform'\n if (!insertedTransforms[val]) {\n // HMR or loaded a new chunk\n updateInserted()\n }\n const transform = insertedTransforms[val]\n // if (!transform) {\n // console.error('NO TRANSFORM', key, val)\n // return\n // }\n transforms[namespace] = transforms[namespace] || ['', '']\n transforms[namespace][0] += val.replace('_transform', '')\n transforms[namespace][1] += transform\n } else {\n classNames[key] = val\n }\n }\n\n function push() {\n if (!cur) return\n normalizeStyleObject(cur)\n if (isWeb && !state.noClassNames) {\n const atomic = getStylesAtomic(cur)\n for (const atomicStyle of atomic) {\n if (!state.noClassNames) {\n mergeClassName(atomicStyle.property, atomicStyle.identifier)\n insertStyleRule(atomicStyle.identifier, atomicStyle.rules[0])\n } else {\n style[atomicStyle.property] = atomicStyle.value\n }\n }\n } else {\n for (const key in cur) {\n if (key in stylePropsTransform) {\n mergeTransform(style, key, cur[key])\n } else {\n style[key] = cur[key]\n }\n }\n }\n // reset it for next group of styles\n cur = null\n }\n\n for (const keyInit in props) {\n const valInit = props[keyInit]\n\n if (skipKeys[keyInit]) {\n viewProps[keyInit] = valInit\n continue\n }\n\n if (\n // isPropClassName\n keyInit === 'className' ||\n // isExtractedClassName\n (validStyleProps[keyInit] && valInit && valInit[0] === '_')\n ) {\n push()\n mergeClassName(keyInit, valInit)\n if (cur) {\n if (cur[keyInit]) console.warn('just want to see how used')\n delete cur[keyInit]\n }\n continue\n }\n\n let isMedia = keyInit[0] === '$'\n let isPseudo = validPseudoKeys[keyInit]\n\n const out =\n isMedia || isPseudo\n ? true\n : staticConfig.propMapper(\n keyInit,\n valInit,\n theme,\n props,\n staticConfig,\n state.resolveVariablesAs\n )\n\n const expanded = out === true || !out ? [[keyInit, valInit]] : Object.entries(out)\n\n for (const [key, val] of expanded) {\n if (val === undefined) {\n continue\n }\n\n if (val && val[0] === '_') {\n mergeClassName(key, val)\n continue\n }\n\n isMedia = key[0] === '$'\n isPseudo = validPseudoKeys[key]\n\n if (\n (staticConfig.deoptProps && staticConfig.deoptProps.has(key)) ||\n (staticConfig.inlineProps && staticConfig.inlineProps.has(key))\n ) {\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.resolveVariablesAs, true)\n if (isWeb && !state.noClassNames) {\n const pseudoStyles = getStylesAtomic({ [key]: pseudos[key] })\n if (pseudoStyles[0]?.identifier?.includes('undefined')) {\n console.warn('undefined bug?', pseudoStyles[0]?.identifier)\n }\n for (const style of pseudoStyles) {\n mergeClassName(`${style.property}-${key}`, style.identifier)\n insertStyleRule(style.identifier, style.rules[0])\n }\n }\n continue\n }\n\n // media\n if (isMedia) {\n const mediaKey = key.slice(1)\n\n if (!mediaQueryConfig[mediaKey]) {\n // this isn't a media key, pass through\n viewProps[key] = valInit\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(\n valInit,\n staticConfig,\n theme,\n props,\n state.resolveVariablesAs,\n true\n )\n\n if (isWeb) {\n const mediaStyles = getStylesAtomic(mediaStyle)\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKey, mediaQueryConfig)\n mergeClassName(`${out.identifier}-${mediaKey}`, out.identifier)\n insertStyleRule(out.identifier, out.styleRule)\n }\n if (mediaState[mediaKey]) {\n Object.assign(medias, mediaStyle)\n }\n } else {\n if (mediaState[mediaKey]) {\n // TODO i think media + pseudo needs handling here\n Object.assign(style, mediaStyle)\n }\n }\n continue\n }\n\n // TODO\n if (key === 'style' || key.startsWith('_style')) {\n push()\n Object.assign(style, val)\n continue\n }\n\n if (!isWeb && key === 'pointerEvents') {\n viewProps[key] = val\n continue\n }\n\n if (validStyleProps[key]) {\n cur = cur || {}\n cur[key] = val\n continue\n }\n\n // pass to view props\n if (!staticConfig.variants || !(key in staticConfig.variants)) {\n if (key !== 'animation' && key !== 'debug') {\n push()\n viewProps[key] = val\n }\n }\n }\n }\n\n push()\n\n if (transforms) {\n for (const namespace in transforms) {\n const [hash, val] = transforms[namespace]\n const identifier = `_transform${hash}`\n if (!insertedTransforms[identifier]) {\n const rule = `.${identifier} { transform: ${val}; }`\n insertStyleRule(identifier, rule)\n }\n classNames[namespace] = identifier\n }\n }\n\n return {\n viewProps,\n style,\n medias,\n pseudos,\n classNames,\n }\n}\n\nconst getSubStyle = (\n styleIn: Object,\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n props: any,\n resolveVariablesAs?: ResolveVariableTypes,\n avoidDefaultProps?: boolean\n): ViewStyle => {\n const styleOut: ViewStyle = {}\n for (const key in styleIn) {\n const val = styleIn[key]\n const out = staticConfig.propMapper(\n key,\n val,\n theme,\n props,\n staticConfig,\n resolveVariablesAs,\n avoidDefaultProps\n )\n const expanded = out === true || !out ? [[key, val]] : Object.entries(out)\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 normalizeStyleObject(styleOut)\n return styleOut\n}\n"],
|
|
5
|
-
"mappings": ";;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AAEA;AASA;AAEA;AACA;AACA;AAIA,MAAM,WAAW;AAAA,EAEf,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAAA,EACV,KAAK;AAAA,EACL,KAAK;AACP;AAcA,8BAA8B,OAAY;AAjD1C;AAoDE,MAAI,OAAO,MAAM,SAAS,UAAU;AAClC,UAAM,MAAM,MAAM;AAClB,WAAO,MAAM;AACb,UAAM,WAAW,YAAM,aAAN,YAAkB;AACnC,UAAM,aAAa,YAAM,eAAN,YAAoB;AAAA,EACzC;AAEA,MAAI,CAAC,OAAO;AACV,oBAAgB,KAAK;AAAA,EACvB;AACF;AAbS;AAmBF,MAAM,iBAAiB,wBAC5B,OACA,cACA,OACA,OAIA,sBACG;
|
|
4
|
+
"sourcesContent": ["import {\n mergeTransform,\n stylePropsText,\n stylePropsTransform,\n validPseudoKeys,\n validStyles,\n} from '@tamagui/helpers'\nimport { ViewStyle } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { ComponentState } from '../defaultComponentState'\nimport { mediaQueryConfig, mediaState } from '../hooks/useMedia'\nimport {\n MediaKeys,\n MediaQueryKey,\n PsuedoPropKeys,\n StackProps,\n StaticConfigParsed,\n ThemeObject,\n} from '../types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { ResolveVariableTypes } from './createPropMapper'\nimport { fixNativeShadow } from './fixNativeShadow'\nimport { ViewStyleWithPseudos, getStylesAtomic } from './getStylesAtomic'\nimport { insertStyleRule, insertedTransforms, updateInserted } from './insertStyleRule'\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\n\nconst skipKeys = {\n // could put events in here\n animation: true,\n animated: true,\n children: true,\n key: true,\n ref: true,\n}\n\nexport type PseudoStyles = {\n hoverStyle?: ViewStyle\n pressStyle?: ViewStyle\n focusStyle?: ViewStyle\n enterStyle?: ViewStyle\n exitStyle?: ViewStyle\n}\n\nexport type ClassNamesObject = Record<string, string>\n\nexport type SplitStyleResult = ReturnType<typeof getSplitStyles>\n\nfunction normalizeStyleObject(style: any) {\n // fix flex to match web\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n if (typeof style.flex === 'number') {\n const val = style.flex\n delete style.flex\n style.flexGrow = style.flexGrow ?? val\n style.flexShrink = style.flexShrink ?? 1\n }\n\n if (!isWeb) {\n fixNativeShadow(style)\n }\n}\n\ntype TransformNamespaceKey = 'transform' | PsuedoPropKeys | MediaQueryKey\n\n// TODO can make a few of these objects lazy if profiling seems slow\n\nexport const getSplitStyles = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n state: Partial<ComponentState> & {\n noClassNames?: boolean\n resolveVariablesAs?: ResolveVariableTypes\n },\n defaultClassNames?: ClassNamesObject | null\n) => {\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: StackProps = {}\n const style: ViewStyle = {}\n const classNames: ClassNamesObject = {\n ...defaultClassNames,\n }\n const pseudos: PseudoStyles = {}\n const medias: Record<MediaKeys, ViewStyle> = {}\n let cur: ViewStyleWithPseudos | null = null\n\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: Record<TransformNamespaceKey, [string, string]> = {}\n\n function mergeClassName(key: string, val: string) {\n if (!val) return\n if (val.startsWith('_transform-')) {\n const isMediaOrPseudo = key !== 'transform'\n const isMedia = isMediaOrPseudo && key[11] === '_'\n const isPsuedo = isMediaOrPseudo && !isMedia\n const namespace: TransformNamespaceKey = isMedia\n ? key.split('_')[2]\n : isPsuedo\n ? key.split('-')[1]\n : 'transform'\n if (!insertedTransforms[val]) {\n // HMR or loaded a new chunk\n updateInserted()\n }\n const transform = insertedTransforms[val]\n // if (!transform) {\n // console.error('NO TRANSFORM', key, val)\n // return\n // }\n transforms[namespace] = transforms[namespace] || ['', '']\n transforms[namespace][0] += val.replace('_transform', '')\n transforms[namespace][1] += transform\n } else {\n classNames[key] = val\n }\n }\n\n function push() {\n if (!cur) return\n normalizeStyleObject(cur)\n if (isWeb && !state.noClassNames) {\n const atomic = getStylesAtomic(cur)\n for (const atomicStyle of atomic) {\n if (!state.noClassNames) {\n mergeClassName(atomicStyle.property, atomicStyle.identifier)\n insertStyleRule(atomicStyle.identifier, atomicStyle.rules[0])\n } else {\n style[atomicStyle.property] = atomicStyle.value\n }\n }\n } else {\n for (const key in cur) {\n if (key in stylePropsTransform) {\n mergeTransform(style, key, cur[key])\n } else {\n style[key] = cur[key]\n }\n }\n }\n // reset it for next group of styles\n cur = null\n }\n\n for (const keyInit in props) {\n const valInit = props[keyInit]\n\n if (skipKeys[keyInit]) {\n viewProps[keyInit] = valInit\n continue\n }\n\n if (\n // isPropClassName\n keyInit === 'className' ||\n // isExtractedClassName\n (validStyleProps[keyInit] && valInit && valInit[0] === '_')\n ) {\n push()\n mergeClassName(keyInit, valInit)\n if (cur) {\n if (cur[keyInit]) console.warn('just want to see how used')\n delete cur[keyInit]\n }\n continue\n }\n\n let isMedia = keyInit[0] === '$'\n let isPseudo = validPseudoKeys[keyInit]\n\n const out =\n isMedia || isPseudo\n ? true\n : staticConfig.propMapper(\n keyInit,\n valInit,\n theme,\n props,\n staticConfig,\n state.resolveVariablesAs\n )\n\n const expanded = out === true || !out ? [[keyInit, valInit]] : Object.entries(out)\n\n for (const [key, val] of expanded) {\n if (val === undefined) {\n continue\n }\n\n if (val && val[0] === '_') {\n mergeClassName(key, val)\n continue\n }\n\n isMedia = key[0] === '$'\n isPseudo = validPseudoKeys[key]\n\n if (\n (staticConfig.deoptProps && staticConfig.deoptProps.has(key)) ||\n (staticConfig.inlineProps && staticConfig.inlineProps.has(key))\n ) {\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.resolveVariablesAs, true)\n if (isWeb && !state.noClassNames) {\n const pseudoStyles = getStylesAtomic({ [key]: pseudos[key] })\n for (const style of pseudoStyles) {\n mergeClassName(`${style.property}-${key}`, style.identifier)\n insertStyleRule(style.identifier, style.rules[0])\n }\n }\n continue\n }\n\n // media\n if (isMedia) {\n const mediaKey = key.slice(1)\n\n if (!mediaQueryConfig[mediaKey]) {\n // this isn't a media key, pass through\n viewProps[key] = valInit\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(\n valInit,\n staticConfig,\n theme,\n props,\n state.resolveVariablesAs,\n true\n )\n\n if (isWeb) {\n const mediaStyles = getStylesAtomic(mediaStyle)\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKey, mediaQueryConfig)\n mergeClassName(`${out.identifier}-${mediaKey}`, out.identifier)\n insertStyleRule(out.identifier, out.styleRule)\n }\n if (mediaState[mediaKey]) {\n Object.assign(medias, mediaStyle)\n }\n } else {\n if (mediaState[mediaKey]) {\n // TODO i think media + pseudo needs handling here\n Object.assign(style, mediaStyle)\n }\n }\n continue\n }\n\n // TODO\n if (key === 'style' || key.startsWith('_style')) {\n push()\n Object.assign(style, val)\n continue\n }\n\n if (!isWeb && key === 'pointerEvents') {\n viewProps[key] = val\n continue\n }\n\n if (validStyleProps[key]) {\n cur = cur || {}\n cur[key] = val\n continue\n }\n\n // pass to view props\n if (!staticConfig.variants || !(key in staticConfig.variants)) {\n if (key !== 'animation' && key !== 'debug') {\n push()\n viewProps[key] = val\n }\n }\n }\n }\n\n push()\n\n if (transforms) {\n for (const namespace in transforms) {\n const [hash, val] = transforms[namespace]\n const identifier = `_transform${hash}`\n if (!insertedTransforms[identifier]) {\n const rule = `.${identifier} { transform: ${val}; }`\n insertStyleRule(identifier, rule)\n }\n classNames[namespace] = identifier\n }\n }\n\n return {\n viewProps,\n style,\n medias,\n pseudos,\n classNames,\n }\n}\n\nconst getSubStyle = (\n styleIn: Object,\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n props: any,\n resolveVariablesAs?: ResolveVariableTypes,\n avoidDefaultProps?: boolean\n): ViewStyle => {\n const styleOut: ViewStyle = {}\n for (const key in styleIn) {\n const val = styleIn[key]\n const out = staticConfig.propMapper(\n key,\n val,\n theme,\n props,\n staticConfig,\n resolveVariablesAs,\n avoidDefaultProps\n )\n const expanded = out === true || !out ? [[key, val]] : Object.entries(out)\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 normalizeStyleObject(styleOut)\n return styleOut\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AAEA;AASA;AAEA;AACA;AACA;AAIA,MAAM,WAAW;AAAA,EAEf,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAAA,EACV,KAAK;AAAA,EACL,KAAK;AACP;AAcA,8BAA8B,OAAY;AAjD1C;AAoDE,MAAI,OAAO,MAAM,SAAS,UAAU;AAClC,UAAM,MAAM,MAAM;AAClB,WAAO,MAAM;AACb,UAAM,WAAW,YAAM,aAAN,YAAkB;AACnC,UAAM,aAAa,YAAM,eAAN,YAAoB;AAAA,EACzC;AAEA,MAAI,CAAC,OAAO;AACV,oBAAgB,KAAK;AAAA,EACvB;AACF;AAbS;AAmBF,MAAM,iBAAiB,wBAC5B,OACA,cACA,OACA,OAIA,sBACG;AACH,QAAM,kBAAkB,aAAa,SAAS,iBAAiB;AAC/D,QAAM,YAAwB,CAAC;AAC/B,QAAM,QAAmB,CAAC;AAC1B,QAAM,aAA+B;AAAA,OAChC;AAAA,EACL;AACA,QAAM,UAAwB,CAAC;AAC/B,QAAM,SAAuC,CAAC;AAC9C,MAAI,MAAmC;AAIvC,MAAI,aAA8D,CAAC;AAEnE,0BAAwB,KAAa,KAAa;AAChD,QAAI,CAAC;AAAK;AACV,QAAI,IAAI,WAAW,aAAa,GAAG;AACjC,YAAM,kBAAkB,QAAQ;AAChC,YAAM,UAAU,mBAAmB,IAAI,QAAQ;AAC/C,YAAM,WAAW,mBAAmB,CAAC;AACrC,YAAM,YAAmC,UACrC,IAAI,MAAM,GAAG,EAAE,KACf,WACA,IAAI,MAAM,GAAG,EAAE,KACf;AACJ,UAAI,CAAC,mBAAmB,MAAM;AAE5B,uBAAe;AAAA,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