@univerjs/sheets-drawing-ui 0.6.0-nightly.202502051606 → 0.6.0-nightly.202502061605
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 +1 -1
- package/lib/es/index.js +79 -79
- package/lib/umd/index.js +1 -1
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var Mr = Object.defineProperty;
|
|
2
2
|
var yr = (i, e, n) => e in i ? Mr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
3
|
var z = (i, e, n) => yr(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { CommandType as Z, ICommandService as F, IUndoRedoService as Fe, sequenceExecute as Pn, LocaleService as
|
|
4
|
+
import { CommandType as Z, ICommandService as F, IUndoRedoService as Fe, sequenceExecute as Pn, LocaleService as xt, IUniverInstanceService as Ye, useDependency as ye, Inject as N, Injector as Qe, IContextService as Un, RxDisposable as Tr, UniverInstanceType as X, connectInjector as Or, toDisposable as Er, FOCUSING_COMMON_DRAWINGS as ke, DrawingTypeEnum as L, Disposable as oe, ArrangeTypeEnum as gt, createDocumentModelWithStyle as Pr, ObjectRelativeFromH as Ur, ObjectRelativeFromV as Ar, BooleanNumber as Nr, PositionedObjectLayoutType as jr, WrapTextType as Br, BuildTextUtils as Wr, Range as $r, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as mt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as ft, InterceptorEffectEnum as xr, ObjectMatrix as kr, Tools as Te, UserManagerService as Lr, IPermissionService as Fr, Rectangle as Yr, Direction as _e, FOCUSING_FX_BAR_EDITOR as Gr, EDITOR_ACTIVATED as Xr, FOCUSING_PANEL_EDITOR as Vr, LifecycleService as Hr, LifecycleStages as zr, DisposableCollection as pt, fromEventSubject as Kr, generateRandomId as Ht, DependentOn as Zr, Plugin as Jr, merge as qr, registerDependencies as Qr, touchDependencies as zt, IConfigService as ei } from "@univerjs/core";
|
|
5
5
|
import { DocDrawingController as ti, UniverDocsDrawingPlugin as ni } from "@univerjs/docs-drawing";
|
|
6
|
-
import { SetDrawingSelectedOperation as
|
|
6
|
+
import { SetDrawingSelectedOperation as kt, IImageIoService as An, IDrawingManagerService as te, DRAWING_IMAGE_ALLOW_IMAGE_LIST as pn, DRAWING_IMAGE_COUNT_LIMIT as wn, ImageUploadStatusType as je, DRAWING_IMAGE_ALLOW_SIZE as _n, getImageSize as vn, DRAWING_IMAGE_WIDTH_LIMIT as Sn, DRAWING_IMAGE_HEIGHT_LIMIT as In, ImageSourceType as ri, getDrawingShapeKeyByDrawingSearch as Ce, UniverDrawingPlugin as ii } from "@univerjs/drawing";
|
|
7
7
|
import { ImageCropperObject as si, COMPONENT_IMAGE_POPUP_MENU as oi, OpenImageCropOperation as ai, ImageResetSizeOperation as ci, DrawingRenderService as Nn, DrawingCommonPanel as di, UniverDrawingUIPlugin as li } from "@univerjs/drawing-ui";
|
|
8
8
|
import { IRenderManagerService as J, precisionTo as wt, getGroupState as ui, transformObjectOutOfGroup as hi, RENDER_CLASS_TYPE as Be, Rect as We, ObjectType as Cn, DRAWING_OBJECT_LAYER_INDEX as Kt, SHEET_VIEWPORT_KEY as jn } from "@univerjs/engine-render";
|
|
9
9
|
import { ISheetDrawingService as ne, SetDrawingApplyMutation as P, DrawingApplyType as U, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as gi } from "@univerjs/sheets-drawing";
|
|
10
|
-
import { SheetCanvasPopManagerService as mi, convertPositionSheetOverGridToAbsolute as fi, ISheetSelectionRenderService as Ge, SheetSkeletonManagerService as Y, attachRangeWithCoord as Bn, IEditorBridgeService as pi, IAutoFillService as wi, HoverManagerService as _i, PREDEFINED_HOOK_NAME as
|
|
10
|
+
import { SheetCanvasPopManagerService as mi, convertPositionSheetOverGridToAbsolute as fi, ISheetSelectionRenderService as Ge, SheetSkeletonManagerService as Y, attachRangeWithCoord as Bn, IEditorBridgeService as pi, IAutoFillService as wi, HoverManagerService as _i, PREDEFINED_HOOK_NAME as xe, COPY_TYPE as be, discreteRangeToRange as bn, virtualizeDiscreteRanges as vi, ISheetClipboardService as Si, SheetPrintInterceptorService as Ii, getCurrentRangeDisable$ as Ci, SetZoomRatioOperation as Rn, SetScrollOperation as bi } from "@univerjs/sheets-ui";
|
|
11
11
|
import { ISidebarService as Ri, IUIPartsService as Di, BuiltInUIPart as Mi, ILocalFileService as yi, IMessageService as Ti, IClipboardInterfaceService as Oi, MenuItemType as cn, getMenuHiddenObservable as Wn, RibbonStartGroup as Ei, KeyCode as Le, ComponentManager as Pi, IMenuManagerService as Ui, IShortcutService as Ai, CanvasFloatDomService as Ni } from "@univerjs/ui";
|
|
12
12
|
import { takeUntil as Dn, combineLatest as _t, map as Je, filter as ve, distinctUntilChanged as vt, Subject as Zt, take as ji, BehaviorSubject as He, switchMap as Mn } from "rxjs";
|
|
13
|
-
import { SheetInterceptorService as Lt, getSheetCommandTarget as G, SheetsSelectionsService as dn, SetRangeValuesCommand as Bi, SetWorksheetRowHeightMutation as $n, SetWorksheetColWidthMutation as
|
|
13
|
+
import { SheetInterceptorService as Lt, getSheetCommandTarget as G, SheetsSelectionsService as dn, SetRangeValuesCommand as Bi, SetWorksheetRowHeightMutation as $n, SetWorksheetColWidthMutation as xn, SetWorksheetRowIsAutoHeightMutation as Wi, SetWorksheetRowAutoHeightMutation as kn, AddWorksheetMergeMutation as $i, RemoveWorksheetMergeMutation as xi, AFTER_CELL_EDIT as ki, INTERCEPTOR_POINT as Li, InterceptCellContentPriority as Fi, WorkbookViewPermission as yn, WorksheetViewPermission as Jt, WorkbookEditablePermission as en, WorksheetEditPermission as yt, InsertRowCommand as Ln, InsertColCommand as Fn, RemoveRowCommand as Yn, RemoveColCommand as Gn, DeleteRangeMoveLeftCommand as Xn, DeleteRangeMoveUpCommand as Vn, InsertRangeMoveDownCommand as Hn, InsertRangeMoveRightCommand as zn, DeltaRowHeightCommand as tn, SetRowHeightCommand as nn, DeltaColumnWidthCommand as Kn, SetColWidthCommand as Zn, SetRowHiddenCommand as Jn, SetSpecificRowsVisibleCommand as qn, SetSpecificColsVisibleCommand as Qn, SetColHiddenCommand as er, MoveColsCommand as tr, MoveRowsCommand as nr, MoveRangeCommand as rr, SetRowVisibleMutation as Yi, SetRowHiddenMutation as Gi, SetColVisibleMutation as Xi, SetColHiddenMutation as Vi, SetWorksheetActiveOperation as Hi, RangeProtectionPermissionEditPoint as zi, SetFrozenMutation as Ki, COMMAND_LISTENER_SKELETON_CHANGE as Zi } from "@univerjs/sheets";
|
|
14
14
|
import { jsx as K, jsxs as Tt } from "react/jsx-runtime";
|
|
15
15
|
import Ji, { useEffect as ln, forwardRef as ir, useRef as qi, createElement as sr, useState as rn } from "react";
|
|
16
16
|
import { docDrawingPositionToTransform as Qi, ReplaceSnapshotCommand as es } from "@univerjs/docs-ui";
|
|
17
17
|
import { MessageType as Re, RadioGroup as ts, Radio as qt } from "@univerjs/design";
|
|
18
|
-
const ns = "sheets-drawing-ui.config", Tn = {},
|
|
18
|
+
const ns = "sheets-drawing-ui.config", Tn = {}, k = {
|
|
19
19
|
id: "sheet.operation.clear-drawing-transformer",
|
|
20
20
|
type: Z.MUTATION,
|
|
21
21
|
handler: (i, e) => {
|
|
@@ -44,13 +44,13 @@ const ns = "sheets-drawing-ui.config", Tn = {}, x = {
|
|
|
44
44
|
...(I = m.preUndos) != null ? I : [],
|
|
45
45
|
f,
|
|
46
46
|
...m.undos,
|
|
47
|
-
{ id:
|
|
47
|
+
{ id: k.id, params: c }
|
|
48
48
|
],
|
|
49
49
|
redoMutations: [
|
|
50
50
|
...(D = m.preRedos) != null ? D : [],
|
|
51
51
|
p,
|
|
52
52
|
...m.redos,
|
|
53
|
-
{ id:
|
|
53
|
+
{ id: k.id, params: c }
|
|
54
54
|
]
|
|
55
55
|
}), !0) : !1;
|
|
56
56
|
}
|
|
@@ -58,7 +58,7 @@ const ns = "sheets-drawing-ui.config", Tn = {}, x = {
|
|
|
58
58
|
id: "sidebar.operation.sheet-image",
|
|
59
59
|
type: Z.COMMAND,
|
|
60
60
|
handler: async (i, e) => {
|
|
61
|
-
const n = i.get(Ri), t = i.get(
|
|
61
|
+
const n = i.get(Ri), t = i.get(xt), r = i.get(Ye), s = i.get(F);
|
|
62
62
|
if (!G(r)) return !1;
|
|
63
63
|
switch (e.value) {
|
|
64
64
|
case "open":
|
|
@@ -66,7 +66,7 @@ const ns = "sheets-drawing-ui.config", Tn = {}, x = {
|
|
|
66
66
|
header: { title: t.t("sheetImage.panel.title") },
|
|
67
67
|
children: { label: or },
|
|
68
68
|
onClose: () => {
|
|
69
|
-
s.syncExecuteCommand(
|
|
69
|
+
s.syncExecuteCommand(kt.id, []);
|
|
70
70
|
},
|
|
71
71
|
width: 360
|
|
72
72
|
});
|
|
@@ -83,7 +83,7 @@ const ns = "sheets-drawing-ui.config", Tn = {}, x = {
|
|
|
83
83
|
type: Z.OPERATION,
|
|
84
84
|
handler: (i, e) => {
|
|
85
85
|
const n = i.get(F);
|
|
86
|
-
return e == null ? !1 : (n.syncExecuteCommand(
|
|
86
|
+
return e == null ? !1 : (n.syncExecuteCommand(kt.id, [e]), n.executeCommand(ar.id, { value: "open" }), !0);
|
|
87
87
|
}
|
|
88
88
|
}, rs = "univer-upload-loading", is = "univer-upload-loading-body", ss = "univer-upload-loading-body-animation", os = "univer-UniverCircleAnimation", as = "univer-upload-loading-body-text", St = {
|
|
89
89
|
uploadLoading: rs,
|
|
@@ -92,7 +92,7 @@ const ns = "sheets-drawing-ui.config", Tn = {}, x = {
|
|
|
92
92
|
univerCircleAnimation: os,
|
|
93
93
|
uploadLoadingBodyText: as
|
|
94
94
|
}, cs = () => {
|
|
95
|
-
const i = ye(An), e = ye(
|
|
95
|
+
const i = ye(An), e = ye(xt), [n, t] = Ji.useState(0);
|
|
96
96
|
return ln(() => {
|
|
97
97
|
const r = i.change$.subscribe((s) => {
|
|
98
98
|
t(s);
|
|
@@ -148,7 +148,7 @@ let Ot = class extends Tr {
|
|
|
148
148
|
this.disposeWithMe(
|
|
149
149
|
Er(
|
|
150
150
|
t.createControl$.subscribe(() => {
|
|
151
|
-
if (this._contextService.setContextValue(
|
|
151
|
+
if (this._contextService.setContextValue(ke, !0), this._hasCropObject(n))
|
|
152
152
|
return;
|
|
153
153
|
const o = t.getSelectedObjectMap();
|
|
154
154
|
if (o.size > 1) {
|
|
@@ -178,11 +178,11 @@ let Ot = class extends Tr {
|
|
|
178
178
|
)
|
|
179
179
|
), this.disposeWithMe(
|
|
180
180
|
t.clearControl$.subscribe(() => {
|
|
181
|
-
r == null || r.dispose(), this._contextService.setContextValue(
|
|
181
|
+
r == null || r.dispose(), this._contextService.setContextValue(ke, !1), this._commandService.syncExecuteCommand(kt.id, []);
|
|
182
182
|
})
|
|
183
183
|
), this.disposeWithMe(
|
|
184
184
|
this._contextService.contextChanged$.subscribe((o) => {
|
|
185
|
-
o[
|
|
185
|
+
o[ke] === !1 && (r == null || r.dispose());
|
|
186
186
|
})
|
|
187
187
|
), this.disposeWithMe(
|
|
188
188
|
t.changing$.subscribe(() => {
|
|
@@ -393,11 +393,11 @@ const dr = {
|
|
|
393
393
|
unitID: c,
|
|
394
394
|
undoMutations: [
|
|
395
395
|
{ id: P.id, params: { op: g, unitId: c, subUnitId: a, objects: ps(l), type: U.UNGROUP } },
|
|
396
|
-
{ id:
|
|
396
|
+
{ id: k.id, params: s }
|
|
397
397
|
],
|
|
398
398
|
redoMutations: [
|
|
399
399
|
{ id: P.id, params: { op: d, unitId: c, subUnitId: a, objects: l, type: U.GROUP } },
|
|
400
|
-
{ id:
|
|
400
|
+
{ id: k.id, params: s }
|
|
401
401
|
]
|
|
402
402
|
}), !0) : !1;
|
|
403
403
|
}
|
|
@@ -415,13 +415,13 @@ const dr = {
|
|
|
415
415
|
...(I = m.preUndos) != null ? I : [],
|
|
416
416
|
f,
|
|
417
417
|
...m.undos,
|
|
418
|
-
{ id:
|
|
418
|
+
{ id: k.id, params: c }
|
|
419
419
|
],
|
|
420
420
|
redoMutations: [
|
|
421
421
|
...(D = m.preRedos) != null ? D : [],
|
|
422
422
|
p,
|
|
423
423
|
...m.redos,
|
|
424
|
-
{ id:
|
|
424
|
+
{ id: k.id, params: c }
|
|
425
425
|
]
|
|
426
426
|
}), !0) : !1;
|
|
427
427
|
}
|
|
@@ -457,11 +457,11 @@ const dr = {
|
|
|
457
457
|
unitID: c,
|
|
458
458
|
undoMutations: [
|
|
459
459
|
{ id: P.id, params: { unitId: c, subUnitId: a, op: g, objects: l, type: U.UPDATE } },
|
|
460
|
-
{ id:
|
|
460
|
+
{ id: k.id, params: [c] }
|
|
461
461
|
],
|
|
462
462
|
redoMutations: [
|
|
463
463
|
{ id: P.id, params: { unitId: c, subUnitId: a, op: d, objects: l, type: U.UPDATE } },
|
|
464
|
-
{ id:
|
|
464
|
+
{ id: k.id, params: [c] }
|
|
465
465
|
]
|
|
466
466
|
}), !0) : !1;
|
|
467
467
|
}
|
|
@@ -482,11 +482,11 @@ const dr = {
|
|
|
482
482
|
unitID: c,
|
|
483
483
|
undoMutations: [
|
|
484
484
|
{ id: P.id, params: { op: g, unitId: c, subUnitId: a, objects: fs(l), type: U.GROUP } },
|
|
485
|
-
{ id:
|
|
485
|
+
{ id: k.id, params: s }
|
|
486
486
|
],
|
|
487
487
|
redoMutations: [
|
|
488
488
|
{ id: P.id, params: { op: d, unitId: c, subUnitId: a, objects: l, type: U.UNGROUP } },
|
|
489
|
-
{ id:
|
|
489
|
+
{ id: k.id, params: s }
|
|
490
490
|
]
|
|
491
491
|
}), !0) : !1;
|
|
492
492
|
}
|
|
@@ -505,7 +505,7 @@ function hr(i, e, n, t, r) {
|
|
|
505
505
|
const { rotatedHeight: s, rotatedWidth: o } = Ss(n, t, r), a = i.get(J).getRenderById(e.unitId);
|
|
506
506
|
if (!a)
|
|
507
507
|
return !1;
|
|
508
|
-
const d = (S = a.with(Y).
|
|
508
|
+
const d = (S = a.with(Y).getSkeletonParam(e.subUnitId)) == null ? void 0 : S.skeleton;
|
|
509
509
|
if (d == null)
|
|
510
510
|
return !1;
|
|
511
511
|
const l = d.getCellByIndex(e.row, e.col), h = l.mergeInfo.endX - l.mergeInfo.startX - 2, u = l.mergeInfo.endY - l.mergeInfo.startY - 2, m = o / s, f = Math.ceil(Math.min(h, u * m)) / o, w = !f || Number.isNaN(f) ? 1e-3 : f;
|
|
@@ -758,7 +758,7 @@ let qe = class extends oe {
|
|
|
758
758
|
this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
|
|
759
759
|
this._commandService.executeCommand(dr.id, e);
|
|
760
760
|
const { unitId: n, subUnitId: t, drawingId: r } = e[0].parent;
|
|
761
|
-
this._commandService.syncExecuteCommand(
|
|
761
|
+
this._commandService.syncExecuteCommand(kt.id, [{ unitId: n, subUnitId: t, drawingId: r }]);
|
|
762
762
|
})), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
|
|
763
763
|
this._commandService.executeCommand(ur.id, e);
|
|
764
764
|
}));
|
|
@@ -766,7 +766,7 @@ let qe = class extends oe {
|
|
|
766
766
|
_focusDrawingListener() {
|
|
767
767
|
this.disposeWithMe(
|
|
768
768
|
this._drawingManagerService.focus$.subscribe((e) => {
|
|
769
|
-
e == null || e.length === 0 ? (this._contextService.setContextValue(
|
|
769
|
+
e == null || e.length === 0 ? (this._contextService.setContextValue(ke, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(ke, !0), this._sheetDrawingService.focusDrawing(e));
|
|
770
770
|
})
|
|
771
771
|
);
|
|
772
772
|
}
|
|
@@ -781,7 +781,7 @@ qe = vs([
|
|
|
781
781
|
Q(7, te),
|
|
782
782
|
Q(8, Un),
|
|
783
783
|
Q(9, Ti),
|
|
784
|
-
Q(10, N(
|
|
784
|
+
Q(10, N(xt)),
|
|
785
785
|
Q(11, N(dn)),
|
|
786
786
|
Q(12, N(Qe))
|
|
787
787
|
], qe);
|
|
@@ -820,13 +820,13 @@ let Et = class extends oe {
|
|
|
820
820
|
if (i.id === $n.id) {
|
|
821
821
|
const t = i.params;
|
|
822
822
|
n = t.ranges, e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
823
|
-
} else if (i.id ===
|
|
823
|
+
} else if (i.id === xn.id) {
|
|
824
824
|
const t = i.params;
|
|
825
825
|
n = t.ranges, e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
826
826
|
} else if (i.id === Wi.id) {
|
|
827
827
|
const t = i.params;
|
|
828
828
|
n = t.ranges, e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
829
|
-
} else if (i.id ===
|
|
829
|
+
} else if (i.id === kn.id) {
|
|
830
830
|
const t = i.params;
|
|
831
831
|
e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId }), n = t.rowsAutoHeightInfo.map((r) => ({
|
|
832
832
|
startRow: r.row,
|
|
@@ -837,7 +837,7 @@ let Et = class extends oe {
|
|
|
837
837
|
} else if (i.id === $i.id) {
|
|
838
838
|
const t = i.params;
|
|
839
839
|
n = t.ranges, e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
840
|
-
} else if (i.id ===
|
|
840
|
+
} else if (i.id === xi.id) {
|
|
841
841
|
const t = i.params;
|
|
842
842
|
n = t.ranges, e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
843
843
|
}
|
|
@@ -857,7 +857,7 @@ let Et = class extends oe {
|
|
|
857
857
|
}));
|
|
858
858
|
}
|
|
859
859
|
_handleWriteCell() {
|
|
860
|
-
this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
860
|
+
this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(ki, {
|
|
861
861
|
priority: 9999,
|
|
862
862
|
handler: (i, e, n) => (on(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: e.row, col: e.col }, i), n(i))
|
|
863
863
|
}));
|
|
@@ -867,7 +867,7 @@ let Et = class extends oe {
|
|
|
867
867
|
this._sheetInterceptorService.intercept(
|
|
868
868
|
Li.CELL_CONTENT,
|
|
869
869
|
{
|
|
870
|
-
effect:
|
|
870
|
+
effect: xr.Style,
|
|
871
871
|
priority: Fi.CELL_IMAGE,
|
|
872
872
|
handler: (i, e, n) => {
|
|
873
873
|
var t;
|
|
@@ -901,7 +901,7 @@ let Pt = class extends oe {
|
|
|
901
901
|
this._autoFillService.addHook({
|
|
902
902
|
id: "sheet-cell-image-autofill",
|
|
903
903
|
onBeforeSubmit: (i, e, n, t) => {
|
|
904
|
-
new
|
|
904
|
+
new kr(t).forValue((r, s, o) => {
|
|
905
905
|
on(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
|
|
906
906
|
});
|
|
907
907
|
}
|
|
@@ -987,10 +987,10 @@ function js() {
|
|
|
987
987
|
};
|
|
988
988
|
}
|
|
989
989
|
const En = [
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
990
|
+
xe.SPECIAL_PASTE_COL_WIDTH,
|
|
991
|
+
xe.SPECIAL_PASTE_VALUE,
|
|
992
|
+
xe.SPECIAL_PASTE_FORMAT,
|
|
993
|
+
xe.SPECIAL_PASTE_FORMULA
|
|
994
994
|
];
|
|
995
995
|
let At = class extends oe {
|
|
996
996
|
constructor(e, n, t, r, s) {
|
|
@@ -1038,10 +1038,10 @@ let At = class extends oe {
|
|
|
1038
1038
|
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: g, subUnitId: d, pasteRange: a }, { copyRange: c, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: n, pasteType: o }, be.COPY);
|
|
1039
1039
|
},
|
|
1040
1040
|
onPastePlainText: (e, n) => ({ undos: [], redos: [] }),
|
|
1041
|
-
onPasteUnrecognized: (e) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType:
|
|
1041
|
+
onPasteUnrecognized: (e) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: xe.DEFAULT_PASTE }, be.COPY) : { undos: [], redos: [] },
|
|
1042
1042
|
onPasteFiles: (e, n) => {
|
|
1043
1043
|
if (this._copyInfo)
|
|
1044
|
-
return this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType:
|
|
1044
|
+
return this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: xe.DEFAULT_PASTE }, be.COPY);
|
|
1045
1045
|
{
|
|
1046
1046
|
const t = n.filter((r) => r.type.includes("image"));
|
|
1047
1047
|
if (t.length)
|
|
@@ -1396,10 +1396,10 @@ Nt = $s([
|
|
|
1396
1396
|
Ke(3, Ye),
|
|
1397
1397
|
Ke(4, N(Lr))
|
|
1398
1398
|
], Nt);
|
|
1399
|
-
var
|
|
1400
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1399
|
+
var xs = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, Ls = (i, e, n, t) => {
|
|
1400
|
+
for (var r = t > 1 ? void 0 : t ? ks(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1401
1401
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1402
|
-
return t && r &&
|
|
1402
|
+
return t && r && xs(e, n, r), r;
|
|
1403
1403
|
}, bt = (i, e) => (n, t) => e(n, t, i);
|
|
1404
1404
|
let jt = class extends oe {
|
|
1405
1405
|
constructor(i, e, n, t) {
|
|
@@ -1426,7 +1426,7 @@ let jt = class extends oe {
|
|
|
1426
1426
|
const { unitId: t, subUnitId: r } = e, s = this._renderManagerService.getRenderById(t);
|
|
1427
1427
|
if (!s)
|
|
1428
1428
|
return n(i);
|
|
1429
|
-
const o = s.with(Y).
|
|
1429
|
+
const o = s.with(Y).getSkeletonParam(r);
|
|
1430
1430
|
if (!o)
|
|
1431
1431
|
return n(i);
|
|
1432
1432
|
const c = this._drawingManagerService.getDrawingDataForUnit(t), a = c == null ? void 0 : c[e.subUnitId];
|
|
@@ -1482,7 +1482,7 @@ const Xs = [
|
|
|
1482
1482
|
Xi.id,
|
|
1483
1483
|
Vi.id,
|
|
1484
1484
|
$n.id,
|
|
1485
|
-
|
|
1485
|
+
xn.id
|
|
1486
1486
|
];
|
|
1487
1487
|
let an = class extends oe {
|
|
1488
1488
|
constructor(i, e, n, t, r, s, o, c, a) {
|
|
@@ -1568,7 +1568,7 @@ let an = class extends oe {
|
|
|
1568
1568
|
const d = this._sheetDrawingService.getBatchRemoveOp(g), l = d.undo, h = d.redo, u = d.objects;
|
|
1569
1569
|
s.push({ id: P.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: t, subUnitId: r, op: l, objects: u, type: U.INSERT } });
|
|
1570
1570
|
}
|
|
1571
|
-
return s.push({ id:
|
|
1571
|
+
return s.push({ id: k.id, params: [t] }), o.push({ id: k.id, params: [t] }), {
|
|
1572
1572
|
redos: s,
|
|
1573
1573
|
undos: o
|
|
1574
1574
|
};
|
|
@@ -1632,10 +1632,10 @@ let an = class extends oe {
|
|
|
1632
1632
|
if (m === O.Position) {
|
|
1633
1633
|
let R = null, T = null;
|
|
1634
1634
|
if (S >= M && S <= y) {
|
|
1635
|
-
const
|
|
1636
|
-
if (
|
|
1635
|
+
const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: y, startRow: p.row, endRow: f.row });
|
|
1636
|
+
if (x == null)
|
|
1637
1637
|
return;
|
|
1638
|
-
T = { ...u, left:
|
|
1638
|
+
T = { ...u, left: x.startX };
|
|
1639
1639
|
}
|
|
1640
1640
|
if (T != null && (R = $(T, this._selectionRenderService), R != null && T != null)) {
|
|
1641
1641
|
r.push({ ...l, sheetTransform: R, transform: T });
|
|
@@ -1700,10 +1700,10 @@ let an = class extends oe {
|
|
|
1700
1700
|
_createUndoAndRedoMutation(i, e, n) {
|
|
1701
1701
|
const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, c = [
|
|
1702
1702
|
{ id: P.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: U.UPDATE } },
|
|
1703
|
-
{ id:
|
|
1703
|
+
{ id: k.id, params: [i] }
|
|
1704
1704
|
], a = [
|
|
1705
1705
|
{ id: P.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type: U.UPDATE } },
|
|
1706
|
-
{ id:
|
|
1706
|
+
{ id: k.id, params: [i] }
|
|
1707
1707
|
];
|
|
1708
1708
|
return {
|
|
1709
1709
|
redos: c,
|
|
@@ -1726,10 +1726,10 @@ let an = class extends oe {
|
|
|
1726
1726
|
if (m === O.Position) {
|
|
1727
1727
|
let R = null, T = null;
|
|
1728
1728
|
if (w >= _ && w <= E) {
|
|
1729
|
-
const
|
|
1730
|
-
if (
|
|
1729
|
+
const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: E });
|
|
1730
|
+
if (x == null)
|
|
1731
1731
|
return;
|
|
1732
|
-
T = { ...u, top:
|
|
1732
|
+
T = { ...u, top: x.startY };
|
|
1733
1733
|
}
|
|
1734
1734
|
if (T != null && (R = $(T, this._selectionRenderService), R != null && T != null)) {
|
|
1735
1735
|
r.push({ ...l, sheetTransform: R, transform: T });
|
|
@@ -1854,13 +1854,13 @@ let an = class extends oe {
|
|
|
1854
1854
|
const { transform: _ } = C;
|
|
1855
1855
|
if (!_)
|
|
1856
1856
|
return;
|
|
1857
|
-
const { left: E = 0, top: M = 0, width: y = 0, height: A = 0 } = _, { drawingStartX: b, drawingEndX: R, drawingStartY: T, drawingEndY:
|
|
1857
|
+
const { left: E = 0, top: M = 0, width: y = 0, height: A = 0 } = _, { drawingStartX: b, drawingEndX: R, drawingStartY: T, drawingEndY: x } = {
|
|
1858
1858
|
drawingStartX: E,
|
|
1859
1859
|
drawingEndX: E + y,
|
|
1860
1860
|
drawingStartY: M,
|
|
1861
1861
|
drawingEndY: M + A
|
|
1862
1862
|
};
|
|
1863
|
-
a <= b && R <= g && d <= T &&
|
|
1863
|
+
a <= b && R <= g && d <= T && x <= l && u.push(C);
|
|
1864
1864
|
});
|
|
1865
1865
|
const m = [], p = [], f = e.startRow - n.startRow, w = e.startColumn - n.startColumn, S = u.map((v) => {
|
|
1866
1866
|
const C = v.sheetTransform, _ = {
|
|
@@ -1917,7 +1917,7 @@ let an = class extends oe {
|
|
|
1917
1917
|
const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, p = u.redo, f = u.objects;
|
|
1918
1918
|
a.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.INSERT } });
|
|
1919
1919
|
}
|
|
1920
|
-
return a.push({ id:
|
|
1920
|
+
return a.push({ id: k.id, params: [t] }), g.push({ id: k.id, params: [t] }), {
|
|
1921
1921
|
redos: a,
|
|
1922
1922
|
undos: g
|
|
1923
1923
|
};
|
|
@@ -1958,7 +1958,7 @@ let an = class extends oe {
|
|
|
1958
1958
|
const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, p = u.redo, f = u.objects;
|
|
1959
1959
|
a.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.INSERT } });
|
|
1960
1960
|
}
|
|
1961
|
-
return a.push({ id:
|
|
1961
|
+
return a.push({ id: k.id, params: [t] }), g.push({ id: k.id, params: [t] }), { redos: a, undos: g };
|
|
1962
1962
|
}
|
|
1963
1963
|
_expandCol(i, e, n, t, r = O.Position) {
|
|
1964
1964
|
const s = t - n + 1, { from: o, to: c } = i, { column: a } = o, { column: g } = c;
|
|
@@ -2229,7 +2229,7 @@ let an = class extends oe {
|
|
|
2229
2229
|
break;
|
|
2230
2230
|
}
|
|
2231
2231
|
}
|
|
2232
|
-
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(
|
|
2232
|
+
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(k.id, [i]));
|
|
2233
2233
|
}
|
|
2234
2234
|
};
|
|
2235
2235
|
an = Gs([
|
|
@@ -2335,7 +2335,7 @@ const wr = {
|
|
|
2335
2335
|
return n.syncExecuteCommand(Yt.id, {
|
|
2336
2336
|
unitId: c,
|
|
2337
2337
|
drawings: a
|
|
2338
|
-
}) ? (n.syncExecuteCommand(
|
|
2338
|
+
}) ? (n.syncExecuteCommand(k.id, [c]), !0) : !1;
|
|
2339
2339
|
}
|
|
2340
2340
|
}, _r = "addition-and-subtraction-single", vr = "sheet.menu.image";
|
|
2341
2341
|
function qs(i) {
|
|
@@ -2395,7 +2395,7 @@ function Rt() {
|
|
|
2395
2395
|
}
|
|
2396
2396
|
const wo = (i) => {
|
|
2397
2397
|
var I;
|
|
2398
|
-
const e = ye(F), n = ye(
|
|
2398
|
+
const e = ye(F), n = ye(xt), t = ye(te), r = ye(J), { drawings: s } = i, o = s[0];
|
|
2399
2399
|
if (o == null)
|
|
2400
2400
|
return;
|
|
2401
2401
|
const { unitId: c } = o, a = r.getRenderById(c), g = a == null ? void 0 : a.scene;
|
|
@@ -2408,13 +2408,13 @@ const wo = (i) => {
|
|
|
2408
2408
|
const { oKey: E } = _, M = v.getDrawingOKey(E);
|
|
2409
2409
|
if (M == null)
|
|
2410
2410
|
return C.push(null), !0;
|
|
2411
|
-
const { unitId: y, subUnitId: A, drawingId: b, drawingType: R, anchorType: T, sheetTransform:
|
|
2411
|
+
const { unitId: y, subUnitId: A, drawingId: b, drawingType: R, anchorType: T, sheetTransform: x } = M;
|
|
2412
2412
|
C.push({
|
|
2413
2413
|
unitId: y,
|
|
2414
2414
|
subUnitId: A,
|
|
2415
2415
|
drawingId: b,
|
|
2416
2416
|
anchorType: T,
|
|
2417
|
-
sheetTransform:
|
|
2417
|
+
sheetTransform: x,
|
|
2418
2418
|
drawingType: R
|
|
2419
2419
|
});
|
|
2420
2420
|
}), C;
|
|
@@ -2492,7 +2492,7 @@ const wo = (i) => {
|
|
|
2492
2492
|
}
|
|
2493
2493
|
};
|
|
2494
2494
|
function nt(i) {
|
|
2495
|
-
return !i.getContextValue(Gr) && !i.getContextValue(Xr) && !i.getContextValue(Vr) && i.getContextValue(
|
|
2495
|
+
return !i.getContextValue(Gr) && !i.getContextValue(Xr) && !i.getContextValue(Vr) && i.getContextValue(ke);
|
|
2496
2496
|
}
|
|
2497
2497
|
const So = {
|
|
2498
2498
|
id: tt.id,
|
|
@@ -2567,7 +2567,7 @@ let Bt = class extends oe {
|
|
|
2567
2567
|
et,
|
|
2568
2568
|
Yt,
|
|
2569
2569
|
ar,
|
|
2570
|
-
|
|
2570
|
+
k,
|
|
2571
2571
|
cr,
|
|
2572
2572
|
dr,
|
|
2573
2573
|
ur,
|
|
@@ -2725,7 +2725,7 @@ let Wt = class extends oe {
|
|
|
2725
2725
|
const g = a.getActiveSheet().getSheetId();
|
|
2726
2726
|
if (!c || !o)
|
|
2727
2727
|
return;
|
|
2728
|
-
const d = (re = this._renderManagerService.getRenderById(t)) == null ? void 0 : re.with(Y).
|
|
2728
|
+
const d = (re = this._renderManagerService.getRenderById(t)) == null ? void 0 : re.with(Y).getSkeletonParam(r);
|
|
2729
2729
|
if (!d)
|
|
2730
2730
|
return;
|
|
2731
2731
|
const { transform: l, drawingType: h, data: u } = c;
|
|
@@ -2757,7 +2757,7 @@ let Wt = class extends oe {
|
|
|
2757
2757
|
}
|
|
2758
2758
|
const T = new We(y, b);
|
|
2759
2759
|
R && T.setObjectType(Cn.CHART), p.addObject(T, Kt), c.allowTransform !== !1 && p.attachTransformerTo(T);
|
|
2760
|
-
const
|
|
2760
|
+
const x = this._ensureMap(t, r), ae = new pt(), Se = ge(T, m.renderUnit, d.skeleton, o.worksheet), ce = new He(Se), Ie = {
|
|
2761
2761
|
dispose: ae,
|
|
2762
2762
|
rect: T,
|
|
2763
2763
|
position$: ce,
|
|
@@ -2780,7 +2780,7 @@ let Wt = class extends oe {
|
|
|
2780
2780
|
onWheel: (W) => {
|
|
2781
2781
|
f.dispatchEvent(new WheelEvent(W.type, W));
|
|
2782
2782
|
},
|
|
2783
|
-
props: (H = (ie =
|
|
2783
|
+
props: (H = (ie = x.get(s)) == null ? void 0 : ie.props) != null ? H : this._getFloatDomProps(s),
|
|
2784
2784
|
data: u,
|
|
2785
2785
|
unitId: t
|
|
2786
2786
|
});
|
|
@@ -2792,8 +2792,8 @@ let Wt = class extends oe {
|
|
|
2792
2792
|
});
|
|
2793
2793
|
ae.add(() => {
|
|
2794
2794
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
2795
|
-
}), de && ae.add(de), this._domLayerInfoMap.set(s, Ie),
|
|
2796
|
-
...
|
|
2795
|
+
}), de && ae.add(de), this._domLayerInfoMap.set(s, Ie), x.set(s, {
|
|
2796
|
+
...x.get(s)
|
|
2797
2797
|
});
|
|
2798
2798
|
});
|
|
2799
2799
|
})
|
|
@@ -2812,7 +2812,7 @@ let Wt = class extends oe {
|
|
|
2812
2812
|
_scrollUpdateListener() {
|
|
2813
2813
|
const e = (n, t) => {
|
|
2814
2814
|
var g;
|
|
2815
|
-
const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), c = G(this._univerInstanceService, { unitId: n, subUnitId: t }), a = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(Y).
|
|
2815
|
+
const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), c = G(this._univerInstanceService, { unitId: n, subUnitId: t }), a = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(Y).getSkeletonParam(t);
|
|
2816
2816
|
!r || !c || !a || o.forEach((d) => {
|
|
2817
2817
|
const l = this._domLayerInfoMap.get(d);
|
|
2818
2818
|
if (l) {
|
|
@@ -3005,11 +3005,11 @@ let Wt = class extends oe {
|
|
|
3005
3005
|
allowTransform: u
|
|
3006
3006
|
};
|
|
3007
3007
|
{
|
|
3008
|
-
const { unitId: b, subUnitId: R, drawingId: T } = C,
|
|
3008
|
+
const { unitId: b, subUnitId: R, drawingId: T } = C, x = G(this._univerInstanceService, { unitId: b, subUnitId: R }), ae = C, Se = this._univerInstanceService.getUnit(b, X.UNIVER_SHEET);
|
|
3009
3009
|
if (!Se)
|
|
3010
3010
|
return;
|
|
3011
3011
|
const ce = Se.getActiveSheet().getSheetId();
|
|
3012
|
-
if (!ae || !
|
|
3012
|
+
if (!ae || !x)
|
|
3013
3013
|
return;
|
|
3014
3014
|
const Ie = (E = this._renderManagerService.getRenderById(b)) == null ? void 0 : E.with(Y);
|
|
3015
3015
|
if (!Ie)
|
|
@@ -3057,7 +3057,7 @@ let Wt = class extends oe {
|
|
|
3057
3057
|
domAnchor: t,
|
|
3058
3058
|
unitId: b,
|
|
3059
3059
|
subUnitId: R
|
|
3060
|
-
}, lt = ge(se, W.renderUnit, de.skeleton,
|
|
3060
|
+
}, lt = ge(se, W.renderUnit, de.skeleton, x.worksheet, he), me = new He(lt);
|
|
3061
3061
|
he.position$ = me;
|
|
3062
3062
|
let B = {
|
|
3063
3063
|
position$: me,
|
|
@@ -3107,7 +3107,7 @@ let Wt = class extends oe {
|
|
|
3107
3107
|
width: (mn = t.width) != null ? mn : j.width,
|
|
3108
3108
|
height: (fn = t.height) != null ? fn : j.height,
|
|
3109
3109
|
zIndex: this._drawingManagerService.getDrawingOrder(b, R).length - 1
|
|
3110
|
-
}), Dr = ge(Rr, W.renderUnit, de.skeleton,
|
|
3110
|
+
}), Dr = ge(Rr, W.renderUnit, de.skeleton, x.worksheet, he);
|
|
3111
3111
|
me.next(Dr);
|
|
3112
3112
|
}));
|
|
3113
3113
|
const Ve = (A = this._renderManagerService.getRenderById(b)) == null ? void 0 : A.with(Y);
|
|
@@ -3115,7 +3115,7 @@ let Wt = class extends oe {
|
|
|
3115
3115
|
j && d.sheetId !== j.sheetId && this._removeDom(m, !0);
|
|
3116
3116
|
});
|
|
3117
3117
|
const ut = se.onTransformChange$.subscribeEvent(() => {
|
|
3118
|
-
const j = ge(se, W.renderUnit, de.skeleton,
|
|
3118
|
+
const j = ge(se, W.renderUnit, de.skeleton, x.worksheet, he);
|
|
3119
3119
|
me.next(
|
|
3120
3120
|
j
|
|
3121
3121
|
);
|
|
@@ -3175,10 +3175,10 @@ let Wt = class extends oe {
|
|
|
3175
3175
|
allowTransform: u
|
|
3176
3176
|
};
|
|
3177
3177
|
{
|
|
3178
|
-
const { unitId: y, subUnitId: A, drawingId: b } = D, R = G(this._univerInstanceService, { unitId: y, subUnitId: A }), T = D,
|
|
3179
|
-
if (!
|
|
3178
|
+
const { unitId: y, subUnitId: A, drawingId: b } = D, R = G(this._univerInstanceService, { unitId: y, subUnitId: A }), T = D, x = this._univerInstanceService.getUnit(y, X.UNIVER_SHEET);
|
|
3179
|
+
if (!x)
|
|
3180
3180
|
return;
|
|
3181
|
-
const ae =
|
|
3181
|
+
const ae = x.getActiveSheet().getSheetId();
|
|
3182
3182
|
if (!T || !R)
|
|
3183
3183
|
return;
|
|
3184
3184
|
const Se = (C = this._renderManagerService.getRenderById(y)) == null ? void 0 : C.with(Y);
|
|
@@ -3326,7 +3326,7 @@ let Wt = class extends oe {
|
|
|
3326
3326
|
c.next(f), g.next(w);
|
|
3327
3327
|
}, l = new pt();
|
|
3328
3328
|
l.add(n.engine.clientRect$.subscribe(() => d())), l.add(this._commandService.onCommandExecuted((f) => {
|
|
3329
|
-
if (f.id ===
|
|
3329
|
+
if (f.id === kn.id && f.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
|
|
3330
3330
|
d();
|
|
3331
3331
|
return;
|
|
3332
3332
|
}
|
|
@@ -3497,7 +3497,7 @@ $t = No([
|
|
|
3497
3497
|
Qt(3, ei)
|
|
3498
3498
|
], $t);
|
|
3499
3499
|
export {
|
|
3500
|
-
|
|
3500
|
+
k as ClearSheetDrawingTransformerOperation,
|
|
3501
3501
|
wr as DeleteDrawingsCommand,
|
|
3502
3502
|
cr as EditSheetDrawingOperation,
|
|
3503
3503
|
dr as GroupSheetDrawingCommand,
|