@univerjs/sheets-drawing-ui 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +425 -12
- package/lib/cjs/locale/ar-SA.js +1 -0
- package/lib/cjs/locale/ca-ES.js +1 -0
- package/lib/cjs/locale/de-DE.js +1 -0
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/es-ES.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/cjs/locale/id-ID.js +1 -0
- package/lib/cjs/locale/it-IT.js +1 -0
- package/lib/cjs/locale/ja-JP.js +1 -0
- package/lib/cjs/locale/ko-KR.js +1 -0
- package/lib/cjs/locale/pl-PL.js +1 -0
- package/lib/cjs/locale/pt-BR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-HK.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/index.js +430 -17
- package/lib/es/locale/ar-SA.js +1 -0
- package/lib/es/locale/ca-ES.js +1 -0
- package/lib/es/locale/de-DE.js +1 -0
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/es-ES.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/fr-FR.js +1 -0
- package/lib/es/locale/id-ID.js +1 -0
- package/lib/es/locale/it-IT.js +1 -0
- package/lib/es/locale/ja-JP.js +1 -0
- package/lib/es/locale/ko-KR.js +1 -0
- package/lib/es/locale/pl-PL.js +1 -0
- package/lib/es/locale/pt-BR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/sk-SK.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-HK.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/index.css +290 -0
- package/lib/index.js +430 -17
- package/lib/locale/ar-SA.js +1 -0
- package/lib/locale/ca-ES.js +1 -0
- package/lib/locale/de-DE.js +1 -0
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/es-ES.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/fr-FR.js +1 -0
- package/lib/locale/id-ID.js +1 -0
- package/lib/locale/it-IT.js +1 -0
- package/lib/locale/ja-JP.js +1 -0
- package/lib/locale/ko-KR.js +1 -0
- package/lib/locale/pl-PL.js +1 -0
- package/lib/locale/pt-BR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/sk-SK.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-HK.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/commands/operations/preview-sheet-image-opacity.operation.d.ts +20 -0
- package/lib/types/controllers/sheet-drawing-active-render.controller.d.ts +4 -0
- package/lib/types/locale/en-US.d.ts +3 -0
- package/lib/types/views/sheet-image-panel/SheetImageTransparency.d.ts +20 -0
- package/lib/types/views/sheet-image-panel/SheetImageTransparencySlider.d.ts +24 -0
- package/lib/types/views/sheet-image-panel/sheet-drawing-panel.util.d.ts +18 -0
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +14 -14
package/lib/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { BooleanNumber, BuildTextUtils, CommandType, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DependentOn, Direction, Disposable, DisposableCollection, DrawingTypeEnum, FOCUSING_COMMON_DRAWINGS, FOCUSING_FX_BAR_EDITOR, FOCUSING_PANEL_EDITOR, FOCUSING_SHAPE_TEXT_EDITOR, FOCUSING_SHEET, ICommandService, IConfigService, IContextService, IImageIoService, IPermissionService, IURLImageService, IUndoRedoService, IUniverInstanceService, ImageCacheMap, ImageSourceType, ImageUploadStatusType, Inject, Injector, InterceptorEffectEnum, LifecycleService, LifecycleStages, LocaleService, ObjectMatrix, Optional, Plugin, PositionedObjectLayoutType, RxDisposable, Tools, UniverInstanceType, UserManagerService, WrapTextType, createDocumentModelWithStyle, createIdentifier, fromEventSubject, generateRandomId, merge, mergeOverrideWithDependencies, registerDependencies, sequenceExecute, toDisposable, touchDependencies } from "@univerjs/core";
|
|
2
|
-
import { ClearSheetDrawingTransformerOperation, DrawingApplyType, ISheetDrawingService, InsertSheetDrawingCommand, RemoveSheetDrawingCommand, SetDrawingApplyMutation, SetDrawingArrangeCommand, SetSheetDrawingCommand, SetSheetDrawingPlacementCommand, SetWorksheetBackgroundImageCommand, SetWorksheetBackgroundImageMutation, SheetDrawingAnchorType, UniverSheetsDrawingPlugin, drawingPositionToTransform, getSheetDrawingPlacement, transformToAxisAlignPosition, transformToDrawingPosition } from "@univerjs/sheets-drawing";
|
|
2
|
+
import { ClearSheetDrawingTransformerOperation, DrawingApplyType, ISheetDrawingService, InsertSheetDrawingCommand, RemoveSheetDrawingCommand, SetDrawingApplyMutation, SetDrawingArrangeCommand, SetSheetDrawingCommand, SetSheetDrawingPlacementCommand, SetWorksheetBackgroundImageCommand, SetWorksheetBackgroundImageMutation, SheetDrawingAnchorType, UniverSheetsDrawingPlugin, applySheetDrawingPlacement, drawingPositionToTransform, getSheetDrawingPlacement, transformToAxisAlignPosition, transformToDrawingPosition } from "@univerjs/sheets-drawing";
|
|
3
3
|
import { CURSOR_TYPE, DEFAULT_TRANSFORMER_CONFIG, DRAWING_OBJECT_LAYER_INDEX, IRenderManagerService, Image, ObjectType, Rect, SHEET_EXTENSION_TYPE, SHEET_VIEWPORT_KEY, SheetExtension, UniverRenderEnginePlugin, Vector2, getCurrentTypeOfRenderer, getGroupState, transformObjectOutOfGroup } from "@univerjs/engine-render";
|
|
4
|
-
import { Button, Checkbox, CheckboxGroup, FormLayout, MessageType, MobileSelect, Radio, RadioGroup, Select, clsx, render, unmount } from "@univerjs/design";
|
|
4
|
+
import { Button, Checkbox, CheckboxGroup, DropdownMenu, FormLayout, Input, MessageType, MobileSelect, Radio, RadioGroup, Select, borderClassName, clsx, render, unmount } from "@univerjs/design";
|
|
5
5
|
import { buildDocTransform, docDrawingPositionToTransform } from "@univerjs/docs";
|
|
6
|
-
import { DRAWING_IMAGE_ALLOW_IMAGE_LIST, DRAWING_IMAGE_COUNT_LIMIT, DRAWING_IMAGE_HEIGHT_LIMIT, DRAWING_IMAGE_WIDTH_LIMIT, IDrawingManagerService, SetDrawingSelectedOperation, UniverDrawingPlugin, getDrawingImageAllowSize, getDrawingShapeKeyByDrawingSearch, getImageSize } from "@univerjs/drawing";
|
|
6
|
+
import { DRAWING_IMAGE_ALLOW_IMAGE_LIST, DRAWING_IMAGE_COUNT_LIMIT, DRAWING_IMAGE_HEIGHT_LIMIT, DRAWING_IMAGE_WIDTH_LIMIT, IDrawingManagerService, SetDrawingSelectedOperation, UniverDrawingPlugin, getDrawingImageAllowSize, getDrawingShapeKeyByDrawingSearch, getImageSize, normalizeImageOpacity } from "@univerjs/drawing";
|
|
7
7
|
import { COMMAND_LISTENER_SKELETON_CHANGE, IAutoFillService, INTERCEPTOR_POINT, InterceptCellContentPriority, RangeProtectionPermissionEditPoint, SetFrozenMutation, SetRangeValuesCommand, SetSelectionsOperation, SetWorksheetActiveOperation, SetWorksheetRowAutoHeightMutation, SheetInterceptorService, SheetPermissionCheckController, SheetSkeletonService, SheetsSelectionsService, UniverSheetsPlugin, WorkbookEditablePermission, WorkbookViewPermission, WorksheetEditPermission, WorksheetViewPermission, attachRangeWithCoord, discreteRangeToRange, getSheetCommandTarget, isCellImage } from "@univerjs/sheets";
|
|
8
8
|
import { COPY_TYPE, EditingRenderController, HoverManagerService, IEditorBridgeService, ISheetClipboardService, ISheetSelectionRenderService, PREDEFINED_HOOK_NAME_PASTE, SetCellEditVisibleOperation, SetScrollOperation, SetZoomRatioOperation, SheetCanvasPopManagerService, SheetPrintInterceptorService, SheetSkeletonManagerService, UniverSheetsMobileUIPlugin, UniverSheetsUIPlugin, getCurrentRangeDisable$, useHighlightRange, virtualizeDiscreteRanges } from "@univerjs/sheets-ui";
|
|
9
|
-
import { CanvasFloatDomPreviewService, CanvasFloatDomService, ComponentManager, ContextMenuGroup, ContextMenuPosition, FloatingObjectToolbarPosition, IClipboardInterfaceService, IContextMenuService, IDialogService, ILayoutService, ILocalFileService, IMenuManagerService, IMessageService, IShortcutService, ISidebarService, KeyCode, MenuItemType, PrintFloatDomSingle, RibbonDataGroup, RibbonInsertGroup, RibbonPosition, RibbonViewGroup, UndoRedoGroupService, UniverMobileUIPlugin, connectInjector, getMenuHiddenObservable, useDependency, useObservable } from "@univerjs/ui";
|
|
9
|
+
import { CanvasFloatDomPreviewService, CanvasFloatDomService, ComponentManager, ContextMenuGroup, ContextMenuPosition, FloatingObjectToolbarPosition, IClipboardInterfaceService, IContextMenuService, IDialogService, ILayoutService, ILocalFileService, IMenuManagerService, IMessageService, IShortcutService, ISidebarService, IconManager, KeyCode, MenuItemType, PrintFloatDomSingle, RibbonDataGroup, RibbonInsertGroup, RibbonPosition, RibbonViewGroup, UndoRedoGroupService, UniverMobileUIPlugin, connectInjector, getMenuHiddenObservable, useDependency, useObservable } from "@univerjs/ui";
|
|
10
10
|
import { COMPONENT_IMAGE_POPUP_MENU, COMPONENT_MOBILE_IMAGE_POPUP_MENU, DrawingCommonPanel, DrawingRenderService, ImageCropperObject, ImageResetSizeOperation, OpenImageCropOperation, UniverDrawingMobileUIPlugin, UniverDrawingUIPlugin, disposeDrawingRenderObject, insertGroupObject } from "@univerjs/drawing-ui";
|
|
11
11
|
import { BehaviorSubject, EMPTY, Observable, Subject, combineLatest, distinctUntilChanged, filter, map, of, switchMap, take, takeUntil, tap, throttleTime, timer } from "rxjs";
|
|
12
12
|
import { DocDrawingController, UniverDocsDrawingPlugin } from "@univerjs/docs-drawing";
|
|
13
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
13
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
import { InnerPasteCommand } from "@univerjs/docs-ui";
|
|
16
16
|
|
|
@@ -3717,7 +3717,7 @@ const menuSchema = {
|
|
|
3717
3717
|
//#endregion
|
|
3718
3718
|
//#region package.json
|
|
3719
3719
|
var name = "@univerjs/sheets-drawing-ui";
|
|
3720
|
-
var version = "1.0.
|
|
3720
|
+
var version = "1.0.4";
|
|
3721
3721
|
|
|
3722
3722
|
//#endregion
|
|
3723
3723
|
//#region src/config/config.ts
|
|
@@ -3948,9 +3948,19 @@ function MobileBatchSaveImagesDialog() {
|
|
|
3948
3948
|
return /* @__PURE__ */ jsx(BatchSaveImagesDialog, { SelectComponent: MobileSelect });
|
|
3949
3949
|
}
|
|
3950
3950
|
|
|
3951
|
+
//#endregion
|
|
3952
|
+
//#region src/views/sheet-image-panel/sheet-drawing-panel.util.ts
|
|
3953
|
+
function isSheetDrawing(drawing) {
|
|
3954
|
+
return Boolean(drawing && "sheetTransform" in drawing && drawing.sheetTransform);
|
|
3955
|
+
}
|
|
3956
|
+
|
|
3951
3957
|
//#endregion
|
|
3952
3958
|
//#region src/views/sheet-image-panel/SheetDrawingAnchor.tsx
|
|
3953
3959
|
const SheetDrawingAnchor = (props) => {
|
|
3960
|
+
function getAnchorKind(value) {
|
|
3961
|
+
if (value === SheetDrawingAnchorType.Position || value === SheetDrawingAnchorType.Both || value === SheetDrawingAnchorType.None) return value;
|
|
3962
|
+
return null;
|
|
3963
|
+
}
|
|
3954
3964
|
const commandService = useDependency(ICommandService);
|
|
3955
3965
|
const localeService = useDependency(LocaleService);
|
|
3956
3966
|
const drawingManagerService = useDependency(IDrawingManagerService);
|
|
@@ -4066,12 +4076,389 @@ const SheetDrawingAnchor = (props) => {
|
|
|
4066
4076
|
}) })]
|
|
4067
4077
|
});
|
|
4068
4078
|
};
|
|
4069
|
-
|
|
4070
|
-
|
|
4079
|
+
|
|
4080
|
+
//#endregion
|
|
4081
|
+
//#region src/commands/operations/preview-sheet-image-opacity.operation.ts
|
|
4082
|
+
const PreviewSheetImageOpacityOperation = {
|
|
4083
|
+
id: "sheet.operation.preview-image-opacity",
|
|
4084
|
+
type: CommandType.OPERATION,
|
|
4085
|
+
handler: (accessor, params) => {
|
|
4086
|
+
var _renderManagerService;
|
|
4087
|
+
if (!params || !Number.isFinite(params.opacity)) return false;
|
|
4088
|
+
const scene = (_renderManagerService = accessor.get(IRenderManagerService).getRenderUnitById(params.unitId)) === null || _renderManagerService === void 0 ? void 0 : _renderManagerService.scene;
|
|
4089
|
+
const image = scene === null || scene === void 0 ? void 0 : scene.getObject(getDrawingShapeKeyByDrawingSearch(params));
|
|
4090
|
+
if (!(image instanceof Image)) return false;
|
|
4091
|
+
image.setOpacity(Math.min(Math.max(params.opacity, 0), 1));
|
|
4092
|
+
return true;
|
|
4093
|
+
}
|
|
4094
|
+
};
|
|
4095
|
+
|
|
4096
|
+
//#endregion
|
|
4097
|
+
//#region src/views/sheet-image-panel/SheetImageTransparencySlider.tsx
|
|
4098
|
+
const MIN_TRANSPARENCY = 0;
|
|
4099
|
+
const MAX_TRANSPARENCY = 100;
|
|
4100
|
+
const TRANSPARENCY_STEP = 1;
|
|
4101
|
+
const TRANSPARENCY_PAGE_STEP = 10;
|
|
4102
|
+
const DRAG_PREVIEW_INTERVAL = 50;
|
|
4103
|
+
function SheetImageTransparencySlider(props) {
|
|
4104
|
+
const { value, shortcuts, ariaLabel, disabled = false, onChange, onChangeComplete } = props;
|
|
4105
|
+
const localeService = useDependency(LocaleService);
|
|
4106
|
+
const isRtl = useObservable(localeService.direction$, localeService.getDirection()) === "rtl";
|
|
4107
|
+
const sliderRailRef = useRef(null);
|
|
4108
|
+
const dragValueRef = useRef(value);
|
|
4109
|
+
const pendingDragValueRef = useRef(null);
|
|
4110
|
+
const lastPreviewedDragValueRef = useRef(value);
|
|
4111
|
+
const dragPreviewTimerRef = useRef(null);
|
|
4112
|
+
const dragCleanupRef = useRef(null);
|
|
4113
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
4114
|
+
const [dragValue, setDragValue] = useState(value);
|
|
4115
|
+
useEffect(() => () => {
|
|
4116
|
+
var _dragCleanupRef$curre;
|
|
4117
|
+
(_dragCleanupRef$curre = dragCleanupRef.current) === null || _dragCleanupRef$curre === void 0 || _dragCleanupRef$curre.call(dragCleanupRef);
|
|
4118
|
+
clearDragPreviewTimer();
|
|
4119
|
+
}, []);
|
|
4120
|
+
function getValueByClientX(clientX) {
|
|
4121
|
+
const rail = sliderRailRef.current;
|
|
4122
|
+
if (!rail) return value;
|
|
4123
|
+
const railRect = rail.getBoundingClientRect();
|
|
4124
|
+
if (railRect.width <= 0) return value;
|
|
4125
|
+
let ratio = (clientX - railRect.left) / railRect.width;
|
|
4126
|
+
ratio = Math.min(Math.max(ratio, 0), 1);
|
|
4127
|
+
if (isRtl) ratio = 1 - ratio;
|
|
4128
|
+
return normalizeTransparency$1(MIN_TRANSPARENCY + ratio * 100);
|
|
4129
|
+
}
|
|
4130
|
+
function clearDragPreviewTimer() {
|
|
4131
|
+
if (dragPreviewTimerRef.current != null) {
|
|
4132
|
+
window.clearTimeout(dragPreviewTimerRef.current);
|
|
4133
|
+
dragPreviewTimerRef.current = null;
|
|
4134
|
+
}
|
|
4135
|
+
}
|
|
4136
|
+
function previewDragValue(nextValue) {
|
|
4137
|
+
if (nextValue === lastPreviewedDragValueRef.current) return;
|
|
4138
|
+
lastPreviewedDragValueRef.current = nextValue;
|
|
4139
|
+
onChange === null || onChange === void 0 || onChange(nextValue);
|
|
4140
|
+
}
|
|
4141
|
+
function flushDragPreview() {
|
|
4142
|
+
clearDragPreviewTimer();
|
|
4143
|
+
const nextValue = pendingDragValueRef.current;
|
|
4144
|
+
pendingDragValueRef.current = null;
|
|
4145
|
+
if (nextValue != null) previewDragValue(nextValue);
|
|
4146
|
+
}
|
|
4147
|
+
function scheduleDragPreview(nextValue) {
|
|
4148
|
+
pendingDragValueRef.current = nextValue;
|
|
4149
|
+
if (dragPreviewTimerRef.current != null) return;
|
|
4150
|
+
dragPreviewTimerRef.current = window.setTimeout(() => {
|
|
4151
|
+
dragPreviewTimerRef.current = null;
|
|
4152
|
+
const pendingValue = pendingDragValueRef.current;
|
|
4153
|
+
pendingDragValueRef.current = null;
|
|
4154
|
+
if (pendingValue != null) previewDragValue(pendingValue);
|
|
4155
|
+
}, DRAG_PREVIEW_INTERVAL);
|
|
4156
|
+
}
|
|
4157
|
+
function updateDragValue(clientX) {
|
|
4158
|
+
const nextValue = getValueByClientX(clientX);
|
|
4159
|
+
dragValueRef.current = nextValue;
|
|
4160
|
+
setDragValue(nextValue);
|
|
4161
|
+
return nextValue;
|
|
4162
|
+
}
|
|
4163
|
+
function handlePointerDown(e) {
|
|
4164
|
+
var _dragCleanupRef$curre2;
|
|
4165
|
+
if (disabled) return;
|
|
4166
|
+
e.preventDefault();
|
|
4167
|
+
e.stopPropagation();
|
|
4168
|
+
(_dragCleanupRef$curre2 = dragCleanupRef.current) === null || _dragCleanupRef$curre2 === void 0 || _dragCleanupRef$curre2.call(dragCleanupRef);
|
|
4169
|
+
clearDragPreviewTimer();
|
|
4170
|
+
pendingDragValueRef.current = null;
|
|
4171
|
+
lastPreviewedDragValueRef.current = value;
|
|
4172
|
+
setIsDragging(true);
|
|
4173
|
+
scheduleDragPreview(updateDragValue(e.clientX));
|
|
4174
|
+
function cleanup() {
|
|
4175
|
+
window.removeEventListener("pointermove", handlePointerMove);
|
|
4176
|
+
window.removeEventListener("pointerup", handlePointerUp);
|
|
4177
|
+
window.removeEventListener("pointercancel", handlePointerUp);
|
|
4178
|
+
dragCleanupRef.current = null;
|
|
4179
|
+
}
|
|
4180
|
+
function handlePointerMove(event) {
|
|
4181
|
+
scheduleDragPreview(updateDragValue(event.clientX));
|
|
4182
|
+
}
|
|
4183
|
+
function handlePointerUp() {
|
|
4184
|
+
cleanup();
|
|
4185
|
+
flushDragPreview();
|
|
4186
|
+
setIsDragging(false);
|
|
4187
|
+
onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete(dragValueRef.current);
|
|
4188
|
+
}
|
|
4189
|
+
dragCleanupRef.current = cleanup;
|
|
4190
|
+
window.addEventListener("pointermove", handlePointerMove);
|
|
4191
|
+
window.addEventListener("pointerup", handlePointerUp);
|
|
4192
|
+
window.addEventListener("pointercancel", handlePointerUp);
|
|
4193
|
+
}
|
|
4194
|
+
function handleSliderKeyDown(e) {
|
|
4195
|
+
let nextValue = null;
|
|
4196
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowDown") nextValue = value - TRANSPARENCY_STEP;
|
|
4197
|
+
else if (e.key === "ArrowRight" || e.key === "ArrowUp") nextValue = value + TRANSPARENCY_STEP;
|
|
4198
|
+
else if (e.key === "PageDown") nextValue = value - TRANSPARENCY_PAGE_STEP;
|
|
4199
|
+
else if (e.key === "PageUp") nextValue = value + TRANSPARENCY_PAGE_STEP;
|
|
4200
|
+
else if (e.key === "Home") nextValue = MIN_TRANSPARENCY;
|
|
4201
|
+
else if (e.key === "End") nextValue = MAX_TRANSPARENCY;
|
|
4202
|
+
if (nextValue == null || disabled) return;
|
|
4203
|
+
e.preventDefault();
|
|
4204
|
+
e.stopPropagation();
|
|
4205
|
+
const normalizedValue = normalizeTransparency$1(nextValue);
|
|
4206
|
+
onChange === null || onChange === void 0 || onChange(normalizedValue);
|
|
4207
|
+
onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete(normalizedValue);
|
|
4208
|
+
}
|
|
4209
|
+
const visualValue = isDragging ? dragValue : value;
|
|
4210
|
+
const sliderOffset = normalizeTransparency$1(visualValue);
|
|
4211
|
+
const handleOffset = isRtl ? MAX_TRANSPARENCY - sliderOffset : sliderOffset;
|
|
4212
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
4213
|
+
className: clsx("univer-flex univer-select-none univer-items-center univer-gap-1.5", { "univer-cursor-not-allowed": disabled }),
|
|
4214
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
4215
|
+
className: "univer-flex univer-h-6 univer-min-w-0 univer-flex-1 univer-items-center",
|
|
4216
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
4217
|
+
className: clsx("univer-relative univer-h-1.5 univer-w-full univer-rounded-full univer-bg-gray-200 univer-px-1.5 univer-transition-colors dark:!univer-bg-gray-600", { "univer-opacity-60": disabled }),
|
|
4218
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
4219
|
+
ref: sliderRailRef,
|
|
4220
|
+
"data-u-comp": "sheet-image-transparency-slider-track",
|
|
4221
|
+
className: "univer-relative univer-h-1.5 univer-bg-gray-200 dark:!univer-bg-gray-600",
|
|
4222
|
+
onPointerDown: handlePointerDown,
|
|
4223
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
4224
|
+
className: clsx("univer-bg-primary-500/60 univer-absolute univer-top-0 univer-h-full univer-rounded-full", isRtl ? "univer-right-0" : "univer-left-0"),
|
|
4225
|
+
style: { width: `${sliderOffset}%` }
|
|
4226
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
4227
|
+
className: clsx("univer-absolute univer-top-1/2 univer-size-3.5 -univer-translate-x-1/2 -univer-translate-y-1/2 univer-rounded-full univer-bg-gray-0 univer-shadow-sm focus-visible:univer-outline-none focus-visible:univer-ring-2 focus-visible:univer-ring-primary-100 dark:!univer-bg-gray-800", borderClassName, {
|
|
4228
|
+
"univer-cursor-pointer hover:univer-border-primary-600 hover:univer-shadow-md": !disabled,
|
|
4229
|
+
"univer-cursor-not-allowed": disabled,
|
|
4230
|
+
"univer-scale-105 univer-border-primary-600 univer-shadow-md": isDragging,
|
|
4231
|
+
"univer-transition-all": !isDragging,
|
|
4232
|
+
"univer-transition-none": isDragging
|
|
4233
|
+
}),
|
|
4234
|
+
role: "slider",
|
|
4235
|
+
"aria-label": ariaLabel,
|
|
4236
|
+
"aria-valuemin": MIN_TRANSPARENCY,
|
|
4237
|
+
"aria-valuemax": MAX_TRANSPARENCY,
|
|
4238
|
+
"aria-valuenow": visualValue,
|
|
4239
|
+
"aria-valuetext": `${visualValue}%`,
|
|
4240
|
+
disabled,
|
|
4241
|
+
type: "button",
|
|
4242
|
+
style: { left: `${handleOffset}%` },
|
|
4243
|
+
onKeyDown: handleSliderKeyDown
|
|
4244
|
+
})]
|
|
4245
|
+
})
|
|
4246
|
+
})
|
|
4247
|
+
}), /* @__PURE__ */ jsx(SheetImageTransparencyInput, {
|
|
4248
|
+
value,
|
|
4249
|
+
shortcuts,
|
|
4250
|
+
ariaLabel,
|
|
4251
|
+
disabled,
|
|
4252
|
+
onChange,
|
|
4253
|
+
onChangeComplete
|
|
4254
|
+
})]
|
|
4255
|
+
});
|
|
4256
|
+
}
|
|
4257
|
+
function SheetImageTransparencyInput(props) {
|
|
4258
|
+
const { value, shortcuts, ariaLabel, disabled = false, onChange, onChangeComplete } = props;
|
|
4259
|
+
const iconManager = useDependency(IconManager);
|
|
4260
|
+
const isEditingRef = useRef(false);
|
|
4261
|
+
const [listVisible, setListVisible] = useState(false);
|
|
4262
|
+
const [inputValue, setInputValue] = useState(() => `${value}%`);
|
|
4263
|
+
useEffect(() => {
|
|
4264
|
+
if (!isEditingRef.current) setInputValue(`${value}%`);
|
|
4265
|
+
}, [value]);
|
|
4266
|
+
function emitValue(nextValue) {
|
|
4267
|
+
const normalizedValue = normalizeTransparency$1(nextValue);
|
|
4268
|
+
onChange === null || onChange === void 0 || onChange(normalizedValue);
|
|
4269
|
+
onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete(normalizedValue);
|
|
4270
|
+
}
|
|
4271
|
+
function handleSelect(nextValue) {
|
|
4272
|
+
if (disabled) return;
|
|
4273
|
+
setListVisible(false);
|
|
4274
|
+
emitValue(nextValue);
|
|
4275
|
+
}
|
|
4276
|
+
function handleFocus() {
|
|
4277
|
+
if (disabled) return;
|
|
4278
|
+
isEditingRef.current = true;
|
|
4279
|
+
setInputValue(String(value));
|
|
4280
|
+
}
|
|
4281
|
+
function commitInput() {
|
|
4282
|
+
if (disabled || !isEditingRef.current) return;
|
|
4283
|
+
const parsedValue = parseTransparency(inputValue);
|
|
4284
|
+
isEditingRef.current = false;
|
|
4285
|
+
if (parsedValue == null) {
|
|
4286
|
+
setInputValue(`${value}%`);
|
|
4287
|
+
return;
|
|
4288
|
+
}
|
|
4289
|
+
if (parsedValue === value) {
|
|
4290
|
+
setInputValue(`${parsedValue}%`);
|
|
4291
|
+
return;
|
|
4292
|
+
}
|
|
4293
|
+
emitValue(parsedValue);
|
|
4294
|
+
}
|
|
4295
|
+
function handleKeyDown(e) {
|
|
4296
|
+
e.stopPropagation();
|
|
4297
|
+
if (e.key === "Enter") {
|
|
4298
|
+
e.preventDefault();
|
|
4299
|
+
commitInput();
|
|
4300
|
+
e.currentTarget.blur();
|
|
4301
|
+
}
|
|
4302
|
+
}
|
|
4303
|
+
const items = [{
|
|
4304
|
+
type: "radio",
|
|
4305
|
+
value: value.toString(),
|
|
4306
|
+
options: shortcuts.map((shortcut) => ({
|
|
4307
|
+
value: shortcut.toString(),
|
|
4308
|
+
label: `${shortcut}%`
|
|
4309
|
+
})),
|
|
4310
|
+
onSelect: (selectedValue) => handleSelect(Number(selectedValue))
|
|
4311
|
+
}];
|
|
4312
|
+
const MoreDownIcon = iconManager.get("MoreDownIcon");
|
|
4313
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
4314
|
+
className: clsx("univer-flex univer-h-6 univer-w-[68px] univer-flex-shrink-0 univer-items-center univer-overflow-hidden univer-rounded-md univer-border univer-border-gray-200 univer-bg-gray-0 dark:!univer-border-gray-600 dark:!univer-bg-gray-800", { "univer-opacity-60": disabled }),
|
|
4315
|
+
onClick: (e) => e.stopPropagation(),
|
|
4316
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
4317
|
+
className: "univer-box-border univer-h-6 univer-min-w-0 univer-flex-1 univer-border-none univer-bg-transparent [&_input:focus]:!univer-ring-0 [&_input]:univer-h-6 [&_input]:univer-w-full [&_input]:univer-border-none [&_input]:!univer-bg-transparent [&_input]:univer-px-1 [&_input]:univer-text-center [&_input]:univer-text-xs [&_input]:univer-tabular-nums",
|
|
4318
|
+
inputClass: "univer-w-full",
|
|
4319
|
+
size: "mini",
|
|
4320
|
+
"aria-label": ariaLabel,
|
|
4321
|
+
value: inputValue,
|
|
4322
|
+
disabled,
|
|
4323
|
+
type: "text",
|
|
4324
|
+
onChange: setInputValue,
|
|
4325
|
+
onFocus: handleFocus,
|
|
4326
|
+
onBlur: commitInput,
|
|
4327
|
+
onKeyDown: handleKeyDown
|
|
4328
|
+
}), /* @__PURE__ */ jsx(DropdownMenu, {
|
|
4329
|
+
align: "end",
|
|
4330
|
+
items,
|
|
4331
|
+
open: listVisible,
|
|
4332
|
+
disabled,
|
|
4333
|
+
onOpenChange: setListVisible,
|
|
4334
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
4335
|
+
className: "univer-h-6 univer-w-4 univer-rounded-none univer-p-0",
|
|
4336
|
+
size: "small",
|
|
4337
|
+
variant: "text",
|
|
4338
|
+
"aria-label": ariaLabel,
|
|
4339
|
+
disabled,
|
|
4340
|
+
children: /* @__PURE__ */ jsx(MoreDownIcon, { className: "univer-size-3 univer-text-gray-500 dark:!univer-text-gray-300" })
|
|
4341
|
+
})
|
|
4342
|
+
})]
|
|
4343
|
+
});
|
|
4071
4344
|
}
|
|
4072
|
-
function
|
|
4073
|
-
|
|
4074
|
-
return null;
|
|
4345
|
+
function parseTransparency(rawValue) {
|
|
4346
|
+
const normalizedValue = rawValue.trim().replace(/%$/, "").trim();
|
|
4347
|
+
if (normalizedValue === "") return null;
|
|
4348
|
+
const parsedValue = Number(normalizedValue);
|
|
4349
|
+
return Number.isFinite(parsedValue) ? normalizeTransparency$1(parsedValue) : null;
|
|
4350
|
+
}
|
|
4351
|
+
function normalizeTransparency$1(value) {
|
|
4352
|
+
return Math.min(Math.max(Math.round(value), MIN_TRANSPARENCY), MAX_TRANSPARENCY);
|
|
4353
|
+
}
|
|
4354
|
+
|
|
4355
|
+
//#endregion
|
|
4356
|
+
//#region src/views/sheet-image-panel/SheetImageTransparency.tsx
|
|
4357
|
+
const IMAGE_TRANSPARENCY_PRESETS = [
|
|
4358
|
+
0,
|
|
4359
|
+
15,
|
|
4360
|
+
30,
|
|
4361
|
+
50,
|
|
4362
|
+
65,
|
|
4363
|
+
80
|
|
4364
|
+
];
|
|
4365
|
+
const SheetImageTransparency = ({ drawings }) => {
|
|
4366
|
+
const commandService = useDependency(ICommandService);
|
|
4367
|
+
const localeService = useDependency(LocaleService);
|
|
4368
|
+
const sheetDrawingService = useDependency(ISheetDrawingService);
|
|
4369
|
+
const drawingParam = isSheetDrawing(drawings[0]) ? drawings[0] : void 0;
|
|
4370
|
+
const currentDrawing = drawingParam ? sheetDrawingService.getDrawingByParam(drawingParam) ?? drawingParam : void 0;
|
|
4371
|
+
const image = (currentDrawing === null || currentDrawing === void 0 ? void 0 : currentDrawing.drawingType) === DrawingTypeEnum.DRAWING_IMAGE ? currentDrawing : void 0;
|
|
4372
|
+
const modelOpacity = normalizeImageOpacity(image === null || image === void 0 ? void 0 : image.opacity);
|
|
4373
|
+
const modelTransparency = Math.round((1 - modelOpacity) * 100);
|
|
4374
|
+
const [previewState, setPreviewState] = useState(null);
|
|
4375
|
+
const previewPendingRef = useRef(false);
|
|
4376
|
+
const [, setModelRevision] = useState(0);
|
|
4377
|
+
const transparency = image && (previewState === null || previewState === void 0 ? void 0 : previewState.unitId) === image.unitId && previewState.subUnitId === image.subUnitId && previewState.drawingId === image.drawingId ? previewState.transparency : modelTransparency;
|
|
4378
|
+
useEffect(() => {
|
|
4379
|
+
if (!drawingParam) return;
|
|
4380
|
+
const subscription = sheetDrawingService.update$.subscribe((updatedDrawings) => {
|
|
4381
|
+
if (updatedDrawings.some((updatedDrawing) => updatedDrawing.unitId === drawingParam.unitId && updatedDrawing.subUnitId === drawingParam.subUnitId && updatedDrawing.drawingId === drawingParam.drawingId)) setModelRevision((revision) => revision + 1);
|
|
4382
|
+
});
|
|
4383
|
+
return () => subscription.unsubscribe();
|
|
4384
|
+
}, [drawingParam, sheetDrawingService]);
|
|
4385
|
+
useEffect(() => {
|
|
4386
|
+
previewPendingRef.current = false;
|
|
4387
|
+
return () => {
|
|
4388
|
+
if (!previewPendingRef.current || !image) return;
|
|
4389
|
+
commandService.syncExecuteCommand(PreviewSheetImageOpacityOperation.id, {
|
|
4390
|
+
unitId: image.unitId,
|
|
4391
|
+
subUnitId: image.subUnitId,
|
|
4392
|
+
drawingId: image.drawingId,
|
|
4393
|
+
opacity: modelOpacity
|
|
4394
|
+
});
|
|
4395
|
+
};
|
|
4396
|
+
}, [
|
|
4397
|
+
commandService,
|
|
4398
|
+
image,
|
|
4399
|
+
modelOpacity,
|
|
4400
|
+
modelTransparency
|
|
4401
|
+
]);
|
|
4402
|
+
if (!image) return null;
|
|
4403
|
+
const title = localeService.t("sheets-drawing-ui.image-transparency.title");
|
|
4404
|
+
const { unitId, subUnitId, drawingId } = image;
|
|
4405
|
+
function previewTransparency(nextTransparency) {
|
|
4406
|
+
const normalizedTransparency = normalizeTransparency(nextTransparency);
|
|
4407
|
+
const opacity = transparencyToOpacity(normalizedTransparency);
|
|
4408
|
+
previewPendingRef.current = true;
|
|
4409
|
+
setPreviewState({
|
|
4410
|
+
unitId,
|
|
4411
|
+
subUnitId,
|
|
4412
|
+
drawingId,
|
|
4413
|
+
transparency: normalizedTransparency
|
|
4414
|
+
});
|
|
4415
|
+
commandService.syncExecuteCommand(PreviewSheetImageOpacityOperation.id, {
|
|
4416
|
+
unitId,
|
|
4417
|
+
subUnitId,
|
|
4418
|
+
drawingId,
|
|
4419
|
+
opacity
|
|
4420
|
+
});
|
|
4421
|
+
}
|
|
4422
|
+
function commitTransparency(nextTransparency) {
|
|
4423
|
+
const opacity = transparencyToOpacity(normalizeTransparency(nextTransparency));
|
|
4424
|
+
previewPendingRef.current = false;
|
|
4425
|
+
setPreviewState(null);
|
|
4426
|
+
if (opacity === modelOpacity) return;
|
|
4427
|
+
if (!commandService.syncExecuteCommand(SetSheetDrawingCommand.id, {
|
|
4428
|
+
unitId,
|
|
4429
|
+
drawings: [{
|
|
4430
|
+
unitId,
|
|
4431
|
+
subUnitId,
|
|
4432
|
+
drawingId,
|
|
4433
|
+
opacity
|
|
4434
|
+
}]
|
|
4435
|
+
})) commandService.syncExecuteCommand(PreviewSheetImageOpacityOperation.id, {
|
|
4436
|
+
unitId,
|
|
4437
|
+
subUnitId,
|
|
4438
|
+
drawingId,
|
|
4439
|
+
opacity: modelOpacity
|
|
4440
|
+
});
|
|
4441
|
+
}
|
|
4442
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
4443
|
+
className: "univer-grid univer-gap-2 univer-py-2 univer-text-gray-400",
|
|
4444
|
+
children: [/* @__PURE__ */ jsx("header", {
|
|
4445
|
+
className: "univer-text-gray-600 dark:!univer-text-gray-200",
|
|
4446
|
+
children: title
|
|
4447
|
+
}), /* @__PURE__ */ jsx(SheetImageTransparencySlider, {
|
|
4448
|
+
value: transparency,
|
|
4449
|
+
shortcuts: IMAGE_TRANSPARENCY_PRESETS,
|
|
4450
|
+
ariaLabel: title,
|
|
4451
|
+
onChange: previewTransparency,
|
|
4452
|
+
onChangeComplete: commitTransparency
|
|
4453
|
+
})]
|
|
4454
|
+
});
|
|
4455
|
+
};
|
|
4456
|
+
function normalizeTransparency(transparency) {
|
|
4457
|
+
if (!Number.isFinite(transparency)) return 0;
|
|
4458
|
+
return Math.min(Math.max(Math.round(transparency), 0), 100);
|
|
4459
|
+
}
|
|
4460
|
+
function transparencyToOpacity(transparency) {
|
|
4461
|
+
return (100 - transparency) / 100;
|
|
4075
4462
|
}
|
|
4076
4463
|
|
|
4077
4464
|
//#endregion
|
|
@@ -4096,7 +4483,11 @@ const SheetDrawingPanel = () => {
|
|
|
4096
4483
|
const drawings = useObservable(() => drawingManagerService.focus$, drawingManagerService.getFocusDrawings(), false, [drawingManagerService]);
|
|
4097
4484
|
return !!(drawings === null || drawings === void 0 ? void 0 : drawings.length) && /* @__PURE__ */ jsxs("div", {
|
|
4098
4485
|
className: "univer-text-sm",
|
|
4099
|
-
children: [
|
|
4486
|
+
children: [
|
|
4487
|
+
/* @__PURE__ */ jsx(DrawingCommonPanel, { drawings }),
|
|
4488
|
+
/* @__PURE__ */ jsx(SheetImageTransparency, { drawings }),
|
|
4489
|
+
/* @__PURE__ */ jsx(SheetDrawingAnchor, { drawings })
|
|
4490
|
+
]
|
|
4100
4491
|
});
|
|
4101
4492
|
};
|
|
4102
4493
|
|
|
@@ -4514,8 +4905,26 @@ let SheetDrawingActiveRenderController = class SheetDrawingActiveRenderControlle
|
|
|
4514
4905
|
this._sheetSkeletonService = _sheetSkeletonService;
|
|
4515
4906
|
this._sheetDrawingService = _sheetDrawingService;
|
|
4516
4907
|
this._drawingManagerService = _drawingManagerService;
|
|
4908
|
+
_defineProperty(this, "_renderTimeout", void 0);
|
|
4517
4909
|
this._commandListener();
|
|
4518
4910
|
}
|
|
4911
|
+
dispose() {
|
|
4912
|
+
this._cancelPendingRender();
|
|
4913
|
+
super.dispose();
|
|
4914
|
+
}
|
|
4915
|
+
_cancelPendingRender() {
|
|
4916
|
+
if (this._renderTimeout !== void 0) {
|
|
4917
|
+
clearTimeout(this._renderTimeout);
|
|
4918
|
+
this._renderTimeout = void 0;
|
|
4919
|
+
}
|
|
4920
|
+
}
|
|
4921
|
+
_scheduleRender(callback) {
|
|
4922
|
+
this._cancelPendingRender();
|
|
4923
|
+
this._renderTimeout = setTimeout(() => {
|
|
4924
|
+
this._renderTimeout = void 0;
|
|
4925
|
+
callback();
|
|
4926
|
+
}, 0);
|
|
4927
|
+
}
|
|
4519
4928
|
_commandListener() {
|
|
4520
4929
|
this.disposeWithMe(this._commandService.onCommandExecuted((command) => {
|
|
4521
4930
|
if (command.id === SetWorksheetActiveOperation.id) {
|
|
@@ -4530,7 +4939,7 @@ let SheetDrawingActiveRenderController = class SheetDrawingActiveRenderControlle
|
|
|
4530
4939
|
}));
|
|
4531
4940
|
}
|
|
4532
4941
|
_clearDrawings(selfUnitId) {
|
|
4533
|
-
|
|
4942
|
+
this._scheduleRender(() => {
|
|
4534
4943
|
const drawingMap = this._drawingManagerService.drawingManagerData;
|
|
4535
4944
|
const removeDrawings = [];
|
|
4536
4945
|
Object.keys(drawingMap ?? {}).forEach((unitId) => {
|
|
@@ -4548,10 +4957,11 @@ let SheetDrawingActiveRenderController = class SheetDrawingActiveRenderControlle
|
|
|
4548
4957
|
});
|
|
4549
4958
|
}
|
|
4550
4959
|
_updateDrawings(showUnitId, showSubunitId) {
|
|
4551
|
-
|
|
4960
|
+
this._scheduleRender(() => {
|
|
4552
4961
|
const sheetSkeletonParam = this._sheetSkeletonService.getSkeletonParam(showUnitId, showSubunitId);
|
|
4553
4962
|
const drawingMap = this._drawingManagerService.drawingManagerData;
|
|
4554
4963
|
const insertDrawings = [];
|
|
4964
|
+
const refreshedDrawings = [];
|
|
4555
4965
|
const removeDrawings = [];
|
|
4556
4966
|
Object.keys(drawingMap ?? {}).forEach((unitId) => {
|
|
4557
4967
|
if (unitId !== showUnitId) return;
|
|
@@ -4562,17 +4972,19 @@ let SheetDrawingActiveRenderController = class SheetDrawingActiveRenderControlle
|
|
|
4562
4972
|
Object.keys(drawingData).forEach((drawingId) => {
|
|
4563
4973
|
if (unitId === showUnitId && subUnitId === showSubunitId) {
|
|
4564
4974
|
const drawing = drawingData[drawingId];
|
|
4565
|
-
if (drawing.sheetTransform && drawing.anchorType !== SheetDrawingAnchorType.None) drawing
|
|
4975
|
+
if (sheetSkeletonParam && drawing.sheetTransform && drawing.anchorType !== SheetDrawingAnchorType.None) refreshedDrawings.push(applySheetDrawingPlacement(drawing, getSheetDrawingPlacement(drawing), sheetSkeletonParam.skeleton));
|
|
4566
4976
|
insertDrawings.push(drawingData[drawingId]);
|
|
4567
4977
|
} else removeDrawings.push(drawingData[drawingId]);
|
|
4568
4978
|
});
|
|
4569
4979
|
});
|
|
4570
4980
|
});
|
|
4981
|
+
this._sheetDrawingService.refreshTransform(refreshedDrawings);
|
|
4982
|
+
this._drawingManagerService.refreshTransform(refreshedDrawings);
|
|
4571
4983
|
this._sheetDrawingService.removeNotification(removeDrawings);
|
|
4572
4984
|
this._sheetDrawingService.addNotification(insertDrawings);
|
|
4573
4985
|
this._drawingManagerService.removeNotification(removeDrawings);
|
|
4574
4986
|
this._drawingManagerService.addNotification(insertDrawings);
|
|
4575
|
-
}
|
|
4987
|
+
});
|
|
4576
4988
|
}
|
|
4577
4989
|
};
|
|
4578
4990
|
SheetDrawingActiveRenderController = __decorate([
|
|
@@ -5632,7 +6044,8 @@ let SheetDrawingUIController = class SheetDrawingUIController extends Disposable
|
|
|
5632
6044
|
MoveDrawingsCommand,
|
|
5633
6045
|
DeleteDrawingsCommand,
|
|
5634
6046
|
SaveCellImagesCommand,
|
|
5635
|
-
FlipSheetDrawingCommand
|
|
6047
|
+
FlipSheetDrawingCommand,
|
|
6048
|
+
PreviewSheetImageOpacityOperation
|
|
5636
6049
|
].forEach((command) => this.disposeWithMe(this._commandService.registerCommand(command)));
|
|
5637
6050
|
}
|
|
5638
6051
|
_initShortcuts() {
|
package/lib/locale/ar-SA.js
CHANGED
|
@@ -39,6 +39,7 @@ const locale = { "sheets-drawing-ui": {
|
|
|
39
39
|
exceedMaxCount: "يمكن رفع {0} صور فقط في المرة الواحدة",
|
|
40
40
|
invalidImage: "صورة غير صالحة"
|
|
41
41
|
},
|
|
42
|
+
"image-transparency": { title: "الشفافية" },
|
|
42
43
|
"drawing-anchor": {
|
|
43
44
|
title: "خصائص المرساة",
|
|
44
45
|
both: "النقل والتحجيم مع الخلايا",
|
package/lib/locale/ca-ES.js
CHANGED
|
@@ -39,6 +39,7 @@ const locale = { "sheets-drawing-ui": {
|
|
|
39
39
|
exceedMaxCount: "Només es poden pujar {0} imatges alhora",
|
|
40
40
|
invalidImage: "Imatge no vàlida"
|
|
41
41
|
},
|
|
42
|
+
"image-transparency": { title: "Transparència" },
|
|
42
43
|
"drawing-anchor": {
|
|
43
44
|
title: "Propietats d’ancoratge",
|
|
44
45
|
both: "Mou i canvia la mida amb les cel·les",
|
package/lib/locale/de-DE.js
CHANGED
|
@@ -39,6 +39,7 @@ const locale = { "sheets-drawing-ui": {
|
|
|
39
39
|
exceedMaxCount: "Es können nur {0} Bilder gleichzeitig hochgeladen werden",
|
|
40
40
|
invalidImage: "Ungültiges Bild"
|
|
41
41
|
},
|
|
42
|
+
"image-transparency": { title: "Transparenz" },
|
|
42
43
|
"drawing-anchor": {
|
|
43
44
|
title: "Anker-Eigenschaften",
|
|
44
45
|
both: "Mit Zellen verschieben und skalieren",
|
package/lib/locale/en-US.js
CHANGED
|
@@ -54,6 +54,7 @@ const locale = { "sheets-drawing-ui": {
|
|
|
54
54
|
exceedMaxCount: "Only {0} images can be uploaded at a time",
|
|
55
55
|
invalidImage: "Invalid image"
|
|
56
56
|
},
|
|
57
|
+
"image-transparency": { title: "Transparency" },
|
|
57
58
|
"drawing-anchor": {
|
|
58
59
|
title: "Anchor Properties",
|
|
59
60
|
both: "Move and size with cells",
|
package/lib/locale/es-ES.js
CHANGED
|
@@ -39,6 +39,7 @@ const locale = { "sheets-drawing-ui": {
|
|
|
39
39
|
exceedMaxCount: "Solo se pueden subir {0} imágenes a la vez",
|
|
40
40
|
invalidImage: "Imagen no válida"
|
|
41
41
|
},
|
|
42
|
+
"image-transparency": { title: "Transparencia" },
|
|
42
43
|
"drawing-anchor": {
|
|
43
44
|
title: "Propiedades de anclaje",
|
|
44
45
|
both: "Mover y cambiar tamaño con las celdas",
|
package/lib/locale/fa-IR.js
CHANGED
|
@@ -39,6 +39,7 @@ const locale = { "sheets-drawing-ui": {
|
|
|
39
39
|
exceedMaxCount: "فقط {0} تصویر میتوانند همزمان آپلود شوند",
|
|
40
40
|
invalidImage: "تصویر نامعتبر است"
|
|
41
41
|
},
|
|
42
|
+
"image-transparency": { title: "شفافیت" },
|
|
42
43
|
"drawing-anchor": {
|
|
43
44
|
title: "خواص لنگر",
|
|
44
45
|
both: "جابهجایی و تغییر اندازه با سلولها",
|
package/lib/locale/fr-FR.js
CHANGED
|
@@ -39,6 +39,7 @@ const locale = { "sheets-drawing-ui": {
|
|
|
39
39
|
exceedMaxCount: "Seulement {0} images peuvent être téléchargées à la fois",
|
|
40
40
|
invalidImage: "Image invalide"
|
|
41
41
|
},
|
|
42
|
+
"image-transparency": { title: "Transparence" },
|
|
42
43
|
"drawing-anchor": {
|
|
43
44
|
title: "Propriétés de l'ancre",
|
|
44
45
|
both: "Déplacer et redimensionner avec les cellules",
|
package/lib/locale/id-ID.js
CHANGED
|
@@ -39,6 +39,7 @@ const locale = { "sheets-drawing-ui": {
|
|
|
39
39
|
exceedMaxCount: "Hanya {0} gambar yang dapat diunggah dalam satu waktu",
|
|
40
40
|
invalidImage: "Gambar tidak valid"
|
|
41
41
|
},
|
|
42
|
+
"image-transparency": { title: "Transparansi" },
|
|
42
43
|
"drawing-anchor": {
|
|
43
44
|
title: "Properti Jangkar",
|
|
44
45
|
both: "Pindah dan ukur bersama sel",
|
package/lib/locale/it-IT.js
CHANGED
|
@@ -39,6 +39,7 @@ const locale = { "sheets-drawing-ui": {
|
|
|
39
39
|
exceedMaxCount: "È possibile caricare solo {0} immagini alla volta",
|
|
40
40
|
invalidImage: "Immagine non valida"
|
|
41
41
|
},
|
|
42
|
+
"image-transparency": { title: "Trasparenza" },
|
|
42
43
|
"drawing-anchor": {
|
|
43
44
|
title: "Proprietà ancoraggio",
|
|
44
45
|
both: "Sposta e ridimensiona con le celle",
|
package/lib/locale/ja-JP.js
CHANGED
package/lib/locale/ko-KR.js
CHANGED
package/lib/locale/pl-PL.js
CHANGED
|
@@ -39,6 +39,7 @@ const locale = { "sheets-drawing-ui": {
|
|
|
39
39
|
exceedMaxCount: "Jednocześnie można przesłać tylko {0} obrazów",
|
|
40
40
|
invalidImage: "Nieprawidłowy obraz"
|
|
41
41
|
},
|
|
42
|
+
"image-transparency": { title: "Przezroczystość" },
|
|
42
43
|
"drawing-anchor": {
|
|
43
44
|
title: "Właściwości kotwicy",
|
|
44
45
|
both: "Przesuwaj i zmieniaj rozmiar razem z komórkami",
|
package/lib/locale/pt-BR.js
CHANGED
|
@@ -39,6 +39,7 @@ const locale = { "sheets-drawing-ui": {
|
|
|
39
39
|
exceedMaxCount: "Apenas {0} imagens podem ser enviadas de cada vez",
|
|
40
40
|
invalidImage: "Imagem inválida"
|
|
41
41
|
},
|
|
42
|
+
"image-transparency": { title: "Transparência" },
|
|
42
43
|
"drawing-anchor": {
|
|
43
44
|
title: "Propriedades da âncora",
|
|
44
45
|
both: "Mover e dimensionar com as células",
|