@p10node/office-engine 0.0.0-stage → 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 +21 -0
- package/README.md +65 -2
- package/dist/DocViewer-Cv4LaMB_.js +9342 -0
- package/dist/DocViewer-Cv4LaMB_.js.map +1 -0
- package/dist/THIRD_PARTY_LICENSES.txt +79 -0
- package/dist/assets/worker-CJfZ05I7.js.map +1 -0
- package/dist/collab-BzN1ZI-z.js +1984 -0
- package/dist/collab-BzN1ZI-z.js.map +1 -0
- package/dist/collab.js +2 -0
- package/dist/core.js +2 -0
- package/dist/default-worker-B5CGBnic.js +9193 -0
- package/dist/default-worker-B5CGBnic.js.map +1 -0
- package/dist/embed.js +83 -0
- package/dist/embed.js.map +1 -0
- package/dist/index.js +5 -0
- package/dist/office-engine.embed.js +33 -0
- package/dist/office-engine.worker.js +9092 -0
- package/dist/types/collab/codec.d.ts +3 -0
- package/dist/types/collab/docx.d.ts +166 -0
- package/dist/types/collab/hosts.d.ts +24 -0
- package/dist/types/collab/hub.d.ts +41 -0
- package/dist/types/collab/index.d.ts +43 -0
- package/dist/types/collab/pptx-ops.d.ts +60 -0
- package/dist/types/collab/pptx-worker.d.ts +35 -0
- package/dist/types/collab/pptx.d.ts +47 -0
- package/dist/types/collab/protocol.d.ts +76 -0
- package/dist/types/collab/react.d.ts +23 -0
- package/dist/types/collab/session.d.ts +115 -0
- package/dist/types/collab/transport.d.ts +47 -0
- package/dist/types/collab/xlsx-ops.d.ts +72 -0
- package/dist/types/collab/xlsx-worker.d.ts +29 -0
- package/dist/types/collab/xlsx.d.ts +51 -0
- package/dist/types/core/color.d.ts +25 -0
- package/dist/types/core/default-worker.d.ts +1 -0
- package/dist/types/core/docx/numbering.d.ts +33 -0
- package/dist/types/core/docx/parser.d.ts +126 -0
- package/dist/types/core/docx/spec.d.ts +4 -0
- package/dist/types/core/docx/styles.d.ts +63 -0
- package/dist/types/core/docx/types.d.ts +325 -0
- package/dist/types/core/docx/writer.d.ts +35 -0
- package/dist/types/core/fonts.d.ts +1 -0
- package/dist/types/core/index.d.ts +15 -0
- package/dist/types/core/opc.d.ts +56 -0
- package/dist/types/core/pptx/edit.d.ts +10 -0
- package/dist/types/core/pptx/parser.d.ts +52 -0
- package/dist/types/core/pptx/types.d.ts +238 -0
- package/dist/types/core/raw.d.ts +40 -0
- package/dist/types/core/source.d.ts +65 -0
- package/dist/types/core/theme.d.ts +11 -0
- package/dist/types/core/units.d.ts +7 -0
- package/dist/types/core/worker/client.d.ts +48 -0
- package/dist/types/core/worker/engine.d.ts +27 -0
- package/dist/types/core/worker/protocol.d.ts +112 -0
- package/dist/types/core/worker/worker.d.ts +1 -0
- package/dist/types/core/xlsx/calc.d.ts +31 -0
- package/dist/types/core/xlsx/editor.d.ts +95 -0
- package/dist/types/core/xlsx/formula/assist.d.ts +35 -0
- package/dist/types/core/xlsx/formula/catalog.d.ts +14 -0
- package/dist/types/core/xlsx/formula/dates.d.ts +23 -0
- package/dist/types/core/xlsx/formula/evaluate.d.ts +33 -0
- package/dist/types/core/xlsx/formula/fn-date.d.ts +2 -0
- package/dist/types/core/xlsx/formula/fn-logic.d.ts +3 -0
- package/dist/types/core/xlsx/formula/fn-lookup.d.ts +3 -0
- package/dist/types/core/xlsx/formula/fn-math.d.ts +3 -0
- package/dist/types/core/xlsx/formula/fn-stats.d.ts +3 -0
- package/dist/types/core/xlsx/formula/fn-text.d.ts +3 -0
- package/dist/types/core/xlsx/formula/fn.d.ts +64 -0
- package/dist/types/core/xlsx/formula/format.d.ts +5 -0
- package/dist/types/core/xlsx/formula/functions.d.ts +4 -0
- package/dist/types/core/xlsx/formula/index.d.ts +17 -0
- package/dist/types/core/xlsx/formula/lexer.d.ts +54 -0
- package/dist/types/core/xlsx/formula/parser.d.ts +53 -0
- package/dist/types/core/xlsx/formula/refs.d.ts +23 -0
- package/dist/types/core/xlsx/formula/transform.d.ts +21 -0
- package/dist/types/core/xlsx/formula/types.d.ts +59 -0
- package/dist/types/core/xlsx/formula/values.d.ts +49 -0
- package/dist/types/core/xlsx/numfmt.d.ts +11 -0
- package/dist/types/core/xlsx/structure.d.ts +31 -0
- package/dist/types/core/xlsx/styles.d.ts +17 -0
- package/dist/types/core/xlsx/types.d.ts +193 -0
- package/dist/types/core/xlsx/workbook.d.ts +94 -0
- package/dist/types/core/xml.d.ts +80 -0
- package/dist/types/core/zip.d.ts +35 -0
- package/dist/types/core/zipwrite.d.ts +9 -0
- package/dist/types/embed.d.ts +30 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/react/DocViewer.d.ts +43 -0
- package/dist/types/react/common/ContextMenu.d.ts +21 -0
- package/dist/types/react/common/Dialog.d.ts +27 -0
- package/dist/types/react/common/Slots.d.ts +18 -0
- package/dist/types/react/common/Status.d.ts +6 -0
- package/dist/types/react/common/ZoomControl.d.ts +6 -0
- package/dist/types/react/common/hooks.d.ts +20 -0
- package/dist/types/react/docx/DocxEditor.d.ts +172 -0
- package/dist/types/react/docx/DocxToolbar.d.ts +18 -0
- package/dist/types/react/docx/DocxView.d.ts +8 -0
- package/dist/types/react/docx/FindBar.d.ts +22 -0
- package/dist/types/react/docx/html.d.ts +8 -0
- package/dist/types/react/docx/render.d.ts +24 -0
- package/dist/types/react/docx/tables.d.ts +20 -0
- package/dist/types/react/edit/Toolbar.d.ts +130 -0
- package/dist/types/react/edit/input.d.ts +81 -0
- package/dist/types/react/edit/rich.d.ts +40 -0
- package/dist/types/react/injectStyles.d.ts +4 -0
- package/dist/types/react/pptx/PptxEditor.d.ts +95 -0
- package/dist/types/react/pptx/PptxToolbar.d.ts +36 -0
- package/dist/types/react/pptx/PptxView.d.ts +24 -0
- package/dist/types/react/pptx/Presenter.d.ts +9 -0
- package/dist/types/react/pptx/Slide.d.ts +28 -0
- package/dist/types/react/pptx/geometry.d.ts +5 -0
- package/dist/types/react/useDocument.d.ts +11 -0
- package/dist/types/react/xlsx/XlsxToolbar.d.ts +27 -0
- package/dist/types/react/xlsx/XlsxView.d.ts +16 -0
- package/dist/types/react/xlsx/axis.d.ts +19 -0
- package/dist/xlsx-ops-CsjNpMI0.js +244 -0
- package/dist/xlsx-ops-CsjNpMI0.js.map +1 -0
- package/package.json +80 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 p10node
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @p10node/office-engine
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
View + edit **DOCX / XLSX / PPTX** directly in the browser. Loads progressively like Google Docs, handles heavy files, one-line React embed, saves back to the original format.
|
|
4
|
+
|
|
5
|
+
**[Live demo](https://p10node.github.io/office-engine/demo/)**: samples, heavy files (300k-row sheet, 305-slide deck), drag & drop your own file, edit and download.
|
|
6
|
+
|
|
7
|
+
| DOCX | XLSX | PPTX |
|
|
8
|
+
|-------------------------------------------|-------------------------------------------|-------------------------------------------|
|
|
9
|
+
|  |  |  |
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Progressive loading**: lazy ZIP, HTTP Range requests, streaming XML parser in a Web Worker → UI never blocks
|
|
14
|
+
- **Virtualized views**: only visible pages, cells and slides render
|
|
15
|
+
- **Editing** with a Google Docs-style toolbar: DOCX text, styles, lists, images, tables; XLSX cells, formulas (134 functions), formats, borders, rows/columns, sheets; PPTX text, shapes, images, slides, slideshow
|
|
16
|
+
- **Fast save**: only edited parts are regenerated, everything else keeps its original bytes
|
|
17
|
+
- **Real-time collaboration**: live edits, avatars, collaborators' cursors, offline edits sync on reconnect
|
|
18
|
+
- **Embed anywhere**: React component, hook, vanilla `mount()`, `<office-viewer>` web component, single `<script>` file
|
|
19
|
+
|
|
20
|
+
Full list, format coverage and limitations: [Features](docs/features.md).
|
|
21
|
+
|
|
22
|
+
| File | Size | First paint | Fully loaded |
|
|
23
|
+
|--------------------------|---------|-------------|-------------------|
|
|
24
|
+
| DOCX 20k paragraphs | 1.2 MB | ~180 ms | 2073 pages in ~2s |
|
|
25
|
+
| XLSX 300k rows × 12 cols | 24.8 MB | ~330 ms | ~2s |
|
|
26
|
+
| PPTX 305 slides | 0.3 MB | ~110 ms | on-demand |
|
|
27
|
+
|
|
28
|
+
Measured in headless Chromium on Apple M-series.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
bun add @p10node/office-engine # peer: react >= 18, react-dom >= 18
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { DocViewer } from '@p10node/office-engine'
|
|
40
|
+
|
|
41
|
+
<DocViewer src={file} style={{ height: 600 }} /> // File | Blob | ArrayBuffer | Uint8Array
|
|
42
|
+
<DocViewer src="https://cdn.example.com/report.xlsx" /> // URL → Range requests
|
|
43
|
+
<DocViewer src={file} editable onSave={(blob, name) => upload(blob, name)} />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
CSS is auto-injected. Container must have a height.
|
|
47
|
+
|
|
48
|
+
Without React:
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<script src="office-engine.embed.js"></script> <!-- dist/, bundles React + worker -->
|
|
52
|
+
<office-viewer src="/files/report.docx" style="height:600px"></office-viewer>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Docs
|
|
56
|
+
|
|
57
|
+
Also online at [p10node.github.io/office-engine](https://p10node.github.io/office-engine/).
|
|
58
|
+
|
|
59
|
+
- [Features](docs/features.md): format coverage, editing, saving, limitations
|
|
60
|
+
- [API](docs/api.md): props, custom views, `mount()`, `<office-viewer>`, core API, CSP
|
|
61
|
+
- [Real-time collaboration](docs/collaboration.md)
|
|
62
|
+
- [Development](docs/development.md): playground, architecture, demo deploy, release
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
[MIT](LICENSE) © p10node
|