@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.
@@ -7005,7 +7005,7 @@ var vo = class {
7005
7005
  }
7006
7006
  loadSheet(e, t, n) {
7007
7007
  let r = this.sheetsData.get(e);
7008
- if (r) return t(this.snapshot(e, r, So(r), !0)), r.loading ?? Promise.resolve();
7008
+ if (r) return r.loading && !r.done ? r.loading.then(() => t(this.snapshot(e, r, So(r), !0))) : (t(this.snapshot(e, r, So(r), !0)), r.loading ?? Promise.resolve());
7009
7009
  let i = new vo();
7010
7010
  return this.sheetsData.set(e, i), i.loading = (async () => {
7011
7011
  let r = this.sheets[e];
@@ -79,7 +79,8 @@ export declare class XlsxWorkbook {
79
79
  private loadSst;
80
80
  /**
81
81
  * Streams a sheet into memory, reporting progress so the UI can grow while parsing.
82
- * Calling again for a loaded/in-flight sheet is a no-op.
82
+ * Calling again for a loaded sheet replays its state; for a sheet still parsing (for another caller) the state is
83
+ * reported once the parse is done — its header isn't known before, and the view keeps the first header it gets.
83
84
  */
84
85
  loadSheet(index: number, emit: (p: SheetProgress) => void, onBytes?: (phase: string, loaded: number, total: number) => void): Promise<void>;
85
86
  private snapshot;
@@ -7,7 +7,7 @@ export declare function useSize<T extends HTMLElement>(): [React.RefObject<T | n
7
7
  w: number;
8
8
  h: number;
9
9
  }];
10
- /** Scroll position of an element, batched to animation frames. */
10
+ /** Scroll position of an element, batched to animation frames. Follows the element when it mounts after the first render. */
11
11
  export declare function useScroll(ref: React.RefObject<HTMLElement | null>): {
12
12
  x: number;
13
13
  y: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@p10node/office-engine",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Browser engine to view DOCX, XLSX, PPTX progressively (worker-based, range-loading, virtualized React views)",
5
5
  "type": "module",
6
6
  "license": "MIT",