update plugin packages

This commit is contained in:
nicwands
2026-02-25 22:22:17 -05:00
parent 949f14f0e1
commit fc4ba2c487
6 changed files with 79 additions and 75 deletions

View File

@@ -1,20 +0,0 @@
"use strict";
const electron = require("electron");
const api = {
openNoteWindow: (noteId) => {
electron.ipcRenderer.send("open-note-window", noteId);
}
};
const notesAPI = {
call: (method, ...args) => electron.ipcRenderer.invoke("notesAPI:call", method, args)
};
if (process.contextIsolated) {
try {
electron.contextBridge.exposeInMainWorld("api", api);
electron.contextBridge.exposeInMainWorld("notesAPI", notesAPI);
} catch (error) {
console.error(error);
}
} else {
window.api = api;
}

19
out/preload/index.mjs Normal file
View File

@@ -0,0 +1,19 @@
import { contextBridge, ipcRenderer } from "electron";
const api = {
openNoteWindow: (noteId) => {
ipcRenderer.send("open-note-window", noteId);
}
};
const notesAPI = {
call: (method, ...args) => ipcRenderer.invoke("notesAPI:call", method, args)
};
if (process.contextIsolated) {
try {
contextBridge.exposeInMainWorld("api", api);
contextBridge.exposeInMainWorld("notesAPI", notesAPI);
} catch (error) {
console.error(error);
}
} else {
window.api = api;
}