feat: init frontend
This commit is contained in:
@ -0,0 +1,42 @@
|
||||
import { g as getContext, c as create_ssr_component, a as subscribe, e as escape } from "../../chunks/ssr.js";
|
||||
import "../../chunks/exports.js";
|
||||
function get(key, parse = JSON.parse) {
|
||||
try {
|
||||
return parse(sessionStorage[key]);
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
const SNAPSHOT_KEY = "sveltekit:snapshot";
|
||||
const SCROLL_KEY = "sveltekit:scroll";
|
||||
get(SCROLL_KEY) ?? {};
|
||||
get(SNAPSHOT_KEY) ?? {};
|
||||
const getStores = () => {
|
||||
const stores = getContext("__svelte__");
|
||||
return {
|
||||
/** @type {typeof page} */
|
||||
page: {
|
||||
subscribe: stores.page.subscribe
|
||||
},
|
||||
/** @type {typeof navigating} */
|
||||
navigating: {
|
||||
subscribe: stores.navigating.subscribe
|
||||
},
|
||||
/** @type {typeof updated} */
|
||||
updated: stores.updated
|
||||
};
|
||||
};
|
||||
const page = {
|
||||
subscribe(fn) {
|
||||
const store = getStores().page;
|
||||
return store.subscribe(fn);
|
||||
}
|
||||
};
|
||||
const Error$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $page, $$unsubscribe_page;
|
||||
$$unsubscribe_page = subscribe(page, (value) => $page = value);
|
||||
$$unsubscribe_page();
|
||||
return `<h1>${escape($page.status)}</h1> <p>${escape($page.error?.message)}</p>`;
|
||||
});
|
||||
export {
|
||||
Error$1 as default
|
||||
};
|
@ -0,0 +1,7 @@
|
||||
import { c as create_ssr_component } from "../../chunks/ssr.js";
|
||||
const Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
});
|
||||
export {
|
||||
Layout as default
|
||||
};
|
Reference in New Issue
Block a user