@namahapdf/sheets 0.1.0
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/LICENSE +16 -0
- package/README.md +40 -0
- package/dist/index.cjs +74 -0
- package/dist/index.d.cts +546 -0
- package/dist/index.d.ts +546 -0
- package/dist/index.js +74 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
NamahaPDF SDK License (Proprietary)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NamahaPDF. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software (the "SDK") is licensed, not sold. Use of the SDK in any application
|
|
6
|
+
requires a valid commercial license key issued by NamahaPDF. Without a valid key the
|
|
7
|
+
SDK operates in a restricted, watermarked evaluation mode and may not be used in
|
|
8
|
+
production.
|
|
9
|
+
|
|
10
|
+
You may NOT, except to the extent permitted by your commercial license agreement:
|
|
11
|
+
remove, disable, or circumvent the license enforcement or watermarking; redistribute,
|
|
12
|
+
sublicense, or resell the SDK; or use the SDK beyond the scope (domains, seats,
|
|
13
|
+
features, term) granted by your license.
|
|
14
|
+
|
|
15
|
+
THE SDK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. To obtain a license, see
|
|
16
|
+
https://namahapdf.com/sdk.
|
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# @namahapdf/sheets
|
|
2
|
+
|
|
3
|
+
Headless, in-browser **Excel engine** — parse and render `.xlsx` on a virtualized canvas
|
|
4
|
+
grid, edit with faithful write-back, and project to an AI-readable model. Fully
|
|
5
|
+
on-device, framework-agnostic. Part of the **NamahaPDF SDK**.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i @namahapdf/sheets
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { XlsxEditSession, SheetRenderer, configureLicense } from '@namahapdf/sheets';
|
|
13
|
+
|
|
14
|
+
// Apply your license key (without one, exports are watermarked + features limited).
|
|
15
|
+
configureLicense({ licenseKey: 'YOUR_KEY' });
|
|
16
|
+
|
|
17
|
+
// Load a workbook into an editing session, edit by intents, save a faithful .xlsx.
|
|
18
|
+
const session = await XlsxEditSession.load('book.xlsx', bytes);
|
|
19
|
+
await session.apply([
|
|
20
|
+
{ op: 'set-cell', anchor: { fmt: 'xlsx', sheetPart: 'xl/worksheets/sheet1.xml', row: 1, col: 1 }, row: 1, col: 1, newText: '5000000' },
|
|
21
|
+
{ op: 'format-cell', anchor: { fmt: 'xlsx', sheetPart: 'xl/worksheets/sheet1.xml', row: 1, col: 1 }, row: 1, col: 1, format: { bold: true, numFmt: '$#,##0.00' } },
|
|
22
|
+
]);
|
|
23
|
+
const editedBytes = session.bytes; // still a valid .xlsx
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Edits flow through a small, JSON-serializable **`EditPlan`** vocabulary (`set-cell`,
|
|
27
|
+
`clear-cell`, `format-cell`, `set-column-width`) applied as surgical XML splices on the
|
|
28
|
+
original package, so everything the plan doesn't touch is preserved byte-for-byte. The
|
|
29
|
+
same plan an LLM emits (validate it with `validateEditPlan`) is the plan the UI emits.
|
|
30
|
+
|
|
31
|
+
- **`XlsxDocument`** — `.xlsx` → a sparse `SheetModel` (styles, merges, number formats;
|
|
32
|
+
formulas carry their cached value — no evaluator by design).
|
|
33
|
+
- **`SheetRenderer`** — a viewport-only virtualized canvas grid (scales to 100k+ rows).
|
|
34
|
+
- **`applyXlsxPlan` / `XlsxEditSession`** — write-back (intent-sourced, undo/redo). A
|
|
35
|
+
value edit sets `fullCalcOnLoad`, so Excel recalculates dependents on open.
|
|
36
|
+
- **`formatValue`** — the in-house number-format subset (currency, %, dates, …).
|
|
37
|
+
|
|
38
|
+
Get a license key at **namahapdf.com/sdk**. Free to download but watermarked and
|
|
39
|
+
feature-limited until a valid key is applied. A ready-made React sheet editor in
|
|
40
|
+
**@namahapdf/react** is planned.
|