From bd2bf7b166556c974dc3146e2b5d538e501290ac Mon Sep 17 00:00:00 2001 From: Nathan Courtney Date: Thu, 22 Jun 2023 14:36:29 +0000 Subject: [PATCH] Release 0.3.9 --- main.js | 346 +++++++++++++++++++++++++------------------------- manifest.json | 2 +- 2 files changed, 172 insertions(+), 176 deletions(-) diff --git a/main.js b/main.js index 4bc03ca..abb57c3 100644 --- a/main.js +++ b/main.js @@ -2674,7 +2674,6 @@ var require_semver2 = __commonJS({ var main_exports = {}; __export(main_exports, { Prism: () => Prism, - appPlugin: () => appPlugin, codeViewProps: () => codeViewProps, default: () => PiecesPlugin, expandId: () => expandId, @@ -2683,7 +2682,7 @@ __export(main_exports, { theme: () => theme }); module.exports = __toCommonJS(main_exports); -var import_obsidian13 = require("obsidian"); +var import_obsidian14 = require("obsidian"); // src/const.ts var Constants = class { @@ -16536,7 +16535,7 @@ var WellKnownApi = class extends BaseAPI2 { }; // package.json -var version = "0.3.8"; +var version = "0.3.9"; // src/connection/notification_handler.ts var import_obsidian = require("obsidian"); @@ -16653,18 +16652,6 @@ var ConnectorSingleton = class { } }; -// src/actions/launch_runtime.ts -var launchRuntime = async (wait) => { - try { - await fetch(`http://localhost:${portNumber}/.well-known/health`); - } catch (error) { - window.open("pieces://launch", "_blank"); - if (wait) { - return new Promise((resolve) => setTimeout(resolve, 3e3)); - } - } -}; - // src/cache/pieces_cache.ts var PiecesCacheSingleton = class { constructor() { @@ -17612,6 +17599,18 @@ var highlightSnippet = ({ // src/ui/modals/delete-modal.ts var import_obsidian4 = require("obsidian"); +// src/actions/launch_runtime.ts +var launchRuntime = async (wait) => { + try { + await fetch(`http://localhost:${portNumber}/.well-known/health`); + } catch (error) { + window.open("pieces://launch", "_blank"); + if (wait) { + return new Promise((resolve) => setTimeout(resolve, 3e3)); + } + } +}; + // src/actions/delete.ts var DeletePiece = class { static async delete({ @@ -18655,8 +18654,13 @@ function renderSearchBox({ loading.createEl("div"); SearchBoxDiv.replaceChild(loading, searchButton.buttonEl); try { - await loadPieces({}); - await triggerUIRedraw(false, containerVar2); + await loadPieces(); + await triggerUIRedraw( + false, + containerVar2, + void 0, + false + ); } catch (e) { } SearchBoxDiv.replaceChild(searchButton.buttonEl, loading); @@ -18701,7 +18705,7 @@ async function triggerUIRedraw(searching2, container = defaultContainer, searchQ } else if (fetch2) { snippets = await fetchSnippets(false); } else { - snippets = (await processAssets({ assets: storage.assets, fetch: false })).snippets; + snippets = (await processAssets({ assets: storage.assets })).snippets; } } if (searchQuery) { @@ -18902,12 +18906,47 @@ function stopPolling() { intervalIds = []; } +// src/database/pieces_database.ts +var import_obsidian9 = require("obsidian"); +async function getData() { + const { vault } = app; + const dataFile = await loadFile(); + const rawData = await vault.read(dataFile); + const data = JSON.parse(rawData); + data.assets.forEach( + (e) => e.created.value = new Date(e.created.value) + ); + return data.assets; +} +async function writeData(assets) { + const { vault } = app; + const dataFile = await loadFile(); + vault.modify(dataFile, JSON.stringify({ assets })); +} +async function cacheAssets(assets) { + const cache2 = PiecesCacheSingleton.getInstance(); + cache2.store({ assets }); +} +async function loadFile(retries = 0) { + const { vault } = app; + const dbPath = "piecesdb.json"; + const dataFile = vault.getAbstractFileByPath(dbPath); + if (dataFile === null) { + if (retries < 5) { + await sleep(100); + return loadFile(retries + 1); + } + return vault.create(dbPath, '{"assets":[]}'); + } + if (dataFile instanceof import_obsidian9.TFolder) { + await vault.delete(dataFile); + return vault.create(dbPath, '{"assets":[]}'); + } + return dataFile; +} + // src/connection/api_wrapper.ts -var loadPieces = async ({ - insert = false, - retry: retry2 = false, - notification = true -}) => { +var loadPieces = async () => { stopPolling(); const config8 = ConnectorSingleton.getInstance(); const notifications3 = Notifications.getInstance(); @@ -18931,18 +18970,17 @@ var loadPieces = async ({ setFetchFailed(true); return Promise.reject(snapshot); } + await fetchAllFormats({ assets: snapshot.assets.iterable }); const piecesStorage = PiecesCacheSingleton.getInstance(); - snapshot.assets = mergeAssetsWithTransferables({ + const assets = mergeAssetsWithTransferables({ assets: snapshot.assets, references: piecesStorage.formatTransferables }); - piecesStorage.store({ assets: snapshot.assets.iterable }); - const { snippets, fetching } = await processAssets({ + writeData(assets.iterable); + piecesStorage.store({ assets: assets.iterable }); + const { snippets } = await processAssets({ assets: piecesStorage.assets }); - if (fetching.length > 0) { - await Promise.all(fetching); - } setFetchFailed(false); pollForNewSnippets(); return snippets; @@ -18957,114 +18995,70 @@ var fetchSnapshot = async ({ snapshot = await config8.api.snapshot({ application: config8.context.application.id, suggested: false, - transferables: true + transferables: false }); return snapshot; } catch (error) { - if (error.status === 401 || error.status === 400) { - console.log("401 or 400 error connecting to POS"); + if (!retry2) { + return await fetchSnapshot({ + suggested: false, + config: config8, + retry: true + }); } else { - if (error.code === "ECONNREFUSED") { - if (!retry2) { - await launchRuntime(true); - } else { - notifications3.error({ - message: "Failed to load snippets. We were unable to locate your Pieces OS. Please ensure that it is up-to-date, installed and running. If the problem persists please reach out to support at support@pieces.app." - }); - } - } - if (!retry2) { - return await fetchSnapshot({ - suggested: false, - config: config8, - retry: true - }); - } else { - notifications3.error({ - message: "Failed to load snippets. Please restart Pieces OS, ensure that it is up-to-date, and try again. If the problem persists please reach out to support at support@pieces.app." - }); - return Promise.reject("Failed to fetch snapshot"); - } - } - if (error.code === "500") { - console.log("500 error connecting to POS"); notifications3.error({ - message: "Failed to load snippets. Please restart Pieces OS and ensure that it is up-to-date. If the problem persists please reach out to support at support@pieces.app." + message: "Failed to load snippets. Please restart Pieces OS, ensure that it is up-to-date, and try again. If the problem persists please reach out to support at support@pieces.app." }); + return Promise.reject("Failed to fetch snapshot"); } - return { - context: config8.context, - assets: { - iterable: [] - } - }; } }; -var processAssets = async ({ - assets, - fetch: fetch2 = true -}) => { - const fetching = []; +var fetchAllFormats = async ({ assets }) => { const piecesStorage = PiecesCacheSingleton.getInstance(); - const snippets = []; + const formatFetching = []; for (const asset of assets) { - const formatFetching = []; - if (fetch2) { - for (const format of asset.formats.iterable || []) { - if (!(format.id in piecesStorage.fetchedFormats) || piecesStorage.fetchedFormats[format.id] < format.updated.value) { - formatFetching.push( - fetchFormatTransferable({ format, asset }) - ); - } + for (const format of asset.formats.iterable || []) { + if (!(format.id in piecesStorage.fetchedFormats) || piecesStorage.fetchedFormats[format.id] < format.updated.value) { + formatFetching.push(fetchFormatTransferable({ format, asset })); } } - Promise.all(formatFetching).then(() => { - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z; - const storage4 = PiecesCacheSingleton.getInstance(); - const assets2 = storage4.assets; - const index = assets2.findIndex(({ id }) => id === asset.id); - if (index >= 0) { - assets2[index] = mergeAssetWithTransferables({ - asset, - references: storage4.formatTransferables - }); - storage4.store({ assets: assets2 }); - } - let rawText = void 0; - let rawFormat = void 0; - const type = (_a = asset.original.reference) == null ? void 0 : _a.classification.generic; - if (type === "IMAGE") { - const decoder = new TextDecoder("utf-8"); - const ocrid = (_e = (_d = (_c = (_b = asset.original.reference) == null ? void 0 : _b.analysis) == null ? void 0 : _c.image) == null ? void 0 : _d.ocr) == null ? void 0 : _e.raw.id; - if (!ocrid) { - } - const format = (_f = asset.formats.iterable) == null ? void 0 : _f.find( - (e) => e.id === ocrid - ); - const bytes = new Uint8Array((_i = (_h = (_g = format == null ? void 0 : format.file) == null ? void 0 : _g.bytes) == null ? void 0 : _h.raw) != null ? _i : []); - rawText = decoder.decode(bytes); - rawFormat = format == null ? void 0 : format.classification.specific; + } + await Promise.all(formatFetching); +}; +var processAssets = async ({ assets }) => { + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z; + const snippets = []; + for (const asset of assets) { + let rawText = void 0; + let rawFormat = void 0; + const type = (_a = asset.original.reference) == null ? void 0 : _a.classification.generic; + if (type === "IMAGE") { + const decoder = new TextDecoder("utf-8"); + const ocrid = (_e = (_d = (_c = (_b = asset.original.reference) == null ? void 0 : _b.analysis) == null ? void 0 : _c.image) == null ? void 0 : _d.ocr) == null ? void 0 : _e.raw.id; + if (!ocrid) { } - snippets.push({ - title: asset.name || "Unnamed Asset", - id: asset.id, - type: ((_j = asset.original.reference) == null ? void 0 : _j.classification.generic) || "Unknown Type", - raw: (_y = (_u = (_q = rawText != null ? rawText : (_m = (_l = (_k = asset.original.reference) == null ? void 0 : _k.fragment) == null ? void 0 : _l.string) == null ? void 0 : _m.raw) != null ? _q : (_p = (_o = (_n = asset.preview.base.reference) == null ? void 0 : _n.fragment) == null ? void 0 : _o.string) == null ? void 0 : _p.raw) != null ? _u : (_t = (_s = (_r = asset.original.reference) == null ? void 0 : _r.file) == null ? void 0 : _s.string) == null ? void 0 : _t.raw) != null ? _y : (_x = (_w = (_v = asset.preview.base.reference) == null ? void 0 : _v.file) == null ? void 0 : _w.string) == null ? void 0 : _x.raw, - //@ts-ignore what the hell i don't even know anymore this is all randy's fault and we are shipping TOMORROW so i guess this is okay - language: rawFormat != null ? rawFormat : ((_z = asset.original.reference) == null ? void 0 : _z.classification.specific) || "ts" /* Ts */, - time: asset.created.readable || "Unknown Time", - created: asset.created.value, - description: asset.description - }); + const format = (_f = asset.formats.iterable) == null ? void 0 : _f.find((e) => e.id === ocrid); + const bytes = new Uint8Array((_i = (_h = (_g = format == null ? void 0 : format.file) == null ? void 0 : _g.bytes) == null ? void 0 : _h.raw) != null ? _i : []); + rawText = decoder.decode(bytes); + rawFormat = format == null ? void 0 : format.classification.specific; + } + snippets.push({ + title: asset.name || "Unnamed Asset", + id: asset.id, + type: ((_j = asset.original.reference) == null ? void 0 : _j.classification.generic) || "Unknown Type", + raw: (_y = (_u = (_q = rawText != null ? rawText : (_m = (_l = (_k = asset.original.reference) == null ? void 0 : _k.fragment) == null ? void 0 : _l.string) == null ? void 0 : _m.raw) != null ? _q : (_p = (_o = (_n = asset.preview.base.reference) == null ? void 0 : _n.fragment) == null ? void 0 : _o.string) == null ? void 0 : _p.raw) != null ? _u : (_t = (_s = (_r = asset.original.reference) == null ? void 0 : _r.file) == null ? void 0 : _s.string) == null ? void 0 : _t.raw) != null ? _y : (_x = (_w = (_v = asset.preview.base.reference) == null ? void 0 : _v.file) == null ? void 0 : _w.string) == null ? void 0 : _x.raw, + //@ts-ignore + language: rawFormat != null ? rawFormat : ((_z = asset.original.reference) == null ? void 0 : _z.classification.specific) || "ts" /* Ts */, + time: asset.created.readable || "Unknown Time", + created: asset.created.value, + description: asset.description }); - fetching.push(Promise.all(formatFetching)); } return { - snippets, - fetching + snippets }; }; -var fetchFormatTransferable = ({ +var fetchFormatTransferable = async ({ format, asset, retryCount = 0 @@ -19100,7 +19094,7 @@ var fetchFormatTransferable = ({ }; // src/settings/index.ts -var import_obsidian9 = require("obsidian"); +var import_obsidian10 = require("obsidian"); // src/actions/login.ts var notifications2 = Notifications.getInstance(); @@ -19150,7 +19144,7 @@ var youtube_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAADwAAAAhwCAM var twitter_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAGlCAYAAACMQU46AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAA8KUlEQVR42u3deXycdb3+/+t9T5LumUlXaDJp2RStAlo3FFERRARFOFI3KJZmEhZBQY4clZ9Ejx45KiAoSzppEdyrKIIgrrjjQTaBokLpMjMNtIVmJumaZO73748Wv4gsTTP7vJ6PBw8V28zc1/2Z+Vz3J/ciAQAAAAAAAACAGmREAACFsf8VPm54wuZ98x7ODYJwZug209z2NgtnuGyGuZrc1Cz3CTIbL6lJ0tAzfsyIpEFJ/Tv/0wbd1G/yjLs9LoWZhjDy+MiW3NrMefFtpA4KAACUSPtV2Zb8OD8kEupgl71M0n67/mkr4feqS0pLelimhz20v0fMV1iD37NmUUuWvQQKAACM8ah+aOLgq+ThG93sUHc/2KQ5FfyWXdKjku6W6S7L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0i/pN27264gHv1qbmPI3IgFAAahQ+yQ3z8rb0GtCBW8w98Mke7W47wB2iz8m2R/M/Y8y+0NqXfRedVtILgAoAFVoxpUbJk9obHqdzA8LZYeZ9DpJk0im7g1Jut/lfwrc/hjmR/7II3UBUABqWbc3tM7OviwI9ErJ5sv1SkkHi6cZ1rJhk1ZIukumu9x0d/OU6P0rFtgQ0QCgANR5KWjbu/8lZjbfTK8MpfkmO5iVgqqUlewByVfI9Vd3u7ehqfmvaxbZdqIBQAHAC1vukbn9gweMWDjPTC+WNE/Sgbv+mUhAZbfFpYcD+YrQ7AGF9kDYMPIg198DoACgWKsFwZzW3Jy824EW+Dy5DnT5S0y2r6S9CKighlxaZWYPK/SHzfRIPvBHFIaPrEtMyxAPAAoAKsK85d40uDnXphHtK/PZcts7NO1r0r7a+c8c8fCjp9shaZ2kVe7+mALrC1yr5FqlBq1KpaIp7psPgAKAqrf/FT5ux7hcW2DBrNDyM+S2twc208JwhpvtZbJZLp9hO1cSYlW6mTmZ+uV60t0ftyDYqNAfM/l6t2CDe9gXsYYNPpx/PHVmrJ9RAYACADyjLGyevLm5SfkpNqxYGPHJ7sFkk08xKeqmZnOf7LLJLk3ZOchsvOT/vJrB3Sea2bin/diopGmSQkm5Z7ykS8ru+m+hTDl33y6zbSYNujQcuLIy3yHZ1l2TfNYD9WtE/R6x/szi5n6eaQ8AAAAAAAAAAAAAAAAAAACgJvz/IKgIJzypZ8cAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjMtMDUtMDlUMTk6NTA6MDErMDA6MDAbrwS+AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIzLTA1LTA5VDE5OjUwOjAxKzAwOjAwavK8AgAAAABJRU5ErkJggg=="; // src/settings/index.ts -var PiecesSettingTab = class extends import_obsidian9.PluginSettingTab { +var PiecesSettingTab = class extends import_obsidian10.PluginSettingTab { constructor(app2, plugin) { super(app2, plugin); this.cloud = CloudService.getInstance(); @@ -19161,17 +19155,17 @@ var PiecesSettingTab = class extends import_obsidian9.PluginSettingTab { const config8 = ConnectorSingleton.getInstance(); containerEl.empty(); containerEl.createEl("h1", { text: "Pieces Settings" }); - new import_obsidian9.Setting(containerEl).setName(Constants.SHOW_TUTORIAL).setDesc(Constants.TUTORIAL_DESCRIPTION).addButton( + new import_obsidian10.Setting(containerEl).setName(Constants.SHOW_TUTORIAL).setDesc(Constants.TUTORIAL_DESCRIPTION).addButton( (comp) => comp.setButtonText("Show").onClick(() => { this.plugin.showOnboarding(); }).setClass("button") ); - new import_obsidian9.Setting(containerEl).setName(Constants.TOGGLE_AUTOOPEN).setDesc(Constants.TOGGLE_AUTOOPEN_DESC).addToggle( + new import_obsidian10.Setting(containerEl).setName(Constants.TOGGLE_AUTOOPEN).setDesc(Constants.TOGGLE_AUTOOPEN_DESC).addToggle( (comp) => comp.setValue(this.plugin.settings.autoOpen).onChange(async (value) => { this.plugin.settings.autoOpen = value; }) ); - new import_obsidian9.Setting(containerEl).setName(Constants.CLOUD_SELECT).setDesc(Constants.CLOUD_SELECT_DESC).addDropdown( + new import_obsidian10.Setting(containerEl).setName(Constants.CLOUD_SELECT).setDesc(Constants.CLOUD_SELECT_DESC).addDropdown( (comp) => comp.addOptions({ blended: "Blended", local: "Local", @@ -19184,12 +19178,12 @@ var PiecesSettingTab = class extends import_obsidian9.PluginSettingTab { } ) ); - new import_obsidian9.Setting(containerEl).setName(Constants.PORT_PROMPT).addText( + new import_obsidian10.Setting(containerEl).setName(Constants.PORT_PROMPT).addText( (comp) => comp.setValue(Constants.PORT_VALUE).setDisabled(true) ).setDesc(Constants.PORT_DESCRIPTION); let user = (await config8.userApi.userSnapshot()).user; if (user) { - new import_obsidian9.Setting(containerEl).setName(Constants.LOGOUT_TITLE).setDesc(Constants.LOGOUT_DESC).addButton( + new import_obsidian10.Setting(containerEl).setName(Constants.LOGOUT_TITLE).setDesc(Constants.LOGOUT_DESC).addButton( (comp) => comp.setButtonText("Logout").onClick(async () => { const success = await logout(); if (success) { @@ -19199,7 +19193,7 @@ var PiecesSettingTab = class extends import_obsidian9.PluginSettingTab { ); this.cloud.connect({ user }); } else { - new import_obsidian9.Setting(containerEl).setName(Constants.LOGIN_TITLE).setDesc(Constants.LOGIN_DESC).addButton( + new import_obsidian10.Setting(containerEl).setName(Constants.LOGIN_TITLE).setDesc(Constants.LOGIN_DESC).addButton( (comp) => comp.setButtonText("Login").onClick(async () => { const success = await login(); user = (await config8.userApi.userSnapshot()).user; @@ -19343,9 +19337,9 @@ var DEFAULT_SETTINGS = { }; // src/ui/views/pieces-snippet-list-view.ts -var import_obsidian10 = require("obsidian"); +var import_obsidian11 = require("obsidian"); var containerVar; -var PiecesSnippetListView = class extends import_obsidian10.ItemView { +var PiecesSnippetListView = class extends import_obsidian11.ItemView { constructor(leaf, workspace) { super(leaf); this.storage = PiecesCacheSingleton.getInstance(); @@ -19364,8 +19358,7 @@ var PiecesSnippetListView = class extends import_obsidian10.ItemView { containerVar = this.containerEl.children[1]; containerVar.empty(); const { snippets } = await processAssets({ - assets: this.storage.assets, - fetch: false + assets: this.storage.assets }); createSnippetListView( containerVar, @@ -19380,7 +19373,7 @@ var PiecesSnippetListView = class extends import_obsidian10.ItemView { }; // src/actions/search.ts -var import_obsidian11 = require("obsidian"); +var import_obsidian12 = require("obsidian"); var config6 = ConnectorSingleton.getInstance(); var storage2 = PiecesCacheSingleton.getInstance(); var searching; @@ -19432,15 +19425,15 @@ var search = async ({ returnedResults.push(found_asset); } } - const snippets = (await processAssets({ assets: returnedResults, fetch: false })).snippets; - new import_obsidian11.Notice( + const snippets = (await processAssets({ assets: returnedResults })).snippets; + new import_obsidian12.Notice( `Search for '${query}' found ` + snippets.length + " result(s)." ); return snippets; } catch (error) { searching = void 0; - const snippets = (await processAssets({ assets: storage2.assets, fetch: false })).snippets; - new import_obsidian11.Notice(Constants.SEARCH_FAILURE); + const snippets = (await processAssets({ assets: storage2.assets })).snippets; + new import_obsidian12.Notice(Constants.SEARCH_FAILURE); return snippets; } }; @@ -19452,7 +19445,7 @@ var import_language = require("@codemirror/language"); // src/ui/plugins/SaveToPiecesWidget.ts var import_view = require("@codemirror/view"); -var import_obsidian12 = require("obsidian"); +var import_obsidian13 = require("obsidian"); var config7 = ConnectorSingleton.getInstance(); var storage3 = PiecesCacheSingleton.getInstance(); function truncateAfterNewline(str) { @@ -19507,8 +19500,7 @@ async function findSimilarity(codeBlock) { assetArray.push(storage3.mappedAssets[element.identifier]); }); const returnedSnippets = await processAssets({ - assets: assetArray, - fetch: false + assets: assetArray }); returnedSnippets.snippets.forEach((element) => { try { @@ -19548,23 +19540,23 @@ var SaveToPiecesWidget = class extends import_view.WidgetType { if (!this.premoExit) { if (!this.piecesPreview) { if (this.id) { - const copyButton = new import_obsidian12.ButtonComponent(holderDiv).onClick(async () => { + const copyButton = new import_obsidian13.ButtonComponent(holderDiv).onClick(async () => { const codeContent = "```" + this.lang + "\n" + this.codeBlock + "```"; copyToClipboard(codeContent); - new import_obsidian12.Notice("This code is already saved!", 5e3); - new import_obsidian12.Notice("Snippet copied to clipboard!"); + new import_obsidian13.Notice("This code is already saved!", 5e3); + new import_obsidian13.Notice("Snippet copied to clipboard!"); await sleep(1500); if (pluginSettings.autoOpen) { - const leaf = appPlugin.workspace.getLeavesOfType( + const leaf = app.workspace.getLeavesOfType( Constants.PIECES_SNIPPET_LIST_VIEW_TYPE ); if (!leaf.length) { - await appPlugin.workspace.getRightLeaf(false).setViewState({ + await app.workspace.getRightLeaf(false).setViewState({ type: Constants.PIECES_SNIPPET_LIST_VIEW_TYPE, active: true }); - appPlugin.workspace.revealLeaf( - appPlugin.workspace.getLeavesOfType( + app.workspace.revealLeaf( + app.workspace.getLeavesOfType( Constants.PIECES_SNIPPET_LIST_VIEW_TYPE )[0] ); @@ -19594,7 +19586,7 @@ var SaveToPiecesWidget = class extends import_view.WidgetType { svgElement.appendChild(pathElement); copyButton.buttonEl.innerHTML = svgElement.outerHTML; } else { - const saveButton = new import_obsidian12.ButtonComponent(holderDiv).onClick(async () => { + const saveButton = new import_obsidian13.ButtonComponent(holderDiv).onClick(async () => { const loading = holderDiv.createEl("div"); loading.addClass("share-code-bouncing-loader"); loading.createEl("div"); @@ -19610,8 +19602,8 @@ var SaveToPiecesWidget = class extends import_view.WidgetType { if (similarity < 2) { const codeContent = "```" + this.lang + "\n" + this.codeBlock + "```"; copyToClipboard(codeContent); - new import_obsidian12.Notice("This code is already saved!", 5e3); - new import_obsidian12.Notice("Snippet copied to clipboard!"); + new import_obsidian13.Notice("This code is already saved!", 5e3); + new import_obsidian13.Notice("Snippet copied to clipboard!"); } else { await createAsset( this.codeBlock, @@ -19621,16 +19613,16 @@ var SaveToPiecesWidget = class extends import_view.WidgetType { ); await sleep(1500); if (pluginSettings.autoOpen) { - const leaf = appPlugin.workspace.getLeavesOfType( + const leaf = app.workspace.getLeavesOfType( Constants.PIECES_SNIPPET_LIST_VIEW_TYPE ); if (!leaf.length) { - await appPlugin.workspace.getRightLeaf(false).setViewState({ + await app.workspace.getRightLeaf(false).setViewState({ type: Constants.PIECES_SNIPPET_LIST_VIEW_TYPE, active: true }); - appPlugin.workspace.revealLeaf( - appPlugin.workspace.getLeavesOfType( + app.workspace.revealLeaf( + app.workspace.getLeavesOfType( Constants.PIECES_SNIPPET_LIST_VIEW_TYPE )[0] ); @@ -19671,12 +19663,12 @@ var SaveToPiecesWidget = class extends import_view.WidgetType { saveButton.buttonEl.innerHTML = svgElement.outerHTML; } } else { - new import_obsidian12.ButtonComponent(holderDiv).onClick(async () => { + new import_obsidian13.ButtonComponent(holderDiv).onClick(async () => { copyToClipboard(this.codeRaw); - new import_obsidian12.Notice("Snippet copied to clipboard!"); + new import_obsidian13.Notice("Snippet copied to clipboard!"); }).setTooltip("Copy code to clipboard").setClass("save-to-pieces-btn").setIcon("copy"); } - const shareButton = new import_obsidian12.ButtonComponent(holderDiv).onClick(async () => { + const shareButton = new import_obsidian13.ButtonComponent(holderDiv).onClick(async () => { const loading = holderDiv.createEl("div"); loading.addClass("share-code-bouncing-loader"); loading.createEl("div"); @@ -19712,7 +19704,7 @@ var SaveToPiecesWidget = class extends import_view.WidgetType { }).setTooltip("Share via Pieces").setClass("save-to-pieces-btn"); shareButton.setIcon("share-2"); if (this.id && this.id != "" && storage3.mappedAssets[this.id]) { - const expandButton = new import_obsidian12.ButtonComponent(holderDiv).onClick(async () => { + const expandButton = new import_obsidian13.ButtonComponent(holderDiv).onClick(async () => { const codeContent = "```" + this.lang + `:${this.id} ` + this.codeBlock + "```"; await createExpandedView({ @@ -19874,7 +19866,6 @@ Utilize the Pieces [Flagship Desktop App](https://pieces.app) in combination wit `; // main.ts -var appPlugin; var pluginSettings; var theme = "dark"; var Prism; @@ -19889,14 +19880,14 @@ var expandId = { codeID: "", codeRaw: "" }; -var PiecesPlugin = class extends import_obsidian13.Plugin { +var PiecesPlugin = class extends import_obsidian14.Plugin { /* Saves the current editor selection to pieces */ async saveSelectionToPieces(getSimilarity) { var _a, _b; - const markdownView = this.app.workspace.getActiveViewOfType(import_obsidian13.MarkdownView); - if (markdownView) { + const markdownView = this.app.workspace.activeEditor; + if (markdownView instanceof import_obsidian14.MarkdownView) { const editor = markdownView.editor; const selection = editor.getSelection(); if (selection.length < 5) { @@ -19932,7 +19923,8 @@ var PiecesPlugin = class extends import_obsidian13.Plugin { } } async onload() { - Prism = await (0, import_obsidian13.loadPrism)(); + app = this.app; + Prism = await (0, import_obsidian14.loadPrism)(); theme = document.body.classList.contains("theme-dark") ? "dark" : "light"; document.body.addEventListener("change", (e) => { const temptheme = document.body.classList.contains("theme-dark") ? "dark" : "light"; @@ -19948,10 +19940,9 @@ var PiecesPlugin = class extends import_obsidian13.Plugin { } theme = temptheme; }); - appPlugin = this.app; await this.loadSettings(); pluginSettings = this.settings; - (0, import_obsidian13.addIcon)("pieces_logo", Constants.PIECES_LOGO); + (0, import_obsidian14.addIcon)("pieces_logo", Constants.PIECES_LOGO); updateConnectionType(this.settings); ConnectorSingleton.checkConnection({}); versionCheck({}).then((val) => { @@ -19987,10 +19978,19 @@ var PiecesPlugin = class extends import_obsidian13.Plugin { await this.saveSettings(); this.showOnboarding(); } - fetchSnippets(false).then((e) => { - setSnippetsLoaded(true); - triggerUIRedraw(false, void 0, void 0, false); - }).catch(() => { + getData().then((data) => { + if (data && data.length && !snippetsFetched) { + setSnippetsLoaded(true); + cacheAssets(data); + triggerUIRedraw(false, void 0, void 0, false); + } + }).catch((e) => { + console.log( + "Pieces: Something went wrong fetching assets from piecesdb.json ", + e + ); + }); + fetchSnippets(false).finally(() => { setSnippetsLoaded(true); triggerUIRedraw(false, void 0, void 0, false); }); @@ -20070,7 +20070,6 @@ var PiecesPlugin = class extends import_obsidian13.Plugin { } }); this.addSettingTab(new PiecesSettingTab(this.app, this)); - app = this.app; this.registerEditorExtension([codeDetectionPlugin]); } onunload() { @@ -20101,15 +20100,12 @@ var PiecesPlugin = class extends import_obsidian13.Plugin { } } activateView() { - this.app.workspace.getRightLeaf(false).setViewState({ + const PiecesLeaf = this.app.workspace.getRightLeaf(false); + PiecesLeaf.setViewState({ type: Constants.PIECES_SNIPPET_LIST_VIEW_TYPE, active: true }); - this.app.workspace.revealLeaf( - this.app.workspace.getLeavesOfType( - Constants.PIECES_SNIPPET_LIST_VIEW_TYPE - )[0] - ); + this.app.workspace.revealLeaf(PiecesLeaf); } async showOnboarding() { const leaf = await this.app.workspace.getLeaf(true); @@ -20126,6 +20122,6 @@ var fetchSnippets = (isSearch, sQuery) => { if (isSearch) { return search({ query: sQuery != null ? sQuery : "" }); } else { - return loadPieces({ notification: false }); + return loadPieces(); } }; diff --git a/manifest.json b/manifest.json index e0b5fb9..5fff7fb 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "pieces-for-developers", "name": "Pieces for Developers", - "version": "0.3.8", + "version": "0.3.9", "minAppVersion": "0.15.0", "description": "Streamline your coding workflow in Obsidian with the Pieces For Developers plugin, offering powerful features for capturing, managing, translating, and enhancing code snippets. (Closed Source) ", "author": "Pieces For Developers",