@univerjs/core 0.1.6 → 0.1.7
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/cjs/index.js +5 -5
- package/lib/es/index.js +127 -112
- package/lib/types/common/const.d.ts +2 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/services/command/command.service.d.ts +9 -1
- package/lib/types/services/context/context.d.ts +1 -0
- package/lib/types/shared/common.d.ts +10 -0
- package/lib/umd/index.js +6 -6
- package/package.json +6 -6
|
@@ -16,3 +16,5 @@
|
|
|
16
16
|
export declare const DOCS_NORMAL_EDITOR_UNIT_ID_KEY = "__defaultDocumentNormalEditorSpecialUnitId_20231006__";
|
|
17
17
|
export declare const DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY = "__defaultDocumentFormulaBarEditorSpecialUnitId_20231012__";
|
|
18
18
|
export declare const DEFAULT_EMPTY_DOCUMENT_VALUE = "\r\n";
|
|
19
|
+
export declare function createInternalEditorID(id: string): string;
|
|
20
|
+
export declare function isInternalEditorID(id: string): boolean;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
export { shallowEqual, isRangesEqual, isUnitRangesEqual } from './common/equal';
|
|
17
17
|
export * from './basics';
|
|
18
18
|
export { dedupe, remove, rotate, groupBy } from './common/array';
|
|
19
|
-
export { DEFAULT_EMPTY_DOCUMENT_VALUE, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, } from './common/const';
|
|
19
|
+
export { DEFAULT_EMPTY_DOCUMENT_VALUE, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, createInternalEditorID, isInternalEditorID, } from './common/const';
|
|
20
20
|
export { throttle } from './common/function';
|
|
21
21
|
export { MemoryCursor } from './common/memory-cursor';
|
|
22
22
|
export { requestImmediateMacroTask } from './common/request-immediate-macro-task';
|
|
@@ -88,6 +88,12 @@ export interface IExecutionOptions {
|
|
|
88
88
|
}
|
|
89
89
|
export type CommandListener = (commandInfo: Readonly<ICommandInfo>, options?: IExecutionOptions) => void;
|
|
90
90
|
export interface ICommandService {
|
|
91
|
+
/**
|
|
92
|
+
* Check if a command is already registered at the current command service.
|
|
93
|
+
*
|
|
94
|
+
* @param commandId The id of the command.
|
|
95
|
+
*/
|
|
96
|
+
hasCommand(commandId: string): boolean;
|
|
91
97
|
registerCommand(command: ICommand<object, unknown>): IDisposable;
|
|
92
98
|
registerMultipleCommand(command: ICommand<object, unknown>): IDisposable;
|
|
93
99
|
executeCommand<P extends object = object, R = boolean>(id: string, params?: P, options?: IExecutionOptions): Promise<R>;
|
|
@@ -109,8 +115,10 @@ export declare const ICommandService: import('@wendellhu/redi').IdentifierDecora
|
|
|
109
115
|
export declare class CommandRegistry {
|
|
110
116
|
private readonly _commands;
|
|
111
117
|
registerCommand(command: ICommand): IDisposable;
|
|
118
|
+
hasCommand(id: string): boolean;
|
|
112
119
|
getCommand(id: string): [ICommand] | null;
|
|
113
120
|
}
|
|
121
|
+
export declare const NilCommand: ICommand;
|
|
114
122
|
export declare class CommandService implements ICommandService {
|
|
115
123
|
private readonly _injector;
|
|
116
124
|
private readonly _logService;
|
|
@@ -121,6 +129,7 @@ export declare class CommandService implements ICommandService {
|
|
|
121
129
|
private _commandExecutingLevel;
|
|
122
130
|
private _commandExecutionStack;
|
|
123
131
|
constructor(_injector: Injector, _logService: ILogService);
|
|
132
|
+
hasCommand(commandId: string): boolean;
|
|
124
133
|
registerCommand(command: ICommand): IDisposable;
|
|
125
134
|
registerMultipleCommand(command: ICommand): IDisposable;
|
|
126
135
|
beforeCommandExecuted(listener: CommandListener): IDisposable;
|
|
@@ -135,4 +144,3 @@ export declare class CommandService implements ICommandService {
|
|
|
135
144
|
}
|
|
136
145
|
export declare function sequenceExecute(tasks: ICommandInfo[], commandService: ICommandService, options?: IExecutionOptions): import('../../common/sequence').ISequenceExecuteResult;
|
|
137
146
|
export declare function sequenceExecuteAsync(tasks: ICommandInfo[], commandService: ICommandService, options?: IExecutionOptions): Promise<import('../../common/sequence').ISequenceExecuteResult>;
|
|
138
|
-
export declare const NilCommand: ICommand;
|
|
@@ -20,6 +20,7 @@ export declare const FOCUSING_SLIDE = "FOCUSING_SLIDE";
|
|
|
20
20
|
export declare const FOCUSING_EDITOR_BUT_HIDDEN = "FOCUSING_EDITOR_BUT_HIDDEN";
|
|
21
21
|
export declare const EDITOR_ACTIVATED = "EDITOR_ACTIVATED";
|
|
22
22
|
export declare const FOCUSING_EDITOR_INPUT_FORMULA = "FOCUSING_EDITOR_INPUT_FORMULA";
|
|
23
|
+
/** The focusing state of the formula editor (Fx bar). */
|
|
23
24
|
export declare const FOCUSING_FORMULA_EDITOR = "FOCUSING_FORMULA_EDITOR";
|
|
24
25
|
export declare const FOCUSING_UNIVER_EDITOR = "FOCUSING_UNIVER_EDITOR";
|
|
25
26
|
export declare const FOCUSING_EDITOR_STANDALONE = "FOCUSING_EDITOR_INPUT_FORMULA";
|
|
@@ -9,7 +9,17 @@ export declare function makeCellToSelection(cellInfo: Nullable<ISelectionCellWit
|
|
|
9
9
|
export declare function makeCellRangeToRangeData(cellInfo: Nullable<ISelectionCell>): Nullable<IRange>;
|
|
10
10
|
export declare function isEmptyCell(cell: Nullable<ICellData>): boolean;
|
|
11
11
|
export declare function getColorStyle(color: Nullable<IColorStyle>): Nullable<string>;
|
|
12
|
+
/**
|
|
13
|
+
* A string starting with an equal sign is a formula
|
|
14
|
+
* @param value
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
12
17
|
export declare function isFormulaString(value: any): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* any string
|
|
20
|
+
* @param value
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
13
23
|
export declare function isFormulaId(value: any): boolean;
|
|
14
24
|
/**
|
|
15
25
|
* Convert rich text json to DOM
|