@univerjs/sheets-zen-editor 0.17.0 → 0.18.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/cjs/facade.js +1 -1
- package/lib/cjs/index.js +9 -3
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -144
- package/lib/es/index.js +9 -466
- package/lib/es/locale/ca-ES.js +1 -14
- package/lib/es/locale/en-US.js +1 -14
- package/lib/es/locale/es-ES.js +1 -14
- package/lib/es/locale/fa-IR.js +1 -14
- package/lib/es/locale/fr-FR.js +1 -14
- package/lib/es/locale/ja-JP.js +1 -14
- package/lib/es/locale/ko-KR.js +1 -14
- package/lib/es/locale/ru-RU.js +1 -14
- package/lib/es/locale/sk-SK.js +1 -14
- package/lib/es/locale/vi-VN.js +1 -14
- package/lib/es/locale/zh-CN.js +1 -14
- package/lib/es/locale/zh-TW.js +1 -14
- package/lib/facade.js +1 -144
- package/lib/index.css +82 -1
- package/lib/index.js +9 -466
- package/lib/locale/ca-ES.js +1 -14
- package/lib/locale/en-US.js +1 -14
- package/lib/locale/es-ES.js +1 -14
- package/lib/locale/fa-IR.js +1 -14
- package/lib/locale/fr-FR.js +1 -14
- package/lib/locale/ja-JP.js +1 -14
- package/lib/locale/ko-KR.js +1 -14
- package/lib/locale/ru-RU.js +1 -14
- package/lib/locale/sk-SK.js +1 -14
- package/lib/locale/vi-VN.js +1 -14
- package/lib/locale/zh-CN.js +1 -14
- package/lib/locale/zh-TW.js +1 -14
- package/lib/types/commands/commands/zen-editor.command.d.ts +16 -1
- package/lib/types/config/config.d.ts +16 -1
- package/lib/types/controllers/shortcuts/zen-editor.shortcut.d.ts +17 -2
- package/lib/types/controllers/zen-editor-ui.controller.d.ts +15 -0
- package/lib/types/controllers/zen-editor.controller.d.ts +15 -0
- package/lib/types/facade/f-univer.d.ts +16 -1
- package/lib/types/facade/f-workbook.d.ts +15 -0
- package/lib/types/locale/ca-ES.d.ts +16 -1
- package/lib/types/locale/es-ES.d.ts +16 -1
- package/lib/types/locale/fa-IR.d.ts +16 -1
- package/lib/types/locale/fr-FR.d.ts +16 -1
- package/lib/types/locale/ja-JP.d.ts +16 -1
- package/lib/types/locale/ko-KR.d.ts +16 -1
- package/lib/types/locale/ru-RU.d.ts +16 -1
- package/lib/types/locale/sk-SK.d.ts +16 -1
- package/lib/types/locale/vi-VN.d.ts +16 -1
- package/lib/types/locale/zh-CN.d.ts +16 -1
- package/lib/types/locale/zh-TW.d.ts +16 -1
- package/lib/types/menu/menu.d.ts +17 -2
- package/lib/types/menu/schema.d.ts +16 -1
- package/lib/types/plugin.d.ts +16 -1
- package/lib/types/services/zen-editor.service.d.ts +18 -3
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +9 -3
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +14 -13
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
|
-
const e
|
|
2
|
-
rightClick: {
|
|
3
|
-
zenEditor: "禪模式編輯"
|
|
4
|
-
},
|
|
5
|
-
shortcut: {
|
|
6
|
-
sheet: {
|
|
7
|
-
"zen-edit-cancel": "取消編輯(禪模式狀態)",
|
|
8
|
-
"zen-edit-confirm": "放棄編輯(禪模式狀態)"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
e as default
|
|
14
|
-
};
|
|
1
|
+
const e={rightClick:{zenEditor:`禪模式編輯`},shortcut:{sheet:{"zen-edit-cancel":`取消編輯(禪模式狀態)`,"zen-edit-confirm":`放棄編輯(禪模式狀態)`}}};export{e as default};
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { ICommand } from '@univerjs/core';
|
|
2
17
|
export declare const OpenZenEditorCommand: ICommand;
|
|
3
18
|
export declare const CancelZenEditCommand: ICommand;
|
|
4
19
|
export declare const ConfirmZenEditCommand: ICommand;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { MenuConfig } from '@univerjs/ui';
|
|
2
17
|
export declare const SHEETS_ZEN_EDITOR_PLUGIN_CONFIG_KEY = "sheets-zen-editor.config";
|
|
3
18
|
export declare const configSymbol: unique symbol;
|
|
4
19
|
export interface IUniverSheetsZenEditorConfig {
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { IContextService } from '@univerjs/core';
|
|
17
|
+
import type { IShortcutItem } from '@univerjs/ui';
|
|
3
18
|
export declare const ZenEditorConfirmShortcut: IShortcutItem;
|
|
4
19
|
export declare const ZenEditorCancelShortcut: IShortcutItem;
|
|
5
20
|
/**
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
*/
|
|
1
16
|
import { Disposable, ICommandService } from '@univerjs/core';
|
|
2
17
|
import { IMenuManagerService, IShortcutService, IZenZoneService } from '@univerjs/ui';
|
|
3
18
|
export declare class ZenEditorUIController extends Disposable {
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
*/
|
|
1
16
|
import { RxDisposable } from '@univerjs/core';
|
|
2
17
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
3
18
|
import { IZenEditorManagerService } from '../services/zen-editor.service';
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { Injector } from '@univerjs/core';
|
|
2
17
|
import { FUniver } from '@univerjs/core/facade';
|
|
3
18
|
/**
|
|
4
19
|
* @ignore
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
*/
|
|
1
16
|
import { FWorkbook } from '@univerjs/sheets/facade';
|
|
2
17
|
/**
|
|
3
18
|
* @ignore
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 enUS from './en-US';
|
|
2
17
|
declare const locale: typeof enUS;
|
|
3
18
|
export default locale;
|
package/lib/types/menu/menu.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { IAccessor } from '@univerjs/core';
|
|
17
|
+
import type { IMenuButtonItem } from '@univerjs/ui';
|
|
3
18
|
export declare function ZenEditorMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { MenuSchemaType } from '@univerjs/ui';
|
|
2
17
|
export declare const menuSchema: MenuSchemaType;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { IUniverSheetsZenEditorConfig } from './config/config';
|
|
2
17
|
import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
18
|
export declare class UniverSheetsZenEditorPlugin extends Plugin {
|
|
4
19
|
private readonly _config;
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { IDisposable, Nullable } from '@univerjs/core';
|
|
17
|
+
import type { Observable } from 'rxjs';
|
|
3
18
|
export interface IZenEditorManagerService {
|
|
4
19
|
position$: Observable<Nullable<DOMRect>>;
|
|
5
20
|
dispose(): void;
|
|
@@ -15,4 +30,4 @@ export declare class ZenEditorManagerService implements IDisposable {
|
|
|
15
30
|
getPosition(): Readonly<Nullable<DOMRect>>;
|
|
16
31
|
private _refresh;
|
|
17
32
|
}
|
|
18
|
-
export declare const IZenEditorManagerService: import(
|
|
33
|
+
export declare const IZenEditorManagerService: import("@wendellhu/redi").IdentifierDecorator<ZenEditorManagerService>;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require(`@univerjs/core`),require(`@univerjs/core/facade`),require(`@univerjs/docs`),require(`@univerjs/sheets-ui`),require(`@univerjs/sheets-zen-editor`),require(`@univerjs/sheets/facade`)):typeof define==`function`&&define.amd?define([`@univerjs/core`,`@univerjs/core/facade`,`@univerjs/docs`,`@univerjs/sheets-ui`,`@univerjs/sheets-zen-editor`,`@univerjs/sheets/facade`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore,e.UniverCoreFacade,e.UniverDocs,e.UniverSheetsUi,e.UniverSheetsZenEditor,e.UniverSheetsFacade))})(this,function(e,t,n,r,i,a){var o=class extends t.FUniver{_initSheetZenEditorEvent(t){let a=t.get(e.ICommandService);this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetEditStart,()=>a.beforeCommandExecuted(n=>{if(n.id===i.OpenZenEditorCommand.id){let i=this.getCommandSheetTarget(n);if(!i)return;let{workbook:a,worksheet:o}=i,s=t.get(r.IEditorBridgeService),{keycode:c,eventType:l}=n.params,u=s.getEditLocation(),d={row:u.row,column:u.column,eventType:l,keycode:c,workbook:a,worksheet:o,isZenEditor:!0};if(this.fireEvent(this.Event.BeforeSheetEditStart,d),d.cancel)throw new e.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetEditEnd,()=>a.beforeCommandExecuted(n=>{if(n.id===i.CancelZenEditCommand.id||n.id===i.ConfirmZenEditCommand.id){let a=this.getCommandSheetTarget(n);if(!a)return;let{workbook:o,worksheet:s}=a,c=t.get(r.IEditorBridgeService),l=t.get(e.IUniverInstanceService),{keycode:u,eventType:d}=n.params,f=c.getEditLocation(),p={row:f.row,column:f.column,eventType:d,keycode:u,workbook:o,worksheet:s,isZenEditor:!0,value:e.RichTextValue.create(l.getUnit(e.DOCS_ZEN_EDITOR_UNIT_ID_KEY).getSnapshot()),isConfirm:n.id===i.ConfirmZenEditCommand.id};if(this.fireEvent(this.Event.BeforeSheetEditEnd,p),p.cancel)throw new e.CanceledError}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetEditStarted,()=>a.onCommandExecuted(e=>{if(e.id===i.OpenZenEditorCommand.id){let n=this.getCommandSheetTarget(e);if(!n)return;let{workbook:i,worksheet:a}=n,o=t.get(r.IEditorBridgeService),{keycode:s,eventType:c}=e.params,l=o.getEditLocation(),u={row:l.row,column:l.column,eventType:c,keycode:s,workbook:i,worksheet:a,isZenEditor:!0};this.fireEvent(this.Event.SheetEditStarted,u)}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetEditEnded,()=>a.onCommandExecuted(e=>{if(e.id===i.CancelZenEditCommand.id||e.id===i.ConfirmZenEditCommand.id){let n=this.getCommandSheetTarget(e);if(!n)return;let{workbook:a,worksheet:o}=n,s=t.get(r.IEditorBridgeService),{keycode:c,eventType:l}=e.params,u=s.getEditLocation(),d={row:u.row,column:u.column,eventType:l,keycode:c,workbook:a,worksheet:o,isZenEditor:!0,isConfirm:e.id===i.ConfirmZenEditCommand.id};this.fireEvent(this.Event.SheetEditEnded,d)}}))),this.disposeWithMe(this.registerEventHandler(this.Event.SheetEditChanging,()=>a.onCommandExecuted(i=>{if(i.id===n.RichTextEditingMutation.id){let n=this.getActiveSheet();if(!n)return;let{workbook:a,worksheet:o}=n,s=t.get(r.IEditorBridgeService),c=t.get(e.IUniverInstanceService),l=i.params;if(!s.isVisible().visible)return;let{unitId:u}=l;if(u===e.DOCS_ZEN_EDITOR_UNIT_ID_KEY){let{row:t,column:n}=s.getEditLocation(),r={workbook:a,worksheet:o,row:t,column:n,value:e.RichTextValue.create(c.getUnit(e.DOCS_ZEN_EDITOR_UNIT_ID_KEY).getSnapshot()),isZenEditor:!0};this.fireEvent(this.Event.SheetEditChanging,r)}}})))}_initialize(e){this._initSheetZenEditorEvent(e)}};t.FUniver.extend(o);var s=class extends a.FWorkbook{startZenEditingAsync(){return this._injector.get(e.ICommandService).executeCommand(i.OpenZenEditorCommand.id)}endZenEditingAsync(t=!0){let n=this._injector.get(e.ICommandService);return t?n.executeCommand(i.ConfirmZenEditCommand.id):n.executeCommand(i.CancelZenEditCommand.id)}};a.FWorkbook.extend(s)});
|
package/lib/umd/index.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/docs-ui`),require(`@univerjs/engine-render`),require(`@univerjs/sheets-ui`),require(`@univerjs/ui`),require(`@univerjs/sheets`),require(`rxjs`),require(`@univerjs/design`),require(`react`),require(`react/jsx-runtime`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/docs-ui`,`@univerjs/engine-render`,`@univerjs/sheets-ui`,`@univerjs/ui`,`@univerjs/sheets`,`rxjs`,`@univerjs/design`,`react`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsZenEditor={},e.UniverCore,e.UniverDocsUi,e.UniverEngineRender,e.UniverSheetsUi,e.UniverUi,e.UniverSheets,e.rxjs,e.UniverDesign,e.React,e.React))})(this,function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let d={id:`zen-editor.command.open-zen-editor`,type:t.CommandType.COMMAND,handler:async e=>{var r;let o=e.get(a.IZenZoneService),s=e.get(n.IEditorService),c=e.get(i.IEditorBridgeService),l=e.get(t.IUniverInstanceService),u=e.get(a.ISidebarService);u.visible&&(u.close(),await(0,t.delayAnimationFrame)()),o.open();let d=s.getEditor(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(d==null)return!1;let f=c.getLatestEditCellState();if(f==null)return!1;let p=(r=f.documentLayoutObject.documentModel)==null?void 0:r.getSnapshot();if(p==null)return!1;l.focusUnit(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY);let{body:m,drawings:h,drawingsOrder:g,tableSource:_,settings:v}=t.Tools.deepClone(p),y={...d.getDocumentData(),body:m,drawings:h,drawingsOrder:g,tableSource:_,settings:v};return d.focus(),d.setDocumentData(y,[{startOffset:0,endOffset:0,collapsed:!0}]),d.clearUndoRedoHistory(),!0}},f={id:`zen-editor.command.cancel-zen-edit`,type:t.CommandType.COMMAND,handler:async e=>{let n=e.get(a.IZenZoneService),r=e.get(i.IEditorBridgeService),o=e.get(t.IUniverInstanceService),s=e.get(a.ISidebarService);s.visible&&(s.close(),await(0,t.delayAnimationFrame)()),n.close();let c=o.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET);return c?(o.focusUnit(c.getUnitId()),r.refreshEditCellState(),!0):!1}},p={id:`zen-editor.command.confirm-zen-edit`,type:t.CommandType.COMMAND,handler:async e=>{let o=e.get(a.IZenZoneService),s=e.get(i.IEditorBridgeService),c=e.get(t.IUniverInstanceService),l=e.get(n.IEditorService),u=e.get(a.ISidebarService);u.visible&&(u.close(),await(0,t.delayAnimationFrame)()),o.close();let d=l.getEditor(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY);if(d==null)return!1;let f=e.get(r.IRenderManagerService),p=c.getCurrentUnitForType(t.UniverInstanceType.UNIVER_SHEET);if(p){var m;let e=p.getUnitId(),n=(m=f.getRenderById(e))==null?void 0:m.with(i.EditingRenderController);if(n){let e=t.Tools.deepClone(d.getDocumentData());e.documentStyle.documentFlavor=t.DocumentFlavor.UNSPECIFIED,n.submitCellData(new t.DocumentDataModel(e))}return c.focusUnit(p.getUnitId()),s.refreshEditCellState(),!0}return!1}};var m=`@univerjs/sheets-zen-editor`,h=`0.18.0`;let g=`sheets-zen-editor.config`;Symbol(g);let _={};function v(e){let t=e.get(i.IEditorBridgeService);return{id:d.id,type:a.MenuItemType.BUTTON,title:`rightClick.zenEditor`,icon:`AmplifyIcon`,hidden$:(0,i.getCurrentExclusiveRangeInterest$)(e),disabled$:t.currentEditCell$.pipe((0,s.switchMap)(t=>(0,i.getCurrentRangeDisable$)(e,{workbookTypes:[o.WorkbookEditablePermission],worksheetTypes:[o.WorksheetEditPermission,o.WorksheetSetCellValuePermission,o.WorksheetSetCellStylePermission],rangeTypes:[o.RangeProtectionPermissionEditPoint]}).pipe((0,s.map)(e=>{var n,r;return e||((n=t==null||(r=t.documentLayoutObject.documentModel)==null||(r=r.getBody())==null||(r=r.customBlocks)==null?void 0:r.length)==null?0:n)>0}))))}}let y={[a.ContextMenuPosition.MAIN_AREA]:{[a.ContextMenuGroup.OTHERS]:{[d.id]:{order:2,menuItemFactory:v}}}};function b({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,s=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),c=(0,l.useRef)(`_${w()}`);return x(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function x(e,t,n,r,i){return(0,l.createElement)(e.tag,{key:t,...S(e,n,i),...r},(C(e,n).children||[]).map((r,a)=>x(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function S(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function C(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function w(){return Math.random().toString(36).substring(2,8)}b.displayName=`UniverIcon`;let T={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},E=(0,l.forwardRef)(function(e,t){return(0,l.createElement)(b,Object.assign({},e,{id:`check-mark-icon`,ref:t,icon:T}))});E.displayName=`CheckMarkIcon`;let D={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z`}}]},O=(0,l.forwardRef)(function(e,t){return(0,l.createElement)(b,Object.assign({},e,{id:`close-icon`,ref:t,icon:D}))});O.displayName=`CloseIcon`;function k(e){"@babel/helpers - typeof";return k=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},k(e)}function A(e,t){if(k(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(k(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function j(e){var t=A(e,`string`);return k(t)==`symbol`?t:t+``}function M(e,t,n){return(t=j(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=class{constructor(){M(this,`_position`,null),M(this,`_position$`,new s.BehaviorSubject(null)),M(this,`position$`,this._position$.asObservable())}dispose(){this._position$.complete(),this._position=null}setPosition(e){this._position=e,this._refresh(e)}getPosition(){return this._position}_refresh(e){this._position$.next(e)}};let P=(0,t.createIdentifier)(`univer.sheet-zen-editor-manager.service`),F={id:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,body:{dataStream:`${t.DEFAULT_EMPTY_DOCUMENT_VALUE}`,textRuns:[],tables:[],customBlocks:[],paragraphs:[{startIndex:0}],sectionBreaks:[{startIndex:1}]},tableSource:{},documentStyle:{pageSize:{width:595,height:1/0},documentFlavor:t.DocumentFlavor.MODERN,marginTop:0,marginBottom:0,marginRight:0,marginLeft:0,renderConfig:{vertexAngle:0,centerAngle:0}},drawings:{},drawingsOrder:[]};function I(){let e=(0,l.useRef)(null),r=(0,a.useDependency)(P),i=(0,a.useDependency)(n.IEditorService),o=(0,a.useDependency)(t.ICommandService);(0,l.useEffect)(()=>{let n=e.current;if(!n)return;let a=i.register({editorUnitId:t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,initialSnapshot:F,scrollBar:!0,backScrollOffset:100},n),o=new ResizeObserver(()=>{r.setPosition(n.getBoundingClientRect())});return o.observe(n),()=>{a.dispose(),o.unobserve(n)}},[]);function s(){let e=i.getEditor(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY);e==null||e.blur(),o.executeCommand(f.id)}function d(){let e=i.getEditor(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY);e==null||e.blur(),o.executeCommand(p.id)}let m=`univer-flex univer-w-7 univer-cursor-pointer univer-items-center univer-justify-center univer-transition-colors`;return(0,u.jsxs)(`div`,{className:`
|
|
2
|
+
univer-absolute univer-inset-0 univer-size-full univer-bg-white
|
|
3
|
+
dark:!univer-bg-gray-800
|
|
4
|
+
`,children:[(0,u.jsxs)(`div`,{className:`
|
|
5
|
+
univer-absolute univer-right-6 univer-top-2 univer-z-10 univer-flex univer-items-center
|
|
6
|
+
univer-justify-center
|
|
7
|
+
`,children:[(0,u.jsx)(`span`,{className:(0,c.clsx)(m,`
|
|
2
8
|
univer-text-red-500
|
|
3
9
|
hover:univer-text-red-600
|
|
4
|
-
`),onClick:s,children:
|
|
10
|
+
`),onClick:s,children:(0,u.jsx)(O,{className:`univer-size-5`})}),(0,u.jsx)(`span`,{className:(0,c.clsx)(m,`
|
|
5
11
|
univer-text-green-500
|
|
6
12
|
hover:univer-text-green-600
|
|
7
|
-
`),onClick:
|
|
13
|
+
`),onClick:d,children:(0,u.jsx)(E,{className:`univer-size-5`})})]}),(0,u.jsx)(`div`,{ref:e,className:`univer-absolute univer-inset-0 univer-size-full`})]})}let L={id:p.id,description:`shortcut.sheet.zen-edit-confirm`,group:`4_sheet-edit`,preconditions:e=>z(e),binding:a.KeyCode.ENTER|a.MetaKeys.ALT},R={id:f.id,description:`shortcut.sheet.zen-edit-cancel`,group:`4_sheet-edit`,preconditions:e=>z(e),binding:a.KeyCode.ESC};function z(e){return e.getContextValue(t.FOCUSING_DOC)&&e.getContextValue(t.FOCUSING_UNIVER_EDITOR)&&e.getContextValue(t.EDITOR_ACTIVATED)&&!e.getContextValue(t.FOCUSING_EDITOR_STANDALONE)}function B(e,t){return function(n,r){t(n,r,e)}}function V(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let H=class extends t.Disposable{constructor(e,t,n,r){super(),this._zenZoneService=e,this._commandService=t,this._menuManagerService=n,this._shortcutService=r,this._initialize()}_initialize(){this._initCustomComponents(),this._initCommands(),this._initMenus(),this._initShortcuts()}_initCustomComponents(){this.disposeWithMe(this._zenZoneService.set(`ZEN_EDITOR_PLUGIN_ZEN_EDITOR_COMPONENT`,I))}_initCommands(){[d,f,p].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(y)}_initShortcuts(){[L,R].forEach(e=>{this.disposeWithMe(this._shortcutService.registerShortcut(e))})}};H=V([B(0,a.IZenZoneService),B(1,t.ICommandService),B(2,a.IMenuManagerService),B(3,a.IShortcutService)],H);let U=class extends t.RxDisposable{constructor(e,t){super(),this._zenEditorManagerService=e,this._renderManagerService=t,this._initialize()}_initialize(){this._syncZenEditorSize()}_syncZenEditorSize(){this._zenEditorManagerService.position$.pipe((0,s.takeUntil)(this.dispose$)).subscribe(e=>{if(e==null)return;let{width:n,height:r}=e,a=(0,i.getEditorObject)(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY,this._renderManagerService);a!=null&&requestIdleCallback(()=>{a.engine.resizeBySize(n,r),this._calculatePagePosition(a),this._scrollToTop()})})}_calculatePagePosition(e){let{document:t,scene:r,docBackground:i}=e,a=r==null?void 0:r.getParent(),{width:o,height:s,pageMarginLeft:c,pageMarginTop:l}=t;if(a==null||o===1/0||s===1/0)return;let{width:u,height:d}=a,f=0,p=l,m=0,h=0,g=1/0,{scaleX:_,scaleY:v}=r.getAncestorScale();u>(o+c*2)*_?(f=u/2-o*_/2,f/=_,m=(u-c*2)/_,g=0):(f=c,m=o+c*2,g=(m-u/_)/2),h=d>s?(d-l*2)/v:s+l*2,r.resize(m,h),t.translate(f,p),i.translate(f,p);let y=r.getViewport(n.VIEWPORT_KEY.VIEW_MAIN);if(g!==1/0&&y!=null){let e=y.transScroll2ViewportScrollValue(g,0).x;y.scrollToBarPos({x:e})}return this}_scrollToTop(){var e;let r=(e=this._renderManagerService.getRenderById(t.DOCS_ZEN_EDITOR_UNIT_ID_KEY))==null?void 0:e.with(n.DocBackScrollRenderController);r&&r.scrollToRange({startOffset:0,endOffset:0})}};U=V([B(0,P),B(1,r.IRenderManagerService)],U);let W=class extends t.Plugin{constructor(e=_,n,r){super(),this._config=e,this._injector=n,this._configService=r;let{menu:i,...a}=(0,t.merge)({},_,this._config);i&&this._configService.setConfig(`menu`,i,{merge:!0}),this._configService.setConfig(g,a),this._initializeDependencies(this._injector)}_initializeDependencies(e){[[H],[U],[P,{useClass:N}]].forEach(t=>e.add(t))}onReady(){this._injector.get(H)}onSteady(){this._injector.get(U)}};M(W,`pluginName`,`SHEET_ZEN_EDITOR_PLUGIN`),M(W,`packageName`,m),M(W,`version`,h),M(W,`type`,t.UniverInstanceType.UNIVER_SHEET),W=V([B(1,(0,t.Inject)(t.Injector)),B(2,t.IConfigService)],W),e.CancelZenEditCommand=f,e.ConfirmZenEditCommand=p,e.OpenZenEditorCommand=d,Object.defineProperty(e,`UniverSheetsZenEditorPlugin`,{enumerable:!0,get:function(){return W}})});
|