@ricsam/formula-engine 0.2.11 → 0.2.13
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/cjs/core/autofill-utils.cjs +68 -2
- package/dist/cjs/core/autofill-utils.cjs.map +3 -3
- package/dist/cjs/core/engine-snapshot.cjs +2 -2
- package/dist/cjs/core/engine-snapshot.cjs.map +3 -3
- package/dist/cjs/core/engine.cjs +47 -3
- package/dist/cjs/core/engine.cjs.map +3 -3
- package/dist/cjs/core/managers/copy-manager.cjs +163 -14
- package/dist/cjs/core/managers/copy-manager.cjs.map +3 -3
- package/dist/cjs/core/managers/range-metadata-manager.cjs +135 -0
- package/dist/cjs/core/managers/range-metadata-manager.cjs.map +10 -0
- package/dist/cjs/core/managers/style-manager.cjs +19 -14
- package/dist/cjs/core/managers/style-manager.cjs.map +3 -3
- package/dist/cjs/core/types.cjs.map +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/core/autofill-utils.mjs +68 -2
- package/dist/mjs/core/autofill-utils.mjs.map +3 -3
- package/dist/mjs/core/engine-snapshot.mjs +2 -2
- package/dist/mjs/core/engine-snapshot.mjs.map +3 -3
- package/dist/mjs/core/engine.mjs +47 -3
- package/dist/mjs/core/engine.mjs.map +3 -3
- package/dist/mjs/core/managers/copy-manager.mjs +163 -14
- package/dist/mjs/core/managers/copy-manager.mjs.map +3 -3
- package/dist/mjs/core/managers/range-metadata-manager.mjs +95 -0
- package/dist/mjs/core/managers/range-metadata-manager.mjs.map +10 -0
- package/dist/mjs/core/managers/style-manager.mjs +19 -14
- package/dist/mjs/core/managers/style-manager.mjs.map +3 -3
- package/dist/mjs/core/types.mjs.map +1 -1
- package/dist/mjs/package.json +1 -1
- package/dist/types/core/autofill-utils.d.ts +7 -1
- package/dist/types/core/engine-snapshot.d.ts +4 -2
- package/dist/types/core/engine.d.ts +32 -1
- package/dist/types/core/managers/copy-manager.d.ts +11 -1
- package/dist/types/core/managers/range-metadata-manager.d.ts +22 -0
- package/dist/types/core/managers/style-manager.d.ts +4 -3
- package/dist/types/core/types.d.ts +26 -6
- package/package.json +1 -1
|
@@ -53,14 +53,16 @@ class CopyManager {
|
|
|
53
53
|
workbookManager;
|
|
54
54
|
evaluationManager;
|
|
55
55
|
styleManager;
|
|
56
|
-
|
|
56
|
+
rangeMetadataManager;
|
|
57
|
+
constructor(workbookManager, evaluationManager, styleManager, rangeMetadataManager) {
|
|
57
58
|
this.workbookManager = workbookManager;
|
|
58
59
|
this.evaluationManager = evaluationManager;
|
|
59
60
|
this.styleManager = styleManager;
|
|
61
|
+
this.rangeMetadataManager = rangeMetadataManager;
|
|
60
62
|
}
|
|
61
63
|
normalizeInclude(include) {
|
|
62
64
|
if (!include || include === "all") {
|
|
63
|
-
return ["content", "style", "
|
|
65
|
+
return ["content", "style", "cellMetadata", "rangeMetadata"];
|
|
64
66
|
}
|
|
65
67
|
return include;
|
|
66
68
|
}
|
|
@@ -83,7 +85,15 @@ class CopyManager {
|
|
|
83
85
|
const rowOffset = target.rowIndex - topLeft.rowIndex;
|
|
84
86
|
const colOffset = target.colIndex - topLeft.colIndex;
|
|
85
87
|
const snapshot = this.snapshotCellsWithStyles(source);
|
|
88
|
+
const rangeMetadataCopies = this.shouldInclude(options, "rangeMetadata") ? this.collectRangeMetadataCopies(source, topLeft, target, rowOffset, colOffset) : [];
|
|
89
|
+
const sourceRange = this.getBoundingBox(source);
|
|
90
|
+
const targetRange = this.adjustRange(sourceRange, rowOffset, colOffset);
|
|
86
91
|
this.clearSourceCells(source);
|
|
92
|
+
if (this.shouldInclude(options, "cellMetadata")) {
|
|
93
|
+
for (const cell of source) {
|
|
94
|
+
this.workbookManager.setCellMetadata(cell, undefined);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
87
97
|
if (this.shouldInclude(options, "style")) {
|
|
88
98
|
for (const cell of source) {
|
|
89
99
|
const cellRange = {
|
|
@@ -100,6 +110,10 @@ class CopyManager {
|
|
|
100
110
|
this.styleManager.clearCellStylesInRange(cellRange);
|
|
101
111
|
}
|
|
102
112
|
}
|
|
113
|
+
if (this.shouldInclude(options, "rangeMetadata")) {
|
|
114
|
+
this.rangeMetadataManager.clearRangeMetadataInRange(this.getRangeAddressFromBoundingBox(topLeft, sourceRange));
|
|
115
|
+
this.rangeMetadataManager.clearRangeMetadataInRange(this.getRangeAddressFromBoundingBox(target, targetRange));
|
|
116
|
+
}
|
|
103
117
|
const movedCellsSet = new Set(source.map((c) => `${c.workbookName}:${c.sheetName}:${c.colIndex}:${c.rowIndex}`));
|
|
104
118
|
const movedCellsInfo = {
|
|
105
119
|
cellsSet: movedCellsSet,
|
|
@@ -131,7 +145,7 @@ class CopyManager {
|
|
|
131
145
|
}
|
|
132
146
|
this.workbookManager.setCellContent(targetCell, targetContent);
|
|
133
147
|
}
|
|
134
|
-
if (this.shouldInclude(options, "
|
|
148
|
+
if (this.shouldInclude(options, "cellMetadata")) {
|
|
135
149
|
if (snap.metadata) {
|
|
136
150
|
this.workbookManager.setCellMetadata(targetCell, {
|
|
137
151
|
...snap.metadata
|
|
@@ -144,6 +158,9 @@ class CopyManager {
|
|
|
144
158
|
this.applyStylesFromSnapshot(snap, targetCell);
|
|
145
159
|
}
|
|
146
160
|
}
|
|
161
|
+
if (this.shouldInclude(options, "rangeMetadata")) {
|
|
162
|
+
this.applyRangeMetadataCopies(rangeMetadataCopies);
|
|
163
|
+
}
|
|
147
164
|
}
|
|
148
165
|
copyOnlyCells(source, target, options) {
|
|
149
166
|
const topLeft = this.findTopLeft(source);
|
|
@@ -163,9 +180,25 @@ class CopyManager {
|
|
|
163
180
|
this.copyCellContentFromSnapshot(cellSnapshot, targetCell, topLeft, options);
|
|
164
181
|
}
|
|
165
182
|
}
|
|
183
|
+
if (this.shouldInclude(options, "cellMetadata")) {
|
|
184
|
+
for (let i = 0;i < source.length; i++) {
|
|
185
|
+
const sourceCell = source[i];
|
|
186
|
+
const cellSnapshot = snapshot[i];
|
|
187
|
+
const targetCell = {
|
|
188
|
+
workbookName: target.workbookName,
|
|
189
|
+
sheetName: target.sheetName,
|
|
190
|
+
colIndex: sourceCell.colIndex + colOffset,
|
|
191
|
+
rowIndex: sourceCell.rowIndex + rowOffset
|
|
192
|
+
};
|
|
193
|
+
this.copyCellMetadataFromSnapshot(cellSnapshot, targetCell);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
166
196
|
if (this.shouldInclude(options, "style")) {
|
|
167
197
|
this.copyFormatting(source, topLeft, target, rowOffset, colOffset);
|
|
168
198
|
}
|
|
199
|
+
if (this.shouldInclude(options, "rangeMetadata")) {
|
|
200
|
+
this.copyRangeMetadata(source, topLeft, target, rowOffset, colOffset);
|
|
201
|
+
}
|
|
169
202
|
}
|
|
170
203
|
findTopLeft(cells) {
|
|
171
204
|
let minRow = Infinity;
|
|
@@ -305,14 +338,14 @@ class CopyManager {
|
|
|
305
338
|
const targetKey = `${String.fromCharCode(65 + targetCell.colIndex)}${targetCell.rowIndex + 1}`;
|
|
306
339
|
targetSheet.content.set(targetKey, targetContent);
|
|
307
340
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
|
|
341
|
+
}
|
|
342
|
+
copyCellMetadataFromSnapshot(snapshot, targetCell) {
|
|
343
|
+
if (snapshot.metadata) {
|
|
344
|
+
this.workbookManager.setCellMetadata(targetCell, {
|
|
345
|
+
...snapshot.metadata
|
|
346
|
+
});
|
|
347
|
+
} else {
|
|
348
|
+
this.workbookManager.setCellMetadata(targetCell, undefined);
|
|
316
349
|
}
|
|
317
350
|
}
|
|
318
351
|
copyCellContent(sourceCell, targetCell, sourceTopLeft, options) {
|
|
@@ -367,7 +400,7 @@ class CopyManager {
|
|
|
367
400
|
const targetKey = `${String.fromCharCode(65 + targetCell.colIndex)}${targetCell.rowIndex + 1}`;
|
|
368
401
|
targetSheet.content.set(targetKey, targetContent);
|
|
369
402
|
}
|
|
370
|
-
if (this.shouldInclude(options, "
|
|
403
|
+
if (this.shouldInclude(options, "cellMetadata")) {
|
|
371
404
|
const sourceMetadata = this.workbookManager.getCellMetadata(sourceCell);
|
|
372
405
|
if (sourceMetadata) {
|
|
373
406
|
this.workbookManager.setCellMetadata(targetCell, { ...sourceMetadata });
|
|
@@ -472,6 +505,61 @@ class CopyManager {
|
|
|
472
505
|
}
|
|
473
506
|
}
|
|
474
507
|
}
|
|
508
|
+
cloneMetadataValue(metadata) {
|
|
509
|
+
if (!metadata || typeof metadata !== "object") {
|
|
510
|
+
return metadata;
|
|
511
|
+
}
|
|
512
|
+
try {
|
|
513
|
+
return structuredClone(metadata);
|
|
514
|
+
} catch {
|
|
515
|
+
return Array.isArray(metadata) ? [...metadata] : { ...metadata };
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
getRangeAddressFromBoundingBox(base, range) {
|
|
519
|
+
return {
|
|
520
|
+
workbookName: base.workbookName,
|
|
521
|
+
sheetName: base.sheetName,
|
|
522
|
+
range
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
collectRangeMetadataCopies(sourceCells, sourceTopLeft, target, rowOffset, colOffset) {
|
|
526
|
+
const sourceRange = this.getBoundingBox(sourceCells);
|
|
527
|
+
const copies = [];
|
|
528
|
+
for (const entry of this.rangeMetadataManager.getAllRangeMetadata()) {
|
|
529
|
+
for (const area of entry.areas) {
|
|
530
|
+
if (area.workbookName !== sourceTopLeft.workbookName || area.sheetName !== sourceTopLeft.sheetName) {
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
const intersection = import_range_utils.intersectRanges(area.range, sourceRange);
|
|
534
|
+
if (!intersection) {
|
|
535
|
+
continue;
|
|
536
|
+
}
|
|
537
|
+
copies.push({
|
|
538
|
+
areas: [
|
|
539
|
+
{
|
|
540
|
+
workbookName: target.workbookName,
|
|
541
|
+
sheetName: target.sheetName,
|
|
542
|
+
range: this.adjustRange(intersection, rowOffset, colOffset)
|
|
543
|
+
}
|
|
544
|
+
],
|
|
545
|
+
metadata: this.cloneMetadataValue(entry.metadata)
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
return copies;
|
|
550
|
+
}
|
|
551
|
+
applyRangeMetadataCopies(copies) {
|
|
552
|
+
for (const copy of copies) {
|
|
553
|
+
this.rangeMetadataManager.addRangeMetadata(copy);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
copyRangeMetadata(sourceCells, sourceTopLeft, target, rowOffset, colOffset) {
|
|
557
|
+
const sourceRange = this.getBoundingBox(sourceCells);
|
|
558
|
+
const targetRange = this.adjustRange(sourceRange, rowOffset, colOffset);
|
|
559
|
+
const copies = this.collectRangeMetadataCopies(sourceCells, sourceTopLeft, target, rowOffset, colOffset);
|
|
560
|
+
this.rangeMetadataManager.clearRangeMetadataInRange(this.getRangeAddressFromBoundingBox(target, targetRange));
|
|
561
|
+
this.applyRangeMetadataCopies(copies);
|
|
562
|
+
}
|
|
475
563
|
getBoundingBox(cells) {
|
|
476
564
|
let minRow = Infinity;
|
|
477
565
|
let maxRow = -Infinity;
|
|
@@ -513,6 +601,8 @@ class CopyManager {
|
|
|
513
601
|
this.fillRangeWithSeed(seedRange, targetRange, {
|
|
514
602
|
copyContent: this.shouldInclude(options, "content"),
|
|
515
603
|
copyStyles: this.shouldInclude(options, "style"),
|
|
604
|
+
copyCellMetadata: this.shouldInclude(options, "cellMetadata"),
|
|
605
|
+
copyRangeMetadata: this.shouldInclude(options, "rangeMetadata"),
|
|
516
606
|
contentType: options.type ?? "formula",
|
|
517
607
|
adjustFormulas: true
|
|
518
608
|
});
|
|
@@ -526,6 +616,9 @@ class CopyManager {
|
|
|
526
616
|
if (options.copyStyles) {
|
|
527
617
|
this.styleManager.clearCellStylesInRange(targetRange);
|
|
528
618
|
}
|
|
619
|
+
if (options.copyRangeMetadata) {
|
|
620
|
+
this.rangeMetadataManager.clearRangeMetadataInRange(targetRange);
|
|
621
|
+
}
|
|
529
622
|
const seedCells = this.expandRangeToCells(seedRange);
|
|
530
623
|
const seedWidth = this.getRangeWidth(seedRange);
|
|
531
624
|
const seedHeight = this.getRangeHeight(seedRange);
|
|
@@ -555,6 +648,12 @@ class CopyManager {
|
|
|
555
648
|
if (options.copyStyles) {
|
|
556
649
|
this.copyCellFormatting(seedCell, targetCell);
|
|
557
650
|
}
|
|
651
|
+
if (options.copyCellMetadata) {
|
|
652
|
+
this.copyCellMetadata(seedCell, targetCell);
|
|
653
|
+
}
|
|
654
|
+
if (options.copyRangeMetadata) {
|
|
655
|
+
this.copyCellRangeMetadata(seedCell, targetCell);
|
|
656
|
+
}
|
|
558
657
|
const key = `${targetCell.colIndex}-${targetCell.rowIndex}`;
|
|
559
658
|
const sheet = this.workbookManager.getSheet({
|
|
560
659
|
workbookName: targetCell.workbookName,
|
|
@@ -593,6 +692,12 @@ class CopyManager {
|
|
|
593
692
|
if (options.copyStyles) {
|
|
594
693
|
this.copyCellFormatting(sourceCell, targetCell);
|
|
595
694
|
}
|
|
695
|
+
if (options.copyCellMetadata) {
|
|
696
|
+
this.copyCellMetadata(sourceCell, targetCell);
|
|
697
|
+
}
|
|
698
|
+
if (options.copyRangeMetadata) {
|
|
699
|
+
this.copyCellRangeMetadata(sourceCell, targetCell);
|
|
700
|
+
}
|
|
596
701
|
}
|
|
597
702
|
}
|
|
598
703
|
}
|
|
@@ -692,7 +797,7 @@ class CopyManager {
|
|
|
692
797
|
const targetKey = `${String.fromCharCode(65 + targetCell.colIndex)}${targetCell.rowIndex + 1}`;
|
|
693
798
|
targetSheet.content.set(targetKey, targetContent);
|
|
694
799
|
}
|
|
695
|
-
if (this.shouldInclude(options, "
|
|
800
|
+
if (this.shouldInclude(options, "cellMetadata")) {
|
|
696
801
|
const sourceMetadata = this.workbookManager.getCellMetadata(sourceCell);
|
|
697
802
|
if (sourceMetadata) {
|
|
698
803
|
this.workbookManager.setCellMetadata(targetCell, { ...sourceMetadata });
|
|
@@ -744,6 +849,50 @@ class CopyManager {
|
|
|
744
849
|
return formula;
|
|
745
850
|
}
|
|
746
851
|
}
|
|
852
|
+
copyCellMetadata(sourceCell, targetCell) {
|
|
853
|
+
const sourceMetadata = this.workbookManager.getCellMetadata(sourceCell);
|
|
854
|
+
if (sourceMetadata) {
|
|
855
|
+
this.workbookManager.setCellMetadata(targetCell, { ...sourceMetadata });
|
|
856
|
+
} else {
|
|
857
|
+
this.workbookManager.setCellMetadata(targetCell, undefined);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
copyCellRangeMetadata(sourceCell, targetCell) {
|
|
861
|
+
const targetCellRange = {
|
|
862
|
+
workbookName: targetCell.workbookName,
|
|
863
|
+
sheetName: targetCell.sheetName,
|
|
864
|
+
range: {
|
|
865
|
+
start: { col: targetCell.colIndex, row: targetCell.rowIndex },
|
|
866
|
+
end: {
|
|
867
|
+
col: { type: "number", value: targetCell.colIndex },
|
|
868
|
+
row: { type: "number", value: targetCell.rowIndex }
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
this.rangeMetadataManager.clearRangeMetadataInRange(targetCellRange);
|
|
873
|
+
const sourceCellRange = {
|
|
874
|
+
start: { col: sourceCell.colIndex, row: sourceCell.rowIndex },
|
|
875
|
+
end: {
|
|
876
|
+
col: { type: "number", value: sourceCell.colIndex },
|
|
877
|
+
row: { type: "number", value: sourceCell.rowIndex }
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
for (const entry of this.rangeMetadataManager.getAllRangeMetadata()) {
|
|
881
|
+
for (const area of entry.areas) {
|
|
882
|
+
if (area.workbookName !== sourceCell.workbookName || area.sheetName !== sourceCell.sheetName) {
|
|
883
|
+
continue;
|
|
884
|
+
}
|
|
885
|
+
const intersection = import_range_utils.intersectRanges(area.range, sourceCellRange);
|
|
886
|
+
if (!intersection) {
|
|
887
|
+
continue;
|
|
888
|
+
}
|
|
889
|
+
this.rangeMetadataManager.addRangeMetadata({
|
|
890
|
+
areas: [targetCellRange],
|
|
891
|
+
metadata: this.cloneMetadataValue(entry.metadata)
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
747
896
|
copyCellFormatting(sourceCell, targetCell) {
|
|
748
897
|
const targetCellRange = {
|
|
749
898
|
workbookName: targetCell.workbookName,
|
|
@@ -827,4 +976,4 @@ class CopyManager {
|
|
|
827
976
|
}
|
|
828
977
|
}
|
|
829
978
|
|
|
830
|
-
//# debugId=
|
|
979
|
+
//# debugId=B4B058B25AE84A5064756E2164756E21
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/core/managers/copy-manager.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * CopyManager - Manages cell copy/paste operations\n */\n\nimport type {\n CellAddress,\n CopyCellsOptions,\n ConditionalStyle,\n DirectCellStyle,\n LocalCellAddress,\n RangeAddress,\n SerializedCellValue,\n SpreadsheetRange,\n} from \"../types.cjs\";\nimport type { WorkbookManager } from \"./workbook-manager.cjs\";\nimport type { EvaluationManager } from \"./evaluation-manager.cjs\";\nimport type { StyleManager } from \"./style-manager.cjs\";\nimport { parseFormula } from \"../../parser/parser.cjs\";\nimport { astToString } from \"../../parser/formatter.cjs\";\nimport { transformAST } from \"../ast-traverser.cjs\";\nimport type { ReferenceNode, RangeNode } from \"../../parser/ast.cjs\";\nimport { getCellReference, isCellInRange } from \"../utils.cjs\";\nimport { intersectRanges } from \"../utils/range-utils.cjs\";\nimport {\n updateReferencesForMovedCells,\n type MovedCellsInfo,\n} from \"../cell-mover.cjs\";\n\n/**\n * Snapshot of a cell's content, metadata, and styles\n */\ninterface CellSnapshot {\n address: CellAddress;\n content: SerializedCellValue | undefined;\n metadata: unknown | undefined;\n matchingCellStyles?: DirectCellStyle[];\n matchingConditionalStyles?: ConditionalStyle[];\n}\n\nexport class CopyManager {\n constructor(\n private workbookManager: WorkbookManager,\n private evaluationManager: EvaluationManager,\n private styleManager: StyleManager\n ) {}\n\n /**\n * Normalize the include option to an array of parts to copy\n */\n private normalizeInclude(\n include: CopyCellsOptions[\"include\"]\n ): (\"content\" | \"style\" | \"metadata\")[] {\n if (!include || include === \"all\") {\n return [\"content\", \"style\", \"metadata\"];\n }\n return include;\n }\n\n /**\n * Check if a specific part should be included in the copy operation\n */\n private shouldInclude(\n options: CopyCellsOptions,\n part: \"content\" | \"style\" | \"metadata\"\n ): boolean {\n const normalized = this.normalizeInclude(options.include);\n return normalized.includes(part);\n }\n\n /**\n * Paste cells from source to target\n * Delegates to cutCells for move operations or copyOnlyCells for copy operations\n */\n pasteCells(\n source: CellAddress[],\n target: CellAddress,\n options: CopyCellsOptions\n ): void {\n if (source.length === 0) {\n return;\n }\n\n if (options.cut === true) {\n return this.cutCells(source, target, options);\n } else {\n return this.copyOnlyCells(source, target, options);\n }\n }\n\n /**\n * Cut cells: Proper snapshot flow for move operations\n * 1. Snapshot source cells (with styles)\n * 2. Remove source cells and punch holes in style areas\n * 3. Update references in OTHER cells (not in moved set)\n * 4. Update formulas in snapshot and apply to target\n */\n private cutCells(\n source: CellAddress[],\n target: CellAddress,\n options: CopyCellsOptions\n ): void {\n const topLeft = this.findTopLeft(source);\n const rowOffset = target.rowIndex - topLeft.rowIndex;\n const colOffset = target.colIndex - topLeft.colIndex;\n\n // 1. Snapshot source cells (with styles)\n const snapshot = this.snapshotCellsWithStyles(source);\n\n // 2. Remove source cells (content) and punch holes in styles\n this.clearSourceCells(source);\n\n // Punch holes in style areas for each cut cell\n if (this.shouldInclude(options, \"style\")) {\n for (const cell of source) {\n const cellRange: RangeAddress = {\n workbookName: cell.workbookName,\n sheetName: cell.sheetName,\n range: {\n start: { col: cell.colIndex, row: cell.rowIndex },\n end: {\n col: { type: \"number\", value: cell.colIndex },\n row: { type: \"number\", value: cell.rowIndex },\n },\n },\n };\n this.styleManager.clearCellStylesInRange(cellRange);\n }\n }\n\n // 3. Update references in OTHER cells (not in moved set)\n const movedCellsSet = new Set(\n source.map(\n (c) => `${c.workbookName}:${c.sheetName}:${c.colIndex}:${c.rowIndex}`\n )\n );\n\n const movedCellsInfo: MovedCellsInfo = {\n cellsSet: movedCellsSet,\n workbookName: topLeft.workbookName,\n sheetName: topLeft.sheetName,\n rowOffset,\n colOffset,\n };\n\n this.workbookManager.updateFormulasExcluding(movedCellsSet, (formula) =>\n updateReferencesForMovedCells(formula, movedCellsInfo)\n );\n\n // 4. Update formulas in snapshot and apply to target\n for (let i = 0; i < snapshot.length; i++) {\n const snap = snapshot[i]!;\n const sourceCell = source[i]!;\n const targetCell: CellAddress = {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n colIndex: sourceCell.colIndex + colOffset,\n rowIndex: sourceCell.rowIndex + rowOffset,\n };\n\n // Apply content (with formula adjustment)\n if (this.shouldInclude(options, \"content\") && snap.content) {\n let targetContent = snap.content;\n\n if (typeof snap.content === \"string\" && snap.content.startsWith(\"=\")) {\n // Adjust formula references relative to new position\n targetContent = this.adjustFormulaReferences(\n snap.content,\n {\n colIndex: snap.address.colIndex,\n rowIndex: snap.address.rowIndex,\n },\n {\n colIndex: targetCell.colIndex,\n rowIndex: targetCell.rowIndex,\n }\n );\n }\n\n // Use setCellContent to ensure proper cache invalidation and dependency tracking\n this.workbookManager.setCellContent(targetCell, targetContent);\n }\n\n // Apply metadata\n if (this.shouldInclude(options, \"metadata\")) {\n if (snap.metadata) {\n this.workbookManager.setCellMetadata(targetCell, {\n ...snap.metadata,\n });\n } else {\n this.workbookManager.setCellMetadata(targetCell, undefined);\n }\n }\n\n // Apply styles from snapshot to new location\n if (this.shouldInclude(options, \"style\")) {\n this.applyStylesFromSnapshot(snap, targetCell);\n }\n }\n }\n\n /**\n * Copy cells: Standard copy operation (not cut/move)\n * Snapshot → Copy with adjustment → Copy formatting\n */\n private copyOnlyCells(\n source: CellAddress[],\n target: CellAddress,\n options: CopyCellsOptions\n ): void {\n const topLeft = this.findTopLeft(source);\n const rowOffset = target.rowIndex - topLeft.rowIndex;\n const colOffset = target.colIndex - topLeft.colIndex;\n\n // SNAPSHOT source cells (handles overlapping ranges)\n const snapshot = this.snapshotCells(source);\n\n // Copy cell contents if requested (from snapshot, not live cells)\n if (this.shouldInclude(options, \"content\")) {\n for (let i = 0; i < source.length; i++) {\n const sourceCell = source[i]!;\n const cellSnapshot = snapshot[i]!;\n const targetCell: CellAddress = {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n colIndex: sourceCell.colIndex + colOffset,\n rowIndex: sourceCell.rowIndex + rowOffset,\n };\n\n this.copyCellContentFromSnapshot(\n cellSnapshot,\n targetCell,\n topLeft,\n options\n );\n }\n }\n\n // Copy formatting if requested\n if (this.shouldInclude(options, \"style\")) {\n this.copyFormatting(source, topLeft, target, rowOffset, colOffset);\n }\n }\n\n /**\n * Find the top-left cell (minimum row/col indices)\n */\n private findTopLeft(cells: CellAddress[]): CellAddress {\n let minRow = Infinity;\n let minCol = Infinity;\n let topLeftCell = cells[0]!;\n\n for (const cell of cells) {\n if (\n cell.rowIndex < minRow ||\n (cell.rowIndex === minRow && cell.colIndex < minCol)\n ) {\n minRow = cell.rowIndex;\n minCol = cell.colIndex;\n topLeftCell = cell;\n }\n }\n\n return topLeftCell;\n }\n\n /**\n * Create a snapshot of cells' content and metadata\n * This prevents issues with overlapping ranges where source and target overlap\n * Used for copy operations (not cut)\n */\n private snapshotCells(cells: CellAddress[]): CellSnapshot[] {\n return cells.map((cell) => {\n const sheet = this.workbookManager.getSheet({\n workbookName: cell.workbookName,\n sheetName: cell.sheetName,\n });\n\n const key = `${String.fromCharCode(65 + cell.colIndex)}${\n cell.rowIndex + 1\n }`;\n const content = sheet?.content.get(key);\n const metadata = this.workbookManager.getCellMetadata(cell);\n\n return {\n address: cell,\n content,\n metadata,\n };\n });\n }\n\n /**\n * Create a snapshot of cells with content, metadata, AND styles\n * Used for cut operations to preserve all cell information\n */\n private snapshotCellsWithStyles(cells: CellAddress[]): CellSnapshot[] {\n const allCellStyles = this.styleManager.getAllCellStyles();\n const allConditionalStyles = this.styleManager.getAllConditionalStyles();\n\n return cells.map((cell) => {\n const sheet = this.workbookManager.getSheet({\n workbookName: cell.workbookName,\n sheetName: cell.sheetName,\n });\n\n const key = getCellReference(cell);\n const content = sheet?.content.get(key);\n const metadata = this.workbookManager.getCellMetadata(cell);\n\n // Find all styles that apply to this cell\n const matchingCellStyles = allCellStyles.filter((style) =>\n style.areas.some(\n (area) =>\n area.workbookName === cell.workbookName &&\n area.sheetName === cell.sheetName &&\n isCellInRange(cell, area.range)\n )\n );\n\n const matchingConditionalStyles = allConditionalStyles.filter((style) =>\n style.areas.some(\n (area) =>\n area.workbookName === cell.workbookName &&\n area.sheetName === cell.sheetName &&\n isCellInRange(cell, area.range)\n )\n );\n\n return {\n address: cell,\n content,\n metadata,\n matchingCellStyles,\n matchingConditionalStyles,\n };\n });\n }\n\n /**\n * Apply styles from a snapshot to a target cell\n * Creates new style areas at the target location\n */\n private applyStylesFromSnapshot(\n snapshot: CellSnapshot,\n targetCell: CellAddress\n ): void {\n // Apply cell styles\n if (snapshot.matchingCellStyles) {\n for (const style of snapshot.matchingCellStyles) {\n const newStyle: DirectCellStyle = {\n areas: [\n {\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n range: {\n start: { col: targetCell.colIndex, row: targetCell.rowIndex },\n end: {\n col: { type: \"number\", value: targetCell.colIndex },\n row: { type: \"number\", value: targetCell.rowIndex },\n },\n },\n },\n ],\n style: style.style,\n };\n this.styleManager.addCellStyle(newStyle);\n }\n }\n\n // Apply conditional styles\n if (snapshot.matchingConditionalStyles) {\n for (const style of snapshot.matchingConditionalStyles) {\n const newStyle: ConditionalStyle = {\n areas: [\n {\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n range: {\n start: { col: targetCell.colIndex, row: targetCell.rowIndex },\n end: {\n col: { type: \"number\", value: targetCell.colIndex },\n row: { type: \"number\", value: targetCell.rowIndex },\n },\n },\n },\n ],\n condition: style.condition,\n };\n this.styleManager.addConditionalStyle(newStyle);\n }\n }\n }\n\n /**\n * Copy content from a cell snapshot to a target cell\n */\n private copyCellContentFromSnapshot(\n snapshot: CellSnapshot,\n targetCell: CellAddress,\n sourceTopLeft: CellAddress,\n options: CopyCellsOptions\n ): void {\n if (!snapshot.content) {\n // Source cell was empty\n return;\n }\n\n let targetContent: SerializedCellValue;\n const copyType = options.type ?? \"formula\";\n\n if (copyType === \"value\") {\n // Copy evaluated value\n const evalResult = this.evaluationManager.getCellEvaluationResult(\n snapshot.address\n );\n\n if (!evalResult || evalResult.type !== \"value\") {\n // If evaluation failed or is not a value, copy as-is\n targetContent = snapshot.content;\n } else {\n // Convert to literal value\n const result = evalResult.result;\n if (result.type === \"number\") {\n targetContent = result.value;\n } else if (result.type === \"string\") {\n targetContent = result.value;\n } else if (result.type === \"boolean\") {\n targetContent = result.value;\n } else {\n // Error or other type, copy as-is\n targetContent = snapshot.content;\n }\n }\n } else {\n // Copy formula\n if (\n typeof snapshot.content === \"string\" &&\n snapshot.content.startsWith(\"=\")\n ) {\n // Adjust formula references\n targetContent = this.adjustFormulaReferences(\n snapshot.content,\n {\n colIndex: snapshot.address.colIndex,\n rowIndex: snapshot.address.rowIndex,\n },\n {\n colIndex: targetCell.colIndex,\n rowIndex: targetCell.rowIndex,\n }\n );\n } else {\n // Not a formula, copy as-is\n targetContent = snapshot.content;\n }\n }\n\n // Set target cell content\n const targetSheet = this.workbookManager.getSheet({\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n });\n\n if (targetSheet) {\n const targetKey = `${String.fromCharCode(65 + targetCell.colIndex)}${\n targetCell.rowIndex + 1\n }`;\n targetSheet.content.set(targetKey, targetContent);\n }\n\n // Copy metadata if requested\n if (this.shouldInclude(options, \"metadata\")) {\n if (snapshot.metadata) {\n this.workbookManager.setCellMetadata(targetCell, {\n ...snapshot.metadata,\n });\n } else {\n // Clear target metadata if source has none\n this.workbookManager.setCellMetadata(targetCell, undefined);\n }\n }\n }\n\n /**\n * Update all formula references when cells are cut (moved)\n */\n /**\n * Copy content from one cell to another\n */\n private copyCellContent(\n sourceCell: CellAddress,\n targetCell: CellAddress,\n sourceTopLeft: CellAddress,\n options: CopyCellsOptions\n ): void {\n const sheet = this.workbookManager.getSheet({\n workbookName: sourceCell.workbookName,\n sheetName: sourceCell.sheetName,\n });\n\n if (!sheet) {\n return;\n }\n\n const key = `${String.fromCharCode(65 + sourceCell.colIndex)}${\n sourceCell.rowIndex + 1\n }`;\n const cellContent = sheet.content.get(key);\n\n if (!cellContent) {\n // Source cell is empty\n return;\n }\n\n let targetContent: SerializedCellValue;\n const copyType = options.type ?? \"formula\";\n\n if (copyType === \"value\") {\n // Copy evaluated value\n const evalResult =\n this.evaluationManager.getCellEvaluationResult(sourceCell);\n\n if (!evalResult || evalResult.type !== \"value\") {\n // If evaluation failed or is not a value, copy as-is\n targetContent = cellContent;\n } else {\n // Convert to literal value\n const result = evalResult.result;\n if (result.type === \"number\") {\n targetContent = result.value;\n } else if (result.type === \"string\") {\n targetContent = result.value;\n } else if (result.type === \"boolean\") {\n targetContent = result.value;\n } else {\n // Error or other type, copy as-is\n targetContent = cellContent;\n }\n }\n } else {\n // Copy formula\n if (typeof cellContent === \"string\" && cellContent.startsWith(\"=\")) {\n // Adjust formula references\n targetContent = this.adjustFormulaReferences(\n cellContent,\n {\n colIndex: sourceCell.colIndex,\n rowIndex: sourceCell.rowIndex,\n },\n {\n colIndex: targetCell.colIndex,\n rowIndex: targetCell.rowIndex,\n }\n );\n } else {\n // Not a formula, copy as-is\n targetContent = cellContent;\n }\n }\n\n // Set target cell content (using the engine's method through workbook manager)\n const targetSheet = this.workbookManager.getSheet({\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n });\n\n if (targetSheet) {\n const targetKey = `${String.fromCharCode(65 + targetCell.colIndex)}${\n targetCell.rowIndex + 1\n }`;\n targetSheet.content.set(targetKey, targetContent);\n }\n\n // Copy metadata if requested\n if (this.shouldInclude(options, \"metadata\")) {\n const sourceMetadata = this.workbookManager.getCellMetadata(sourceCell);\n if (sourceMetadata) {\n this.workbookManager.setCellMetadata(targetCell, { ...sourceMetadata });\n } else {\n // Clear target metadata if source has none\n this.workbookManager.setCellMetadata(targetCell, undefined);\n }\n }\n }\n\n /**\n * Adjust formula references when copying\n * Based on autofill-utils.ts adjustFormulaReferences\n */\n private adjustFormulaReferences(\n formula: string,\n sourceAddress: LocalCellAddress,\n targetAddress: LocalCellAddress\n ): string {\n try {\n const ast = parseFormula(formula.slice(1)); // Remove the \"=\" sign\n\n const rowDelta = targetAddress.rowIndex - sourceAddress.rowIndex;\n const colDelta = targetAddress.colIndex - sourceAddress.colIndex;\n\n const adjustedAst = transformAST(ast, (node) => {\n if (node.type === \"reference\") {\n const refNode = node as ReferenceNode;\n return {\n ...refNode,\n address: {\n colIndex: refNode.isAbsolute.col\n ? refNode.address.colIndex\n : refNode.address.colIndex + colDelta,\n rowIndex: refNode.isAbsolute.row\n ? refNode.address.rowIndex\n : refNode.address.rowIndex + rowDelta,\n },\n };\n } else if (node.type === \"range\") {\n const rangeNode = node as RangeNode;\n return {\n ...rangeNode,\n range: {\n start: {\n col: rangeNode.isAbsolute.start.col\n ? rangeNode.range.start.col\n : rangeNode.range.start.col + colDelta,\n row: rangeNode.isAbsolute.start.row\n ? rangeNode.range.start.row\n : rangeNode.range.start.row + rowDelta,\n },\n end: {\n col:\n rangeNode.range.end.col.type === \"number\"\n ? rangeNode.isAbsolute.end.col\n ? rangeNode.range.end.col\n : {\n type: \"number\" as const,\n value: rangeNode.range.end.col.value + colDelta,\n }\n : rangeNode.range.end.col,\n row:\n rangeNode.range.end.row.type === \"number\"\n ? rangeNode.isAbsolute.end.row\n ? rangeNode.range.end.row\n : {\n type: \"number\" as const,\n value: rangeNode.range.end.row.value + rowDelta,\n }\n : rangeNode.range.end.row,\n },\n },\n };\n }\n return node;\n });\n\n return `=${astToString(adjustedAst)}`;\n } catch (error) {\n // If parsing fails, return the original formula\n console.warn(\"Failed to adjust formula references:\", error);\n return formula;\n }\n }\n\n /**\n * Copy formatting (cellStyles and conditionalStyles) from source to target\n * Clears existing cell styles in target range first (Excel behavior)\n */\n private copyFormatting(\n sourceCells: CellAddress[],\n sourceTopLeft: CellAddress,\n target: CellAddress,\n rowOffset: number,\n colOffset: number\n ): void {\n // STEP 1: Clear existing cell styles in target range (Excel-like replacement)\n const sourceRange = this.getBoundingBox(sourceCells);\n const targetRange: RangeAddress = {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n range: this.adjustRange(sourceRange, rowOffset, colOffset),\n };\n\n this.styleManager.clearCellStylesInRange(targetRange);\n\n // Get all styles for the source workbook\n const allConditionalStyles = this.styleManager.getAllConditionalStyles();\n const allCellStyles = this.styleManager.getAllCellStyles();\n\n // STEP 2: Copy conditional styles\n for (const style of allConditionalStyles) {\n for (const area of style.areas) {\n if (\n area.workbookName === sourceTopLeft.workbookName &&\n area.sheetName === sourceTopLeft.sheetName\n ) {\n // Calculate intersection of style range with source bounding box\n const intersection = intersectRanges(area.range, sourceRange);\n if (intersection) {\n // Copy only the intersection, offset to target\n const newStyle: ConditionalStyle = {\n areas: [\n {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n range: this.adjustRange(intersection, rowOffset, colOffset),\n },\n ],\n condition: style.condition,\n };\n this.styleManager.addConditionalStyle(newStyle);\n }\n }\n }\n }\n\n // STEP 3: Copy cell styles\n for (const style of allCellStyles) {\n for (const area of style.areas) {\n if (\n area.workbookName === sourceTopLeft.workbookName &&\n area.sheetName === sourceTopLeft.sheetName\n ) {\n // Calculate intersection of style range with source bounding box\n const intersection = intersectRanges(area.range, sourceRange);\n if (intersection) {\n // Copy only the intersection, offset to target\n const newStyle: DirectCellStyle = {\n areas: [\n {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n range: this.adjustRange(intersection, rowOffset, colOffset),\n },\n ],\n style: style.style,\n };\n this.styleManager.addCellStyle(newStyle);\n }\n }\n }\n }\n }\n\n /**\n * Get bounding box for a set of cells\n */\n private getBoundingBox(cells: CellAddress[]): SpreadsheetRange {\n let minRow = Infinity;\n let maxRow = -Infinity;\n let minCol = Infinity;\n let maxCol = -Infinity;\n\n for (const cell of cells) {\n minRow = Math.min(minRow, cell.rowIndex);\n maxRow = Math.max(maxRow, cell.rowIndex);\n minCol = Math.min(minCol, cell.colIndex);\n maxCol = Math.max(maxCol, cell.colIndex);\n }\n\n return {\n start: { col: minCol, row: minRow },\n end: {\n col: { type: \"number\", value: maxCol },\n row: { type: \"number\", value: maxRow },\n },\n };\n }\n\n /**\n * Adjust a range by row and column offsets\n */\n private adjustRange(\n range: SpreadsheetRange,\n rowOffset: number,\n colOffset: number\n ): SpreadsheetRange {\n return {\n start: {\n col: range.start.col + colOffset,\n row: range.start.row + rowOffset,\n },\n end: {\n col:\n range.end.col.type === \"number\"\n ? { type: \"number\", value: range.end.col.value + colOffset }\n : range.end.col,\n row:\n range.end.row.type === \"number\"\n ? { type: \"number\", value: range.end.row.value + rowOffset }\n : range.end.row,\n },\n };\n }\n\n /**\n * Clear source cells (for cut operation)\n */\n private clearSourceCells(cells: CellAddress[]): void {\n for (const cell of cells) {\n // Use setCellContent with empty string to properly clear the cell\n // This ensures indexes are updated and caches are properly managed\n this.workbookManager.setCellContent(cell, \"\");\n }\n }\n\n /**\n * Fill one or more areas with a seed range's content/style\n * Uses column-first strategy: fills down, then replicates right\n * Formulas are adjusted based on each target cell's offset from the seed\n */\n fillAreas(\n seedRange: RangeAddress,\n targetRanges: RangeAddress[],\n options: CopyCellsOptions\n ): void {\n for (const targetRange of targetRanges) {\n this.fillRangeWithSeed(seedRange, targetRange, {\n copyContent: this.shouldInclude(options, \"content\"),\n copyStyles: this.shouldInclude(options, \"style\"),\n contentType: options.type ?? \"formula\",\n adjustFormulas: true,\n });\n }\n\n // Clear seed range if cut operation\n if (options.cut) {\n const seedCells = this.expandRangeToCells(seedRange);\n this.clearSourceCells(seedCells);\n }\n }\n\n /**\n * Fill a target range with a seed range using column-first strategy\n * Step 0: Clear existing cell styles in target (Excel behavior)\n * Step 1: Fill down - extend seed pattern vertically to match target height\n * Step 2: Replicate right - copy filled columns horizontally\n */\n private fillRangeWithSeed(\n seedRange: RangeAddress,\n targetRange: RangeAddress,\n options: {\n copyContent: boolean;\n copyStyles: boolean;\n contentType: \"value\" | \"formula\";\n adjustFormulas: boolean;\n }\n ): void {\n // Step 0: Clear existing cell styles in target range (Excel-like replacement)\n if (options.copyStyles) {\n this.styleManager.clearCellStylesInRange(targetRange);\n }\n\n const seedCells = this.expandRangeToCells(seedRange);\n const seedWidth = this.getRangeWidth(seedRange);\n const seedHeight = this.getRangeHeight(seedRange);\n const targetWidth = this.getRangeWidth(targetRange);\n const targetHeight = this.getRangeHeight(targetRange);\n\n // Step 1: Fill down - replicate seed pattern vertically\n const filledColumns: Map<\n string,\n { cell: CellAddress; content: SerializedCellValue }\n > = new Map();\n\n for (let col = 0; col < seedWidth; col++) {\n for (let row = 0; row < targetHeight; row++) {\n const seedRow = row % seedHeight;\n const seedCell = seedCells.find(\n (c) =>\n c.colIndex === seedRange.range.start.col + col &&\n c.rowIndex === seedRange.range.start.row + seedRow\n );\n\n if (seedCell) {\n const targetCell: CellAddress = {\n workbookName: targetRange.workbookName,\n sheetName: targetRange.sheetName,\n colIndex: targetRange.range.start.col + col,\n rowIndex: targetRange.range.start.row + row,\n };\n\n const rowDelta = targetCell.rowIndex - seedCell.rowIndex;\n const colDelta = targetCell.colIndex - seedCell.colIndex;\n\n if (options.copyContent) {\n this.copyCellContentWithOffset(\n seedCell,\n targetCell,\n rowDelta,\n colDelta,\n {\n type: options.contentType,\n cut: false,\n include: [\"content\"],\n }\n );\n }\n\n if (options.copyStyles) {\n this.copyCellFormatting(seedCell, targetCell);\n }\n\n // Store filled column for horizontal replication\n const key = `${targetCell.colIndex}-${targetCell.rowIndex}`;\n const sheet = this.workbookManager.getSheet({\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n });\n const cellKey = `${String.fromCharCode(65 + targetCell.colIndex)}${\n targetCell.rowIndex + 1\n }`;\n const content = sheet?.content.get(cellKey) || \"\";\n filledColumns.set(key, { cell: targetCell, content });\n }\n }\n }\n\n // Step 2: Replicate right - copy filled columns horizontally\n if (targetWidth > seedWidth) {\n for (let col = seedWidth; col < targetWidth; col++) {\n const sourceCol = col % seedWidth;\n\n for (let row = 0; row < targetHeight; row++) {\n const sourceCell: CellAddress = {\n workbookName: targetRange.workbookName,\n sheetName: targetRange.sheetName,\n colIndex: targetRange.range.start.col + sourceCol,\n rowIndex: targetRange.range.start.row + row,\n };\n\n const targetCell: CellAddress = {\n workbookName: targetRange.workbookName,\n sheetName: targetRange.sheetName,\n colIndex: targetRange.range.start.col + col,\n rowIndex: targetRange.range.start.row + row,\n };\n\n const colDelta = targetCell.colIndex - sourceCell.colIndex;\n\n if (options.copyContent) {\n this.copyCellContentWithOffset(\n sourceCell,\n targetCell,\n 0,\n colDelta,\n {\n type: options.contentType,\n cut: false,\n include: [\"content\"],\n }\n );\n }\n\n if (options.copyStyles) {\n this.copyCellFormatting(sourceCell, targetCell);\n }\n }\n }\n }\n }\n\n /**\n * Get the width of a range (number of columns)\n */\n private getRangeWidth(range: RangeAddress): number {\n if (range.range.end.col.type === \"infinity\") {\n return 100; // Default for infinite\n }\n return range.range.end.col.value - range.range.start.col + 1;\n }\n\n /**\n * Get the height of a range (number of rows)\n */\n private getRangeHeight(range: RangeAddress): number {\n if (range.range.end.row.type === \"infinity\") {\n return 100; // Default for infinite\n }\n return range.range.end.row.value - range.range.start.row + 1;\n }\n\n /**\n * Expand a RangeAddress into an array of CellAddress\n * Handles finite ranges, row-bounded, and column-bounded ranges\n */\n public expandRangeToCells(rangeAddress: RangeAddress): CellAddress[] {\n const { workbookName, sheetName, range } = rangeAddress;\n const cells: CellAddress[] = [];\n\n const startCol = range.start.col;\n const startRow = range.start.row;\n\n // Determine end column\n let endCol: number;\n if (range.end.col.type === \"infinity\") {\n // Limit infinite column ranges to a reasonable size (e.g., 100 columns)\n endCol = startCol + 99;\n } else {\n endCol = range.end.col.value;\n }\n\n // Determine end row\n let endRow: number;\n if (range.end.row.type === \"infinity\") {\n // Limit infinite row ranges to a reasonable size (e.g., 100 rows)\n endRow = startRow + 99;\n } else {\n endRow = range.end.row.value;\n }\n\n // Generate all cells in the range\n for (let row = startRow; row <= endRow; row++) {\n for (let col = startCol; col <= endCol; col++) {\n cells.push({\n workbookName,\n sheetName,\n colIndex: col,\n rowIndex: row,\n });\n }\n }\n\n return cells;\n }\n\n /**\n * Copy cell content with explicit row/column offset for fill operations\n */\n private copyCellContentWithOffset(\n sourceCell: CellAddress,\n targetCell: CellAddress,\n rowDelta: number,\n colDelta: number,\n options: CopyCellsOptions\n ): void {\n const sheet = this.workbookManager.getSheet({\n workbookName: sourceCell.workbookName,\n sheetName: sourceCell.sheetName,\n });\n\n if (!sheet) {\n return;\n }\n\n const key = `${String.fromCharCode(65 + sourceCell.colIndex)}${\n sourceCell.rowIndex + 1\n }`;\n const cellContent = sheet.content.get(key);\n\n if (!cellContent) {\n // Source cell is empty - clear target\n const targetSheet = this.workbookManager.getSheet({\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n });\n if (targetSheet) {\n const targetKey = `${String.fromCharCode(65 + targetCell.colIndex)}${\n targetCell.rowIndex + 1\n }`;\n targetSheet.content.delete(targetKey);\n }\n return;\n }\n\n let targetContent: SerializedCellValue;\n const copyType = options.type ?? \"formula\";\n\n if (copyType === \"value\") {\n // Copy evaluated value\n const evalResult =\n this.evaluationManager.getCellEvaluationResult(sourceCell);\n\n if (!evalResult || evalResult.type !== \"value\") {\n // If evaluation failed or is not a value, copy as-is\n targetContent = cellContent;\n } else {\n // Convert to literal value\n const result = evalResult.result;\n if (result.type === \"number\") {\n targetContent = result.value;\n } else if (result.type === \"string\") {\n targetContent = result.value;\n } else if (result.type === \"boolean\") {\n targetContent = result.value;\n } else {\n // Error or other type, copy as-is\n targetContent = cellContent;\n }\n }\n } else {\n // Copy formula with offset adjustment\n if (typeof cellContent === \"string\" && cellContent.startsWith(\"=\")) {\n // Adjust formula references based on offset\n targetContent = this.adjustFormulaWithOffset(\n cellContent,\n rowDelta,\n colDelta\n );\n } else {\n // Not a formula, copy as-is\n targetContent = cellContent;\n }\n }\n\n // Set target cell content\n const targetSheet = this.workbookManager.getSheet({\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n });\n\n if (targetSheet) {\n const targetKey = `${String.fromCharCode(65 + targetCell.colIndex)}${\n targetCell.rowIndex + 1\n }`;\n targetSheet.content.set(targetKey, targetContent);\n }\n\n // Copy metadata if requested\n if (this.shouldInclude(options, \"metadata\")) {\n const sourceMetadata = this.workbookManager.getCellMetadata(sourceCell);\n if (sourceMetadata) {\n this.workbookManager.setCellMetadata(targetCell, { ...sourceMetadata });\n } else {\n // Clear target metadata if source has none\n this.workbookManager.setCellMetadata(targetCell, undefined);\n }\n }\n }\n\n /**\n * Adjust formula references by a specific row/column offset\n */\n private adjustFormulaWithOffset(\n formula: string,\n rowDelta: number,\n colDelta: number\n ): string {\n try {\n const ast = parseFormula(formula.slice(1)); // Remove the \"=\" sign\n\n const adjustedAst = transformAST(ast, (node) => {\n if (node.type === \"reference\") {\n const refNode = node as ReferenceNode;\n return {\n ...refNode,\n address: {\n colIndex: refNode.isAbsolute.col\n ? refNode.address.colIndex\n : refNode.address.colIndex + colDelta,\n rowIndex: refNode.isAbsolute.row\n ? refNode.address.rowIndex\n : refNode.address.rowIndex + rowDelta,\n },\n };\n } else if (node.type === \"range\") {\n const rangeNode = node as RangeNode;\n return {\n ...rangeNode,\n range: {\n start: {\n col: rangeNode.isAbsolute.start.col\n ? rangeNode.range.start.col\n : rangeNode.range.start.col + colDelta,\n row: rangeNode.isAbsolute.start.row\n ? rangeNode.range.start.row\n : rangeNode.range.start.row + rowDelta,\n },\n end: {\n col:\n rangeNode.range.end.col.type === \"number\"\n ? rangeNode.isAbsolute.end.col\n ? rangeNode.range.end.col\n : {\n type: \"number\" as const,\n value: rangeNode.range.end.col.value + colDelta,\n }\n : rangeNode.range.end.col,\n row:\n rangeNode.range.end.row.type === \"number\"\n ? rangeNode.isAbsolute.end.row\n ? rangeNode.range.end.row\n : {\n type: \"number\" as const,\n value: rangeNode.range.end.row.value + rowDelta,\n }\n : rangeNode.range.end.row,\n },\n },\n };\n }\n return node;\n });\n\n return `=${astToString(adjustedAst)}`;\n } catch (error) {\n // If parsing fails, return the original formula\n console.warn(\"Failed to adjust formula with offset:\", error);\n return formula;\n }\n }\n\n /**\n * Copy formatting from one cell to another\n * Clears existing cell styles at target (Excel behavior) before copying new ones\n */\n private copyCellFormatting(\n sourceCell: CellAddress,\n targetCell: CellAddress\n ): void {\n // STEP 1: Clear existing cell styles at target cell (Excel-like replacement)\n const targetCellRange: RangeAddress = {\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n range: {\n start: { col: targetCell.colIndex, row: targetCell.rowIndex },\n end: {\n col: { type: \"number\", value: targetCell.colIndex },\n row: { type: \"number\", value: targetCell.rowIndex },\n },\n },\n };\n\n this.styleManager.clearCellStylesInRange(targetCellRange);\n\n // Get all styles that intersect with the source cell\n const allConditionalStyles = this.styleManager.getAllConditionalStyles();\n const allCellStyles = this.styleManager.getAllCellStyles();\n\n const sourceCellRange: SpreadsheetRange = {\n start: { col: sourceCell.colIndex, row: sourceCell.rowIndex },\n end: {\n col: { type: \"number\", value: sourceCell.colIndex },\n row: { type: \"number\", value: sourceCell.rowIndex },\n },\n };\n\n // STEP 2: Copy conditional styles that apply to source cell\n for (const style of allConditionalStyles) {\n for (const area of style.areas) {\n if (\n area.workbookName === sourceCell.workbookName &&\n area.sheetName === sourceCell.sheetName\n ) {\n const intersection = intersectRanges(area.range, sourceCellRange);\n if (intersection) {\n // Apply style to target cell\n const newStyle: ConditionalStyle = {\n areas: [\n {\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n range: {\n start: {\n col: targetCell.colIndex,\n row: targetCell.rowIndex,\n },\n end: {\n col: { type: \"number\", value: targetCell.colIndex },\n row: { type: \"number\", value: targetCell.rowIndex },\n },\n },\n },\n ],\n condition: style.condition,\n };\n this.styleManager.addConditionalStyle(newStyle);\n }\n }\n }\n }\n\n // STEP 3: Copy cell styles that apply to source cell\n for (const style of allCellStyles) {\n for (const area of style.areas) {\n if (\n area.workbookName === sourceCell.workbookName &&\n area.sheetName === sourceCell.sheetName\n ) {\n const intersection = intersectRanges(area.range, sourceCellRange);\n if (intersection) {\n // Apply style to target cell\n const newStyle: DirectCellStyle = {\n areas: [\n {\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n range: {\n start: {\n col: targetCell.colIndex,\n row: targetCell.rowIndex,\n },\n end: {\n col: { type: \"number\", value: targetCell.colIndex },\n row: { type: \"number\", value: targetCell.rowIndex },\n },\n },\n },\n ],\n style: style.style,\n };\n this.styleManager.addCellStyle(newStyle);\n }\n }\n }\n }\n }\n}\n"
|
|
5
|
+
"/**\n * CopyManager - Manages cell copy/paste operations\n */\n\nimport type {\n CellAddress,\n CopyCellsOptions,\n CopyCellsIncludePart,\n ConditionalStyle,\n DirectCellStyle,\n LocalCellAddress,\n RangeAddress,\n RangeMetadataInput,\n SerializedCellValue,\n SpreadsheetRange,\n} from \"../types.cjs\";\nimport type { WorkbookManager } from \"./workbook-manager.cjs\";\nimport type { EvaluationManager } from \"./evaluation-manager.cjs\";\nimport type { StyleManager } from \"./style-manager.cjs\";\nimport type { RangeMetadataManager } from \"./range-metadata-manager.cjs\";\nimport { parseFormula } from \"../../parser/parser.cjs\";\nimport { astToString } from \"../../parser/formatter.cjs\";\nimport { transformAST } from \"../ast-traverser.cjs\";\nimport type { ReferenceNode, RangeNode } from \"../../parser/ast.cjs\";\nimport { getCellReference, isCellInRange } from \"../utils.cjs\";\nimport { intersectRanges } from \"../utils/range-utils.cjs\";\nimport {\n updateReferencesForMovedCells,\n type MovedCellsInfo,\n} from \"../cell-mover.cjs\";\n\n/**\n * Snapshot of a cell's content, metadata, and styles\n */\ninterface CellSnapshot {\n address: CellAddress;\n content: SerializedCellValue | undefined;\n metadata: unknown | undefined;\n matchingCellStyles?: DirectCellStyle[];\n matchingConditionalStyles?: ConditionalStyle[];\n}\n\nexport class CopyManager {\n constructor(\n private workbookManager: WorkbookManager,\n private evaluationManager: EvaluationManager,\n private styleManager: StyleManager,\n private rangeMetadataManager: RangeMetadataManager\n ) {}\n\n /**\n * Normalize the include option to an array of parts to copy\n */\n private normalizeInclude(\n include: CopyCellsOptions[\"include\"]\n ): CopyCellsIncludePart[] {\n if (!include || include === \"all\") {\n return [\"content\", \"style\", \"cellMetadata\", \"rangeMetadata\"];\n }\n return include;\n }\n\n /**\n * Check if a specific part should be included in the copy operation\n */\n private shouldInclude(\n options: CopyCellsOptions,\n part: CopyCellsIncludePart\n ): boolean {\n const normalized = this.normalizeInclude(options.include);\n return normalized.includes(part);\n }\n\n /**\n * Paste cells from source to target\n * Delegates to cutCells for move operations or copyOnlyCells for copy operations\n */\n pasteCells(\n source: CellAddress[],\n target: CellAddress,\n options: CopyCellsOptions\n ): void {\n if (source.length === 0) {\n return;\n }\n\n if (options.cut === true) {\n return this.cutCells(source, target, options);\n } else {\n return this.copyOnlyCells(source, target, options);\n }\n }\n\n /**\n * Cut cells: Proper snapshot flow for move operations\n * 1. Snapshot source cells (with styles)\n * 2. Remove source cells and punch holes in style areas\n * 3. Update references in OTHER cells (not in moved set)\n * 4. Update formulas in snapshot and apply to target\n */\n private cutCells(\n source: CellAddress[],\n target: CellAddress,\n options: CopyCellsOptions\n ): void {\n const topLeft = this.findTopLeft(source);\n const rowOffset = target.rowIndex - topLeft.rowIndex;\n const colOffset = target.colIndex - topLeft.colIndex;\n\n // 1. Snapshot source cells (with styles)\n const snapshot = this.snapshotCellsWithStyles(source);\n const rangeMetadataCopies = this.shouldInclude(options, \"rangeMetadata\")\n ? this.collectRangeMetadataCopies(\n source,\n topLeft,\n target,\n rowOffset,\n colOffset\n )\n : [];\n const sourceRange = this.getBoundingBox(source);\n const targetRange = this.adjustRange(sourceRange, rowOffset, colOffset);\n\n // 2. Remove source cells (content) and punch holes in styles\n this.clearSourceCells(source);\n\n if (this.shouldInclude(options, \"cellMetadata\")) {\n for (const cell of source) {\n this.workbookManager.setCellMetadata(cell, undefined);\n }\n }\n\n // Punch holes in style areas for each cut cell\n if (this.shouldInclude(options, \"style\")) {\n for (const cell of source) {\n const cellRange: RangeAddress = {\n workbookName: cell.workbookName,\n sheetName: cell.sheetName,\n range: {\n start: { col: cell.colIndex, row: cell.rowIndex },\n end: {\n col: { type: \"number\", value: cell.colIndex },\n row: { type: \"number\", value: cell.rowIndex },\n },\n },\n };\n this.styleManager.clearCellStylesInRange(cellRange);\n }\n }\n\n if (this.shouldInclude(options, \"rangeMetadata\")) {\n this.rangeMetadataManager.clearRangeMetadataInRange(\n this.getRangeAddressFromBoundingBox(topLeft, sourceRange)\n );\n this.rangeMetadataManager.clearRangeMetadataInRange(\n this.getRangeAddressFromBoundingBox(target, targetRange)\n );\n }\n\n // 3. Update references in OTHER cells (not in moved set)\n const movedCellsSet = new Set(\n source.map(\n (c) => `${c.workbookName}:${c.sheetName}:${c.colIndex}:${c.rowIndex}`\n )\n );\n\n const movedCellsInfo: MovedCellsInfo = {\n cellsSet: movedCellsSet,\n workbookName: topLeft.workbookName,\n sheetName: topLeft.sheetName,\n rowOffset,\n colOffset,\n };\n\n this.workbookManager.updateFormulasExcluding(movedCellsSet, (formula) =>\n updateReferencesForMovedCells(formula, movedCellsInfo)\n );\n\n // 4. Update formulas in snapshot and apply to target\n for (let i = 0; i < snapshot.length; i++) {\n const snap = snapshot[i]!;\n const sourceCell = source[i]!;\n const targetCell: CellAddress = {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n colIndex: sourceCell.colIndex + colOffset,\n rowIndex: sourceCell.rowIndex + rowOffset,\n };\n\n // Apply content (with formula adjustment)\n if (this.shouldInclude(options, \"content\") && snap.content) {\n let targetContent = snap.content;\n\n if (typeof snap.content === \"string\" && snap.content.startsWith(\"=\")) {\n // Adjust formula references relative to new position\n targetContent = this.adjustFormulaReferences(\n snap.content,\n {\n colIndex: snap.address.colIndex,\n rowIndex: snap.address.rowIndex,\n },\n {\n colIndex: targetCell.colIndex,\n rowIndex: targetCell.rowIndex,\n }\n );\n }\n\n // Use setCellContent to ensure proper cache invalidation and dependency tracking\n this.workbookManager.setCellContent(targetCell, targetContent);\n }\n\n // Apply cell metadata\n if (this.shouldInclude(options, \"cellMetadata\")) {\n if (snap.metadata) {\n this.workbookManager.setCellMetadata(targetCell, {\n ...snap.metadata,\n });\n } else {\n this.workbookManager.setCellMetadata(targetCell, undefined);\n }\n }\n\n // Apply styles from snapshot to new location\n if (this.shouldInclude(options, \"style\")) {\n this.applyStylesFromSnapshot(snap, targetCell);\n }\n }\n\n if (this.shouldInclude(options, \"rangeMetadata\")) {\n this.applyRangeMetadataCopies(rangeMetadataCopies);\n }\n }\n\n /**\n * Copy cells: Standard copy operation (not cut/move)\n * Snapshot → Copy with adjustment → Copy formatting\n */\n private copyOnlyCells(\n source: CellAddress[],\n target: CellAddress,\n options: CopyCellsOptions\n ): void {\n const topLeft = this.findTopLeft(source);\n const rowOffset = target.rowIndex - topLeft.rowIndex;\n const colOffset = target.colIndex - topLeft.colIndex;\n\n // SNAPSHOT source cells (handles overlapping ranges)\n const snapshot = this.snapshotCells(source);\n\n // Copy cell contents if requested (from snapshot, not live cells)\n if (this.shouldInclude(options, \"content\")) {\n for (let i = 0; i < source.length; i++) {\n const sourceCell = source[i]!;\n const cellSnapshot = snapshot[i]!;\n const targetCell: CellAddress = {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n colIndex: sourceCell.colIndex + colOffset,\n rowIndex: sourceCell.rowIndex + rowOffset,\n };\n\n this.copyCellContentFromSnapshot(\n cellSnapshot,\n targetCell,\n topLeft,\n options\n );\n }\n }\n\n // Copy cell metadata if requested\n if (this.shouldInclude(options, \"cellMetadata\")) {\n for (let i = 0; i < source.length; i++) {\n const sourceCell = source[i]!;\n const cellSnapshot = snapshot[i]!;\n const targetCell: CellAddress = {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n colIndex: sourceCell.colIndex + colOffset,\n rowIndex: sourceCell.rowIndex + rowOffset,\n };\n\n this.copyCellMetadataFromSnapshot(cellSnapshot, targetCell);\n }\n }\n\n // Copy formatting if requested\n if (this.shouldInclude(options, \"style\")) {\n this.copyFormatting(source, topLeft, target, rowOffset, colOffset);\n }\n\n // Copy range metadata if requested\n if (this.shouldInclude(options, \"rangeMetadata\")) {\n this.copyRangeMetadata(source, topLeft, target, rowOffset, colOffset);\n }\n }\n\n /**\n * Find the top-left cell (minimum row/col indices)\n */\n private findTopLeft(cells: CellAddress[]): CellAddress {\n let minRow = Infinity;\n let minCol = Infinity;\n let topLeftCell = cells[0]!;\n\n for (const cell of cells) {\n if (\n cell.rowIndex < minRow ||\n (cell.rowIndex === minRow && cell.colIndex < minCol)\n ) {\n minRow = cell.rowIndex;\n minCol = cell.colIndex;\n topLeftCell = cell;\n }\n }\n\n return topLeftCell;\n }\n\n /**\n * Create a snapshot of cells' content and metadata\n * This prevents issues with overlapping ranges where source and target overlap\n * Used for copy operations (not cut)\n */\n private snapshotCells(cells: CellAddress[]): CellSnapshot[] {\n return cells.map((cell) => {\n const sheet = this.workbookManager.getSheet({\n workbookName: cell.workbookName,\n sheetName: cell.sheetName,\n });\n\n const key = `${String.fromCharCode(65 + cell.colIndex)}${\n cell.rowIndex + 1\n }`;\n const content = sheet?.content.get(key);\n const metadata = this.workbookManager.getCellMetadata(cell);\n\n return {\n address: cell,\n content,\n metadata,\n };\n });\n }\n\n /**\n * Create a snapshot of cells with content, metadata, AND styles\n * Used for cut operations to preserve all cell information\n */\n private snapshotCellsWithStyles(cells: CellAddress[]): CellSnapshot[] {\n const allCellStyles = this.styleManager.getAllCellStyles();\n const allConditionalStyles = this.styleManager.getAllConditionalStyles();\n\n return cells.map((cell) => {\n const sheet = this.workbookManager.getSheet({\n workbookName: cell.workbookName,\n sheetName: cell.sheetName,\n });\n\n const key = getCellReference(cell);\n const content = sheet?.content.get(key);\n const metadata = this.workbookManager.getCellMetadata(cell);\n\n // Find all styles that apply to this cell\n const matchingCellStyles = allCellStyles.filter((style) =>\n style.areas.some(\n (area) =>\n area.workbookName === cell.workbookName &&\n area.sheetName === cell.sheetName &&\n isCellInRange(cell, area.range)\n )\n );\n\n const matchingConditionalStyles = allConditionalStyles.filter((style) =>\n style.areas.some(\n (area) =>\n area.workbookName === cell.workbookName &&\n area.sheetName === cell.sheetName &&\n isCellInRange(cell, area.range)\n )\n );\n\n return {\n address: cell,\n content,\n metadata,\n matchingCellStyles,\n matchingConditionalStyles,\n };\n });\n }\n\n /**\n * Apply styles from a snapshot to a target cell\n * Creates new style areas at the target location\n */\n private applyStylesFromSnapshot(\n snapshot: CellSnapshot,\n targetCell: CellAddress\n ): void {\n // Apply cell styles\n if (snapshot.matchingCellStyles) {\n for (const style of snapshot.matchingCellStyles) {\n const newStyle: DirectCellStyle = {\n areas: [\n {\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n range: {\n start: { col: targetCell.colIndex, row: targetCell.rowIndex },\n end: {\n col: { type: \"number\", value: targetCell.colIndex },\n row: { type: \"number\", value: targetCell.rowIndex },\n },\n },\n },\n ],\n style: style.style,\n };\n this.styleManager.addCellStyle(newStyle);\n }\n }\n\n // Apply conditional styles\n if (snapshot.matchingConditionalStyles) {\n for (const style of snapshot.matchingConditionalStyles) {\n const newStyle: ConditionalStyle = {\n areas: [\n {\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n range: {\n start: { col: targetCell.colIndex, row: targetCell.rowIndex },\n end: {\n col: { type: \"number\", value: targetCell.colIndex },\n row: { type: \"number\", value: targetCell.rowIndex },\n },\n },\n },\n ],\n condition: style.condition,\n };\n this.styleManager.addConditionalStyle(newStyle);\n }\n }\n }\n\n /**\n * Copy content from a cell snapshot to a target cell\n */\n private copyCellContentFromSnapshot(\n snapshot: CellSnapshot,\n targetCell: CellAddress,\n sourceTopLeft: CellAddress,\n options: CopyCellsOptions\n ): void {\n if (!snapshot.content) {\n // Source cell was empty\n return;\n }\n\n let targetContent: SerializedCellValue;\n const copyType = options.type ?? \"formula\";\n\n if (copyType === \"value\") {\n // Copy evaluated value\n const evalResult = this.evaluationManager.getCellEvaluationResult(\n snapshot.address\n );\n\n if (!evalResult || evalResult.type !== \"value\") {\n // If evaluation failed or is not a value, copy as-is\n targetContent = snapshot.content;\n } else {\n // Convert to literal value\n const result = evalResult.result;\n if (result.type === \"number\") {\n targetContent = result.value;\n } else if (result.type === \"string\") {\n targetContent = result.value;\n } else if (result.type === \"boolean\") {\n targetContent = result.value;\n } else {\n // Error or other type, copy as-is\n targetContent = snapshot.content;\n }\n }\n } else {\n // Copy formula\n if (\n typeof snapshot.content === \"string\" &&\n snapshot.content.startsWith(\"=\")\n ) {\n // Adjust formula references\n targetContent = this.adjustFormulaReferences(\n snapshot.content,\n {\n colIndex: snapshot.address.colIndex,\n rowIndex: snapshot.address.rowIndex,\n },\n {\n colIndex: targetCell.colIndex,\n rowIndex: targetCell.rowIndex,\n }\n );\n } else {\n // Not a formula, copy as-is\n targetContent = snapshot.content;\n }\n }\n\n // Set target cell content\n const targetSheet = this.workbookManager.getSheet({\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n });\n\n if (targetSheet) {\n const targetKey = `${String.fromCharCode(65 + targetCell.colIndex)}${\n targetCell.rowIndex + 1\n }`;\n targetSheet.content.set(targetKey, targetContent);\n }\n\n }\n\n private copyCellMetadataFromSnapshot(\n snapshot: CellSnapshot,\n targetCell: CellAddress\n ): void {\n if (snapshot.metadata) {\n this.workbookManager.setCellMetadata(targetCell, {\n ...snapshot.metadata,\n });\n } else {\n this.workbookManager.setCellMetadata(targetCell, undefined);\n }\n }\n\n /**\n * Update all formula references when cells are cut (moved)\n */\n /**\n * Copy content from one cell to another\n */\n private copyCellContent(\n sourceCell: CellAddress,\n targetCell: CellAddress,\n sourceTopLeft: CellAddress,\n options: CopyCellsOptions\n ): void {\n const sheet = this.workbookManager.getSheet({\n workbookName: sourceCell.workbookName,\n sheetName: sourceCell.sheetName,\n });\n\n if (!sheet) {\n return;\n }\n\n const key = `${String.fromCharCode(65 + sourceCell.colIndex)}${\n sourceCell.rowIndex + 1\n }`;\n const cellContent = sheet.content.get(key);\n\n if (!cellContent) {\n // Source cell is empty\n return;\n }\n\n let targetContent: SerializedCellValue;\n const copyType = options.type ?? \"formula\";\n\n if (copyType === \"value\") {\n // Copy evaluated value\n const evalResult =\n this.evaluationManager.getCellEvaluationResult(sourceCell);\n\n if (!evalResult || evalResult.type !== \"value\") {\n // If evaluation failed or is not a value, copy as-is\n targetContent = cellContent;\n } else {\n // Convert to literal value\n const result = evalResult.result;\n if (result.type === \"number\") {\n targetContent = result.value;\n } else if (result.type === \"string\") {\n targetContent = result.value;\n } else if (result.type === \"boolean\") {\n targetContent = result.value;\n } else {\n // Error or other type, copy as-is\n targetContent = cellContent;\n }\n }\n } else {\n // Copy formula\n if (typeof cellContent === \"string\" && cellContent.startsWith(\"=\")) {\n // Adjust formula references\n targetContent = this.adjustFormulaReferences(\n cellContent,\n {\n colIndex: sourceCell.colIndex,\n rowIndex: sourceCell.rowIndex,\n },\n {\n colIndex: targetCell.colIndex,\n rowIndex: targetCell.rowIndex,\n }\n );\n } else {\n // Not a formula, copy as-is\n targetContent = cellContent;\n }\n }\n\n // Set target cell content (using the engine's method through workbook manager)\n const targetSheet = this.workbookManager.getSheet({\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n });\n\n if (targetSheet) {\n const targetKey = `${String.fromCharCode(65 + targetCell.colIndex)}${\n targetCell.rowIndex + 1\n }`;\n targetSheet.content.set(targetKey, targetContent);\n }\n\n // Copy cell metadata if requested\n if (this.shouldInclude(options, \"cellMetadata\")) {\n const sourceMetadata = this.workbookManager.getCellMetadata(sourceCell);\n if (sourceMetadata) {\n this.workbookManager.setCellMetadata(targetCell, { ...sourceMetadata });\n } else {\n // Clear target metadata if source has none\n this.workbookManager.setCellMetadata(targetCell, undefined);\n }\n }\n }\n\n /**\n * Adjust formula references when copying\n * Based on autofill-utils.ts adjustFormulaReferences\n */\n private adjustFormulaReferences(\n formula: string,\n sourceAddress: LocalCellAddress,\n targetAddress: LocalCellAddress\n ): string {\n try {\n const ast = parseFormula(formula.slice(1)); // Remove the \"=\" sign\n\n const rowDelta = targetAddress.rowIndex - sourceAddress.rowIndex;\n const colDelta = targetAddress.colIndex - sourceAddress.colIndex;\n\n const adjustedAst = transformAST(ast, (node) => {\n if (node.type === \"reference\") {\n const refNode = node as ReferenceNode;\n return {\n ...refNode,\n address: {\n colIndex: refNode.isAbsolute.col\n ? refNode.address.colIndex\n : refNode.address.colIndex + colDelta,\n rowIndex: refNode.isAbsolute.row\n ? refNode.address.rowIndex\n : refNode.address.rowIndex + rowDelta,\n },\n };\n } else if (node.type === \"range\") {\n const rangeNode = node as RangeNode;\n return {\n ...rangeNode,\n range: {\n start: {\n col: rangeNode.isAbsolute.start.col\n ? rangeNode.range.start.col\n : rangeNode.range.start.col + colDelta,\n row: rangeNode.isAbsolute.start.row\n ? rangeNode.range.start.row\n : rangeNode.range.start.row + rowDelta,\n },\n end: {\n col:\n rangeNode.range.end.col.type === \"number\"\n ? rangeNode.isAbsolute.end.col\n ? rangeNode.range.end.col\n : {\n type: \"number\" as const,\n value: rangeNode.range.end.col.value + colDelta,\n }\n : rangeNode.range.end.col,\n row:\n rangeNode.range.end.row.type === \"number\"\n ? rangeNode.isAbsolute.end.row\n ? rangeNode.range.end.row\n : {\n type: \"number\" as const,\n value: rangeNode.range.end.row.value + rowDelta,\n }\n : rangeNode.range.end.row,\n },\n },\n };\n }\n return node;\n });\n\n return `=${astToString(adjustedAst)}`;\n } catch (error) {\n // If parsing fails, return the original formula\n console.warn(\"Failed to adjust formula references:\", error);\n return formula;\n }\n }\n\n /**\n * Copy formatting (cellStyles and conditionalStyles) from source to target\n * Clears existing cell styles in target range first (Excel behavior)\n */\n private copyFormatting(\n sourceCells: CellAddress[],\n sourceTopLeft: CellAddress,\n target: CellAddress,\n rowOffset: number,\n colOffset: number\n ): void {\n // STEP 1: Clear existing cell styles in target range (Excel-like replacement)\n const sourceRange = this.getBoundingBox(sourceCells);\n const targetRange: RangeAddress = {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n range: this.adjustRange(sourceRange, rowOffset, colOffset),\n };\n\n this.styleManager.clearCellStylesInRange(targetRange);\n\n // Get all styles for the source workbook\n const allConditionalStyles = this.styleManager.getAllConditionalStyles();\n const allCellStyles = this.styleManager.getAllCellStyles();\n\n // STEP 2: Copy conditional styles\n for (const style of allConditionalStyles) {\n for (const area of style.areas) {\n if (\n area.workbookName === sourceTopLeft.workbookName &&\n area.sheetName === sourceTopLeft.sheetName\n ) {\n // Calculate intersection of style range with source bounding box\n const intersection = intersectRanges(area.range, sourceRange);\n if (intersection) {\n // Copy only the intersection, offset to target\n const newStyle: ConditionalStyle = {\n areas: [\n {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n range: this.adjustRange(intersection, rowOffset, colOffset),\n },\n ],\n condition: style.condition,\n };\n this.styleManager.addConditionalStyle(newStyle);\n }\n }\n }\n }\n\n // STEP 3: Copy cell styles\n for (const style of allCellStyles) {\n for (const area of style.areas) {\n if (\n area.workbookName === sourceTopLeft.workbookName &&\n area.sheetName === sourceTopLeft.sheetName\n ) {\n // Calculate intersection of style range with source bounding box\n const intersection = intersectRanges(area.range, sourceRange);\n if (intersection) {\n // Copy only the intersection, offset to target\n const newStyle: DirectCellStyle = {\n areas: [\n {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n range: this.adjustRange(intersection, rowOffset, colOffset),\n },\n ],\n style: style.style,\n };\n this.styleManager.addCellStyle(newStyle);\n }\n }\n }\n }\n }\n\n private cloneMetadataValue(metadata: unknown): unknown {\n if (!metadata || typeof metadata !== \"object\") {\n return metadata;\n }\n\n try {\n return structuredClone(metadata);\n } catch {\n return Array.isArray(metadata) ? [...metadata] : { ...metadata };\n }\n }\n\n private getRangeAddressFromBoundingBox(\n base: Pick<CellAddress, \"workbookName\" | \"sheetName\">,\n range: SpreadsheetRange\n ): RangeAddress {\n return {\n workbookName: base.workbookName,\n sheetName: base.sheetName,\n range,\n };\n }\n\n private collectRangeMetadataCopies(\n sourceCells: CellAddress[],\n sourceTopLeft: CellAddress,\n target: CellAddress,\n rowOffset: number,\n colOffset: number\n ): RangeMetadataInput[] {\n const sourceRange = this.getBoundingBox(sourceCells);\n const copies: RangeMetadataInput[] = [];\n\n for (const entry of this.rangeMetadataManager.getAllRangeMetadata()) {\n for (const area of entry.areas) {\n if (\n area.workbookName !== sourceTopLeft.workbookName ||\n area.sheetName !== sourceTopLeft.sheetName\n ) {\n continue;\n }\n\n const intersection = intersectRanges(area.range, sourceRange);\n if (!intersection) {\n continue;\n }\n\n copies.push({\n areas: [\n {\n workbookName: target.workbookName,\n sheetName: target.sheetName,\n range: this.adjustRange(intersection, rowOffset, colOffset),\n },\n ],\n metadata: this.cloneMetadataValue(entry.metadata),\n });\n }\n }\n\n return copies;\n }\n\n private applyRangeMetadataCopies(copies: RangeMetadataInput[]): void {\n for (const copy of copies) {\n this.rangeMetadataManager.addRangeMetadata(copy);\n }\n }\n\n private copyRangeMetadata(\n sourceCells: CellAddress[],\n sourceTopLeft: CellAddress,\n target: CellAddress,\n rowOffset: number,\n colOffset: number\n ): void {\n const sourceRange = this.getBoundingBox(sourceCells);\n const targetRange = this.adjustRange(sourceRange, rowOffset, colOffset);\n const copies = this.collectRangeMetadataCopies(\n sourceCells,\n sourceTopLeft,\n target,\n rowOffset,\n colOffset\n );\n\n this.rangeMetadataManager.clearRangeMetadataInRange(\n this.getRangeAddressFromBoundingBox(target, targetRange)\n );\n this.applyRangeMetadataCopies(copies);\n }\n\n /**\n * Get bounding box for a set of cells\n */\n private getBoundingBox(cells: CellAddress[]): SpreadsheetRange {\n let minRow = Infinity;\n let maxRow = -Infinity;\n let minCol = Infinity;\n let maxCol = -Infinity;\n\n for (const cell of cells) {\n minRow = Math.min(minRow, cell.rowIndex);\n maxRow = Math.max(maxRow, cell.rowIndex);\n minCol = Math.min(minCol, cell.colIndex);\n maxCol = Math.max(maxCol, cell.colIndex);\n }\n\n return {\n start: { col: minCol, row: minRow },\n end: {\n col: { type: \"number\", value: maxCol },\n row: { type: \"number\", value: maxRow },\n },\n };\n }\n\n /**\n * Adjust a range by row and column offsets\n */\n private adjustRange(\n range: SpreadsheetRange,\n rowOffset: number,\n colOffset: number\n ): SpreadsheetRange {\n return {\n start: {\n col: range.start.col + colOffset,\n row: range.start.row + rowOffset,\n },\n end: {\n col:\n range.end.col.type === \"number\"\n ? { type: \"number\", value: range.end.col.value + colOffset }\n : range.end.col,\n row:\n range.end.row.type === \"number\"\n ? { type: \"number\", value: range.end.row.value + rowOffset }\n : range.end.row,\n },\n };\n }\n\n /**\n * Clear source cells (for cut operation)\n */\n private clearSourceCells(cells: CellAddress[]): void {\n for (const cell of cells) {\n // Use setCellContent with empty string to properly clear the cell\n // This ensures indexes are updated and caches are properly managed\n this.workbookManager.setCellContent(cell, \"\");\n }\n }\n\n /**\n * Fill one or more areas with a seed range's content/style\n * Uses column-first strategy: fills down, then replicates right\n * Formulas are adjusted based on each target cell's offset from the seed\n */\n fillAreas(\n seedRange: RangeAddress,\n targetRanges: RangeAddress[],\n options: CopyCellsOptions\n ): void {\n for (const targetRange of targetRanges) {\n this.fillRangeWithSeed(seedRange, targetRange, {\n copyContent: this.shouldInclude(options, \"content\"),\n copyStyles: this.shouldInclude(options, \"style\"),\n copyCellMetadata: this.shouldInclude(options, \"cellMetadata\"),\n copyRangeMetadata: this.shouldInclude(options, \"rangeMetadata\"),\n contentType: options.type ?? \"formula\",\n adjustFormulas: true,\n });\n }\n\n // Clear seed range if cut operation\n if (options.cut) {\n const seedCells = this.expandRangeToCells(seedRange);\n this.clearSourceCells(seedCells);\n }\n }\n\n /**\n * Fill a target range with a seed range using column-first strategy\n * Step 0: Clear existing cell styles in target (Excel behavior)\n * Step 1: Fill down - extend seed pattern vertically to match target height\n * Step 2: Replicate right - copy filled columns horizontally\n */\n private fillRangeWithSeed(\n seedRange: RangeAddress,\n targetRange: RangeAddress,\n options: {\n copyContent: boolean;\n copyStyles: boolean;\n copyCellMetadata: boolean;\n copyRangeMetadata: boolean;\n contentType: \"value\" | \"formula\";\n adjustFormulas: boolean;\n }\n ): void {\n // Step 0: Clear existing cell styles in target range (Excel-like replacement)\n if (options.copyStyles) {\n this.styleManager.clearCellStylesInRange(targetRange);\n }\n if (options.copyRangeMetadata) {\n this.rangeMetadataManager.clearRangeMetadataInRange(targetRange);\n }\n\n const seedCells = this.expandRangeToCells(seedRange);\n const seedWidth = this.getRangeWidth(seedRange);\n const seedHeight = this.getRangeHeight(seedRange);\n const targetWidth = this.getRangeWidth(targetRange);\n const targetHeight = this.getRangeHeight(targetRange);\n\n // Step 1: Fill down - replicate seed pattern vertically\n const filledColumns: Map<\n string,\n { cell: CellAddress; content: SerializedCellValue }\n > = new Map();\n\n for (let col = 0; col < seedWidth; col++) {\n for (let row = 0; row < targetHeight; row++) {\n const seedRow = row % seedHeight;\n const seedCell = seedCells.find(\n (c) =>\n c.colIndex === seedRange.range.start.col + col &&\n c.rowIndex === seedRange.range.start.row + seedRow\n );\n\n if (seedCell) {\n const targetCell: CellAddress = {\n workbookName: targetRange.workbookName,\n sheetName: targetRange.sheetName,\n colIndex: targetRange.range.start.col + col,\n rowIndex: targetRange.range.start.row + row,\n };\n\n const rowDelta = targetCell.rowIndex - seedCell.rowIndex;\n const colDelta = targetCell.colIndex - seedCell.colIndex;\n\n if (options.copyContent) {\n this.copyCellContentWithOffset(\n seedCell,\n targetCell,\n rowDelta,\n colDelta,\n {\n type: options.contentType,\n cut: false,\n include: [\"content\"],\n }\n );\n }\n\n if (options.copyStyles) {\n this.copyCellFormatting(seedCell, targetCell);\n }\n\n if (options.copyCellMetadata) {\n this.copyCellMetadata(seedCell, targetCell);\n }\n\n if (options.copyRangeMetadata) {\n this.copyCellRangeMetadata(seedCell, targetCell);\n }\n\n // Store filled column for horizontal replication\n const key = `${targetCell.colIndex}-${targetCell.rowIndex}`;\n const sheet = this.workbookManager.getSheet({\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n });\n const cellKey = `${String.fromCharCode(65 + targetCell.colIndex)}${\n targetCell.rowIndex + 1\n }`;\n const content = sheet?.content.get(cellKey) || \"\";\n filledColumns.set(key, { cell: targetCell, content });\n }\n }\n }\n\n // Step 2: Replicate right - copy filled columns horizontally\n if (targetWidth > seedWidth) {\n for (let col = seedWidth; col < targetWidth; col++) {\n const sourceCol = col % seedWidth;\n\n for (let row = 0; row < targetHeight; row++) {\n const sourceCell: CellAddress = {\n workbookName: targetRange.workbookName,\n sheetName: targetRange.sheetName,\n colIndex: targetRange.range.start.col + sourceCol,\n rowIndex: targetRange.range.start.row + row,\n };\n\n const targetCell: CellAddress = {\n workbookName: targetRange.workbookName,\n sheetName: targetRange.sheetName,\n colIndex: targetRange.range.start.col + col,\n rowIndex: targetRange.range.start.row + row,\n };\n\n const colDelta = targetCell.colIndex - sourceCell.colIndex;\n\n if (options.copyContent) {\n this.copyCellContentWithOffset(\n sourceCell,\n targetCell,\n 0,\n colDelta,\n {\n type: options.contentType,\n cut: false,\n include: [\"content\"],\n }\n );\n }\n\n if (options.copyStyles) {\n this.copyCellFormatting(sourceCell, targetCell);\n }\n\n if (options.copyCellMetadata) {\n this.copyCellMetadata(sourceCell, targetCell);\n }\n\n if (options.copyRangeMetadata) {\n this.copyCellRangeMetadata(sourceCell, targetCell);\n }\n }\n }\n }\n }\n\n /**\n * Get the width of a range (number of columns)\n */\n private getRangeWidth(range: RangeAddress): number {\n if (range.range.end.col.type === \"infinity\") {\n return 100; // Default for infinite\n }\n return range.range.end.col.value - range.range.start.col + 1;\n }\n\n /**\n * Get the height of a range (number of rows)\n */\n private getRangeHeight(range: RangeAddress): number {\n if (range.range.end.row.type === \"infinity\") {\n return 100; // Default for infinite\n }\n return range.range.end.row.value - range.range.start.row + 1;\n }\n\n /**\n * Expand a RangeAddress into an array of CellAddress\n * Handles finite ranges, row-bounded, and column-bounded ranges\n */\n public expandRangeToCells(rangeAddress: RangeAddress): CellAddress[] {\n const { workbookName, sheetName, range } = rangeAddress;\n const cells: CellAddress[] = [];\n\n const startCol = range.start.col;\n const startRow = range.start.row;\n\n // Determine end column\n let endCol: number;\n if (range.end.col.type === \"infinity\") {\n // Limit infinite column ranges to a reasonable size (e.g., 100 columns)\n endCol = startCol + 99;\n } else {\n endCol = range.end.col.value;\n }\n\n // Determine end row\n let endRow: number;\n if (range.end.row.type === \"infinity\") {\n // Limit infinite row ranges to a reasonable size (e.g., 100 rows)\n endRow = startRow + 99;\n } else {\n endRow = range.end.row.value;\n }\n\n // Generate all cells in the range\n for (let row = startRow; row <= endRow; row++) {\n for (let col = startCol; col <= endCol; col++) {\n cells.push({\n workbookName,\n sheetName,\n colIndex: col,\n rowIndex: row,\n });\n }\n }\n\n return cells;\n }\n\n /**\n * Copy cell content with explicit row/column offset for fill operations\n */\n private copyCellContentWithOffset(\n sourceCell: CellAddress,\n targetCell: CellAddress,\n rowDelta: number,\n colDelta: number,\n options: CopyCellsOptions\n ): void {\n const sheet = this.workbookManager.getSheet({\n workbookName: sourceCell.workbookName,\n sheetName: sourceCell.sheetName,\n });\n\n if (!sheet) {\n return;\n }\n\n const key = `${String.fromCharCode(65 + sourceCell.colIndex)}${\n sourceCell.rowIndex + 1\n }`;\n const cellContent = sheet.content.get(key);\n\n if (!cellContent) {\n // Source cell is empty - clear target\n const targetSheet = this.workbookManager.getSheet({\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n });\n if (targetSheet) {\n const targetKey = `${String.fromCharCode(65 + targetCell.colIndex)}${\n targetCell.rowIndex + 1\n }`;\n targetSheet.content.delete(targetKey);\n }\n return;\n }\n\n let targetContent: SerializedCellValue;\n const copyType = options.type ?? \"formula\";\n\n if (copyType === \"value\") {\n // Copy evaluated value\n const evalResult =\n this.evaluationManager.getCellEvaluationResult(sourceCell);\n\n if (!evalResult || evalResult.type !== \"value\") {\n // If evaluation failed or is not a value, copy as-is\n targetContent = cellContent;\n } else {\n // Convert to literal value\n const result = evalResult.result;\n if (result.type === \"number\") {\n targetContent = result.value;\n } else if (result.type === \"string\") {\n targetContent = result.value;\n } else if (result.type === \"boolean\") {\n targetContent = result.value;\n } else {\n // Error or other type, copy as-is\n targetContent = cellContent;\n }\n }\n } else {\n // Copy formula with offset adjustment\n if (typeof cellContent === \"string\" && cellContent.startsWith(\"=\")) {\n // Adjust formula references based on offset\n targetContent = this.adjustFormulaWithOffset(\n cellContent,\n rowDelta,\n colDelta\n );\n } else {\n // Not a formula, copy as-is\n targetContent = cellContent;\n }\n }\n\n // Set target cell content\n const targetSheet = this.workbookManager.getSheet({\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n });\n\n if (targetSheet) {\n const targetKey = `${String.fromCharCode(65 + targetCell.colIndex)}${\n targetCell.rowIndex + 1\n }`;\n targetSheet.content.set(targetKey, targetContent);\n }\n\n // Copy cell metadata if requested\n if (this.shouldInclude(options, \"cellMetadata\")) {\n const sourceMetadata = this.workbookManager.getCellMetadata(sourceCell);\n if (sourceMetadata) {\n this.workbookManager.setCellMetadata(targetCell, { ...sourceMetadata });\n } else {\n // Clear target metadata if source has none\n this.workbookManager.setCellMetadata(targetCell, undefined);\n }\n }\n }\n\n /**\n * Adjust formula references by a specific row/column offset\n */\n private adjustFormulaWithOffset(\n formula: string,\n rowDelta: number,\n colDelta: number\n ): string {\n try {\n const ast = parseFormula(formula.slice(1)); // Remove the \"=\" sign\n\n const adjustedAst = transformAST(ast, (node) => {\n if (node.type === \"reference\") {\n const refNode = node as ReferenceNode;\n return {\n ...refNode,\n address: {\n colIndex: refNode.isAbsolute.col\n ? refNode.address.colIndex\n : refNode.address.colIndex + colDelta,\n rowIndex: refNode.isAbsolute.row\n ? refNode.address.rowIndex\n : refNode.address.rowIndex + rowDelta,\n },\n };\n } else if (node.type === \"range\") {\n const rangeNode = node as RangeNode;\n return {\n ...rangeNode,\n range: {\n start: {\n col: rangeNode.isAbsolute.start.col\n ? rangeNode.range.start.col\n : rangeNode.range.start.col + colDelta,\n row: rangeNode.isAbsolute.start.row\n ? rangeNode.range.start.row\n : rangeNode.range.start.row + rowDelta,\n },\n end: {\n col:\n rangeNode.range.end.col.type === \"number\"\n ? rangeNode.isAbsolute.end.col\n ? rangeNode.range.end.col\n : {\n type: \"number\" as const,\n value: rangeNode.range.end.col.value + colDelta,\n }\n : rangeNode.range.end.col,\n row:\n rangeNode.range.end.row.type === \"number\"\n ? rangeNode.isAbsolute.end.row\n ? rangeNode.range.end.row\n : {\n type: \"number\" as const,\n value: rangeNode.range.end.row.value + rowDelta,\n }\n : rangeNode.range.end.row,\n },\n },\n };\n }\n return node;\n });\n\n return `=${astToString(adjustedAst)}`;\n } catch (error) {\n // If parsing fails, return the original formula\n console.warn(\"Failed to adjust formula with offset:\", error);\n return formula;\n }\n }\n\n private copyCellMetadata(\n sourceCell: CellAddress,\n targetCell: CellAddress\n ): void {\n const sourceMetadata = this.workbookManager.getCellMetadata(sourceCell);\n if (sourceMetadata) {\n this.workbookManager.setCellMetadata(targetCell, { ...sourceMetadata });\n } else {\n this.workbookManager.setCellMetadata(targetCell, undefined);\n }\n }\n\n private copyCellRangeMetadata(\n sourceCell: CellAddress,\n targetCell: CellAddress\n ): void {\n const targetCellRange: RangeAddress = {\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n range: {\n start: { col: targetCell.colIndex, row: targetCell.rowIndex },\n end: {\n col: { type: \"number\", value: targetCell.colIndex },\n row: { type: \"number\", value: targetCell.rowIndex },\n },\n },\n };\n\n this.rangeMetadataManager.clearRangeMetadataInRange(targetCellRange);\n\n const sourceCellRange: SpreadsheetRange = {\n start: { col: sourceCell.colIndex, row: sourceCell.rowIndex },\n end: {\n col: { type: \"number\", value: sourceCell.colIndex },\n row: { type: \"number\", value: sourceCell.rowIndex },\n },\n };\n\n for (const entry of this.rangeMetadataManager.getAllRangeMetadata()) {\n for (const area of entry.areas) {\n if (\n area.workbookName !== sourceCell.workbookName ||\n area.sheetName !== sourceCell.sheetName\n ) {\n continue;\n }\n\n const intersection = intersectRanges(area.range, sourceCellRange);\n if (!intersection) {\n continue;\n }\n\n this.rangeMetadataManager.addRangeMetadata({\n areas: [targetCellRange],\n metadata: this.cloneMetadataValue(entry.metadata),\n });\n }\n }\n }\n\n /**\n * Copy formatting from one cell to another\n * Clears existing cell styles at target (Excel behavior) before copying new ones\n */\n private copyCellFormatting(\n sourceCell: CellAddress,\n targetCell: CellAddress\n ): void {\n // STEP 1: Clear existing cell styles at target cell (Excel-like replacement)\n const targetCellRange: RangeAddress = {\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n range: {\n start: { col: targetCell.colIndex, row: targetCell.rowIndex },\n end: {\n col: { type: \"number\", value: targetCell.colIndex },\n row: { type: \"number\", value: targetCell.rowIndex },\n },\n },\n };\n\n this.styleManager.clearCellStylesInRange(targetCellRange);\n\n // Get all styles that intersect with the source cell\n const allConditionalStyles = this.styleManager.getAllConditionalStyles();\n const allCellStyles = this.styleManager.getAllCellStyles();\n\n const sourceCellRange: SpreadsheetRange = {\n start: { col: sourceCell.colIndex, row: sourceCell.rowIndex },\n end: {\n col: { type: \"number\", value: sourceCell.colIndex },\n row: { type: \"number\", value: sourceCell.rowIndex },\n },\n };\n\n // STEP 2: Copy conditional styles that apply to source cell\n for (const style of allConditionalStyles) {\n for (const area of style.areas) {\n if (\n area.workbookName === sourceCell.workbookName &&\n area.sheetName === sourceCell.sheetName\n ) {\n const intersection = intersectRanges(area.range, sourceCellRange);\n if (intersection) {\n // Apply style to target cell\n const newStyle: ConditionalStyle = {\n areas: [\n {\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n range: {\n start: {\n col: targetCell.colIndex,\n row: targetCell.rowIndex,\n },\n end: {\n col: { type: \"number\", value: targetCell.colIndex },\n row: { type: \"number\", value: targetCell.rowIndex },\n },\n },\n },\n ],\n condition: style.condition,\n };\n this.styleManager.addConditionalStyle(newStyle);\n }\n }\n }\n }\n\n // STEP 3: Copy cell styles that apply to source cell\n for (const style of allCellStyles) {\n for (const area of style.areas) {\n if (\n area.workbookName === sourceCell.workbookName &&\n area.sheetName === sourceCell.sheetName\n ) {\n const intersection = intersectRanges(area.range, sourceCellRange);\n if (intersection) {\n // Apply style to target cell\n const newStyle: DirectCellStyle = {\n areas: [\n {\n workbookName: targetCell.workbookName,\n sheetName: targetCell.sheetName,\n range: {\n start: {\n col: targetCell.colIndex,\n row: targetCell.rowIndex,\n },\n end: {\n col: { type: \"number\", value: targetCell.colIndex },\n row: { type: \"number\", value: targetCell.rowIndex },\n },\n },\n },\n ],\n style: style.style,\n };\n this.styleManager.addCellStyle(newStyle);\n }\n }\n }\n }\n }\n}\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiB6B,IAA7B;AAC4B,IAA5B;AAC6B,IAA7B;AAEgD,IAAhD;AACgC,IAAhC;AAIO,IAHP;AAAA;AAgBO,MAAM,YAAY;AAAA,EAEb;AAAA,EACA;AAAA,EACA;AAAA,EAHV,WAAW,CACD,iBACA,mBACA,cACR;AAAA,IAHQ;AAAA,IACA;AAAA,IACA;AAAA;AAAA,EAMF,gBAAgB,CACtB,SACsC;AAAA,IACtC,IAAI,CAAC,WAAW,YAAY,OAAO;AAAA,MACjC,OAAO,CAAC,WAAW,SAAS,UAAU;AAAA,IACxC;AAAA,IACA,OAAO;AAAA;AAAA,EAMD,aAAa,CACnB,SACA,MACS;AAAA,IACT,MAAM,aAAa,KAAK,iBAAiB,QAAQ,OAAO;AAAA,IACxD,OAAO,WAAW,SAAS,IAAI;AAAA;AAAA,EAOjC,UAAU,CACR,QACA,QACA,SACM;AAAA,IACN,IAAI,OAAO,WAAW,GAAG;AAAA,MACvB;AAAA,IACF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