@tamagui/core 1.0.1-beta.51 → 1.0.1-beta.54
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 +15 -10
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createVariables.js +0 -1
- package/dist/cjs/createVariables.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +7 -10
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/validate.js +4 -4
- package/dist/cjs/helpers/validate.js.map +2 -2
- package/dist/cjs/hooks/useId.js +5 -3
- package/dist/cjs/hooks/useId.js.map +2 -2
- package/dist/cjs/views/Slot.js +12 -6
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/esm/createComponent.js +22 -12
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createVariables.js +0 -1
- package/dist/esm/createVariables.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +7 -10
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/validate.js +4 -4
- package/dist/esm/helpers/validate.js.map +2 -2
- package/dist/esm/hooks/useId.js +6 -4
- package/dist/esm/hooks/useId.js.map +2 -2
- package/dist/esm/views/Slot.js +10 -5
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/jsx/createComponent.js +19 -8
- package/dist/jsx/createVariables.js +0 -1
- package/dist/jsx/helpers/getSplitStyles.js +7 -10
- package/dist/jsx/helpers/validate.js +4 -4
- package/dist/jsx/hooks/useId.js +6 -4
- package/dist/jsx/views/Slot.js +10 -5
- package/package.json +5 -5
- package/types/createComponent.d.ts.map +1 -1
- package/types/createVariables.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/hooks/useId.d.ts.map +1 -1
- package/types/views/Slot.d.ts +1 -0
- package/types/views/Slot.d.ts.map +1 -1
- package/dist/cjs/helpers/nativeGestureHandler.js +0 -29
- package/dist/cjs/helpers/nativeGestureHandler.js.map +0 -7
- package/dist/cjs/nativeGestureHandler.native.js +0 -18
- package/dist/cjs/nativeGestureHandler.native.js.map +0 -7
- package/dist/esm/helpers/nativeGestureHandler.js +0 -7
- package/dist/esm/helpers/nativeGestureHandler.js.map +0 -7
- package/dist/esm/nativeGestureHandler.native.js +0 -2
- package/dist/esm/nativeGestureHandler.native.js.map +0 -7
- package/dist/jsx/helpers/nativeGestureHandler.js +0 -6
- package/dist/jsx/nativeGestureHandler.native.js +0 -1
- package/types/helpers/nativeGestureHandler.d.ts +0 -2
- package/types/helpers/nativeGestureHandler.d.ts.map +0 -1
- package/types/nativeGestureHandler.native.d.ts +0 -2
- package/types/nativeGestureHandler.native.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/getSplitStyles.tsx"],
|
|
4
|
-
"sourcesContent": ["import { stylePropsText, stylePropsTransform, validPseudoKeys, validStyles } from '@tamagui/helpers'\n// @ts-ignore\nimport { useInsertionEffect } from 'react'\nimport { ViewStyle } from 'react-native'\n\nimport { getConfig } from '../conf'\nimport { isClient, isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\nimport { mediaQueryConfig, mediaState } from '../hooks/useMedia'\nimport {\n MediaKeys,\n MediaQueryKey,\n PseudoStyles,\n PsuedoPropKeys,\n SplitStyleState,\n StackProps,\n StaticConfigParsed,\n TamaguiInternalConfig,\n ThemeObject,\n} from '../types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { fixNativeShadow } from './fixNativeShadow'\nimport { ViewStyleWithPseudos, getStylesAtomic, psuedoCNInverse } from './getStylesAtomic'\nimport {\n insertStyleRule,\n insertedTransforms,\n updateInserted,\n updateInsertedCache,\n} from './insertStyleRule'\nimport { mergeTransform } from './mergeTransform'\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\nexport type ClassNamesObject = Record<string, string>\nexport type SplitStyleResult = ReturnType<typeof getSplitStyles>\n\nconst skipProps = {\n animation: true,\n animateOnly: true,\n debug: true,\n componentName: true,\n\n ...(!isWeb && {\n tag: true,\n whiteSpace: true,\n wordWrap: true,\n textOverflow: true,\n textDecorationDistance: true,\n userSelect: true,\n selectable: true,\n cursor: true,\n contain: true,\n pointerEvents: true,\n boxSizing: true,\n boxShadow: true,\n }),\n}\n\ntype TransformNamespaceKey = 'transform' | PsuedoPropKeys | MediaQueryKey\n\nlet conf: TamaguiInternalConfig\n\ntype StyleSplitter = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n state: SplitStyleState & {\n keepVariantsAsProps?: boolean\n },\n defaultClassNames?: any\n) => {\n pseudos: PseudoStyles\n medias: Record<MediaKeys, ViewStyle>\n style: ViewStyle\n classNames: ClassNamesObject\n rulesToInsert: [string, string][]\n viewProps: StackProps\n}\n\n// loop props backwards\n// track used keys:\n// const keys = new Set<string>()\n// keep classnames and styles separate:\n// const styles = {}\n// const classNames = {}\n\nexport const getSplitStyles: StyleSplitter = (\n props,\n staticConfig,\n theme,\n state,\n defaultClassNames\n) => {\n conf = conf || getConfig()\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: StackProps = {}\n const pseudos: PseudoStyles = {}\n const medias: Record<MediaKeys, ViewStyle> = {}\n\n let style: ViewStyle = {}\n let classNames: ClassNamesObject = {}\n\n const usedKeys = new Set<string>()\n\n const rulesToInsert: [string, string][] = []\n function addStyle(prop: string, rule: string) {\n rulesToInsert.push([prop, rule])\n updateInsertedCache(prop, rule)\n }\n\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, isMediaOrPseudo = false) {\n if (!val) {\n // empty classnames passed by compiler sometimes\n return\n }\n if (val.startsWith('_transform-')) {\n // const isMediaOrPseudo = key !== 'transform'\n // const isMedia = isMediaOrPseudo && key[11] === '_'\n // const isPsuedo = (isMediaOrPseudo && key[11] === '0') || key.endsWith('Style')\n const namespace: TransformNamespaceKey = isMediaOrPseudo ? key : 'transform'\n\n let transform = insertedTransforms[val]\n if (isClient) {\n if (!transform) {\n // HMR or loaded a new chunk\n updateInserted()\n transform = insertedTransforms[val]\n }\n if (!transform) {\n if (isWeb && val[0] !== '_') {\n // runtime insert\n transform = val\n } else {\n if (process.env.NODE_ENV === 'development') {\n // error\n console.trace('?', key, val, cur, props, state)\n }\n }\n }\n if (process.env.NODE_ENV === 'development' && props['debug'] === 'verbose') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles mergeClassName transform', { key, val, namespace, transform, insertedTransforms })\n }\n }\n transforms[namespace] = transforms[namespace] || ['', '']\n const identifier = val.replace('_transform', '')\n transforms[namespace][0] += identifier\n // ssr doesn't need to do anything just make the right classname\n if (transform) {\n transforms[namespace][1] += transform\n }\n } else {\n classNames[key] = val\n }\n }\n\n const propKeys = Object.keys(props)\n\n for (let i = propKeys.length - 1; i >= 0; i--) {\n const keyInit = propKeys[i]\n\n if (usedKeys.has(keyInit)) continue\n if (skipProps[keyInit]) continue\n if (!isWeb && keyInit.startsWith('data-')) continue\n\n const valInit = props[keyInit]\n\n if (keyInit === 'style' || keyInit.startsWith('_style')) {\n if (!valInit) continue\n for (const key in valInit) {\n if (usedKeys.has(key)) continue\n if (valInit && typeof valInit === 'object') {\n // newer react native versions return a full object instead of ID\n for (const skey in valInit) {\n if (usedKeys.has(skey)) continue\n usedKeys.add(skey)\n style[skey] = valInit[skey]\n }\n } else {\n usedKeys.add(key)\n style[key] = valInit\n }\n }\n continue\n }\n\n if (keyInit === 'className') {\n let nonTamaguis = ''\n if (!valInit) {\n continue\n }\n for (const cn of valInit.split(' ')) {\n if (cn[0] === '_') {\n // tamagui, merge it expanded on key, eventually this will go away with better compiler\n const [shorthand, mediaOrPsuedo] = cn.slice(1).split('-')\n const isMedia = mediaOrPsuedo[0] === '_'\n const isPseudo = mediaOrPsuedo[0] === '0'\n const isMediaOrPseudo = isMedia || isPseudo\n let fullKey = conf.shorthands[shorthand]\n if (isMedia) {\n // is media\n let mediaShortKey = mediaOrPsuedo.slice(1)\n mediaShortKey = mediaShortKey.slice(0, mediaShortKey.indexOf('_'))\n fullKey += `-${mediaShortKey}`\n } else if (isPseudo) {\n // is psuedo\n const pseudoShortKey = mediaOrPsuedo.slice(1)\n fullKey += `-${psuedoCNInverse[pseudoShortKey]}`\n }\n usedKeys.add(fullKey)\n mergeClassName(fullKey, cn, isMediaOrPseudo)\n } else {\n nonTamaguis += ' ' + cn\n }\n }\n if (nonTamaguis) {\n mergeClassName(keyInit, nonTamaguis)\n }\n continue\n }\n\n if (validStyleProps[keyInit] && valInit && valInit[0] === '_') {\n usedKeys.add(keyInit)\n mergeClassName(keyInit, valInit)\n continue\n }\n\n if (\n state.keepVariantsAsProps &&\n staticConfig.defaultVariants &&\n keyInit in staticConfig.defaultVariants\n ) {\n viewProps[keyInit] = valInit\n }\n\n let isMedia = keyInit[0] === '$'\n let isPseudo = validPseudoKeys[keyInit]\n\n if (\n !isMedia &&\n !isPseudo &&\n !staticConfig.variants?.[keyInit] &&\n !validStyleProps[keyInit] &&\n !conf.shorthands[keyInit]\n ) {\n usedKeys.add(keyInit)\n viewProps[keyInit] = valInit\n continue\n }\n\n const expanded =\n isMedia || isPseudo\n ? [[keyInit, valInit]]\n : staticConfig.propMapper(keyInit, valInit, theme, props, state)\n\n let isMediaOrPseudo = isMedia || isPseudo\n\n if (process.env.NODE_ENV === 'development' && props['debug'] === 'verbose') {\n console.log(' \u00BB getSplitStyles', keyInit, expanded)\n }\n\n if (!expanded) {\n continue\n }\n\n for (const [key, val] of expanded) {\n if (val === undefined) continue\n if (usedKeys.has(key)) continue\n\n if (key !== 'target' && val && val[0] === '_') {\n usedKeys.add(key)\n mergeClassName(key, val, isMediaOrPseudo)\n continue\n }\n\n isMedia = key[0] === '$'\n isPseudo = validPseudoKeys[key]\n isMediaOrPseudo = isMedia || isPseudo\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, true)\n if (isWeb && !state.noClassNames) {\n const pseudoStyles = getStylesAtomic({ [key]: pseudos[key] })\n for (const style of pseudoStyles) {\n const fullKey = `${style.property}-${key}`\n if (!usedKeys.has(fullKey)) {\n usedKeys.add(fullKey)\n addStyle(style.identifier, style.rules[0])\n mergeClassName(fullKey, style.identifier, isMediaOrPseudo)\n }\n }\n }\n continue\n }\n\n // media\n if (isMedia) {\n const mediaKey = key\n const mediaKeyShort = mediaKey.slice(1)\n\n if (!mediaQueryConfig[mediaKeyShort]) {\n // this isn't a media key, pass through\n viewProps[key] = val\n continue\n }\n\n // dont check if media is active, we just apply *all* media styles\n // we combine the media props on top regular props, could proxy this\n // TODO test proxy here instead of merge\n // THIS USED TO PROXY BACK TO REGULAR PROPS BUT THAT IS THE WRONG BEHAVIOR\n // we avoid passing in default props for media queries because that would confuse things like SizableText.size:\n const mediaStyle = getSubStyle(val, staticConfig, theme, props, state)\n const shouldDoClasses = isWeb && !state.noClassNames\n\n if (process.env.NODE_ENV === 'development' && props['debug'] === 'verbose') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles mediaStyle', { mediaKey, mediaStyle, props, shouldDoClasses })\n }\n\n if (shouldDoClasses) {\n const mediaStyles = getStylesAtomic(mediaStyle)\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKeyShort, mediaQueryConfig)\n // TODO handle psuedo + media, not too hard just need to set up example case\n const fullKey = `${style.property}-${mediaKeyShort}`\n if (!usedKeys.has(fullKey)) {\n usedKeys.add(fullKey)\n addStyle(out.identifier, out.styleRule)\n mergeClassName(fullKey, out.identifier, true)\n }\n }\n } else {\n if (mediaState[mediaKey]) {\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n console.log('apply media style', mediaKey, mediaState)\n }\n Object.assign(shouldDoClasses ? medias : style, mediaStyle)\n }\n }\n continue\n }\n\n if (!isWeb && key === 'pointerEvents') {\n usedKeys.add(key)\n viewProps[key] = val\n continue\n }\n\n if (validStyleProps[key]) {\n usedKeys.add(key)\n if (val && val[0] === '_') {\n classNames[key] = val\n } else {\n // const avoidMergeTransform =\n // !isWeb ||\n // state.noClassNames ||\n // state.resolveVariablesAs === 'value' ||\n // state.resolveVariablesAs === 'both'\n if (key in stylePropsTransform) {\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n console.log('mergeTransform', key, val)\n }\n mergeTransform(style, key, val, true)\n } else {\n style[key] = val\n }\n }\n\n continue\n }\n\n // pass to view props\n if (!staticConfig.variants || !(key in staticConfig.variants)) {\n if (!skipProps[key]) {\n // push()\n viewProps[key] = val\n usedKeys.add(key)\n }\n }\n }\n }\n\n // add in defaults if not set:\n if (defaultClassNames) {\n classNames = {\n ...defaultClassNames,\n ...classNames,\n }\n }\n\n if (isWeb && !state.noClassNames) {\n const atomic = getStylesAtomic(style)\n for (const atomicStyle of atomic) {\n const key = atomicStyle.property\n if (!state.dynamicStylesInline) {\n addStyle(atomicStyle.identifier, atomicStyle.rules[0])\n mergeClassName(key, atomicStyle.identifier)\n } else {\n style[key] = atomicStyle.value\n }\n }\n }\n\n if (transforms) {\n for (const namespace in transforms) {\n const [hash, val] = transforms[namespace]\n const identifier = `_transform${hash}`\n if (isClient) {\n if (!insertedTransforms[identifier]) {\n const rule = `.${identifier} { transform: ${val}; }`\n addStyle(identifier, rule)\n }\n }\n classNames[namespace] = identifier\n }\n }\n\n if (process.env.NODE_ENV === 'development' && props['debug'] === 'verbose') {\n if (typeof document !== 'undefined') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles out', { style, pseudos, medias, classNames, viewProps, state })\n }\n }\n\n return {\n viewProps,\n style,\n medias,\n pseudos,\n classNames,\n rulesToInsert,\n }\n}\n\nexport const insertSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n for (const [prop, rule] of res.rulesToInsert) {\n insertStyleRule(prop, rule)\n }\n return res\n}\n\nconst effect = isWeb ? useInsertionEffect || useIsomorphicLayoutEffect : useIsomorphicLayoutEffect\n\nexport const useSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n effect(() => {\n for (const [prop, rule] of res.rulesToInsert) {\n insertStyleRule(prop, rule)\n }\n })\n return res\n}\n\nexport const getSubStyle = (\n styleIn: Object,\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n props: any,\n state: SplitStyleState,\n avoidDefaultProps?: boolean\n): ViewStyle => {\n const styleOut: ViewStyle = {}\n for (const key in styleIn) {\n const val = styleIn[key]\n const expanded = staticConfig.propMapper(key, val, theme, props, state, avoidDefaultProps)\n if (!expanded) continue\n for (const [skey, sval] of expanded) {\n if (skey in stylePropsTransform) {\n mergeTransform(styleOut, skey, sval)\n } else {\n styleOut[skey] = sval\n }\n }\n }\n return styleOut\n}\n\nexport function normalizeStyleObject(style: any) {\n if (!isWeb) {\n fixNativeShadow(style)\n }\n}\n"],
|
|
5
|
-
"mappings": ";;AAAA;AAEA;AAGA;AACA;AACA;AAYA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAMA,MAAM,YAAY;AAAA,EAChB,WAAW;AAAA,EACX,aAAa;AAAA,EACb,OAAO;AAAA,EACP,eAAe;AAAA,EAEf,GAAI,CAAC,SAAS;AAAA,IACZ,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,cAAc;AAAA,IACd,wBAAwB;AAAA,IACxB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,eAAe;AAAA,IACf,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF;AAIA,IAAI;AA0BG,MAAM,iBAAgC,wBAC3C,OACA,cACA,OACA,OACA,sBACG;AA1FL;AA2FE,SAAO,QAAQ,UAAU;AACzB,QAAM,kBAAkB,aAAa,SAAS,iBAAiB;AAC/D,QAAM,YAAwB,CAAC;AAC/B,QAAM,UAAwB,CAAC;AAC/B,QAAM,SAAuC,CAAC;
|
|
4
|
+
"sourcesContent": ["import { stylePropsText, stylePropsTransform, validPseudoKeys, validStyles } from '@tamagui/helpers'\n// @ts-ignore\nimport { useInsertionEffect } from 'react'\nimport { ViewStyle } from 'react-native'\n\nimport { getConfig } from '../conf'\nimport { isClient, isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\nimport { mediaQueryConfig, mediaState } from '../hooks/useMedia'\nimport {\n MediaKeys,\n MediaQueryKey,\n PseudoStyles,\n PsuedoPropKeys,\n SplitStyleState,\n StackProps,\n StaticConfigParsed,\n TamaguiInternalConfig,\n ThemeObject,\n} from '../types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { fixNativeShadow } from './fixNativeShadow'\nimport { getStylesAtomic, psuedoCNInverse } from './getStylesAtomic'\nimport {\n insertStyleRule,\n insertedTransforms,\n updateInserted,\n updateInsertedCache,\n} from './insertStyleRule'\nimport { mergeTransform } from './mergeTransform'\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\nexport type ClassNamesObject = Record<string, string>\nexport type SplitStyleResult = ReturnType<typeof getSplitStyles>\n\nconst skipProps = {\n animation: true,\n animateOnly: true,\n debug: true,\n componentName: true,\n\n ...(!isWeb && {\n tag: true,\n whiteSpace: true,\n wordWrap: true,\n textOverflow: true,\n textDecorationDistance: true,\n userSelect: true,\n selectable: true,\n cursor: true,\n contain: true,\n pointerEvents: true,\n boxSizing: true,\n boxShadow: true,\n }),\n}\n\ntype TransformNamespaceKey = 'transform' | PsuedoPropKeys | MediaQueryKey\n\nlet conf: TamaguiInternalConfig\n\ntype StyleSplitter = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n state: SplitStyleState & {\n keepVariantsAsProps?: boolean\n },\n defaultClassNames?: any\n) => {\n pseudos: PseudoStyles\n medias: Record<MediaKeys, ViewStyle>\n style: ViewStyle\n classNames: ClassNamesObject\n rulesToInsert: [string, string][]\n viewProps: StackProps\n}\n\n// loop props backwards\n// track used keys:\n// const keys = new Set<string>()\n// keep classnames and styles separate:\n// const styles = {}\n// const classNames = {}\n\nexport const getSplitStyles: StyleSplitter = (\n props,\n staticConfig,\n theme,\n state,\n defaultClassNames\n) => {\n conf = conf || getConfig()\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: StackProps = {}\n const pseudos: PseudoStyles = {}\n const medias: Record<MediaKeys, ViewStyle> = {}\n const usedKeys = new Set<string>()\n\n let style: ViewStyle = {}\n let classNames: ClassNamesObject = {}\n // we need to gather these specific to each media query / pseudo\n // value is [hash, val], so [\"-jnjad-asdnjk\", \"scaleX(1) rotate(10deg)\"]\n let transforms: Record<TransformNamespaceKey, [string, string]> = {}\n\n const rulesToInsert: [string, string][] = []\n function addStyle(prop: string, rule: string) {\n rulesToInsert.push([prop, rule])\n updateInsertedCache(prop, rule)\n }\n\n function mergeClassName(key: string, val: string, isMediaOrPseudo = false) {\n // empty classnames passed by compiler sometimes\n if (!val) return\n if (val.startsWith('_transform-')) {\n // const isMediaOrPseudo = key !== 'transform'\n // const isMedia = isMediaOrPseudo && key[11] === '_'\n // const isPsuedo = (isMediaOrPseudo && key[11] === '0') || key.endsWith('Style')\n const namespace: TransformNamespaceKey = isMediaOrPseudo ? key : 'transform'\n\n let transform = insertedTransforms[val]\n if (isClient) {\n if (!transform) {\n // HMR or loaded a new chunk\n updateInserted()\n transform = insertedTransforms[val]\n }\n if (!transform) {\n if (isWeb && val[0] !== '_') {\n // runtime insert\n transform = val\n } else {\n // shouldn't reach\n }\n }\n if (process.env.NODE_ENV === 'development' && props['debug'] === 'verbose') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles mergeClassName transform', { key, val, namespace, transform, insertedTransforms })\n }\n }\n transforms[namespace] = transforms[namespace] || ['', '']\n const identifier = val.replace('_transform', '')\n transforms[namespace][0] += identifier\n // ssr doesn't need to do anything just make the right classname\n if (transform) {\n transforms[namespace][1] += transform\n }\n } else {\n classNames[key] = val\n }\n }\n\n const propKeys = Object.keys(props)\n\n for (let i = propKeys.length - 1; i >= 0; i--) {\n const keyInit = propKeys[i]\n if (usedKeys.has(keyInit)) continue\n if (skipProps[keyInit]) continue\n if (!isWeb && keyInit.startsWith('data-')) continue\n\n const valInit = props[keyInit]\n\n if (keyInit === 'style' || keyInit.startsWith('_style')) {\n if (!valInit) continue\n for (const key in valInit) {\n if (usedKeys.has(key)) continue\n if (valInit && typeof valInit === 'object') {\n // newer react native versions return a full object instead of ID\n for (const skey in valInit) {\n if (usedKeys.has(skey)) continue\n usedKeys.add(skey)\n style[skey] = valInit[skey]\n }\n } else {\n usedKeys.add(key)\n style[key] = valInit\n }\n }\n continue\n }\n\n if (keyInit === 'className') {\n let nonTamaguis = ''\n if (!valInit) {\n continue\n }\n for (const cn of valInit.split(' ')) {\n if (cn[0] === '_') {\n // tamagui, merge it expanded on key, eventually this will go away with better compiler\n const [shorthand, mediaOrPsuedo] = cn.slice(1).split('-')\n const isMedia = mediaOrPsuedo[0] === '_'\n const isPseudo = mediaOrPsuedo[0] === '0'\n const isMediaOrPseudo = isMedia || isPseudo\n let fullKey = conf.shorthands[shorthand]\n if (isMedia) {\n // is media\n let mediaShortKey = mediaOrPsuedo.slice(1)\n mediaShortKey = mediaShortKey.slice(0, mediaShortKey.indexOf('_'))\n fullKey += `-${mediaShortKey}`\n } else if (isPseudo) {\n // is psuedo\n const pseudoShortKey = mediaOrPsuedo.slice(1)\n fullKey += `-${psuedoCNInverse[pseudoShortKey]}`\n }\n usedKeys.add(fullKey)\n mergeClassName(fullKey, cn, isMediaOrPseudo)\n } else {\n nonTamaguis += ' ' + cn\n }\n }\n if (nonTamaguis) {\n mergeClassName(keyInit, nonTamaguis)\n }\n continue\n }\n\n if (validStyleProps[keyInit] && valInit && valInit[0] === '_') {\n usedKeys.add(keyInit)\n mergeClassName(keyInit, valInit)\n continue\n }\n\n if (\n state.keepVariantsAsProps &&\n staticConfig.defaultVariants &&\n keyInit in staticConfig.defaultVariants\n ) {\n viewProps[keyInit] = valInit\n }\n\n let isMedia = keyInit[0] === '$'\n let isPseudo = validPseudoKeys[keyInit]\n\n if (\n !isMedia &&\n !isPseudo &&\n !staticConfig.variants?.[keyInit] &&\n !validStyleProps[keyInit] &&\n !conf.shorthands[keyInit]\n ) {\n usedKeys.add(keyInit)\n viewProps[keyInit] = valInit\n continue\n }\n\n const expanded =\n isMedia || isPseudo\n ? [[keyInit, valInit]]\n : staticConfig.propMapper(keyInit, valInit, theme, props, state)\n\n let isMediaOrPseudo = isMedia || isPseudo\n\n if (process.env.NODE_ENV === 'development' && props['debug'] === 'verbose') {\n console.log(' \u00BB getSplitStyles', keyInit, expanded)\n }\n\n if (!expanded) {\n continue\n }\n\n for (const [key, val] of expanded) {\n if (val === undefined) continue\n\n if (key !== 'target' && val && val[0] === '_') {\n usedKeys.add(key)\n mergeClassName(key, val, isMediaOrPseudo)\n continue\n }\n\n isMedia = key[0] === '$'\n isPseudo = validPseudoKeys[key]\n isMediaOrPseudo = isMedia || isPseudo\n\n if (!isMediaOrPseudo) {\n if (usedKeys.has(key)) continue\n }\n\n if (\n (staticConfig.deoptProps && staticConfig.deoptProps.has(key)) ||\n (staticConfig.inlineProps && staticConfig.inlineProps.has(key))\n ) {\n viewProps[key] = val\n }\n\n // pseudo\n if (isPseudo) {\n if (!val) continue\n if (key === 'enterStyle' && state.mounted) {\n // once mounted we can ignore enterStyle\n continue\n }\n pseudos[key] = pseudos[key] || {}\n pseudos[key] = getSubStyle(val, staticConfig, theme, props, state, true)\n if (isWeb && !state.noClassNames) {\n const pseudoStyles = getStylesAtomic({ [key]: pseudos[key] })\n for (const style of pseudoStyles) {\n const fullKey = `${style.property}-${key}`\n if (!usedKeys.has(fullKey)) {\n usedKeys.add(fullKey)\n addStyle(style.identifier, style.rules[0])\n mergeClassName(fullKey, style.identifier, isMediaOrPseudo)\n }\n }\n }\n continue\n }\n\n // media\n if (isMedia) {\n const mediaKey = key\n const mediaKeyShort = mediaKey.slice(1)\n\n if (!mediaQueryConfig[mediaKeyShort]) {\n // this isn't a media key, pass through\n viewProps[key] = val\n continue\n }\n\n // dont check if media is active, we just apply *all* media styles\n // we combine the media props on top regular props, could proxy this\n // TODO test proxy here instead of merge\n // THIS USED TO PROXY BACK TO REGULAR PROPS BUT THAT IS THE WRONG BEHAVIOR\n // we avoid passing in default props for media queries because that would confuse things like SizableText.size:\n const mediaStyle = getSubStyle(val, staticConfig, theme, props, state)\n const shouldDoClasses = isWeb && !state.noClassNames\n\n if (process.env.NODE_ENV === 'development' && props['debug'] === 'verbose') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles mediaStyle', { mediaKey, mediaStyle, props, shouldDoClasses })\n }\n\n if (shouldDoClasses) {\n const mediaStyles = getStylesAtomic(mediaStyle)\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKeyShort, mediaQueryConfig)\n // TODO handle psuedo + media, not too hard just need to set up example case\n const fullKey = `${style.property}-${mediaKeyShort}`\n if (!usedKeys.has(fullKey)) {\n usedKeys.add(fullKey)\n addStyle(out.identifier, out.styleRule)\n mergeClassName(fullKey, out.identifier, true)\n }\n }\n } else {\n if (mediaState[mediaKey]) {\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n console.log('apply media style', mediaKey, mediaState)\n }\n Object.assign(shouldDoClasses ? medias : style, mediaStyle)\n }\n }\n continue\n }\n\n if (!isWeb && key === 'pointerEvents') {\n usedKeys.add(key)\n viewProps[key] = val\n continue\n }\n\n if (validStyleProps[key]) {\n usedKeys.add(key)\n if (val && val[0] === '_') {\n classNames[key] = val\n } else {\n if (key in stylePropsTransform) {\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n console.log('mergeTransform', key, val)\n }\n mergeTransform(style, key, val, true)\n } else {\n style[key] = val\n }\n }\n\n continue\n }\n\n // pass to view props\n if (!staticConfig.variants || !(key in staticConfig.variants)) {\n if (!skipProps[key]) {\n // push()\n viewProps[key] = val\n usedKeys.add(key)\n }\n }\n }\n }\n\n // add in defaults if not set:\n if (defaultClassNames) {\n classNames = {\n ...defaultClassNames,\n ...classNames,\n }\n }\n\n if (isWeb && !state.noClassNames) {\n const atomic = getStylesAtomic(style)\n for (const atomicStyle of atomic) {\n const key = atomicStyle.property\n if (!state.dynamicStylesInline) {\n addStyle(atomicStyle.identifier, atomicStyle.rules[0])\n mergeClassName(key, atomicStyle.identifier)\n } else {\n style[key] = atomicStyle.value\n }\n }\n }\n\n if (transforms) {\n for (const namespace in transforms) {\n const [hash, val] = transforms[namespace]\n const identifier = `_transform${hash}`\n if (isClient) {\n if (!insertedTransforms[identifier]) {\n const rule = `.${identifier} { transform: ${val}; }`\n addStyle(identifier, rule)\n }\n }\n classNames[namespace] = identifier\n }\n }\n\n if (process.env.NODE_ENV === 'development' && props['debug'] === 'verbose') {\n if (typeof document !== 'undefined') {\n // prettier-ignore\n console.log(' \u00BB getSplitStyles out', { style, pseudos, medias, classNames, viewProps, state })\n }\n }\n\n return {\n viewProps,\n style,\n medias,\n pseudos,\n classNames,\n rulesToInsert,\n }\n}\n\nexport const insertSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n for (const [prop, rule] of res.rulesToInsert) {\n insertStyleRule(prop, rule)\n }\n return res\n}\n\nconst effect = isWeb ? useInsertionEffect || useIsomorphicLayoutEffect : useIsomorphicLayoutEffect\n\nexport const useSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n effect(() => {\n for (const [prop, rule] of res.rulesToInsert) {\n insertStyleRule(prop, rule)\n }\n })\n return res\n}\n\nexport const getSubStyle = (\n styleIn: Object,\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n props: any,\n state: SplitStyleState,\n avoidDefaultProps?: boolean\n): ViewStyle => {\n const styleOut: ViewStyle = {}\n for (const key in styleIn) {\n const val = styleIn[key]\n const expanded = staticConfig.propMapper(key, val, theme, props, state, avoidDefaultProps)\n if (!expanded) continue\n for (const [skey, sval] of expanded) {\n if (skey in stylePropsTransform) {\n mergeTransform(styleOut, skey, sval)\n } else {\n styleOut[skey] = sval\n }\n }\n }\n return styleOut\n}\n\nexport function normalizeStyleObject(style: any) {\n if (!isWeb) {\n fixNativeShadow(style)\n }\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA;AAEA;AAGA;AACA;AACA;AAYA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAMA,MAAM,YAAY;AAAA,EAChB,WAAW;AAAA,EACX,aAAa;AAAA,EACb,OAAO;AAAA,EACP,eAAe;AAAA,EAEf,GAAI,CAAC,SAAS;AAAA,IACZ,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,cAAc;AAAA,IACd,wBAAwB;AAAA,IACxB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,eAAe;AAAA,IACf,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF;AAIA,IAAI;AA0BG,MAAM,iBAAgC,wBAC3C,OACA,cACA,OACA,OACA,sBACG;AA1FL;AA2FE,SAAO,QAAQ,UAAU;AACzB,QAAM,kBAAkB,aAAa,SAAS,iBAAiB;AAC/D,QAAM,YAAwB,CAAC;AAC/B,QAAM,UAAwB,CAAC;AAC/B,QAAM,SAAuC,CAAC;AAC9C,QAAM,WAAW,oBAAI,IAAY;AAEjC,MAAI,QAAmB,CAAC;AACxB,MAAI,aAA+B,CAAC;AAGpC,MAAI,aAA8D,CAAC;AAEnE,QAAM,gBAAoC,CAAC;AAC3C,oBAAkB,MAAc,MAAc;AAC5C,kBAAc,KAAK,CAAC,MAAM,IAAI,CA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8BAA8B,OAAY;AAC/C,MAAI,CAAC,OAAO;AACV,oBAAgB,KAAK;AAAA,EACvB;AACF;AAJgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -61,10 +61,10 @@ if (process.env.NODE_ENV === "development") {
|
|
|
61
61
|
FontRequired = ow.object.exactShape(fontReq);
|
|
62
62
|
FontOptional = ow.object.partialShape(fontOpt);
|
|
63
63
|
Tokens = ow.object.exactShape({
|
|
64
|
-
size: ow.object.nonEmpty.valuesOfType(ow.number),
|
|
65
|
-
space: ow.object.nonEmpty.valuesOfType(ow.number),
|
|
66
|
-
zIndex: ow.object.nonEmpty.valuesOfType(ow.number),
|
|
67
|
-
radius: ow.object.nonEmpty.valuesOfType(ow.number),
|
|
64
|
+
size: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),
|
|
65
|
+
space: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),
|
|
66
|
+
zIndex: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),
|
|
67
|
+
radius: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),
|
|
68
68
|
color: ow.object.nonEmpty.valuesOfType(ow.any(ow.string, ow.object))
|
|
69
69
|
});
|
|
70
70
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/validate.ts"],
|
|
4
|
-
"sourcesContent": ["// published a patched version that works on native\n// @ts-ignore\nconst { default: ow } = require('@tamagui/ow/dev-only')\n\nlet Config: any\nlet Tokens: any\nlet FontRequired: any\nlet FontOptional: any\n\nexport const validateConfig = (conf: any) => {\n if (!conf) {\n console.warn('no conf?')\n return\n }\n try {\n ow(conf, Config)\n } catch (err: any) {\n console.warn('Given config:\\n', JSON.stringify(conf, null, 2), err)\n }\n}\n\nexport const validateTokens = (tokens: any) => {\n try {\n ow(tokens, Tokens)\n } catch (err: any) {\n console.warn('Given tokens:\\n', JSON.stringify(tokens, null, 2), err)\n }\n}\n\nexport const validateFont = (font: any) => {\n try {\n const { style, transform, color, ...required } = font\n ow(required, FontRequired)\n ow({ style, transform, color }, FontOptional)\n } catch (err: any) {\n console.warn('Given font:\\n', JSON.stringify(font, null, 2), err)\n }\n}\n\nif (process.env.NODE_ENV === 'development') {\n const fontReq = {\n family: ow.string,\n size: ow.object.nonEmpty.valuesOfType(ow.number),\n lineHeight: ow.object.nonEmpty.valuesOfType(ow.number),\n weight: ow.object.nonEmpty.valuesOfType(ow.string),\n letterSpacing: ow.object.nonEmpty.valuesOfType(ow.number),\n }\n const fontOpt = {\n style: ow.optional.object.valuesOfType(ow.string),\n transform: ow.optional.object.valuesOfType(ow.string),\n color: ow.optional.object.valuesOfType(ow.any(ow.string, ow.object)),\n }\n\n Config = ow.object.exactShape({\n defaultTheme: ow.optional.string,\n disableRootThemeClass: ow.optional.boolean,\n shorthands: ow.optional.object.valuesOfType(ow.string),\n themes: ow.object.valuesOfType(ow.object),\n tokens: ow.object.valuesOfType(ow.object),\n media: ow.object.valuesOfType(ow.object),\n animations: ow.object.valuesOfType(ow.object),\n fonts: ow.object.valuesOfType(\n ow.object.partialShape({\n ...fontReq,\n ...fontOpt,\n })\n ),\n })\n\n FontRequired = ow.object.exactShape(fontReq)\n FontOptional = ow.object.partialShape(fontOpt)\n\n Tokens = ow.object.exactShape({\n size: ow.object.nonEmpty.valuesOfType(ow.number),\n space: ow.object.nonEmpty.valuesOfType(ow.number),\n zIndex: ow.object.nonEmpty.valuesOfType(ow.number),\n radius: ow.object.nonEmpty.valuesOfType(ow.number),\n color: ow.object.nonEmpty.valuesOfType(ow.any(ow.string, ow.object)),\n })\n}\n"],
|
|
5
|
-
"mappings": ";;AAEA,MAAM,EAAE,SAAS,OAAO,QAAQ,sBAAsB;AAEtD,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AAEG,MAAM,iBAAiB,wBAAC,SAAc;AAC3C,MAAI,CAAC,MAAM;AACT,Y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Ac,GAAG,SAAS;AAAA,IAC1B,uBAAuB,GAAG,SAAS;AAAA,IACnC,YAAY,GAAG,SAAS,OAAO,aAAa,GAAG,MAAM;AAAA,IACrD,QAAQ,GAAG,OAAO,aAAa,GAAG,MAAM;AAAA,IACxC,QAAQ,GAAG,OAAO,aAAa,GAAG,MAAM;AAAA,IACxC,OAAO,GAAG,OAAO,aAAa,GAAG,MAAM;AAAA,IACvC,YAAY,GAAG,OAAO,aAAa,GAAG,MAAM;AAAA,IAC5C,OAAO,GAAG,OAAO,aACf,GAAG,OAAO,aAAa;AAAA,MACrB,GAAG;AAAA,MACH,GAAG;AAAA,IACL,CAAC,CACH;AAAA,EACF,CAAC;AAED,iBAAe,GAAG,OAAO,WAAW,OAAO;AAC3C,iBAAe,GAAG,OAAO,aAAa,OAAO;AAE7C,WAAS,GAAG,OAAO,WAAW;AAAA,IAC5B,MAAM,GAAG,OAAO,SAAS,aAAa,GAAG,MAAM;AAAA,
|
|
4
|
+
"sourcesContent": ["// published a patched version that works on native\n// @ts-ignore\nconst { default: ow } = require('@tamagui/ow/dev-only')\n\nlet Config: any\nlet Tokens: any\nlet FontRequired: any\nlet FontOptional: any\n\nexport const validateConfig = (conf: any) => {\n if (!conf) {\n console.warn('no conf?')\n return\n }\n try {\n ow(conf, Config)\n } catch (err: any) {\n console.warn('Given config:\\n', JSON.stringify(conf, null, 2), err)\n }\n}\n\nexport const validateTokens = (tokens: any) => {\n try {\n ow(tokens, Tokens)\n } catch (err: any) {\n console.warn('Given tokens:\\n', JSON.stringify(tokens, null, 2), err)\n }\n}\n\nexport const validateFont = (font: any) => {\n try {\n const { style, transform, color, ...required } = font\n ow(required, FontRequired)\n ow({ style, transform, color }, FontOptional)\n } catch (err: any) {\n console.warn('Given font:\\n', JSON.stringify(font, null, 2), err)\n }\n}\n\nif (process.env.NODE_ENV === 'development') {\n const fontReq = {\n family: ow.string,\n size: ow.object.nonEmpty.valuesOfType(ow.number),\n lineHeight: ow.object.nonEmpty.valuesOfType(ow.number),\n weight: ow.object.nonEmpty.valuesOfType(ow.string),\n letterSpacing: ow.object.nonEmpty.valuesOfType(ow.number),\n }\n const fontOpt = {\n style: ow.optional.object.valuesOfType(ow.string),\n transform: ow.optional.object.valuesOfType(ow.string),\n color: ow.optional.object.valuesOfType(ow.any(ow.string, ow.object)),\n }\n\n Config = ow.object.exactShape({\n defaultTheme: ow.optional.string,\n disableRootThemeClass: ow.optional.boolean,\n shorthands: ow.optional.object.valuesOfType(ow.string),\n themes: ow.object.valuesOfType(ow.object),\n tokens: ow.object.valuesOfType(ow.object),\n media: ow.object.valuesOfType(ow.object),\n animations: ow.object.valuesOfType(ow.object),\n fonts: ow.object.valuesOfType(\n ow.object.partialShape({\n ...fontReq,\n ...fontOpt,\n })\n ),\n })\n\n FontRequired = ow.object.exactShape(fontReq)\n FontOptional = ow.object.partialShape(fontOpt)\n\n Tokens = ow.object.exactShape({\n size: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),\n space: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),\n zIndex: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),\n radius: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),\n color: ow.object.nonEmpty.valuesOfType(ow.any(ow.string, ow.object)),\n })\n}\n"],
|
|
5
|
+
"mappings": ";;AAEA,MAAM,EAAE,SAAS,OAAO,QAAQ,sBAAsB;AAEtD,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AAEG,MAAM,iBAAiB,wBAAC,SAAc;AAC3C,MAAI,CAAC,MAAM;AACT,YAAQ,KAAK,UAAU;AACvB;AAAA,EACF;AACA,MAAI;AACF,OAAG,MAAM,MAAM;AAAA,EACjB,SAAS,KAAP;AACA,YAAQ,KAAK,mBAAmB,KAAK,UAAU,MAAM,MAAM,CAAC,GAAG,GAAG;AAAA,EACpE;AACF,GAV8B;AAYvB,MAAM,iBAAiB,wBAAC,WAAgB;AAC7C,MAAI;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Aa,GAAG,MAAM;AAAA,IACvC,YAAY,GAAG,OAAO,aAAa,GAAG,MAAM;AAAA,IAC5C,OAAO,GAAG,OAAO,aACf,GAAG,OAAO,aAAa;AAAA,MACrB,GAAG;AAAA,MACH,GAAG;AAAA,IACL,CAAC,CACH;AAAA,EACF,CAAC;AAED,iBAAe,GAAG,OAAO,WAAW,OAAO;AAC3C,iBAAe,GAAG,OAAO,aAAa,OAAO;AAE7C,WAAS,GAAG,OAAO,WAAW;AAAA,IAC5B,MAAM,GAAG,OAAO,SAAS,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,IAClE,OAAO,GAAG,OAAO,SAAS,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,IACnE,QAAQ,GAAG,OAAO,SAAS,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,IACpE,QAAQ,GAAG,OAAO,SAAS,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,IACpE,OAAO,GAAG,OAAO,SAAS,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,EACrE,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/hooks/useId.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { useIsomorphicLayoutEffect } from "../constants/platform";
|
|
4
|
+
import { isWeb, useIsomorphicLayoutEffect } from "../constants/platform";
|
|
5
5
|
let serverHandoffComplete = false;
|
|
6
6
|
let id = 0;
|
|
7
7
|
function genId() {
|
|
@@ -10,9 +10,11 @@ function genId() {
|
|
|
10
10
|
__name(genId, "genId");
|
|
11
11
|
function useId(providedId) {
|
|
12
12
|
var _a;
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
if (isWeb) {
|
|
14
|
+
if (typeof React.useId === "function") {
|
|
15
|
+
let id3 = React.useId(providedId);
|
|
16
|
+
return providedId != null ? providedId : id3;
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
19
|
let initialId = providedId != null ? providedId : serverHandoffComplete ? genId() : null;
|
|
18
20
|
let [id2, setId] = React.useState(initialId);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useId.tsx"],
|
|
4
|
-
"sourcesContent": ["/*\n * Welcome to @reach/auto-id!\n\n * Let's see if we can make sense of why this hook exists and its\n * implementation.\n *\n * Some background:\n * 1. Accessibility APIs rely heavily on element IDs\n * 2. Requiring developers to put IDs on every element in Reach UI is both\n * cumbersome and error-prone\n * 3. With a component model, we can generate IDs for them!\n *\n * Solution 1: Generate random IDs.\n *\n * This works great as long as you don't server render your app. When React (in\n * the client) tries to reuse the markup from the server, the IDs won't match\n * and React will then recreate the entire DOM tree.\n *\n * Solution 2: Increment an integer\n *\n * This sounds great. Since we're rendering the exact same tree on the server\n * and client, we can increment a counter and get a deterministic result between\n * client and server. Also, JS integers can go up to nine-quadrillion. I'm\n * pretty sure the tab will be closed before an app never needs\n * 10 quadrillion IDs!\n *\n * Problem solved, right?\n *\n * Ah, but there's a catch! React's concurrent rendering makes this approach\n * non-deterministic. While the client and server will end up with the same\n * elements in the end, depending on suspense boundaries (and possibly some user\n * input during the initial render) the incrementing integers won't always match\n * up.\n *\n * Solution 3: Don't use IDs at all on the server; patch after first render.\n *\n * What we've done here is solution 2 with some tricks. With this approach, the\n * ID returned is an empty string on the first render. This way the server and\n * client have the same markup no matter how wild the concurrent rendering may\n * have gotten.\n *\n * After the render, we patch up the components with an incremented ID. This\n * causes a double render on any components with `useId`. Shouldn't be a problem\n * since the components using this hook should be small, and we're only updating\n * the ID attribute on the DOM, nothing big is happening.\n *\n * It doesn't have to be an incremented number, though--we could do generate\n * random strings instead, but incrementing a number is probably the cheapest\n * thing we can do.\n *\n * Additionally, we only do this patchup on the very first client render ever.\n * Any calls to `useId` that happen dynamically in the client will be\n * populated immediately with a value. So, we only get the double render after\n * server hydration and never again, SO BACK OFF ALRIGHT?\n */\n\nimport * as React from 'react'\n\nimport { useIsomorphicLayoutEffect } from '../constants/platform'\n\nlet serverHandoffComplete = false\nlet id = 0\nfunction genId() {\n return ++id\n}\n\n/* eslint-disable react-hooks/rules-of-hooks */\n\n/**\n * useId\n *\n * Autogenerate IDs to facilitate WAI-ARIA and server rendering.\n *\n * Note: The returned ID will initially be `null` and will update after a\n * component mounts. Users may need to supply their own ID if they need\n * consistent values for SSR.\n *\n * @see Docs https://reach.tech/auto-id\n */\nfunction useId(idFromProps: string): string\nfunction useId(idFromProps: number): number\nfunction useId(idFromProps: string | number): string | number\nfunction useId(idFromProps: string | undefined | null): string | undefined\nfunction useId(idFromProps: number | undefined | null): number | undefined\nfunction useId(idFromProps: string | number | undefined | null): string | number | undefined\nfunction useId(): string | undefined\n\nfunction useId(providedId?: number | string | undefined | null) {\n // TODO: Remove error flag when updating internal deps to React 18. None of\n // our tricks will play well with concurrent rendering anyway.\n // @ts-expect-error\n
|
|
5
|
-
"mappings": ";;AAwDA;AAEA;AAEA,IAAI,wBAAwB;AAC5B,IAAI,KAAK;AACT,iBAAiB;AACf,SAAO,EAAE;AACX;AAFS;AAyBT,eAAe,YAAiD;AAvFhE;
|
|
4
|
+
"sourcesContent": ["/*\n * Welcome to @reach/auto-id!\n\n * Let's see if we can make sense of why this hook exists and its\n * implementation.\n *\n * Some background:\n * 1. Accessibility APIs rely heavily on element IDs\n * 2. Requiring developers to put IDs on every element in Reach UI is both\n * cumbersome and error-prone\n * 3. With a component model, we can generate IDs for them!\n *\n * Solution 1: Generate random IDs.\n *\n * This works great as long as you don't server render your app. When React (in\n * the client) tries to reuse the markup from the server, the IDs won't match\n * and React will then recreate the entire DOM tree.\n *\n * Solution 2: Increment an integer\n *\n * This sounds great. Since we're rendering the exact same tree on the server\n * and client, we can increment a counter and get a deterministic result between\n * client and server. Also, JS integers can go up to nine-quadrillion. I'm\n * pretty sure the tab will be closed before an app never needs\n * 10 quadrillion IDs!\n *\n * Problem solved, right?\n *\n * Ah, but there's a catch! React's concurrent rendering makes this approach\n * non-deterministic. While the client and server will end up with the same\n * elements in the end, depending on suspense boundaries (and possibly some user\n * input during the initial render) the incrementing integers won't always match\n * up.\n *\n * Solution 3: Don't use IDs at all on the server; patch after first render.\n *\n * What we've done here is solution 2 with some tricks. With this approach, the\n * ID returned is an empty string on the first render. This way the server and\n * client have the same markup no matter how wild the concurrent rendering may\n * have gotten.\n *\n * After the render, we patch up the components with an incremented ID. This\n * causes a double render on any components with `useId`. Shouldn't be a problem\n * since the components using this hook should be small, and we're only updating\n * the ID attribute on the DOM, nothing big is happening.\n *\n * It doesn't have to be an incremented number, though--we could do generate\n * random strings instead, but incrementing a number is probably the cheapest\n * thing we can do.\n *\n * Additionally, we only do this patchup on the very first client render ever.\n * Any calls to `useId` that happen dynamically in the client will be\n * populated immediately with a value. So, we only get the double render after\n * server hydration and never again, SO BACK OFF ALRIGHT?\n */\n\nimport * as React from 'react'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\n\nlet serverHandoffComplete = false\nlet id = 0\nfunction genId() {\n return ++id\n}\n\n/* eslint-disable react-hooks/rules-of-hooks */\n\n/**\n * useId\n *\n * Autogenerate IDs to facilitate WAI-ARIA and server rendering.\n *\n * Note: The returned ID will initially be `null` and will update after a\n * component mounts. Users may need to supply their own ID if they need\n * consistent values for SSR.\n *\n * @see Docs https://reach.tech/auto-id\n */\nfunction useId(idFromProps: string): string\nfunction useId(idFromProps: number): number\nfunction useId(idFromProps: string | number): string | number\nfunction useId(idFromProps: string | undefined | null): string | undefined\nfunction useId(idFromProps: number | undefined | null): number | undefined\nfunction useId(idFromProps: string | number | undefined | null): string | number | undefined\nfunction useId(): string | undefined\n\nfunction useId(providedId?: number | string | undefined | null) {\n // TODO: Remove error flag when updating internal deps to React 18. None of\n // our tricks will play well with concurrent rendering anyway.\n\n // native doesn't support until next react-native version, need to remove eventually\n if (isWeb) {\n // @ts-expect-error\n if (typeof React.useId === 'function') {\n // @ts-expect-error\n let id = React.useId(providedId)\n return providedId != null ? providedId : id\n }\n }\n\n // If this instance isn't part of the initial render, we don't have to do the\n // double render/patch-up dance. We can just generate the ID and return it.\n let initialId = providedId ?? (serverHandoffComplete ? genId() : null)\n let [id, setId] = React.useState(initialId)\n\n useIsomorphicLayoutEffect(() => {\n if (id === null) {\n // Patch the ID after render. We do this in `useLayoutEffect` to avoid any\n // rendering flicker, though it'll make the first render slower (unlikely\n // to matter, but you're welcome to measure your app and let us know if\n // it's a problem).\n setId(genId())\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n React.useEffect(() => {\n if (serverHandoffComplete === false) {\n // Flag all future uses of `useId` to skip the update dance. This is in\n // `useEffect` because it goes after `useLayoutEffect`, ensuring we don't\n // accidentally bail out of the patch-up dance prematurely.\n serverHandoffComplete = true\n }\n }, [])\n\n return providedId ?? id ?? undefined\n}\n\nexport { useId }\n"],
|
|
5
|
+
"mappings": ";;AAwDA;AAEA;AAEA,IAAI,wBAAwB;AAC5B,IAAI,KAAK;AACT,iBAAiB;AACf,SAAO,EAAE;AACX;AAFS;AAyBT,eAAe,YAAiD;AAvFhE;AA4FE,MAAI,OAAO;AAET,QAAI,OAAO,MAAM,UAAU,YAAY;AAErC,UAAI,MAAK,MAAM,MAAM,UAAU;AAC/B,aAAO,cAAc,OAAO,aAAa;AAAA,IAC3C;AAAA,EACF;AAIA,MAAI,YAAY,kCAAe,wBAAwB,MAAM,IAAI;AACjE,MAAI,CAAC,KAAI,SAAS,MAAM,SAAS,SAAS;AAE1C,4BAA0B,MAAM;AAC9B,QAAI,QAAO,MAAM;AAKf,YAAM,MAAM,CAAC;AAAA,IACf;AAAA,EAEF,GAAG,CAAC,CAAC;AAEL,QAAM,UAAU,MAAM;AACpB,QAAI,0BAA0B,OAAO;AAInC,8BAAwB;AAAA,IAC1B;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO,wCAAc,QAAd,YAAoB;AAC7B;AAxCS;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/views/Slot.js
CHANGED
|
@@ -52,10 +52,7 @@ function mergeProps(child, slotProps) {
|
|
|
52
52
|
}
|
|
53
53
|
const isHandler = /^on[A-Z]/.test(propName);
|
|
54
54
|
if (isHandler) {
|
|
55
|
-
overrideProps[propName] = (
|
|
56
|
-
childPropValue == null ? void 0 : childPropValue(...args);
|
|
57
|
-
slotPropValue == null ? void 0 : slotPropValue(...args);
|
|
58
|
-
};
|
|
55
|
+
overrideProps[propName] = mergeEvent(childPropValue, slotPropValue);
|
|
59
56
|
} else if (propName === "style") {
|
|
60
57
|
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
61
58
|
} else if (propName === "className") {
|
|
@@ -65,8 +62,16 @@ function mergeProps(child, slotProps) {
|
|
|
65
62
|
return { ...slotProps, ...overrideProps };
|
|
66
63
|
}
|
|
67
64
|
__name(mergeProps, "mergeProps");
|
|
65
|
+
function mergeEvent(a, b) {
|
|
66
|
+
return (...args) => {
|
|
67
|
+
a == null ? void 0 : a(...args);
|
|
68
|
+
b == null ? void 0 : b(...args);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
__name(mergeEvent, "mergeEvent");
|
|
68
72
|
export {
|
|
69
73
|
Slot,
|
|
70
|
-
Slottable
|
|
74
|
+
Slottable,
|
|
75
|
+
mergeEvent
|
|
71
76
|
};
|
|
72
77
|
//# sourceMappingURL=Slot.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Slot.tsx"],
|
|
4
|
-
"sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\nimport { isWeb } from '../constants/platform'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: React.ReactNode\n}\n\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode\n}\n\nconst SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.isValidElement(children)) {\n const childProps = {\n ...mergeProps(children, slotProps),\n ref: composeRefs(forwardedRef, (children as any).ref),\n }\n return React.cloneElement(children, childProps)\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\n// function isSlottable(child: React.ReactNode): child is React.ReactElement {\n// return React.isValidElement(child)\n// }\n\nconst pressMap = isWeb\n ? {\n onPress: 'onClick',\n onPressOut: 'onMouseUp',\n onPressIn: 'onMouseDown',\n }\n : {}\n\nfunction mergeProps(child: any, slotProps: AnyProps) {\n const childProps = child.props\n\n // all child props should override\n const overrideProps = { ...childProps }\n
|
|
5
|
-
"mappings": ";;AAEA;AACA;AAEA;AAUO,MAAM,OAAO,MAAM,WAAmC,CAAC,OAAO,iBAAiB;AACpF,QAAM,EAAE,aAAa,cAAc;AACnC,SACE,oCAAC;AAAA,IAAW,GAAG;AAAA,IAAW,KAAK;AAAA,KAC5B,QACH;AAEJ,CAAC;AAED,KAAK,cAAc;AAUnB,MAAM,YAAY,MAAM,WAAgC,CAAC,OAAO,iBAAiB;AAC/E,QAAM,EAAE,aAAa,cAAc;AAEnC,MAAI,MAAM,eAAe,QAAQ,GAAG;AAClC,UAAM,aAAa;AAAA,MACjB,GAAG,WAAW,UAAU,SAAS;AAAA,MACjC,KAAK,YAAY,cAAe,SAAiB,GAAG;AAAA,IACtD;AACA,WAAO,MAAM,aAAa,UAAU,UAAU;AAAA,EAChD;AAEA,SAAO,MAAM,SAAS,MAAM,QAAQ,IAAI,IAAI,MAAM,SAAS,KAAK,IAAI,IAAI;AAC1E,CAAC;AAED,UAAU,cAAc;AAMjB,MAAM,YAAY,wBAAC,EAAE,eAA8C;AACxE,SAAO,0DAAG,QAAS;AACrB,GAFyB;AAYzB,MAAM,WAAW,QACb;AAAA,EACE,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,WAAW;AACb,IACA,CAAC;AAEL,oBAAoB,OAAY,WAAqB;AACnD,QAAM,aAAa,MAAM;AAGzB,QAAM,gBAAgB,EAAE,GAAG,WAAW;
|
|
4
|
+
"sourcesContent": ["// via radix\n\nimport { composeRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\nimport { isWeb } from '../constants/platform'\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type SlotProps = {\n children?: React.ReactNode\n}\n\nexport const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n )\n})\n\nSlot.displayName = 'Slot'\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode\n}\n\nconst SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props\n\n if (React.isValidElement(children)) {\n const childProps = {\n ...mergeProps(children, slotProps),\n ref: composeRefs(forwardedRef, (children as any).ref),\n }\n return React.cloneElement(children, childProps)\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null\n})\n\nSlotClone.displayName = 'SlotClone'\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Slottable = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>\n\n// function isSlottable(child: React.ReactNode): child is React.ReactElement {\n// return React.isValidElement(child)\n// }\n\nconst pressMap = isWeb\n ? {\n onPress: 'onClick',\n onPressOut: 'onMouseUp',\n onPressIn: 'onMouseDown',\n }\n : {}\n\nfunction mergeProps(child: any, slotProps: AnyProps) {\n const childProps = child.props\n\n // all child props should override\n const overrideProps = { ...childProps }\n const isHTMLChild = typeof child.type === 'string'\n\n if (isHTMLChild) {\n for (const key in pressMap) {\n if (key in slotProps) {\n slotProps[pressMap[key]] = slotProps[key]\n delete slotProps[key]\n }\n }\n }\n\n for (let propName in childProps) {\n const slotPropValue = slotProps[propName]\n const childPropValue = childProps[propName]\n\n if (isHTMLChild && pressMap[propName]) {\n propName = pressMap[propName]\n delete overrideProps[propName]\n }\n\n const isHandler = /^on[A-Z]/.test(propName)\n // if it's a handler, modify the override by composing the base handler\n if (isHandler) {\n overrideProps[propName] = mergeEvent(childPropValue, slotPropValue)\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue }\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ')\n }\n }\n\n return { ...slotProps, ...overrideProps }\n}\n\nexport function mergeEvent(a?: Function, b?: Function) {\n return (...args: unknown[]) => {\n a?.(...args)\n b?.(...args)\n }\n}\n"],
|
|
5
|
+
"mappings": ";;AAEA;AACA;AAEA;AAUO,MAAM,OAAO,MAAM,WAAmC,CAAC,OAAO,iBAAiB;AACpF,Q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aAAa,SAAS;AAC7B,oBAAc,YAAY,EAAE,GAAG,eAAe,GAAG,eAAe;AAAA,IAClE,WAAW,aAAa,aAAa;AACnC,oBAAc,YAAY,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,EAAE,GAAG,WAAW,GAAG,cAAc;AAC1C;AAvCS;AAyCF,oBAAoB,GAAc,GAAc;AACrD,SAAO,IAAI,SAAoB;AAC7B,2BAAI,GAAG;AACP,2BAAI,GAAG;AAAA,EACT;AACF;AALgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -13,7 +13,12 @@ import React, {
|
|
|
13
13
|
useRef,
|
|
14
14
|
useState
|
|
15
15
|
} from "react";
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
StyleSheet,
|
|
18
|
+
Text,
|
|
19
|
+
TouchableWithoutFeedback,
|
|
20
|
+
View
|
|
21
|
+
} from "react-native";
|
|
17
22
|
import { onConfiguredOnce } from "./conf";
|
|
18
23
|
import { stackDefaultStyles } from "./constants/constants";
|
|
19
24
|
import { isWeb, useIsomorphicLayoutEffect } from "./constants/platform";
|
|
@@ -22,7 +27,6 @@ import { createShallowUpdate } from "./helpers/createShallowUpdate";
|
|
|
22
27
|
import { extendStaticConfig, parseStaticConfig } from "./helpers/extendStaticConfig";
|
|
23
28
|
import { insertSplitStyles, useSplitStyles } from "./helpers/getSplitStyles";
|
|
24
29
|
import { getAllSelectors } from "./helpers/insertStyleRule";
|
|
25
|
-
import { BaseButton } from "./helpers/nativeGestureHandler";
|
|
26
30
|
import { proxyThemeVariables } from "./helpers/proxyThemeVariables";
|
|
27
31
|
import { wrapThemeManagerContext } from "./helpers/wrapThemeManagerContext";
|
|
28
32
|
import { useFeatures } from "./hooks/useFeatures";
|
|
@@ -30,7 +34,7 @@ import { useIsTouchDevice } from "./hooks/useIsTouchDevice";
|
|
|
30
34
|
import { mediaState } from "./hooks/useMedia";
|
|
31
35
|
import { usePressable } from "./hooks/usePressable";
|
|
32
36
|
import { getThemeManagerIfChanged, useTheme } from "./hooks/useTheme";
|
|
33
|
-
import { Slot } from "./views/Slot";
|
|
37
|
+
import { Slot, mergeEvent } from "./views/Slot";
|
|
34
38
|
import { TextAncestorContext } from "./views/TextAncestorContext";
|
|
35
39
|
React["keep"];
|
|
36
40
|
const defaultComponentState = {
|
|
@@ -507,14 +511,21 @@ function createComponent(configIn, ParentComponent) {
|
|
|
507
511
|
}
|
|
508
512
|
}
|
|
509
513
|
}
|
|
514
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
515
|
+
const attachFocus = !!(pseudos && pseudos.focusStyle || initialPseudos && initialPseudos.focusStyle);
|
|
516
|
+
if (attachFocus) {
|
|
517
|
+
viewProps.onFocus = mergeEvent(viewProps.onFocus, () => {
|
|
518
|
+
setStateShallow({ focus: true });
|
|
519
|
+
});
|
|
520
|
+
viewProps.onBlur = mergeEvent(viewProps.onBlur, () => {
|
|
521
|
+
setStateShallow({ focus: false });
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
}
|
|
510
525
|
content = createElement(elementType, viewProps, childEls);
|
|
511
526
|
if (process.env.TAMAGUI_TARGET === "native") {
|
|
512
527
|
if (attachPress && events) {
|
|
513
|
-
content = <
|
|
514
|
-
if (!isActive) {
|
|
515
|
-
unPress();
|
|
516
|
-
}
|
|
517
|
-
}}>{content}</BaseButton></Pressable>;
|
|
528
|
+
content = <TouchableWithoutFeedback onPressIn={events[pressInKey]} onPress={events[pressKey]} onPressOut={events[pressOutKey]}>{content}</TouchableWithoutFeedback>;
|
|
518
529
|
}
|
|
519
530
|
}
|
|
520
531
|
if (isWeb && events && attachHover) {
|
|
@@ -13,7 +13,6 @@ const createVariables = /* @__PURE__ */ __name((tokens, parentPath = "") => {
|
|
|
13
13
|
res[key] = val.map((val2, i) => {
|
|
14
14
|
const skey = `${key}-${i}`;
|
|
15
15
|
const sname = parentPath ? `${name}-${skey}` : skey;
|
|
16
|
-
console.log("make it", val2, key, sname);
|
|
17
16
|
return isVariable(val2) ? val2 : createVariable({
|
|
18
17
|
val: val2,
|
|
19
18
|
key: skey,
|
|
@@ -43,21 +43,19 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
43
43
|
const viewProps = {};
|
|
44
44
|
const pseudos = {};
|
|
45
45
|
const medias = {};
|
|
46
|
+
const usedKeys = /* @__PURE__ */ new Set();
|
|
46
47
|
let style = {};
|
|
47
48
|
let classNames = {};
|
|
48
|
-
|
|
49
|
+
let transforms = {};
|
|
49
50
|
const rulesToInsert = [];
|
|
50
51
|
function addStyle(prop, rule) {
|
|
51
52
|
rulesToInsert.push([prop, rule]);
|
|
52
53
|
updateInsertedCache(prop, rule);
|
|
53
54
|
}
|
|
54
55
|
__name(addStyle, "addStyle");
|
|
55
|
-
let cur = null;
|
|
56
|
-
let transforms = {};
|
|
57
56
|
function mergeClassName(key, val, isMediaOrPseudo = false) {
|
|
58
|
-
if (!val)
|
|
57
|
+
if (!val)
|
|
59
58
|
return;
|
|
60
|
-
}
|
|
61
59
|
if (val.startsWith("_transform-")) {
|
|
62
60
|
const namespace = isMediaOrPseudo ? key : "transform";
|
|
63
61
|
let transform = insertedTransforms[val];
|
|
@@ -70,9 +68,6 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
70
68
|
if (isWeb && val[0] !== "_") {
|
|
71
69
|
transform = val;
|
|
72
70
|
} else {
|
|
73
|
-
if (process.env.NODE_ENV === "development") {
|
|
74
|
-
console.trace("?", key, val, cur, props, state);
|
|
75
|
-
}
|
|
76
71
|
}
|
|
77
72
|
}
|
|
78
73
|
if (process.env.NODE_ENV === "development" && props["debug"] === "verbose") {
|
|
@@ -177,8 +172,6 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
177
172
|
for (const [key, val] of expanded) {
|
|
178
173
|
if (val === void 0)
|
|
179
174
|
continue;
|
|
180
|
-
if (usedKeys.has(key))
|
|
181
|
-
continue;
|
|
182
175
|
if (key !== "target" && val && val[0] === "_") {
|
|
183
176
|
usedKeys.add(key);
|
|
184
177
|
mergeClassName(key, val, isMediaOrPseudo);
|
|
@@ -187,6 +180,10 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme, state
|
|
|
187
180
|
isMedia = key[0] === "$";
|
|
188
181
|
isPseudo = validPseudoKeys[key];
|
|
189
182
|
isMediaOrPseudo = isMedia || isPseudo;
|
|
183
|
+
if (!isMediaOrPseudo) {
|
|
184
|
+
if (usedKeys.has(key))
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
190
187
|
if (staticConfig.deoptProps && staticConfig.deoptProps.has(key) || staticConfig.inlineProps && staticConfig.inlineProps.has(key)) {
|
|
191
188
|
viewProps[key] = val;
|
|
192
189
|
}
|
|
@@ -61,10 +61,10 @@ if (process.env.NODE_ENV === "development") {
|
|
|
61
61
|
FontRequired = ow.object.exactShape(fontReq);
|
|
62
62
|
FontOptional = ow.object.partialShape(fontOpt);
|
|
63
63
|
Tokens = ow.object.exactShape({
|
|
64
|
-
size: ow.object.nonEmpty.valuesOfType(ow.number),
|
|
65
|
-
space: ow.object.nonEmpty.valuesOfType(ow.number),
|
|
66
|
-
zIndex: ow.object.nonEmpty.valuesOfType(ow.number),
|
|
67
|
-
radius: ow.object.nonEmpty.valuesOfType(ow.number),
|
|
64
|
+
size: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),
|
|
65
|
+
space: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),
|
|
66
|
+
zIndex: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),
|
|
67
|
+
radius: ow.object.nonEmpty.valuesOfType(ow.any(ow.number, ow.object)),
|
|
68
68
|
color: ow.object.nonEmpty.valuesOfType(ow.any(ow.string, ow.object))
|
|
69
69
|
});
|
|
70
70
|
}
|
package/dist/jsx/hooks/useId.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { useIsomorphicLayoutEffect } from "../constants/platform";
|
|
4
|
+
import { isWeb, useIsomorphicLayoutEffect } from "../constants/platform";
|
|
5
5
|
let serverHandoffComplete = false;
|
|
6
6
|
let id = 0;
|
|
7
7
|
function genId() {
|
|
@@ -10,9 +10,11 @@ function genId() {
|
|
|
10
10
|
__name(genId, "genId");
|
|
11
11
|
function useId(providedId) {
|
|
12
12
|
var _a;
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
if (isWeb) {
|
|
14
|
+
if (typeof React.useId === "function") {
|
|
15
|
+
let id3 = React.useId(providedId);
|
|
16
|
+
return providedId != null ? providedId : id3;
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
19
|
let initialId = providedId != null ? providedId : serverHandoffComplete ? genId() : null;
|
|
18
20
|
let [id2, setId] = React.useState(initialId);
|
package/dist/jsx/views/Slot.js
CHANGED
|
@@ -49,10 +49,7 @@ function mergeProps(child, slotProps) {
|
|
|
49
49
|
}
|
|
50
50
|
const isHandler = /^on[A-Z]/.test(propName);
|
|
51
51
|
if (isHandler) {
|
|
52
|
-
overrideProps[propName] = (
|
|
53
|
-
childPropValue == null ? void 0 : childPropValue(...args);
|
|
54
|
-
slotPropValue == null ? void 0 : slotPropValue(...args);
|
|
55
|
-
};
|
|
52
|
+
overrideProps[propName] = mergeEvent(childPropValue, slotPropValue);
|
|
56
53
|
} else if (propName === "style") {
|
|
57
54
|
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
58
55
|
} else if (propName === "className") {
|
|
@@ -62,7 +59,15 @@ function mergeProps(child, slotProps) {
|
|
|
62
59
|
return { ...slotProps, ...overrideProps };
|
|
63
60
|
}
|
|
64
61
|
__name(mergeProps, "mergeProps");
|
|
62
|
+
function mergeEvent(a, b) {
|
|
63
|
+
return (...args) => {
|
|
64
|
+
a == null ? void 0 : a(...args);
|
|
65
|
+
b == null ? void 0 : b(...args);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
__name(mergeEvent, "mergeEvent");
|
|
65
69
|
export {
|
|
66
70
|
Slot,
|
|
67
|
-
Slottable
|
|
71
|
+
Slottable,
|
|
72
|
+
mergeEvent
|
|
68
73
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.54",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@expo/match-media": "^0.3.0",
|
|
24
|
-
"@tamagui/helpers": "^1.0.1-beta.
|
|
24
|
+
"@tamagui/helpers": "^1.0.1-beta.54",
|
|
25
25
|
"@tamagui/ow": "^0.28.1",
|
|
26
|
-
"@tamagui/use-debounce": "^1.0.1-beta.
|
|
27
|
-
"@tamagui/use-force-update": "^1.0.1-beta.
|
|
26
|
+
"@tamagui/use-debounce": "^1.0.1-beta.54",
|
|
27
|
+
"@tamagui/use-force-update": "^1.0.1-beta.54",
|
|
28
28
|
"expo-screen-orientation": "^4.2.0",
|
|
29
29
|
"hyphenate-style-name": "^1.0.4",
|
|
30
30
|
"inline-style-prefixer": "^6.0.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react-native-web": "*"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
39
|
+
"@tamagui/build": "^1.0.1-beta.54",
|
|
40
40
|
"@types/react": "^17.0.35",
|
|
41
41
|
"csstype": "^3.0.10",
|
|
42
42
|
"esbuild": "^0.14.36",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAUN,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAUN,MAAM,OAAO,CAAA;AAyBd,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAGhB,cAAc,EAGf,MAAM,SAAS,CAAA;AAgBhB,eAAO,MAAM,QAAQ,eAAsB,CAAA;AA0B3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,GAAG,EAAE,EACtC,GAAG,GAAG,cAAc,EACpB,SAAS,GAAG,KAAK,EACjB,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,kBAAkB,EAAE,eAAe,CAAC,EAAE,iBAAiB,4DAw0B1F;AAGD,eAAO,MAAM,QAAQ;YAAW;QAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;KAAE;;CAEjD,CAAA;AAMD,aAAK,cAAc,GAAG,UAAU,GAAG,YAAY,CAAA;AAE/C,oBAAY,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG;IACjE,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;IAC3B,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,cAAc,CAAA;CAC3B,CAAA;AACD,eAAO,MAAM,MAAM,0DA2CjB,CAAA;AAEF,oBAAY,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,kBAAkB,CAAA;IAC9B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC5B,CAAA;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,GACV,EAAE,mBAAmB,OAsErB;AA2BD,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,eAkBtC;AA6BD,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,QA6K3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createVariables.d.ts","sourceRoot":"","sources":["../src/createVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA8B,MAAM,kBAAkB,CAAA;AAEvE,aAAK,eAAe,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,GAAG,GAAG,IAAI;IACxD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,eAAe,CAAC,GAAG,CAAC,CAAA;CAC1C,CAAA;AAED,aAAK,kBAAkB,CAAC,CAAC,SAAS,eAAe,IAAI;KAClD,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,GAAG,MAAM,GAC5C,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAChB,CAAC,CAAC,GAAG,CAAC,SAAS,eAAe,GAC9B,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAC1B,KAAK;CACV,CAAA;AAED,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"createVariables.d.ts","sourceRoot":"","sources":["../src/createVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA8B,MAAM,kBAAkB,CAAA;AAEvE,aAAK,eAAe,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,GAAG,GAAG,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AA;AAED,eAAO,MAAM,iBAAiB,EAAE,aAM/B,CAAA;AAID,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAA;AAED,eAAO,MAAM,WAAW,YACb,MAAM,gBACD,kBAAkB,SACzB,WAAW,SACX,GAAG,SACH,eAAe,sBACF,OAAO,KAC1B,SAeF,CAAA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,GAAG,QAI9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useId.d.ts","sourceRoot":"","sources":["../../src/hooks/useId.tsx"],"names":[],"mappings":"AA+EA,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;AAC3C,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;AAC3C,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAC7D,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;AAC1E,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;AAC1E,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;AAC5F,iBAAS,KAAK,IAAI,MAAM,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"useId.d.ts","sourceRoot":"","sources":["../../src/hooks/useId.tsx"],"names":[],"mappings":"AA+EA,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;AAC3C,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;AAC3C,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAC7D,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;AAC1E,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;AAC1E,iBAAS,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;AAC5F,iBAAS,KAAK,IAAI,MAAM,GAAG,SAAS,CAAA;AA4CpC,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
package/types/views/Slot.d.ts
CHANGED
|
@@ -6,4 +6,5 @@ export declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.Ref
|
|
|
6
6
|
export declare const Slottable: ({ children }: {
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
}) => JSX.Element;
|
|
9
|
+
export declare function mergeEvent(a?: Function, b?: Function): (...args: unknown[]) => void;
|
|
9
10
|
//# sourceMappingURL=Slot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slot.d.ts","sourceRoot":"","sources":["../../src/views/Slot.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,oBAAY,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,IAAI,+EAOf,CAAA;AAgCF,eAAO,MAAM,SAAS;cAA8B,MAAM,SAAS;iBAElE,CAAA"}
|
|
1
|
+
{"version":3,"file":"Slot.d.ts","sourceRoot":"","sources":["../../src/views/Slot.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,oBAAY,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,IAAI,+EAOf,CAAA;AAgCF,eAAO,MAAM,SAAS;cAA8B,MAAM,SAAS;iBAElE,CAAA;AA2DD,wBAAgB,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,QAAQ,aAClC,OAAO,EAAE,UAI3B"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var nativeGestureHandler_exports = {};
|
|
20
|
-
__export(nativeGestureHandler_exports, {
|
|
21
|
-
BaseButton: () => BaseButton
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(nativeGestureHandler_exports);
|
|
24
|
-
const BaseButton = /* @__PURE__ */ __name((props) => props.children, "BaseButton");
|
|
25
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
-
0 && (module.exports = {
|
|
27
|
-
BaseButton
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=nativeGestureHandler.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/nativeGestureHandler.ts"],
|
|
4
|
-
"sourcesContent": ["export const BaseButton = (props: any) => props.children\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,aAAa,wBAAC,UAAe,MAAM,UAAtB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var nativeGestureHandler_native_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(nativeGestureHandler_native_exports);
|
|
17
|
-
__reExport(nativeGestureHandler_native_exports, require("react-native-gesture-handler"), module.exports);
|
|
18
|
-
//# sourceMappingURL=nativeGestureHandler.native.js.map
|