@fileverse-dev/dsheet 4.1.23-stabilise-package-4 → 4.1.23-stabilise-package-6

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.
Files changed (23) hide show
  1. package/dist/editor/hooks/use-celldata-compaction.d.ts +21 -0
  2. package/dist/editor/utils/remote-apply-guard.d.ts +10 -13
  3. package/dist/{executeStringFunction-BsVLVYUB.js → executeStringFunction-7PJajNOY.js} +4719 -4459
  4. package/dist/formula.js +1 -1
  5. package/dist/{index-YKT7Lz7Z.js → index-CYTfmipC.js} +5938 -5864
  6. package/dist/index.es.js +20 -20
  7. package/dist/sheet-engine/core/api/cell.d.ts +8 -3
  8. package/dist/sheet-engine/core/modules/formula-dep-text.d.ts +23 -0
  9. package/dist/sheet-engine/core/modules/formula-dep-text.test.d.ts +1 -0
  10. package/dist/sheet-engine/core/modules/formula-edge-update.d.ts +13 -0
  11. package/dist/sheet-engine/core/modules/formula-transitive-deps.d.ts +24 -3
  12. package/dist/sheet-engine/core/modules/formula-warmup.d.ts +4 -8
  13. package/dist/sheet-engine/core/modules/formula.d.ts +22 -0
  14. package/dist/sheet-engine/core/modules/history-celldata.d.ts +25 -0
  15. package/dist/sheet-engine/core/modules/rowcol-refused-edit.test.d.ts +1 -0
  16. package/dist/sheet-engine/core/modules/rowcol-unloaded-history.test.d.ts +1 -0
  17. package/dist/sheet-engine/react/components/NotationBoxes/shown-comments.d.ts +5 -1
  18. package/dist/sheet-engine/react/components/SheetOverlay/hover-tracker.d.ts +5 -1
  19. package/dist/{use-xlsx-import-impl-8Lojcck9.js → use-xlsx-import-impl-C1HeHhb9.js} +4 -4
  20. package/dist/{xlsx-defined-names-D3F23p2Z.js → xlsx-defined-names-k0uTgLHs.js} +2 -2
  21. package/dist/{xlsx-export-impl-DXWvjnk5.js → xlsx-export-impl-93M1pRiV.js} +4 -4
  22. package/dist/{xlsx-hyperlink-inline-07QbQDEt.js → xlsx-hyperlink-inline-C88tUQTK.js} +2 -2
  23. package/package.json +1 -1
@@ -3,6 +3,10 @@ import { WorkbookInstance, Sheet } from '../../sheet-engine/react';
3
3
  import { planYdocCompaction } from '../utils/compact-committed-celldata';
4
4
 
5
5
  import * as Y from 'yjs';
6
+ /** Wait before a refused or stopped run is tried again. */
7
+ export declare const COMPACTION_RETRY_MS = 30000;
8
+ /** Tries after the first run; the compaction is also retried on a later open. */
9
+ export declare const COMPACTION_MAX_RETRIES = 10;
6
10
  type UseCelldataCompactionArgs = {
7
11
  dsheetId: string;
8
12
  ydocRef: RefObject<Y.Doc | null>;
@@ -26,6 +30,23 @@ export declare function canRunCompaction(refs: {
26
30
  remoteUpdateRef: MutableRefObject<boolean>;
27
31
  structuralRemountPendingRef?: MutableRefObject<boolean>;
28
32
  }, collabSyncing: boolean): boolean;
33
+ /**
34
+ * Runs `attempt` and, when it asks for a retry (the gate was closed, or a run
35
+ * stopped because the document changed), calls `retry` after `delayMs`, up to
36
+ * `maxRetries` times. Without it a refused run waited for the next open, so
37
+ * compaction made one chunk of progress per open (PR 466 N10).
38
+ */
39
+ export declare function createCompactionRetrier({ attempt, retry, delayMs, maxRetries, setTimer, clearTimer, }: {
40
+ attempt: () => Promise<'done' | 'retry'>;
41
+ retry: () => void;
42
+ delayMs?: number;
43
+ maxRetries?: number;
44
+ setTimer?: (cb: () => void, ms: number) => ReturnType<typeof setTimeout>;
45
+ clearTimer?: (handle: ReturnType<typeof setTimeout>) => void;
46
+ }): {
47
+ run(): Promise<void>;
48
+ cancel(): void;
49
+ };
29
50
  /**
30
51
  * Applies the plan chunk by chunk, yielding between chunks. The plan was made
31
52
  * from the document as it was, and one change in it, the whole-value
@@ -34,26 +34,23 @@ export type StructuralRemountRefs = RemoteApplyGuardRefs & {
34
34
  /**
35
35
  * Debounced structural remount under the remote-apply guard.
36
36
  *
37
- * The guard is begun once, right before `run`, and ended after paint, so each
38
- * remount owns exactly one begin and one end. It is NOT held while the timer
39
- * is merely pending or deferred by a cell edit: `remoteUpdateRef` makes
40
- * handleChange and the data-block work in afterUpdateCell drop local work, so
41
- * holding it across an edit would drop the user's typed edit. (The cell write
42
- * in afterUpdateCell and the commit-time write do not check it.) What must not
43
- * run while a remount is pending is the engine → Yjs echo hooks, which diff
44
- * the old grid against Yjs: they check `shouldSkipEchoWrite`. Events that
45
- * land while one is pending only re-arm its timer.
37
+ * Each pending remount owns exactly one begin and one end (B1): the guard is
38
+ * begun when the remount becomes pending (no remount was pending before),
39
+ * held while the timer is pending or deferred by a cell edit (B3), and ended
40
+ * after paint once `run` has finished. Events that land while one is pending
41
+ * only re-arm its timer.
46
42
  *
47
43
  * While `isEditing()` is true at fire time the timer re-arms (250 ms) and the
48
- * pending flag is kept; the remount runs once the edit ends.
44
+ * pending flag and guard depth are kept; the remount runs once the edit ends.
45
+ * The typed cell itself is still written: the commit-time write and the cell
46
+ * write in afterUpdateCell do not check the guard.
49
47
  */
50
48
  export declare function scheduleStructuralRemount(refs: StructuralRemountRefs, run: () => void, delayMs?: number, isEditing?: () => boolean): void;
51
49
  /** Re-arm interval while a cell edit blocks the remount. */
52
50
  export declare const STRUCTURAL_REMOUNT_EDIT_RETRY_MS = 250;
53
51
  /**
54
- * Drop a pending structural remount (observer teardown). The guard is only
55
- * held while `run` executes and until paint afterwards, so there is nothing
56
- * to release here.
52
+ * Drop a pending structural remount (observer teardown) and release the
53
+ * guard begun for it.
57
54
  */
58
55
  export declare function cancelStructuralRemount(refs: StructuralRemountRefs): void;
59
56
  /**