Skip to content

Commit

Permalink
deploy: 9c7bbd1
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 14, 2024
1 parent 58a4049 commit 2b1505c
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 16 deletions.
4 changes: 4 additions & 0 deletions assets/index-DRundNpP.css → assets/index-DyvJo6T7.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
103 changes: 91 additions & 12 deletions assets/index-B3xfWiYm.js → assets/index-GL9krXpV.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand All @@ -131051,25 +131101,50 @@ 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,
encoding: Encoding.UTF8
});
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);
}
Expand Down Expand Up @@ -131177,15 +131252,17 @@ function Frame({ selectedFolderURL, setSelectedFolderURL }) {
selectedFolderURL,
items: itemsRef.current,
setItems,
setIsLoading
setIsLoading,
selection: selection2,
setItem
});
}
}
document.addEventListener("visibilitychange", change);
return () => {
document.removeEventListener("visibilitychange", change);
};
}, [currentRevisionRef, selectedFolderURL, setItem]);
}, [currentRevisionRef, selectedFolderURL, setItem, selection2]);
if (!selection2.length) {
return null;
}
Expand Down Expand Up @@ -131298,7 +131375,9 @@ function Frame({ selectedFolderURL, setSelectedFolderURL }) {
selectedFolderURL,
items: itemsRef.current,
setItems,
setIsLoading
setIsLoading,
selection: selection2,
setItem
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion assets/web-mdPnE2pf.js → assets/web-DSFZ-96h.js
Original file line number Diff line number Diff line change
@@ -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 = [];
Expand Down
2 changes: 1 addition & 1 deletion assets/web-BR4Loxpx.js → assets/web-DWm8f35Z.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<link rel="icon" href="/assets/android-chrome-192x192-Du3u38rl.png" sizes="192x192" />
<link rel="apple-touch-icon" href="/assets/apple-touch-icon-Bi5UWSX_.png" />
<meta name="theme-color" content="#fff" />
<script type="module" crossorigin src="/assets/index-B3xfWiYm.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DRundNpP.css">
<script type="module" crossorigin src="/assets/index-GL9krXpV.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DyvJo6T7.css">
</head>
<body>
<div id="app"></div>
Expand Down

0 comments on commit 2b1505c

Please sign in to comment.