diff --git a/dist/extension.zip b/dist/extension.zip index 5106474..a144f70 100644 Binary files a/dist/extension.zip and b/dist/extension.zip differ diff --git a/dist/extension/birb.js b/dist/extension/birb.js index 98b5112..e0bbfb6 100644 --- a/dist/extension/birb.js +++ b/dist/extension/birb.js @@ -976,9 +976,9 @@ // @ts-expect-error if (chrome.runtime.lastError) { // @ts-expect-error - console.error(chrome.runtime.lastError); + error(chrome.runtime.lastError); } else { - console.log("Settings saved successfully"); + log("Settings saved successfully"); } }); } @@ -1693,6 +1693,13 @@ border: none !important; } +.birb-sticky-note-input::placeholder { + font-family: "Monocraft", monospace !important; + font-size: 14px !important; + background-color: transparent !important; + color: rgba(0, 0, 0, 0.35) !important; +} + .birb-sticky-note-input:focus { outline: none !important; box-shadow: none !important; diff --git a/dist/obsidian/main.js b/dist/obsidian/main.js index 21fbfde..dcead4d 100644 --- a/dist/obsidian/main.js +++ b/dist/obsidian/main.js @@ -1736,6 +1736,13 @@ module.exports = class PocketBird extends Plugin { border: none !important; } +.birb-sticky-note-input::placeholder { + font-family: "Monocraft", monospace !important; + font-size: 14px !important; + background-color: transparent !important; + color: rgba(0, 0, 0, 0.35) !important; +} + .birb-sticky-note-input:focus { outline: none !important; box-shadow: none !important; diff --git a/dist/userscript/birb.user.js b/dist/userscript/birb.user.js index 80f2cf2..1f84ab5 100644 --- a/dist/userscript/birb.user.js +++ b/dist/userscript/birb.user.js @@ -1698,6 +1698,13 @@ border: none !important; } +.birb-sticky-note-input::placeholder { + font-family: "Monocraft", monospace !important; + font-size: 14px !important; + background-color: transparent !important; + color: rgba(0, 0, 0, 0.35) !important; +} + .birb-sticky-note-input:focus { outline: none !important; box-shadow: none !important; diff --git a/dist/vencord/birb.js b/dist/vencord/birb.js index 9680483..d951702 100644 --- a/dist/vencord/birb.js +++ b/dist/vencord/birb.js @@ -950,15 +950,15 @@ export const Birb = () => { } } - class LocalContext extends Context { - + class VencordContext extends Context { + /** * @override * @returns {Promise} */ async getSaveData() { - log("Loading save data from localStorage"); - return JSON.parse(localStorage.getItem(SAVE_KEY) ?? "{}"); + // @ts-expect-error + return await Vencord.Api.DataStore.get(SAVE_KEY) ?? {}; } /** @@ -966,14 +966,14 @@ export const Birb = () => { * @param {BirbSaveData} saveData */ async putSaveData(saveData) { - log("Saving data to localStorage"); - localStorage.setItem(SAVE_KEY, JSON.stringify(saveData)); + // @ts-expect-error + await Vencord.Api.DataStore.set(SAVE_KEY, saveData); } /** @override */ resetSaveData() { - log("Resetting save data in localStorage"); - localStorage.removeItem(SAVE_KEY); + // @ts-expect-error + Vencord.Api.DataStore.del(SAVE_KEY); } } @@ -1679,6 +1679,13 @@ export const Birb = () => { border: none !important; } +.birb-sticky-note-input::placeholder { + font-family: "Monocraft", monospace !important; + font-size: 14px !important; + background-color: transparent !important; + color: rgba(0, 0, 0, 0.35) !important; +} + .birb-sticky-note-input:focus { outline: none !important; box-shadow: none !important; @@ -2616,7 +2623,7 @@ export const Birb = () => { }); } - initializeApplication(new LocalContext()); + initializeApplication(new VencordContext()); })(); diff --git a/dist/web/birb.js b/dist/web/birb.js index 4af8e0b..e0c26be 100644 --- a/dist/web/birb.js +++ b/dist/web/birb.js @@ -1678,6 +1678,13 @@ border: none !important; } +.birb-sticky-note-input::placeholder { + font-family: "Monocraft", monospace !important; + font-size: 14px !important; + background-color: transparent !important; + color: rgba(0, 0, 0, 0.35) !important; +} + .birb-sticky-note-input:focus { outline: none !important; box-shadow: none !important; diff --git a/preview/index.html b/preview/index.html index 7a16e7a..e74e7ea 100644 --- a/preview/index.html +++ b/preview/index.html @@ -26,6 +26,6 @@
- + \ No newline at end of file diff --git a/src/context.js b/src/context.js index d52f166..a135e6f 100644 --- a/src/context.js +++ b/src/context.js @@ -181,9 +181,9 @@ export class BrowserExtensionContext extends Context { // @ts-expect-error if (chrome.runtime.lastError) { // @ts-expect-error - console.error(chrome.runtime.lastError); + error(chrome.runtime.lastError); } else { - console.log("Settings saved successfully"); + log("Settings saved successfully"); } }); } @@ -276,6 +276,33 @@ export class ObsidianContext extends Context { } } +export class VencordContext extends Context { + + /** + * @override + * @returns {Promise} + */ + async getSaveData() { + // @ts-expect-error + return await Vencord.Api.DataStore.get(SAVE_KEY) ?? {}; + } + + /** + * @override + * @param {BirbSaveData} saveData + */ + async putSaveData(saveData) { + // @ts-expect-error + await Vencord.Api.DataStore.set(SAVE_KEY, saveData); + } + + /** @override */ + resetSaveData() { + // @ts-expect-error + Vencord.Api.DataStore.del(SAVE_KEY); + } +} + /** * Parse URL parameters into a key-value map * @param {string} url diff --git a/src/platforms/vencord/vencord.js b/src/platforms/vencord/vencord.js index 9b0133f..85645ad 100644 --- a/src/platforms/vencord/vencord.js +++ b/src/platforms/vencord/vencord.js @@ -1,4 +1,4 @@ import { initializeApplication } from "../../application.js"; -import { LocalContext } from "../../context.js"; +import { VencordContext } from "../../context.js"; -initializeApplication(new LocalContext()); \ No newline at end of file +initializeApplication(new VencordContext()); \ No newline at end of file diff --git a/src/stylesheet.css b/src/stylesheet.css index 9ccdd24..fd82706 100644 --- a/src/stylesheet.css +++ b/src/stylesheet.css @@ -357,6 +357,13 @@ border: none !important; } +.birb-sticky-note-input::placeholder { + font-family: "Monocraft", monospace !important; + font-size: 14px !important; + background-color: transparent !important; + color: rgba(0, 0, 0, 0.35) !important; +} + .birb-sticky-note-input:focus { outline: none !important; box-shadow: none !important;