@tamagui/core 1.0.1-beta.186 → 1.0.1-beta.187
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/addTheme.js +2 -2
- package/dist/cjs/addTheme.js.map +2 -2
- package/dist/cjs/constants/constants.js +2 -2
- package/dist/cjs/constants/constants.js.map +2 -2
- package/dist/cjs/createComponent.js +25 -25
- package/dist/cjs/createComponent.js.map +3 -3
- package/dist/cjs/createTamagui.js +3 -3
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createVariable.js +3 -3
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/helpers/calc.js +2 -2
- package/dist/cjs/helpers/calc.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +5 -5
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/expandStyle.js +2 -2
- package/dist/cjs/helpers/expandStyle.js.map +2 -2
- package/dist/cjs/helpers/expandStyles.js +2 -2
- package/dist/cjs/helpers/expandStyles.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +11 -11
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/hooks/useDidFinishSSR.js +60 -0
- package/dist/cjs/hooks/useDidFinishSSR.js.map +7 -0
- package/dist/cjs/hooks/useIsMounted.js +2 -2
- package/dist/cjs/hooks/useIsMounted.js.map +2 -2
- package/dist/cjs/hooks/useIsSSR.js +3 -3
- package/dist/cjs/hooks/useIsSSR.js.map +2 -2
- package/dist/cjs/hooks/useIsTouchDevice.js +4 -4
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +2 -2
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/useSafeRef.js +2 -2
- package/dist/cjs/hooks/useSafeRef.js.map +2 -2
- package/dist/cjs/hooks/useServerHooks.js +3 -3
- package/dist/cjs/hooks/useServerHooks.js.map +2 -2
- package/dist/cjs/hooks/useTheme.js +7 -7
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/views/Slot.js +2 -2
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/TamaguiProvider.js +6 -4
- package/dist/cjs/views/TamaguiProvider.js.map +2 -2
- package/dist/cjs/views/Text.js +5 -5
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/Theme.js +2 -2
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/cjs/views/ThemeInverse.js +2 -2
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeReset.js +2 -2
- package/dist/cjs/views/ThemeReset.js.map +2 -2
- package/dist/esm/addTheme.js +1 -1
- package/dist/esm/addTheme.js.map +2 -2
- package/dist/esm/constants/constants.js +1 -1
- package/dist/esm/constants/constants.js.map +1 -1
- package/dist/esm/createComponent.js +1 -1
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createTamagui.js +1 -1
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createVariable.js +1 -1
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/helpers/calc.js +1 -1
- package/dist/esm/helpers/calc.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +1 -1
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/expandStyle.js +1 -1
- package/dist/esm/helpers/expandStyle.js.map +1 -1
- package/dist/esm/helpers/expandStyles.js +1 -1
- package/dist/esm/helpers/expandStyles.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +1 -1
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/hooks/useDidFinishSSR.js +35 -0
- package/dist/esm/hooks/useDidFinishSSR.js.map +7 -0
- package/dist/esm/hooks/useIsMounted.js +1 -1
- package/dist/esm/hooks/useIsMounted.js.map +2 -2
- package/dist/esm/hooks/useIsSSR.js +1 -1
- package/dist/esm/hooks/useIsSSR.js.map +2 -2
- package/dist/esm/hooks/useIsTouchDevice.js +1 -1
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +1 -1
- package/dist/esm/hooks/useMedia.js.map +2 -2
- package/dist/esm/hooks/useSafeRef.js +1 -1
- package/dist/esm/hooks/useSafeRef.js.map +2 -2
- package/dist/esm/hooks/useServerHooks.js +1 -1
- package/dist/esm/hooks/useServerHooks.js.map +2 -2
- package/dist/esm/hooks/useTheme.js +1 -1
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/views/Slot.js +1 -1
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/TamaguiProvider.js +3 -1
- package/dist/esm/views/TamaguiProvider.js.map +2 -2
- package/dist/esm/views/Text.js +1 -1
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/Theme.js +1 -1
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeInverse.js +1 -1
- package/dist/esm/views/ThemeInverse.js.map +2 -2
- package/dist/esm/views/ThemeReset.js +1 -1
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/package.json +11 -10
- package/src/addTheme.ts +2 -1
- package/src/constants/constants.ts +1 -1
- package/src/createComponent.tsx +1 -1
- package/src/createTamagui.ts +2 -1
- package/src/createVariable.ts +1 -1
- package/src/helpers/calc.ts +2 -1
- package/src/helpers/createPropMapper.ts +2 -1
- package/src/helpers/expandStyle.ts +1 -1
- package/src/helpers/expandStyles.ts +2 -1
- package/src/helpers/getSplitStyles.tsx +1 -1
- package/src/hooks/useIsMounted.ts +1 -2
- package/src/hooks/useIsSSR.tsx +1 -1
- package/src/hooks/useIsTouchDevice.tsx +1 -2
- package/src/hooks/useMedia.tsx +1 -1
- package/src/hooks/useSafeRef.ts +1 -2
- package/src/hooks/useServerHooks.tsx +1 -2
- package/src/hooks/useTheme.tsx +1 -1
- package/src/index.ts +2 -1
- package/src/views/Slot.tsx +1 -2
- package/src/views/TamaguiProvider.tsx +3 -1
- package/src/views/Text.tsx +1 -1
- package/src/views/Theme.tsx +1 -1
- package/src/views/ThemeInverse.tsx +1 -1
- package/src/views/ThemeReset.tsx +1 -1
- package/types/constants/platform.d.ts +2 -2
- package/types/hooks/useDidFinishSSR.d.ts +3 -0
- package/types/index.d.ts +1 -1
package/src/hooks/useIsSSR.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { isServer, isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
1
2
|
import { useState } from 'react'
|
|
2
3
|
|
|
3
|
-
import { isServer, isWeb, useIsomorphicLayoutEffect } from '../constants/platform'
|
|
4
4
|
import { startTransition } from '../helpers/startTransition'
|
|
5
5
|
|
|
6
6
|
// because any change before first useEffect causes hydration / mismatch issues
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { isServer, isTouchable, isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
1
2
|
import { useState } from 'react'
|
|
2
3
|
|
|
3
|
-
import { isServer, isTouchable, isWeb, useIsomorphicLayoutEffect } from '../constants/platform'
|
|
4
|
-
|
|
5
4
|
// ssr friendly
|
|
6
5
|
|
|
7
6
|
export const useIsTouchDevice = () => {
|
package/src/hooks/useMedia.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
1
2
|
import { startTransition, useEffect, useMemo, useState } from 'react'
|
|
2
3
|
|
|
3
|
-
import { useIsomorphicLayoutEffect } from '../constants/platform'
|
|
4
4
|
import { matchMedia } from '../helpers/matchMedia'
|
|
5
5
|
import {
|
|
6
6
|
MediaQueries,
|
package/src/hooks/useSafeRef.ts
CHANGED
package/src/hooks/useTheme.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { isRSC, isServer, useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
1
2
|
import { useForceUpdate } from '@tamagui/use-force-update'
|
|
2
3
|
import React, { useContext, useLayoutEffect, useMemo, useRef, useState } from 'react'
|
|
3
4
|
|
|
4
5
|
import { getConfig } from '../config'
|
|
5
6
|
import { isDevTools } from '../constants/isDevTools'
|
|
6
|
-
import { isRSC, isServer, useIsomorphicLayoutEffect } from '../constants/platform'
|
|
7
7
|
import { ThemeContext } from '../contexts/ThemeContext'
|
|
8
8
|
import { areEqualSets } from '../helpers/areEqualSets'
|
|
9
9
|
import {
|
package/src/index.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type { RNWTextProps, RNWViewProps } from './types-rnw'
|
|
|
18
18
|
export { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './config'
|
|
19
19
|
|
|
20
20
|
export * from './constants/constants'
|
|
21
|
-
export * from '
|
|
21
|
+
export * from '@tamagui/constants'
|
|
22
22
|
export { createDOMProps } from '@tamagui/rnw'
|
|
23
23
|
|
|
24
24
|
export * from './helpers/calc'
|
|
@@ -48,6 +48,7 @@ export * from './hooks/useConstant'
|
|
|
48
48
|
export * from './hooks/useId'
|
|
49
49
|
export * from './hooks/useIsMounted'
|
|
50
50
|
export * from './hooks/useIsTouchDevice'
|
|
51
|
+
|
|
51
52
|
export {
|
|
52
53
|
configureMedia,
|
|
53
54
|
getMedia,
|
package/src/views/Slot.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// via radix
|
|
2
2
|
|
|
3
3
|
import { composeRefs } from '@tamagui/compose-refs'
|
|
4
|
+
import { isWeb } from '@tamagui/constants'
|
|
4
5
|
import * as React from 'react'
|
|
5
6
|
|
|
6
|
-
import { isWeb } from '../constants/platform'
|
|
7
|
-
|
|
8
7
|
/* -------------------------------------------------------------------------------------------------
|
|
9
8
|
* Slot
|
|
10
9
|
* -----------------------------------------------------------------------------------------------*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { isClient, isRSC, isServer } from '@tamagui/constants'
|
|
2
|
+
import { useSetupHasSSRRendered } from '@tamagui/use-did-finish-ssr'
|
|
1
3
|
import * as React from 'react'
|
|
2
4
|
|
|
3
|
-
import { isClient, isRSC, isServer } from '../constants/platform'
|
|
4
5
|
import { ButtonInsideButtonContext } from '../contexts/ButtonInsideButtonContext'
|
|
5
6
|
import { TextAncestorProvider } from '../contexts/TextAncestorContext'
|
|
6
7
|
import { useMediaQueryListeners } from '../hooks/useMedia'
|
|
@@ -22,6 +23,7 @@ export function TamaguiProvider({
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
if (!isServer) {
|
|
26
|
+
useSetupHasSSRRendered()
|
|
25
27
|
useMediaQueryListeners(config)
|
|
26
28
|
}
|
|
27
29
|
|
package/src/views/Text.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { isWeb } from '@tamagui/constants'
|
|
1
2
|
import { stylePropsTextOnly, validStyles } from '@tamagui/helpers'
|
|
2
3
|
import { Text as TextView } from 'react-native'
|
|
3
4
|
|
|
4
|
-
import { isWeb } from '../constants/platform'
|
|
5
5
|
import { createComponent } from '../createComponent'
|
|
6
6
|
import { TextProps, TextPropsBase } from '../types'
|
|
7
7
|
|
package/src/views/Theme.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { isWeb } from '@tamagui/constants'
|
|
1
2
|
import React, { memo, useMemo } from 'react'
|
|
2
3
|
|
|
3
|
-
import { isWeb } from '../constants/platform'
|
|
4
4
|
import { variableToString } from '../createVariable'
|
|
5
5
|
import { ThemeManager, ThemeManagerContext } from '../helpers/ThemeManager'
|
|
6
6
|
import { ThemeProps, useChangeThemeEffect } from '../hooks/useTheme'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
1
2
|
import React, { useState } from 'react'
|
|
2
3
|
|
|
3
|
-
import { useIsomorphicLayoutEffect } from '../constants/platform'
|
|
4
4
|
import { useDefaultThemeName, useThemeName } from '../hooks/useTheme'
|
|
5
5
|
import { Theme } from './Theme'
|
|
6
6
|
|
package/src/views/ThemeReset.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLayoutEffect } from 'react';
|
|
2
2
|
export declare const isAndroid: boolean;
|
|
3
3
|
export declare const isIOS: boolean;
|
|
4
4
|
export declare const isWeb: boolean;
|
|
@@ -6,7 +6,7 @@ export declare const isWindowDefined: boolean;
|
|
|
6
6
|
export declare const isServer: boolean;
|
|
7
7
|
export declare const isClient: boolean;
|
|
8
8
|
export declare const isRSC: any;
|
|
9
|
-
export declare const useIsomorphicLayoutEffect: typeof
|
|
9
|
+
export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
10
10
|
export declare const isChrome: boolean;
|
|
11
11
|
export declare const isWebTouchable: boolean;
|
|
12
12
|
export declare const isTouchable: boolean;
|
package/types/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export * from './types';
|
|
|
15
15
|
export type { RNWTextProps, RNWViewProps } from './types-rnw';
|
|
16
16
|
export { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './config';
|
|
17
17
|
export * from './constants/constants';
|
|
18
|
-
export * from '
|
|
18
|
+
export * from '@tamagui/constants';
|
|
19
19
|
export { createDOMProps } from '@tamagui/rnw';
|
|
20
20
|
export * from './helpers/calc';
|
|
21
21
|
export * from './helpers/useShallowSetState';
|