@univerjs/drawing-ui 1.0.0-alpha.7 → 1.0.0-alpha.8
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 +21 -17
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +16 -16
- package/lib/cjs/locale/vi-VN.js +16 -16
- package/lib/es/index.js +25 -21
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/ru-RU.js +16 -16
- package/lib/es/locale/vi-VN.js +16 -16
- package/lib/index.js +25 -21
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/ru-RU.js +16 -16
- package/lib/locale/vi-VN.js +16 -16
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/package.json +8 -8
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ArrangeTypeEnum, BooleanNumber, CommandType, Disposable, DrawingTypeEnum, ICommandService, IConfigService, IImageIoService, IURLImageService, IUniverInstanceService, ImageSourceType, Inject, Injector, LocaleService, Plugin, PositionedObjectLayoutType, UniverInstanceType, checkIfMove, debounce, generateRandomId, merge, toDisposable } from "@univerjs/core";
|
|
2
|
-
import { DRAWING_GROUPABLE_TYPES, IDrawingManagerService, SetDrawingSelectedOperation, getDrawingShapeKeyByDrawingSearch, isGroupableDrawingType, resolveDrawingRotateEnabled } from "@univerjs/drawing";
|
|
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 { ComponentManager, ContextMenuGroup, ContextMenuPosition, IDialogService, IGalleryService, IMenuManagerService, IMessageService, IconManager, MenuItemType, useDependency, useObservable } from "@univerjs/ui";
|
|
1
|
+
import { ArrangeTypeEnum, BooleanNumber, CommandType, DependentOn, Disposable, DrawingTypeEnum, ICommandService, IConfigService, IImageIoService, IURLImageService, IUniverInstanceService, ImageSourceType, Inject, Injector, LocaleService, Plugin, PositionedObjectLayoutType, UniverInstanceType, checkIfMove, debounce, generateRandomId, merge, toDisposable } from "@univerjs/core";
|
|
2
|
+
import { DRAWING_GROUPABLE_TYPES, IDrawingManagerService, SetDrawingSelectedOperation, UniverDrawingPlugin, getDrawingShapeKeyByDrawingSearch, isGroupableDrawingType, resolveDrawingRotateEnabled } from "@univerjs/drawing";
|
|
3
|
+
import { CURSOR_TYPE, Canvas, DRAWING_OBJECT_LAYER_INDEX, DrawingGroupObject, Group, IRenderManagerService, Image, RENDER_CLASS_TYPE, Rect, Shape, UniverRenderEnginePlugin, Vector2, degToRad, getGroupState, precisionTo, transformObjectOutOfGroup } from "@univerjs/engine-render";
|
|
4
|
+
import { ComponentManager, ContextMenuGroup, ContextMenuPosition, IDialogService, IGalleryService, IMenuManagerService, IMessageService, IconManager, MenuItemType, UniverUIPlugin, useDependency, useObservable } from "@univerjs/ui";
|
|
5
5
|
import { BehaviorSubject, Observable, bufferTime, filter, map, merge as merge$1, of, startWith, switchMap } from "rxjs";
|
|
6
6
|
import { ArrowDownIcon, ArrowUpIcon, AutofillDoubleIcon, BottomIcon, ChartIcon, CreateCopyIcon, CropIcon, DeleteIcon, DocSettingIcon, EyeIcon, EyelashIcon, GroupIcon, LocateFixedIcon, LockIcon, MoreDownIcon, MoreRightIcon, MoveDownIcon, MoveUpIcon, TextWrapShapeIcon, TopmostIcon, UngroupIcon, UnlockIcon } from "@univerjs/icons";
|
|
7
7
|
import { Button, Checkbox, Dropdown, DropdownMenu, Input, InputNumber, MessageType, Select, Separator, Tooltip, borderClassName, clsx } from "@univerjs/design";
|
|
@@ -626,7 +626,7 @@ const menuSchema = { [ContextMenuPosition.DRAWING]: { [ContextMenuGroup.OTHERS]:
|
|
|
626
626
|
//#endregion
|
|
627
627
|
//#region package.json
|
|
628
628
|
var name = "@univerjs/drawing-ui";
|
|
629
|
-
var version = "1.0.0-alpha.
|
|
629
|
+
var version = "1.0.0-alpha.8";
|
|
630
630
|
|
|
631
631
|
//#endregion
|
|
632
632
|
//#region src/config/config.ts
|
|
@@ -900,7 +900,7 @@ function DocChartFloatingToolbar(props) {
|
|
|
900
900
|
}
|
|
901
901
|
|
|
902
902
|
//#endregion
|
|
903
|
-
//#region \0@oxc-project+runtime@0.
|
|
903
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
|
|
904
904
|
function __decorateParam(paramIndex, decorator) {
|
|
905
905
|
return function(target, key) {
|
|
906
906
|
decorator(target, key, paramIndex);
|
|
@@ -908,7 +908,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
908
908
|
}
|
|
909
909
|
|
|
910
910
|
//#endregion
|
|
911
|
-
//#region \0@oxc-project+runtime@0.
|
|
911
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
|
|
912
912
|
function __decorate(decorators, target, key, desc) {
|
|
913
913
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
914
914
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -963,7 +963,7 @@ let ComponentsController = class ComponentsController extends Disposable {
|
|
|
963
963
|
ComponentsController = __decorate([__decorateParam(0, Inject(ComponentManager)), __decorateParam(1, Inject(IconManager))], ComponentsController);
|
|
964
964
|
|
|
965
965
|
//#endregion
|
|
966
|
-
//#region \0@oxc-project+runtime@0.
|
|
966
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
|
|
967
967
|
function _typeof(o) {
|
|
968
968
|
"@babel/helpers - typeof";
|
|
969
969
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -974,7 +974,7 @@ function _typeof(o) {
|
|
|
974
974
|
}
|
|
975
975
|
|
|
976
976
|
//#endregion
|
|
977
|
-
//#region \0@oxc-project+runtime@0.
|
|
977
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
|
|
978
978
|
function toPrimitive(t, r) {
|
|
979
979
|
if ("object" != _typeof(t) || !t) return t;
|
|
980
980
|
var e = t[Symbol.toPrimitive];
|
|
@@ -987,14 +987,14 @@ function toPrimitive(t, r) {
|
|
|
987
987
|
}
|
|
988
988
|
|
|
989
989
|
//#endregion
|
|
990
|
-
//#region \0@oxc-project+runtime@0.
|
|
990
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
|
|
991
991
|
function toPropertyKey(t) {
|
|
992
992
|
var i = toPrimitive(t, "string");
|
|
993
993
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
994
994
|
}
|
|
995
995
|
|
|
996
996
|
//#endregion
|
|
997
|
-
//#region \0@oxc-project+runtime@0.
|
|
997
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
|
|
998
998
|
function _defineProperty(e, r, t) {
|
|
999
999
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1000
1000
|
value: t,
|
|
@@ -1369,7 +1369,7 @@ let DrawingUpdateController = class DrawingUpdateController extends Disposable {
|
|
|
1369
1369
|
}
|
|
1370
1370
|
_getSceneAndTransformerByDrawingSearch(unitId) {
|
|
1371
1371
|
if (unitId == null) return;
|
|
1372
|
-
const renderObject = this._renderManagerService.
|
|
1372
|
+
const renderObject = this._renderManagerService.getRenderUnitById(unitId);
|
|
1373
1373
|
const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
|
|
1374
1374
|
if (scene == null) return null;
|
|
1375
1375
|
return {
|
|
@@ -1981,7 +1981,7 @@ let ImageCropperController = class ImageCropperController extends Disposable {
|
|
|
1981
1981
|
const drawingParams = this._drawingManagerService.getFocusDrawings();
|
|
1982
1982
|
if (drawingParams.length !== 1) return;
|
|
1983
1983
|
const { unitId, subUnitId, drawingId } = drawingParams[0];
|
|
1984
|
-
const renderObject = this._renderManagerService.
|
|
1984
|
+
const renderObject = this._renderManagerService.getRenderUnitById(unitId);
|
|
1985
1985
|
const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
|
|
1986
1986
|
if (scene == null) return true;
|
|
1987
1987
|
if (this._searchCropObject(scene) != null) this._commandService.syncExecuteCommand(CloseImageCropOperation.id, { isAuto: true });
|
|
@@ -2073,7 +2073,7 @@ let ImageCropperController = class ImageCropperController extends Disposable {
|
|
|
2073
2073
|
const params = command.params;
|
|
2074
2074
|
if (params == null) return;
|
|
2075
2075
|
const { unitId, subUnitId, drawingId } = params;
|
|
2076
|
-
const renderObject = this._renderManagerService.
|
|
2076
|
+
const renderObject = this._renderManagerService.getRenderUnitById(unitId);
|
|
2077
2077
|
const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
|
|
2078
2078
|
if (scene == null) return true;
|
|
2079
2079
|
if (!this._sceneListenerOnImageMap.has(scene)) {
|
|
@@ -2129,7 +2129,7 @@ let ImageCropperController = class ImageCropperController extends Disposable {
|
|
|
2129
2129
|
const currentUnit = this._univerInstanceService.getFocusedUnit();
|
|
2130
2130
|
if (currentUnit == null) return;
|
|
2131
2131
|
const unitId = currentUnit.getUnitId();
|
|
2132
|
-
const renderObject = this._renderManagerService.
|
|
2132
|
+
const renderObject = this._renderManagerService.getRenderUnitById(unitId);
|
|
2133
2133
|
const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
|
|
2134
2134
|
if (scene == null) return true;
|
|
2135
2135
|
const imageCropperObject = this._searchCropObject(scene);
|
|
@@ -2299,7 +2299,7 @@ let ImageUpdateController = class ImageUpdateController extends Disposable {
|
|
|
2299
2299
|
}
|
|
2300
2300
|
_getSceneAndTransformerByDrawingSearch(unitId) {
|
|
2301
2301
|
if (unitId == null) return;
|
|
2302
|
-
const renderObject = this._renderManagerService.
|
|
2302
|
+
const renderObject = this._renderManagerService.getRenderUnitById(unitId);
|
|
2303
2303
|
const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
|
|
2304
2304
|
if (scene == null) return null;
|
|
2305
2305
|
return {
|
|
@@ -2534,7 +2534,11 @@ let UniverDrawingUIPlugin = class UniverDrawingUIPlugin extends Plugin {
|
|
|
2534
2534
|
_defineProperty(UniverDrawingUIPlugin, "pluginName", "UNIVER_DRAWING_UI_PLUGIN");
|
|
2535
2535
|
_defineProperty(UniverDrawingUIPlugin, "packageName", name);
|
|
2536
2536
|
_defineProperty(UniverDrawingUIPlugin, "version", version);
|
|
2537
|
-
UniverDrawingUIPlugin = __decorate([
|
|
2537
|
+
UniverDrawingUIPlugin = __decorate([
|
|
2538
|
+
DependentOn(UniverDrawingPlugin, UniverRenderEnginePlugin, UniverUIPlugin),
|
|
2539
|
+
__decorateParam(1, Inject(Injector)),
|
|
2540
|
+
__decorateParam(2, IConfigService)
|
|
2541
|
+
], UniverDrawingUIPlugin);
|
|
2538
2542
|
|
|
2539
2543
|
//#endregion
|
|
2540
2544
|
//#region src/views/object-list-panel/object-list-panel-layer.ts
|
|
@@ -3155,7 +3159,7 @@ const DrawingGroup = (props) => {
|
|
|
3155
3159
|
const GroupIcon = iconManager.get("GroupIcon");
|
|
3156
3160
|
const UngroupIcon = iconManager.get("UngroupIcon");
|
|
3157
3161
|
const drawingParam = drawings[0];
|
|
3158
|
-
const transformer = drawingParam ? (_renderManagerService = renderManagerService.
|
|
3162
|
+
const transformer = drawingParam ? (_renderManagerService = renderManagerService.getRenderUnitById(drawingParam.unitId)) === null || _renderManagerService === void 0 || (_renderManagerService = _renderManagerService.scene) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.getTransformerByCreate() : void 0;
|
|
3159
3163
|
const { groupShow, groupBtnShow, ungroupBtnShow } = useObservable(transformer ? () => merge$1(transformer.clearControl$.pipe(filter((changeSelf) => changeSelf === true), map(() => ({
|
|
3160
3164
|
groupShow: false,
|
|
3161
3165
|
groupBtnShow: false,
|
|
@@ -3234,7 +3238,7 @@ const DrawingTransform = (props) => {
|
|
|
3234
3238
|
var _renderManagerService, _scene$getEngine;
|
|
3235
3239
|
const renderManagerService = useDependency(IRenderManagerService);
|
|
3236
3240
|
const drawingParam = props.drawings[0];
|
|
3237
|
-
const scene = drawingParam ? (_renderManagerService = renderManagerService.
|
|
3241
|
+
const scene = drawingParam ? (_renderManagerService = renderManagerService.getRenderUnitById(drawingParam.unitId)) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.scene : void 0;
|
|
3238
3242
|
const topScene = scene === null || scene === void 0 || (_scene$getEngine = scene.getEngine()) === null || _scene$getEngine === void 0 ? void 0 : _scene$getEngine.activeScene;
|
|
3239
3243
|
if (!(drawingParam === null || drawingParam === void 0 ? void 0 : drawingParam.transform) || !scene || !topScene) return null;
|
|
3240
3244
|
return /* @__PURE__ */ jsx(DrawingTransformContent, { ...props });
|
|
@@ -3247,7 +3251,7 @@ function DrawingTransformContent(props) {
|
|
|
3247
3251
|
const drawingParam = drawings[0];
|
|
3248
3252
|
const transform = drawingParam.transform;
|
|
3249
3253
|
const { unitId, subUnitId, drawingId, drawingType } = drawingParam;
|
|
3250
|
-
const scene = renderManagerService.
|
|
3254
|
+
const scene = renderManagerService.getRenderUnitById(unitId).scene;
|
|
3251
3255
|
const topScene = scene.getEngine().activeScene;
|
|
3252
3256
|
const transformer = scene.getTransformerByCreate();
|
|
3253
3257
|
const { width: originWidth = 0, height: originHeight = 0, left: originX = 0, top: originY = 0, angle: originRotation = 0 } = transform;
|
|
@@ -3614,7 +3618,7 @@ const DrawingCommonPanel = (props) => {
|
|
|
3614
3618
|
const localeService = useDependency(LocaleService);
|
|
3615
3619
|
const { drawings, hasArrange = true, hasTransform = true, hasAlign = true, hasCropper = true, hasGroup = true } = props;
|
|
3616
3620
|
const drawingParam = drawings[0];
|
|
3617
|
-
const renderObject = drawingParam ? renderManagerService.
|
|
3621
|
+
const renderObject = drawingParam ? renderManagerService.getRenderUnitById(drawingParam.unitId) : void 0;
|
|
3618
3622
|
const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
|
|
3619
3623
|
const transformer = scene === null || scene === void 0 ? void 0 : scene.getTransformerByCreate();
|
|
3620
3624
|
const { arrangeShow, transformShow, alignShow, cropperShow, nullShow } = useObservable(() => merge$1(drawingManagerService.focus$.pipe(map(getPanelShowState)), ...transformer ? [transformer.clearControl$.pipe(filter((changeSelf) => changeSelf === true), map(() => getPanelShowState([]))), transformer.changeStart$.pipe(map((state) => getPanelShowState(getUpdateParams(state.objects, drawingManagerService))))] : []), getPanelShowState(drawings), false, [drawingManagerService, transformer]);
|
package/lib/locale/fr-FR.js
CHANGED
|
@@ -17,7 +17,7 @@ const locale = { "drawing-ui": {
|
|
|
17
17
|
nameInput: "Nom de l'objet",
|
|
18
18
|
description: "Description",
|
|
19
19
|
descriptionPlaceholder: "Ajouter une description",
|
|
20
|
-
details: "
|
|
20
|
+
details: "Détails",
|
|
21
21
|
locate: "Localiser",
|
|
22
22
|
expand: "Développer",
|
|
23
23
|
collapse: "Réduire",
|
package/lib/locale/ru-RU.js
CHANGED
|
@@ -88,22 +88,22 @@ const locale = { "drawing-ui": {
|
|
|
88
88
|
null: "Нет выбранных объектов"
|
|
89
89
|
},
|
|
90
90
|
"image-text-wrap": {
|
|
91
|
-
title: "
|
|
92
|
-
wrappingStyle: "
|
|
93
|
-
square: "
|
|
94
|
-
topAndBottom: "
|
|
95
|
-
inline: "
|
|
96
|
-
behindText: "
|
|
97
|
-
inFrontText: "
|
|
98
|
-
wrapText: "
|
|
99
|
-
bothSide: "
|
|
100
|
-
leftOnly: "
|
|
101
|
-
rightOnly: "
|
|
102
|
-
distanceFromText: "
|
|
103
|
-
top: "
|
|
104
|
-
left: "
|
|
105
|
-
bottom: "
|
|
106
|
-
right: "
|
|
91
|
+
title: "Обтекание текстом",
|
|
92
|
+
wrappingStyle: "Стиль обтекания",
|
|
93
|
+
square: "Вокруг рамки",
|
|
94
|
+
topAndBottom: "Сверху и снизу",
|
|
95
|
+
inline: "В тексте",
|
|
96
|
+
behindText: "За текстом",
|
|
97
|
+
inFrontText: "Перед текстом",
|
|
98
|
+
wrapText: "Обтекание",
|
|
99
|
+
bothSide: "С обеих сторон",
|
|
100
|
+
leftOnly: "Только слева",
|
|
101
|
+
rightOnly: "Только справа",
|
|
102
|
+
distanceFromText: "Расстояние от текста",
|
|
103
|
+
top: "Сверху (пкс)",
|
|
104
|
+
left: "Слева (пкс)",
|
|
105
|
+
bottom: "Снизу (пкс)",
|
|
106
|
+
right: "Справа (пкс)"
|
|
107
107
|
},
|
|
108
108
|
"image-popup": {
|
|
109
109
|
replace: "Заменить",
|
package/lib/locale/vi-VN.js
CHANGED
|
@@ -88,22 +88,22 @@ const locale = { "drawing-ui": {
|
|
|
88
88
|
null: "Không có đối tượng nào được chọn"
|
|
89
89
|
},
|
|
90
90
|
"image-text-wrap": {
|
|
91
|
-
title: "
|
|
92
|
-
wrappingStyle: "
|
|
93
|
-
square: "
|
|
94
|
-
topAndBottom: "
|
|
95
|
-
inline: "
|
|
96
|
-
behindText: "
|
|
97
|
-
inFrontText: "
|
|
98
|
-
wrapText: "
|
|
99
|
-
bothSide: "
|
|
100
|
-
leftOnly: "
|
|
101
|
-
rightOnly: "
|
|
102
|
-
distanceFromText: "
|
|
103
|
-
top: "
|
|
104
|
-
left: "
|
|
105
|
-
bottom: "
|
|
106
|
-
right: "
|
|
91
|
+
title: "Bố cục văn bản",
|
|
92
|
+
wrappingStyle: "Kiểu bố cục",
|
|
93
|
+
square: "Vuông",
|
|
94
|
+
topAndBottom: "Trên và dưới",
|
|
95
|
+
inline: "Cùng dòng với văn bản",
|
|
96
|
+
behindText: "Phía sau văn bản",
|
|
97
|
+
inFrontText: "Phía trước văn bản",
|
|
98
|
+
wrapText: "Bọc văn bản",
|
|
99
|
+
bothSide: "Cả hai bên",
|
|
100
|
+
leftOnly: "Chỉ bên trái",
|
|
101
|
+
rightOnly: "Chỉ bên phải",
|
|
102
|
+
distanceFromText: "Khoảng cách từ văn bản",
|
|
103
|
+
top: "Trên (px)",
|
|
104
|
+
left: "Trái (px)",
|
|
105
|
+
bottom: "Dưới (px)",
|
|
106
|
+
right: "Phải (px)"
|
|
107
107
|
},
|
|
108
108
|
"image-popup": {
|
|
109
109
|
replace: "Thay thế",
|