@univerjs/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 (86) hide show
  1. package/lib/cjs/index.js +110 -58
  2. package/lib/cjs/locale/ar-SA.js +1 -19
  3. package/lib/cjs/locale/ca-ES.js +1 -19
  4. package/lib/cjs/locale/de-DE.js +1 -19
  5. package/lib/cjs/locale/en-US.js +1 -19
  6. package/lib/cjs/locale/es-ES.js +1 -19
  7. package/lib/cjs/locale/fa-IR.js +1 -19
  8. package/lib/cjs/locale/fr-FR.js +1 -19
  9. package/lib/cjs/locale/id-ID.js +1 -19
  10. package/lib/cjs/locale/it-IT.js +1 -19
  11. package/lib/cjs/locale/ja-JP.js +1 -19
  12. package/lib/cjs/locale/ko-KR.js +1 -19
  13. package/lib/cjs/locale/pl-PL.js +1 -19
  14. package/lib/cjs/locale/pt-BR.js +1 -19
  15. package/lib/cjs/locale/ru-RU.js +1 -19
  16. package/lib/cjs/locale/sk-SK.js +1 -19
  17. package/lib/cjs/locale/vi-VN.js +1 -19
  18. package/lib/cjs/locale/zh-CN.js +1 -19
  19. package/lib/cjs/locale/zh-HK.js +1 -19
  20. package/lib/cjs/locale/zh-TW.js +1 -19
  21. package/lib/es/index.js +113 -61
  22. package/lib/es/locale/ar-SA.js +1 -19
  23. package/lib/es/locale/ca-ES.js +1 -19
  24. package/lib/es/locale/de-DE.js +1 -19
  25. package/lib/es/locale/en-US.js +1 -19
  26. package/lib/es/locale/es-ES.js +1 -19
  27. package/lib/es/locale/fa-IR.js +1 -19
  28. package/lib/es/locale/fr-FR.js +1 -19
  29. package/lib/es/locale/id-ID.js +1 -19
  30. package/lib/es/locale/it-IT.js +1 -19
  31. package/lib/es/locale/ja-JP.js +1 -19
  32. package/lib/es/locale/ko-KR.js +1 -19
  33. package/lib/es/locale/pl-PL.js +1 -19
  34. package/lib/es/locale/pt-BR.js +1 -19
  35. package/lib/es/locale/ru-RU.js +1 -19
  36. package/lib/es/locale/sk-SK.js +1 -19
  37. package/lib/es/locale/vi-VN.js +1 -19
  38. package/lib/es/locale/zh-CN.js +1 -19
  39. package/lib/es/locale/zh-HK.js +1 -19
  40. package/lib/es/locale/zh-TW.js +1 -19
  41. package/lib/index.css +28 -10
  42. package/lib/index.js +113 -61
  43. package/lib/locale/ar-SA.js +1 -19
  44. package/lib/locale/ca-ES.js +1 -19
  45. package/lib/locale/de-DE.js +1 -19
  46. package/lib/locale/en-US.js +1 -19
  47. package/lib/locale/es-ES.js +1 -19
  48. package/lib/locale/fa-IR.js +1 -19
  49. package/lib/locale/fr-FR.js +1 -19
  50. package/lib/locale/id-ID.js +1 -19
  51. package/lib/locale/it-IT.js +1 -19
  52. package/lib/locale/ja-JP.js +1 -19
  53. package/lib/locale/ko-KR.js +1 -19
  54. package/lib/locale/pl-PL.js +1 -19
  55. package/lib/locale/pt-BR.js +1 -19
  56. package/lib/locale/ru-RU.js +1 -19
  57. package/lib/locale/sk-SK.js +1 -19
  58. package/lib/locale/vi-VN.js +1 -19
  59. package/lib/locale/zh-CN.js +1 -19
  60. package/lib/locale/zh-HK.js +1 -19
  61. package/lib/locale/zh-TW.js +1 -19
  62. package/lib/types/commands/operations/image-crop.operation.d.ts +4 -2
  63. package/lib/types/controllers/image-cropper.controller.d.ts +10 -2
  64. package/lib/types/locale/en-US.d.ts +0 -18
  65. package/lib/types/views/image-popup-menu/ImagePopupMenu.d.ts +1 -0
  66. package/lib/umd/index.js +2 -2
  67. package/lib/umd/locale/ar-SA.js +1 -1
  68. package/lib/umd/locale/ca-ES.js +1 -1
  69. package/lib/umd/locale/de-DE.js +1 -1
  70. package/lib/umd/locale/en-US.js +1 -1
  71. package/lib/umd/locale/es-ES.js +1 -1
  72. package/lib/umd/locale/fa-IR.js +1 -1
  73. package/lib/umd/locale/fr-FR.js +1 -1
  74. package/lib/umd/locale/id-ID.js +1 -1
  75. package/lib/umd/locale/it-IT.js +1 -1
  76. package/lib/umd/locale/ja-JP.js +1 -1
  77. package/lib/umd/locale/ko-KR.js +1 -1
  78. package/lib/umd/locale/pl-PL.js +1 -1
  79. package/lib/umd/locale/pt-BR.js +1 -1
  80. package/lib/umd/locale/ru-RU.js +1 -1
  81. package/lib/umd/locale/sk-SK.js +1 -1
  82. package/lib/umd/locale/vi-VN.js +1 -1
  83. package/lib/umd/locale/zh-CN.js +1 -1
  84. package/lib/umd/locale/zh-HK.js +1 -1
  85. package/lib/umd/locale/zh-TW.js +1 -1
  86. package/package.json +7 -7
package/lib/cjs/index.js CHANGED
@@ -237,21 +237,21 @@ const CancelDrawingGroupOperation = {
237
237
  const OpenImageCropOperation = {
238
238
  id: "sheet.operation.open-image-crop",
239
239
  type: _univerjs_core.CommandType.OPERATION,
240
- handler: (accessor, params) => {
240
+ handler: (_accessor, _params) => {
241
241
  return true;
242
242
  }
243
243
  };
244
244
  const CloseImageCropOperation = {
245
245
  id: "sheet.operation.close-image-crop",
246
246
  type: _univerjs_core.CommandType.OPERATION,
247
- handler: (accessor, params) => {
247
+ handler: (_accessor, _params) => {
248
248
  return true;
249
249
  }
250
250
  };
251
251
  const AutoImageCropOperation = {
252
252
  id: "sheet.operation.Auto-image-crop",
253
253
  type: _univerjs_core.CommandType.OPERATION,
254
- handler: (accessor, params) => {
254
+ handler: (_accessor, _params) => {
255
255
  return true;
256
256
  }
257
257
  };
@@ -625,7 +625,7 @@ const menuSchema = { [_univerjs_ui.ContextMenuPosition.DRAWING]: { [_univerjs_ui
625
625
  //#endregion
626
626
  //#region package.json
627
627
  var name = "@univerjs/drawing-ui";
628
- var version = "1.0.0-beta.0";
628
+ var version = "1.0.0-beta.1";
629
629
 
630
630
  //#endregion
631
631
  //#region src/config/config.ts
@@ -698,11 +698,11 @@ function ImagePopupMenu(props) {
698
698
  open: visible,
699
699
  onOpenChange: onVisibleChange,
700
700
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
701
- className: (0, _univerjs_design.clsx)("univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800", _univerjs_design.borderClassName, {
701
+ className: (0, _univerjs_design.clsx)("univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 univer-text-gray-900 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800", _univerjs_design.borderClassName, {
702
702
  "univer-bg-gray-100 dark:!univer-bg-gray-800": visible,
703
- "univer-bg-white dark:!univer-bg-gray-900": !visible
703
+ "univer-bg-gray-0 dark:!univer-bg-gray-900": !visible
704
704
  }),
705
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.AutofillDoubleIcon, { className: "univer-fill-primary-600 univer-text-gray-900 dark:!univer-text-white" }), showMore && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreDownIcon, { className: "dark:!univer-text-white" })]
705
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.AutofillDoubleIcon, { className: "univer-fill-primary-600 univer-text-gray-900 dark:!univer-text-gray-0" }), showMore && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreDownIcon, { className: "dark:!univer-text-gray-0" })]
706
706
  })
707
707
  })
708
708
  });
@@ -743,7 +743,7 @@ function ToolbarDropdownButton(props) {
743
743
  open,
744
744
  onOpenChange: setOpen,
745
745
  overlay: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
746
- className: "univer-min-w-32 univer-rounded-lg univer-border univer-border-solid univer-border-gray-200 univer-bg-white univer-p-1 univer-shadow-lg dark:!univer-border-gray-700 dark:!univer-bg-gray-900",
746
+ className: "univer-min-w-32 univer-rounded-lg univer-border univer-border-solid univer-border-gray-200 univer-bg-gray-0 univer-p-1 univer-shadow-lg dark:!univer-border-gray-700 dark:!univer-bg-gray-900",
747
747
  children: props.options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
748
748
  type: "button",
749
749
  onClick: () => {
@@ -832,7 +832,7 @@ function DocImageFloatingToolbar(props) {
832
832
  event.stopPropagation();
833
833
  event.preventDefault();
834
834
  },
835
- className: (0, _univerjs_design.clsx)("univer-box-border univer-flex univer-items-center univer-rounded univer-bg-white univer-px-1 univer-py-1 univer-shadow-sm dark:!univer-border-gray-700 dark:!univer-bg-gray-900", _univerjs_design.borderClassName),
835
+ className: (0, _univerjs_design.clsx)("univer-box-border univer-flex univer-items-center univer-rounded univer-bg-gray-0 univer-px-1 univer-py-1 univer-shadow-sm dark:!univer-border-gray-700 dark:!univer-bg-gray-900", _univerjs_design.borderClassName),
836
836
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarGroup, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarDropdownButton, {
837
837
  title: ((_wrappingStyleOptions = wrappingStyleOptions.find((option) => option.value === wrappingStyle)) === null || _wrappingStyleOptions === void 0 ? void 0 : _wrappingStyleOptions.label) ?? localeService.t("drawing-ui.image-text-wrap.inline"),
838
838
  value: wrappingStyle,
@@ -857,11 +857,14 @@ function DocChartFloatingToolbar(props) {
857
857
  const [hidden, setHidden] = (0, react.useState)(false);
858
858
  const chartTypeItem = props.menuItems.find((item) => item.type === "select");
859
859
  const actionItems = props.menuItems.filter((item) => item.type !== "select" && item.icon).sort((a, b) => a.index - b.index);
860
- const chartTypeOptions = ((chartTypeItem === null || chartTypeItem === void 0 ? void 0 : chartTypeItem.options) ?? []).map((option) => ({
861
- label: String(option.label),
862
- value: option.value,
863
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.ChartIcon, {})
864
- }));
860
+ const chartTypeOptions = ((chartTypeItem === null || chartTypeItem === void 0 ? void 0 : chartTypeItem.options) ?? []).map((option) => {
861
+ const Icon = option.icon ? iconManager.get(option.icon) : _univerjs_icons.ChartIcon;
862
+ return {
863
+ label: String(option.label),
864
+ value: option.value,
865
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {})
866
+ };
867
+ });
865
868
  const executeMenuItem = (item) => {
866
869
  if (!item || item.disable) return;
867
870
  if (item.hideOnClick) setHidden(true);
@@ -874,7 +877,7 @@ function DocChartFloatingToolbar(props) {
874
877
  event.stopPropagation();
875
878
  event.preventDefault();
876
879
  },
877
- className: (0, _univerjs_design.clsx)("univer-box-border univer-flex univer-items-center univer-rounded univer-bg-white univer-px-1 univer-py-1 univer-shadow-sm dark:!univer-border-gray-700 dark:!univer-bg-gray-900", _univerjs_design.borderClassName),
880
+ className: (0, _univerjs_design.clsx)("univer-box-border univer-flex univer-items-center univer-rounded univer-bg-gray-0 univer-px-1 univer-py-1 univer-shadow-sm dark:!univer-border-gray-700 dark:!univer-bg-gray-900", _univerjs_design.borderClassName),
878
881
  children: [chartTypeItem && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarGroup, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolbarDropdownButton, {
879
882
  title: localeService.t(chartTypeItem.label),
880
883
  value: chartTypeItem.value ?? ((_chartTypeOptions$ = chartTypeOptions[0]) === null || _chartTypeOptions$ === void 0 ? void 0 : _chartTypeOptions$.value) ?? "",
@@ -1954,7 +1957,7 @@ var ImageCropperObject = class extends _univerjs_engine_render.Shape {
1954
1957
  //#endregion
1955
1958
  //#region src/controllers/image-cropper.controller.ts
1956
1959
  let ImageCropperController = class ImageCropperController extends _univerjs_core.Disposable {
1957
- constructor(_commandService, _drawingManagerService, _renderManagerService, _univerInstanceService, _messageService, _localeService) {
1960
+ constructor(_commandService, _drawingManagerService, _renderManagerService, _univerInstanceService, _messageService, _localeService, _shortcutService) {
1958
1961
  super();
1959
1962
  this._commandService = _commandService;
1960
1963
  this._drawingManagerService = _drawingManagerService;
@@ -1962,7 +1965,13 @@ let ImageCropperController = class ImageCropperController extends _univerjs_core
1962
1965
  this._univerInstanceService = _univerInstanceService;
1963
1966
  this._messageService = _messageService;
1964
1967
  this._localeService = _localeService;
1968
+ this._shortcutService = _shortcutService;
1965
1969
  _defineProperty(this, "_sceneListenerOnImageMap", /* @__PURE__ */ new WeakSet());
1970
+ _defineProperty(this, "_cropShortcutDisposables", new _univerjs_core.DisposableCollection());
1971
+ _defineProperty(this, "_cropSnapshots", /* @__PURE__ */ new WeakMap());
1972
+ _defineProperty(this, "_pendingCropSnapshot", null);
1973
+ _defineProperty(this, "_activeCropSession", null);
1974
+ this.disposeWithMe(this._cropShortcutDisposables);
1966
1975
  this._init();
1967
1976
  }
1968
1977
  _init() {
@@ -1997,12 +2006,17 @@ let ImageCropperController = class ImageCropperController extends _univerjs_core
1997
2006
  return;
1998
2007
  }
1999
2008
  if (imageShape == null) return;
2000
- this._updateCropperObject(cropType, imageShape);
2001
- this._commandService.executeCommand(OpenImageCropOperation.id, {
2002
- unitId,
2003
- subUnitId,
2004
- drawingId
2005
- });
2009
+ this._pendingCropSnapshot = this._captureCropSnapshot(imageShape);
2010
+ try {
2011
+ this._updateCropperObject(cropType, imageShape);
2012
+ this._commandService.syncExecuteCommand(OpenImageCropOperation.id, {
2013
+ unitId,
2014
+ subUnitId,
2015
+ drawingId
2016
+ });
2017
+ } finally {
2018
+ this._pendingCropSnapshot = null;
2019
+ }
2006
2020
  }));
2007
2021
  }
2008
2022
  _calculateSrcRectByRatio(left, top, width, height, numerator, denominator) {
@@ -2070,6 +2084,7 @@ let ImageCropperController = class ImageCropperController extends _univerjs_core
2070
2084
  if (command.id !== OpenImageCropOperation.id) return;
2071
2085
  const params = command.params;
2072
2086
  if (params == null) return;
2087
+ if (this._activeCropSession != null) this._commandService.syncExecuteCommand(CloseImageCropOperation.id, { isAuto: true });
2073
2088
  const { unitId, subUnitId, drawingId } = params;
2074
2089
  const renderObject = this._renderManagerService.getRenderUnitById(unitId);
2075
2090
  const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
@@ -2104,12 +2119,20 @@ let ImageCropperController = class ImageCropperController extends _univerjs_core
2104
2119
  prstGeom: imageShape.prstGeom,
2105
2120
  applyTransform: imageShape.calculateTransformWithSrcRect()
2106
2121
  });
2122
+ this._cropSnapshots.set(imageCropperObject, this._pendingCropSnapshot ?? this._captureCropSnapshot(imageShape));
2123
+ this._pendingCropSnapshot = null;
2107
2124
  scene.addObject(imageCropperObject, imageShape.getLayerIndex() + 1).attachTransformerTo(imageCropperObject);
2125
+ this._activeCropSession = {
2126
+ scene,
2127
+ imageShape,
2128
+ imageCropperObject
2129
+ };
2108
2130
  transformer === null || transformer === void 0 || transformer.createControlForCopper(imageCropperObject);
2109
2131
  this._addHoverForImageCopper(imageCropperObject);
2110
2132
  imageShape.openRenderByCropper();
2111
2133
  transformer === null || transformer === void 0 || transformer.refreshControls();
2112
2134
  imageCropperObject.makeDirty(true);
2135
+ this._registerCropShortcuts();
2113
2136
  this._commandService.syncExecuteCommand(_univerjs_drawing.SetDrawingSelectedOperation.id, [{
2114
2137
  unitId,
2115
2138
  subUnitId,
@@ -2124,39 +2147,40 @@ let ImageCropperController = class ImageCropperController extends _univerjs_core
2124
2147
  _initCloseCrop() {
2125
2148
  this.disposeWithMe(this._commandService.onCommandExecuted((command) => {
2126
2149
  if (command.id !== CloseImageCropOperation.id) return;
2127
- const currentUnit = this._univerInstanceService.getFocusedUnit();
2128
- if (currentUnit == null) return;
2129
- const unitId = currentUnit.getUnitId();
2130
- const renderObject = this._renderManagerService.getRenderUnitById(unitId);
2131
- const scene = renderObject === null || renderObject === void 0 ? void 0 : renderObject.scene;
2132
- if (scene == null) return true;
2133
- const imageCropperObject = this._searchCropObject(scene);
2134
- if (imageCropperObject == null) return;
2135
- const imageShape = this._getApplyObjectByCropObject(imageCropperObject);
2136
- if (imageShape == null) return;
2150
+ const cropSession = this._activeCropSession;
2151
+ if (cropSession == null) return;
2152
+ const { scene, imageShape, imageCropperObject } = cropSession;
2137
2153
  const transformer = scene.getTransformerByCreate();
2138
2154
  transformer.detachFrom(imageCropperObject);
2139
2155
  transformer.clearCopperControl();
2140
- const srcRect = this._getSrcRectByTransformState(imageShape, imageCropperObject);
2141
- const drawingParam = this._drawingManagerService.getDrawingOKey(imageShape.oKey);
2142
- if (drawingParam != null) {
2143
- const { left, top, height, width } = imageCropperObject;
2144
- this._drawingManagerService.featurePluginUpdateNotification([{
2145
- ...drawingParam,
2146
- transform: {
2147
- ...drawingParam.transform,
2148
- left,
2149
- top,
2150
- height,
2151
- width
2152
- },
2153
- srcRect: srcRect.srcRectAngle
2154
- }]);
2156
+ const params = command.params;
2157
+ if (params === null || params === void 0 ? void 0 : params.isCancel) this._restoreCropSnapshot(imageShape, imageCropperObject);
2158
+ else {
2159
+ const srcRect = this._getSrcRectByTransformState(imageShape, imageCropperObject);
2160
+ const drawingParam = this._drawingManagerService.getDrawingOKey(imageShape.oKey);
2161
+ if (drawingParam != null) {
2162
+ const { left, top, height, width } = imageCropperObject;
2163
+ this._drawingManagerService.featurePluginUpdateNotification([{
2164
+ ...drawingParam,
2165
+ transform: {
2166
+ ...drawingParam.transform,
2167
+ left,
2168
+ top,
2169
+ height,
2170
+ width
2171
+ },
2172
+ srcRect: srcRect.srcRectAngle
2173
+ }]);
2174
+ }
2175
+ imageShape.setSrcRect({ ...srcRect.srcRectAngle });
2155
2176
  }
2156
- imageShape.setSrcRect({ ...srcRect.srcRectAngle });
2157
2177
  imageShape.closeRenderByCropper();
2158
2178
  imageShape.makeDirty(true);
2159
- imageCropperObject === null || imageCropperObject === void 0 || imageCropperObject.dispose();
2179
+ transformer.refreshControls();
2180
+ this._cropSnapshots.delete(imageCropperObject);
2181
+ imageCropperObject.dispose();
2182
+ this._activeCropSession = null;
2183
+ this._cropShortcutDisposables.dispose();
2160
2184
  }));
2161
2185
  const sheetUnit$ = this._univerInstanceService.getCurrentTypeOfUnit$(_univerjs_core.UniverInstanceType.UNIVER_SHEET).pipe((0, rxjs.switchMap)((workbook) => workbook ? workbook.activeSheet$ : (0, rxjs.of)(null)));
2162
2186
  this.disposeWithMe(sheetUnit$.subscribe(() => {
@@ -2172,6 +2196,33 @@ let ImageCropperController = class ImageCropperController extends _univerjs_core
2172
2196
  if (applyObject == null) return null;
2173
2197
  return applyObject;
2174
2198
  }
2199
+ _captureCropSnapshot(imageShape) {
2200
+ return {
2201
+ transform: imageShape.getState(),
2202
+ srcRect: imageShape.srcRect == null ? imageShape.srcRect : { ...imageShape.srcRect }
2203
+ };
2204
+ }
2205
+ _restoreCropSnapshot(imageShape, imageCropperObject) {
2206
+ const snapshot = this._cropSnapshots.get(imageCropperObject);
2207
+ if (snapshot) {
2208
+ imageShape.transformByStateCloseCropper(snapshot.transform);
2209
+ imageShape.setSrcRect(snapshot.srcRect);
2210
+ }
2211
+ }
2212
+ _registerCropShortcuts() {
2213
+ this._cropShortcutDisposables.dispose();
2214
+ this._cropShortcutDisposables.add(this._shortcutService.registerShortcut({
2215
+ id: CloseImageCropOperation.id,
2216
+ binding: _univerjs_ui.KeyCode.ENTER,
2217
+ priority: 1e3
2218
+ }));
2219
+ this._cropShortcutDisposables.add(this._shortcutService.registerShortcut({
2220
+ id: CloseImageCropOperation.id,
2221
+ binding: _univerjs_ui.KeyCode.ESC,
2222
+ priority: 1e3,
2223
+ staticParameters: { isCancel: true }
2224
+ }));
2225
+ }
2175
2226
  _addListenerOnImage(scene) {
2176
2227
  const transformer = scene.getTransformerByCreate();
2177
2228
  let startTransform = null;
@@ -2224,8 +2275,8 @@ let ImageCropperController = class ImageCropperController extends _univerjs_core
2224
2275
  }));
2225
2276
  }
2226
2277
  _getSrcRectByTransformState(applyObject, imageCropperObject) {
2227
- const { left, top, height, width, strokeWidth, angle: copperAngle } = imageCropperObject;
2228
- const { left: applyLeft, top: applyTop, width: applyWidth, height: applyHeight, angle: applyAngle, strokeWidth: applyStrokeWidth } = applyObject;
2278
+ const { left, top, height, width } = imageCropperObject;
2279
+ const { left: applyLeft, top: applyTop, width: applyWidth, height: applyHeight, angle: applyAngle } = applyObject;
2229
2280
  const newLeft = left - applyLeft;
2230
2281
  const newTop = top - applyTop;
2231
2282
  const srcRect = {
@@ -2261,7 +2312,8 @@ ImageCropperController = __decorate([
2261
2312
  __decorateParam(2, _univerjs_engine_render.IRenderManagerService),
2262
2313
  __decorateParam(3, _univerjs_core.IUniverInstanceService),
2263
2314
  __decorateParam(4, _univerjs_ui.IMessageService),
2264
- __decorateParam(5, (0, _univerjs_core.Inject)(_univerjs_core.LocaleService))
2315
+ __decorateParam(5, (0, _univerjs_core.Inject)(_univerjs_core.LocaleService)),
2316
+ __decorateParam(6, _univerjs_ui.IShortcutService)
2265
2317
  ], ImageCropperController);
2266
2318
 
2267
2319
  //#endregion
@@ -2747,7 +2799,7 @@ function ObjectListPanelBase(props) {
2747
2799
  ["locked", labels.filterLocked]
2748
2800
  ].map(([mode, label]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2749
2801
  type: "button",
2750
- className: (0, _univerjs_design.clsx)("univer-h-7 univer-min-w-0 univer-flex-1 univer-rounded-md univer-border univer-border-solid univer-px-2 univer-text-xs univer-outline-none univer-transition-colors dark:!univer-border-gray-700", filterMode === mode ? "dark:!univer-bg-primary-900/30 univer-border-primary-500 univer-bg-primary-50 univer-text-primary-600 dark:!univer-text-primary-200" : "univer-border-gray-200 univer-bg-white univer-text-gray-600 hover:univer-bg-gray-50 dark:!univer-bg-gray-900 dark:!univer-text-gray-300 dark:hover:!univer-bg-gray-800"),
2802
+ className: (0, _univerjs_design.clsx)("univer-h-7 univer-min-w-0 univer-flex-1 univer-rounded-md univer-border univer-border-solid univer-px-2 univer-text-xs univer-outline-none univer-transition-colors dark:!univer-border-gray-700", filterMode === mode ? "dark:!univer-bg-primary-900/30 univer-border-primary-500 univer-bg-primary-50 univer-text-primary-600 dark:!univer-text-primary-200" : "univer-border-gray-200 univer-bg-gray-0 univer-text-gray-600 hover:univer-bg-gray-50 dark:!univer-bg-gray-900 dark:!univer-text-gray-300 dark:hover:!univer-bg-gray-800"),
2751
2803
  "aria-pressed": filterMode === mode,
2752
2804
  onClick: () => setFilterMode(mode),
2753
2805
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -2777,7 +2829,7 @@ function ObjectListPanelBase(props) {
2777
2829
  children: [
2778
2830
  section.id ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2779
2831
  className: "univer-flex univer-size-4 univer-shrink-0 univer-items-center univer-justify-center",
2780
- children: sectionCollapsed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreRightIcon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreDownIcon, {})
2832
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreDownIcon, { className: (0, _univerjs_design.clsx)({ "-univer-rotate-90 rtl:univer-rotate-90": sectionCollapsed }) })
2781
2833
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "univer-size-4 univer-shrink-0" }),
2782
2834
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2783
2835
  className: "univer-min-w-0 univer-flex-1 univer-truncate univer-text-left",
@@ -2886,11 +2938,11 @@ function ObjectListRow(props) {
2886
2938
  event.stopPropagation();
2887
2939
  onToggleExpanded();
2888
2940
  },
2889
- children: item.expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreDownIcon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreRightIcon, {})
2941
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreDownIcon, { className: (0, _univerjs_design.clsx)({ "-univer-rotate-90 rtl:univer-rotate-90": !item.expanded }) })
2890
2942
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "univer-size-5 univer-shrink-0" }),
2891
2943
  showName ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Input, {
2892
2944
  className: (0, _univerjs_design.clsx)("univer-h-7 univer-w-0 univer-min-w-0 univer-flex-1", disabled && "univer-cursor-not-allowed"),
2893
- inputClass: (0, _univerjs_design.clsx)("!univer-h-7 univer-min-w-0 univer-overflow-hidden univer-text-ellipsis univer-whitespace-nowrap !univer-rounded !univer-border-transparent !univer-bg-transparent !univer-px-1 univer-text-sm univer-text-gray-900 !univer-shadow-none focus:!univer-border-primary-500 focus:!univer-bg-white focus:!univer-ring-1 focus:!univer-ring-primary-100 disabled:!univer-bg-transparent disabled:univer-opacity-100 dark:!univer-text-gray-100 dark:focus:!univer-bg-gray-900 dark:focus:!univer-ring-primary-900", disabled && "univer-text-gray-400 dark:!univer-text-gray-500"),
2945
+ inputClass: (0, _univerjs_design.clsx)("!univer-h-7 univer-min-w-0 univer-overflow-hidden univer-text-ellipsis univer-whitespace-nowrap !univer-rounded !univer-border-transparent !univer-bg-transparent !univer-px-1 univer-text-sm univer-text-gray-900 !univer-shadow-none focus:!univer-border-primary-500 focus:!univer-bg-gray-0 focus:!univer-ring-1 focus:!univer-ring-primary-100 disabled:!univer-bg-transparent disabled:univer-opacity-100 dark:!univer-text-gray-100 dark:focus:!univer-bg-gray-900 dark:focus:!univer-ring-primary-900", disabled && "univer-text-gray-400 dark:!univer-text-gray-500"),
2894
2946
  inputStyle: {
2895
2947
  maxWidth: "100%",
2896
2948
  boxSizing: "border-box"
@@ -2984,7 +3036,7 @@ function ObjectDetailsEditor(props) {
2984
3036
  className: "univer-text-xs univer-text-gray-500 dark:!univer-text-gray-400",
2985
3037
  children: labels.description
2986
3038
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
2987
- className: "univer-box-border univer-min-h-16 univer-w-full univer-resize-none univer-rounded-md univer-border univer-border-solid univer-border-gray-200 univer-bg-white univer-p-2 univer-text-sm univer-text-gray-900 univer-outline-none focus:univer-border-primary-500 focus:univer-ring-1 focus:univer-ring-primary-100 disabled:univer-cursor-not-allowed disabled:univer-opacity-70 dark:!univer-border-gray-700 dark:!univer-bg-gray-900 dark:!univer-text-gray-100 dark:focus:!univer-ring-primary-900",
3039
+ className: "univer-box-border univer-min-h-16 univer-w-full univer-resize-none univer-rounded-md univer-border univer-border-solid univer-border-gray-200 univer-bg-gray-0 univer-p-2 univer-text-sm univer-text-gray-900 univer-outline-none focus:univer-border-primary-500 focus:univer-ring-1 focus:univer-ring-primary-100 disabled:univer-cursor-not-allowed disabled:univer-opacity-70 dark:!univer-border-gray-700 dark:!univer-bg-gray-900 dark:!univer-text-gray-100 dark:focus:!univer-ring-primary-900",
2988
3040
  value: draftDescription,
2989
3041
  disabled,
2990
3042
  placeholder: labels.descriptionPlaceholder,
@@ -3062,7 +3114,7 @@ const DrawingAlign = (props) => {
3062
3114
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3063
3115
  className: "univer-relative univer-mt-2.5 univer-flex univer-h-full",
3064
3116
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3065
- className: "univer-w-full univer-text-gray-900 dark:!univer-text-white",
3117
+ className: "univer-w-full univer-text-gray-900 dark:!univer-text-gray-0",
3066
3118
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Select, {
3067
3119
  value: alignValue,
3068
3120
  options: alignOptions,
@@ -89,29 +89,11 @@ const locale = { "drawing-ui": {
89
89
  null: "لا يوجد تحديد للكائن"
90
90
  },
91
91
  "image-text-wrap": {
92
- title: "التفاف النص",
93
- wrappingStyle: "نمط التفاف",
94
92
  square: "مربع",
95
93
  topAndBottom: "أعلى وأسفل",
96
94
  inline: "في نفس السطر مع النص",
97
95
  behindText: "خلف النص",
98
- inFrontText: "أمام النص",
99
- wrapText: "تفاف النص",
100
- bothSide: "كلا الجانبين",
101
- leftOnly: "يسار فقط",
102
- rightOnly: "يمين فقط",
103
- distanceFromText: "المسافة من النص",
104
- top: "أعلى(بكسل)",
105
- left: "يسار(بكسل)",
106
- bottom: "أسفل(بكسل)",
107
- right: "يمين(بكسل)"
108
- },
109
- "image-popup": {
110
- replace: "استبدال",
111
- delete: "حذف",
112
- edit: "تحرير",
113
- crop: "قص",
114
- reset: "إعادة تعيين الحجم"
96
+ inFrontText: "أمام النص"
115
97
  }
116
98
  } };
117
99
 
@@ -89,29 +89,11 @@ const locale = { "drawing-ui": {
89
89
  null: "Cap objecte seleccionat"
90
90
  },
91
91
  "image-text-wrap": {
92
- title: "Ajust del text",
93
- wrappingStyle: "Estil d'ajust",
94
92
  square: "Quadrat",
95
93
  topAndBottom: "A dalt i a baix",
96
94
  inline: "En línia amb el text",
97
95
  behindText: "Darrere del text",
98
- inFrontText: "Davant del text",
99
- wrapText: "Ajusta el text",
100
- bothSide: "Ambdós costats",
101
- leftOnly: "Només esquerra",
102
- rightOnly: "Només dreta",
103
- distanceFromText: "Distància del text",
104
- top: "A dalt(px)",
105
- left: "Esquerra(px)",
106
- bottom: "A baix(px)",
107
- right: "Dreta(px)"
108
- },
109
- "image-popup": {
110
- replace: "Reemplaça",
111
- delete: "Elimina",
112
- edit: "Edita",
113
- crop: "Retalla",
114
- reset: "Restableix la mida"
96
+ inFrontText: "Davant del text"
115
97
  }
116
98
  } };
117
99
 
@@ -89,29 +89,11 @@ const locale = { "drawing-ui": {
89
89
  null: "Keine Objektauswahl"
90
90
  },
91
91
  "image-text-wrap": {
92
- title: "Textumbruch",
93
- wrappingStyle: "Umbruchstil",
94
92
  square: "Quadratisch",
95
93
  topAndBottom: "Oben und unten",
96
94
  inline: "Im Textfluss",
97
95
  behindText: "Hinter dem Text",
98
- inFrontText: "Vor dem Text",
99
- wrapText: "Text umbrechen",
100
- bothSide: "Beide Seiten",
101
- leftOnly: "Nur links",
102
- rightOnly: "Nur rechts",
103
- distanceFromText: "Abstand vom Text",
104
- top: "Oben(px)",
105
- left: "Links(px)",
106
- bottom: "Unten(px)",
107
- right: "Rechts(px)"
108
- },
109
- "image-popup": {
110
- replace: "Ersetzen",
111
- delete: "Löschen",
112
- edit: "Bearbeiten",
113
- crop: "Zuschneiden",
114
- reset: "Größe zurücksetzen"
96
+ inFrontText: "Vor dem Text"
115
97
  }
116
98
  } };
117
99
 
@@ -103,30 +103,12 @@ const locale = { "drawing-ui": {
103
103
  },
104
104
  null: "No Object Selection"
105
105
  },
106
- "image-popup": {
107
- replace: "Replace",
108
- delete: "Delete",
109
- edit: "Edit",
110
- crop: "Crop",
111
- reset: "Reset Size"
112
- },
113
106
  "image-text-wrap": {
114
- title: "Text Wrapping",
115
- wrappingStyle: "Wrapping Style",
116
107
  square: "Square",
117
108
  topAndBottom: "Top and Bottom",
118
109
  inline: "In line with text",
119
110
  behindText: "Behind text",
120
- inFrontText: "In front of text",
121
- wrapText: "Wrap text",
122
- bothSide: "Both sides",
123
- leftOnly: "Left only",
124
- rightOnly: "Right only",
125
- distanceFromText: "Distance from text",
126
- top: "Top(px)",
127
- left: "Left(px)",
128
- bottom: "Bottom(px)",
129
- right: "Right(px)"
111
+ inFrontText: "In front of text"
130
112
  }
131
113
  } };
132
114
 
@@ -89,29 +89,11 @@ const locale = { "drawing-ui": {
89
89
  null: "Ningún objeto seleccionado"
90
90
  },
91
91
  "image-text-wrap": {
92
- title: "Ajuste de texto",
93
- wrappingStyle: "Estilo de ajuste",
94
92
  square: "Cuadrado",
95
93
  topAndBottom: "Arriba y abajo",
96
94
  inline: "En línea con el texto",
97
95
  behindText: "Detrás del texto",
98
- inFrontText: "Delante del texto",
99
- wrapText: "Ajustar texto",
100
- bothSide: "Ambos lados",
101
- leftOnly: "Solo izquierda",
102
- rightOnly: "Solo derecha",
103
- distanceFromText: "Distancia del texto",
104
- top: "Arriba(px)",
105
- left: "Izquierda(px)",
106
- bottom: "Abajo(px)",
107
- right: "Derecha(px)"
108
- },
109
- "image-popup": {
110
- replace: "Reemplazar",
111
- delete: "Eliminar",
112
- edit: "Editar",
113
- crop: "Recortar",
114
- reset: "Restablecer tamaño"
96
+ inFrontText: "Delante del texto"
115
97
  }
116
98
  } };
117
99
 
@@ -89,29 +89,11 @@ const locale = { "drawing-ui": {
89
89
  null: "هیچ شیئی انتخاب نشده است"
90
90
  },
91
91
  "image-text-wrap": {
92
- title: "پیچش متن",
93
- wrappingStyle: "سبک پیچش",
94
92
  square: "مربع",
95
93
  topAndBottom: "بالا و پایین",
96
94
  inline: "در یک خط با متن",
97
95
  behindText: "پشت متن",
98
- inFrontText: "جلوی متن",
99
- wrapText: "پیچش متن",
100
- bothSide: "هر دو طرف",
101
- leftOnly: "فقط سمت چپ",
102
- rightOnly: "فقط سمت راست",
103
- distanceFromText: "فاصله از متن",
104
- top: "بالا(px)",
105
- left: "چپ(px)",
106
- bottom: "پایین(px)",
107
- right: "راست(px)"
108
- },
109
- "image-popup": {
110
- replace: "تعویض",
111
- delete: "حذف",
112
- edit: "ویرایش",
113
- crop: "کراپ",
114
- reset: "بازنشانی اندازه"
96
+ inFrontText: "جلوی متن"
115
97
  }
116
98
  } };
117
99
 
@@ -89,29 +89,11 @@ const locale = { "drawing-ui": {
89
89
  null: "Aucune sélection d'objet"
90
90
  },
91
91
  "image-text-wrap": {
92
- title: "Habillage du texte",
93
- wrappingStyle: "Style d'habillage",
94
92
  square: "Carré",
95
93
  topAndBottom: "Haut et bas",
96
94
  inline: "Aligné avec le texte",
97
95
  behindText: "Derrière le texte",
98
- inFrontText: "Devant le texte",
99
- wrapText: "Habiller le texte",
100
- bothSide: "Des deux côtés",
101
- leftOnly: "Seulement à gauche",
102
- rightOnly: "Seulement à droite",
103
- distanceFromText: "Distance du texte",
104
- top: "Haut(px)",
105
- left: "Gauche(px)",
106
- bottom: "Bas(px)",
107
- right: "Droite(px)"
108
- },
109
- "image-popup": {
110
- replace: "Remplacer",
111
- delete: "Supprimer",
112
- edit: "Modifier",
113
- crop: "Rogner",
114
- reset: "Réinitialiser la taille"
96
+ inFrontText: "Devant le texte"
115
97
  }
116
98
  } };
117
99
 
@@ -89,29 +89,11 @@ const locale = { "drawing-ui": {
89
89
  null: "Tidak Ada Objek yang Dipilih"
90
90
  },
91
91
  "image-text-wrap": {
92
- title: "Pembungkus Teks",
93
- wrappingStyle: "Gaya Pembungkus",
94
92
  square: "Kotak",
95
93
  topAndBottom: "Atas dan Bawah",
96
94
  inline: "Sejajar dengan teks",
97
95
  behindText: "Di belakang teks",
98
- inFrontText: "Di depan teks",
99
- wrapText: "Bungkus teks",
100
- bothSide: "Kedua sisi",
101
- leftOnly: "Kiri saja",
102
- rightOnly: "Kanan saja",
103
- distanceFromText: "Jarak dari teks",
104
- top: "Atas(px)",
105
- left: "Kiri(px)",
106
- bottom: "Bawah(px)",
107
- right: "Kanan(px)"
108
- },
109
- "image-popup": {
110
- replace: "Ganti",
111
- delete: "Hapus",
112
- edit: "Edit",
113
- crop: "Pangkas",
114
- reset: "Atur Ulang Ukuran"
96
+ inFrontText: "Di depan teks"
115
97
  }
116
98
  } };
117
99
 
@@ -89,29 +89,11 @@ const locale = { "drawing-ui": {
89
89
  null: "Nessun oggetto selezionato"
90
90
  },
91
91
  "image-text-wrap": {
92
- title: "Testo a capo",
93
- wrappingStyle: "Stile a capo",
94
92
  square: "Quadrato",
95
93
  topAndBottom: "Superiore e inferiore",
96
94
  inline: "In linea con il testo",
97
95
  behindText: "Dietro il testo",
98
- inFrontText: "Davanti al testo",
99
- wrapText: "Testo a capo",
100
- bothSide: "Entrambi i lati",
101
- leftOnly: "Solo sinistra",
102
- rightOnly: "Solo destra",
103
- distanceFromText: "Distanza dal testo",
104
- top: "Superiore(px)",
105
- left: "Sinistra(px)",
106
- bottom: "Inferiore(px)",
107
- right: "Destra(px)"
108
- },
109
- "image-popup": {
110
- replace: "Sostituisci",
111
- delete: "Elimina",
112
- edit: "Modifica",
113
- crop: "Ritaglia",
114
- reset: "Reimposta dimensione"
96
+ inFrontText: "Davanti al testo"
115
97
  }
116
98
  } };
117
99
 
@@ -89,29 +89,11 @@ const locale = { "drawing-ui": {
89
89
  null: "選択されたオブジェクトがありません"
90
90
  },
91
91
  "image-text-wrap": {
92
- title: "文字列の折り返し",
93
- wrappingStyle: "折り返しのスタイル",
94
92
  square: "四角形",
95
93
  topAndBottom: "上下",
96
94
  inline: "行内",
97
95
  behindText: "文字列の背面",
98
- inFrontText: "文字列の前面",
99
- wrapText: "文字列の折り返し",
100
- bothSide: "両側",
101
- leftOnly: "左のみ",
102
- rightOnly: "右のみ",
103
- distanceFromText: "文字列からの距離",
104
- top: "上(px)",
105
- left: "左(px)",
106
- bottom: "下(px)",
107
- right: "右(px)"
108
- },
109
- "image-popup": {
110
- replace: "置換",
111
- delete: "削除",
112
- edit: "編集",
113
- crop: "トリミング",
114
- reset: "サイズをリセット"
96
+ inFrontText: "文字列の前面"
115
97
  }
116
98
  } };
117
99