@tamagui/react-native-web 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cjs/Dimensions.cjs +84 -0
- package/dist/cjs/Dimensions.js +79 -0
- package/dist/cjs/Dimensions.js.map +6 -0
- package/dist/cjs/Dimensions.native.js +93 -0
- package/dist/cjs/Dimensions.native.js.map +1 -0
- package/dist/cjs/index.cjs +68 -0
- package/dist/cjs/index.js +50 -0
- package/dist/cjs/index.js.map +6 -0
- package/dist/cjs/index.native.js +85 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/esm/Dimensions.js +63 -0
- package/dist/esm/Dimensions.js.map +6 -0
- package/dist/esm/Dimensions.mjs +61 -0
- package/dist/esm/Dimensions.mjs.map +1 -0
- package/dist/esm/Dimensions.native.js +67 -0
- package/dist/esm/Dimensions.native.js.map +1 -0
- package/dist/esm/index.js +35 -0
- package/dist/esm/index.js.map +6 -0
- package/dist/esm/index.mjs +31 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +45 -0
- package/dist/esm/index.native.js.map +1 -0
- package/package.json +47 -0
- package/src/Dimensions.ts +117 -0
- package/src/index.tsx +59 -0
- package/types/Dimensions.d.ts +22 -0
- package/types/Dimensions.d.ts.map +1 -0
- package/types/index.d.ts +25 -0
- package/types/index.d.ts.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Nate Wienert
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,84 @@
|
|
|
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) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var Dimensions_exports = {};
|
|
22
|
+
__export(Dimensions_exports, {
|
|
23
|
+
Dimensions: () => Dimensions
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(Dimensions_exports);
|
|
26
|
+
const dimensions = {
|
|
27
|
+
window: {
|
|
28
|
+
fontScale: 1,
|
|
29
|
+
height: 0,
|
|
30
|
+
scale: 1,
|
|
31
|
+
width: 0
|
|
32
|
+
},
|
|
33
|
+
screen: {
|
|
34
|
+
fontScale: 1,
|
|
35
|
+
height: 0,
|
|
36
|
+
scale: 1,
|
|
37
|
+
width: 0
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
listeners = {},
|
|
41
|
+
canUseDOM = typeof window < "u";
|
|
42
|
+
let shouldInit = canUseDOM;
|
|
43
|
+
function update() {
|
|
44
|
+
if (!canUseDOM) return;
|
|
45
|
+
const win = window,
|
|
46
|
+
docEl = win.document.documentElement;
|
|
47
|
+
dimensions.window = {
|
|
48
|
+
fontScale: 1,
|
|
49
|
+
height: docEl.clientHeight,
|
|
50
|
+
scale: win.devicePixelRatio || 1,
|
|
51
|
+
width: docEl.clientWidth
|
|
52
|
+
}, dimensions.screen = {
|
|
53
|
+
fontScale: 1,
|
|
54
|
+
height: win.screen.height,
|
|
55
|
+
scale: win.devicePixelRatio || 1,
|
|
56
|
+
width: win.screen.width
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function handleResize() {
|
|
60
|
+
update(), Array.isArray(listeners.change) && listeners.change.forEach(handler => handler(dimensions));
|
|
61
|
+
}
|
|
62
|
+
const Dimensions = {
|
|
63
|
+
get(dimension) {
|
|
64
|
+
if (shouldInit && (shouldInit = !1, update()), dimensions[dimension] === void 0) throw new Error(`No dimension set for key ${dimension}`);
|
|
65
|
+
return dimensions[dimension];
|
|
66
|
+
},
|
|
67
|
+
set(initialDimensions) {
|
|
68
|
+
if (initialDimensions) {
|
|
69
|
+
if (canUseDOM) throw new Error("Dimensions cannot be set in the browser");
|
|
70
|
+
initialDimensions.screen != null && (dimensions.screen = initialDimensions.screen), initialDimensions.window != null && (dimensions.window = initialDimensions.window);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
addEventListener(type, handler) {
|
|
74
|
+
return listeners[type] = listeners[type] || [], listeners[type].push(handler), {
|
|
75
|
+
remove: () => {
|
|
76
|
+
this.removeEventListener(type, handler);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
removeEventListener(type, handler) {
|
|
81
|
+
Array.isArray(listeners[type]) && (listeners[type] = listeners[type].filter(_handler => _handler !== handler));
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
canUseDOM && window.addEventListener("resize", handleResize, !1);
|
|
@@ -0,0 +1,79 @@
|
|
|
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 Dimensions_exports = {};
|
|
16
|
+
__export(Dimensions_exports, {
|
|
17
|
+
Dimensions: () => Dimensions
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(Dimensions_exports);
|
|
20
|
+
const dimensions = {
|
|
21
|
+
window: {
|
|
22
|
+
fontScale: 1,
|
|
23
|
+
height: 0,
|
|
24
|
+
scale: 1,
|
|
25
|
+
width: 0
|
|
26
|
+
},
|
|
27
|
+
screen: {
|
|
28
|
+
fontScale: 1,
|
|
29
|
+
height: 0,
|
|
30
|
+
scale: 1,
|
|
31
|
+
width: 0
|
|
32
|
+
}
|
|
33
|
+
}, listeners = {}, canUseDOM = typeof window < "u";
|
|
34
|
+
let shouldInit = canUseDOM;
|
|
35
|
+
function update() {
|
|
36
|
+
if (!canUseDOM)
|
|
37
|
+
return;
|
|
38
|
+
const win = window, docEl = win.document.documentElement;
|
|
39
|
+
dimensions.window = {
|
|
40
|
+
fontScale: 1,
|
|
41
|
+
height: docEl.clientHeight,
|
|
42
|
+
scale: win.devicePixelRatio || 1,
|
|
43
|
+
width: docEl.clientWidth
|
|
44
|
+
}, dimensions.screen = {
|
|
45
|
+
fontScale: 1,
|
|
46
|
+
height: win.screen.height,
|
|
47
|
+
scale: win.devicePixelRatio || 1,
|
|
48
|
+
width: win.screen.width
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function handleResize() {
|
|
52
|
+
update(), Array.isArray(listeners.change) && listeners.change.forEach((handler) => handler(dimensions));
|
|
53
|
+
}
|
|
54
|
+
const Dimensions = {
|
|
55
|
+
get(dimension) {
|
|
56
|
+
if (shouldInit && (shouldInit = !1, update()), dimensions[dimension] === void 0)
|
|
57
|
+
throw new Error(`No dimension set for key ${dimension}`);
|
|
58
|
+
return dimensions[dimension];
|
|
59
|
+
},
|
|
60
|
+
set(initialDimensions) {
|
|
61
|
+
if (initialDimensions) {
|
|
62
|
+
if (canUseDOM)
|
|
63
|
+
throw new Error("Dimensions cannot be set in the browser");
|
|
64
|
+
initialDimensions.screen != null && (dimensions.screen = initialDimensions.screen), initialDimensions.window != null && (dimensions.window = initialDimensions.window);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
addEventListener(type, handler) {
|
|
68
|
+
return listeners[type] = listeners[type] || [], listeners[type].push(handler), {
|
|
69
|
+
remove: () => {
|
|
70
|
+
this.removeEventListener(type, handler);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
removeEventListener(type, handler) {
|
|
75
|
+
Array.isArray(listeners[type]) && (listeners[type] = listeners[type].filter((_handler) => _handler !== handler));
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
canUseDOM && window.addEventListener("resize", handleResize, !1);
|
|
79
|
+
//# sourceMappingURL=Dimensions.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Dimensions.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,MAAM,aAAa;AAAA,EACjB,QAAQ;AAAA,IACN,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,IACN,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF,GAEM,YAAY,CAAC,GAEb,YAAY,OAAO,SAAW;AACpC,IAAI,aAAa;AAEjB,SAAS,SAAS;AAChB,MAAI,CAAC;AACH;AAGF,QAAM,MAAM,QACN,QAAQ,IAAI,SAAS;AAE3B,aAAW,SAAS;AAAA,IAClB,WAAW;AAAA,IACX,QAAQ,MAAM;AAAA,IACd,OAAO,IAAI,oBAAoB;AAAA,IAC/B,OAAO,MAAM;AAAA,EACf,GAEA,WAAW,SAAS;AAAA,IAClB,WAAW;AAAA,IACX,QAAQ,IAAI,OAAO;AAAA,IACnB,OAAO,IAAI,oBAAoB;AAAA,IAC/B,OAAO,IAAI,OAAO;AAAA,EACpB;AACF;AAEA,SAAS,eAAe;AACtB,SAAO,GACH,MAAM,QAAQ,UAAU,MAAS,KACnC,UAAU,OAAU,QAAQ,CAAC,YAAY,QAAQ,UAAU,CAAC;AAEhE;AAEO,MAAM,aAAa;AAAA,EACxB,IAAI,WAAyC;AAK3C,QAJI,eACF,aAAa,IACb,OAAO,IAEL,WAAW,SAAS,MAAM;AAC5B,YAAM,IAAI,MAAM,4BAA4B,SAAS,EAAE;AACzD,WAAO,WAAW,SAAS;AAAA,EAC7B;AAAA,EAEA,IAAI,mBAAiD;AACnD,QAAI,mBAAmB;AACrB,UAAI;AACF,cAAM,IAAI,MAAM,yCAAyC;AAE3D,MAAI,kBAAkB,UAAU,SAC9B,WAAW,SAAS,kBAAkB,SAEpC,kBAAkB,UAAU,SAC9B,WAAW,SAAS,kBAAkB;AAAA,IAE1C;AAAA,EACF;AAAA,EAEA,iBACE,MACA,SACA;AACA,qBAAU,IAAI,IAAI,UAAU,IAAI,KAAK,CAAC,GACtC,UAAU,IAAI,EAAE,KAAK,OAAO,GAErB;AAAA,MACL,QAAQ,MAAM;AACZ,aAAK,oBAAoB,MAAM,OAAO;AAAA,MACxC;AAAA,IACF;AAAA,EACF;AAAA,EAEA,oBACE,MACA,SACM;AACN,IAAI,MAAM,QAAQ,UAAU,IAAI,CAAC,MAC/B,UAAU,IAAI,IAAI,UAAU,IAAI,EAAE,OAAO,CAAC,aAAa,aAAa,OAAO;AAAA,EAE/E;AACF;AAEI,aACF,OAAO,iBAAiB,UAAU,cAAc,EAAK;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: !0
|
|
22
|
+
}), mod);
|
|
23
|
+
var Dimensions_exports = {};
|
|
24
|
+
__export(Dimensions_exports, {
|
|
25
|
+
Dimensions: () => Dimensions
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(Dimensions_exports);
|
|
28
|
+
var dimensions = {
|
|
29
|
+
window: {
|
|
30
|
+
fontScale: 1,
|
|
31
|
+
height: 0,
|
|
32
|
+
scale: 1,
|
|
33
|
+
width: 0
|
|
34
|
+
},
|
|
35
|
+
screen: {
|
|
36
|
+
fontScale: 1,
|
|
37
|
+
height: 0,
|
|
38
|
+
scale: 1,
|
|
39
|
+
width: 0
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
listeners = {},
|
|
43
|
+
canUseDOM = typeof window < "u",
|
|
44
|
+
shouldInit = canUseDOM;
|
|
45
|
+
function update() {
|
|
46
|
+
if (canUseDOM) {
|
|
47
|
+
var win = window,
|
|
48
|
+
docEl = win.document.documentElement;
|
|
49
|
+
dimensions.window = {
|
|
50
|
+
fontScale: 1,
|
|
51
|
+
height: docEl.clientHeight,
|
|
52
|
+
scale: win.devicePixelRatio || 1,
|
|
53
|
+
width: docEl.clientWidth
|
|
54
|
+
}, dimensions.screen = {
|
|
55
|
+
fontScale: 1,
|
|
56
|
+
height: win.screen.height,
|
|
57
|
+
scale: win.devicePixelRatio || 1,
|
|
58
|
+
width: win.screen.width
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function handleResize() {
|
|
63
|
+
update(), Array.isArray(listeners.change) && listeners.change.forEach(function (handler) {
|
|
64
|
+
return handler(dimensions);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
var Dimensions = {
|
|
68
|
+
get(dimension) {
|
|
69
|
+
if (shouldInit && (shouldInit = !1, update()), dimensions[dimension] === void 0) throw new Error(`No dimension set for key ${dimension}`);
|
|
70
|
+
return dimensions[dimension];
|
|
71
|
+
},
|
|
72
|
+
set(initialDimensions) {
|
|
73
|
+
if (initialDimensions) {
|
|
74
|
+
if (canUseDOM) throw new Error("Dimensions cannot be set in the browser");
|
|
75
|
+
initialDimensions.screen != null && (dimensions.screen = initialDimensions.screen), initialDimensions.window != null && (dimensions.window = initialDimensions.window);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
addEventListener(type, handler) {
|
|
79
|
+
var _this = this;
|
|
80
|
+
return listeners[type] = listeners[type] || [], listeners[type].push(handler), {
|
|
81
|
+
remove: function () {
|
|
82
|
+
_this.removeEventListener(type, handler);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
removeEventListener(type, handler) {
|
|
87
|
+
Array.isArray(listeners[type]) && (listeners[type] = listeners[type].filter(function (_handler) {
|
|
88
|
+
return _handler !== handler;
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
canUseDOM && window.addEventListener("resize", handleResize, !1);
|
|
93
|
+
//# sourceMappingURL=Dimensions.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Dimensions_exports","__export","Dimensions","module","exports","dimensions","window","fontScale","height","scale","width","screen","listeners","canUseDOM","shouldInit","update","win","docEl","document","documentElement","clientHeight","devicePixelRatio","clientWidth","handleResize","Array","isArray","change","forEach","handler","get","dimension","Error","set","initialDimensions","addEventListener","type","_this","push","remove","removeEventListener","filter","_handler"],"sources":["../../src/Dimensions.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,kBAAA;AAAAC,QAAA,CAAAD,kBAAA;EAAAE,UAAA,EAAAA,CAAA,KAAAA;AAAA;AAeAC,MAAM,CAAAC,OAAA,GAAAT,YAAa,CAAAK,kBAAA;AAAA,IACjBK,UAAQ;IAAAC,MACN;MACAC,SAAQ;MACRC,MAAA,EAAO;MACPC,KAAA,EAAO;MACTC,KAAA;IACA;IAAQC,MACN;MACAJ,SAAQ;MACRC,MAAA,EAAO;MACPC,KAAA,EAAO;MACTC,KAAA;IACF;EAKA;EAAAE,SAAI,KAAa;EAAAC,SAAA,UAAAP,MAAA;EAAAQ,UAAA,GAAAD,SAAA;AAEjB,SAASE,OAAA,EAAS;EAChB,IAAIF,SAAC;IACH,IAAAG,GAAA,GAAAV,MAAA;MAAAW,KAAA,GAAAD,GAAA,CAAAE,QAAA,CAAAC,eAAA;IAGFd,UAAY,CAAAC,MAAA,GACN;MAENC,SAAW;MACTC,MAAA,EAAAS,KAAW,CAAAG,YAAA;MACXX,KAAA,EAAQO,GAAA,CAAAK,gBAAM;MACdX,KAAO,EAAAO,KAAI,CAAAK;IACX,GAAAjB,UAAa,CAAAM,MAAA;MAGfJ,SAAA,EAAW;MACTC,MAAA,EAAAQ,GAAW,CAAAL,MAAA,CAAAH,MAAA;MACXC,KAAA,EAAQO,GAAI,CAAAK,gBAAO;MACnBX,KAAO,EAAAM,GAAI,CAAAL,MAAA,CAAAD;IACX;EACF;AACF;AAEA,SAASa,aAAA,EAAe;EACtBR,MAAA,CAAO,GACHS,KAAA,CAAMC,OAAA,CAAQb,SAAA,CAAUc,MAAS,KACnCd,SAAA,CAAUc,MAAA,CAAUC,OAAA,CAAQ,UAACC,OAAY;IAE7C,OAAAA,OAAA,CAAAvB,UAAA;EAEO;AAAmB;AAMtB,IAAAH,UAJI;EAKF2B,IAAAC,SAAM,EAAI;IACZ,IAAAhB,UAAO,KAAWA,UAAS,OAAAC,MAAA,KAAAV,UAAA,CAAAyB,SAAA,wBAAAC,KAAA,6BAAAD,SAAA;IAC7B,OAAAzB,UAAA,CAAAyB,SAAA;EAEA;EACEE,IAAAC,iBAAI;IACF,IAAAA,iBAAI;MACF,IAAApB,SAAU,EAER,UAAAkB,KAAA,CAAkB,yCACA;MAKxBE,iBAAA,CAAAtB,MAAA,aAAAN,UAAA,CAAAM,MAAA,GAAAsB,iBAAA,CAAAtB,MAAA,GAAAsB,iBAAA,CAAA3B,MAAA,aAAAD,UAAA,CAAAC,MAAA,GAAA2B,iBAAA,CAAA3B,MAAA;IACF;EAEA;EAIE4B,iBAAAC,IAAU,EAAIP,OAAI;IAGX,IACLQ,KAAA,GAAQ,IAAM;IACZ,OAAAxB,SAAK,CAAAuB,IAAA,IAAAvB,SAAoB,CAAMuB,IAAA,KAAO,IAAAvB,SAAA,CAAAuB,IAAA,EAAAE,IAAA,CAAAT,OAAA;MACxCU,MAAA,WAAAA,CAAA;QACFF,KAAA,CAAAG,mBAAA,CAAAJ,IAAA,EAAAP,OAAA;MACF;IAEA;EAIE;EAGFW,oBAAAJ,IAAA,EAAAP,OAAA;IACFJ,KAAA,CAAAC,OAAA,CAAAb,SAAA,CAAAuB,IAAA,OAAAvB,SAAA,CAAAuB,IAAA,IAAAvB,SAAA,CAAAuB,IAAA,EAAAK,MAAA,WAAAC,QAAA;MAEI,OACFA,QAAO,KAAAb,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
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) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
},
|
|
18
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
20
|
+
value: !0
|
|
21
|
+
}), mod);
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
|
+
ActivityIndicator: () => ActivityIndicator,
|
|
25
|
+
Animated: () => Animated,
|
|
26
|
+
Image: () => Image,
|
|
27
|
+
Keyboard: () => Keyboard,
|
|
28
|
+
Linking: () => Linking,
|
|
29
|
+
PanResponder: () => PanResponder,
|
|
30
|
+
Platform: () => Platform,
|
|
31
|
+
Pressable: () => Pressable,
|
|
32
|
+
ScrollView: () => ScrollView,
|
|
33
|
+
StyleSheet: () => StyleSheet,
|
|
34
|
+
Switch: () => Switch,
|
|
35
|
+
Text: () => import_web.Text,
|
|
36
|
+
TextInput: () => TextInput,
|
|
37
|
+
View: () => import_web.View
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(index_exports);
|
|
40
|
+
__reExport(index_exports, require("@tamagui/react-native-use-responder-events"), module.exports);
|
|
41
|
+
__reExport(index_exports, require("@tamagui/react-native-use-pressable"), module.exports);
|
|
42
|
+
var import_web = require("@tamagui/web"),
|
|
43
|
+
import_web2 = require("@tamagui/web");
|
|
44
|
+
__reExport(index_exports, require("./Dimensions.cjs"), module.exports);
|
|
45
|
+
const Platform = {
|
|
46
|
+
OS: "web",
|
|
47
|
+
select(obj) {
|
|
48
|
+
return obj.web;
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
StyleSheet = {
|
|
52
|
+
create(obj) {
|
|
53
|
+
return obj;
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
Pressable = () => null,
|
|
57
|
+
Animated = {
|
|
58
|
+
View: import_web2.View,
|
|
59
|
+
Text: import_web2.Text
|
|
60
|
+
},
|
|
61
|
+
ActivityIndicator = () => null,
|
|
62
|
+
PanResponder = () => null,
|
|
63
|
+
Switch = () => null,
|
|
64
|
+
TextInput = () => null,
|
|
65
|
+
ScrollView = () => null,
|
|
66
|
+
Keyboard = {},
|
|
67
|
+
Image = () => null,
|
|
68
|
+
Linking = {};
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var index_exports = {};
|
|
16
|
+
__export(index_exports, {
|
|
17
|
+
ActivityIndicator: () => ActivityIndicator,
|
|
18
|
+
Animated: () => Animated,
|
|
19
|
+
Image: () => Image,
|
|
20
|
+
Keyboard: () => Keyboard,
|
|
21
|
+
Linking: () => Linking,
|
|
22
|
+
PanResponder: () => PanResponder,
|
|
23
|
+
Platform: () => Platform,
|
|
24
|
+
Pressable: () => Pressable,
|
|
25
|
+
ScrollView: () => ScrollView,
|
|
26
|
+
StyleSheet: () => StyleSheet,
|
|
27
|
+
Switch: () => Switch,
|
|
28
|
+
Text: () => import_web.Text,
|
|
29
|
+
TextInput: () => TextInput,
|
|
30
|
+
View: () => import_web.View
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(index_exports);
|
|
33
|
+
__reExport(index_exports, require("@tamagui/react-native-use-responder-events"), module.exports);
|
|
34
|
+
__reExport(index_exports, require("@tamagui/react-native-use-pressable"), module.exports);
|
|
35
|
+
var import_web = require("@tamagui/web"), import_web2 = require("@tamagui/web");
|
|
36
|
+
__reExport(index_exports, require("./Dimensions"), module.exports);
|
|
37
|
+
const Platform = {
|
|
38
|
+
OS: "web",
|
|
39
|
+
select(obj) {
|
|
40
|
+
return obj.web;
|
|
41
|
+
}
|
|
42
|
+
}, StyleSheet = {
|
|
43
|
+
create(obj) {
|
|
44
|
+
return obj;
|
|
45
|
+
}
|
|
46
|
+
}, Pressable = () => null, Animated = {
|
|
47
|
+
View: import_web2.View,
|
|
48
|
+
Text: import_web2.Text
|
|
49
|
+
}, ActivityIndicator = () => null, PanResponder = () => null, Switch = () => null, TextInput = () => null, ScrollView = () => null, Keyboard = {}, Image = () => null, Linking = {};
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAc,uDAFd;AAGA,0BAAc,gDAHd;AAIA,iBAA2B,yBAC3BA,cAA2B;AAE3B,0BAAc,yBAPd;AASO,MAAM,WAAW;AAAA,EACtB,IAAI;AAAA,EAEJ,OAAO,KAAK;AACV,WAAO,IAAI;AAAA,EACb;AACF,GAEa,aAAa;AAAA,EACxB,OAAO,KAAK;AACV,WAAO;AAAA,EACT;AACF,GAEa,YAAY,MAChB,MAGI,WAAW;AAAA,EACtB;AAAA,EACA;AACF,GAEa,oBAAoB,MACxB,MAGI,eAAe,MACnB,MAGI,SAAS,MACb,MAGI,YAAY,MAChB,MAGI,aAAa,MACjB,MAGI,WAAW,CAAC,GAEZ,QAAQ,MACZ,MAGI,UAAU,CAAC;",
|
|
5
|
+
"names": ["import_web"]
|
|
6
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
},
|
|
20
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
22
|
+
value: !0
|
|
23
|
+
}), mod);
|
|
24
|
+
var index_exports = {};
|
|
25
|
+
__export(index_exports, {
|
|
26
|
+
ActivityIndicator: () => ActivityIndicator,
|
|
27
|
+
Animated: () => Animated,
|
|
28
|
+
Image: () => Image,
|
|
29
|
+
Keyboard: () => Keyboard,
|
|
30
|
+
Linking: () => Linking,
|
|
31
|
+
PanResponder: () => PanResponder,
|
|
32
|
+
Platform: () => Platform,
|
|
33
|
+
Pressable: () => Pressable,
|
|
34
|
+
ScrollView: () => ScrollView,
|
|
35
|
+
StyleSheet: () => StyleSheet,
|
|
36
|
+
Switch: () => Switch,
|
|
37
|
+
Text: () => import_web.Text,
|
|
38
|
+
TextInput: () => TextInput,
|
|
39
|
+
View: () => import_web.View
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(index_exports);
|
|
42
|
+
__reExport(index_exports, require("@tamagui/react-native-use-responder-events"), module.exports);
|
|
43
|
+
__reExport(index_exports, require("@tamagui/react-native-use-pressable"), module.exports);
|
|
44
|
+
var import_web = require("@tamagui/web"),
|
|
45
|
+
import_web2 = require("@tamagui/web");
|
|
46
|
+
__reExport(index_exports, require("./Dimensions.native.js"), module.exports);
|
|
47
|
+
var Platform = {
|
|
48
|
+
OS: "web",
|
|
49
|
+
select(obj) {
|
|
50
|
+
return obj.web;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
StyleSheet = {
|
|
54
|
+
create(obj) {
|
|
55
|
+
return obj;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
Pressable = function () {
|
|
59
|
+
return null;
|
|
60
|
+
},
|
|
61
|
+
Animated = {
|
|
62
|
+
View: import_web2.View,
|
|
63
|
+
Text: import_web2.Text
|
|
64
|
+
},
|
|
65
|
+
ActivityIndicator = function () {
|
|
66
|
+
return null;
|
|
67
|
+
},
|
|
68
|
+
PanResponder = function () {
|
|
69
|
+
return null;
|
|
70
|
+
},
|
|
71
|
+
Switch = function () {
|
|
72
|
+
return null;
|
|
73
|
+
},
|
|
74
|
+
TextInput = function () {
|
|
75
|
+
return null;
|
|
76
|
+
},
|
|
77
|
+
ScrollView = function () {
|
|
78
|
+
return null;
|
|
79
|
+
},
|
|
80
|
+
Keyboard = {},
|
|
81
|
+
Image = function () {
|
|
82
|
+
return null;
|
|
83
|
+
},
|
|
84
|
+
Linking = {};
|
|
85
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","ActivityIndicator","Animated","Image","Keyboard","Linking","PanResponder","Platform","Pressable","ScrollView","StyleSheet","Switch","Text","import_web","TextInput","View","module","exports","__reExport","require","import_web2","OS","select","obj","web","create"],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,iBAAA,EAAAA,CAAA,KAAAA,iBAAA;EAAAC,QAAA,EAAAA,CAAA,KAAAA,QAAA;EAAAC,KAAA,EAAAA,CAAA,KAAAA,KAAA;EAAAC,QAAA,EAAAA,CAAA,KAAAA,QAAA;EAAAC,OAAA,EAAAA,CAAA,KAAAA,OAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAAAC,QAAA,EAAAA,CAAA,KAAAA,QAAA;EAAAC,SAAA,EAAAA,CAAA,KAAAA,SAAA;EAAAC,UAAA,EAAAA,CAAA,KAAAA,UAAA;EAAAC,UAAA,EAAAA,CAAA,KAAAA,UAAA;EAAAC,MAAA,EAAAA,CAAA,KAAAA,MAAA;EAAAC,IAAA,EAAAA,CAAA,KAAAC,UAAA,CAAAD,IAAA;EAAAE,SAAA,EAAAA,CAAA,KAAAA,SAAA;EAAAC,IAAA,EAAAA,CAAA,KAAAF,UAAA,CAAAE;AAAA;AAEAC,MAAA,CAAAC,OAAA,GAAAvB,YAAc,CAAAK,aAAA;AACdmB,UAAA,CAAAnB,aAAA,EAAcoB,OAAA,6CAHd,GAAAH,MAAA,CAAAC,OAAA;AAIAC,UAAA,CAAAnB,aAA2B,EAAAoB,OAAA,sCACA,GAAAH,MAAA,CAAAC,OAAA;AAE3B,IAAAJ,UAAA,GAAAM,OAAA,eAAc;EAAAC,WAPd,GAAAD,OAAA;AASOD,UAAM,CAAAnB,aAAW,EAAAoB,OAAA,4BAAAH,MAAA,CAAAC,OAAA;AAAA,IACtBV,QAAI;IAEJc,EAAA,OAAO;IACLC,OAAAC,GAAO;MACT,OAAAA,GAAA,CAAAC,GAAA;IACF;EAE0B;EACxBd,UAAO,GAAK;IACVe,OAAAF,GAAO;MACT,OAAAA,GAAA;IACF;EAMwB;EACtBf,SAAA,YAAAA,CAAA;IACA;EACF;EAEaN,QAAA","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const dimensions = {
|
|
2
|
+
window: {
|
|
3
|
+
fontScale: 1,
|
|
4
|
+
height: 0,
|
|
5
|
+
scale: 1,
|
|
6
|
+
width: 0
|
|
7
|
+
},
|
|
8
|
+
screen: {
|
|
9
|
+
fontScale: 1,
|
|
10
|
+
height: 0,
|
|
11
|
+
scale: 1,
|
|
12
|
+
width: 0
|
|
13
|
+
}
|
|
14
|
+
}, listeners = {}, canUseDOM = typeof window < "u";
|
|
15
|
+
let shouldInit = canUseDOM;
|
|
16
|
+
function update() {
|
|
17
|
+
if (!canUseDOM)
|
|
18
|
+
return;
|
|
19
|
+
const win = window, docEl = win.document.documentElement;
|
|
20
|
+
dimensions.window = {
|
|
21
|
+
fontScale: 1,
|
|
22
|
+
height: docEl.clientHeight,
|
|
23
|
+
scale: win.devicePixelRatio || 1,
|
|
24
|
+
width: docEl.clientWidth
|
|
25
|
+
}, dimensions.screen = {
|
|
26
|
+
fontScale: 1,
|
|
27
|
+
height: win.screen.height,
|
|
28
|
+
scale: win.devicePixelRatio || 1,
|
|
29
|
+
width: win.screen.width
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function handleResize() {
|
|
33
|
+
update(), Array.isArray(listeners.change) && listeners.change.forEach((handler) => handler(dimensions));
|
|
34
|
+
}
|
|
35
|
+
const Dimensions = {
|
|
36
|
+
get(dimension) {
|
|
37
|
+
if (shouldInit && (shouldInit = !1, update()), dimensions[dimension] === void 0)
|
|
38
|
+
throw new Error(`No dimension set for key ${dimension}`);
|
|
39
|
+
return dimensions[dimension];
|
|
40
|
+
},
|
|
41
|
+
set(initialDimensions) {
|
|
42
|
+
if (initialDimensions) {
|
|
43
|
+
if (canUseDOM)
|
|
44
|
+
throw new Error("Dimensions cannot be set in the browser");
|
|
45
|
+
initialDimensions.screen != null && (dimensions.screen = initialDimensions.screen), initialDimensions.window != null && (dimensions.window = initialDimensions.window);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
addEventListener(type, handler) {
|
|
49
|
+
return listeners[type] = listeners[type] || [], listeners[type].push(handler), {
|
|
50
|
+
remove: () => {
|
|
51
|
+
this.removeEventListener(type, handler);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
removeEventListener(type, handler) {
|
|
56
|
+
Array.isArray(listeners[type]) && (listeners[type] = listeners[type].filter((_handler) => _handler !== handler));
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
canUseDOM && window.addEventListener("resize", handleResize, !1);
|
|
60
|
+
export {
|
|
61
|
+
Dimensions
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=Dimensions.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Dimensions.ts"],
|
|
4
|
+
"mappings": "AAeA,MAAM,aAAa;AAAA,EACjB,QAAQ;AAAA,IACN,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,IACN,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF,GAEM,YAAY,CAAC,GAEb,YAAY,OAAO,SAAW;AACpC,IAAI,aAAa;AAEjB,SAAS,SAAS;AAChB,MAAI,CAAC;AACH;AAGF,QAAM,MAAM,QACN,QAAQ,IAAI,SAAS;AAE3B,aAAW,SAAS;AAAA,IAClB,WAAW;AAAA,IACX,QAAQ,MAAM;AAAA,IACd,OAAO,IAAI,oBAAoB;AAAA,IAC/B,OAAO,MAAM;AAAA,EACf,GAEA,WAAW,SAAS;AAAA,IAClB,WAAW;AAAA,IACX,QAAQ,IAAI,OAAO;AAAA,IACnB,OAAO,IAAI,oBAAoB;AAAA,IAC/B,OAAO,IAAI,OAAO;AAAA,EACpB;AACF;AAEA,SAAS,eAAe;AACtB,SAAO,GACH,MAAM,QAAQ,UAAU,MAAS,KACnC,UAAU,OAAU,QAAQ,CAAC,YAAY,QAAQ,UAAU,CAAC;AAEhE;AAEO,MAAM,aAAa;AAAA,EACxB,IAAI,WAAyC;AAK3C,QAJI,eACF,aAAa,IACb,OAAO,IAEL,WAAW,SAAS,MAAM;AAC5B,YAAM,IAAI,MAAM,4BAA4B,SAAS,EAAE;AACzD,WAAO,WAAW,SAAS;AAAA,EAC7B;AAAA,EAEA,IAAI,mBAAiD;AACnD,QAAI,mBAAmB;AACrB,UAAI;AACF,cAAM,IAAI,MAAM,yCAAyC;AAE3D,MAAI,kBAAkB,UAAU,SAC9B,WAAW,SAAS,kBAAkB,SAEpC,kBAAkB,UAAU,SAC9B,WAAW,SAAS,kBAAkB;AAAA,IAE1C;AAAA,EACF;AAAA,EAEA,iBACE,MACA,SACA;AACA,qBAAU,IAAI,IAAI,UAAU,IAAI,KAAK,CAAC,GACtC,UAAU,IAAI,EAAE,KAAK,OAAO,GAErB;AAAA,MACL,QAAQ,MAAM;AACZ,aAAK,oBAAoB,MAAM,OAAO;AAAA,MACxC;AAAA,IACF;AAAA,EACF;AAAA,EAEA,oBACE,MACA,SACM;AACN,IAAI,MAAM,QAAQ,UAAU,IAAI,CAAC,MAC/B,UAAU,IAAI,IAAI,UAAU,IAAI,EAAE,OAAO,CAAC,aAAa,aAAa,OAAO;AAAA,EAE/E;AACF;AAEI,aACF,OAAO,iBAAiB,UAAU,cAAc,EAAK;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const dimensions = {
|
|
2
|
+
window: {
|
|
3
|
+
fontScale: 1,
|
|
4
|
+
height: 0,
|
|
5
|
+
scale: 1,
|
|
6
|
+
width: 0
|
|
7
|
+
},
|
|
8
|
+
screen: {
|
|
9
|
+
fontScale: 1,
|
|
10
|
+
height: 0,
|
|
11
|
+
scale: 1,
|
|
12
|
+
width: 0
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
listeners = {},
|
|
16
|
+
canUseDOM = typeof window < "u";
|
|
17
|
+
let shouldInit = canUseDOM;
|
|
18
|
+
function update() {
|
|
19
|
+
if (!canUseDOM) return;
|
|
20
|
+
const win = window,
|
|
21
|
+
docEl = win.document.documentElement;
|
|
22
|
+
dimensions.window = {
|
|
23
|
+
fontScale: 1,
|
|
24
|
+
height: docEl.clientHeight,
|
|
25
|
+
scale: win.devicePixelRatio || 1,
|
|
26
|
+
width: docEl.clientWidth
|
|
27
|
+
}, dimensions.screen = {
|
|
28
|
+
fontScale: 1,
|
|
29
|
+
height: win.screen.height,
|
|
30
|
+
scale: win.devicePixelRatio || 1,
|
|
31
|
+
width: win.screen.width
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function handleResize() {
|
|
35
|
+
update(), Array.isArray(listeners.change) && listeners.change.forEach(handler => handler(dimensions));
|
|
36
|
+
}
|
|
37
|
+
const Dimensions = {
|
|
38
|
+
get(dimension) {
|
|
39
|
+
if (shouldInit && (shouldInit = !1, update()), dimensions[dimension] === void 0) throw new Error(`No dimension set for key ${dimension}`);
|
|
40
|
+
return dimensions[dimension];
|
|
41
|
+
},
|
|
42
|
+
set(initialDimensions) {
|
|
43
|
+
if (initialDimensions) {
|
|
44
|
+
if (canUseDOM) throw new Error("Dimensions cannot be set in the browser");
|
|
45
|
+
initialDimensions.screen != null && (dimensions.screen = initialDimensions.screen), initialDimensions.window != null && (dimensions.window = initialDimensions.window);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
addEventListener(type, handler) {
|
|
49
|
+
return listeners[type] = listeners[type] || [], listeners[type].push(handler), {
|
|
50
|
+
remove: () => {
|
|
51
|
+
this.removeEventListener(type, handler);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
removeEventListener(type, handler) {
|
|
56
|
+
Array.isArray(listeners[type]) && (listeners[type] = listeners[type].filter(_handler => _handler !== handler));
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
canUseDOM && window.addEventListener("resize", handleResize, !1);
|
|
60
|
+
export { Dimensions };
|
|
61
|
+
//# sourceMappingURL=Dimensions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["dimensions","window","fontScale","height","scale","width","screen","listeners","canUseDOM","shouldInit","update","win","docEl","document","documentElement","clientHeight","devicePixelRatio","clientWidth","handleResize","Array","isArray","change","forEach","handler","Dimensions","get","dimension","Error","set","initialDimensions","addEventListener","type","push","remove","removeEventListener","filter","_handler"],"sources":["../../src/Dimensions.ts"],"sourcesContent":[null],"mappings":"AAeA,MAAMA,UAAA,GAAa;IACjBC,MAAA,EAAQ;MACNC,SAAA,EAAW;MACXC,MAAA,EAAQ;MACRC,KAAA,EAAO;MACPC,KAAA,EAAO;IACT;IACAC,MAAA,EAAQ;MACNJ,SAAA,EAAW;MACXC,MAAA,EAAQ;MACRC,KAAA,EAAO;MACPC,KAAA,EAAO;IACT;EACF;EAEME,SAAA,GAAY,CAAC;EAEbC,SAAA,GAAY,OAAOP,MAAA,GAAW;AACpC,IAAIQ,UAAA,GAAaD,SAAA;AAEjB,SAASE,OAAA,EAAS;EAChB,IAAI,CAACF,SAAA,EACH;EAGF,MAAMG,GAAA,GAAMV,MAAA;IACNW,KAAA,GAAQD,GAAA,CAAIE,QAAA,CAASC,eAAA;EAE3Bd,UAAA,CAAWC,MAAA,GAAS;IAClBC,SAAA,EAAW;IACXC,MAAA,EAAQS,KAAA,CAAMG,YAAA;IACdX,KAAA,EAAOO,GAAA,CAAIK,gBAAA,IAAoB;IAC/BX,KAAA,EAAOO,KAAA,CAAMK;EACf,GAEAjB,UAAA,CAAWM,MAAA,GAAS;IAClBJ,SAAA,EAAW;IACXC,MAAA,EAAQQ,GAAA,CAAIL,MAAA,CAAOH,MAAA;IACnBC,KAAA,EAAOO,GAAA,CAAIK,gBAAA,IAAoB;IAC/BX,KAAA,EAAOM,GAAA,CAAIL,MAAA,CAAOD;EACpB;AACF;AAEA,SAASa,aAAA,EAAe;EACtBR,MAAA,CAAO,GACHS,KAAA,CAAMC,OAAA,CAAQb,SAAA,CAAUc,MAAS,KACnCd,SAAA,CAAUc,MAAA,CAAUC,OAAA,CAASC,OAAA,IAAYA,OAAA,CAAQvB,UAAU,CAAC;AAEhE;AAEO,MAAMwB,UAAA,GAAa;EACxBC,IAAIC,SAAA,EAAyC;IAK3C,IAJIjB,UAAA,KACFA,UAAA,GAAa,IACbC,MAAA,CAAO,IAELV,UAAA,CAAW0B,SAAS,MAAM,QAC5B,MAAM,IAAIC,KAAA,CAAM,4BAA4BD,SAAS,EAAE;IACzD,OAAO1B,UAAA,CAAW0B,SAAS;EAC7B;EAEAE,IAAIC,iBAAA,EAAiD;IACnD,IAAIA,iBAAA,EAAmB;MACrB,IAAIrB,SAAA,EACF,MAAM,IAAImB,KAAA,CAAM,yCAAyC;MAEvDE,iBAAA,CAAkBvB,MAAA,IAAU,SAC9BN,UAAA,CAAWM,MAAA,GAASuB,iBAAA,CAAkBvB,MAAA,GAEpCuB,iBAAA,CAAkB5B,MAAA,IAAU,SAC9BD,UAAA,CAAWC,MAAA,GAAS4B,iBAAA,CAAkB5B,MAAA;IAE1C;EACF;EAEA6B,iBACEC,IAAA,EACAR,OAAA,EACA;IACA,OAAAhB,SAAA,CAAUwB,IAAI,IAAIxB,SAAA,CAAUwB,IAAI,KAAK,EAAC,EACtCxB,SAAA,CAAUwB,IAAI,EAAEC,IAAA,CAAKT,OAAO,GAErB;MACLU,MAAA,EAAQA,CAAA,KAAM;QACZ,KAAKC,mBAAA,CAAoBH,IAAA,EAAMR,OAAO;MACxC;IACF;EACF;EAEAW,oBACEH,IAAA,EACAR,OAAA,EACM;IACFJ,KAAA,CAAMC,OAAA,CAAQb,SAAA,CAAUwB,IAAI,CAAC,MAC/BxB,SAAA,CAAUwB,IAAI,IAAIxB,SAAA,CAAUwB,IAAI,EAAEI,MAAA,CAAQC,QAAA,IAAaA,QAAA,KAAab,OAAO;EAE/E;AACF;AAEIf,SAAA,IACFP,MAAA,CAAO6B,gBAAA,CAAiB,UAAUZ,YAAA,EAAc,EAAK","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var dimensions = {
|
|
2
|
+
window: {
|
|
3
|
+
fontScale: 1,
|
|
4
|
+
height: 0,
|
|
5
|
+
scale: 1,
|
|
6
|
+
width: 0
|
|
7
|
+
},
|
|
8
|
+
screen: {
|
|
9
|
+
fontScale: 1,
|
|
10
|
+
height: 0,
|
|
11
|
+
scale: 1,
|
|
12
|
+
width: 0
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
listeners = {},
|
|
16
|
+
canUseDOM = typeof window < "u",
|
|
17
|
+
shouldInit = canUseDOM;
|
|
18
|
+
function update() {
|
|
19
|
+
if (canUseDOM) {
|
|
20
|
+
var win = window,
|
|
21
|
+
docEl = win.document.documentElement;
|
|
22
|
+
dimensions.window = {
|
|
23
|
+
fontScale: 1,
|
|
24
|
+
height: docEl.clientHeight,
|
|
25
|
+
scale: win.devicePixelRatio || 1,
|
|
26
|
+
width: docEl.clientWidth
|
|
27
|
+
}, dimensions.screen = {
|
|
28
|
+
fontScale: 1,
|
|
29
|
+
height: win.screen.height,
|
|
30
|
+
scale: win.devicePixelRatio || 1,
|
|
31
|
+
width: win.screen.width
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function handleResize() {
|
|
36
|
+
update(), Array.isArray(listeners.change) && listeners.change.forEach(function (handler) {
|
|
37
|
+
return handler(dimensions);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
var Dimensions = {
|
|
41
|
+
get(dimension) {
|
|
42
|
+
if (shouldInit && (shouldInit = !1, update()), dimensions[dimension] === void 0) throw new Error(`No dimension set for key ${dimension}`);
|
|
43
|
+
return dimensions[dimension];
|
|
44
|
+
},
|
|
45
|
+
set(initialDimensions) {
|
|
46
|
+
if (initialDimensions) {
|
|
47
|
+
if (canUseDOM) throw new Error("Dimensions cannot be set in the browser");
|
|
48
|
+
initialDimensions.screen != null && (dimensions.screen = initialDimensions.screen), initialDimensions.window != null && (dimensions.window = initialDimensions.window);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
addEventListener(type, handler) {
|
|
52
|
+
var _this = this;
|
|
53
|
+
return listeners[type] = listeners[type] || [], listeners[type].push(handler), {
|
|
54
|
+
remove: function () {
|
|
55
|
+
_this.removeEventListener(type, handler);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
removeEventListener(type, handler) {
|
|
60
|
+
Array.isArray(listeners[type]) && (listeners[type] = listeners[type].filter(function (_handler) {
|
|
61
|
+
return _handler !== handler;
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
canUseDOM && window.addEventListener("resize", handleResize, !1);
|
|
66
|
+
export { Dimensions };
|
|
67
|
+
//# sourceMappingURL=Dimensions.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["dimensions","window","fontScale","height","scale","width","screen","listeners","canUseDOM","shouldInit","update","win","docEl","document","documentElement","clientHeight","devicePixelRatio","clientWidth","handleResize","Array","isArray","change","forEach","handler","Dimensions","get","dimension","Error","set","initialDimensions","addEventListener","type","_this","push","remove","removeEventListener","filter","_handler"],"sources":["../../src/Dimensions.ts"],"sourcesContent":[null],"mappings":"AAeA,IAAAA,UAAM;IACJC,MAAA,EAAQ;MACNC,SAAA,EAAW;MACXC,MAAA,EAAQ;MACRC,KAAA,EAAO;MACPC,KAAA,EAAO;IACT;IACAC,MAAA,EAAQ;MACNJ,SAAA,EAAW;MACXC,MAAA,EAAQ;MACRC,KAAA,EAAO;MACPC,KAAA,EAAO;IACT;EACF;EAEME,SAAA,GAAY,CAAC;EAEbC,SAAA,GAAY,OAAOP,MAAA,GAAW;EAAAQ,UAAA,GAAAD,SAAA;AACpC,SAAIE,OAAA,EAAa;EAEjB,IAAAF,SAAS;IACP,IAAKG,GAAA,GAAAV,MAAA;MAAAW,KAAA,GAAAD,GAAA,CAAAE,QAAA,CAAAC,eAAA;IACHd,UAAA,CAAAC,MAAA;MAGFC,SAAY;MAGZC,MAAA,EAAWS,KAAA,CAAAG,YAAS;MAClBX,KAAA,EAAAO,GAAW,CAAAK,gBAAA;MACXX,KAAA,EAAQO,KAAM,CAAAK;IACd,GAAAjB,UAAW,CAAAM,MAAA;MACXJ,SAAO,EAAM;MAGfC,MAAA,EAAAQ,GAAW,CAAAL,MAAA,CAASH,MAAA;MAClBC,KAAA,EAAAO,GAAW,CAAAK,gBAAA;MACXX,KAAA,EAAQM,GAAI,CAAAL,MAAO,CAAAD;IACnB;EAA+B;AACb;AAEtB,SAAAa,aAAA;EAEAR,MAAA,CAAS,GAAAS,KAAA,CAAAC,OAAe,CAAAb,SAAA,CAAAc,MAAA,KAAAd,SAAA,CAAAc,MAAA,CAAAC,OAAA,WAAAC,OAAA;IACtB,OAAOA,OACG,CAAAvB,UAAQ;EAGpB;AAEO;AAAmB,IACxBwB,UAAI,GAAyC;EAK3CC,IAAAC,SAJI;IAKF,IAAAjB,UAAU,KAAMA,UAAA,OAAAC,MAAA,KAA4BV,UAAW,CAAA0B,SAAA,wBAAAC,KAAA,6BAAAD,SAAA;IACzD,OAAO1B,UAAA,CAAW0B,SAAS;EAC7B;EAEAE,IAAIC,iBAAA,EAAiD;IACnD,IAAIA,iBAAA,EAAmB;MACrB,IAAIrB,SAAA,EACF,MAAM,IAAImB,KAAA,CAAM,yCAAyC;MAEvDE,iBAAA,CAAkBvB,MAAA,IAAU,SAC9BN,UAAA,CAAWM,MAAA,GAASuB,iBAAA,CAAkBvB,MAAA,GAEpCuB,iBAAA,CAAkB5B,MAAA,IAAU,SAC9BD,UAAA,CAAWC,MAAA,GAAS4B,iBAAA,CAAkB5B,MAAA;IAE1C;EACF;EAEA6B,iBACEC,IAAA,EACAR,OAAA,EACA;IACA,IAAAS,KAAA;IAGO,OACLzB,SAAc,CAAAwB,IAAA,IAAAxB,SAAA,CAAAwB,IAAA,SAAAxB,SAAA,CAAAwB,IAAA,EAAAE,IAAA,CAAAV,OAAA;MACZW,MAAA,EAAK,SAAAA,CAAA;QACPF,KAAA,CAAAG,mBAAA,CAAAJ,IAAA,EAAAR,OAAA;MACF;IACF;EAEA;EAIEY,mBAAkBA,CAAAJ,IAAA,EAAUR,OAAK;IAGnCJ,KAAA,CAAAC,OAAA,CAAAb,SAAA,CAAAwB,IAAA,OAAAxB,SAAA,CAAAwB,IAAA,IAAAxB,SAAA,CAAAwB,IAAA,EAAAK,MAAA,WAAAC,QAAA;MACF,OAAAA,QAAA,KAAAd,OAAA;IAEI","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export * from "@tamagui/react-native-use-responder-events";
|
|
2
|
+
export * from "@tamagui/react-native-use-pressable";
|
|
3
|
+
import { View, Text } from "@tamagui/web";
|
|
4
|
+
import { View as View2, Text as Text2 } from "@tamagui/web";
|
|
5
|
+
export * from "./Dimensions";
|
|
6
|
+
const Platform = {
|
|
7
|
+
OS: "web",
|
|
8
|
+
select(obj) {
|
|
9
|
+
return obj.web;
|
|
10
|
+
}
|
|
11
|
+
}, StyleSheet = {
|
|
12
|
+
create(obj) {
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
}, Pressable = () => null, Animated = {
|
|
16
|
+
View: View2,
|
|
17
|
+
Text: Text2
|
|
18
|
+
}, ActivityIndicator = () => null, PanResponder = () => null, Switch = () => null, TextInput = () => null, ScrollView = () => null, Keyboard = {}, Image = () => null, Linking = {};
|
|
19
|
+
export {
|
|
20
|
+
ActivityIndicator,
|
|
21
|
+
Animated,
|
|
22
|
+
Image,
|
|
23
|
+
Keyboard,
|
|
24
|
+
Linking,
|
|
25
|
+
PanResponder,
|
|
26
|
+
Platform,
|
|
27
|
+
Pressable,
|
|
28
|
+
ScrollView,
|
|
29
|
+
StyleSheet,
|
|
30
|
+
Switch,
|
|
31
|
+
Text,
|
|
32
|
+
TextInput,
|
|
33
|
+
View
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx"],
|
|
4
|
+
"mappings": "AAEA,cAAc;AACd,cAAc;AACd,SAAS,MAAM,YAAY;AAC3B,SAAS,QAAAA,OAAM,QAAAC,aAAY;AAE3B,cAAc;AAEP,MAAM,WAAW;AAAA,EACtB,IAAI;AAAA,EAEJ,OAAO,KAAK;AACV,WAAO,IAAI;AAAA,EACb;AACF,GAEa,aAAa;AAAA,EACxB,OAAO,KAAK;AACV,WAAO;AAAA,EACT;AACF,GAEa,YAAY,MAChB,MAGI,WAAW;AAAA,EACtB,MAAAD;AAAA,EACA,MAAAC;AACF,GAEa,oBAAoB,MACxB,MAGI,eAAe,MACnB,MAGI,SAAS,MACb,MAGI,YAAY,MAChB,MAGI,aAAa,MACjB,MAGI,WAAW,CAAC,GAEZ,QAAQ,MACZ,MAGI,UAAU,CAAC;",
|
|
5
|
+
"names": ["View", "Text"]
|
|
6
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from "@tamagui/react-native-use-responder-events";
|
|
2
|
+
export * from "@tamagui/react-native-use-pressable";
|
|
3
|
+
import { View, Text } from "@tamagui/web";
|
|
4
|
+
import { View as View2, Text as Text2 } from "@tamagui/web";
|
|
5
|
+
export * from "./Dimensions.mjs";
|
|
6
|
+
const Platform = {
|
|
7
|
+
OS: "web",
|
|
8
|
+
select(obj) {
|
|
9
|
+
return obj.web;
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
StyleSheet = {
|
|
13
|
+
create(obj) {
|
|
14
|
+
return obj;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
Pressable = () => null,
|
|
18
|
+
Animated = {
|
|
19
|
+
View: View2,
|
|
20
|
+
Text: Text2
|
|
21
|
+
},
|
|
22
|
+
ActivityIndicator = () => null,
|
|
23
|
+
PanResponder = () => null,
|
|
24
|
+
Switch = () => null,
|
|
25
|
+
TextInput = () => null,
|
|
26
|
+
ScrollView = () => null,
|
|
27
|
+
Keyboard = {},
|
|
28
|
+
Image = () => null,
|
|
29
|
+
Linking = {};
|
|
30
|
+
export { ActivityIndicator, Animated, Image, Keyboard, Linking, PanResponder, Platform, Pressable, ScrollView, StyleSheet, Switch, Text, TextInput, View };
|
|
31
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Text","View2","Text2","Platform","OS","select","obj","web","StyleSheet","create","Pressable","Animated","ActivityIndicator","PanResponder","Switch","TextInput","ScrollView","Keyboard","Image","Linking"],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":"AAEA,cAAc;AACd,cAAc;AACd,SAASA,IAAA,EAAMC,IAAA,QAAY;AAC3B,SAASD,IAAA,IAAAE,KAAA,EAAMD,IAAA,IAAAE,KAAA,QAAY;AAE3B,cAAc;AAEP,MAAMC,QAAA,GAAW;IACtBC,EAAA,EAAI;IAEJC,OAAOC,GAAA,EAAK;MACV,OAAOA,GAAA,CAAIC,GAAA;IACb;EACF;EAEaC,UAAA,GAAa;IACxBC,OAAOH,GAAA,EAAK;MACV,OAAOA,GAAA;IACT;EACF;EAEaI,SAAA,GAAYA,CAAA,KAChB;EAGIC,QAAA,GAAW;IACtBZ,IAAA,EAAAE,KAAA;IACAD,IAAA,EAAAE;EACF;EAEaU,iBAAA,GAAoBA,CAAA,KACxB;EAGIC,YAAA,GAAeA,CAAA,KACnB;EAGIC,MAAA,GAASA,CAAA,KACb;EAGIC,SAAA,GAAYA,CAAA,KAChB;EAGIC,UAAA,GAAaA,CAAA,KACjB;EAGIC,QAAA,GAAW,CAAC;EAEZC,KAAA,GAAQA,CAAA,KACZ;EAGIC,OAAA,GAAU,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export * from "@tamagui/react-native-use-responder-events";
|
|
2
|
+
export * from "@tamagui/react-native-use-pressable";
|
|
3
|
+
import { View, Text } from "@tamagui/web";
|
|
4
|
+
import { View as View2, Text as Text2 } from "@tamagui/web";
|
|
5
|
+
export * from "./Dimensions.native.js";
|
|
6
|
+
var Platform = {
|
|
7
|
+
OS: "web",
|
|
8
|
+
select(obj) {
|
|
9
|
+
return obj.web;
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
StyleSheet = {
|
|
13
|
+
create(obj) {
|
|
14
|
+
return obj;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
Pressable = function () {
|
|
18
|
+
return null;
|
|
19
|
+
},
|
|
20
|
+
Animated = {
|
|
21
|
+
View: View2,
|
|
22
|
+
Text: Text2
|
|
23
|
+
},
|
|
24
|
+
ActivityIndicator = function () {
|
|
25
|
+
return null;
|
|
26
|
+
},
|
|
27
|
+
PanResponder = function () {
|
|
28
|
+
return null;
|
|
29
|
+
},
|
|
30
|
+
Switch = function () {
|
|
31
|
+
return null;
|
|
32
|
+
},
|
|
33
|
+
TextInput = function () {
|
|
34
|
+
return null;
|
|
35
|
+
},
|
|
36
|
+
ScrollView = function () {
|
|
37
|
+
return null;
|
|
38
|
+
},
|
|
39
|
+
Keyboard = {},
|
|
40
|
+
Image = function () {
|
|
41
|
+
return null;
|
|
42
|
+
},
|
|
43
|
+
Linking = {};
|
|
44
|
+
export { ActivityIndicator, Animated, Image, Keyboard, Linking, PanResponder, Platform, Pressable, ScrollView, StyleSheet, Switch, Text, TextInput, View };
|
|
45
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Text","View2","Text2","Platform","OS","select","obj","web","StyleSheet","create","Pressable","Animated"],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":"AAEA,cAAc;AACd,cAAc;AACd,SAASA,IAAA,EAAMC,IAAA,QAAY;AAC3B,SAASD,IAAA,IAAAE,KAAA,EAAMD,IAAA,IAAAE,KAAA,QAAY;AAE3B,cAAc;AAEP,IAAAC,QAAM;IACXC,EAAA,EAAI;IAEJC,OAAOC,GAAA,EAAK;MACV,OAAOA,GAAA,CAAIC,GAAA;IACb;EACF;EAEaC,UAAA,GAAa;IACxBC,OAAOH,GAAA,EAAK;MACV,OAAOA,GAAA;IACT;EACF;EAEaI,SAAA,GAAY,SAAAA,CAAA,EAChB;IAIP;EAAA;EACAC,QAAA;IACFZ,IAEa,EAAAE,KAAA","ignoreList":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tamagui/react-native-web",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"files": [
|
|
5
|
+
"src",
|
|
6
|
+
"types",
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"type": "module",
|
|
10
|
+
"sideEffects": [
|
|
11
|
+
"*.css"
|
|
12
|
+
],
|
|
13
|
+
"main": "dist/cjs",
|
|
14
|
+
"module": "dist/esm",
|
|
15
|
+
"types": "./types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./types/index.d.ts",
|
|
19
|
+
"react-native": "./dist/esm/index.native.js",
|
|
20
|
+
"browser": "./dist/esm/index.mjs",
|
|
21
|
+
"module": "./dist/esm/index.mjs",
|
|
22
|
+
"import": "./dist/esm/index.mjs",
|
|
23
|
+
"require": "./dist/cjs/index.cjs",
|
|
24
|
+
"default": "./dist/esm/index.mjs"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tamagui-build",
|
|
29
|
+
"watch": "tamagui-build --watch",
|
|
30
|
+
"clean": "tamagui-build clean",
|
|
31
|
+
"clean:build": "tamagui-build clean:build",
|
|
32
|
+
"check": "bun run check-circular-deps",
|
|
33
|
+
"check-circular-deps": "npx madge --circular ./src/index.ts"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@tamagui/react-native-use-pressable": "1.0.1",
|
|
37
|
+
"@tamagui/react-native-use-responder-events": "1.0.1",
|
|
38
|
+
"@tamagui/web": "1.0.1"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@tamagui/build": "1.0.1",
|
|
42
|
+
"react": ">=19"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": ">=19"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export type DisplayMetrics = {
|
|
2
|
+
fontScale: number
|
|
3
|
+
height: number
|
|
4
|
+
scale: number
|
|
5
|
+
width: number
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type DimensionsValue = {
|
|
9
|
+
window: DisplayMetrics
|
|
10
|
+
screen: DisplayMetrics
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type DimensionKey = 'window' | 'screen'
|
|
14
|
+
type DimensionEventListenerType = 'change'
|
|
15
|
+
|
|
16
|
+
const dimensions = {
|
|
17
|
+
window: {
|
|
18
|
+
fontScale: 1,
|
|
19
|
+
height: 0,
|
|
20
|
+
scale: 1,
|
|
21
|
+
width: 0,
|
|
22
|
+
},
|
|
23
|
+
screen: {
|
|
24
|
+
fontScale: 1,
|
|
25
|
+
height: 0,
|
|
26
|
+
scale: 1,
|
|
27
|
+
width: 0,
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const listeners = {}
|
|
32
|
+
|
|
33
|
+
const canUseDOM = typeof window !== 'undefined'
|
|
34
|
+
let shouldInit = canUseDOM
|
|
35
|
+
|
|
36
|
+
function update() {
|
|
37
|
+
if (!canUseDOM) {
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const win = window
|
|
42
|
+
const docEl = win.document.documentElement
|
|
43
|
+
|
|
44
|
+
dimensions.window = {
|
|
45
|
+
fontScale: 1,
|
|
46
|
+
height: docEl.clientHeight,
|
|
47
|
+
scale: win.devicePixelRatio || 1,
|
|
48
|
+
width: docEl.clientWidth,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
dimensions.screen = {
|
|
52
|
+
fontScale: 1,
|
|
53
|
+
height: win.screen.height,
|
|
54
|
+
scale: win.devicePixelRatio || 1,
|
|
55
|
+
width: win.screen.width,
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function handleResize() {
|
|
60
|
+
update()
|
|
61
|
+
if (Array.isArray(listeners['change'])) {
|
|
62
|
+
listeners['change'].forEach((handler) => handler(dimensions))
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const Dimensions = {
|
|
67
|
+
get(dimension: DimensionKey): DisplayMetrics {
|
|
68
|
+
if (shouldInit) {
|
|
69
|
+
shouldInit = false
|
|
70
|
+
update()
|
|
71
|
+
}
|
|
72
|
+
if (dimensions[dimension] === undefined)
|
|
73
|
+
throw new Error(`No dimension set for key ${dimension}`)
|
|
74
|
+
return dimensions[dimension]
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
set(initialDimensions: DimensionsValue | null): void {
|
|
78
|
+
if (initialDimensions) {
|
|
79
|
+
if (canUseDOM) {
|
|
80
|
+
throw new Error('Dimensions cannot be set in the browser')
|
|
81
|
+
}
|
|
82
|
+
if (initialDimensions.screen != null) {
|
|
83
|
+
dimensions.screen = initialDimensions.screen
|
|
84
|
+
}
|
|
85
|
+
if (initialDimensions.window != null) {
|
|
86
|
+
dimensions.window = initialDimensions.window
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
addEventListener(
|
|
92
|
+
type: DimensionEventListenerType,
|
|
93
|
+
handler: (dimensionsValue: DimensionsValue) => void
|
|
94
|
+
) {
|
|
95
|
+
listeners[type] = listeners[type] || []
|
|
96
|
+
listeners[type].push(handler)
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
remove: () => {
|
|
100
|
+
this.removeEventListener(type, handler)
|
|
101
|
+
},
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
removeEventListener(
|
|
106
|
+
type: DimensionEventListenerType,
|
|
107
|
+
handler: (dimensionsValue: DimensionsValue) => void
|
|
108
|
+
): void {
|
|
109
|
+
if (Array.isArray(listeners[type])) {
|
|
110
|
+
listeners[type] = listeners[type].filter((_handler) => _handler !== handler)
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (canUseDOM) {
|
|
116
|
+
window.addEventListener('resize', handleResize, false)
|
|
117
|
+
}
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// TODO
|
|
2
|
+
|
|
3
|
+
export * from '@tamagui/react-native-use-responder-events'
|
|
4
|
+
export * from '@tamagui/react-native-use-pressable'
|
|
5
|
+
export { View, Text } from '@tamagui/web'
|
|
6
|
+
import { View, Text } from '@tamagui/web'
|
|
7
|
+
|
|
8
|
+
export * from './Dimensions'
|
|
9
|
+
|
|
10
|
+
export const Platform = {
|
|
11
|
+
OS: 'web',
|
|
12
|
+
|
|
13
|
+
select(obj) {
|
|
14
|
+
return obj.web
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const StyleSheet = {
|
|
19
|
+
create(obj) {
|
|
20
|
+
return obj
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Pressable = () => {
|
|
25
|
+
return null
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const Animated = {
|
|
29
|
+
View,
|
|
30
|
+
Text,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const ActivityIndicator = () => {
|
|
34
|
+
return null
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const PanResponder = () => {
|
|
38
|
+
return null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const Switch = () => {
|
|
42
|
+
return null
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const TextInput = () => {
|
|
46
|
+
return null
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const ScrollView = () => {
|
|
50
|
+
return null
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const Keyboard = {}
|
|
54
|
+
|
|
55
|
+
export const Image = () => {
|
|
56
|
+
return null
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const Linking = {}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type DisplayMetrics = {
|
|
2
|
+
fontScale: number;
|
|
3
|
+
height: number;
|
|
4
|
+
scale: number;
|
|
5
|
+
width: number;
|
|
6
|
+
};
|
|
7
|
+
type DimensionsValue = {
|
|
8
|
+
window: DisplayMetrics;
|
|
9
|
+
screen: DisplayMetrics;
|
|
10
|
+
};
|
|
11
|
+
type DimensionKey = 'window' | 'screen';
|
|
12
|
+
type DimensionEventListenerType = 'change';
|
|
13
|
+
export declare const Dimensions: {
|
|
14
|
+
get(dimension: DimensionKey): DisplayMetrics;
|
|
15
|
+
set(initialDimensions: DimensionsValue | null): void;
|
|
16
|
+
addEventListener(type: DimensionEventListenerType, handler: (dimensionsValue: DimensionsValue) => void): {
|
|
17
|
+
remove: () => void;
|
|
18
|
+
};
|
|
19
|
+
removeEventListener(type: DimensionEventListenerType, handler: (dimensionsValue: DimensionsValue) => void): void;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=Dimensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dimensions.d.ts","sourceRoot":"","sources":["../src/Dimensions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,cAAc,CAAA;IACtB,MAAM,EAAE,cAAc,CAAA;CACvB,CAAA;AAED,KAAK,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAA;AACvC,KAAK,0BAA0B,GAAG,QAAQ,CAAA;AAoD1C,eAAO,MAAM,UAAU;mBACN,YAAY,GAAG,cAAc;2BAUrB,eAAe,GAAG,IAAI,GAAG,IAAI;2BAe5C,0BAA0B,WACvB,CAAC,eAAe,EAAE,eAAe,KAAK,IAAI;;;8BAa7C,0BAA0B,WACvB,CAAC,eAAe,EAAE,eAAe,KAAK,IAAI,GAClD,IAAI;CAKR,CAAA"}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from '@tamagui/react-native-use-responder-events';
|
|
2
|
+
export * from '@tamagui/react-native-use-pressable';
|
|
3
|
+
export { View, Text } from '@tamagui/web';
|
|
4
|
+
export * from './Dimensions';
|
|
5
|
+
export declare const Platform: {
|
|
6
|
+
OS: string;
|
|
7
|
+
select(obj: any): any;
|
|
8
|
+
};
|
|
9
|
+
export declare const StyleSheet: {
|
|
10
|
+
create(obj: any): any;
|
|
11
|
+
};
|
|
12
|
+
export declare const Pressable: () => null;
|
|
13
|
+
export declare const Animated: {
|
|
14
|
+
View: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").ViewProps, import("@tamagui/web").TamaguiElement, import("@tamagui/web").StackNonStyleProps, import("@tamagui/web").StackStyleBase, {}, {}>;
|
|
15
|
+
Text: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TextProps, import("@tamagui/web").TamaguiTextElement, import("@tamagui/web").TextNonStyleProps, import("@tamagui/web").TextStylePropsBase, {}, {}>;
|
|
16
|
+
};
|
|
17
|
+
export declare const ActivityIndicator: () => null;
|
|
18
|
+
export declare const PanResponder: () => null;
|
|
19
|
+
export declare const Switch: () => null;
|
|
20
|
+
export declare const TextInput: () => null;
|
|
21
|
+
export declare const ScrollView: () => null;
|
|
22
|
+
export declare const Keyboard: {};
|
|
23
|
+
export declare const Image: () => null;
|
|
24
|
+
export declare const Linking: {};
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,cAAc,4CAA4C,CAAA;AAC1D,cAAc,qCAAqC,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGzC,cAAc,cAAc,CAAA;AAE5B,eAAO,MAAM,QAAQ;;;CAMpB,CAAA;AAED,eAAO,MAAM,UAAU;;CAItB,CAAA;AAED,eAAO,MAAM,SAAS,YAErB,CAAA;AAED,eAAO,MAAM,QAAQ;;;CAGpB,CAAA;AAED,eAAO,MAAM,iBAAiB,YAE7B,CAAA;AAED,eAAO,MAAM,YAAY,YAExB,CAAA;AAED,eAAO,MAAM,MAAM,YAElB,CAAA;AAED,eAAO,MAAM,SAAS,YAErB,CAAA;AAED,eAAO,MAAM,UAAU,YAEtB,CAAA;AAED,eAAO,MAAM,QAAQ,IAAK,CAAA;AAE1B,eAAO,MAAM,KAAK,YAEjB,CAAA;AAED,eAAO,MAAM,OAAO,IAAK,CAAA"}
|