@tamagui/core 1.84.2 → 1.85.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "1.84.2",
3
+ "version": "1.85.1",
4
4
  "source": "src/index.tsx",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -35,16 +35,16 @@
35
35
  "native-test.d.ts"
36
36
  ],
37
37
  "dependencies": {
38
- "@tamagui/react-native-use-pressable": "1.84.2",
39
- "@tamagui/react-native-use-responder-events": "1.84.2",
40
- "@tamagui/use-event": "1.84.2",
41
- "@tamagui/web": "1.84.2"
38
+ "@tamagui/react-native-use-pressable": "1.85.1",
39
+ "@tamagui/react-native-use-responder-events": "1.85.1",
40
+ "@tamagui/use-event": "1.85.1",
41
+ "@tamagui/web": "1.85.1"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": "*"
45
45
  },
46
46
  "devDependencies": {
47
- "@tamagui/build": "1.84.2",
47
+ "@tamagui/build": "1.85.1",
48
48
  "@testing-library/react": "^14.0.0",
49
49
  "csstype": "^3.0.10",
50
50
  "react": "^18.2.0",
@@ -1,4 +1,4 @@
1
- export const getBoundingClientRect = (node: HTMLElement | null): void | DOMRect => {
1
+ export const getBoundingClientRect = (node: HTMLElement | null): undefined | DOMRect => {
2
2
  if (!node || node.nodeType !== 1) return
3
3
  return node.getBoundingClientRect?.()
4
4
  }
package/src/index.tsx CHANGED
@@ -24,36 +24,30 @@ import { usePlatformMethods } from './hooks/usePlatformMethods'
24
24
  import { RNTextProps, RNViewProps } from './reactNativeTypes'
25
25
  import { usePressability } from './vendor/Pressability'
26
26
 
27
- // re-exports all of @tamagui/web just adds hooks
28
- export * from '@tamagui/web'
29
- // fixes issues with TS saying internal type usage is breaking
30
- // see https://discord.com/channels/909986013848412191/1146150253490348112/1146150253490348112
31
- export * from './reactNativeTypes'
32
-
33
- // adds extra types to Stack/Text:
27
+ // adds extra types to View/Stack/Text:
34
28
 
35
29
  type RNExclusiveViewProps = Omit<RNViewProps, keyof StackProps>
36
-
37
- type ViewType = TamaguiComponent<
30
+ type RNTamaguiView = TamaguiComponent<
38
31
  StackProps & RNExclusiveViewProps,
39
32
  TamaguiElement,
40
33
  StackPropsBase & RNExclusiveViewProps,
41
34
  void
42
35
  >
43
36
 
44
- // the same:
45
- export const View = WebView as any as ViewType
46
- export const Stack = WebStack as any as ViewType
47
-
48
37
  type RNExclusiveTextProps = Omit<RNTextProps, keyof TextProps>
49
-
50
- export const Text = WebText as any as TamaguiComponent<
38
+ type RNTamaguiText = TamaguiComponent<
51
39
  TextProps & RNExclusiveTextProps,
52
40
  TamaguiTextElement,
53
41
  TextPropsBase & RNExclusiveTextProps,
54
42
  void
55
43
  >
56
44
 
45
+ // re-exports all of @tamagui/web just adds hooks
46
+ export * from '@tamagui/web'
47
+ // fixes issues with TS saying internal type usage is breaking
48
+ // see https://discord.com/channels/909986013848412191/1146150253490348112/1146150253490348112
49
+ export * from './reactNativeTypes'
50
+
57
51
  const baseViews = getBaseViews()
58
52
 
59
53
  // setup internal hooks:
@@ -222,3 +216,9 @@ setupHooks({
222
216
  const dontComposePressabilityKeys = {
223
217
  onClick: true,
224
218
  }
219
+
220
+ // overwrite web versions:
221
+ // putting at the end ensures it overwrites in dist/cjs/index.js
222
+ export const View = WebView as any as RNTamaguiView
223
+ export const Stack = WebStack as any as RNTamaguiView
224
+ export const Text = WebText as any as RNTamaguiText
@@ -1,2 +1,2 @@
1
- export declare const getBoundingClientRect: (node: HTMLElement | null) => void | DOMRect;
1
+ export declare const getBoundingClientRect: (node: HTMLElement | null) => undefined | DOMRect;
2
2
  //# sourceMappingURL=getBoundingClientRect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBoundingClientRect.d.ts","sourceRoot":"","sources":["../../src/helpers/getBoundingClientRect.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,SAAU,WAAW,GAAG,IAAI,KAAG,IAAI,GAAG,OAGvE,CAAA"}
1
+ {"version":3,"file":"getBoundingClientRect.d.ts","sourceRoot":"","sources":["../../src/helpers/getBoundingClientRect.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,SAAU,WAAW,GAAG,IAAI,KAAG,SAAS,GAAG,OAG5E,CAAA"}
package/types/index.d.ts CHANGED
@@ -1,16 +1,12 @@
1
- /// <reference types="react" />
2
- import type { StackProps, StackPropsBase, TamaguiComponent, TamaguiElement, TamaguiTextElement, TextProps } from '@tamagui/web';
1
+ import type { StackProps, StackPropsBase, TamaguiComponent, TamaguiElement, TamaguiTextElement, TextProps, TextPropsBase } from '@tamagui/web';
3
2
  import { RNTextProps, RNViewProps } from './reactNativeTypes';
4
- export * from '@tamagui/web';
5
- export * from './reactNativeTypes';
6
3
  type RNExclusiveViewProps = Omit<RNViewProps, keyof StackProps>;
7
- type ViewType = TamaguiComponent<StackProps & RNExclusiveViewProps, TamaguiElement, StackPropsBase & RNExclusiveViewProps, void>;
8
- export declare const View: ViewType;
9
- export declare const Stack: ViewType;
4
+ type RNTamaguiView = TamaguiComponent<StackProps & RNExclusiveViewProps, TamaguiElement, StackPropsBase & RNExclusiveViewProps, void>;
10
5
  type RNExclusiveTextProps = Omit<RNTextProps, keyof TextProps>;
11
- export declare const Text: TamaguiComponent<Omit<import("react-native").TextProps, "style" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/web").ExtendBaseTextProps & import("@tamagui/web").WebOnlyPressEvents & import("@tamagui/web").TamaguiComponentPropsBaseBase & {
12
- style?: import("@tamagui/web").StyleProp<import("react-native").TextStyle | import("react").CSSProperties | (import("react").CSSProperties & import("react-native").TextStyle)>;
13
- } & import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>> & import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>>> & import("@tamagui/web").MediaProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>> & import("@tamagui/web").PseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>>>> & RNExclusiveTextProps, TamaguiTextElement, Omit<import("react-native").TextProps, "style" | "children" | ("onLayout" | keyof import("react-native").GestureResponderHandlers)> & import("@tamagui/web").ExtendBaseTextProps & import("@tamagui/web").WebOnlyPressEvents & import("@tamagui/web").TamaguiComponentPropsBaseBase & {
14
- style?: import("@tamagui/web").StyleProp<import("react-native").TextStyle | import("react").CSSProperties | (import("react").CSSProperties & import("react-native").TextStyle)>;
15
- } & import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").TextStylePropsBase>> & RNExclusiveTextProps, void>;
6
+ type RNTamaguiText = TamaguiComponent<TextProps & RNExclusiveTextProps, TamaguiTextElement, TextPropsBase & RNExclusiveTextProps, void>;
7
+ export * from '@tamagui/web';
8
+ export * from './reactNativeTypes';
9
+ export declare const View: RNTamaguiView;
10
+ export declare const Stack: RNTamaguiView;
11
+ export declare const Text: RNTamaguiText;
16
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,SAAS,EAEV,MAAM,cAAc,CAAA;AAcr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