@fileverse-dev/dsheet 1.3.18-patch.1 → 1.3.18-patch.3

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 (31) hide show
  1. package/dist/editor/utils/xlsx-border-utils.d.ts +21 -0
  2. package/dist/editor/utils/xlsx-cf-export-utils.d.ts +47 -0
  3. package/dist/editor/utils/xlsx-cf-postprocess.d.ts +14 -0
  4. package/dist/editor/utils/xlsx-image-utils.d.ts +14 -1
  5. package/dist/editor/utils/xlsx-richtext-utils.d.ts +16 -0
  6. package/dist/{en-DhXXsqA5.js → en-Cyd9m-Dg.js} +1 -1
  7. package/dist/index-Cn_S2KAM.js +52411 -0
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.es.js +5 -5
  10. package/dist/sheet-engine/core/api/cell.d.ts +1 -1
  11. package/dist/sheet-engine/core/events/keyboard.d.ts +2 -2
  12. package/dist/sheet-engine/core/events/mouse.d.ts +1 -1
  13. package/dist/sheet-engine/core/index.d.ts +1 -1
  14. package/dist/sheet-engine/core/modules/cell.d.ts +5 -1
  15. package/dist/sheet-engine/core/modules/formula.d.ts +50 -1
  16. package/dist/sheet-engine/core/modules/index.d.ts +1 -1
  17. package/dist/sheet-engine/core/modules/inline-string.d.ts +6 -6
  18. package/dist/sheet-engine/core/modules/rowcol.d.ts +3 -3
  19. package/dist/sheet-engine/core/modules/selection.d.ts +6 -5
  20. package/dist/sheet-engine/core/modules/sort.d.ts +1 -1
  21. package/dist/sheet-engine/core/paste-table-helpers.d.ts +1 -1
  22. package/dist/sheet-engine/core/types.d.ts +6 -4
  23. package/dist/sheet-engine/react/components/FormulaSearch/constant.d.ts +63 -0
  24. package/dist/sheet-engine/react/components/FormulaSearch/index.d.ts +3 -2
  25. package/dist/sheet-engine/react/components/SheetOverlay/formula-segment-boundary.d.ts +1 -0
  26. package/dist/sheet-engine/react/components/SheetOverlay/helper.d.ts +34 -0
  27. package/dist/sheet-engine/react/hooks/useFormulaEditorHistory.d.ts +30 -0
  28. package/dist/sheet-engine/react/hooks/useRerenderOnFormulaCaret.d.ts +11 -0
  29. package/dist/style.css +1 -1
  30. package/package.json +5 -3
  31. package/dist/index-ZCAfF51b.js +0 -47201
@@ -0,0 +1,21 @@
1
+ export type BorderSide = {
2
+ style: number;
3
+ color?: string;
4
+ };
5
+ export declare const BORDER_STYLE_MAP: Record<number, string>;
6
+ /** Convert a fortune border side descriptor to an xlsx-js-style border entry. */
7
+ export declare const toBorderSide: (style: unknown, color: unknown) => {
8
+ style: string;
9
+ color: {
10
+ rgb: string;
11
+ };
12
+ } | undefined;
13
+ /**
14
+ * Reads `borderInfo` from a fortune sheet config and writes the corresponding
15
+ * border styles into the xlsx-js-style worksheet object.
16
+ *
17
+ * Handles two rangeTypes:
18
+ * - "cell" → per-cell border entries produced by luckyexcel on import
19
+ * - "range" → range border commands produced when the user draws borders in the UI
20
+ */
21
+ export declare const applyBordersToWorksheet: (worksheet: Record<string, unknown>, borderInfo: any[]) => void;
@@ -0,0 +1,47 @@
1
+ import { Worksheet } from 'exceljs';
2
+
3
+ type CellRange = {
4
+ row: [number, number];
5
+ column: [number, number];
6
+ [key: string]: unknown;
7
+ };
8
+ export type FortuneFormat = {
9
+ textColor?: string;
10
+ cellColor?: string;
11
+ bold?: boolean;
12
+ italic?: boolean;
13
+ underline?: boolean;
14
+ strikethrough?: boolean;
15
+ };
16
+ type FortuneRule = {
17
+ type: string;
18
+ cellrange: CellRange[];
19
+ format?: FortuneFormat;
20
+ conditionName: string;
21
+ conditionValue?: string[];
22
+ };
23
+ type Sheet = {
24
+ luckysheet_conditionformat_save?: FortuneRule[];
25
+ [key: string]: unknown;
26
+ };
27
+ export type PendingDuplicateRule = {
28
+ ref: string;
29
+ format: FortuneFormat;
30
+ priority: number;
31
+ };
32
+ export type CfExportResult = {
33
+ nextPriority: number;
34
+ pendingDuplicateValues: PendingDuplicateRule[];
35
+ };
36
+ /** Convert any CSS color string to an 8-char ARGB hex (e.g. "FFFF0000"). Returns null if unparseable. */
37
+ export declare function colorToArgb(color: string): string | null;
38
+ /**
39
+ * Writes all luckysheet_conditionformat_save rules from `sheet` into the
40
+ * ExcelJS worksheet.
41
+ *
42
+ * Returns the next available priority integer and any `duplicateValue` rules
43
+ * that ExcelJS cannot render — those must be injected later via
44
+ * `patchXlsxCf` in the post-processing step.
45
+ */
46
+ export declare function exportConditionalFormatting(ws: Worksheet, sheet: Sheet, startPriority: number): CfExportResult;
47
+ export {};
@@ -0,0 +1,14 @@
1
+ import { PendingDuplicateRule } from './xlsx-cf-export-utils';
2
+
3
+ export type SheetCfPatch = {
4
+ duplicateValues: PendingDuplicateRule[];
5
+ };
6
+ /**
7
+ * Post-process an XLSX buffer produced by ExcelJS to fix conditional
8
+ * formatting issues that ExcelJS cannot handle natively:
9
+ *
10
+ * 1. Adds the `text` attribute to `containsText` cfRules (ExcelJS omits it).
11
+ * 2. Injects `duplicateValues` cfRules that ExcelJS's renderer skips entirely,
12
+ * including their dxf style entries in xl/styles.xml.
13
+ */
14
+ export declare function patchXlsxCf(buffer: ArrayBuffer | Buffer, sheetPatches: SheetCfPatch[]): Promise<ArrayBuffer>;
@@ -1,5 +1,5 @@
1
1
  import { Workbook, Worksheet } from 'exceljs';
2
- import { Sheet } from '../../sheet-engine/react';
2
+ import { Sheet } from '../../sheet-engine/core';
3
3
 
4
4
  export interface RawSheetImage {
5
5
  src: string;
@@ -15,6 +15,19 @@ export interface RawSheetImage {
15
15
  brNativeRowOff?: number;
16
16
  }
17
17
  export declare function extractImagesFromWorksheet(ws: Worksheet, workbook: Workbook): RawSheetImage[];
18
+ /**
19
+ * Embed Fortune sheet images into an ExcelJS worksheet.
20
+ * This is the inverse of convertRawImagesToFortuneSheet: converts pixel-based
21
+ * Image objects back to ExcelJS native cell + EMU positioning.
22
+ */
23
+ export declare function addFortuneImagesToWorksheet(ws: Worksheet, workbook: Workbook, images: {
24
+ id: string;
25
+ src: string;
26
+ left: number;
27
+ top: number;
28
+ width: number;
29
+ height: number;
30
+ }[], sheet: Sheet, defaultColPx: number, defaultRowPx: number): void;
18
31
  export declare function convertRawImagesToFortuneSheet(rawImages: RawSheetImage[], sheet: Sheet, defaultColPx: number, defaultRowPx: number): {
19
32
  id: string;
20
33
  src: string;
@@ -0,0 +1,16 @@
1
+ import { Worksheet, RichText } from 'exceljs';
2
+
3
+ export type CellRichTextValue = {
4
+ richText: RichText[];
5
+ };
6
+ /**
7
+ * Convert a Fortune/Luckysheet `ct.s` rich text array into an ExcelJS
8
+ * CellRichTextValue. Returns null if there are no non-empty runs.
9
+ */
10
+ export declare function buildExcelJsRichText(ctS: any[]): CellRichTextValue | null;
11
+ /**
12
+ * Apply rich text values collected during Pass 1 to an ExcelJS worksheet.
13
+ * Cell-level styles (fill, borders, alignment) from xlsx-js-style are preserved
14
+ * because ExcelJS stores value and style independently.
15
+ */
16
+ export declare function applyRichTextToWorksheet(ws: Worksheet, richTextMap: Map<string, CellRichTextValue>): void;
@@ -1,4 +1,4 @@
1
- import { F as a } from "./index-ZCAfF51b.js";
1
+ import { F as a } from "./index-Cn_S2KAM.js";
2
2
  const r = {
3
3
  generalDialog: {
4
4
  partiallyError: "Cannot perform this operation on partially merged cells",