@univerjs/docs-drawing-ui 0.2.6 → 0.2.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.
Files changed (37) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +82 -24
  3. package/lib/types/commands/commands/delete-doc-drawing.command.d.ts +0 -1
  4. package/lib/types/commands/commands/group-doc-drawing.command.d.ts +0 -1
  5. package/lib/types/commands/commands/insert-doc-drawing.command.d.ts +0 -1
  6. package/lib/types/commands/commands/interfaces.d.ts +0 -1
  7. package/lib/types/commands/commands/move-drawings.command.d.ts +0 -1
  8. package/lib/types/commands/commands/remove-doc-drawing.command.d.ts +0 -1
  9. package/lib/types/commands/commands/set-drawing-arrange.command.d.ts +0 -1
  10. package/lib/types/commands/commands/ungroup-doc-drawing.command.d.ts +0 -1
  11. package/lib/types/commands/commands/update-doc-drawing.command.d.ts +1 -1
  12. package/lib/types/commands/commands/utils.d.ts +0 -1
  13. package/lib/types/commands/operations/clear-drawing-transformer.operation.d.ts +0 -1
  14. package/lib/types/commands/operations/edit-doc-drawing.operation.d.ts +0 -1
  15. package/lib/types/commands/operations/insert-image.operation.d.ts +0 -1
  16. package/lib/types/commands/operations/open-drawing-panel.operation.d.ts +0 -1
  17. package/lib/types/controllers/doc-drawing-notification.controller.d.ts +0 -1
  18. package/lib/types/controllers/doc-drawing-transformer-update.controller.d.ts +0 -1
  19. package/lib/types/controllers/doc-drawing.controller.d.ts +0 -1
  20. package/lib/types/controllers/drawing-popup-menu.controller.d.ts +0 -1
  21. package/lib/types/controllers/render-controllers/doc-drawing-transform-update.controller.d.ts +6 -3
  22. package/lib/types/controllers/render-controllers/doc-drawing-update.render-controller.d.ts +0 -1
  23. package/lib/types/controllers/shortcuts/drawing.shortcut.d.ts +0 -1
  24. package/lib/types/index.d.ts +2 -0
  25. package/lib/types/locale/en-US.d.ts +0 -1
  26. package/lib/types/locale/ru-RU.d.ts +0 -1
  27. package/lib/types/locale/vi-VN.d.ts +0 -1
  28. package/lib/types/locale/zh-TW.d.ts +0 -1
  29. package/lib/types/plugin.d.ts +0 -1
  30. package/lib/types/services/doc-refresh-drawings.service.d.ts +0 -1
  31. package/lib/types/views/doc-image-panel/DocDrawingPanel.d.ts +0 -1
  32. package/lib/types/views/doc-image-panel/DocDrawingPosition.d.ts +0 -1
  33. package/lib/types/views/doc-image-panel/DocDrawingTextWrap.d.ts +0 -1
  34. package/lib/types/views/menu/image.menu.d.ts +1 -1
  35. package/lib/types/views/upload-component/UploadFile.d.ts +0 -1
  36. package/lib/umd/index.js +1 -1
  37. package/package.json +23 -23
package/lib/es/index.js CHANGED
@@ -2,14 +2,14 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
- import { CommandType, ICommandService, IUniverInstanceService, TextX, JSONX, MemoryCursor, TextXActionType, LocaleService, RxDisposable, UniverInstanceType, toDisposable, FOCUSING_COMMON_DRAWINGS, OnLifecycle, LifecycleStages, Inject, IContextService, useDependency, PositionedObjectLayoutType, BooleanNumber, ObjectRelativeFromH, ObjectRelativeFromV, Tools, WrapTextType, Direction, IUndoRedoService, FOCUSING_UNIVER_EDITOR, Disposable, Injector, UndoCommand, RedoCommand, throttle, COLORS, Plugin, DependentOn } from "@univerjs/core";
5
+ import { CommandType, ICommandService, IUniverInstanceService, TextX, JSONX, MemoryCursor, TextXActionType, LocaleService, RxDisposable, UniverInstanceType, toDisposable, FOCUSING_COMMON_DRAWINGS, OnLifecycle, LifecycleStages, Inject, IContextService, useDependency, PositionedObjectLayoutType, BooleanNumber, ObjectRelativeFromH, ObjectRelativeFromV, Tools, WrapTextType, Direction, IUndoRedoService, FOCUSING_UNIVER_EDITOR, Disposable, Injector, fromEventSubject, LifecycleService, UndoCommand, RedoCommand, throttle, COLORS, Plugin, DependentOn } from "@univerjs/core";
6
6
  import { ImageCropperObject, COMPONENT_IMAGE_POPUP_MENU, OpenImageCropOperation, ImageResetSizeOperation, DrawingCommonPanel, UniverDrawingUIPlugin } from "@univerjs/drawing-ui";
7
7
  import { IDrawingManagerService, DRAWING_IMAGE_ALLOW_IMAGE_LIST, ArrangeTypeEnum, DRAWING_IMAGE_COUNT_LIMIT, ImageUploadStatusType, DRAWING_IMAGE_ALLOW_SIZE, getImageSize, DrawingTypeEnum, getDrawingShapeKeyByDrawingSearch, DRAWING_IMAGE_WIDTH_LIMIT, DRAWING_IMAGE_HEIGHT_LIMIT, IImageIoService, UniverDrawingPlugin } from "@univerjs/drawing";
8
8
  import { IDocDrawingService, UniverDocsDrawingPlugin } from "@univerjs/docs-drawing";
9
- import { ITextSelectionRenderManager, IRenderManagerService, DocumentEditArea, Liquid, PageLayoutType, NodePositionConvertToCursor, getOneTextSelectionRange, DocumentSkeletonPageType, Vector2, getAnchorBounding, Rect, getColor, TEXT_RANGE_LAYER_INDEX } from "@univerjs/engine-render";
10
- import { takeUntil, BehaviorSubject } from "rxjs";
9
+ import { ITextSelectionRenderManager, IRenderManagerService, DocumentEditArea, Liquid, TRANSFORM_CHANGE_OBSERVABLE_TYPE, PageLayoutType, NodePositionConvertToCursor, getOneTextSelectionRange, DocumentSkeletonPageType, Vector2, getAnchorBounding, Rect, getColor, TEXT_RANGE_LAYER_INDEX } from "@univerjs/engine-render";
10
+ import { takeUntil, Observable, BehaviorSubject, filter, debounceTime } from "rxjs";
11
11
  import { DocCanvasPopManagerService, docDrawingPositionToTransform } from "@univerjs/docs-ui";
12
- import { RichTextEditingMutation, getRichTextEditPath, DocSkeletonManagerService, TextSelectionManagerService, getRetainAndDeleteFromReplace, SetDocZoomRatioOperation, getDocObject } from "@univerjs/docs";
12
+ import { RichTextEditingMutation, getRichTextEditPath, TextSelectionManagerService, DocSkeletonManagerService, getRetainAndDeleteFromReplace, SetDocZoomRatioOperation, getDocObject } from "@univerjs/docs";
13
13
  import { ISidebarService, MenuItemType, MenuPosition, MenuGroup, getMenuHiddenObservable, KeyCode, ComponentManager, IMenuService, IShortcutService, IMessageService, IEditorService } from "@univerjs/ui";
14
14
  import React, { forwardRef, useRef, createElement, useState, useEffect } from "react";
15
15
  import clsx from "clsx";
@@ -307,7 +307,30 @@ const InsertDocImageOperation = {
307
307
  multiple: !0
308
308
  }
309
309
  ));
310
- }, "UploadFileMenu"), COMPONENT_DOC_UPLOAD_FILE_MENU = "COMPONENT_DOC_UPLOAD_FILE_MENU", ImageUploadIcon = "addition-and-subtraction-single", IMAGE_MENU_ID = "doc.menu.image", IMAGE_MENU_UPLOAD_FLOAT_ID = "doc.menu.image.upload.float";
310
+ }, "UploadFileMenu"), COMPONENT_DOC_UPLOAD_FILE_MENU = "COMPONENT_DOC_UPLOAD_FILE_MENU", ImageUploadIcon = "addition-and-subtraction-single", IMAGE_MENU_ID = "doc.menu.image", IMAGE_MENU_UPLOAD_FLOAT_ID = "doc.menu.image.upload.float", getDisableWhenSelectionInTableObservable = /* @__PURE__ */ __name((accessor) => {
311
+ const textSelectionManagerService = accessor.get(TextSelectionManagerService), univerInstanceService = accessor.get(IUniverInstanceService);
312
+ return new Observable((subscriber) => {
313
+ const observable = textSelectionManagerService.textSelection$.subscribe(() => {
314
+ var _a8;
315
+ const activeRange = textSelectionManagerService.getActiveTextRangeWithStyle();
316
+ if (activeRange) {
317
+ const { segmentId, startOffset, endOffset } = activeRange, docDataModel = univerInstanceService.getCurrentUniverDocInstance(), tables = (_a8 = docDataModel == null ? void 0 : docDataModel.getSelfOrHeaderFooterModel(segmentId).getBody()) == null ? void 0 : _a8.tables;
318
+ if (tables && tables.length && tables.some((table) => {
319
+ const { startIndex, endIndex } = table;
320
+ return startOffset >= startIndex && startOffset <= endIndex || endOffset >= startIndex && endOffset <= endIndex;
321
+ })) {
322
+ subscriber.next(!0);
323
+ return;
324
+ }
325
+ } else {
326
+ subscriber.next(!0);
327
+ return;
328
+ }
329
+ subscriber.next(!1);
330
+ });
331
+ return () => observable.unsubscribe();
332
+ });
333
+ }, "getDisableWhenSelectionInTableObservable");
311
334
  function ImageMenuFactory(accessor) {
312
335
  return {
313
336
  id: IMAGE_MENU_ID,
@@ -316,6 +339,7 @@ function ImageMenuFactory(accessor) {
316
339
  group: MenuGroup.TOOLBAR_LAYOUT,
317
340
  icon: ImageUploadIcon,
318
341
  tooltip: "docImage.title",
342
+ disabled$: getDisableWhenSelectionInTableObservable(accessor),
319
343
  hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC)
320
344
  };
321
345
  }
@@ -653,7 +677,10 @@ const UpdateDocDrawingWrappingStyleCommand = {
653
677
  const transformer = scene.getTransformerByCreate(), commandService = accessor.get(ICommandService), documentDataModel = accessor.get(IUniverInstanceService).getCurrentUniverDocInstance();
654
678
  if (documentDataModel == null)
655
679
  return !1;
656
- const { drawing, unitId, offset, segmentId: newSegmentId, segmentPage } = params, rawActions = [], { drawingId } = drawing, segmentId = (_a8 = textSelectionRenderManager.getSegment()) != null ? _a8 : "", actions = getDeleteAndInsertCustomBlockActions(
680
+ const { drawing, unitId, offset, segmentId: newSegmentId, segmentPage, needRefreshDrawings } = params;
681
+ if (needRefreshDrawings)
682
+ return docRefreshDrawingsService.refreshDrawings(skeleton), transformer.refreshControls(), !0;
683
+ const rawActions = [], { drawingId } = drawing, segmentId = (_a8 = textSelectionRenderManager.getSegment()) != null ? _a8 : "", actions = getDeleteAndInsertCustomBlockActions(
657
684
  newSegmentId,
658
685
  segmentId,
659
686
  segmentPage,
@@ -1252,7 +1279,7 @@ const UpdateDocDrawingWrappingStyleCommand = {
1252
1279
  var _a8, _b;
1253
1280
  if (params == null)
1254
1281
  return !1;
1255
- const commandService = accessor.get(ICommandService), textSelectionManagerService = accessor.get(TextSelectionManagerService), univerInstanceService = accessor.get(IUniverInstanceService), activeTextRange = textSelectionManagerService.getActiveRange(), documentDataModel = univerInstanceService.getCurrentUniverDocInstance();
1282
+ const commandService = accessor.get(ICommandService), textSelectionManagerService = accessor.get(TextSelectionManagerService), univerInstanceService = accessor.get(IUniverInstanceService), activeTextRange = textSelectionManagerService.getActiveTextRangeWithStyle(), documentDataModel = univerInstanceService.getCurrentUniverDocInstance();
1256
1283
  if (activeTextRange == null || documentDataModel == null)
1257
1284
  return !1;
1258
1285
  const unitId = documentDataModel.getUnitId(), { drawings } = params, { collapsed, startOffset, segmentId } = activeTextRange, body = documentDataModel.getSelfOrHeaderFooterModel(segmentId).getBody();
@@ -1660,13 +1687,13 @@ var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPrope
1660
1687
  return kind && result && __defProp$3(target, key, result), result;
1661
1688
  }, "__decorateClass$3"), __decorateParam$3 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$3"), _a4;
1662
1689
  let DocDrawingTransformUpdateController = (_a4 = class extends Disposable {
1663
- constructor(_context, _docSkeletonManagerService, _commandService, _editorService, _drawingManagerService, _docRefreshDrawingsService) {
1690
+ constructor(_context, _docSkeletonManagerService, _commandService, _editorService, _drawingManagerService, _docRefreshDrawingsService, _univerInstanceService, _lifecycleService) {
1664
1691
  super();
1665
1692
  __publicField(this, "_liquid", new Liquid());
1666
- this._context = _context, this._docSkeletonManagerService = _docSkeletonManagerService, this._commandService = _commandService, this._editorService = _editorService, this._drawingManagerService = _drawingManagerService, this._docRefreshDrawingsService = _docRefreshDrawingsService, this._initialize(), this._commandExecutedListener();
1693
+ this._context = _context, this._docSkeletonManagerService = _docSkeletonManagerService, this._commandService = _commandService, this._editorService = _editorService, this._drawingManagerService = _drawingManagerService, this._docRefreshDrawingsService = _docRefreshDrawingsService, this._univerInstanceService = _univerInstanceService, this._lifecycleService = _lifecycleService, this._initialize(), this._commandExecutedListener();
1667
1694
  }
1668
1695
  _initialize() {
1669
- this._initialRenderRefresh();
1696
+ this._initialRenderRefresh(), this._drawingInitializeListener(), this._initResize();
1670
1697
  }
1671
1698
  _initialRenderRefresh() {
1672
1699
  this._docSkeletonManagerService.currentSkeleton$.subscribe((documentSkeleton) => {
@@ -1695,6 +1722,18 @@ let DocDrawingTransformUpdateController = (_a4 = class extends Disposable {
1695
1722
  })
1696
1723
  );
1697
1724
  }
1725
+ _initResize() {
1726
+ this.disposeWithMe(
1727
+ fromEventSubject(this._context.engine.onTransformChange$).pipe(
1728
+ filter((evt) => evt.type === TRANSFORM_CHANGE_OBSERVABLE_TYPE.resize),
1729
+ debounceTime(16)
1730
+ ).subscribe(() => {
1731
+ var _a8;
1732
+ const skeleton = this._docSkeletonManagerService.getSkeleton(), { scene } = this._context;
1733
+ (_a8 = scene.getTransformer()) == null || _a8.refreshControls(), this._refreshDrawing(skeleton);
1734
+ })
1735
+ );
1736
+ }
1698
1737
  _refreshDrawing(skeleton) {
1699
1738
  var _a8, _b;
1700
1739
  const skeletonData = skeleton == null ? void 0 : skeleton.getSkeletonData(), { mainComponent, unitId } = this._context, documentComponent = mainComponent;
@@ -1773,13 +1812,24 @@ let DocDrawingTransformUpdateController = (_a4 = class extends Disposable {
1773
1812
  marginLeft
1774
1813
  });
1775
1814
  }
1815
+ _drawingInitializeListener() {
1816
+ const init = /* @__PURE__ */ __name(() => {
1817
+ const skeleton = this._docSkeletonManagerService.getSkeleton();
1818
+ skeleton != null && (this._refreshDrawing(skeleton), this._drawingManagerService.initializeNotification(this._context.unitId));
1819
+ }, "init");
1820
+ this._lifecycleService.stage === LifecycleStages.Steady ? setTimeout(() => {
1821
+ init();
1822
+ }, 1e3) : this._lifecycleService.lifecycle$.pipe(filter((stage) => stage === LifecycleStages.Steady)).subscribe(init);
1823
+ }
1776
1824
  }, __name(_a4, "DocDrawingTransformUpdateController"), _a4);
1777
1825
  DocDrawingTransformUpdateController = __decorateClass$3([
1778
1826
  __decorateParam$3(1, Inject(DocSkeletonManagerService)),
1779
1827
  __decorateParam$3(2, ICommandService),
1780
1828
  __decorateParam$3(3, IEditorService),
1781
1829
  __decorateParam$3(4, IDrawingManagerService),
1782
- __decorateParam$3(5, Inject(DocRefreshDrawingsService))
1830
+ __decorateParam$3(5, Inject(DocRefreshDrawingsService)),
1831
+ __decorateParam$3(6, IUniverInstanceService),
1832
+ __decorateParam$3(7, Inject(LifecycleService))
1783
1833
  ], DocDrawingTransformUpdateController);
1784
1834
  var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
1785
1835
  for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
@@ -1909,6 +1959,11 @@ var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPrope
1909
1959
  return kind && result && __defProp$1(target, key, result), result;
1910
1960
  }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1");
1911
1961
  const INLINE_DRAWING_ANCHOR_KEY_PREFIX = "__InlineDrawingAnchor__";
1962
+ function isInTableCell(nodePosition) {
1963
+ const { path } = nodePosition;
1964
+ return path.some((p) => p === "cells");
1965
+ }
1966
+ __name(isInTableCell, "isInTableCell");
1912
1967
  var _a6;
1913
1968
  let DocDrawingTransformerController = (_a6 = class extends Disposable {
1914
1969
  constructor(_commandService, _univerInstanceService, _drawingManagerService, _renderManagerService, _textSelectionRenderManager) {
@@ -1973,7 +2028,7 @@ let DocDrawingTransformerController = (_a6 = class extends Disposable {
1973
2028
  throttleMultipleDrawingUpdate(objects);
1974
2029
  else if (objects.size === 1) {
1975
2030
  const drawingCache = this._transformerCache.values().next().value, object = objects.values().next().value, { width, height, top, left, angle } = object;
1976
- if (width === drawingCache.width && height === drawingCache.height && top === drawingCache.top && left === drawingCache.left && angle === drawingCache.angle)
2031
+ if (drawingCache && width === drawingCache.width && height === drawingCache.height && top === drawingCache.top && left === drawingCache.left && angle === drawingCache.angle)
1977
2032
  return;
1978
2033
  drawingCache && (drawingCache.drawing.layoutType, PositionedObjectLayoutType.INLINE), drawingCache && drawingCache.drawing.layoutType === PositionedObjectLayoutType.INLINE && offsetX != null && offsetY != null && this._updateInlineDrawingAnchor(drawingCache.drawing, offsetX, offsetY);
1979
2034
  }
@@ -1981,6 +2036,7 @@ let DocDrawingTransformerController = (_a6 = class extends Disposable {
1981
2036
  )
1982
2037
  ), this.disposeWithMe(
1983
2038
  toDisposable(
2039
+ // eslint-disable-next-line complexity
1984
2040
  transformer.changeEnd$.subscribe((state) => {
1985
2041
  const { objects, offsetX, offsetY } = state;
1986
2042
  for (const object of objects.values()) {
@@ -1994,7 +2050,7 @@ let DocDrawingTransformerController = (_a6 = class extends Disposable {
1994
2050
  this._updateMultipleDrawingDocTransform(objects);
1995
2051
  else if (objects.size === 1) {
1996
2052
  const drawingCache = this._transformerCache.values().next().value, object = objects.values().next().value, { width, height, top, left, angle } = object;
1997
- if (width === drawingCache.width && height === drawingCache.height && top === drawingCache.top && left === drawingCache.left && angle === drawingCache.angle)
2053
+ if (drawingCache && width === drawingCache.width && height === drawingCache.height && top === drawingCache.top && left === drawingCache.left && angle === drawingCache.angle)
1998
2054
  return;
1999
2055
  drawingCache && drawingCache.drawing.layoutType === PositionedObjectLayoutType.INLINE ? width !== drawingCache.width || height !== drawingCache.height || angle !== drawingCache.angle ? this._updateDrawingSize(drawingCache, object) : offsetX != null && offsetY != null && this._moveInlineDrawing(drawingCache.drawing, offsetX, offsetY) : drawingCache && this._nonInlineDrawingTransform(drawingCache.drawing, object);
2000
2056
  }
@@ -2102,7 +2158,7 @@ let DocDrawingTransformerController = (_a6 = class extends Disposable {
2102
2158
  if (glyphAnchor == null)
2103
2159
  return;
2104
2160
  const nodePosition = skeleton == null ? void 0 : skeleton.findPositionByGlyph(glyphAnchor, segmentPageIndex), docObject = this._getDocObject();
2105
- if (nodePosition == null || skeleton == null || docObject == null)
2161
+ if (nodePosition == null || skeleton == null || docObject == null || isInTableCell(nodePosition))
2106
2162
  return;
2107
2163
  const positionWithIsBack = {
2108
2164
  ...nodePosition,
@@ -2214,7 +2270,7 @@ let DocDrawingTransformerController = (_a6 = class extends Disposable {
2214
2270
  if (glyphAnchor == null)
2215
2271
  return;
2216
2272
  const nodePosition = skeleton == null ? void 0 : skeleton.findPositionByGlyph(glyphAnchor, segmentPage), docObject = this._getDocObject();
2217
- if (nodePosition == null || skeleton == null || docObject == null)
2273
+ if (nodePosition == null || skeleton == null || docObject == null || isInTableCell(nodePosition))
2218
2274
  return;
2219
2275
  const positionWithIsBack = {
2220
2276
  ...nodePosition,
@@ -2248,15 +2304,15 @@ let DocDrawingTransformerController = (_a6 = class extends Disposable {
2248
2304
  // Update inline drawing when use transformer to move it.
2249
2305
  _moveInlineDrawing(drawing, offsetX, offsetY) {
2250
2306
  const anchor = this._getInlineDrawingAnchor(drawing, offsetX, offsetY), { offset, segmentId, segmentPage } = anchor != null ? anchor : {};
2251
- if (offset != null)
2252
- return this._commandService.executeCommand(IMoveInlineDrawingCommand.id, {
2253
- unitId: drawing.unitId,
2254
- subUnitId: drawing.unitId,
2255
- drawing,
2256
- offset,
2257
- segmentId,
2258
- segmentPage
2259
- });
2307
+ return this._commandService.executeCommand(IMoveInlineDrawingCommand.id, {
2308
+ unitId: drawing.unitId,
2309
+ subUnitId: drawing.unitId,
2310
+ drawing,
2311
+ offset,
2312
+ segmentId,
2313
+ segmentPage,
2314
+ needRefreshDrawings: offset == null
2315
+ });
2260
2316
  }
2261
2317
  // Limit the drawing to the page area, mainly in the vertical direction,
2262
2318
  // and the upper and lower limits cannot exceed the page margin area.
@@ -2422,10 +2478,12 @@ UniverDocsDrawingUIPlugin = __decorateClass([
2422
2478
  __decorateParam(2, IRenderManagerService)
2423
2479
  ], UniverDocsDrawingUIPlugin);
2424
2480
  export {
2481
+ COMPONENT_DOC_UPLOAD_FILE_MENU,
2425
2482
  ClearDocDrawingTransformerOperation,
2426
2483
  DeleteDocDrawingsCommand,
2427
2484
  EditDocDrawingOperation,
2428
2485
  GroupDocDrawingCommand,
2486
+ IMAGE_MENU_ID,
2429
2487
  InsertDocDrawingCommand,
2430
2488
  InsertDocImageOperation,
2431
2489
  MoveDocDrawingsCommand,
@@ -1,3 +1,2 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  export declare const DeleteDocDrawingsCommand: ICommand;
@@ -1,5 +1,4 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  /**
4
3
  * The command to insert new defined name
5
4
  */
@@ -1,5 +1,4 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  /**
4
3
  * The command to insert new drawings
5
4
  */
@@ -1,6 +1,5 @@
1
1
  import { DrawingTypeEnum } from '@univerjs/core';
2
2
  import { IDocDrawing } from '@univerjs/docs-drawing';
3
-
4
3
  export interface IInsertDrawingCommandParams {
5
4
  unitId: string;
6
5
  drawings: IDocDrawing[];
@@ -1,5 +1,4 @@
1
1
  import { ICommand, Direction } from '@univerjs/core';
2
-
3
2
  export interface IMoveDrawingsCommandParams {
4
3
  direction: Direction;
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  /**
4
3
  * The command to remove new sheet image
5
4
  */
@@ -1,6 +1,5 @@
1
1
  import { ICommand } from '@univerjs/core';
2
2
  import { IDrawingOrderMapParam, ArrangeTypeEnum } from '@univerjs/drawing';
3
-
4
3
  export interface ISetDrawingArrangeCommandParams extends IDrawingOrderMapParam {
5
4
  arrangeType: ArrangeTypeEnum;
6
5
  }
@@ -1,5 +1,4 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  /**
4
3
  * The command to insert new defined name
5
4
  */
@@ -1,5 +1,4 @@
1
1
  import { ICommand, IDocDrawingBase, IDocDrawingPosition, IObjectPositionH, IObjectPositionV, ISize } from '@univerjs/core';
2
-
3
2
  export declare enum TextWrappingStyle {
4
3
  INLINE = "inline",
5
4
  BEHIND_TEXT = "behindText",
@@ -40,6 +39,7 @@ export interface IMoveInlineDrawingParams {
40
39
  offset: number;
41
40
  segmentId: string;
42
41
  segmentPage: number;
42
+ needRefreshDrawings?: boolean;
43
43
  }
44
44
  /**
45
45
  * The command to move inline drawing.
@@ -1,4 +1,3 @@
1
1
  import { IDrawingGroupUpdateParam } from '@univerjs/drawing';
2
-
3
2
  export declare function ungroupToGroup(ungroupParams: IDrawingGroupUpdateParam[]): IDrawingGroupUpdateParam[];
4
3
  export declare function groupToUngroup(groupParams: IDrawingGroupUpdateParam[]): IDrawingGroupUpdateParam[];
@@ -1,3 +1,2 @@
1
1
  import { IMutation } from '@univerjs/core';
2
-
3
2
  export declare const ClearDocDrawingTransformerOperation: IMutation<string[]>;
@@ -1,4 +1,3 @@
1
1
  import { IOperation } from '@univerjs/core';
2
2
  import { IDrawingSearch } from '@univerjs/drawing';
3
-
4
3
  export declare const EditDocDrawingOperation: IOperation<IDrawingSearch>;
@@ -1,5 +1,4 @@
1
1
  import { IOperation, Nullable } from '@univerjs/core';
2
-
3
2
  export interface IInsertImageOperationParams {
4
3
  files: Nullable<File[]>;
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  export interface IUIComponentCommandParams {
4
3
  value: string;
5
4
  }
@@ -2,7 +2,6 @@ import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/c
2
2
  import { IDocDrawingService } from '@univerjs/docs-drawing';
3
3
  import { IDrawingManagerService } from '@univerjs/drawing';
4
4
  import { IRenderManagerService } from '@univerjs/engine-render';
5
-
6
5
  export declare class DocDrawingAddRemoveController extends Disposable {
7
6
  private readonly _univerInstanceService;
8
7
  private readonly _commandService;
@@ -1,7 +1,6 @@
1
1
  import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
2
  import { IDrawingManagerService } from '@univerjs/drawing';
3
3
  import { IRenderManagerService, ITextSelectionRenderManager } from '@univerjs/engine-render';
4
-
5
4
  export declare class DocDrawingTransformerController extends Disposable {
6
5
  private readonly _commandService;
7
6
  private readonly _univerInstanceService;
@@ -1,6 +1,5 @@
1
1
  import { Disposable, ICommandService, Injector } from '@univerjs/core';
2
2
  import { ComponentManager, IMenuService, IShortcutService } from '@univerjs/ui';
3
-
4
3
  export declare class DocDrawingUIController extends Disposable {
5
4
  private readonly _injector;
6
5
  private readonly _componentManager;
@@ -2,7 +2,6 @@ import { IContextService, IUniverInstanceService, RxDisposable } from '@univerjs
2
2
  import { IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { DocCanvasPopManagerService } from '@univerjs/docs-ui';
4
4
  import { IDrawingManagerService } from '@univerjs/drawing';
5
-
6
5
  export declare class DocDrawingPopupMenuController extends RxDisposable {
7
6
  private readonly _drawingManagerService;
8
7
  private readonly _canvasPopManagerService;
@@ -1,10 +1,9 @@
1
- import { DocumentDataModel, Disposable, ICommandService } from '@univerjs/core';
1
+ import { DocumentDataModel, Disposable, ICommandService, IUniverInstanceService, LifecycleService } from '@univerjs/core';
2
2
  import { DocSkeletonManagerService } from '@univerjs/docs';
3
3
  import { IDrawingManagerService } from '@univerjs/drawing';
4
4
  import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
5
5
  import { IEditorService } from '@univerjs/ui';
6
6
  import { DocRefreshDrawingsService } from '../../services/doc-refresh-drawings.service';
7
-
8
7
  export declare class DocDrawingTransformUpdateController extends Disposable implements IRenderModule {
9
8
  private readonly _context;
10
9
  private readonly _docSkeletonManagerService;
@@ -12,12 +11,16 @@ export declare class DocDrawingTransformUpdateController extends Disposable impl
12
11
  private readonly _editorService;
13
12
  private readonly _drawingManagerService;
14
13
  private readonly _docRefreshDrawingsService;
14
+ private _univerInstanceService;
15
+ private _lifecycleService;
15
16
  private _liquid;
16
- constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService, _commandService: ICommandService, _editorService: IEditorService, _drawingManagerService: IDrawingManagerService, _docRefreshDrawingsService: DocRefreshDrawingsService);
17
+ constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService, _commandService: ICommandService, _editorService: IEditorService, _drawingManagerService: IDrawingManagerService, _docRefreshDrawingsService: DocRefreshDrawingsService, _univerInstanceService: IUniverInstanceService, _lifecycleService: LifecycleService);
17
18
  private _initialize;
18
19
  private _initialRenderRefresh;
19
20
  private _commandExecutedListener;
21
+ private _initResize;
20
22
  private _refreshDrawing;
21
23
  private _handleMultiDrawingsTransform;
22
24
  private _calculateDrawingPosition;
25
+ private _drawingInitializeListener;
23
26
  }
@@ -5,7 +5,6 @@ import { IDocDrawingService } from '@univerjs/docs-drawing';
5
5
  import { TextSelectionManagerService } from '@univerjs/docs';
6
6
  import { IRenderContext, IRenderModule, IRenderManagerService, ITextSelectionRenderManager } from '@univerjs/engine-render';
7
7
  import { DocRefreshDrawingsService } from '../../services/doc-refresh-drawings.service';
8
-
9
8
  export declare class DocDrawingUpdateRenderController extends Disposable implements IRenderModule {
10
9
  private readonly _context;
11
10
  private readonly _commandService;
@@ -1,7 +1,6 @@
1
1
  import { IContextService } from '@univerjs/core';
2
2
  import { IShortcutItem } from '@univerjs/ui';
3
3
  import { IMoveDrawingsCommandParams } from '../../commands/commands/move-drawings.command';
4
-
5
4
  export declare function whenDocDrawingFocused(contextService: IContextService): boolean;
6
5
  export declare const MoveDrawingDownShortcutItem: IShortcutItem<IMoveDrawingsCommandParams>;
7
6
  export declare const MoveDrawingUpShortcutItem: IShortcutItem<IMoveDrawingsCommandParams>;
@@ -25,3 +25,5 @@ export { ClearDocDrawingTransformerOperation } from './commands/operations/clear
25
25
  export { EditDocDrawingOperation } from './commands/operations/edit-doc-drawing.operation';
26
26
  export { InsertDocImageOperation } from './commands/operations/insert-image.operation';
27
27
  export { SidebarDocDrawingOperation } from './commands/operations/open-drawing-panel.operation';
28
+ export { IMAGE_MENU_ID } from './views/menu/image.menu';
29
+ export { COMPONENT_DOC_UPLOAD_FILE_MENU } from './views/upload-component/component-name';
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,6 +1,5 @@
1
1
  import { Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
2
  import { IRenderManagerService } from '@univerjs/engine-render';
3
-
4
3
  export declare class UniverDocsDrawingUIPlugin extends Plugin {
5
4
  protected _injector: Injector;
6
5
  private readonly _renderManagerSrv;
@@ -1,6 +1,5 @@
1
1
  import { Nullable } from '@univerjs/core';
2
2
  import { DocumentSkeleton } from '@univerjs/engine-render';
3
-
4
3
  export declare class DocRefreshDrawingsService {
5
4
  private readonly _refreshDrawings$;
6
5
  readonly refreshDrawings$: import('rxjs').Observable<Nullable<DocumentSkeleton>>;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare const DocDrawingPanel: () => false | React.JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { IDrawingParam } from '@univerjs/drawing';
3
-
4
3
  export interface IDocDrawingPositionProps {
5
4
  drawings: IDrawingParam[];
6
5
  }
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { IDrawingParam } from '@univerjs/drawing';
3
-
4
3
  export interface IDocDrawingTextWrapProps {
5
4
  drawings: IDrawingParam[];
6
5
  }
@@ -1,6 +1,6 @@
1
1
  import { IMenuItem } from '@univerjs/ui';
2
2
  import { IAccessor } from '@univerjs/core';
3
-
4
3
  export declare const ImageUploadIcon = "addition-and-subtraction-single";
4
+ export declare const IMAGE_MENU_ID = "doc.menu.image";
5
5
  export declare function ImageMenuFactory(accessor: IAccessor): IMenuItem;
6
6
  export declare function UploadFloatImageMenuFactory(_accessor: IAccessor): IMenuItem;
@@ -1,3 +1,2 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  export declare const UploadFileMenu: () => React.JSX.Element;