@univerjs/drawing-ui 1.0.0-alpha.1 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2483 -1884
- package/lib/cjs/locale/ar-SA.js +45 -0
- package/lib/cjs/locale/ca-ES.js +45 -0
- package/lib/cjs/locale/de-DE.js +45 -0
- package/lib/cjs/locale/en-US.js +45 -0
- package/lib/cjs/locale/es-ES.js +45 -0
- package/lib/cjs/locale/fa-IR.js +45 -0
- package/lib/cjs/locale/fr-FR.js +45 -0
- package/lib/cjs/locale/id-ID.js +45 -0
- package/lib/cjs/locale/it-IT.js +45 -0
- package/lib/cjs/locale/ja-JP.js +45 -0
- package/lib/cjs/locale/ko-KR.js +45 -0
- package/lib/cjs/locale/pl-PL.js +45 -0
- package/lib/cjs/locale/pt-BR.js +45 -0
- package/lib/cjs/locale/ru-RU.js +45 -0
- package/lib/cjs/locale/sk-SK.js +45 -0
- package/lib/cjs/locale/vi-VN.js +45 -0
- package/lib/cjs/locale/zh-CN.js +45 -0
- package/lib/cjs/locale/zh-HK.js +45 -0
- package/lib/cjs/locale/zh-TW.js +45 -0
- package/lib/es/index.js +2477 -1888
- package/lib/es/locale/ar-SA.js +45 -0
- package/lib/es/locale/ca-ES.js +45 -0
- package/lib/es/locale/de-DE.js +45 -0
- package/lib/es/locale/en-US.js +45 -0
- package/lib/es/locale/es-ES.js +45 -0
- package/lib/es/locale/fa-IR.js +45 -0
- package/lib/es/locale/fr-FR.js +45 -0
- package/lib/es/locale/id-ID.js +45 -0
- package/lib/es/locale/it-IT.js +45 -0
- package/lib/es/locale/ja-JP.js +45 -0
- package/lib/es/locale/ko-KR.js +45 -0
- package/lib/es/locale/pl-PL.js +45 -0
- package/lib/es/locale/pt-BR.js +45 -0
- package/lib/es/locale/ru-RU.js +45 -0
- package/lib/es/locale/sk-SK.js +45 -0
- package/lib/es/locale/vi-VN.js +45 -0
- package/lib/es/locale/zh-CN.js +45 -0
- package/lib/es/locale/zh-HK.js +45 -0
- package/lib/es/locale/zh-TW.js +45 -0
- package/lib/index.css +299 -0
- package/lib/index.js +2477 -1888
- package/lib/locale/ar-SA.js +45 -0
- package/lib/locale/ca-ES.js +45 -0
- package/lib/locale/de-DE.js +45 -0
- package/lib/locale/en-US.js +45 -0
- package/lib/locale/es-ES.js +45 -0
- package/lib/locale/fa-IR.js +45 -0
- package/lib/locale/fr-FR.js +45 -0
- package/lib/locale/id-ID.js +45 -0
- package/lib/locale/it-IT.js +45 -0
- package/lib/locale/ja-JP.js +45 -0
- package/lib/locale/ko-KR.js +45 -0
- package/lib/locale/pl-PL.js +45 -0
- package/lib/locale/pt-BR.js +45 -0
- package/lib/locale/ru-RU.js +45 -0
- package/lib/locale/sk-SK.js +45 -0
- package/lib/locale/vi-VN.js +45 -0
- package/lib/locale/zh-CN.js +45 -0
- package/lib/locale/zh-HK.js +45 -0
- package/lib/locale/zh-TW.js +45 -0
- package/lib/types/commands/operations/drawing-group.operation.d.ts +5 -3
- package/lib/types/controllers/image-update.controller.d.ts +2 -2
- package/lib/types/controllers/utils.d.ts +5 -1
- package/lib/types/index.d.ts +6 -1
- package/lib/types/locale/en-US.d.ts +45 -0
- package/lib/types/services/drawing-render.service.d.ts +10 -4
- package/lib/types/utils/rotate-enabled.d.ts +19 -0
- package/lib/types/views/image-popup-menu/ImagePopupMenu.d.ts +10 -3
- package/lib/types/views/object-list-panel/ObjectListPanelBase.d.ts +101 -0
- package/lib/types/views/object-list-panel/object-list-panel-layer.d.ts +21 -0
- package/lib/types/views/panel/drawing-transform-rotation.d.ts +26 -0
- package/lib/umd/index.js +7 -1
- 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 +10 -10
package/lib/locale/ru-RU.js
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
//#region src/locale/ru-RU.ts
|
|
2
2
|
const locale = { "drawing-ui": {
|
|
3
3
|
"image-cropper": { error: "Невозможно обрезать не изображения." },
|
|
4
|
+
objectListPanel: {
|
|
5
|
+
title: "Объекты",
|
|
6
|
+
empty: "Нет объектов",
|
|
7
|
+
showAll: "Показать все",
|
|
8
|
+
hideAll: "Скрыть все",
|
|
9
|
+
moveForward: "Переместить вперед",
|
|
10
|
+
moveBackward: "Переместить назад",
|
|
11
|
+
close: "Закрыть",
|
|
12
|
+
show: "Показать",
|
|
13
|
+
hide: "Скрыть",
|
|
14
|
+
lock: "Заблокировать",
|
|
15
|
+
unlock: "Разблокировать",
|
|
16
|
+
name: "Имя",
|
|
17
|
+
nameInput: "Имя объекта",
|
|
18
|
+
description: "Описание",
|
|
19
|
+
descriptionPlaceholder: "Добавить описание",
|
|
20
|
+
details: "Сведения",
|
|
21
|
+
locate: "Найти",
|
|
22
|
+
expand: "Развернуть",
|
|
23
|
+
collapse: "Свернуть",
|
|
24
|
+
dragToReorder: "Перетащите, чтобы изменить порядок",
|
|
25
|
+
search: "Поиск объектов",
|
|
26
|
+
filterAll: "Все",
|
|
27
|
+
filterHidden: "Скрытые",
|
|
28
|
+
filterLocked: "Заблокированные",
|
|
29
|
+
sectionCanvas: "Слой холста",
|
|
30
|
+
sectionFloating: "Плавающий слой",
|
|
31
|
+
typeNames: {
|
|
32
|
+
object: "Объект",
|
|
33
|
+
shape: "Фигура",
|
|
34
|
+
connector: "Соединитель",
|
|
35
|
+
image: "Изображение",
|
|
36
|
+
chart: "Диаграмма",
|
|
37
|
+
table: "Таблица",
|
|
38
|
+
smartArt: "SmartArt",
|
|
39
|
+
video: "Видео",
|
|
40
|
+
group: "Группа",
|
|
41
|
+
unit: "Единица",
|
|
42
|
+
dom: "DOM",
|
|
43
|
+
text: "Текст",
|
|
44
|
+
placeholder: "Заполнитель",
|
|
45
|
+
container: "Контейнер"
|
|
46
|
+
},
|
|
47
|
+
noSelection: "Выберите объект, чтобы изменить сведения"
|
|
48
|
+
},
|
|
4
49
|
"image-panel": {
|
|
5
50
|
arrange: {
|
|
6
51
|
title: "Расположение",
|
package/lib/locale/sk-SK.js
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
//#region src/locale/sk-SK.ts
|
|
2
2
|
const locale = { "drawing-ui": {
|
|
3
3
|
"image-cropper": { error: "Nedá sa orezať neobrázkový objekt." },
|
|
4
|
+
objectListPanel: {
|
|
5
|
+
title: "Objekty",
|
|
6
|
+
empty: "Ziadne objekty",
|
|
7
|
+
showAll: "Zobrazit vsetko",
|
|
8
|
+
hideAll: "Skryt vsetko",
|
|
9
|
+
moveForward: "Presunut dopredu",
|
|
10
|
+
moveBackward: "Presunut dozadu",
|
|
11
|
+
close: "Zavriet",
|
|
12
|
+
show: "Zobrazit",
|
|
13
|
+
hide: "Skryt",
|
|
14
|
+
lock: "Zamknut",
|
|
15
|
+
unlock: "Odomknut",
|
|
16
|
+
name: "Nazov",
|
|
17
|
+
nameInput: "Nazov objektu",
|
|
18
|
+
description: "Popis",
|
|
19
|
+
descriptionPlaceholder: "Pridat popis",
|
|
20
|
+
details: "Podrobnosti",
|
|
21
|
+
locate: "Nájsť",
|
|
22
|
+
expand: "Rozbaliť",
|
|
23
|
+
collapse: "Zbaliť",
|
|
24
|
+
dragToReorder: "Potiahnutím zmeňte poradie",
|
|
25
|
+
search: "Hľadať objekty",
|
|
26
|
+
filterAll: "Všetky",
|
|
27
|
+
filterHidden: "Skryté",
|
|
28
|
+
filterLocked: "Zamknuté",
|
|
29
|
+
sectionCanvas: "Vrstva plátna",
|
|
30
|
+
sectionFloating: "Plávajúca vrstva",
|
|
31
|
+
typeNames: {
|
|
32
|
+
object: "Objekt",
|
|
33
|
+
shape: "Tvar",
|
|
34
|
+
connector: "Spojnica",
|
|
35
|
+
image: "Obrázok",
|
|
36
|
+
chart: "Graf",
|
|
37
|
+
table: "Tabuľka",
|
|
38
|
+
smartArt: "SmartArt",
|
|
39
|
+
video: "Video",
|
|
40
|
+
group: "Skupina",
|
|
41
|
+
unit: "Jednotka",
|
|
42
|
+
dom: "DOM",
|
|
43
|
+
text: "Text",
|
|
44
|
+
placeholder: "Zástupný symbol",
|
|
45
|
+
container: "Kontajner"
|
|
46
|
+
},
|
|
47
|
+
noSelection: "Vyberte objekt na úpravu podrobností"
|
|
48
|
+
},
|
|
4
49
|
"image-panel": {
|
|
5
50
|
arrange: {
|
|
6
51
|
title: "Usporiadať",
|
package/lib/locale/vi-VN.js
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
//#region src/locale/vi-VN.ts
|
|
2
2
|
const locale = { "drawing-ui": {
|
|
3
3
|
"image-cropper": { error: "Không thể cắt phần tử không phải hình ảnh" },
|
|
4
|
+
objectListPanel: {
|
|
5
|
+
title: "Doi tuong",
|
|
6
|
+
empty: "Khong co doi tuong",
|
|
7
|
+
showAll: "Hien thi tat ca",
|
|
8
|
+
hideAll: "An tat ca",
|
|
9
|
+
moveForward: "Dua len truoc",
|
|
10
|
+
moveBackward: "Dua ra sau",
|
|
11
|
+
close: "Dong",
|
|
12
|
+
show: "Hien thi",
|
|
13
|
+
hide: "An",
|
|
14
|
+
lock: "Khoa",
|
|
15
|
+
unlock: "Mo khoa",
|
|
16
|
+
name: "Ten",
|
|
17
|
+
nameInput: "Ten doi tuong",
|
|
18
|
+
description: "Mo ta",
|
|
19
|
+
descriptionPlaceholder: "Them mo ta",
|
|
20
|
+
details: "Chi tiet",
|
|
21
|
+
locate: "Định vị",
|
|
22
|
+
expand: "Mở rộng",
|
|
23
|
+
collapse: "Thu gọn",
|
|
24
|
+
dragToReorder: "Kéo để sắp xếp lại",
|
|
25
|
+
search: "Tìm đối tượng",
|
|
26
|
+
filterAll: "Tất cả",
|
|
27
|
+
filterHidden: "Đã ẩn",
|
|
28
|
+
filterLocked: "Đã khóa",
|
|
29
|
+
sectionCanvas: "Lớp canvas",
|
|
30
|
+
sectionFloating: "Lớp nổi",
|
|
31
|
+
typeNames: {
|
|
32
|
+
object: "Đối tượng",
|
|
33
|
+
shape: "Hình dạng",
|
|
34
|
+
connector: "Đường nối",
|
|
35
|
+
image: "Hình ảnh",
|
|
36
|
+
chart: "Biểu đồ",
|
|
37
|
+
table: "Bảng",
|
|
38
|
+
smartArt: "SmartArt",
|
|
39
|
+
video: "Video",
|
|
40
|
+
group: "Nhóm",
|
|
41
|
+
unit: "Đơn vị",
|
|
42
|
+
dom: "DOM",
|
|
43
|
+
text: "Văn bản",
|
|
44
|
+
placeholder: "Chỗ dành sẵn",
|
|
45
|
+
container: "Vùng chứa"
|
|
46
|
+
},
|
|
47
|
+
noSelection: "Chọn một đối tượng để chỉnh sửa chi tiết"
|
|
48
|
+
},
|
|
4
49
|
"image-panel": {
|
|
5
50
|
arrange: {
|
|
6
51
|
title: "Sắp xếp",
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
//#region src/locale/zh-CN.ts
|
|
2
2
|
const locale = { "drawing-ui": {
|
|
3
3
|
"image-cropper": { error: "无法裁剪非图片元素" },
|
|
4
|
+
objectListPanel: {
|
|
5
|
+
title: "对象",
|
|
6
|
+
empty: "暂无对象",
|
|
7
|
+
showAll: "全部显示",
|
|
8
|
+
hideAll: "全部隐藏",
|
|
9
|
+
moveForward: "上移一层",
|
|
10
|
+
moveBackward: "下移一层",
|
|
11
|
+
close: "关闭",
|
|
12
|
+
show: "显示",
|
|
13
|
+
hide: "隐藏",
|
|
14
|
+
lock: "锁定",
|
|
15
|
+
unlock: "解锁",
|
|
16
|
+
name: "名称",
|
|
17
|
+
nameInput: "对象名称",
|
|
18
|
+
description: "描述",
|
|
19
|
+
descriptionPlaceholder: "添加描述",
|
|
20
|
+
details: "详情",
|
|
21
|
+
locate: "定位",
|
|
22
|
+
expand: "展开",
|
|
23
|
+
collapse: "折叠",
|
|
24
|
+
dragToReorder: "拖拽调整层级",
|
|
25
|
+
search: "搜索对象",
|
|
26
|
+
filterAll: "全部",
|
|
27
|
+
filterHidden: "隐藏",
|
|
28
|
+
filterLocked: "锁定",
|
|
29
|
+
sectionCanvas: "画布层",
|
|
30
|
+
sectionFloating: "浮动层",
|
|
31
|
+
typeNames: {
|
|
32
|
+
object: "对象",
|
|
33
|
+
shape: "形状",
|
|
34
|
+
connector: "连接线",
|
|
35
|
+
image: "图片",
|
|
36
|
+
chart: "图表",
|
|
37
|
+
table: "表格",
|
|
38
|
+
smartArt: "SmartArt",
|
|
39
|
+
video: "视频",
|
|
40
|
+
group: "组合",
|
|
41
|
+
unit: "单元",
|
|
42
|
+
dom: "DOM",
|
|
43
|
+
text: "文本",
|
|
44
|
+
placeholder: "占位符",
|
|
45
|
+
container: "容器"
|
|
46
|
+
},
|
|
47
|
+
noSelection: "选择一个对象以编辑详情"
|
|
48
|
+
},
|
|
4
49
|
"image-panel": {
|
|
5
50
|
arrange: {
|
|
6
51
|
title: "排列",
|
package/lib/locale/zh-HK.js
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
//#region src/locale/zh-HK.ts
|
|
2
2
|
const locale = { "drawing-ui": {
|
|
3
3
|
"image-cropper": { error: "無法裁切非圖片元素" },
|
|
4
|
+
objectListPanel: {
|
|
5
|
+
title: "物件",
|
|
6
|
+
empty: "暫無物件",
|
|
7
|
+
showAll: "全部顯示",
|
|
8
|
+
hideAll: "全部隱藏",
|
|
9
|
+
moveForward: "上移一層",
|
|
10
|
+
moveBackward: "下移一層",
|
|
11
|
+
close: "關閉",
|
|
12
|
+
show: "顯示",
|
|
13
|
+
hide: "隱藏",
|
|
14
|
+
lock: "鎖定",
|
|
15
|
+
unlock: "解鎖",
|
|
16
|
+
name: "名稱",
|
|
17
|
+
nameInput: "物件名稱",
|
|
18
|
+
description: "描述",
|
|
19
|
+
descriptionPlaceholder: "新增描述",
|
|
20
|
+
details: "詳情",
|
|
21
|
+
locate: "定位",
|
|
22
|
+
expand: "展開",
|
|
23
|
+
collapse: "摺疊",
|
|
24
|
+
dragToReorder: "拖曳調整圖層",
|
|
25
|
+
search: "搜尋物件",
|
|
26
|
+
filterAll: "全部",
|
|
27
|
+
filterHidden: "隱藏",
|
|
28
|
+
filterLocked: "鎖定",
|
|
29
|
+
sectionCanvas: "畫布層",
|
|
30
|
+
sectionFloating: "浮動層",
|
|
31
|
+
typeNames: {
|
|
32
|
+
object: "物件",
|
|
33
|
+
shape: "形狀",
|
|
34
|
+
connector: "連接線",
|
|
35
|
+
image: "圖片",
|
|
36
|
+
chart: "圖表",
|
|
37
|
+
table: "表格",
|
|
38
|
+
smartArt: "SmartArt",
|
|
39
|
+
video: "影片",
|
|
40
|
+
group: "群組",
|
|
41
|
+
unit: "單元",
|
|
42
|
+
dom: "DOM",
|
|
43
|
+
text: "文字",
|
|
44
|
+
placeholder: "佔位符",
|
|
45
|
+
container: "容器"
|
|
46
|
+
},
|
|
47
|
+
noSelection: "請選取一個物件以編輯詳細資訊"
|
|
48
|
+
},
|
|
4
49
|
"image-panel": {
|
|
5
50
|
arrange: {
|
|
6
51
|
title: "排列",
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
//#region src/locale/zh-TW.ts
|
|
2
2
|
const locale = { "drawing-ui": {
|
|
3
3
|
"image-cropper": { error: "無法裁切非圖片元素" },
|
|
4
|
+
objectListPanel: {
|
|
5
|
+
title: "物件",
|
|
6
|
+
empty: "暫無物件",
|
|
7
|
+
showAll: "全部顯示",
|
|
8
|
+
hideAll: "全部隱藏",
|
|
9
|
+
moveForward: "上移一層",
|
|
10
|
+
moveBackward: "下移一層",
|
|
11
|
+
close: "關閉",
|
|
12
|
+
show: "顯示",
|
|
13
|
+
hide: "隱藏",
|
|
14
|
+
lock: "鎖定",
|
|
15
|
+
unlock: "解鎖",
|
|
16
|
+
name: "名稱",
|
|
17
|
+
nameInput: "物件名稱",
|
|
18
|
+
description: "描述",
|
|
19
|
+
descriptionPlaceholder: "新增描述",
|
|
20
|
+
details: "詳細資料",
|
|
21
|
+
locate: "定位",
|
|
22
|
+
expand: "展開",
|
|
23
|
+
collapse: "摺疊",
|
|
24
|
+
dragToReorder: "拖曳調整圖層",
|
|
25
|
+
search: "搜尋物件",
|
|
26
|
+
filterAll: "全部",
|
|
27
|
+
filterHidden: "隱藏",
|
|
28
|
+
filterLocked: "鎖定",
|
|
29
|
+
sectionCanvas: "畫布層",
|
|
30
|
+
sectionFloating: "浮動層",
|
|
31
|
+
typeNames: {
|
|
32
|
+
object: "物件",
|
|
33
|
+
shape: "形狀",
|
|
34
|
+
connector: "連接線",
|
|
35
|
+
image: "圖片",
|
|
36
|
+
chart: "圖表",
|
|
37
|
+
table: "表格",
|
|
38
|
+
smartArt: "SmartArt",
|
|
39
|
+
video: "影片",
|
|
40
|
+
group: "群組",
|
|
41
|
+
unit: "單元",
|
|
42
|
+
dom: "DOM",
|
|
43
|
+
text: "文字",
|
|
44
|
+
placeholder: "預留位置",
|
|
45
|
+
container: "容器"
|
|
46
|
+
},
|
|
47
|
+
noSelection: "請選取一個物件以編輯詳細資訊"
|
|
48
|
+
},
|
|
4
49
|
"image-panel": {
|
|
5
50
|
arrange: {
|
|
6
51
|
title: "排列",
|
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
import type { IDrawingParam, IOperation } from '@univerjs/core';
|
|
17
17
|
import { DrawingTypeEnum } from '@univerjs/core';
|
|
18
18
|
/**
|
|
19
|
-
* Now only support grouping images, shapes, and groups.
|
|
19
|
+
* Now only support grouping images, shapes, charts, and groups.
|
|
20
20
|
*/
|
|
21
|
-
export declare const DRAWING_GROUP_TYPES: DrawingTypeEnum
|
|
21
|
+
export declare const DRAWING_GROUP_TYPES: readonly [DrawingTypeEnum.DRAWING_IMAGE, DrawingTypeEnum.DRAWING_SHAPE, DrawingTypeEnum.DRAWING_CHART, DrawingTypeEnum.DRAWING_GROUP];
|
|
22
22
|
export interface IDrawingGroupOperationParams {
|
|
23
23
|
drawings?: IDrawingParam[];
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Group the selected drawings into a new group. The selected drawings must be
|
|
26
|
+
* Group the selected drawings into a new group. The selected drawings must be
|
|
27
|
+
* of type image, shape, chart, or group, and there must be at least 2 drawings
|
|
28
|
+
* selected.
|
|
27
29
|
*/
|
|
28
30
|
export declare const SetDrawingGroupOperation: IOperation<IDrawingGroupOperationParams>;
|
|
29
31
|
export interface ICancelDrawingGroupOperationParams {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
17
|
-
import { IDrawingManagerService
|
|
16
|
+
import { Disposable, ICommandService, IImageIoService, IUniverInstanceService } from '@univerjs/core';
|
|
17
|
+
import { IDrawingManagerService } from '@univerjs/drawing';
|
|
18
18
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
19
19
|
import { IDialogService } from '@univerjs/ui';
|
|
20
20
|
import { DrawingRenderService } from '../services/drawing-render.service';
|
|
@@ -13,10 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IDrawingSearch, IUniverInstanceService, Nullable } from '@univerjs/core';
|
|
16
|
+
import type { IDrawingParam, IDrawingSearch, IUniverInstanceService, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { IDrawingManagerService } from '@univerjs/drawing';
|
|
18
18
|
import type { BaseObject, Scene } from '@univerjs/engine-render';
|
|
19
19
|
import { UniverInstanceType } from '@univerjs/core';
|
|
20
|
+
import { Group } from '@univerjs/engine-render';
|
|
21
|
+
export declare function getDrawingRenderObject(scene: Scene, drawingSearch: IDrawingSearch): BaseObject | null;
|
|
22
|
+
export declare function disposeDrawingRenderObject(scene: Scene, drawingSearch: IDrawingSearch): boolean;
|
|
23
|
+
export declare function syncGroupRotateEnabled(group: Group, groupParam: IDrawingParam, scene: Scene, drawingManagerService: IDrawingManagerService, children?: readonly IDrawingParam[]): void;
|
|
20
24
|
export declare function insertGroupObject(objectParam: IDrawingSearch, object: BaseObject, scene: Scene, drawingManagerService: IDrawingManagerService): void;
|
|
21
25
|
export declare function getCurrentUnitInfo(currentUniverService: IUniverInstanceService, propUnitId?: string): {
|
|
22
26
|
unitId: string;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -22,7 +22,8 @@ export type { ICancelDrawingGroupOperationParams, IDrawingGroupOperationParams,
|
|
|
22
22
|
export { AutoImageCropOperation, CloseImageCropOperation, OpenImageCropOperation, } from './commands/operations/image-crop.operation';
|
|
23
23
|
export { ImageResetSizeOperation } from './commands/operations/image-reset-size.operation';
|
|
24
24
|
export type { IUniverDrawingUIConfig } from './config/config';
|
|
25
|
-
export { getCurrentUnitInfo, insertGroupObject } from './controllers/utils';
|
|
25
|
+
export { disposeDrawingRenderObject, getCurrentUnitInfo, getDrawingRenderObject, insertGroupObject, } from './controllers/utils';
|
|
26
|
+
export { menuSchema as DrawingUIMenuSchema } from './menu/schema';
|
|
26
27
|
export { UniverDrawingUIPlugin } from './plugin';
|
|
27
28
|
export { DrawingImageClipService, IMAGE_CLIP_SHAPE_PICKER_COMPONENT } from './services/drawing-image-clip.service';
|
|
28
29
|
export type { ImageShapeClipDelegate } from './services/drawing-image-clip.service';
|
|
@@ -30,4 +31,8 @@ export { DrawingRenderService } from './services/drawing-render.service';
|
|
|
30
31
|
export { getUpdateParams } from './utils/get-update-params';
|
|
31
32
|
export { ImageCropperObject } from './views/crop/image-cropper-object';
|
|
32
33
|
export { COMPONENT_IMAGE_POPUP_MENU } from './views/image-popup-menu/component-name';
|
|
34
|
+
export { getObjectListPanelSectionIdForDrawingType, isFloatingObjectListDrawingType, OBJECT_LIST_CANVAS_SECTION_ID, OBJECT_LIST_FLOATING_SECTION_ID, } from './views/object-list-panel/object-list-panel-layer';
|
|
35
|
+
export type { ObjectListPanelSectionId } from './views/object-list-panel/object-list-panel-layer';
|
|
36
|
+
export { getObjectListPanelLabels, getObjectListPanelTypeName, ObjectListPanelBase, } from './views/object-list-panel/ObjectListPanelBase';
|
|
37
|
+
export type { IDrawingObjectListItem, IDrawingObjectListPanelLabels, IDrawingObjectListPanelProps, IObjectListPanelBaseProps, IObjectListPanelItem, IObjectListPanelLabels, ObjectListPanelTypeNameKey, } from './views/object-list-panel/ObjectListPanelBase';
|
|
33
38
|
export { DrawingCommonPanel } from './views/panel/DrawingCommonPanel';
|
|
@@ -18,6 +18,51 @@ declare const locale: {
|
|
|
18
18
|
'image-cropper': {
|
|
19
19
|
error: string;
|
|
20
20
|
};
|
|
21
|
+
objectListPanel: {
|
|
22
|
+
title: string;
|
|
23
|
+
empty: string;
|
|
24
|
+
showAll: string;
|
|
25
|
+
hideAll: string;
|
|
26
|
+
moveForward: string;
|
|
27
|
+
moveBackward: string;
|
|
28
|
+
close: string;
|
|
29
|
+
show: string;
|
|
30
|
+
hide: string;
|
|
31
|
+
lock: string;
|
|
32
|
+
unlock: string;
|
|
33
|
+
name: string;
|
|
34
|
+
nameInput: string;
|
|
35
|
+
description: string;
|
|
36
|
+
descriptionPlaceholder: string;
|
|
37
|
+
details: string;
|
|
38
|
+
locate: string;
|
|
39
|
+
expand: string;
|
|
40
|
+
collapse: string;
|
|
41
|
+
dragToReorder: string;
|
|
42
|
+
search: string;
|
|
43
|
+
filterAll: string;
|
|
44
|
+
filterHidden: string;
|
|
45
|
+
filterLocked: string;
|
|
46
|
+
sectionCanvas: string;
|
|
47
|
+
sectionFloating: string;
|
|
48
|
+
typeNames: {
|
|
49
|
+
object: string;
|
|
50
|
+
shape: string;
|
|
51
|
+
connector: string;
|
|
52
|
+
image: string;
|
|
53
|
+
chart: string;
|
|
54
|
+
table: string;
|
|
55
|
+
smartArt: string;
|
|
56
|
+
video: string;
|
|
57
|
+
group: string;
|
|
58
|
+
unit: string;
|
|
59
|
+
dom: string;
|
|
60
|
+
text: string;
|
|
61
|
+
placeholder: string;
|
|
62
|
+
container: string;
|
|
63
|
+
};
|
|
64
|
+
noSelection: string;
|
|
65
|
+
};
|
|
21
66
|
'image-panel': {
|
|
22
67
|
arrange: {
|
|
23
68
|
title: string;
|
|
@@ -16,13 +16,15 @@
|
|
|
16
16
|
import type { IDrawingParam, IDrawingSearch } from '@univerjs/core';
|
|
17
17
|
import type { IDocFloatDomData, IImageData } from '@univerjs/drawing';
|
|
18
18
|
import type { BaseObject, IRectProps, Scene } from '@univerjs/engine-render';
|
|
19
|
-
import { BooleanNumber, IUniverInstanceService, IURLImageService } from '@univerjs/core';
|
|
20
|
-
import { IDrawingManagerService
|
|
19
|
+
import { BooleanNumber, IImageIoService, IUniverInstanceService, IURLImageService, PositionedObjectLayoutType } from '@univerjs/core';
|
|
20
|
+
import { IDrawingManagerService } from '@univerjs/drawing';
|
|
21
21
|
import { Image, Rect } from '@univerjs/engine-render';
|
|
22
22
|
import { IGalleryService } from '@univerjs/ui';
|
|
23
23
|
import { DrawingImageClipService } from './drawing-image-clip.service';
|
|
24
24
|
type IDrawingParamWithBehindText = (Partial<IDrawingParam> | Partial<IImageData>) & {
|
|
25
25
|
behindText?: boolean | BooleanNumber;
|
|
26
|
+
behindDoc?: BooleanNumber;
|
|
27
|
+
layoutType?: PositionedObjectLayoutType;
|
|
26
28
|
docxHeaderFooterDrawing?: boolean;
|
|
27
29
|
};
|
|
28
30
|
export declare const DOC_DRAWING_BEHIND_TEXT_LAYER_INDEX = 1;
|
|
@@ -36,10 +38,14 @@ export declare class DrawingRenderService {
|
|
|
36
38
|
private readonly _univerInstanceService;
|
|
37
39
|
private readonly _drawingImageClipService;
|
|
38
40
|
constructor(_drawingManagerService: IDrawingManagerService, _imageIoService: IImageIoService, _galleryService: IGalleryService, _urlImageService: IURLImageService, _univerInstanceService: IUniverInstanceService, _drawingImageClipService: DrawingImageClipService);
|
|
39
|
-
renderImages(imageParam: IImageData, scene: Scene
|
|
41
|
+
renderImages(imageParam: IImageData, scene: Scene, options?: {
|
|
42
|
+
allowInactiveSheet?: boolean;
|
|
43
|
+
}): Promise<Image[] | undefined>;
|
|
40
44
|
private _getActiveSheetId;
|
|
41
45
|
renderFloatDom(param: IDocFloatDomData, scene: Scene): Rect<IRectProps>[] | undefined;
|
|
42
|
-
renderDrawing(param: IDrawingSearch, scene: Scene
|
|
46
|
+
renderDrawing(param: IDrawingSearch, scene: Scene, options?: {
|
|
47
|
+
allowInactiveSheet?: boolean;
|
|
48
|
+
}): Promise<Image[] | undefined> | undefined;
|
|
43
49
|
previewImage(key: string, src: string, width: number, height: number): void;
|
|
44
50
|
private _adjustImageSize;
|
|
45
51
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { DrawingType, IDrawingParam } from '@univerjs/core';
|
|
17
|
+
import type { IDrawingRotateEnabledResolverOptions } from '@univerjs/drawing';
|
|
18
|
+
export declare function isKnownDrawingUINonRotatableType(drawingType: DrawingType): boolean;
|
|
19
|
+
export declare function resolveDrawingUIRotateEnabled(drawing: IDrawingParam, options?: IDrawingRotateEnabledResolverOptions): boolean;
|
|
@@ -13,17 +13,24 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { LocaleKey } from '../../locale/types';
|
|
17
16
|
export interface IImagePopupMenuItem {
|
|
18
|
-
label:
|
|
17
|
+
label: string;
|
|
19
18
|
index: number;
|
|
20
19
|
commandId: string;
|
|
21
20
|
commandParams?: object;
|
|
22
21
|
disable: boolean;
|
|
22
|
+
type?: 'button' | 'select';
|
|
23
|
+
value?: string;
|
|
24
|
+
options?: Array<{
|
|
25
|
+
label: unknown;
|
|
26
|
+
value: string;
|
|
27
|
+
}>;
|
|
28
|
+
commandParamsFactory?: (value: string) => object;
|
|
29
|
+
icon?: string;
|
|
23
30
|
}
|
|
24
31
|
export interface IImagePopupMenuExtraProps {
|
|
25
32
|
menuItems: IImagePopupMenuItem[];
|
|
26
|
-
variant?: 'doc-floating-toolbar';
|
|
33
|
+
variant?: 'doc-floating-toolbar' | 'doc-chart-floating-toolbar';
|
|
27
34
|
unitId?: string;
|
|
28
35
|
subUnitId?: string;
|
|
29
36
|
drawingId?: string;
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
+
export interface IObjectListPanelCapabilities {
|
|
17
|
+
arrange?: boolean;
|
|
18
|
+
description?: boolean;
|
|
19
|
+
locate?: boolean;
|
|
20
|
+
name?: boolean;
|
|
21
|
+
reorder?: boolean;
|
|
22
|
+
selectable?: boolean;
|
|
23
|
+
visible?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface IObjectListPanelItem {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
visible: boolean;
|
|
30
|
+
selectable?: boolean;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
level?: number;
|
|
33
|
+
isGroup?: boolean;
|
|
34
|
+
expanded?: boolean;
|
|
35
|
+
canMoveForward?: boolean;
|
|
36
|
+
canMoveBackward?: boolean;
|
|
37
|
+
canReorder?: boolean;
|
|
38
|
+
parentId?: string;
|
|
39
|
+
sectionId?: string;
|
|
40
|
+
sectionTitle?: string;
|
|
41
|
+
capabilities?: IObjectListPanelCapabilities;
|
|
42
|
+
}
|
|
43
|
+
export interface IObjectListPanelLabels {
|
|
44
|
+
title: string;
|
|
45
|
+
empty: string;
|
|
46
|
+
showAll: string;
|
|
47
|
+
hideAll: string;
|
|
48
|
+
moveForward: string;
|
|
49
|
+
moveBackward: string;
|
|
50
|
+
close: string;
|
|
51
|
+
show: string;
|
|
52
|
+
hide: string;
|
|
53
|
+
lock: string;
|
|
54
|
+
unlock: string;
|
|
55
|
+
name: string;
|
|
56
|
+
nameInput: string;
|
|
57
|
+
description: string;
|
|
58
|
+
descriptionPlaceholder: string;
|
|
59
|
+
details: string;
|
|
60
|
+
noSelection: string;
|
|
61
|
+
locate: string;
|
|
62
|
+
expand: string;
|
|
63
|
+
collapse: string;
|
|
64
|
+
dragToReorder: string;
|
|
65
|
+
search: string;
|
|
66
|
+
filterAll: string;
|
|
67
|
+
filterHidden: string;
|
|
68
|
+
filterLocked: string;
|
|
69
|
+
sectionCanvas: string;
|
|
70
|
+
sectionFloating: string;
|
|
71
|
+
}
|
|
72
|
+
export type ObjectListPanelTypeNameKey = 'chart' | 'connector' | 'container' | 'dom' | 'group' | 'image' | 'object' | 'placeholder' | 'shape' | 'smartArt' | 'table' | 'text' | 'unit' | 'video';
|
|
73
|
+
interface IObjectListPanelLocaleService {
|
|
74
|
+
t: (key: string) => string;
|
|
75
|
+
}
|
|
76
|
+
export declare function getObjectListPanelLabels(localeService: IObjectListPanelLocaleService): IObjectListPanelLabels;
|
|
77
|
+
export declare function getObjectListPanelTypeName(localeService: IObjectListPanelLocaleService, typeName: ObjectListPanelTypeNameKey): string;
|
|
78
|
+
export interface IObjectListPanelBaseProps {
|
|
79
|
+
items: IObjectListPanelItem[];
|
|
80
|
+
selectedIds: string[];
|
|
81
|
+
allObjectIds?: string[];
|
|
82
|
+
focusedId?: string | null;
|
|
83
|
+
labels: IObjectListPanelLabels;
|
|
84
|
+
showHeader?: boolean;
|
|
85
|
+
capabilities?: IObjectListPanelCapabilities;
|
|
86
|
+
onSelect: (objectId: string, multiSelect: boolean) => void;
|
|
87
|
+
onSetVisible: (objectIds: string[], visible: boolean) => void;
|
|
88
|
+
onCommitName: (objectId: string, value: string) => void;
|
|
89
|
+
onCommitDescription: (objectId: string, value: string) => void;
|
|
90
|
+
onMoveForward?: (objectId: string) => void;
|
|
91
|
+
onMoveBackward?: (objectId: string) => void;
|
|
92
|
+
onToggleExpanded?: (objectId: string) => void;
|
|
93
|
+
onToggleSelectable?: (objectId: string) => void;
|
|
94
|
+
onLocate?: (objectId: string) => void;
|
|
95
|
+
onReorder?: (sourceObjectId: string, targetObjectId: string) => void;
|
|
96
|
+
}
|
|
97
|
+
export declare function ObjectListPanelBase(props: IObjectListPanelBaseProps): import("react").JSX.Element;
|
|
98
|
+
export type IDrawingObjectListItem = IObjectListPanelItem;
|
|
99
|
+
export type IDrawingObjectListPanelLabels = IObjectListPanelLabels;
|
|
100
|
+
export type IDrawingObjectListPanelProps = IObjectListPanelBaseProps;
|
|
101
|
+
export {};
|
|
@@ -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 { DrawingType } from '@univerjs/core';
|
|
17
|
+
export declare const OBJECT_LIST_FLOATING_SECTION_ID = "floating";
|
|
18
|
+
export declare const OBJECT_LIST_CANVAS_SECTION_ID = "canvas";
|
|
19
|
+
export type ObjectListPanelSectionId = typeof OBJECT_LIST_FLOATING_SECTION_ID | typeof OBJECT_LIST_CANVAS_SECTION_ID;
|
|
20
|
+
export declare function isFloatingObjectListDrawingType(drawingType: DrawingType | null | undefined): boolean;
|
|
21
|
+
export declare function getObjectListPanelSectionIdForDrawingType(drawingType: DrawingType | null | undefined): ObjectListPanelSectionId;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { IDrawingParam } from '@univerjs/core';
|
|
17
|
+
interface IDrawingTransformRotationChangeHandlerOptions {
|
|
18
|
+
rotateEnabled: boolean;
|
|
19
|
+
drawingParam: Pick<IDrawingParam, 'unitId' | 'subUnitId' | 'drawingId' | 'drawingType'>;
|
|
20
|
+
setRotation: (rotation: number) => void;
|
|
21
|
+
emitUpdate: (updateParams: IDrawingParam[]) => void;
|
|
22
|
+
notifyChange: () => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function isDrawingTransformRotationDisabled(rotateEnabled: boolean): boolean;
|
|
25
|
+
export declare function createDrawingTransformRotationChangeHandler(options: IDrawingTransformRotationChangeHandlerOptions): (val: number | null) => void;
|
|
26
|
+
export {};
|