@univerjs/sheets-formula 0.1.0-beta.5 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-formula",
3
- "version": "0.1.0-beta.5",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
5
  "author": "DreamNum <developer@univer.ai>",
6
6
  "license": "Apache-2.0",
@@ -52,18 +52,18 @@
52
52
  "@wendellhu/redi": "^0.13.0",
53
53
  "react": ">=16.9.0",
54
54
  "rxjs": ">=7.0.0",
55
- "@univerjs/docs": "0.1.0-beta.5",
56
- "@univerjs/core": "0.1.0-beta.5",
57
- "@univerjs/design": "0.1.0-beta.5",
58
- "@univerjs/engine-formula": "0.1.0-beta.5",
59
- "@univerjs/engine-render": "0.1.0-beta.5",
60
- "@univerjs/sheets": "0.1.0-beta.5",
61
- "@univerjs/sheets-numfmt": "0.1.0-beta.5",
62
- "@univerjs/sheets-ui": "0.1.0-beta.5",
63
- "@univerjs/ui": "0.1.0-beta.5"
55
+ "@univerjs/core": "0.1.2",
56
+ "@univerjs/design": "0.1.2",
57
+ "@univerjs/docs": "0.1.2",
58
+ "@univerjs/engine-formula": "0.1.2",
59
+ "@univerjs/sheets": "0.1.2",
60
+ "@univerjs/sheets-numfmt": "0.1.2",
61
+ "@univerjs/engine-render": "0.1.2",
62
+ "@univerjs/sheets-ui": "0.1.2",
63
+ "@univerjs/ui": "0.1.2"
64
64
  },
65
65
  "dependencies": {
66
- "@univerjs/icons": "^0.1.28"
66
+ "@univerjs/icons": "^0.1.30"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/react": "^18.2.57",
@@ -75,16 +75,16 @@
75
75
  "typescript": "^5.3.3",
76
76
  "vite": "^5.1.4",
77
77
  "vitest": "^1.3.1",
78
- "@univerjs/docs": "0.1.0-beta.5",
79
- "@univerjs/engine-formula": "0.1.0-beta.5",
80
- "@univerjs/core": "0.1.0-beta.5",
81
- "@univerjs/design": "0.1.0-beta.5",
82
- "@univerjs/engine-render": "0.1.0-beta.5",
83
- "@univerjs/shared": "0.1.0-beta.5",
84
- "@univerjs/sheets": "0.1.0-beta.5",
85
- "@univerjs/sheets-numfmt": "0.1.0-beta.5",
86
- "@univerjs/ui": "0.1.0-beta.5",
87
- "@univerjs/sheets-ui": "0.1.0-beta.5"
78
+ "@univerjs/core": "0.1.2",
79
+ "@univerjs/docs": "0.1.2",
80
+ "@univerjs/design": "0.1.2",
81
+ "@univerjs/engine-formula": "0.1.2",
82
+ "@univerjs/engine-render": "0.1.2",
83
+ "@univerjs/shared": "0.1.2",
84
+ "@univerjs/sheets": "0.1.2",
85
+ "@univerjs/sheets-numfmt": "0.1.2",
86
+ "@univerjs/sheets-ui": "0.1.2",
87
+ "@univerjs/ui": "0.1.2"
88
88
  },
89
89
  "scripts": {
90
90
  "lint:types": "tsc --noEmit",
@@ -1,41 +0,0 @@
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 { Disposable, ICommandService } from '@univerjs/core';
17
- import { TextSelectionManagerService } from '@univerjs/docs';
18
- import { LexerTreeBuilder } from '@univerjs/engine-formula';
19
- import { IRenderManagerService, ITextSelectionRenderManager } from '@univerjs/engine-render';
20
- import type { EditorBridgeService } from '@univerjs/sheets-ui';
21
- import { IFormulaInputService } from '../services/formula-input.service';
22
- export declare class FormulaInputController extends Disposable {
23
- private readonly _commandService;
24
- private readonly _textSelectionRenderManager;
25
- private readonly _editorBridgeService;
26
- private readonly _lexerTreeBuilder;
27
- private readonly _renderManagerService;
28
- private readonly _formulaInputService;
29
- private readonly _textSelectionManagerService;
30
- private _userCursorMove;
31
- constructor(_commandService: ICommandService, _textSelectionRenderManager: ITextSelectionRenderManager, _editorBridgeService: EditorBridgeService, _lexerTreeBuilder: LexerTreeBuilder, _renderManagerService: IRenderManagerService, _formulaInputService: IFormulaInputService, _textSelectionManagerService: TextSelectionManagerService);
32
- private _initialize;
33
- private _initialEditorInputChange;
34
- private _userMouseListener;
35
- private _inputFormulaListener;
36
- private _changeRefString;
37
- private _changeRangeRef;
38
- private _changeSingleRef;
39
- private _commandExecutedListener;
40
- private _getEditorObject;
41
- }
@@ -1,106 +0,0 @@
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 { ISequenceNode } from '@univerjs/engine-formula';
17
- import type { IDisposable } from '@wendellhu/redi';
18
- import type { Observable } from 'rxjs';
19
- export interface ISyncToEditorParam {
20
- textSelectionOffset: number;
21
- sequences: Array<string | ISequenceNode>;
22
- }
23
- export interface IFormulaInputService {
24
- syncToEditor$: Observable<ISyncToEditorParam>;
25
- inputFormula$: Observable<string>;
26
- changeRef$: Observable<boolean>;
27
- syncToEditor(textSelectionOffset: number): void;
28
- dispose(): void;
29
- getSequenceNodes(): Array<string | ISequenceNode>;
30
- setSequenceNodes(nodes: Array<string | ISequenceNode>): void;
31
- clearSequenceNodes(): void;
32
- getCurrentSequenceNodeIndex(strIndex: number): number;
33
- getCurrentSequenceNodeByIndex(nodeIndex: number): string | ISequenceNode;
34
- getCurrentSequenceNode(strIndex: number): string | ISequenceNode;
35
- updateSequenceRef(nodeIndex: number, refString: string): void;
36
- insertSequenceRef(index: number, refString: string): void;
37
- insertSequenceString(index: number, content: string): void;
38
- enableSelectionMoving(): void;
39
- disableSelectionMoving(): void;
40
- isSelectionMoving(): boolean;
41
- enableLockedSelectionChange(): void;
42
- disableLockedSelectionChange(): void;
43
- isLockedSelectionChange(): boolean;
44
- enableLockedSelectionInsert(): void;
45
- disableLockedSelectionInsert(): void;
46
- isLockedSelectionInsert(): boolean;
47
- inputFormula(formulaString: string): void;
48
- }
49
- export declare class FormulaInputService implements IFormulaInputService, IDisposable {
50
- private _sequenceNodes;
51
- private _isSelectionMoving;
52
- private _isLockedOnSelectionChangeRefString;
53
- private _isLockedOnSelectionInsertRefString;
54
- private readonly _syncToEditor$;
55
- readonly syncToEditor$: Observable<ISyncToEditorParam>;
56
- private _changeRef$;
57
- readonly changeRef$: Observable<boolean>;
58
- private readonly _inputFormula$;
59
- readonly inputFormula$: Observable<string>;
60
- dispose(): void;
61
- inputFormula(formulaString: string): void;
62
- syncToEditor(textSelectionOffset: number): void;
63
- getSequenceNodes(): (string | ISequenceNode)[];
64
- setSequenceNodes(nodes: Array<string | ISequenceNode>): void;
65
- clearSequenceNodes(): void;
66
- getCurrentSequenceNode(strIndex: number): string | ISequenceNode;
67
- getCurrentSequenceNodeByIndex(nodeIndex: number): string | ISequenceNode;
68
- /**
69
- * Query the text coordinates in the sequenceNodes and determine the actual insertion index.
70
- * @param sequenceNodes
71
- * @param strIndex
72
- * @returns
73
- */
74
- getCurrentSequenceNodeIndex(strIndex: number): number;
75
- /**
76
- * Synchronize the reference text based on the changes of the selection.
77
- * @param refIndex
78
- * @param rangeWithCoord
79
- * @returns
80
- */
81
- updateSequenceRef(nodeIndex: number, refString: string): void;
82
- /**
83
- * When the cursor is on the right side of a formula token,
84
- * you can add reference text to the formula by drawing a selection.
85
- * @param index
86
- * @param range
87
- */
88
- insertSequenceRef(index: number, refString: string): void;
89
- /**
90
- * Insert a string at the cursor position in the text corresponding to the sequenceNodes.
91
- * @param sequenceNodes
92
- * @param index
93
- * @param content
94
- */
95
- insertSequenceString(index: number, content: string): void;
96
- enableSelectionMoving(): void;
97
- disableSelectionMoving(): void;
98
- isSelectionMoving(): boolean;
99
- enableLockedSelectionChange(): void;
100
- disableLockedSelectionChange(): void;
101
- isLockedSelectionChange(): boolean;
102
- enableLockedSelectionInsert(): void;
103
- disableLockedSelectionInsert(): void;
104
- isLockedSelectionInsert(): boolean;
105
- }
106
- export declare const IFormulaInputService: import("@wendellhu/redi").IdentifierDecorator<FormulaInputService>;
@@ -1,17 +0,0 @@
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 React from 'react';
17
- export declare function ErrorFunction(): React.JSX.Element | null;