vault backup: 2026-03-02 09:41:52

This commit is contained in:
2026-03-02 09:41:52 -05:00
parent 944192ae4c
commit 0b1e03a803
23 changed files with 1651 additions and 16178 deletions
+622 -45
View File
@@ -10732,6 +10732,48 @@ var import_obsidian2 = require("obsidian");
// src/repositoryConnection/RepositoryConnection.ts // src/repositoryConnection/RepositoryConnection.ts
var import_js_logger = __toESM(require_logger()); var import_js_logger = __toESM(require_logger());
// src/forestry/LimitReachedError.ts
var LimitReachedError = class extends Error {
constructor(errorType, responseData) {
var _a2;
const message = (_a2 = responseData.message) != null ? _a2 : "Usage limit reached";
super(message);
this.name = "LimitReachedError";
this.errorType = errorType;
this.buildsUsed = responseData.builds_used;
this.monthlyLimit = responseData.monthly_limit;
this.starterCreditsRemaining = responseData.starter_credits_remaining;
}
};
function throwIfLimitError(error) {
if (error && typeof error === "object" && "status" in error && error.status === 403) {
const responseData = extractResponseData(error);
if (!responseData) return;
const errorType = responseData.error;
if (errorType === "build_limit_reached" || errorType === "storage_limit_exceeded") {
throw new LimitReachedError(errorType, responseData);
}
}
}
function extractResponseData(error) {
const err = error;
if (err.response && typeof err.response === "object") {
const response = err.response;
if (response.data && typeof response.data === "object") {
return response.data;
}
}
if (err.response && typeof err.response === "object") {
const resp = err.response;
if (resp.data && typeof resp.data === "object") {
return resp.data;
}
}
return null;
}
// src/repositoryConnection/RepositoryConnection.ts
var logger = import_js_logger.default.get("repository-connection"); var logger = import_js_logger.default.get("repository-connection");
var IMAGE_PATH_BASE = "src/site/"; var IMAGE_PATH_BASE = "src/site/";
var NOTE_PATH_BASE = "src/site/notes/"; var NOTE_PATH_BASE = "src/site/notes/";
@@ -10823,6 +10865,7 @@ var RepositoryConnection = class {
); );
return result; return result;
} catch (error) { } catch (error) {
throwIfLimitError(error);
logger.error(error); logger.error(error);
return false; return false;
} }
@@ -10875,6 +10918,7 @@ var RepositoryConnection = class {
payload payload
); );
} catch (error) { } catch (error) {
throwIfLimitError(error);
logger.error(error); logger.error(error);
} }
}); });
@@ -10973,6 +11017,7 @@ var RepositoryConnection = class {
sha: blob.data.sha sha: blob.data.sha
}; };
} catch (error) { } catch (error) {
throwIfLimitError(error);
logger.error(error); logger.error(error);
} }
})); }));
@@ -11002,6 +11047,7 @@ var RepositoryConnection = class {
sha: blob.data.sha sha: blob.data.sha
}; };
} catch (error) { } catch (error) {
throwIfLimitError(error);
logger.error(error); logger.error(error);
} }
})); }));
@@ -12902,7 +12948,8 @@ var CanvasCompiler = class {
node, node,
baseStyle, baseStyle,
colorClass, colorClass,
file file,
assets
); );
case "file": case "file":
return yield this.buildFileNode( return yield this.buildFileNode(
@@ -12927,7 +12974,7 @@ var CanvasCompiler = class {
} }
}); });
} }
buildTextNode(node, baseStyle, colorClass, file) { buildTextNode(node, baseStyle, colorClass, file, assets) {
return __async(this, null, function* () { return __async(this, null, function* () {
var _a2; var _a2;
let processedText = node.text; let processedText = node.text;
@@ -12935,7 +12982,8 @@ var CanvasCompiler = class {
try { try {
processedText = yield this.textNodeProcessor.processTextNodeContent( processedText = yield this.textNodeProcessor.processTextNodeContent(
file, file,
node.text node.text,
assets
); );
} catch (e) { } catch (e) {
console.error("Error processing canvas text node:", e); console.error("Error processing canvas text node:", e);
@@ -12955,6 +13003,45 @@ var CanvasCompiler = class {
} }
buildFileNode(node, baseStyle, colorClass, file, assets) { buildFileNode(node, baseStyle, colorClass, file, assets) {
return __async(this, null, function* () { return __async(this, null, function* () {
const isPdf = /\.pdf$/i.test(node.file);
if (isPdf) {
const linkedFile = this.metadataCache.getFirstLinkpathDest(
(0, import_obsidian4.getLinkpath)(node.file),
file.getPath()
);
if (linkedFile) {
try {
const pdfData = yield this.vault.readBinary(linkedFile);
const pdfBase64 = arrayBufferToBase64(pdfData);
const pdfPath2 = `/img/user/${linkedFile.path}`;
assets.push({
path: pdfPath2,
content: pdfBase64,
localHash: generateBlobHashFromBase64(pdfBase64)
});
return `<div class="canvas-node canvas-node-file canvas-node-pdf ${colorClass}" data-node-id="${node.id}" style="${baseStyle}">
<div class="canvas-node-container">
<div class="canvas-node-content">
<iframe src="${encodeURI(
pdfPath2
)}" class="canvas-pdf-iframe" loading="lazy" style="width:100%;height:100%;border:none;"></iframe>
</div>
</div>
</div>`;
} catch (e) {
console.error("Error reading canvas PDF:", e);
}
}
const resolvedPath = (linkedFile == null ? void 0 : linkedFile.path) || node.file;
const pdfPath = encodeURI(`/img/user/${resolvedPath}`);
return `<div class="canvas-node canvas-node-file canvas-node-pdf ${colorClass}" data-node-id="${node.id}" style="${baseStyle}">
<div class="canvas-node-container">
<div class="canvas-node-content">
<iframe src="${pdfPath}" class="canvas-pdf-iframe" loading="lazy" style="width:100%;height:100%;border:none;"></iframe>
</div>
</div>
</div>`;
}
const isImage = /\.(png|jpg|jpeg|gif|webp|svg)$/i.test(node.file); const isImage = /\.(png|jpg|jpeg|gif|webp|svg)$/i.test(node.file);
if (isImage) { if (isImage) {
const linkedFile = this.metadataCache.getFirstLinkpathDest( const linkedFile = this.metadataCache.getFirstLinkpathDest(
@@ -19415,6 +19502,18 @@ var GardenPageCompiler = class {
linkedFileName = headerSplit[0]; linkedFileName = headerSplit[0];
headerPath = headerSplit.length > 1 ? `#${headerSplit[1]}` : ""; headerPath = headerSplit.length > 1 ? `#${headerSplit[1]}` : "";
} }
if (linkedFileName === "" && headerPath !== "") {
const currentFilePath = file.getPath();
const currentExtensionlessPath = currentFilePath.substring(
0,
currentFilePath.lastIndexOf(".")
);
convertedText = convertedText.replace(
linkMatch,
`[[${currentExtensionlessPath}${headerPath}\\|${linkDisplayName}]]`
);
continue;
}
const fullLinkedFilePath = (0, import_obsidian5.getLinkpath)(linkedFileName); const fullLinkedFilePath = (0, import_obsidian5.getLinkpath)(linkedFileName);
if (fullLinkedFilePath === "") { if (fullLinkedFilePath === "") {
continue; continue;
@@ -20122,7 +20221,7 @@ ${headerSection}
* Process text content from canvas text nodes through the same pipeline as notes. * Process text content from canvas text nodes through the same pipeline as notes.
* This enables wiki-links, transclusions, dataview, etc. in canvas text nodes. * This enables wiki-links, transclusions, dataview, etc. in canvas text nodes.
*/ */
processTextNodeContent(file, text2) { processTextNodeContent(file, text2, assets) {
return __async(this, null, function* () { return __async(this, null, function* () {
const CANVAS_TEXT_COMPILE_STEPS = [ const CANVAS_TEXT_COMPILE_STEPS = [
this.convertCustomFilters, this.convertCustomFilters,
@@ -20130,12 +20229,18 @@ ${headerSection}
this.createTranscludedText(0), this.createTranscludedText(0),
this.convertDataViews, this.convertDataViews,
this.convertLinksToFullPath, this.convertLinksToFullPath,
this.removeObsidianComments this.removeObsidianComments,
this.createSvgEmbeds
]; ];
return yield this.runCompilerSteps( const compiledText = yield this.runCompilerSteps(
file, file,
CANVAS_TEXT_COMPILE_STEPS CANVAS_TEXT_COMPILE_STEPS
)(text2); )(text2);
const [processedText, collectedAssets] = yield this.convertEmbeddedAssets(file)(compiledText);
if (assets) {
assets.push(...collectedAssets);
}
return processedText;
}); });
} }
generateMarkdown(file) { generateMarkdown(file) {
@@ -20371,6 +20476,9 @@ var Publisher = class {
yield this.uploadAssets(assets, remoteImageHashes); yield this.uploadAssets(assets, remoteImageHashes);
return true; return true;
} catch (error) { } catch (error) {
if (error instanceof LimitReachedError) {
throw error;
}
console.error(error); console.error(error);
return false; return false;
} }
@@ -20416,6 +20524,9 @@ var Publisher = class {
); );
return true; return true;
} catch (error) { } catch (error) {
if (error instanceof LimitReachedError) {
throw error;
}
console.error(error); console.error(error);
return false; return false;
} }
@@ -30017,6 +30128,22 @@ var ForestryApi = class {
} }
}); });
} }
getUserLimits() {
return __async(this, null, function* () {
try {
const response = yield this.client.get(
"user/limits"
);
if (response.status !== 200) {
return null;
}
return response.data;
} catch (e) {
import_js_logger8.default.error(e);
return null;
}
});
}
}; };
// src/views/SettingsView/ForestrySettings.svelte // src/views/SettingsView/ForestrySettings.svelte
@@ -30033,11 +30160,11 @@ function create_else_block5(ctx) {
pending: create_pending_block, pending: create_pending_block,
then: create_then_block, then: create_then_block,
catch: create_catch_block, catch: create_catch_block,
value: 9, value: 12,
blocks: [, , ,] blocks: [, , ,]
}; };
handle_promise(promise = /*getPageInfo*/ handle_promise(promise = /*getPageInfo*/
ctx[5](), info); ctx[7](), info);
return { return {
c() { c() {
await_block_anchor = empty(); await_block_anchor = empty();
@@ -30125,13 +30252,13 @@ function create_if_block6(ctx) {
input, input,
"input", "input",
/*input_input_handler*/ /*input_input_handler*/
ctx[8] ctx[10]
), ),
listen( listen(
button, button,
"click", "click",
/*connect*/ /*connect*/
ctx[3] ctx[5]
) )
]; ];
mounted = true; mounted = true;
@@ -30191,7 +30318,7 @@ function create_catch_block(ctx) {
button, button,
"click", "click",
/*disconnect*/ /*disconnect*/
ctx[4] ctx[6]
); );
mounted = true; mounted = true;
} }
@@ -30218,7 +30345,7 @@ function create_then_block(ctx) {
function select_block_type_1(ctx2, dirty) { function select_block_type_1(ctx2, dirty) {
if ( if (
/*pageInfo*/ /*pageInfo*/
ctx2[9] ctx2[12]
) return 0; ) return 0;
return 1; return 1;
} }
@@ -30287,7 +30414,7 @@ function create_else_block_12(ctx) {
button, button,
"click", "click",
/*disconnect*/ /*disconnect*/
ctx[4] ctx[6]
); );
mounted = true; mounted = true;
} }
@@ -30313,7 +30440,7 @@ function create_if_block_15(ctx) {
let t0; let t0;
let t1_value = ( let t1_value = (
/*pageInfo*/ /*pageInfo*/
((_a2 = ctx[9].value.pageName) != null ? _a2 : "Unknown") + "" ((_a2 = ctx[12].value.pageName) != null ? _a2 : "Unknown") + ""
); );
let t1; let t1;
let t2; let t2;
@@ -30326,11 +30453,25 @@ function create_if_block_15(ctx) {
let a; let a;
let icon1; let icon1;
let t7; let t7;
let t8;
let if_block_anchor;
let current; let current;
let mounted; let mounted;
let dispose; let dispose;
icon0 = new Icon_default({ props: { name: "check-circle" } }); icon0 = new Icon_default({ props: { name: "check-circle" } });
icon1 = new Icon_default({ props: { name: "external-link" } }); icon1 = new Icon_default({ props: { name: "external-link" } });
function select_block_type_2(ctx2, dirty) {
if (
/*limitsLoading*/
ctx2[4]
) return create_if_block_25;
if (
/*limits*/
ctx2[3]
) return create_if_block_33;
}
let current_block_type = select_block_type_2(ctx, -1);
let if_block = current_block_type && current_block_type(ctx);
return { return {
c() { c() {
div4 = element("div"); div4 = element("div");
@@ -30351,6 +30492,9 @@ function create_if_block_15(ctx) {
a = element("a"); a = element("a");
create_component(icon1.$$.fragment); create_component(icon1.$$.fragment);
t7 = text(" Open Forestry.md Dashboard"); t7 = text(" Open Forestry.md Dashboard");
t8 = space();
if (if_block) if_block.c();
if_block_anchor = empty();
attr(div0, "class", "setting-item-name"); attr(div0, "class", "setting-item-name");
set_style(div0, "display", "flex"); set_style(div0, "display", "flex");
set_style(div0, "align-items", "center"); set_style(div0, "align-items", "center");
@@ -30384,18 +30528,32 @@ function create_if_block_15(ctx) {
append(div5, a); append(div5, a);
mount_component(icon1, a, null); mount_component(icon1, a, null);
append(a, t7); append(a, t7);
insert(target, t8, anchor);
if (if_block) if_block.m(target, anchor);
insert(target, if_block_anchor, anchor);
current = true; current = true;
if (!mounted) { if (!mounted) {
dispose = listen( dispose = listen(
button, button,
"click", "click",
/*disconnect*/ /*disconnect*/
ctx[4] ctx[6]
); );
mounted = true; mounted = true;
} }
}, },
p: noop, p(ctx2, dirty) {
if (current_block_type === (current_block_type = select_block_type_2(ctx2, dirty)) && if_block) {
if_block.p(ctx2, dirty);
} else {
if (if_block) if_block.d(1);
if_block = current_block_type && current_block_type(ctx2);
if (if_block) {
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
}
},
i(local) { i(local) {
if (current) return; if (current) return;
transition_in(icon0.$$.fragment, local); transition_in(icon0.$$.fragment, local);
@@ -30412,14 +30570,362 @@ function create_if_block_15(ctx) {
detach(div4); detach(div4);
detach(t6); detach(t6);
detach(div5); detach(div5);
detach(t8);
detach(if_block_anchor);
} }
destroy_component(icon0); destroy_component(icon0);
destroy_component(icon1); destroy_component(icon1);
if (if_block) {
if_block.d(detaching);
}
mounted = false; mounted = false;
dispose(); dispose();
} }
}; };
} }
function create_if_block_33(ctx) {
let div5;
let div0;
let t0;
let t1_value = (
/*limits*/
ctx[3].plan + ""
);
let t1;
let t2;
let t3;
let div4;
let div1;
let span0;
let t5;
let span1;
let t6_value = (
/*limits*/
ctx[3].builds.monthlyLimit - /*limits*/
ctx[3].builds.monthlyRemaining + ""
);
let t6;
let t7;
let t8_value = (
/*limits*/
ctx[3].builds.monthlyLimit + ""
);
let t8;
let t9;
let t10;
let div2;
let span2;
let t12;
let span3;
let t13_value = (
/*limits*/
ctx[3].storage.usedFormatted + ""
);
let t13;
let t14;
let t15_value = (
/*limits*/
ctx[3].storage.limitFormatted + ""
);
let t15;
let t16;
let div3;
let span4;
let t18;
let span5;
let t19_value = (
/*limits*/
ctx[3].sites.current + ""
);
let t19;
let t20;
let t21_value = (
/*limits*/
ctx[3].sites.limit + ""
);
let t21;
let t22;
let if_block0 = (
/*limits*/
ctx[3].builds.starterCreditsRemaining > 0 && create_if_block_53(ctx)
);
let if_block1 = (
/*limits*/
(ctx[3].builds.monthlyRemaining === 0 || /*limits*/
ctx[3].storage.usedBytes >= /*limits*/
ctx[3].storage.limitBytes) && create_if_block_43(ctx)
);
return {
c() {
div5 = element("div");
div0 = element("div");
t0 = text("Usage \u2014 ");
t1 = text(t1_value);
t2 = text(" plan");
t3 = space();
div4 = element("div");
div1 = element("div");
span0 = element("span");
span0.textContent = "Builds this month";
t5 = space();
span1 = element("span");
t6 = text(t6_value);
t7 = text(" / ");
t8 = text(t8_value);
t9 = space();
if (if_block0) if_block0.c();
t10 = space();
div2 = element("div");
span2 = element("span");
span2.textContent = "Storage";
t12 = space();
span3 = element("span");
t13 = text(t13_value);
t14 = text(" / ");
t15 = text(t15_value);
t16 = space();
div3 = element("div");
span4 = element("span");
span4.textContent = "Sites";
t18 = space();
span5 = element("span");
t19 = text(t19_value);
t20 = text(" / ");
t21 = text(t21_value);
t22 = space();
if (if_block1) if_block1.c();
set_style(div0, "font-weight", "600");
set_style(div0, "margin-bottom", "8px");
set_style(
span1,
"color",
/*limits*/
ctx[3].builds.monthlyRemaining === 0 ? "var(--text-error)" : "var(--text-normal)"
);
set_style(div1, "display", "flex");
set_style(div1, "justify-content", "space-between");
set_style(
span3,
"color",
/*limits*/
ctx[3].storage.usedBytes >= /*limits*/
ctx[3].storage.limitBytes ? "var(--text-error)" : "var(--text-normal)"
);
set_style(div2, "display", "flex");
set_style(div2, "justify-content", "space-between");
set_style(div3, "display", "flex");
set_style(div3, "justify-content", "space-between");
set_style(div4, "display", "flex");
set_style(div4, "flex-direction", "column");
set_style(div4, "gap", "6px");
set_style(div4, "font-size", "0.9em");
set_style(div4, "color", "var(--text-muted)");
set_style(div5, "margin-top", "16px");
set_style(div5, "padding", "12px");
set_style(div5, "background", "var(--background-secondary)");
set_style(div5, "border-radius", "8px");
},
m(target, anchor) {
insert(target, div5, anchor);
append(div5, div0);
append(div0, t0);
append(div0, t1);
append(div0, t2);
append(div5, t3);
append(div5, div4);
append(div4, div1);
append(div1, span0);
append(div1, t5);
append(div1, span1);
append(span1, t6);
append(span1, t7);
append(span1, t8);
append(div4, t9);
if (if_block0) if_block0.m(div4, null);
append(div4, t10);
append(div4, div2);
append(div2, span2);
append(div2, t12);
append(div2, span3);
append(span3, t13);
append(span3, t14);
append(span3, t15);
append(div4, t16);
append(div4, div3);
append(div3, span4);
append(div3, t18);
append(div3, span5);
append(span5, t19);
append(span5, t20);
append(span5, t21);
append(div5, t22);
if (if_block1) if_block1.m(div5, null);
},
p(ctx2, dirty) {
if (dirty & /*limits*/
8 && t1_value !== (t1_value = /*limits*/
ctx2[3].plan + "")) set_data(t1, t1_value);
if (dirty & /*limits*/
8 && t6_value !== (t6_value = /*limits*/
ctx2[3].builds.monthlyLimit - /*limits*/
ctx2[3].builds.monthlyRemaining + "")) set_data(t6, t6_value);
if (dirty & /*limits*/
8 && t8_value !== (t8_value = /*limits*/
ctx2[3].builds.monthlyLimit + "")) set_data(t8, t8_value);
if (dirty & /*limits*/
8) {
set_style(
span1,
"color",
/*limits*/
ctx2[3].builds.monthlyRemaining === 0 ? "var(--text-error)" : "var(--text-normal)"
);
}
if (
/*limits*/
ctx2[3].builds.starterCreditsRemaining > 0
) {
if (if_block0) {
if_block0.p(ctx2, dirty);
} else {
if_block0 = create_if_block_53(ctx2);
if_block0.c();
if_block0.m(div4, t10);
}
} else if (if_block0) {
if_block0.d(1);
if_block0 = null;
}
if (dirty & /*limits*/
8 && t13_value !== (t13_value = /*limits*/
ctx2[3].storage.usedFormatted + "")) set_data(t13, t13_value);
if (dirty & /*limits*/
8 && t15_value !== (t15_value = /*limits*/
ctx2[3].storage.limitFormatted + "")) set_data(t15, t15_value);
if (dirty & /*limits*/
8) {
set_style(
span3,
"color",
/*limits*/
ctx2[3].storage.usedBytes >= /*limits*/
ctx2[3].storage.limitBytes ? "var(--text-error)" : "var(--text-normal)"
);
}
if (dirty & /*limits*/
8 && t19_value !== (t19_value = /*limits*/
ctx2[3].sites.current + "")) set_data(t19, t19_value);
if (dirty & /*limits*/
8 && t21_value !== (t21_value = /*limits*/
ctx2[3].sites.limit + "")) set_data(t21, t21_value);
if (
/*limits*/
ctx2[3].builds.monthlyRemaining === 0 || /*limits*/
ctx2[3].storage.usedBytes >= /*limits*/
ctx2[3].storage.limitBytes
) {
if (if_block1) {
} else {
if_block1 = create_if_block_43(ctx2);
if_block1.c();
if_block1.m(div5, null);
}
} else if (if_block1) {
if_block1.d(1);
if_block1 = null;
}
},
d(detaching) {
if (detaching) {
detach(div5);
}
if (if_block0) if_block0.d();
if (if_block1) if_block1.d();
}
};
}
function create_if_block_25(ctx) {
let div2;
return {
c() {
div2 = element("div");
div2.innerHTML = `<div class="setting-item-info"><div class="setting-item-name">Loading usage info...</div></div>`;
attr(div2, "class", "setting-item");
set_style(div2, "margin-top", "12px");
},
m(target, anchor) {
insert(target, div2, anchor);
},
p: noop,
d(detaching) {
if (detaching) {
detach(div2);
}
}
};
}
function create_if_block_53(ctx) {
let div;
let span0;
let t1;
let span1;
let t2_value = (
/*limits*/
ctx[3].builds.starterCreditsRemaining + ""
);
let t2;
return {
c() {
div = element("div");
span0 = element("span");
span0.textContent = "Starter credits remaining";
t1 = space();
span1 = element("span");
t2 = text(t2_value);
set_style(div, "display", "flex");
set_style(div, "justify-content", "space-between");
},
m(target, anchor) {
insert(target, div, anchor);
append(div, span0);
append(div, t1);
append(div, span1);
append(span1, t2);
},
p(ctx2, dirty) {
if (dirty & /*limits*/
8 && t2_value !== (t2_value = /*limits*/
ctx2[3].builds.starterCreditsRemaining + "")) set_data(t2, t2_value);
},
d(detaching) {
if (detaching) {
detach(div);
}
}
};
}
function create_if_block_43(ctx) {
let div;
return {
c() {
div = element("div");
div.innerHTML = `You&#39;ve reached your usage limit. <a href="https://dashboard.forestry.md/settings" target="_blank">Upgrade your plan</a> to continue publishing.`;
set_style(div, "margin-top", "8px");
set_style(div, "padding", "8px");
set_style(div, "background", "var(--background-modifier-error)");
set_style(div, "border-radius", "4px");
set_style(div, "font-size", "0.85em");
},
m(target, anchor) {
insert(target, div, anchor);
},
d(detaching) {
if (detaching) {
detach(div);
}
}
};
}
function create_pending_block(ctx) { function create_pending_block(ctx) {
let div2; let div2;
return { return {
@@ -30576,6 +31082,8 @@ function instance8($$self, $$props, $$invalidate) {
let { saveSettings } = $$props; let { saveSettings } = $$props;
let { onConnect } = $$props; let { onConnect } = $$props;
let apiKey = settings.forestrySettings.apiKey; let apiKey = settings.forestrySettings.apiKey;
let limits = null;
let limitsLoading = false;
const connect = () => __awaiter(void 0, void 0, void 0, function* () { const connect = () => __awaiter(void 0, void 0, void 0, function* () {
let pageInfo = yield getPageInfo(); let pageInfo = yield getPageInfo();
if (!pageInfo) { if (!pageInfo) {
@@ -30594,24 +31102,45 @@ function instance8($$self, $$props, $$invalidate) {
$$invalidate(0, settings.forestrySettings.forestryPageName = "", settings); $$invalidate(0, settings.forestrySettings.forestryPageName = "", settings);
yield saveSettings(); yield saveSettings();
$$invalidate(2, apiKey = ""); $$invalidate(2, apiKey = "");
$$invalidate(3, limits = null);
}); });
const getPageInfo = () => __awaiter(void 0, void 0, void 0, function* () { const getPageInfo = () => __awaiter(void 0, void 0, void 0, function* () {
let pageInfo = yield new ForestryApi(apiKey).getPageInfo(); let pageInfo = yield new ForestryApi(apiKey).getPageInfo();
return pageInfo; return pageInfo;
}); });
const fetchLimits = () => __awaiter(void 0, void 0, void 0, function* () {
if (!settings.forestrySettings.apiKey) return;
$$invalidate(4, limitsLoading = true);
try {
$$invalidate(3, limits = yield new ForestryApi(settings.forestrySettings.apiKey).getUserLimits());
} catch (_a2) {
$$invalidate(3, limits = null);
}
$$invalidate(4, limitsLoading = false);
});
function input_input_handler() { function input_input_handler() {
apiKey = this.value; apiKey = this.value;
$$invalidate(2, apiKey); $$invalidate(2, apiKey);
} }
$$self.$$set = ($$props2) => { $$self.$$set = ($$props2) => {
if ("settings" in $$props2) $$invalidate(0, settings = $$props2.settings); if ("settings" in $$props2) $$invalidate(0, settings = $$props2.settings);
if ("saveSettings" in $$props2) $$invalidate(6, saveSettings = $$props2.saveSettings); if ("saveSettings" in $$props2) $$invalidate(8, saveSettings = $$props2.saveSettings);
if ("onConnect" in $$props2) $$invalidate(7, onConnect = $$props2.onConnect); if ("onConnect" in $$props2) $$invalidate(9, onConnect = $$props2.onConnect);
};
$$self.$$.update = () => {
if ($$self.$$.dirty & /*settings*/
1) {
$: if (settings.forestrySettings.apiKey) {
fetchLimits();
}
}
}; };
return [ return [
settings, settings,
unique, unique,
apiKey, apiKey,
limits,
limitsLoading,
connect, connect,
disconnect, disconnect,
getPageInfo, getPageInfo,
@@ -30625,8 +31154,8 @@ var ForestrySettings = class extends SvelteComponent {
super(); super();
init(this, options, instance8, create_fragment8, safe_not_equal, { init(this, options, instance8, create_fragment8, safe_not_equal, {
settings: 0, settings: 0,
saveSettings: 6, saveSettings: 8,
onConnect: 7 onConnect: 9
}); });
} }
}; };
@@ -30699,7 +31228,7 @@ var SettingView = class {
const publishPlatformSettings = this.settingsRootElement.createEl( const publishPlatformSettings = this.settingsRootElement.createEl(
"div", "div",
{ {
cls: "connection-status" cls: "publish-platform-settings"
} }
); );
this.initializePublishPlatformSettings(publishPlatformSettings); this.initializePublishPlatformSettings(publishPlatformSettings);
@@ -31313,13 +31842,31 @@ var SettingView = class {
cb.setButtonText("Apply settings to site"); cb.setButtonText("Apply settings to site");
cb.setCta(); cb.setCta();
cb.onClick((_ev) => __async(this, null, function* () { cb.onClick((_ev) => __async(this, null, function* () {
const octokit = new Octokit({
auth: this.settings.githubToken
});
new import_obsidian15.Notice("Applying settings to site..."); new import_obsidian15.Notice("Applying settings to site...");
yield this.saveSettingsAndUpdateEnv(); yield this.saveSettingsAndUpdateEnv();
yield this.addFavicon(octokit); const connection = yield PublishPlatformConnectionFactory.createPublishPlatformConnection(
yield this.addLogo(octokit); this.settings
);
const octokit = connection.octoKit;
const owner = connection.userName;
const repo = connection.pageName;
try {
yield this.addFavicon(octokit, owner, repo);
} catch (error) {
import_js_logger9.default.error("Failed to update favicon", error);
new import_obsidian15.Notice(
"Failed to update favicon. Check the developer console for details."
);
}
try {
yield this.addLogo(octokit, owner, repo);
} catch (error) {
import_js_logger9.default.error("Failed to update logo", error);
new import_obsidian15.Notice(
"Failed to update logo. Check the developer console for details."
);
}
new import_obsidian15.Notice("Settings applied to site!");
})); }));
}; };
new import_obsidian15.Setting(this.settingsRootElement).setName("Appearance").setDesc("Manage themes, sitename and styling on your site").addButton((cb) => { new import_obsidian15.Setting(this.settingsRootElement).setName("Appearance").setDesc("Manage themes, sitename and styling on your site").addButton((cb) => {
@@ -31724,7 +32271,7 @@ var SettingView = class {
} }
return settings; return settings;
} }
addFavicon(octokit) { addFavicon(octokit, owner, repo) {
return __async(this, null, function* () { return __async(this, null, function* () {
let base64SettingsFaviconContent = ""; let base64SettingsFaviconContent = "";
if (this.settings.faviconPath) { if (this.settings.faviconPath) {
@@ -31738,11 +32285,12 @@ var SettingView = class {
const faviconContent = yield this.app.vault.readBinary(faviconFile); const faviconContent = yield this.app.vault.readBinary(faviconFile);
base64SettingsFaviconContent = arrayBufferToBase64(faviconContent); base64SettingsFaviconContent = arrayBufferToBase64(faviconContent);
} else { } else {
const defaultFavicon = yield octokit.request( const baseConnection = PublishPlatformConnectionFactory.createBaseGardenConnection();
const defaultFavicon = yield baseConnection.octoKit.request(
"GET /repos/{owner}/{repo}/contents/{path}", "GET /repos/{owner}/{repo}/contents/{path}",
{ {
owner: "oleeskild", owner: baseConnection.userName,
repo: "digitalgarden", repo: baseConnection.pageName,
path: "src/site/favicon.svg" path: "src/site/favicon.svg"
} }
); );
@@ -31755,13 +32303,13 @@ var SettingView = class {
currentFaviconOnSite = yield octokit.request( currentFaviconOnSite = yield octokit.request(
"GET /repos/{owner}/{repo}/contents/{path}", "GET /repos/{owner}/{repo}/contents/{path}",
{ {
owner: this.settings.githubUserName, owner,
repo: this.settings.githubRepo, repo,
path: "src/site/favicon.svg" path: "src/site/favicon.svg"
} }
); );
faviconsAreIdentical = // @ts-expect-error TODO: abstract octokit response faviconsAreIdentical = // @ts-expect-error TODO: abstract octokit response
currentFaviconOnSite.data.content === base64SettingsFaviconContent; currentFaviconOnSite.data.content.replace(/\n/g, "") === base64SettingsFaviconContent;
if (faviconsAreIdentical) { if (faviconsAreIdentical) {
import_js_logger9.default.info("Favicons are identical, skipping update"); import_js_logger9.default.info("Favicons are identical, skipping update");
return; return;
@@ -31771,8 +32319,8 @@ var SettingView = class {
} }
if (!faviconExists || !faviconsAreIdentical) { if (!faviconExists || !faviconsAreIdentical) {
yield octokit.request("PUT /repos/{owner}/{repo}/contents/{path}", { yield octokit.request("PUT /repos/{owner}/{repo}/contents/{path}", {
owner: this.settings.githubUserName, owner,
repo: this.settings.githubRepo, repo,
path: "src/site/favicon.svg", path: "src/site/favicon.svg",
message: `Update favicon.svg`, message: `Update favicon.svg`,
content: base64SettingsFaviconContent, content: base64SettingsFaviconContent,
@@ -31782,9 +32330,12 @@ var SettingView = class {
} }
}); });
} }
addLogo(octokit) { addLogo(octokit, owner, repo) {
return __async(this, null, function* () { return __async(this, null, function* () {
var _a2; var _a2;
import_js_logger9.default.info(
`addLogo called, logoPath setting: "${this.settings.logoPath}", owner: "${owner}", repo: "${repo}"`
);
const logoBasePath = "src/site/logo"; const logoBasePath = "src/site/logo";
const logoExtensions = ["png", "jpg", "jpeg", "gif", "svg", "webp"]; const logoExtensions = ["png", "jpg", "jpeg", "gif", "svg", "webp"];
for (const ext of logoExtensions) { for (const ext of logoExtensions) {
@@ -31792,8 +32343,8 @@ var SettingView = class {
const existingLogo = yield octokit.request( const existingLogo = yield octokit.request(
"GET /repos/{owner}/{repo}/contents/{path}", "GET /repos/{owner}/{repo}/contents/{path}",
{ {
owner: this.settings.githubUserName, owner,
repo: this.settings.githubRepo, repo,
path: `${logoBasePath}.${ext}` path: `${logoBasePath}.${ext}`
} }
); );
@@ -31804,8 +32355,8 @@ var SettingView = class {
yield octokit.request( yield octokit.request(
"DELETE /repos/{owner}/{repo}/contents/{path}", "DELETE /repos/{owner}/{repo}/contents/{path}",
{ {
owner: this.settings.githubUserName, owner,
repo: this.settings.githubRepo, repo,
path: `${logoBasePath}.${ext}`, path: `${logoBasePath}.${ext}`,
message: `Remove logo.${ext}`, message: `Remove logo.${ext}`,
// @ts-expect-error TODO: abstract octokit response // @ts-expect-error TODO: abstract octokit response
@@ -31841,13 +32392,13 @@ var SettingView = class {
currentLogoOnSite = yield octokit.request( currentLogoOnSite = yield octokit.request(
"GET /repos/{owner}/{repo}/contents/{path}", "GET /repos/{owner}/{repo}/contents/{path}",
{ {
owner: this.settings.githubUserName, owner,
repo: this.settings.githubRepo, repo,
path: logoPath path: logoPath
} }
); );
logosAreIdentical = // @ts-expect-error TODO: abstract octokit response logosAreIdentical = // @ts-expect-error TODO: abstract octokit response
currentLogoOnSite.data.content === base64LogoContent; currentLogoOnSite.data.content.replace(/\n/g, "") === base64LogoContent;
if (logosAreIdentical) { if (logosAreIdentical) {
import_js_logger9.default.info("Logos are identical, skipping update"); import_js_logger9.default.info("Logos are identical, skipping update");
return; return;
@@ -31858,8 +32409,8 @@ var SettingView = class {
if (!logoExists || !logosAreIdentical) { if (!logoExists || !logosAreIdentical) {
try { try {
const requestPayload = __spreadValues({ const requestPayload = __spreadValues({
owner: this.settings.githubUserName, owner,
repo: this.settings.githubRepo, repo,
path: logoPath, path: logoPath,
message: `Update logo.${logoExtension}`, message: `Update logo.${logoExtension}`,
content: base64LogoContent content: base64LogoContent
@@ -32550,6 +33101,10 @@ var DigitalGarden = class extends import_obsidian19.Plugin {
} catch (e) { } catch (e) {
statusBarItem.remove(); statusBarItem.remove();
this.isPublishing = false; this.isPublishing = false;
if (e instanceof LimitReachedError) {
this.showLimitNotice(e);
return;
}
console.error(e); console.error(e);
new import_obsidian19.Notice( new import_obsidian19.Notice(
"Unable to publish multiple notes, something went wrong." "Unable to publish multiple notes, something went wrong."
@@ -32666,9 +33221,15 @@ var DigitalGarden = class extends import_obsidian19.Plugin {
const publishSuccessful = yield publisher.publish(publishFile); const publishSuccessful = yield publisher.publish(publishFile);
if (publishSuccessful) { if (publishSuccessful) {
new import_obsidian19.Notice(`Successfully published note to your garden.`); new import_obsidian19.Notice(`Successfully published note to your garden.`);
} else {
new import_obsidian19.Notice("Unable to publish note, something went wrong.");
} }
return publishSuccessful; return publishSuccessful;
} catch (e) { } catch (e) {
if (e instanceof LimitReachedError) {
this.showLimitNotice(e);
return false;
}
console.error(e); console.error(e);
new import_obsidian19.Notice("Unable to publish note, something went wrong."); new import_obsidian19.Notice("Unable to publish note, something went wrong.");
return false; return false;
@@ -32762,6 +33323,22 @@ var DigitalGarden = class extends import_obsidian19.Plugin {
} }
}); });
} }
showLimitNotice(error) {
var _a2, _b;
if (error.errorType === "build_limit_reached") {
const used = (_a2 = error.buildsUsed) != null ? _a2 : 0;
const limit = (_b = error.monthlyLimit) != null ? _b : 0;
new import_obsidian19.Notice(
`Publishing blocked: You've used all ${used}/${limit} builds this month. Upgrade to Pro for 1000 builds/month at dashboard.forestry.md/settings`,
1e4
);
} else {
new import_obsidian19.Notice(
`Publishing blocked: Storage limit exceeded. Free up space or upgrade at dashboard.forestry.md/settings`,
1e4
);
}
}
openPublishModal() { openPublishModal() {
const siteManager = new DigitalGardenSiteManager( const siteManager = new DigitalGardenSiteManager(
this.app.metadataCache, this.app.metadataCache,
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "digitalgarden", "id": "digitalgarden",
"name": "Digital Garden", "name": "Digital Garden",
"version": "2.69.0", "version": "2.72.0",
"minAppVersion": "1.10.0", "minAppVersion": "1.10.0",
"description": "Publish your notes to the web for others to enjoy. For free.", "description": "Publish your notes to the web for others to enjoy. For free.",
"author": "Ole Eskild Steensen", "author": "Ole Eskild Steensen",
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "obsidian-excalidraw-plugin", "id": "obsidian-excalidraw-plugin",
"name": "Excalidraw", "name": "Excalidraw",
"version": "2.20.2", "version": "2.20.6",
"minAppVersion": "1.5.7", "minAppVersion": "1.5.7",
"description": "Sketch Your Mind. An Obsidian plugin to edit and view Excalidraw drawings. Enter the world of 4D Visual PKM.", "description": "Sketch Your Mind. An Obsidian plugin to edit and view Excalidraw drawings. Enter the world of 4D Visual PKM.",
"author": "Zsolt Viczian", "author": "Zsolt Viczian",
File diff suppressed because one or more lines are too long
+281 -271
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -6,5 +6,5 @@
"description": "Integrate Git version control with automatic backup and other advanced features.", "description": "Integrate Git version control with automatic backup and other advanced features.",
"isDesktopOnly": false, "isDesktopOnly": false,
"fundingUrl": "https://ko-fi.com/vinzent", "fundingUrl": "https://ko-fi.com/vinzent",
"version": "2.36.1" "version": "2.37.1"
} }
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1,11 +1,11 @@
{ {
"id": "obsidian-latex-suite", "id": "obsidian-latex-suite",
"name": "Latex Suite", "name": "Latex Suite",
"version": "1.9.8", "version": "1.11.0",
"minAppVersion": "1.0.0", "minAppVersion": "1.0.0",
"description": "Make typesetting LaTeX math as fast as handwriting through snippets, text expansion, and editor enhancements", "description": "Make typesetting LaTeX math as fast as handwriting through snippets, text expansion, and editor enhancements",
"author": "artisticat", "author": "artisticat",
"authorUrl": "https://github.com/artisticat1", "authorUrl": "https://github.com/artisticat1",
"fundingUrl": "https://ko-fi.com/artisticat", "fundingUrl": "https://ko-fi.com/artisticat",
"isDesktopOnly": false "isDesktopOnly": false
} }
+29
View File
@@ -192,8 +192,25 @@ sup.cm-math, sub.cm-math {
0px 3.4px 6.7px rgba(0, 0, 0, 0.15), 0px 3.4px 6.7px rgba(0, 0, 0, 0.15),
0px 0px 30px rgba(0, 0, 0, 0.27); 0px 0px 30px rgba(0, 0, 0, 0.27);
} }
/* CM6 puts the top of the tooltip higher than what's viewable (negative top value),
so to compensate for this, we align the content to the bottom of the tooltip container,
and limit the height.
*/
.cm-tooltip.cm-tooltip-cursor.cm-tooltip-above {
display: flex;
}
.cm-tooltip.cm-tooltip-cursor.cm-tooltip-above > .MathJax {
overflow-y: auto;
max-height: 70%;
display: inline-block;
align-self: flex-end;
}
.cm-tooltip.cm-tooltip-cursor.cm-tooltip-below > .MathJax {
overflow-y: auto;
max-height: 90%;
}
/* Highlight brackets */ /* Highlight brackets */
.theme-light .latex-suite-highlighted-bracket, .theme-light .latex-suite-highlighted-bracket [class^="latex-suite-color-bracket-"] { .theme-light .latex-suite-highlighted-bracket, .theme-light .latex-suite-highlighted-bracket [class^="latex-suite-color-bracket-"] {
background-color: hsl(var(--accent-h), var(--accent-s), 40%, 0.3); background-color: hsl(var(--accent-h), var(--accent-s), 40%, 0.3);
@@ -233,3 +250,15 @@ sup.cm-math, sub.cm-math {
/* .latex-suite-color-bracket-3 { /* .latex-suite-color-bracket-3 {
color: #8de15c; color: #8de15c;
} */ } */
.latex-suite-math-preview-highlight {
background-color: var(--text-selection);
}
.cm-snippetFieldPosition {
vertical-align: text-top;
width: 0;
height: 1.15em;
display: inline-block;
margin: 0 -0.7px -.7em;
border-left: 1.4px dotted #888;
}
+3 -1
View File
@@ -106,7 +106,8 @@
"enabled": false "enabled": false
}, },
"move-footnotes-to-the-bottom": { "move-footnotes-to-the-bottom": {
"enabled": false "enabled": false,
"include-blank-line-between-footnotes": false
}, },
"re-index-footnotes": { "re-index-footnotes": {
"enabled": false "enabled": false
@@ -273,6 +274,7 @@
"lintOnSave": true, "lintOnSave": true,
"recordLintOnSaveLogs": false, "recordLintOnSaveLogs": false,
"displayChanged": true, "displayChanged": true,
"suppressMessageWhenNoChange": false,
"lintOnFileChange": false, "lintOnFileChange": false,
"displayLintOnFileChangeNotice": false, "displayLintOnFileChangeNotice": false,
"settingsConvertedToConfigKeyValues": true, "settingsConvertedToConfigKeyValues": true,
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "obsidian-linter", "id": "obsidian-linter",
"name": "Linter", "name": "Linter",
"version": "1.30.0", "version": "1.31.0",
"minAppVersion": "1.9.0", "minAppVersion": "1.9.0",
"description": "Formats and styles your notes. It can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular markdown contents like list, italics, and bold styles; and more with the use of custom rule options as well.", "description": "Formats and styles your notes. It can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular markdown contents like list, italics, and bold styles; and more with the use of custom rule options as well.",
"author": "Victor Tao", "author": "Victor Tao",
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "obsidian-tasks-plugin", "id": "obsidian-tasks-plugin",
"name": "Tasks", "name": "Tasks",
"version": "7.22.0", "version": "7.23.1",
"minAppVersion": "1.4.0", "minAppVersion": "1.4.0",
"description": "Track tasks across your vault. Supports due dates, recurring tasks, done dates, sub-set of checklist items, and filtering.", "description": "Track tasks across your vault. Supports due dates, recurring tasks, done dates, sub-set of checklist items, and filtering.",
"helpUrl": "https://publish.obsidian.md/tasks/", "helpUrl": "https://publish.obsidian.md/tasks/",
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -6,7 +6,7 @@
"devMode": false, "devMode": false,
"templateFolderPath": "", "templateFolderPath": "",
"announceUpdates": "none", "announceUpdates": "none",
"version": "2.10.0", "version": "2.11.0",
"globalVariables": {}, "globalVariables": {},
"onePageInputEnabled": false, "onePageInputEnabled": false,
"disableOnlineFeatures": true, "disableOnlineFeatures": true,
+51 -49
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "quickadd", "id": "quickadd",
"name": "QuickAdd", "name": "QuickAdd",
"version": "2.10.0", "version": "2.11.0",
"minAppVersion": "1.11.4", "minAppVersion": "1.11.4",
"description": "Quickly add new pages or content to your vault.", "description": "Quickly add new pages or content to your vault.",
"author": "Christian B. B. Houmann", "author": "Christian B. B. Houmann",
File diff suppressed because one or more lines are too long
+1 -2
View File
@@ -562,8 +562,7 @@ var SpellcheckTogglerPlugin = class extends import_obsidian2.Plugin {
const editor = (_a2 = this.app.workspace.activeEditor) == null ? void 0 : _a2.editor; const editor = (_a2 = this.app.workspace.activeEditor) == null ? void 0 : _a2.editor;
if (!editor) if (!editor)
return; return;
editor.replaceRange(" ", editor.getCursor()); editor.refresh();
editor.undo();
})(); })();
} }
async onload() { async onload() {
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "spellcheck-toggler", "id": "spellcheck-toggler",
"name": "Spellcheck Toggler", "name": "Spellcheck Toggler",
"version": "1.4.3", "version": "1.4.4",
"minAppVersion": "1.5.3", "minAppVersion": "1.5.3",
"description": "Toggle spellchecking for types of text blocks in the editing view.", "description": "Toggle spellchecking for types of text blocks in the editing view.",
"author": "Julian Szachowicz", "author": "Julian Szachowicz",
+2 -1
View File
@@ -25,6 +25,7 @@
"TQ_show_tree": "checkbox", "TQ_show_tree": "checkbox",
"TQ_show_urgency": "checkbox", "TQ_show_urgency": "checkbox",
"dg-publish": "checkbox", "dg-publish": "checkbox",
"id": "datetime" "id": "datetime",
"TQ_show_toolbar": "checkbox"
} }
} }