@univerjs/sheets-drawing-ui 0.4.0-alpha.1 → 0.4.0-alpha.2
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/es/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
5
|
-
import { CommandType, ICommandService, IUndoRedoService, LocaleService, IUniverInstanceService, useDependency, Inject, Injector, IContextService, RxDisposable, UniverInstanceType, connectInjector, toDisposable, FOCUSING_COMMON_DRAWINGS, Disposable, Direction, FOCUSING_FX_BAR_EDITOR, EDITOR_ACTIVATED, Tools, UserManagerService, IPermissionService, Rectangle,
|
|
5
|
+
import { CommandType, ICommandService, IUndoRedoService, LocaleService, IUniverInstanceService, useDependency, Inject, Injector, IContextService, RxDisposable, UniverInstanceType, connectInjector, toDisposable, FOCUSING_COMMON_DRAWINGS, Disposable, Direction, FOCUSING_FX_BAR_EDITOR, EDITOR_ACTIVATED, Tools, UserManagerService, IPermissionService, Rectangle, DisposableCollection, generateRandomId, DependentOn, Plugin, registerDependencies, touchDependencies, IConfigService } from "@univerjs/core";
|
|
6
6
|
import { IDrawingManagerService, IImageIoService, DrawingTypeEnum, ArrangeTypeEnum, DRAWING_IMAGE_ALLOW_IMAGE_LIST, DRAWING_IMAGE_COUNT_LIMIT, ImageUploadStatusType, DRAWING_IMAGE_ALLOW_SIZE, getImageSize, DRAWING_IMAGE_WIDTH_LIMIT, DRAWING_IMAGE_HEIGHT_LIMIT, getDrawingShapeKeyByDrawingSearch, UniverDrawingPlugin } from "@univerjs/drawing";
|
|
7
7
|
import { ImageCropperObject, COMPONENT_IMAGE_POPUP_MENU, OpenImageCropOperation, ImageResetSizeOperation, DrawingCommonPanel, DrawingRenderService, UniverDrawingUIPlugin } from "@univerjs/drawing-ui";
|
|
8
8
|
import { IRenderManagerService, precisionTo, getGroupState, transformObjectOutOfGroup, RENDER_CLASS_TYPE, Rect, DRAWING_OBJECT_LAYER_INDEX, SHEET_VIEWPORT_KEY } from "@univerjs/engine-render";
|
|
@@ -2228,7 +2228,7 @@ let SheetCanvasFloatDomManagerService = (_a9 = class extends Disposable {
|
|
|
2228
2228
|
if (!skeleton)
|
|
2229
2229
|
return;
|
|
2230
2230
|
const { transform, drawingType, data } = floatDomParam;
|
|
2231
|
-
if (drawingType !== DrawingTypeEnum
|
|
2231
|
+
if (drawingType !== DrawingTypeEnum.DRAWING_DOM && drawingType !== DrawingTypeEnum.DRAWING_CHART)
|
|
2232
2232
|
return;
|
|
2233
2233
|
const renderObject = this._getSceneAndTransformerByDrawingSearch(unitId);
|
|
2234
2234
|
if (renderObject == null)
|
|
@@ -2247,7 +2247,9 @@ let SheetCanvasFloatDomManagerService = (_a9 = class extends Disposable {
|
|
|
2247
2247
|
width,
|
|
2248
2248
|
height,
|
|
2249
2249
|
zIndex: this._drawingManagerService.getDrawingOrder(unitId, subUnitId).length - 1
|
|
2250
|
-
}
|
|
2250
|
+
};
|
|
2251
|
+
drawingType === DrawingTypeEnum.DRAWING_CHART && (imageConfig.fill = "white", imageConfig.rotateEnabled = !1);
|
|
2252
|
+
const rect = new Rect(rectShapeKey, imageConfig);
|
|
2251
2253
|
scene.addObject(rect, DRAWING_OBJECT_LAYER_INDEX), floatDomParam.allowTransform !== !1 && scene.attachTransformerTo(rect);
|
|
2252
2254
|
const map2 = this._ensureMap(unitId, subUnitId), disposableCollection = new DisposableCollection(), initPosition = calcPosition(rect, renderObject.renderObject, skeleton.skeleton, target.worksheet), position$ = new BehaviorSubject(initPosition), info = {
|
|
2253
2255
|
dispose: disposableCollection,
|
|
@@ -2351,7 +2353,7 @@ let SheetCanvasFloatDomManagerService = (_a9 = class extends Disposable {
|
|
|
2351
2353
|
this._drawingManagerService.update$.subscribe((params) => {
|
|
2352
2354
|
params.forEach((data) => {
|
|
2353
2355
|
const sheetDrawing = this._drawingManagerService.getDrawingByParam(data);
|
|
2354
|
-
if (!sheetDrawing || sheetDrawing.drawingType !== DrawingTypeEnum
|
|
2356
|
+
if (!sheetDrawing || sheetDrawing.drawingType !== DrawingTypeEnum.DRAWING_DOM && sheetDrawing.drawingType !== DrawingTypeEnum.DRAWING_CHART)
|
|
2355
2357
|
return;
|
|
2356
2358
|
const newValue = {
|
|
2357
2359
|
...sheetDrawing.transform
|
|
@@ -2385,7 +2387,7 @@ let SheetCanvasFloatDomManagerService = (_a9 = class extends Disposable {
|
|
|
2385
2387
|
unitId,
|
|
2386
2388
|
subUnitId,
|
|
2387
2389
|
drawingId: id,
|
|
2388
|
-
drawingType: DrawingTypeEnum
|
|
2390
|
+
drawingType: layer.type || DrawingTypeEnum.DRAWING_DOM,
|
|
2389
2391
|
componentKey,
|
|
2390
2392
|
sheetTransform,
|
|
2391
2393
|
transform: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IDisposable, IPosition, ITransformState, Serializable, Worksheet, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { IBoundRectNoAngle, Scene, SpreadsheetSkeleton, IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
-
import { IDrawingManagerService } from '@univerjs/drawing';
|
|
3
|
+
import { DrawingTypeEnum, IDrawingManagerService } from '@univerjs/drawing';
|
|
4
4
|
import { ISheetDrawingService } from '@univerjs/sheets-drawing';
|
|
5
5
|
import { CanvasFloatDomService } from '@univerjs/ui';
|
|
6
6
|
export interface ICanvasFloatDom {
|
|
@@ -29,6 +29,10 @@ export interface ICanvasFloatDom {
|
|
|
29
29
|
* data of component, will save to snapshot, json-like data
|
|
30
30
|
*/
|
|
31
31
|
data?: Serializable;
|
|
32
|
+
/**
|
|
33
|
+
* the float-dom type
|
|
34
|
+
*/
|
|
35
|
+
type?: DrawingTypeEnum;
|
|
32
36
|
}
|
|
33
37
|
export declare function transformBound2DOMBound(originBound: IBoundRectNoAngle, scene: Scene, skeleton: SpreadsheetSkeleton, worksheet: Worksheet): {
|
|
34
38
|
absolute: {
|