@tamagui/react-native-media-driver 2.7.7 → 3.0.0-beta.637.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/dist/cjs/index.cjs +10 -12
- package/dist/cjs/index.native.cjs +21 -0
- package/dist/cjs/index.native.js +10 -11
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/matchMedia.cjs +15 -18
- package/dist/cjs/matchMedia.native.cjs +30 -0
- package/dist/cjs/matchMedia.native.js +17 -19
- package/dist/cjs/matchMedia.native.js.map +1 -1
- package/dist/cjs/matchQuery.cjs +115 -132
- package/dist/cjs/matchQuery.native.cjs +145 -0
- package/dist/cjs/matchQuery.native.js +117 -133
- package/dist/cjs/matchQuery.native.js.map +1 -1
- package/dist/cjs/mediaQueryList.cjs +102 -66
- package/dist/cjs/mediaQueryList.native.cjs +180 -0
- package/dist/cjs/mediaQueryList.native.js +158 -110
- package/dist/cjs/mediaQueryList.native.js.map +1 -1
- package/dist/esm/index.js +1 -3
- package/dist/esm/index.mjs +1 -3
- package/dist/esm/index.native.js +1 -3
- package/dist/esm/matchMedia.mjs +1 -0
- package/dist/esm/matchMedia.mjs.map +1 -1
- package/dist/esm/matchMedia.native.js +4 -2
- package/dist/esm/matchMedia.native.js.map +1 -1
- package/dist/esm/matchQuery.mjs +100 -115
- package/dist/esm/matchQuery.mjs.map +1 -1
- package/dist/esm/matchQuery.native.js +102 -117
- package/dist/esm/matchQuery.native.js.map +1 -1
- package/dist/esm/mediaQueryList.mjs +90 -49
- package/dist/esm/mediaQueryList.mjs.map +1 -1
- package/dist/esm/mediaQueryList.native.js +146 -94
- package/dist/esm/mediaQueryList.native.js.map +1 -1
- package/package.json +7 -4
- package/src/index.ts +0 -1
- package/src/mediaQueryList.ts +58 -3
- package/types/index.d.ts +0 -1
- package/types/index.d.ts.map +2 -2
- package/types/mediaQueryList.d.ts +2 -2
- package/types/mediaQueryList.d.ts.map +2 -2
- package/dist/cjs/createMedia.cjs +0 -33
- package/dist/cjs/createMedia.native.js +0 -36
- package/dist/cjs/createMedia.native.js.map +0 -1
- package/dist/esm/createMedia.mjs +0 -8
- package/dist/esm/createMedia.mjs.map +0 -1
- package/dist/esm/createMedia.native.js +0 -8
- package/dist/esm/createMedia.native.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/src/createMedia.ts +0 -19
- package/types/createMedia.d.ts +0 -10
- package/types/createMedia.d.ts.map +0 -11
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
12
13
|
};
|
|
13
14
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
21
22
|
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
24
|
var matchQuery_exports = {};
|
|
26
25
|
__export(matchQuery_exports, {
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
matchQuery: () => matchQuery,
|
|
27
|
+
parseQuery: () => parseQuery
|
|
29
28
|
});
|
|
30
29
|
module.exports = __toCommonJS(matchQuery_exports);
|
|
31
30
|
var RE_MEDIA_QUERY = /(?:(only|not)?\s*([^\s()]+)(?:\s*and)?\s*)?(.+)?/i;
|
|
@@ -34,130 +33,115 @@ var RE_MQ_FEATURE = /^(?:(min|max)-)?(.+)/;
|
|
|
34
33
|
var RE_LENGTH_UNIT = /(em|rem|px|cm|mm|in|pt|pc)?$/;
|
|
35
34
|
var RE_RESOLUTION_UNIT = /(dpi|dpcm|dppx)?$/;
|
|
36
35
|
function matchQuery(mediaQuery, values) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return value === expValue;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
return expressionsMatch && !inverse || !expressionsMatch && inverse;
|
|
92
|
-
});
|
|
36
|
+
return parseQuery(mediaQuery).some(function(query) {
|
|
37
|
+
if (!query) return;
|
|
38
|
+
var inverse = query.inverse;
|
|
39
|
+
var typeMatch = query.type === "all" || values.type === query.type;
|
|
40
|
+
if (typeMatch && inverse || !(typeMatch || inverse)) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
var expressionsMatch = query.expressions.every(function(expression) {
|
|
44
|
+
var feature = expression.feature;
|
|
45
|
+
var modifier = expression.modifier;
|
|
46
|
+
var expValue = expression.value;
|
|
47
|
+
var value = values[feature];
|
|
48
|
+
if (!value) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
switch (feature) {
|
|
52
|
+
case "orientation":
|
|
53
|
+
case "scan": return value.toLowerCase() === expValue.toLowerCase();
|
|
54
|
+
case "width":
|
|
55
|
+
case "height":
|
|
56
|
+
case "device-width":
|
|
57
|
+
case "device-height":
|
|
58
|
+
expValue = toPx(expValue);
|
|
59
|
+
value = toPx(value);
|
|
60
|
+
break;
|
|
61
|
+
case "resolution":
|
|
62
|
+
expValue = toDpi(expValue);
|
|
63
|
+
value = toDpi(value);
|
|
64
|
+
break;
|
|
65
|
+
case "aspect-ratio":
|
|
66
|
+
case "device-aspect-ratio":
|
|
67
|
+
case "device-pixel-ratio":
|
|
68
|
+
expValue = toDecimal(expValue);
|
|
69
|
+
value = toDecimal(value);
|
|
70
|
+
break;
|
|
71
|
+
case "grid":
|
|
72
|
+
case "color":
|
|
73
|
+
case "color-index":
|
|
74
|
+
case "monochrome":
|
|
75
|
+
expValue = Number.parseInt(expValue, 10) || 1;
|
|
76
|
+
value = Number.parseInt(value, 10) || 0;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
switch (modifier) {
|
|
80
|
+
case "min": return value >= expValue;
|
|
81
|
+
case "max": return value <= expValue;
|
|
82
|
+
default: return value === expValue;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return expressionsMatch && !inverse || !expressionsMatch && inverse;
|
|
86
|
+
});
|
|
93
87
|
}
|
|
94
88
|
function parseQuery(mediaQuery) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
89
|
+
return mediaQuery.split(",").map(function(query) {
|
|
90
|
+
query = query.trim();
|
|
91
|
+
var captures = query.match(RE_MEDIA_QUERY);
|
|
92
|
+
if (!captures) return null;
|
|
93
|
+
var modifier = captures[1];
|
|
94
|
+
var type = captures[2];
|
|
95
|
+
var expressionsCapture = captures[3] || "";
|
|
96
|
+
var expressions = expressionsCapture.match(/\([^)]+\)/g) || [];
|
|
97
|
+
return {
|
|
98
|
+
inverse: !!modifier && modifier.toLowerCase() === "not",
|
|
99
|
+
type: type ? type.toLowerCase() : "all",
|
|
100
|
+
expressions: expressions.map(function(expression) {
|
|
101
|
+
var captures2 = expression.match(RE_MQ_EXPRESSION);
|
|
102
|
+
var feature = captures2[1].toLowerCase().match(RE_MQ_FEATURE);
|
|
103
|
+
return {
|
|
104
|
+
modifier: feature[1],
|
|
105
|
+
feature: feature[2],
|
|
106
|
+
value: captures2[2]
|
|
107
|
+
};
|
|
108
|
+
})
|
|
109
|
+
};
|
|
110
|
+
});
|
|
117
111
|
}
|
|
118
112
|
function toDecimal(ratio) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
113
|
+
var decimal = Number(ratio);
|
|
114
|
+
var numbers;
|
|
115
|
+
if (!decimal) {
|
|
116
|
+
numbers = ratio.match(/^(\d+)\s*\/\s*(\d+)$/);
|
|
117
|
+
decimal = numbers[1] / numbers[2];
|
|
118
|
+
}
|
|
119
|
+
return decimal;
|
|
126
120
|
}
|
|
127
121
|
function toDpi(resolution) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
default:
|
|
137
|
-
return value;
|
|
138
|
-
}
|
|
122
|
+
var _String_match;
|
|
123
|
+
var value = Number.parseFloat(resolution);
|
|
124
|
+
var units = (_String_match = String(resolution).match(RE_RESOLUTION_UNIT)) === null || _String_match === void 0 ? void 0 : _String_match[1];
|
|
125
|
+
switch (units) {
|
|
126
|
+
case "dpcm": return value / 2.54;
|
|
127
|
+
case "dppx": return value * 96;
|
|
128
|
+
default: return value;
|
|
129
|
+
}
|
|
139
130
|
}
|
|
140
131
|
function toPx(length) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return value * 96;
|
|
155
|
-
case "pt":
|
|
156
|
-
return value * 72;
|
|
157
|
-
case "pc":
|
|
158
|
-
return value * 72 / 12;
|
|
159
|
-
default:
|
|
160
|
-
return value;
|
|
161
|
-
}
|
|
132
|
+
var _String_match;
|
|
133
|
+
var value = Number.parseFloat(length);
|
|
134
|
+
var units = (_String_match = String(length).match(RE_LENGTH_UNIT)) === null || _String_match === void 0 ? void 0 : _String_match[1];
|
|
135
|
+
switch (units) {
|
|
136
|
+
case "em": return value * 16;
|
|
137
|
+
case "rem": return value * 16;
|
|
138
|
+
case "cm": return value * 96 / 2.54;
|
|
139
|
+
case "mm": return value * 96 / 2.54 / 10;
|
|
140
|
+
case "in": return value * 96;
|
|
141
|
+
case "pt": return value * 72;
|
|
142
|
+
case "pc": return value * 72 / 12;
|
|
143
|
+
default: return value;
|
|
144
|
+
}
|
|
162
145
|
}
|
|
146
|
+
|
|
163
147
|
//# sourceMappingURL=matchQuery.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"matchQuery.native.js","names":[],"sources":["cjs/matchQuery.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar matchQuery_exports = {};\n__export(matchQuery_exports, {\n matchQuery: () => matchQuery,\n parseQuery: () => parseQuery\n});\nmodule.exports = __toCommonJS(matchQuery_exports);\nvar RE_MEDIA_QUERY = /(?:(only|not)?\\s*([^\\s()]+)(?:\\s*and)?\\s*)?(.+)?/i;\nvar RE_MQ_EXPRESSION = /\\(\\s*([^\\s:)]+)\\s*(?::\\s*([^\\s)]+))?\\s*\\)/;\nvar RE_MQ_FEATURE = /^(?:(min|max)-)?(.+)/;\nvar RE_LENGTH_UNIT = /(em|rem|px|cm|mm|in|pt|pc)?$/;\nvar RE_RESOLUTION_UNIT = /(dpi|dpcm|dppx)?$/;\nfunction matchQuery(mediaQuery, values) {\n return parseQuery(mediaQuery).some(function(query) {\n if (!query) return;\n var inverse = query.inverse;\n var typeMatch = query.type === \"all\" || values.type === query.type;\n if (typeMatch && inverse || !(typeMatch || inverse)) {\n return false;\n }\n var expressionsMatch = query.expressions.every(function(expression) {\n var feature = expression.feature;\n var modifier = expression.modifier;\n var expValue = expression.value;\n var value = values[feature];\n if (!value) {\n return false;\n }\n switch (feature) {\n case \"orientation\":\n case \"scan\":\n return value.toLowerCase() === expValue.toLowerCase();\n case \"width\":\n case \"height\":\n case \"device-width\":\n case \"device-height\":\n expValue = toPx(expValue);\n value = toPx(value);\n break;\n case \"resolution\":\n expValue = toDpi(expValue);\n value = toDpi(value);\n break;\n case \"aspect-ratio\":\n case \"device-aspect-ratio\":\n case /* Deprecated */\n \"device-pixel-ratio\":\n expValue = toDecimal(expValue);\n value = toDecimal(value);\n break;\n case \"grid\":\n case \"color\":\n case \"color-index\":\n case \"monochrome\":\n expValue = Number.parseInt(expValue, 10) || 1;\n value = Number.parseInt(value, 10) || 0;\n break;\n }\n switch (modifier) {\n case \"min\":\n return value >= expValue;\n case \"max\":\n return value <= expValue;\n default:\n return value === expValue;\n }\n });\n return expressionsMatch && !inverse || !expressionsMatch && inverse;\n });\n}\nfunction parseQuery(mediaQuery) {\n return mediaQuery.split(\",\").map(function(query) {\n query = query.trim();\n var captures = query.match(RE_MEDIA_QUERY);\n if (!captures) return null;\n var modifier = captures[1];\n var type = captures[2];\n var expressionsCapture = captures[3] || \"\";\n var expressions = expressionsCapture.match(/\\([^)]+\\)/g) || [];\n return {\n inverse: !!modifier && modifier.toLowerCase() === \"not\",\n type: type ? type.toLowerCase() : \"all\",\n expressions: expressions.map(function(expression) {\n var captures2 = expression.match(RE_MQ_EXPRESSION);\n var feature = captures2[1].toLowerCase().match(RE_MQ_FEATURE);\n return {\n modifier: feature[1],\n feature: feature[2],\n value: captures2[2]\n };\n })\n };\n });\n}\nfunction toDecimal(ratio) {\n var decimal = Number(ratio);\n var numbers;\n if (!decimal) {\n numbers = ratio.match(/^(\\d+)\\s*\\/\\s*(\\d+)$/);\n decimal = numbers[1] / numbers[2];\n }\n return decimal;\n}\nfunction toDpi(resolution) {\n var _String_match;\n var value = Number.parseFloat(resolution);\n var units = (_String_match = String(resolution).match(RE_RESOLUTION_UNIT)) === null || _String_match === void 0 ? void 0 : _String_match[1];\n switch (units) {\n case \"dpcm\":\n return value / 2.54;\n case \"dppx\":\n return value * 96;\n default:\n return value;\n }\n}\nfunction toPx(length) {\n var _String_match;\n var value = Number.parseFloat(length);\n var units = (_String_match = String(length).match(RE_LENGTH_UNIT)) === null || _String_match === void 0 ? void 0 : _String_match[1];\n switch (units) {\n case \"em\":\n return value * 16;\n case \"rem\":\n return value * 16;\n case \"cm\":\n return value * 96 / 2.54;\n case \"mm\":\n return value * 96 / 2.54 / 10;\n case \"in\":\n return value * 96;\n case \"pt\":\n return value * 72;\n case \"pc\":\n return value * 72 / 12;\n default:\n return value;\n }\n}\n//# sourceMappingURL=matchQuery.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,qBAAqB,CAAC;AAC1B,SAAS,oBAAoB;CAC3B,kBAAkB;CAClB,kBAAkB;AACpB,CAAC;AACD,OA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K,IAAI,KAAK,IAAI,cAAc;CACjI,QAAQ,OAAR;EACE,KAAK,MACH,OAAO,QAAQ;EACjB,KAAK,OACH,OAAO,QAAQ;EACjB,KAAK,MACH,OAAO,QAAQ,KAAK;EACtB,KAAK,MACH,OAAO,QAAQ,KAAK,OAAO;EAC7B,KAAK,MACH,OAAO,QAAQ;EACjB,KAAK,MACH,OAAO,QAAQ;EACjB,KAAK,MACH,OAAO,QAAQ,KAAK;EACtB,SACE,OAAO;CACX;AACF"}
|
|
@@ -1,78 +1,114 @@
|
|
|
1
|
+
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
6
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
10
11
|
};
|
|
11
12
|
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
19
20
|
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: true
|
|
22
|
-
}), mod);
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
22
|
var mediaQueryList_exports = {};
|
|
24
|
-
__export(mediaQueryList_exports, {
|
|
25
|
-
NativeMediaQueryList: () => NativeMediaQueryList
|
|
26
|
-
});
|
|
23
|
+
__export(mediaQueryList_exports, { NativeMediaQueryList: () => NativeMediaQueryList });
|
|
27
24
|
module.exports = __toCommonJS(mediaQueryList_exports);
|
|
28
25
|
var import_react_native = require("react-native-web");
|
|
29
26
|
var import_matchQuery = require("./matchQuery.cjs");
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
27
|
+
const REDUCED_MOTION_RE = /\(\s*prefers-reduced-motion\s*:\s*([a-z-]+)\s*\)/i;
|
|
28
|
+
let reducedMotionEnabled = false;
|
|
29
|
+
let reducedMotionInitialized = false;
|
|
30
|
+
const reducedMotionListeners = /* @__PURE__ */ new Set();
|
|
31
|
+
function ensureReducedMotionSubscription() {
|
|
32
|
+
if (reducedMotionInitialized) return;
|
|
33
|
+
reducedMotionInitialized = true;
|
|
34
|
+
import_react_native.AccessibilityInfo.isReduceMotionEnabled?.().then((value) => {
|
|
35
|
+
if (value !== reducedMotionEnabled) {
|
|
36
|
+
reducedMotionEnabled = value;
|
|
37
|
+
reducedMotionListeners.forEach((cb) => cb());
|
|
38
|
+
}
|
|
39
|
+
}).catch(() => {});
|
|
40
|
+
import_react_native.AccessibilityInfo.addEventListener?.("reduceMotionChanged", (value) => {
|
|
41
|
+
if (value === reducedMotionEnabled) return;
|
|
42
|
+
reducedMotionEnabled = value;
|
|
43
|
+
reducedMotionListeners.forEach((cb) => cb());
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
var NativeMediaQueryList = class {
|
|
47
|
+
constructor(query) {
|
|
48
|
+
this.query = query;
|
|
49
|
+
const reducedMotionMatch = query.match(REDUCED_MOTION_RE);
|
|
50
|
+
if (reducedMotionMatch) {
|
|
51
|
+
this.reducedMotionExpected = reducedMotionMatch[1];
|
|
52
|
+
ensureReducedMotionSubscription();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
this.notify();
|
|
56
|
+
import_react_native.Dimensions.addEventListener("change", () => {
|
|
57
|
+
this.notify();
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
query;
|
|
61
|
+
listeners = [];
|
|
62
|
+
reducedMotionExpected = null;
|
|
63
|
+
get orientation() {
|
|
64
|
+
const windowDimensions = import_react_native.Dimensions.get("window");
|
|
65
|
+
return windowDimensions.height > windowDimensions.width ? "portrait" : "landscape";
|
|
66
|
+
}
|
|
67
|
+
notify() {
|
|
68
|
+
this.listeners.forEach((listener) => {
|
|
69
|
+
listener();
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
addListener(listener) {
|
|
73
|
+
if (this.reducedMotionExpected) {
|
|
74
|
+
reducedMotionListeners.add(listener);
|
|
75
|
+
this.listeners.push(listener);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
this.listeners.push(listener);
|
|
79
|
+
}
|
|
80
|
+
removeListener(listener) {
|
|
81
|
+
if (this.reducedMotionExpected) {
|
|
82
|
+
reducedMotionListeners.delete(listener);
|
|
83
|
+
}
|
|
84
|
+
const index = this.listeners.indexOf(listener);
|
|
85
|
+
if (index !== -1) this.listeners.splice(index, 1);
|
|
86
|
+
}
|
|
87
|
+
match(query, { width, height }) {
|
|
88
|
+
const reducedMotionMatch = query.match(REDUCED_MOTION_RE);
|
|
89
|
+
if (reducedMotionMatch) {
|
|
90
|
+
const expected = reducedMotionMatch[1];
|
|
91
|
+
return expected === "reduce" ? reducedMotionEnabled : !reducedMotionEnabled;
|
|
92
|
+
}
|
|
93
|
+
return (0, import_matchQuery.matchQuery)(query, {
|
|
94
|
+
type: "screen",
|
|
95
|
+
orientation: height > width ? "portrait" : "landscape",
|
|
96
|
+
"device-width": width,
|
|
97
|
+
"device-height": height
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
get matches() {
|
|
101
|
+
if (this.reducedMotionExpected) {
|
|
102
|
+
return this.reducedMotionExpected === "reduce" ? reducedMotionEnabled : !reducedMotionEnabled;
|
|
103
|
+
}
|
|
104
|
+
const windowDimensions = import_react_native.Dimensions.get("window");
|
|
105
|
+
const matches = (0, import_matchQuery.matchQuery)(this.query, {
|
|
106
|
+
type: "screen",
|
|
107
|
+
orientation: this.orientation,
|
|
108
|
+
...windowDimensions,
|
|
109
|
+
"device-width": windowDimensions.width,
|
|
110
|
+
"device-height": windowDimensions.height
|
|
111
|
+
});
|
|
112
|
+
return matches;
|
|
113
|
+
}
|
|
114
|
+
};
|