@fileverse-dev/dsheet 2.0.26 → 2.0.27
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/{executeStringFunction-Cv2qXCMb.js → executeStringFunction-C2k81eQQ.js} +4871 -4896
- package/dist/formula.js +1 -1
- package/dist/index.es.js +11333 -11222
- package/dist/sheet-engine/core/context.d.ts +5 -0
- package/dist/sheet-engine/core/events/paste.d.ts +2 -12
- package/dist/sheet-engine/core/modules/cell.d.ts +2 -1
- package/dist/sheet-engine/core/modules/selection.d.ts +7 -1
- package/dist/sheet-engine/core/modules/sheet-metadata-hooks.d.ts +7 -0
- package/dist/sheet-engine/core/paste/clipboard-entry.d.ts +4 -0
- package/dist/sheet-engine/core/paste/formula-adjust.d.ts +7 -0
- package/dist/sheet-engine/core/paste/fortune-internal-paste.d.ts +13 -0
- package/dist/sheet-engine/core/paste/index.d.ts +5 -0
- package/dist/sheet-engine/core/paste/paste-internals.d.ts +10 -0
- package/package.json +1 -1
|
@@ -213,6 +213,11 @@ export type Context = {
|
|
|
213
213
|
luckysheet_shiftkeydown: boolean;
|
|
214
214
|
luckysheet_shiftpositon: Selection | undefined;
|
|
215
215
|
iscopyself: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* True when the last in-app copy dropped per-cell `data-fortune-cell` JSON due to HTML size cap.
|
|
218
|
+
* Paste must rely on `luckysheet_copy_save` + grid data (internal route), not HTML text equality.
|
|
219
|
+
*/
|
|
220
|
+
lastInternalCopyHtmlMetadataStripped: boolean;
|
|
216
221
|
orderbyindex: number;
|
|
217
222
|
luckysheet_model_move_state: boolean;
|
|
218
223
|
luckysheet_model_xy: number[];
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function columnLabelIndex(label: string): number;
|
|
4
|
-
export declare function indexToColumnLabel(index: number): string;
|
|
5
|
-
export declare class FormularCellRefError extends Error {
|
|
6
|
-
formula: string;
|
|
7
|
-
constructor(message: string, formula: string);
|
|
8
|
-
}
|
|
9
|
-
export declare function adjustFormulaForPaste(formula: string, srcCol: number, srcRow: number, destCol: number, destRow: number): string;
|
|
10
|
-
export declare function parseAsLinkIfUrl(txtdata: string, ctx: Context): void;
|
|
11
|
-
export declare function handlePaste(ctx: Context, e: ClipboardEvent): void;
|
|
12
|
-
export declare function handlePasteByClick(ctx: Context, clipboardData: string, triggerType?: string): void;
|
|
1
|
+
/** Re-export paste module (Fortune-first architecture lives under `core/paste/`). */
|
|
2
|
+
export { handlePaste, handlePasteByClick, columnLabelIndex, indexToColumnLabel, FormularCellRefError, adjustFormulaForPaste, parseAsLinkIfUrl, } from '../paste';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Context } from '../context';
|
|
2
2
|
import { Cell, CellMatrix, Range, Selection, SingleRange } from '../types';
|
|
3
|
+
import { getComputeMap } from './ConditionFormat';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Recompute auto row height for one row from wrap/inline cells; updates cfg.rowlen and ctx.config.
|
|
@@ -36,7 +37,7 @@ export declare function getRangeByTxt(ctx: Context, txt: string): any[];
|
|
|
36
37
|
export declare function isValidRangeText(ctx: Context, txt: string): boolean;
|
|
37
38
|
export declare function isAllSelectedCellsInStatus(ctx: Context, attr: keyof Cell, status: any): boolean;
|
|
38
39
|
export declare function getFontStyleByCell(cell: Cell | null | undefined, checksAF?: any[], checksCF?: any, isCheck?: boolean): any;
|
|
39
|
-
export declare function getStyleByCell(ctx: Context, d: CellMatrix, r: number, c: number): any;
|
|
40
|
+
export declare function getStyleByCell(ctx: Context, d: CellMatrix, r: number, c: number, precomputedCfCompute?: ReturnType<typeof getComputeMap>): any;
|
|
40
41
|
export declare function getInlineStringHTML(r: number, c: number, data: CellMatrix, options?: {
|
|
41
42
|
useSemanticMarkup?: boolean;
|
|
42
43
|
isRichTextCopy?: boolean;
|
|
@@ -5,6 +5,11 @@ export declare const selectionCache: {
|
|
|
5
5
|
isPasteAction: boolean;
|
|
6
6
|
isPasteValuesOnly: boolean;
|
|
7
7
|
};
|
|
8
|
+
interface RangeValueToHtmlOptions {
|
|
9
|
+
includeCellMetadata?: boolean;
|
|
10
|
+
preferRichText?: boolean;
|
|
11
|
+
respectFilterHiddenRows?: boolean;
|
|
12
|
+
}
|
|
8
13
|
export declare function scrollToHighlightCell(ctx: Context, r: number, c: number): void;
|
|
9
14
|
export declare function seletedHighlistByindex(ctx: Context, r1: number, r2: number, c1: number, c2: number): {
|
|
10
15
|
left: number;
|
|
@@ -54,7 +59,7 @@ export declare function getRowMerge(ctx: Context, rIndex: number, c1: number, c2
|
|
|
54
59
|
export declare function getColMerge(ctx: Context, cIndex: number, r1: number, r2: number): (number | null)[];
|
|
55
60
|
export declare function moveHighlightCell(ctx: Context, postion: "down" | "right", index: number, type: "rangeOfSelect" | "rangeOfFormula"): void;
|
|
56
61
|
export declare function moveHighlightRange(ctx: Context, postion: "down" | "right", index: number, type: "rangeOfSelect" | "rangeOfFormula"): void;
|
|
57
|
-
export declare function rangeValueToHtml(ctx: Context, sheetId: string, ranges?: Range): string | null;
|
|
62
|
+
export declare function rangeValueToHtml(ctx: Context, sheetId: string, ranges?: Range, options?: RangeValueToHtmlOptions): string | null;
|
|
58
63
|
export declare function copy(ctx: Context): void;
|
|
59
64
|
export declare function deleteSelectedCellText(ctx: Context): string;
|
|
60
65
|
export declare function deleteSelectedCellFormat(ctx: Context): string;
|
|
@@ -83,3 +88,4 @@ export declare function calcSelectionInfo(ctx: Context): {
|
|
|
83
88
|
min: number;
|
|
84
89
|
average: string;
|
|
85
90
|
};
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context } from '../context';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Defer sheet-level metadata hooks until after React applies Immer updates, so
|
|
5
|
+
* getSheet() / Yjs diff see dataVerification, CF rules, and hyperlinks from paste/cut.
|
|
6
|
+
*/
|
|
7
|
+
export declare function scheduleSheetMetadataSyncHooks(ctx: Context): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function columnLabelIndex(label: string): number;
|
|
2
|
+
export declare function indexToColumnLabel(index: number): string;
|
|
3
|
+
export declare class FormularCellRefError extends Error {
|
|
4
|
+
formula: string;
|
|
5
|
+
constructor(message: string, formula: string);
|
|
6
|
+
}
|
|
7
|
+
export declare function adjustFormulaForPaste(formula: string, srcCol: number, srcRow: number, destCol: number, destRow: number): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Context } from '../context';
|
|
2
|
+
|
|
3
|
+
export type FortuneInternalPasteDecision = {
|
|
4
|
+
/** True when clipboard/grid prep must stop (e.g. missing copy source data). */
|
|
5
|
+
abortPaste: boolean;
|
|
6
|
+
/** True when paste should use `pasteHandlerOfCopyPaste` / cut handler for Fortune HTML. */
|
|
7
|
+
internalFortunePaste: boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Decides whether pasted HTML corresponds to the last in-app Fortune copy so we can use
|
|
11
|
+
* the internal paste path (grid + `luckysheet_copy_save`) instead of HTML table parsing.
|
|
12
|
+
*/
|
|
13
|
+
export declare function computeFortuneInternalPasteDecision(ctx: Context, txtdata: string): FortuneInternalPasteDecision;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Fortune-first paste: routing in `fortune-internal-paste`, handlers in `paste-internals`, wire-up in `clipboard-entry`. */
|
|
2
|
+
export { columnLabelIndex, indexToColumnLabel, FormularCellRefError, adjustFormulaForPaste, } from './formula-adjust';
|
|
3
|
+
export { computeFortuneInternalPasteDecision, type FortuneInternalPasteDecision, } from './fortune-internal-paste';
|
|
4
|
+
export { parseAsLinkIfUrl, pasteHandler, pasteHandlerOfCutPaste, pasteHandlerOfCopyPaste, handleFormulaStringPaste, resizePastedCellsToContent, shouldHandleNonTableHtml, convertAnyHtmlToTable, } from './paste-internals';
|
|
5
|
+
export { handlePaste, handlePasteByClick } from './clipboard-entry';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context } from '../context';
|
|
2
|
+
|
|
3
|
+
export declare function pasteHandler(ctx: Context, data: any, borderInfo?: any): void;
|
|
4
|
+
export declare function pasteHandlerOfCutPaste(ctx: Context, copyRange: Context["luckysheet_copy_save"]): void;
|
|
5
|
+
export declare function pasteHandlerOfCopyPaste(ctx: Context, copyRange: Context["luckysheet_copy_save"], valuesOnly?: boolean): void;
|
|
6
|
+
export declare function handleFormulaStringPaste(ctx: Context, formulaStr: string): void;
|
|
7
|
+
export declare function parseAsLinkIfUrl(txtdata: string, ctx: Context): void;
|
|
8
|
+
export declare function resizePastedCellsToContent(ctx: Context): void;
|
|
9
|
+
export declare function shouldHandleNonTableHtml(html: string): boolean;
|
|
10
|
+
export declare function convertAnyHtmlToTable(html: string): string;
|