@p10node/office-engine 0.2.0 → 0.2.2

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 CHANGED
@@ -1,33 +1,20 @@
1
1
  # @p10node/office-engine
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@p10node/office-engine)](https://www.npmjs.com/package/@p10node/office-engine)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@p10node/office-engine)](https://www.npmjs.com/package/@p10node/office-engine)
5
+ [![CI](https://github.com/p10node/office-engine/actions/workflows/ci.yml/badge.svg)](https://github.com/p10node/office-engine/actions/workflows/ci.yml)
6
+ [![License: MIT](https://img.shields.io/npm/l/@p10node/office-engine)](LICENSE)
7
+
3
8
  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
9
 
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.
10
+ **[npm](https://www.npmjs.com/package/@p10node/office-engine)** · **[Live demo](https://p10node.github.io/office-engine/demo/)** · **[Docs](https://p10node.github.io/office-engine/)**
11
+
12
+ The demo has samples, heavy files (300k-row sheet, 305-slide deck), drag & drop your own file, edit and download.
6
13
 
7
14
  | DOCX | XLSX | PPTX |
8
15
  |-------------------------------------------|-------------------------------------------|-------------------------------------------|
9
16
  | ![DOCX editor](docs/screenshots/docx.png) | ![XLSX editor](docs/screenshots/xlsx.png) | ![PPTX editor](docs/screenshots/pptx.png) |
10
17
 
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
- - **File menu**: new, open (also CSV / text / Markdown / HTML), import CSV, rename, download as PDF / HTML / text / CSV, document details, print
18
- - **Real-time collaboration**: live edits, avatars, collaborators' cursors, offline edits sync on reconnect
19
- - **Embed anywhere**: React component, hook, vanilla `mount()`, `<office-viewer>` web component, single `<script>` file
20
-
21
- Full list, format coverage and limitations: [Features](docs/features.md).
22
-
23
- | File | Size | First paint | Fully loaded |
24
- |--------------------------|---------|-------------|-------------------|
25
- | DOCX 20k paragraphs | 1.2 MB | ~180 ms | 2073 pages in ~2s |
26
- | XLSX 300k rows × 12 cols | 24.8 MB | ~330 ms | ~2s |
27
- | PPTX 305 slides | 0.3 MB | ~110 ms | on-demand |
28
-
29
- Measured in headless Chromium on Apple M-series.
30
-
31
18
  ## Install
32
19
 
33
20
  ```bash
@@ -62,6 +49,26 @@ Also online at [p10node.github.io/office-engine](https://p10node.github.io/offic
62
49
  - [Real-time collaboration](docs/collaboration.md)
63
50
  - [Development](docs/development.md): playground, architecture, demo deploy, release
64
51
 
52
+ ## Features
53
+
54
+ - **Progressive loading**: lazy ZIP, HTTP Range requests, streaming XML parser in a Web Worker → UI never blocks
55
+ - **Virtualized views**: only visible pages, cells and slides render
56
+ - **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
57
+ - **Fast save**: only edited parts are regenerated, everything else keeps its original bytes
58
+ - **File menu**: new, open (also CSV / text / Markdown / HTML), import CSV, rename, download as PDF / HTML / text / CSV, document details, print
59
+ - **Real-time collaboration**: live edits, avatars, collaborators' cursors, offline edits sync on reconnect
60
+ - **Embed anywhere**: React component, hook, vanilla `mount()`, `<office-viewer>` web component, single `<script>` file
61
+
62
+ Full list, format coverage and limitations: [Features](docs/features.md).
63
+
64
+ | File | Size | First paint | Fully loaded |
65
+ |--------------------------|---------|-------------|-------------------|
66
+ | DOCX 20k paragraphs | 1.2 MB | ~180 ms | 2073 pages in ~2s |
67
+ | XLSX 300k rows × 12 cols | 24.8 MB | ~330 ms | ~2s |
68
+ | PPTX 305 slides | 0.3 MB | ~110 ms | on-demand |
69
+
70
+ Measured in headless Chromium on Apple M-series.
71
+
65
72
  ## License
66
73
 
67
74
  [MIT](LICENSE) © p10node
@@ -1,5 +1,5 @@
1
1
 
2
- import { C as e, E as t, N as n, P as r, S as i, d as a, f as o, h as s, j as c, m as l, o as u, p as d, t as f, u as p, w as m } from "./default-worker-DfpaJUjf.js";
2
+ import { C as e, E as t, N as n, P as r, S as i, d as a, f as o, h as s, j as c, m as l, o as u, p as d, t as f, u as p, w as m } from "./default-worker-BDj6MNRA.js";
3
3
  import { C as h, D as g, E as _, O as v, S as y, T as b, _ as ee, b as x, d as S, f as C, g as w, h as te, k as ne, m as re, p as ie, t as ae, v as T, w as E, x as oe, y as se } from "./collab-BvjXvfJ9.js";
4
4
  import { Children as D, Fragment as ce, createContext as le, isValidElement as O, memo as ue, useCallback as de, useContext as fe, useEffect as k, useId as pe, useInsertionEffect as me, useLayoutEffect as A, useMemo as he, useReducer as ge, useRef as j, useState as M, useSyncExternalStore as _e } from "react";
5
5
  import { createPortal as N } from "react-dom";
@@ -304,22 +304,23 @@ function ke(e) {
304
304
  let [t, n] = M({
305
305
  x: 0,
306
306
  y: 0
307
- });
308
- return k(() => {
309
- let t = e.current;
310
- if (!t) return;
311
- let r = 0, i = () => {
312
- r ||= requestAnimationFrame(() => {
313
- r = 0, n({
314
- x: t.scrollLeft,
315
- y: t.scrollTop
316
- });
307
+ }), [r, i] = M(null);
308
+ return Ee(() => {
309
+ e.current !== r && i(e.current);
310
+ }), k(() => {
311
+ if (!r) return;
312
+ let e = 0, t = () => n((e) => e.x === r.scrollLeft && e.y === r.scrollTop ? e : {
313
+ x: r.scrollLeft,
314
+ y: r.scrollTop
315
+ }), i = () => {
316
+ e ||= requestAnimationFrame(() => {
317
+ e = 0, t();
317
318
  });
318
319
  };
319
- return t.addEventListener("scroll", i, { passive: !0 }), () => {
320
- t.removeEventListener("scroll", i), cancelAnimationFrame(r);
320
+ return t(), r.addEventListener("scroll", i, { passive: !0 }), () => {
321
+ r.removeEventListener("scroll", i), cancelAnimationFrame(e);
321
322
  };
322
- }, [e]), t;
323
+ }, [r]), t;
323
324
  }
324
325
  function U(e, n, r = !0) {
325
326
  let [i, a] = M(null);
@@ -10566,4 +10567,4 @@ function Ca(e) {
10566
10567
  }
10567
10568
  export { ea as a, li as c, bn as d, ma as i, dr as l, _a as n, Ci as o, va as r, Si as s, Ca as t, lr as u };
10568
10569
 
10569
- //# sourceMappingURL=DocViewer-PJieqbIR.js.map
10570
+ //# sourceMappingURL=DocViewer-Co7q5D2H.js.map