seitu 0.4.4 → 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 +5 -8
- 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,15 +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 = typeof window > "u" ? null : window.matchMedia(e.query), a = () => i?.matches ?? e.defaultMatches ?? !1;
|
|
106
|
-
return i?.addEventListener("change",
|
|
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
107
|
get: a,
|
|
108
|
-
subscribe: (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return i.addEventListener("change", o), () => {
|
|
112
|
-
r(), i.removeEventListener("change", o);
|
|
113
|
-
};
|
|
108
|
+
subscribe: (e) => t(() => e(a())),
|
|
109
|
+
destroy: () => {
|
|
110
|
+
i?.removeEventListener("change", o);
|
|
114
111
|
},
|
|
115
112
|
"~": {
|
|
116
113
|
output: null,
|