@fileverse-dev/dsheet 4.1.23-stabilise-package-8 → 4.1.24

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 (123) hide show
  1. package/README.md +0 -10
  2. package/dist/editor/contexts/editor-context.d.ts +0 -9
  3. package/dist/editor/hooks/use-celldata-compaction.d.ts +2 -44
  4. package/dist/editor/hooks/use-editor-data.d.ts +0 -1
  5. package/dist/editor/hooks/use-editor-sync.d.ts +1 -5
  6. package/dist/editor/types.d.ts +1 -41
  7. package/dist/editor/utils/after-update-cell.d.ts +0 -6
  8. package/dist/editor/utils/apply-comment-markers.d.ts +1 -3
  9. package/dist/editor/utils/editor-handle.d.ts +1 -1
  10. package/dist/editor/utils/remote-apply-guard.d.ts +0 -45
  11. package/dist/editor/utils/sheet-ydoc-sync-utils.d.ts +4 -13
  12. package/dist/editor/utils/update-ydoc.d.ts +1 -9
  13. package/dist/{executeStringFunction-CN6ZZqZM.js → executeStringFunction-B3Tw7e1U.js} +13166 -13690
  14. package/dist/formula.js +1 -1
  15. package/dist/{index-Dbl7Dh2_.js → index-DvpQioe4.js} +22321 -23599
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.es.js +21 -21
  18. package/dist/persistence-utils-BXFajzvq.js +98 -0
  19. package/dist/persistence-utils.d.ts +0 -2
  20. package/dist/persistence.d.ts +0 -13
  21. package/dist/persistence.js +74 -122
  22. package/dist/sheet-engine/core/api/cell.d.ts +1 -25
  23. package/dist/sheet-engine/core/api/sheet-flowdata-lifecycle.d.ts +0 -1
  24. package/dist/sheet-engine/core/index.d.ts +1 -1
  25. package/dist/sheet-engine/core/modules/border.d.ts +0 -9
  26. package/dist/sheet-engine/core/modules/dataVerification.d.ts +0 -15
  27. package/dist/sheet-engine/core/modules/formula-arrow-mode.d.ts +81 -0
  28. package/dist/sheet-engine/core/modules/formula-async-eval.d.ts +0 -5
  29. package/dist/sheet-engine/core/modules/formula-snapshot-eval.d.ts +0 -2
  30. package/dist/sheet-engine/core/modules/formula-transitive-deps.d.ts +1 -26
  31. package/dist/sheet-engine/core/modules/formula.d.ts +33 -88
  32. package/dist/sheet-engine/core/modules/index.d.ts +3 -4
  33. package/dist/sheet-engine/core/modules/rowcol.d.ts +0 -8
  34. package/dist/sheet-engine/core/paste-helpers/calculate-range-cell-size.d.ts +0 -14
  35. package/dist/sheet-engine/core/settings.d.ts +1 -11
  36. package/dist/sheet-engine/core/utils/ydoc-celldata-changes.d.ts +2 -29
  37. package/dist/sheet-engine/react/components/ContextMenu/FilterMenu.d.ts +2 -2
  38. package/dist/sheet-engine/react/components/ContextMenu/SheetTab.d.ts +2 -2
  39. package/dist/sheet-engine/react/components/ContextMenu/index.d.ts +2 -2
  40. package/dist/sheet-engine/react/components/SVGDefines.d.ts +2 -2
  41. package/dist/sheet-engine/react/components/SheetTab/index.d.ts +2 -2
  42. package/dist/sheet-engine/react/components/Toolbar/index.d.ts +2 -2
  43. package/dist/sheet-engine/react/components/Workbook/api.d.ts +0 -4
  44. package/dist/sheet-engine/react/components/Workbook/index.d.ts +0 -2
  45. package/dist/sheet-engine/react/context/index.d.ts +0 -15
  46. package/dist/style.css +1 -1
  47. package/dist/sync-local/SyncManager.d.ts +2 -2
  48. package/dist/sync-local/types/index.d.ts +1 -2
  49. package/dist/{use-xlsx-import-impl-sGRvmOlI.js → use-xlsx-import-impl-DWkIjd5v.js} +119 -120
  50. package/dist/{xlsx-defined-names-C6c8LJn5.js → xlsx-defined-names-776Vg9GT.js} +2 -2
  51. package/dist/{xlsx-export-impl-Dno93LqB.js → xlsx-export-impl-C60SB8Ve.js} +4 -4
  52. package/dist/{xlsx-hyperlink-inline-DjtQMKIL.js → xlsx-hyperlink-inline-DaxgypSu.js} +2 -2
  53. package/package.json +1 -1
  54. package/dist/editor/utils/active-sheet-keeper.test.d.ts +0 -1
  55. package/dist/editor/utils/after-update-cell.test.d.ts +0 -1
  56. package/dist/editor/utils/apply-comment-markers.test.d.ts +0 -1
  57. package/dist/editor/utils/calc-chain-ydoc-update.test.d.ts +0 -1
  58. package/dist/editor/utils/content-change.d.ts +0 -48
  59. package/dist/editor/utils/content-change.test.d.ts +0 -1
  60. package/dist/editor/utils/content-fingerprint.d.ts +0 -37
  61. package/dist/editor/utils/content-fingerprint.test.d.ts +0 -1
  62. package/dist/editor/utils/format-gate.d.ts +0 -27
  63. package/dist/editor/utils/format-gate.test.d.ts +0 -1
  64. package/dist/editor/utils/legacy-on-change.d.ts +0 -20
  65. package/dist/editor/utils/legacy-on-change.test.d.ts +0 -1
  66. package/dist/editor/utils/patch-plain-celldata.d.ts +0 -19
  67. package/dist/editor/utils/patch-plain-celldata.test.d.ts +0 -1
  68. package/dist/editor/utils/rebuild-indexeddb-store.d.ts +0 -19
  69. package/dist/editor/utils/rebuild-indexeddb-store.failure.test.d.ts +0 -1
  70. package/dist/editor/utils/rebuild-indexeddb-store.test.d.ts +0 -1
  71. package/dist/editor/utils/remote-apply-guard.test.d.ts +0 -1
  72. package/dist/editor/utils/sheet-ydoc-sync-utils.test.d.ts +0 -1
  73. package/dist/editor/utils/structural-edit-formula-sync.test.d.ts +0 -1
  74. package/dist/editor/utils/structural-edit-other-tabs.test.d.ts +0 -1
  75. package/dist/editor/utils/wait-for-sync.d.ts +0 -35
  76. package/dist/editor/utils/wait-for-sync.test.d.ts +0 -1
  77. package/dist/persistence-utils-CSKBobX8.js +0 -151
  78. package/dist/persistence.append.test.d.ts +0 -1
  79. package/dist/persistence.fingerprint.test.d.ts +0 -1
  80. package/dist/sheet-engine/core/api/remote-apply.test.d.ts +0 -1
  81. package/dist/sheet-engine/core/api/sheet-flowdata-lifecycle.test.d.ts +0 -1
  82. package/dist/sheet-engine/core/modules/b6-ydoc-writes.test.d.ts +0 -1
  83. package/dist/sheet-engine/core/modules/cell-shift.d.ts +0 -11
  84. package/dist/sheet-engine/core/modules/cell.commit-ydoc.test.d.ts +0 -1
  85. package/dist/sheet-engine/core/modules/engine-hot-spots.test.d.ts +0 -1
  86. package/dist/sheet-engine/core/modules/formula-dep-text.d.ts +0 -23
  87. package/dist/sheet-engine/core/modules/formula-dep-text.test.d.ts +0 -1
  88. package/dist/sheet-engine/core/modules/formula-edge-update.d.ts +0 -13
  89. package/dist/sheet-engine/core/modules/formula-narrowing.test.d.ts +0 -1
  90. package/dist/sheet-engine/core/modules/formula-tab-load.test.d.ts +0 -1
  91. package/dist/sheet-engine/core/modules/formula-warmup.d.ts +0 -33
  92. package/dist/sheet-engine/core/modules/formula-warmup.test.d.ts +0 -1
  93. package/dist/sheet-engine/core/modules/formula.dep-graph.test.d.ts +0 -1
  94. package/dist/sheet-engine/core/modules/formula.str-change.test.d.ts +0 -1
  95. package/dist/sheet-engine/core/modules/formula.wide-seed.test.d.ts +0 -1
  96. package/dist/sheet-engine/core/modules/history-calc-chain.d.ts +0 -39
  97. package/dist/sheet-engine/core/modules/history-calc-chain.test.d.ts +0 -1
  98. package/dist/sheet-engine/core/modules/history-celldata.d.ts +0 -25
  99. package/dist/sheet-engine/core/modules/history-grid-size.d.ts +0 -16
  100. package/dist/sheet-engine/core/modules/history-grid-size.test.d.ts +0 -1
  101. package/dist/sheet-engine/core/modules/rowcol-refused-edit.test.d.ts +0 -1
  102. package/dist/sheet-engine/core/modules/rowcol-unloaded-history.test.d.ts +0 -1
  103. package/dist/sheet-engine/core/modules/structural-edit-prep.d.ts +0 -36
  104. package/dist/sheet-engine/core/modules/structural-edit-prep.test.d.ts +0 -1
  105. package/dist/sheet-engine/core/paste/paste-dep-graph.test.d.ts +0 -1
  106. package/dist/sheet-engine/core/paste-helpers/calculate-range-cell-size.test.d.ts +0 -1
  107. package/dist/sheet-engine/react/components/NotationBoxes/shown-comments.d.ts +0 -20
  108. package/dist/sheet-engine/react/components/NotationBoxes/shown-comments.test.d.ts +0 -1
  109. package/dist/sheet-engine/react/components/SheetOverlay/editing-as-formula.d.ts +0 -7
  110. package/dist/sheet-engine/react/components/SheetOverlay/editing-as-formula.test.d.ts +0 -1
  111. package/dist/sheet-engine/react/components/SheetOverlay/hover-tracker.d.ts +0 -44
  112. package/dist/sheet-engine/react/components/SheetOverlay/hover-tracker.test.d.ts +0 -1
  113. package/dist/sheet-engine/react/components/Toolbar/FunctionList/group-functions.d.ts +0 -9
  114. package/dist/sheet-engine/react/components/Toolbar/FunctionList/group-functions.test.d.ts +0 -1
  115. package/dist/sheet-engine/react/components/Workbook/denomination-scan.d.ts +0 -16
  116. package/dist/sheet-engine/react/components/Workbook/denomination-scan.test.d.ts +0 -1
  117. package/dist/sheet-engine/react/components/Workbook/stable-handle.d.ts +0 -8
  118. package/dist/sheet-engine/react/components/Workbook/stable-handle.test.d.ts +0 -1
  119. package/dist/sheet-engine/react/context/use-workbook-store.d.ts +0 -30
  120. package/dist/sheet-engine/react/context/workbook-store.d.ts +0 -30
  121. package/dist/sheet-engine/react/context/workbook-store.test.d.ts +0 -1
  122. package/dist/sync-local/SyncManager.remote-apply.test.d.ts +0 -1
  123. /package/dist/{editor/hooks/use-celldata-compaction.test.d.ts → sheet-engine/core/modules/formula-arrow-mode.test.d.ts} +0 -0
@@ -1,25 +0,0 @@
1
- /**
2
- * A structural edit rewrites the cross-tab formulas of a tab that is not
3
- * loaded in its `celldata`, as one replacement of the whole array (PR 466 N1).
4
- * Undo and redo replay that replacement, so the engine is right; the Yjs write
5
- * for it compares the two arrays here.
6
- *
7
- * Only formulas that name another tab (they contain `!`) are compared. Those
8
- * are the cells a structural edit on another tab can rewrite; a cell a
9
- * collaborator changed in between is not written back.
10
- */
11
- type CelldataEntry = {
12
- r: number;
13
- c: number;
14
- v?: any;
15
- };
16
- export type CelldataArrayChange = {
17
- sheetId: string;
18
- path: ['celldata'];
19
- key: string;
20
- value: CelldataEntry | null;
21
- type: 'update' | 'delete';
22
- };
23
- /** The Yjs changes that turn `before` into `after` for the cross-tab formulas. */
24
- export declare function celldataArrayChanges(sheetId: string, before: CelldataEntry[] | undefined, after: CelldataEntry[] | undefined): CelldataArrayChange[];
25
- export {};
@@ -1,16 +0,0 @@
1
- import { Patch } from 'immer';
2
- import { Context } from '../context';
3
-
4
- export type GridSizeChange = {
5
- sheetId: string;
6
- path: ['row'] | ['column'];
7
- value: number;
8
- type: 'update';
9
- };
10
- /**
11
- * Undo and redo of a row/column insert or delete change a sheet's `row` /
12
- * `column`. The forward edit writes them to Yjs (`emitGridSizeToYdoc`); history
13
- * wrote the restored cells only, so a peer kept the grown grid until a later
14
- * effect fixed it, and only for the current sheet.
15
- */
16
- export declare function gridSizeChangesFromPatches(ctxAfter: Context, patches: Patch[]): GridSizeChange[];
@@ -1,36 +0,0 @@
1
- import { Context } from '../context';
2
-
3
- export type StructuralEditOp = {
4
- insertRowColOp?: {
5
- type: 'row' | 'column';
6
- id: string;
7
- index: number;
8
- count: number;
9
- direction: 'lefttop' | 'rightbottom';
10
- };
11
- deleteRowColOp?: {
12
- type: 'row' | 'column';
13
- id: string;
14
- start: number;
15
- end: number;
16
- };
17
- };
18
- /**
19
- * Indexes of the tabs that are not loaded (no dense `data`) and that the edit
20
- * rewrites (K6). A tab counts when the rewrite itself would change one of its
21
- * formulas, or when one names the edited tab. The first is the test the
22
- * rewrite uses, so the two cannot disagree: the sheet-name regex reads
23
- * `=C1-A!B5` as a tab called `C1-A` and finds no tab A (PR 466 N1).
24
- */
25
- export declare function unloadedTabsRewrittenBy(ctx: Context, op: StructuralEditOp): number[];
26
- /**
27
- * Load the tabs a structural edit will rewrite, before the edit and outside
28
- * the change that history records (PR 466 N1, second review). The rewrite is
29
- * then recorded as cell patches on `data`, which undo and redo replay for just
30
- * the cells it touched: a peer's edits to the same tab are left alone, and the
31
- * tab can be loaded or unloaded again at undo time (`handleUndo` loads it for
32
- * `data` patches).
33
- *
34
- * Returns the same state object when nothing needs loading.
35
- */
36
- export declare function loadTabsReadingSheet(ctx: Context, op: StructuralEditOp): Context;
@@ -1,20 +0,0 @@
1
- import { Cell } from '../../../core/types';
2
-
3
- export type ShownCommentCell = {
4
- r: number;
5
- c: number;
6
- /** Position, size and text of the pinned box (see `shownCommentsKey`). */
7
- sig: string;
8
- };
9
- /** Cells whose comment popup is pinned open (`ps.isShow`), in row-major order. */
10
- export declare function collectShownCommentCells(data: (Cell | null)[][]): ShownCommentCell[];
11
- /**
12
- * Identity of a shown-comment set. NotationBoxes applies `showComments` only
13
- * when this changes, so an edit that leaves the set alone costs no second
14
- * context update. The sheet id is part of the key so that switching to a sheet
15
- * with an equal (for example empty) set still replaces the previous sheet's
16
- * boxes. Moving or resizing a pinned box, or a peer editing its text, writes
17
- * `ps` but not `commentBoxes`, so each shown cell's `ps` position, size and
18
- * text are part of the key too.
19
- */
20
- export declare function shownCommentsKey(sheetId: string | undefined, cells: ShownCommentCell[]): string;
@@ -1,7 +0,0 @@
1
- /**
2
- * True while a cell is being edited and either input holds a formula. The
3
- * inputs' `innerText` is read only when `editing` is true (a read forces
4
- * layout), and the formula bar is read only when the cell input did not
5
- * already say yes.
6
- */
7
- export declare function isEditingAsFormula(editing: boolean, readCellInputText: () => string | undefined, readFxInputText: () => string | undefined): boolean;
@@ -1,44 +0,0 @@
1
- import { Context, GlobalCache } from '../../../core';
2
-
3
- export type HoverCell = {
4
- row: number;
5
- col: number;
6
- } | null;
7
- type Rect = {
8
- left: number;
9
- top: number;
10
- width: number;
11
- height: number;
12
- };
13
- type HoverTrackerOptions = {
14
- /** Position of the cell area; read at most once per animation frame. */
15
- getRect: () => Rect | undefined;
16
- /** Cell under a page position, or null outside the cell area. */
17
- locate: (pageX: number, pageY: number, rect: Rect | undefined) => HoverCell;
18
- /** True while a drag, resize or popup needs every mouse move. */
19
- isInteracting: () => boolean;
20
- requestFrame: (cb: () => void) => void;
21
- };
22
- /**
23
- * Decides whether a mouse move needs the full `setContext` pass. A move that
24
- * stays in the same cell, with nothing being dragged or hovered, changes
25
- * nothing, so it is skipped (E1).
26
- */
27
- export declare function createHoverTracker({ getRect, locate, isInteracting, requestFrame, }: HoverTrackerOptions): {
28
- shouldProcess(e: {
29
- pageX: number;
30
- pageY: number;
31
- }): boolean;
32
- reset(): void;
33
- };
34
- /**
35
- * True when `handleOverlayMouseMove` or `overShowLinkCard` do something that
36
- * depends on more than the hovered cell: a comment box, image, cell or dialog
37
- * drag, a popup that must see the pointer leave it, or one of the drag states
38
- * after which `handleOverlayMouseMove` runs `mouseRender` on every move
39
- * (`luckysheet_scroll_status` is set by every drag start). Outside the grid
40
- * every position maps to "no cell", so auto-scroll and the resize guide need
41
- * each move.
42
- */
43
- export declare function isHoverInteractionActive(ctx: Context, globalCache: GlobalCache): boolean;
44
- export {};
@@ -1,9 +0,0 @@
1
- export type FunctionLocaleItem = {
2
- n?: string;
3
- t?: number | string;
4
- };
5
- /** Groups the locale's function list by category for the function picker. */
6
- export declare function groupFunctions(functionlist: FunctionLocaleItem[]): {
7
- categories: ("Text" | "Date" | "Other" | "Logical" | "All" | "Array" | "Database" | "Engineering" | "Datablock" | "Financial" | "Lookup" | "Math" | "Operator" | "Parser" | "Statistical" | "Info")[];
8
- getFunctions: (categoryKey: string) => string[];
9
- };
@@ -1,16 +0,0 @@
1
- import { Cell } from '../../../core/types';
2
-
3
- /**
4
- * True when any displayed value (`m`) contains BTC, ETH or SOL. Walks the grid
5
- * in place and returns at the first hit; no intermediate cell list is built.
6
- */
7
- export declare function hasDenominatedCell(data: (Cell | null)[][]): boolean;
8
- type BannerDoc = Pick<Document, 'getElementById' | 'getElementsByClassName'>;
9
- /**
10
- * Show or hide the crypto-denomination banner and move the scrollbar and
11
- * add-row bar to match. A no-op when the host has not mounted the banner
12
- * element; call again later (for example on selection change) to retry.
13
- * Returns true when the banner element was found.
14
- */
15
- export declare function applyDenominationBanner(denominated: boolean, doc?: BannerDoc): boolean;
16
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * An object with the keys of `getLatest()` whose identity never changes. Each
3
- * function member calls the function of the same name on the latest api, and
4
- * each other member reads the latest value, so a host that keeps the handle
5
- * across renders always sees current state (E3). The key set is taken from the
6
- * first call and is expected to stay the same.
7
- */
8
- export declare function createStableHandle<T extends object>(getLatest: () => T): T;
@@ -1,30 +0,0 @@
1
- import { Context } from '../../core';
2
-
3
- export declare function useWorkbookSelector<S>(selector: (ctx: Context) => S, isEqual?: (a: S, b: S) => boolean): S;
4
- /**
5
- * Drop-in for `useContext(WorkbookContext)` in components that should not
6
- * render on every context update: it returns the same shape, but the
7
- * component renders again only when `equal` says the context changed in a way
8
- * it cares about (or when its own props or state change). The returned
9
- * `context` is always the latest one.
10
- */
11
- export declare function useWorkbookContextWhen(equal: (previous: Context, next: Context) => boolean): {
12
- context: Context;
13
- setContext: (recipe: (ctx: Context) => void, options?: import('./index').SetContextOptions) => void;
14
- settings: Required<import('../../core').Settings>;
15
- refs: import('./index').RefValues;
16
- handleUndo: () => void;
17
- handleRedo: () => void;
18
- };
19
- /**
20
- * `useContext(WorkbookContext)` for components that must not render when only
21
- * the scroll position or the row and column offsets changed (E2).
22
- */
23
- export declare function useWorkbookContextIgnoringScroll(): {
24
- context: Context;
25
- setContext: (recipe: (ctx: Context) => void, options?: import('./index').SetContextOptions) => void;
26
- settings: Required<import('../../core').Settings>;
27
- refs: import('./index').RefValues;
28
- handleUndo: () => void;
29
- handleRedo: () => void;
30
- };
@@ -1,30 +0,0 @@
1
- export type WorkbookStore<T> = {
2
- getState: () => T;
3
- setState: (next: T) => void;
4
- subscribe: (listener: () => void) => () => void;
5
- };
6
- /** A one-value store; Workbook sets the latest context after every commit (E2). */
7
- export declare function createWorkbookStore<T>(initial: T): WorkbookStore<T>;
8
- /**
9
- * The snapshot logic behind `useWorkbookSelector`: `getSnapshot` returns the
10
- * previously handed-out value while `isEqual` says the newly selected one is
11
- * the same, so `useSyncExternalStore` sees no change and the component does
12
- * not render. The selector runs once per state.
13
- */
14
- export declare function createSelection<T, S>(store: WorkbookStore<T>, selector: (state: T) => S, isEqual?: (a: S, b: S) => boolean): {
15
- subscribe: (listener: () => void) => () => void;
16
- getSnapshot(): S;
17
- };
18
- /** True when two states differ only in the listed keys. */
19
- export declare function onlyIgnoredKeysChanged(ignored: readonly string[]): (a: object, b: object) => boolean;
20
- /**
21
- * Context keys that change on scroll or when the row and column offsets are
22
- * rebuilt after an edit, and that the components converted in E2 do not read:
23
- * Toolbar and its popovers, SheetTab, ContextMenu, FilterMenu and
24
- * SheetTabContextMenu. Checked with grep in those directories and in the
25
- * helpers they call with the context (`updateCellsDecimalFormat`,
26
- * `convertCellsToCrypto`, `isHyperlinkCreationBlocked`,
27
- * `captureLinkEditorOpenSnapshot`).
28
- */
29
- export declare const SCROLL_ONLY_KEYS: readonly ["scrollLeft", "scrollTop", "visibledatarow", "visibledatacolumn"];
30
- export declare const contextEqualIgnoringScroll: (a: object, b: object) => boolean;
@@ -1 +0,0 @@
1
- export {};