seitu 0.4.3 → 0.4.5
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/web/media-query.d.ts +2 -2
- package/dist/web.js +6 -16
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Readable, Subscribable } from '../core/index';
|
|
2
|
-
export interface MediaQuery extends Subscribable<boolean>, Readable<boolean
|
|
1
|
+
import type { Destroyable, Readable, Subscribable } from '../core/index';
|
|
2
|
+
export interface MediaQuery extends Subscribable<boolean>, Readable<boolean>, Destroyable {
|
|
3
3
|
}
|
|
4
4
|
type MinMaxPrefix = 'min-' | 'max-' | '';
|
|
5
5
|
type CSSUnitSuffix = 'px' | 'em' | 'rem' | 'vw' | 'vh' | 'dvw' | 'dvh' | 'svw' | 'svh' | 'lvw' | 'lvh' | 'cqw' | 'cqh' | 'vmin' | 'vmax' | 'cm' | 'mm' | 'in' | 'pt' | 'pc';
|
package/dist/web.js
CHANGED
|
@@ -102,22 +102,12 @@ function o(e) {
|
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/web/media-query.ts
|
|
104
104
|
function s(e) {
|
|
105
|
-
let { subscribe: t, notify: r } = n(), i = () =>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
return {
|
|
114
|
-
get: i,
|
|
115
|
-
subscribe: (n) => {
|
|
116
|
-
if (typeof window > "u") return n(i()), () => {};
|
|
117
|
-
let r = t(() => n(i())), a = window.matchMedia(e.query), o = () => n(i());
|
|
118
|
-
return a.addEventListener("change", o), () => {
|
|
119
|
-
r(), a.removeEventListener("change", o);
|
|
120
|
-
};
|
|
105
|
+
let { subscribe: t, notify: r } = n(), i = typeof window > "u" ? null : window.matchMedia(e.query), a = () => i?.matches ?? e.defaultMatches ?? !1, o = () => r();
|
|
106
|
+
return i?.addEventListener("change", o), {
|
|
107
|
+
get: a,
|
|
108
|
+
subscribe: (e) => t(() => e(a())),
|
|
109
|
+
destroy: () => {
|
|
110
|
+
i?.removeEventListener("change", o);
|
|
121
111
|
},
|
|
122
112
|
"~": {
|
|
123
113
|
output: null,
|