@tamagui/element 2.0.0-rc.4 → 2.0.0-rc.40
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.cjs +18 -12
- package/dist/cjs/getWebElement.native.js +23 -13
- package/dist/cjs/getWebElement.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +13 -11
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/types.cjs +7 -5
- package/dist/cjs/types.native.js +7 -5
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/useNativeRef.cjs +30 -28
- package/dist/cjs/useNativeRef.native.js +30 -28
- package/dist/cjs/useNativeRef.native.js.map +1 -1
- package/dist/cjs/useWebRef.cjs +28 -26
- package/dist/cjs/useWebRef.native.js +28 -26
- package/dist/cjs/useWebRef.native.js.map +1 -1
- package/dist/esm/getWebElement.mjs +6 -2
- package/dist/esm/getWebElement.mjs.map +1 -1
- package/dist/esm/getWebElement.native.js +11 -3
- package/dist/esm/getWebElement.native.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/useNativeRef.mjs +4 -4
- package/dist/esm/useNativeRef.mjs.map +1 -1
- package/dist/esm/useNativeRef.native.js +4 -4
- package/dist/esm/useNativeRef.native.js.map +1 -1
- package/dist/esm/useWebRef.mjs +2 -2
- package/dist/esm/useWebRef.mjs.map +1 -1
- package/dist/esm/useWebRef.native.js +2 -2
- package/dist/esm/useWebRef.native.js.map +1 -1
- package/package.json +6 -9
- package/src/useWebRef.ts +1 -1
- package/dist/cjs/getWebElement.js +0 -27
- package/dist/cjs/getWebElement.js.map +0 -6
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/types.js +0 -14
- package/dist/cjs/types.js.map +0 -6
- package/dist/cjs/useNativeRef.js +0 -38
- package/dist/cjs/useNativeRef.js.map +0 -6
- package/dist/cjs/useWebRef.js +0 -33
- package/dist/cjs/useWebRef.js.map +0 -6
- package/dist/esm/getWebElement.js +0 -11
- package/dist/esm/getWebElement.js.map +0 -6
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -6
- package/dist/esm/useNativeRef.js +0 -15
- package/dist/esm/useNativeRef.js.map +0 -6
- package/dist/esm/useWebRef.js +0 -10
- package/dist/esm/useWebRef.js.map +0 -6
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var getWebElement_exports = {};
|
|
22
24
|
__export(getWebElement_exports, {
|
|
@@ -24,7 +26,11 @@ __export(getWebElement_exports, {
|
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(getWebElement_exports);
|
|
26
28
|
function getWebElement(element) {
|
|
27
|
-
if (!element)
|
|
28
|
-
|
|
29
|
+
if (!element) {
|
|
30
|
+
throw new Error("Element is null or undefined");
|
|
31
|
+
}
|
|
32
|
+
if (!(element instanceof HTMLElement)) {
|
|
33
|
+
throw new Error("Element is not an HTMLElement");
|
|
34
|
+
}
|
|
29
35
|
return element;
|
|
30
36
|
}
|
|
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value:
|
|
23
|
+
value: true
|
|
22
24
|
}), mod);
|
|
23
25
|
var getWebElement_exports = {};
|
|
24
26
|
__export(getWebElement_exports, {
|
|
@@ -26,11 +28,19 @@ __export(getWebElement_exports, {
|
|
|
26
28
|
});
|
|
27
29
|
module.exports = __toCommonJS(getWebElement_exports);
|
|
28
30
|
function _instanceof(left, right) {
|
|
29
|
-
|
|
31
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
32
|
+
return !!right[Symbol.hasInstance](left);
|
|
33
|
+
} else {
|
|
34
|
+
return left instanceof right;
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
37
|
function getWebElement(element) {
|
|
32
|
-
if (!element)
|
|
33
|
-
|
|
38
|
+
if (!element) {
|
|
39
|
+
throw new Error("Element is null or undefined");
|
|
40
|
+
}
|
|
41
|
+
if (!_instanceof(element, HTMLElement)) {
|
|
42
|
+
throw new Error("Element is not an HTMLElement");
|
|
43
|
+
}
|
|
34
44
|
return element;
|
|
35
45
|
}
|
|
36
46
|
//# sourceMappingURL=getWebElement.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","getWebElement_exports","__export","getWebElement","module","exports","_instanceof","left","right","Symbol","hasInstance","element"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","getWebElement_exports","__export","getWebElement","module","exports","_instanceof","left","right","Symbol","hasInstance","element"],"sources":["../../src/getWebElement.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,qBAAA;AAAAC,QAAA,CAAAD,qBAAA;EAAAE,aAAA,EAAAA,CAAA,KAAAA;AAAA;AAYOC,MAAA,CAAAC,OAAS,GAAAT,YACd,CAAAK,qBACG;AACH,SAAKK,WAASA,CAAAC,IAAA,EAAAC,KAAA;EACZ,IAAAA,KAAM,IAAI,QAAM,OAAAC,MAAA,gBAA8B,IAAAD,KAAA,CAAAC,MAAA,CAAAC,WAAA;IAChD,SAAAF,KAAA,CAAAC,MAAA,CAAAC,WAAA,EAAAH,IAAA;EACA,OAAM;IACJ,OAAMA,IAAI,YAAMC,KAAA;EAClB;AACA;AACF,SAAAL,cAAAQ,OAAA","ignoreList":[]}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,15 +3,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
7
8
|
get: () => from[key],
|
|
8
9
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
10
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
15
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
-
value:
|
|
16
|
+
value: true
|
|
15
17
|
}), mod);
|
|
16
18
|
var index_exports = {};
|
|
17
19
|
module.exports = __toCommonJS(index_exports);
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -5,21 +5,23 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
23
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
22
|
-
value:
|
|
24
|
+
value: true
|
|
23
25
|
}), mod);
|
|
24
26
|
var index_native_exports = {};
|
|
25
27
|
__export(index_native_exports, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["index_native_exports","__export","getWebElement","useWebRef","import_useNativeRef","useNativeRef","module","exports","__toCommonJS","__reExport","require","Error"],"sources":["../../src/index.native.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["index_native_exports","__export","getWebElement","useWebRef","import_useNativeRef","useNativeRef","module","exports","__toCommonJS","__reExport","require","Error"],"sources":["../../src/index.native.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,oBAAA;AAAAC,QAAA,CAAAD,oBAAA;EAAAE,aAAA,EAAAA,CAAA,KAAAA,aAAA;EAAAC,SAAA,EAAAA,CAAA,KAAAC,mBAAA,CAAAC;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAR,oBAAA;AAAAS,UAAA,CAAAT,oBAAA,EAAcU,OAAA,8BAAdJ,MAAA,CAAAC,OAAA;AACAE,UAAA,CAAAT,oBAAA,EAAcU,OAAA,uBADdJ,MAAA,CAAAC,OAAA;AAGA,IAAAH,mBAAA,GAA0CM,OAAA;AACnC,SAASR,cAAA,EAAgB;EAC5B,MAAM,IAAIS,KAAA,CAAM,wCAAwC;AAC5D","ignoreList":[]}
|
package/dist/cjs/types.cjs
CHANGED
|
@@ -3,14 +3,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
8
|
+
get: () => from[key],
|
|
9
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
10
|
+
});
|
|
11
|
+
}
|
|
10
12
|
return to;
|
|
11
13
|
};
|
|
12
14
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
13
|
-
value:
|
|
15
|
+
value: true
|
|
14
16
|
}), mod);
|
|
15
17
|
var types_exports = {};
|
|
16
18
|
module.exports = __toCommonJS(types_exports);
|
package/dist/cjs/types.native.js
CHANGED
|
@@ -5,14 +5,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
+
get: () => from[key],
|
|
11
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
+
});
|
|
13
|
+
}
|
|
12
14
|
return to;
|
|
13
15
|
};
|
|
14
16
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
-
value:
|
|
17
|
+
value: true
|
|
16
18
|
}), mod);
|
|
17
19
|
var types_exports = {};
|
|
18
20
|
module.exports = __toCommonJS(types_exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","types_exports"],"sources":["../../src/types.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","types_exports"],"sources":["../../src/types.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA","ignoreList":[]}
|
|
@@ -2,52 +2,54 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
6
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
32
34
|
var useNativeRef_exports = {};
|
|
33
35
|
__export(useNativeRef_exports, {
|
|
34
36
|
useNativeInputRef: () => useNativeInputRef,
|
|
35
37
|
useNativeRef: () => useNativeRef
|
|
36
38
|
});
|
|
37
39
|
module.exports = __toCommonJS(useNativeRef_exports);
|
|
38
|
-
var import_compose_refs = require("@tamagui/compose-refs")
|
|
39
|
-
|
|
40
|
+
var import_compose_refs = require("@tamagui/compose-refs");
|
|
41
|
+
var React = __toESM(require("react"), 1);
|
|
40
42
|
function useNativeRef(forwardedRef) {
|
|
41
|
-
const ref = React.useRef(null)
|
|
42
|
-
|
|
43
|
+
const ref = React.useRef(null);
|
|
44
|
+
const composedRef = (0, import_compose_refs.useComposedRefs)(ref, forwardedRef);
|
|
43
45
|
return {
|
|
44
46
|
ref,
|
|
45
47
|
composedRef
|
|
46
48
|
};
|
|
47
49
|
}
|
|
48
50
|
function useNativeInputRef(forwardedRef) {
|
|
49
|
-
const ref = React.useRef(null)
|
|
50
|
-
|
|
51
|
+
const ref = React.useRef(null);
|
|
52
|
+
const composedRef = (0, import_compose_refs.useComposedRefs)(ref, forwardedRef);
|
|
51
53
|
return {
|
|
52
54
|
ref,
|
|
53
55
|
composedRef
|
|
@@ -4,52 +4,54 @@ var __create = Object.create;
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
8
|
-
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
18
|
get: () => from[key],
|
|
18
19
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
22
24
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
}), mod);
|
|
34
36
|
var useNativeRef_exports = {};
|
|
35
37
|
__export(useNativeRef_exports, {
|
|
36
38
|
useNativeInputRef: () => useNativeInputRef,
|
|
37
39
|
useNativeRef: () => useNativeRef
|
|
38
40
|
});
|
|
39
41
|
module.exports = __toCommonJS(useNativeRef_exports);
|
|
40
|
-
var import_compose_refs = require("@tamagui/compose-refs")
|
|
41
|
-
|
|
42
|
+
var import_compose_refs = require("@tamagui/compose-refs");
|
|
43
|
+
var React = __toESM(require("react"), 1);
|
|
42
44
|
function useNativeRef(forwardedRef) {
|
|
43
|
-
var ref = React.useRef(null)
|
|
44
|
-
|
|
45
|
+
var ref = React.useRef(null);
|
|
46
|
+
var composedRef = (0, import_compose_refs.useComposedRefs)(ref, forwardedRef);
|
|
45
47
|
return {
|
|
46
48
|
ref,
|
|
47
49
|
composedRef
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
52
|
function useNativeInputRef(forwardedRef) {
|
|
51
|
-
var ref = React.useRef(null)
|
|
52
|
-
|
|
53
|
+
var ref = React.useRef(null);
|
|
54
|
+
var composedRef = (0, import_compose_refs.useComposedRefs)(ref, forwardedRef);
|
|
53
55
|
return {
|
|
54
56
|
ref,
|
|
55
57
|
composedRef
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useNativeRef_exports","__export","useNativeInputRef","useNativeRef","module","exports","import_compose_refs","require","React","__toESM","forwardedRef","ref","useRef","composedRef","useComposedRefs"],"sources":["../../src/useNativeRef.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useNativeRef_exports","__export","useNativeInputRef","useNativeRef","module","exports","import_compose_refs","require","React","__toESM","forwardedRef","ref","useRef","composedRef","useComposedRefs"],"sources":["../../src/useNativeRef.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,oBAAA;AAAAC,QAAA,CAAAD,oBAAA;EAAAE,iBAAA,EAAAA,CAAA,KAAAA,iBAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAV,YAAgC,CAAAK,oBAAA;AAChC,IAAAM,mBAAuB,GAAAC,OAAA;AAchB,IAAAC,KAAS,GAAAC,OAAA,CAAAF,OAAa,SAAwC;AACnE,SAAMJ,YAAYA,CAAAO,YAAiC;EACnD,IAAAC,GAAM,GAAAH,KAAA,CAAAI,MAAA,KAAc;EACpB,IAAAC,WAAc,OAAAP,mBAAY,CAAAQ,eAAA,EAAAH,GAAA,EAAAD,YAAA;EAC5B;IAYOC,GAAA;IACLE;EACA;AACA;AACF,SAAAX,kBAAAQ,YAAA","ignoreList":[]}
|
package/dist/cjs/useWebRef.cjs
CHANGED
|
@@ -2,43 +2,45 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
6
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
32
34
|
var useWebRef_exports = {};
|
|
33
35
|
__export(useWebRef_exports, {
|
|
34
36
|
useWebRef: () => useWebRef
|
|
35
37
|
});
|
|
36
38
|
module.exports = __toCommonJS(useWebRef_exports);
|
|
37
|
-
var import_compose_refs = require("@tamagui/compose-refs")
|
|
38
|
-
|
|
39
|
+
var import_compose_refs = require("@tamagui/compose-refs");
|
|
40
|
+
var React = __toESM(require("react"), 1);
|
|
39
41
|
function useWebRef(forwardedRef) {
|
|
40
|
-
const ref = React.useRef(null)
|
|
41
|
-
|
|
42
|
+
const ref = React.useRef(null);
|
|
43
|
+
const composedRef = (0, import_compose_refs.useComposedRefs)(ref, forwardedRef);
|
|
42
44
|
return {
|
|
43
45
|
ref,
|
|
44
46
|
composedRef
|
|
@@ -4,43 +4,45 @@ var __create = Object.create;
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
8
|
-
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
18
|
get: () => from[key],
|
|
18
19
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
22
24
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
}), mod);
|
|
34
36
|
var useWebRef_exports = {};
|
|
35
37
|
__export(useWebRef_exports, {
|
|
36
38
|
useWebRef: () => useWebRef
|
|
37
39
|
});
|
|
38
40
|
module.exports = __toCommonJS(useWebRef_exports);
|
|
39
|
-
var import_compose_refs = require("@tamagui/compose-refs")
|
|
40
|
-
|
|
41
|
+
var import_compose_refs = require("@tamagui/compose-refs");
|
|
42
|
+
var React = __toESM(require("react"), 1);
|
|
41
43
|
function useWebRef(forwardedRef) {
|
|
42
|
-
var ref = React.useRef(null)
|
|
43
|
-
|
|
44
|
+
var ref = React.useRef(null);
|
|
45
|
+
var composedRef = (0, import_compose_refs.useComposedRefs)(ref, forwardedRef);
|
|
44
46
|
return {
|
|
45
47
|
ref,
|
|
46
48
|
composedRef
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useWebRef_exports","__export","useWebRef","module","exports","import_compose_refs","require","React","__toESM","forwardedRef","ref","useRef","composedRef","useComposedRefs"],"sources":["../../src/useWebRef.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useWebRef_exports","__export","useWebRef","module","exports","import_compose_refs","require","React","__toESM","forwardedRef","ref","useRef","composedRef","useComposedRefs"],"sources":["../../src/useWebRef.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,iBAAA;AAAAC,QAAA,CAAAD,iBAAA;EAAAE,SAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAgC,CAAAK,iBAAA;AAChC,IAAAK,mBAAuB,GAAAC,OAAA;AAehB,IAAAC,KAAS,GAAAC,OACd,CAAAF,OAAA,QACA;AACA,SAAMJ,SAAMA,CAAAO,YAAoB;EAChC,IAAAC,GAAM,GAAAH,KAAA,CAAAI,MAAA,KAAc;EACpB,IAAAC,WAAc,OAAAP,mBAAY,CAAAQ,eAAA,EAAAH,GAAA,EAAAD,YAAA;EAC5B","ignoreList":[]}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
function getWebElement(element) {
|
|
2
|
-
if (!element)
|
|
3
|
-
|
|
2
|
+
if (!element) {
|
|
3
|
+
throw new Error("Element is null or undefined");
|
|
4
|
+
}
|
|
5
|
+
if (!(element instanceof HTMLElement)) {
|
|
6
|
+
throw new Error("Element is not an HTMLElement");
|
|
7
|
+
}
|
|
4
8
|
return element;
|
|
5
9
|
}
|
|
6
10
|
export { getWebElement };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getWebElement","element","Error","HTMLElement"],"sources":["../../src/getWebElement.ts"],"sourcesContent":[null],"mappings":"AAYO,SAASA,cACdC,OAAA,EACG;EACH,IAAI,CAACA,OAAA,
|
|
1
|
+
{"version":3,"names":["getWebElement","element","Error","HTMLElement"],"sources":["../../src/getWebElement.ts"],"sourcesContent":[null],"mappings":"AAYO,SAASA,cACdC,OAAA,EACG;EACH,IAAI,CAACA,OAAA,EAAS;IACZ,MAAM,IAAIC,KAAA,CAAM,8BAA8B;EAChD;EACA,IAAI,EAAED,OAAA,YAAmBE,WAAA,GAAc;IACrC,MAAM,IAAID,KAAA,CAAM,+BAA+B;EACjD;EACA,OAAOD,OAAA;AACT","ignoreList":[]}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
function _instanceof(left, right) {
|
|
2
|
-
|
|
2
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
3
|
+
return !!right[Symbol.hasInstance](left);
|
|
4
|
+
} else {
|
|
5
|
+
return left instanceof right;
|
|
6
|
+
}
|
|
3
7
|
}
|
|
4
8
|
function getWebElement(element) {
|
|
5
|
-
if (!element)
|
|
6
|
-
|
|
9
|
+
if (!element) {
|
|
10
|
+
throw new Error("Element is null or undefined");
|
|
11
|
+
}
|
|
12
|
+
if (!_instanceof(element, HTMLElement)) {
|
|
13
|
+
throw new Error("Element is not an HTMLElement");
|
|
14
|
+
}
|
|
7
15
|
return element;
|
|
8
16
|
}
|
|
9
17
|
export { getWebElement };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_instanceof","left","right","Symbol","hasInstance","getWebElement","element"
|
|
1
|
+
{"version":3,"names":["_instanceof","left","right","Symbol","hasInstance","getWebElement","element"],"sources":["../../src/getWebElement.ts"],"sourcesContent":[null],"mappings":"AAYO,SAASA,YAAAC,IACd,EAAAC,KACG;EACH,IAAIA,KAAC,QAAS,WAAAC,MAAA,oBAAAD,KAAA,CAAAC,MAAA,CAAAC,WAAA;IACZ,OAAM,EAAAF,KAAI,CAAAC,MAAM,CAAAC,WAAA,EAAAH,IAAA;EAClB;IACA,OAAMA,IAAA,YAAmBC,KAAA;EACvB;AAA+C;AAEjD,SAAOG,cAAAC,OAAA;EACT,KAAAA,OAAA","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./useWebRef";
|
|
2
|
-
export * from "./useNativeRef";
|
|
3
|
-
export * from "./getWebElement";
|
|
4
|
-
export * from "./types";
|
|
1
|
+
export * from "./useWebRef.mjs";
|
|
2
|
+
export * from "./useNativeRef.mjs";
|
|
3
|
+
export * from "./getWebElement.mjs";
|
|
4
|
+
export * from "./types.mjs";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
function useNativeRef(forwardedRef) {
|
|
4
|
-
const ref = React.useRef(null)
|
|
5
|
-
|
|
4
|
+
const ref = React.useRef(null);
|
|
5
|
+
const composedRef = useComposedRefs(ref, forwardedRef);
|
|
6
6
|
return {
|
|
7
7
|
ref,
|
|
8
8
|
composedRef
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
function useNativeInputRef(forwardedRef) {
|
|
12
|
-
const ref = React.useRef(null)
|
|
13
|
-
|
|
12
|
+
const ref = React.useRef(null);
|
|
13
|
+
const composedRef = useComposedRefs(ref, forwardedRef);
|
|
14
14
|
return {
|
|
15
15
|
ref,
|
|
16
16
|
composedRef
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useComposedRefs","React","useNativeRef","forwardedRef","ref","useRef","composedRef","useNativeInputRef"],"sources":["../../src/useNativeRef.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,eAAA,QAAuB;AAChC,YAAYC,KAAA,MAAW;AAchB,SAASC,aAAaC,YAAA,EAAwC;EACnE,MAAMC,GAAA,GAAMH,KAAA,CAAMI,MAAA,CAA6B,IAAI;
|
|
1
|
+
{"version":3,"names":["useComposedRefs","React","useNativeRef","forwardedRef","ref","useRef","composedRef","useNativeInputRef"],"sources":["../../src/useNativeRef.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,eAAA,QAAuB;AAChC,YAAYC,KAAA,MAAW;AAchB,SAASC,aAAaC,YAAA,EAAwC;EACnE,MAAMC,GAAA,GAAMH,KAAA,CAAMI,MAAA,CAA6B,IAAI;EACnD,MAAMC,WAAA,GAAcN,eAAA,CAAgBI,GAAA,EAAKD,YAAmB;EAC5D,OAAO;IAAEC,GAAA;IAAKE;EAAY;AAC5B;AAYO,SAASC,kBAAkBJ,YAAA,EAAwC;EACxE,MAAMC,GAAA,GAAMH,KAAA,CAAMI,MAAA,CAAkB,IAAI;EACxC,MAAMC,WAAA,GAAcN,eAAA,CAAgBI,GAAA,EAAKD,YAAmB;EAC5D,OAAO;IAAEC,GAAA;IAAKE;EAAY;AAC5B","ignoreList":[]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
function useNativeRef(forwardedRef) {
|
|
4
|
-
var ref = React.useRef(null)
|
|
5
|
-
|
|
4
|
+
var ref = React.useRef(null);
|
|
5
|
+
var composedRef = useComposedRefs(ref, forwardedRef);
|
|
6
6
|
return {
|
|
7
7
|
ref,
|
|
8
8
|
composedRef
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
function useNativeInputRef(forwardedRef) {
|
|
12
|
-
var ref = React.useRef(null)
|
|
13
|
-
|
|
12
|
+
var ref = React.useRef(null);
|
|
13
|
+
var composedRef = useComposedRefs(ref, forwardedRef);
|
|
14
14
|
return {
|
|
15
15
|
ref,
|
|
16
16
|
composedRef
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useComposedRefs","React","useNativeRef","forwardedRef","ref","useRef","composedRef","useNativeInputRef"],"sources":["../../src/useNativeRef.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,eAAA,QAAuB;AAChC,YAAYC,KAAA,MAAW;AAchB,SAASC,aAAaC,YAAA,EAAwC;EACnE,IAAAC,GAAM,GAAAH,KAAM,CAAAI,MAAM,KAA6B;
|
|
1
|
+
{"version":3,"names":["useComposedRefs","React","useNativeRef","forwardedRef","ref","useRef","composedRef","useNativeInputRef"],"sources":["../../src/useNativeRef.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,eAAA,QAAuB;AAChC,YAAYC,KAAA,MAAW;AAchB,SAASC,aAAaC,YAAA,EAAwC;EACnE,IAAAC,GAAM,GAAAH,KAAM,CAAAI,MAAM,KAA6B;EAC/C,IAAAC,WAAM,GAAAN,eAAc,CAAAI,GAAgB,EAAAD,YAAK;EACzC,OAAO;IACTC,GAAA;IAYOE;EACL;AACA;AACA,SAAOC,iBAAOA,CAAAJ,YAAY;EAC5B,IAAAC,GAAA,GAAAH,KAAA,CAAAI,MAAA","ignoreList":[]}
|
package/dist/esm/useWebRef.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
function useWebRef(forwardedRef) {
|
|
4
|
-
const ref = React.useRef(null)
|
|
5
|
-
|
|
4
|
+
const ref = React.useRef(null);
|
|
5
|
+
const composedRef = useComposedRefs(ref, forwardedRef);
|
|
6
6
|
return {
|
|
7
7
|
ref,
|
|
8
8
|
composedRef
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useComposedRefs","React","useWebRef","forwardedRef","ref","useRef","composedRef"],"sources":["../../src/useWebRef.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,eAAA,QAAuB;AAChC,YAAYC,KAAA,MAAW;AAehB,SAASC,UACdC,YAAA,EACA;EACA,MAAMC,GAAA,GAAMH,KAAA,CAAMI,MAAA,CAAU,IAAI;
|
|
1
|
+
{"version":3,"names":["useComposedRefs","React","useWebRef","forwardedRef","ref","useRef","composedRef"],"sources":["../../src/useWebRef.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,eAAA,QAAuB;AAChC,YAAYC,KAAA,MAAW;AAehB,SAASC,UACdC,YAAA,EACA;EACA,MAAMC,GAAA,GAAMH,KAAA,CAAMI,MAAA,CAAU,IAAI;EAChC,MAAMC,WAAA,GAAcN,eAAA,CAAgBI,GAAA,EAAKD,YAAmB;EAC5D,OAAO;IAAEC,GAAA;IAAKE;EAAY;AAC5B","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
function useWebRef(forwardedRef) {
|
|
4
|
-
var ref = React.useRef(null)
|
|
5
|
-
|
|
4
|
+
var ref = React.useRef(null);
|
|
5
|
+
var composedRef = useComposedRefs(ref, forwardedRef);
|
|
6
6
|
return {
|
|
7
7
|
ref,
|
|
8
8
|
composedRef
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useComposedRefs","React","useWebRef","forwardedRef","ref","useRef","composedRef"],"sources":["../../src/useWebRef.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,eAAA,QAAuB;AAChC,YAAYC,KAAA,MAAW;AAehB,SAASC,UACdC,YAAA,EACA;EACA,IAAAC,GAAM,GAAAH,KAAM,CAAAI,MAAM,KAAU;
|
|
1
|
+
{"version":3,"names":["useComposedRefs","React","useWebRef","forwardedRef","ref","useRef","composedRef"],"sources":["../../src/useWebRef.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,eAAA,QAAuB;AAChC,YAAYC,KAAA,MAAW;AAehB,SAASC,UACdC,YAAA,EACA;EACA,IAAAC,GAAM,GAAAH,KAAM,CAAAI,MAAM,KAAU;EAC5B,IAAAC,WAAM,GAAAN,eAAc,CAAAI,GAAgB,EAAAD,YAAK;EACzC,OAAO;IACTC,GAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/element",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.40",
|
|
4
4
|
"files": [
|
|
5
5
|
"src",
|
|
6
6
|
"types",
|
|
@@ -15,15 +15,12 @@
|
|
|
15
15
|
"./package.json": "./package.json",
|
|
16
16
|
".": {
|
|
17
17
|
"types": "./src/index.ts",
|
|
18
|
-
"react-native":
|
|
19
|
-
|
|
20
|
-
"import": "./dist/esm/index.native.js",
|
|
21
|
-
"require": "./dist/cjs/index.native.js"
|
|
22
|
-
},
|
|
18
|
+
"react-native": "./dist/esm/index.native.js",
|
|
19
|
+
"browser": "./dist/esm/index.mjs",
|
|
23
20
|
"module": "./dist/esm/index.mjs",
|
|
24
21
|
"import": "./dist/esm/index.mjs",
|
|
25
22
|
"require": "./dist/cjs/index.cjs",
|
|
26
|
-
"default": "./dist/
|
|
23
|
+
"default": "./dist/esm/index.mjs"
|
|
27
24
|
}
|
|
28
25
|
},
|
|
29
26
|
"publishConfig": {
|
|
@@ -36,10 +33,10 @@
|
|
|
36
33
|
"clean:build": "tamagui-build clean:build"
|
|
37
34
|
},
|
|
38
35
|
"dependencies": {
|
|
39
|
-
"@tamagui/compose-refs": "2.0.0-rc.
|
|
36
|
+
"@tamagui/compose-refs": "2.0.0-rc.40"
|
|
40
37
|
},
|
|
41
38
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "2.0.0-rc.
|
|
39
|
+
"@tamagui/build": "2.0.0-rc.40"
|
|
43
40
|
},
|
|
44
41
|
"peerDependencies": {
|
|
45
42
|
"react": "*",
|
package/src/useWebRef.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { TamaguiElement } from './types'
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
export function useWebRef<T extends TamaguiElement | HTMLElement>(
|
|
18
|
-
forwardedRef?: React.ForwardedRef<
|
|
18
|
+
forwardedRef?: React.ForwardedRef<any>
|
|
19
19
|
) {
|
|
20
20
|
const ref = React.useRef<T>(null)
|
|
21
21
|
const composedRef = useComposedRefs(ref, forwardedRef as any)
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var getWebElement_exports = {};
|
|
16
|
-
__export(getWebElement_exports, {
|
|
17
|
-
getWebElement: () => getWebElement
|
|
18
|
-
});
|
|
19
|
-
module.exports = __toCommonJS(getWebElement_exports);
|
|
20
|
-
function getWebElement(element) {
|
|
21
|
-
if (!element)
|
|
22
|
-
throw new Error("Element is null or undefined");
|
|
23
|
-
if (!(element instanceof HTMLElement))
|
|
24
|
-
throw new Error("Element is not an HTMLElement");
|
|
25
|
-
return element;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=getWebElement.js.map
|
package/dist/cjs/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
-
return to;
|
|
10
|
-
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
11
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
-
var index_exports = {};
|
|
13
|
-
module.exports = __toCommonJS(index_exports);
|
|
14
|
-
__reExport(index_exports, require("./useWebRef"), module.exports);
|
|
15
|
-
__reExport(index_exports, require("./useNativeRef"), module.exports);
|
|
16
|
-
__reExport(index_exports, require("./getWebElement"), module.exports);
|
|
17
|
-
__reExport(index_exports, require("./types"), module.exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
package/dist/cjs/types.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
-
return to;
|
|
10
|
-
};
|
|
11
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
-
var types_exports = {};
|
|
13
|
-
module.exports = __toCommonJS(types_exports);
|
|
14
|
-
//# sourceMappingURL=types.js.map
|
package/dist/cjs/types.js.map
DELETED
package/dist/cjs/useNativeRef.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var useNativeRef_exports = {};
|
|
24
|
-
__export(useNativeRef_exports, {
|
|
25
|
-
useNativeInputRef: () => useNativeInputRef,
|
|
26
|
-
useNativeRef: () => useNativeRef
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(useNativeRef_exports);
|
|
29
|
-
var import_compose_refs = require("@tamagui/compose-refs"), React = __toESM(require("react"), 1);
|
|
30
|
-
function useNativeRef(forwardedRef) {
|
|
31
|
-
const ref = React.useRef(null), composedRef = (0, import_compose_refs.useComposedRefs)(ref, forwardedRef);
|
|
32
|
-
return { ref, composedRef };
|
|
33
|
-
}
|
|
34
|
-
function useNativeInputRef(forwardedRef) {
|
|
35
|
-
const ref = React.useRef(null), composedRef = (0, import_compose_refs.useComposedRefs)(ref, forwardedRef);
|
|
36
|
-
return { ref, composedRef };
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=useNativeRef.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/useNativeRef.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgC,kCAChC,QAAuB;AAchB,SAAS,aAAa,cAAwC;AACnE,QAAM,MAAM,MAAM,OAA6B,IAAI,GAC7C,kBAAc,qCAAgB,KAAK,YAAmB;AAC5D,SAAO,EAAE,KAAK,YAAY;AAC5B;AAYO,SAAS,kBAAkB,cAAwC;AACxE,QAAM,MAAM,MAAM,OAAkB,IAAI,GAClC,kBAAc,qCAAgB,KAAK,YAAmB;AAC5D,SAAO,EAAE,KAAK,YAAY;AAC5B;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/cjs/useWebRef.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var useWebRef_exports = {};
|
|
24
|
-
__export(useWebRef_exports, {
|
|
25
|
-
useWebRef: () => useWebRef
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(useWebRef_exports);
|
|
28
|
-
var import_compose_refs = require("@tamagui/compose-refs"), React = __toESM(require("react"), 1);
|
|
29
|
-
function useWebRef(forwardedRef) {
|
|
30
|
-
const ref = React.useRef(null), composedRef = (0, import_compose_refs.useComposedRefs)(ref, forwardedRef);
|
|
31
|
-
return { ref, composedRef };
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=useWebRef.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/useWebRef.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgC,kCAChC,QAAuB;AAehB,SAAS,UACd,cACA;AACA,QAAM,MAAM,MAAM,OAAU,IAAI,GAC1B,kBAAc,qCAAgB,KAAK,YAAmB;AAC5D,SAAO,EAAE,KAAK,YAAY;AAC5B;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function getWebElement(element) {
|
|
2
|
-
if (!element)
|
|
3
|
-
throw new Error("Element is null or undefined");
|
|
4
|
-
if (!(element instanceof HTMLElement))
|
|
5
|
-
throw new Error("Element is not an HTMLElement");
|
|
6
|
-
return element;
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
getWebElement
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=getWebElement.js.map
|
package/dist/esm/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.js.map
|
package/dist/esm/types.js.map
DELETED
package/dist/esm/useNativeRef.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
function useNativeRef(forwardedRef) {
|
|
4
|
-
const ref = React.useRef(null), composedRef = useComposedRefs(ref, forwardedRef);
|
|
5
|
-
return { ref, composedRef };
|
|
6
|
-
}
|
|
7
|
-
function useNativeInputRef(forwardedRef) {
|
|
8
|
-
const ref = React.useRef(null), composedRef = useComposedRefs(ref, forwardedRef);
|
|
9
|
-
return { ref, composedRef };
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
useNativeInputRef,
|
|
13
|
-
useNativeRef
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=useNativeRef.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/useNativeRef.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,uBAAuB;AAChC,YAAY,WAAW;AAchB,SAAS,aAAa,cAAwC;AACnE,QAAM,MAAM,MAAM,OAA6B,IAAI,GAC7C,cAAc,gBAAgB,KAAK,YAAmB;AAC5D,SAAO,EAAE,KAAK,YAAY;AAC5B;AAYO,SAAS,kBAAkB,cAAwC;AACxE,QAAM,MAAM,MAAM,OAAkB,IAAI,GAClC,cAAc,gBAAgB,KAAK,YAAmB;AAC5D,SAAO,EAAE,KAAK,YAAY;AAC5B;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/esm/useWebRef.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
function useWebRef(forwardedRef) {
|
|
4
|
-
const ref = React.useRef(null), composedRef = useComposedRefs(ref, forwardedRef);
|
|
5
|
-
return { ref, composedRef };
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
useWebRef
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=useWebRef.js.map
|