@fileverse-dev/dsheet 2.1.3-package-cleanup-2 → 2.1.3-rtc-debug-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/dist/editor/components/editor-workbook.d.ts +14 -11
- package/dist/editor/contexts/editor-context.d.ts +4 -16
- package/dist/editor/dsheet-editor.d.ts +1 -1
- package/dist/editor/hooks/live-query/use-live-query.d.ts +2 -4
- package/dist/editor/hooks/use-editor-data.d.ts +2 -4
- package/dist/editor/types.d.ts +29 -36
- package/dist/editor/utils/after-update-cell.d.ts +8 -13
- package/dist/{executeStringFunction-CIx20yEd.js → executeStringFunction-BkmJj04p.js} +4364 -4742
- package/dist/formula.js +1 -1
- package/dist/index-BM9BQJsD.js +52663 -0
- package/dist/index.d.ts +1 -8
- package/dist/index.es.js +50 -54
- package/dist/sheet-engine/core/context.d.ts +0 -5
- package/dist/sheet-engine/core/index.d.ts +1 -1
- package/dist/sheet-engine/core/modules/formula.d.ts +1 -26
- package/dist/sheet-engine/core/modules/index.d.ts +1 -3
- package/dist/sheet-engine/react/components/SheetOverlay/Icon.d.ts +4 -5
- package/dist/sheet-engine/react/components/SheetOverlay/LucideIcon.d.ts +4 -4
- package/dist/sheet-engine/react/components/Toolbar/conditionalFormatPortal.d.ts +7 -0
- package/dist/sheet-engine/react/components/Toolbar/dataVerificationPortal.d.ts +6 -0
- package/dist/sheet-engine/react/components/Workbook/index.d.ts +0 -6
- package/dist/sheet-engine/react/components/index.d.ts +0 -1
- package/dist/sheet-engine/react/utils/datepickerStyles.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-xlsx-import-impl-Ce2uNFrO.js → use-xlsx-import-impl-8Dal2Jdo.js} +2 -2
- package/dist/{xlsx-export-impl-DxzFr-zj.js → xlsx-export-impl-B2iPnSXK.js} +2 -2
- package/package.json +2 -3
- package/dist/editor/components/api-key-modal/api-key-input.d.ts +0 -5
- package/dist/editor/components/api-key-modal/api-key-modal.d.ts +0 -7
- package/dist/editor/components/api-key-modal/rate-limit-info.d.ts +0 -4
- package/dist/editor/components/comments/comment-actions-dropdown.d.ts +0 -19
- package/dist/editor/components/comments/comment-cell-popup.d.ts +0 -4
- package/dist/editor/components/comments/comment-input.d.ts +0 -4
- package/dist/editor/components/comments/comment-item.d.ts +0 -4
- package/dist/editor/components/comments/comment-sidebar-empty.d.ts +0 -4
- package/dist/editor/components/comments/comment-sidebar.d.ts +0 -4
- package/dist/editor/components/comments/ens/ens-cache.d.ts +0 -10
- package/dist/editor/components/comments/ens/use-ens-status.d.ts +0 -10
- package/dist/editor/components/comments/use-comment-cell-popup.d.ts +0 -12
- package/dist/editor/components/comments/use-comment-permissions.d.ts +0 -15
- package/dist/editor/components/sidebar/editor-right-sidebar.d.ts +0 -20
- package/dist/editor/components/sidebar/right-sidebar.d.ts +0 -14
- package/dist/editor/components/sidebar/sidebar-context.d.ts +0 -17
- package/dist/editor/components/sidebar/sidebar-portal-registry.d.ts +0 -20
- package/dist/editor/components/sidebar/use-right-panels.d.ts +0 -12
- package/dist/editor/components/sidebars/conditional-format.d.ts +0 -2
- package/dist/editor/components/sidebars/data-verification.d.ts +0 -2
- package/dist/editor/components/sidebars/function/function-categories-logic.d.ts +0 -11
- package/dist/editor/components/sidebars/function/function-categories.d.ts +0 -6
- package/dist/editor/components/sidebars/function/function-metadata.d.ts +0 -7
- package/dist/editor/components/sidebars/function/functionList.d.ts +0 -8
- package/dist/editor/components/sidebars/function/types.d.ts +0 -24
- package/dist/editor/components/sidebars/function/use-functions.d.ts +0 -20
- package/dist/editor/components/sidebars/function-content.d.ts +0 -8
- package/dist/editor/components/sidebars/template-ui.d.ts +0 -22
- package/dist/editor/components/sidebars/templates.d.ts +0 -9
- package/dist/editor/types/comments.d.ts +0 -133
- package/dist/editor/utils/api-key-storage.d.ts +0 -6
- package/dist/editor/utils/api-keys-local-storage.d.ts +0 -19
- package/dist/editor/utils/cell-comment-marker.d.ts +0 -29
- package/dist/editor/utils/comment-key-utils.d.ts +0 -7
- package/dist/editor/utils/data-block-error-handler.d.ts +0 -21
- package/dist/editor/utils/datablock-error-utils.d.ts +0 -1
- package/dist/editor/utils/sheet-editor-safe.d.ts +0 -26
- package/dist/index-B1GgIaLD.js +0 -55500
- package/dist/sheet-engine/core/modules/formula-async-eval.d.ts +0 -53
- package/dist/sheet-engine/core/modules/formula-eval.worker.d.ts +0 -1
- package/dist/sheet-engine/core/modules/formula-range-cache.d.ts +0 -20
- package/dist/sheet-engine/core/modules/formula-snapshot-eval.d.ts +0 -40
- package/dist/sheet-engine/core/modules/formula-transitive-deps.d.ts +0 -7
- package/dist/sheet-engine/core/modules/formula-worker-bridge.d.ts +0 -16
- package/dist/sheet-engine/core/modules/formula-worker-types.d.ts +0 -24
- package/dist/sheet-engine/core/theme.d.ts +0 -67
- package/dist/sheet-engine/react/components/SidebarPanelPortals/index.d.ts +0 -17
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/** Minimum formula count before deferring eval to chunked async (Step 1). */
|
|
2
|
-
export declare const FORMULA_ASYNC_EVAL_THRESHOLD = 15;
|
|
3
|
-
/** Formulas evaluated per animation frame during async recalc. */
|
|
4
|
-
export declare const FORMULA_ASYNC_CHUNK_SIZE = 50;
|
|
5
|
-
/** Use a Web Worker when the async job has at least this many formulas. */
|
|
6
|
-
export declare const FORMULA_WORKER_THRESHOLD = 100;
|
|
7
|
-
/** Formulas evaluated per worker message (larger — runs off main thread). */
|
|
8
|
-
export declare const FORMULA_WORKER_CHUNK_SIZE = 300;
|
|
9
|
-
/** Maximum time to wait for a worker chunk before falling back to the real engine. */
|
|
10
|
-
export declare const FORMULA_WORKER_CHUNK_TIMEOUT_MS = 30000;
|
|
11
|
-
/** localStorage key for the optional formula execution debug panel. */
|
|
12
|
-
export declare const FORMULA_EXEC_DEBUG_STORAGE_KEY = "fortune-formula-execution-debug";
|
|
13
|
-
export declare function isFormulaExecutionDebugEnabled(): boolean;
|
|
14
|
-
export type FormulaEvalDebugMode = 'worker' | 'main-thread' | 'fallback';
|
|
15
|
-
export type FormulaEvalDebug = {
|
|
16
|
-
mode: FormulaEvalDebugMode;
|
|
17
|
-
lastChunkMs: number;
|
|
18
|
-
lastChunkSize: number;
|
|
19
|
-
completedChunks: number;
|
|
20
|
-
fallbackChunks: number;
|
|
21
|
-
workerAvailable: boolean;
|
|
22
|
-
unsafeFormulaCount: number;
|
|
23
|
-
workerFormulaCount: number;
|
|
24
|
-
totalWorkerFormulas: number;
|
|
25
|
-
totalMainThreadFormulas: number;
|
|
26
|
-
lastError: string | null;
|
|
27
|
-
};
|
|
28
|
-
export type FormulaAsyncEvalJob = {
|
|
29
|
-
formulaRunList: Array<{
|
|
30
|
-
r: number;
|
|
31
|
-
c: number;
|
|
32
|
-
id: string;
|
|
33
|
-
calc_funcStr: string;
|
|
34
|
-
level?: number;
|
|
35
|
-
}>;
|
|
36
|
-
calcChainKeys: string[];
|
|
37
|
-
impactedByCircular: string[];
|
|
38
|
-
cycleNodes: string[];
|
|
39
|
-
workerSnapshotKey: string;
|
|
40
|
-
nextIndex: number;
|
|
41
|
-
total: number;
|
|
42
|
-
debug?: FormulaEvalDebug;
|
|
43
|
-
};
|
|
44
|
-
export declare function isFormulaEvalPending(ctx: {
|
|
45
|
-
isFormulaCalculating?: boolean;
|
|
46
|
-
formulaAsyncEval?: FormulaAsyncEvalJob | null;
|
|
47
|
-
}): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* The worker snapshot evaluator intentionally handles only scalar formulas that
|
|
50
|
-
* mirror the main engine well. Dynamic/spill/range-indirection formulas stay on
|
|
51
|
-
* the main thread so `spillSortResult` and special range logic remain authoritative.
|
|
52
|
-
*/
|
|
53
|
-
export declare function isFormulaWorkerUnsafe(calcFuncStr: string): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type RangePassCacheEntry = {
|
|
2
|
-
fragment: any[][];
|
|
3
|
-
cryptoDenomination: string;
|
|
4
|
-
cryptoDecimal: number;
|
|
5
|
-
globalDataKeysFingerprint: string;
|
|
6
|
-
};
|
|
7
|
-
export declare function makeRangePassCacheKey(sheetId: string, startRow: number, endRow: number, startCol: number, endCol: number): string;
|
|
8
|
-
export declare function collectGlobalDataKeysInRange(execFunctionGlobalData: Record<string, unknown>, sheetId: string, startRow: number, endRow: number, startCol: number, endCol: number): string;
|
|
9
|
-
/** Remove the formula origin cell from a full rectangular range fragment. */
|
|
10
|
-
export declare function sliceRangeFragmentForOrigin(full: any[][], startRow: number, startCol: number, originRow: number | null | undefined, originCol: number | null | undefined): any[][];
|
|
11
|
-
type RangeCacheHost = {
|
|
12
|
-
rangeValuePassCache?: Map<string, RangePassCacheEntry>;
|
|
13
|
-
rangeValuePassCacheStats?: {
|
|
14
|
-
hits: number;
|
|
15
|
-
misses: number;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare function beginRangeValuePassCache(cache: RangeCacheHost): void;
|
|
19
|
-
export declare function clearRangeValuePassCache(cache: RangeCacheHost): void;
|
|
20
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { CellMatrix } from '../types';
|
|
2
|
-
|
|
3
|
-
export type SnapshotSheet = {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
data: CellMatrix | null | undefined;
|
|
7
|
-
};
|
|
8
|
-
export type SnapshotFormulaCell = {
|
|
9
|
-
r: number;
|
|
10
|
-
c: number;
|
|
11
|
-
id: string;
|
|
12
|
-
calc_funcStr: string;
|
|
13
|
-
};
|
|
14
|
-
export type SnapshotFormulaResult = {
|
|
15
|
-
r: number;
|
|
16
|
-
c: number;
|
|
17
|
-
id: string;
|
|
18
|
-
v: unknown;
|
|
19
|
-
f: string;
|
|
20
|
-
spe?: unknown;
|
|
21
|
-
deps: string[];
|
|
22
|
-
isError: boolean;
|
|
23
|
-
};
|
|
24
|
-
export type SnapshotEvalInput = {
|
|
25
|
-
sheets: SnapshotSheet[];
|
|
26
|
-
execFunctionGlobalData: Record<string, {
|
|
27
|
-
v: unknown;
|
|
28
|
-
f: unknown;
|
|
29
|
-
}>;
|
|
30
|
-
formulas: SnapshotFormulaCell[];
|
|
31
|
-
};
|
|
32
|
-
export type SnapshotEvalOutput = {
|
|
33
|
-
execFunctionGlobalData: Record<string, {
|
|
34
|
-
v: unknown;
|
|
35
|
-
f: unknown;
|
|
36
|
-
}>;
|
|
37
|
-
results: SnapshotFormulaResult[];
|
|
38
|
-
};
|
|
39
|
-
/** Worker-safe formula evaluation against plain sheet snapshots (no React/immer). */
|
|
40
|
-
export declare function evalFormulasInSnapshot(input: SnapshotEvalInput): SnapshotEvalOutput;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** Cell / formula key format used in depsByCell and revDepsByCell. */
|
|
2
|
-
export declare function toFormulaDepCellKey(sheetId: string, r: number, c: number): string;
|
|
3
|
-
/**
|
|
4
|
-
* Walk revDepsByCell from a changed cell to collect every formula cell that
|
|
5
|
-
* must recalculate (direct + transitive dependents).
|
|
6
|
-
*/
|
|
7
|
-
export declare function collectTransitiveFormulaDependents(originCellKey: string, revDepsByCell: Map<string, Set<string>>): Set<string>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Context } from '../context';
|
|
2
|
-
import { SnapshotEvalInput, SnapshotEvalOutput, SnapshotFormulaCell, evalFormulasInSnapshot } from './formula-snapshot-eval';
|
|
3
|
-
import { FORMULA_WORKER_CHUNK_SIZE } from './formula-async-eval';
|
|
4
|
-
|
|
5
|
-
export declare function buildSnapshotEvalInput(ctx: Context, formulas: SnapshotFormulaCell[]): SnapshotEvalInput;
|
|
6
|
-
export declare function buildWorkerEvalInput(ctx: Context, formulas: SnapshotFormulaCell[]): Omit<SnapshotEvalInput, 'sheets'>;
|
|
7
|
-
export declare function initFormulaWorkerSnapshot(ctx: Context, snapshotKey: string): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Evaluate a formula chunk off the critical UI path when possible.
|
|
10
|
-
* Uses an inline Web Worker. Callers should fall back to the real engine on
|
|
11
|
-
* rejection so the worker cannot silently leave a recalculation job hanging.
|
|
12
|
-
*/
|
|
13
|
-
export declare function evalFormulasInBackground(snapshotKey: string, input: Omit<SnapshotEvalInput, 'sheets'>): Promise<SnapshotEvalOutput>;
|
|
14
|
-
/** @deprecated Use evalFormulasInBackground */
|
|
15
|
-
export declare const evalFormulasInWorker: typeof evalFormulasInBackground;
|
|
16
|
-
export { FORMULA_WORKER_CHUNK_SIZE, evalFormulasInSnapshot };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SnapshotEvalInput, SnapshotEvalOutput, SnapshotSheet } from './formula-snapshot-eval';
|
|
2
|
-
|
|
3
|
-
export type WorkerInitSnapshotRequest = {
|
|
4
|
-
type: 'init-snapshot';
|
|
5
|
-
snapshotKey: string;
|
|
6
|
-
sheets: SnapshotSheet[];
|
|
7
|
-
};
|
|
8
|
-
export type WorkerEvalRequest = {
|
|
9
|
-
type: 'eval';
|
|
10
|
-
requestId: number;
|
|
11
|
-
snapshotKey: string;
|
|
12
|
-
input: Omit<SnapshotEvalInput, 'sheets'>;
|
|
13
|
-
};
|
|
14
|
-
export type WorkerRequest = WorkerInitSnapshotRequest | WorkerEvalRequest;
|
|
15
|
-
export type WorkerEvalResponse = {
|
|
16
|
-
type: 'eval-result';
|
|
17
|
-
requestId: number;
|
|
18
|
-
output: SnapshotEvalOutput;
|
|
19
|
-
};
|
|
20
|
-
export type WorkerEvalError = {
|
|
21
|
-
type: 'eval-error';
|
|
22
|
-
requestId: number;
|
|
23
|
-
message: string;
|
|
24
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Grid (canvas) theming — the single source of truth for the JS-painted grid's per-theme colors.
|
|
3
|
-
*
|
|
4
|
-
* The chrome (toolbar, sidebars, comments) themes passively via `@fileverse/ui` `.color-*`
|
|
5
|
-
* utilities + the `<html>` class. The canvas grid cannot read CSS variables, so `canvas.ts`
|
|
6
|
-
* resolves its colors from `activePalette` here. On theme change the host threads a `theme` prop
|
|
7
|
-
* to the engine, which calls `setActiveGridPalette` and repaints via `jfrefreshgrid`.
|
|
8
|
-
*
|
|
9
|
-
* `ThemeKey` is copied verbatim from `fileverse-ddoc` `package/types.ts` so the dsheet `theme`
|
|
10
|
-
* prop is type-identical to ddoc's and a host app can pass the same value to both editors.
|
|
11
|
-
*
|
|
12
|
-
* See docs/superpowers/specs/2026-06-30-dsheet-canvas-theming-design.md
|
|
13
|
-
*/
|
|
14
|
-
export type ThemeKey = 'light' | 'dark' | 'theme-sepia' | 'theme-pink' | 'theme-green';
|
|
15
|
-
export declare const DEFAULT_THEME: ThemeKey;
|
|
16
|
-
/**
|
|
17
|
-
* dsheet selection-accent brand color. Constant across all five themes (readable on every
|
|
18
|
-
* background) — intentionally NOT a per-theme palette slot. Used for the fill handle, selection
|
|
19
|
-
* border, and marching ants.
|
|
20
|
-
*/
|
|
21
|
-
export declare const SELECTION_ACCENT = "#EFC703";
|
|
22
|
-
/**
|
|
23
|
-
* One slot per neutral grid-chrome color role painted in `canvas.ts`. User-authored cell colors
|
|
24
|
-
* (cell `bg`/`fc`/border, conditional-format colors) are NOT here — they render literally in every
|
|
25
|
-
* theme and are read straight from cell data.
|
|
26
|
-
*/
|
|
27
|
-
export interface GridPalette {
|
|
28
|
-
/** Unset cell background + main-area canvas clear (the `!fillStyle` fallback branch). */
|
|
29
|
-
cellBg: string;
|
|
30
|
-
/** Gridlines. */
|
|
31
|
-
gridLine: string;
|
|
32
|
-
/** Default cell text (cells with no user `fc`). */
|
|
33
|
-
cellText: string;
|
|
34
|
-
/** Row/column header background. */
|
|
35
|
-
headerBg: string;
|
|
36
|
-
/** Row/column header text. */
|
|
37
|
-
headerText: string;
|
|
38
|
-
/** Secondary fill for on-canvas chips (e.g. data-verification dropdown). */
|
|
39
|
-
secondaryFill: string;
|
|
40
|
-
/** Frozen-pane divider line. */
|
|
41
|
-
freezeLine: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Per-theme grid palettes.
|
|
45
|
-
*
|
|
46
|
-
* `light` holds the EXACT pre-theming hex from `canvas.ts`, so the default theme renders
|
|
47
|
-
* pixel-identical to before this change (regression guard).
|
|
48
|
-
*
|
|
49
|
-
* [Unverified] The four non-light palettes are reasonable design-guess values derived from each
|
|
50
|
-
* theme's surface swatch — NOT final brand colors; they need design sign-off. The mechanism is
|
|
51
|
-
* independent of the exact values.
|
|
52
|
-
*/
|
|
53
|
-
export declare const GRID_THEMES: Record<ThemeKey, GridPalette>;
|
|
54
|
-
export declare const resolveGridPalette: (theme?: ThemeKey) => GridPalette;
|
|
55
|
-
/**
|
|
56
|
-
* The palette the canvas paints from. Module-level so the imperative canvas reads it on every
|
|
57
|
-
* repaint without prop threading inside the engine. `canvas.ts` imports this as a live binding and
|
|
58
|
-
* reads `activePalette.<slot>` at paint time; reassigning it here updates every reader.
|
|
59
|
-
*
|
|
60
|
-
* NOTE: this is a module singleton — multiple workbooks with different themes on one page would
|
|
61
|
-
* share it. dsheet renders one editor per page (like ddoc), so this is acceptable. If multi-instance
|
|
62
|
-
* is ever needed, move the palette onto `sheetCtx`.
|
|
63
|
-
*/
|
|
64
|
-
export declare let activePalette: GridPalette;
|
|
65
|
-
/** Swap the active grid palette. Returns true if it actually changed (caller decides to repaint). */
|
|
66
|
-
export declare const setActiveGridPalette: (theme?: ThemeKey) => boolean;
|
|
67
|
-
export declare const getActiveTheme: () => ThemeKey;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { Context } from '../../../core';
|
|
3
|
-
import { default as WorkbookContext } from '../../context';
|
|
4
|
-
|
|
5
|
-
export type SidebarPortalTargets = Record<string, HTMLElement | undefined>;
|
|
6
|
-
export type SidebarPortalRegistryHandle = {
|
|
7
|
-
getTargets: () => SidebarPortalTargets;
|
|
8
|
-
subscribe: (onStoreChange: () => void) => () => void;
|
|
9
|
-
};
|
|
10
|
-
export type SidebarPortalRenderer = (workbook: React.ContextType<typeof WorkbookContext>) => React.ReactNode;
|
|
11
|
-
interface SidebarPanelPortalsProps {
|
|
12
|
-
activePanel: string | null;
|
|
13
|
-
portalRegistry?: SidebarPortalRegistryHandle | null;
|
|
14
|
-
extraPortals?: Record<string, SidebarPortalRenderer>;
|
|
15
|
-
}
|
|
16
|
-
export declare function SidebarPanelPortals({ activePanel, portalRegistry, extraPortals, }: Readonly<SidebarPanelPortalsProps>): React.ReactPortal | null;
|
|
17
|
-
export type { Context };
|