@univerjs/drawing-ui 0.24.0 → 0.25.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/index.js +309 -56
- package/lib/cjs/locale/ar-SA.js +74 -0
- package/lib/cjs/locale/ca-ES.js +27 -19
- package/lib/cjs/locale/de-DE.js +74 -0
- package/lib/cjs/locale/en-US.js +27 -19
- package/lib/cjs/locale/es-ES.js +27 -19
- package/lib/cjs/locale/fa-IR.js +27 -19
- package/lib/cjs/locale/fr-FR.js +27 -19
- package/lib/cjs/locale/id-ID.js +74 -0
- package/lib/cjs/locale/it-IT.js +74 -0
- package/lib/cjs/locale/ja-JP.js +27 -19
- package/lib/cjs/locale/ko-KR.js +27 -19
- package/lib/cjs/locale/pl-PL.js +74 -0
- package/lib/cjs/locale/pt-BR.js +74 -0
- package/lib/cjs/locale/ru-RU.js +27 -19
- package/lib/cjs/locale/sk-SK.js +27 -19
- package/lib/cjs/locale/vi-VN.js +27 -19
- package/lib/cjs/locale/zh-CN.js +27 -19
- package/lib/cjs/locale/zh-HK.js +74 -0
- package/lib/cjs/locale/zh-TW.js +27 -19
- package/lib/es/index.js +312 -59
- package/lib/es/locale/ar-SA.js +73 -0
- package/lib/es/locale/ca-ES.js +27 -19
- package/lib/es/locale/de-DE.js +73 -0
- package/lib/es/locale/en-US.js +27 -19
- package/lib/es/locale/es-ES.js +27 -19
- package/lib/es/locale/fa-IR.js +27 -19
- package/lib/es/locale/fr-FR.js +27 -19
- package/lib/es/locale/id-ID.js +73 -0
- package/lib/es/locale/it-IT.js +73 -0
- package/lib/es/locale/ja-JP.js +27 -19
- package/lib/es/locale/ko-KR.js +27 -19
- package/lib/es/locale/pl-PL.js +73 -0
- package/lib/es/locale/pt-BR.js +73 -0
- package/lib/es/locale/ru-RU.js +27 -19
- package/lib/es/locale/sk-SK.js +27 -19
- package/lib/es/locale/vi-VN.js +27 -19
- package/lib/es/locale/zh-CN.js +27 -19
- package/lib/es/locale/zh-HK.js +73 -0
- package/lib/es/locale/zh-TW.js +27 -19
- package/lib/index.css +183 -0
- package/lib/index.js +312 -59
- package/lib/locale/ar-SA.js +73 -0
- package/lib/locale/ca-ES.js +27 -19
- package/lib/locale/de-DE.js +73 -0
- package/lib/locale/en-US.js +27 -19
- package/lib/locale/es-ES.js +27 -19
- package/lib/locale/fa-IR.js +27 -19
- package/lib/locale/fr-FR.js +27 -19
- package/lib/locale/id-ID.js +73 -0
- package/lib/locale/it-IT.js +73 -0
- package/lib/locale/ja-JP.js +27 -19
- package/lib/locale/ko-KR.js +27 -19
- package/lib/locale/pl-PL.js +73 -0
- package/lib/locale/pt-BR.js +73 -0
- package/lib/locale/ru-RU.js +27 -19
- package/lib/locale/sk-SK.js +27 -19
- package/lib/locale/vi-VN.js +27 -19
- package/lib/locale/zh-CN.js +27 -19
- package/lib/locale/zh-HK.js +73 -0
- package/lib/locale/zh-TW.js +27 -19
- package/lib/types/locale/ar-SA.d.ts +18 -0
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +63 -53
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/types/views/image-popup-menu/ImagePopupMenu.d.ts +5 -2
- package/lib/umd/index.js +4 -1
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -0
- 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 -0
- package/lib/umd/locale/it-IT.js +1 -0
- 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 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- 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 -0
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +9 -9
package/lib/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ArrangeTypeEnum, CommandType, Disposable, DrawingTypeEnum, ICommandService, IConfigService, IURLImageService, IUniverInstanceService, ImageSourceType, Inject, Injector, LocaleService, Plugin, UniverInstanceType, checkIfMove, debounce, generateRandomId, merge, toDisposable } from "@univerjs/core";
|
|
1
|
+
import { ArrangeTypeEnum, BooleanNumber, CommandType, Disposable, DrawingTypeEnum, ICommandService, IConfigService, IURLImageService, IUniverInstanceService, ImageSourceType, Inject, Injector, LocaleService, Plugin, PositionedObjectLayoutType, UniverInstanceType, checkIfMove, debounce, generateRandomId, merge, toDisposable } from "@univerjs/core";
|
|
2
2
|
import { IDrawingManagerService, IImageIoService, ImageSourceType as ImageSourceType$1, SetDrawingSelectedOperation, getDrawingShapeKeyByDrawingSearch } from "@univerjs/drawing";
|
|
3
3
|
import { CURSOR_TYPE, Canvas, DRAWING_OBJECT_LAYER_INDEX, DrawingGroupObject, Group, IRenderManagerService, Image, RENDER_CLASS_TYPE, Rect, Shape, Vector2, degToRad, getGroupState, precisionTo, transformObjectOutOfGroup } from "@univerjs/engine-render";
|
|
4
|
-
import { AutofillDoubleIcon, BottomIcon, CreateCopyIcon, GroupIcon, MoreDownIcon, MoveDownIcon, MoveUpIcon, TopmostIcon, UngroupIcon } from "@univerjs/icons";
|
|
4
|
+
import { AutofillDoubleIcon, BottomIcon, CreateCopyIcon, DeleteIcon, DocSettingIcon, GroupIcon, MoreDownIcon, MoveDownIcon, MoveUpIcon, TopmostIcon, UngroupIcon } from "@univerjs/icons";
|
|
5
5
|
import { ComponentManager, ContextMenuGroup, ContextMenuPosition, IDialogService, IGalleryService, IMenuManagerService, IMessageService, MenuItemType, useDependency, useObservable } from "@univerjs/ui";
|
|
6
6
|
import { BehaviorSubject, Observable, bufferTime, filter, map, of, switchMap } from "rxjs";
|
|
7
|
-
import { Button, Checkbox, DropdownMenu, InputNumber, MessageType, Select, borderClassName, clsx } from "@univerjs/design";
|
|
7
|
+
import { Button, Checkbox, Dropdown, DropdownMenu, InputNumber, MessageType, Select, Tooltip, borderClassName, clsx } from "@univerjs/design";
|
|
8
8
|
import { useEffect, useRef, useState } from "react";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
|
|
@@ -321,7 +321,7 @@ function getCurrentUnitInfo(currentUniverService, propUnitId) {
|
|
|
321
321
|
//#endregion
|
|
322
322
|
//#region package.json
|
|
323
323
|
var name = "@univerjs/drawing-ui";
|
|
324
|
-
var version = "0.
|
|
324
|
+
var version = "0.25.0";
|
|
325
325
|
|
|
326
326
|
//#endregion
|
|
327
327
|
//#region src/config/config.ts
|
|
@@ -353,7 +353,7 @@ function DrawingAlignContextMenuItemFactory(accessor) {
|
|
|
353
353
|
id: DRAWING_ALIGN_CONTEXT_MENU_ID,
|
|
354
354
|
type: MenuItemType.SUBITEMS,
|
|
355
355
|
icon: "HorizontallyIcon",
|
|
356
|
-
title: "image-panel.align.title",
|
|
356
|
+
title: "drawing-ui.image-panel.align.title",
|
|
357
357
|
hidden$: getMenuStateByDrawingFocusChangedObservable$$1(accessor)
|
|
358
358
|
};
|
|
359
359
|
}
|
|
@@ -362,7 +362,7 @@ function SetDrawingAlignLeftMenuItemFactory() {
|
|
|
362
362
|
id: SetDrawingAlignLeftOperation.id,
|
|
363
363
|
type: MenuItemType.BUTTON,
|
|
364
364
|
icon: "LeftJustifyingIcon",
|
|
365
|
-
title: "image-panel.align.left"
|
|
365
|
+
title: "drawing-ui.image-panel.align.left"
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
368
|
function SetDrawingAlignCenterMenuItemFactory() {
|
|
@@ -370,7 +370,7 @@ function SetDrawingAlignCenterMenuItemFactory() {
|
|
|
370
370
|
id: SetDrawingAlignCenterOperation.id,
|
|
371
371
|
type: MenuItemType.BUTTON,
|
|
372
372
|
icon: "HorizontallyIcon",
|
|
373
|
-
title: "image-panel.align.center"
|
|
373
|
+
title: "drawing-ui.image-panel.align.center"
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
376
|
function SetDrawingAlignRightMenuItemFactory() {
|
|
@@ -378,7 +378,7 @@ function SetDrawingAlignRightMenuItemFactory() {
|
|
|
378
378
|
id: SetDrawingAlignRightOperation.id,
|
|
379
379
|
type: MenuItemType.BUTTON,
|
|
380
380
|
icon: "RightJustifyingIcon",
|
|
381
|
-
title: "image-panel.align.right"
|
|
381
|
+
title: "drawing-ui.image-panel.align.right"
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
384
|
function SetDrawingAlignTopMenuItemFactory() {
|
|
@@ -386,7 +386,7 @@ function SetDrawingAlignTopMenuItemFactory() {
|
|
|
386
386
|
id: SetDrawingAlignTopOperation.id,
|
|
387
387
|
type: MenuItemType.BUTTON,
|
|
388
388
|
icon: "AlignTopIcon",
|
|
389
|
-
title: "image-panel.align.top"
|
|
389
|
+
title: "drawing-ui.image-panel.align.top"
|
|
390
390
|
};
|
|
391
391
|
}
|
|
392
392
|
function SetDrawingAlignMiddleMenuItemFactory() {
|
|
@@ -394,7 +394,7 @@ function SetDrawingAlignMiddleMenuItemFactory() {
|
|
|
394
394
|
id: SetDrawingAlignMiddleOperation.id,
|
|
395
395
|
type: MenuItemType.BUTTON,
|
|
396
396
|
icon: "VerticalCenterIcon",
|
|
397
|
-
title: "image-panel.align.middle"
|
|
397
|
+
title: "drawing-ui.image-panel.align.middle"
|
|
398
398
|
};
|
|
399
399
|
}
|
|
400
400
|
function SetDrawingAlignBottomMenuItemFactory() {
|
|
@@ -402,7 +402,7 @@ function SetDrawingAlignBottomMenuItemFactory() {
|
|
|
402
402
|
id: SetDrawingAlignBottomOperation.id,
|
|
403
403
|
type: MenuItemType.BUTTON,
|
|
404
404
|
icon: "AlignBottomIcon",
|
|
405
|
-
title: "image-panel.align.bottom"
|
|
405
|
+
title: "drawing-ui.image-panel.align.bottom"
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
408
|
function SetDrawingAlignHorizonMenuItemFactory() {
|
|
@@ -410,7 +410,7 @@ function SetDrawingAlignHorizonMenuItemFactory() {
|
|
|
410
410
|
id: SetDrawingAlignHorizonOperation.id,
|
|
411
411
|
type: MenuItemType.BUTTON,
|
|
412
412
|
icon: "HorizontallyIcon",
|
|
413
|
-
title: "image-panel.align.horizon"
|
|
413
|
+
title: "drawing-ui.image-panel.align.horizon"
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
416
|
function SetDrawingAlignVerticalMenuItemFactory() {
|
|
@@ -418,7 +418,7 @@ function SetDrawingAlignVerticalMenuItemFactory() {
|
|
|
418
418
|
id: SetDrawingAlignVerticalOperation.id,
|
|
419
419
|
type: MenuItemType.BUTTON,
|
|
420
420
|
icon: "VerticalCenterIcon",
|
|
421
|
-
title: "image-panel.align.vertical"
|
|
421
|
+
title: "drawing-ui.image-panel.align.vertical"
|
|
422
422
|
};
|
|
423
423
|
}
|
|
424
424
|
|
|
@@ -430,7 +430,7 @@ function DrawingArrangeContextMenuItemFactory() {
|
|
|
430
430
|
id: DRAWING_ARRANGE_CONTEXT_MENU_ID,
|
|
431
431
|
type: MenuItemType.SUBITEMS,
|
|
432
432
|
icon: "TopmostIcon",
|
|
433
|
-
title: "image-panel.arrange.title"
|
|
433
|
+
title: "drawing-ui.image-panel.arrange.title"
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
436
|
function SetDrawingArrangeFrontMenuItemFactory() {
|
|
@@ -438,7 +438,7 @@ function SetDrawingArrangeFrontMenuItemFactory() {
|
|
|
438
438
|
id: SetDrawingArrangeFrontOperation.id,
|
|
439
439
|
type: MenuItemType.BUTTON,
|
|
440
440
|
icon: "TopmostIcon",
|
|
441
|
-
title: "image-panel.arrange.front"
|
|
441
|
+
title: "drawing-ui.image-panel.arrange.front"
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
444
|
function SetDrawingArrangeForwardMenuItemFactory() {
|
|
@@ -446,7 +446,7 @@ function SetDrawingArrangeForwardMenuItemFactory() {
|
|
|
446
446
|
id: SetDrawingArrangeForwardOperation.id,
|
|
447
447
|
type: MenuItemType.BUTTON,
|
|
448
448
|
icon: "MoveUpIcon",
|
|
449
|
-
title: "image-panel.arrange.forward"
|
|
449
|
+
title: "drawing-ui.image-panel.arrange.forward"
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
452
|
function SetDrawingArrangeBackMenuItemFactory() {
|
|
@@ -454,7 +454,7 @@ function SetDrawingArrangeBackMenuItemFactory() {
|
|
|
454
454
|
id: SetDrawingArrangeBackOperation.id,
|
|
455
455
|
type: MenuItemType.BUTTON,
|
|
456
456
|
icon: "BottomIcon",
|
|
457
|
-
title: "image-panel.arrange.back"
|
|
457
|
+
title: "drawing-ui.image-panel.arrange.back"
|
|
458
458
|
};
|
|
459
459
|
}
|
|
460
460
|
function SetDrawingArrangeBackwardMenuItemFactory() {
|
|
@@ -462,7 +462,7 @@ function SetDrawingArrangeBackwardMenuItemFactory() {
|
|
|
462
462
|
id: SetDrawingArrangeBackwardOperation.id,
|
|
463
463
|
type: MenuItemType.BUTTON,
|
|
464
464
|
icon: "MoveDownIcon",
|
|
465
|
-
title: "image-panel.arrange.backward"
|
|
465
|
+
title: "drawing-ui.image-panel.arrange.backward"
|
|
466
466
|
};
|
|
467
467
|
}
|
|
468
468
|
|
|
@@ -495,7 +495,7 @@ function DrawingGroupContextMenuItemFactory(accessor) {
|
|
|
495
495
|
id: DRAWING_GROUP_CONTEXT_MENU_ID,
|
|
496
496
|
type: MenuItemType.SUBITEMS,
|
|
497
497
|
icon: "GroupIcon",
|
|
498
|
-
title: "image-panel.group.title",
|
|
498
|
+
title: "drawing-ui.image-panel.group.title",
|
|
499
499
|
hidden$: getMenuStateByDrawingFocusChangedObservable$(accessor)
|
|
500
500
|
};
|
|
501
501
|
}
|
|
@@ -504,7 +504,7 @@ function SetDrawingGroupMenuItemFactory(accessor) {
|
|
|
504
504
|
id: SetDrawingGroupOperation.id,
|
|
505
505
|
type: MenuItemType.BUTTON,
|
|
506
506
|
icon: "GroupIcon",
|
|
507
|
-
title: "image-panel.group.group",
|
|
507
|
+
title: "drawing-ui.image-panel.group.group",
|
|
508
508
|
disabled$: getMenuStateByDrawingFocusChangedObservable$(accessor, "group")
|
|
509
509
|
};
|
|
510
510
|
}
|
|
@@ -513,7 +513,7 @@ function CancelDrawingGroupMenuItemFactory(accessor) {
|
|
|
513
513
|
id: CancelDrawingGroupOperation.id,
|
|
514
514
|
type: MenuItemType.BUTTON,
|
|
515
515
|
icon: "UngroupIcon",
|
|
516
|
-
title: "image-panel.group.unGroup",
|
|
516
|
+
title: "drawing-ui.image-panel.group.unGroup",
|
|
517
517
|
disabled$: getMenuStateByDrawingFocusChangedObservable$(accessor, "unGroup")
|
|
518
518
|
};
|
|
519
519
|
}
|
|
@@ -613,10 +613,16 @@ const COMPONENT_IMAGE_POPUP_MENU = "COMPONENT_IMAGE_POPUP_MENU";
|
|
|
613
613
|
//#endregion
|
|
614
614
|
//#region src/views/image-popup-menu/ImagePopupMenu.tsx
|
|
615
615
|
function ImagePopupMenu(props) {
|
|
616
|
-
var _popup$extraProps;
|
|
616
|
+
var _popup$extraProps, _popup$extraProps2;
|
|
617
617
|
const { popup } = props;
|
|
618
618
|
const menuItems = popup === null || popup === void 0 || (_popup$extraProps = popup.extraProps) === null || _popup$extraProps === void 0 ? void 0 : _popup$extraProps.menuItems;
|
|
619
619
|
if (!menuItems) return null;
|
|
620
|
+
if (((_popup$extraProps2 = popup.extraProps) === null || _popup$extraProps2 === void 0 ? void 0 : _popup$extraProps2.variant) === "doc-floating-toolbar" && popup.extraProps.unitId && popup.extraProps.subUnitId && popup.extraProps.drawingId) return /* @__PURE__ */ jsx(DocImageFloatingToolbar, {
|
|
621
|
+
menuItems,
|
|
622
|
+
unitId: popup.extraProps.unitId,
|
|
623
|
+
subUnitId: popup.extraProps.subUnitId,
|
|
624
|
+
drawingId: popup.extraProps.drawingId
|
|
625
|
+
});
|
|
620
626
|
const commandService = useDependency(ICommandService);
|
|
621
627
|
const localeService = useDependency(LocaleService);
|
|
622
628
|
const [visible, setVisible] = useState(false);
|
|
@@ -658,9 +664,256 @@ function ImagePopupMenu(props) {
|
|
|
658
664
|
})
|
|
659
665
|
});
|
|
660
666
|
}
|
|
667
|
+
const UPDATE_DOC_DRAWING_WRAPPING_STYLE_COMMAND_ID = "doc.command.update-doc-drawing-wrapping-style";
|
|
668
|
+
function getWrappingStyle(documentDataModel, drawingId) {
|
|
669
|
+
var _documentDataModel$ge;
|
|
670
|
+
const drawing = documentDataModel === null || documentDataModel === void 0 || (_documentDataModel$ge = documentDataModel.getSnapshot().drawings) === null || _documentDataModel$ge === void 0 ? void 0 : _documentDataModel$ge[drawingId];
|
|
671
|
+
if (!drawing) return "inline";
|
|
672
|
+
if (drawing.layoutType === PositionedObjectLayoutType.WRAP_NONE) return drawing.behindDoc === BooleanNumber.TRUE ? "behindText" : "inFrontOfText";
|
|
673
|
+
if (drawing.layoutType === PositionedObjectLayoutType.WRAP_SQUARE) return "wrapSquare";
|
|
674
|
+
if (drawing.layoutType === PositionedObjectLayoutType.WRAP_TOP_AND_BOTTOM) return "wrapTopAndBottom";
|
|
675
|
+
return "inline";
|
|
676
|
+
}
|
|
677
|
+
function Divider() {
|
|
678
|
+
return /* @__PURE__ */ jsx("span", { className: "\n univer-h-5 univer-w-px univer-bg-gray-200\n dark:!univer-bg-gray-700\n " });
|
|
679
|
+
}
|
|
680
|
+
function ToolbarGroup(props) {
|
|
681
|
+
return /* @__PURE__ */ jsx("div", {
|
|
682
|
+
className: "univer-flex univer-h-7 univer-items-center univer-gap-1 univer-px-1",
|
|
683
|
+
children: props.children
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
function ToolbarButton(props) {
|
|
687
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
688
|
+
title: props.title,
|
|
689
|
+
placement: "bottom",
|
|
690
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
691
|
+
type: "button",
|
|
692
|
+
disabled: props.disabled,
|
|
693
|
+
onClick: props.onClick,
|
|
694
|
+
className: clsx("univer-flex univer-h-6 univer-w-6 univer-items-center univer-justify-center univer-rounded-md univer-border-none univer-bg-transparent univer-p-0 univer-text-sm univer-text-gray-700 univer-transition-colors hover:univer-bg-gray-100 disabled:univer-cursor-not-allowed disabled:univer-opacity-40 dark:!univer-text-gray-100 dark:hover:!univer-bg-gray-700", { "univer-bg-gray-100 univer-text-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-primary-300": props.active }),
|
|
695
|
+
children: props.children
|
|
696
|
+
})
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
function TextWrapShapeIcon() {
|
|
700
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
701
|
+
viewBox: "0 0 20 20",
|
|
702
|
+
width: "1em",
|
|
703
|
+
height: "1em",
|
|
704
|
+
fill: "none",
|
|
705
|
+
"aria-hidden": "true",
|
|
706
|
+
children: [
|
|
707
|
+
/* @__PURE__ */ jsx("path", {
|
|
708
|
+
d: "M2.5 4.5H8.2",
|
|
709
|
+
stroke: "currentColor",
|
|
710
|
+
strokeWidth: "1.4",
|
|
711
|
+
strokeLinecap: "round"
|
|
712
|
+
}),
|
|
713
|
+
/* @__PURE__ */ jsx("path", {
|
|
714
|
+
d: "M11.8 4.5H17.5",
|
|
715
|
+
stroke: "currentColor",
|
|
716
|
+
strokeWidth: "1.4",
|
|
717
|
+
strokeLinecap: "round"
|
|
718
|
+
}),
|
|
719
|
+
/* @__PURE__ */ jsx("path", {
|
|
720
|
+
d: "M2.5 10H5.7",
|
|
721
|
+
stroke: "currentColor",
|
|
722
|
+
strokeWidth: "1.4",
|
|
723
|
+
strokeLinecap: "round"
|
|
724
|
+
}),
|
|
725
|
+
/* @__PURE__ */ jsx("path", {
|
|
726
|
+
d: "M14.3 10H17.5",
|
|
727
|
+
stroke: "currentColor",
|
|
728
|
+
strokeWidth: "1.4",
|
|
729
|
+
strokeLinecap: "round"
|
|
730
|
+
}),
|
|
731
|
+
/* @__PURE__ */ jsx("path", {
|
|
732
|
+
d: "M2.5 15.5H8.2",
|
|
733
|
+
stroke: "currentColor",
|
|
734
|
+
strokeWidth: "1.4",
|
|
735
|
+
strokeLinecap: "round"
|
|
736
|
+
}),
|
|
737
|
+
/* @__PURE__ */ jsx("path", {
|
|
738
|
+
d: "M11.8 15.5H17.5",
|
|
739
|
+
stroke: "currentColor",
|
|
740
|
+
strokeWidth: "1.4",
|
|
741
|
+
strokeLinecap: "round"
|
|
742
|
+
}),
|
|
743
|
+
/* @__PURE__ */ jsx("rect", {
|
|
744
|
+
x: "6.8",
|
|
745
|
+
y: "7",
|
|
746
|
+
width: "6.4",
|
|
747
|
+
height: "6",
|
|
748
|
+
rx: "1",
|
|
749
|
+
stroke: "currentColor",
|
|
750
|
+
strokeWidth: "1.4"
|
|
751
|
+
})
|
|
752
|
+
]
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
function CropIcon() {
|
|
756
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
757
|
+
viewBox: "0 0 20 20",
|
|
758
|
+
width: "1em",
|
|
759
|
+
height: "1em",
|
|
760
|
+
fill: "none",
|
|
761
|
+
"aria-hidden": "true",
|
|
762
|
+
children: [
|
|
763
|
+
/* @__PURE__ */ jsx("path", {
|
|
764
|
+
d: "M5 2.8V12.5C5 13.9 6.1 15 7.5 15H17.2",
|
|
765
|
+
stroke: "currentColor",
|
|
766
|
+
strokeWidth: "1.5",
|
|
767
|
+
strokeLinecap: "round"
|
|
768
|
+
}),
|
|
769
|
+
/* @__PURE__ */ jsx("path", {
|
|
770
|
+
d: "M2.8 5H12.5C13.9 5 15 6.1 15 7.5V17.2",
|
|
771
|
+
stroke: "currentColor",
|
|
772
|
+
strokeWidth: "1.5",
|
|
773
|
+
strokeLinecap: "round"
|
|
774
|
+
}),
|
|
775
|
+
/* @__PURE__ */ jsx("path", {
|
|
776
|
+
d: "M8.3 8.3H11.7V11.7H8.3V8.3Z",
|
|
777
|
+
stroke: "currentColor",
|
|
778
|
+
strokeWidth: "1.2"
|
|
779
|
+
})
|
|
780
|
+
]
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
function ToolbarDropdownButton(props) {
|
|
784
|
+
var _props$options$find;
|
|
785
|
+
const [open, setOpen] = useState(false);
|
|
786
|
+
const activeOption = (_props$options$find = props.options.find((option) => option.value === props.value)) !== null && _props$options$find !== void 0 ? _props$options$find : props.options[0];
|
|
787
|
+
return /* @__PURE__ */ jsx(Dropdown, {
|
|
788
|
+
open,
|
|
789
|
+
onOpenChange: setOpen,
|
|
790
|
+
overlay: /* @__PURE__ */ jsx("div", {
|
|
791
|
+
className: "univer-min-w-32 univer-rounded-lg univer-border univer-border-solid univer-border-gray-200 univer-bg-white univer-p-1 univer-shadow-lg dark:!univer-border-gray-700 dark:!univer-bg-gray-900",
|
|
792
|
+
children: props.options.map((option) => /* @__PURE__ */ jsxs("button", {
|
|
793
|
+
type: "button",
|
|
794
|
+
onClick: () => {
|
|
795
|
+
props.onChange(option.value);
|
|
796
|
+
setOpen(false);
|
|
797
|
+
},
|
|
798
|
+
className: clsx("univer-flex univer-h-8 univer-w-full univer-items-center univer-gap-2 univer-rounded-md univer-border-none univer-bg-transparent univer-px-2 univer-text-left univer-text-sm univer-text-gray-700 univer-transition-colors hover:univer-bg-gray-100 dark:!univer-text-gray-100 dark:hover:!univer-bg-gray-800", { "univer-bg-primary-50 univer-text-primary-600 dark:!univer-bg-gray-800 dark:!univer-text-primary-300": option.value === props.value }),
|
|
799
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
800
|
+
className: "univer-flex univer-size-4 univer-items-center univer-justify-center",
|
|
801
|
+
children: option.icon
|
|
802
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
803
|
+
className: "univer-flex-1",
|
|
804
|
+
children: option.label
|
|
805
|
+
})]
|
|
806
|
+
}, option.value))
|
|
807
|
+
}),
|
|
808
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Tooltip, {
|
|
809
|
+
title: props.title,
|
|
810
|
+
placement: "bottom",
|
|
811
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
812
|
+
type: "button",
|
|
813
|
+
className: clsx("univer-flex univer-h-6 univer-min-w-9 univer-items-center univer-justify-center univer-gap-1 univer-rounded-md univer-border-none univer-bg-transparent univer-px-1.5 univer-text-sm univer-text-gray-700 univer-transition-colors hover:univer-bg-gray-100 dark:!univer-text-gray-100 dark:hover:!univer-bg-gray-700", { "univer-bg-gray-100 univer-text-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-primary-300": open }),
|
|
814
|
+
children: [activeOption.icon, /* @__PURE__ */ jsx(MoreDownIcon, { className: "univer-text-xs" })]
|
|
815
|
+
})
|
|
816
|
+
}) })
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
function DocImageFloatingToolbar(props) {
|
|
820
|
+
var _univerInstanceServic, _wrappingStyleOptions, _wrappingStyleOptions2;
|
|
821
|
+
const commandService = useDependency(ICommandService);
|
|
822
|
+
const localeService = useDependency(LocaleService);
|
|
823
|
+
const documentDataModel = (_univerInstanceServic = useDependency(IUniverInstanceService).getUnit(props.unitId, UniverInstanceType.UNIVER_DOC)) !== null && _univerInstanceServic !== void 0 ? _univerInstanceServic : void 0;
|
|
824
|
+
const [wrappingStyle, setWrappingStyle] = useState(() => getWrappingStyle(documentDataModel, props.drawingId));
|
|
825
|
+
const [hidden, setHidden] = useState(false);
|
|
826
|
+
const getMenuItem = (label) => props.menuItems.find((item) => item.label === label);
|
|
827
|
+
const editItem = getMenuItem("drawing-ui.image-popup.edit");
|
|
828
|
+
const cropItem = getMenuItem("drawing-ui.image-popup.crop");
|
|
829
|
+
const deleteItem = getMenuItem("drawing-ui.image-popup.delete");
|
|
830
|
+
const wrappingStyleOptions = [
|
|
831
|
+
{
|
|
832
|
+
label: localeService.t("drawing-ui.image-text-wrap.inline"),
|
|
833
|
+
value: "inline",
|
|
834
|
+
icon: /* @__PURE__ */ jsx(TextWrapShapeIcon, {})
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
label: localeService.t("drawing-ui.image-text-wrap.square"),
|
|
838
|
+
value: "wrapSquare",
|
|
839
|
+
icon: /* @__PURE__ */ jsx(TextWrapShapeIcon, {})
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
label: localeService.t("drawing-ui.image-text-wrap.topAndBottom"),
|
|
843
|
+
value: "wrapTopAndBottom",
|
|
844
|
+
icon: /* @__PURE__ */ jsx(TextWrapShapeIcon, {})
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
label: localeService.t("drawing-ui.image-text-wrap.behindText"),
|
|
848
|
+
value: "behindText",
|
|
849
|
+
icon: /* @__PURE__ */ jsx(TextWrapShapeIcon, {})
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
label: localeService.t("drawing-ui.image-text-wrap.inFrontText"),
|
|
853
|
+
value: "inFrontOfText",
|
|
854
|
+
icon: /* @__PURE__ */ jsx(TextWrapShapeIcon, {})
|
|
855
|
+
}
|
|
856
|
+
];
|
|
857
|
+
const executeMenuItem = (item) => {
|
|
858
|
+
if (!item || item.disable) return;
|
|
859
|
+
commandService.executeCommand(item.commandId, item.commandParams);
|
|
860
|
+
};
|
|
861
|
+
const updateWrappingStyle = (value) => {
|
|
862
|
+
setWrappingStyle(value);
|
|
863
|
+
commandService.executeCommand(UPDATE_DOC_DRAWING_WRAPPING_STYLE_COMMAND_ID, {
|
|
864
|
+
unitId: props.unitId,
|
|
865
|
+
subUnitId: props.subUnitId,
|
|
866
|
+
drawings: [{
|
|
867
|
+
unitId: props.unitId,
|
|
868
|
+
subUnitId: props.subUnitId,
|
|
869
|
+
drawingId: props.drawingId
|
|
870
|
+
}],
|
|
871
|
+
wrappingStyle: value
|
|
872
|
+
});
|
|
873
|
+
};
|
|
874
|
+
if (hidden) return null;
|
|
875
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
876
|
+
"data-u-comp": "doc-image-floating-toolbar",
|
|
877
|
+
onMouseDown: (event) => {
|
|
878
|
+
event.stopPropagation();
|
|
879
|
+
event.preventDefault();
|
|
880
|
+
},
|
|
881
|
+
className: clsx("univer-box-border univer-flex univer-items-center univer-rounded univer-bg-white univer-px-1 univer-py-1 univer-shadow-sm dark:!univer-border-gray-700 dark:!univer-bg-gray-900", borderClassName),
|
|
882
|
+
children: [
|
|
883
|
+
/* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(ToolbarDropdownButton, {
|
|
884
|
+
title: (_wrappingStyleOptions = (_wrappingStyleOptions2 = wrappingStyleOptions.find((option) => option.value === wrappingStyle)) === null || _wrappingStyleOptions2 === void 0 ? void 0 : _wrappingStyleOptions2.label) !== null && _wrappingStyleOptions !== void 0 ? _wrappingStyleOptions : localeService.t("drawing-ui.image-text-wrap.inline"),
|
|
885
|
+
value: wrappingStyle,
|
|
886
|
+
options: wrappingStyleOptions,
|
|
887
|
+
onChange: updateWrappingStyle
|
|
888
|
+
}) }),
|
|
889
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
890
|
+
/* @__PURE__ */ jsxs(ToolbarGroup, { children: [/* @__PURE__ */ jsx(ToolbarButton, {
|
|
891
|
+
title: editItem ? localeService.t(editItem.label) : localeService.t("drawing-ui.image-popup.edit"),
|
|
892
|
+
disabled: !editItem || editItem.disable,
|
|
893
|
+
onClick: () => {
|
|
894
|
+
setHidden(true);
|
|
895
|
+
executeMenuItem(editItem);
|
|
896
|
+
},
|
|
897
|
+
children: /* @__PURE__ */ jsx(DocSettingIcon, {})
|
|
898
|
+
}), /* @__PURE__ */ jsx(ToolbarButton, {
|
|
899
|
+
title: cropItem ? localeService.t(cropItem.label) : localeService.t("drawing-ui.image-popup.crop"),
|
|
900
|
+
disabled: !cropItem || cropItem.disable,
|
|
901
|
+
onClick: () => executeMenuItem(cropItem),
|
|
902
|
+
children: /* @__PURE__ */ jsx(CropIcon, {})
|
|
903
|
+
})] }),
|
|
904
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
905
|
+
/* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(ToolbarButton, {
|
|
906
|
+
title: deleteItem ? localeService.t(deleteItem.label) : localeService.t("drawing-ui.image-popup.delete"),
|
|
907
|
+
disabled: !deleteItem || deleteItem.disable,
|
|
908
|
+
onClick: () => executeMenuItem(deleteItem),
|
|
909
|
+
children: /* @__PURE__ */ jsx(DeleteIcon, {})
|
|
910
|
+
}) })
|
|
911
|
+
]
|
|
912
|
+
});
|
|
913
|
+
}
|
|
661
914
|
|
|
662
915
|
//#endregion
|
|
663
|
-
//#region \0@oxc-project+runtime@0.
|
|
916
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorateParam.js
|
|
664
917
|
function __decorateParam(paramIndex, decorator) {
|
|
665
918
|
return function(target, key) {
|
|
666
919
|
decorator(target, key, paramIndex);
|
|
@@ -668,7 +921,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
668
921
|
}
|
|
669
922
|
|
|
670
923
|
//#endregion
|
|
671
|
-
//#region \0@oxc-project+runtime@0.
|
|
924
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
|
|
672
925
|
function __decorate(decorators, target, key, desc) {
|
|
673
926
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
674
927
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -785,7 +1038,7 @@ function getUpdateParams(objects, drawingManagerService) {
|
|
|
785
1038
|
}
|
|
786
1039
|
|
|
787
1040
|
//#endregion
|
|
788
|
-
//#region \0@oxc-project+runtime@0.
|
|
1041
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
|
|
789
1042
|
function _typeof(o) {
|
|
790
1043
|
"@babel/helpers - typeof";
|
|
791
1044
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -796,7 +1049,7 @@ function _typeof(o) {
|
|
|
796
1049
|
}
|
|
797
1050
|
|
|
798
1051
|
//#endregion
|
|
799
|
-
//#region \0@oxc-project+runtime@0.
|
|
1052
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
|
|
800
1053
|
function toPrimitive(t, r) {
|
|
801
1054
|
if ("object" != _typeof(t) || !t) return t;
|
|
802
1055
|
var e = t[Symbol.toPrimitive];
|
|
@@ -809,14 +1062,14 @@ function toPrimitive(t, r) {
|
|
|
809
1062
|
}
|
|
810
1063
|
|
|
811
1064
|
//#endregion
|
|
812
|
-
//#region \0@oxc-project+runtime@0.
|
|
1065
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
|
|
813
1066
|
function toPropertyKey(t) {
|
|
814
1067
|
var i = toPrimitive(t, "string");
|
|
815
1068
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
816
1069
|
}
|
|
817
1070
|
|
|
818
1071
|
//#endregion
|
|
819
|
-
//#region \0@oxc-project+runtime@0.
|
|
1072
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
|
|
820
1073
|
function _defineProperty(e, r, t) {
|
|
821
1074
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
822
1075
|
value: t,
|
|
@@ -1498,7 +1751,7 @@ let ImageCropperController = class ImageCropperController extends Disposable {
|
|
|
1498
1751
|
if (!(imageShape instanceof Image)) {
|
|
1499
1752
|
this._messageService.show({
|
|
1500
1753
|
type: MessageType.Error,
|
|
1501
|
-
content: this._localeService.t("image-cropper.error")
|
|
1754
|
+
content: this._localeService.t("drawing-ui.image-cropper.error")
|
|
1502
1755
|
});
|
|
1503
1756
|
return;
|
|
1504
1757
|
}
|
|
@@ -1599,7 +1852,7 @@ let ImageCropperController = class ImageCropperController extends Disposable {
|
|
|
1599
1852
|
if (!(imageShape instanceof Image)) {
|
|
1600
1853
|
this._messageService.show({
|
|
1601
1854
|
type: MessageType.Error,
|
|
1602
|
-
content: this._localeService.t("image-cropper.error")
|
|
1855
|
+
content: this._localeService.t("drawing-ui.image-cropper.error")
|
|
1603
1856
|
});
|
|
1604
1857
|
return;
|
|
1605
1858
|
}
|
|
@@ -2198,42 +2451,42 @@ const DrawingAlign = (props) => {
|
|
|
2198
2451
|
const [alignValue, setAlignValue] = useState("0");
|
|
2199
2452
|
const alignOptions = [
|
|
2200
2453
|
{
|
|
2201
|
-
label: localeService.t("image-panel.align.default"),
|
|
2454
|
+
label: localeService.t("drawing-ui.image-panel.align.default"),
|
|
2202
2455
|
value: "0"
|
|
2203
2456
|
},
|
|
2204
2457
|
{ options: [
|
|
2205
2458
|
{
|
|
2206
|
-
label: localeService.t("image-panel.align.left"),
|
|
2459
|
+
label: localeService.t("drawing-ui.image-panel.align.left"),
|
|
2207
2460
|
value: "1"
|
|
2208
2461
|
},
|
|
2209
2462
|
{
|
|
2210
|
-
label: localeService.t("image-panel.align.center"),
|
|
2463
|
+
label: localeService.t("drawing-ui.image-panel.align.center"),
|
|
2211
2464
|
value: "2"
|
|
2212
2465
|
},
|
|
2213
2466
|
{
|
|
2214
|
-
label: localeService.t("image-panel.align.right"),
|
|
2467
|
+
label: localeService.t("drawing-ui.image-panel.align.right"),
|
|
2215
2468
|
value: "3"
|
|
2216
2469
|
}
|
|
2217
2470
|
] },
|
|
2218
2471
|
{ options: [
|
|
2219
2472
|
{
|
|
2220
|
-
label: localeService.t("image-panel.align.top"),
|
|
2473
|
+
label: localeService.t("drawing-ui.image-panel.align.top"),
|
|
2221
2474
|
value: "4"
|
|
2222
2475
|
},
|
|
2223
2476
|
{
|
|
2224
|
-
label: localeService.t("image-panel.align.middle"),
|
|
2477
|
+
label: localeService.t("drawing-ui.image-panel.align.middle"),
|
|
2225
2478
|
value: "5"
|
|
2226
2479
|
},
|
|
2227
2480
|
{
|
|
2228
|
-
label: localeService.t("image-panel.align.bottom"),
|
|
2481
|
+
label: localeService.t("drawing-ui.image-panel.align.bottom"),
|
|
2229
2482
|
value: "6"
|
|
2230
2483
|
}
|
|
2231
2484
|
] },
|
|
2232
2485
|
{ options: [{
|
|
2233
|
-
label: localeService.t("image-panel.align.horizon"),
|
|
2486
|
+
label: localeService.t("drawing-ui.image-panel.align.horizon"),
|
|
2234
2487
|
value: "7"
|
|
2235
2488
|
}, {
|
|
2236
|
-
label: localeService.t("image-panel.align.vertical"),
|
|
2489
|
+
label: localeService.t("drawing-ui.image-panel.align.vertical"),
|
|
2237
2490
|
value: "8"
|
|
2238
2491
|
}] }
|
|
2239
2492
|
];
|
|
@@ -2248,7 +2501,7 @@ const DrawingAlign = (props) => {
|
|
|
2248
2501
|
className: clsx("univer-relative univer-w-full", { "univer-hidden": !alignShow }),
|
|
2249
2502
|
children: [/* @__PURE__ */ jsx("header", {
|
|
2250
2503
|
className: "univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2251
|
-
children: /* @__PURE__ */ jsx("div", { children: localeService.t("image-panel.align.title") })
|
|
2504
|
+
children: /* @__PURE__ */ jsx("div", { children: localeService.t("drawing-ui.image-panel.align.title") })
|
|
2252
2505
|
}), /* @__PURE__ */ jsx("div", {
|
|
2253
2506
|
className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
|
|
2254
2507
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -2294,7 +2547,7 @@ const DrawingArrange = (props) => {
|
|
|
2294
2547
|
className: clsx("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", { "univer-hidden": !arrangeShow }),
|
|
2295
2548
|
children: [/* @__PURE__ */ jsx("header", {
|
|
2296
2549
|
className: "univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2297
|
-
children: /* @__PURE__ */ jsx("div", { children: localeService.t("image-panel.arrange.title") })
|
|
2550
|
+
children: /* @__PURE__ */ jsx("div", { children: localeService.t("drawing-ui.image-panel.arrange.title") })
|
|
2298
2551
|
}), /* @__PURE__ */ jsxs("div", {
|
|
2299
2552
|
className: "univer-grid univer-grid-cols-2 univer-gap-2",
|
|
2300
2553
|
children: [
|
|
@@ -2302,25 +2555,25 @@ const DrawingArrange = (props) => {
|
|
|
2302
2555
|
onClick: () => {
|
|
2303
2556
|
onArrangeBtnClick(ArrangeTypeEnum.forward);
|
|
2304
2557
|
},
|
|
2305
|
-
children: [/* @__PURE__ */ jsx(MoveUpIcon, {}), localeService.t("image-panel.arrange.forward")]
|
|
2558
|
+
children: [/* @__PURE__ */ jsx(MoveUpIcon, {}), localeService.t("drawing-ui.image-panel.arrange.forward")]
|
|
2306
2559
|
}),
|
|
2307
2560
|
/* @__PURE__ */ jsxs(Button, {
|
|
2308
2561
|
onClick: () => {
|
|
2309
2562
|
onArrangeBtnClick(ArrangeTypeEnum.backward);
|
|
2310
2563
|
},
|
|
2311
|
-
children: [/* @__PURE__ */ jsx(MoveDownIcon, {}), localeService.t("image-panel.arrange.backward")]
|
|
2564
|
+
children: [/* @__PURE__ */ jsx(MoveDownIcon, {}), localeService.t("drawing-ui.image-panel.arrange.backward")]
|
|
2312
2565
|
}),
|
|
2313
2566
|
/* @__PURE__ */ jsxs(Button, {
|
|
2314
2567
|
onClick: () => {
|
|
2315
2568
|
onArrangeBtnClick(ArrangeTypeEnum.front);
|
|
2316
2569
|
},
|
|
2317
|
-
children: [/* @__PURE__ */ jsx(TopmostIcon, {}), localeService.t("image-panel.arrange.front")]
|
|
2570
|
+
children: [/* @__PURE__ */ jsx(TopmostIcon, {}), localeService.t("drawing-ui.image-panel.arrange.front")]
|
|
2318
2571
|
}),
|
|
2319
2572
|
/* @__PURE__ */ jsxs(Button, {
|
|
2320
2573
|
onClick: () => {
|
|
2321
2574
|
onArrangeBtnClick(ArrangeTypeEnum.back);
|
|
2322
2575
|
},
|
|
2323
|
-
children: [/* @__PURE__ */ jsx(BottomIcon, {}), localeService.t("image-panel.arrange.back")]
|
|
2576
|
+
children: [/* @__PURE__ */ jsx(BottomIcon, {}), localeService.t("drawing-ui.image-panel.arrange.back")]
|
|
2324
2577
|
})
|
|
2325
2578
|
]
|
|
2326
2579
|
})]
|
|
@@ -2379,17 +2632,17 @@ const DrawingGroup = (props) => {
|
|
|
2379
2632
|
className: clsx("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", { "univer-hidden": hasGroup === true && groupShow === false || hasGroup === false }),
|
|
2380
2633
|
children: [/* @__PURE__ */ jsx("header", {
|
|
2381
2634
|
className: "univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2382
|
-
children: /* @__PURE__ */ jsx("div", { children: localeService.t("image-panel.group.title") })
|
|
2635
|
+
children: /* @__PURE__ */ jsx("div", { children: localeService.t("drawing-ui.image-panel.group.title") })
|
|
2383
2636
|
}), /* @__PURE__ */ jsxs("div", {
|
|
2384
2637
|
className: "univer-flex univer-items-center univer-justify-center univer-gap-2",
|
|
2385
2638
|
children: [/* @__PURE__ */ jsxs(Button, {
|
|
2386
2639
|
className: clsx({ "univer-hidden": !groupBtnShow }),
|
|
2387
2640
|
onClick: onGroupBtnClick,
|
|
2388
|
-
children: [/* @__PURE__ */ jsx(GroupIcon, {}), localeService.t("image-panel.group.group")]
|
|
2641
|
+
children: [/* @__PURE__ */ jsx(GroupIcon, {}), localeService.t("drawing-ui.image-panel.group.group")]
|
|
2389
2642
|
}), /* @__PURE__ */ jsxs(Button, {
|
|
2390
2643
|
className: clsx({ "univer-hidden": !ungroupBtnShow }),
|
|
2391
2644
|
onClick: onUngroupBtnClick,
|
|
2392
|
-
children: [/* @__PURE__ */ jsx(UngroupIcon, {}), localeService.t("image-panel.group.unGroup")]
|
|
2645
|
+
children: [/* @__PURE__ */ jsx(UngroupIcon, {}), localeService.t("drawing-ui.image-panel.group.unGroup")]
|
|
2393
2646
|
})]
|
|
2394
2647
|
})]
|
|
2395
2648
|
});
|
|
@@ -2588,12 +2841,12 @@ const DrawingTransform = (props) => {
|
|
|
2588
2841
|
children: [
|
|
2589
2842
|
/* @__PURE__ */ jsx("header", {
|
|
2590
2843
|
className: "univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2591
|
-
children: /* @__PURE__ */ jsx("div", { children: localeService.t("image-panel.transform.title") })
|
|
2844
|
+
children: /* @__PURE__ */ jsx("div", { children: localeService.t("drawing-ui.image-panel.transform.title") })
|
|
2592
2845
|
}),
|
|
2593
2846
|
/* @__PURE__ */ jsxs("div", {
|
|
2594
2847
|
className: "univer-grid univer-grid-cols-3 univer-gap-2 [&>div]:univer-grid [&>div]:univer-gap-2",
|
|
2595
2848
|
children: [
|
|
2596
|
-
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("image-panel.transform.width") }), /* @__PURE__ */ jsx(InputNumber, {
|
|
2849
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("drawing-ui.image-panel.transform.width") }), /* @__PURE__ */ jsx(InputNumber, {
|
|
2597
2850
|
precision: 1,
|
|
2598
2851
|
value: width,
|
|
2599
2852
|
min: 20,
|
|
@@ -2601,7 +2854,7 @@ const DrawingTransform = (props) => {
|
|
|
2601
2854
|
handleWidthChange(val);
|
|
2602
2855
|
}
|
|
2603
2856
|
})] }),
|
|
2604
|
-
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("image-panel.transform.height") }), /* @__PURE__ */ jsx(InputNumber, {
|
|
2857
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("drawing-ui.image-panel.transform.height") }), /* @__PURE__ */ jsx(InputNumber, {
|
|
2605
2858
|
precision: 1,
|
|
2606
2859
|
value: height,
|
|
2607
2860
|
min: 20,
|
|
@@ -2609,7 +2862,7 @@ const DrawingTransform = (props) => {
|
|
|
2609
2862
|
handleHeightChange(val);
|
|
2610
2863
|
}
|
|
2611
2864
|
})] }),
|
|
2612
|
-
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("image-panel.transform.lock") }), /* @__PURE__ */ jsx("div", {
|
|
2865
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("drawing-ui.image-panel.transform.lock") }), /* @__PURE__ */ jsx("div", {
|
|
2613
2866
|
className: "univer-text-center",
|
|
2614
2867
|
children: /* @__PURE__ */ jsx(Checkbox, {
|
|
2615
2868
|
checked: lockRatio,
|
|
@@ -2621,21 +2874,21 @@ const DrawingTransform = (props) => {
|
|
|
2621
2874
|
/* @__PURE__ */ jsxs("div", {
|
|
2622
2875
|
className: "univer-grid univer-grid-cols-3 univer-gap-2 [&>div]:univer-grid [&>div]:univer-gap-2",
|
|
2623
2876
|
children: [
|
|
2624
|
-
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("image-panel.transform.x") }), /* @__PURE__ */ jsx(InputNumber, {
|
|
2877
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("drawing-ui.image-panel.transform.x") }), /* @__PURE__ */ jsx(InputNumber, {
|
|
2625
2878
|
precision: 1,
|
|
2626
2879
|
value: xPosition,
|
|
2627
2880
|
onChange: (val) => {
|
|
2628
2881
|
handleXChange(val);
|
|
2629
2882
|
}
|
|
2630
2883
|
})] }),
|
|
2631
|
-
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("image-panel.transform.y") }), /* @__PURE__ */ jsx(InputNumber, {
|
|
2884
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("drawing-ui.image-panel.transform.y") }), /* @__PURE__ */ jsx(InputNumber, {
|
|
2632
2885
|
precision: 1,
|
|
2633
2886
|
value: yPosition,
|
|
2634
2887
|
onChange: (val) => {
|
|
2635
2888
|
handleYChange(val);
|
|
2636
2889
|
}
|
|
2637
2890
|
})] }),
|
|
2638
|
-
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("image-panel.transform.rotate") }), /* @__PURE__ */ jsx(InputNumber, {
|
|
2891
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", { children: localeService.t("drawing-ui.image-panel.transform.rotate") }), /* @__PURE__ */ jsx(InputNumber, {
|
|
2639
2892
|
precision: 1,
|
|
2640
2893
|
value: rotation,
|
|
2641
2894
|
min: RANGE_DRAWING_ROTATION_LIMIT[0],
|
|
@@ -2662,7 +2915,7 @@ const ImageCropper = (props) => {
|
|
|
2662
2915
|
const cropStateRef = useRef(false);
|
|
2663
2916
|
const cropOptions = [
|
|
2664
2917
|
{
|
|
2665
|
-
label: localeService.t("image-panel.crop.mode"),
|
|
2918
|
+
label: localeService.t("drawing-ui.image-panel.crop.mode"),
|
|
2666
2919
|
value: "0"
|
|
2667
2920
|
},
|
|
2668
2921
|
{
|
|
@@ -2726,7 +2979,7 @@ const ImageCropper = (props) => {
|
|
|
2726
2979
|
children: [
|
|
2727
2980
|
/* @__PURE__ */ jsx("header", {
|
|
2728
2981
|
className: "univer-text-gray-600 dark:!univer-text-gray-200",
|
|
2729
|
-
children: /* @__PURE__ */ jsx("div", { children: localeService.t("image-panel.crop.title") })
|
|
2982
|
+
children: /* @__PURE__ */ jsx("div", { children: localeService.t("drawing-ui.image-panel.crop.title") })
|
|
2730
2983
|
}),
|
|
2731
2984
|
/* @__PURE__ */ jsxs("div", {
|
|
2732
2985
|
className: "univer-flex univer-items-center univer-justify-center univer-gap-2",
|
|
@@ -2734,7 +2987,7 @@ const ImageCropper = (props) => {
|
|
|
2734
2987
|
onClick: () => {
|
|
2735
2988
|
onCropperBtnClick(cropValue);
|
|
2736
2989
|
},
|
|
2737
|
-
children: [/* @__PURE__ */ jsx(CreateCopyIcon, {}), localeService.t("image-panel.crop.start")]
|
|
2990
|
+
children: [/* @__PURE__ */ jsx(CreateCopyIcon, {}), localeService.t("drawing-ui.image-panel.crop.start")]
|
|
2738
2991
|
}), /* @__PURE__ */ jsx(Select, {
|
|
2739
2992
|
value: cropValue,
|
|
2740
2993
|
options: cropOptions,
|
|
@@ -2833,7 +3086,7 @@ const DrawingCommonPanel = (props) => {
|
|
|
2833
3086
|
className: clsx("univer-h-full", { "univer-hidden": !nullShow }),
|
|
2834
3087
|
children: /* @__PURE__ */ jsx("div", {
|
|
2835
3088
|
className: "univer-flex univer-h-full univer-items-center univer-justify-center",
|
|
2836
|
-
children: /* @__PURE__ */ jsx("span", { children: localeService.t("image-panel.null") })
|
|
3089
|
+
children: /* @__PURE__ */ jsx("span", { children: localeService.t("drawing-ui.image-panel.null") })
|
|
2837
3090
|
})
|
|
2838
3091
|
}),
|
|
2839
3092
|
/* @__PURE__ */ jsx(DrawingArrange, {
|