@univerjs/sheets 1.0.0-alpha.8 → 1.0.0-beta.0

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/lib/es/index.js CHANGED
@@ -7,6 +7,10 @@ import { filter as filter$1, map as map$1, takeUntil as takeUntil$1 } from "rxjs
7
7
  import { DataSyncPrimaryController } from "@univerjs/rpc";
8
8
 
9
9
  //#region src/basics/cell-type.ts
10
+ function isCellImage(documentData) {
11
+ var _documentData$drawing;
12
+ return !!(documentData === null || documentData === void 0 || (_documentData$drawing = documentData.drawingsOrder) === null || _documentData$drawing === void 0 ? void 0 : _documentData$drawing.length);
13
+ }
10
14
  /**
11
15
  * Get cell value type by style, new value and old value.
12
16
  * If the new value contains t, then take t directly. In other cases, we need to dynamically determine based on actual data and styles
@@ -283,10 +287,7 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
283
287
  interceptCommand(interceptor) {
284
288
  if (this._commandInterceptors.includes(interceptor)) throw new Error("[SheetInterceptorService]: Interceptor already exists!");
285
289
  this._commandInterceptors.push(interceptor);
286
- this._commandInterceptors.sort((a, b) => {
287
- var _b$priority, _a$priority;
288
- return ((_b$priority = b.priority) !== null && _b$priority !== void 0 ? _b$priority : 0) - ((_a$priority = a.priority) !== null && _a$priority !== void 0 ? _a$priority : 0);
289
- });
290
+ this._commandInterceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
290
291
  return this.disposeWithMe(toDisposable(() => remove(this._commandInterceptors, interceptor)));
291
292
  }
292
293
  /**
@@ -297,25 +298,16 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
297
298
  onCommandExecute(info) {
298
299
  const infos = this._commandInterceptors.map((i) => i.getMutations(info));
299
300
  return {
300
- preUndos: infos.map((i) => {
301
- var _i$preUndos;
302
- return (_i$preUndos = i.preUndos) !== null && _i$preUndos !== void 0 ? _i$preUndos : [];
303
- }).flat(),
301
+ preUndos: infos.map((i) => i.preUndos ?? []).flat(),
304
302
  undos: infos.map((i) => i.undos).flat(),
305
- preRedos: infos.map((i) => {
306
- var _i$preRedos;
307
- return (_i$preRedos = i.preRedos) !== null && _i$preRedos !== void 0 ? _i$preRedos : [];
308
- }).flat(),
303
+ preRedos: infos.map((i) => i.preRedos ?? []).flat(),
309
304
  redos: infos.map((i) => i.redos).flat()
310
305
  };
311
306
  }
312
307
  interceptAfterCommand(interceptor) {
313
308
  if (this._afterCommandInterceptors.includes(interceptor)) throw new Error("[SheetInterceptorService]: Interceptor already exists!");
314
309
  this._afterCommandInterceptors.push(interceptor);
315
- this._afterCommandInterceptors.sort((a, b) => {
316
- var _b$priority2, _a$priority2;
317
- return ((_b$priority2 = b.priority) !== null && _b$priority2 !== void 0 ? _b$priority2 : 0) - ((_a$priority2 = a.priority) !== null && _a$priority2 !== void 0 ? _a$priority2 : 0);
318
- });
310
+ this._afterCommandInterceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
319
311
  return this.disposeWithMe(toDisposable(() => remove(this._afterCommandInterceptors, interceptor)));
320
312
  }
321
313
  afterCommandExecute(info) {
@@ -328,24 +320,15 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
328
320
  interceptAutoHeight(interceptor) {
329
321
  if (this._autoHeightInterceptors.includes(interceptor)) throw new Error("[SheetInterceptorService]: Interceptor already exists!");
330
322
  this._autoHeightInterceptors.push(interceptor);
331
- this._autoHeightInterceptors.sort((a, b) => {
332
- var _b$priority3, _a$priority3;
333
- return ((_b$priority3 = b.priority) !== null && _b$priority3 !== void 0 ? _b$priority3 : 0) - ((_a$priority3 = a.priority) !== null && _a$priority3 !== void 0 ? _a$priority3 : 0);
334
- });
323
+ this._autoHeightInterceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
335
324
  return this.disposeWithMe(toDisposable(() => remove(this._autoHeightInterceptors, interceptor)));
336
325
  }
337
326
  generateMutationsOfAutoHeight(ctx) {
338
327
  const infos = this._autoHeightInterceptors.map((i) => i.getMutations(ctx));
339
328
  return {
340
- preUndos: infos.map((i) => {
341
- var _i$preUndos2;
342
- return (_i$preUndos2 = i.preUndos) !== null && _i$preUndos2 !== void 0 ? _i$preUndos2 : [];
343
- }).flat(),
329
+ preUndos: infos.map((i) => i.preUndos ?? []).flat(),
344
330
  undos: infos.map((i) => i.undos).flat(),
345
- preRedos: infos.map((i) => {
346
- var _i$preRedos2;
347
- return (_i$preRedos2 = i.preRedos) !== null && _i$preRedos2 !== void 0 ? _i$preRedos2 : [];
348
- }).flat(),
331
+ preRedos: infos.map((i) => i.preRedos ?? []).flat(),
349
332
  redos: infos.map((i) => i.redos).flat()
350
333
  };
351
334
  }
@@ -361,10 +344,7 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
361
344
  interceptBeforeCommand(interceptor) {
362
345
  if (this._beforeCommandInterceptor.includes(interceptor)) throw new Error("[SheetInterceptorService]: Interceptor already exists!");
363
346
  this._beforeCommandInterceptor.push(interceptor);
364
- this._beforeCommandInterceptor.sort((a, b) => {
365
- var _b$priority4, _a$priority4;
366
- return ((_b$priority4 = b.priority) !== null && _b$priority4 !== void 0 ? _b$priority4 : 0) - ((_a$priority4 = a.priority) !== null && _a$priority4 !== void 0 ? _a$priority4 : 0);
367
- });
347
+ this._beforeCommandInterceptor.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
368
348
  return this.disposeWithMe(toDisposable(() => remove(this._beforeCommandInterceptor, interceptor)));
369
349
  }
370
350
  /**
@@ -383,24 +363,15 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
383
363
  interceptRanges(interceptor) {
384
364
  if (this._rangeInterceptors.includes(interceptor)) throw new Error("[SheetInterceptorService]: Interceptor already exists!");
385
365
  this._rangeInterceptors.push(interceptor);
386
- this._rangeInterceptors.sort((a, b) => {
387
- var _b$priority5, _a$priority5;
388
- return ((_b$priority5 = b.priority) !== null && _b$priority5 !== void 0 ? _b$priority5 : 0) - ((_a$priority5 = a.priority) !== null && _a$priority5 !== void 0 ? _a$priority5 : 0);
389
- });
366
+ this._rangeInterceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
390
367
  return this.disposeWithMe(toDisposable(() => remove(this._rangeInterceptors, interceptor)));
391
368
  }
392
369
  generateMutationsByRanges(info) {
393
370
  const infos = this._rangeInterceptors.map((i) => i.getMutations(info));
394
371
  return {
395
- preUndos: infos.map((i) => {
396
- var _i$preUndos3;
397
- return (_i$preUndos3 = i.preUndos) !== null && _i$preUndos3 !== void 0 ? _i$preUndos3 : [];
398
- }).flat(),
372
+ preUndos: infos.map((i) => i.preUndos ?? []).flat(),
399
373
  undos: infos.map((i) => i.undos).flat(),
400
- preRedos: infos.map((i) => {
401
- var _i$preRedos3;
402
- return (_i$preRedos3 = i.preRedos) !== null && _i$preRedos3 !== void 0 ? _i$preRedos3 : [];
403
- }).flat(),
374
+ preRedos: infos.map((i) => i.preRedos ?? []).flat(),
404
375
  redos: infos.map((i) => i.redos).flat()
405
376
  };
406
377
  }
@@ -432,10 +403,7 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
432
403
  if (!this._interceptorsByName.has(key)) this._interceptorsByName.set(key, []);
433
404
  const interceptors = this._interceptorsByName.get(key);
434
405
  interceptors.push(interceptor);
435
- const sortedInterceptors = interceptors.sort((a, b) => {
436
- var _b$priority6, _a$priority6;
437
- return ((_b$priority6 = b.priority) !== null && _b$priority6 !== void 0 ? _b$priority6 : 0) - ((_a$priority6 = a.priority) !== null && _a$priority6 !== void 0 ? _a$priority6 : 0);
438
- });
406
+ const sortedInterceptors = interceptors.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
439
407
  this._invalidateComposedInterceptors();
440
408
  if (key === INTERCEPTOR_POINT.CELL_CONTENT) {
441
409
  const JOINED_EFFECT = InterceptorEffectEnum.Style | InterceptorEffectEnum.Value;
@@ -460,7 +428,7 @@ let SheetInterceptorService = class SheetInterceptorService extends Disposable {
460
428
  }
461
429
  fetchThroughInterceptors(name, effect, _key, filter) {
462
430
  const byNamesKey = effect === void 0 ? name : `${name}-${effect}`;
463
- const key = _key !== null && _key !== void 0 ? _key : byNamesKey;
431
+ const key = _key ?? byNamesKey;
464
432
  let composed = this._composedInterceptorByKey.get(key);
465
433
  if (!composed) {
466
434
  let interceptors = this._interceptorsByName.get(byNamesKey);
@@ -2169,7 +2137,7 @@ function handleStyle(styles, oldVal, newVal) {
2169
2137
  */
2170
2138
  function transformStyle(oldStyle, newStyle) {
2171
2139
  if (!newStyle || !Object.keys(newStyle).length) return oldStyle;
2172
- const backupStyle = Tools.deepClone(oldStyle !== null && oldStyle !== void 0 ? oldStyle : {}) || {};
2140
+ const backupStyle = Tools.deepClone(oldStyle ?? {}) || {};
2173
2141
  const styleRecord = newStyle;
2174
2142
  for (const key of STYLE_KEYS) {
2175
2143
  if (!Object.prototype.hasOwnProperty.call(styleRecord, key)) continue;
@@ -2353,7 +2321,7 @@ const SetRangeValuesUndoMutationFactory = (accessor, params) => {
2353
2321
  const cell = Tools.deepClone(cellMatrix === null || cellMatrix === void 0 ? void 0 : cellMatrix.getValue(row, col)) || {};
2354
2322
  const oldStyle = styles.getStyleByCell(cell);
2355
2323
  const newStyle = styles.getStyleByCell(newVal);
2356
- cell.s = isOverrideStyle && Object.prototype.hasOwnProperty.call(newVal !== null && newVal !== void 0 ? newVal : {}, "s") ? oldStyle !== null && oldStyle !== void 0 ? oldStyle : null : transformStyle(oldStyle, newStyle);
2324
+ cell.s = isOverrideStyle && Object.prototype.hasOwnProperty.call(newVal ?? {}, "s") ? oldStyle ?? null : transformStyle(oldStyle, newStyle);
2357
2325
  undoData.setValue(row, col, setNull(cell));
2358
2326
  });
2359
2327
  return {
@@ -2645,8 +2613,8 @@ const SetWorksheetRowHeightMutationFactory = (params, worksheet) => {
2645
2613
  const rowHeight = {};
2646
2614
  const manager = worksheet.getRowManager();
2647
2615
  for (const { startRow, endRow } of ranges) for (let rowIndex = startRow; rowIndex < endRow + 1; rowIndex++) {
2648
- var _manager$getRow$h, _manager$getRow;
2649
- rowHeight[rowIndex] = (_manager$getRow$h = (_manager$getRow = manager.getRow(rowIndex)) === null || _manager$getRow === void 0 ? void 0 : _manager$getRow.h) !== null && _manager$getRow$h !== void 0 ? _manager$getRow$h : worksheet.getConfig().defaultRowHeight;
2616
+ var _manager$getRow;
2617
+ rowHeight[rowIndex] = ((_manager$getRow = manager.getRow(rowIndex)) === null || _manager$getRow === void 0 ? void 0 : _manager$getRow.h) ?? worksheet.getConfig().defaultRowHeight;
2650
2618
  }
2651
2619
  return {
2652
2620
  unitId,
@@ -2675,11 +2643,11 @@ const SetWorksheetRowAutoHeightMutationFactory = (params, worksheet) => {
2675
2643
  const results = [];
2676
2644
  const manager = worksheet.getRowManager();
2677
2645
  for (const rowInfo of rowsAutoHeightInfo) {
2678
- var _manager$getRow$ah, _manager$getRow3;
2646
+ var _manager$getRow3;
2679
2647
  const { row } = rowInfo;
2680
2648
  results.push({
2681
2649
  row,
2682
- autoHeight: (_manager$getRow$ah = (_manager$getRow3 = manager.getRow(row)) === null || _manager$getRow3 === void 0 ? void 0 : _manager$getRow3.ah) !== null && _manager$getRow$ah !== void 0 ? _manager$getRow$ah : worksheet.getConfig().defaultRowHeight
2650
+ autoHeight: ((_manager$getRow3 = manager.getRow(row)) === null || _manager$getRow3 === void 0 ? void 0 : _manager$getRow3.ah) ?? worksheet.getConfig().defaultRowHeight
2683
2651
  });
2684
2652
  }
2685
2653
  return {
@@ -2713,10 +2681,7 @@ const SetWorksheetRowIsAutoHeightMutation = {
2713
2681
  for (const { startRow, endRow } of ranges) for (let rowIndex = startRow; rowIndex <= endRow; rowIndex++) {
2714
2682
  const row = manager.getRowOrCreate(rowIndex);
2715
2683
  if (typeof autoHeightInfo === "number") row.ia = autoHeightInfo;
2716
- else {
2717
- var _autoHeightInfo$rowIn;
2718
- row.ia = (_autoHeightInfo$rowIn = autoHeightInfo[rowIndex]) !== null && _autoHeightInfo$rowIn !== void 0 ? _autoHeightInfo$rowIn : void 0;
2719
- }
2684
+ else row.ia = autoHeightInfo[rowIndex] ?? void 0;
2720
2685
  }
2721
2686
  return true;
2722
2687
  }
@@ -4252,8 +4217,7 @@ var WorkbookSelectionModel = class extends Disposable {
4252
4217
  return this._worksheetSelections.get(sheetId);
4253
4218
  }
4254
4219
  getLastSelectionPrimaryCellOfWorksheet(sheetId) {
4255
- var _this$_worksheetLastS;
4256
- return (_this$_worksheetLastS = this._worksheetLastSelectionPrimaryCell.get(sheetId)) !== null && _this$_worksheetLastS !== void 0 ? _this$_worksheetLastS : null;
4220
+ return this._worksheetLastSelectionPrimaryCell.get(sheetId) ?? null;
4257
4221
  }
4258
4222
  setSelectionsOfWorksheet(sheetId, selections) {
4259
4223
  this._worksheetSelections.set(sheetId, [...selections]);
@@ -4407,16 +4371,15 @@ let SheetsSelectionsService = class SheetsSelectionsService extends RxDisposable
4407
4371
  setSelections(unitIdOrSelections, worksheetIdOrType, selectionDatas, type) {
4408
4372
  if (typeof unitIdOrSelections === "string" && typeof worksheetIdOrType === "string") {
4409
4373
  const unitId = unitIdOrSelections;
4410
- this._ensureWorkbookSelection(unitId).setSelections(worksheetIdOrType, selectionDatas || [], type !== null && type !== void 0 ? type : 3);
4374
+ this._ensureWorkbookSelection(unitId).setSelections(worksheetIdOrType, selectionDatas || [], type ?? 3);
4411
4375
  return;
4412
4376
  }
4413
4377
  const current = this._currentSelectionPos;
4414
4378
  if (!current) throw new Error("[SheetsSelectionsService]: cannot find current selection position!");
4415
4379
  const { unitId, sheetId } = current;
4416
4380
  if (typeof unitIdOrSelections === "object") {
4417
- var _ref;
4418
- const selectionData = unitIdOrSelections !== null && unitIdOrSelections !== void 0 ? unitIdOrSelections : selectionDatas;
4419
- const type = (_ref = worksheetIdOrType) !== null && _ref !== void 0 ? _ref : 3;
4381
+ const selectionData = unitIdOrSelections ?? selectionDatas;
4382
+ const type = worksheetIdOrType ?? 3;
4420
4383
  this._ensureWorkbookSelection(unitId).setSelections(sheetId, selectionData, type);
4421
4384
  }
4422
4385
  }
@@ -5114,12 +5077,11 @@ const MoveRangeCommand = {
5114
5077
  }
5115
5078
  };
5116
5079
  function _resolveMoveRangeContext(accessor, params) {
5117
- var _ref, _params$toUnitId, _params$fromSubUnitId, _ref2, _params$toSubUnitId;
5118
5080
  const univerInstanceService = accessor.get(IUniverInstanceService);
5119
5081
  const target = getSheetCommandTarget(univerInstanceService);
5120
- const unitId = (_ref = (_params$toUnitId = params.toUnitId) !== null && _params$toUnitId !== void 0 ? _params$toUnitId : params.fromUnitId) !== null && _ref !== void 0 ? _ref : target === null || target === void 0 ? void 0 : target.unitId;
5121
- const fromSubUnitId = (_params$fromSubUnitId = params.fromSubUnitId) !== null && _params$fromSubUnitId !== void 0 ? _params$fromSubUnitId : target === null || target === void 0 ? void 0 : target.subUnitId;
5122
- const toSubUnitId = (_ref2 = (_params$toSubUnitId = params.toSubUnitId) !== null && _params$toSubUnitId !== void 0 ? _params$toSubUnitId : params.fromSubUnitId) !== null && _ref2 !== void 0 ? _ref2 : target === null || target === void 0 ? void 0 : target.subUnitId;
5082
+ const unitId = params.toUnitId ?? params.fromUnitId ?? (target === null || target === void 0 ? void 0 : target.unitId);
5083
+ const fromSubUnitId = params.fromSubUnitId ?? (target === null || target === void 0 ? void 0 : target.subUnitId);
5084
+ const toSubUnitId = params.toSubUnitId ?? params.fromSubUnitId ?? (target === null || target === void 0 ? void 0 : target.subUnitId);
5123
5085
  if (!unitId || !fromSubUnitId || !toSubUnitId) return null;
5124
5086
  if (params.fromUnitId && params.toUnitId && params.fromUnitId !== params.toUnitId) return null;
5125
5087
  const workbook = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
@@ -5135,7 +5097,6 @@ function _resolveMoveRangeContext(accessor, params) {
5135
5097
  };
5136
5098
  }
5137
5099
  function getMoveRangeCommandMutations(accessor, params, options = {}) {
5138
- var _interceptorCommands$, _interceptorCommands$2;
5139
5100
  const { includeSelection = true, includeAfterCommand = true, includeAutoHeight = true } = options;
5140
5101
  const context = _resolveMoveRangeContext(accessor, params);
5141
5102
  if (!context) return null;
@@ -5157,12 +5118,12 @@ function getMoveRangeCommandMutations(accessor, params, options = {}) {
5157
5118
  };
5158
5119
  const interceptorCommands = sheetInterceptorService.onCommandExecute(commandInfo);
5159
5120
  const redos = [
5160
- ...(_interceptorCommands$ = interceptorCommands.preRedos) !== null && _interceptorCommands$ !== void 0 ? _interceptorCommands$ : [],
5121
+ ...interceptorCommands.preRedos ?? [],
5161
5122
  ...moveRangeMutations.redos,
5162
5123
  ...interceptorCommands.redos
5163
5124
  ];
5164
5125
  const undos = [
5165
- ...(_interceptorCommands$2 = interceptorCommands.preUndos) !== null && _interceptorCommands$2 !== void 0 ? _interceptorCommands$2 : [],
5126
+ ...interceptorCommands.preUndos ?? [],
5166
5127
  ...moveRangeMutations.undos,
5167
5128
  ...interceptorCommands.undos
5168
5129
  ];
@@ -5230,8 +5191,7 @@ function getMoveRangeUndoRedoMutations(accessor, from, to, ignoreMerge = false)
5230
5191
  const toRedoCellValue = new ObjectMatrix();
5231
5192
  const toUndoCellValue = new ObjectMatrix();
5232
5193
  Range.foreach(fromRange, (row, col) => {
5233
- var _Tools$deepClone;
5234
- const cellData = (_Tools$deepClone = Tools.deepClone(fromWorksheetCellMatrix.getValue(row, col))) !== null && _Tools$deepClone !== void 0 ? _Tools$deepClone : null;
5194
+ const cellData = Tools.deepClone(fromWorksheetCellMatrix.getValue(row, col)) ?? null;
5235
5195
  if (cellData === null || cellData === void 0 ? void 0 : cellData.s) cellData.s = workbook.getStyles().get(cellData.s);
5236
5196
  fromRedoCellValue.setValue(row, col, null);
5237
5197
  fromUndoCellValue.setValue(row, col, cellData);
@@ -5241,8 +5201,7 @@ function getMoveRangeUndoRedoMutations(accessor, from, to, ignoreMerge = false)
5241
5201
  toRedoCellValue.setValue(range.startRow, range.startColumn, Tools.deepClone(cellData));
5242
5202
  });
5243
5203
  Range.foreach(toRange, (row, col) => {
5244
- var _Tools$deepClone2;
5245
- const cellData = (_Tools$deepClone2 = Tools.deepClone(toWorksheetCellMatrix.getValue(row, col))) !== null && _Tools$deepClone2 !== void 0 ? _Tools$deepClone2 : null;
5204
+ const cellData = Tools.deepClone(toWorksheetCellMatrix.getValue(row, col)) ?? null;
5246
5205
  toUndoCellValue.setValue(row, col, cellData);
5247
5206
  });
5248
5207
  const redoMoveRangeMutationParams = {
@@ -5309,7 +5268,7 @@ const SetRangeValuesCommand = {
5309
5268
  id: "sheet.command.set-range-values",
5310
5269
  type: CommandType.COMMAND,
5311
5270
  handler: (accessor, params) => {
5312
- var _selectionManagerServ, _realCellValue;
5271
+ var _selectionManagerServ;
5313
5272
  const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
5314
5273
  if (!target) return false;
5315
5274
  const currentSelections = (_selectionManagerServ = accessor.get(SheetsSelectionsService).getCurrentSelections()) === null || _selectionManagerServ === void 0 ? void 0 : _selectionManagerServ.map((s) => s.range);
@@ -5337,7 +5296,7 @@ const SetRangeValuesCommand = {
5337
5296
  const setRangeValuesMutationRedoParams = {
5338
5297
  unitId,
5339
5298
  subUnitId,
5340
- cellValue: (_realCellValue = realCellValue) !== null && _realCellValue !== void 0 ? _realCellValue : cellValue.getMatrix()
5299
+ cellValue: realCellValue ?? cellValue.getMatrix()
5341
5300
  };
5342
5301
  const setRangeValuesMutationUndoParams = SetRangeValuesUndoMutationFactory(accessor, setRangeValuesMutationRedoParams);
5343
5302
  const cellHeights = mapObjectMatrix(setRangeValuesMutationRedoParams.cellValue, (row, col) => worksheet.getCellHeight(row, col) || void 0);
@@ -5629,7 +5588,6 @@ const DeleteRangeMoveLeftCommand = {
5629
5588
  type: CommandType.COMMAND,
5630
5589
  id: DeleteRangeMoveLeftCommandId,
5631
5590
  handler: async (accessor, params) => {
5632
- var _sheetInterceptor$pre, _sheetInterceptor$pre2;
5633
5591
  const commandService = accessor.get(ICommandService);
5634
5592
  const undoRedoService = accessor.get(IUndoRedoService);
5635
5593
  const univerInstanceService = accessor.get(IUniverInstanceService);
@@ -5655,11 +5613,11 @@ const DeleteRangeMoveLeftCommand = {
5655
5613
  params: { range }
5656
5614
  });
5657
5615
  const { redo: removeRangeRedo, undo: removeRangeUndo } = getRemoveRangeMutations(accessor, deleteRangeMutationParams);
5658
- const redos = [...(_sheetInterceptor$pre = sheetInterceptor.preRedos) !== null && _sheetInterceptor$pre !== void 0 ? _sheetInterceptor$pre : [], ...removeRangeRedo];
5616
+ const redos = [...sheetInterceptor.preRedos ?? [], ...removeRangeRedo];
5659
5617
  const undos = [...sheetInterceptor.undos, ...removeRangeUndo];
5660
5618
  redos.push(...sheetInterceptor.redos);
5661
5619
  redos.push(followSelectionOperation(range, workbook, worksheet));
5662
- undos.push(...(_sheetInterceptor$pre2 = sheetInterceptor.preUndos) !== null && _sheetInterceptor$pre2 !== void 0 ? _sheetInterceptor$pre2 : []);
5620
+ undos.push(...sheetInterceptor.preUndos ?? []);
5663
5621
  if (sequenceExecute(redos, commandService).result) {
5664
5622
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
5665
5623
  id: DeleteRangeMoveLeftCommand.id,
@@ -5689,7 +5647,6 @@ const DeleteRangeMoveUpCommand = {
5689
5647
  type: CommandType.COMMAND,
5690
5648
  id: DeleteRangeMoveUpCommandId,
5691
5649
  handler: async (accessor, params) => {
5692
- var _sheetInterceptor$pre, _sheetInterceptor$pre2;
5693
5650
  const commandService = accessor.get(ICommandService);
5694
5651
  const undoRedoService = accessor.get(IUndoRedoService);
5695
5652
  const univerInstanceService = accessor.get(IUniverInstanceService);
@@ -5715,11 +5672,11 @@ const DeleteRangeMoveUpCommand = {
5715
5672
  params: { range }
5716
5673
  });
5717
5674
  const { redo: removeRangeRedo, undo: removeRangeUndo } = getRemoveRangeMutations(accessor, deleteRangeMutationParams);
5718
- const redos = [...(_sheetInterceptor$pre = sheetInterceptor.preRedos) !== null && _sheetInterceptor$pre !== void 0 ? _sheetInterceptor$pre : [], ...removeRangeRedo];
5675
+ const redos = [...sheetInterceptor.preRedos ?? [], ...removeRangeRedo];
5719
5676
  const undos = [...sheetInterceptor.undos, ...removeRangeUndo];
5720
5677
  redos.push(...sheetInterceptor.redos);
5721
5678
  redos.push(followSelectionOperation(range, workbook, worksheet));
5722
- undos.push(...(_sheetInterceptor$pre2 = sheetInterceptor.preUndos) !== null && _sheetInterceptor$pre2 !== void 0 ? _sheetInterceptor$pre2 : []);
5679
+ undos.push(...sheetInterceptor.preUndos ?? []);
5723
5680
  if (sequenceExecute(redos, commandService).result) {
5724
5681
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
5725
5682
  id: DeleteRangeMoveUpCommand.id,
@@ -5749,7 +5706,6 @@ const InsertRangeMoveDownCommand = {
5749
5706
  type: CommandType.COMMAND,
5750
5707
  id: InsertRangeMoveDownCommandId,
5751
5708
  handler: async (accessor, params) => {
5752
- var _sheetInterceptor$pre, _sheetInterceptor$pre2;
5753
5709
  const commandService = accessor.get(ICommandService);
5754
5710
  const undoRedoService = accessor.get(IUndoRedoService);
5755
5711
  const univerInstanceService = accessor.get(IUniverInstanceService);
@@ -5825,8 +5781,8 @@ const InsertRangeMoveDownCommand = {
5825
5781
  });
5826
5782
  redoMutations.push(...sheetInterceptor.redos);
5827
5783
  redoMutations.push(followSelectionOperation(range, workbook, worksheet));
5828
- undoMutations.push(...(_sheetInterceptor$pre = sheetInterceptor.preUndos) !== null && _sheetInterceptor$pre !== void 0 ? _sheetInterceptor$pre : []);
5829
- redoMutations.unshift(...(_sheetInterceptor$pre2 = sheetInterceptor.preRedos) !== null && _sheetInterceptor$pre2 !== void 0 ? _sheetInterceptor$pre2 : []);
5784
+ undoMutations.push(...sheetInterceptor.preUndos ?? []);
5785
+ redoMutations.unshift(...sheetInterceptor.preRedos ?? []);
5830
5786
  undoMutations.unshift(...sheetInterceptor.undos);
5831
5787
  if (sequenceExecute(redoMutations, commandService).result) {
5832
5788
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
@@ -5857,7 +5813,6 @@ const InsertRangeMoveRightCommand = {
5857
5813
  type: CommandType.COMMAND,
5858
5814
  id: InsertRangeMoveRightCommandId,
5859
5815
  handler: async (accessor, params) => {
5860
- var _sheetInterceptor$pre, _sheetInterceptor$pre2;
5861
5816
  const commandService = accessor.get(ICommandService);
5862
5817
  const undoRedoService = accessor.get(IUndoRedoService);
5863
5818
  const univerInstanceService = accessor.get(IUniverInstanceService);
@@ -5933,8 +5888,8 @@ const InsertRangeMoveRightCommand = {
5933
5888
  });
5934
5889
  redoMutations.push(...sheetInterceptor.redos);
5935
5890
  redoMutations.push(followSelectionOperation(range, workbook, worksheet));
5936
- undoMutations.push(...(_sheetInterceptor$pre = sheetInterceptor.preUndos) !== null && _sheetInterceptor$pre !== void 0 ? _sheetInterceptor$pre : []);
5937
- redoMutations.unshift(...(_sheetInterceptor$pre2 = sheetInterceptor.preRedos) !== null && _sheetInterceptor$pre2 !== void 0 ? _sheetInterceptor$pre2 : []);
5891
+ undoMutations.push(...sheetInterceptor.preUndos ?? []);
5892
+ redoMutations.unshift(...sheetInterceptor.preRedos ?? []);
5938
5893
  undoMutations.unshift(...sheetInterceptor.undos);
5939
5894
  if (sequenceExecute(redoMutations, commandService).result) {
5940
5895
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
@@ -5987,7 +5942,6 @@ const InsertRowByRangeCommand = {
5987
5942
  type: CommandType.COMMAND,
5988
5943
  id: "sheet.command.insert-row-by-range",
5989
5944
  handler: (accessor, params) => {
5990
- var _intercepted$preRedos, _intercepted$redos, _intercepted$preUndos, _intercepted$undos;
5991
5945
  const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
5992
5946
  if (!target) throw new Error("Workbook or Worksheet not found at InsertRowByRangeCommand");
5993
5947
  const { workbook, worksheet, unitId, subUnitId } = target;
@@ -6030,11 +5984,11 @@ const InsertRowByRangeCommand = {
6030
5984
  id: InsertRowCommand.id,
6031
5985
  params
6032
5986
  });
6033
- redos.unshift(...(_intercepted$preRedos = intercepted.preRedos) !== null && _intercepted$preRedos !== void 0 ? _intercepted$preRedos : []);
6034
- redos.push(...(_intercepted$redos = intercepted.redos) !== null && _intercepted$redos !== void 0 ? _intercepted$redos : []);
5987
+ redos.unshift(...intercepted.preRedos ?? []);
5988
+ redos.push(...intercepted.redos ?? []);
6035
5989
  redos.push(followSelectionOperation(range, workbook, worksheet));
6036
- undos.unshift(...(_intercepted$preUndos = intercepted.preUndos) !== null && _intercepted$preUndos !== void 0 ? _intercepted$preUndos : []);
6037
- undos.push(...(_intercepted$undos = intercepted.undos) !== null && _intercepted$undos !== void 0 ? _intercepted$undos : []);
5990
+ undos.unshift(...intercepted.preUndos ?? []);
5991
+ undos.push(...intercepted.undos ?? []);
6038
5992
  if (sequenceExecute(redos, commandService).result) {
6039
5993
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
6040
5994
  id: InsertRowCommand.id,
@@ -6210,7 +6164,6 @@ const InsertColByRangeCommand = {
6210
6164
  type: CommandType.COMMAND,
6211
6165
  id: "sheet.command.insert-col-by-range",
6212
6166
  handler: (accessor, params) => {
6213
- var _intercepted$preRedos2, _intercepted$redos2, _intercepted$preUndos2, _intercepted$undos2;
6214
6167
  const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
6215
6168
  if (!target) throw new Error("Workbook or Worksheet not found at InsertColByRangeCommand");
6216
6169
  const { workbook, worksheet, unitId, subUnitId } = target;
@@ -6253,11 +6206,11 @@ const InsertColByRangeCommand = {
6253
6206
  id: InsertColCommand.id,
6254
6207
  params
6255
6208
  });
6256
- redos.unshift(...(_intercepted$preRedos2 = intercepted.preRedos) !== null && _intercepted$preRedos2 !== void 0 ? _intercepted$preRedos2 : []);
6257
- redos.push(...(_intercepted$redos2 = intercepted.redos) !== null && _intercepted$redos2 !== void 0 ? _intercepted$redos2 : []);
6209
+ redos.unshift(...intercepted.preRedos ?? []);
6210
+ redos.push(...intercepted.redos ?? []);
6258
6211
  redos.push(followSelectionOperation(range, workbook, worksheet));
6259
- undos.unshift(...(_intercepted$preUndos2 = intercepted.preUndos) !== null && _intercepted$preUndos2 !== void 0 ? _intercepted$preUndos2 : []);
6260
- undos.push(...(_intercepted$undos2 = intercepted.undos) !== null && _intercepted$undos2 !== void 0 ? _intercepted$undos2 : []);
6212
+ undos.unshift(...intercepted.preUndos ?? []);
6213
+ undos.push(...intercepted.undos ?? []);
6261
6214
  if (sequenceExecute(redos, commandService).result) {
6262
6215
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
6263
6216
  id: InsertColCommand.id,
@@ -6419,7 +6372,6 @@ const RemoveRowByRangeCommand = {
6419
6372
  type: CommandType.COMMAND,
6420
6373
  id: "sheet.command.remove-row-by-range",
6421
6374
  handler: (accessor, params) => {
6422
- var _intercepted$preRedos;
6423
6375
  if (!params) return false;
6424
6376
  const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
6425
6377
  if (!target) return false;
@@ -6466,11 +6418,10 @@ const RemoveRowByRangeCommand = {
6466
6418
  });
6467
6419
  const commandService = accessor.get(ICommandService);
6468
6420
  if (sequenceExecute([
6469
- ...(_intercepted$preRedos = intercepted.preRedos) !== null && _intercepted$preRedos !== void 0 ? _intercepted$preRedos : [],
6421
+ ...intercepted.preRedos ?? [],
6470
6422
  ...redoMutations,
6471
6423
  ...intercepted.redos
6472
6424
  ], commandService).result) {
6473
- var _intercepted$preUndos, _intercepted$preRedos2;
6474
6425
  setSelection(range, workbook, worksheet, commandService);
6475
6426
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
6476
6427
  id: RemoveRowCommandId,
@@ -6480,13 +6431,13 @@ const RemoveRowByRangeCommand = {
6480
6431
  accessor.get(IUndoRedoService).pushUndoRedo({
6481
6432
  unitID: unitId,
6482
6433
  undoMutations: [
6483
- ...(_intercepted$preUndos = intercepted.preUndos) !== null && _intercepted$preUndos !== void 0 ? _intercepted$preUndos : [],
6434
+ ...intercepted.preUndos ?? [],
6484
6435
  ...undoMutations,
6485
6436
  ...intercepted.undos,
6486
6437
  ...afterInterceptors.undos
6487
6438
  ],
6488
6439
  redoMutations: [
6489
- ...(_intercepted$preRedos2 = intercepted.preRedos) !== null && _intercepted$preRedos2 !== void 0 ? _intercepted$preRedos2 : [],
6440
+ ...intercepted.preRedos ?? [],
6490
6441
  ...redoMutations,
6491
6442
  ...intercepted.redos,
6492
6443
  ...afterInterceptors.redos
@@ -6538,7 +6489,6 @@ const RemoveColByRangeCommand = {
6538
6489
  type: CommandType.COMMAND,
6539
6490
  id: "sheet.command.remove-col-by-range",
6540
6491
  handler: (accessor, params) => {
6541
- var _intercepted$preRedos3;
6542
6492
  if (!params) return false;
6543
6493
  const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
6544
6494
  if (!target) return false;
@@ -6563,14 +6513,13 @@ const RemoveColByRangeCommand = {
6563
6513
  });
6564
6514
  const commandService = accessor.get(ICommandService);
6565
6515
  if (sequenceExecute([
6566
- ...(_intercepted$preRedos3 = intercepted.preRedos) !== null && _intercepted$preRedos3 !== void 0 ? _intercepted$preRedos3 : [],
6516
+ ...intercepted.preRedos ?? [],
6567
6517
  {
6568
6518
  id: RemoveColMutation.id,
6569
6519
  params: removeColParams
6570
6520
  },
6571
6521
  ...intercepted.redos
6572
6522
  ], commandService).result) {
6573
- var _intercepted$preUndos2, _intercepted$preRedos4;
6574
6523
  setSelection(range, workbook, worksheet, commandService);
6575
6524
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
6576
6525
  id: RemoveColCommandId,
@@ -6580,7 +6529,7 @@ const RemoveColByRangeCommand = {
6580
6529
  accessor.get(IUndoRedoService).pushUndoRedo({
6581
6530
  unitID: unitId,
6582
6531
  undoMutations: [
6583
- ...(_intercepted$preUndos2 = intercepted.preUndos) !== null && _intercepted$preUndos2 !== void 0 ? _intercepted$preUndos2 : [],
6532
+ ...intercepted.preUndos ?? [],
6584
6533
  {
6585
6534
  id: InsertColMutation.id,
6586
6535
  params: undoRemoveColParams
@@ -6593,7 +6542,7 @@ const RemoveColByRangeCommand = {
6593
6542
  ...afterInterceptors.undos
6594
6543
  ],
6595
6544
  redoMutations: [
6596
- ...(_intercepted$preRedos4 = intercepted.preRedos) !== null && _intercepted$preRedos4 !== void 0 ? _intercepted$preRedos4 : [],
6545
+ ...intercepted.preRedos ?? [],
6597
6546
  {
6598
6547
  id: RemoveColMutation.id,
6599
6548
  params: removeColParams
@@ -6695,7 +6644,6 @@ const MoveRowsCommand = {
6695
6644
  id: MoveRowsCommandId,
6696
6645
  type: CommandType.COMMAND,
6697
6646
  handler: (accessor, params) => {
6698
- var _interceptorCommands$, _interceptorCommands$2;
6699
6647
  const selectionManagerService = accessor.get(SheetsSelectionsService);
6700
6648
  const { fromRange: { startRow: fromRow }, toRange: { startRow: toRow }, range } = params;
6701
6649
  const selections = range ? [covertRangeToSelection(range)] : selectionManagerService.getCurrentSelections();
@@ -6737,11 +6685,11 @@ const MoveRowsCommand = {
6737
6685
  id: MoveRowsCommand.id,
6738
6686
  params
6739
6687
  });
6740
- const redos = [...(_interceptorCommands$ = interceptorCommands.preRedos) !== null && _interceptorCommands$ !== void 0 ? _interceptorCommands$ : [], {
6688
+ const redos = [...interceptorCommands.preRedos ?? [], {
6741
6689
  id: MoveRowsMutation.id,
6742
6690
  params: moveRowsParams
6743
6691
  }];
6744
- const undos = [...(_interceptorCommands$2 = interceptorCommands.preUndos) !== null && _interceptorCommands$2 !== void 0 ? _interceptorCommands$2 : [], {
6692
+ const undos = [...interceptorCommands.preUndos ?? [], {
6745
6693
  id: MoveRowsMutation.id,
6746
6694
  params: undoMoveRowsParams
6747
6695
  }];
@@ -6807,7 +6755,6 @@ const MoveColsCommand = {
6807
6755
  id: MoveColsCommandId,
6808
6756
  type: CommandType.COMMAND,
6809
6757
  handler: (accessor, params) => {
6810
- var _interceptorCommands$3, _interceptorCommands$4;
6811
6758
  const selectionManagerService = accessor.get(SheetsSelectionsService);
6812
6759
  const { fromRange: { startColumn: fromCol }, toRange: { startColumn: toCol }, range } = params;
6813
6760
  const selections = range ? [covertRangeToSelection(range)] : selectionManagerService.getCurrentSelections();
@@ -6849,11 +6796,11 @@ const MoveColsCommand = {
6849
6796
  id: MoveColsCommand.id,
6850
6797
  params
6851
6798
  });
6852
- const redos = [...(_interceptorCommands$3 = interceptorCommands.preRedos) !== null && _interceptorCommands$3 !== void 0 ? _interceptorCommands$3 : [], {
6799
+ const redos = [...interceptorCommands.preRedos ?? [], {
6853
6800
  id: MoveColsMutation.id,
6854
6801
  params: moveColsParams
6855
6802
  }];
6856
- const undos = [...(_interceptorCommands$4 = interceptorCommands.preUndos) !== null && _interceptorCommands$4 !== void 0 ? _interceptorCommands$4 : [], {
6803
+ const undos = [...interceptorCommands.preUndos ?? [], {
6857
6804
  id: MoveColsMutation.id,
6858
6805
  params: undoMoveColsParams
6859
6806
  }];
@@ -6928,7 +6875,6 @@ const ReorderRangeCommand = {
6928
6875
  id: ReorderRangeCommandId,
6929
6876
  type: CommandType.COMMAND,
6930
6877
  handler: (accessor, params) => {
6931
- var _interceptorCommands$, _interceptorCommands$2;
6932
6878
  const { subUnitId, unitId, range, order } = params;
6933
6879
  const commandService = accessor.get(ICommandService);
6934
6880
  const reorderMutation = {
@@ -6950,12 +6896,12 @@ const ReorderRangeCommand = {
6950
6896
  params
6951
6897
  });
6952
6898
  const redos = [
6953
- ...(_interceptorCommands$ = interceptorCommands.preRedos) !== null && _interceptorCommands$ !== void 0 ? _interceptorCommands$ : [],
6899
+ ...interceptorCommands.preRedos ?? [],
6954
6900
  reorderMutation,
6955
6901
  ...interceptorCommands.redos
6956
6902
  ];
6957
6903
  const undos = [
6958
- ...(_interceptorCommands$2 = interceptorCommands.preUndos) !== null && _interceptorCommands$2 !== void 0 ? _interceptorCommands$2 : [],
6904
+ ...interceptorCommands.preUndos ?? [],
6959
6905
  undoReorderMutation,
6960
6906
  ...interceptorCommands.undos
6961
6907
  ];
@@ -7174,9 +7120,8 @@ const handleReorderRangeCommon = (param, targetRange) => {
7174
7120
  const cacheMatrix = new ObjectMatrix();
7175
7121
  Range.foreach(range, (row, col) => {
7176
7122
  if (Object.prototype.hasOwnProperty.call(order, row)) {
7177
- var _matrix$getValue;
7178
7123
  const targetRow = order[row];
7179
- const cloneCell = (_matrix$getValue = matrix.getValue(targetRow, col)) !== null && _matrix$getValue !== void 0 ? _matrix$getValue : 0;
7124
+ const cloneCell = matrix.getValue(targetRow, col) ?? 0;
7180
7125
  cacheMatrix.setValue(row, col, cloneCell);
7181
7126
  }
7182
7127
  });
@@ -7270,10 +7215,9 @@ const handleMoveRangeCommon = (param, targetRange) => {
7270
7215
  endRow: toRange.endRow - rowOffset
7271
7216
  };
7272
7217
  loopToRange && Range.foreach(loopToRange, (row, col) => {
7273
- var _fromMatrix$getValue;
7274
7218
  const targetRow = row + rowOffset;
7275
7219
  const targetCol = col + columnOffset;
7276
- matrix.setValue(targetRow, targetCol, (_fromMatrix$getValue = fromMatrix.getValue(row, col)) !== null && _fromMatrix$getValue !== void 0 ? _fromMatrix$getValue : 0);
7220
+ matrix.setValue(targetRow, targetCol, fromMatrix.getValue(row, col) ?? 0);
7277
7221
  });
7278
7222
  return queryObjectMatrix(matrix, (value) => value === 1);
7279
7223
  };
@@ -7625,8 +7569,7 @@ const handleDeleteRangeMoveUpCommon = (param, targetRange) => {
7625
7569
  return queryObjectMatrix(matrix, (v) => v === 1);
7626
7570
  };
7627
7571
  const handleRemoveRowCommon = (param, targetRange) => {
7628
- var _param$ranges;
7629
- const mergedRemoved = mergeIntervals(((_param$ranges = param.ranges) !== null && _param$ranges !== void 0 ? _param$ranges : [param.range]).map((range) => [range.startRow, range.endRow]));
7572
+ const mergedRemoved = mergeIntervals((param.ranges ?? [param.range]).map((range) => [range.startRow, range.endRow]));
7630
7573
  let targetStartRow = targetRange.startRow;
7631
7574
  let targetEndRow = targetRange.endRow;
7632
7575
  for (let i = mergedRemoved.length - 1; i >= 0; i--) {
@@ -8177,8 +8120,9 @@ function getSeparateEffectedRangesOnCommand(accessor, command) {
8177
8120
  const MERGE_REDO = createInterceptorKey("MERGE_REDO");
8178
8121
  const MERGE_UNDO = createInterceptorKey("MERGE_UNDO");
8179
8122
  var WatchRange = class extends Disposable {
8180
- constructor(_unitId, _subUnitId, _range, _callback, _skipIntersects = false) {
8123
+ constructor(revision, _unitId, _subUnitId, _range, _callback, _skipIntersects = false) {
8181
8124
  super();
8125
+ this.revision = revision;
8182
8126
  this._unitId = _unitId;
8183
8127
  this._subUnitId = _subUnitId;
8184
8128
  this._range = _range;
@@ -8217,6 +8161,8 @@ let RefRangeService = class RefRangeService extends Disposable {
8217
8161
  MERGE_UNDO
8218
8162
  }));
8219
8163
  _defineProperty(this, "_watchRanges", /* @__PURE__ */ new Set());
8164
+ _defineProperty(this, "_watchRangesListener", null);
8165
+ _defineProperty(this, "_watchRangeRevision", 0);
8220
8166
  _defineProperty(this, "_refRangeManagerMap", /* @__PURE__ */ new Map());
8221
8167
  _defineProperty(this, "_serializer", createRangeSerializer());
8222
8168
  _defineProperty(this, "_onRefRangeChange", () => {
@@ -8248,15 +8194,14 @@ let RefRangeService = class RefRangeService extends Disposable {
8248
8194
  }], unitId, subUnitId);
8249
8195
  }
8250
8196
  case EffectRefRangId.MoveRangeCommandId: {
8251
- var _params$toUnitId, _params$toSubUnitId;
8252
8197
  const params = command.params;
8253
8198
  const sourceTarget = getSheetCommandTarget(this._univerInstanceService, {
8254
8199
  unitId: params.fromUnitId,
8255
8200
  subUnitId: params.fromSubUnitId
8256
8201
  });
8257
8202
  const destinationTarget = getSheetCommandTarget(this._univerInstanceService, {
8258
- unitId: (_params$toUnitId = params.toUnitId) !== null && _params$toUnitId !== void 0 ? _params$toUnitId : params.fromUnitId,
8259
- subUnitId: (_params$toSubUnitId = params.toSubUnitId) !== null && _params$toSubUnitId !== void 0 ? _params$toSubUnitId : params.fromSubUnitId
8203
+ unitId: params.toUnitId ?? params.fromUnitId,
8204
+ subUnitId: params.toSubUnitId ?? params.fromSubUnitId
8260
8205
  });
8261
8206
  if (!sourceTarget && !destinationTarget) return [];
8262
8207
  if (sourceTarget && destinationTarget && sourceTarget.unitId === destinationTarget.unitId && sourceTarget.subUnitId === destinationTarget.subUnitId) return this._checkRange([params.fromRange, params.toRange], sourceTarget.unitId, sourceTarget.subUnitId);
@@ -8374,11 +8319,10 @@ let RefRangeService = class RefRangeService extends Disposable {
8374
8319
  result.push(v);
8375
8320
  return result;
8376
8321
  }, []).reduce((result, currentValue) => {
8377
- var _currentValue$preRedo, _currentValue$preUndo;
8378
8322
  result.redos.push(...currentValue.redos);
8379
8323
  result.undos.push(...currentValue.undos);
8380
- result.preRedos.push(...(_currentValue$preRedo = currentValue.preRedos) !== null && _currentValue$preRedo !== void 0 ? _currentValue$preRedo : []);
8381
- result.preUndos.push(...(_currentValue$preUndo = currentValue.preUndos) !== null && _currentValue$preUndo !== void 0 ? _currentValue$preUndo : []);
8324
+ result.preRedos.push(...currentValue.preRedos ?? []);
8325
+ result.preUndos.push(...currentValue.preUndos ?? []);
8382
8326
  return result;
8383
8327
  }, {
8384
8328
  redos: [],
@@ -8469,18 +8413,22 @@ let RefRangeService = class RefRangeService extends Disposable {
8469
8413
  });
8470
8414
  }
8471
8415
  watchRange(unitId, subUnitId, range, callback, skipIntersects) {
8472
- let watchRangesListener;
8473
- if (this._watchRanges.size === 0) watchRangesListener = this._commandService.onCommandExecuted((command) => {
8416
+ if (!this._watchRangesListener) this._watchRangesListener = this.disposeWithMe(this._commandService.onCommandExecuted((command) => {
8474
8417
  if (command.type !== CommandType.MUTATION) return false;
8475
- for (const watchRange of this._watchRanges) watchRange.onMutation(command);
8476
- });
8477
- const watchRange = new WatchRange(unitId, subUnitId, range, callback, skipIntersects);
8418
+ const revision = this._watchRangeRevision;
8419
+ for (const watchRange of this._watchRanges) {
8420
+ if (watchRange.revision > revision) continue;
8421
+ watchRange.onMutation(command);
8422
+ }
8423
+ }));
8424
+ const watchRange = new WatchRange(++this._watchRangeRevision, unitId, subUnitId, range, callback, skipIntersects);
8478
8425
  this._watchRanges.add(watchRange);
8479
8426
  const teardownWatching = toDisposable(() => {
8480
8427
  this._watchRanges.delete(watchRange);
8481
8428
  if (this._watchRanges.size === 0) {
8482
- watchRangesListener === null || watchRangesListener === void 0 || watchRangesListener.dispose();
8483
- watchRangesListener = null;
8429
+ var _this$_watchRangesLis;
8430
+ (_this$_watchRangesLis = this._watchRangesListener) === null || _this$_watchRangesLis === void 0 || _this$_watchRangesLis.dispose();
8431
+ this._watchRangesListener = null;
8484
8432
  }
8485
8433
  });
8486
8434
  const registerToService = this.disposeWithMe(teardownWatching);
@@ -8874,11 +8822,10 @@ let MergeCellController = class MergeCellController extends Disposable {
8874
8822
  };
8875
8823
  }
8876
8824
  _handleMoveRangeCommand(params, unitId, subUnitId) {
8877
- var _params$fromSubUnitId, _params$toSubUnitId;
8878
8825
  const workbook = getWorkbook(this._univerInstanceService, unitId);
8879
8826
  if (!workbook) return this._handleNull();
8880
- const sourceSubUnitId = (_params$fromSubUnitId = params.fromSubUnitId) !== null && _params$fromSubUnitId !== void 0 ? _params$fromSubUnitId : subUnitId;
8881
- const targetSubUnitId = (_params$toSubUnitId = params.toSubUnitId) !== null && _params$toSubUnitId !== void 0 ? _params$toSubUnitId : sourceSubUnitId;
8827
+ const sourceSubUnitId = params.fromSubUnitId ?? subUnitId;
8828
+ const targetSubUnitId = params.toSubUnitId ?? sourceSubUnitId;
8882
8829
  const sourceWorksheet = getWorksheet(workbook, sourceSubUnitId);
8883
8830
  const targetWorksheet = getWorksheet(workbook, targetSubUnitId);
8884
8831
  if (!sourceWorksheet || !targetWorksheet) return this._handleNull();
@@ -9796,8 +9743,8 @@ function getClearContentMutationParamForRange(worksheet, range) {
9796
9743
  let leftTopCellValue = null;
9797
9744
  cellMatrix.forValue((row, col, cellData) => {
9798
9745
  if (cellData && row >= startRow && col >= startColumn) {
9799
- var _cellData$p$body$data, _cellData$p;
9800
- if (!leftTopCellValue && worksheet.cellHasValue(cellData) && (cellData.v !== "" || ((_cellData$p$body$data = (_cellData$p = cellData.p) === null || _cellData$p === void 0 || (_cellData$p = _cellData$p.body) === null || _cellData$p === void 0 || (_cellData$p = _cellData$p.dataStream) === null || _cellData$p === void 0 ? void 0 : _cellData$p.length) !== null && _cellData$p$body$data !== void 0 ? _cellData$p$body$data : 0) > 2)) leftTopCellValue = cellData;
9746
+ var _cellData$p;
9747
+ if (!leftTopCellValue && worksheet.cellHasValue(cellData) && (cellData.v !== "" || (((_cellData$p = cellData.p) === null || _cellData$p === void 0 || (_cellData$p = _cellData$p.body) === null || _cellData$p === void 0 || (_cellData$p = _cellData$p.dataStream) === null || _cellData$p === void 0 ? void 0 : _cellData$p.length) ?? 0) > 2)) leftTopCellValue = cellData;
9801
9748
  redoMatrix.setValue(row, col, cellData.s ? {
9802
9749
  v: null,
9803
9750
  t: null,
@@ -12620,7 +12567,6 @@ function splitCellDataIntoBatches(unitId, subUnitId, cellData, batchSize) {
12620
12567
  }
12621
12568
  const COPY_SHEET_COMMAND_ID = "sheet.command.copy-sheet";
12622
12569
  function buildCopySheetMutations(accessor, workbook, worksheet, unitId, subUnitId, localeService, sheetInterceptorService) {
12623
- var _intercepted$preRedos, _intercepted$preUndos;
12624
12570
  const pluginConfig = accessor.get(IConfigService).getConfig(SHEETS_PLUGIN_CONFIG_KEY);
12625
12571
  const largeSheetConfig = {
12626
12572
  ...defaultLargeSheetOperationConfig,
@@ -12665,7 +12611,7 @@ function buildCopySheetMutations(accessor, workbook, worksheet, unitId, subUnitI
12665
12611
  });
12666
12612
  return {
12667
12613
  redos: [
12668
- ...(_intercepted$preRedos = intercepted.preRedos) !== null && _intercepted$preRedos !== void 0 ? _intercepted$preRedos : [],
12614
+ ...intercepted.preRedos ?? [],
12669
12615
  {
12670
12616
  id: InsertSheetMutation.id,
12671
12617
  params: insertSheetMutationParams
@@ -12673,7 +12619,7 @@ function buildCopySheetMutations(accessor, workbook, worksheet, unitId, subUnitI
12673
12619
  ...intercepted.redos
12674
12620
  ],
12675
12621
  undos: [
12676
- ...(_intercepted$preUndos = intercepted.preUndos) !== null && _intercepted$preUndos !== void 0 ? _intercepted$preUndos : [],
12622
+ ...intercepted.preUndos ?? [],
12677
12623
  {
12678
12624
  id: RemoveSheetMutation.id,
12679
12625
  params: removeSheetMutationParams
@@ -12888,8 +12834,7 @@ const InsertSheetCommand = {
12888
12834
  const sheetName = sheet === null || sheet === void 0 ? void 0 : sheet.name;
12889
12835
  const sheetConfig = mergeWorksheetSnapshotWithDefault(sheet || {});
12890
12836
  if (params) {
12891
- var _params$index;
12892
- index = (_params$index = params.index) !== null && _params$index !== void 0 ? _params$index : index;
12837
+ index = params.index ?? index;
12893
12838
  sheetConfig.id = sheetId || generateRandomId();
12894
12839
  sheetConfig.name = sheetName ? workbook.uniqueSheetName(sheetName) : workbook.generateNewSheetName(`${localeService.t("sheets.tabs.sheet")}`);
12895
12840
  } else {
@@ -13004,7 +12949,6 @@ const RemoveDefinedNameCommand = {
13004
12949
  id: "sheet.command.remove-defined-name",
13005
12950
  type: CommandType.COMMAND,
13006
12951
  handler: (accessor, params) => {
13007
- var _interceptorCommands$, _interceptorCommands$2;
13008
12952
  const commandService = accessor.get(ICommandService);
13009
12953
  const undoRedoService = accessor.get(IUndoRedoService);
13010
12954
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
@@ -13015,7 +12959,7 @@ const RemoveDefinedNameCommand = {
13015
12959
  params
13016
12960
  });
13017
12961
  const redos = [
13018
- ...(_interceptorCommands$ = interceptorCommands.preRedos) !== null && _interceptorCommands$ !== void 0 ? _interceptorCommands$ : [],
12962
+ ...interceptorCommands.preRedos ?? [],
13019
12963
  {
13020
12964
  id: RemoveDefinedNameMutation.id,
13021
12965
  params: removeSheetMutationParams
@@ -13023,7 +12967,7 @@ const RemoveDefinedNameCommand = {
13023
12967
  ...interceptorCommands.redos
13024
12968
  ];
13025
12969
  const undos = [
13026
- ...(_interceptorCommands$2 = interceptorCommands.preUndos) !== null && _interceptorCommands$2 !== void 0 ? _interceptorCommands$2 : [],
12970
+ ...interceptorCommands.preUndos ?? [],
13027
12971
  {
13028
12972
  id: SetDefinedNameMutation.id,
13029
12973
  params: removeSheetMutationParams
@@ -13051,7 +12995,6 @@ const RemoveSheetCommand = {
13051
12995
  id: "sheet.command.remove-sheet",
13052
12996
  type: CommandType.COMMAND,
13053
12997
  handler: (accessor, params) => {
13054
- var _intercepted$preRedos, _intercepted$preUndos;
13055
12998
  const commandService = accessor.get(ICommandService);
13056
12999
  const undoRedoService = accessor.get(IUndoRedoService);
13057
13000
  const univerInstanceService = accessor.get(IUniverInstanceService);
@@ -13081,7 +13024,7 @@ const RemoveSheetCommand = {
13081
13024
  }
13082
13025
  });
13083
13026
  const redos = [
13084
- ...(_intercepted$preRedos = intercepted.preRedos) !== null && _intercepted$preRedos !== void 0 ? _intercepted$preRedos : [],
13027
+ ...intercepted.preRedos ?? [],
13085
13028
  {
13086
13029
  id: RemoveSheetMutation.id,
13087
13030
  params: RemoveSheetMutationParams
@@ -13089,7 +13032,7 @@ const RemoveSheetCommand = {
13089
13032
  ...intercepted.redos
13090
13033
  ];
13091
13034
  const undos = isLargeSheet ? [] : [
13092
- ...(_intercepted$preUndos = intercepted.preUndos) !== null && _intercepted$preUndos !== void 0 ? _intercepted$preUndos : [],
13035
+ ...intercepted.preUndos ?? [],
13093
13036
  {
13094
13037
  id: InsertSheetMutation.id,
13095
13038
  params: InsertSheetMutationParams
@@ -13619,7 +13562,6 @@ const SetSpecificColsVisibleCommand = {
13619
13562
  });
13620
13563
  const interceptedResult = sequenceExecute([...intercepted.redos], commandService);
13621
13564
  if (result.result && interceptedResult.result) {
13622
- var _intercepted$undos, _intercepted$preRedos;
13623
13565
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
13624
13566
  id: SetSpecificColsVisibleCommand.id,
13625
13567
  params
@@ -13636,11 +13578,11 @@ const SetSpecificColsVisibleCommand = {
13636
13578
  id: SetSelectionsOperation.id,
13637
13579
  params: undoSetSelectionsOperationParams
13638
13580
  },
13639
- ...(_intercepted$undos = intercepted.undos) !== null && _intercepted$undos !== void 0 ? _intercepted$undos : [],
13581
+ ...intercepted.undos ?? [],
13640
13582
  ...afterInterceptors.undos
13641
13583
  ],
13642
13584
  redoMutations: [
13643
- ...(_intercepted$preRedos = intercepted.preRedos) !== null && _intercepted$preRedos !== void 0 ? _intercepted$preRedos : [],
13585
+ ...intercepted.preRedos ?? [],
13644
13586
  {
13645
13587
  id: SetColVisibleMutation.id,
13646
13588
  params: redoMutationParams
@@ -13730,7 +13672,6 @@ const SetColHiddenCommand = {
13730
13672
  });
13731
13673
  const interceptedResult = sequenceExecute([...intercepted.redos], commandService);
13732
13674
  if (result.result && interceptedResult.result) {
13733
- var _intercepted$undos2, _intercepted$preRedos2;
13734
13675
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
13735
13676
  id: SetColHiddenCommand.id,
13736
13677
  params: redoMutationParams
@@ -13747,11 +13688,11 @@ const SetColHiddenCommand = {
13747
13688
  id: SetSelectionsOperation.id,
13748
13689
  params: undoSetSelectionsOperationParams
13749
13690
  },
13750
- ...(_intercepted$undos2 = intercepted.undos) !== null && _intercepted$undos2 !== void 0 ? _intercepted$undos2 : [],
13691
+ ...intercepted.undos ?? [],
13751
13692
  ...afterInterceptors.undos
13752
13693
  ],
13753
13694
  redoMutations: [
13754
- ...(_intercepted$preRedos2 = intercepted.preRedos) !== null && _intercepted$preRedos2 !== void 0 ? _intercepted$preRedos2 : [],
13695
+ ...intercepted.preRedos ?? [],
13755
13696
  {
13756
13697
  id: SetColHiddenMutation.id,
13757
13698
  params: redoMutationParams
@@ -13860,7 +13801,6 @@ const SetDefinedNameCommand = {
13860
13801
  id: "sheet.command.set-defined-name",
13861
13802
  type: CommandType.COMMAND,
13862
13803
  handler: (accessor, params) => {
13863
- var _interceptorCommands$, _interceptorCommands$2;
13864
13804
  const commandService = accessor.get(ICommandService);
13865
13805
  const undoRedoService = accessor.get(IUndoRedoService);
13866
13806
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
@@ -13872,7 +13812,7 @@ const SetDefinedNameCommand = {
13872
13812
  params
13873
13813
  });
13874
13814
  const redos = [
13875
- ...(_interceptorCommands$ = interceptorCommands.preRedos) !== null && _interceptorCommands$ !== void 0 ? _interceptorCommands$ : [],
13815
+ ...interceptorCommands.preRedos ?? [],
13876
13816
  ...oldDefinedNameMutationParams ? [{
13877
13817
  id: RemoveDefinedNameMutation.id,
13878
13818
  params: oldDefinedNameMutationParams
@@ -13884,7 +13824,7 @@ const SetDefinedNameCommand = {
13884
13824
  ...interceptorCommands.redos
13885
13825
  ];
13886
13826
  const undos = [
13887
- ...(_interceptorCommands$2 = interceptorCommands.preUndos) !== null && _interceptorCommands$2 !== void 0 ? _interceptorCommands$2 : [],
13827
+ ...interceptorCommands.preUndos ?? [],
13888
13828
  {
13889
13829
  id: RemoveDefinedNameMutation.id,
13890
13830
  params: newDefinedNameMutationParams
@@ -14350,7 +14290,6 @@ const SetSpecificRowsVisibleCommand = {
14350
14290
  });
14351
14291
  const interceptedResult = sequenceExecute([...intercepted.redos], commandService);
14352
14292
  if (result.result && interceptedResult.result) {
14353
- var _intercepted$preUndos, _intercepted$undos, _intercepted$preRedos;
14354
14293
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
14355
14294
  id: SetSpecificRowsVisibleCommand.id,
14356
14295
  params
@@ -14359,7 +14298,7 @@ const SetSpecificRowsVisibleCommand = {
14359
14298
  undoRedoService.pushUndoRedo({
14360
14299
  unitID: unitId,
14361
14300
  undoMutations: [
14362
- ...(_intercepted$preUndos = intercepted.preUndos) !== null && _intercepted$preUndos !== void 0 ? _intercepted$preUndos : [],
14301
+ ...intercepted.preUndos ?? [],
14363
14302
  {
14364
14303
  id: SetRowHiddenMutation.id,
14365
14304
  params: undoMutationParams
@@ -14368,11 +14307,11 @@ const SetSpecificRowsVisibleCommand = {
14368
14307
  id: SetSelectionsOperation.id,
14369
14308
  params: undoSetSelectionsOperationParams
14370
14309
  },
14371
- ...(_intercepted$undos = intercepted.undos) !== null && _intercepted$undos !== void 0 ? _intercepted$undos : [],
14310
+ ...intercepted.undos ?? [],
14372
14311
  ...afterInterceptors.undos
14373
14312
  ],
14374
14313
  redoMutations: [
14375
- ...(_intercepted$preRedos = intercepted.preRedos) !== null && _intercepted$preRedos !== void 0 ? _intercepted$preRedos : [],
14314
+ ...intercepted.preRedos ?? [],
14376
14315
  {
14377
14316
  id: SetRowVisibleMutation.id,
14378
14317
  params: redoMutationParams
@@ -14414,7 +14353,7 @@ const SetRowHiddenCommand = {
14414
14353
  type: CommandType.COMMAND,
14415
14354
  id: "sheet.command.set-rows-hidden",
14416
14355
  handler: (accessor, params) => {
14417
- var _params$ranges, _intercepted$preRedos2;
14356
+ var _params$ranges;
14418
14357
  const selectionManagerService = accessor.get(SheetsSelectionsService);
14419
14358
  const commandService = accessor.get(ICommandService);
14420
14359
  const undoRedoService = accessor.get(IUndoRedoService);
@@ -14456,7 +14395,7 @@ const SetRowHiddenCommand = {
14456
14395
  params: redoMutationParams
14457
14396
  });
14458
14397
  if (sequenceExecute([
14459
- ...(_intercepted$preRedos2 = intercepted.preRedos) !== null && _intercepted$preRedos2 !== void 0 ? _intercepted$preRedos2 : [],
14398
+ ...intercepted.preRedos ?? [],
14460
14399
  {
14461
14400
  id: SetRowHiddenMutation.id,
14462
14401
  params: redoMutationParams
@@ -14467,7 +14406,6 @@ const SetRowHiddenCommand = {
14467
14406
  },
14468
14407
  ...intercepted.redos
14469
14408
  ], commandService).result) {
14470
- var _intercepted$preUndos2, _intercepted$undos2, _intercepted$preRedos3;
14471
14409
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
14472
14410
  id: SetRowHiddenCommand.id,
14473
14411
  params: redoMutationParams
@@ -14476,7 +14414,7 @@ const SetRowHiddenCommand = {
14476
14414
  undoRedoService.pushUndoRedo({
14477
14415
  unitID: unitId,
14478
14416
  undoMutations: [
14479
- ...(_intercepted$preUndos2 = intercepted.preUndos) !== null && _intercepted$preUndos2 !== void 0 ? _intercepted$preUndos2 : [],
14417
+ ...intercepted.preUndos ?? [],
14480
14418
  {
14481
14419
  id: SetRowVisibleMutation.id,
14482
14420
  params: undoMutationParams
@@ -14485,11 +14423,11 @@ const SetRowHiddenCommand = {
14485
14423
  id: SetSelectionsOperation.id,
14486
14424
  params: undoSetSelectionsOperationParams
14487
14425
  },
14488
- ...(_intercepted$undos2 = intercepted.undos) !== null && _intercepted$undos2 !== void 0 ? _intercepted$undos2 : [],
14426
+ ...intercepted.undos ?? [],
14489
14427
  ...afterInterceptors.undos
14490
14428
  ],
14491
14429
  redoMutations: [
14492
- ...(_intercepted$preRedos3 = intercepted.preRedos) !== null && _intercepted$preRedos3 !== void 0 ? _intercepted$preRedos3 : [],
14430
+ ...intercepted.preRedos ?? [],
14493
14431
  {
14494
14432
  id: SetRowHiddenMutation.id,
14495
14433
  params: redoMutationParams
@@ -14661,7 +14599,6 @@ const SetWorkbookNameCommand = {
14661
14599
  type: CommandType.COMMAND,
14662
14600
  id: "sheet.command.set-workbook-name",
14663
14601
  handler: (accessor, params) => {
14664
- var _interceptedCommands$;
14665
14602
  const commandService = accessor.get(ICommandService);
14666
14603
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
14667
14604
  if (!getSheetCommandTargetWorkbook(accessor.get(IUniverInstanceService), params)) return false;
@@ -14674,7 +14611,7 @@ const SetWorkbookNameCommand = {
14674
14611
  unitId: params.unitId
14675
14612
  };
14676
14613
  return sequenceExecute([
14677
- ...(_interceptedCommands$ = interceptedCommands.preRedos) !== null && _interceptedCommands$ !== void 0 ? _interceptedCommands$ : [],
14614
+ ...interceptedCommands.preRedos ?? [],
14678
14615
  {
14679
14616
  id: SetWorkbookNameMutation.id,
14680
14617
  params: redoMutationParams
@@ -14850,7 +14787,6 @@ const SetColWidthCommand = {
14850
14787
  });
14851
14788
  const result = sequenceExecute([...intercepted.redos, ...autoHeightRedos], commandService);
14852
14789
  if (setColWidthResult && result.result) {
14853
- var _intercepted$preUndos, _intercepted$preRedos;
14854
14790
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
14855
14791
  id: SetColWidthCommand.id,
14856
14792
  params: redoMutationParams
@@ -14859,7 +14795,7 @@ const SetColWidthCommand = {
14859
14795
  undoRedoService.pushUndoRedo({
14860
14796
  unitID: unitId,
14861
14797
  undoMutations: [
14862
- ...(_intercepted$preUndos = intercepted.preUndos) !== null && _intercepted$preUndos !== void 0 ? _intercepted$preUndos : [],
14798
+ ...intercepted.preUndos ?? [],
14863
14799
  {
14864
14800
  id: SetWorksheetColWidthMutation.id,
14865
14801
  params: undoMutationParams
@@ -14869,7 +14805,7 @@ const SetColWidthCommand = {
14869
14805
  ...autoHeightUndos
14870
14806
  ],
14871
14807
  redoMutations: [
14872
- ...(_intercepted$preRedos = intercepted.preRedos) !== null && _intercepted$preRedos !== void 0 ? _intercepted$preRedos : [],
14808
+ ...intercepted.preRedos ?? [],
14873
14809
  {
14874
14810
  id: SetWorksheetColWidthMutation.id,
14875
14811
  params: redoMutationParams
@@ -15085,7 +15021,6 @@ const SetWorksheetNameCommand = {
15085
15021
  type: CommandType.COMMAND,
15086
15022
  id: "sheet.command.set-worksheet-name",
15087
15023
  handler: (accessor, params) => {
15088
- var _interceptorCommands$, _interceptorCommands$2;
15089
15024
  const commandService = accessor.get(ICommandService);
15090
15025
  const undoRedoService = accessor.get(IUndoRedoService);
15091
15026
  const sheetInterceptorService = accessor.get(SheetInterceptorService);
@@ -15103,7 +15038,7 @@ const SetWorksheetNameCommand = {
15103
15038
  params
15104
15039
  });
15105
15040
  const redos = [
15106
- ...(_interceptorCommands$ = interceptorCommands.preRedos) !== null && _interceptorCommands$ !== void 0 ? _interceptorCommands$ : [],
15041
+ ...interceptorCommands.preRedos ?? [],
15107
15042
  {
15108
15043
  id: SetWorksheetNameMutation.id,
15109
15044
  params: redoMutationParams
@@ -15111,7 +15046,7 @@ const SetWorksheetNameCommand = {
15111
15046
  ...interceptorCommands.redos
15112
15047
  ];
15113
15048
  const undos = [
15114
- ...(_interceptorCommands$2 = interceptorCommands.preUndos) !== null && _interceptorCommands$2 !== void 0 ? _interceptorCommands$2 : [],
15049
+ ...interceptorCommands.preUndos ?? [],
15115
15050
  {
15116
15051
  id: SetWorksheetNameMutation.id,
15117
15052
  params: undoMutationParams
@@ -16412,10 +16347,7 @@ const SetWorksheetRightToLeftCommand = {
16412
16347
  if (!target) return false;
16413
16348
  const { unitId, subUnitId } = target;
16414
16349
  let rightToLeft = BooleanNumber.FALSE;
16415
- if (params) {
16416
- var _params$rightToLeft;
16417
- rightToLeft = (_params$rightToLeft = params.rightToLeft) !== null && _params$rightToLeft !== void 0 ? _params$rightToLeft : BooleanNumber.FALSE;
16418
- }
16350
+ if (params) rightToLeft = params.rightToLeft ?? BooleanNumber.FALSE;
16419
16351
  const setWorksheetRightToLeftMutationParams = {
16420
16352
  rightToLeft,
16421
16353
  unitId,
@@ -16548,7 +16480,6 @@ const DeltaRowHeightCommand = {
16548
16480
  }], commandService);
16549
16481
  const interceptedResult = sequenceExecute([...intercepted.redos], commandService);
16550
16482
  if (result.result && interceptedResult.result) {
16551
- var _intercepted$preUndos, _intercepted$preRedos;
16552
16483
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
16553
16484
  id: DeltaRowHeightCommand.id,
16554
16485
  params: redoMutationParams
@@ -16557,7 +16488,7 @@ const DeltaRowHeightCommand = {
16557
16488
  undoRedoService.pushUndoRedo({
16558
16489
  unitID: unitId,
16559
16490
  undoMutations: [
16560
- ...(_intercepted$preUndos = intercepted.preUndos) !== null && _intercepted$preUndos !== void 0 ? _intercepted$preUndos : [],
16491
+ ...intercepted.preUndos ?? [],
16561
16492
  {
16562
16493
  id: SetWorksheetRowHeightMutation.id,
16563
16494
  params: undoMutationParams
@@ -16570,7 +16501,7 @@ const DeltaRowHeightCommand = {
16570
16501
  ...afterInterceptors.undos
16571
16502
  ],
16572
16503
  redoMutations: [
16573
- ...(_intercepted$preRedos = intercepted.preRedos) !== null && _intercepted$preRedos !== void 0 ? _intercepted$preRedos : [],
16504
+ ...intercepted.preRedos ?? [],
16574
16505
  {
16575
16506
  id: SetWorksheetRowHeightMutation.id,
16576
16507
  params: redoMutationParams
@@ -16630,7 +16561,6 @@ const SetRowHeightCommand = {
16630
16561
  });
16631
16562
  const sheetInterceptorResult = sequenceExecute([...intercepted.redos], commandService);
16632
16563
  if (result.result && sheetInterceptorResult.result) {
16633
- var _intercepted$preRedos2, _intercepted$preRedos3;
16634
16564
  const afterInterceptors = sheetInterceptorService.afterCommandExecute({
16635
16565
  id: SetRowHeightCommand.id,
16636
16566
  params: redoMutationParams
@@ -16639,7 +16569,7 @@ const SetRowHeightCommand = {
16639
16569
  undoRedoService.pushUndoRedo({
16640
16570
  unitID: unitId,
16641
16571
  undoMutations: [
16642
- ...(_intercepted$preRedos2 = intercepted.preRedos) !== null && _intercepted$preRedos2 !== void 0 ? _intercepted$preRedos2 : [],
16572
+ ...intercepted.preRedos ?? [],
16643
16573
  {
16644
16574
  id: SetWorksheetRowHeightMutation.id,
16645
16575
  params: undoMutationParams
@@ -16652,7 +16582,7 @@ const SetRowHeightCommand = {
16652
16582
  ...afterInterceptors.undos
16653
16583
  ],
16654
16584
  redoMutations: [
16655
- ...(_intercepted$preRedos3 = intercepted.preRedos) !== null && _intercepted$preRedos3 !== void 0 ? _intercepted$preRedos3 : [],
16585
+ ...intercepted.preRedos ?? [],
16656
16586
  {
16657
16587
  id: SetWorksheetRowHeightMutation.id,
16658
16588
  params: redoMutationParams
@@ -17852,14 +17782,14 @@ const effectedByOnlyLocalMutationIds = [
17852
17782
  ];
17853
17783
  let SheetsFreezeSyncController = class SheetsFreezeSyncController extends Disposable {
17854
17784
  constructor(_univerInstanceService, _commandService, _configService) {
17855
- var _this$_configService$, _this$_configService$2;
17785
+ var _this$_configService$;
17856
17786
  super();
17857
17787
  this._univerInstanceService = _univerInstanceService;
17858
17788
  this._commandService = _commandService;
17859
17789
  this._configService = _configService;
17860
17790
  _defineProperty(this, "_d", new DisposableCollection());
17861
17791
  _defineProperty(this, "_enabled", true);
17862
- const freezeSync = (_this$_configService$ = (_this$_configService$2 = this._configService.getConfig("sheets.config")) === null || _this$_configService$2 === void 0 ? void 0 : _this$_configService$2.freezeSync) !== null && _this$_configService$ !== void 0 ? _this$_configService$ : true;
17792
+ const freezeSync = ((_this$_configService$ = this._configService.getConfig("sheets.config")) === null || _this$_configService$ === void 0 ? void 0 : _this$_configService$.freezeSync) ?? true;
17863
17793
  this.setEnabled(freezeSync);
17864
17794
  }
17865
17795
  getEnabled() {
@@ -18279,7 +18209,7 @@ let SheetPermissionCheckController = class SheetPermissionCheckController extend
18279
18209
  })) return false;
18280
18210
  if (rangeTypes && rangeTypes.length > 0) {
18281
18211
  var _this$_selectionManag;
18282
- const ranges = selectionRanges !== null && selectionRanges !== void 0 ? selectionRanges : (_this$_selectionManag = this._selectionManagerService.getCurrentSelections()) === null || _this$_selectionManag === void 0 ? void 0 : _this$_selectionManag.map((s) => s.range);
18212
+ const ranges = selectionRanges ?? ((_this$_selectionManag = this._selectionManagerService.getCurrentSelections()) === null || _this$_selectionManag === void 0 ? void 0 : _this$_selectionManag.map((s) => s.range));
18283
18213
  if (!ranges) return false;
18284
18214
  const rules = this._rangeProtectionRuleModel.getSubunitRuleList(_unitId, _subUnitId);
18285
18215
  if (rules.length === 0) return true;
@@ -18496,11 +18426,11 @@ let SheetPermissionCheckController = class SheetPermissionCheckController extend
18496
18426
  return true;
18497
18427
  }
18498
18428
  _permissionCheckWithInsertOrDeleteMoveRange(direction, params) {
18499
- var _params$range, _this$_selectionManag3;
18429
+ var _this$_selectionManag3;
18500
18430
  const target = getSheetCommandTarget(this._univerInstanceService);
18501
18431
  if (!target) return false;
18502
18432
  const { worksheet, unitId, subUnitId } = target;
18503
- const range = (_params$range = params === null || params === void 0 ? void 0 : params.range) !== null && _params$range !== void 0 ? _params$range : (_this$_selectionManag3 = this._selectionManagerService.getCurrentLastSelection()) === null || _this$_selectionManag3 === void 0 ? void 0 : _this$_selectionManag3.range;
18433
+ const range = (params === null || params === void 0 ? void 0 : params.range) ?? ((_this$_selectionManag3 = this._selectionManagerService.getCurrentLastSelection()) === null || _this$_selectionManag3 === void 0 ? void 0 : _this$_selectionManag3.range);
18504
18434
  if (!range) return false;
18505
18435
  if (!this.permissionCheckWithRanges({
18506
18436
  workbookTypes: [WorkbookEditablePermission],
@@ -19084,10 +19014,9 @@ let RangeProtectionRenderModel = class RangeProtectionRenderModel extends Dispos
19084
19014
  const result = [];
19085
19015
  for (const rule of ruleMap) if (rule.ranges.some((range) => range.startRow <= row && range.endRow >= row && range.startColumn <= col && range.endColumn >= col)) {
19086
19016
  const permissionMap = getAllRangePermissionPoint().reduce((result, F) => {
19087
- var _permission$value;
19088
19017
  const instance = new F(unitId, subUnitId, rule.permissionId);
19089
19018
  const permission = this._permissionService.getPermissionPoint(instance.id);
19090
- result[instance.subType] = (_permission$value = permission === null || permission === void 0 ? void 0 : permission.value) !== null && _permission$value !== void 0 ? _permission$value : instance.value;
19019
+ result[instance.subType] = (permission === null || permission === void 0 ? void 0 : permission.value) ?? instance.value;
19091
19020
  return result;
19092
19021
  }, {});
19093
19022
  result.push({
@@ -19243,11 +19172,11 @@ let RangeProtectionCache = class RangeProtectionCache extends Disposable {
19243
19172
  this._permissionIdCache.delete(rule.permissionId);
19244
19173
  }
19245
19174
  _getSelectionActions(unitId, subUnitId, rule) {
19246
- var _this$_permissionServ, _this$_permissionServ2, _RangeProtectionPermi, _this$_permissionServ3, _this$_permissionServ4, _RangeProtectionPermi2, _this$_permissionServ5, _this$_permissionServ6, _RangeProtectionPermi3, _this$_permissionServ7, _this$_permissionServ8, _RangeProtectionPermi4;
19247
- const edit = (_this$_permissionServ = (_this$_permissionServ2 = this._permissionService.getPermissionPoint((_RangeProtectionPermi = new RangeProtectionPermissionEditPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi === void 0 ? void 0 : _RangeProtectionPermi.id)) === null || _this$_permissionServ2 === void 0 ? void 0 : _this$_permissionServ2.value) !== null && _this$_permissionServ !== void 0 ? _this$_permissionServ : false;
19248
- const view = (_this$_permissionServ3 = (_this$_permissionServ4 = this._permissionService.getPermissionPoint((_RangeProtectionPermi2 = new RangeProtectionPermissionViewPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi2 === void 0 ? void 0 : _RangeProtectionPermi2.id)) === null || _this$_permissionServ4 === void 0 ? void 0 : _this$_permissionServ4.value) !== null && _this$_permissionServ3 !== void 0 ? _this$_permissionServ3 : false;
19249
- const manageProtection = (_this$_permissionServ5 = (_this$_permissionServ6 = this._permissionService.getPermissionPoint((_RangeProtectionPermi3 = new RangeProtectionPermissionManageCollaPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi3 === void 0 ? void 0 : _RangeProtectionPermi3.id)) === null || _this$_permissionServ6 === void 0 ? void 0 : _this$_permissionServ6.value) !== null && _this$_permissionServ5 !== void 0 ? _this$_permissionServ5 : false;
19250
- const deleteProtection = (_this$_permissionServ7 = (_this$_permissionServ8 = this._permissionService.getPermissionPoint((_RangeProtectionPermi4 = new RangeProtectionPermissionDeleteProtectionPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi4 === void 0 ? void 0 : _RangeProtectionPermi4.id)) === null || _this$_permissionServ8 === void 0 ? void 0 : _this$_permissionServ8.value) !== null && _this$_permissionServ7 !== void 0 ? _this$_permissionServ7 : false;
19175
+ var _this$_permissionServ, _RangeProtectionPermi, _this$_permissionServ2, _RangeProtectionPermi2, _this$_permissionServ3, _RangeProtectionPermi3, _this$_permissionServ4, _RangeProtectionPermi4;
19176
+ const edit = ((_this$_permissionServ = this._permissionService.getPermissionPoint((_RangeProtectionPermi = new RangeProtectionPermissionEditPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi === void 0 ? void 0 : _RangeProtectionPermi.id)) === null || _this$_permissionServ === void 0 ? void 0 : _this$_permissionServ.value) ?? false;
19177
+ const view = ((_this$_permissionServ2 = this._permissionService.getPermissionPoint((_RangeProtectionPermi2 = new RangeProtectionPermissionViewPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi2 === void 0 ? void 0 : _RangeProtectionPermi2.id)) === null || _this$_permissionServ2 === void 0 ? void 0 : _this$_permissionServ2.value) ?? false;
19178
+ const manageProtection = ((_this$_permissionServ3 = this._permissionService.getPermissionPoint((_RangeProtectionPermi3 = new RangeProtectionPermissionManageCollaPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi3 === void 0 ? void 0 : _RangeProtectionPermi3.id)) === null || _this$_permissionServ3 === void 0 ? void 0 : _this$_permissionServ3.value) ?? false;
19179
+ const deleteProtection = ((_this$_permissionServ4 = this._permissionService.getPermissionPoint((_RangeProtectionPermi4 = new RangeProtectionPermissionDeleteProtectionPoint(unitId, subUnitId, rule.permissionId)) === null || _RangeProtectionPermi4 === void 0 ? void 0 : _RangeProtectionPermi4.id)) === null || _this$_permissionServ4 === void 0 ? void 0 : _this$_permissionServ4.value) ?? false;
19251
19180
  return {
19252
19181
  [UnitAction.Edit]: edit,
19253
19182
  [UnitAction.View]: view,
@@ -19395,7 +19324,7 @@ RangeProtectionCache = __decorate([
19395
19324
  //#endregion
19396
19325
  //#region package.json
19397
19326
  var name = "@univerjs/sheets";
19398
- var version = "1.0.0-alpha.8";
19327
+ var version = "1.0.0-beta.0";
19399
19328
 
19400
19329
  //#endregion
19401
19330
  //#region src/controllers/active-worksheet.controller.ts
@@ -19502,7 +19431,6 @@ const ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY = "ONLY_REGISTER_FORMULA_RELAT
19502
19431
  //#region src/controllers/basic-worksheet.controller.ts
19503
19432
  let BasicWorksheetController = class BasicWorksheetController extends Disposable {
19504
19433
  constructor(_commandService, _configService, _dataSyncPrimaryController) {
19505
- var _this$_configService$;
19506
19434
  super();
19507
19435
  this._commandService = _commandService;
19508
19436
  this._configService = _configService;
@@ -19544,7 +19472,7 @@ let BasicWorksheetController = class BasicWorksheetController extends Disposable
19544
19472
  this._commandService.registerCommand(mutation);
19545
19473
  (_this$_dataSyncPrimar = this._dataSyncPrimaryController) === null || _this$_dataSyncPrimar === void 0 || _this$_dataSyncPrimar.registerSyncingMutations(mutation);
19546
19474
  });
19547
- if (!((_this$_configService$ = this._configService.getConfig("ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY")) !== null && _this$_configService$ !== void 0 ? _this$_configService$ : false)) [
19475
+ if (!(this._configService.getConfig("ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY") ?? false)) [
19548
19476
  AddWorksheetMergeCommand,
19549
19477
  AddWorksheetMergeAllCommand,
19550
19478
  AddWorksheetMergeVerticalCommand,
@@ -19782,10 +19710,10 @@ let SheetPermissionViewModelController = class SheetPermissionViewModelControlle
19782
19710
  const { unitId, subUnitId } = context;
19783
19711
  const worksheetRule = this._worksheetProtectionRuleModel.getRule(unitId, subUnitId);
19784
19712
  if (worksheetRule === null || worksheetRule === void 0 ? void 0 : worksheetRule.permissionId) {
19785
- var _this$_permissionServ, _this$_permissionServ2, _this$_permissionServ3, _this$_permissionServ4, _selectionProtection$;
19713
+ var _this$_permissionServ, _this$_permissionServ2, _selectionProtection$;
19786
19714
  const selectionProtection = [{
19787
- [UnitAction.View]: (_this$_permissionServ = (_this$_permissionServ2 = this._permissionService.getPermissionPoint(new WorksheetViewPermission(unitId, subUnitId).id)) === null || _this$_permissionServ2 === void 0 ? void 0 : _this$_permissionServ2.value) !== null && _this$_permissionServ !== void 0 ? _this$_permissionServ : false,
19788
- [UnitAction.Edit]: (_this$_permissionServ3 = (_this$_permissionServ4 = this._permissionService.getPermissionPoint(new WorksheetEditPermission(unitId, subUnitId).id)) === null || _this$_permissionServ4 === void 0 ? void 0 : _this$_permissionServ4.value) !== null && _this$_permissionServ3 !== void 0 ? _this$_permissionServ3 : false
19715
+ [UnitAction.View]: ((_this$_permissionServ = this._permissionService.getPermissionPoint(new WorksheetViewPermission(unitId, subUnitId).id)) === null || _this$_permissionServ === void 0 ? void 0 : _this$_permissionServ.value) ?? false,
19716
+ [UnitAction.Edit]: ((_this$_permissionServ2 = this._permissionService.getPermissionPoint(new WorksheetEditPermission(unitId, subUnitId).id)) === null || _this$_permissionServ2 === void 0 ? void 0 : _this$_permissionServ2.value) ?? false
19789
19717
  }];
19790
19718
  const isSkipRender = !((_selectionProtection$ = selectionProtection[0]) === null || _selectionProtection$ === void 0 ? void 0 : _selectionProtection$[UnitAction.View]);
19791
19719
  const _cellData = !cell || cell === context.rawData ? { ...cell } : cell;
@@ -21347,4 +21275,4 @@ function convertPositionCellToSheetOverGrid(unitId, subUnitId, cellOverGridPosit
21347
21275
  }
21348
21276
 
21349
21277
  //#endregion
21350
- export { AFFECT_LAYOUT_STYLES, AFTER_CELL_EDIT, AUTO_FILL_APPLY_TYPE, AUTO_FILL_DATA_TYPE, AUTO_FILL_HOOK_TYPE, AddMergeRedoSelectionsOperationFactory, AddMergeUndoMutationFactory, AddMergeUndoSelectionsOperationFactory, AddRangeProtectionCommand, AddRangeProtectionMutation, AddRangeThemeMutation, AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeMutation, AddWorksheetMergeVerticalCommand, AddWorksheetProtectionCommand, AddWorksheetProtectionMutation, AppendRowCommand, AutoClearContentCommand, AutoFillCommand, AutoFillController, AutoFillRules, AutoFillService, AutoFillTools, BEFORE_CELL_EDIT, BorderStyleManagerService, COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, CalculateResultApplyController, CancelFrozenCommand, CancelMarkDirtyRowAutoHeightOperation, ClearSelectionAllCommand, ClearSelectionContentCommand, ClearSelectionFormatCommand, CopySheetCommand, CopyWorksheetEndMutation, DISABLE_NORMAL_SELECTIONS, DefinedNameDataController, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, DeleteRangeProtectionCommand, DeleteRangeProtectionMutation, DeleteWorksheetProtectionCommand, DeleteWorksheetProtectionMutation, DeleteWorksheetRangeThemeStyleCommand, DeleteWorksheetRangeThemeStyleMutation, DeleteWorksheetRangeThemeStyleMutationFactory, DeltaColumnWidthCommand, DeltaRowHeightCommand, EditStateEnum, EffectRefRangId, EmptyMutation, ExclusiveRangeService, FactoryAddRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, FactorySetRangeProtectionMutation, IAutoFillService, IExclusiveRangeService, INTERCEPTOR_POINT, INumfmtService, IRefSelectionsService, InsertColAfterCommand, InsertColBeforeCommand, InsertColByRangeCommand, InsertColCommand, InsertColMutation, InsertColMutationUndoFactory, InsertDefinedNameCommand, InsertMultiColsLeftCommand, InsertMultiColsRightCommand, InsertMultiRowsAboveCommand, InsertMultiRowsAfterCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowByRangeCommand, InsertRowCommand, InsertRowMutation, InsertRowMutationUndoFactory, InsertSheetCommand, InsertSheetMutation, InsertSheetUndoMutationFactory, InterceptCellContentPriority, MAX_CELL_PER_SHEET_KEY, MERGE_CELL_INTERCEPTOR_CHECK, MarkDirtyFilterChangeMutation, MarkDirtyRowAutoHeightOperation, MergeCellController, MoveColsCommand, MoveColsMutation, MoveColsMutationUndoFactory, MoveRangeCommand, MoveRangeMutation, MoveRowsCommand, MoveRowsMutation, MoveRowsMutationUndoFactory, NumfmtService, OperatorType, PermissionPointsDefinitions, REF_SELECTIONS_ENABLED, RangeMergeUtil, RangeProtectionCache, RangeProtectionPermissionDeleteProtectionPoint, RangeProtectionPermissionEditPoint, RangeProtectionPermissionManageCollaPoint, RangeProtectionPermissionViewPoint, RangeProtectionRefRangeService, RangeProtectionRenderModel, RangeProtectionRuleModel, RangeProtectionService, RangeThemeStyle, RefRangeService, RefSelectionsService, RefillCommand, RegisterWorksheetRangeThemeStyleCommand, RegisterWorksheetRangeThemeStyleMutation, RemoveColByRangeCommand, RemoveColCommand, RemoveColMutation, RemoveDefinedNameCommand, RemoveMergeUndoMutationFactory, RemoveNumfmtMutation, RemoveRangeThemeMutation, RemoveRowByRangeCommand, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, RemoveSheetMutation, RemoveSheetUndoMutationFactory, RemoveWorksheetMergeCommand, RemoveWorksheetMergeMutation, ReorderRangeCommand, ReorderRangeMutation, ReorderRangeUndoMutationFactory, ResetBackgroundColorCommand, ResetTextColorCommand, SCOPE_WORKBOOK_VALUE_DEFINED_NAME, SELECTIONS_ENABLED, SELECTION_CONTROL_BORDER_BUFFER_COLOR, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, SHEETS_PLUGIN_CONFIG_KEY, ScrollToCellOperation, SelectRangeCommand, SelectionMoveType, SetBackgroundColorCommand, SetBoldCommand, SetBorderBasicCommand, SetBorderColorCommand, SetBorderCommand, SetBorderPositionCommand, SetBorderStyleCommand, SetColDataCommand, SetColDataMutation, SetColDataMutationFactory, SetColHiddenCommand, SetColHiddenMutation, SetColVisibleMutation, SetColWidthCommand, SetDefinedNameCommand, SetFontFamilyCommand, SetFontSizeCommand, SetFrozenCommand, SetFrozenMutation, SetFrozenMutationFactory, SetGridlinesColorCommand, SetGridlinesColorMutation, SetHorizontalTextAlignCommand, SetItalicCommand, SetNumfmtMutation, SetOverlineCommand, SetProtectionCommand, SetRangeCustomMetadataCommand, SetRangeProtectionMutation, SetRangeThemeMutation, SetRangeValuesCommand, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SetRowDataCommand, SetRowDataMutation, SetRowDataMutationFactory, SetRowHeightCommand, SetRowHiddenCommand, SetRowHiddenMutation, SetRowVisibleMutation, SetSelectedColsVisibleCommand, SetSelectedRowsVisibleCommand, SetSelectionsOperation, SetShrinkToFitCommand, SetSpecificColsVisibleCommand, SetSpecificRowsVisibleCommand, SetStrikeThroughCommand, SetStyleCommand, SetTabColorCommand, SetTabColorMutation, SetTextColorCommand, SetTextRotationCommand, SetTextWrapCommand, SetUnderlineCommand, SetVerticalTextAlignCommand, SetWorkbookNameCommand, SetWorkbookNameMutation, SetWorksheetActivateCommand, SetWorksheetActiveOperation, SetWorksheetColWidthMutation, SetWorksheetColWidthMutationFactory, SetWorksheetColumnCountCommand, SetWorksheetColumnCountMutation, SetWorksheetColumnCountUndoMutationFactory, SetWorksheetDefaultStyleCommand, SetWorksheetDefaultStyleMutation, SetWorksheetDefaultStyleMutationFactory, SetWorksheetHideCommand, SetWorksheetHideMutation, SetWorksheetNameCommand, SetWorksheetNameMutation, SetWorksheetOrderCommand, SetWorksheetOrderMutation, SetWorksheetPermissionPointsCommand, SetWorksheetPermissionPointsMutation, SetWorksheetProtectionCommand, SetWorksheetProtectionMutation, SetWorksheetRangeThemeStyleCommand, SetWorksheetRangeThemeStyleMutation, SetWorksheetRangeThemeStyleMutationFactory, SetWorksheetRightToLeftCommand, SetWorksheetRightToLeftMutation, SetWorksheetRowAutoHeightMutation, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowCountCommand, SetWorksheetRowCountMutation, SetWorksheetRowCountUndoMutationFactory, SetWorksheetRowHeightMutation, SetWorksheetRowHeightMutationFactory, SetWorksheetRowIsAutoHeightCommand, SetWorksheetRowIsAutoHeightMutation, SetWorksheetRowIsAutoHeightMutationFactory, SetWorksheetShowCommand, SheetCopyDownCommand, SheetCopyRightCommand, SheetInterceptorService, SheetLazyExecuteScheduleService, SheetPermissionCheckController, SheetPermissionInitController, SheetRangeThemeModel, SheetRangeThemeService, SheetSkeletonChangeType, SheetSkeletonService, SheetValueChangeType, SheetsFreezeSyncController, SheetsSelectionsService, SplitDelimiterEnum, SplitTextToColumnsCommand, TextToNumberCommand, ToggleCellCheckboxCommand, ToggleGridlinesCommand, ToggleGridlinesMutation, UniverSheetsPlugin, UnregisterWorksheetRangeThemeStyleCommand, UnregisterWorksheetRangeThemeStyleMutation, VALIDATE_CELL, ViewStateEnum, WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCopySheetPermission, WorkbookCreateProtectPermission, WorkbookCreateSheetPermission, WorkbookDeleteColumnPermission, WorkbookDeleteRowPermission, WorkbookDeleteSheetPermission, WorkbookDuplicatePermission, WorkbookEditablePermission, WorkbookExportPermission, WorkbookHideSheetPermission, WorkbookInsertColumnPermission, WorkbookInsertRowPermission, WorkbookManageCollaboratorPermission, WorkbookMoveSheetPermission, WorkbookPermissionService, WorkbookPrintPermission, WorkbookRecoverHistoryPermission, WorkbookRenameSheetPermission, WorkbookSelectionModel, WorkbookSharePermission, WorkbookViewHistoryPermission, WorkbookViewPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteProtectionPermission, WorksheetDeleteRowPermission, WorksheetEditExtraObjectPermission, WorksheetEditPermission, WorksheetFilterPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetPermissionService, WorksheetPivotTablePermission, WorksheetProtectionPointModel, WorksheetProtectionRuleModel, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetSortPermission, WorksheetViewPermission, ZebraCrossingCacheController, addMergeCellsUtil, adjustRangeOnMutation, alignToMergedCellsBorders, attachPrimaryWithCoord, attachRangeWithCoord, attachSelectionWithCoord, baseProtectionActions, checkCellValueType, checkRangesEditablePermission, convertPositionCellToSheetOverGrid, convertPositionSheetOverGridToAbsolute, convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, copyRangeStyles, countCells, createTopMatrixFromMatrix, createTopMatrixFromRanges, defaultLargeSheetOperationConfig, defaultWorkbookPermissionPoints, defaultWorksheetPermissionPoint, deserializeListOptions, discreteRangeToRange, expandToContinuousRange, factoryRemoveNumfmtUndoMutation, factorySetNumfmtUndoMutation, findAllRectangle, findFirstNonEmptyCell, followSelectionOperation, generateNullCell, generateNullCellValue, getAddMergeMutationRangeByType, getAllRangePermissionPoint, getAllWorkbookPermissionPoint, getAllWorksheetPermissionPoint, getAllWorksheetPermissionPointByPointPanel, getCellAtRowCol, getClearContentMutationParamForRange, getClearContentMutationParamsForRanges, getDefaultRangePermission, getInsertRangeMutations, getMoveRangeCommandMutations, getMoveRangeUndoRedoMutations, getNextPrimaryCell, getPrimaryForRange, getRemoveRangeMutations, getSelectionsService, getSeparateEffectedRangesOnCommand, getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationTarget, getSkeletonChangedEffectedRange, getValueChangedEffectedRange, getVisibleRanges, handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleCommonDefaultRangeChangeWithEffectRefCommands, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests, handleDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleDeleteRangeMutation, handleIRemoveCol, handleIRemoveRow, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRangeMutation, handleInsertRow, handleMoveCols, handleMoveRange, handleMoveRows, isSingleCellSelection, rangeMerge, rangeToDiscreteRange, rotateRange, runRefRangeMutations, serializeListOptions, setEndForRange, splitRangeText, transformCellsToRange, validateDefinedName };
21278
+ export { AFFECT_LAYOUT_STYLES, AFTER_CELL_EDIT, AUTO_FILL_APPLY_TYPE, AUTO_FILL_DATA_TYPE, AUTO_FILL_HOOK_TYPE, AddMergeRedoSelectionsOperationFactory, AddMergeUndoMutationFactory, AddMergeUndoSelectionsOperationFactory, AddRangeProtectionCommand, AddRangeProtectionMutation, AddRangeThemeMutation, AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeMutation, AddWorksheetMergeVerticalCommand, AddWorksheetProtectionCommand, AddWorksheetProtectionMutation, AppendRowCommand, AutoClearContentCommand, AutoFillCommand, AutoFillController, AutoFillRules, AutoFillService, AutoFillTools, BEFORE_CELL_EDIT, BorderStyleManagerService, COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, CalculateResultApplyController, CancelFrozenCommand, CancelMarkDirtyRowAutoHeightOperation, ClearSelectionAllCommand, ClearSelectionContentCommand, ClearSelectionFormatCommand, CopySheetCommand, CopyWorksheetEndMutation, DISABLE_NORMAL_SELECTIONS, DefinedNameDataController, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, DeleteRangeProtectionCommand, DeleteRangeProtectionMutation, DeleteWorksheetProtectionCommand, DeleteWorksheetProtectionMutation, DeleteWorksheetRangeThemeStyleCommand, DeleteWorksheetRangeThemeStyleMutation, DeleteWorksheetRangeThemeStyleMutationFactory, DeltaColumnWidthCommand, DeltaRowHeightCommand, EditStateEnum, EffectRefRangId, EmptyMutation, ExclusiveRangeService, FactoryAddRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, FactorySetRangeProtectionMutation, IAutoFillService, IExclusiveRangeService, INTERCEPTOR_POINT, INumfmtService, IRefSelectionsService, InsertColAfterCommand, InsertColBeforeCommand, InsertColByRangeCommand, InsertColCommand, InsertColMutation, InsertColMutationUndoFactory, InsertDefinedNameCommand, InsertMultiColsLeftCommand, InsertMultiColsRightCommand, InsertMultiRowsAboveCommand, InsertMultiRowsAfterCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowByRangeCommand, InsertRowCommand, InsertRowMutation, InsertRowMutationUndoFactory, InsertSheetCommand, InsertSheetMutation, InsertSheetUndoMutationFactory, InterceptCellContentPriority, MAX_CELL_PER_SHEET_KEY, MERGE_CELL_INTERCEPTOR_CHECK, MarkDirtyFilterChangeMutation, MarkDirtyRowAutoHeightOperation, MergeCellController, MoveColsCommand, MoveColsMutation, MoveColsMutationUndoFactory, MoveRangeCommand, MoveRangeMutation, MoveRowsCommand, MoveRowsMutation, MoveRowsMutationUndoFactory, NumfmtService, OperatorType, PermissionPointsDefinitions, REF_SELECTIONS_ENABLED, RangeMergeUtil, RangeProtectionCache, RangeProtectionPermissionDeleteProtectionPoint, RangeProtectionPermissionEditPoint, RangeProtectionPermissionManageCollaPoint, RangeProtectionPermissionViewPoint, RangeProtectionRefRangeService, RangeProtectionRenderModel, RangeProtectionRuleModel, RangeProtectionService, RangeThemeStyle, RefRangeService, RefSelectionsService, RefillCommand, RegisterWorksheetRangeThemeStyleCommand, RegisterWorksheetRangeThemeStyleMutation, RemoveColByRangeCommand, RemoveColCommand, RemoveColMutation, RemoveDefinedNameCommand, RemoveMergeUndoMutationFactory, RemoveNumfmtMutation, RemoveRangeThemeMutation, RemoveRowByRangeCommand, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, RemoveSheetMutation, RemoveSheetUndoMutationFactory, RemoveWorksheetMergeCommand, RemoveWorksheetMergeMutation, ReorderRangeCommand, ReorderRangeMutation, ReorderRangeUndoMutationFactory, ResetBackgroundColorCommand, ResetTextColorCommand, SCOPE_WORKBOOK_VALUE_DEFINED_NAME, SELECTIONS_ENABLED, SELECTION_CONTROL_BORDER_BUFFER_COLOR, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, SHEETS_PLUGIN_CONFIG_KEY, ScrollToCellOperation, SelectRangeCommand, SelectionMoveType, SetBackgroundColorCommand, SetBoldCommand, SetBorderBasicCommand, SetBorderColorCommand, SetBorderCommand, SetBorderPositionCommand, SetBorderStyleCommand, SetColDataCommand, SetColDataMutation, SetColDataMutationFactory, SetColHiddenCommand, SetColHiddenMutation, SetColVisibleMutation, SetColWidthCommand, SetDefinedNameCommand, SetFontFamilyCommand, SetFontSizeCommand, SetFrozenCommand, SetFrozenMutation, SetFrozenMutationFactory, SetGridlinesColorCommand, SetGridlinesColorMutation, SetHorizontalTextAlignCommand, SetItalicCommand, SetNumfmtMutation, SetOverlineCommand, SetProtectionCommand, SetRangeCustomMetadataCommand, SetRangeProtectionMutation, SetRangeThemeMutation, SetRangeValuesCommand, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SetRowDataCommand, SetRowDataMutation, SetRowDataMutationFactory, SetRowHeightCommand, SetRowHiddenCommand, SetRowHiddenMutation, SetRowVisibleMutation, SetSelectedColsVisibleCommand, SetSelectedRowsVisibleCommand, SetSelectionsOperation, SetShrinkToFitCommand, SetSpecificColsVisibleCommand, SetSpecificRowsVisibleCommand, SetStrikeThroughCommand, SetStyleCommand, SetTabColorCommand, SetTabColorMutation, SetTextColorCommand, SetTextRotationCommand, SetTextWrapCommand, SetUnderlineCommand, SetVerticalTextAlignCommand, SetWorkbookNameCommand, SetWorkbookNameMutation, SetWorksheetActivateCommand, SetWorksheetActiveOperation, SetWorksheetColWidthMutation, SetWorksheetColWidthMutationFactory, SetWorksheetColumnCountCommand, SetWorksheetColumnCountMutation, SetWorksheetColumnCountUndoMutationFactory, SetWorksheetDefaultStyleCommand, SetWorksheetDefaultStyleMutation, SetWorksheetDefaultStyleMutationFactory, SetWorksheetHideCommand, SetWorksheetHideMutation, SetWorksheetNameCommand, SetWorksheetNameMutation, SetWorksheetOrderCommand, SetWorksheetOrderMutation, SetWorksheetPermissionPointsCommand, SetWorksheetPermissionPointsMutation, SetWorksheetProtectionCommand, SetWorksheetProtectionMutation, SetWorksheetRangeThemeStyleCommand, SetWorksheetRangeThemeStyleMutation, SetWorksheetRangeThemeStyleMutationFactory, SetWorksheetRightToLeftCommand, SetWorksheetRightToLeftMutation, SetWorksheetRowAutoHeightMutation, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowCountCommand, SetWorksheetRowCountMutation, SetWorksheetRowCountUndoMutationFactory, SetWorksheetRowHeightMutation, SetWorksheetRowHeightMutationFactory, SetWorksheetRowIsAutoHeightCommand, SetWorksheetRowIsAutoHeightMutation, SetWorksheetRowIsAutoHeightMutationFactory, SetWorksheetShowCommand, SheetCopyDownCommand, SheetCopyRightCommand, SheetInterceptorService, SheetLazyExecuteScheduleService, SheetPermissionCheckController, SheetPermissionInitController, SheetRangeThemeModel, SheetRangeThemeService, SheetSkeletonChangeType, SheetSkeletonService, SheetValueChangeType, SheetsFreezeSyncController, SheetsSelectionsService, SplitDelimiterEnum, SplitTextToColumnsCommand, TextToNumberCommand, ToggleCellCheckboxCommand, ToggleGridlinesCommand, ToggleGridlinesMutation, UniverSheetsPlugin, UnregisterWorksheetRangeThemeStyleCommand, UnregisterWorksheetRangeThemeStyleMutation, VALIDATE_CELL, ViewStateEnum, WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCopySheetPermission, WorkbookCreateProtectPermission, WorkbookCreateSheetPermission, WorkbookDeleteColumnPermission, WorkbookDeleteRowPermission, WorkbookDeleteSheetPermission, WorkbookDuplicatePermission, WorkbookEditablePermission, WorkbookExportPermission, WorkbookHideSheetPermission, WorkbookInsertColumnPermission, WorkbookInsertRowPermission, WorkbookManageCollaboratorPermission, WorkbookMoveSheetPermission, WorkbookPermissionService, WorkbookPrintPermission, WorkbookRecoverHistoryPermission, WorkbookRenameSheetPermission, WorkbookSelectionModel, WorkbookSharePermission, WorkbookViewHistoryPermission, WorkbookViewPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteProtectionPermission, WorksheetDeleteRowPermission, WorksheetEditExtraObjectPermission, WorksheetEditPermission, WorksheetFilterPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetPermissionService, WorksheetPivotTablePermission, WorksheetProtectionPointModel, WorksheetProtectionRuleModel, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetSortPermission, WorksheetViewPermission, ZebraCrossingCacheController, addMergeCellsUtil, adjustRangeOnMutation, alignToMergedCellsBorders, attachPrimaryWithCoord, attachRangeWithCoord, attachSelectionWithCoord, baseProtectionActions, checkCellValueType, checkRangesEditablePermission, convertPositionCellToSheetOverGrid, convertPositionSheetOverGridToAbsolute, convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, copyRangeStyles, countCells, createTopMatrixFromMatrix, createTopMatrixFromRanges, defaultLargeSheetOperationConfig, defaultWorkbookPermissionPoints, defaultWorksheetPermissionPoint, deserializeListOptions, discreteRangeToRange, expandToContinuousRange, factoryRemoveNumfmtUndoMutation, factorySetNumfmtUndoMutation, findAllRectangle, findFirstNonEmptyCell, followSelectionOperation, generateNullCell, generateNullCellValue, getAddMergeMutationRangeByType, getAllRangePermissionPoint, getAllWorkbookPermissionPoint, getAllWorksheetPermissionPoint, getAllWorksheetPermissionPointByPointPanel, getCellAtRowCol, getClearContentMutationParamForRange, getClearContentMutationParamsForRanges, getDefaultRangePermission, getInsertRangeMutations, getMoveRangeCommandMutations, getMoveRangeUndoRedoMutations, getNextPrimaryCell, getPrimaryForRange, getRemoveRangeMutations, getSelectionsService, getSeparateEffectedRangesOnCommand, getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationTarget, getSkeletonChangedEffectedRange, getValueChangedEffectedRange, getVisibleRanges, handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleCommonDefaultRangeChangeWithEffectRefCommands, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests, handleDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleDeleteRangeMutation, handleIRemoveCol, handleIRemoveRow, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRangeMutation, handleInsertRow, handleMoveCols, handleMoveRange, handleMoveRows, isCellImage, isSingleCellSelection, rangeMerge, rangeToDiscreteRange, rotateRange, runRefRangeMutations, serializeListOptions, setEndForRange, splitRangeText, transformCellsToRange, validateDefinedName };