@univerjs/sheets-drawing-ui 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +4 -9
- package/lib/cjs/index.js +131 -138
- package/lib/cjs/locale/ar-SA.js +1 -2
- package/lib/cjs/locale/ca-ES.js +1 -2
- package/lib/cjs/locale/de-DE.js +1 -2
- package/lib/cjs/locale/en-US.js +1 -2
- package/lib/cjs/locale/es-ES.js +1 -2
- package/lib/cjs/locale/fa-IR.js +1 -2
- package/lib/cjs/locale/fr-FR.js +1 -2
- package/lib/cjs/locale/id-ID.js +1 -2
- package/lib/cjs/locale/it-IT.js +1 -2
- package/lib/cjs/locale/ja-JP.js +1 -2
- package/lib/cjs/locale/ko-KR.js +1 -2
- package/lib/cjs/locale/pl-PL.js +1 -2
- package/lib/cjs/locale/pt-BR.js +1 -2
- package/lib/cjs/locale/ru-RU.js +1 -2
- package/lib/cjs/locale/sk-SK.js +1 -2
- package/lib/cjs/locale/vi-VN.js +1 -2
- package/lib/cjs/locale/zh-CN.js +1 -2
- package/lib/cjs/locale/zh-HK.js +1 -2
- package/lib/cjs/locale/zh-TW.js +1 -2
- package/lib/es/facade.js +4 -8
- package/lib/es/index.js +133 -140
- package/lib/es/locale/ar-SA.js +1 -2
- package/lib/es/locale/ca-ES.js +1 -2
- package/lib/es/locale/de-DE.js +1 -2
- package/lib/es/locale/en-US.js +1 -2
- package/lib/es/locale/es-ES.js +1 -2
- package/lib/es/locale/fa-IR.js +1 -2
- package/lib/es/locale/fr-FR.js +1 -2
- package/lib/es/locale/id-ID.js +1 -2
- package/lib/es/locale/it-IT.js +1 -2
- package/lib/es/locale/ja-JP.js +1 -2
- package/lib/es/locale/ko-KR.js +1 -2
- package/lib/es/locale/pl-PL.js +1 -2
- package/lib/es/locale/pt-BR.js +1 -2
- package/lib/es/locale/ru-RU.js +1 -2
- package/lib/es/locale/sk-SK.js +1 -2
- package/lib/es/locale/vi-VN.js +1 -2
- package/lib/es/locale/zh-CN.js +1 -2
- package/lib/es/locale/zh-HK.js +1 -2
- package/lib/es/locale/zh-TW.js +1 -2
- package/lib/facade.js +4 -8
- package/lib/index.js +133 -140
- package/lib/locale/ar-SA.js +1 -2
- package/lib/locale/ca-ES.js +1 -2
- package/lib/locale/de-DE.js +1 -2
- package/lib/locale/en-US.js +1 -2
- package/lib/locale/es-ES.js +1 -2
- package/lib/locale/fa-IR.js +1 -2
- package/lib/locale/fr-FR.js +1 -2
- package/lib/locale/id-ID.js +1 -2
- package/lib/locale/it-IT.js +1 -2
- package/lib/locale/ja-JP.js +1 -2
- package/lib/locale/ko-KR.js +1 -2
- package/lib/locale/pl-PL.js +1 -2
- package/lib/locale/pt-BR.js +1 -2
- package/lib/locale/ru-RU.js +1 -2
- package/lib/locale/sk-SK.js +1 -2
- package/lib/locale/vi-VN.js +1 -2
- package/lib/locale/zh-CN.js +1 -2
- package/lib/locale/zh-HK.js +1 -2
- package/lib/locale/zh-TW.js +1 -2
- package/lib/types/menu/drawing-popup-menu.controller.d.ts +5 -2
- package/lib/types/services/batch-save-images.service.d.ts +1 -1
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +3 -3
- package/lib/types/services/drawing-context-menu.service.d.ts +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +19 -19
package/lib/index.js
CHANGED
|
@@ -4,17 +4,17 @@ import { CURSOR_TYPE, DEFAULT_TRANSFORMER_CONFIG, DRAWING_OBJECT_LAYER_INDEX, IR
|
|
|
4
4
|
import { Button, Checkbox, CheckboxGroup, DropdownMenu, FormLayout, Input, MessageType, MobileSelect, Radio, RadioGroup, Select, borderClassName, clsx, render, unmount } from "@univerjs/design";
|
|
5
5
|
import { buildDocTransform, docDrawingPositionToTransform } from "@univerjs/docs";
|
|
6
6
|
import { DRAWING_IMAGE_ALLOW_IMAGE_LIST, DRAWING_IMAGE_COUNT_LIMIT, DRAWING_IMAGE_HEIGHT_LIMIT, DRAWING_IMAGE_WIDTH_LIMIT, IDrawingManagerService, SetDrawingSelectedOperation, UniverDrawingPlugin, getDrawingImageAllowSize, getDrawingShapeKeyByDrawingSearch, getImageSize, normalizeImageOpacity } from "@univerjs/drawing";
|
|
7
|
-
import { COMMAND_LISTENER_SKELETON_CHANGE, IAutoFillService, INTERCEPTOR_POINT, InterceptCellContentPriority, RangeProtectionPermissionEditPoint, SetFrozenMutation, SetRangeValuesCommand, SetSelectionsOperation, SetWorksheetActiveOperation, SetWorksheetRowAutoHeightMutation, SheetInterceptorService, SheetPermissionCheckController, SheetSkeletonService, SheetsSelectionsService, UniverSheetsPlugin, WorkbookEditablePermission, WorkbookViewPermission, WorksheetEditPermission, WorksheetViewPermission, attachRangeWithCoord, discreteRangeToRange, getSheetCommandTarget, isCellImage } from "@univerjs/sheets";
|
|
7
|
+
import { COMMAND_LISTENER_SKELETON_CHANGE, IAutoFillService, INTERCEPTOR_POINT, InterceptCellContentPriority, RangeProtectionPermissionEditPoint, SetFrozenMutation, SetRangeValuesCommand, SetSelectionsOperation, SetWorksheetActiveOperation, SetWorksheetRowAutoHeightMutation, SheetInterceptorService, SheetPermissionCheckController, SheetSkeletonService, SheetsSelectionsService, UniverSheetsPlugin, WorkbookEditablePermission, WorkbookRenameSheetPermission, WorkbookViewPermission, WorksheetEditPermission, WorksheetViewPermission, attachRangeWithCoord, discreteRangeToRange, getSheetCommandTarget, isCellImage } from "@univerjs/sheets";
|
|
8
8
|
import { COPY_TYPE, EditingRenderController, HoverManagerService, IEditorBridgeService, ISheetClipboardService, ISheetSelectionRenderService, PREDEFINED_HOOK_NAME_PASTE, SetCellEditVisibleOperation, SetScrollOperation, SetZoomRatioOperation, SheetCanvasPopManagerService, SheetPrintInterceptorService, SheetSkeletonManagerService, UniverSheetsMobileUIPlugin, UniverSheetsUIPlugin, getCurrentRangeDisable$, useHighlightRange, virtualizeDiscreteRanges } from "@univerjs/sheets-ui";
|
|
9
9
|
import { CanvasFloatDomPreviewService, CanvasFloatDomService, ComponentManager, ContextMenuGroup, ContextMenuPosition, FloatingObjectToolbarPosition, IClipboardInterfaceService, IContextMenuService, IDialogService, ILayoutService, ILocalFileService, IMenuManagerService, IMessageService, IShortcutService, ISidebarService, IconManager, KeyCode, MenuItemType, PrintFloatDomSingle, RibbonDataGroup, RibbonInsertGroup, RibbonPosition, RibbonViewGroup, UndoRedoGroupService, UniverMobileUIPlugin, connectInjector, getMenuHiddenObservable, useDependency, useObservable } from "@univerjs/ui";
|
|
10
|
-
import { COMPONENT_IMAGE_POPUP_MENU, COMPONENT_MOBILE_IMAGE_POPUP_MENU, DrawingCommonPanel, DrawingRenderService, ImageCropperObject, ImageResetSizeOperation, OpenImageCropOperation, UniverDrawingMobileUIPlugin, UniverDrawingUIPlugin, disposeDrawingRenderObject, insertGroupObject } from "@univerjs/drawing-ui";
|
|
10
|
+
import { COMPONENT_IMAGE_POPUP_MENU, COMPONENT_MOBILE_IMAGE_POPUP_MENU, DrawingCommonPanel, DrawingRenderService, ImageCropperObject, ImageResetSizeOperation, OleUIService, OpenImageCropOperation, UniverDrawingMobileUIPlugin, UniverDrawingUIPlugin, createOlePreviewViewer, disposeDrawingRenderObject, insertGroupObject, registerOlePreviewRenderer } from "@univerjs/drawing-ui";
|
|
11
11
|
import { BehaviorSubject, EMPTY, Observable, Subject, combineLatest, distinctUntilChanged, filter, map, of, switchMap, take, takeUntil, tap, throttleTime, timer } from "rxjs";
|
|
12
12
|
import { DocDrawingController, UniverDocsDrawingPlugin } from "@univerjs/docs-drawing";
|
|
13
13
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
import { InnerPasteCommand } from "@univerjs/docs-ui";
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
// src/commands/commands/delete-drawings.command.ts
|
|
18
18
|
const DeleteDrawingsCommand = {
|
|
19
19
|
id: "sheet.command.delete-drawing",
|
|
20
20
|
type: CommandType.COMMAND,
|
|
@@ -39,8 +39,7 @@ const DeleteDrawingsCommand = {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
//#region src/commands/commands/utils.ts
|
|
42
|
+
// src/commands/commands/utils.ts
|
|
44
43
|
function ungroupToGroup(ungroupParams) {
|
|
45
44
|
const newGroupParams = [];
|
|
46
45
|
ungroupParams.forEach((ungroupParam) => {
|
|
@@ -160,8 +159,7 @@ function cloneDrawingParam(param, newDrawingId, parentGroupId) {
|
|
|
160
159
|
return JSON.parse(JSON.stringify(newParam));
|
|
161
160
|
}
|
|
162
161
|
|
|
163
|
-
|
|
164
|
-
//#region src/commands/commands/group-sheet-drawing.command.ts
|
|
162
|
+
// src/commands/commands/group-sheet-drawing.command.ts
|
|
165
163
|
/**
|
|
166
164
|
* The command to insert new defined name
|
|
167
165
|
*/
|
|
@@ -223,8 +221,7 @@ const GroupSheetDrawingCommand = {
|
|
|
223
221
|
}
|
|
224
222
|
};
|
|
225
223
|
|
|
226
|
-
|
|
227
|
-
//#region src/commands/commands/ungroup-sheet-drawing.command.ts
|
|
224
|
+
// src/commands/commands/ungroup-sheet-drawing.command.ts
|
|
228
225
|
/**
|
|
229
226
|
* The command to insert new defined name
|
|
230
227
|
*/
|
|
@@ -286,8 +283,7 @@ const UngroupSheetDrawingCommand = {
|
|
|
286
283
|
}
|
|
287
284
|
};
|
|
288
285
|
|
|
289
|
-
|
|
290
|
-
//#region src/utils/worksheet-background-image.ts
|
|
286
|
+
// src/utils/worksheet-background-image.ts
|
|
291
287
|
/**
|
|
292
288
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
293
289
|
*
|
|
@@ -426,8 +422,7 @@ function readUint32Be(bytes, offset) {
|
|
|
426
422
|
return ((bytes[offset] ?? 0) << 24 >>> 0 | (bytes[offset + 1] ?? 0) << 16 | (bytes[offset + 2] ?? 0) << 8 | (bytes[offset + 3] ?? 0)) >>> 0;
|
|
427
423
|
}
|
|
428
424
|
|
|
429
|
-
|
|
430
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
425
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
431
426
|
function _typeof(o) {
|
|
432
427
|
"@babel/helpers - typeof";
|
|
433
428
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -437,8 +432,7 @@ function _typeof(o) {
|
|
|
437
432
|
}, _typeof(o);
|
|
438
433
|
}
|
|
439
434
|
|
|
440
|
-
|
|
441
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
435
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
442
436
|
function toPrimitive(t, r) {
|
|
443
437
|
if ("object" != _typeof(t) || !t) return t;
|
|
444
438
|
var e = t[Symbol.toPrimitive];
|
|
@@ -450,15 +444,13 @@ function toPrimitive(t, r) {
|
|
|
450
444
|
return ("string" === r ? String : Number)(t);
|
|
451
445
|
}
|
|
452
446
|
|
|
453
|
-
|
|
454
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
447
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
455
448
|
function toPropertyKey(t) {
|
|
456
449
|
var i = toPrimitive(t, "string");
|
|
457
450
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
458
451
|
}
|
|
459
452
|
|
|
460
|
-
|
|
461
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
453
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
462
454
|
function _defineProperty(e, r, t) {
|
|
463
455
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
464
456
|
value: t,
|
|
@@ -468,16 +460,14 @@ function _defineProperty(e, r, t) {
|
|
|
468
460
|
}) : e[r] = t, e;
|
|
469
461
|
}
|
|
470
462
|
|
|
471
|
-
|
|
472
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
463
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateParam.js
|
|
473
464
|
function __decorateParam(paramIndex, decorator) {
|
|
474
465
|
return function(target, key) {
|
|
475
466
|
decorator(target, key, paramIndex);
|
|
476
467
|
};
|
|
477
468
|
}
|
|
478
469
|
|
|
479
|
-
|
|
480
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
470
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
|
|
481
471
|
function __decorate(decorators, target, key, desc) {
|
|
482
472
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
483
473
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -485,8 +475,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
485
475
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
486
476
|
}
|
|
487
477
|
|
|
488
|
-
|
|
489
|
-
//#region src/controllers/sheet-drawing-update.controller.ts
|
|
478
|
+
// src/controllers/sheet-drawing-update.controller.ts
|
|
490
479
|
/**
|
|
491
480
|
* Calculate the bounding box after rotation
|
|
492
481
|
* @param {number} width Width
|
|
@@ -1043,8 +1032,7 @@ SheetDrawingUpdateController = __decorate([
|
|
|
1043
1032
|
__decorateParam(14, IURLImageService)
|
|
1044
1033
|
], SheetDrawingUpdateController);
|
|
1045
1034
|
|
|
1046
|
-
|
|
1047
|
-
//#region src/commands/commands/insert-image.command.ts
|
|
1035
|
+
// src/commands/commands/insert-image.command.ts
|
|
1048
1036
|
const InsertFloatImageCommand = {
|
|
1049
1037
|
id: "sheet.command.insert-float-image",
|
|
1050
1038
|
type: CommandType.COMMAND,
|
|
@@ -1072,8 +1060,7 @@ const InsertCellImageCommand = {
|
|
|
1072
1060
|
}
|
|
1073
1061
|
};
|
|
1074
1062
|
|
|
1075
|
-
|
|
1076
|
-
//#region src/commands/commands/move-drawings.command.ts
|
|
1063
|
+
// src/commands/commands/move-drawings.command.ts
|
|
1077
1064
|
const MoveDrawingsCommand = {
|
|
1078
1065
|
id: "sheet.command.move-drawing",
|
|
1079
1066
|
type: CommandType.COMMAND,
|
|
@@ -1114,8 +1101,7 @@ const MoveDrawingsCommand = {
|
|
|
1114
1101
|
}
|
|
1115
1102
|
};
|
|
1116
1103
|
|
|
1117
|
-
|
|
1118
|
-
//#region src/services/batch-save-images.service.ts
|
|
1104
|
+
// src/services/batch-save-images.service.ts
|
|
1119
1105
|
/**
|
|
1120
1106
|
* File name part type for multi-select
|
|
1121
1107
|
*/
|
|
@@ -1474,8 +1460,7 @@ BatchSaveImagesService = __decorate([
|
|
|
1474
1460
|
__decorateParam(3, IURLImageService)
|
|
1475
1461
|
], BatchSaveImagesService);
|
|
1476
1462
|
|
|
1477
|
-
|
|
1478
|
-
//#region src/views/batch-save-images/component-name.ts
|
|
1463
|
+
// src/views/batch-save-images/component-name.ts
|
|
1479
1464
|
/**
|
|
1480
1465
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1481
1466
|
*
|
|
@@ -1493,8 +1478,7 @@ BatchSaveImagesService = __decorate([
|
|
|
1493
1478
|
*/
|
|
1494
1479
|
const BATCH_SAVE_IMAGES_DIALOG_ID = "sheet.dialog.batch-save-images";
|
|
1495
1480
|
|
|
1496
|
-
|
|
1497
|
-
//#region src/commands/commands/save-cell-images.command.ts
|
|
1481
|
+
// src/commands/commands/save-cell-images.command.ts
|
|
1498
1482
|
const SaveCellImagesCommand = {
|
|
1499
1483
|
id: "sheet.command.save-cell-images",
|
|
1500
1484
|
type: CommandType.COMMAND,
|
|
@@ -1525,8 +1509,7 @@ const SaveCellImagesCommand = {
|
|
|
1525
1509
|
}
|
|
1526
1510
|
};
|
|
1527
1511
|
|
|
1528
|
-
|
|
1529
|
-
//#region src/commands/commands/worksheet-background-image.command.ts
|
|
1512
|
+
// src/commands/commands/worksheet-background-image.command.ts
|
|
1530
1513
|
const AddWorksheetBackgroundImageCommand = {
|
|
1531
1514
|
id: "sheet.command.add-worksheet-background-image",
|
|
1532
1515
|
type: CommandType.COMMAND,
|
|
@@ -1543,8 +1526,7 @@ const DeleteWorksheetBackgroundImageCommand = {
|
|
|
1543
1526
|
handler: (accessor) => accessor.get(ICommandService).executeCommand(SetWorksheetBackgroundImageCommand.id, { backgroundImage: null })
|
|
1544
1527
|
};
|
|
1545
1528
|
|
|
1546
|
-
|
|
1547
|
-
//#region src/views/sheet-image-panel/component-name.ts
|
|
1529
|
+
// src/views/sheet-image-panel/component-name.ts
|
|
1548
1530
|
/**
|
|
1549
1531
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1550
1532
|
*
|
|
@@ -1562,8 +1544,7 @@ const DeleteWorksheetBackgroundImageCommand = {
|
|
|
1562
1544
|
*/
|
|
1563
1545
|
const COMPONENT_SHEET_DRAWING_PANEL = "COMPONENT_SHEET_DRAWING_PANEL";
|
|
1564
1546
|
|
|
1565
|
-
|
|
1566
|
-
//#region src/commands/operations/open-drawing-panel.operation.ts
|
|
1547
|
+
// src/commands/operations/open-drawing-panel.operation.ts
|
|
1567
1548
|
const SidebarSheetDrawingOperation = {
|
|
1568
1549
|
id: "sidebar.operation.sheet-image",
|
|
1569
1550
|
type: CommandType.COMMAND,
|
|
@@ -1593,8 +1574,7 @@ const SidebarSheetDrawingOperation = {
|
|
|
1593
1574
|
}
|
|
1594
1575
|
};
|
|
1595
1576
|
|
|
1596
|
-
|
|
1597
|
-
//#region src/commands/operations/edit-sheet-drawing.operation.ts
|
|
1577
|
+
// src/commands/operations/edit-sheet-drawing.operation.ts
|
|
1598
1578
|
const EditSheetDrawingOperation = {
|
|
1599
1579
|
id: "sheet.operation.edit-sheet-image",
|
|
1600
1580
|
type: CommandType.OPERATION,
|
|
@@ -1607,8 +1587,7 @@ const EditSheetDrawingOperation = {
|
|
|
1607
1587
|
}
|
|
1608
1588
|
};
|
|
1609
1589
|
|
|
1610
|
-
|
|
1611
|
-
//#region src/controllers/sheet-drawing-group-copy-paste.controller.ts
|
|
1590
|
+
// src/controllers/sheet-drawing-group-copy-paste.controller.ts
|
|
1612
1591
|
const specialPastes$1 = [
|
|
1613
1592
|
PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_COL_WIDTH,
|
|
1614
1593
|
PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_VALUE,
|
|
@@ -1810,8 +1789,7 @@ SheetsDrawingGroupCopyPasteController = __decorate([
|
|
|
1810
1789
|
__decorateParam(4, IDrawingManagerService)
|
|
1811
1790
|
], SheetsDrawingGroupCopyPasteController);
|
|
1812
1791
|
|
|
1813
|
-
|
|
1814
|
-
//#region src/services/sheet-chart-render-object.config.ts
|
|
1792
|
+
// src/services/sheet-chart-render-object.config.ts
|
|
1815
1793
|
/** Shared Chart frame config for editor and isolated print Scene objects. */
|
|
1816
1794
|
const SHEET_CHART_RENDER_OBJECT_CONFIG = Object.freeze({
|
|
1817
1795
|
borderEnabled: false,
|
|
@@ -1821,8 +1799,7 @@ const SHEET_CHART_RENDER_OBJECT_CONFIG = Object.freeze({
|
|
|
1821
1799
|
strokeWidth: 1
|
|
1822
1800
|
});
|
|
1823
1801
|
|
|
1824
|
-
|
|
1825
|
-
//#region src/services/canvas-float-dom-manager.service.ts
|
|
1802
|
+
// src/services/canvas-float-dom-manager.service.ts
|
|
1826
1803
|
var _SheetCanvasFloatDomManagerService;
|
|
1827
1804
|
const SHEET_FLOAT_DOM_PREFIX = "univer-sheet-float-dom-";
|
|
1828
1805
|
function createExternalRuntimeDisposable(owner, id, disposeById) {
|
|
@@ -3510,8 +3487,7 @@ function calculateOffset(value, rangeWidth) {
|
|
|
3510
3487
|
return rangeWidth * Number.parseFloat(value) / 100;
|
|
3511
3488
|
}
|
|
3512
3489
|
|
|
3513
|
-
|
|
3514
|
-
//#region src/embed/floating-host/register-sheets-drawing-floating-host.ts
|
|
3490
|
+
// src/embed/floating-host/register-sheets-drawing-floating-host.ts
|
|
3515
3491
|
const SHEETS_DRAWING_FLOATING_HOST_DEPENDENCIES = [[SheetCanvasFloatDomManagerService]];
|
|
3516
3492
|
function registerSheetsDrawingFloatingHostCapability(injector) {
|
|
3517
3493
|
if (!injector.has(SheetCanvasFloatDomManagerService)) registerDependencies(injector, SHEETS_DRAWING_FLOATING_HOST_DEPENDENCIES);
|
|
@@ -3535,8 +3511,7 @@ function touchSheetsDrawingFloatingHostCapabilityWhenReady(injector) {
|
|
|
3535
3511
|
});
|
|
3536
3512
|
}
|
|
3537
3513
|
|
|
3538
|
-
|
|
3539
|
-
//#region src/menu/image.menu.ts
|
|
3514
|
+
// src/menu/image.menu.ts
|
|
3540
3515
|
const SHEETS_IMAGE_MENU_ID = "sheet.menu.image";
|
|
3541
3516
|
function ImageMenuFactory(accessor) {
|
|
3542
3517
|
return {
|
|
@@ -3569,8 +3544,7 @@ function UploadCellImageMenuFactory(accessor) {
|
|
|
3569
3544
|
};
|
|
3570
3545
|
}
|
|
3571
3546
|
|
|
3572
|
-
|
|
3573
|
-
//#region src/menu/save-images.menu.ts
|
|
3547
|
+
// src/menu/save-images.menu.ts
|
|
3574
3548
|
/**
|
|
3575
3549
|
* Check if selection range has any images
|
|
3576
3550
|
*/
|
|
@@ -3613,8 +3587,7 @@ function SaveCellImagesMenuFactory(accessor) {
|
|
|
3613
3587
|
};
|
|
3614
3588
|
}
|
|
3615
3589
|
|
|
3616
|
-
|
|
3617
|
-
//#region src/menu/worksheet-background-image.menu.ts
|
|
3590
|
+
// src/menu/worksheet-background-image.menu.ts
|
|
3618
3591
|
const WORKSHEET_BACKGROUND_IMAGE_MENU_ID = "sheet.menu.worksheet-background-image";
|
|
3619
3592
|
function worksheetBackgroundImagePresent$(accessor) {
|
|
3620
3593
|
const commandService = accessor.get(ICommandService);
|
|
@@ -3671,8 +3644,7 @@ function DeleteWorksheetBackgroundImageMenuFactory(accessor) {
|
|
|
3671
3644
|
};
|
|
3672
3645
|
}
|
|
3673
3646
|
|
|
3674
|
-
|
|
3675
|
-
//#region src/menu/schema.ts
|
|
3647
|
+
// src/menu/schema.ts
|
|
3676
3648
|
const menuSchema = {
|
|
3677
3649
|
[RibbonInsertGroup.MEDIA]: { [SHEETS_IMAGE_MENU_ID]: {
|
|
3678
3650
|
order: 0,
|
|
@@ -3724,19 +3696,16 @@ const menuSchema = {
|
|
|
3724
3696
|
} } }
|
|
3725
3697
|
};
|
|
3726
3698
|
|
|
3727
|
-
|
|
3728
|
-
//#region package.json
|
|
3699
|
+
// package.json
|
|
3729
3700
|
var name = "@univerjs/sheets-drawing-ui";
|
|
3730
|
-
var version = "1.
|
|
3701
|
+
var version = "1.4.0";
|
|
3731
3702
|
|
|
3732
|
-
|
|
3733
|
-
//#region src/config/config.ts
|
|
3703
|
+
// src/config/config.ts
|
|
3734
3704
|
const SHEETS_DRAWING_UI_PLUGIN_CONFIG_KEY = "sheets-drawing-ui.config";
|
|
3735
3705
|
const configSymbol = Symbol(SHEETS_DRAWING_UI_PLUGIN_CONFIG_KEY);
|
|
3736
3706
|
const defaultPluginConfig = {};
|
|
3737
3707
|
|
|
3738
|
-
|
|
3739
|
-
//#region src/services/drawing-context-menu.service.ts
|
|
3708
|
+
// src/services/drawing-context-menu.service.ts
|
|
3740
3709
|
const IDrawingContextMenuService = createIdentifier("sheets-drawing-ui.drawing-context-menu.service");
|
|
3741
3710
|
var DrawingContextMenuService = class extends Disposable {
|
|
3742
3711
|
constructor(..._args) {
|
|
@@ -3755,8 +3724,7 @@ var DrawingContextMenuService = class extends Disposable {
|
|
|
3755
3724
|
}
|
|
3756
3725
|
};
|
|
3757
3726
|
|
|
3758
|
-
|
|
3759
|
-
//#region src/controllers/drawing-context-menu.controller.ts
|
|
3727
|
+
// src/controllers/drawing-context-menu.controller.ts
|
|
3760
3728
|
let DrawingContextMenuController = class DrawingContextMenuController extends RxDisposable {
|
|
3761
3729
|
constructor(_drawingManagerService, _contextMenuService, _renderManagerService, _univerInstanceService, _drawingContextMenuService) {
|
|
3762
3730
|
super();
|
|
@@ -3812,8 +3780,7 @@ DrawingContextMenuController = __decorate([
|
|
|
3812
3780
|
__decorateParam(4, IDrawingContextMenuService)
|
|
3813
3781
|
], DrawingContextMenuController);
|
|
3814
3782
|
|
|
3815
|
-
|
|
3816
|
-
//#region src/views/batch-save-images/BatchSaveImagesDialog.tsx
|
|
3783
|
+
// src/views/batch-save-images/BatchSaveImagesDialog.tsx
|
|
3817
3784
|
function BatchSaveImagesDialog({ SelectComponent = Select } = {}) {
|
|
3818
3785
|
const localeService = useDependency(LocaleService);
|
|
3819
3786
|
const dialogService = useDependency(IDialogService);
|
|
@@ -3937,8 +3904,7 @@ function BatchSaveImagesDialog({ SelectComponent = Select } = {}) {
|
|
|
3937
3904
|
});
|
|
3938
3905
|
}
|
|
3939
3906
|
|
|
3940
|
-
|
|
3941
|
-
//#region src/views/batch-save-images/MobileBatchSaveImagesDialog.tsx
|
|
3907
|
+
// src/views/batch-save-images/MobileBatchSaveImagesDialog.tsx
|
|
3942
3908
|
/**
|
|
3943
3909
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3944
3910
|
*
|
|
@@ -3958,14 +3924,12 @@ function MobileBatchSaveImagesDialog() {
|
|
|
3958
3924
|
return /* @__PURE__ */ jsx(BatchSaveImagesDialog, { SelectComponent: MobileSelect });
|
|
3959
3925
|
}
|
|
3960
3926
|
|
|
3961
|
-
|
|
3962
|
-
//#region src/views/sheet-image-panel/sheet-drawing-panel.util.ts
|
|
3927
|
+
// src/views/sheet-image-panel/sheet-drawing-panel.util.ts
|
|
3963
3928
|
function isSheetDrawing(drawing) {
|
|
3964
3929
|
return Boolean(drawing && "sheetTransform" in drawing && drawing.sheetTransform);
|
|
3965
3930
|
}
|
|
3966
3931
|
|
|
3967
|
-
|
|
3968
|
-
//#region src/views/sheet-image-panel/SheetDrawingAnchor.tsx
|
|
3932
|
+
// src/views/sheet-image-panel/SheetDrawingAnchor.tsx
|
|
3969
3933
|
const SheetDrawingAnchor = (props) => {
|
|
3970
3934
|
function getAnchorKind(value) {
|
|
3971
3935
|
if (value === SheetDrawingAnchorType.Position || value === SheetDrawingAnchorType.Both || value === SheetDrawingAnchorType.None) return value;
|
|
@@ -4087,8 +4051,7 @@ const SheetDrawingAnchor = (props) => {
|
|
|
4087
4051
|
});
|
|
4088
4052
|
};
|
|
4089
4053
|
|
|
4090
|
-
|
|
4091
|
-
//#region src/commands/operations/preview-sheet-image-opacity.operation.ts
|
|
4054
|
+
// src/commands/operations/preview-sheet-image-opacity.operation.ts
|
|
4092
4055
|
const PreviewSheetImageOpacityOperation = {
|
|
4093
4056
|
id: "sheet.operation.preview-image-opacity",
|
|
4094
4057
|
type: CommandType.OPERATION,
|
|
@@ -4103,8 +4066,7 @@ const PreviewSheetImageOpacityOperation = {
|
|
|
4103
4066
|
}
|
|
4104
4067
|
};
|
|
4105
4068
|
|
|
4106
|
-
|
|
4107
|
-
//#region src/views/sheet-image-panel/SheetImageTransparencySlider.tsx
|
|
4069
|
+
// src/views/sheet-image-panel/SheetImageTransparencySlider.tsx
|
|
4108
4070
|
const MIN_TRANSPARENCY = 0;
|
|
4109
4071
|
const MAX_TRANSPARENCY = 100;
|
|
4110
4072
|
const TRANSPARENCY_STEP = 1;
|
|
@@ -4362,8 +4324,7 @@ function normalizeTransparency$1(value) {
|
|
|
4362
4324
|
return Math.min(Math.max(Math.round(value), MIN_TRANSPARENCY), MAX_TRANSPARENCY);
|
|
4363
4325
|
}
|
|
4364
4326
|
|
|
4365
|
-
|
|
4366
|
-
//#region src/views/sheet-image-panel/SheetImageTransparency.tsx
|
|
4327
|
+
// src/views/sheet-image-panel/SheetImageTransparency.tsx
|
|
4367
4328
|
const IMAGE_TRANSPARENCY_PRESETS = [
|
|
4368
4329
|
0,
|
|
4369
4330
|
15,
|
|
@@ -4471,8 +4432,7 @@ function transparencyToOpacity(transparency) {
|
|
|
4471
4432
|
return (100 - transparency) / 100;
|
|
4472
4433
|
}
|
|
4473
4434
|
|
|
4474
|
-
|
|
4475
|
-
//#region src/views/sheet-image-panel/SheetDrawingPanel.tsx
|
|
4435
|
+
// src/views/sheet-image-panel/SheetDrawingPanel.tsx
|
|
4476
4436
|
/**
|
|
4477
4437
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
4478
4438
|
*
|
|
@@ -4501,8 +4461,7 @@ const SheetDrawingPanel = () => {
|
|
|
4501
4461
|
});
|
|
4502
4462
|
};
|
|
4503
4463
|
|
|
4504
|
-
|
|
4505
|
-
//#region src/controllers/mobile/components.controller.ts
|
|
4464
|
+
// src/controllers/mobile/components.controller.ts
|
|
4506
4465
|
/**
|
|
4507
4466
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
4508
4467
|
*
|
|
@@ -4527,8 +4486,7 @@ let MobileComponentsController = class MobileComponentsController extends Dispos
|
|
|
4527
4486
|
};
|
|
4528
4487
|
MobileComponentsController = __decorate([__decorateParam(0, Inject(ComponentManager))], MobileComponentsController);
|
|
4529
4488
|
|
|
4530
|
-
|
|
4531
|
-
//#region src/controllers/render-controllers/sheet-celll-image-hover.render-controller.ts
|
|
4489
|
+
// src/controllers/render-controllers/sheet-celll-image-hover.render-controller.ts
|
|
4532
4490
|
const CELL_IMAGE_PREVIEW_KEY = "preview-cell-image";
|
|
4533
4491
|
let SheetCellImageHoverRenderController = class SheetCellImageHoverRenderController extends Disposable {
|
|
4534
4492
|
constructor(_context, _hoverManagerService, _selectionsService, _drawingRenderService, _sheetSkeletonManagerService) {
|
|
@@ -4602,8 +4560,7 @@ SheetCellImageHoverRenderController = __decorate([
|
|
|
4602
4560
|
__decorateParam(4, Inject(SheetSkeletonManagerService))
|
|
4603
4561
|
], SheetCellImageHoverRenderController);
|
|
4604
4562
|
|
|
4605
|
-
|
|
4606
|
-
//#region src/controllers/render-controllers/sheet-drawing.render-controller.ts
|
|
4563
|
+
// src/controllers/render-controllers/sheet-drawing.render-controller.ts
|
|
4607
4564
|
let SheetsDrawingRenderController = class SheetsDrawingRenderController extends Disposable {
|
|
4608
4565
|
constructor(_context, _sheetDrawingService, _drawingManagerService, _sheetSkeletonService, _logService) {
|
|
4609
4566
|
super();
|
|
@@ -4663,8 +4620,7 @@ SheetsDrawingRenderController = __decorate([
|
|
|
4663
4620
|
__decorateParam(4, ILogService)
|
|
4664
4621
|
], SheetsDrawingRenderController);
|
|
4665
4622
|
|
|
4666
|
-
|
|
4667
|
-
//#region src/views/background/worksheet-background-image.extension.ts
|
|
4623
|
+
// src/views/background/worksheet-background-image.extension.ts
|
|
4668
4624
|
const WORKSHEET_BACKGROUND_IMAGE_EXTENSION_KEY = "WorksheetBackgroundImageExtension";
|
|
4669
4625
|
var WorksheetBackgroundImageExtension = class extends SheetExtension {
|
|
4670
4626
|
constructor(injector, _requestRender) {
|
|
@@ -4704,8 +4660,7 @@ var WorksheetBackgroundImageExtension = class extends SheetExtension {
|
|
|
4704
4660
|
}
|
|
4705
4661
|
};
|
|
4706
4662
|
|
|
4707
|
-
|
|
4708
|
-
//#region src/controllers/render-controllers/worksheet-background.render-controller.ts
|
|
4663
|
+
// src/controllers/render-controllers/worksheet-background.render-controller.ts
|
|
4709
4664
|
let WorksheetBackgroundRenderController = class WorksheetBackgroundRenderController extends Disposable {
|
|
4710
4665
|
constructor(_context, commandService, injector) {
|
|
4711
4666
|
super();
|
|
@@ -4727,8 +4682,7 @@ let WorksheetBackgroundRenderController = class WorksheetBackgroundRenderControl
|
|
|
4727
4682
|
};
|
|
4728
4683
|
WorksheetBackgroundRenderController = __decorate([__decorateParam(1, ICommandService), __decorateParam(2, Inject(Injector))], WorksheetBackgroundRenderController);
|
|
4729
4684
|
|
|
4730
|
-
|
|
4731
|
-
//#region src/controllers/sheet-cell-image.controller.ts
|
|
4685
|
+
// src/controllers/sheet-cell-image.controller.ts
|
|
4732
4686
|
function resizeImageByCell(injector, location, cell) {
|
|
4733
4687
|
var _documentData$drawing, _documentData$drawing2;
|
|
4734
4688
|
const documentData = cell === null || cell === void 0 ? void 0 : cell.p;
|
|
@@ -4807,8 +4761,7 @@ SheetCellImageController = __decorate([
|
|
|
4807
4761
|
__decorateParam(4, Inject(IEditorBridgeService))
|
|
4808
4762
|
], SheetCellImageController);
|
|
4809
4763
|
|
|
4810
|
-
|
|
4811
|
-
//#region src/controllers/sheet-cell-image-autofill.controller.ts
|
|
4764
|
+
// src/controllers/sheet-cell-image-autofill.controller.ts
|
|
4812
4765
|
/**
|
|
4813
4766
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
4814
4767
|
*
|
|
@@ -4849,8 +4802,7 @@ let SheetCellImageAutofillController = class SheetCellImageAutofillController ex
|
|
|
4849
4802
|
};
|
|
4850
4803
|
SheetCellImageAutofillController = __decorate([__decorateParam(0, Inject(IAutoFillService)), __decorateParam(1, Inject(Injector))], SheetCellImageAutofillController);
|
|
4851
4804
|
|
|
4852
|
-
|
|
4853
|
-
//#region src/controllers/sheet-cell-image-copy-paste.controller.ts
|
|
4805
|
+
// src/controllers/sheet-cell-image-copy-paste.controller.ts
|
|
4854
4806
|
const DISABLE_UNITS = [DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY];
|
|
4855
4807
|
let SheetCellImageCopyPasteController = class SheetCellImageCopyPasteController extends Disposable {
|
|
4856
4808
|
constructor(_commandService, _univerInstanceService, _dialogService, _renderManagerService, _localeService) {
|
|
@@ -4923,8 +4875,7 @@ SheetCellImageCopyPasteController = __decorate([
|
|
|
4923
4875
|
__decorateParam(4, Inject(LocaleService))
|
|
4924
4876
|
], SheetCellImageCopyPasteController);
|
|
4925
4877
|
|
|
4926
|
-
|
|
4927
|
-
//#region src/controllers/sheet-drawing-active-render.controller.ts
|
|
4878
|
+
// src/controllers/sheet-drawing-active-render.controller.ts
|
|
4928
4879
|
let SheetDrawingActiveRenderController = class SheetDrawingActiveRenderController extends Disposable {
|
|
4929
4880
|
constructor(_context, _commandService, _sheetSkeletonService, _sheetDrawingService, _drawingManagerService, _logService) {
|
|
4930
4881
|
super();
|
|
@@ -5050,8 +5001,7 @@ function prepareSheetDrawings(drawings, skeleton) {
|
|
|
5050
5001
|
};
|
|
5051
5002
|
}
|
|
5052
5003
|
|
|
5053
|
-
|
|
5054
|
-
//#region src/controllers/sheet-drawing-copy-paste.controller.ts
|
|
5004
|
+
// src/controllers/sheet-drawing-copy-paste.controller.ts
|
|
5055
5005
|
const IMAGE_PNG_MIME_TYPE = "image/png";
|
|
5056
5006
|
function base64ToBlob(base64) {
|
|
5057
5007
|
const arr = base64.split(",");
|
|
@@ -5458,8 +5408,7 @@ SheetsDrawingCopyPasteController = __decorate([
|
|
|
5458
5408
|
__decorateParam(5, ICommandService)
|
|
5459
5409
|
], SheetsDrawingCopyPasteController);
|
|
5460
5410
|
|
|
5461
|
-
|
|
5462
|
-
//#region src/controllers/sheet-drawing-permission.controller.ts
|
|
5411
|
+
// src/controllers/sheet-drawing-permission.controller.ts
|
|
5463
5412
|
const drawingObjectTypes = [
|
|
5464
5413
|
ObjectType.IMAGE,
|
|
5465
5414
|
ObjectType.SHAPE,
|
|
@@ -5701,8 +5650,7 @@ function getPlacementCommandTarget(params) {
|
|
|
5701
5650
|
};
|
|
5702
5651
|
}
|
|
5703
5652
|
|
|
5704
|
-
|
|
5705
|
-
//#region src/views/PrintingFloatDom.tsx
|
|
5653
|
+
// src/views/PrintingFloatDom.tsx
|
|
5706
5654
|
function createPrintingFloatDom(info, scene, skeleton, worksheet) {
|
|
5707
5655
|
const { width, height, angle, left, top } = info.transform;
|
|
5708
5656
|
const offsetBound = transformBound2DOMBound({
|
|
@@ -5764,8 +5712,7 @@ function mountPrintingFloatDom(props, root, injector) {
|
|
|
5764
5712
|
return () => unmount(root);
|
|
5765
5713
|
}
|
|
5766
5714
|
|
|
5767
|
-
|
|
5768
|
-
//#region src/controllers/sheet-drawing-printing.controller.ts
|
|
5715
|
+
// src/controllers/sheet-drawing-printing.controller.ts
|
|
5769
5716
|
let SheetDrawingPrintingController = class SheetDrawingPrintingController extends Disposable {
|
|
5770
5717
|
constructor(_sheetPrintInterceptorService, _drawingRenderService, _drawingManagerService, _renderManagerService, _componetManager, _injector) {
|
|
5771
5718
|
super();
|
|
@@ -5787,7 +5734,10 @@ let SheetDrawingPrintingController = class SheetDrawingPrintingController extend
|
|
|
5787
5734
|
const drawing = subUnitData.data[id];
|
|
5788
5735
|
if (drawing.hidden) return;
|
|
5789
5736
|
if (drawing.drawingType !== DrawingTypeEnum.DRAWING_CHART && drawing.drawingType !== DrawingTypeEnum.DRAWING_DOM && drawing.drawingType !== DrawingTypeEnum.DRAWING_BLOCK) {
|
|
5790
|
-
const resource = this._drawingRenderService.renderDrawing(drawing, scene, {
|
|
5737
|
+
const resource = this._drawingRenderService.renderDrawing(drawing, scene, {
|
|
5738
|
+
allowInactiveSheet: true,
|
|
5739
|
+
interactive: false
|
|
5740
|
+
});
|
|
5791
5741
|
if (resource) resourceCollector.add(Promise.resolve(resource));
|
|
5792
5742
|
}
|
|
5793
5743
|
});
|
|
@@ -5879,8 +5829,7 @@ SheetDrawingPrintingController = __decorate([
|
|
|
5879
5829
|
__decorateParam(5, Inject(Injector))
|
|
5880
5830
|
], SheetDrawingPrintingController);
|
|
5881
5831
|
|
|
5882
|
-
|
|
5883
|
-
//#region src/commands/commands/flip-drawings.command.ts
|
|
5832
|
+
// src/commands/commands/flip-drawings.command.ts
|
|
5884
5833
|
/**
|
|
5885
5834
|
* The command to flip sheet drawing elements
|
|
5886
5835
|
*/
|
|
@@ -6004,8 +5953,7 @@ function getSceneByDrawingSearch(accessor, unitId) {
|
|
|
6004
5953
|
return render.scene;
|
|
6005
5954
|
}
|
|
6006
5955
|
|
|
6007
|
-
|
|
6008
|
-
//#region src/controllers/shortcuts/drawing.shortcut.ts
|
|
5956
|
+
// src/controllers/shortcuts/drawing.shortcut.ts
|
|
6009
5957
|
function whenSheetDrawingFocused(contextService) {
|
|
6010
5958
|
return contextService.getContextValue(FOCUSING_SHEET) && !contextService.getContextValue(FOCUSING_FX_BAR_EDITOR) && !contextService.getContextValue(FOCUSING_PANEL_EDITOR) && contextService.getContextValue(FOCUSING_COMMON_DRAWINGS) && !contextService.getContextValue(FOCUSING_SHAPE_TEXT_EDITOR);
|
|
6011
5959
|
}
|
|
@@ -6060,8 +6008,7 @@ const DeleteDrawingsShortcutItem = {
|
|
|
6060
6008
|
mac: KeyCode.BACKSPACE
|
|
6061
6009
|
};
|
|
6062
6010
|
|
|
6063
|
-
|
|
6064
|
-
//#region src/controllers/ui.controller.ts
|
|
6011
|
+
// src/controllers/ui.controller.ts
|
|
6065
6012
|
/**
|
|
6066
6013
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
6067
6014
|
*
|
|
@@ -6136,8 +6083,7 @@ SheetDrawingUIController = __decorate([
|
|
|
6136
6083
|
__decorateParam(3, Inject(ISidebarService))
|
|
6137
6084
|
], SheetDrawingUIController);
|
|
6138
6085
|
|
|
6139
|
-
|
|
6140
|
-
//#region src/menu/mobile-drawing-popup-menu.controller.ts
|
|
6086
|
+
// src/menu/mobile-drawing-popup-menu.controller.ts
|
|
6141
6087
|
const MOBILE_IMAGE_ACTIONS_DIALOG_ID = "sheet-mobile-image-actions";
|
|
6142
6088
|
const MOBILE_DRAWING_LONG_PRESS_DURATION = 500;
|
|
6143
6089
|
let MobileDrawingPopupMenuController = class MobileDrawingPopupMenuController extends RxDisposable {
|
|
@@ -6415,8 +6361,7 @@ MobileDrawingPopupMenuController = __decorate([
|
|
|
6415
6361
|
__decorateParam(11, ILayoutService)
|
|
6416
6362
|
], MobileDrawingPopupMenuController);
|
|
6417
6363
|
|
|
6418
|
-
|
|
6419
|
-
//#region src/menu/mobile-schema.ts
|
|
6364
|
+
// src/menu/mobile-schema.ts
|
|
6420
6365
|
const mobileMenuSchema = {
|
|
6421
6366
|
[RibbonInsertGroup.MEDIA]: { [SHEETS_IMAGE_MENU_ID]: {
|
|
6422
6367
|
order: 0,
|
|
@@ -6456,8 +6401,7 @@ const mobileMenuSchema = {
|
|
|
6456
6401
|
} } }
|
|
6457
6402
|
};
|
|
6458
6403
|
|
|
6459
|
-
|
|
6460
|
-
//#region src/menu/mobile-sheet-drawing-menu.controller.ts
|
|
6404
|
+
// src/menu/mobile-sheet-drawing-menu.controller.ts
|
|
6461
6405
|
/**
|
|
6462
6406
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
6463
6407
|
*
|
|
@@ -6481,8 +6425,7 @@ let MobileSheetDrawingMenuController = class MobileSheetDrawingMenuController ex
|
|
|
6481
6425
|
};
|
|
6482
6426
|
MobileSheetDrawingMenuController = __decorate([__decorateParam(0, IMenuManagerService)], MobileSheetDrawingMenuController);
|
|
6483
6427
|
|
|
6484
|
-
|
|
6485
|
-
//#region src/services/sheet-drawing-hit-test.service.ts
|
|
6428
|
+
// src/services/sheet-drawing-hit-test.service.ts
|
|
6486
6429
|
let SheetDrawingHitTestService = class SheetDrawingHitTestService extends Disposable {
|
|
6487
6430
|
constructor(_drawingManagerService, _univerInstanceService, _renderManagerService) {
|
|
6488
6431
|
super();
|
|
@@ -6592,8 +6535,7 @@ SheetDrawingHitTestService = __decorate([
|
|
|
6592
6535
|
__decorateParam(2, IRenderManagerService)
|
|
6593
6536
|
], SheetDrawingHitTestService);
|
|
6594
6537
|
|
|
6595
|
-
|
|
6596
|
-
//#region src/mobile-plugin.ts
|
|
6538
|
+
// src/mobile-plugin.ts
|
|
6597
6539
|
let UniverSheetsDrawingMobileUIPlugin = class UniverSheetsDrawingMobileUIPlugin extends Plugin {
|
|
6598
6540
|
constructor(_config = defaultPluginConfig, _injector, _renderManagerService, _configService) {
|
|
6599
6541
|
super();
|
|
@@ -6673,8 +6615,7 @@ UniverSheetsDrawingMobileUIPlugin = __decorate([
|
|
|
6673
6615
|
__decorateParam(3, IConfigService)
|
|
6674
6616
|
], UniverSheetsDrawingMobileUIPlugin);
|
|
6675
6617
|
|
|
6676
|
-
|
|
6677
|
-
//#region src/controllers/components.controller.ts
|
|
6618
|
+
// src/controllers/components.controller.ts
|
|
6678
6619
|
/**
|
|
6679
6620
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
6680
6621
|
*
|
|
@@ -6703,10 +6644,9 @@ let ComponentsController = class ComponentsController extends Disposable {
|
|
|
6703
6644
|
};
|
|
6704
6645
|
ComponentsController = __decorate([__decorateParam(0, Inject(ComponentManager))], ComponentsController);
|
|
6705
6646
|
|
|
6706
|
-
|
|
6707
|
-
//#region src/menu/drawing-popup-menu.controller.ts
|
|
6647
|
+
// src/menu/drawing-popup-menu.controller.ts
|
|
6708
6648
|
let DrawingPopupMenuController = class DrawingPopupMenuController extends RxDisposable {
|
|
6709
|
-
constructor(_localeService, _drawingManagerService, _canvasPopManagerService, _renderManagerService, _univerInstanceService, _messageService, _menuManagerService, _contextService, _ioService, _commandService) {
|
|
6649
|
+
constructor(_localeService, _drawingManagerService, _canvasPopManagerService, _renderManagerService, _univerInstanceService, _messageService, _menuManagerService, _contextService, _ioService, _commandService, _oleUI, _permissionService) {
|
|
6710
6650
|
super();
|
|
6711
6651
|
this._localeService = _localeService;
|
|
6712
6652
|
this._drawingManagerService = _drawingManagerService;
|
|
@@ -6718,7 +6658,40 @@ let DrawingPopupMenuController = class DrawingPopupMenuController extends RxDisp
|
|
|
6718
6658
|
this._contextService = _contextService;
|
|
6719
6659
|
this._ioService = _ioService;
|
|
6720
6660
|
this._commandService = _commandService;
|
|
6661
|
+
this._oleUI = _oleUI;
|
|
6662
|
+
this._permissionService = _permissionService;
|
|
6721
6663
|
_defineProperty(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
6664
|
+
this.disposeWithMe(this._oleUI.registerHost(UniverInstanceType.UNIVER_SHEET, {
|
|
6665
|
+
isEditable: (drawing) => {
|
|
6666
|
+
var _this$_permissionServ;
|
|
6667
|
+
return this._drawingManagerService.getDrawingEditable() && ((_this$_permissionServ = this._permissionService.getPermissionPoint(new WorkbookEditablePermission(drawing.unitId).id)) === null || _this$_permissionServ === void 0 ? void 0 : _this$_permissionServ.value) !== false;
|
|
6668
|
+
},
|
|
6669
|
+
attach: (object, componentKey, extraProps, _drawing, direction = "top-center") => this._canvasPopManagerService.attachPopupToObject(object, {
|
|
6670
|
+
componentKey,
|
|
6671
|
+
extraProps,
|
|
6672
|
+
direction,
|
|
6673
|
+
portal: true,
|
|
6674
|
+
offset: direction === "top-center" ? [0, 8] : [0, 0]
|
|
6675
|
+
}),
|
|
6676
|
+
rename: (drawing, name) => this._commandService.executeCommand(SetSheetDrawingCommand.id, {
|
|
6677
|
+
unitId: drawing.unitId,
|
|
6678
|
+
drawings: [{
|
|
6679
|
+
...drawing,
|
|
6680
|
+
oleFileName: name
|
|
6681
|
+
}]
|
|
6682
|
+
}),
|
|
6683
|
+
saveOnlineUnit: (drawing, online) => this._commandService.executeCommand(SetSheetDrawingCommand.id, {
|
|
6684
|
+
unitId: drawing.unitId,
|
|
6685
|
+
drawings: [{
|
|
6686
|
+
...drawing,
|
|
6687
|
+
oleOnlineUnit: online
|
|
6688
|
+
}]
|
|
6689
|
+
}),
|
|
6690
|
+
remove: (drawing) => this._commandService.executeCommand(RemoveSheetDrawingCommand.id, {
|
|
6691
|
+
unitId: drawing.unitId,
|
|
6692
|
+
drawings: [drawing]
|
|
6693
|
+
})
|
|
6694
|
+
}));
|
|
6722
6695
|
this._init();
|
|
6723
6696
|
}
|
|
6724
6697
|
_init() {
|
|
@@ -6793,7 +6766,7 @@ let DrawingPopupMenuController = class DrawingPopupMenuController extends RxDisp
|
|
|
6793
6766
|
const object = selectedObjects.values().next().value;
|
|
6794
6767
|
if (!object) return;
|
|
6795
6768
|
const drawingParam = this._drawingManagerService.getDrawingOKey(object.oKey);
|
|
6796
|
-
if (!drawingParam || drawingParam.drawingType === DrawingTypeEnum.DRAWING_SHAPE) return;
|
|
6769
|
+
if (!drawingParam || drawingParam.drawingType === DrawingTypeEnum.DRAWING_SHAPE || drawingParam.drawingType === DrawingTypeEnum.DRAWING_OLE) return;
|
|
6797
6770
|
const { unitId, subUnitId, drawingId, drawingType } = drawingParam;
|
|
6798
6771
|
const data = drawingParam.data;
|
|
6799
6772
|
if (data && (data.disablePopup || data.version === 1 && typeof data.embedId === "string")) return;
|
|
@@ -6803,7 +6776,10 @@ let DrawingPopupMenuController = class DrawingPopupMenuController extends RxDisp
|
|
|
6803
6776
|
constrainToCanvas: true,
|
|
6804
6777
|
direction: this._localeService.getDirection() === "rtl" ? "left" : "horizontal",
|
|
6805
6778
|
offset: [2, 0],
|
|
6806
|
-
extraProps: {
|
|
6779
|
+
extraProps: {
|
|
6780
|
+
menuItems,
|
|
6781
|
+
icon: this._canvasPopManagerService.getFeatureMenuIcon(drawingType)
|
|
6782
|
+
}
|
|
6807
6783
|
}));
|
|
6808
6784
|
}
|
|
6809
6785
|
_getImageMenuItems(unitId, subUnitId, drawingId, drawingType) {
|
|
@@ -6910,11 +6886,30 @@ DrawingPopupMenuController = __decorate([
|
|
|
6910
6886
|
__decorateParam(6, IMenuManagerService),
|
|
6911
6887
|
__decorateParam(7, IContextService),
|
|
6912
6888
|
__decorateParam(8, IImageIoService),
|
|
6913
|
-
__decorateParam(9, ICommandService)
|
|
6889
|
+
__decorateParam(9, ICommandService),
|
|
6890
|
+
__decorateParam(10, Inject(OleUIService)),
|
|
6891
|
+
__decorateParam(11, IPermissionService)
|
|
6914
6892
|
], DrawingPopupMenuController);
|
|
6893
|
+
function createSheetOlePreview(context) {
|
|
6894
|
+
return createOlePreviewViewer({
|
|
6895
|
+
...context,
|
|
6896
|
+
setReadonly: (permissions, unitId) => {
|
|
6897
|
+
for (const point of [new WorkbookEditablePermission(unitId), new WorkbookRenameSheetPermission(unitId)]) {
|
|
6898
|
+
if (!permissions.getPermissionPoint(point.id)) permissions.addPermissionPoint(point);
|
|
6899
|
+
permissions.updatePermissionPoint(point.id, false);
|
|
6900
|
+
}
|
|
6901
|
+
},
|
|
6902
|
+
register: (viewer) => {
|
|
6903
|
+
viewer.registerPlugin(UniverSheetsPlugin);
|
|
6904
|
+
viewer.registerPlugin(UniverSheetsUIPlugin, { disableEdit: true });
|
|
6905
|
+
viewer.registerPlugin(UniverSheetsDrawingPlugin);
|
|
6906
|
+
viewer.registerPlugin(UniverSheetsDrawingUIPlugin);
|
|
6907
|
+
}
|
|
6908
|
+
});
|
|
6909
|
+
}
|
|
6910
|
+
registerOlePreviewRenderer(UniverInstanceType.UNIVER_SHEET, createSheetOlePreview);
|
|
6915
6911
|
|
|
6916
|
-
|
|
6917
|
-
//#region src/menu/sheet-drawing-menu.controller.ts
|
|
6912
|
+
// src/menu/sheet-drawing-menu.controller.ts
|
|
6918
6913
|
/**
|
|
6919
6914
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
6920
6915
|
*
|
|
@@ -6938,8 +6933,7 @@ let SheetDrawingMenuController = class SheetDrawingMenuController extends Dispos
|
|
|
6938
6933
|
};
|
|
6939
6934
|
SheetDrawingMenuController = __decorate([__decorateParam(0, IMenuManagerService)], SheetDrawingMenuController);
|
|
6940
6935
|
|
|
6941
|
-
|
|
6942
|
-
//#region src/plugin.ts
|
|
6936
|
+
// src/plugin.ts
|
|
6943
6937
|
let UniverSheetsDrawingUIPlugin = class UniverSheetsDrawingUIPlugin extends Plugin {
|
|
6944
6938
|
constructor(_config = defaultPluginConfig, _injector, _renderManagerService, _configService) {
|
|
6945
6939
|
super();
|
|
@@ -7018,5 +7012,4 @@ UniverSheetsDrawingUIPlugin = __decorate([
|
|
|
7018
7012
|
__decorateParam(3, IConfigService)
|
|
7019
7013
|
], UniverSheetsDrawingUIPlugin);
|
|
7020
7014
|
|
|
7021
|
-
//#endregion
|
|
7022
7015
|
export { AddWorksheetBackgroundImageCommand, BatchSaveImagesService, DeleteDrawingsCommand, DeleteWorksheetBackgroundImageCommand, DrawingContextMenuService, EditSheetDrawingOperation, FileNamePart, GroupSheetDrawingCommand, IBatchSaveImagesService, IDrawingContextMenuService, InsertFloatImageCommand, MoveDrawingsCommand, SHEETS_DRAWING_FLOATING_HOST_DEPENDENCIES, SHEETS_IMAGE_MENU_ID, SHEET_CHART_RENDER_OBJECT_CONFIG, SHEET_FLOAT_DOM_PREFIX, SaveCellImagesCommand, SheetCanvasFloatDomManagerService, SheetDrawingAnchor, SheetDrawingHitTestService, SheetDrawingUpdateController, SheetsDrawingGroupCopyPasteController, menuSchema as SheetsDrawingUIMenuSchema, SidebarSheetDrawingOperation, UngroupSheetDrawingCommand, UniverSheetsDrawingMobileUIPlugin, UniverSheetsDrawingUIPlugin, calcSheetFloatDomPosition, registerSheetsDrawingFloatingHostCapability };
|