@fileverse-dev/dsheet 3.0.1-yjs-8 → 3.0.1-yjs-10

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/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as s, a as t, b as o, S as l, d as r, i as n, e as d, T as c, f as i, g as S, h, j as m, k as p, l as C, n as u, o as E, p as g, q as F, s as x, t as R, u as f, v as L, w as A, x as T, z as w, A as I, B as v, D, E as k } from "./index-sIdumZnm.js";
2
- import { cg as _, ch as V, ci as b, cn as z, bf as P, e as U, f as X, l as y, a as B, cY as O, cZ as j, a_ as G, c_ as H, c$ as Y, d3 as Z, d4 as q, d6 as J, D as K, dk as N, dL as $, aT as Q } from "./executeStringFunction-DiaE7AnQ.js";
1
+ import { C as s, a as t, b as o, S as l, d as r, i as n, e as d, T as c, f as i, g as S, h, j as m, k as p, l as C, n as u, o as E, p as g, q as F, s as x, t as R, u as f, v as A, w as L, x as w, z as I, A as T, B as v, D, E as M } from "./index-BDIZu4U9.js";
2
+ import { ch as U, ci as V, cj as _, co as b, bg as z, e as P, f as X, l as j, a as y, cZ as B, c_ as O, a$ as G, c$ as H, d0 as Z, d4 as $, d5 as q, d7 as J, D as K, dl as N, dM as Y, aU as Q } from "./executeStringFunction-DLKAY5dk.js";
3
3
  import { FLVURL as ee } from "@fileverse-dev/formulajs";
4
4
  import { E as se, S as te } from "./constants-Cdz6oSCq.js";
5
5
  export {
@@ -15,45 +15,45 @@ export {
15
15
  d as SupportedChain,
16
16
  c as TEMPLATES,
17
17
  i as api,
18
- _ as clearColumnsCellsFormat,
18
+ U as clearColumnsCellsFormat,
19
19
  S as clearFilter,
20
20
  V as clearRowsCellsFormat,
21
- b as clearSelectedCellFormat,
21
+ _ as clearSelectedCellFormat,
22
22
  h as createFilter,
23
- z as deleteRowCol,
24
- P as deleteSelectedCellText,
23
+ b as deleteRowCol,
24
+ z as deleteSelectedCellText,
25
25
  m as describeMatchedShortcut,
26
- U as executeStringFunction,
26
+ P as executeStringFunction,
27
27
  X as formulaResponseUiSync,
28
- y as getFlowdata,
28
+ j as getFlowdata,
29
29
  p as getRemoveDuplicatesErrorMessage,
30
30
  C as getRemoveDuplicatesPreview,
31
- B as getSheetIndex,
31
+ y as getSheetIndex,
32
32
  u as handleCSVUpload,
33
33
  E as handleCopy,
34
34
  g as handleExportToCSV,
35
35
  F as handleExportToJSON,
36
36
  x as handleExportToXLSX,
37
- O as handleFreeze,
38
- j as handleHorizontalAlign,
37
+ B as handleFreeze,
38
+ O as handleHorizontalAlign,
39
39
  G as handleLink,
40
40
  H as handleMerge,
41
41
  R as handlePasteByClick,
42
- Y as handleSort,
43
- Z as handleTextSize,
42
+ Z as handleSort,
43
+ $ as handleTextSize,
44
44
  q as handleVerticalAlign,
45
45
  f as importSpreadsheetFile,
46
46
  J as insertRowCol,
47
- L as isBrowserZoomShortcut,
48
- A as isFormulaListShortcut,
49
- T as isOpenShortcutsModalShortcut,
47
+ A as isBrowserZoomShortcut,
48
+ L as isFormulaListShortcut,
49
+ w as isOpenShortcutsModalShortcut,
50
50
  K as jfrefreshgrid,
51
51
  N as loadLocale,
52
- w as removeActiveImage,
53
- I as removeDuplicates,
52
+ I as removeActiveImage,
53
+ T as removeDuplicates,
54
54
  v as showImgChooser,
55
- $ as toolbarItemClickHandler,
55
+ Y as toolbarItemClickHandler,
56
56
  Q as updateFormat,
57
57
  D as useEnsStatus,
58
- k as useXLSXImport
58
+ M as useXLSXImport
59
59
  };
@@ -1,7 +1,14 @@
1
1
  import { Context } from '../context';
2
2
  import { Settings } from '../settings';
3
- import { CellMatrix, Sheet } from '../types';
3
+ import { CellMatrix, Sheet, SheetConfig } from '../types';
4
4
 
5
+ /**
6
+ * Persist active ctx.config onto ONE sheet file only.
7
+ * If Immer wrote keys (e.g. cellFormatRanges) on file.config but not ctx.config,
8
+ * keep those instead of wiping them with a blind replace.
9
+ * Never touches other sheets.
10
+ */
11
+ export declare function assignActiveConfigToSheetFile(file: Sheet, activeConfig: SheetConfig | undefined): void;
5
12
  export declare function storeSheetParamALL(ctx: Context): void;
6
13
  export declare function changeSheet(ctx: Context, id: string, isPivotInitial?: boolean, isNewSheet?: boolean, isCopySheet?: boolean): void;
7
14
  export declare function addSheet(ctx: Context, settings?: Required<Settings>, newSheetID?: string | undefined, // if action is from websocket, there will be a new sheetID
@@ -4,5 +4,7 @@ export declare const CELL_FORMAT_ATTRS: readonly ["tb", "ht", "vt", "tr", "fs",
4
4
  export type CellFormatAttr = (typeof CELL_FORMAT_ATTRS)[number];
5
5
  export declare function hasCellMeaningfulContent(cell: Cell | string | number | boolean | null | undefined): boolean;
6
6
  export declare function isFormatOnlyEmptyCell(cell: Cell | string | number | boolean | null | undefined): boolean;
7
+ /** Pull only present format attrs from a format-only empty cell (cheap, no clone). */
8
+ export declare function extractCellFormatAttrs(cell: Cell | string | number | boolean | null | undefined): Partial<Record<CellFormatAttr, unknown>> | null;
7
9
  export declare function shouldPersistCelldataCell(cell: Cell | string | number | boolean | null | undefined): boolean;
8
10
  export declare function celldataEntryEqual(existing: unknown, next: unknown): boolean;
@@ -15,7 +15,7 @@ export type CellFormatRange = {
15
15
  un?: number;
16
16
  cl?: number;
17
17
  bg?: string;
18
- ct?: Cell['ct'];
18
+ ct?: Cell["ct"];
19
19
  };
20
20
  declare function rangesEqual(a: CellFormatRange[] | undefined, b: CellFormatRange[] | undefined): boolean;
21
21
  /** Merge overlapping/adjacent ranges that carry identical format attrs. */
@@ -25,13 +25,13 @@ export declare function normalizeCellFormatRanges(ranges: CellFormatRange[] | un
25
25
  * drag-and-drop. A contiguous source range can become multiple rectangles
26
26
  * when the moved indices are no longer contiguous.
27
27
  */
28
- export declare function remapCellFormatRanges(ranges: CellFormatRange[] | undefined, axis: 'row' | 'column', indexMap: Record<number, number>): CellFormatRange[];
28
+ export declare function remapCellFormatRanges(ranges: CellFormatRange[] | undefined, axis: "row" | "column", indexMap: Record<number, number>): CellFormatRange[];
29
29
  /**
30
30
  * Move format ranges with a cut-and-paste cell block move. Formatting in both
31
31
  * the old source and the overwritten destination is cleared; only the source
32
32
  * intersection is translated to the target rectangle.
33
33
  */
34
- export declare function moveCellFormatRanges(ranges: CellFormatRange[] | undefined, source: Pick<CellFormatRange, 'row' | 'column'>, target: Pick<CellFormatRange, 'row' | 'column'>): CellFormatRange[];
34
+ export declare function moveCellFormatRanges(ranges: CellFormatRange[] | undefined, source: Pick<CellFormatRange, "row" | "column">, target: Pick<CellFormatRange, "row" | "column">): CellFormatRange[];
35
35
  export declare function getCellFormatRangeGridBounds(ranges: CellFormatRange[] | undefined): {
36
36
  maxRow: number;
37
37
  maxCol: number;
@@ -40,16 +40,32 @@ export declare function upsertCellFormatRange(ranges: CellFormatRange[] | undefi
40
40
  ranges: CellFormatRange[];
41
41
  changed: boolean;
42
42
  };
43
+ /**
44
+ * When a cell loses meaningful content but keeps style, put that style back
45
+ * into cellFormatRanges as a 1x1 (normalize merges with neighbours).
46
+ */
47
+ export declare function migrateFormatOnlyCellIntoRanges(ranges: CellFormatRange[] | undefined, r: number, c: number, cell: Cell | string | number | boolean | null | undefined): {
48
+ ranges: CellFormatRange[];
49
+ changed: boolean;
50
+ };
51
+ /**
52
+ * Scan a dense-data rectangle and move any format-only cells into
53
+ * cellFormatRanges. Adjacent identical styles merge via normalize.
54
+ */
55
+ export declare function migrateFormatOnlyCellsFromData(ranges: CellFormatRange[] | undefined, data: CellMatrix | null | undefined, r1: number, r2: number, c1: number, c2: number): {
56
+ ranges: CellFormatRange[];
57
+ changed: boolean;
58
+ };
43
59
  export declare function punchHoleInCellFormatRanges(ranges: CellFormatRange[] | undefined, r: number, c: number): CellFormatRange[];
44
60
  export declare function punchRectHoleInCellFormatRanges(ranges: CellFormatRange[] | undefined, rowSt: number, rowEd: number, colSt: number, colEd: number): CellFormatRange[];
45
- export declare function shiftCellFormatRangesOnInsert(ranges: CellFormatRange[] | undefined, type: 'row' | 'column', index: number, count: number, direction: 'lefttop' | 'rightbottom'): CellFormatRange[];
46
- export declare function shiftCellFormatRangesOnDelete(ranges: CellFormatRange[] | undefined, type: 'row' | 'column', start: number, end: number): CellFormatRange[];
61
+ export declare function shiftCellFormatRangesOnInsert(ranges: CellFormatRange[] | undefined, type: "row" | "column", index: number, count: number, direction: "lefttop" | "rightbottom"): CellFormatRange[];
62
+ export declare function shiftCellFormatRangesOnDelete(ranges: CellFormatRange[] | undefined, type: "row" | "column", start: number, end: number): CellFormatRange[];
47
63
  export declare function applyCellFormatRangesToData(data: CellMatrix | null | undefined, ranges: CellFormatRange[] | undefined): void;
48
64
  export declare function buildSheetDataMatrixForExport(sheet: {
49
65
  data?: CellMatrix | null;
50
66
  celldata?: CellWithRowAndCol[];
51
67
  row?: number;
52
68
  column?: number;
53
- config?: Sheet['config'];
69
+ config?: Sheet["config"];
54
70
  }): CellMatrix;
55
71
  export { rangesEqual };
@@ -1,6 +1,6 @@
1
- import { g as Ke } from "./executeStringFunction-DiaE7AnQ.js";
1
+ import { g as Ke } from "./executeStringFunction-DLKAY5dk.js";
2
2
  import * as et from "yjs";
3
- import { m as tt, y as rt, r as nt } from "./index-sIdumZnm.js";
3
+ import { m as tt, y as rt, r as nt } from "./index-BDIZu4U9.js";
4
4
  import { n as at } from "./xlsx-hyperlink-inline-DzewAypN.js";
5
5
  import { toast as Ge } from "@fileverse/ui";
6
6
  var Ze = { exports: {} };
@@ -2,8 +2,8 @@ import { utils as ht, write as Nt } from "xlsx-js-style";
2
2
  import { Workbook as Pt } from "exceljs";
3
3
  import { toast as Ut } from "@fileverse/ui";
4
4
  import { addFortuneImagesToWorksheet as Lt } from "./xlsx-image-utils-Cvg0qxRA.js";
5
- import { g as jt, c as xt, b as Wt } from "./executeStringFunction-DiaE7AnQ.js";
6
- import { c as Ct } from "./index-sIdumZnm.js";
5
+ import { g as jt, c as xt, b as Wt } from "./executeStringFunction-DLKAY5dk.js";
6
+ import { c as Ct } from "./index-BDIZu4U9.js";
7
7
  import { c as zt, g as Mt } from "./xlsx-hyperlink-inline-DzewAypN.js";
8
8
  const Zt = {
9
9
  1: "thin",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/dsheet",
3
3
  "private": false,
4
4
  "description": "DSheet",
5
- "version": "3.0.1-yjs-8",
5
+ "version": "3.0.1-yjs-10",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {