@univerjs/docs-drawing-ui 1.0.0-alpha.6 → 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 +48 -47
- package/lib/cjs/locale/ru-RU.js +34 -34
- package/lib/cjs/locale/vi-VN.js +39 -39
- package/lib/cjs/locale/zh-HK.js +3 -3
- package/lib/cjs/locale/zh-TW.js +3 -3
- package/lib/es/index.js +51 -50
- package/lib/es/locale/ru-RU.js +34 -34
- package/lib/es/locale/vi-VN.js +39 -39
- package/lib/es/locale/zh-HK.js +3 -3
- package/lib/es/locale/zh-TW.js +3 -3
- package/lib/index.js +51 -50
- package/lib/locale/ru-RU.js +34 -34
- package/lib/locale/vi-VN.js +39 -39
- package/lib/locale/zh-HK.js +3 -3
- package/lib/locale/zh-TW.js +3 -3
- package/lib/types/controllers/doc-drawing-transformer-update.controller.d.ts +0 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +12 -12
package/lib/cjs/index.js
CHANGED
|
@@ -74,7 +74,7 @@ const UngroupDocDrawingCommand = {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
//#endregion
|
|
77
|
-
//#region \0@oxc-project+runtime@0.
|
|
77
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
|
|
78
78
|
function _typeof(o) {
|
|
79
79
|
"@babel/helpers - typeof";
|
|
80
80
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -85,7 +85,7 @@ function _typeof(o) {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
//#endregion
|
|
88
|
-
//#region \0@oxc-project+runtime@0.
|
|
88
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
|
|
89
89
|
function toPrimitive(t, r) {
|
|
90
90
|
if ("object" != _typeof(t) || !t) return t;
|
|
91
91
|
var e = t[Symbol.toPrimitive];
|
|
@@ -98,14 +98,14 @@ function toPrimitive(t, r) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
//#endregion
|
|
101
|
-
//#region \0@oxc-project+runtime@0.
|
|
101
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
|
|
102
102
|
function toPropertyKey(t) {
|
|
103
103
|
var i = toPrimitive(t, "string");
|
|
104
104
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
//#endregion
|
|
108
|
-
//#region \0@oxc-project+runtime@0.
|
|
108
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
|
|
109
109
|
function _defineProperty(e, r, t) {
|
|
110
110
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
111
111
|
value: t,
|
|
@@ -128,7 +128,7 @@ var DocRefreshDrawingsService = class {
|
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
//#endregion
|
|
131
|
-
//#region \0@oxc-project+runtime@0.
|
|
131
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
|
|
132
132
|
function __decorateParam(paramIndex, decorator) {
|
|
133
133
|
return function(target, key) {
|
|
134
134
|
decorator(target, key, paramIndex);
|
|
@@ -136,7 +136,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
//#endregion
|
|
139
|
-
//#region \0@oxc-project+runtime@0.
|
|
139
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
|
|
140
140
|
function __decorate(decorators, target, key, desc) {
|
|
141
141
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
142
142
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -265,7 +265,7 @@ let DocDrawingUpdateRenderController = class DocDrawingUpdateRenderController ex
|
|
|
265
265
|
_isInsertInHeaderFooter() {
|
|
266
266
|
var _this$_renderManagerS;
|
|
267
267
|
const { unitId } = this._context;
|
|
268
|
-
const viewModel = (_this$_renderManagerS = this._renderManagerSrv.
|
|
268
|
+
const viewModel = (_this$_renderManagerS = this._renderManagerSrv.getRenderUnitById(unitId)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.with(_univerjs_docs.DocSkeletonManagerService).getViewModel();
|
|
269
269
|
const editArea = viewModel === null || viewModel === void 0 ? void 0 : viewModel.getEditArea();
|
|
270
270
|
return editArea === _univerjs_engine_render.DocumentEditArea.HEADER || editArea === _univerjs_engine_render.DocumentEditArea.FOOTER;
|
|
271
271
|
}
|
|
@@ -368,7 +368,7 @@ let DocDrawingUpdateRenderController = class DocDrawingUpdateRenderController ex
|
|
|
368
368
|
var _this$_renderManagerS2;
|
|
369
369
|
if (!this._context) return;
|
|
370
370
|
const { unit: docDataModel, scene, unitId } = this._context;
|
|
371
|
-
const viewModel = (_this$_renderManagerS2 = this._renderManagerSrv.
|
|
371
|
+
const viewModel = (_this$_renderManagerS2 = this._renderManagerSrv.getRenderUnitById(unitId)) === null || _this$_renderManagerS2 === void 0 ? void 0 : _this$_renderManagerS2.with(_univerjs_docs.DocSkeletonManagerService).getViewModel();
|
|
372
372
|
if (viewModel == null || docDataModel == null) return;
|
|
373
373
|
const { drawings = {} } = docDataModel.getSnapshot();
|
|
374
374
|
const isEditBody = viewModel.getEditArea() === _univerjs_engine_render.DocumentEditArea.BODY;
|
|
@@ -399,7 +399,7 @@ let DocDrawingUpdateRenderController = class DocDrawingUpdateRenderController ex
|
|
|
399
399
|
_editAreaChangeListener() {
|
|
400
400
|
var _this$_renderManagerS3;
|
|
401
401
|
const { unitId } = this._context;
|
|
402
|
-
const viewModel = (_this$_renderManagerS3 = this._renderManagerSrv.
|
|
402
|
+
const viewModel = (_this$_renderManagerS3 = this._renderManagerSrv.getRenderUnitById(unitId)) === null || _this$_renderManagerS3 === void 0 ? void 0 : _this$_renderManagerS3.with(_univerjs_docs.DocSkeletonManagerService).getViewModel();
|
|
403
403
|
if (viewModel == null) return;
|
|
404
404
|
this._updateDrawingsEditStatus();
|
|
405
405
|
this.disposeWithMe(viewModel.editAreaChange$.subscribe(() => {
|
|
@@ -530,7 +530,7 @@ const MoveDocDrawingsCommand = {
|
|
|
530
530
|
const drawings = docDrawingService.getFocusDrawings();
|
|
531
531
|
if (drawings.length === 0) return false;
|
|
532
532
|
const unitId = drawings[0].unitId;
|
|
533
|
-
const renderObject = renderManagerService.
|
|
533
|
+
const renderObject = renderManagerService.getRenderUnitById(unitId);
|
|
534
534
|
const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
|
|
535
535
|
if (scene == null) return false;
|
|
536
536
|
const transformer = scene.getTransformerByCreate();
|
|
@@ -582,7 +582,7 @@ const ClearDocDrawingTransformerOperation = {
|
|
|
582
582
|
const renderManagerService = accessor.get(_univerjs_engine_render.IRenderManagerService);
|
|
583
583
|
params.forEach((unitId) => {
|
|
584
584
|
var _renderManagerService;
|
|
585
|
-
(_renderManagerService = renderManagerService.
|
|
585
|
+
(_renderManagerService = renderManagerService.getRenderUnitById(unitId)) === null || _renderManagerService === void 0 || (_renderManagerService = _renderManagerService.scene.getTransformer()) === null || _renderManagerService === void 0 || _renderManagerService.debounceRefreshControls();
|
|
586
586
|
});
|
|
587
587
|
return true;
|
|
588
588
|
}
|
|
@@ -728,7 +728,7 @@ let DocFloatDomController = class DocFloatDomController extends _univerjs_core.D
|
|
|
728
728
|
}
|
|
729
729
|
_getSceneAndTransformerByDrawingSearch(unitId) {
|
|
730
730
|
if (unitId == null) return;
|
|
731
|
-
const renderObject = this._renderManagerService.
|
|
731
|
+
const renderObject = this._renderManagerService.getRenderUnitById(unitId);
|
|
732
732
|
if (renderObject == null) return null;
|
|
733
733
|
const scene = renderObject.scene;
|
|
734
734
|
return {
|
|
@@ -864,7 +864,7 @@ let DocFloatDomController = class DocFloatDomController extends _univerjs_core.D
|
|
|
864
864
|
this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(_univerjs_core.UniverInstanceType.UNIVER_DOC).pipe((0, rxjs.map)((documentDataModel) => {
|
|
865
865
|
if (!documentDataModel) return null;
|
|
866
866
|
const unitId = documentDataModel.getUnitId();
|
|
867
|
-
const render = this._renderManagerService.
|
|
867
|
+
const render = this._renderManagerService.getRenderUnitById(unitId);
|
|
868
868
|
return render ? {
|
|
869
869
|
render,
|
|
870
870
|
unitId
|
|
@@ -1197,7 +1197,7 @@ const menuSchema = {
|
|
|
1197
1197
|
//#endregion
|
|
1198
1198
|
//#region package.json
|
|
1199
1199
|
var name = "@univerjs/docs-drawing-ui";
|
|
1200
|
-
var version = "1.0.0-alpha.
|
|
1200
|
+
var version = "1.0.0-alpha.8";
|
|
1201
1201
|
|
|
1202
1202
|
//#endregion
|
|
1203
1203
|
//#region src/config/config.ts
|
|
@@ -1228,7 +1228,7 @@ const DocDrawingPosition = (props) => {
|
|
|
1228
1228
|
var _renderManagerService;
|
|
1229
1229
|
const renderManagerService = (0, _univerjs_ui.useDependency)(_univerjs_engine_render.IRenderManagerService);
|
|
1230
1230
|
const drawingParam = props.drawings[0];
|
|
1231
|
-
const scene = drawingParam ? (_renderManagerService = renderManagerService.
|
|
1231
|
+
const scene = drawingParam ? (_renderManagerService = renderManagerService.getRenderUnitById(drawingParam.unitId)) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.scene : void 0;
|
|
1232
1232
|
return drawingParam && scene ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DocDrawingPositionContent, { ...props }) : null;
|
|
1233
1233
|
};
|
|
1234
1234
|
function DocDrawingPositionContent(props) {
|
|
@@ -1241,7 +1241,7 @@ function DocDrawingPositionContent(props) {
|
|
|
1241
1241
|
const { unitId } = drawings[0];
|
|
1242
1242
|
const documentDataModel = univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
1243
1243
|
const documentFlavor = documentDataModel === null || documentDataModel === void 0 ? void 0 : documentDataModel.getSnapshot().documentStyle.documentFlavor;
|
|
1244
|
-
const transformer = renderManagerService.
|
|
1244
|
+
const transformer = renderManagerService.getRenderUnitById(unitId).scene.getTransformerByCreate();
|
|
1245
1245
|
const HORIZONTAL_RELATIVE_FROM = [
|
|
1246
1246
|
{
|
|
1247
1247
|
label: localeService.t("docs-drawing-ui.image-position.column"),
|
|
@@ -1310,7 +1310,7 @@ function DocDrawingPositionContent(props) {
|
|
|
1310
1310
|
value
|
|
1311
1311
|
}))
|
|
1312
1312
|
});
|
|
1313
|
-
const docSelectionRenderService = (_renderManagerService2 = renderManagerService.
|
|
1313
|
+
const docSelectionRenderService = (_renderManagerService2 = renderManagerService.getRenderUnitById(unitId)) === null || _renderManagerService2 === void 0 ? void 0 : _renderManagerService2.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
1314
1314
|
if (docSelectionRenderService) docSelectionRenderService.blur();
|
|
1315
1315
|
transformer.refreshControls();
|
|
1316
1316
|
}
|
|
@@ -1326,7 +1326,7 @@ function DocDrawingPositionContent(props) {
|
|
|
1326
1326
|
const unitId = focusDrawings[0].unitId;
|
|
1327
1327
|
let drawing = null;
|
|
1328
1328
|
let pageMarginLeft = 0;
|
|
1329
|
-
const skeleton = (_renderManagerService3 = renderManagerService.
|
|
1329
|
+
const skeleton = (_renderManagerService3 = renderManagerService.getRenderUnitById(unitId)) === null || _renderManagerService3 === void 0 ? void 0 : _renderManagerService3.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
1330
1330
|
const skeletonData = skeleton === null || skeleton === void 0 ? void 0 : skeleton.getSkeletonData();
|
|
1331
1331
|
if (skeletonData == null) return;
|
|
1332
1332
|
const { pages, skeHeaders, skeFooters } = skeletonData;
|
|
@@ -1765,7 +1765,7 @@ const ITransformNonInlineDrawingCommand = {
|
|
|
1765
1765
|
const docSelectionRenderService = (_renderManagerService2 = renderManagerService.getRenderUnitById(unitId)) === null || _renderManagerService2 === void 0 ? void 0 : _renderManagerService2.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
1766
1766
|
const renderObject = renderManagerService.getRenderUnitById(unitId);
|
|
1767
1767
|
const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
|
|
1768
|
-
if (scene == null || docSelectionRenderService == null) return false;
|
|
1768
|
+
if (renderObject == null || scene == null || docSelectionRenderService == null) return false;
|
|
1769
1769
|
const transformer = scene.getTransformerByCreate();
|
|
1770
1770
|
const commandService = accessor.get(_univerjs_core.ICommandService);
|
|
1771
1771
|
const documentDataModel = accessor.get(_univerjs_core.IUniverInstanceService).getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
@@ -1827,6 +1827,8 @@ const ITransformNonInlineDrawingCommand = {
|
|
|
1827
1827
|
return _univerjs_core.JSONX.compose(acc, cur);
|
|
1828
1828
|
}, null);
|
|
1829
1829
|
const result = commandService.syncExecuteCommand(doMutation.id, doMutation.params);
|
|
1830
|
+
const skeleton = renderObject.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
1831
|
+
accessor.get(DocRefreshDrawingsService).refreshDrawings(skeleton);
|
|
1830
1832
|
transformer.refreshControls();
|
|
1831
1833
|
return Boolean(result);
|
|
1832
1834
|
}
|
|
@@ -1900,10 +1902,11 @@ function DocDrawingTextWrapContent(props) {
|
|
|
1900
1902
|
}
|
|
1901
1903
|
function handleDistToTextChange(value, direction) {
|
|
1902
1904
|
if (value == null) return;
|
|
1903
|
-
|
|
1905
|
+
const newDistToText = {
|
|
1904
1906
|
...distToText,
|
|
1905
1907
|
[direction]: value
|
|
1906
|
-
}
|
|
1908
|
+
};
|
|
1909
|
+
setDistToText(newDistToText);
|
|
1907
1910
|
const focusDrawings = drawingManagerService.getFocusDrawings();
|
|
1908
1911
|
if (focusDrawings.length === 0) return;
|
|
1909
1912
|
const drawings = focusDrawings.map((drawing) => {
|
|
@@ -2265,7 +2268,7 @@ let DocDrawingAddRemoveController = class DocDrawingAddRemoveController extends
|
|
|
2265
2268
|
this.disposeWithMe(this._commandService.onCommandExecuted((command) => {
|
|
2266
2269
|
if (command.id !== _univerjs_docs_drawing.UpdateDrawingDocTransformCommand.id && command.id !== _univerjs_docs_drawing.UpdateDocDrawingWrappingStyleCommand.id) return;
|
|
2267
2270
|
const { unitId } = command.params;
|
|
2268
|
-
const renderObject = this._renderManagerService.
|
|
2271
|
+
const renderObject = this._renderManagerService.getRenderUnitById(unitId);
|
|
2269
2272
|
const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
|
|
2270
2273
|
if (renderObject == null || scene == null) return;
|
|
2271
2274
|
this._docRefreshDrawingsService.refreshDrawings(renderObject.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton());
|
|
@@ -2288,7 +2291,7 @@ let DocDrawingAddRemoveController = class DocDrawingAddRemoveController extends
|
|
|
2288
2291
|
if (params.wrappingStyle === _univerjs_docs_drawing.TextWrappingStyle.INLINE) return;
|
|
2289
2292
|
const { unitId } = params;
|
|
2290
2293
|
const documentDataModel = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
2291
|
-
const renderObject = this._renderManagerService.
|
|
2294
|
+
const renderObject = this._renderManagerService.getRenderUnitById(unitId);
|
|
2292
2295
|
const skeletonManager = renderObject === null || renderObject === void 0 ? void 0 : renderObject.with(_univerjs_docs.DocSkeletonManagerService);
|
|
2293
2296
|
const skeletonData = skeletonManager === null || skeletonManager === void 0 ? void 0 : skeletonManager.getSkeleton().getSkeletonData();
|
|
2294
2297
|
const viewModel = skeletonManager === null || skeletonManager === void 0 ? void 0 : skeletonManager.getViewModel();
|
|
@@ -2768,11 +2771,11 @@ let DocDrawingTransformUpdateController = class DocDrawingTransformUpdateControl
|
|
|
2768
2771
|
clipOffsetTop: clipOffset === null || clipOffset === void 0 ? void 0 : clipOffset.top,
|
|
2769
2772
|
page: clipPage
|
|
2770
2773
|
});
|
|
2771
|
-
const pageRelativeAnchorPage = drawingOrigin.layoutType === _univerjs_core.PositionedObjectLayoutType.
|
|
2774
|
+
const pageRelativeAnchorPage = drawingOrigin.layoutType === _univerjs_core.PositionedObjectLayoutType.WRAP_NONE ? getDocsPageRelativeDrawingAnchorPage({
|
|
2772
2775
|
page,
|
|
2773
2776
|
clipPage,
|
|
2774
2777
|
hostPage
|
|
2775
|
-
});
|
|
2778
|
+
}) : void 0;
|
|
2776
2779
|
const pageRelativeLeft = pageRelativeAnchorPage != null ? getDocsPageRelativeDrawingLeft({
|
|
2777
2780
|
hostPage: pageRelativeAnchorPage,
|
|
2778
2781
|
positionH: drawingOrigin.docTransform.positionH,
|
|
@@ -3032,7 +3035,7 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3032
3035
|
}
|
|
3033
3036
|
_getInlineDrawingAnchor(drawing, offsetX, offsetY) {
|
|
3034
3037
|
var _this$_renderManagerS, _getOneTextSelectionR;
|
|
3035
|
-
const currentRender = this._renderManagerService.
|
|
3038
|
+
const currentRender = this._renderManagerService.getRenderUnitById(drawing.unitId);
|
|
3036
3039
|
const skeleton = currentRender === null || currentRender === void 0 ? void 0 : currentRender.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
3037
3040
|
if (currentRender == null) return;
|
|
3038
3041
|
const { mainComponent, scene } = currentRender;
|
|
@@ -3046,7 +3049,7 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3046
3049
|
const HALF = .5;
|
|
3047
3050
|
const coord = this._getTransformCoordForDocumentOffset(documentComponent, activeViewport, offsetX, offsetY);
|
|
3048
3051
|
if (coord == null) return;
|
|
3049
|
-
const docSelectionRenderService = (_this$_renderManagerS = this._renderManagerService.
|
|
3052
|
+
const docSelectionRenderService = (_this$_renderManagerS = this._renderManagerService.getRenderUnitById(drawing.unitId)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
3050
3053
|
if (docSelectionRenderService == null) return;
|
|
3051
3054
|
const nodeInfo = skeleton === null || skeleton === void 0 ? void 0 : skeleton.findNodeByCoord(coord, pageLayoutType, pageMarginLeft, pageMarginTop, {
|
|
3052
3055
|
strict: false,
|
|
@@ -3062,8 +3065,8 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3062
3065
|
}
|
|
3063
3066
|
if (glyphAnchor == null) return;
|
|
3064
3067
|
const nodePosition = skeleton === null || skeleton === void 0 ? void 0 : skeleton.findPositionByGlyph(glyphAnchor, segmentPageIndex);
|
|
3065
|
-
const docObject =
|
|
3066
|
-
if (nodePosition == null || skeleton == null
|
|
3068
|
+
const docObject = (0, _univerjs_docs_ui.neoGetDocObject)(currentRender);
|
|
3069
|
+
if (nodePosition == null || skeleton == null) return;
|
|
3067
3070
|
const positionWithIsBack = {
|
|
3068
3071
|
...nodePosition,
|
|
3069
3072
|
isBack
|
|
@@ -3079,8 +3082,8 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3079
3082
|
};
|
|
3080
3083
|
}
|
|
3081
3084
|
_getDrawingAnchor(drawing, object) {
|
|
3082
|
-
var _this$_renderManagerS2, _glyphAnchor$parent, _column$lines$find, _column$
|
|
3083
|
-
const currentRender = this._renderManagerService.
|
|
3085
|
+
var _this$_renderManagerS2, _glyphAnchor$parent, _column$parent$top, _column$parent, _column$lines$find, _column$parent2, _tableCellContext$hos, _getOneTextSelectionR2;
|
|
3086
|
+
const currentRender = this._renderManagerService.getRenderUnitById(drawing.unitId);
|
|
3084
3087
|
const skeleton = currentRender === null || currentRender === void 0 ? void 0 : currentRender.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
3085
3088
|
const skeletonData = skeleton === null || skeleton === void 0 ? void 0 : skeleton.getSkeletonData();
|
|
3086
3089
|
if (skeletonData == null || currentRender == null) return;
|
|
@@ -3098,7 +3101,7 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3098
3101
|
let glyphAnchor = null;
|
|
3099
3102
|
let segmentId = "";
|
|
3100
3103
|
let segmentPage = -1;
|
|
3101
|
-
const isBack =
|
|
3104
|
+
const isBack = true;
|
|
3102
3105
|
const docTransform = {
|
|
3103
3106
|
...drawing.docTransform,
|
|
3104
3107
|
size: {
|
|
@@ -3110,7 +3113,7 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3110
3113
|
const { x, y } = scene.getViewportScrollXY(activeViewport);
|
|
3111
3114
|
const coord = this._getTransformCoordForDocumentOffset(documentComponent, activeViewport, left - x, top - y);
|
|
3112
3115
|
if (coord == null) return;
|
|
3113
|
-
const docSelectionRenderService = (_this$_renderManagerS2 = this._renderManagerService.
|
|
3116
|
+
const docSelectionRenderService = (_this$_renderManagerS2 = this._renderManagerService.getRenderUnitById(drawing.unitId)) === null || _this$_renderManagerS2 === void 0 ? void 0 : _this$_renderManagerS2.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
3114
3117
|
if (docSelectionRenderService == null) return;
|
|
3115
3118
|
const nodeInfo = skeleton === null || skeleton === void 0 ? void 0 : skeleton.findNodeByCoord(coord, pageLayoutType, pageMarginLeft, pageMarginTop, {
|
|
3116
3119
|
strict: false,
|
|
@@ -3126,8 +3129,9 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3126
3129
|
if (glyphAnchor == null) return;
|
|
3127
3130
|
const line = (_glyphAnchor$parent = glyphAnchor.parent) === null || _glyphAnchor$parent === void 0 ? void 0 : _glyphAnchor$parent.parent;
|
|
3128
3131
|
const column = line === null || line === void 0 ? void 0 : line.parent;
|
|
3132
|
+
const sectionTop = (_column$parent$top = column === null || column === void 0 || (_column$parent = column.parent) === null || _column$parent === void 0 ? void 0 : _column$parent.top) !== null && _column$parent$top !== void 0 ? _column$parent$top : 0;
|
|
3129
3133
|
const paragraphStartLine = (_column$lines$find = column === null || column === void 0 ? void 0 : column.lines.find((l) => l.paragraphIndex === (line === null || line === void 0 ? void 0 : line.paragraphIndex) && l.paragraphStart)) !== null && _column$lines$find !== void 0 ? _column$lines$find : column === null || column === void 0 ? void 0 : column.lines[0];
|
|
3130
|
-
const page = column === null || column === void 0 || (_column$
|
|
3134
|
+
const page = column === null || column === void 0 || (_column$parent2 = column.parent) === null || _column$parent2 === void 0 ? void 0 : _column$parent2.parent;
|
|
3131
3135
|
if (line == null || column == null || paragraphStartLine == null || page == null) return;
|
|
3132
3136
|
this._liquid.reset();
|
|
3133
3137
|
const tableCellContext = page.type === _univerjs_engine_render.DocumentSkeletonPageType.CELL ? getDocsTableCellAnchorContext(drawing.unitId, page) : null;
|
|
@@ -3196,16 +3200,16 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3196
3200
|
docTransform.positionV.posOffset = top - this._liquid.y - docsTop - page.marginTop;
|
|
3197
3201
|
break;
|
|
3198
3202
|
case _univerjs_core.ObjectRelativeFromV.LINE:
|
|
3199
|
-
docTransform.positionV.posOffset = top - this._liquid.y - docsTop - line.top;
|
|
3203
|
+
docTransform.positionV.posOffset = top - this._liquid.y - docsTop - sectionTop - line.top;
|
|
3200
3204
|
break;
|
|
3201
3205
|
case _univerjs_core.ObjectRelativeFromV.PARAGRAPH:
|
|
3202
|
-
docTransform.positionV.posOffset = top - this._liquid.y - docsTop - paragraphStartLine.top;
|
|
3206
|
+
docTransform.positionV.posOffset = top - this._liquid.y - docsTop - sectionTop - paragraphStartLine.top;
|
|
3203
3207
|
break;
|
|
3204
3208
|
}
|
|
3205
3209
|
if (glyphAnchor == null) return;
|
|
3206
3210
|
const nodePosition = skeleton === null || skeleton === void 0 ? void 0 : skeleton.findPositionByGlyph(glyphAnchor, segmentPage);
|
|
3207
|
-
const docObject =
|
|
3208
|
-
if (nodePosition == null || skeleton == null
|
|
3211
|
+
const docObject = (0, _univerjs_docs_ui.neoGetDocObject)(currentRender);
|
|
3212
|
+
if (nodePosition == null || skeleton == null) return;
|
|
3209
3213
|
const positionWithIsBack = {
|
|
3210
3214
|
...nodePosition,
|
|
3211
3215
|
isBack
|
|
@@ -3261,7 +3265,7 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3261
3265
|
});
|
|
3262
3266
|
}
|
|
3263
3267
|
_limitDrawingInPage(drawing, object) {
|
|
3264
|
-
const currentRender = this._renderManagerService.
|
|
3268
|
+
const currentRender = this._renderManagerService.getRenderUnitById(drawing.unitId);
|
|
3265
3269
|
const { left, top, width, height, angle } = object;
|
|
3266
3270
|
const skeleton = currentRender === null || currentRender === void 0 ? void 0 : currentRender.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
3267
3271
|
const skeletonData = skeleton === null || skeleton === void 0 ? void 0 : skeleton.getSkeletonData();
|
|
@@ -3311,7 +3315,7 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3311
3315
|
}
|
|
3312
3316
|
_getSceneAndTransformerByDrawingSearch(unitId) {
|
|
3313
3317
|
if (unitId == null) return;
|
|
3314
|
-
const renderObject = this._renderManagerService.
|
|
3318
|
+
const renderObject = this._renderManagerService.getRenderUnitById(unitId);
|
|
3315
3319
|
const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
|
|
3316
3320
|
if (scene == null) return;
|
|
3317
3321
|
return {
|
|
@@ -3326,7 +3330,7 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3326
3330
|
return documentTransform.clone().invert().applyPoint(originCoord);
|
|
3327
3331
|
}
|
|
3328
3332
|
_createOrUpdateInlineAnchor(unitId, pointsGroup) {
|
|
3329
|
-
const currentRender = this._renderManagerService.
|
|
3333
|
+
const currentRender = this._renderManagerService.getRenderUnitById(unitId);
|
|
3330
3334
|
if (currentRender == null) return;
|
|
3331
3335
|
const { mainComponent, scene } = currentRender;
|
|
3332
3336
|
const { docsLeft, docsTop } = mainComponent.getOffsetConfig();
|
|
@@ -3353,11 +3357,8 @@ let DocDrawingTransformerController = class DocDrawingTransformerController exte
|
|
|
3353
3357
|
this._anchorShape = anchor;
|
|
3354
3358
|
scene.addObject(anchor, _univerjs_docs_ui.TEXT_RANGE_LAYER_INDEX);
|
|
3355
3359
|
}
|
|
3356
|
-
_getDocObject() {
|
|
3357
|
-
return (0, _univerjs_docs_ui.getDocObject)(this._univerInstanceService, this._renderManagerService);
|
|
3358
|
-
}
|
|
3359
3360
|
_getPageContentSize(drawing) {
|
|
3360
|
-
const currentRender = this._renderManagerService.
|
|
3361
|
+
const currentRender = this._renderManagerService.getRenderUnitById(drawing.unitId);
|
|
3361
3362
|
const skeleton = currentRender === null || currentRender === void 0 ? void 0 : currentRender.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
|
|
3362
3363
|
const MAX_WIDTH = 500;
|
|
3363
3364
|
const MAX_HEIGHT = 500;
|
|
@@ -3604,7 +3605,7 @@ let DocDrawingPopupMenuController = class DocDrawingPopupMenuController extends
|
|
|
3604
3605
|
}
|
|
3605
3606
|
_popupMenuListener(unitId) {
|
|
3606
3607
|
var _this$_renderManagerS;
|
|
3607
|
-
const scene = (_this$_renderManagerS = this._renderManagerService.
|
|
3608
|
+
const scene = (_this$_renderManagerS = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.scene;
|
|
3608
3609
|
if (!scene) return;
|
|
3609
3610
|
const transformer = scene.getTransformerByCreate();
|
|
3610
3611
|
if (!transformer) return;
|
|
@@ -3786,7 +3787,7 @@ _defineProperty(UniverDocsDrawingUIPlugin, "pluginName", "DOC_DRAWING_UI_PLUGIN"
|
|
|
3786
3787
|
_defineProperty(UniverDocsDrawingUIPlugin, "packageName", name);
|
|
3787
3788
|
_defineProperty(UniverDocsDrawingUIPlugin, "version", version);
|
|
3788
3789
|
UniverDocsDrawingUIPlugin = __decorate([
|
|
3789
|
-
(0, _univerjs_core.DependentOn)(
|
|
3790
|
+
(0, _univerjs_core.DependentOn)(_univerjs_docs.UniverDocsPlugin, _univerjs_drawing.UniverDrawingPlugin, _univerjs_engine_render.UniverRenderEnginePlugin, _univerjs_docs_drawing.UniverDocsDrawingPlugin, _univerjs_ui.UniverUIPlugin, _univerjs_docs_ui.UniverDocsUIPlugin, _univerjs_drawing_ui.UniverDrawingUIPlugin),
|
|
3790
3791
|
__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
3791
3792
|
__decorateParam(2, _univerjs_engine_render.IRenderManagerService),
|
|
3792
3793
|
__decorateParam(3, _univerjs_core.IConfigService)
|
package/lib/cjs/locale/ru-RU.js
CHANGED
|
@@ -4,9 +4,9 @@ const locale = { "docs-drawing-ui": {
|
|
|
4
4
|
title: "Изображение",
|
|
5
5
|
upload: { float: "Вставить изображение" },
|
|
6
6
|
shape: { insert: {
|
|
7
|
-
title: "
|
|
8
|
-
rectangle: "
|
|
9
|
-
ellipse: "
|
|
7
|
+
title: "Вставить фигуру",
|
|
8
|
+
rectangle: "Вставить прямоугольник",
|
|
9
|
+
ellipse: "Вставить эллипс"
|
|
10
10
|
} },
|
|
11
11
|
panel: { title: "Редактировать изображение" },
|
|
12
12
|
"image-popup": {
|
|
@@ -17,39 +17,39 @@ const locale = { "docs-drawing-ui": {
|
|
|
17
17
|
reset: "Сбросить размер"
|
|
18
18
|
},
|
|
19
19
|
"image-text-wrap": {
|
|
20
|
-
title: "
|
|
21
|
-
wrappingStyle: "
|
|
22
|
-
square: "
|
|
23
|
-
topAndBottom: "
|
|
24
|
-
inline: "
|
|
25
|
-
behindText: "
|
|
26
|
-
inFrontText: "
|
|
27
|
-
wrapText: "
|
|
28
|
-
bothSide: "
|
|
29
|
-
leftOnly: "
|
|
30
|
-
rightOnly: "
|
|
31
|
-
distanceFromText: "
|
|
32
|
-
top: "
|
|
33
|
-
left: "
|
|
34
|
-
bottom: "
|
|
35
|
-
right: "
|
|
20
|
+
title: "Обтекание текстом",
|
|
21
|
+
wrappingStyle: "Стиль обтекания",
|
|
22
|
+
square: "Квадрат",
|
|
23
|
+
topAndBottom: "Сверху и снизу",
|
|
24
|
+
inline: "В тексте",
|
|
25
|
+
behindText: "За текстом",
|
|
26
|
+
inFrontText: "Перед текстом",
|
|
27
|
+
wrapText: "Обтекание текстом",
|
|
28
|
+
bothSide: "С обеих сторон",
|
|
29
|
+
leftOnly: "Только слева",
|
|
30
|
+
rightOnly: "Только справа",
|
|
31
|
+
distanceFromText: "Расстояние от текста",
|
|
32
|
+
top: "Сверху (px)",
|
|
33
|
+
left: "Слева (px)",
|
|
34
|
+
bottom: "Снизу (px)",
|
|
35
|
+
right: "Справа (px)"
|
|
36
36
|
},
|
|
37
37
|
"image-position": {
|
|
38
|
-
title: "
|
|
39
|
-
horizontal: "
|
|
40
|
-
vertical: "
|
|
41
|
-
absolutePosition: "
|
|
42
|
-
relativePosition: "
|
|
43
|
-
toTheRightOf: "
|
|
44
|
-
relativeTo: "
|
|
45
|
-
bellow: "
|
|
46
|
-
options: "
|
|
47
|
-
moveObjectWithText: "
|
|
48
|
-
column: "
|
|
49
|
-
margin: "
|
|
50
|
-
page: "
|
|
51
|
-
line: "
|
|
52
|
-
paragraph: "
|
|
38
|
+
title: "Положение",
|
|
39
|
+
horizontal: "По горизонтали",
|
|
40
|
+
vertical: "По вертикали",
|
|
41
|
+
absolutePosition: "Абсолютное положение (px)",
|
|
42
|
+
relativePosition: "Относительное положение",
|
|
43
|
+
toTheRightOf: "справа от",
|
|
44
|
+
relativeTo: "относительно",
|
|
45
|
+
bellow: "снизу",
|
|
46
|
+
options: "Параметры",
|
|
47
|
+
moveObjectWithText: "Перемещать объект с текстом",
|
|
48
|
+
column: "Колонка",
|
|
49
|
+
margin: "Поле",
|
|
50
|
+
page: "Страница",
|
|
51
|
+
line: "Строка",
|
|
52
|
+
paragraph: "Абзац"
|
|
53
53
|
},
|
|
54
54
|
"update-status": {
|
|
55
55
|
exceedMaxSize: "Размер изображения превышает лимит, лимит составляет {0}М",
|
package/lib/cjs/locale/vi-VN.js
CHANGED
|
@@ -4,9 +4,9 @@ const locale = { "docs-drawing-ui": {
|
|
|
4
4
|
title: "Hình ảnh",
|
|
5
5
|
upload: { float: "Chèn hình ảnh" },
|
|
6
6
|
shape: { insert: {
|
|
7
|
-
title: "
|
|
8
|
-
rectangle: "
|
|
9
|
-
ellipse: "
|
|
7
|
+
title: "Chèn hình",
|
|
8
|
+
rectangle: "Chèn hình chữ nhật",
|
|
9
|
+
ellipse: "Chèn hình elip"
|
|
10
10
|
} },
|
|
11
11
|
panel: { title: "Chỉnh sửa hình ảnh" },
|
|
12
12
|
"image-popup": {
|
|
@@ -17,39 +17,39 @@ const locale = { "docs-drawing-ui": {
|
|
|
17
17
|
reset: "Đặt lại kích thước"
|
|
18
18
|
},
|
|
19
19
|
"image-text-wrap": {
|
|
20
|
-
title: "
|
|
21
|
-
wrappingStyle: "
|
|
22
|
-
square: "
|
|
23
|
-
topAndBottom: "
|
|
24
|
-
inline: "
|
|
25
|
-
behindText: "
|
|
26
|
-
inFrontText: "
|
|
27
|
-
wrapText: "
|
|
28
|
-
bothSide: "
|
|
29
|
-
leftOnly: "
|
|
30
|
-
rightOnly: "
|
|
31
|
-
distanceFromText: "
|
|
32
|
-
top: "
|
|
33
|
-
left: "
|
|
34
|
-
bottom: "
|
|
35
|
-
right: "
|
|
20
|
+
title: "Bọc văn bản",
|
|
21
|
+
wrappingStyle: "Kiểu bọc văn bản",
|
|
22
|
+
square: "Hình vuông",
|
|
23
|
+
topAndBottom: "Trên và dưới",
|
|
24
|
+
inline: "Cùng dòng với văn bản",
|
|
25
|
+
behindText: "Phía sau văn bản",
|
|
26
|
+
inFrontText: "Phía trước văn bản",
|
|
27
|
+
wrapText: "Bọc văn bản",
|
|
28
|
+
bothSide: "Cả hai bên",
|
|
29
|
+
leftOnly: "Chỉ bên trái",
|
|
30
|
+
rightOnly: "Chỉ bên phải",
|
|
31
|
+
distanceFromText: "Khoảng cách với văn bản",
|
|
32
|
+
top: "Trên (px)",
|
|
33
|
+
left: "Trái (px)",
|
|
34
|
+
bottom: "Dưới (px)",
|
|
35
|
+
right: "Phải (px)"
|
|
36
36
|
},
|
|
37
37
|
"image-position": {
|
|
38
|
-
title: "
|
|
39
|
-
horizontal: "
|
|
40
|
-
vertical: "
|
|
41
|
-
absolutePosition: "
|
|
42
|
-
relativePosition: "
|
|
43
|
-
toTheRightOf: "
|
|
44
|
-
relativeTo: "
|
|
45
|
-
bellow: "
|
|
46
|
-
options: "
|
|
47
|
-
moveObjectWithText: "
|
|
48
|
-
column: "
|
|
49
|
-
margin: "
|
|
50
|
-
page: "
|
|
51
|
-
line: "
|
|
52
|
-
paragraph: "
|
|
38
|
+
title: "Vị trí",
|
|
39
|
+
horizontal: "Ngang",
|
|
40
|
+
vertical: "Dọc",
|
|
41
|
+
absolutePosition: "Vị trí tuyệt đối (px)",
|
|
42
|
+
relativePosition: "Vị trí tương đối",
|
|
43
|
+
toTheRightOf: "ở bên phải",
|
|
44
|
+
relativeTo: "tương đối với",
|
|
45
|
+
bellow: "bên dưới",
|
|
46
|
+
options: "Tùy chọn",
|
|
47
|
+
moveObjectWithText: "Di chuyển đối tượng cùng văn bản",
|
|
48
|
+
column: "Cột",
|
|
49
|
+
margin: "Lề",
|
|
50
|
+
page: "Trang",
|
|
51
|
+
line: "Dòng",
|
|
52
|
+
paragraph: "Đoạn văn"
|
|
53
53
|
},
|
|
54
54
|
"update-status": {
|
|
55
55
|
exceedMaxSize: "Kích thước hình ảnh vượt quá giới hạn, giới hạn là {0}M",
|
|
@@ -59,11 +59,11 @@ const locale = { "docs-drawing-ui": {
|
|
|
59
59
|
},
|
|
60
60
|
shortcut: {
|
|
61
61
|
"drawing-view": "Chế độ xem bản vẽ",
|
|
62
|
-
"drawing-move-down": "
|
|
63
|
-
"drawing-move-up": "
|
|
64
|
-
"drawing-move-left": "
|
|
65
|
-
"drawing-move-right": "
|
|
66
|
-
"drawing-delete": "
|
|
62
|
+
"drawing-move-down": "Di chuyển bản vẽ xuống",
|
|
63
|
+
"drawing-move-up": "Di chuyển bản vẽ lên",
|
|
64
|
+
"drawing-move-left": "Di chuyển bản vẽ sang trái",
|
|
65
|
+
"drawing-move-right": "Di chuyển bản vẽ sang phải",
|
|
66
|
+
"drawing-delete": "Xóa bản vẽ"
|
|
67
67
|
}
|
|
68
68
|
} };
|
|
69
69
|
|
package/lib/cjs/locale/zh-HK.js
CHANGED
|
@@ -4,9 +4,9 @@ const locale = { "docs-drawing-ui": {
|
|
|
4
4
|
title: "圖片",
|
|
5
5
|
upload: { float: "插入圖片" },
|
|
6
6
|
shape: { insert: {
|
|
7
|
-
title: "
|
|
8
|
-
rectangle: "
|
|
9
|
-
ellipse: "
|
|
7
|
+
title: "插入圖形",
|
|
8
|
+
rectangle: "插入矩形",
|
|
9
|
+
ellipse: "插入橢圓形"
|
|
10
10
|
} },
|
|
11
11
|
panel: { title: "編圖" },
|
|
12
12
|
"image-popup": {
|
package/lib/cjs/locale/zh-TW.js
CHANGED
|
@@ -4,9 +4,9 @@ const locale = { "docs-drawing-ui": {
|
|
|
4
4
|
title: "圖片",
|
|
5
5
|
upload: { float: "插入圖片" },
|
|
6
6
|
shape: { insert: {
|
|
7
|
-
title: "
|
|
8
|
-
rectangle: "
|
|
9
|
-
ellipse: "
|
|
7
|
+
title: "插入圖形",
|
|
8
|
+
rectangle: "插入矩形",
|
|
9
|
+
ellipse: "插入橢圓形"
|
|
10
10
|
} },
|
|
11
11
|
panel: { title: "編圖" },
|
|
12
12
|
"image-popup": {
|