Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

flush

jerryb5bd6889f1a8
diff --git a/packages/core/src/Command/ActionBase.ts b/packages/core/src/Command/ActionBase.ts
index 9fcac6544b..f32e0fff5d 100644
--- a/packages/core/src/Command/ActionBase.ts
+++ b/packages/core/src/Command/ActionBase.ts
@@ -1,4 +1,4 @@
-import { ActionObservers } from './ActionObservers';
+import { ActionObservers } from './index';
/**
* Format of action data param
diff --git a/packages/core/src/Command/ActionExtensionFactory.ts b/packages/core/src/Command/ActionExtensionFactory.ts
index 3684f79977..3fbe840410 100644
--- a/packages/core/src/Command/ActionExtensionFactory.ts
+++ b/packages/core/src/Command/ActionExtensionFactory.ts
@@ -1,11 +1,11 @@
-import { IActionData } from './ActionBase';
+import { IActionData } from './index';
import { Plugin } from '../Plugin';
/**
* Manipulate the list of actions in a command
*/
export class BaseActionExtension<T extends Plugin = Plugin> {
- constructor(protected actionDataList: IActionData[], protected _plugin: T) {}
+ constructor(protected actionDataList: IActionData[], protected _plugin: T) { }
getActionDataList(): IActionData[] {
return this.actionDataList;
@@ -22,19 +22,19 @@ export class BaseActionExtension<T extends Plugin = Plugin> {
/**
* Modify the data of action
*/
- setValue() {}
+ setValue() { }
/**
* Execute the core logic after the check is successful
*/
- execute() {}
+ execute() { }
}
/**
* Determine whether to intercept and create BaseActionExtension
*/
export class BaseActionExtensionFactory<T extends Plugin = Plugin> {
- constructor(protected _plugin: T) {}
+ constructor(protected _plugin: T) { }
get zIndex() {
return 0;
diff --git a/packages/core/src/Command/ActionExtensionManager.ts b/packages/core/src/Command/ActionExtensionManager.ts
index 1f0aa5ba82..fba1904c39 100644
--- a/packages/core/src/Command/ActionExtensionManager.ts
+++ b/packages/core/src/Command/ActionExtensionManager.ts
@@ -1,6 +1,8 @@
-import { IActionData } from './ActionBase';
-import { BaseActionExtensionFactory } from './ActionExtensionFactory';
-import { ActionExtensionRegister } from './ActionExtensionRegister';
+import {
+ IActionData,
+ ActionExtensionRegister,
+ BaseActionExtensionFactory,
+} from './index';
export class ActionExtensionManager {
private _actionExtensionFactoryList: BaseActionExtensionFactory[];
diff --git a/packages/core/src/Command/ActionExtensionRegister.ts b/packages/core/src/Command/ActionExtensionRegister.ts
index 41c8f4d815..3a41c4fa47 100644
--- a/packages/core/src/Command/ActionExtensionRegister.ts
+++ b/packages/core/src/Command/ActionExtensionRegister.ts
@@ -1,6 +1,5 @@
import { sortRules } from '../Shared';
-import { BaseActionExtensionFactory } from './ActionExtensionFactory';
-import { REGISTRY_ACTION_FACTORY } from './RegistryFactory';
+import { BaseActionExtensionFactory, REGISTRY_ACTION_FACTORY } from './index';
export class ActionExtensionRegister {
private _actionExtensionFactoryList: BaseActionExtensionFactory[] = [];
diff --git a/packages/core/src/Command/ActionObservers.ts b/packages/core/src/Command/ActionObservers.ts
index c986f6ab3e..27c53cc3e0 100644
--- a/packages/core/src/Command/ActionObservers.ts
+++ b/packages/core/src/Command/ActionObservers.ts
@@ -1,5 +1,5 @@
import { Observable } from '../Observer';
-import { IActionData, ActionBase } from './ActionBase';
+import { IActionData, ActionBase } from './index';
/**
* Action type
@@ -23,4 +23,4 @@ export interface IActionObserverProps {
*
* @beta
*/
-export class ActionObservers extends Observable<IActionObserverProps> {}
+export class ActionObservers extends Observable<IActionObserverProps> { }
diff --git a/packages/core/src/Command/ActionOperation.ts b/packages/core/src/Command/ActionOperation.ts
index d7ae8331e4..73df60536b 100644
--- a/packages/core/src/Command/ActionOperation.ts
+++ b/packages/core/src/Command/ActionOperation.ts
@@ -1,4 +1,4 @@
-import { ActionOperationType, IActionData } from './ActionBase';
+import { ActionOperationType, IActionData } from './index';
export class ActionOperation<T extends IActionData> {
protected _action: T;
diff --git a/packages/core/src/Command/Command.ts b/packages/core/src/Command/Command.ts
index 1661da76c0..82a6ae2241 100644
--- a/packages/core/src/Command/Command.ts
+++ b/packages/core/src/Command/Command.ts
@@ -1,10 +1,14 @@
import { Class, Nullable } from '../Shared';
-import { Workbook } from '../Sheets/Domain';
-import { ActionBase, IActionData } from './ActionBase';
-import { ActionType } from './ActionObservers';
+import { Workbook } from '../Sheets';
+import {
+ ActionBase,
+ IActionData,
+ ActionType,
+ CommandInjector,
+ CommandManager,
+} from './index';
+
import { DocumentModel } from '../Docs/Domain/DocumentModel';
-import { CommandInjector } from './CommandInjectorObservers';
-import { CommandManager } from './CommandManager';
export class CommandUnit {
WorkBookUnit?: Workbook;
diff --git a/packages/core/src/Command/CommandInjectorObservers.ts b/packages/core/src/Command/CommandInjectorObservers.ts
index a7e969a897..9699beafa0 100644
--- a/packages/core/src/Command/CommandInjectorObservers.ts
+++ b/packages/core/src/Command/CommandInjectorObservers.ts
@@ -1,6 +1,6 @@
import { Observable } from '../Observer';
import { Class, Nullable } from '../Shared';
-import { ActionBase, IActionData } from './ActionBase';
+import { ActionBase, IActionData } from './index';
/**
* Command injector, after the core triggers the Command, the plug-in receives the Command WorkBookObserver message, inserts its own Action, and combines it into one Command, which is convenient for undo/redo to be executed as a command.
@@ -16,4 +16,4 @@ export interface CommandInjector {
getActions(): Array<ActionBase<IActionData>>;
}
-export class CommandInjectorObservers extends Observable<CommandInjector> {}
+export class CommandInjectorObservers extends Observable<CommandInjector> { }
diff --git a/packages/core/src/Command/CommandManager.ts b/packages/core/src/Command/CommandManager.ts
index ab2cfbacc9..cd1c17bea9 100644
--- a/packages/core/src/Command/CommandManager.ts
+++ b/packages/core/src/Command/CommandManager.ts
@@ -1,13 +1,16 @@
-import { ActionExtensionManager } from './ActionExtensionManager';
-import { UndoManager } from './UndoManager';
+import {
+ UndoManager,
+ ActionBase,
+ ActionExtensionManager,
+ IActionData,
+ ActionObservers,
+ CommandObservers,
+ CommandInjectorObservers,
+ ActionOperation,
+ Command,
+} from './index';
import { Class } from '../Shared';
-import { ActionBase, IActionData } from './ActionBase';
-import { ActionObservers } from './ActionObservers';
-import { CommandObservers } from './CommandObservers';
-import { CommandInjectorObservers } from './CommandInjectorObservers';
-import { ContextBase } from '../Basics/ContextBase';
-import { Command } from './Command';
-import { ActionOperation } from './ActionOperation';
+import { ContextBase } from '../Basics';
/**
* Manage command
@@ -86,22 +89,18 @@ export class CommandManager {
const { _actionDataList, _unit, _actionList } = command;
// const server = _workbook.getServer();
this._actionExtensionManager.handle(_actionDataList);
-
_actionDataList.forEach((data) => {
const ActionClass = CommandManager.getAction(data.actionName);
const observers = CommandManager.getActionObservers();
const action = new ActionClass(data, _unit, observers);
-
if (ActionOperation.hasUndo(data)) {
_actionList.push(action);
}
});
command.invoke();
-
if (_actionList.length === 0) {
return;
}
-
_undoManager.push(command);
// server.pushMessageQueue(command.getDoData());
}
diff --git a/packages/core/src/Command/CommandObservers.ts b/packages/core/src/Command/CommandObservers.ts
index d418e87cd1..4f9c5975be 100644
--- a/packages/core/src/Command/CommandObservers.ts
+++ b/packages/core/src/Command/CommandObservers.ts
@@ -1,6 +1,5 @@
import { Observable } from '../Observer';
-import { ActionBase, IActionData } from './ActionBase';
-import { ActionType } from './ActionObservers';
+import { ActionBase, IActionData, ActionType } from './index';
/**
* Command observer props
@@ -13,4 +12,4 @@ interface ICommandObserverProps {
/**
* Command observers
*/
-export class CommandObservers extends Observable<ICommandObserverProps> {}
+export class CommandObservers extends Observable<ICommandObserverProps> { }
diff --git a/packages/core/src/Command/DocActionBase.ts b/packages/core/src/Command/DocActionBase.ts
index 54d288eb68..66ebafc702 100644
--- a/packages/core/src/Command/DocActionBase.ts
+++ b/packages/core/src/Command/DocActionBase.ts
@@ -1,9 +1,7 @@
-import { ActionBase, IActionData } from './ActionBase';
+import { ActionBase, IActionData, CommandUnit, ActionObservers } from './index';
import { DocumentModel } from '../Docs/Domain/DocumentModel';
-import { CommandUnit } from './Command';
-import { ActionObservers } from './ActionObservers';
-export interface IDocActionData extends IActionData {}
+export interface IDocActionData extends IActionData { }
export abstract class DocActionBase<
D extends IDocActionData,
diff --git a/packages/core/src/Command/SheetActionBase.ts b/packages/core/src/Command/SheetActionBase.ts
index 987b540e09..4c57a257cc 100644
--- a/packages/core/src/Command/SheetActionBase.ts
+++ b/packages/core/src/Command/SheetActionBase.ts
@@ -1,7 +1,5 @@
import { Workbook, Worksheet } from '../Sheets/Domain';
-import { ActionBase, IActionData } from './ActionBase';
-import { ActionObservers } from './ActionObservers';
-import { CommandUnit } from './Command';
+import { ActionBase, IActionData, ActionObservers, CommandUnit } from './index';
/**
* Format of action data param
diff --git a/packages/core/src/Command/UndoManager.ts b/packages/core/src/Command/UndoManager.ts
index 6294a32e77..5dbf079540 100644
--- a/packages/core/src/Command/UndoManager.ts
+++ b/packages/core/src/Command/UndoManager.ts
@@ -1,4 +1,4 @@
-import { Command } from './Command';
+import { Command } from './index';
/**
* Manage Undo Redo
diff --git a/packages/core/src/Command/index.ts b/packages/core/src/Command/index.ts
index abb33cd68a..e0fe53b910 100644
--- a/packages/core/src/Command/index.ts
+++ b/packages/core/src/Command/index.ts
@@ -1,15 +1,15 @@
-// @index(['./*.ts','./Action/index.ts'], f => `export * from '${f.path}'`)
-export * from './SheetActionBase';
+// @index(['./*.ts','./Action/index.ts'], f => `export * from '${f.path}'`);
+export * from './ActionBase';
export * from './ActionObservers';
-export * from './Command';
+export * from './CommandInjectorObservers';
+export * from './CommandObservers';
export * from './CommandManager';
+export * from './SheetActionBase';
+export * from './Command';
export * from './UndoManager';
export * from './ActionExtensionManager';
export * from './ActionExtensionFactory';
-export * from '../Sheets/Action/index';
+export * from './RegistryFactory';
+export * from './ActionExtensionRegister';
export * from './ActionOperation';
-
-/* eslint-disable import/first */
-import './RegisterAction';
-
// @endindex
diff --git a/packages/core/src/Sheets/Action/AddMergeAction.ts b/packages/core/src/Sheets/Action/AddMergeAction.ts
index 31dab25187..e573756848 100644
--- a/packages/core/src/Sheets/Action/AddMergeAction.ts
+++ b/packages/core/src/Sheets/Action/AddMergeAction.ts
@@ -1,7 +1,7 @@
+import { CommandManager, CommandUnit } from '../../Command';
import { IRangeData } from '../../Interfaces';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
import { IRemoveMergeActionData } from './RemoveMergeAction';
import { addMergeApply, RemoveMergeApply } from '../Apply';
@@ -57,3 +57,5 @@ export class AddMergeAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(AddMergeAction.NAME, AddMergeAction);
diff --git a/packages/core/src/Sheets/Action/AddNamedRangeAction.ts b/packages/core/src/Sheets/Action/AddNamedRangeAction.ts
index 56d7afca48..18836d001b 100644
--- a/packages/core/src/Sheets/Action/AddNamedRangeAction.ts
+++ b/packages/core/src/Sheets/Action/AddNamedRangeAction.ts
@@ -4,12 +4,15 @@ import {
ActionObservers,
ActionType,
CommandUnit,
- DeleteNamedRangeAction,
+ CommandManager,
} from '../../Command';
import { INamedRange } from '../../Interfaces/INamedRange';
import { AddNamedRangeApply } from '../Apply';
import { DeleteNamedRangeApply } from '../Apply/DeleteNamedRange';
-import { IDeleteNamedRangeActionData } from './DeleteNamedRangeAction';
+import {
+ DeleteNamedRangeAction,
+ IDeleteNamedRangeActionData,
+} from './DeleteNamedRangeAction';
export interface IAddNamedRangeActionData extends ISheetActionData {
namedRange: INamedRange;
@@ -80,3 +83,5 @@ export class AddNamedRangeAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(AddNamedRangeAction.NAME, AddNamedRangeAction);
diff --git a/packages/core/src/Sheets/Action/ClearRangeAction.ts b/packages/core/src/Sheets/Action/ClearRangeAction.ts
index 88114c45cc..74066049d6 100644
--- a/packages/core/src/Sheets/Action/ClearRangeAction.ts
+++ b/packages/core/src/Sheets/Action/ClearRangeAction.ts
@@ -4,7 +4,7 @@ import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { ISetRangeDataActionData, SetRangeDataAction } from './SetRangeDataAction';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -81,3 +81,5 @@ export class ClearRangeAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(ClearRangeAction.NAME, ClearRangeAction);
diff --git a/packages/core/src/Sheets/Action/DeleteNamedRangeAction.ts b/packages/core/src/Sheets/Action/DeleteNamedRangeAction.ts
index 9d3584393e..d0109e934d 100644
--- a/packages/core/src/Sheets/Action/DeleteNamedRangeAction.ts
+++ b/packages/core/src/Sheets/Action/DeleteNamedRangeAction.ts
@@ -4,11 +4,14 @@ import {
ActionObservers,
ActionType,
CommandUnit,
- AddNamedRangeAction,
+ CommandManager,
} from '../../Command';
import { AddNamedRangeApply, DeleteNamedRangeApply } from '../Apply';
import { INamedRange } from '../../Interfaces';
-import { IAddNamedRangeActionData } from './AddNamedRangeAction';
+import {
+ AddNamedRangeAction,
+ IAddNamedRangeActionData,
+} from './AddNamedRangeAction';
export interface IDeleteNamedRangeActionData extends ISheetActionData {
namedRangeId: string;
@@ -74,3 +77,5 @@ export class DeleteNamedRangeAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(DeleteNamedRangeAction.NAME, DeleteNamedRangeAction);
diff --git a/packages/core/src/Sheets/Action/DeleteRangeAction.ts b/packages/core/src/Sheets/Action/DeleteRangeAction.ts
index 4569351294..96694dec50 100644
--- a/packages/core/src/Sheets/Action/DeleteRangeAction.ts
+++ b/packages/core/src/Sheets/Action/DeleteRangeAction.ts
@@ -4,7 +4,7 @@ import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { IInsertRangeActionData, InsertRangeAction } from './InsertRangeAction';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
import { DeleteRangeApply, InsertRangeApply } from '../Apply';
/**
@@ -85,3 +85,5 @@ export class DeleteRangeAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(DeleteRangeAction.NAME, DeleteRangeAction);
diff --git a/packages/core/src/Sheets/Action/InsertColumnAction.ts b/packages/core/src/Sheets/Action/InsertColumnAction.ts
index 1d9e36097d..15c84febd4 100644
--- a/packages/core/src/Sheets/Action/InsertColumnAction.ts
+++ b/packages/core/src/Sheets/Action/InsertColumnAction.ts
@@ -2,7 +2,7 @@ import { InsertColumnApply, RemoveColumnApply } from '../Apply';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { IRemoveColumnAction } from './removeColumnAction';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -65,3 +65,5 @@ export class InsertColumnAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(InsertColumnAction.NAME, InsertColumnAction);
diff --git a/packages/core/src/Sheets/Action/InsertColumnDataAction.ts b/packages/core/src/Sheets/Action/InsertColumnDataAction.ts
index 6de8948b0a..456f8098ec 100644
--- a/packages/core/src/Sheets/Action/InsertColumnDataAction.ts
+++ b/packages/core/src/Sheets/Action/InsertColumnDataAction.ts
@@ -1,7 +1,7 @@
import { InsertDataColumnApply, RemoveColumnDataApply } from '../Apply';
import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
import { ObjectArray } from '../../Shared';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ICellData } from '../../Interfaces';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
@@ -69,3 +69,5 @@ export class InsertColumnDataAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(InsertColumnDataAction.NAME, InsertColumnDataAction);
diff --git a/packages/core/src/Sheets/Action/InsertRangeAction.ts b/packages/core/src/Sheets/Action/InsertRangeAction.ts
index 60f9ce5ccc..fd160acb94 100644
--- a/packages/core/src/Sheets/Action/InsertRangeAction.ts
+++ b/packages/core/src/Sheets/Action/InsertRangeAction.ts
@@ -1,11 +1,12 @@
-import { Dimension } from '../../Enum/Dimension';
import { ICellData, IRangeData } from '../../Interfaces';
import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
-import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
-import { ActionObservers, ActionType } from '../../Command/ActionObservers';
+import { Dimension } from '../../Enum/Dimension';
import { IDeleteRangeActionData } from './DeleteRangeAction';
-import { CommandUnit, SetRangeDataAction } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
+import { SetRangeDataAction } from './SetRangeDataAction';
import { DeleteRangeApply, InsertRangeApply } from '../Apply';
+import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
+import { ActionObservers, ActionType } from '../../Command/ActionObservers';
/**
* @internal
@@ -85,3 +86,5 @@ export class InsertRangeAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(InsertRangeAction.NAME, InsertRangeAction);
diff --git a/packages/core/src/Sheets/Action/InsertRowAction.ts b/packages/core/src/Sheets/Action/InsertRowAction.ts
index 545f8e50a6..41cf4b0349 100644
--- a/packages/core/src/Sheets/Action/InsertRowAction.ts
+++ b/packages/core/src/Sheets/Action/InsertRowAction.ts
@@ -4,6 +4,7 @@ import {
ActionObservers,
ActionType,
CommandUnit,
+ CommandManager,
} from '../../Command';
import { InsertRowApply, RemoveRowApply } from '../Apply';
import { IRemoveRowActionData } from './RemoveRowAction';
@@ -69,3 +70,5 @@ export class InsertRowAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(InsertRowAction.NAME, InsertRowAction);
diff --git a/packages/core/src/Sheets/Action/InsertRowDataAction.ts b/packages/core/src/Sheets/Action/InsertRowDataAction.ts
index ef9a4f9eb3..ee75518aca 100644
--- a/packages/core/src/Sheets/Action/InsertRowDataAction.ts
+++ b/packages/core/src/Sheets/Action/InsertRowDataAction.ts
@@ -2,7 +2,7 @@ import { InsertDataRowApply, RemoveRowDataApply } from '../Apply';
import { ICellData } from '../../Interfaces';
import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
import { ObjectArray } from '../../Shared';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { IRemoveRowDataActionData } from './RemoveRowDataAction';
@@ -69,3 +69,5 @@ export class InsertRowDataAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(InsertRowDataAction.NAME, InsertRowDataAction);
diff --git a/packages/core/src/Sheets/Action/InsertSheetAction.ts b/packages/core/src/Sheets/Action/InsertSheetAction.ts
index 641ce3f041..4c79146b03 100644
--- a/packages/core/src/Sheets/Action/InsertSheetAction.ts
+++ b/packages/core/src/Sheets/Action/InsertSheetAction.ts
@@ -1,7 +1,7 @@
import { InsertSheetApply, RemoveSheetApply } from '../Apply';
import { IWorksheetConfig } from '../../Interfaces';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { IRemoveSheetActionData } from './RemoveSheetAction';
@@ -58,3 +58,5 @@ export class InsertSheetAction extends SheetActionBase<
throw new Error('Method not implemented.');
}
}
+
+CommandManager.register(InsertSheetAction.NAME, InsertSheetAction);
diff --git a/packages/core/src/Sheets/Action/RemoveColumnDataAction.ts b/packages/core/src/Sheets/Action/RemoveColumnDataAction.ts
index f4dcad5e77..b32474bf3f 100644
--- a/packages/core/src/Sheets/Action/RemoveColumnDataAction.ts
+++ b/packages/core/src/Sheets/Action/RemoveColumnDataAction.ts
@@ -4,7 +4,7 @@ import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { IInsertColumnDataActionData } from './InsertColumnDataAction';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -68,3 +68,5 @@ export class RemoveColumnDataAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(RemoveColumnDataAction.NAME, RemoveColumnDataAction);
diff --git a/packages/core/src/Sheets/Action/RemoveMergeAction.ts b/packages/core/src/Sheets/Action/RemoveMergeAction.ts
index a0df4e194f..ffddd1d4bf 100644
--- a/packages/core/src/Sheets/Action/RemoveMergeAction.ts
+++ b/packages/core/src/Sheets/Action/RemoveMergeAction.ts
@@ -1,7 +1,7 @@
import { addMergeApply, RemoveMergeApply } from '../Apply';
import { IRangeData } from '../../Interfaces';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { IAddMergeActionData } from './AddMergeAction';
@@ -67,3 +67,5 @@ export class RemoveMergeAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(RemoveMergeAction.NAME, RemoveMergeAction);
diff --git a/packages/core/src/Sheets/Action/RemoveRowAction.ts b/packages/core/src/Sheets/Action/RemoveRowAction.ts
index 88713c925a..0157d7ffb3 100644
--- a/packages/core/src/Sheets/Action/RemoveRowAction.ts
+++ b/packages/core/src/Sheets/Action/RemoveRowAction.ts
@@ -1,6 +1,6 @@
import { InsertRowApply, RemoveRowApply } from '../Apply';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { IInsertRowActionData } from './InsertRowAction';
@@ -67,3 +67,5 @@ export class RemoveRowAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(RemoveRowAction.NAME, RemoveRowAction);
diff --git a/packages/core/src/Sheets/Action/RemoveRowDataAction.ts b/packages/core/src/Sheets/Action/RemoveRowDataAction.ts
index 5439c2b7ef..2d3414f8d8 100644
--- a/packages/core/src/Sheets/Action/RemoveRowDataAction.ts
+++ b/packages/core/src/Sheets/Action/RemoveRowDataAction.ts
@@ -2,7 +2,7 @@ import { InsertDataRowApply, RemoveRowDataApply } from '../Apply';
import { ICellData } from '../../Interfaces';
import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { IInsertRowDataActionData } from './InsertRowDataAction';
@@ -68,3 +68,5 @@ export class RemoveRowDataAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(RemoveRowDataAction.NAME, RemoveRowDataAction);
diff --git a/packages/core/src/Sheets/Action/RemoveSheetAction.ts b/packages/core/src/Sheets/Action/RemoveSheetAction.ts
index 8b5b845a6f..fb25fbfba9 100644
--- a/packages/core/src/Sheets/Action/RemoveSheetAction.ts
+++ b/packages/core/src/Sheets/Action/RemoveSheetAction.ts
@@ -1,6 +1,6 @@
import { InsertSheetApply, RemoveSheetApply } from '../Apply';
import { IWorksheetConfig } from '../../Interfaces';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { IInsertSheetActionData } from './InsertSheetAction';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
@@ -58,3 +58,5 @@ export class RemoveSheetAction extends SheetActionBase<
throw new Error('Method not implemented.');
}
}
+
+CommandManager.register(RemoveSheetAction.NAME, RemoveSheetAction);
diff --git a/packages/core/src/Sheets/Action/SetBorderAction.ts b/packages/core/src/Sheets/Action/SetBorderAction.ts
index 761dd9ad6f..2a8fa41f3f 100644
--- a/packages/core/src/Sheets/Action/SetBorderAction.ts
+++ b/packages/core/src/Sheets/Action/SetBorderAction.ts
@@ -3,7 +3,7 @@ import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase
import { SetBorderApply } from '../Apply';
import { IStyleData } from '../../Interfaces';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -67,3 +67,5 @@ export class SetBorderAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetBorderAction.NAME, SetBorderAction);
diff --git a/packages/core/src/Sheets/Action/SetColumnHideAction.ts b/packages/core/src/Sheets/Action/SetColumnHideAction.ts
index 5e83698be8..2c9c87abcf 100644
--- a/packages/core/src/Sheets/Action/SetColumnHideAction.ts
+++ b/packages/core/src/Sheets/Action/SetColumnHideAction.ts
@@ -2,7 +2,7 @@ import { SetColumnHideApply, SetColumnShowApply } from '../Apply';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { ISetColumnShowActionData } from './SetColumnShowAction';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -65,3 +65,5 @@ export class SetColumnHideAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetColumnHideAction.NAME, SetColumnHideAction);
diff --git a/packages/core/src/Sheets/Action/SetColumnShowAction.ts b/packages/core/src/Sheets/Action/SetColumnShowAction.ts
index 1c54fdfcb5..199d2dc907 100644
--- a/packages/core/src/Sheets/Action/SetColumnShowAction.ts
+++ b/packages/core/src/Sheets/Action/SetColumnShowAction.ts
@@ -1,7 +1,7 @@
import { SetColumnHideApply, SetColumnShowApply } from '../Apply';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -61,3 +61,5 @@ export class SetColumnShowAction extends SheetActionBase<ISetColumnShowActionDat
return false;
}
}
+
+CommandManager.register(SetColumnShowAction.NAME, SetColumnShowAction);
diff --git a/packages/core/src/Sheets/Action/SetColumnWidthAction.ts b/packages/core/src/Sheets/Action/SetColumnWidthAction.ts
index 167dccd526..9bd7a7ee16 100644
--- a/packages/core/src/Sheets/Action/SetColumnWidthAction.ts
+++ b/packages/core/src/Sheets/Action/SetColumnWidthAction.ts
@@ -1,6 +1,6 @@
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
import { SetColumnWidthApply } from '../Apply';
/**
@@ -63,3 +63,5 @@ export class SetColumnWidthAction extends SheetActionBase<ISetColumnWidthActionD
return false;
}
}
+
+CommandManager.register(SetColumnWidthAction.NAME, SetColumnWidthAction);
diff --git a/packages/core/src/Sheets/Action/SetHiddenGridlinesAction.ts b/packages/core/src/Sheets/Action/SetHiddenGridlinesAction.ts
index 1f0b370f66..68f1fe8e62 100644
--- a/packages/core/src/Sheets/Action/SetHiddenGridlinesAction.ts
+++ b/packages/core/src/Sheets/Action/SetHiddenGridlinesAction.ts
@@ -1,7 +1,7 @@
import { SetHiddenGridlinesApply } from '../Apply';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -63,3 +63,5 @@ export class SetHiddenGridlinesAction extends SheetActionBase<ISetHiddenGridline
return false;
}
}
+
+CommandManager.register(SetHiddenGridlinesAction.NAME, SetHiddenGridlinesAction);
diff --git a/packages/core/src/Sheets/Action/SetNamedRangeAction.ts b/packages/core/src/Sheets/Action/SetNamedRangeAction.ts
index c6015ead54..78ab38290c 100644
--- a/packages/core/src/Sheets/Action/SetNamedRangeAction.ts
+++ b/packages/core/src/Sheets/Action/SetNamedRangeAction.ts
@@ -4,6 +4,7 @@ import {
ActionObservers,
ActionType,
CommandUnit,
+ CommandManager,
} from '../../Command';
import { SetNamedRangeApply } from '../Apply';
import { INamedRange } from '../../Interfaces';
@@ -79,3 +80,5 @@ export class SetNamedRangeAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetNamedRangeAction.NAME, SetNamedRangeAction);
diff --git a/packages/core/src/Sheets/Action/SetRangeDataAction.ts b/packages/core/src/Sheets/Action/SetRangeDataAction.ts
index 97c6281d94..372e9e2c63 100644
--- a/packages/core/src/Sheets/Action/SetRangeDataAction.ts
+++ b/packages/core/src/Sheets/Action/SetRangeDataAction.ts
@@ -6,6 +6,7 @@ import {
ActionObservers,
ActionType,
CommandUnit,
+ CommandManager,
} from '../../Command';
import { ICopyToOptionsData, ICellData } from '../../Interfaces';
@@ -100,3 +101,5 @@ export class SetRangeDataAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetRangeDataAction.NAME, SetRangeDataAction);
diff --git a/packages/core/src/Sheets/Action/SetRangeFormatAction.ts b/packages/core/src/Sheets/Action/SetRangeFormatAction.ts
index b4d6c8d97d..4f854bfad6 100644
--- a/packages/core/src/Sheets/Action/SetRangeFormatAction.ts
+++ b/packages/core/src/Sheets/Action/SetRangeFormatAction.ts
@@ -3,7 +3,7 @@ import { IRangeData } from '../../Interfaces';
import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -102,3 +102,5 @@ export class SetRangeFormatAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetRangeFormatAction.NAME, SetRangeFormatAction);
diff --git a/packages/core/src/Sheets/Action/SetRangeFormattedValueAction.ts b/packages/core/src/Sheets/Action/SetRangeFormattedValueAction.ts
index 6efb247087..1b1f0fa073 100644
--- a/packages/core/src/Sheets/Action/SetRangeFormattedValueAction.ts
+++ b/packages/core/src/Sheets/Action/SetRangeFormattedValueAction.ts
@@ -3,7 +3,8 @@ import { ICellV, IRangeData } from '../../Interfaces';
import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit, SetRangeDataAction } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
+import { SetRangeDataAction } from './SetRangeDataAction';
/**
*
@@ -100,3 +101,8 @@ export class SetRangeFormattedValueAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(
+ SetRangeFormattedValueAction.NAME,
+ SetRangeFormattedValueAction
+);
diff --git a/packages/core/src/Sheets/Action/SetRangeFormulaAction.ts b/packages/core/src/Sheets/Action/SetRangeFormulaAction.ts
index 7b731f0382..a2788a9dec 100644
--- a/packages/core/src/Sheets/Action/SetRangeFormulaAction.ts
+++ b/packages/core/src/Sheets/Action/SetRangeFormulaAction.ts
@@ -3,7 +3,7 @@ import { IRangeData } from '../../Interfaces';
import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -100,3 +100,5 @@ export class SetRangeFormulaAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetRangeFormulaAction.NAME, SetRangeFormulaAction);
diff --git a/packages/core/src/Sheets/Action/SetRangeNoteAction.ts b/packages/core/src/Sheets/Action/SetRangeNoteAction.ts
index 3d42057ea1..1ddc9b240f 100644
--- a/packages/core/src/Sheets/Action/SetRangeNoteAction.ts
+++ b/packages/core/src/Sheets/Action/SetRangeNoteAction.ts
@@ -3,7 +3,7 @@ import { IRangeData } from '../../Interfaces';
import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -99,3 +99,5 @@ export class SetRangeNoteAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetRangeNoteAction.NAME, SetRangeNoteAction);
diff --git a/packages/core/src/Sheets/Action/SetRangeStyleAction.ts b/packages/core/src/Sheets/Action/SetRangeStyleAction.ts
index 1c23b43924..d72ac22d06 100644
--- a/packages/core/src/Sheets/Action/SetRangeStyleAction.ts
+++ b/packages/core/src/Sheets/Action/SetRangeStyleAction.ts
@@ -3,7 +3,7 @@ import { IRangeData, IStyleData } from '../../Interfaces';
import { ObjectMatrixPrimitiveType } from '../../Shared/ObjectMatrix';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
export interface ISetRangeStyleActionData extends ISheetActionData {
value: ObjectMatrixPrimitiveType<IStyleData>; //
@@ -85,3 +85,5 @@ export class SetRangeStyleAction extends SheetActionBase<ISetRangeStyleActionDat
return false;
}
}
+
+CommandManager.register(SetRangeStyleAction.NAME, SetRangeStyleAction);
diff --git a/packages/core/src/Sheets/Action/SetRightToLeftAction.ts b/packages/core/src/Sheets/Action/SetRightToLeftAction.ts
index 2668677cc4..19349968c0 100644
--- a/packages/core/src/Sheets/Action/SetRightToLeftAction.ts
+++ b/packages/core/src/Sheets/Action/SetRightToLeftAction.ts
@@ -2,7 +2,7 @@ import { SetRightToLeft } from '../Apply';
import { BooleanNumber } from '../../Enum';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -67,3 +67,5 @@ export class SetRightToLeftAction extends SheetActionBase<ISetRightToLeftActionD
return false;
}
}
+
+CommandManager.register(SetRightToLeftAction.NAME, SetRightToLeftAction);
diff --git a/packages/core/src/Sheets/Action/SetRowHeightAction.ts b/packages/core/src/Sheets/Action/SetRowHeightAction.ts
index a9ee335999..8b7175a3b9 100644
--- a/packages/core/src/Sheets/Action/SetRowHeightAction.ts
+++ b/packages/core/src/Sheets/Action/SetRowHeightAction.ts
@@ -1,7 +1,7 @@
import { SetRowHeight } from '../Apply';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -79,3 +79,5 @@ export class SetRowHeightAction extends SheetActionBase<ISetRowHeightActionData>
return false;
}
}
+
+CommandManager.register(SetRowHeightAction.NAME, SetRowHeightAction);
diff --git a/packages/core/src/Sheets/Action/SetRowHideAction.ts b/packages/core/src/Sheets/Action/SetRowHideAction.ts
index 60d93e28fd..514046ec4e 100644
--- a/packages/core/src/Sheets/Action/SetRowHideAction.ts
+++ b/packages/core/src/Sheets/Action/SetRowHideAction.ts
@@ -2,7 +2,7 @@ import { SetHideRow, SetShowRow } from '../Apply';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { ISetRowShowActionData } from './SetRowShowAction';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -79,3 +79,5 @@ export class SetRowHideAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetRowHideAction.NAME, SetRowHideAction);
diff --git a/packages/core/src/Sheets/Action/SetRowShowAction.ts b/packages/core/src/Sheets/Action/SetRowShowAction.ts
index f7d2a995e5..78d89f2850 100644
--- a/packages/core/src/Sheets/Action/SetRowShowAction.ts
+++ b/packages/core/src/Sheets/Action/SetRowShowAction.ts
@@ -1,7 +1,7 @@
import { SetHideRow, SetShowRow } from '../Apply';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -73,3 +73,5 @@ export class SetRowShowAction extends SheetActionBase<ISetRowShowActionData> {
return false;
}
}
+
+CommandManager.register(SetRowShowAction.NAME, SetRowShowAction);
diff --git a/packages/core/src/Sheets/Action/SetSelectionActivateAction.ts b/packages/core/src/Sheets/Action/SetSelectionActivateAction.ts
index 739e863a04..3f3ce46b82 100644
--- a/packages/core/src/Sheets/Action/SetSelectionActivateAction.ts
+++ b/packages/core/src/Sheets/Action/SetSelectionActivateAction.ts
@@ -2,7 +2,7 @@ import { IRangeData } from '../../Interfaces';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { SetSelectionActivate } from '../Apply';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -121,3 +121,5 @@ export class SetSelectionActivateAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetSelectionActivateAction.NAME, SetSelectionActivateAction);
diff --git a/packages/core/src/Sheets/Action/SetSheetOrderAction.ts b/packages/core/src/Sheets/Action/SetSheetOrderAction.ts
index 47e2ac8d02..82d95c3ca6 100644
--- a/packages/core/src/Sheets/Action/SetSheetOrderAction.ts
+++ b/packages/core/src/Sheets/Action/SetSheetOrderAction.ts
@@ -1,7 +1,7 @@
import { SetSheetOrder } from '../Apply';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
export interface ISetSheetOrderActionData extends ISheetActionData {
sheetId: string;
@@ -71,3 +71,5 @@ export class SetSheetOrderAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetSheetOrderAction.NAME, SetSheetOrderAction);
diff --git a/packages/core/src/Sheets/Action/SetTabColorAction.ts b/packages/core/src/Sheets/Action/SetTabColorAction.ts
index 27e71a8a4f..096c27d5bd 100644
--- a/packages/core/src/Sheets/Action/SetTabColorAction.ts
+++ b/packages/core/src/Sheets/Action/SetTabColorAction.ts
@@ -2,7 +2,7 @@ import { SetTabColor } from '../Apply';
import { Nullable } from '../../Shared/Types';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -87,3 +87,5 @@ export class SetTabColorAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetTabColorAction.NAME, SetTabColorAction);
diff --git a/packages/core/src/Sheets/Action/SetWorkSheetActivateAction.ts b/packages/core/src/Sheets/Action/SetWorkSheetActivateAction.ts
index 1afe341b6d..5b6999f8c9 100644
--- a/packages/core/src/Sheets/Action/SetWorkSheetActivateAction.ts
+++ b/packages/core/src/Sheets/Action/SetWorkSheetActivateAction.ts
@@ -3,7 +3,7 @@ import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { BooleanNumber } from '../../Enum';
import { ActionOperationType } from '../../Command/ActionBase';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -103,3 +103,5 @@ export class SetWorkSheetActivateAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetWorkSheetActivateAction.NAME, SetWorkSheetActivateAction);
diff --git a/packages/core/src/Sheets/Action/SetWorkSheetHideAction.ts b/packages/core/src/Sheets/Action/SetWorkSheetHideAction.ts
index e4ca564576..3346963a29 100644
--- a/packages/core/src/Sheets/Action/SetWorkSheetHideAction.ts
+++ b/packages/core/src/Sheets/Action/SetWorkSheetHideAction.ts
@@ -2,7 +2,7 @@ import { SetWorkSheetHideService } from '../Apply';
import { BooleanNumber } from '../../Enum';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -82,3 +82,5 @@ export class SetWorkSheetHideAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetWorkSheetHideAction.NAME, SetWorkSheetHideAction);
diff --git a/packages/core/src/Sheets/Action/SetWorkSheetNameAction.ts b/packages/core/src/Sheets/Action/SetWorkSheetNameAction.ts
index 3d1ce32264..ca55e198a5 100644
--- a/packages/core/src/Sheets/Action/SetWorkSheetNameAction.ts
+++ b/packages/core/src/Sheets/Action/SetWorkSheetNameAction.ts
@@ -1,7 +1,7 @@
import { SetWorkSheetName } from '../Apply';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -83,3 +83,5 @@ export class SetWorkSheetNameAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetWorkSheetNameAction.NAME, SetWorkSheetNameAction);
diff --git a/packages/core/src/Sheets/Action/SetWorkSheetStatusAction.ts b/packages/core/src/Sheets/Action/SetWorkSheetStatusAction.ts
index 741c79b208..94b8c9701b 100644
--- a/packages/core/src/Sheets/Action/SetWorkSheetStatusAction.ts
+++ b/packages/core/src/Sheets/Action/SetWorkSheetStatusAction.ts
@@ -3,7 +3,7 @@ import { ACTION_NAMES } from '../../Const/ACTION_NAMES';
import { BooleanNumber } from '../../Enum';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
/**
* @internal
@@ -81,3 +81,5 @@ export class SetWorkSheetStatusAction extends SheetActionBase<ISetWorkSheetStatu
return false;
}
}
+
+CommandManager.register(SetWorkSheetStatusAction.NAME, SetWorkSheetStatusAction);
diff --git a/packages/core/src/Sheets/Action/SetZoomRatioAction.ts b/packages/core/src/Sheets/Action/SetZoomRatioAction.ts
index f944f46db5..b11d2ea670 100644
--- a/packages/core/src/Sheets/Action/SetZoomRatioAction.ts
+++ b/packages/core/src/Sheets/Action/SetZoomRatioAction.ts
@@ -4,6 +4,7 @@ import {
ActionType,
ISheetActionData,
CommandUnit,
+ CommandManager,
} from '../../Command';
import { SetZoomRatio } from '../Apply/SetZoomRatio';
@@ -72,3 +73,5 @@ export class SetZoomRatioAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(SetZoomRatioAction.NAME, SetZoomRatioAction);
diff --git a/packages/core/src/Sheets/Action/removeColumnAction.ts b/packages/core/src/Sheets/Action/removeColumnAction.ts
index 143602ad17..bdb0d5b50a 100644
--- a/packages/core/src/Sheets/Action/removeColumnAction.ts
+++ b/packages/core/src/Sheets/Action/removeColumnAction.ts
@@ -1,5 +1,5 @@
import { InsertColumnApply, RemoveColumnApply } from '../Apply';
-import { CommandUnit } from '../../Command';
+import { CommandManager, CommandUnit } from '../../Command';
import { SheetActionBase, ISheetActionData } from '../../Command/SheetActionBase';
import { ActionObservers, ActionType } from '../../Command/ActionObservers';
import { IInsertColumnActionData } from './InsertColumnAction';
@@ -66,3 +66,5 @@ export class RemoveColumnAction extends SheetActionBase<
return false;
}
}
+
+CommandManager.register(RemoveColumnAction.NAME, RemoveColumnAction);
diff --git a/packages/core/src/Sheets/Domain/Merges.ts b/packages/core/src/Sheets/Domain/Merges.ts
index eea4909169..fecf4dbc07 100644
--- a/packages/core/src/Sheets/Domain/Merges.ts
+++ b/packages/core/src/Sheets/Domain/Merges.ts
@@ -1,23 +1,23 @@
import {
- IAddMergeActionData,
CommandManager,
- InsertRowAction,
- IRemoveMergeActionData,
Command,
- RemoveRowAction,
- DeleteRangeAction,
SheetActionBase,
ISheetActionData,
} from '../../Command';
import {
+ DeleteRangeAction,
+ IAddMergeActionData,
InsertColumnAction,
- RemoveColumnAction,
+ InsertRowAction,
+ RemoveRowAction,
+ IRemoveMergeActionData,
RemoveMergeAction,
+ RemoveColumnAction,
} from '../Action';
import { ACTION_NAMES } from '../../Const';
-import { IRangeData } from '../../Interfaces';
-import { Worksheet } from './Worksheet';
import { Nullable, Tools, Rectangle, Tuples } from '../../Shared';
+import { Worksheet } from './Worksheet';
+import { IRangeData } from '../../Interfaces';
/**
* Manage merged cells
@@ -367,7 +367,7 @@ export class Merges {
continue;
} else if (
merge.startColumn >=
- data.rangeData.startColumn &&
+ data.rangeData.startColumn &&
merge.endColumn <= data.rangeData.endColumn
) {
const count =
diff --git a/packages/core/src/Sheets/Domain/NamedRange.ts b/packages/core/src/Sheets/Domain/NamedRange.ts
index 140c04566d..24c43fd5c6 100644
--- a/packages/core/src/Sheets/Domain/NamedRange.ts
+++ b/packages/core/src/Sheets/Domain/NamedRange.ts
@@ -1,12 +1,11 @@
import { SheetContext } from '../../Basics';
+import { CommandManager, Command } from '../../Command';
import {
- CommandManager,
- Command,
IAddNamedRangeActionData,
IDeleteNamedRangeActionData,
ISetNamedRangeActionData,
AddNamedRangeAction,
-} from '../../Command';
+} from '../Action';
import { ACTION_NAMES } from '../../Const';
import { Workbook } from './index';
import { INamedRange } from '../../Interfaces';
diff --git a/packages/core/src/Sheets/Domain/Range.ts b/packages/core/src/Sheets/Domain/Range.ts
index 6bc4c51eff..f27367aae1 100644
--- a/packages/core/src/Sheets/Domain/Range.ts
+++ b/packages/core/src/Sheets/Domain/Range.ts
@@ -6,15 +6,14 @@ import {
IAddMergeActionData,
IRemoveMergeActionData,
IDeleteRangeActionData,
- CommandManager,
- ISheetActionData,
ISetRangeDataActionData,
- Command,
ISetRangeFormulaActionData,
ISetRangeStyleActionData,
ISetRangeFormattedValueActionData,
SetRangeStyleAction,
-} from '../../Command';
+} from '../Action';
+
+import { CommandManager, ISheetActionData, Command } from '../../Command';
import { DEFAULT_RANGE, DEFAULT_STYLES, ACTION_NAMES } from '../../Const';
@@ -1950,9 +1949,9 @@ export class Range {
const zx = Math.abs(
currentStartColumn +
- currentEndColumn -
- incomingStartColumn -
- incomingEndColumn
+ currentEndColumn -
+ incomingStartColumn -
+ incomingEndColumn
);
const x =
Math.abs(currentStartColumn - currentEndColumn) +
diff --git a/packages/core/src/Sheets/Domain/RangeList.ts b/packages/core/src/Sheets/Domain/RangeList.ts
index 4c614a001c..5c3cef6896 100644
--- a/packages/core/src/Sheets/Domain/RangeList.ts
+++ b/packages/core/src/Sheets/Domain/RangeList.ts
@@ -1,28 +1,13 @@
import { Worksheet } from './index';
import { SheetContext } from '../../Basics';
-
-import {
- ISetRangeStyleActionData,
- IClearRangeActionData,
- ISetRangeDataActionData,
- Command,
- CommandManager,
- ISetRangeFormulaActionData,
- ISetRangeFormattedValueActionData,
- SetRangeDataAction,
- ClearRangeAction,
- SetRangeStyleAction,
-} from '../../Command';
-
+import { Command, CommandManager } from '../../Command';
import { ACTION_NAMES } from '../../Const';
-
import {
BooleanNumber,
HorizontalAlign,
VerticalAlign,
WrapStrategy,
} from '../../Enum';
-
import {
ICellData,
ICellV,
@@ -32,10 +17,18 @@ import {
IStyleData,
ITextDecoration,
} from '../../Interfaces';
-
import { Workbook } from './Workbook';
-
import { Nullable, ObjectMatrix, Tools, Tuples } from '../../Shared';
+import {
+ ClearRangeAction,
+ IClearRangeActionData,
+ ISetRangeDataActionData,
+ ISetRangeFormattedValueActionData,
+ ISetRangeFormulaActionData,
+ ISetRangeStyleActionData,
+ SetRangeDataAction,
+ SetRangeStyleAction,
+} from '../Action';
/**
* A collection of one or more Range instances in the same sheet.
diff --git a/packages/core/src/Sheets/Domain/Workbook.ts b/packages/core/src/Sheets/Domain/Workbook.ts
index 2ff5099ae5..37943d7683 100644
--- a/packages/core/src/Sheets/Domain/Workbook.ts
+++ b/packages/core/src/Sheets/Domain/Workbook.ts
@@ -8,13 +8,13 @@ import { BooleanNumber } from '../../Enum';
import { SheetContext } from '../../Basics';
import {
- CommandManager,
InsertSheetAction,
- Command,
ISetSheetOrderActionData,
RemoveSheetAction,
SetSheetOrderAction,
-} from '../../Command';
+ IInsertSheetActionData,
+ IRemoveSheetActionData,
+} from '../Action';
import {
IColumnStartEndData,
@@ -33,8 +33,9 @@ import { Selection } from './Selection';
import { Styles } from './Styles';
import { Worksheet } from './Worksheet';
import { Range } from './Range';
-import { IInsertSheetActionData, IRemoveSheetActionData } from '../Action';
+
import { NamedRange } from './NamedRange';
+import { Command, CommandManager } from '../../Command';
/**
* Access and create Univer Sheets files
@@ -572,7 +573,9 @@ export class Workbook {
*
* @returns void
*/
- flush(): void {}
+ flush(): void {
+ //TDOO ..
+ }
setSheetOrder(sheetId: string, order: number): void {
// const { _sheetOrder } = this;
diff --git a/packages/core/src/Sheets/Domain/Worksheet.ts b/packages/core/src/Sheets/Domain/Worksheet.ts
index b9118faa5c..5a448f656a 100644
--- a/packages/core/src/Sheets/Domain/Worksheet.ts
+++ b/packages/core/src/Sheets/Domain/Worksheet.ts
@@ -2,26 +2,6 @@ import { SheetContext } from '../../Basics';
import {
IInsertColumnDataActionData,
BorderStyleData,
- Command,
- CommandManager,
- ISheetActionData,
- IClearRangeActionData,
- IInsertRowActionData,
- IInsertRowDataActionData,
- IRemoveColumnDataAction,
- IRemoveRowActionData,
- IRemoveRowDataActionData,
- ISetColumnHideActionData,
- ISetColumnShowActionData,
- ISetRowHideActionData,
- ISetRowShowActionData,
- ISetTabColorActionData,
- ISetWorkSheetActivateActionData,
- ISetWorkSheetHideActionData,
- ISetWorkSheetStatusActionData,
- SetWorkSheetActivateAction,
- SetWorkSheetNameAction,
- SetWorkSheetStatusAction,
SetZoomRatioAction,
InsertRowDataAction,
InsertRowAction,
@@ -30,8 +10,6 @@ import {
ClearRangeAction,
SetTabColorAction,
SetBorderAction,
-} from '../../Command';
-import {
IInsertColumnActionData,
IRemoveColumnAction,
RemoveColumnAction,
@@ -45,6 +23,23 @@ import {
SetRowHideAction,
SetRowShowAction,
SetWorkSheetHideAction,
+ IClearRangeActionData,
+ IInsertRowActionData,
+ IInsertRowDataActionData,
+ IRemoveColumnDataAction,
+ IRemoveRowActionData,
+ IRemoveRowDataActionData,
+ ISetColumnHideActionData,
+ ISetColumnShowActionData,
+ ISetRowHideActionData,
+ ISetRowShowActionData,
+ ISetTabColorActionData,
+ ISetWorkSheetActivateActionData,
+ ISetWorkSheetHideActionData,
+ ISetWorkSheetStatusActionData,
+ SetWorkSheetActivateAction,
+ SetWorkSheetNameAction,
+ SetWorkSheetStatusAction,
} from '../Action';
import { DEFAULT_WORKSHEET } from '../../Const';
import { Direction, BooleanNumber, SheetTypes } from '../../Enum';
@@ -65,8 +60,9 @@ import { Merges } from './Merges';
import { Range } from './Range';
import { RangeList } from './RangeList';
import { RowManager } from './RowManager';
-import { Selection } from './Selection';
import { Workbook } from './Workbook';
+import { Selection } from './Selection';
+import { Command, CommandManager, ISheetActionData } from '../../Command';
/**
* Access and modify spreadsheet sheets.
diff --git a/packages/core/src/Sheets/index.ts b/packages/core/src/Sheets/index.ts
new file mode 100644
index 0000000000..84fc0d663e
--- /dev/null
+++ b/packages/core/src/Sheets/index.ts
@@ -0,0 +1,3 @@
+export * from './Action';
+export * from './Domain';
+export * from './Apply';
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index 0705762025..baffa42823 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -12,10 +12,12 @@
*
*/
-export * from './Basics';
+import './Sheets/Action';
+
export * from './Command';
+export * from './Basics';
export * from './Const';
-export * from './Sheets/Domain';
+export * from './Sheets';
export * from './Docs/Domain';
export * from './Slides/Domain';
export * from './Enum';