From 2b1505c237ad2d2d57afddc496f81f6790c4ff01 Mon Sep 17 00:00:00 2001 From: ellatrix Date: Sun, 14 Jul 2024 19:42:19 +0000 Subject: [PATCH] deploy: 9c7bbd1ba1cccd92159a0fc601744b522256595b --- ...{index-DRundNpP.css => index-DyvJo6T7.css} | 4 + .../{index-B3xfWiYm.js => index-GL9krXpV.js} | 103 ++++++++++++++++-- assets/{web-mdPnE2pf.js => web-DSFZ-96h.js} | 2 +- assets/{web-BR4Loxpx.js => web-DWm8f35Z.js} | 2 +- index.html | 4 +- 5 files changed, 99 insertions(+), 16 deletions(-) rename assets/{index-DRundNpP.css => index-DyvJo6T7.css} (99%) rename assets/{index-B3xfWiYm.js => index-GL9krXpV.js} (99%) rename assets/{web-mdPnE2pf.js => web-DSFZ-96h.js} (99%) rename assets/{web-BR4Loxpx.js => web-DWm8f35Z.js} (97%) diff --git a/assets/index-DRundNpP.css b/assets/index-DyvJo6T7.css similarity index 99% rename from assets/index-DRundNpP.css rename to assets/index-DyvJo6T7.css index 051d014..a636291 100644 --- a/assets/index-DRundNpP.css +++ b/assets/index-DyvJo6T7.css @@ -9158,6 +9158,10 @@ body, font-size: 1em; } +.components-popover.is-expanded { + top: env(safe-area-inset-top); +} + #sidebar { position: absolute; top: env(safe-area-inset-top); diff --git a/assets/index-B3xfWiYm.js b/assets/index-GL9krXpV.js similarity index 99% rename from assets/index-B3xfWiYm.js rename to assets/index-GL9krXpV.js index a4cf150..aabdf50 100644 --- a/assets/index-B3xfWiYm.js +++ b/assets/index-GL9krXpV.js @@ -658,7 +658,7 @@ var Encoding; Encoding2["UTF16"] = "utf16"; })(Encoding || (Encoding = {})); const Filesystem = registerPlugin$1("Filesystem", { - web: () => __vitePreload(() => import("./web-mdPnE2pf.js"), true ? [] : void 0).then((m2) => new m2.FilesystemWeb()) + web: () => __vitePreload(() => import("./web-DSFZ-96h.js"), true ? [] : void 0).then((m2) => new m2.FilesystemWeb()) }); /*! Capacitor: https://capacitorjs.com/ - MIT License */ const createCapacitorPlatforms = (win) => { @@ -1181,7 +1181,7 @@ registerPlugin("CapacitorHttp", { web: () => new CapacitorHttpPluginWeb2() }); const Preferences = registerPlugin("Preferences", { - web: () => __vitePreload(() => import("./web-BR4Loxpx.js"), true ? [] : void 0).then((m2) => new m2.PreferencesWeb()) + web: () => __vitePreload(() => import("./web-DWm8f35Z.js"), true ? [] : void 0).then((m2) => new m2.PreferencesWeb()) }); function promisifyRequest(request) { return new Promise((resolve2, reject) => { @@ -128215,7 +128215,50 @@ div.components-toolbar > div + div.has-left-divider::before { .components-tooltip__shortcut { margin-left: 8px; }`; -const contentStyle = 'body {\n background: var(--wp-components-color-background);\n color: var(--wp-components-color-foreground);\n max-width: 600px;\n margin: 100px auto;\n font-family: Hoefler Text;\n font-size: 20px;\n padding: 1px 1em;\n}\n\na {\n color: var(--wp-components-color-accent);\n}\n\n[data-type="core/checklist"] {\n /* padding-left: 0; */\n}\n\n[data-type="core/checklist-item"] {\n margin-top: 5px;\n}\n\n[data-type="core/checklist-item"] .components-checkbox-control__input[type=checkbox]:indeterminate {\n filter: grayscale(1);\n}\n\n[data-type="core/checklist-item"] .components-checkbox-control__input[type=checkbox]:indeterminate + svg {\n filter: grayscale(1);\n}\n\n[data-type="core/checklist-item"] > .components-checkbox-control {\n position: absolute;\n transform: translate(-100%);\n top: 0;\n}'; +const contentStyle = `body { + background: var(--wp-components-color-background); + color: var(--wp-components-color-foreground); + max-width: 600px; + margin: 100px auto; + font-family: Hoefler Text; + font-size: 20px; + padding: 1px 1em; +} + +/* Disable scrollbars, there's a glitch in Safari with the content animation. */ +* { + scrollbar-width: none; +} + +*::-webkit-scrollbar { + display: none; +} + +a { + color: var(--wp-components-color-accent); +} + +[data-type="core/checklist"] { + /* padding-left: 0; */ +} + +[data-type="core/checklist-item"] { + margin-top: 5px; +} + +[data-type="core/checklist-item"] .components-checkbox-control__input[type=checkbox]:indeterminate { + filter: grayscale(1); +} + +[data-type="core/checklist-item"] .components-checkbox-control__input[type=checkbox]:indeterminate + svg { + filter: grayscale(1); +} + +[data-type="core/checklist-item"] > .components-checkbox-control { + position: absolute; + transform: translate(-100%); + top: 0; +}`; const contentStyles = [ componentsStyle, blockLibraryContentStyle, @@ -131037,7 +131080,14 @@ function getInitialSelection({ path, blocks: blocks2 }) { }; return { selectionStart: sel, selectionEnd: sel }; } -async function refresh({ selectedFolderURL, items, setItems, setIsLoading }) { +async function refresh({ + selectedFolderURL, + items, + setItems, + setIsLoading, + selection: selection2, + setItem +}) { setIsLoading(true); try { const _paths = await getPaths("", selectedFolderURL); @@ -131051,7 +131101,14 @@ async function refresh({ selectedFolderURL, items, setItems, setIsLoading }) { tags: [] }; }); - for (const pathObject of pathObjects) { + for (const id2 of selection2) { + const pathObject = pathObjects.find((item2) => item2.id === id2); + const previousState = items.find( + (item2) => item2.id === pathObject.id + ); + if (!previousState || !previousState.blocks) { + continue; + } const __file = await Filesystem.readFile({ path: pathObject.path, directory: selectedFolderURL, @@ -131059,17 +131116,35 @@ async function refresh({ selectedFolderURL, items, setItems, setIsLoading }) { }); pathObject.text = __file.data; pathObject.tags = getTagsFromText(__file.data); - const previousState = items.find( - (item2) => item2.id === pathObject.id - ); - if (pathObject.text === (previousState == null ? void 0 : previousState.text)) { + if (pathObject.text === previousState.text) { pathObject.blocks = previousState.blocks; } } const unsaved = items.filter((item2) => !item2.path); setItems([...unsaved, ...pathObjects]); + queueMicrotask(async () => { + const nonSelectedPaths = pathObjects.filter( + (obj2) => !selection2.includes(obj2.id) + ); + const updates = /* @__PURE__ */ new Map(); + for (const item2 of nonSelectedPaths) { + const __file = await Filesystem.readFile({ + path: item2.path, + directory: selectedFolderURL, + encoding: Encoding.UTF8 + }); + updates.set(item2.id, { + text: __file.data, + tags: getTagsFromText(__file.data) + }); + } + for (const [id2, _update] of updates) { + setItem(id2, _update); + } + }); } catch (error5) { window.alert(error5); + setIsLoading(false); } finally { setIsLoading(false); } @@ -131177,7 +131252,9 @@ function Frame({ selectedFolderURL, setSelectedFolderURL }) { selectedFolderURL, items: itemsRef.current, setItems, - setIsLoading + setIsLoading, + selection: selection2, + setItem }); } } @@ -131185,7 +131262,7 @@ function Frame({ selectedFolderURL, setSelectedFolderURL }) { return () => { document.removeEventListener("visibilitychange", change); }; - }, [currentRevisionRef, selectedFolderURL, setItem]); + }, [currentRevisionRef, selectedFolderURL, setItem, selection2]); if (!selection2.length) { return null; } @@ -131298,7 +131375,9 @@ function Frame({ selectedFolderURL, setSelectedFolderURL }) { selectedFolderURL, items: itemsRef.current, setItems, - setIsLoading + setIsLoading, + selection: selection2, + setItem }); } } diff --git a/assets/web-mdPnE2pf.js b/assets/web-DSFZ-96h.js similarity index 99% rename from assets/web-mdPnE2pf.js rename to assets/web-DSFZ-96h.js index 64ca854..6bd3260 100644 --- a/assets/web-mdPnE2pf.js +++ b/assets/web-DSFZ-96h.js @@ -1,4 +1,4 @@ -import { W as WebPlugin, E as Encoding } from "./index-B3xfWiYm.js"; +import { W as WebPlugin, E as Encoding } from "./index-GL9krXpV.js"; function resolve(path) { const posix = path.split("/").filter((item) => item !== "."); const newPosix = []; diff --git a/assets/web-BR4Loxpx.js b/assets/web-DWm8f35Z.js similarity index 97% rename from assets/web-BR4Loxpx.js rename to assets/web-DWm8f35Z.js index 3f24ce2..db90394 100644 --- a/assets/web-BR4Loxpx.js +++ b/assets/web-DWm8f35Z.js @@ -1,4 +1,4 @@ -import { a as WebPlugin } from "./index-B3xfWiYm.js"; +import { a as WebPlugin } from "./index-GL9krXpV.js"; class PreferencesWeb extends WebPlugin { constructor() { super(...arguments); diff --git a/index.html b/index.html index 872d0cd..220bcd4 100644 --- a/index.html +++ b/index.html @@ -13,8 +13,8 @@ - - + +