From f70098fde9e33a33c9b26e1358d0d6527e9b2566 Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Fri, 13 Jan 2023 01:45:22 +0100 Subject: [PATCH] Remove built files --- heynote-electron/dist-electron/main/index.js | 79 ------------------- .../dist-electron/main/index.js.map | 1 - .../dist-electron/preload/index.js | 79 ------------------- .../dist-electron/preload/index.js.map | 1 - 4 files changed, 160 deletions(-) delete mode 100644 heynote-electron/dist-electron/main/index.js delete mode 100644 heynote-electron/dist-electron/main/index.js.map delete mode 100644 heynote-electron/dist-electron/preload/index.js delete mode 100644 heynote-electron/dist-electron/preload/index.js.map diff --git a/heynote-electron/dist-electron/main/index.js b/heynote-electron/dist-electron/main/index.js deleted file mode 100644 index 7689239..0000000 --- a/heynote-electron/dist-electron/main/index.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -const electron = require("electron"); -const node_os = require("node:os"); -const node_path = require("node:path"); -process.env.DIST_ELECTRON = node_path.join(__dirname, ".."); -process.env.DIST = node_path.join(process.env.DIST_ELECTRON, "../dist"); -process.env.PUBLIC = process.env.VITE_DEV_SERVER_URL ? node_path.join(process.env.DIST_ELECTRON, "../public") : process.env.DIST; -if (node_os.release().startsWith("6.1")) - electron.app.disableHardwareAcceleration(); -if (process.platform === "win32") - electron.app.setAppUserModelId(electron.app.getName()); -if (!electron.app.requestSingleInstanceLock()) { - electron.app.quit(); - process.exit(0); -} -let win = null; -const preload = node_path.join(__dirname, "../preload/index.js"); -const url = process.env.VITE_DEV_SERVER_URL; -const indexHtml = node_path.join(process.env.DIST, "index.html"); -async function createWindow() { - win = new electron.BrowserWindow({ - title: "Main window", - icon: node_path.join(process.env.PUBLIC, "favicon.ico"), - webPreferences: { - preload, - nodeIntegration: true, - contextIsolation: false - } - }); - if (process.env.VITE_DEV_SERVER_URL) { - win.loadURL(url); - } else { - win.loadFile(indexHtml); - } - win.webContents.on("did-finish-load", () => { - win == null ? void 0 : win.webContents.send("main-process-message", new Date().toLocaleString()); - }); - win.webContents.setWindowOpenHandler(({ url: url2 }) => { - if (url2.startsWith("https:")) - electron.shell.openExternal(url2); - return { action: "deny" }; - }); -} -electron.app.whenReady().then(createWindow); -electron.app.on("window-all-closed", () => { - win = null; - if (process.platform !== "darwin") - electron.app.quit(); -}); -electron.app.on("second-instance", () => { - if (win) { - if (win.isMinimized()) - win.restore(); - win.focus(); - } -}); -electron.app.on("activate", () => { - const allWindows = electron.BrowserWindow.getAllWindows(); - if (allWindows.length) { - allWindows[0].focus(); - } else { - createWindow(); - } -}); -electron.ipcMain.handle("open-win", (_, arg) => { - const childWindow = new electron.BrowserWindow({ - webPreferences: { - preload, - nodeIntegration: true, - contextIsolation: false - } - }); - if (process.env.VITE_DEV_SERVER_URL) { - childWindow.loadURL(`${url}#${arg}`); - } else { - childWindow.loadFile(indexHtml, { hash: arg }); - } -}); -//# sourceMappingURL=index.js.map diff --git a/heynote-electron/dist-electron/main/index.js.map b/heynote-electron/dist-electron/main/index.js.map deleted file mode 100644 index ad7fca1..0000000 --- a/heynote-electron/dist-electron/main/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../../electron/main/index.ts"],"sourcesContent":["import { app, BrowserWindow, shell, ipcMain, Menu } from 'electron'\nimport { release } from 'node:os'\nimport { join } from 'node:path'\n\n// The built directory structure\n//\n// ├─┬ dist-electron\n// │ ├─┬ main\n// │ │ └── index.js > Electron-Main\n// │ └─┬ preload\n// │ └── index.js > Preload-Scripts\n// ├─┬ dist\n// │ └── index.html > Electron-Renderer\n//\nprocess.env.DIST_ELECTRON = join(__dirname, '..')\nprocess.env.DIST = join(process.env.DIST_ELECTRON, '../dist')\nprocess.env.PUBLIC = process.env.VITE_DEV_SERVER_URL\n ? join(process.env.DIST_ELECTRON, '../public')\n : process.env.DIST\n\n// Disable GPU Acceleration for Windows 7\nif (release().startsWith('6.1')) app.disableHardwareAcceleration()\n\n// Set application name for Windows 10+ notifications\nif (process.platform === 'win32') app.setAppUserModelId(app.getName())\n\nif (!app.requestSingleInstanceLock()) {\n app.quit()\n process.exit(0)\n}\n\n// Remove electron security warnings\n// This warning only shows in development mode\n// Read more on https://www.electronjs.org/docs/latest/tutorial/security\n// process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'\n\nlet win: BrowserWindow | null = null\n// Here, you can also use other preload\nconst preload = join(__dirname, '../preload/index.js')\nconst url = process.env.VITE_DEV_SERVER_URL\nconst indexHtml = join(process.env.DIST, 'index.html')\n\nasync function createWindow() {\n win = new BrowserWindow({\n title: 'Main window',\n icon: join(process.env.PUBLIC, 'favicon.ico'),\n //titleBarStyle: 'customButtonsOnHover',\n webPreferences: {\n preload,\n // Warning: Enable nodeIntegration and disable contextIsolation is not secure in production\n // Consider using contextBridge.exposeInMainWorld\n // Read more on https://www.electronjs.org/docs/latest/tutorial/context-isolation\n nodeIntegration: true,\n contextIsolation: false,\n },\n })\n\n if (process.env.VITE_DEV_SERVER_URL) { // electron-vite-vue#298\n win.loadURL(url)\n // Open devTool if the app is not packaged\n //win.webContents.openDevTools()\n } else {\n win.loadFile(indexHtml)\n //win.webContents.openDevTools()\n }\n\n // Test actively push message to the Electron-Renderer\n win.webContents.on('did-finish-load', () => {\n win?.webContents.send('main-process-message', new Date().toLocaleString())\n })\n\n // Make all links open with the browser, not with the application\n win.webContents.setWindowOpenHandler(({ url }) => {\n if (url.startsWith('https:')) shell.openExternal(url)\n return { action: 'deny' }\n })\n}\n\napp.whenReady().then(createWindow)\n\napp.on('window-all-closed', () => {\n win = null\n if (process.platform !== 'darwin') app.quit()\n})\n\napp.on('second-instance', () => {\n if (win) {\n // Focus on the main window if the user tried to open another\n if (win.isMinimized()) win.restore()\n win.focus()\n }\n})\n\napp.on('activate', () => {\n const allWindows = BrowserWindow.getAllWindows()\n if (allWindows.length) {\n allWindows[0].focus()\n } else {\n createWindow()\n }\n})\n\n// New window example arg: new windows url\nipcMain.handle('open-win', (_, arg) => {\n const childWindow = new BrowserWindow({\n webPreferences: {\n preload,\n nodeIntegration: true,\n contextIsolation: false,\n },\n })\n\n if (process.env.VITE_DEV_SERVER_URL) {\n childWindow.loadURL(`${url}#${arg}`)\n } else {\n childWindow.loadFile(indexHtml, { hash: arg })\n }\n})\n"],"names":["join","release","app","BrowserWindow","url","shell","ipcMain"],"mappings":";;;;AAcA,QAAQ,IAAI,gBAAgBA,UAAK,KAAA,WAAW,IAAI;AAChD,QAAQ,IAAI,OAAOA,UAAA,KAAK,QAAQ,IAAI,eAAe,SAAS;AAC5D,QAAQ,IAAI,SAAS,QAAQ,IAAI,sBAC7BA,UAAA,KAAK,QAAQ,IAAI,eAAe,WAAW,IAC3C,QAAQ,IAAI;AAGhB,IAAIC,gBAAU,EAAA,WAAW,KAAK;AAAGC,WAAA,IAAI,4BAA4B;AAGjE,IAAI,QAAQ,aAAa;AAAaA,WAAAA,IAAA,kBAAkBA,aAAI,QAAS,CAAA;AAErE,IAAI,CAACA,SAAAA,IAAI,6BAA6B;AACpCA,WAAA,IAAI,KAAK;AACT,UAAQ,KAAK,CAAC;AAChB;AAOA,IAAI,MAA4B;AAEhC,MAAM,UAAUF,UAAK,KAAA,WAAW,qBAAqB;AACrD,MAAM,MAAM,QAAQ,IAAI;AACxB,MAAM,YAAYA,UAAA,KAAK,QAAQ,IAAI,MAAM,YAAY;AAErD,eAAe,eAAe;AAC5B,QAAM,IAAIG,SAAAA,cAAc;AAAA,IACtB,OAAO;AAAA,IACP,MAAMH,UAAAA,KAAK,QAAQ,IAAI,QAAQ,aAAa;AAAA,IAE5C,gBAAgB;AAAA,MACd;AAAA,MAIA,iBAAiB;AAAA,MACjB,kBAAkB;AAAA,IACpB;AAAA,EAAA,CACD;AAEG,MAAA,QAAQ,IAAI,qBAAqB;AACnC,QAAI,QAAQ,GAAG;AAAA,EAAA,OAGV;AACL,QAAI,SAAS,SAAS;AAAA,EAExB;AAGI,MAAA,YAAY,GAAG,mBAAmB,MAAM;AAC1C,+BAAK,YAAY,KAAK,wBAAwB,IAAI,KAAK,EAAE;EAAgB,CAC1E;AAGD,MAAI,YAAY,qBAAqB,CAAC,EAAE,KAAAI,WAAU;AAC5CA,QAAAA,KAAI,WAAW,QAAQ;AAAGC,qBAAM,aAAaD,IAAG;AAC7C,WAAA,EAAE,QAAQ;EAAO,CACzB;AACH;AAEAF,SAAI,IAAA,UAAY,EAAA,KAAK,YAAY;AAEjCA,SAAAA,IAAI,GAAG,qBAAqB,MAAM;AAC1B,QAAA;AACN,MAAI,QAAQ,aAAa;AAAUA,aAAA,IAAI,KAAK;AAC9C,CAAC;AAEDA,SAAAA,IAAI,GAAG,mBAAmB,MAAM;AAC9B,MAAI,KAAK;AAEP,QAAI,IAAI,YAAY;AAAG,UAAI,QAAQ;AACnC,QAAI,MAAM;AAAA,EACZ;AACF,CAAC;AAEDA,SAAAA,IAAI,GAAG,YAAY,MAAM;AACjB,QAAA,aAAaC,uBAAc;AACjC,MAAI,WAAW,QAAQ;AACrB,eAAW,GAAG;EAAM,OACf;AACQ;EACf;AACF,CAAC;AAGDG,SAAA,QAAQ,OAAO,YAAY,CAAC,GAAG,QAAQ;AAC/B,QAAA,cAAc,IAAIH,uBAAc;AAAA,IACpC,gBAAgB;AAAA,MACd;AAAA,MACA,iBAAiB;AAAA,MACjB,kBAAkB;AAAA,IACpB;AAAA,EAAA,CACD;AAEG,MAAA,QAAQ,IAAI,qBAAqB;AACvB,gBAAA,QAAQ,GAAG,OAAO,KAAK;AAAA,EAAA,OAC9B;AACL,gBAAY,SAAS,WAAW,EAAE,MAAM,IAAK,CAAA;AAAA,EAC/C;AACF,CAAC;"} \ No newline at end of file diff --git a/heynote-electron/dist-electron/preload/index.js b/heynote-electron/dist-electron/preload/index.js deleted file mode 100644 index 5eb39cf..0000000 --- a/heynote-electron/dist-electron/preload/index.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -function domReady(condition = ["complete", "interactive"]) { - return new Promise((resolve) => { - if (condition.includes(document.readyState)) { - resolve(true); - } else { - document.addEventListener("readystatechange", () => { - if (condition.includes(document.readyState)) { - resolve(true); - } - }); - } - }); -} -const safeDOM = { - append(parent, child) { - if (!Array.from(parent.children).find((e) => e === child)) { - return parent.appendChild(child); - } - }, - remove(parent, child) { - if (Array.from(parent.children).find((e) => e === child)) { - return parent.removeChild(child); - } - } -}; -function useLoading() { - const className = `loaders-css__square-spin`; - const styleContent = ` -@keyframes square-spin { - 25% { transform: perspective(100px) rotateX(180deg) rotateY(0); } - 50% { transform: perspective(100px) rotateX(180deg) rotateY(180deg); } - 75% { transform: perspective(100px) rotateX(0) rotateY(180deg); } - 100% { transform: perspective(100px) rotateX(0) rotateY(0); } -} -.${className} > div { - animation-fill-mode: both; - width: 50px; - height: 50px; - background: #fff; - animation: square-spin 3s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; -} -.app-loading-wrap { - position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - display: flex; - align-items: center; - justify-content: center; - background: #282c34; - z-index: 9; -} - `; - const oStyle = document.createElement("style"); - const oDiv = document.createElement("div"); - oStyle.id = "app-loading-style"; - oStyle.innerHTML = styleContent; - oDiv.className = "app-loading-wrap"; - oDiv.innerHTML = `
`; - return { - appendLoading() { - safeDOM.append(document.head, oStyle); - safeDOM.append(document.body, oDiv); - }, - removeLoading() { - safeDOM.remove(document.head, oStyle); - safeDOM.remove(document.body, oDiv); - } - }; -} -const { appendLoading, removeLoading } = useLoading(); -domReady().then(appendLoading); -window.onmessage = (ev) => { - ev.data.payload === "removeLoading" && removeLoading(); -}; -setTimeout(removeLoading, 4999); -//# sourceMappingURL=index.js.map diff --git a/heynote-electron/dist-electron/preload/index.js.map b/heynote-electron/dist-electron/preload/index.js.map deleted file mode 100644 index ae300a5..0000000 --- a/heynote-electron/dist-electron/preload/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../../electron/preload/index.ts"],"sourcesContent":["function domReady(condition: DocumentReadyState[] = ['complete', 'interactive']) {\n return new Promise((resolve) => {\n if (condition.includes(document.readyState)) {\n resolve(true)\n } else {\n document.addEventListener('readystatechange', () => {\n if (condition.includes(document.readyState)) {\n resolve(true)\n }\n })\n }\n })\n}\n\nconst safeDOM = {\n append(parent: HTMLElement, child: HTMLElement) {\n if (!Array.from(parent.children).find(e => e === child)) {\n return parent.appendChild(child)\n }\n },\n remove(parent: HTMLElement, child: HTMLElement) {\n if (Array.from(parent.children).find(e => e === child)) {\n return parent.removeChild(child)\n }\n },\n}\n\n/**\n * https://tobiasahlin.com/spinkit\n * https://connoratherton.com/loaders\n * https://projects.lukehaas.me/css-loaders\n * https://matejkustec.github.io/SpinThatShit\n */\nfunction useLoading() {\n const className = `loaders-css__square-spin`\n const styleContent = `\n@keyframes square-spin {\n 25% { transform: perspective(100px) rotateX(180deg) rotateY(0); }\n 50% { transform: perspective(100px) rotateX(180deg) rotateY(180deg); }\n 75% { transform: perspective(100px) rotateX(0) rotateY(180deg); }\n 100% { transform: perspective(100px) rotateX(0) rotateY(0); }\n}\n.${className} > div {\n animation-fill-mode: both;\n width: 50px;\n height: 50px;\n background: #fff;\n animation: square-spin 3s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite;\n}\n.app-loading-wrap {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #282c34;\n z-index: 9;\n}\n `\n const oStyle = document.createElement('style')\n const oDiv = document.createElement('div')\n\n oStyle.id = 'app-loading-style'\n oStyle.innerHTML = styleContent\n oDiv.className = 'app-loading-wrap'\n oDiv.innerHTML = `
`\n\n return {\n appendLoading() {\n safeDOM.append(document.head, oStyle)\n safeDOM.append(document.body, oDiv)\n },\n removeLoading() {\n safeDOM.remove(document.head, oStyle)\n safeDOM.remove(document.body, oDiv)\n },\n }\n}\n\n// ----------------------------------------------------------------------\n\nconst { appendLoading, removeLoading } = useLoading()\ndomReady().then(appendLoading)\n\nwindow.onmessage = (ev) => {\n ev.data.payload === 'removeLoading' && removeLo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