@tamagui/react-native-media-driver 1.13.3 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/createMedia.js +1 -33
- package/dist/cjs/createMedia.js.map +2 -2
- package/dist/cjs/index.js +1 -19
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/matchMedia.js +1 -28
- package/dist/cjs/matchMedia.js.map +2 -2
- package/dist/cjs/matchMedia.native.js +1 -31
- package/dist/cjs/matchMedia.native.js.map +2 -2
- package/dist/cjs/mediaQueryList.js +1 -77
- package/dist/cjs/mediaQueryList.js.map +2 -2
- package/dist/esm/createMedia.js +1 -9
- package/dist/esm/createMedia.js.map +2 -2
- package/dist/esm/createMedia.mjs +1 -9
- package/dist/esm/createMedia.mjs.map +2 -2
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/matchMedia.js +1 -4
- package/dist/esm/matchMedia.js.map +2 -2
- package/dist/esm/matchMedia.mjs +1 -4
- package/dist/esm/matchMedia.mjs.map +2 -2
- package/dist/esm/matchMedia.native.js +1 -7
- package/dist/esm/matchMedia.native.js.map +2 -2
- package/dist/esm/matchMedia.native.mjs +1 -7
- package/dist/esm/matchMedia.native.mjs.map +2 -2
- package/dist/esm/mediaQueryList.js +1 -43
- package/dist/esm/mediaQueryList.js.map +2 -2
- package/dist/esm/mediaQueryList.mjs +1 -43
- package/dist/esm/mediaQueryList.mjs.map +2 -2
- package/package.json +3 -3
package/dist/cjs/createMedia.js
CHANGED
|
@@ -1,34 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var createMedia_exports = {};
|
|
20
|
-
__export(createMedia_exports, {
|
|
21
|
-
createMedia: () => createMedia
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(createMedia_exports);
|
|
24
|
-
var import_web = require("@tamagui/web");
|
|
25
|
-
var import_matchMedia = require("./matchMedia");
|
|
26
|
-
function createMedia(media) {
|
|
27
|
-
(0, import_web.setupMatchMedia)(import_matchMedia.matchMedia);
|
|
28
|
-
return media;
|
|
29
|
-
}
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
createMedia
|
|
33
|
-
});
|
|
1
|
+
"use strict";var a=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var u=(e,t)=>{for(var i in t)a(e,i,{get:t[i],enumerable:!0})},p=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of m(t))!n.call(e,r)&&r!==i&&a(e,r,{get:()=>t[r],enumerable:!(c=M(t,r))||c.enumerable});return e};var f=e=>p(a({},"__esModule",{value:!0}),e);var y={};u(y,{createMedia:()=>s});module.exports=f(y);var d=require("@tamagui/web"),o=require("./matchMedia");function s(e){return(0,d.setupMatchMedia)(o.matchMedia),e}0&&(module.exports={createMedia});
|
|
34
2
|
//# sourceMappingURL=createMedia.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createMedia.ts"],
|
|
4
4
|
"sourcesContent": ["import { MediaQueryObject, setupMatchMedia } from '@tamagui/web'\n\nimport { matchMedia } from './matchMedia'\n\nexport function createMedia<\n A extends {\n [key: string]: MediaQueryObject\n }\n>(media: A): A {\n // this should ideally return a diff object that is then passed to createTamagui\n // but works for now we dont really support swapping out media drivers\n setupMatchMedia(matchMedia)\n return media\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkD,wBAElDC,EAA2B,wBAEpB,SAASH,EAIdI,EAAa,CAGb,4BAAgB,YAAU,EACnBA,CACT",
|
|
6
|
+
"names": ["createMedia_exports", "__export", "createMedia", "__toCommonJS", "import_web", "import_matchMedia", "media"]
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var src_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(src_exports);
|
|
18
|
-
__reExport(src_exports, require("./createMedia.js"), module.exports);
|
|
19
|
-
__reExport(src_exports, require("./matchMedia"), module.exports);
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(r,o,p,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of c(o))!d.call(r,m)&&m!==p&&a(r,m,{get:()=>o[m],enumerable:!(x=b(o,m))||x.enumerable});return r},f=(r,o,p)=>(t(r,o,"default"),p&&t(p,o,"default"));var g=r=>t(a({},"__esModule",{value:!0}),r);var e={};module.exports=g(e);f(e,require("./createMedia.js"),module.exports);f(e,require("./matchMedia"),module.exports);
|
|
20
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export * from './createMedia.js'\nexport * from './matchMedia'\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,4BAAd,gBACAE,EAAAF,EAAc,wBADd",
|
|
6
|
+
"names": ["src_exports", "__toCommonJS", "__reExport"]
|
|
7
7
|
}
|
package/dist/cjs/matchMedia.js
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var matchMedia_exports = {};
|
|
20
|
-
__export(matchMedia_exports, {
|
|
21
|
-
matchMedia: () => matchMedia
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(matchMedia_exports);
|
|
24
|
-
const matchMedia = globalThis["matchMedia"];
|
|
25
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
-
0 && (module.exports = {
|
|
27
|
-
matchMedia
|
|
28
|
-
});
|
|
1
|
+
"use strict";var M=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var d=(t,a)=>{for(var i in a)M(t,i,{get:a[i],enumerable:!0})},p=(t,a,i,c)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of m(a))!o.call(t,e)&&e!==i&&M(t,e,{get:()=>a[e],enumerable:!(c=h(a,e))||c.enumerable});return t};var r=t=>p(M({},"__esModule",{value:!0}),t);var g={};d(g,{matchMedia:()=>b});module.exports=r(g);const b=globalThis.matchMedia;0&&(module.exports={matchMedia});
|
|
29
2
|
//# sourceMappingURL=matchMedia.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/matchMedia.ts"],
|
|
4
4
|
"sourcesContent": ["// web-only use platform:\n\nimport type { MatchMedia } from '@tamagui/web'\n\nexport const matchMedia: MatchMedia = globalThis['matchMedia']\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAIO,MAAME,EAAyB,WAAW",
|
|
6
|
+
"names": ["matchMedia_exports", "__export", "matchMedia", "__toCommonJS"]
|
|
7
7
|
}
|
|
@@ -1,32 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var matchMedia_native_exports = {};
|
|
20
|
-
__export(matchMedia_native_exports, {
|
|
21
|
-
matchMedia: () => matchMedia
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(matchMedia_native_exports);
|
|
24
|
-
var import_mediaQueryList = require("./mediaQueryList.js");
|
|
25
|
-
const matchMedia = (query) => {
|
|
26
|
-
return new import_mediaQueryList.NativeMediaQueryList(query);
|
|
27
|
-
};
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
matchMedia
|
|
31
|
-
});
|
|
1
|
+
"use strict";var r=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var h=(t,e)=>{for(var i in e)r(t,i,{get:e[i],enumerable:!0})},n=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of c(e))!d.call(t,a)&&a!==i&&r(t,a,{get:()=>e[a],enumerable:!(o=m(e,a))||o.enumerable});return t};var p=t=>n(r({},"__esModule",{value:!0}),t);var s={};h(s,{matchMedia:()=>f});module.exports=p(s);var M=require("./mediaQueryList.js");const f=t=>new M.NativeMediaQueryList(t);0&&(module.exports={matchMedia});
|
|
32
2
|
//# sourceMappingURL=matchMedia.native.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/matchMedia.native.ts"],
|
|
4
4
|
"sourcesContent": ["import { MatchMedia } from '@tamagui/web'\n\nimport { NativeMediaQueryList } from './mediaQueryList.js'\n\nexport const matchMedia: MatchMedia = (query) => {\n return new NativeMediaQueryList(query)\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAEA,IAAAI,EAAqC,+BAE9B,MAAMF,EAA0BG,GAC9B,IAAI,uBAAqBA,CAAK",
|
|
6
|
+
"names": ["matchMedia_native_exports", "__export", "matchMedia", "__toCommonJS", "import_mediaQueryList", "query"]
|
|
7
7
|
}
|
|
@@ -1,78 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
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", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var mediaQueryList_exports = {};
|
|
30
|
-
__export(mediaQueryList_exports, {
|
|
31
|
-
NativeMediaQueryList: () => NativeMediaQueryList
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(mediaQueryList_exports);
|
|
34
|
-
var import_css_mediaquery = __toESM(require("css-mediaquery"));
|
|
35
|
-
var import_react_native = require("react-native");
|
|
36
|
-
class NativeMediaQueryList {
|
|
37
|
-
constructor(query) {
|
|
38
|
-
this.query = query;
|
|
39
|
-
this.listeners = [];
|
|
40
|
-
this.notify();
|
|
41
|
-
import_react_native.Dimensions.addEventListener("change", () => {
|
|
42
|
-
this.notify();
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
get orientation() {
|
|
46
|
-
const windowDimensions = import_react_native.Dimensions.get("window");
|
|
47
|
-
return windowDimensions.height > windowDimensions.width ? "portrait" : "landscape";
|
|
48
|
-
}
|
|
49
|
-
notify() {
|
|
50
|
-
this.listeners.forEach((listener) => {
|
|
51
|
-
listener(this.orientation);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
addListener(listener) {
|
|
55
|
-
this.listeners.push(listener);
|
|
56
|
-
}
|
|
57
|
-
removeListener(listener) {
|
|
58
|
-
const index = this.listeners.indexOf(listener);
|
|
59
|
-
if (index !== -1)
|
|
60
|
-
this.listeners.splice(index, 1);
|
|
61
|
-
}
|
|
62
|
-
get matches() {
|
|
63
|
-
const windowDimensions = import_react_native.Dimensions.get("window");
|
|
64
|
-
const matches = import_css_mediaquery.default.match(this.query, {
|
|
65
|
-
type: "screen",
|
|
66
|
-
orientation: this.orientation,
|
|
67
|
-
...windowDimensions,
|
|
68
|
-
"device-width": windowDimensions.width,
|
|
69
|
-
"device-height": windowDimensions.height
|
|
70
|
-
});
|
|
71
|
-
return matches;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
-
0 && (module.exports = {
|
|
76
|
-
NativeMediaQueryList
|
|
77
|
-
});
|
|
1
|
+
"use strict";var d=Object.create;var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var i in e)s(t,i,{get:e[i],enumerable:!0})},a=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of p(e))!y.call(t,n)&&n!==i&&s(t,n,{get:()=>e[n],enumerable:!(o=c(e,n))||o.enumerable});return t};var l=(t,e,i)=>(i=t!=null?d(m(t)):{},a(e||!t||!t.__esModule?s(i,"default",{value:t,enumerable:!0}):i,t)),u=t=>a(s({},"__esModule",{value:!0}),t);var v={};w(v,{NativeMediaQueryList:()=>g});module.exports=u(v);var h=l(require("css-mediaquery")),r=require("react-native");class g{constructor(e){this.query=e;this.listeners=[];this.notify(),r.Dimensions.addEventListener("change",()=>{this.notify()})}get orientation(){const e=r.Dimensions.get("window");return e.height>e.width?"portrait":"landscape"}notify(){this.listeners.forEach(e=>{e(this.orientation)})}addListener(e){this.listeners.push(e)}removeListener(e){const i=this.listeners.indexOf(e);i!==-1&&this.listeners.splice(i,1)}get matches(){const e=r.Dimensions.get("window");return h.default.match(this.query,{type:"screen",orientation:this.orientation,...e,"device-width":e.width,"device-height":e.height})}}0&&(module.exports={NativeMediaQueryList});
|
|
78
2
|
//# sourceMappingURL=mediaQueryList.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/mediaQueryList.ts"],
|
|
4
4
|
"sourcesContent": ["import type { MediaQueryList } from '@tamagui/web'\nimport mediaQuery from 'css-mediaquery'\nimport { Dimensions } from 'react-native'\n\ntype Orientation = 'landscape' | 'portrait'\n\ntype Listener = (orientation: Orientation) => void\n\nexport class NativeMediaQueryList implements MediaQueryList {\n private listeners: Listener[] = []\n\n private get orientation(): Orientation {\n const windowDimensions = Dimensions.get('window')\n return windowDimensions.height > windowDimensions.width ? 'portrait' : 'landscape'\n }\n\n constructor(private query: string) {\n this.notify()\n Dimensions.addEventListener('change', () => {\n this.notify()\n })\n }\n\n private notify() {\n this.listeners.forEach((listener) => {\n listener(this.orientation)\n })\n }\n\n addListener(listener: Listener) {\n this.listeners.push(listener)\n }\n\n removeListener(listener: Listener) {\n const index = this.listeners.indexOf(listener)\n if (index !== -1) this.listeners.splice(index, 1)\n }\n\n get matches(): boolean {\n const windowDimensions = Dimensions.get('window')\n const matches = mediaQuery.match(this.query, {\n type: 'screen',\n orientation: this.orientation,\n ...windowDimensions,\n 'device-width': windowDimensions.width,\n 'device-height': windowDimensions.height,\n })\n return matches\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["mediaQuery"]
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAAuB,6BACvBC,EAA2B,wBAMpB,MAAMH,CAA+C,CAQ1D,YAAoBI,EAAe,CAAf,WAAAA,EAPpB,KAAQ,UAAwB,CAAC,EAQ/B,KAAK,OAAO,EACZ,aAAW,iBAAiB,SAAU,IAAM,CAC1C,KAAK,OAAO,CACd,CAAC,CACH,CAVA,IAAY,aAA2B,CACrC,MAAMC,EAAmB,aAAW,IAAI,QAAQ,EAChD,OAAOA,EAAiB,OAASA,EAAiB,MAAQ,WAAa,WACzE,CASQ,QAAS,CACf,KAAK,UAAU,QAASC,GAAa,CACnCA,EAAS,KAAK,WAAW,CAC3B,CAAC,CACH,CAEA,YAAYA,EAAoB,CAC9B,KAAK,UAAU,KAAKA,CAAQ,CAC9B,CAEA,eAAeA,EAAoB,CACjC,MAAMC,EAAQ,KAAK,UAAU,QAAQD,CAAQ,EACzCC,IAAU,IAAI,KAAK,UAAU,OAAOA,EAAO,CAAC,CAClD,CAEA,IAAI,SAAmB,CACrB,MAAMF,EAAmB,aAAW,IAAI,QAAQ,EAQhD,OAPgB,EAAAG,QAAW,MAAM,KAAK,MAAO,CAC3C,KAAM,SACN,YAAa,KAAK,YAClB,GAAGH,EACH,eAAgBA,EAAiB,MACjC,gBAAiBA,EAAiB,MACpC,CAAC,CAEH,CACF",
|
|
6
|
+
"names": ["mediaQueryList_exports", "__export", "NativeMediaQueryList", "__toCommonJS", "import_css_mediaquery", "import_react_native", "query", "windowDimensions", "listener", "index", "mediaQuery"]
|
|
7
7
|
}
|
package/dist/esm/createMedia.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { matchMedia } from "./matchMedia";
|
|
3
|
-
function createMedia(media) {
|
|
4
|
-
setupMatchMedia(matchMedia);
|
|
5
|
-
return media;
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
createMedia
|
|
9
|
-
};
|
|
1
|
+
import{setupMatchMedia as t}from"@tamagui/web";import{matchMedia as r}from"./matchMedia";function d(e){return t(r),e}export{d as createMedia};
|
|
10
2
|
//# sourceMappingURL=createMedia.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createMedia.ts"],
|
|
4
4
|
"sourcesContent": ["import { MediaQueryObject, setupMatchMedia } from '@tamagui/web'\n\nimport { matchMedia } from './matchMedia'\n\nexport function createMedia<\n A extends {\n [key: string]: MediaQueryObject\n }\n>(media: A): A {\n // this should ideally return a diff object that is then passed to createTamagui\n // but works for now we dont really support swapping out media drivers\n setupMatchMedia(matchMedia)\n return media\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAA2B,mBAAAA,MAAuB,eAElD,OAAS,cAAAC,MAAkB,eAEpB,SAASC,EAIdC,EAAa,CAGb,OAAAH,EAAgBC,CAAU,EACnBE,CACT",
|
|
6
|
+
"names": ["setupMatchMedia", "matchMedia", "createMedia", "media"]
|
|
7
7
|
}
|
package/dist/esm/createMedia.mjs
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { matchMedia } from "./matchMedia";
|
|
3
|
-
function createMedia(media) {
|
|
4
|
-
setupMatchMedia(matchMedia);
|
|
5
|
-
return media;
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
createMedia
|
|
9
|
-
};
|
|
1
|
+
import{setupMatchMedia as t}from"@tamagui/web";import{matchMedia as r}from"./matchMedia";function d(e){return t(r),e}export{d as createMedia};
|
|
10
2
|
//# sourceMappingURL=createMedia.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createMedia.ts"],
|
|
4
4
|
"sourcesContent": ["import { MediaQueryObject, setupMatchMedia } from '@tamagui/web'\n\nimport { matchMedia } from './matchMedia'\n\nexport function createMedia<\n A extends {\n [key: string]: MediaQueryObject\n }\n>(media: A): A {\n // this should ideally return a diff object that is then passed to createTamagui\n // but works for now we dont really support swapping out media drivers\n setupMatchMedia(matchMedia)\n return media\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAA2B,mBAAAA,MAAuB,eAElD,OAAS,cAAAC,MAAkB,eAEpB,SAASC,EAIdC,EAAa,CAGb,OAAAH,EAAgBC,CAAU,EACnBE,CACT",
|
|
6
|
+
"names": ["setupMatchMedia", "matchMedia", "createMedia", "media"]
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
package/dist/esm/index.mjs
CHANGED
package/dist/esm/index.mjs.map
CHANGED
package/dist/esm/matchMedia.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/matchMedia.ts"],
|
|
4
4
|
"sourcesContent": ["// web-only use platform:\n\nimport type { MatchMedia } from '@tamagui/web'\n\nexport const matchMedia: MatchMedia = globalThis['matchMedia']\n"],
|
|
5
|
-
"mappings": "AAIO,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAIO,MAAMA,EAAyB,WAAW",
|
|
6
|
+
"names": ["matchMedia"]
|
|
7
7
|
}
|
package/dist/esm/matchMedia.mjs
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/matchMedia.ts"],
|
|
4
4
|
"sourcesContent": ["// web-only use platform:\n\nimport type { MatchMedia } from '@tamagui/web'\n\nexport const matchMedia: MatchMedia = globalThis['matchMedia']\n"],
|
|
5
|
-
"mappings": "AAIO,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAIO,MAAMA,EAAyB,WAAW",
|
|
6
|
+
"names": ["matchMedia"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
const matchMedia = (query) => {
|
|
3
|
-
return new NativeMediaQueryList(query);
|
|
4
|
-
};
|
|
5
|
-
export {
|
|
6
|
-
matchMedia
|
|
7
|
-
};
|
|
1
|
+
import{NativeMediaQueryList as e}from"./mediaQueryList.js";const o=t=>new e(t);export{o as matchMedia};
|
|
8
2
|
//# sourceMappingURL=matchMedia.native.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/matchMedia.native.ts"],
|
|
4
4
|
"sourcesContent": ["import { MatchMedia } from '@tamagui/web'\n\nimport { NativeMediaQueryList } from './mediaQueryList.js'\n\nexport const matchMedia: MatchMedia = (query) => {\n return new NativeMediaQueryList(query)\n}\n"],
|
|
5
|
-
"mappings": "AAEA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAEA,OAAS,wBAAAA,MAA4B,sBAE9B,MAAMC,EAA0BC,GAC9B,IAAIF,EAAqBE,CAAK",
|
|
6
|
+
"names": ["NativeMediaQueryList", "matchMedia", "query"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
const matchMedia = (query) => {
|
|
3
|
-
return new NativeMediaQueryList(query);
|
|
4
|
-
};
|
|
5
|
-
export {
|
|
6
|
-
matchMedia
|
|
7
|
-
};
|
|
1
|
+
import{NativeMediaQueryList as e}from"./mediaQueryList.js";const o=t=>new e(t);export{o as matchMedia};
|
|
8
2
|
//# sourceMappingURL=matchMedia.native.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/matchMedia.native.ts"],
|
|
4
4
|
"sourcesContent": ["import { MatchMedia } from '@tamagui/web'\n\nimport { NativeMediaQueryList } from './mediaQueryList.js'\n\nexport const matchMedia: MatchMedia = (query) => {\n return new NativeMediaQueryList(query)\n}\n"],
|
|
5
|
-
"mappings": "AAEA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAEA,OAAS,wBAAAA,MAA4B,sBAE9B,MAAMC,EAA0BC,GAC9B,IAAIF,EAAqBE,CAAK",
|
|
6
|
+
"names": ["NativeMediaQueryList", "matchMedia", "query"]
|
|
7
7
|
}
|
|
@@ -1,44 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Dimensions } from "react-native";
|
|
3
|
-
class NativeMediaQueryList {
|
|
4
|
-
constructor(query) {
|
|
5
|
-
this.query = query;
|
|
6
|
-
this.listeners = [];
|
|
7
|
-
this.notify();
|
|
8
|
-
Dimensions.addEventListener("change", () => {
|
|
9
|
-
this.notify();
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
get orientation() {
|
|
13
|
-
const windowDimensions = Dimensions.get("window");
|
|
14
|
-
return windowDimensions.height > windowDimensions.width ? "portrait" : "landscape";
|
|
15
|
-
}
|
|
16
|
-
notify() {
|
|
17
|
-
this.listeners.forEach((listener) => {
|
|
18
|
-
listener(this.orientation);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
addListener(listener) {
|
|
22
|
-
this.listeners.push(listener);
|
|
23
|
-
}
|
|
24
|
-
removeListener(listener) {
|
|
25
|
-
const index = this.listeners.indexOf(listener);
|
|
26
|
-
if (index !== -1)
|
|
27
|
-
this.listeners.splice(index, 1);
|
|
28
|
-
}
|
|
29
|
-
get matches() {
|
|
30
|
-
const windowDimensions = Dimensions.get("window");
|
|
31
|
-
const matches = mediaQuery.match(this.query, {
|
|
32
|
-
type: "screen",
|
|
33
|
-
orientation: this.orientation,
|
|
34
|
-
...windowDimensions,
|
|
35
|
-
"device-width": windowDimensions.width,
|
|
36
|
-
"device-height": windowDimensions.height
|
|
37
|
-
});
|
|
38
|
-
return matches;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
export {
|
|
42
|
-
NativeMediaQueryList
|
|
43
|
-
};
|
|
1
|
+
import n from"css-mediaquery";import{Dimensions as i}from"react-native";class a{constructor(e){this.query=e;this.listeners=[];this.notify(),i.addEventListener("change",()=>{this.notify()})}get orientation(){const e=i.get("window");return e.height>e.width?"portrait":"landscape"}notify(){this.listeners.forEach(e=>{e(this.orientation)})}addListener(e){this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);t!==-1&&this.listeners.splice(t,1)}get matches(){const e=i.get("window");return n.match(this.query,{type:"screen",orientation:this.orientation,...e,"device-width":e.width,"device-height":e.height})}}export{a as NativeMediaQueryList};
|
|
44
2
|
//# sourceMappingURL=mediaQueryList.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/mediaQueryList.ts"],
|
|
4
4
|
"sourcesContent": ["import type { MediaQueryList } from '@tamagui/web'\nimport mediaQuery from 'css-mediaquery'\nimport { Dimensions } from 'react-native'\n\ntype Orientation = 'landscape' | 'portrait'\n\ntype Listener = (orientation: Orientation) => void\n\nexport class NativeMediaQueryList implements MediaQueryList {\n private listeners: Listener[] = []\n\n private get orientation(): Orientation {\n const windowDimensions = Dimensions.get('window')\n return windowDimensions.height > windowDimensions.width ? 'portrait' : 'landscape'\n }\n\n constructor(private query: string) {\n this.notify()\n Dimensions.addEventListener('change', () => {\n this.notify()\n })\n }\n\n private notify() {\n this.listeners.forEach((listener) => {\n listener(this.orientation)\n })\n }\n\n addListener(listener: Listener) {\n this.listeners.push(listener)\n }\n\n removeListener(listener: Listener) {\n const index = this.listeners.indexOf(listener)\n if (index !== -1) this.listeners.splice(index, 1)\n }\n\n get matches(): boolean {\n const windowDimensions = Dimensions.get('window')\n const matches = mediaQuery.match(this.query, {\n type: 'screen',\n orientation: this.orientation,\n ...windowDimensions,\n 'device-width': windowDimensions.width,\n 'device-height': windowDimensions.height,\n })\n return matches\n }\n}\n"],
|
|
5
|
-
"mappings": "AACA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AACA,OAAOA,MAAgB,iBACvB,OAAS,cAAAC,MAAkB,eAMpB,MAAMC,CAA+C,CAQ1D,YAAoBC,EAAe,CAAf,WAAAA,EAPpB,KAAQ,UAAwB,CAAC,EAQ/B,KAAK,OAAO,EACZF,EAAW,iBAAiB,SAAU,IAAM,CAC1C,KAAK,OAAO,CACd,CAAC,CACH,CAVA,IAAY,aAA2B,CACrC,MAAMG,EAAmBH,EAAW,IAAI,QAAQ,EAChD,OAAOG,EAAiB,OAASA,EAAiB,MAAQ,WAAa,WACzE,CASQ,QAAS,CACf,KAAK,UAAU,QAASC,GAAa,CACnCA,EAAS,KAAK,WAAW,CAC3B,CAAC,CACH,CAEA,YAAYA,EAAoB,CAC9B,KAAK,UAAU,KAAKA,CAAQ,CAC9B,CAEA,eAAeA,EAAoB,CACjC,MAAMC,EAAQ,KAAK,UAAU,QAAQD,CAAQ,EACzCC,IAAU,IAAI,KAAK,UAAU,OAAOA,EAAO,CAAC,CAClD,CAEA,IAAI,SAAmB,CACrB,MAAMF,EAAmBH,EAAW,IAAI,QAAQ,EAQhD,OAPgBD,EAAW,MAAM,KAAK,MAAO,CAC3C,KAAM,SACN,YAAa,KAAK,YAClB,GAAGI,EACH,eAAgBA,EAAiB,MACjC,gBAAiBA,EAAiB,MACpC,CAAC,CAEH,CACF",
|
|
6
|
+
"names": ["mediaQuery", "Dimensions", "NativeMediaQueryList", "query", "windowDimensions", "listener", "index"]
|
|
7
7
|
}
|
|
@@ -1,44 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Dimensions } from "react-native";
|
|
3
|
-
class NativeMediaQueryList {
|
|
4
|
-
constructor(query) {
|
|
5
|
-
this.query = query;
|
|
6
|
-
this.listeners = [];
|
|
7
|
-
this.notify();
|
|
8
|
-
Dimensions.addEventListener("change", () => {
|
|
9
|
-
this.notify();
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
get orientation() {
|
|
13
|
-
const windowDimensions = Dimensions.get("window");
|
|
14
|
-
return windowDimensions.height > windowDimensions.width ? "portrait" : "landscape";
|
|
15
|
-
}
|
|
16
|
-
notify() {
|
|
17
|
-
this.listeners.forEach((listener) => {
|
|
18
|
-
listener(this.orientation);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
addListener(listener) {
|
|
22
|
-
this.listeners.push(listener);
|
|
23
|
-
}
|
|
24
|
-
removeListener(listener) {
|
|
25
|
-
const index = this.listeners.indexOf(listener);
|
|
26
|
-
if (index !== -1)
|
|
27
|
-
this.listeners.splice(index, 1);
|
|
28
|
-
}
|
|
29
|
-
get matches() {
|
|
30
|
-
const windowDimensions = Dimensions.get("window");
|
|
31
|
-
const matches = mediaQuery.match(this.query, {
|
|
32
|
-
type: "screen",
|
|
33
|
-
orientation: this.orientation,
|
|
34
|
-
...windowDimensions,
|
|
35
|
-
"device-width": windowDimensions.width,
|
|
36
|
-
"device-height": windowDimensions.height
|
|
37
|
-
});
|
|
38
|
-
return matches;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
export {
|
|
42
|
-
NativeMediaQueryList
|
|
43
|
-
};
|
|
1
|
+
import n from"css-mediaquery";import{Dimensions as i}from"react-native";class a{constructor(e){this.query=e;this.listeners=[];this.notify(),i.addEventListener("change",()=>{this.notify()})}get orientation(){const e=i.get("window");return e.height>e.width?"portrait":"landscape"}notify(){this.listeners.forEach(e=>{e(this.orientation)})}addListener(e){this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);t!==-1&&this.listeners.splice(t,1)}get matches(){const e=i.get("window");return n.match(this.query,{type:"screen",orientation:this.orientation,...e,"device-width":e.width,"device-height":e.height})}}export{a as NativeMediaQueryList};
|
|
44
2
|
//# sourceMappingURL=mediaQueryList.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/mediaQueryList.ts"],
|
|
4
4
|
"sourcesContent": ["import type { MediaQueryList } from '@tamagui/web'\nimport mediaQuery from 'css-mediaquery'\nimport { Dimensions } from 'react-native'\n\ntype Orientation = 'landscape' | 'portrait'\n\ntype Listener = (orientation: Orientation) => void\n\nexport class NativeMediaQueryList implements MediaQueryList {\n private listeners: Listener[] = []\n\n private get orientation(): Orientation {\n const windowDimensions = Dimensions.get('window')\n return windowDimensions.height > windowDimensions.width ? 'portrait' : 'landscape'\n }\n\n constructor(private query: string) {\n this.notify()\n Dimensions.addEventListener('change', () => {\n this.notify()\n })\n }\n\n private notify() {\n this.listeners.forEach((listener) => {\n listener(this.orientation)\n })\n }\n\n addListener(listener: Listener) {\n this.listeners.push(listener)\n }\n\n removeListener(listener: Listener) {\n const index = this.listeners.indexOf(listener)\n if (index !== -1) this.listeners.splice(index, 1)\n }\n\n get matches(): boolean {\n const windowDimensions = Dimensions.get('window')\n const matches = mediaQuery.match(this.query, {\n type: 'screen',\n orientation: this.orientation,\n ...windowDimensions,\n 'device-width': windowDimensions.width,\n 'device-height': windowDimensions.height,\n })\n return matches\n }\n}\n"],
|
|
5
|
-
"mappings": "AACA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AACA,OAAOA,MAAgB,iBACvB,OAAS,cAAAC,MAAkB,eAMpB,MAAMC,CAA+C,CAQ1D,YAAoBC,EAAe,CAAf,WAAAA,EAPpB,KAAQ,UAAwB,CAAC,EAQ/B,KAAK,OAAO,EACZF,EAAW,iBAAiB,SAAU,IAAM,CAC1C,KAAK,OAAO,CACd,CAAC,CACH,CAVA,IAAY,aAA2B,CACrC,MAAMG,EAAmBH,EAAW,IAAI,QAAQ,EAChD,OAAOG,EAAiB,OAASA,EAAiB,MAAQ,WAAa,WACzE,CASQ,QAAS,CACf,KAAK,UAAU,QAASC,GAAa,CACnCA,EAAS,KAAK,WAAW,CAC3B,CAAC,CACH,CAEA,YAAYA,EAAoB,CAC9B,KAAK,UAAU,KAAKA,CAAQ,CAC9B,CAEA,eAAeA,EAAoB,CACjC,MAAMC,EAAQ,KAAK,UAAU,QAAQD,CAAQ,EACzCC,IAAU,IAAI,KAAK,UAAU,OAAOA,EAAO,CAAC,CAClD,CAEA,IAAI,SAAmB,CACrB,MAAMF,EAAmBH,EAAW,IAAI,QAAQ,EAQhD,OAPgBD,EAAW,MAAM,KAAK,MAAO,CAC3C,KAAM,SACN,YAAa,KAAK,YAClB,GAAGI,EACH,eAAgBA,EAAiB,MACjC,gBAAiBA,EAAiB,MACpC,CAAC,CAEH,CACF",
|
|
6
|
+
"names": ["mediaQuery", "Dimensions", "NativeMediaQueryList", "query", "windowDimensions", "listener", "index"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/react-native-media-driver",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
],
|
|
14
14
|
"sideEffects": true,
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@tamagui/web": "1.
|
|
16
|
+
"@tamagui/web": "1.14.0",
|
|
17
17
|
"css-mediaquery": "^0.1.2"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@tamagui/build": "1.
|
|
20
|
+
"@tamagui/build": "1.14.0",
|
|
21
21
|
"react-native": "^0.71.4"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|