@tamagui/core 1.112.5 → 1.112.7

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.
Files changed (47) hide show
  1. package/dist/cjs/index.js +2 -22
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/index.native.js.map +1 -1
  4. package/dist/esm/index.js +2 -22
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/esm/index.mjs +2 -19
  7. package/dist/esm/index.mjs.map +1 -1
  8. package/dist/esm/index.native.js.map +1 -1
  9. package/dist/native.js +35 -13
  10. package/dist/native.js.map +1 -1
  11. package/dist/test.native.js +34 -12
  12. package/dist/test.native.js.map +1 -1
  13. package/package.json +6 -6
  14. package/src/index.tsx +2 -24
  15. package/types/index.d.ts.map +1 -1
  16. package/dist/cjs/hooks/usePlatformMethods.js +0 -32
  17. package/dist/cjs/hooks/usePlatformMethods.js.map +0 -6
  18. package/dist/cjs/hooks/usePlatformMethods.native.js +0 -46
  19. package/dist/cjs/hooks/usePlatformMethods.native.js.map +0 -6
  20. package/dist/cjs/react-native-web/Dimensions.js +0 -79
  21. package/dist/cjs/react-native-web/Dimensions.js.map +0 -6
  22. package/dist/cjs/react-native-web/Dimensions.native.js +0 -87
  23. package/dist/cjs/react-native-web/Dimensions.native.js.map +0 -6
  24. package/dist/cjs/react-native-web.js +0 -35
  25. package/dist/cjs/react-native-web.js.map +0 -6
  26. package/dist/esm/hooks/usePlatformMethods.js +0 -18
  27. package/dist/esm/hooks/usePlatformMethods.js.map +0 -6
  28. package/dist/esm/hooks/usePlatformMethods.mjs +0 -21
  29. package/dist/esm/hooks/usePlatformMethods.mjs.map +0 -1
  30. package/dist/esm/hooks/usePlatformMethods.native.js +0 -28
  31. package/dist/esm/hooks/usePlatformMethods.native.js.map +0 -1
  32. package/dist/esm/react-native-web/Dimensions.js +0 -63
  33. package/dist/esm/react-native-web/Dimensions.js.map +0 -6
  34. package/dist/esm/react-native-web/Dimensions.mjs +0 -61
  35. package/dist/esm/react-native-web/Dimensions.mjs.map +0 -1
  36. package/dist/esm/react-native-web/Dimensions.native.js +0 -67
  37. package/dist/esm/react-native-web/Dimensions.native.js.map +0 -1
  38. package/dist/esm/react-native-web.js +0 -19
  39. package/dist/esm/react-native-web.js.map +0 -6
  40. package/dist/esm/react-native-web.mjs +0 -17
  41. package/dist/esm/react-native-web.mjs.map +0 -1
  42. package/types/hooks/usePlatformMethods.d.ts +0 -4
  43. package/types/hooks/usePlatformMethods.d.ts.map +0 -1
  44. package/types/react-native-web/Dimensions.d.ts +0 -22
  45. package/types/react-native-web/Dimensions.d.ts.map +0 -1
  46. package/types/react-native-web.d.ts +0 -29
  47. package/types/react-native-web.d.ts.map +0 -1
@@ -1,67 +0,0 @@
1
- var dimensions = {
2
- window: {
3
- fontScale: 1,
4
- height: 0,
5
- scale: 1,
6
- width: 0
7
- },
8
- screen: {
9
- fontScale: 1,
10
- height: 0,
11
- scale: 1,
12
- width: 0
13
- }
14
- },
15
- listeners = {},
16
- canUseDOM = typeof window < "u",
17
- shouldInit = canUseDOM;
18
- function update() {
19
- if (canUseDOM) {
20
- var win = window,
21
- docEl = win.document.documentElement;
22
- dimensions.window = {
23
- fontScale: 1,
24
- height: docEl.clientHeight,
25
- scale: win.devicePixelRatio || 1,
26
- width: docEl.clientWidth
27
- }, dimensions.screen = {
28
- fontScale: 1,
29
- height: win.screen.height,
30
- scale: win.devicePixelRatio || 1,
31
- width: win.screen.width
32
- };
33
- }
34
- }
35
- function handleResize() {
36
- update(), Array.isArray(listeners.change) && listeners.change.forEach(function (handler) {
37
- return handler(dimensions);
38
- });
39
- }
40
- var Dimensions = {
41
- get(dimension) {
42
- if (shouldInit && (shouldInit = !1, update()), dimensions[dimension] === void 0) throw new Error(`No dimension set for key ${dimension}`);
43
- return dimensions[dimension];
44
- },
45
- set(initialDimensions) {
46
- if (initialDimensions) {
47
- if (canUseDOM) throw new Error("Dimensions cannot be set in the browser");
48
- initialDimensions.screen != null && (dimensions.screen = initialDimensions.screen), initialDimensions.window != null && (dimensions.window = initialDimensions.window);
49
- }
50
- },
51
- addEventListener(type, handler) {
52
- var _this = this;
53
- return listeners[type] = listeners[type] || [], listeners[type].push(handler), {
54
- remove: function () {
55
- _this.removeEventListener(type, handler);
56
- }
57
- };
58
- },
59
- removeEventListener(type, handler) {
60
- Array.isArray(listeners[type]) && (listeners[type] = listeners[type].filter(function (_handler) {
61
- return _handler !== handler;
62
- }));
63
- }
64
- };
65
- canUseDOM && window.addEventListener("resize", handleResize, !1);
66
- export { Dimensions };
67
- //# sourceMappingURL=Dimensions.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["dimensions","window","fontScale","height","scale","width","screen","listeners","canUseDOM","shouldInit","update","win","docEl","document","documentElement","clientHeight","devicePixelRatio","clientWidth","handleResize","Array","isArray","change","forEach","handler","Dimensions","get","dimension","Error","set","initialDimensions","addEventListener","type","_this","push","remove","removeEventListener","filter","_handler"],"sources":["../../../src/react-native-web/Dimensions.ts"],"sourcesContent":[null],"mappings":"AAeA,IAAAA,UAAM;IACJC,MAAA,EAAQ;MACNC,SAAA,EAAW;MACXC,MAAA,EAAQ;MACRC,KAAA,EAAO;MACPC,KAAA,EAAO;IACT;IACAC,MAAA,EAAQ;MACNJ,SAAA,EAAW;MACXC,MAAA,EAAQ;MACRC,KAAA,EAAO;MACPC,KAAA,EAAO;IACT;EACF;EAEME,SAAA,GAAY,CAAC;EAEbC,SAAA,GAAY,OAAOP,MAAA,GAAW;EAAAQ,UAAA,GAAAD,SAAA;AACpC,SAAIE,OAAA,EAAa;EAEjB,IAAAF,SAAS;IACP,IAAKG,GAAA,GAAAV,MAAA;MAAAW,KAAA,GAAAD,GAAA,CAAAE,QAAA,CAAAC,eAAA;IACHd,UAAA,CAAAC,MAAA;MAGFC,SAAY;MAGZC,MAAA,EAAWS,KAAA,CAAAG,YAAS;MAClBX,KAAA,EAAAO,GAAW,CAAAK,gBAAA;MACXX,KAAA,EAAQO,KAAM,CAA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AUR,OAAK;IAGnCJ,KAAA,CAAAC,OAAA,CAAAb,SAAA,CAAAwB,IAAA,OAAAxB,SAAA,CAAAwB,IAAA,IAAAxB,SAAA,CAAAwB,IAAA,EAAAK,MAAA,WAAAC,QAAA;MACF,OAAAA,QAAA,KAAAd,OAAA;IAEI","ignoreList":[]}
@@ -1,19 +0,0 @@
1
- export * from "@tamagui/react-native-use-responder-events";
2
- export * from "@tamagui/react-native-use-pressable";
3
- export * from "./index";
4
- const Platform = {
5
- OS: "web",
6
- select(obj) {
7
- return obj.web;
8
- }
9
- }, StyleSheet = {
10
- create(obj) {
11
- return obj;
12
- }
13
- }, Pressable = () => null;
14
- export {
15
- Platform,
16
- Pressable,
17
- StyleSheet
18
- };
19
- //# sourceMappingURL=react-native-web.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/react-native-web.ts"],
4
- "mappings": "AAEA,cAAc;AACd,cAAc;AACd,cAAc;AAEP,MAAM,WAAW;AAAA,EACtB,IAAI;AAAA,EAEJ,OAAO,KAAK;AACV,WAAO,IAAI;AAAA,EACb;AACF,GAEa,aAAa;AAAA,EACxB,OAAO,KAAK;AACV,WAAO;AAAA,EACT;AACF,GAEa,YAAY,MAChB;",
5
- "names": []
6
- }
@@ -1,17 +0,0 @@
1
- export * from "@tamagui/react-native-use-responder-events";
2
- export * from "@tamagui/react-native-use-pressable";
3
- export * from "./index.mjs";
4
- const Platform = {
5
- OS: "web",
6
- select(obj) {
7
- return obj.web;
8
- }
9
- },
10
- StyleSheet = {
11
- create(obj) {
12
- return obj;
13
- }
14
- },
15
- Pressable = () => null;
16
- export { Platform, Pressable, StyleSheet };
17
- //# sourceMappingURL=react-native-web.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Platform","OS","select","obj","web","StyleSheet","create","Pressable"],"sources":["../../src/react-native-web.ts"],"sourcesContent":[null],"mappings":"AAEA,cAAc;AACd,cAAc;AACd,cAAc;AAEP,MAAMA,QAAA,GAAW;IACtBC,EAAA,EAAI;IAEJC,OAAOC,GAAA,EAAK;MACV,OAAOA,GAAA,CAAIC,GAAA;IACb;EACF;EAEaC,UAAA,GAAa;IACxBC,OAAOH,GAAA,EAAK;MACV,OAAOA,GAAA;IACT;EACF;EAEaI,SAAA,GAAYA,CAAA,KAChB","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- import type { RefObject } from 'react';
2
- import type { TamaguiComponentStateRef } from '@tamagui/web';
3
- export declare function usePlatformMethods(stateRef: RefObject<TamaguiComponentStateRef>, props?: Object): void;
4
- //# sourceMappingURL=usePlatformMethods.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePlatformMethods.d.ts","sourceRoot":"","sources":["../../src/hooks/usePlatformMethods.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,QAmB7D"}
@@ -1,22 +0,0 @@
1
- export type DisplayMetrics = {
2
- fontScale: number;
3
- height: number;
4
- scale: number;
5
- width: number;
6
- };
7
- type DimensionsValue = {
8
- window: DisplayMetrics;
9
- screen: DisplayMetrics;
10
- };
11
- type DimensionKey = 'window' | 'screen';
12
- type DimensionEventListenerType = 'change';
13
- export declare const Dimensions: {
14
- get(dimension: DimensionKey): DisplayMetrics;
15
- set(initialDimensions: DimensionsValue | null): void;
16
- addEventListener(type: DimensionEventListenerType, handler: (dimensionsValue: DimensionsValue) => void): {
17
- remove: () => void;
18
- };
19
- removeEventListener(type: DimensionEventListenerType, handler: (dimensionsValue: DimensionsValue) => void): void;
20
- };
21
- export {};
22
- //# sourceMappingURL=Dimensions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Dimensions.d.ts","sourceRoot":"","sources":["../../src/react-native-web/Dimensions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,cAAc,CAAA;IACtB,MAAM,EAAE,cAAc,CAAA;CACvB,CAAA;AAED,KAAK,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAA;AACvC,KAAK,0BAA0B,GAAG,QAAQ,CAAA;AAoD1C,eAAO,MAAM,UAAU;mBACN,YAAY,GAAG,cAAc;2BAUrB,eAAe,GAAG,IAAI,GAAG,IAAI;2BAe5C,0BAA0B,WACvB,CAAC,eAAe,EAAE,eAAe,KAAK,IAAI;;;8BAa7C,0BAA0B,WACvB,CAAC,eAAe,EAAE,eAAe,KAAK,IAAI,GAClD,IAAI;CAKR,CAAA"}
@@ -1,29 +0,0 @@
1
- export * from '@tamagui/react-native-use-responder-events';
2
- export * from '@tamagui/react-native-use-pressable';
3
- export { View, Text } from './index';
4
- export * from './react-native-web/Dimensions';
5
- export declare const Platform: {
6
- OS: string;
7
- select(obj: any): any;
8
- };
9
- export declare const StyleSheet: {
10
- create(obj: any): any;
11
- };
12
- export declare const Pressable: () => null;
13
- export declare const Animated: {
14
- View: import("react").ForwardRefExoticComponent<Omit<import("./index").RNTamaguiViewNonStyleProps, keyof import("@tamagui/web/types/types").StackStyleBase> & import("@tamagui/web/types/types").WithThemeValues<import("@tamagui/web/types/types").StackStyleBase> & import("@tamagui/web/types/types").WithShorthands<import("@tamagui/web/types/types").WithThemeValues<import("@tamagui/web/types/types").StackStyleBase>> & import("@tamagui/web/types/types").WithPseudoProps<import("@tamagui/web/types/types").WithThemeValues<import("@tamagui/web/types/types").StackStyleBase> & import("@tamagui/web/types/types").WithShorthands<import("@tamagui/web/types/types").WithThemeValues<import("@tamagui/web/types/types").StackStyleBase>>> & import("@tamagui/web/types/types").WithMediaProps<import("@tamagui/web/types/types").WithThemeShorthandsAndPseudos<import("@tamagui/web/types/types").StackStyleBase, {}>> & import("react").RefAttributes<import("@tamagui/web/types/types").TamaguiElement>> & import("@tamagui/web/types/types").StaticComponentObject<import("@tamagui/web/types/types").TamaDefer, import("@tamagui/web/types/types").TamaguiElement, import("./index").RNTamaguiViewNonStyleProps, import("@tamagui/web/types/types").StackStyleBase, {}, {}> & Omit<{}, "staticConfig" | "extractable" | "styleable"> & {
15
- __tama: [import("@tamagui/web/types/types").TamaDefer, import("@tamagui/web/types/types").TamaguiElement, import("./index").RNTamaguiViewNonStyleProps, import("@tamagui/web/types/types").StackStyleBase, {}, {}];
16
- };
17
- Text: import("react").ForwardRefExoticComponent<Omit<import("./index").RNTamaguiTextNonStyleProps, keyof import("@tamagui/web/types/types").TextStylePropsBase> & import("@tamagui/web/types/types").WithThemeValues<import("@tamagui/web/types/types").TextStylePropsBase> & import("@tamagui/web/types/types").WithShorthands<import("@tamagui/web/types/types").WithThemeValues<import("@tamagui/web/types/types").TextStylePropsBase>> & import("@tamagui/web/types/types").WithPseudoProps<import("@tamagui/web/types/types").WithThemeValues<import("@tamagui/web/types/types").TextStylePropsBase> & import("@tamagui/web/types/types").WithShorthands<import("@tamagui/web/types/types").WithThemeValues<import("@tamagui/web/types/types").TextStylePropsBase>>> & import("@tamagui/web/types/types").WithMediaProps<import("@tamagui/web/types/types").WithThemeShorthandsAndPseudos<import("@tamagui/web/types/types").TextStylePropsBase, {}>> & import("react").RefAttributes<import("@tamagui/web/types/types").TamaguiTextElement>> & import("@tamagui/web/types/types").StaticComponentObject<import("@tamagui/web/types/types").TamaDefer, import("@tamagui/web/types/types").TamaguiTextElement, import("./index").RNTamaguiTextNonStyleProps, import("@tamagui/web/types/types").TextStylePropsBase, {}, {}> & Omit<{}, "staticConfig" | "extractable" | "styleable"> & {
18
- __tama: [import("@tamagui/web/types/types").TamaDefer, import("@tamagui/web/types/types").TamaguiTextElement, import("./index").RNTamaguiTextNonStyleProps, import("@tamagui/web/types/types").TextStylePropsBase, {}, {}];
19
- };
20
- };
21
- export declare const ActivityIndicator: () => null;
22
- export declare const PanResponder: () => null;
23
- export declare const Switch: () => null;
24
- export declare const TextInput: () => null;
25
- export declare const ScrollView: () => null;
26
- export declare const Keyboard: {};
27
- export declare const Image: () => null;
28
- export declare const Linking: {};
29
- //# sourceMappingURL=react-native-web.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-native-web.d.ts","sourceRoot":"","sources":["../src/react-native-web.ts"],"names":[],"mappings":"AAEA,cAAc,4CAA4C,CAAA;AAC1D,cAAc,qCAAqC,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAIpC,cAAc,+BAA+B,CAAA;AAE7C,eAAO,MAAM,QAAQ;;;CAMpB,CAAA;AAED,eAAO,MAAM,UAAU;;CAItB,CAAA;AAED,eAAO,MAAM,SAAS,YAErB,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;CAGpB,CAAA;AAED,eAAO,MAAM,iBAAiB,YAE7B,CAAA;AAED,eAAO,MAAM,YAAY,YAExB,CAAA;AAED,eAAO,MAAM,MAAM,YAElB,CAAA;AAED,eAAO,MAAM,SAAS,YAErB,CAAA;AAED,eAAO,MAAM,UAAU,YAEtB,CAAA;AAED,eAAO,MAAM,QAAQ,IAAK,CAAA;AAE1B,eAAO,MAAM,KAAK,YAEjB,CAAA;AAED,eAAO,MAAM,OAAO,IAAK,CAAA"}