@univerjs/docs-drawing-ui 1.0.0-beta.0 → 1.0.0-beta.1

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 (84) hide show
  1. package/lib/cjs/index.js +31 -14
  2. package/lib/cjs/locale/ar-SA.js +0 -3
  3. package/lib/cjs/locale/ca-ES.js +0 -3
  4. package/lib/cjs/locale/de-DE.js +0 -3
  5. package/lib/cjs/locale/en-US.js +0 -3
  6. package/lib/cjs/locale/es-ES.js +0 -3
  7. package/lib/cjs/locale/fa-IR.js +0 -3
  8. package/lib/cjs/locale/fr-FR.js +0 -3
  9. package/lib/cjs/locale/id-ID.js +0 -3
  10. package/lib/cjs/locale/it-IT.js +0 -3
  11. package/lib/cjs/locale/ja-JP.js +0 -3
  12. package/lib/cjs/locale/ko-KR.js +0 -3
  13. package/lib/cjs/locale/pl-PL.js +0 -3
  14. package/lib/cjs/locale/pt-BR.js +0 -3
  15. package/lib/cjs/locale/ru-RU.js +0 -3
  16. package/lib/cjs/locale/sk-SK.js +0 -3
  17. package/lib/cjs/locale/vi-VN.js +0 -3
  18. package/lib/cjs/locale/zh-CN.js +0 -3
  19. package/lib/cjs/locale/zh-HK.js +0 -3
  20. package/lib/cjs/locale/zh-TW.js +0 -3
  21. package/lib/es/index.js +31 -14
  22. package/lib/es/locale/ar-SA.js +0 -3
  23. package/lib/es/locale/ca-ES.js +0 -3
  24. package/lib/es/locale/de-DE.js +0 -3
  25. package/lib/es/locale/en-US.js +0 -3
  26. package/lib/es/locale/es-ES.js +0 -3
  27. package/lib/es/locale/fa-IR.js +0 -3
  28. package/lib/es/locale/fr-FR.js +0 -3
  29. package/lib/es/locale/id-ID.js +0 -3
  30. package/lib/es/locale/it-IT.js +0 -3
  31. package/lib/es/locale/ja-JP.js +0 -3
  32. package/lib/es/locale/ko-KR.js +0 -3
  33. package/lib/es/locale/pl-PL.js +0 -3
  34. package/lib/es/locale/pt-BR.js +0 -3
  35. package/lib/es/locale/ru-RU.js +0 -3
  36. package/lib/es/locale/sk-SK.js +0 -3
  37. package/lib/es/locale/vi-VN.js +0 -3
  38. package/lib/es/locale/zh-CN.js +0 -3
  39. package/lib/es/locale/zh-HK.js +0 -3
  40. package/lib/es/locale/zh-TW.js +0 -3
  41. package/lib/index.js +31 -14
  42. package/lib/locale/ar-SA.js +0 -3
  43. package/lib/locale/ca-ES.js +0 -3
  44. package/lib/locale/de-DE.js +0 -3
  45. package/lib/locale/en-US.js +0 -3
  46. package/lib/locale/es-ES.js +0 -3
  47. package/lib/locale/fa-IR.js +0 -3
  48. package/lib/locale/fr-FR.js +0 -3
  49. package/lib/locale/id-ID.js +0 -3
  50. package/lib/locale/it-IT.js +0 -3
  51. package/lib/locale/ja-JP.js +0 -3
  52. package/lib/locale/ko-KR.js +0 -3
  53. package/lib/locale/pl-PL.js +0 -3
  54. package/lib/locale/pt-BR.js +0 -3
  55. package/lib/locale/ru-RU.js +0 -3
  56. package/lib/locale/sk-SK.js +0 -3
  57. package/lib/locale/vi-VN.js +0 -3
  58. package/lib/locale/zh-CN.js +0 -3
  59. package/lib/locale/zh-HK.js +0 -3
  60. package/lib/locale/zh-TW.js +0 -3
  61. package/lib/types/controllers/render-controllers/doc-drawing-transform-update.controller.d.ts +3 -0
  62. package/lib/types/locale/en-US.d.ts +0 -3
  63. package/lib/types/services/doc-drawing-floating-toolbar-adapter.service.d.ts +1 -0
  64. package/lib/umd/index.js +1 -1
  65. package/lib/umd/locale/ar-SA.js +1 -1
  66. package/lib/umd/locale/ca-ES.js +1 -1
  67. package/lib/umd/locale/de-DE.js +1 -1
  68. package/lib/umd/locale/en-US.js +1 -1
  69. package/lib/umd/locale/es-ES.js +1 -1
  70. package/lib/umd/locale/fa-IR.js +1 -1
  71. package/lib/umd/locale/fr-FR.js +1 -1
  72. package/lib/umd/locale/id-ID.js +1 -1
  73. package/lib/umd/locale/it-IT.js +1 -1
  74. package/lib/umd/locale/ja-JP.js +1 -1
  75. package/lib/umd/locale/ko-KR.js +1 -1
  76. package/lib/umd/locale/pl-PL.js +1 -1
  77. package/lib/umd/locale/pt-BR.js +1 -1
  78. package/lib/umd/locale/ru-RU.js +1 -1
  79. package/lib/umd/locale/sk-SK.js +1 -1
  80. package/lib/umd/locale/vi-VN.js +1 -1
  81. package/lib/umd/locale/zh-CN.js +1 -1
  82. package/lib/umd/locale/zh-HK.js +1 -1
  83. package/lib/umd/locale/zh-TW.js +1 -1
  84. package/package.json +11 -11
package/lib/cjs/index.js CHANGED
@@ -1034,7 +1034,8 @@ const getDisableWhenSelectionInTableObservable = (accessor) => {
1034
1034
  function ImageMenuFactory(accessor) {
1035
1035
  return {
1036
1036
  id: DOCS_IMAGE_MENU_ID,
1037
- type: _univerjs_ui.MenuItemType.SUBITEMS,
1037
+ commandId: IMAGE_MENU_UPLOAD_FLOAT_ID,
1038
+ type: _univerjs_ui.MenuItemType.BUTTON,
1038
1039
  icon: "AddImageIcon",
1039
1040
  tooltip: "docs-drawing-ui.title",
1040
1041
  disabled$: getDisableWhenSelectionInTableObservable(accessor),
@@ -1128,11 +1129,7 @@ function InsertEllipseShapeBelowMenuFactory(accessor) {
1128
1129
  const menuSchema = {
1129
1130
  [_univerjs_ui.RibbonInsertGroup.MEDIA]: { [DOCS_IMAGE_MENU_ID]: {
1130
1131
  order: 0,
1131
- menuItemFactory: ImageMenuFactory,
1132
- [IMAGE_MENU_UPLOAD_FLOAT_ID]: {
1133
- order: 0,
1134
- menuItemFactory: UploadFloatImageMenuFactory
1135
- }
1132
+ menuItemFactory: ImageMenuFactory
1136
1133
  } },
1137
1134
  [_univerjs_ui.ContextMenuPosition.PARAGRAPH]: {
1138
1135
  [_univerjs_ui.ContextMenuGroup.LAYOUT]: { [_univerjs_docs_ui.INSERT_BELLOW_MENU_ID]: { [IMAGE_MENU_UPLOAD_FLOAT_ID]: {
@@ -1195,7 +1192,7 @@ const menuSchema = {
1195
1192
  //#endregion
1196
1193
  //#region package.json
1197
1194
  var name = "@univerjs/docs-drawing-ui";
1198
- var version = "1.0.0-beta.0";
1195
+ var version = "1.0.0-beta.1";
1199
1196
 
1200
1197
  //#endregion
1201
1198
  //#region src/config/config.ts
@@ -2608,6 +2605,7 @@ let DocDrawingTransformUpdateController = class DocDrawingTransformUpdateControl
2608
2605
  this._univerInstanceService = _univerInstanceService;
2609
2606
  this._lifecycleService = _lifecycleService;
2610
2607
  _defineProperty(this, "_liquid", new _univerjs_engine_render.Liquid());
2608
+ _defineProperty(this, "_changesetDrawingRefreshScheduled", false);
2611
2609
  this._initialize();
2612
2610
  this._commandExecutedListener();
2613
2611
  }
@@ -2628,21 +2626,40 @@ let DocDrawingTransformUpdateController = class DocDrawingTransformUpdateControl
2628
2626
  }
2629
2627
  _commandExecutedListener() {
2630
2628
  const updateCommandList = [_univerjs_docs.RichTextEditingMutation.id, _univerjs_docs_ui.SetDocZoomRatioOperation.id];
2631
- this.disposeWithMe(this._commandService.onCommandExecuted((command) => {
2629
+ this.disposeWithMe(this._commandService.onCommandExecuted((command, options) => {
2632
2630
  if (updateCommandList.includes(command.id)) {
2633
2631
  const { unitId: commandUnitId } = command.params;
2634
- const { unitId, mainComponent } = this._context;
2632
+ const { unitId } = this._context;
2635
2633
  if (commandUnitId !== unitId) return;
2636
- const skeleton = this._docSkeletonManagerService.getSkeleton();
2637
- if (skeleton == null) return;
2638
- if (this._editorService.isEditor(unitId)) {
2639
- mainComponent === null || mainComponent === void 0 || mainComponent.makeDirty();
2634
+ if (command.id === _univerjs_docs.RichTextEditingMutation.id && (options === null || options === void 0 ? void 0 : options.fromChangeset)) {
2635
+ this._scheduleChangesetDrawingRefresh();
2640
2636
  return;
2641
2637
  }
2642
- this._refreshDrawing(skeleton);
2638
+ this._refreshCurrentDrawing();
2643
2639
  }
2644
2640
  }));
2645
2641
  }
2642
+ _scheduleChangesetDrawingRefresh() {
2643
+ if (this._changesetDrawingRefreshScheduled) return;
2644
+ this._changesetDrawingRefreshScheduled = true;
2645
+ queueMicrotask(() => {
2646
+ queueMicrotask(() => {
2647
+ this._changesetDrawingRefreshScheduled = false;
2648
+ if (this._disposed) return;
2649
+ this._refreshCurrentDrawing();
2650
+ });
2651
+ });
2652
+ }
2653
+ _refreshCurrentDrawing() {
2654
+ const skeleton = this._docSkeletonManagerService.getSkeleton();
2655
+ if (skeleton == null) return;
2656
+ const { unitId, mainComponent } = this._context;
2657
+ if (this._editorService.isEditor(unitId)) {
2658
+ mainComponent === null || mainComponent === void 0 || mainComponent.makeDirty();
2659
+ return;
2660
+ }
2661
+ this._refreshDrawing(skeleton);
2662
+ }
2646
2663
  _initTransformRefresh() {
2647
2664
  this.disposeWithMe((0, rxjs.merge)((0, _univerjs_core.fromEventSubject)(this._context.engine.onTransformChange$).pipe((0, rxjs.filter)((evt) => evt.type === _univerjs_engine_render.TRANSFORM_CHANGE_OBSERVABLE_TYPE.resize)), (0, _univerjs_core.fromEventSubject)(this._context.scene.onTransformChange$).pipe((0, rxjs.filter)((evt) => evt.type === _univerjs_engine_render.TRANSFORM_CHANGE_OBSERVABLE_TYPE.scale))).pipe((0, rxjs.debounceTime)(16)).subscribe(() => {
2648
2665
  var _scene$getTransformer;
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "تحرير الصورة" },
12
12
  "image-popup": {
13
- replace: "استبدال",
14
13
  delete: "حذف",
15
14
  edit: "تحرير",
16
15
  crop: "قص",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "أفقي",
40
39
  vertical: "عمودي",
41
40
  absolutePosition: "موضع مطلق(بكسل)",
42
- relativePosition: "موضع نسبي",
43
41
  toTheRightOf: "إلى يمين",
44
- relativeTo: "بالنسبة إلى",
45
42
  bellow: "أسفل",
46
43
  options: "خيارات",
47
44
  moveObjectWithText: "نقل الكائن مع النص",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "Edita la imatge" },
12
12
  "image-popup": {
13
- replace: "Reemplaça",
14
13
  delete: "Elimina",
15
14
  edit: "Edita",
16
15
  crop: "Retalla",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "Horitzontal",
40
39
  vertical: "Vertical",
41
40
  absolutePosition: "Posició absoluta(px)",
42
- relativePosition: "Posició relativa",
43
41
  toTheRightOf: "a la dreta de",
44
- relativeTo: "relatiu a",
45
42
  bellow: "a sota",
46
43
  options: "Opcions",
47
44
  moveObjectWithText: "Mou l'objecte amb el text",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "Bild bearbeiten" },
12
12
  "image-popup": {
13
- replace: "Ersetzen",
14
13
  delete: "Löschen",
15
14
  edit: "Bearbeiten",
16
15
  crop: "Zuschneiden",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "Horizontal",
40
39
  vertical: "Vertikal",
41
40
  absolutePosition: "Absolute Position(px)",
42
- relativePosition: "Relative Position",
43
41
  toTheRightOf: "rechts von",
44
- relativeTo: "relativ zu",
45
42
  bellow: "unterhalb",
46
43
  options: "Optionen",
47
44
  moveObjectWithText: "Objekt mit Text verschieben",
@@ -25,7 +25,6 @@ const locale = { "docs-drawing-ui": {
25
25
  } },
26
26
  panel: { title: "Edit Image" },
27
27
  "image-popup": {
28
- replace: "Replace",
29
28
  delete: "Delete",
30
29
  edit: "Edit",
31
30
  crop: "Crop",
@@ -54,9 +53,7 @@ const locale = { "docs-drawing-ui": {
54
53
  horizontal: "Horizontal",
55
54
  vertical: "Vertical",
56
55
  absolutePosition: "Absolute Position(px)",
57
- relativePosition: "Relative Position",
58
56
  toTheRightOf: "to the right of",
59
- relativeTo: "relative to",
60
57
  bellow: "bellow",
61
58
  options: "Options",
62
59
  moveObjectWithText: "Move object with text",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "Editar imagen" },
12
12
  "image-popup": {
13
- replace: "Reemplazar",
14
13
  delete: "Eliminar",
15
14
  edit: "Editar",
16
15
  crop: "Recortar",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "Horizontal",
40
39
  vertical: "Vertical",
41
40
  absolutePosition: "Posición absoluta(px)",
42
- relativePosition: "Posición relativa",
43
41
  toTheRightOf: "a la derecha de",
44
- relativeTo: "relativo a",
45
42
  bellow: "debajo",
46
43
  options: "Opciones",
47
44
  moveObjectWithText: "Mover objeto con el texto",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "ویرایش تصویر" },
12
12
  "image-popup": {
13
- replace: "تعویض",
14
13
  delete: "حذف",
15
14
  edit: "ویرایش",
16
15
  crop: "کراپ",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "افقی",
40
39
  vertical: "عمودی",
41
40
  absolutePosition: "موقعیت مطلق(px)",
42
- relativePosition: "موقعیت نسبی",
43
41
  toTheRightOf: "سمت راست",
44
- relativeTo: "نسبت به",
45
42
  bellow: "زیر",
46
43
  options: "گزینه‌ها",
47
44
  moveObjectWithText: "جابه‌جایی شیء با متن",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "Modifier l'image" },
12
12
  "image-popup": {
13
- replace: "Remplacer",
14
13
  delete: "Supprimer",
15
14
  edit: "Modifier",
16
15
  crop: "Rogner",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "Horizontal",
40
39
  vertical: "Vertical",
41
40
  absolutePosition: "Position absolue(px)",
42
- relativePosition: "Position relative",
43
41
  toTheRightOf: "à droite de",
44
- relativeTo: "par rapport à",
45
42
  bellow: "en dessous",
46
43
  options: "Options",
47
44
  moveObjectWithText: "Déplacer l'objet avec le texte",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "Edit Gambar" },
12
12
  "image-popup": {
13
- replace: "Ganti",
14
13
  delete: "Hapus",
15
14
  edit: "Edit",
16
15
  crop: "Pangkas",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "Horizontal",
40
39
  vertical: "Vertikal",
41
40
  absolutePosition: "Posisi Absolut(px)",
42
- relativePosition: "Posisi Relatif",
43
41
  toTheRightOf: "di sebelah kanan",
44
- relativeTo: "relatif terhadap",
45
42
  bellow: "di bawah",
46
43
  options: "Opsi",
47
44
  moveObjectWithText: "Pindahkan objek dengan teks",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "Modifica immagine" },
12
12
  "image-popup": {
13
- replace: "Sostituisci",
14
13
  delete: "Elimina",
15
14
  edit: "Modifica",
16
15
  crop: "Ritaglia",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "Orizzontale",
40
39
  vertical: "Verticale",
41
40
  absolutePosition: "Posizione assoluta(px)",
42
- relativePosition: "Posizione relativa",
43
41
  toTheRightOf: "a destra di",
44
- relativeTo: "relativo a",
45
42
  bellow: "sotto",
46
43
  options: "Opzioni",
47
44
  moveObjectWithText: "Sposta oggetto con il testo",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "画像の編集" },
12
12
  "image-popup": {
13
- replace: "置換",
14
13
  delete: "削除",
15
14
  edit: "編集",
16
15
  crop: "トリミング",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "水平方向",
40
39
  vertical: "垂直方向",
41
40
  absolutePosition: "絶対位置(px)",
42
- relativePosition: "相対位置",
43
41
  toTheRightOf: "右側に",
44
- relativeTo: "基準に対して",
45
42
  bellow: "下に",
46
43
  options: "オプション",
47
44
  moveObjectWithText: "文字列と一緒にオブジェクトを移動",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "이미지 편집" },
12
12
  "image-popup": {
13
- replace: "교체",
14
13
  delete: "삭제",
15
14
  edit: "편집",
16
15
  crop: "자르기",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "수평",
40
39
  vertical: "수직",
41
40
  absolutePosition: "절대 위치(px)",
42
- relativePosition: "상대 위치",
43
41
  toTheRightOf: "우측에",
44
- relativeTo: "상대적으로",
45
42
  bellow: "아래에",
46
43
  options: "옵션",
47
44
  moveObjectWithText: "텍스트와 함께 객체 이동",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "Edytuj obraz" },
12
12
  "image-popup": {
13
- replace: "Zamień",
14
13
  delete: "Usuń",
15
14
  edit: "Edytuj",
16
15
  crop: "Przytnij",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "Pozioma",
40
39
  vertical: "Pionowa",
41
40
  absolutePosition: "Pozycja bezwzględna(px)",
42
- relativePosition: "Pozycja względna",
43
41
  toTheRightOf: "po prawej stronie",
44
- relativeTo: "względem",
45
42
  bellow: "poniżej",
46
43
  options: "Opcje",
47
44
  moveObjectWithText: "Przesuwaj obiekt razem z tekstem",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "Editar imagem" },
12
12
  "image-popup": {
13
- replace: "Substituir",
14
13
  delete: "Excluir",
15
14
  edit: "Editar",
16
15
  crop: "Cortar",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "Horizontal",
40
39
  vertical: "Vertical",
41
40
  absolutePosition: "Posição absoluta(px)",
42
- relativePosition: "Posição relativa",
43
41
  toTheRightOf: "à direita de",
44
- relativeTo: "relativo a",
45
42
  bellow: "abaixo",
46
43
  options: "Opções",
47
44
  moveObjectWithText: "Mover objeto com o texto",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "Редактировать изображение" },
12
12
  "image-popup": {
13
- replace: "Заменить",
14
13
  delete: "Удалить",
15
14
  edit: "Редактировать",
16
15
  crop: "Обрезать",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "По горизонтали",
40
39
  vertical: "По вертикали",
41
40
  absolutePosition: "Абсолютное положение (px)",
42
- relativePosition: "Относительное положение",
43
41
  toTheRightOf: "справа от",
44
- relativeTo: "относительно",
45
42
  bellow: "снизу",
46
43
  options: "Параметры",
47
44
  moveObjectWithText: "Перемещать объект с текстом",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "Upraviť obrázok" },
12
12
  "image-popup": {
13
- replace: "Nahradiť",
14
13
  delete: "Odstrániť",
15
14
  edit: "Upraviť",
16
15
  crop: "Orezať",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "Vodorovne",
40
39
  vertical: "Zvisle",
41
40
  absolutePosition: "Absolútna pozícia (px)",
42
- relativePosition: "Relatívna pozícia",
43
41
  toTheRightOf: "vpravo od",
44
- relativeTo: "vzhľadom na",
45
42
  bellow: "pod",
46
43
  options: "Možnosti",
47
44
  moveObjectWithText: "Presunúť objekt s textom",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "Chỉnh sửa hình ảnh" },
12
12
  "image-popup": {
13
- replace: "Thay thế",
14
13
  delete: "Xóa",
15
14
  edit: "Chỉnh sửa",
16
15
  crop: "Cắt",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "Ngang",
40
39
  vertical: "Dọc",
41
40
  absolutePosition: "Vị trí tuyệt đối (px)",
42
- relativePosition: "Vị trí tương đối",
43
41
  toTheRightOf: "ở bên phải",
44
- relativeTo: "tương đối với",
45
42
  bellow: "bên dưới",
46
43
  options: "Tùy chọn",
47
44
  moveObjectWithText: "Di chuyển đối tượng cùng văn bản",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "编辑图片" },
12
12
  "image-popup": {
13
- replace: "替换",
14
13
  delete: "删除",
15
14
  edit: "编辑",
16
15
  crop: "裁剪",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "水平",
40
39
  vertical: "垂直",
41
40
  absolutePosition: "绝对位置(px)",
42
- relativePosition: "相对位置",
43
41
  toTheRightOf: "右侧",
44
- relativeTo: "相对于",
45
42
  bellow: "下方",
46
43
  options: "选项",
47
44
  moveObjectWithText: "对象随文字移动",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "編圖" },
12
12
  "image-popup": {
13
- replace: "替換",
14
13
  delete: "刪除",
15
14
  edit: "編輯",
16
15
  crop: "裁切",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "水平",
40
39
  vertical: "垂直",
41
40
  absolutePosition: "絕對位置(px)",
42
- relativePosition: "相對位置",
43
41
  toTheRightOf: "右側",
44
- relativeTo: "相對於",
45
42
  bellow: "下方",
46
43
  options: "選項",
47
44
  moveObjectWithText: "物件隨文字移動",
@@ -10,7 +10,6 @@ const locale = { "docs-drawing-ui": {
10
10
  } },
11
11
  panel: { title: "編圖" },
12
12
  "image-popup": {
13
- replace: "替換",
14
13
  delete: "刪除",
15
14
  edit: "編輯",
16
15
  crop: "裁切",
@@ -39,9 +38,7 @@ const locale = { "docs-drawing-ui": {
39
38
  horizontal: "水平",
40
39
  vertical: "垂直",
41
40
  absolutePosition: "絕對位置(px)",
42
- relativePosition: "相對位置",
43
41
  toTheRightOf: "右側",
44
- relativeTo: "相對於",
45
42
  bellow: "下方",
46
43
  options: "選項",
47
44
  moveObjectWithText: "物件隨文字移動",
package/lib/es/index.js CHANGED
@@ -1033,7 +1033,8 @@ const getDisableWhenSelectionInTableObservable = (accessor) => {
1033
1033
  function ImageMenuFactory(accessor) {
1034
1034
  return {
1035
1035
  id: DOCS_IMAGE_MENU_ID,
1036
- type: MenuItemType.SUBITEMS,
1036
+ commandId: IMAGE_MENU_UPLOAD_FLOAT_ID,
1037
+ type: MenuItemType.BUTTON,
1037
1038
  icon: "AddImageIcon",
1038
1039
  tooltip: "docs-drawing-ui.title",
1039
1040
  disabled$: getDisableWhenSelectionInTableObservable(accessor),
@@ -1127,11 +1128,7 @@ function InsertEllipseShapeBelowMenuFactory(accessor) {
1127
1128
  const menuSchema = {
1128
1129
  [RibbonInsertGroup.MEDIA]: { [DOCS_IMAGE_MENU_ID]: {
1129
1130
  order: 0,
1130
- menuItemFactory: ImageMenuFactory,
1131
- [IMAGE_MENU_UPLOAD_FLOAT_ID]: {
1132
- order: 0,
1133
- menuItemFactory: UploadFloatImageMenuFactory
1134
- }
1131
+ menuItemFactory: ImageMenuFactory
1135
1132
  } },
1136
1133
  [ContextMenuPosition.PARAGRAPH]: {
1137
1134
  [ContextMenuGroup.LAYOUT]: { [INSERT_BELLOW_MENU_ID]: { [IMAGE_MENU_UPLOAD_FLOAT_ID]: {
@@ -1194,7 +1191,7 @@ const menuSchema = {
1194
1191
  //#endregion
1195
1192
  //#region package.json
1196
1193
  var name = "@univerjs/docs-drawing-ui";
1197
- var version = "1.0.0-beta.0";
1194
+ var version = "1.0.0-beta.1";
1198
1195
 
1199
1196
  //#endregion
1200
1197
  //#region src/config/config.ts
@@ -2607,6 +2604,7 @@ let DocDrawingTransformUpdateController = class DocDrawingTransformUpdateControl
2607
2604
  this._univerInstanceService = _univerInstanceService;
2608
2605
  this._lifecycleService = _lifecycleService;
2609
2606
  _defineProperty(this, "_liquid", new Liquid());
2607
+ _defineProperty(this, "_changesetDrawingRefreshScheduled", false);
2610
2608
  this._initialize();
2611
2609
  this._commandExecutedListener();
2612
2610
  }
@@ -2627,21 +2625,40 @@ let DocDrawingTransformUpdateController = class DocDrawingTransformUpdateControl
2627
2625
  }
2628
2626
  _commandExecutedListener() {
2629
2627
  const updateCommandList = [RichTextEditingMutation.id, SetDocZoomRatioOperation.id];
2630
- this.disposeWithMe(this._commandService.onCommandExecuted((command) => {
2628
+ this.disposeWithMe(this._commandService.onCommandExecuted((command, options) => {
2631
2629
  if (updateCommandList.includes(command.id)) {
2632
2630
  const { unitId: commandUnitId } = command.params;
2633
- const { unitId, mainComponent } = this._context;
2631
+ const { unitId } = this._context;
2634
2632
  if (commandUnitId !== unitId) return;
2635
- const skeleton = this._docSkeletonManagerService.getSkeleton();
2636
- if (skeleton == null) return;
2637
- if (this._editorService.isEditor(unitId)) {
2638
- mainComponent === null || mainComponent === void 0 || mainComponent.makeDirty();
2633
+ if (command.id === RichTextEditingMutation.id && (options === null || options === void 0 ? void 0 : options.fromChangeset)) {
2634
+ this._scheduleChangesetDrawingRefresh();
2639
2635
  return;
2640
2636
  }
2641
- this._refreshDrawing(skeleton);
2637
+ this._refreshCurrentDrawing();
2642
2638
  }
2643
2639
  }));
2644
2640
  }
2641
+ _scheduleChangesetDrawingRefresh() {
2642
+ if (this._changesetDrawingRefreshScheduled) return;
2643
+ this._changesetDrawingRefreshScheduled = true;
2644
+ queueMicrotask(() => {
2645
+ queueMicrotask(() => {
2646
+ this._changesetDrawingRefreshScheduled = false;
2647
+ if (this._disposed) return;
2648
+ this._refreshCurrentDrawing();
2649
+ });
2650
+ });
2651
+ }
2652
+ _refreshCurrentDrawing() {
2653
+ const skeleton = this._docSkeletonManagerService.getSkeleton();
2654
+ if (skeleton == null) return;
2655
+ const { unitId, mainComponent } = this._context;
2656
+ if (this._editorService.isEditor(unitId)) {
2657
+ mainComponent === null || mainComponent === void 0 || mainComponent.makeDirty();
2658
+ return;
2659
+ }
2660
+ this._refreshDrawing(skeleton);
2661
+ }
2645
2662
  _initTransformRefresh() {
2646
2663
  this.disposeWithMe(merge$1(fromEventSubject(this._context.engine.onTransformChange$).pipe(filter((evt) => evt.type === TRANSFORM_CHANGE_OBSERVABLE_TYPE.resize)), fromEventSubject(this._context.scene.onTransformChange$).pipe(filter((evt) => evt.type === TRANSFORM_CHANGE_OBSERVABLE_TYPE.scale))).pipe(debounceTime(16)).subscribe(() => {
2647
2664
  var _scene$getTransformer;
@@ -9,7 +9,6 @@ const locale = { "docs-drawing-ui": {
9
9
  } },
10
10
  panel: { title: "تحرير الصورة" },
11
11
  "image-popup": {
12
- replace: "استبدال",
13
12
  delete: "حذف",
14
13
  edit: "تحرير",
15
14
  crop: "قص",
@@ -38,9 +37,7 @@ const locale = { "docs-drawing-ui": {
38
37
  horizontal: "أفقي",
39
38
  vertical: "عمودي",
40
39
  absolutePosition: "موضع مطلق(بكسل)",
41
- relativePosition: "موضع نسبي",
42
40
  toTheRightOf: "إلى يمين",
43
- relativeTo: "بالنسبة إلى",
44
41
  bellow: "أسفل",
45
42
  options: "خيارات",
46
43
  moveObjectWithText: "نقل الكائن مع النص",
@@ -9,7 +9,6 @@ const locale = { "docs-drawing-ui": {
9
9
  } },
10
10
  panel: { title: "Edita la imatge" },
11
11
  "image-popup": {
12
- replace: "Reemplaça",
13
12
  delete: "Elimina",
14
13
  edit: "Edita",
15
14
  crop: "Retalla",
@@ -38,9 +37,7 @@ const locale = { "docs-drawing-ui": {
38
37
  horizontal: "Horitzontal",
39
38
  vertical: "Vertical",
40
39
  absolutePosition: "Posició absoluta(px)",
41
- relativePosition: "Posició relativa",
42
40
  toTheRightOf: "a la dreta de",
43
- relativeTo: "relatiu a",
44
41
  bellow: "a sota",
45
42
  options: "Opcions",
46
43
  moveObjectWithText: "Mou l'objecte amb el text",
@@ -9,7 +9,6 @@ const locale = { "docs-drawing-ui": {
9
9
  } },
10
10
  panel: { title: "Bild bearbeiten" },
11
11
  "image-popup": {
12
- replace: "Ersetzen",
13
12
  delete: "Löschen",
14
13
  edit: "Bearbeiten",
15
14
  crop: "Zuschneiden",
@@ -38,9 +37,7 @@ const locale = { "docs-drawing-ui": {
38
37
  horizontal: "Horizontal",
39
38
  vertical: "Vertikal",
40
39
  absolutePosition: "Absolute Position(px)",
41
- relativePosition: "Relative Position",
42
40
  toTheRightOf: "rechts von",
43
- relativeTo: "relativ zu",
44
41
  bellow: "unterhalb",
45
42
  options: "Optionen",
46
43
  moveObjectWithText: "Objekt mit Text verschieben",
@@ -24,7 +24,6 @@ const locale = { "docs-drawing-ui": {
24
24
  } },
25
25
  panel: { title: "Edit Image" },
26
26
  "image-popup": {
27
- replace: "Replace",
28
27
  delete: "Delete",
29
28
  edit: "Edit",
30
29
  crop: "Crop",
@@ -53,9 +52,7 @@ const locale = { "docs-drawing-ui": {
53
52
  horizontal: "Horizontal",
54
53
  vertical: "Vertical",
55
54
  absolutePosition: "Absolute Position(px)",
56
- relativePosition: "Relative Position",
57
55
  toTheRightOf: "to the right of",
58
- relativeTo: "relative to",
59
56
  bellow: "bellow",
60
57
  options: "Options",
61
58
  moveObjectWithText: "Move object with text",
@@ -9,7 +9,6 @@ const locale = { "docs-drawing-ui": {
9
9
  } },
10
10
  panel: { title: "Editar imagen" },
11
11
  "image-popup": {
12
- replace: "Reemplazar",
13
12
  delete: "Eliminar",
14
13
  edit: "Editar",
15
14
  crop: "Recortar",
@@ -38,9 +37,7 @@ const locale = { "docs-drawing-ui": {
38
37
  horizontal: "Horizontal",
39
38
  vertical: "Vertical",
40
39
  absolutePosition: "Posición absoluta(px)",
41
- relativePosition: "Posición relativa",
42
40
  toTheRightOf: "a la derecha de",
43
- relativeTo: "relativo a",
44
41
  bellow: "debajo",
45
42
  options: "Opciones",
46
43
  moveObjectWithText: "Mover objeto con el texto",
@@ -9,7 +9,6 @@ const locale = { "docs-drawing-ui": {
9
9
  } },
10
10
  panel: { title: "ویرایش تصویر" },
11
11
  "image-popup": {
12
- replace: "تعویض",
13
12
  delete: "حذف",
14
13
  edit: "ویرایش",
15
14
  crop: "کراپ",
@@ -38,9 +37,7 @@ const locale = { "docs-drawing-ui": {
38
37
  horizontal: "افقی",
39
38
  vertical: "عمودی",
40
39
  absolutePosition: "موقعیت مطلق(px)",
41
- relativePosition: "موقعیت نسبی",
42
40
  toTheRightOf: "سمت راست",
43
- relativeTo: "نسبت به",
44
41
  bellow: "زیر",
45
42
  options: "گزینه‌ها",
46
43
  moveObjectWithText: "جابه‌جایی شیء با متن",
@@ -9,7 +9,6 @@ const locale = { "docs-drawing-ui": {
9
9
  } },
10
10
  panel: { title: "Modifier l'image" },
11
11
  "image-popup": {
12
- replace: "Remplacer",
13
12
  delete: "Supprimer",
14
13
  edit: "Modifier",
15
14
  crop: "Rogner",
@@ -38,9 +37,7 @@ const locale = { "docs-drawing-ui": {
38
37
  horizontal: "Horizontal",
39
38
  vertical: "Vertical",
40
39
  absolutePosition: "Position absolue(px)",
41
- relativePosition: "Position relative",
42
40
  toTheRightOf: "à droite de",
43
- relativeTo: "par rapport à",
44
41
  bellow: "en dessous",
45
42
  options: "Options",
46
43
  moveObjectWithText: "Déplacer l'objet avec le texte",