@tamagui/react-native-web-internals 1.130.7 → 1.130.8
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/modules/UIManager/index.cjs +11 -88
- package/dist/cjs/modules/UIManager/index.js +9 -52
- package/dist/cjs/modules/UIManager/index.js.map +2 -2
- package/dist/cjs/modules/UIManager/index.native.js +8 -57
- package/dist/cjs/modules/UIManager/index.native.js.map +2 -2
- package/dist/cjs/modules/usePlatformMethods/index.cjs +2 -2
- package/dist/cjs/modules/usePlatformMethods/index.js +2 -2
- package/dist/cjs/modules/usePlatformMethods/index.js.map +2 -2
- package/dist/cjs/modules/usePlatformMethods/index.native.js +2 -8
- package/dist/cjs/modules/usePlatformMethods/index.native.js.map +2 -2
- package/dist/esm/modules/UIManager/index.js +7 -43
- package/dist/esm/modules/UIManager/index.js.map +1 -1
- package/dist/esm/modules/UIManager/index.mjs +7 -73
- package/dist/esm/modules/UIManager/index.mjs.map +1 -1
- package/dist/esm/modules/UIManager/index.native.js +7 -72
- package/dist/esm/modules/UIManager/index.native.js.map +1 -1
- package/dist/esm/modules/usePlatformMethods/index.js +6 -2
- package/dist/esm/modules/usePlatformMethods/index.js.map +1 -1
- package/dist/esm/modules/usePlatformMethods/index.mjs +2 -2
- package/dist/esm/modules/usePlatformMethods/index.mjs.map +1 -1
- package/dist/esm/modules/usePlatformMethods/index.native.js +2 -8
- package/dist/esm/modules/usePlatformMethods/index.native.js.map +1 -1
- package/package.json +8 -8
- package/src/modules/UIManager/index.tsx +11 -60
- package/src/modules/usePlatformMethods/index.tsx +8 -6
- package/types/modules/UIManager/index.d.ts +8 -4
- package/types/modules/UIManager/index.d.ts.map +1 -1
- package/types/modules/usePlatformMethods/index.d.ts.map +1 -1
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var
|
|
6
|
-
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all) __defProp(target, name, {
|
|
9
7
|
get: all[name],
|
|
@@ -17,59 +15,16 @@ var __export = (target, all) => {
|
|
|
17
15
|
});
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
-
value: mod,
|
|
27
|
-
enumerable: !0
|
|
28
|
-
}) : target, mod)),
|
|
29
|
-
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
-
value: !0
|
|
31
|
-
}), mod);
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
32
21
|
var UIManager_exports = {};
|
|
33
22
|
__export(UIManager_exports, {
|
|
34
23
|
default: () => UIManager_default
|
|
35
24
|
});
|
|
36
25
|
module.exports = __toCommonJS(UIManager_exports);
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
const getRect = node => {
|
|
40
|
-
const {
|
|
41
|
-
x,
|
|
42
|
-
y,
|
|
43
|
-
top,
|
|
44
|
-
left
|
|
45
|
-
} = (0, import_getBoundingClientRect.default)(node),
|
|
46
|
-
width = node.offsetWidth,
|
|
47
|
-
height = node.offsetHeight;
|
|
48
|
-
return {
|
|
49
|
-
x,
|
|
50
|
-
y,
|
|
51
|
-
width,
|
|
52
|
-
height,
|
|
53
|
-
top,
|
|
54
|
-
left
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
measureLayout = (node, relativeToNativeNode, callback) => {
|
|
58
|
-
const relativeNode = relativeToNativeNode || node && node.parentNode;
|
|
59
|
-
if (node && relativeNode) {
|
|
60
|
-
const relativeRect = (0, import_getBoundingClientRect.default)(relativeNode),
|
|
61
|
-
{
|
|
62
|
-
height,
|
|
63
|
-
left,
|
|
64
|
-
top,
|
|
65
|
-
width
|
|
66
|
-
} = getRect(node),
|
|
67
|
-
x = left - relativeRect.left,
|
|
68
|
-
y = top - relativeRect.top;
|
|
69
|
-
callback(x, y, width, height, left, top);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
focusableElements = {
|
|
26
|
+
var import_use_element_layout = require("@tamagui/use-element-layout");
|
|
27
|
+
const focusableElements = {
|
|
73
28
|
A: !0,
|
|
74
29
|
INPUT: !0,
|
|
75
30
|
SELECT: !0,
|
|
@@ -88,46 +43,14 @@ const getRect = node => {
|
|
|
88
43
|
} catch {}
|
|
89
44
|
},
|
|
90
45
|
measure(node, callback) {
|
|
91
|
-
|
|
46
|
+
return (0, import_use_element_layout.measure)(node, callback);
|
|
92
47
|
},
|
|
93
48
|
measureInWindow(node, callback) {
|
|
94
|
-
|
|
95
|
-
const {
|
|
96
|
-
height,
|
|
97
|
-
left,
|
|
98
|
-
top,
|
|
99
|
-
width
|
|
100
|
-
} = getRect(node);
|
|
101
|
-
callback(left, top, width, height);
|
|
102
|
-
}, 0);
|
|
103
|
-
},
|
|
104
|
-
measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
105
|
-
measureLayout(node, relativeToNativeNode, onSuccess);
|
|
49
|
+
return (0, import_use_element_layout.measureInWindow)(node, callback);
|
|
106
50
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const value = props[prop];
|
|
111
|
-
switch (prop) {
|
|
112
|
-
case "style":
|
|
113
|
-
{
|
|
114
|
-
(0, import_setValueForStyles.default)(node, value);
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
case "class":
|
|
118
|
-
case "className":
|
|
119
|
-
{
|
|
120
|
-
node.setAttribute("class", value);
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
case "text":
|
|
124
|
-
case "value":
|
|
125
|
-
node.value = value;
|
|
126
|
-
break;
|
|
127
|
-
default:
|
|
128
|
-
node.setAttribute(prop, value);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
51
|
+
// note its flipped fail and success on purpose lol
|
|
52
|
+
async measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
53
|
+
return measureLayout(node, relativeToNativeNode, onSuccess);
|
|
131
54
|
},
|
|
132
55
|
configureNextLayoutAnimation(config, onAnimationDidEnd) {
|
|
133
56
|
onAnimationDidEnd();
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
7
|
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
@@ -12,30 +11,14 @@ var __export = (target, all) => {
|
|
|
12
11
|
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
12
|
return to;
|
|
14
13
|
};
|
|
15
|
-
var
|
|
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);
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
15
|
var UIManager_exports = {};
|
|
24
16
|
__export(UIManager_exports, {
|
|
25
17
|
default: () => UIManager_default
|
|
26
18
|
});
|
|
27
19
|
module.exports = __toCommonJS(UIManager_exports);
|
|
28
|
-
var
|
|
29
|
-
const
|
|
30
|
-
const { x, y, top, left } = (0, import_getBoundingClientRect.default)(node), width = node.offsetWidth, height = node.offsetHeight;
|
|
31
|
-
return { x, y, width, height, top, left };
|
|
32
|
-
}, measureLayout = (node, relativeToNativeNode, callback) => {
|
|
33
|
-
const relativeNode = relativeToNativeNode || node && node.parentNode;
|
|
34
|
-
if (node && relativeNode) {
|
|
35
|
-
const relativeRect = (0, import_getBoundingClientRect.default)(relativeNode), { height, left, top, width } = getRect(node), x = left - relativeRect.left, y = top - relativeRect.top;
|
|
36
|
-
callback(x, y, width, height, left, top);
|
|
37
|
-
}
|
|
38
|
-
}, focusableElements = {
|
|
20
|
+
var import_use_element_layout = require("@tamagui/use-element-layout");
|
|
21
|
+
const focusableElements = {
|
|
39
22
|
A: !0,
|
|
40
23
|
INPUT: !0,
|
|
41
24
|
SELECT: !0,
|
|
@@ -55,40 +38,14 @@ const getRect = (node) => {
|
|
|
55
38
|
}
|
|
56
39
|
},
|
|
57
40
|
measure(node, callback) {
|
|
58
|
-
|
|
41
|
+
return (0, import_use_element_layout.measure)(node, callback);
|
|
59
42
|
},
|
|
60
43
|
measureInWindow(node, callback) {
|
|
61
|
-
|
|
62
|
-
const { height, left, top, width } = getRect(node);
|
|
63
|
-
callback(left, top, width, height);
|
|
64
|
-
}, 0);
|
|
65
|
-
},
|
|
66
|
-
measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
67
|
-
measureLayout(node, relativeToNativeNode, onSuccess);
|
|
44
|
+
return (0, import_use_element_layout.measureInWindow)(node, callback);
|
|
68
45
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
continue;
|
|
73
|
-
const value = props[prop];
|
|
74
|
-
switch (prop) {
|
|
75
|
-
case "style": {
|
|
76
|
-
(0, import_setValueForStyles.default)(node, value);
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
case "class":
|
|
80
|
-
case "className": {
|
|
81
|
-
node.setAttribute("class", value);
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
case "text":
|
|
85
|
-
case "value":
|
|
86
|
-
node.value = value;
|
|
87
|
-
break;
|
|
88
|
-
default:
|
|
89
|
-
node.setAttribute(prop, value);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
46
|
+
// note its flipped fail and success on purpose lol
|
|
47
|
+
async measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
48
|
+
return measureLayout(node, relativeToNativeNode, onSuccess);
|
|
92
49
|
},
|
|
93
50
|
configureNextLayoutAnimation(config, onAnimationDidEnd) {
|
|
94
51
|
onAnimationDidEnd();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/UIManager/index.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": [
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,gCAAyC;AAEzC,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AACZ,GAEM,YAAY;AAAA,EAChB,KAAK,MAAM;AACT,QAAI;AACF,WAAK,KAAK;AAAA,IACZ,QAAc;AAAA,IAEd;AAAA,EACF;AAAA,EAEA,MAAM,MAAM;AACV,QAAI;AACF,YAAM,OAAO,KAAK;AAIlB,MAAI,KAAK,aAAa,UAAU,KAAK,QAAQ,kBAAkB,IAAI,KAAK,QACtE,KAAK,aAAa,YAAY,IAAI,GAEpC,KAAK,MAAM;AAAA,IACb,QAAc;AAAA,IAEd;AAAA,EACF;AAAA,EAEA,QAAQ,MAAM,UAAU;AACtB,eAAO,mCAAQ,MAAM,QAAQ;AAAA,EAC/B;AAAA,EAEA,gBAAgB,MAAM,UAAU;AAC9B,eAAO,2CAAgB,MAAM,QAAQ;AAAA,EACvC;AAAA;AAAA,EAGA,MAAM,cACJ,MACA,sBACA,QACA,WACA;AACA,WAAO,cAAc,MAAM,sBAAsB,SAAS;AAAA,EAC5D;AAAA,EAEA,6BAA6B,QAAQ,mBAAmB;AACtD,sBAAkB;AAAA,EACpB;AAAA;AAAA,EAGA,wCAAwC;AAAA,EAAC;AAC3C;AAEA,IAAO,oBAAQ;",
|
|
5
|
+
"names": []
|
|
6
6
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
6
|
var __export = (target, all) => {
|
|
8
7
|
for (var name in all)
|
|
9
8
|
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
@@ -13,36 +12,13 @@ var __export = (target, all) => {
|
|
|
13
12
|
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
13
|
return to;
|
|
15
14
|
};
|
|
16
|
-
var
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
-
mod
|
|
23
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
16
|
var UIManager_exports = {};
|
|
25
17
|
__export(UIManager_exports, {
|
|
26
18
|
default: () => UIManager_default
|
|
27
19
|
});
|
|
28
20
|
module.exports = __toCommonJS(UIManager_exports);
|
|
29
|
-
var
|
|
30
|
-
var { x, y, top, left } = (0, import_getBoundingClientRect.default)(node), width = node.offsetWidth, height = node.offsetHeight;
|
|
31
|
-
return {
|
|
32
|
-
x,
|
|
33
|
-
y,
|
|
34
|
-
width,
|
|
35
|
-
height,
|
|
36
|
-
top,
|
|
37
|
-
left
|
|
38
|
-
};
|
|
39
|
-
}, measureLayout = function(node, relativeToNativeNode, callback) {
|
|
40
|
-
var relativeNode = relativeToNativeNode || node && node.parentNode;
|
|
41
|
-
if (node && relativeNode) {
|
|
42
|
-
var relativeRect = (0, import_getBoundingClientRect.default)(relativeNode), { height, left, top, width } = getRect(node), x = left - relativeRect.left, y = top - relativeRect.top;
|
|
43
|
-
callback(x, y, width, height, left, top);
|
|
44
|
-
}
|
|
45
|
-
}, focusableElements = {
|
|
21
|
+
var import_use_element_layout = require("@tamagui/use-element-layout"), focusableElements = {
|
|
46
22
|
A: !0,
|
|
47
23
|
INPUT: !0,
|
|
48
24
|
SELECT: !0,
|
|
@@ -64,39 +40,14 @@ var import_getBoundingClientRect = __toESM(require("../getBoundingClientRect/ind
|
|
|
64
40
|
},
|
|
65
41
|
//
|
|
66
42
|
measure(node, callback) {
|
|
67
|
-
|
|
43
|
+
return (0, import_use_element_layout.measure)(node, callback);
|
|
68
44
|
},
|
|
69
45
|
measureInWindow(node, callback) {
|
|
70
|
-
|
|
71
|
-
var { height, left, top, width } = getRect(node);
|
|
72
|
-
callback(left, top, width, height);
|
|
73
|
-
}, 0);
|
|
74
|
-
},
|
|
75
|
-
measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
76
|
-
measureLayout(node, relativeToNativeNode, onSuccess);
|
|
46
|
+
return (0, import_use_element_layout.measureInWindow)(node, callback);
|
|
77
47
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
var value = props[prop];
|
|
82
|
-
switch (prop) {
|
|
83
|
-
case "style": {
|
|
84
|
-
(0, import_setValueForStyles.default)(node, value);
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
case "class":
|
|
88
|
-
case "className": {
|
|
89
|
-
node.setAttribute("class", value);
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
case "text":
|
|
93
|
-
case "value":
|
|
94
|
-
node.value = value;
|
|
95
|
-
break;
|
|
96
|
-
default:
|
|
97
|
-
node.setAttribute(prop, value);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
48
|
+
// note its flipped fail and success on purpose lol
|
|
49
|
+
async measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
50
|
+
return measureLayout(node, relativeToNativeNode, onSuccess);
|
|
100
51
|
},
|
|
101
52
|
configureNextLayoutAnimation(config, onAnimationDidEnd) {
|
|
102
53
|
onAnimationDidEnd();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/UIManager/index.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;AAUA,gCAAyC,wCAEnCA,oBAAoB;EACxBC,GAAG;EACHC,OAAO;EACPC,QAAQ;EACRC,UAAU;AACZ,GAEMC,YAAY;EAChBC,KAAKC,MAAI;AACP,QAAI;AACFA,WAAKD,KAAI;IACX,QAAc;IAEd;EACF;;EAEAE,MAAMD,MAAI;AACR,QAAI;AACF,UAAME,OAAOF,KAAKG;AAIlB,MAAIH,KAAKI,aAAa,UAAA,KAAe,QAAQX,kBAAkBS,IAAAA,KAAS,QACtEF,KAAKK,aAAa,YAAY,IAAA,GAEhCL,KAAKC,MAAK;IACZ,QAAc;IAEd;EACF;;EAEAK,QAAQN,MAAMO,UAAQ;AACpB,eAAOD,mCAAQN,MAAMO,QAAAA;EACvB;EAEAC,gBAAgBR,MAAMO,UAAQ;AAC5B,eAAOC,2CAAgBR,MAAMO,QAAAA;EAC/B;;EAGA,MAAME,cACJT,MACAU,sBACAC,QACAC,WAAS;AAET,WAAOH,cAAcT,MAAMU,sBAAsBE,SAAAA;EACnD;EAEAC,6BAA6BC,QAAQC,mBAAiB;AACpDA,sBAAAA;EACF;;EAGAC,wCAAAA;EAAyC;AAC3C,GAEA,oBAAelB;",
|
|
5
|
+
"names": ["focusableElements", "A", "INPUT", "SELECT", "TEXTAREA", "UIManager", "blur", "node", "focus", "name", "nodeName", "getAttribute", "setAttribute", "measure", "callback", "measureInWindow", "measureLayout", "relativeToNativeNode", "onFail", "onSuccess", "configureNextLayoutAnimation", "config", "onAnimationDidEnd", "setLayoutAnimationEnabledExperimental"]
|
|
6
6
|
}
|
|
@@ -35,14 +35,14 @@ __export(usePlatformMethods_exports, {
|
|
|
35
35
|
usePlatformMethods: () => usePlatformMethods
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(usePlatformMethods_exports);
|
|
38
|
-
var
|
|
38
|
+
var import_use_element_layout = require("@tamagui/use-element-layout"),
|
|
39
39
|
import_useStable = __toESM(require("../useStable/index"));
|
|
40
40
|
function usePlatformMethods({
|
|
41
41
|
pointerEvents,
|
|
42
42
|
style
|
|
43
43
|
}) {
|
|
44
44
|
return (0, import_useStable.default)(() => hostNode => {
|
|
45
|
-
hostNode != null && (hostNode.measure =
|
|
45
|
+
hostNode != null && (hostNode.measure = (0, import_use_element_layout.createMeasure)(hostNode), hostNode.measureLayout = (0, import_use_element_layout.createMeasureLayout)(hostNode), hostNode.measureInWindow = (0, import_use_element_layout.createMeasureInWindow)(hostNode));
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
var usePlatformMethods_default = usePlatformMethods;
|
|
@@ -26,13 +26,13 @@ __export(usePlatformMethods_exports, {
|
|
|
26
26
|
usePlatformMethods: () => usePlatformMethods
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(usePlatformMethods_exports);
|
|
29
|
-
var
|
|
29
|
+
var import_use_element_layout = require("@tamagui/use-element-layout"), import_useStable = __toESM(require("../useStable/index"));
|
|
30
30
|
function usePlatformMethods({
|
|
31
31
|
pointerEvents,
|
|
32
32
|
style
|
|
33
33
|
}) {
|
|
34
34
|
return (0, import_useStable.default)(() => (hostNode) => {
|
|
35
|
-
hostNode != null && (hostNode.measure = (
|
|
35
|
+
hostNode != null && (hostNode.measure = (0, import_use_element_layout.createMeasure)(hostNode), hostNode.measureLayout = (0, import_use_element_layout.createMeasureLayout)(hostNode), hostNode.measureInWindow = (0, import_use_element_layout.createMeasureInWindow)(hostNode));
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
var usePlatformMethods_default = usePlatformMethods;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/usePlatformMethods/index.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
5
|
-
"names": ["useStable"
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,gCAIO,wCAEP,mBAAsB;AAMf,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AACF,GAG4B;AAW1B,aARY,iBAAAA,SAAU,MAAM,CAAC,aAAkB;AAC7C,IAAI,YAAY,SACd,SAAS,cAAU,yCAAc,QAAQ,GACzC,SAAS,oBAAgB,+CAAoB,QAAQ,GACrD,SAAS,sBAAkB,iDAAsB,QAAQ;AAAA,EAE7D,CAAC;AAGH;AAEA,IAAO,6BAAQ;",
|
|
5
|
+
"names": ["useStable"]
|
|
6
6
|
}
|
|
@@ -27,17 +27,11 @@ __export(usePlatformMethods_exports, {
|
|
|
27
27
|
usePlatformMethods: () => usePlatformMethods
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(usePlatformMethods_exports);
|
|
30
|
-
var
|
|
30
|
+
var import_use_element_layout = require("@tamagui/use-element-layout"), import_useStable = __toESM(require("../useStable/index"));
|
|
31
31
|
function usePlatformMethods(param) {
|
|
32
32
|
var { pointerEvents, style } = param, ref = (0, import_useStable.default)(function() {
|
|
33
33
|
return function(hostNode) {
|
|
34
|
-
hostNode != null && (hostNode.measure =
|
|
35
|
-
return import_UIManager.default.measure(hostNode, callback);
|
|
36
|
-
}, hostNode.measureLayout = function(relativeToNode, success, failure) {
|
|
37
|
-
return import_UIManager.default.measureLayout(hostNode, relativeToNode, failure, success);
|
|
38
|
-
}, hostNode.measureInWindow = function(callback) {
|
|
39
|
-
return import_UIManager.default.measureInWindow(hostNode, callback);
|
|
40
|
-
});
|
|
34
|
+
hostNode != null && (hostNode.measure = (0, import_use_element_layout.createMeasure)(hostNode), hostNode.measureLayout = (0, import_use_element_layout.createMeasureLayout)(hostNode), hostNode.measureInWindow = (0, import_use_element_layout.createMeasureInWindow)(hostNode));
|
|
41
35
|
};
|
|
42
36
|
});
|
|
43
37
|
return ref;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/usePlatformMethods/index.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;
|
|
5
|
-
"names": ["usePlatformMethods", "pointerEvents", "style", "ref", "useStable", "hostNode", "measure", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AASA,gCAIO,wCAEP,mBAAsB;AAMf,SAASA,mBAAmB,OAMlC;MANkC,EACjCC,eACAC,MAAK,IAF4B,OAS3BC,UAAMC,iBAAAA,SAAU,WAAA;WAAM,SAACC,UAAAA;AAC3B,MAAIA,YAAY,SACdA,SAASC,cAAUC,yCAAcF,QAAAA,GACjCA,SAASG,oBAAgBC,+CAAoBJ,QAAAA,GAC7CA,SAASK,sBAAkBC,iDAAsBN,QAAAA;IAErD;;AAEA,SAAOF;AACT;AAEA,IAAA,6BAAeH;",
|
|
5
|
+
"names": ["usePlatformMethods", "pointerEvents", "style", "ref", "useStable", "hostNode", "measure", "createMeasure", "measureLayout", "createMeasureLayout", "measureInWindow", "createMeasureInWindow"]
|
|
6
6
|
}
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const getRect = (node) => {
|
|
4
|
-
const { x, y, top, left } = getBoundingClientRect(node), width = node.offsetWidth, height = node.offsetHeight;
|
|
5
|
-
return { x, y, width, height, top, left };
|
|
6
|
-
}, measureLayout = (node, relativeToNativeNode, callback) => {
|
|
7
|
-
const relativeNode = relativeToNativeNode || node && node.parentNode;
|
|
8
|
-
if (node && relativeNode) {
|
|
9
|
-
const relativeRect = getBoundingClientRect(relativeNode), { height, left, top, width } = getRect(node), x = left - relativeRect.left, y = top - relativeRect.top;
|
|
10
|
-
callback(x, y, width, height, left, top);
|
|
11
|
-
}
|
|
12
|
-
}, focusableElements = {
|
|
1
|
+
import { measure, measureInWindow } from "@tamagui/use-element-layout";
|
|
2
|
+
const focusableElements = {
|
|
13
3
|
A: !0,
|
|
14
4
|
INPUT: !0,
|
|
15
5
|
SELECT: !0,
|
|
@@ -29,40 +19,14 @@ const getRect = (node) => {
|
|
|
29
19
|
}
|
|
30
20
|
},
|
|
31
21
|
measure(node, callback) {
|
|
32
|
-
|
|
22
|
+
return measure(node, callback);
|
|
33
23
|
},
|
|
34
24
|
measureInWindow(node, callback) {
|
|
35
|
-
node
|
|
36
|
-
const { height, left, top, width } = getRect(node);
|
|
37
|
-
callback(left, top, width, height);
|
|
38
|
-
}, 0);
|
|
39
|
-
},
|
|
40
|
-
measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
41
|
-
measureLayout(node, relativeToNativeNode, onSuccess);
|
|
25
|
+
return measureInWindow(node, callback);
|
|
42
26
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
continue;
|
|
47
|
-
const value = props[prop];
|
|
48
|
-
switch (prop) {
|
|
49
|
-
case "style": {
|
|
50
|
-
setValueForStyles(node, value);
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
case "class":
|
|
54
|
-
case "className": {
|
|
55
|
-
node.setAttribute("class", value);
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
case "text":
|
|
59
|
-
case "value":
|
|
60
|
-
node.value = value;
|
|
61
|
-
break;
|
|
62
|
-
default:
|
|
63
|
-
node.setAttribute(prop, value);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
27
|
+
// note its flipped fail and success on purpose lol
|
|
28
|
+
async measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
29
|
+
return measureLayout(node, relativeToNativeNode, onSuccess);
|
|
66
30
|
},
|
|
67
31
|
configureNextLayoutAnimation(config, onAnimationDidEnd) {
|
|
68
32
|
onAnimationDidEnd();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/UIManager/index.tsx"],
|
|
4
|
-
"mappings": "AAUA,
|
|
4
|
+
"mappings": "AAUA,SAAS,SAAS,uBAAuB;AAEzC,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AACZ,GAEM,YAAY;AAAA,EAChB,KAAK,MAAM;AACT,QAAI;AACF,WAAK,KAAK;AAAA,IACZ,QAAc;AAAA,IAEd;AAAA,EACF;AAAA,EAEA,MAAM,MAAM;AACV,QAAI;AACF,YAAM,OAAO,KAAK;AAIlB,MAAI,KAAK,aAAa,UAAU,KAAK,QAAQ,kBAAkB,IAAI,KAAK,QACtE,KAAK,aAAa,YAAY,IAAI,GAEpC,KAAK,MAAM;AAAA,IACb,QAAc;AAAA,IAEd;AAAA,EACF;AAAA,EAEA,QAAQ,MAAM,UAAU;AACtB,WAAO,QAAQ,MAAM,QAAQ;AAAA,EAC/B;AAAA,EAEA,gBAAgB,MAAM,UAAU;AAC9B,WAAO,gBAAgB,MAAM,QAAQ;AAAA,EACvC;AAAA;AAAA,EAGA,MAAM,cACJ,MACA,sBACA,QACA,WACA;AACA,WAAO,cAAc,MAAM,sBAAsB,SAAS;AAAA,EAC5D;AAAA,EAEA,6BAA6B,QAAQ,mBAAmB;AACtD,sBAAkB;AAAA,EACpB;AAAA;AAAA,EAGA,wCAAwC;AAAA,EAAC;AAC3C;AAEA,IAAO,oBAAQ;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,39 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const getRect = node => {
|
|
4
|
-
const {
|
|
5
|
-
x,
|
|
6
|
-
y,
|
|
7
|
-
top,
|
|
8
|
-
left
|
|
9
|
-
} = getBoundingClientRect(node),
|
|
10
|
-
width = node.offsetWidth,
|
|
11
|
-
height = node.offsetHeight;
|
|
12
|
-
return {
|
|
13
|
-
x,
|
|
14
|
-
y,
|
|
15
|
-
width,
|
|
16
|
-
height,
|
|
17
|
-
top,
|
|
18
|
-
left
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
measureLayout = (node, relativeToNativeNode, callback) => {
|
|
22
|
-
const relativeNode = relativeToNativeNode || node && node.parentNode;
|
|
23
|
-
if (node && relativeNode) {
|
|
24
|
-
const relativeRect = getBoundingClientRect(relativeNode),
|
|
25
|
-
{
|
|
26
|
-
height,
|
|
27
|
-
left,
|
|
28
|
-
top,
|
|
29
|
-
width
|
|
30
|
-
} = getRect(node),
|
|
31
|
-
x = left - relativeRect.left,
|
|
32
|
-
y = top - relativeRect.top;
|
|
33
|
-
callback(x, y, width, height, left, top);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
focusableElements = {
|
|
1
|
+
import { measure, measureInWindow } from "@tamagui/use-element-layout";
|
|
2
|
+
const focusableElements = {
|
|
37
3
|
A: !0,
|
|
38
4
|
INPUT: !0,
|
|
39
5
|
SELECT: !0,
|
|
@@ -52,46 +18,14 @@ const getRect = node => {
|
|
|
52
18
|
} catch {}
|
|
53
19
|
},
|
|
54
20
|
measure(node, callback) {
|
|
55
|
-
|
|
21
|
+
return measure(node, callback);
|
|
56
22
|
},
|
|
57
23
|
measureInWindow(node, callback) {
|
|
58
|
-
node
|
|
59
|
-
const {
|
|
60
|
-
height,
|
|
61
|
-
left,
|
|
62
|
-
top,
|
|
63
|
-
width
|
|
64
|
-
} = getRect(node);
|
|
65
|
-
callback(left, top, width, height);
|
|
66
|
-
}, 0);
|
|
67
|
-
},
|
|
68
|
-
measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
69
|
-
measureLayout(node, relativeToNativeNode, onSuccess);
|
|
24
|
+
return measureInWindow(node, callback);
|
|
70
25
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const value = props[prop];
|
|
75
|
-
switch (prop) {
|
|
76
|
-
case "style":
|
|
77
|
-
{
|
|
78
|
-
setValueForStyles(node, value);
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
case "class":
|
|
82
|
-
case "className":
|
|
83
|
-
{
|
|
84
|
-
node.setAttribute("class", value);
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
case "text":
|
|
88
|
-
case "value":
|
|
89
|
-
node.value = value;
|
|
90
|
-
break;
|
|
91
|
-
default:
|
|
92
|
-
node.setAttribute(prop, value);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
26
|
+
// note its flipped fail and success on purpose lol
|
|
27
|
+
async measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
28
|
+
return measureLayout(node, relativeToNativeNode, onSuccess);
|
|
95
29
|
},
|
|
96
30
|
configureNextLayoutAnimation(config, onAnimationDidEnd) {
|
|
97
31
|
onAnimationDidEnd();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["measure","measureInWindow","focusableElements","A","INPUT","SELECT","TEXTAREA","UIManager","blur","node","focus","name","nodeName","getAttribute","setAttribute","callback","measureLayout","relativeToNativeNode","onFail","onSuccess","configureNextLayoutAnimation","config","onAnimationDidEnd","setLayoutAnimationEnabledExperimental","UIManager_default"],"sources":["../../../../src/modules/UIManager/index.tsx"],"sourcesContent":[null],"mappings":"AAUA,SAASA,OAAA,EAASC,eAAA,QAAuB;AAEzC,MAAMC,iBAAA,GAAoB;IACxBC,CAAA,EAAG;IACHC,KAAA,EAAO;IACPC,MAAA,EAAQ;IACRC,QAAA,EAAU;EACZ;EAEMC,SAAA,GAAY;IAChBC,KAAKC,IAAA,EAAM;MACT,IAAI;QACFA,IAAA,CAAKD,IAAA,CAAK;MACZ,QAAc,CAEd;IACF;IAEAE,MAAMD,IAAA,EAAM;MACV,IAAI;QACF,MAAME,IAAA,GAAOF,IAAA,CAAKG,QAAA;QAIdH,IAAA,CAAKI,YAAA,CAAa,UAAU,KAAK,QAAQX,iBAAA,CAAkBS,IAAI,KAAK,QACtEF,IAAA,CAAKK,YAAA,CAAa,YAAY,IAAI,GAEpCL,IAAA,CAAKC,KAAA,CAAM;MACb,QAAc,CAEd;IACF;IAEAV,QAAQS,IAAA,EAAMM,QAAA,EAAU;MACtB,OAAOf,OAAA,CAAQS,IAAA,EAAMM,QAAQ;IAC/B;IAEAd,gBAAgBQ,IAAA,EAAMM,QAAA,EAAU;MAC9B,OAAOd,eAAA,CAAgBQ,IAAA,EAAMM,QAAQ;IACvC;IAAA;IAGA,MAAMC,cACJP,IAAA,EACAQ,oBAAA,EACAC,MAAA,EACAC,SAAA,EACA;MACA,OAAOH,aAAA,CAAcP,IAAA,EAAMQ,oBAAA,EAAsBE,SAAS;IAC5D;IAEAC,6BAA6BC,MAAA,EAAQC,iBAAA,EAAmB;MACtDA,iBAAA,CAAkB;IACpB;IAAA;IAGAC,sCAAA,EAAwC,CAAC;EAC3C;AAEA,IAAOC,iBAAA,GAAQjB,SAAA","ignoreList":[]}
|
|
@@ -1,39 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var getRect = function (node) {
|
|
4
|
-
var {
|
|
5
|
-
x,
|
|
6
|
-
y,
|
|
7
|
-
top,
|
|
8
|
-
left
|
|
9
|
-
} = getBoundingClientRect(node),
|
|
10
|
-
width = node.offsetWidth,
|
|
11
|
-
height = node.offsetHeight;
|
|
12
|
-
return {
|
|
13
|
-
x,
|
|
14
|
-
y,
|
|
15
|
-
width,
|
|
16
|
-
height,
|
|
17
|
-
top,
|
|
18
|
-
left
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
measureLayout = function (node, relativeToNativeNode, callback) {
|
|
22
|
-
var relativeNode = relativeToNativeNode || node && node.parentNode;
|
|
23
|
-
if (node && relativeNode) {
|
|
24
|
-
var relativeRect = getBoundingClientRect(relativeNode),
|
|
25
|
-
{
|
|
26
|
-
height,
|
|
27
|
-
left,
|
|
28
|
-
top,
|
|
29
|
-
width
|
|
30
|
-
} = getRect(node),
|
|
31
|
-
x = left - relativeRect.left,
|
|
32
|
-
y = top - relativeRect.top;
|
|
33
|
-
callback(x, y, width, height, left, top);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
focusableElements = {
|
|
1
|
+
import { measure, measureInWindow } from "@tamagui/use-element-layout";
|
|
2
|
+
var focusableElements = {
|
|
37
3
|
A: !0,
|
|
38
4
|
INPUT: !0,
|
|
39
5
|
SELECT: !0,
|
|
@@ -54,45 +20,14 @@ var getRect = function (node) {
|
|
|
54
20
|
},
|
|
55
21
|
//
|
|
56
22
|
measure(node, callback) {
|
|
57
|
-
|
|
23
|
+
return measure(node, callback);
|
|
58
24
|
},
|
|
59
25
|
measureInWindow(node, callback) {
|
|
60
|
-
|
|
61
|
-
var {
|
|
62
|
-
height,
|
|
63
|
-
left,
|
|
64
|
-
top,
|
|
65
|
-
width
|
|
66
|
-
} = getRect(node);
|
|
67
|
-
callback(left, top, width, height);
|
|
68
|
-
}, 0);
|
|
69
|
-
},
|
|
70
|
-
measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
71
|
-
measureLayout(node, relativeToNativeNode, onSuccess);
|
|
26
|
+
return measureInWindow(node, callback);
|
|
72
27
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
switch (prop) {
|
|
77
|
-
case "style":
|
|
78
|
-
{
|
|
79
|
-
setValueForStyles(node, value);
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
case "class":
|
|
83
|
-
case "className":
|
|
84
|
-
{
|
|
85
|
-
node.setAttribute("class", value);
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
case "text":
|
|
89
|
-
case "value":
|
|
90
|
-
node.value = value;
|
|
91
|
-
break;
|
|
92
|
-
default:
|
|
93
|
-
node.setAttribute(prop, value);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
28
|
+
// note its flipped fail and success on purpose lol
|
|
29
|
+
async measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
|
30
|
+
return measureLayout(node, relativeToNativeNode, onSuccess);
|
|
96
31
|
},
|
|
97
32
|
configureNextLayoutAnimation(config, onAnimationDidEnd) {
|
|
98
33
|
onAnimationDidEnd();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["measure","measureInWindow","focusableElements","A","INPUT","SELECT","TEXTAREA","UIManager","blur","node","focus","name","nodeName","getAttribute","setAttribute","callback","measureLayout","relativeToNativeNode","onFail","onSuccess","configureNextLayoutAnimation","config","onAnimationDidEnd","setLayoutAnimationEnabledExperimental"],"sources":["../../../../src/modules/UIManager/index.tsx"],"sourcesContent":[null],"mappings":"AAUA,SAASA,OAAA,EAASC,eAAA,QAAuB;AAEzC,IAAAC,iBAAM;IACJC,CAAA,EAAG;IACHC,KAAA,EAAO;IACPC,MAAA,EAAQ;IACRC,QAAA,EAAU;EACZ;EAEMC,SAAA,GAAY;IAChBC,KAAKC,IAAA,EAAM;MACT,IAAI;QACFA,IAAA,CAAKD,IAAA,CAAK;MACZ,QAAc,CAEd;IACF;IAEA;IACEE,MAAID,IAAA;MACF;QAII,IAAAE,IAAK,GAAAF,IAAA,CAAAG,QAAa;QAIxBH,IAAA,CAAAI,YAAc,wBAAAX,iBAAA,CAAAS,IAAA,aAAAF,IAAA,CAAAK,YAAA,oBAAAL,IAAA,CAAAC,KAAA;MAEd,SACF;IAEA;IACE;IACFV,QAAAS,IAAA,EAAAM,QAAA;MAEA,OAAAf,OAAgB,CAAAS,IAAA,EAAMM,QAAA,CAAU;IAC9B;IACFd,gBAAAQ,IAAA,EAAAM,QAAA;MAAA,OAAAd,eAAA,CAAAQ,IAAA,EAAAM,QAAA;IAGA;IAME;IACF,MAAAC,cAAAP,IAAA,EAAAQ,oBAAA,EAAAC,MAAA,EAAAC,SAAA;MAEA,OAAAH,aAAA,CAAAP,IAAA,EAA6BQ,oBAAQ,EAAAE,SAAmB;IACtD;IACFC,6BAAAC,MAAA,EAAAC,iBAAA;MAAAA,iBAAA;IAGA;IAAyC;IAC3CC,sCAAA,GAEA","ignoreList":[]}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
createMeasure,
|
|
3
|
+
createMeasureInWindow,
|
|
4
|
+
createMeasureLayout
|
|
5
|
+
} from "@tamagui/use-element-layout";
|
|
2
6
|
import useStable from "../useStable/index";
|
|
3
7
|
function usePlatformMethods({
|
|
4
8
|
pointerEvents,
|
|
5
9
|
style
|
|
6
10
|
}) {
|
|
7
11
|
return useStable(() => (hostNode) => {
|
|
8
|
-
hostNode != null && (hostNode.measure = (
|
|
12
|
+
hostNode != null && (hostNode.measure = createMeasure(hostNode), hostNode.measureLayout = createMeasureLayout(hostNode), hostNode.measureInWindow = createMeasureInWindow(hostNode));
|
|
9
13
|
});
|
|
10
14
|
}
|
|
11
15
|
var usePlatformMethods_default = usePlatformMethods;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/usePlatformMethods/index.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AASA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,OAAO,eAAe;AAMf,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AACF,GAG4B;AAW1B,SARY,UAAU,MAAM,CAAC,aAAkB;AAC7C,IAAI,YAAY,SACd,SAAS,UAAU,cAAc,QAAQ,GACzC,SAAS,gBAAgB,oBAAoB,QAAQ,GACrD,SAAS,kBAAkB,sBAAsB,QAAQ;AAAA,EAE7D,CAAC;AAGH;AAEA,IAAO,6BAAQ;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createMeasure, createMeasureInWindow, createMeasureLayout } from "@tamagui/use-element-layout";
|
|
2
2
|
import useStable from "../useStable/index.mjs";
|
|
3
3
|
function usePlatformMethods({
|
|
4
4
|
pointerEvents,
|
|
5
5
|
style
|
|
6
6
|
}) {
|
|
7
7
|
return useStable(() => hostNode => {
|
|
8
|
-
hostNode != null && (hostNode.measure =
|
|
8
|
+
hostNode != null && (hostNode.measure = createMeasure(hostNode), hostNode.measureLayout = createMeasureLayout(hostNode), hostNode.measureInWindow = createMeasureInWindow(hostNode));
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
var usePlatformMethods_default = usePlatformMethods;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createMeasure","createMeasureInWindow","createMeasureLayout","useStable","usePlatformMethods","pointerEvents","style","hostNode","measure","measureLayout","measureInWindow","usePlatformMethods_default"],"sources":["../../../../src/modules/usePlatformMethods/index.tsx"],"sourcesContent":[null],"mappings":"AASA,SACEA,aAAA,EACAC,qBAAA,EACAC,mBAAA,QACK;AAEP,OAAOC,SAAA,MAAe;AAMf,SAASC,mBAAmB;EACjCC,aAAA;EACAC;AACF,GAG4B;EAW1B,OARYH,SAAA,CAAU,MAAOI,QAAA,IAAkB;IACzCA,QAAA,IAAY,SACdA,QAAA,CAASC,OAAA,GAAUR,aAAA,CAAcO,QAAQ,GACzCA,QAAA,CAASE,aAAA,GAAgBP,mBAAA,CAAoBK,QAAQ,GACrDA,QAAA,CAASG,eAAA,GAAkBT,qBAAA,CAAsBM,QAAQ;EAE7D,CAAC;AAGH;AAEA,IAAOI,0BAAA,GAAQP,kBAAA","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createMeasure, createMeasureInWindow, createMeasureLayout } from "@tamagui/use-element-layout";
|
|
2
2
|
import useStable from "../useStable/index.native.js";
|
|
3
3
|
function usePlatformMethods(param) {
|
|
4
4
|
var {
|
|
@@ -7,13 +7,7 @@ function usePlatformMethods(param) {
|
|
|
7
7
|
} = param,
|
|
8
8
|
ref = useStable(function () {
|
|
9
9
|
return function (hostNode) {
|
|
10
|
-
hostNode != null && (hostNode.measure =
|
|
11
|
-
return UIManager.measure(hostNode, callback);
|
|
12
|
-
}, hostNode.measureLayout = function (relativeToNode, success, failure) {
|
|
13
|
-
return UIManager.measureLayout(hostNode, relativeToNode, failure, success);
|
|
14
|
-
}, hostNode.measureInWindow = function (callback) {
|
|
15
|
-
return UIManager.measureInWindow(hostNode, callback);
|
|
16
|
-
});
|
|
10
|
+
hostNode != null && (hostNode.measure = createMeasure(hostNode), hostNode.measureLayout = createMeasureLayout(hostNode), hostNode.measureInWindow = createMeasureInWindow(hostNode));
|
|
17
11
|
};
|
|
18
12
|
});
|
|
19
13
|
return ref;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createMeasure","createMeasureInWindow","createMeasureLayout","useStable","usePlatformMethods","param","pointerEvents","style","ref","hostNode","measure","measureLayout","measureInWindow","usePlatformMethods_default","default"],"sources":["../../../../src/modules/usePlatformMethods/index.tsx"],"sourcesContent":[null],"mappings":"AASA,SAAAA,aAAA,EAAAC,qBAAA,EAAAC,mBAAA;AAAA,OACEC,SAAA;AAAA,SACAC,mBAAAC,KAAA;EACA;MAAAC,aAAA;MAAAC;IAAA,IAAAF,KAAA;IAAAG,GAAA,GAAAL,SAAA;MAAA,OACK,UAAAM,QAAA;QAEPA,QAAO,QAAe,KAAAA,QAAA,CAAAC,OAAA,GAAAV,aAAA,CAAAS,QAAA,GAAAA,QAAA,CAAAE,aAAA,GAAAT,mBAAA,CAAAO,QAAA,GAAAA,QAAA,CAAAG,eAAA,GAAAX,qBAAA,CAAAQ,QAAA;MAMf;IACL;EACA,OAAAD,GAAA;AACF;AAcE,IAAAK,0BAR6B,GAAAT,kBAAkB;AAC7C,SAKFS,0BAAC,IAAAC,OAAA,EAGHV,kBAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/react-native-web-internals",
|
|
3
|
-
"version": "1.130.
|
|
3
|
+
"version": "1.130.8",
|
|
4
4
|
"description": "React Native for Web",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@tamagui/normalize-css-color": "1.130.
|
|
35
|
-
"@tamagui/react-native-use-pressable": "1.130.
|
|
36
|
-
"@tamagui/react-native-use-responder-events": "1.130.
|
|
37
|
-
"@tamagui/simple-hash": "1.130.
|
|
38
|
-
"@tamagui/use-element-layout": "1.130.
|
|
39
|
-
"@tamagui/web": "1.130.
|
|
34
|
+
"@tamagui/normalize-css-color": "1.130.8",
|
|
35
|
+
"@tamagui/react-native-use-pressable": "1.130.8",
|
|
36
|
+
"@tamagui/react-native-use-responder-events": "1.130.8",
|
|
37
|
+
"@tamagui/simple-hash": "1.130.8",
|
|
38
|
+
"@tamagui/use-element-layout": "1.130.8",
|
|
39
|
+
"@tamagui/web": "1.130.8"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "1.130.
|
|
42
|
+
"@tamagui/build": "1.130.8",
|
|
43
43
|
"react": "*",
|
|
44
44
|
"react-dom": "*"
|
|
45
45
|
},
|
|
@@ -8,29 +8,7 @@
|
|
|
8
8
|
* @noflow
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import
|
|
12
|
-
import setValueForStyles from '../setValueForStyles/index'
|
|
13
|
-
|
|
14
|
-
const getRect = (node) => {
|
|
15
|
-
// Unlike the DOM's getBoundingClientRect, React Native layout measurements
|
|
16
|
-
// for "height" and "width" ignore scale transforms.
|
|
17
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements
|
|
18
|
-
const { x, y, top, left } = getBoundingClientRect(node)!
|
|
19
|
-
const width = node.offsetWidth
|
|
20
|
-
const height = node.offsetHeight
|
|
21
|
-
return { x, y, width, height, top, left }
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const measureLayout = (node, relativeToNativeNode, callback) => {
|
|
25
|
-
const relativeNode = relativeToNativeNode || (node && node.parentNode)
|
|
26
|
-
if (node && relativeNode) {
|
|
27
|
-
const relativeRect = getBoundingClientRect(relativeNode)
|
|
28
|
-
const { height, left, top, width } = getRect(node)
|
|
29
|
-
const x = left - relativeRect.left
|
|
30
|
-
const y = top - relativeRect.top
|
|
31
|
-
callback(x, y, width, height, left, top)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
11
|
+
import { measure, measureInWindow } from '@tamagui/use-element-layout'
|
|
34
12
|
|
|
35
13
|
const focusableElements = {
|
|
36
14
|
A: true,
|
|
@@ -64,48 +42,21 @@ const UIManager = {
|
|
|
64
42
|
},
|
|
65
43
|
|
|
66
44
|
measure(node, callback) {
|
|
67
|
-
|
|
45
|
+
return measure(node, callback)
|
|
68
46
|
},
|
|
69
47
|
|
|
70
48
|
measureInWindow(node, callback) {
|
|
71
|
-
|
|
72
|
-
setTimeout(() => {
|
|
73
|
-
const { height, left, top, width } = getRect(node)
|
|
74
|
-
callback(left, top, width, height)
|
|
75
|
-
}, 0)
|
|
76
|
-
}
|
|
49
|
+
return measureInWindow(node, callback)
|
|
77
50
|
},
|
|
78
51
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const value = props[prop]
|
|
90
|
-
switch (prop) {
|
|
91
|
-
case 'style': {
|
|
92
|
-
setValueForStyles(node, value)
|
|
93
|
-
break
|
|
94
|
-
}
|
|
95
|
-
case 'class':
|
|
96
|
-
case 'className': {
|
|
97
|
-
node.setAttribute('class', value)
|
|
98
|
-
break
|
|
99
|
-
}
|
|
100
|
-
case 'text':
|
|
101
|
-
case 'value':
|
|
102
|
-
// native platforms use `text` prop to replace text input value
|
|
103
|
-
node.value = value
|
|
104
|
-
break
|
|
105
|
-
default:
|
|
106
|
-
node.setAttribute(prop, value)
|
|
107
|
-
}
|
|
108
|
-
}
|
|
52
|
+
// note its flipped fail and success on purpose lol
|
|
53
|
+
async measureLayout(
|
|
54
|
+
node: HTMLElement,
|
|
55
|
+
relativeToNativeNode?: HTMLElement,
|
|
56
|
+
onFail,
|
|
57
|
+
onSuccess
|
|
58
|
+
) {
|
|
59
|
+
return measureLayout(node, relativeToNativeNode, onSuccess)
|
|
109
60
|
},
|
|
110
61
|
|
|
111
62
|
configureNextLayoutAnimation(config, onAnimationDidEnd) {
|
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
* @flow
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import {
|
|
11
|
+
createMeasure,
|
|
12
|
+
createMeasureInWindow,
|
|
13
|
+
createMeasureLayout,
|
|
14
|
+
} from '@tamagui/use-element-layout'
|
|
10
15
|
import type { GenericStyleProp } from '../../types'
|
|
11
|
-
import UIManager from '../UIManager/index'
|
|
12
16
|
import useStable from '../useStable/index'
|
|
13
17
|
|
|
14
18
|
/**
|
|
@@ -26,11 +30,9 @@ export function usePlatformMethods({
|
|
|
26
30
|
// available to 'setNativeProps' when it is called.
|
|
27
31
|
const ref = useStable(() => (hostNode: any) => {
|
|
28
32
|
if (hostNode != null) {
|
|
29
|
-
hostNode.measure = (
|
|
30
|
-
hostNode.measureLayout = (
|
|
31
|
-
|
|
32
|
-
hostNode.measureInWindow = (callback) =>
|
|
33
|
-
UIManager.measureInWindow(hostNode, callback)
|
|
33
|
+
hostNode.measure = createMeasure(hostNode)
|
|
34
|
+
hostNode.measureLayout = createMeasureLayout(hostNode)
|
|
35
|
+
hostNode.measureInWindow = createMeasureInWindow(hostNode)
|
|
34
36
|
}
|
|
35
37
|
})
|
|
36
38
|
|
|
@@ -9,10 +9,14 @@
|
|
|
9
9
|
declare const UIManager: {
|
|
10
10
|
blur(node: any): void;
|
|
11
11
|
focus(node: any): void;
|
|
12
|
-
measure(node: any, callback: any):
|
|
13
|
-
measureInWindow(node: any, callback: any):
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
measure(node: any, callback: any): Promise<import("@tamagui/use-element-layout").LayoutValue | null>;
|
|
13
|
+
measureInWindow(node: any, callback: any): Promise<{
|
|
14
|
+
pageX: number;
|
|
15
|
+
pageY: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
} | null>;
|
|
19
|
+
measureLayout(node: HTMLElement, relativeToNativeNode?: HTMLElement, onFail: any, onSuccess: any): Promise<any>;
|
|
16
20
|
configureNextLayoutAnimation(config: any, onAnimationDidEnd: any): void;
|
|
17
21
|
setLayoutAnimationEnabledExperimental(): void;
|
|
18
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/UIManager/index.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/UIManager/index.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAWH,QAAA,MAAM,SAAS;;;;;;;;;;wBAkCL,WAAW,yBACM,WAAW;;;CAarC,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/usePlatformMethods/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/usePlatformMethods/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAGnD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,aAAa,EACb,KAAK,GACN,EAAE;IACD,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IACjC,aAAa,CAAC,EAAE,GAAG,CAAA;CACpB,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAY1B;AAED,eAAe,kBAAkB,CAAA"}
|