@univerjs/core 0.1.1 → 0.1.2
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/README.md +22 -2
- package/lib/cjs/index.js +6 -6
- package/lib/es/index.js +379 -283
- package/lib/types/docs/data-model/__tests__/replacement.spec.d.ts +16 -0
- package/lib/types/docs/data-model/replacement.d.ts +17 -0
- package/lib/types/docs/data-model/text-x/text-x.d.ts +3 -3
- package/lib/types/index.d.ts +4 -0
- package/lib/types/services/context/context.d.ts +1 -0
- package/lib/types/shared/debounce.d.ts +18 -0
- package/lib/types/shared/generate.d.ts +1 -1
- package/lib/types/shared/index.d.ts +1 -0
- package/lib/types/sheets/__tests__/worksheet.spec.d.ts +16 -0
- package/lib/types/sheets/worksheet.d.ts +22 -0
- package/lib/types/types/interfaces/i-document-data.d.ts +1 -1
- package/lib/umd/index.js +6 -6
- package/package.json +2 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IDocumentBody } from '../../types/interfaces/i-document-data';
|
|
17
|
+
export declare function replaceInDocumentBody(body: IDocumentBody, query: string, target: string): IDocumentBody;
|
|
@@ -19,9 +19,9 @@ import { type TextXAction } from '../action-types';
|
|
|
19
19
|
export declare class TextX {
|
|
20
20
|
static compose(thisActions: TextXAction[], otherActions: TextXAction[]): TextXAction[];
|
|
21
21
|
private _actions;
|
|
22
|
-
insert(len: number, body: IDocumentBody, segmentId
|
|
23
|
-
retain(len: number, segmentId
|
|
24
|
-
delete(len: number, segmentId
|
|
22
|
+
insert(len: number, body: IDocumentBody, segmentId?: string): this;
|
|
23
|
+
retain(len: number, segmentId?: string, body?: IDocumentBody, coverType?: UpdateDocsAttributeType): this;
|
|
24
|
+
delete(len: number, segmentId?: string): this;
|
|
25
25
|
serialize(): TextXAction[];
|
|
26
26
|
push(...args: TextXAction[]): this;
|
|
27
27
|
trimEndUselessRetainAction(): this;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export { TextXActionType, type TextXAction, type IDeleteAction, type IInsertActi
|
|
|
25
25
|
export { ActionIterator } from './docs/data-model/text-x/action-iterator';
|
|
26
26
|
export { getBodySlice, composeBody } from './docs/data-model/text-x/utils';
|
|
27
27
|
export { TextX } from './docs/data-model/text-x/text-x';
|
|
28
|
+
export { replaceInDocumentBody } from './docs/data-model/replacement';
|
|
28
29
|
export * from './observer';
|
|
29
30
|
export { Plugin, PluginType } from './plugin/plugin';
|
|
30
31
|
export { type CommandListener, CommandService, CommandType, type ICommand, type ICommandInfo, ICommandService, type IExecutionOptions, type IMultiCommand, type IMutation, type IMutationCommonParams, type IMutationInfo, type IOperation, type IOperationInfo, NilCommand, sequenceExecute, sequenceExecuteAsync, } from './services/command/command.service';
|
|
@@ -61,3 +62,6 @@ export * from './slides/domain';
|
|
|
61
62
|
export * from './types/const';
|
|
62
63
|
export * from './types/enum';
|
|
63
64
|
export * from './types/interfaces';
|
|
65
|
+
export { UniverInstanceService } from './services/instance/instance.service';
|
|
66
|
+
export { LifecycleInitializerService } from './services/lifecycle/lifecycle.service';
|
|
67
|
+
export { ConfigService } from './services/config/config.service';
|
|
@@ -22,3 +22,4 @@ export declare const EDITOR_ACTIVATED = "EDITOR_ACTIVATED";
|
|
|
22
22
|
export declare const FOCUSING_EDITOR_INPUT_FORMULA = "FOCUSING_EDITOR_INPUT_FORMULA";
|
|
23
23
|
export declare const FOCUSING_FORMULA_EDITOR = "FOCUSING_FORMULA_EDITOR";
|
|
24
24
|
export declare const FOCUSING_UNIVER_EDITOR = "FOCUSING_UNIVER_EDITOR";
|
|
25
|
+
export declare const FOCUSING_UNIVER_EDITOR_SINGLE_MODE = "FOCUSING_UNIVER_EDITOR_SINGLE_MODE";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
type debounceFn<T extends (...args: any[]) => any> = (this: ThisParameterType<T>, ...args: Parameters<T>) => void;
|
|
17
|
+
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): debounceFn<T>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -192,4 +192,26 @@ export declare class Worksheet {
|
|
|
192
192
|
*/
|
|
193
193
|
getLastColumnWithContent(): number;
|
|
194
194
|
cellHasValue(value: ICellData): boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Iterate a range row by row.
|
|
197
|
+
*
|
|
198
|
+
* Performance intensive.
|
|
199
|
+
*/
|
|
200
|
+
iterateByRow(range: IRange): Iterator<Readonly<ICell>, Readonly<ICell>>;
|
|
201
|
+
/**
|
|
202
|
+
* Iterate a range column by column. This is pretty similar to `iterateByRow` but with different order.
|
|
203
|
+
*
|
|
204
|
+
* Performance intensive.
|
|
205
|
+
*/
|
|
206
|
+
iterateByColumn(range: IRange): Iterator<Readonly<ICell>, Readonly<ICell>>;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* A cell info including its span (if it is the top-left cell of a merged cell).
|
|
210
|
+
*/
|
|
211
|
+
export interface ICell {
|
|
212
|
+
row: number;
|
|
213
|
+
col: number;
|
|
214
|
+
rowSpan?: number;
|
|
215
|
+
colSpan?: number;
|
|
216
|
+
value: ICellData;
|
|
195
217
|
}
|