@betteroffice/xlsx 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# @betteroffice/xlsx
|
|
2
2
|
|
|
3
|
-
Framework-free core for the BetterOffice XLSX editor —
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Framework-free core for the BetterOffice XLSX editor — the Rust engine (parse,
|
|
4
|
+
calc, render) compiled to WebAssembly and bundled in, plus display-list,
|
|
5
|
+
viewport, hit-test, and accessibility helpers. There's no separate wasm asset to
|
|
6
|
+
host.
|
|
6
7
|
|
|
7
8
|
> **Experimental (`0.0.x`).** The API is unstable and may change in any release.
|
|
8
9
|
|
|
@@ -10,6 +11,23 @@ WebAssembly and bundled in, so there is no separate asset to host.
|
|
|
10
11
|
bun add @betteroffice/xlsx
|
|
11
12
|
```
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
Most apps want the turnkey React component in
|
|
15
|
+
[`@betteroffice/xlsx-react`](https://www.npmjs.com/package/@betteroffice/xlsx-react).
|
|
16
|
+
Reach for this package directly to render a spreadsheet onto your own canvas.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { openWorkbook } from "@betteroffice/xlsx";
|
|
22
|
+
|
|
23
|
+
// parse + load into the wasm engine (calc-ready)
|
|
24
|
+
const bytes = new Uint8Array(await file.arrayBuffer());
|
|
25
|
+
const workbook = openWorkbook(bytes);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
From the returned handle you compose the geometry and rendering helpers this
|
|
29
|
+
package exports onto your own `<canvas>` 2D context — `paintDisplayList`,
|
|
30
|
+
`cellAtPoint` / `cellRect` / `rangeRect` (hit-testing), the `viewport` math,
|
|
31
|
+
`buildA11yGrid`, and `toTsv` / `fromTsv` (clipboard).
|
|
14
32
|
|
|
15
33
|
Docs: https://betteroffice.dev · Apache-2.0.
|