intial
This commit is contained in:
103
node_modules/.vite/deps/svelte_reactivity_window.js
generated
vendored
Normal file
103
node_modules/.vite/deps/svelte_reactivity_window.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
import "./esm-env-D8Yi5ac9.js";
|
||||
import "./svelte_events.js";
|
||||
import { t as ReactiveValue } from "./reactive-value-BNDpYQtD.js";
|
||||
import { c as on } from "./events-21uQP6Br.js";
|
||||
import "./index-client-D0TavHuA.js";
|
||||
import { a as get, dt as set, ft as source, ln as tag } from "./runtime-BOFXI46e.js";
|
||||
// node_modules/svelte/src/reactivity/window/index.js
|
||||
/**
|
||||
* `scrollX.current` is a reactive view of `window.scrollX`. On the server it is `undefined`.
|
||||
* @since 5.11.0
|
||||
*/
|
||||
var scrollX = new ReactiveValue(() => window.scrollX, (update) => on(window, "scroll", update));
|
||||
/**
|
||||
* `scrollY.current` is a reactive view of `window.scrollY`. On the server it is `undefined`.
|
||||
* @since 5.11.0
|
||||
*/
|
||||
var scrollY = new ReactiveValue(() => window.scrollY, (update) => on(window, "scroll", update));
|
||||
/**
|
||||
* `innerWidth.current` is a reactive view of `window.innerWidth`. On the server it is `undefined`.
|
||||
* @since 5.11.0
|
||||
*/
|
||||
var innerWidth = new ReactiveValue(() => window.innerWidth, (update) => on(window, "resize", update));
|
||||
/**
|
||||
* `innerHeight.current` is a reactive view of `window.innerHeight`. On the server it is `undefined`.
|
||||
* @since 5.11.0
|
||||
*/
|
||||
var innerHeight = new ReactiveValue(() => window.innerHeight, (update) => on(window, "resize", update));
|
||||
/**
|
||||
* `outerWidth.current` is a reactive view of `window.outerWidth`. On the server it is `undefined`.
|
||||
* @since 5.11.0
|
||||
*/
|
||||
var outerWidth = new ReactiveValue(() => window.outerWidth, (update) => on(window, "resize", update));
|
||||
/**
|
||||
* `outerHeight.current` is a reactive view of `window.outerHeight`. On the server it is `undefined`.
|
||||
* @since 5.11.0
|
||||
*/
|
||||
var outerHeight = new ReactiveValue(() => window.outerHeight, (update) => on(window, "resize", update));
|
||||
/**
|
||||
* `screenLeft.current` is a reactive view of `window.screenLeft`. It is updated inside a `requestAnimationFrame` callback. On the server it is `undefined`.
|
||||
* @since 5.11.0
|
||||
*/
|
||||
var screenLeft = new ReactiveValue(() => window.screenLeft, (update) => {
|
||||
let value = window.screenLeft;
|
||||
let frame = requestAnimationFrame(function check() {
|
||||
frame = requestAnimationFrame(check);
|
||||
if (value !== (value = window.screenLeft)) update();
|
||||
});
|
||||
return () => {
|
||||
cancelAnimationFrame(frame);
|
||||
};
|
||||
});
|
||||
/**
|
||||
* `screenTop.current` is a reactive view of `window.screenTop`. It is updated inside a `requestAnimationFrame` callback. On the server it is `undefined`.
|
||||
* @since 5.11.0
|
||||
*/
|
||||
var screenTop = new ReactiveValue(() => window.screenTop, (update) => {
|
||||
let value = window.screenTop;
|
||||
let frame = requestAnimationFrame(function check() {
|
||||
frame = requestAnimationFrame(check);
|
||||
if (value !== (value = window.screenTop)) update();
|
||||
});
|
||||
return () => {
|
||||
cancelAnimationFrame(frame);
|
||||
};
|
||||
});
|
||||
/**
|
||||
* `online.current` is a reactive view of `navigator.onLine`. On the server it is `undefined`.
|
||||
* @since 5.11.0
|
||||
*/
|
||||
var online = new ReactiveValue(() => navigator.onLine, (update) => {
|
||||
const unsub_online = on(window, "online", update);
|
||||
const unsub_offline = on(window, "offline", update);
|
||||
return () => {
|
||||
unsub_online();
|
||||
unsub_offline();
|
||||
};
|
||||
});
|
||||
/**
|
||||
* `devicePixelRatio.current` is a reactive view of `window.devicePixelRatio`. On the server it is `undefined`.
|
||||
* Note that behaviour differs between browsers — on Chrome it will respond to the current zoom level,
|
||||
* on Firefox and Safari it won't.
|
||||
* @type {{ get current(): number | undefined }}
|
||||
* @since 5.11.0
|
||||
*/
|
||||
var devicePixelRatio = /* @__PURE__ */ new class DevicePixelRatio {
|
||||
#dpr = source(window.devicePixelRatio);
|
||||
#update() {
|
||||
const off = on(window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`), "change", () => {
|
||||
set(this.#dpr, window.devicePixelRatio);
|
||||
off();
|
||||
this.#update();
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
this.#update();
|
||||
tag(this.#dpr, "window.devicePixelRatio");
|
||||
}
|
||||
get current() {
|
||||
get(this.#dpr);
|
||||
return window.devicePixelRatio;
|
||||
}
|
||||
}();
|
||||
export { devicePixelRatio, innerHeight, innerWidth, online, outerHeight, outerWidth, screenLeft, screenTop, scrollX, scrollY };
|
||||
Reference in New Issue
Block a user