@univerjs/docs-ui 1.1.0 → 1.3.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/README.md +45 -0
- package/lib/cjs/index.js +822 -243
- package/lib/cjs/locale/ar-SA.js +4 -0
- package/lib/cjs/locale/ca-ES.js +4 -0
- package/lib/cjs/locale/de-DE.js +4 -0
- package/lib/cjs/locale/en-US.js +4 -0
- package/lib/cjs/locale/es-ES.js +4 -0
- package/lib/cjs/locale/fa-IR.js +4 -0
- package/lib/cjs/locale/fr-FR.js +4 -0
- package/lib/cjs/locale/id-ID.js +4 -0
- package/lib/cjs/locale/it-IT.js +4 -0
- package/lib/cjs/locale/ja-JP.js +4 -0
- package/lib/cjs/locale/ko-KR.js +4 -0
- package/lib/cjs/locale/pl-PL.js +4 -0
- package/lib/cjs/locale/pt-BR.js +4 -0
- package/lib/cjs/locale/ru-RU.js +4 -0
- package/lib/cjs/locale/sk-SK.js +4 -0
- package/lib/cjs/locale/vi-VN.js +4 -0
- package/lib/cjs/locale/zh-CN.js +4 -0
- package/lib/cjs/locale/zh-HK.js +4 -0
- package/lib/cjs/locale/zh-TW.js +4 -0
- package/lib/es/index.js +826 -248
- package/lib/es/locale/ar-SA.js +4 -0
- package/lib/es/locale/ca-ES.js +4 -0
- package/lib/es/locale/de-DE.js +4 -0
- package/lib/es/locale/en-US.js +4 -0
- package/lib/es/locale/es-ES.js +4 -0
- package/lib/es/locale/fa-IR.js +4 -0
- package/lib/es/locale/fr-FR.js +4 -0
- package/lib/es/locale/id-ID.js +4 -0
- package/lib/es/locale/it-IT.js +4 -0
- package/lib/es/locale/ja-JP.js +4 -0
- package/lib/es/locale/ko-KR.js +4 -0
- package/lib/es/locale/pl-PL.js +4 -0
- package/lib/es/locale/pt-BR.js +4 -0
- package/lib/es/locale/ru-RU.js +4 -0
- package/lib/es/locale/sk-SK.js +4 -0
- package/lib/es/locale/vi-VN.js +4 -0
- package/lib/es/locale/zh-CN.js +4 -0
- package/lib/es/locale/zh-HK.js +4 -0
- package/lib/es/locale/zh-TW.js +4 -0
- package/lib/index.css +40 -78
- package/lib/index.js +826 -248
- package/lib/locale/ar-SA.js +4 -0
- package/lib/locale/ca-ES.js +4 -0
- package/lib/locale/de-DE.js +4 -0
- package/lib/locale/en-US.js +4 -0
- package/lib/locale/es-ES.js +4 -0
- package/lib/locale/fa-IR.js +4 -0
- package/lib/locale/fr-FR.js +4 -0
- package/lib/locale/id-ID.js +4 -0
- package/lib/locale/it-IT.js +4 -0
- package/lib/locale/ja-JP.js +4 -0
- package/lib/locale/ko-KR.js +4 -0
- package/lib/locale/pl-PL.js +4 -0
- package/lib/locale/pt-BR.js +4 -0
- package/lib/locale/ru-RU.js +4 -0
- package/lib/locale/sk-SK.js +4 -0
- package/lib/locale/vi-VN.js +4 -0
- package/lib/locale/zh-CN.js +4 -0
- package/lib/locale/zh-HK.js +4 -0
- package/lib/locale/zh-TW.js +4 -0
- package/lib/types/config/config.d.ts +5 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/locale/en-US.d.ts +4 -0
- package/lib/types/menu/menu.d.ts +1 -1
- package/lib/types/menu/mobile-schema.d.ts +41 -2
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/services/clipboard/clipboard.service.d.ts +1 -1
- package/lib/types/services/doc-heading-collapse.service.d.ts +38 -0
- package/lib/types/services/doc-paragraph-menu.service.d.ts +5 -3
- package/lib/types/services/doc-popup-manager.service.d.ts +4 -1
- package/lib/types/services/mobile/doc-selection-render.service.d.ts +1 -0
- package/lib/types/services/selection/doc-selection-render.service.d.ts +2 -1
- package/lib/types/views/EditorColorPicker.d.ts +20 -0
- package/lib/types/views/ParagraphMenu.d.ts +2 -2
- package/lib/types/views/doc-side-menu-layout.d.ts +17 -0
- package/lib/types/views/heading-collapse-shape.d.ts +38 -0
- package/lib/types/views/paragraph-menu/paragraph-menu-position.d.ts +21 -0
- package/lib/types/views/paragraph-setting/hook/utils.d.ts +2 -0
- package/lib/types/views/rich-text-editor/hooks/editor-undo-redo-keyboard.d.ts +5 -1
- package/lib/umd/index.js +16 -17
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.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/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.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/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.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-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +12 -12
package/lib/locale/ar-SA.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "لون النص الافتراضي",
|
|
217
217
|
noBackground: "بدون خلفية"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "طي",
|
|
221
|
+
expand: "توسيع"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "إعداد المستند",
|
|
221
225
|
"modern-width": "عرض المحتوى",
|
package/lib/locale/ca-ES.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "Color de text predeterminat",
|
|
217
217
|
noBackground: "Sense fons"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "Redueix",
|
|
221
|
+
expand: "Expandeix"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "Configuració de document",
|
|
221
225
|
"modern-width": "Amplada del contingut",
|
package/lib/locale/de-DE.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "Standardtextfarbe",
|
|
217
217
|
noBackground: "Kein Hintergrund"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "Einklappen",
|
|
221
|
+
expand: "Ausklappen"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "Dokumenteneinstellung",
|
|
221
225
|
"modern-width": "Inhaltsbreite",
|
package/lib/locale/en-US.js
CHANGED
|
@@ -231,6 +231,10 @@ const locale = { "docs-ui": {
|
|
|
231
231
|
defaultTextColor: "Default text color",
|
|
232
232
|
noBackground: "No background"
|
|
233
233
|
},
|
|
234
|
+
heading: {
|
|
235
|
+
collapse: "Collapse",
|
|
236
|
+
expand: "Expand"
|
|
237
|
+
},
|
|
234
238
|
"page-settings": {
|
|
235
239
|
"document-setting": "Page Setup",
|
|
236
240
|
"modern-width": "Content width",
|
package/lib/locale/es-ES.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "Color de texto predeterminado",
|
|
217
217
|
noBackground: "Sin fondo"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "Contraer",
|
|
221
|
+
expand: "Expandir"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "Configuración de documento",
|
|
221
225
|
"modern-width": "Ancho del contenido",
|
package/lib/locale/fa-IR.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "رنگ پیشفرض متن",
|
|
217
217
|
noBackground: "بدون پسزمینه"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "جمع کردن",
|
|
221
|
+
expand: "باز کردن"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "تنظیمات سند",
|
|
221
225
|
"modern-width": "عرض محتوا",
|
package/lib/locale/fr-FR.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "Couleur de texte par défaut",
|
|
217
217
|
noBackground: "Aucun arrière-plan"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "Réduire",
|
|
221
|
+
expand: "Développer"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "Paramètres du document",
|
|
221
225
|
"modern-width": "Largeur du contenu",
|
package/lib/locale/id-ID.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "Warna teks default",
|
|
217
217
|
noBackground: "Tanpa latar belakang"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "Ciutkan",
|
|
221
|
+
expand: "Perluas"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "Pengaturan Dokumen",
|
|
221
225
|
"modern-width": "Lebar konten",
|
package/lib/locale/it-IT.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "Colore testo predefinito",
|
|
217
217
|
noBackground: "Nessuno sfondo"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "Comprimi",
|
|
221
|
+
expand: "Espandi"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "Impostazione Documento",
|
|
221
225
|
"modern-width": "Larghezza contenuto",
|
package/lib/locale/ja-JP.js
CHANGED
package/lib/locale/ko-KR.js
CHANGED
package/lib/locale/pl-PL.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "Domyślny kolor tekstu",
|
|
217
217
|
noBackground: "Brak tła"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "Zwiń",
|
|
221
|
+
expand: "Rozwiń"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "Ustawienia dokumentu",
|
|
221
225
|
"modern-width": "Szerokość treści",
|
package/lib/locale/pt-BR.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "Cor de texto padrão",
|
|
217
217
|
noBackground: "Sem plano de fundo"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "Recolher",
|
|
221
|
+
expand: "Expandir"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "Configuração do documento",
|
|
221
225
|
"modern-width": "Largura do conteúdo",
|
package/lib/locale/ru-RU.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "Цвет текста по умолчанию",
|
|
217
217
|
noBackground: "Без фона"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "Свернуть",
|
|
221
|
+
expand: "Развернуть"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "Настройки документа",
|
|
221
225
|
"modern-width": "Ширина содержимого",
|
package/lib/locale/sk-SK.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "Predvolená farba textu",
|
|
217
217
|
noBackground: "Bez pozadia"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "Zbaliť",
|
|
221
|
+
expand: "Rozbaliť"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "Nastavenia dokumentu",
|
|
221
225
|
"modern-width": "Šírka obsahu",
|
package/lib/locale/vi-VN.js
CHANGED
|
@@ -216,6 +216,10 @@ const locale = { "docs-ui": {
|
|
|
216
216
|
defaultTextColor: "Màu văn bản mặc định",
|
|
217
217
|
noBackground: "Không có nền"
|
|
218
218
|
},
|
|
219
|
+
heading: {
|
|
220
|
+
collapse: "Thu gọn",
|
|
221
|
+
expand: "Mở rộng"
|
|
222
|
+
},
|
|
219
223
|
"page-settings": {
|
|
220
224
|
"document-setting": "Cài đặt tài liệu",
|
|
221
225
|
"modern-width": "Độ rộng nội dung",
|
package/lib/locale/zh-CN.js
CHANGED
package/lib/locale/zh-HK.js
CHANGED
package/lib/locale/zh-TW.js
CHANGED
|
@@ -33,6 +33,11 @@ export interface IDocFitToWidthOptions {
|
|
|
33
33
|
export interface IUniverDocsUIConfig {
|
|
34
34
|
menu?: MenuConfig;
|
|
35
35
|
container?: HTMLElement | string;
|
|
36
|
+
/**
|
|
37
|
+
* Show the left-hand document outline for heading navigation.
|
|
38
|
+
* When omitted, enabled for modern documents and disabled for traditional documents.
|
|
39
|
+
* Explicit `true` or `false` overrides the default in either document mode.
|
|
40
|
+
*/
|
|
36
41
|
toc?: boolean;
|
|
37
42
|
footer?: boolean;
|
|
38
43
|
wordCount?: boolean;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -131,6 +131,7 @@ export { getCanvasOffsetByEngine, getTextRangeFromCharIndex } from './services/s
|
|
|
131
131
|
export { getAnchorBounding, getLineBounding, TEXT_RANGE_LAYER_INDEX, TextRange } from './services/selection/text-range';
|
|
132
132
|
export { whenDocAndEditorFocused } from './shortcuts/utils';
|
|
133
133
|
export { DOC_VERTICAL_PADDING } from './types/const/padding';
|
|
134
|
+
export { EditorColorPicker } from './views/EditorColorPicker';
|
|
134
135
|
export { BulletListTypePicker, OrderListTypePicker } from './views/list-type-picker/Picker';
|
|
135
136
|
export { MOBILE_DOC_ELEMENT_MENU, MobileDocElementMenu } from './views/mobile-element-menu/MobileDocElementMenu';
|
|
136
137
|
export { MobileRichTextEditor } from './views/mobile-rich-text-editor/MobileRichTextEditor';
|
package/lib/types/menu/menu.d.ts
CHANGED
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { DocumentDataModel, IAccessor, ITextRangeParam, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { IMenuButtonItem, IMenuItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
18
|
-
import type { LocaleKey } from '../locale/types';
|
|
19
18
|
import { HorizontalAlign, NamedStyleType, PresetListType } from '@univerjs/core';
|
|
20
19
|
import { UnitAction } from '@univerjs/protocol';
|
|
21
20
|
import { Observable } from 'rxjs';
|
|
21
|
+
import type { LocaleKey } from '../locale/types';
|
|
22
22
|
export declare function shouldSuppressDocMenuStateRefresh(accessor: IAccessor): boolean;
|
|
23
23
|
export declare function disableMenuWhenHeaderFooterEditing(accessor: IAccessor): Observable<boolean>;
|
|
24
24
|
export declare function disableMenuWhenNoDocRange(accessor: IAccessor): Observable<boolean>;
|
|
@@ -13,5 +13,44 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
17
|
-
|
|
16
|
+
import { DocPasteCommand, DocPasteSpecialCommand } from '../commands/commands/clipboard.command';
|
|
17
|
+
import { DocSelectAllCommand, DocSelectWordCommand } from '../commands/commands/doc-select-all.command';
|
|
18
|
+
import { PasteMenuFactory, PasteSpecialMenuFactory, SelectAllMenuFactory, SelectWordMenuFactory } from './context-menu';
|
|
19
|
+
export declare const mobileMenuSchema: {
|
|
20
|
+
"contextMenu.mainArea": {
|
|
21
|
+
"contextMenu.quick": {
|
|
22
|
+
[DocSelectWordCommand.id]: {
|
|
23
|
+
order: number;
|
|
24
|
+
menuItemFactory: typeof SelectWordMenuFactory;
|
|
25
|
+
};
|
|
26
|
+
[DocSelectAllCommand.id]: {
|
|
27
|
+
order: number;
|
|
28
|
+
menuItemFactory: typeof SelectAllMenuFactory;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
"docs.contextMenu.caret": {
|
|
33
|
+
"contextMenu.quick": {
|
|
34
|
+
[DocPasteCommand.id]: {
|
|
35
|
+
order: number;
|
|
36
|
+
menuItemFactory: typeof PasteMenuFactory;
|
|
37
|
+
};
|
|
38
|
+
[DocSelectWordCommand.id]: {
|
|
39
|
+
order: number;
|
|
40
|
+
menuItemFactory: typeof SelectWordMenuFactory;
|
|
41
|
+
};
|
|
42
|
+
[DocSelectAllCommand.id]: {
|
|
43
|
+
order: number;
|
|
44
|
+
menuItemFactory: typeof SelectAllMenuFactory;
|
|
45
|
+
};
|
|
46
|
+
quickLayout: "tile";
|
|
47
|
+
};
|
|
48
|
+
"contextMenu.format": {
|
|
49
|
+
[DocPasteSpecialCommand.id]: {
|
|
50
|
+
order: number;
|
|
51
|
+
menuItemFactory: typeof PasteSpecialMenuFactory;
|
|
52
|
+
};
|
|
53
|
+
order: number;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IUniverDocsUIConfig } from './config/config';
|
|
17
16
|
import { ICommandService, IConfigService, Injector, Plugin } from '@univerjs/core';
|
|
18
17
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
18
|
+
import type { IUniverDocsUIConfig } from './config/config';
|
|
19
19
|
export declare class UniverDocsUIPlugin extends Plugin {
|
|
20
20
|
private readonly _config;
|
|
21
21
|
_injector: Injector;
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
import type { IDisposable, IDocumentBody, IDocumentData } from '@univerjs/core';
|
|
17
17
|
import type { IRectRangeWithStyle, ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
18
18
|
import type { Observable } from 'rxjs';
|
|
19
|
-
import type { DocPasteMode } from './paste-options';
|
|
20
19
|
import { Disposable, ErrorService, ICommandService, ILogService, ImageSourceType, IPermissionService, IUndoRedoService, IUniverInstanceService, SliceBodyType } from '@univerjs/core';
|
|
21
20
|
import { DocSelectionManagerService, DocStateChangeManagerService } from '@univerjs/docs';
|
|
22
21
|
import { IClipboardInterfaceService } from '@univerjs/ui';
|
|
22
|
+
import type { DocPasteMode } from './paste-options';
|
|
23
23
|
import { DocMenuStyleService } from '../doc-menu-style.service';
|
|
24
24
|
import { DocHtmlExportService } from './udm-to-html/doc-html-export.service';
|
|
25
25
|
export declare function convertClipboardHtmlToDocumentData(html: string, unitId?: string): Partial<IDocumentData>;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { DocumentDataModel } from '@univerjs/core';
|
|
17
|
+
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
18
|
+
import { Disposable, ICommandService, LocaleService, ThemeService } from '@univerjs/core';
|
|
19
|
+
import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
|
|
20
|
+
import { ILayoutService } from '@univerjs/ui';
|
|
21
|
+
import { DocEventManagerService } from './doc-event-manager.service';
|
|
22
|
+
export declare class DocHeadingCollapseService extends Disposable implements IRenderModule {
|
|
23
|
+
private readonly _context;
|
|
24
|
+
private readonly _skeletonManager;
|
|
25
|
+
private readonly _eventManager;
|
|
26
|
+
private readonly _selections;
|
|
27
|
+
private readonly _commandService;
|
|
28
|
+
private readonly _layoutService;
|
|
29
|
+
private readonly _buttons;
|
|
30
|
+
private _colors;
|
|
31
|
+
private _expandLabel;
|
|
32
|
+
private _collapseLabel;
|
|
33
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _skeletonManager: DocSkeletonManagerService, _eventManager: DocEventManagerService, _selections: DocSelectionManagerService, _commandService: ICommandService, _layoutService: ILayoutService, themeService: ThemeService, localeService: LocaleService);
|
|
34
|
+
private _getColors;
|
|
35
|
+
private _normalizeSelection;
|
|
36
|
+
private _update;
|
|
37
|
+
dispose(): void;
|
|
38
|
+
}
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { DocumentDataModel, ICustomBlock, ICustomTable, IDocumentBlockRange } from '@univerjs/core';
|
|
17
17
|
import type { IBoundRectNoAngle, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
18
|
-
import type { IMutiPageParagraphBound, ITableBound } from './doc-event-manager.service';
|
|
19
18
|
import { Disposable, DocumentBlockType, IContextService, IPermissionService } from '@univerjs/core';
|
|
20
19
|
import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
|
|
20
|
+
import type { IMutiPageParagraphBound, ITableBound } from './doc-event-manager.service';
|
|
21
21
|
import { DocEventManagerService } from './doc-event-manager.service';
|
|
22
22
|
import { DocLayoutInteractionService } from './doc-layout-interaction.service';
|
|
23
23
|
import { DocCanvasPopManagerService } from './doc-popup-manager.service';
|
|
@@ -73,6 +73,7 @@ export declare class DocParagraphMenuService extends Disposable implements IRend
|
|
|
73
73
|
private _docLayoutInteractionService;
|
|
74
74
|
private readonly _contextService;
|
|
75
75
|
private _paragraphMenu;
|
|
76
|
+
private _paragraphMenuHideTimer;
|
|
76
77
|
private readonly _activeTarget$;
|
|
77
78
|
readonly activeTarget$: import("rxjs").Observable<IDocBlockMenuTarget | null>;
|
|
78
79
|
private _focusedTableMenu;
|
|
@@ -93,7 +94,6 @@ export declare class DocParagraphMenuService extends Disposable implements IRend
|
|
|
93
94
|
setBlockMenuDragging(isDragging: boolean): void;
|
|
94
95
|
get isBlockMenuDragging(): boolean;
|
|
95
96
|
constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionManagerService: DocSelectionManagerService, _docEventManagerService: DocEventManagerService, _docPopupManagerService: DocCanvasPopManagerService, _docSkeletonManagerService: DocSkeletonManagerService, _floatMenuService: DocFloatMenuService, _docSelectionRenderService: DocSelectionRenderService, _permissionService: IPermissionService, _docLayoutInteractionService: DocLayoutInteractionService, _contextService: IContextService);
|
|
96
|
-
private _isCursorInActiveParagraph;
|
|
97
97
|
private _getExpandedSelectionState;
|
|
98
98
|
private _hasExpandedSelectionRanges;
|
|
99
99
|
private _hasExpandedTextSelection;
|
|
@@ -110,13 +110,15 @@ export declare class DocParagraphMenuService extends Disposable implements IRend
|
|
|
110
110
|
private _getSlashMenuAnchorRect;
|
|
111
111
|
showParagraphMenu(paragraph: IMutiPageParagraphBound): void;
|
|
112
112
|
showTableMenu(tableBound: ITableBound, focused?: boolean): void;
|
|
113
|
-
private
|
|
113
|
+
private _showHoverMenu;
|
|
114
114
|
private _showFocusedTableMenu;
|
|
115
115
|
private _shouldKeepCurrentCellMenuForTable;
|
|
116
116
|
getDropTargetFromClientPoint(clientX: number, clientY: number, sourceRange: {
|
|
117
117
|
startOffset: number;
|
|
118
118
|
endOffset: number;
|
|
119
119
|
}): IDocBlockDropTarget | null;
|
|
120
|
+
private _cancelParagraphMenuHide;
|
|
121
|
+
private _scheduleParagraphMenuHide;
|
|
120
122
|
hideParagraphMenu(force?: boolean): void;
|
|
121
123
|
hideFocusedTableMenu(): void;
|
|
122
124
|
private _canEditDocument;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import type { INeedCheckDisposable, ITextRangeParam } from '@univerjs/core';
|
|
17
17
|
import type { BaseObject, IBoundRectNoAngle, IRender, Scene } from '@univerjs/engine-render';
|
|
18
18
|
import type { IPopup } from '@univerjs/ui';
|
|
19
|
+
import type { Observable } from 'rxjs';
|
|
19
20
|
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
20
21
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
21
22
|
import { ICanvasPopupService } from '@univerjs/ui';
|
|
@@ -29,6 +30,8 @@ export declare function transformOffset2Bound(offsetX: number, offsetY: number,
|
|
|
29
30
|
y: number;
|
|
30
31
|
};
|
|
31
32
|
export interface IDocCanvasPopup extends Omit<IPopup, 'anchorRect$' | 'children' | 'unitId' | 'subUnitId' | 'canvasElement'> {
|
|
33
|
+
/** Notify when a business-owned rect changes independently of scene transforms. */
|
|
34
|
+
positionChanges$?: Observable<unknown>;
|
|
32
35
|
/** Defaults to true. Passive hover affordances can track layout without holding it. */
|
|
33
36
|
requiresStableLayout?: boolean;
|
|
34
37
|
mask?: boolean;
|
|
@@ -45,7 +48,7 @@ export declare class DocCanvasPopManagerService extends Disposable {
|
|
|
45
48
|
private readonly _commandService;
|
|
46
49
|
private readonly _popupCountByUnit;
|
|
47
50
|
private readonly _popupUnits$;
|
|
48
|
-
readonly popupUnits$:
|
|
51
|
+
readonly popupUnits$: Observable<ReadonlySet<string>>;
|
|
49
52
|
constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService);
|
|
50
53
|
dispose(): void;
|
|
51
54
|
private _beginPopupActivity;
|
|
@@ -38,6 +38,7 @@ export declare class MobileDocSelectionRenderService extends DocSelectionRenderS
|
|
|
38
38
|
readonly mobileEditMode$: import("rxjs").Observable<boolean>;
|
|
39
39
|
get isMobileEditMode(): boolean;
|
|
40
40
|
constructor(context: IRenderContext<DocumentDataModel>, layoutService: ILayoutService, logService: ILogService, contextService: IContextService, univerInstanceService: IUniverInstanceService, _mobileDocSkeletonManagerService: DocSkeletonManagerService, docSelectionManagerService: DocSelectionManagerService, embedInteractionBoundaryService?: IDocEmbedInteractionBoundaryService, embedRuntimeFocusCoordinator?: IDocEmbedRuntimeFocusCoordinator);
|
|
41
|
+
focus(): void;
|
|
41
42
|
cancelPointerSelection(): void;
|
|
42
43
|
enterMobileEditMode(shouldFocusInput?: boolean): boolean;
|
|
43
44
|
suspendMobileEditingInput(): void;
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { DocumentDataModel, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { IDocSelectionInnerParam, IMouseEvent, INodePosition, IPointerEvent, IRenderContext, IRenderModule, ISuccinctDocRangeParam, ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
18
|
-
import type { RectRange } from './rect-range';
|
|
19
18
|
import { IContextService, ILogService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
20
19
|
import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
|
|
21
20
|
import { ILayoutService } from '@univerjs/ui';
|
|
21
|
+
import type { RectRange } from './rect-range';
|
|
22
22
|
import { IDocEmbedInteractionBoundaryService, IDocEmbedRuntimeFocusCoordinator } from '../doc-embed-integration.service';
|
|
23
23
|
import { TextRange } from './text-range';
|
|
24
24
|
export interface IEditorInputConfig {
|
|
@@ -192,6 +192,7 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
|
|
|
192
192
|
private _getTransformCoordForDocumentOffset;
|
|
193
193
|
private _findNodeByCoord;
|
|
194
194
|
private _shouldPreserveExternalFocus;
|
|
195
|
+
private _isInUnfocusedFrame;
|
|
195
196
|
private _isAnotherEditorFocused;
|
|
196
197
|
private _containsCurrentEmbedRuntimeElement;
|
|
197
198
|
private _getCurrentEmbedOwner;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { IColorPickerProps } from '@univerjs/design';
|
|
17
|
+
export declare function EditorColorPicker(props: IColorPickerProps): import("react").JSX.Element;
|
|
18
|
+
export declare namespace EditorColorPicker {
|
|
19
|
+
var componentKey: string;
|
|
20
|
+
}
|
|
@@ -18,10 +18,10 @@ import type { IDocBlockMoveValidationContext } from '@univerjs/docs';
|
|
|
18
18
|
import type { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
19
19
|
import type { IPopup, IValueOption } from '@univerjs/ui';
|
|
20
20
|
import type { CSSProperties } from 'react';
|
|
21
|
-
import type { IMutiPageParagraphBound } from '../services/doc-event-manager.service';
|
|
22
|
-
import type { IDocBlockMenuTarget } from '../services/doc-paragraph-menu.service';
|
|
23
21
|
import { NamedStyleType } from '@univerjs/core';
|
|
24
22
|
import { DocBlockMoveValidatorService } from '@univerjs/docs';
|
|
23
|
+
import type { IMutiPageParagraphBound } from '../services/doc-event-manager.service';
|
|
24
|
+
import type { IDocBlockMenuTarget } from '../services/doc-paragraph-menu.service';
|
|
25
25
|
import { DocParagraphMenuService } from '../services/doc-paragraph-menu.service';
|
|
26
26
|
export declare function getParagraphMenuPopupDirection(anchorLeft: number, menuWidth?: number, viewportPadding?: number, options?: {
|
|
27
27
|
anchorRight?: number;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 { IBoundRectNoAngle, IDocsTableRenderViewport } from '@univerjs/engine-render';
|
|
17
|
+
export declare function isDocSideMenuTableOverlapping(outline: IBoundRectNoAngle, table: IBoundRectNoAngle, viewport: IDocsTableRenderViewport | null): boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { IShapeProps, IViewportInfo, UniverRenderingContext } from '@univerjs/engine-render';
|
|
17
|
+
import { Shape } from '@univerjs/engine-render';
|
|
18
|
+
export interface IHeadingCollapseColors {
|
|
19
|
+
normal: string;
|
|
20
|
+
hover: string;
|
|
21
|
+
tooltipBackground: string;
|
|
22
|
+
tooltipText: string;
|
|
23
|
+
}
|
|
24
|
+
export declare class HeadingCollapseShape extends Shape<IShapeProps> {
|
|
25
|
+
private _collapsed;
|
|
26
|
+
private _label;
|
|
27
|
+
private _colors;
|
|
28
|
+
private _hovered;
|
|
29
|
+
private _tooltipVisible;
|
|
30
|
+
private _tooltipTimer;
|
|
31
|
+
private _pressed;
|
|
32
|
+
constructor(key: string, colors: IHeadingCollapseColors, activate: () => void);
|
|
33
|
+
update(collapsed: boolean, label: string, colors: IHeadingCollapseColors): void;
|
|
34
|
+
resetHover(): void;
|
|
35
|
+
private _hideTooltip;
|
|
36
|
+
protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
37
|
+
dispose(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { IPopup } from '@univerjs/ui';
|
|
17
|
+
import type { Observable } from 'rxjs';
|
|
18
|
+
import { DocumentBlockType } from '@univerjs/core';
|
|
19
|
+
export declare function observeParagraphMenuPosition(element: HTMLElement, popup: IPopup, targets$: Observable<{
|
|
20
|
+
kind: DocumentBlockType;
|
|
21
|
+
} | null>): () => void;
|
|
@@ -19,6 +19,7 @@ export declare function resolveParagraphsForSettingPanel(paragraphs: IParagraph[
|
|
|
19
19
|
paragraphStyle: import("@univerjs/core").IParagraphStyle;
|
|
20
20
|
startIndex: number;
|
|
21
21
|
paragraphId: string;
|
|
22
|
+
headingCollapsed?: boolean;
|
|
22
23
|
styleId?: string;
|
|
23
24
|
bullet?: import("@univerjs/core").IBullet;
|
|
24
25
|
sourceBullet?: import("@univerjs/core").IBullet | null;
|
|
@@ -28,6 +29,7 @@ export declare const useCurrentParagraph: () => import("@univerjs/core").IParagr
|
|
|
28
29
|
paragraphStyle: import("@univerjs/core").IParagraphStyle;
|
|
29
30
|
startIndex: number;
|
|
30
31
|
paragraphId: string;
|
|
32
|
+
headingCollapsed?: boolean;
|
|
31
33
|
styleId?: string;
|
|
32
34
|
bullet?: import("@univerjs/core").IBullet;
|
|
33
35
|
sourceBullet?: import("@univerjs/core").IBullet | null;
|