@tamagui/element 3.0.0-beta.924.1 → 3.0.0
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/getWebElement.native.cjs +1 -8
- package/dist/cjs/getWebElement.native.js +1 -8
- package/dist/cjs/getWebElement.native.js.map +1 -1
- package/dist/esm/getWebElement.native.js +1 -8
- package/dist/esm/getWebElement.native.js.map +1 -1
- package/package.json +7 -4
- package/src/types.ts +1 -1
- package/src/useNativeRef.ts +1 -1
- package/types/types.d.ts +1 -1
- package/types/types.d.ts.map +1 -1
- package/types/useNativeRef.d.ts +4 -5
- package/types/useNativeRef.d.ts.map +1 -1
|
@@ -23,18 +23,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
23
23
|
var getWebElement_exports = {};
|
|
24
24
|
__export(getWebElement_exports, { getWebElement: () => getWebElement });
|
|
25
25
|
module.exports = __toCommonJS(getWebElement_exports);
|
|
26
|
-
function _instanceof(left, right) {
|
|
27
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
28
|
-
return !!right[Symbol.hasInstance](left);
|
|
29
|
-
} else {
|
|
30
|
-
return left instanceof right;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
26
|
function getWebElement(element) {
|
|
34
27
|
if (!element) {
|
|
35
28
|
throw new Error("Element is null or undefined");
|
|
36
29
|
}
|
|
37
|
-
if (!
|
|
30
|
+
if (!(element instanceof HTMLElement)) {
|
|
38
31
|
throw new Error("Element is not an HTMLElement");
|
|
39
32
|
}
|
|
40
33
|
return element;
|
|
@@ -23,18 +23,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
23
23
|
var getWebElement_exports = {};
|
|
24
24
|
__export(getWebElement_exports, { getWebElement: () => getWebElement });
|
|
25
25
|
module.exports = __toCommonJS(getWebElement_exports);
|
|
26
|
-
function _instanceof(left, right) {
|
|
27
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
28
|
-
return !!right[Symbol.hasInstance](left);
|
|
29
|
-
} else {
|
|
30
|
-
return left instanceof right;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
26
|
function getWebElement(element) {
|
|
34
27
|
if (!element) {
|
|
35
28
|
throw new Error("Element is null or undefined");
|
|
36
29
|
}
|
|
37
|
-
if (!
|
|
30
|
+
if (!(element instanceof HTMLElement)) {
|
|
38
31
|
throw new Error("Element is not an HTMLElement");
|
|
39
32
|
}
|
|
40
33
|
return element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWebElement.native.js","names":[],"sources":["cjs/getWebElement.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getWebElement_exports = {};\n__export(getWebElement_exports, {\n getWebElement: () => getWebElement\n});\nmodule.exports = __toCommonJS(getWebElement_exports);\nfunction
|
|
1
|
+
{"version":3,"file":"getWebElement.native.js","names":[],"sources":["cjs/getWebElement.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getWebElement_exports = {};\n__export(getWebElement_exports, {\n getWebElement: () => getWebElement\n});\nmodule.exports = __toCommonJS(getWebElement_exports);\nfunction getWebElement(element) {\n if (!element) {\n throw new Error(\"Element is null or undefined\");\n }\n if (!(element instanceof HTMLElement)) {\n throw new Error(\"Element is not an HTMLElement\");\n }\n return element;\n}\n//# sourceMappingURL=getWebElement.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,wBAAwB,CAAC;AAC7B,SAAS,uBAAuB,EAC9B,qBAAqB,cACvB,CAAC;AACD,OAAO,UAAU,aAAa,qBAAqB;AACnD,SAAS,cAAc,SAAS;CAC9B,IAAI,CAAC,SAAS;EACZ,MAAM,IAAI,MAAM,8BAA8B;CAChD;CACA,IAAI,EAAE,mBAAmB,cAAc;EACrC,MAAM,IAAI,MAAM,+BAA+B;CACjD;CACA,OAAO;AACT"}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
function _instanceof(left, right) {
|
|
2
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
3
|
-
return !!right[Symbol.hasInstance](left);
|
|
4
|
-
} else {
|
|
5
|
-
return left instanceof right;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
1
|
function getWebElement(element) {
|
|
9
2
|
if (!element) {
|
|
10
3
|
throw new Error("Element is null or undefined");
|
|
11
4
|
}
|
|
12
|
-
if (!
|
|
5
|
+
if (!(element instanceof HTMLElement)) {
|
|
13
6
|
throw new Error("Element is not an HTMLElement");
|
|
14
7
|
}
|
|
15
8
|
return element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWebElement.native.js","names":[],"sources":["esm/getWebElement.native.js"],"sourcesContent":["function
|
|
1
|
+
{"version":3,"file":"getWebElement.native.js","names":[],"sources":["esm/getWebElement.native.js"],"sourcesContent":["function getWebElement(element) {\n if (!element) {\n throw new Error(\"Element is null or undefined\");\n }\n if (!(element instanceof HTMLElement)) {\n throw new Error(\"Element is not an HTMLElement\");\n }\n return element;\n}\nexport {\n getWebElement\n};\n//# sourceMappingURL=getWebElement.js.map\n"],"mappings":";AAAA,SAAS,cAAc,SAAS;CAC9B,IAAI,CAAC,SAAS;EACZ,MAAM,IAAI,MAAM,8BAA8B;CAChD;CACA,IAAI,EAAE,mBAAmB,cAAc;EACrC,MAAM,IAAI,MAAM,+BAA+B;CACjD;CACA,OAAO;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/element",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"files": [
|
|
5
6
|
"src",
|
|
6
7
|
"types",
|
|
@@ -36,10 +37,11 @@
|
|
|
36
37
|
"clean:build": "tamagui-build clean:build"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@tamagui/compose-refs": "3.0.0
|
|
40
|
+
"@tamagui/compose-refs": "3.0.0",
|
|
41
|
+
"@tamagui/react-native-types": "3.0.0"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "3.0.0
|
|
44
|
+
"@tamagui/build": "3.0.0"
|
|
43
45
|
},
|
|
44
46
|
"peerDependencies": {
|
|
45
47
|
"react": "*"
|
|
@@ -48,5 +50,6 @@
|
|
|
48
50
|
"type": "git",
|
|
49
51
|
"url": "git+https://github.com/tamagui/tamagui.git",
|
|
50
52
|
"directory": "code/packages/element"
|
|
51
|
-
}
|
|
53
|
+
},
|
|
54
|
+
"releaseSourceCommit": "15fbca480b143f876f6975601e23a17d3f90d2ee"
|
|
52
55
|
}
|
package/src/types.ts
CHANGED
package/src/useNativeRef.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useComposedRefs } from '@tamagui/compose-refs'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import type { TextInput } from 'react-native'
|
|
3
|
+
import type { TextInputInstance as TextInput } from '@tamagui/react-native-types'
|
|
4
4
|
import type { TamaguiNativeElement } from './types'
|
|
5
5
|
|
|
6
6
|
/**
|
package/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { View } from 'react-native';
|
|
1
|
+
import type { ViewInstance as View } from '@tamagui/react-native-types';
|
|
2
2
|
type MeasureOnSuccessCallback = (x: number, y: number, width: number, height: number, pageX: number, pageY: number) => void;
|
|
3
3
|
type MeasureInWindowOnSuccessCallback = (x: number, y: number, width: number, height: number) => void;
|
|
4
4
|
type MeasureLayoutOnSuccessCallback = (left: number, top: number, width: number, height: number) => void;
|
package/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAEvE,KAAK,wBAAwB,GAAG,CAC9B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,KACV,IAAI,CAAA;AAET,KAAK,gCAAgC,GAAG,CACtC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,KACX,IAAI,CAAA;AAET,KAAK,8BAA8B,GAAG,CACpC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,KACX,IAAI,CAAA;AAET;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,QAAQ,EAAE,wBAAwB,GAAG,IAAI,CAAA;IACjD,eAAe,CAAC,QAAQ,EAAE,gCAAgC,GAAG,IAAI,CAAA;IACjE,aAAa,CACX,oBAAoB,EAAE,IAAI,GAAG,WAAW,EACxC,SAAS,EAAE,8BAA8B,EACzC,MAAM,CAAC,EAAE,MAAM,IAAI,GAClB,IAAI,CAAA;IACP,KAAK,IAAI,IAAI,CAAA;IACb,IAAI,IAAI,IAAI,CAAA;CACb;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,WAAW,GAAG,qBAAqB,CAAC,GAAG,IAAI,CAAA;AAEzE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,CAAC,GACpE,qBAAqB,CAAA;AAEvB;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAA"}
|
package/types/useNativeRef.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { TextInput } from 'react-native';
|
|
3
2
|
/**
|
|
4
3
|
* Creates a ref for native-only code that properly types to View.
|
|
5
4
|
* Returns both ref and composedRef for component usage.
|
|
@@ -11,8 +10,8 @@ import type { TextInput } from 'react-native';
|
|
|
11
10
|
* ```
|
|
12
11
|
*/
|
|
13
12
|
export declare function useNativeRef(forwardedRef?: React.ForwardedRef<any>): {
|
|
14
|
-
ref: React.RefObject<import("react-native").
|
|
15
|
-
composedRef: (node: import("react-native").
|
|
13
|
+
ref: React.RefObject<import("@tamagui/react-native-types").ReactNativeElement | null>;
|
|
14
|
+
composedRef: (node: import("@tamagui/react-native-types").ReactNativeElement | null) => void;
|
|
16
15
|
};
|
|
17
16
|
/**
|
|
18
17
|
* Creates a ref for native TextInput components.
|
|
@@ -25,7 +24,7 @@ export declare function useNativeRef(forwardedRef?: React.ForwardedRef<any>): {
|
|
|
25
24
|
* ```
|
|
26
25
|
*/
|
|
27
26
|
export declare function useNativeInputRef(forwardedRef?: React.ForwardedRef<any>): {
|
|
28
|
-
ref: React.RefObject<
|
|
29
|
-
composedRef: (node:
|
|
27
|
+
ref: React.RefObject<import("@tamagui/react-native-types")._TextInputInstance | null>;
|
|
28
|
+
composedRef: (node: import("@tamagui/react-native-types")._TextInputInstance | null) => void;
|
|
30
29
|
};
|
|
31
30
|
//# sourceMappingURL=useNativeRef.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNativeRef.d.ts","sourceRoot":"","sources":["../src/useNativeRef.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"useNativeRef.d.ts","sourceRoot":"","sources":["../src/useNativeRef.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;;;EAIlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC;;;EAIvE"}
|