@tamagui/core 1.0.0-alpha.2 → 1.0.0-alpha.4
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/.ultra.cache.json +1 -1
- package/dist/createComponent.js +1 -1
- package/dist/createComponent.js.map +2 -2
- package/dist/hooks/useMedia.js +1 -1
- package/dist/hooks/useMedia.js.map +2 -2
- package/dist/hooks/useTheme.js +1 -1
- package/dist/hooks/useTheme.js.map +2 -2
- package/dist/index.cjs +56 -78
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +0 -1
- package/dist/index.js.map +2 -2
- package/package.json +4 -2
- package/src/createComponent.tsx +1 -1
- package/src/hooks/useMedia.tsx +1 -1
- package/src/hooks/useTheme.tsx +1 -1
- package/src/index.ts +0 -1
- package/types.d.ts +0 -1
- package/src/hooks/useForceUpdate.tsx +0 -26
package/dist/index.js
CHANGED
|
@@ -16,7 +16,6 @@ export * from "./helpers/getStylesAtomic";
|
|
|
16
16
|
export * from "./helpers/matchMedia";
|
|
17
17
|
export * from "./helpers/themeable";
|
|
18
18
|
export * from "./hooks/useConstant";
|
|
19
|
-
export * from "./hooks/useForceUpdate";
|
|
20
19
|
export * from "./hooks/useMedia";
|
|
21
20
|
export * from "./hooks/useTheme";
|
|
22
21
|
export * from "./views/Animated";
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './createComponent'\nexport * from './createShorthands'\nexport * from './createTheme'\nexport * from './createTamagui'\nexport * from './createFont'\nexport { createTokens } from './createTokens'\nexport * from './createVariable'\nexport * from './styled'\nexport * from './types'\n\nexport * from './constants/pseudos'\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport * from './constants/rnw'\n\nexport * from './helpers/isObj'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/matchMedia'\nexport * from './helpers/themeable'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/
|
|
5
|
-
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["export * from './createComponent'\nexport * from './createShorthands'\nexport * from './createTheme'\nexport * from './createTamagui'\nexport * from './createFont'\nexport { createTokens } from './createTokens'\nexport * from './createVariable'\nexport * from './styled'\nexport * from './types'\n\nexport * from './constants/pseudos'\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport * from './constants/rnw'\n\nexport * from './helpers/isObj'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/matchMedia'\nexport * from './helpers/themeable'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/useMedia'\nexport * from './hooks/useTheme'\n\nexport * from './views/Animated'\nexport * from './views/Stack'\nexport * from './views/Text'\nexport * from './views/Theme'\nexport * from './views/ThemeInverse'\nexport * from './views/ThemeProvider'\nexport * from './views/TextAncestorContext'\nexport * from './views/SafeAreaProvider'\n"],
|
|
5
|
+
"mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@tamagui/helpers": "^1.0.0-alpha.2",
|
|
14
|
+
"@tamagui/use-debounce": "^1.0.0-alpha.4",
|
|
15
|
+
"@tamagui/use-force-update": "^1.0.0-alpha.4",
|
|
14
16
|
"react": "*",
|
|
15
17
|
"react-dom": "*",
|
|
16
18
|
"react-native-safe-area-context": "^3.3.0"
|
|
@@ -30,5 +32,5 @@
|
|
|
30
32
|
"engines": {
|
|
31
33
|
"node": ">=16"
|
|
32
34
|
},
|
|
33
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "3e3b5401f9daea70cf9a99782d325f58357ca681"
|
|
34
36
|
}
|
package/src/createComponent.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { concatClassName, stylePropsView } from '@tamagui/helpers'
|
|
2
|
+
import { useForceUpdate } from '@tamagui/use-force-update'
|
|
2
3
|
import React, {
|
|
3
4
|
Children,
|
|
4
5
|
Fragment,
|
|
@@ -20,7 +21,6 @@ import { addStylesUsingClassname, useStylesAsClassname } from './helpers/addStyl
|
|
|
20
21
|
import { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'
|
|
21
22
|
import { getSplitStyles } from './helpers/getSplitStyles'
|
|
22
23
|
import { useFeatures } from './hooks/useFeatures'
|
|
23
|
-
import { useForceUpdate } from './hooks/useForceUpdate'
|
|
24
24
|
import { usePressable } from './hooks/usePressable'
|
|
25
25
|
import {
|
|
26
26
|
SpaceTokens,
|
package/src/hooks/useMedia.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useForceUpdate } from '@tamagui/use-force-update'
|
|
1
2
|
import { useRef } from 'react'
|
|
2
3
|
|
|
3
4
|
import { useIsomorphicLayoutEffect } from '../constants/platform'
|
|
@@ -9,7 +10,6 @@ import {
|
|
|
9
10
|
MediaQueryState,
|
|
10
11
|
} from '../types'
|
|
11
12
|
import { useConstant } from './useConstant'
|
|
12
|
-
import { useForceUpdate } from './useForceUpdate'
|
|
13
13
|
|
|
14
14
|
export const mediaState: { [key in keyof MediaQueryState]: boolean } = {} as any
|
|
15
15
|
const mediaQueryListeners: { [key: string]: Set<Function> } = {}
|
package/src/hooks/useTheme.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useForceUpdate } from '@tamagui/use-force-update'
|
|
1
2
|
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react'
|
|
2
3
|
|
|
3
4
|
import { useIsomorphicLayoutEffect } from '../constants/platform'
|
|
@@ -6,7 +7,6 @@ import { ThemeName } from '../types'
|
|
|
6
7
|
import { ThemeContext } from '../views/ThemeContext'
|
|
7
8
|
import { ThemeManagerContext } from '../views/ThemeManagerContext'
|
|
8
9
|
import { GET_DEFAULT_THEME } from '../views/ThemeProvider'
|
|
9
|
-
import { useForceUpdate } from './useForceUpdate'
|
|
10
10
|
|
|
11
11
|
type UseThemeState = {
|
|
12
12
|
uuid: Object
|
package/src/index.ts
CHANGED
package/types.d.ts
CHANGED
|
@@ -492,7 +492,6 @@ export interface ThemeableHOC {
|
|
|
492
492
|
<R extends ReactElement<any, any> | null, P extends ThemeableProps = {}>(component: (props: P) => R): (props: P) => R;
|
|
493
493
|
}
|
|
494
494
|
export declare function useConstant<T>(fn: () => T): T;
|
|
495
|
-
export declare function useForceUpdate(): Function;
|
|
496
495
|
export declare const mediaState: {
|
|
497
496
|
[key in keyof MediaQueryState]: boolean;
|
|
498
497
|
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react'
|
|
2
|
-
|
|
3
|
-
// ensures no updates after unmount
|
|
4
|
-
|
|
5
|
-
export function useForceUpdate() {
|
|
6
|
-
const setState = useState(0)[1]
|
|
7
|
-
const internal = useRef<{ update: Function; isMounted: boolean }>()
|
|
8
|
-
if (!internal.current) {
|
|
9
|
-
internal.current = {
|
|
10
|
-
isMounted: true,
|
|
11
|
-
update: () => {
|
|
12
|
-
if (internal.current!.isMounted) {
|
|
13
|
-
setState(Math.random())
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
return () => {
|
|
21
|
-
internal.current!.isMounted = false
|
|
22
|
-
}
|
|
23
|
-
}, [])
|
|
24
|
-
|
|
25
|
-
return internal.current.update
|
|
26
|
-
}
|