From 3c8a75c5e37a81dec5366eac4db992a9705b7839 Mon Sep 17 00:00:00 2001 From: SheetJS Date: Mon, 7 Nov 2022 18:23:05 -0500 Subject: [PATCH] electron19 --- docz/docs/03-demos/03-desktop.md | 4 ++-- docz/docs/03-demos/05-database.md | 7 +------ docz/docs/03-demos/32-clipboard.md | 20 +++++++++++++++++--- docz/docs/03-demos/41-nosql.md | 2 -- docz/static/electron/package.json | 14 +++++++------- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/docz/docs/03-demos/03-desktop.md b/docz/docs/03-demos/03-desktop.md index 0e02c7b..930f28f 100644 --- a/docz/docs/03-demos/03-desktop.md +++ b/docz/docs/03-demos/03-desktop.md @@ -137,7 +137,7 @@ from the main or the renderer thread. Electron presents a `fs` module. The `require('xlsx')` call loads the CommonJS module, so `XLSX.readFile` and `XLSX.writeFile` work in the renderer thread. -This demo was tested against Electron 19.0.5 on an Intel Mac (`darwin-x64`). +This demo was tested on 2022 November 07 with Electron 21.2.2 on `darwin-x64`.
Complete Example (click to show) @@ -327,7 +327,7 @@ function importFile(workbook) { ### Electron Breaking Changes The first version of this demo used Electron 1.7.5. The current demo includes -the required changes for Electron 19.0.5. +the required changes for Electron 19.2.2. There are no Electron-specific workarounds in the library, but Electron broke backwards compatibility multiple times. A summary of changes is noted below. diff --git a/docz/docs/03-demos/05-database.md b/docz/docs/03-demos/05-database.md index b053e48..f18dc80 100644 --- a/docz/docs/03-demos/05-database.md +++ b/docz/docs/03-demos/05-database.md @@ -377,7 +377,7 @@ XLSX.writeFile(wb, "bun.xlsx"); -[`sqlite` library](https://deno.land/x/sqlite/) returns raw arrays of arrays. +Deno `sqlite` library returns raw arrays of arrays. 1) Save the following to `deno.ts`: @@ -429,11 +429,6 @@ XLSX.writeFile(wb, "deno.xlsx"); This information is included for legacy deployments. Web SQL is deprecated. - has up-to-date info on browser support. -[Firefox](https://nolanlawson.com/2014/04/26/web-sql-database-in-memoriam/) -never supported Web SQL. Safari 13 dropped support. As of the time of writing, -the current Chrome version (103) supports WebSQL. - :::: WebSQL was a popular SQL-based in-browser database available on Chrome. In diff --git a/docz/docs/03-demos/32-clipboard.md b/docz/docs/03-demos/32-clipboard.md index 28084da..1210dbd 100644 --- a/docz/docs/03-demos/32-clipboard.md +++ b/docz/docs/03-demos/32-clipboard.md @@ -180,8 +180,7 @@ function ClipboardWrite() { ## Electron -Electron [Clipboard API](https://www.electronjs.org/docs/latest/api/clipboard) -supports HTML and RTF clipboards. +Electron Clipboard API supports HTML and RTF clipboards. There are special methods for specific clipboard types: @@ -193,6 +192,21 @@ There are special methods for specific clipboard types: Each method operates on JS strings. +`clipboard.write` can assign to multiple clipboard types: + +```js +const { clipboard } = require('electron'); +const XLSX = require('xlsx'); + +function copy_first_sheet_to_clipboard(workbook) { + clipboard.write({ + text: XLSX.write(wb, {type: "string", bookType: "txt"}), + rtf: XLSX.write(wb, {type: "string", bookType: "rtf"}), + html: XLSX.write(wb, {type: "string", bookType: "html"}) + }); +} +``` + :::caution Experimental Buffer Clipboard Support Electron additionally supports binary operations using `Buffer` objects. This @@ -204,7 +218,7 @@ On the `MacOS` platform, some versions of Excel store a packaged file with key a simple CFB file that can be parsed: ```js -const { clipboard } = require('electron') +const { clipboard } = require('electron'); const XLSX = require("xlsx"); const buf = clipboard.readBuffer('dyn.ah62d4qmxhk4d425try1g44pdsm11g55gsu1en5pcqzwc4y5tsz3gg3k'); const cfb = XLSX.CFB.read(buf, {type: "buffer"}); diff --git a/docz/docs/03-demos/41-nosql.md b/docz/docs/03-demos/41-nosql.md index ae96701..b5d4102 100644 --- a/docz/docs/03-demos/41-nosql.md +++ b/docz/docs/03-demos/41-nosql.md @@ -242,8 +242,6 @@ function export_pouchdb_to_xlsx(db) { 0) Download the "Working Version" from the Getting Started guide. -[ZIP](https://github.com/nickcolley/getting-started-todo/archive/master.zip) - The ZIP file should have `MD5` checksum `ac4da7cb0cade1be293ba222462f109c`: ```bash diff --git a/docz/static/electron/package.json b/docz/static/electron/package.json index b25da2e..a8963a8 100644 --- a/docz/static/electron/package.json +++ b/docz/static/electron/package.json @@ -5,7 +5,7 @@ "main": "main.js", "dependencies": { "@electron/remote": "2.0.8", - "electron-squirrel-startup": "^1.0.0", + "electron-squirrel-startup": "1.0.0", "xlsx": "https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz" }, "scripts": { @@ -14,12 +14,12 @@ "make": "electron-forge make" }, "devDependencies": { - "@electron-forge/cli": "^6.0.0-beta.64", - "@electron-forge/maker-deb": "^6.0.0-beta.64", - "@electron-forge/maker-rpm": "^6.0.0-beta.64", - "@electron-forge/maker-squirrel": "^6.0.0-beta.64", - "@electron-forge/maker-zip": "^6.0.0-beta.64", - "electron": "19.0.5" + "@electron-forge/cli": "6.0.0", + "@electron-forge/maker-deb": "6.0.0", + "@electron-forge/maker-rpm": "6.0.0", + "@electron-forge/maker-squirrel": "6.0.0", + "@electron-forge/maker-zip": "6.0.0", + "electron": "21.2.2" }, "config": { "forge": {