@univerjs/sheets-drawing-ui 0.12.3 → 0.12.4
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 +2 -2
- 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/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 +439 -395
- package/lib/es/index.js +1786 -1234
- package/lib/es/locale/ca-ES.js +15 -2
- package/lib/es/locale/en-US.js +13 -0
- package/lib/es/locale/es-ES.js +13 -0
- package/lib/es/locale/fa-IR.js +13 -0
- package/lib/es/locale/fr-FR.js +13 -0
- package/lib/es/locale/ja-JP.js +13 -0
- package/lib/es/locale/ko-KR.js +13 -0
- package/lib/es/locale/ru-RU.js +13 -0
- package/lib/es/locale/vi-VN.js +13 -0
- package/lib/es/locale/zh-CN.js +13 -0
- package/lib/es/locale/zh-TW.js +17 -4
- package/lib/facade.js +439 -395
- package/lib/index.css +1 -1
- package/lib/index.js +1786 -1234
- package/lib/locale/ca-ES.js +15 -2
- package/lib/locale/en-US.js +13 -0
- package/lib/locale/es-ES.js +13 -0
- package/lib/locale/fa-IR.js +13 -0
- package/lib/locale/fr-FR.js +13 -0
- package/lib/locale/ja-JP.js +13 -0
- package/lib/locale/ko-KR.js +13 -0
- package/lib/locale/ru-RU.js +13 -0
- package/lib/locale/vi-VN.js +13 -0
- package/lib/locale/zh-CN.js +13 -0
- package/lib/locale/zh-TW.js +17 -4
- package/lib/types/commands/commands/save-cell-images.command.d.ts +2 -0
- package/lib/types/facade/f-range.d.ts +40 -0
- package/lib/types/facade/f-worksheet.d.ts +29 -0
- package/lib/types/index.d.ts +3 -1
- package/lib/types/locale/en-US.d.ts +13 -0
- package/lib/types/services/batch-save-images.service.d.ts +148 -0
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +2 -0
- package/lib/types/views/batch-save-images/BatchSaveImagesDialog.d.ts +16 -0
- package/lib/types/views/batch-save-images/component-name.d.ts +16 -0
- package/lib/types/views/batch-save-images/index.d.ts +17 -0
- package/lib/types/views/menu/save-images.menu.d.ts +4 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- 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/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 +16 -15
package/lib/locale/ca-ES.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = {
|
|
2
2
|
sheetImage: {
|
|
3
3
|
title: "Imatge",
|
|
4
4
|
upload: {
|
|
@@ -7,6 +7,19 @@ const a = {
|
|
|
7
7
|
},
|
|
8
8
|
panel: {
|
|
9
9
|
title: "Edita la imatge"
|
|
10
|
+
},
|
|
11
|
+
save: {
|
|
12
|
+
title: "Desa les imatges de cel·la",
|
|
13
|
+
menuLabel: "Desa les imatges de cel·la",
|
|
14
|
+
imageCount: "Nombre d'imatges",
|
|
15
|
+
fileNameConfig: "Nom del fitxer",
|
|
16
|
+
useRowCol: "Utilitza l'adreça de la cel·la (A1, B2...)",
|
|
17
|
+
useColumnValue: "Utilitza el valor de la columna",
|
|
18
|
+
selectColumn: "Selecciona la columna",
|
|
19
|
+
cancel: "Cancel·la",
|
|
20
|
+
confirm: "Desa",
|
|
21
|
+
saving: "Desant...",
|
|
22
|
+
error: "No s'han pogut desar les imatges de cel·la"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"image-popup": {
|
|
@@ -35,5 +48,5 @@ const a = {
|
|
|
35
48
|
}
|
|
36
49
|
};
|
|
37
50
|
export {
|
|
38
|
-
|
|
51
|
+
e as default
|
|
39
52
|
};
|
package/lib/locale/en-US.js
CHANGED
|
@@ -7,6 +7,19 @@ const e = {
|
|
|
7
7
|
},
|
|
8
8
|
panel: {
|
|
9
9
|
title: "Edit Image"
|
|
10
|
+
},
|
|
11
|
+
save: {
|
|
12
|
+
title: "Save Cell Images",
|
|
13
|
+
menuLabel: "Save Cell Images",
|
|
14
|
+
imageCount: "Image Count",
|
|
15
|
+
fileNameConfig: "File Name",
|
|
16
|
+
useRowCol: "Use Cell Address (A1, B2...)",
|
|
17
|
+
useColumnValue: "Use Column Value",
|
|
18
|
+
selectColumn: "Select Column",
|
|
19
|
+
cancel: "Cancel",
|
|
20
|
+
confirm: "Save",
|
|
21
|
+
saving: "Saving...",
|
|
22
|
+
error: "Failed to save cell images"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"image-popup": {
|
package/lib/locale/es-ES.js
CHANGED
|
@@ -7,6 +7,19 @@ const e = {
|
|
|
7
7
|
},
|
|
8
8
|
panel: {
|
|
9
9
|
title: "Editar imagen"
|
|
10
|
+
},
|
|
11
|
+
save: {
|
|
12
|
+
title: "Guardar imágenes de celda",
|
|
13
|
+
menuLabel: "Guardar imágenes de celda",
|
|
14
|
+
imageCount: "Cantidad de imágenes",
|
|
15
|
+
fileNameConfig: "Nombre del archivo",
|
|
16
|
+
useRowCol: "Usar dirección de celda (A1, B2...)",
|
|
17
|
+
useColumnValue: "Usar valor de columna",
|
|
18
|
+
selectColumn: "Seleccionar columna",
|
|
19
|
+
cancel: "Cancelar",
|
|
20
|
+
confirm: "Guardar",
|
|
21
|
+
saving: "Guardando...",
|
|
22
|
+
error: "Error al guardar las imágenes de celda"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"image-popup": {
|
package/lib/locale/fa-IR.js
CHANGED
|
@@ -7,6 +7,19 @@ const e = {
|
|
|
7
7
|
},
|
|
8
8
|
panel: {
|
|
9
9
|
title: "ویرایش تصویر"
|
|
10
|
+
},
|
|
11
|
+
save: {
|
|
12
|
+
title: "ذخیره تصاویر سلول",
|
|
13
|
+
menuLabel: "ذخیره تصاویر سلول",
|
|
14
|
+
imageCount: "تعداد تصاویر",
|
|
15
|
+
fileNameConfig: "نام فایل",
|
|
16
|
+
useRowCol: "استفاده از آدرس سلول (A1, B2...)",
|
|
17
|
+
useColumnValue: "استفاده از مقدار ستون",
|
|
18
|
+
selectColumn: "انتخاب ستون",
|
|
19
|
+
cancel: "لغو",
|
|
20
|
+
confirm: "ذخیره",
|
|
21
|
+
saving: "در حال ذخیره...",
|
|
22
|
+
error: "ذخیره تصاویر سلول ناموفق بود"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"image-popup": {
|
package/lib/locale/fr-FR.js
CHANGED
|
@@ -7,6 +7,19 @@ const e = {
|
|
|
7
7
|
},
|
|
8
8
|
panel: {
|
|
9
9
|
title: "Modifier l'image"
|
|
10
|
+
},
|
|
11
|
+
save: {
|
|
12
|
+
title: "Enregistrer les images de cellule",
|
|
13
|
+
menuLabel: "Enregistrer les images de cellule",
|
|
14
|
+
imageCount: "Nombre d'images",
|
|
15
|
+
fileNameConfig: "Nom du fichier",
|
|
16
|
+
useRowCol: "Utiliser l'adresse de cellule (A1, B2...)",
|
|
17
|
+
useColumnValue: "Utiliser la valeur de la colonne",
|
|
18
|
+
selectColumn: "Sélectionner la colonne",
|
|
19
|
+
cancel: "Annuler",
|
|
20
|
+
confirm: "Enregistrer",
|
|
21
|
+
saving: "Enregistrement...",
|
|
22
|
+
error: "Échec de l'enregistrement des images de cellule"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"image-popup": {
|
package/lib/locale/ja-JP.js
CHANGED
|
@@ -7,6 +7,19 @@ const e = {
|
|
|
7
7
|
},
|
|
8
8
|
panel: {
|
|
9
9
|
title: "画像の編集"
|
|
10
|
+
},
|
|
11
|
+
save: {
|
|
12
|
+
title: "セル画像を保存",
|
|
13
|
+
menuLabel: "セル画像を保存",
|
|
14
|
+
imageCount: "画像数",
|
|
15
|
+
fileNameConfig: "ファイル名",
|
|
16
|
+
useRowCol: "セルアドレスを使用 (A1, B2...)",
|
|
17
|
+
useColumnValue: "列の値を使用",
|
|
18
|
+
selectColumn: "列を選択",
|
|
19
|
+
cancel: "キャンセル",
|
|
20
|
+
confirm: "保存",
|
|
21
|
+
saving: "保存中...",
|
|
22
|
+
error: "セル画像の保存に失敗しました"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"image-popup": {
|
package/lib/locale/ko-KR.js
CHANGED
|
@@ -7,6 +7,19 @@ const e = {
|
|
|
7
7
|
},
|
|
8
8
|
panel: {
|
|
9
9
|
title: "이미지 편집"
|
|
10
|
+
},
|
|
11
|
+
save: {
|
|
12
|
+
title: "셀 이미지 저장",
|
|
13
|
+
menuLabel: "셀 이미지 저장",
|
|
14
|
+
imageCount: "이미지 수",
|
|
15
|
+
fileNameConfig: "파일 이름",
|
|
16
|
+
useRowCol: "셀 주소 사용 (A1, B2...)",
|
|
17
|
+
useColumnValue: "열 값 사용",
|
|
18
|
+
selectColumn: "열 선택",
|
|
19
|
+
cancel: "취소",
|
|
20
|
+
confirm: "저장",
|
|
21
|
+
saving: "저장 중...",
|
|
22
|
+
error: "셀 이미지 저장 실패"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"image-popup": {
|
package/lib/locale/ru-RU.js
CHANGED
|
@@ -7,6 +7,19 @@ const e = {
|
|
|
7
7
|
},
|
|
8
8
|
panel: {
|
|
9
9
|
title: "Редактировать изображение"
|
|
10
|
+
},
|
|
11
|
+
save: {
|
|
12
|
+
title: "Сохранить изображения ячеек",
|
|
13
|
+
menuLabel: "Сохранить изображения ячеек",
|
|
14
|
+
imageCount: "Количество изображений",
|
|
15
|
+
fileNameConfig: "Имя файла",
|
|
16
|
+
useRowCol: "Использовать адрес ячейки (A1, B2...)",
|
|
17
|
+
useColumnValue: "Использовать значение столбца",
|
|
18
|
+
selectColumn: "Выбрать столбец",
|
|
19
|
+
cancel: "Отмена",
|
|
20
|
+
confirm: "Сохранить",
|
|
21
|
+
saving: "Сохранение...",
|
|
22
|
+
error: "Не удалось сохранить изображения ячеек"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"image-popup": {
|
package/lib/locale/vi-VN.js
CHANGED
|
@@ -7,6 +7,19 @@ const h = {
|
|
|
7
7
|
},
|
|
8
8
|
panel: {
|
|
9
9
|
title: "Chỉnh sửa hình ảnh"
|
|
10
|
+
},
|
|
11
|
+
save: {
|
|
12
|
+
title: "Lưu hình ảnh ô",
|
|
13
|
+
menuLabel: "Lưu hình ảnh ô",
|
|
14
|
+
imageCount: "Số lượng hình ảnh",
|
|
15
|
+
fileNameConfig: "Tên tệp",
|
|
16
|
+
useRowCol: "Sử dụng địa chỉ ô (A1, B2...)",
|
|
17
|
+
useColumnValue: "Sử dụng giá trị cột",
|
|
18
|
+
selectColumn: "Chọn cột",
|
|
19
|
+
cancel: "Hủy",
|
|
20
|
+
confirm: "Lưu",
|
|
21
|
+
saving: "Đang lưu...",
|
|
22
|
+
error: "Lưu hình ảnh ô thất bại"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"image-popup": {
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -7,6 +7,19 @@ const e = {
|
|
|
7
7
|
},
|
|
8
8
|
panel: {
|
|
9
9
|
title: "编辑图片"
|
|
10
|
+
},
|
|
11
|
+
save: {
|
|
12
|
+
title: "保存单元格图片",
|
|
13
|
+
menuLabel: "保存单元格图片",
|
|
14
|
+
imageCount: "图片数量",
|
|
15
|
+
fileNameConfig: "文件名",
|
|
16
|
+
useRowCol: "使用单元格地址 (A1, B2...)",
|
|
17
|
+
useColumnValue: "使用某列的值",
|
|
18
|
+
selectColumn: "选择列",
|
|
19
|
+
cancel: "取消",
|
|
20
|
+
confirm: "保存",
|
|
21
|
+
saving: "保存中...",
|
|
22
|
+
error: "保存单元格图片失败"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"image-popup": {
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -7,6 +7,19 @@ const e = {
|
|
|
7
7
|
},
|
|
8
8
|
panel: {
|
|
9
9
|
title: "編圖"
|
|
10
|
+
},
|
|
11
|
+
save: {
|
|
12
|
+
title: "儲存儲存格圖片",
|
|
13
|
+
menuLabel: "儲存儲存格圖片",
|
|
14
|
+
imageCount: "圖片數量",
|
|
15
|
+
fileNameConfig: "檔案名稱",
|
|
16
|
+
useRowCol: "使用儲存格地址 (A1, B2...)",
|
|
17
|
+
useColumnValue: "使用某欄的值",
|
|
18
|
+
selectColumn: "選擇欄",
|
|
19
|
+
cancel: "取消",
|
|
20
|
+
confirm: "儲存",
|
|
21
|
+
saving: "儲存中...",
|
|
22
|
+
error: "儲存儲存格圖片失敗"
|
|
10
23
|
}
|
|
11
24
|
},
|
|
12
25
|
"image-popup": {
|
|
@@ -20,7 +33,7 @@ const e = {
|
|
|
20
33
|
title: "錨點屬性",
|
|
21
34
|
both: "與儲存格一起移動和調整大小",
|
|
22
35
|
position: "移動但不調整大小與儲存格",
|
|
23
|
-
none: "
|
|
36
|
+
none: "不要移動或調整大小與儲存格"
|
|
24
37
|
},
|
|
25
38
|
"update-status": {
|
|
26
39
|
exceedMaxSize: "圖片大小超過限制, 限制為{0}M",
|
|
@@ -29,9 +42,9 @@ const e = {
|
|
|
29
42
|
invalidImage: "無效圖片"
|
|
30
43
|
},
|
|
31
44
|
"cell-image": {
|
|
32
|
-
pasteTitle: "
|
|
33
|
-
pasteContent: "
|
|
34
|
-
pasteError: "
|
|
45
|
+
pasteTitle: "貼上為儲存格圖片",
|
|
46
|
+
pasteContent: "貼上儲存格圖片將覆蓋儲存格中的現有內容,繼續貼上",
|
|
47
|
+
pasteError: "此儲存格不支援儲存格圖片複製貼上"
|
|
35
48
|
}
|
|
36
49
|
};
|
|
37
50
|
export {
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { FRange } from '@univerjs/sheets/facade';
|
|
2
|
+
/**
|
|
3
|
+
* Options for saving cell images
|
|
4
|
+
*/
|
|
5
|
+
export interface ISaveCellImagesOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to use cell address in file name (e.g., A1, B2)
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
useCellAddress?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Column index to use for file name (0-based). If specified, the value from this column will be used in file name.
|
|
13
|
+
*/
|
|
14
|
+
useColumnIndex?: number;
|
|
15
|
+
}
|
|
2
16
|
export interface IFRangeSheetDrawingMixin {
|
|
3
17
|
/**
|
|
4
18
|
* Inserts an image into the current cell.
|
|
@@ -17,9 +31,35 @@ export interface IFRangeSheetDrawingMixin {
|
|
|
17
31
|
* ```
|
|
18
32
|
*/
|
|
19
33
|
insertCellImageAsync(file: File | string): Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Save all cell images in this range to the file system.
|
|
36
|
+
* This method will open a directory picker dialog and save all images to the selected directory.
|
|
37
|
+
*
|
|
38
|
+
* @param {ISaveCellImagesOptions} [options] Options for saving images
|
|
39
|
+
* @returns {Promise<boolean>} True if images are saved successfully, otherwise false
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
43
|
+
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
44
|
+
*
|
|
45
|
+
* // Save all cell images in range A1:D10
|
|
46
|
+
* const fRange = fWorksheet.getRange('A1:D10');
|
|
47
|
+
*
|
|
48
|
+
* // Save with default options (using cell address as file name)
|
|
49
|
+
* await fRange.saveCellImagesAsync();
|
|
50
|
+
*
|
|
51
|
+
* // Save with custom options
|
|
52
|
+
* await fRange.saveCellImagesAsync({
|
|
53
|
+
* useCellAddress: true,
|
|
54
|
+
* useColumnIndex: 0, // Use values from column A for file names
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
saveCellImagesAsync(options?: ISaveCellImagesOptions): Promise<boolean>;
|
|
20
59
|
}
|
|
21
60
|
export declare class FRangeSheetDrawingUI extends FRange implements IFRangeSheetDrawingMixin {
|
|
22
61
|
insertCellImageAsync(file: File | string): Promise<boolean>;
|
|
62
|
+
saveCellImagesAsync(options?: ISaveCellImagesOptions): Promise<boolean>;
|
|
23
63
|
}
|
|
24
64
|
declare module '@univerjs/sheets/facade' {
|
|
25
65
|
interface FRange extends IFRangeSheetDrawingMixin {
|
|
@@ -4,6 +4,7 @@ import { ISheetImage } from '@univerjs/sheets-drawing';
|
|
|
4
4
|
import { ICanvasFloatDom, ICanvasFloatDomInfo, IDOMAnchor } from '@univerjs/sheets-drawing-ui';
|
|
5
5
|
import { IFComponentKey } from '@univerjs/sheets-ui/facade';
|
|
6
6
|
import { FRange, FWorksheet } from '@univerjs/sheets/facade';
|
|
7
|
+
import { ISaveCellImagesOptions } from './f-range';
|
|
7
8
|
import { FOverGridImage, FOverGridImageBuilder } from './f-over-grid-image';
|
|
8
9
|
export interface IFICanvasFloatDom extends Omit<ICanvasFloatDom, 'componentKey' | 'unitId' | 'subUnitId'>, IFComponentKey {
|
|
9
10
|
}
|
|
@@ -544,6 +545,33 @@ export interface IFWorksheetLegacy {
|
|
|
544
545
|
* ```
|
|
545
546
|
*/
|
|
546
547
|
newOverGridImage(): FOverGridImageBuilder;
|
|
548
|
+
/**
|
|
549
|
+
* Save all cell images from specified ranges to the file system.
|
|
550
|
+
* This method will open a directory picker dialog and save all images to the selected directory.
|
|
551
|
+
*
|
|
552
|
+
* @param {ISaveCellImagesOptions} [options] - Options for saving images
|
|
553
|
+
* @param {FRange[]} [ranges] - The ranges to get cell images from. If not provided, all images in the worksheet will be saved.
|
|
554
|
+
* @returns {Promise<boolean>} True if images are saved successfully, otherwise false
|
|
555
|
+
* @example
|
|
556
|
+
* ```ts
|
|
557
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
558
|
+
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
559
|
+
*
|
|
560
|
+
* // Save cell images from multiple ranges
|
|
561
|
+
* const range1 = fWorksheet.getRange('A1:B10');
|
|
562
|
+
* const range2 = fWorksheet.getRange('D1:E10');
|
|
563
|
+
*
|
|
564
|
+
* // Save with default options (using cell address as file name)
|
|
565
|
+
* await fWorksheet.saveCellImagesAsync(undefined, [range1, range2]);
|
|
566
|
+
*
|
|
567
|
+
* // Save with custom options
|
|
568
|
+
* await fWorksheet.saveCellImagesAsync({
|
|
569
|
+
* useCellAddress: true,
|
|
570
|
+
* useColumnIndex: 2, // Use values from column C for file names
|
|
571
|
+
* }, [range1, range2]);
|
|
572
|
+
* ```
|
|
573
|
+
*/
|
|
574
|
+
saveCellImagesAsync(options?: ISaveCellImagesOptions, ranges?: FRange[]): Promise<boolean>;
|
|
547
575
|
}
|
|
548
576
|
export declare class FWorksheetLegacy extends FWorksheet implements IFWorksheetLegacy {
|
|
549
577
|
getFloatDomById(id: string): Nullable<IFCanvasFloatDomResult>;
|
|
@@ -577,6 +605,7 @@ export declare class FWorksheetLegacy extends FWorksheet implements IFWorksheetL
|
|
|
577
605
|
onImageDeleted(callback: (images: FOverGridImage[]) => void): IDisposable;
|
|
578
606
|
onImageChanged(callback: (images: FOverGridImage[]) => void): IDisposable;
|
|
579
607
|
newOverGridImage(): FOverGridImageBuilder;
|
|
608
|
+
saveCellImagesAsync(options?: ISaveCellImagesOptions, ranges?: FRange[]): Promise<boolean>;
|
|
580
609
|
}
|
|
581
610
|
declare module '@univerjs/sheets/facade' {
|
|
582
611
|
interface FWorksheet extends IFWorksheetLegacy {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export { InsertSheetDrawingCommand } from './commands/commands/insert-sheet-draw
|
|
|
22
22
|
export type { IDeleteDrawingCommandParams, IInsertDrawingCommandParams, ISetDrawingCommandParams } from './commands/commands/interfaces';
|
|
23
23
|
export { MoveDrawingsCommand } from './commands/commands/move-drawings.command';
|
|
24
24
|
export { RemoveSheetDrawingCommand } from './commands/commands/remove-sheet-drawing.command';
|
|
25
|
+
export { SaveCellImagesCommand } from './commands/commands/save-cell-images.command';
|
|
25
26
|
export { SetDrawingArrangeCommand } from './commands/commands/set-drawing-arrange.command';
|
|
26
27
|
export { SetSheetDrawingCommand } from './commands/commands/set-sheet-drawing.command';
|
|
27
28
|
export { UngroupSheetDrawingCommand } from './commands/commands/ungroup-sheet-drawing.command';
|
|
@@ -31,5 +32,6 @@ export { SidebarSheetDrawingOperation } from './commands/operations/open-drawing
|
|
|
31
32
|
export type { IUniverSheetsDrawingUIConfig } from './controllers/config.schema';
|
|
32
33
|
export { SheetDrawingUpdateController } from './controllers/sheet-drawing-update.controller';
|
|
33
34
|
export { UniverSheetsDrawingUIPlugin } from './plugin';
|
|
34
|
-
export {
|
|
35
|
+
export { BatchSaveImagesService, FileNamePart, type IBatchSaveImagesConfig, IBatchSaveImagesService, type ICellImageInfo } from './services/batch-save-images.service';
|
|
36
|
+
export { calcSheetFloatDomPosition, type ICanvasFloatDom, type ICanvasFloatDomInfo, type IDOMAnchor, SHEET_FLOAT_DOM_PREFIX, SheetCanvasFloatDomManagerService } from './services/canvas-float-dom-manager.service';
|
|
35
37
|
export { SHEETS_IMAGE_MENU_ID } from './views/menu/image.menu';
|
|
@@ -23,6 +23,19 @@ declare const locale: {
|
|
|
23
23
|
panel: {
|
|
24
24
|
title: string;
|
|
25
25
|
};
|
|
26
|
+
save: {
|
|
27
|
+
title: string;
|
|
28
|
+
menuLabel: string;
|
|
29
|
+
imageCount: string;
|
|
30
|
+
fileNameConfig: string;
|
|
31
|
+
useRowCol: string;
|
|
32
|
+
useColumnValue: string;
|
|
33
|
+
selectColumn: string;
|
|
34
|
+
cancel: string;
|
|
35
|
+
confirm: string;
|
|
36
|
+
saving: string;
|
|
37
|
+
error: string;
|
|
38
|
+
};
|
|
26
39
|
};
|
|
27
40
|
'image-popup': {
|
|
28
41
|
replace: string;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { IRange, Disposable, IImageIoService, ImageSourceType, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
showDirectoryPicker(options?: {
|
|
6
|
+
mode?: 'read' | 'readwrite';
|
|
7
|
+
}): Promise<FileSystemDirectoryHandle>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* File name part type for multi-select
|
|
12
|
+
*/
|
|
13
|
+
export declare enum FileNamePart {
|
|
14
|
+
/**
|
|
15
|
+
* Use cell address as part of file name (e.g., A1, B2)
|
|
16
|
+
*/
|
|
17
|
+
CELL_ADDRESS = "cellAddress",
|
|
18
|
+
/**
|
|
19
|
+
* Use value from a specific column as part of file name
|
|
20
|
+
*/
|
|
21
|
+
COLUMN_VALUE = "columnValue"
|
|
22
|
+
}
|
|
23
|
+
export interface ICellImageInfo {
|
|
24
|
+
row: number;
|
|
25
|
+
col: number;
|
|
26
|
+
cellAddress: string;
|
|
27
|
+
source: string;
|
|
28
|
+
imageSourceType: ImageSourceType;
|
|
29
|
+
imageId: string;
|
|
30
|
+
}
|
|
31
|
+
export interface IBatchSaveImagesConfig {
|
|
32
|
+
/**
|
|
33
|
+
* Selected file name parts (multi-select)
|
|
34
|
+
*/
|
|
35
|
+
fileNameParts: FileNamePart[];
|
|
36
|
+
/**
|
|
37
|
+
* Column index for COLUMN_VALUE part
|
|
38
|
+
*/
|
|
39
|
+
columnIndex?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface IBatchSaveImagesService {
|
|
42
|
+
/**
|
|
43
|
+
* Get all cell images in the current selection
|
|
44
|
+
*/
|
|
45
|
+
getCellImagesInSelection(): ICellImageInfo[];
|
|
46
|
+
/**
|
|
47
|
+
* Get cell images from specified ranges
|
|
48
|
+
* @param unitId The workbook unit ID
|
|
49
|
+
* @param subUnitId The worksheet ID
|
|
50
|
+
* @param ranges The ranges to get images from
|
|
51
|
+
*/
|
|
52
|
+
getCellImagesFromRanges(unitId: string, subUnitId: string, ranges: IRange[]): ICellImageInfo[];
|
|
53
|
+
/**
|
|
54
|
+
* Get columns that have data in the current selection
|
|
55
|
+
*/
|
|
56
|
+
getDataColumns(): Array<{
|
|
57
|
+
index: number;
|
|
58
|
+
label: string;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Get columns that have data for specified ranges
|
|
62
|
+
* @param unitId The workbook unit ID
|
|
63
|
+
* @param subUnitId The worksheet ID
|
|
64
|
+
* @param ranges The ranges to check
|
|
65
|
+
*/
|
|
66
|
+
getDataColumnsForRanges(unitId: string, subUnitId: string, ranges: IRange[]): Array<{
|
|
67
|
+
index: number;
|
|
68
|
+
label: string;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Get current selection range as A1 notation
|
|
72
|
+
*/
|
|
73
|
+
getSelectionRangeNotation(): string;
|
|
74
|
+
/**
|
|
75
|
+
* Generate file name for a cell image based on config
|
|
76
|
+
* @param imageInfo The cell image info
|
|
77
|
+
* @param config The file name configuration
|
|
78
|
+
*/
|
|
79
|
+
generateFileName(imageInfo: ICellImageInfo, config: IBatchSaveImagesConfig): string;
|
|
80
|
+
/**
|
|
81
|
+
* Generate file name with specified worksheet context
|
|
82
|
+
* @param imageInfo The cell image info
|
|
83
|
+
* @param config The file name configuration
|
|
84
|
+
* @param unitId The workbook unit ID
|
|
85
|
+
* @param subUnitId The worksheet ID
|
|
86
|
+
*/
|
|
87
|
+
generateFileNameWithContext(imageInfo: ICellImageInfo, config: IBatchSaveImagesConfig, unitId: string, subUnitId: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* Save images to the file system
|
|
90
|
+
* @param images The images to save
|
|
91
|
+
* @param config The file name configuration
|
|
92
|
+
*/
|
|
93
|
+
saveImages(images: ICellImageInfo[], config: IBatchSaveImagesConfig): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Save images to the file system with specified worksheet context
|
|
96
|
+
* @param images The images to save
|
|
97
|
+
* @param config The file name configuration
|
|
98
|
+
* @param unitId The workbook unit ID
|
|
99
|
+
* @param subUnitId The worksheet ID
|
|
100
|
+
*/
|
|
101
|
+
saveImagesWithContext(images: ICellImageInfo[], config: IBatchSaveImagesConfig, unitId: string, subUnitId: string): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Download a single image directly
|
|
104
|
+
* @param imageInfo The cell image info
|
|
105
|
+
*/
|
|
106
|
+
downloadSingleImage(imageInfo: ICellImageInfo): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Get the row range of current selection
|
|
109
|
+
* Returns the min and max row indices
|
|
110
|
+
*/
|
|
111
|
+
getSelectionRowRange(): {
|
|
112
|
+
startRow: number;
|
|
113
|
+
endRow: number;
|
|
114
|
+
} | null;
|
|
115
|
+
/**
|
|
116
|
+
* Get all column indices that are within the current selection
|
|
117
|
+
*/
|
|
118
|
+
getSelectionColumnIndices(): Set<number>;
|
|
119
|
+
}
|
|
120
|
+
export declare const IBatchSaveImagesService: import('@wendellhu/redi').IdentifierDecorator<IBatchSaveImagesService>;
|
|
121
|
+
export declare class BatchSaveImagesService extends Disposable implements IBatchSaveImagesService {
|
|
122
|
+
private readonly _univerInstanceService;
|
|
123
|
+
private readonly _selectionService;
|
|
124
|
+
private readonly _imageIoService;
|
|
125
|
+
constructor(_univerInstanceService: IUniverInstanceService, _selectionService: SheetsSelectionsService, _imageIoService: IImageIoService);
|
|
126
|
+
getCellImagesInSelection(): ICellImageInfo[];
|
|
127
|
+
getCellImagesFromRanges(unitId: string, subUnitId: string, ranges: IRange[]): ICellImageInfo[];
|
|
128
|
+
getDataColumns(): Array<{
|
|
129
|
+
index: number;
|
|
130
|
+
label: string;
|
|
131
|
+
}>;
|
|
132
|
+
getDataColumnsForRanges(unitId: string, subUnitId: string, ranges: IRange[]): Array<{
|
|
133
|
+
index: number;
|
|
134
|
+
label: string;
|
|
135
|
+
}>;
|
|
136
|
+
getSelectionRangeNotation(): string;
|
|
137
|
+
getSelectionRowRange(): {
|
|
138
|
+
startRow: number;
|
|
139
|
+
endRow: number;
|
|
140
|
+
} | null;
|
|
141
|
+
getSelectionColumnIndices(): Set<number>;
|
|
142
|
+
generateFileName(imageInfo: ICellImageInfo, config: IBatchSaveImagesConfig): string;
|
|
143
|
+
generateFileNameWithContext(imageInfo: ICellImageInfo, config: IBatchSaveImagesConfig, unitId: string, subUnitId: string): string;
|
|
144
|
+
saveImages(images: ICellImageInfo[], config: IBatchSaveImagesConfig): Promise<void>;
|
|
145
|
+
saveImagesWithContext(images: ICellImageInfo[], config: IBatchSaveImagesConfig, unitId: string, subUnitId: string): Promise<void>;
|
|
146
|
+
downloadSingleImage(imageInfo: ICellImageInfo): Promise<void>;
|
|
147
|
+
private _getImageBlob;
|
|
148
|
+
}
|
|
@@ -40,6 +40,7 @@ declare enum ScrollDirectionResponse {
|
|
|
40
40
|
HORIZONTAL = "HORIZONTAL",
|
|
41
41
|
VERTICAL = "VERTICAL"
|
|
42
42
|
}
|
|
43
|
+
export declare const SHEET_FLOAT_DOM_PREFIX = "univer-sheet-float-dom-";
|
|
43
44
|
export interface ICanvasFloatDomInfo {
|
|
44
45
|
position$: BehaviorSubject<IFloatDomLayout>;
|
|
45
46
|
dispose: IDisposable;
|
|
@@ -50,6 +51,7 @@ export interface ICanvasFloatDomInfo {
|
|
|
50
51
|
scrollDirectionResponse?: ScrollDirectionResponse;
|
|
51
52
|
domAnchor?: IDOMAnchor;
|
|
52
53
|
id: string;
|
|
54
|
+
domId?: string;
|
|
53
55
|
}
|
|
54
56
|
export interface IDOMAnchor {
|
|
55
57
|
width: number;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 declare function BatchSaveImagesDialog(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 declare const BATCH_SAVE_IMAGES_DIALOG_ID = "sheet.dialog.batch-save-images";
|
|
@@ -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
|
+
export { BatchSaveImagesDialog } from './BatchSaveImagesDialog';
|
|
17
|
+
export { BATCH_SAVE_IMAGES_DIALOG_ID } from './component-name';
|