diff --git a/docz/docs/03-demos/19-desktop/01-electron.md b/docz/docs/03-demos/19-desktop/01-electron.md index dff29fb..60dfbbf 100644 --- a/docz/docs/03-demos/19-desktop/01-electron.md +++ b/docz/docs/03-demos/19-desktop/01-electron.md @@ -279,7 +279,7 @@ The program will run on ARM64 Windows. | `win10-x64` |`.\out\sheetjs-electron-win32-x64\sheetjs-electron.exe` | | `win11-arm` |`.\out\sheetjs-electron-win32-x64\sheetjs-electron.exe` | | `linux-x64` |`./out/sheetjs-electron-linux-x64/sheetjs-electron` | -| `linux-x64` |`./out/sheetjs-electron-linux-arm64/sheetjs-electron` | +| `linux-arm` |`./out/sheetjs-electron-linux-arm64/sheetjs-electron` | #### Electron API diff --git a/docz/docs/03-demos/19-desktop/02-nwjs.md b/docz/docs/03-demos/19-desktop/02-nwjs.md index bfb8526..70a2ada 100644 --- a/docz/docs/03-demos/19-desktop/02-nwjs.md +++ b/docz/docs/03-demos/19-desktop/02-nwjs.md @@ -117,7 +117,7 @@ This demo was tested in the following environments: | macOS 14.5 | `darwin-arm` | `0.88.0` | 2024-05-28 | | | Windows 10 | `win10-x64` | `0.83.0` | 2024-03-04 | | | Windows 11 | `win11-arm` | `0.88.0` | 2024-05-28 | | -| Linux (HoloOS) | `linux-x64` | `0.85.0` | 2024-03-12 | | +| Linux (HoloOS) | `linux-x64` | `0.89.0` | 2024-07-07 | | | Linux (Debian) | `linux-arm` | `0.60.0` | 2024-05-23 | Unofficial build[^1] | ::: @@ -138,7 +138,7 @@ cd sheetjs-nwjs "version": "0.0.0", "main": "index.html", "dependencies": { - "nw": "0.88.0", + "nw": "0.89.0", "xlsx": "https://cdn.sheetjs.com/xlsx-${current}/xlsx-${current}.tgz" } }`} @@ -182,9 +182,15 @@ file can be opened in Excel or another spreadsheet editor. 5) To build a standalone app, run the builder: ```bash -npx -p nw-builder nwbuild --mode=build --version=0.88.0 --glob=false --outDir=../out ./ +npx -p nw-builder nwbuild --mode=build --version=0.89.0 --glob=false --outDir=../out ./ ``` This will generate the standalone app in the `..\out\` folder. +6) Launch the generated application: + +| Architecture | Command | +|:-------------|:--------------------------------------------------------------| +| `linux-x64` | `../out/sheetjs-nwjs` | + [^1]: The [`nw60-arm64_2022-01-08` release](https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/tag/nw60-arm64_2022-01-08) included an ARM64 version of `nw`. \ No newline at end of file diff --git a/docz/docs/03-demos/27-local/02-websql.md b/docz/docs/03-demos/27-local/02-websql.md index 5074fce..3c14ad3 100644 --- a/docz/docs/03-demos/27-local/02-websql.md +++ b/docz/docs/03-demos/27-local/02-websql.md @@ -11,17 +11,28 @@ import CodeBlock from '@theme/CodeBlock'; :::danger pass -WebSQL is no longer enabled by default in Chrome. Chrome 123 will officially -remove support. For SQL in the browser, there are a few alternatives: +WebSQL is no longer supported in Chrome or Safari. + +For SQL in the browser, there are a few alternatives: - [SQL.js](/docs/demos/data/sqlite#browser) is a compiled version of SQLite - [AlaSQL](/docs/demos/data/alasql) is a pure-JS SQL engine backed by IndexedDB ::: -WebSQL (formally "Web SQL Database") is a popular SQL-based in-browser database -available in Chromium and related browsers including Google Chrome. In practice, -it is powered by SQLite. Many SQLite-compatible queries work as-is in WebSQL. +WebSQL (formally "Web SQL Database") was a popular SQL-based in-browser database +available in Chromium and Safari. In practice, it was powered by SQLite. Many +SQLite-compatible queries were supported by WebSQL engines. + +:::note Historical Context + +Google and Apple developed and supported WebSQL. Legacy browser vendors fought +against standardization and ultimately broke the web by forcing the deprecation +of the storied API. + +Leveraging new technologies, many websites ship with an in-browser SQL database. + +::: The public demo https://sheetjs.com/sql generates a database from workbook. diff --git a/docz/docs/07-csf/03-sheet.md b/docz/docs/07-csf/03-sheet.md index 8c39773..599917b 100644 --- a/docz/docs/07-csf/03-sheet.md +++ b/docz/docs/07-csf/03-sheet.md @@ -17,10 +17,38 @@ Excel supports 4 different types of "sheets": Generic sheets are plain JavaScript objects. Each key that does not start with `!` is an `A1`-style address whose corresponding value is a cell object. +### Worksheet Range + +The `!ref` property stores the [A1-style range](/docs/csf/general#a1-style-1). + +Functions that work with sheets should use this property to determine the range. +Cells that are assigned outside of the range are not processed. + +For example, in the following sparse worksheet, the cell `A3` will be ignored +since it is outside of the worksheet range (`A1:B2`): + +```js +var ws = { + // worksheet range is A1:B2 + "!ref": "A1:B2", + + // A1 is in the range and will be included + "A1": { t: "s", v: "SheetJS" }, + + // cell A3 is outside of the range and will be ignored + "A3": { t: "n", v: 5433795 }, +}; +``` + +[Utility functions](/docs/api/utilities/) and functions that handle sheets +should test for the presence of the `!ref` field. If the `!ref` is omitted or is +not a valid range, functions should treat the sheet as empty. + ### Cell Storage -By default, the parsers and utility functions generate "sparse-mode" worksheet -objects. `sheet[address]` returns the cell object for the specified address. +By default, the parsers and utility functions generate "sparse-mode" worksheets. +For a given [A1-style address](/docs/csf/general#a1-style), `sheet[ref]` is the +corresponding cell object. #### Dense Mode @@ -127,27 +155,13 @@ _`json_to_sheet`_ +var sheet = XLSX.utils.json_to_sheet([{x:1,y:2}], {...opts, dense: true}); ``` - - ### Sheet Properties Each key starts with `!`. The properties are accessible as `sheet[key]`. -- `sheet['!ref']`: A-1 based range representing the sheet range. Functions that - work with sheets should use this parameter to determine the range. Cells that - are assigned outside of the range are not processed. In particular, when - writing a sheet by hand, cells outside of the range are not included - - Functions that handle sheets should test for the presence of `!ref` field. - If the `!ref` is omitted or is not a valid range, functions are free to treat - the sheet as empty or attempt to guess the range. The standard utilities that - ship with this library treat sheets as empty (for example, the CSV output is - empty string). - - When reading a worksheet with the `sheetRows` property set, the ref parameter - will use the restricted range. The original range is set at `ws['!fullref']` +- `sheet['!ref']`: [A1-style sheet range string](#worksheet-range) - `sheet['!margins']`: Object representing the page margins. The default values follow Excel's "normal" preset. Excel also has a "wide" and a "narrow" preset diff --git a/docz/docs/07-csf/index.md b/docz/docs/07-csf/index.md index 81a7576..03a2004 100644 --- a/docz/docs/07-csf/index.md +++ b/docz/docs/07-csf/index.md @@ -14,6 +14,19 @@ features are only accessible by inspecting and modifying the objects directly. This section covers the JS representation of workbooks, worksheets, cells, ranges, addresses and other features. +:::info Historical Context + +[Web Workers](/docs/demos/bigdata/worker), a popular API for parallelism in the +web browser, uses message passing. The "structured clone algorithm"[^1] is used +to pass data between the main renderer thread and Worker instances. + +The structured clone algorithm does not preserve functions or prototypes. + +In the SheetJS data model, each structure is a simple object. There are no +classes or prototype methods. + +::: + ### Contents