@univerjs/sheets-drawing-ui 0.2.1 → 0.2.3
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/README.md +16 -5
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +968 -1010
- package/lib/index.css +1 -1
- package/lib/locale/en-US.json +10 -0
- package/lib/locale/ru-RU.json +10 -0
- package/lib/locale/vi-VN.json +41 -0
- package/lib/locale/zh-CN.json +10 -0
- package/lib/locale/zh-TW.json +41 -0
- package/lib/types/basics/transform-position.d.ts +3 -3
- package/lib/types/controllers/sheet-drawing-copy-paste.controller.d.ts +4 -5
- package/lib/types/controllers/sheet-drawing-transform-affected.controller.d.ts +7 -9
- package/lib/types/controllers/sheet-drawing-update.controller.d.ts +7 -9
- package/lib/types/locale/vi-VN.d.ts +4 -0
- package/lib/types/locale/zh-CN.d.ts +10 -0
- package/lib/types/locale/zh-TW.d.ts +4 -0
- package/lib/types/plugin.d.ts +2 -0
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +2 -2
- package/lib/umd/index.js +1 -1
- package/package.json +20 -20
package/lib/es/index.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { Inject as W, Injector as
|
|
6
|
-
import { ImageCropperObject as
|
|
7
|
-
import { ISheetDrawingService as H, SetDrawingApplyMutation as
|
|
8
|
-
import { IDrawingManagerService as
|
|
9
|
-
import { IRenderManagerService as
|
|
10
|
-
import { SheetCanvasPopManagerService as
|
|
11
|
-
import { takeUntil as
|
|
12
|
-
import { ISidebarService as
|
|
13
|
-
import { useDependency as ee, connectInjector as
|
|
14
|
-
import { getSheetCommandTarget as
|
|
15
|
-
import L, { useEffect as
|
|
16
|
-
import { MessageType as
|
|
17
|
-
import
|
|
1
|
+
var Qt = Object.defineProperty;
|
|
2
|
+
var en = (i, e, n) => e in i ? Qt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var X = (i, e, n) => en(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CommandType as F, ICommandService as V, IUndoRedoService as ge, LocaleService as _e, IUniverInstanceService as he, RxDisposable as tn, UniverInstanceType as B, toDisposable as nn, FOCUSING_COMMON_DRAWINGS as we, OnLifecycle as se, LifecycleStages as oe, IContextService as wt, Disposable as ae, Direction as q, FOCUSING_FORMULA_EDITOR as rn, EDITOR_ACTIVATED as sn, Rectangle as on, DrawingTypeEnum as Ye, DisposableCollection as an, Tools as re, UserManagerService as cn, IPermissionService as dn, Plugin as ln, DependentOn as un } from "@univerjs/core";
|
|
5
|
+
import { Inject as W, Injector as nt } from "@wendellhu/redi";
|
|
6
|
+
import { ImageCropperObject as gn, COMPONENT_IMAGE_POPUP_MENU as hn, OpenImageCropOperation as mn, ImageResetSizeOperation as fn, DrawingCommonPanel as pn, DrawingRenderService as wn, UniverDrawingUIPlugin as _n } from "@univerjs/drawing-ui";
|
|
7
|
+
import { ISheetDrawingService as H, SetDrawingApplyMutation as E, DrawingApplyType as y, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as vn } from "@univerjs/sheets-drawing";
|
|
8
|
+
import { IDrawingManagerService as z, IImageIoService as _t, ArrangeTypeEnum as Ce, DrawingTypeEnum as Ve, DRAWING_IMAGE_COUNT_LIMIT as ct, ImageUploadStatusType as He, DRAWING_IMAGE_ALLOW_SIZE as Sn, getImageSize as Cn, DRAWING_IMAGE_WIDTH_LIMIT as dt, DRAWING_IMAGE_HEIGHT_LIMIT as lt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as In, getDrawingShapeKeyByDrawingSearch as Rn, UniverDrawingPlugin as Mn } from "@univerjs/drawing";
|
|
9
|
+
import { IRenderManagerService as K, getGroupState as Dn, transformObjectOutOfGroup as bn, precisionTo as Q, Rect as En, DRAWING_OBJECT_LAYER_INDEX as yn, SHEET_VIEWPORT_KEY as On, RENDER_CLASS_TYPE as ce } from "@univerjs/engine-render";
|
|
10
|
+
import { SheetCanvasPopManagerService as Tn, ISheetSelectionRenderService as Ge, SheetSkeletonManagerService as ie, attachRangeWithCoord as Pn, getCurrentRangeDisable$ as Un, SetScrollOperation as An, SetZoomRatioOperation as Nn, SheetPrintInterceptorService as jn, COPY_TYPE as ut, PREDEFINED_HOOK_NAME as Ie, virtualizeDiscreteRanges as Ln, ISheetClipboardService as Bn } from "@univerjs/sheets-ui";
|
|
11
|
+
import { takeUntil as gt, Subject as ht, BehaviorSubject as Wn, combineLatest as Re, map as mt, filter as Me, distinctUntilChanged as De } from "rxjs";
|
|
12
|
+
import { ISidebarService as $n, BuiltInUIPart as Vn, IUIPartsService as Gn, IMessageService as xn, MenuItemType as vt, MenuPosition as Fn, MenuGroup as Yn, getMenuHiddenObservable as St, KeyCode as ue, ComponentManager as Hn, IMenuService as Xn, IShortcutService as kn, CanvasFloatDomService as zn } from "@univerjs/ui";
|
|
13
|
+
import { useDependency as ee, connectInjector as Kn } from "@wendellhu/redi/react-bindings";
|
|
14
|
+
import { getSheetCommandTarget as le, SheetsSelectionsService as Jn, WorkbookEditablePermission as Ze, WorksheetEditPermission as Te, RangeProtectionPermissionEditPoint as Zn, InsertRowCommand as Ct, InsertColCommand as It, RemoveRowCommand as Rt, RemoveColCommand as Mt, DeleteRangeMoveLeftCommand as Dt, DeleteRangeMoveUpCommand as bt, InsertRangeMoveDownCommand as Et, InsertRangeMoveRightCommand as yt, DeltaRowHeightCommand as qe, SetRowHeightCommand as Qe, DeltaColumnWidthCommand as Ot, SetColWidthCommand as Tt, SetRowHiddenCommand as Pt, SetSpecificRowsVisibleCommand as Ut, SetSpecificColsVisibleCommand as At, SetColHiddenCommand as Nt, SetRowVisibleMutation as qn, SetRowHiddenMutation as Qn, SetColVisibleMutation as er, SetColHiddenMutation as tr, SetWorksheetRowHeightMutation as nr, SetWorksheetColWidthMutation as rr, SetWorksheetActiveOperation as ir, SheetInterceptorService as sr, SetFrozenMutation as or, WorkbookViewPermission as ft, WorksheetViewPermission as Xe } from "@univerjs/sheets";
|
|
15
|
+
import L, { useEffect as rt, forwardRef as jt, useRef as Lt, createElement as Bt, useState as et } from "react";
|
|
16
|
+
import { MessageType as be, RadioGroup as ar, Radio as ke } from "@univerjs/design";
|
|
17
|
+
import Ee from "clsx";
|
|
18
18
|
const j = {
|
|
19
19
|
id: "sheet.operation.clear-drawing-transformer",
|
|
20
|
-
type:
|
|
20
|
+
type: F.MUTATION,
|
|
21
21
|
handler: (i, e) => {
|
|
22
|
-
const n = i.get(
|
|
22
|
+
const n = i.get(K);
|
|
23
23
|
return e.forEach((t) => {
|
|
24
24
|
var r, s;
|
|
25
25
|
(s = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
|
|
26
26
|
}), !0;
|
|
27
27
|
}
|
|
28
|
-
},
|
|
28
|
+
}, it = {
|
|
29
29
|
id: "sheet.command.remove-sheet-image",
|
|
30
|
-
type:
|
|
30
|
+
type: F.COMMAND,
|
|
31
31
|
handler: (i, e) => {
|
|
32
|
-
const n = i.get(
|
|
32
|
+
const n = i.get(V), t = i.get(ge), r = i.get(H);
|
|
33
33
|
if (!e) return !1;
|
|
34
34
|
const { drawings: s } = e, o = [];
|
|
35
35
|
s.forEach((f) => {
|
|
36
36
|
const { unitId: m } = f;
|
|
37
37
|
o.push(m);
|
|
38
38
|
});
|
|
39
|
-
const a = r.getBatchRemoveOp(s), { unitId: d, subUnitId:
|
|
40
|
-
return n.syncExecuteCommand(
|
|
39
|
+
const a = r.getBatchRemoveOp(s), { unitId: d, subUnitId: h, undo: l, redo: c, objects: g } = a;
|
|
40
|
+
return n.syncExecuteCommand(E.id, { unitId: d, subUnitId: h, op: c, objects: g, type: y.REMOVE }) ? (t.pushUndoRedo({
|
|
41
41
|
unitID: d,
|
|
42
42
|
undoMutations: [
|
|
43
|
-
{ id:
|
|
43
|
+
{ id: E.id, params: { unitId: d, subUnitId: h, op: l, objects: g, type: y.INSERT } },
|
|
44
44
|
{ id: j.id, params: o }
|
|
45
45
|
],
|
|
46
46
|
redoMutations: [
|
|
47
|
-
{ id:
|
|
47
|
+
{ id: E.id, params: { unitId: d, subUnitId: h, op: c, objects: g, type: y.REMOVE } },
|
|
48
48
|
{ id: j.id, params: o }
|
|
49
49
|
]
|
|
50
50
|
}), !0) : !1;
|
|
51
51
|
}
|
|
52
|
-
},
|
|
52
|
+
}, Wt = "COMPONENT_SHEET_DRAWING_PANEL", $t = {
|
|
53
53
|
id: "sidebar.operation.sheet-image",
|
|
54
|
-
type:
|
|
54
|
+
type: F.COMMAND,
|
|
55
55
|
handler: async (i, e) => {
|
|
56
|
-
const n = i.get(
|
|
57
|
-
if (!
|
|
56
|
+
const n = i.get($n), t = i.get(_e), r = i.get(he), s = i.get(z);
|
|
57
|
+
if (!le(r)) return !1;
|
|
58
58
|
switch (e.value) {
|
|
59
59
|
case "open":
|
|
60
60
|
n.open({
|
|
61
61
|
header: { title: t.t("sheetImage.panel.title") },
|
|
62
|
-
children: { label:
|
|
62
|
+
children: { label: Wt },
|
|
63
63
|
onClose: () => {
|
|
64
64
|
s.focusDrawing(null);
|
|
65
65
|
},
|
|
@@ -73,43 +73,43 @@ const j = {
|
|
|
73
73
|
}
|
|
74
74
|
return !0;
|
|
75
75
|
}
|
|
76
|
-
},
|
|
76
|
+
}, Vt = {
|
|
77
77
|
id: "sheet.operation.edit-sheet-image",
|
|
78
|
-
type:
|
|
78
|
+
type: F.OPERATION,
|
|
79
79
|
handler: (i, e) => {
|
|
80
|
-
const n = i.get(
|
|
81
|
-
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
uploadLoading:
|
|
85
|
-
uploadLoadingBody:
|
|
86
|
-
uploadLoadingBodyAnimation:
|
|
87
|
-
univerCircleAnimation:
|
|
80
|
+
const n = i.get(z), t = i.get(V);
|
|
81
|
+
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand($t.id, { value: "open" }), !0);
|
|
82
|
+
}
|
|
83
|
+
}, cr = "univer-upload-loading", dr = "univer-upload-loading-body", lr = "univer-upload-loading-body-animation", ur = "univer-UniverCircleAnimation", gr = "univer-upload-loading-body-text", ye = {
|
|
84
|
+
uploadLoading: cr,
|
|
85
|
+
uploadLoadingBody: dr,
|
|
86
|
+
uploadLoadingBodyAnimation: lr,
|
|
87
|
+
univerCircleAnimation: ur,
|
|
88
88
|
uploadLoadingBodyText: gr
|
|
89
|
-
},
|
|
90
|
-
const i = ee(_t), e = ee(
|
|
91
|
-
return
|
|
89
|
+
}, hr = () => {
|
|
90
|
+
const i = ee(_t), e = ee(_e), [n, t] = L.useState(0);
|
|
91
|
+
return rt(() => {
|
|
92
92
|
const r = i.change$.subscribe((s) => {
|
|
93
93
|
t(s);
|
|
94
94
|
});
|
|
95
95
|
return () => {
|
|
96
96
|
r.unsubscribe();
|
|
97
97
|
};
|
|
98
|
-
}, [i]), /* @__PURE__ */ L.createElement("div", { style: { display: n > 0 ? "block" : "none" }, className:
|
|
98
|
+
}, [i]), /* @__PURE__ */ L.createElement("div", { style: { display: n > 0 ? "block" : "none" }, className: ye.uploadLoading }, /* @__PURE__ */ L.createElement("div", { className: ye.uploadLoadingBody }, /* @__PURE__ */ L.createElement("div", { className: ye.uploadLoadingBodyAnimation }), /* @__PURE__ */ L.createElement("div", { className: ye.uploadLoadingBodyText }, `${e.t("uploadLoading.loading")}: ${n}`)));
|
|
99
99
|
};
|
|
100
|
-
var
|
|
101
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
100
|
+
var mr = Object.defineProperty, fr = Object.getOwnPropertyDescriptor, pr = (i, e, n, t) => {
|
|
101
|
+
for (var r = t > 1 ? void 0 : t ? fr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
102
102
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
103
|
-
return t && r &&
|
|
104
|
-
},
|
|
105
|
-
let
|
|
103
|
+
return t && r && mr(e, n, r), r;
|
|
104
|
+
}, te = (i, e) => (n, t) => e(n, t, i);
|
|
105
|
+
let Pe = class extends tn {
|
|
106
106
|
constructor(e, n, t, r, s, o, a) {
|
|
107
107
|
super();
|
|
108
|
-
|
|
108
|
+
X(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
109
109
|
this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = a, this._init();
|
|
110
110
|
}
|
|
111
111
|
_init() {
|
|
112
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
112
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(B.UNIVER_SHEET).pipe(gt(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(B.UNIVER_SHEET).pipe(gt(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(B.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(Vn.CONTENT, () => Kn(hr, this._injector));
|
|
113
113
|
}
|
|
114
114
|
_dispose(e) {
|
|
115
115
|
const n = e.getUnitId();
|
|
@@ -124,7 +124,7 @@ let je = class extends rn {
|
|
|
124
124
|
_hasCropObject(e) {
|
|
125
125
|
const n = e.getAllObjects();
|
|
126
126
|
for (const t of n)
|
|
127
|
-
if (t instanceof
|
|
127
|
+
if (t instanceof gn)
|
|
128
128
|
return !0;
|
|
129
129
|
return !1;
|
|
130
130
|
}
|
|
@@ -138,7 +138,7 @@ let je = class extends rn {
|
|
|
138
138
|
return;
|
|
139
139
|
let r;
|
|
140
140
|
this.disposeWithMe(
|
|
141
|
-
|
|
141
|
+
nn(
|
|
142
142
|
t.createControl$.subscribe(() => {
|
|
143
143
|
if (this._contextService.setContextValue(we, !0), this._hasCropObject(n))
|
|
144
144
|
return;
|
|
@@ -150,21 +150,21 @@ let je = class extends rn {
|
|
|
150
150
|
const a = o.values().next().value;
|
|
151
151
|
if (!a)
|
|
152
152
|
return;
|
|
153
|
-
const d = a.oKey,
|
|
154
|
-
if (!
|
|
153
|
+
const d = a.oKey, h = this._drawingManagerService.getDrawingOKey(d);
|
|
154
|
+
if (!h)
|
|
155
155
|
return;
|
|
156
|
-
const { unitId: l, subUnitId: c, drawingId:
|
|
156
|
+
const { unitId: l, subUnitId: c, drawingId: g } = h;
|
|
157
157
|
r == null || r.dispose(), r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
158
|
-
componentKey:
|
|
158
|
+
componentKey: hn,
|
|
159
159
|
direction: "horizontal",
|
|
160
160
|
offset: [2, 0],
|
|
161
161
|
extraProps: {
|
|
162
|
-
menuItems: this._getImageMenuItems(l, c,
|
|
162
|
+
menuItems: this._getImageMenuItems(l, c, g)
|
|
163
163
|
}
|
|
164
164
|
})), this._drawingManagerService.focusDrawing([{
|
|
165
165
|
unitId: l,
|
|
166
166
|
subUnitId: c,
|
|
167
|
-
drawingId:
|
|
167
|
+
drawingId: g
|
|
168
168
|
}]);
|
|
169
169
|
})
|
|
170
170
|
)
|
|
@@ -183,125 +183,125 @@ let je = class extends rn {
|
|
|
183
183
|
{
|
|
184
184
|
label: "image-popup.edit",
|
|
185
185
|
index: 0,
|
|
186
|
-
commandId:
|
|
186
|
+
commandId: Vt.id,
|
|
187
187
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
188
188
|
disable: !1
|
|
189
189
|
},
|
|
190
190
|
{
|
|
191
191
|
label: "image-popup.delete",
|
|
192
192
|
index: 1,
|
|
193
|
-
commandId:
|
|
193
|
+
commandId: it.id,
|
|
194
194
|
commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
|
|
195
195
|
disable: !1
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
198
|
label: "image-popup.crop",
|
|
199
199
|
index: 2,
|
|
200
|
-
commandId:
|
|
200
|
+
commandId: mn.id,
|
|
201
201
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
202
202
|
disable: !1
|
|
203
203
|
},
|
|
204
204
|
{
|
|
205
205
|
label: "image-popup.reset",
|
|
206
206
|
index: 3,
|
|
207
|
-
commandId:
|
|
207
|
+
commandId: fn.id,
|
|
208
208
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
209
209
|
disable: !1
|
|
210
210
|
}
|
|
211
211
|
];
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
],
|
|
224
|
-
const
|
|
214
|
+
Pe = pr([
|
|
215
|
+
se(oe.Steady, Pe),
|
|
216
|
+
te(0, W(nt)),
|
|
217
|
+
te(1, z),
|
|
218
|
+
te(2, W(Tn)),
|
|
219
|
+
te(3, K),
|
|
220
|
+
te(4, he),
|
|
221
|
+
te(5, wt),
|
|
222
|
+
te(6, W(Gn))
|
|
223
|
+
], Pe);
|
|
224
|
+
const xe = {
|
|
225
225
|
id: "sheet.operation.insert-float-image",
|
|
226
|
-
type:
|
|
226
|
+
type: F.OPERATION,
|
|
227
227
|
handler: (i, e) => !0
|
|
228
|
-
},
|
|
228
|
+
}, Be = {
|
|
229
229
|
id: "sheet.operation.insert-cell-image",
|
|
230
|
-
type:
|
|
230
|
+
type: F.OPERATION,
|
|
231
231
|
handler: (i, e) => !0
|
|
232
|
-
},
|
|
232
|
+
}, st = {
|
|
233
233
|
id: "sheet.command.insert-sheet-image",
|
|
234
|
-
type:
|
|
234
|
+
type: F.COMMAND,
|
|
235
235
|
handler: (i, e) => {
|
|
236
|
-
const n = i.get(
|
|
236
|
+
const n = i.get(V), t = i.get(ge), r = i.get(H);
|
|
237
237
|
if (!e) return !1;
|
|
238
|
-
const s = e.drawings, o = s.map((f) => f.unitId), a = r.getBatchAddOp(s), { unitId: d, subUnitId:
|
|
239
|
-
return n.syncExecuteCommand(
|
|
238
|
+
const s = e.drawings, o = s.map((f) => f.unitId), a = r.getBatchAddOp(s), { unitId: d, subUnitId: h, undo: l, redo: c, objects: g } = a;
|
|
239
|
+
return n.syncExecuteCommand(E.id, { op: c, unitId: d, subUnitId: h, objects: g, type: y.INSERT }) ? (t.pushUndoRedo({
|
|
240
240
|
unitID: d,
|
|
241
241
|
undoMutations: [
|
|
242
|
-
{ id:
|
|
242
|
+
{ id: E.id, params: { op: l, unitId: d, subUnitId: h, objects: g, type: y.REMOVE } },
|
|
243
243
|
{ id: j.id, params: o }
|
|
244
244
|
],
|
|
245
245
|
redoMutations: [
|
|
246
|
-
{ id:
|
|
246
|
+
{ id: E.id, params: { op: c, unitId: d, subUnitId: h, objects: g, type: y.INSERT } },
|
|
247
247
|
{ id: j.id, params: o }
|
|
248
248
|
]
|
|
249
249
|
}), !0) : !1;
|
|
250
250
|
}
|
|
251
|
-
},
|
|
251
|
+
}, Fe = {
|
|
252
252
|
id: "sheet.command.set-sheet-image",
|
|
253
|
-
type:
|
|
253
|
+
type: F.COMMAND,
|
|
254
254
|
handler: (i, e) => {
|
|
255
|
-
const n = i.get(
|
|
255
|
+
const n = i.get(V), t = i.get(ge), r = i.get(H);
|
|
256
256
|
if (!e) return !1;
|
|
257
|
-
const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo:
|
|
258
|
-
return n.syncExecuteCommand(
|
|
257
|
+
const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: h, redo: l, objects: c } = o;
|
|
258
|
+
return n.syncExecuteCommand(E.id, { unitId: a, subUnitId: d, op: l, objects: c, type: y.UPDATE }) ? (t.pushUndoRedo({
|
|
259
259
|
unitID: a,
|
|
260
260
|
undoMutations: [
|
|
261
|
-
{ id:
|
|
261
|
+
{ id: E.id, params: { unitId: a, subUnitId: d, op: h, objects: c, type: y.UPDATE } },
|
|
262
262
|
{ id: j.id, params: [a] }
|
|
263
263
|
],
|
|
264
264
|
redoMutations: [
|
|
265
|
-
{ id:
|
|
265
|
+
{ id: E.id, params: { unitId: a, subUnitId: d, op: l, objects: c, type: y.UPDATE } },
|
|
266
266
|
{ id: j.id, params: [a] }
|
|
267
267
|
]
|
|
268
268
|
}), !0) : !1;
|
|
269
269
|
}
|
|
270
270
|
}, Gt = {
|
|
271
271
|
id: "sheet.command.set-drawing-arrange",
|
|
272
|
-
type:
|
|
272
|
+
type: F.COMMAND,
|
|
273
273
|
handler: (i, e) => {
|
|
274
|
-
const n = i.get(
|
|
274
|
+
const n = i.get(V), t = i.get(ge);
|
|
275
275
|
if (!e) return !1;
|
|
276
|
-
const r = i.get(H), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = e,
|
|
276
|
+
const r = i.get(H), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = e, h = { unitId: s, subUnitId: o, drawingIds: a };
|
|
277
277
|
let l;
|
|
278
|
-
if (d ===
|
|
278
|
+
if (d === Ce.forward ? l = r.getForwardDrawingsOp(h) : d === Ce.backward ? l = r.getBackwardDrawingOp(h) : d === Ce.front ? l = r.getFrontDrawingsOp(h) : d === Ce.back && (l = r.getBackDrawingsOp(h)), l == null)
|
|
279
279
|
return !1;
|
|
280
|
-
const { objects: c, redo:
|
|
281
|
-
return n.syncExecuteCommand(
|
|
280
|
+
const { objects: c, redo: g, undo: u } = l;
|
|
281
|
+
return n.syncExecuteCommand(E.id, { op: g, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE }) ? (t.pushUndoRedo({
|
|
282
282
|
unitID: s,
|
|
283
283
|
undoMutations: [
|
|
284
|
-
{ id:
|
|
284
|
+
{ id: E.id, params: { op: u, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE } }
|
|
285
285
|
],
|
|
286
286
|
redoMutations: [
|
|
287
|
-
{ id:
|
|
287
|
+
{ id: E.id, params: { op: g, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE } }
|
|
288
288
|
]
|
|
289
289
|
}), !0) : !1;
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
|
-
function
|
|
292
|
+
function wr(i) {
|
|
293
293
|
const e = [];
|
|
294
294
|
return i.forEach((n) => {
|
|
295
|
-
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a } = t, d =
|
|
296
|
-
const
|
|
295
|
+
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a } = t, d = Dn(0, 0, r.map((c) => c.transform || {})), h = r.map((c) => {
|
|
296
|
+
const g = c.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: f, drawingId: m } = c;
|
|
297
297
|
return {
|
|
298
|
-
unitId:
|
|
298
|
+
unitId: u,
|
|
299
299
|
subUnitId: f,
|
|
300
300
|
drawingId: m,
|
|
301
301
|
transform: {
|
|
302
|
-
...
|
|
303
|
-
left:
|
|
304
|
-
top:
|
|
302
|
+
...g,
|
|
303
|
+
left: g.left - d.left,
|
|
304
|
+
top: g.top - d.top
|
|
305
305
|
},
|
|
306
306
|
groupId: a
|
|
307
307
|
};
|
|
@@ -309,25 +309,25 @@ function _r(i) {
|
|
|
309
309
|
unitId: s,
|
|
310
310
|
subUnitId: o,
|
|
311
311
|
drawingId: a,
|
|
312
|
-
drawingType:
|
|
312
|
+
drawingType: Ve.DRAWING_GROUP,
|
|
313
313
|
transform: d
|
|
314
314
|
};
|
|
315
315
|
e.push({
|
|
316
316
|
parent: l,
|
|
317
|
-
children:
|
|
317
|
+
children: h
|
|
318
318
|
});
|
|
319
319
|
}), e;
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function _r(i) {
|
|
322
322
|
const e = [];
|
|
323
323
|
return i.forEach((n) => {
|
|
324
324
|
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a, transform: d = { width: 0, height: 0 } } = t;
|
|
325
325
|
if (d == null)
|
|
326
326
|
return;
|
|
327
|
-
const
|
|
328
|
-
const { transform:
|
|
327
|
+
const h = r.map((c) => {
|
|
328
|
+
const { transform: g } = c, { unitId: u, subUnitId: f, drawingId: m } = c, p = bn(g || {}, d, d.width || 0, d.height || 0);
|
|
329
329
|
return {
|
|
330
|
-
unitId:
|
|
330
|
+
unitId: u,
|
|
331
331
|
subUnitId: f,
|
|
332
332
|
drawingId: m,
|
|
333
333
|
transform: p,
|
|
@@ -337,7 +337,7 @@ function vr(i) {
|
|
|
337
337
|
unitId: s,
|
|
338
338
|
subUnitId: o,
|
|
339
339
|
drawingId: a,
|
|
340
|
-
drawingType:
|
|
340
|
+
drawingType: Ve.DRAWING_GROUP,
|
|
341
341
|
transform: {
|
|
342
342
|
left: 0,
|
|
343
343
|
top: 0
|
|
@@ -345,130 +345,142 @@ function vr(i) {
|
|
|
345
345
|
};
|
|
346
346
|
e.push({
|
|
347
347
|
parent: l,
|
|
348
|
-
children:
|
|
348
|
+
children: h
|
|
349
349
|
});
|
|
350
350
|
}), e;
|
|
351
351
|
}
|
|
352
|
-
const
|
|
352
|
+
const xt = {
|
|
353
353
|
id: "sheet.command.group-sheet-image",
|
|
354
|
-
type:
|
|
354
|
+
type: F.COMMAND,
|
|
355
355
|
handler: (i, e) => {
|
|
356
|
-
const n = i.get(
|
|
356
|
+
const n = i.get(V), t = i.get(ge), r = i.get(H);
|
|
357
357
|
if (!e) return !1;
|
|
358
358
|
const s = [];
|
|
359
|
-
e.forEach(({ parent:
|
|
360
|
-
s.push(
|
|
359
|
+
e.forEach(({ parent: u, children: f }) => {
|
|
360
|
+
s.push(u.unitId), f.forEach((m) => {
|
|
361
361
|
s.push(m.unitId);
|
|
362
362
|
});
|
|
363
363
|
});
|
|
364
|
-
const o = r.getGroupDrawingOp(e), { unitId: a, subUnitId: d, undo:
|
|
365
|
-
return n.syncExecuteCommand(
|
|
364
|
+
const o = r.getGroupDrawingOp(e), { unitId: a, subUnitId: d, undo: h, redo: l, objects: c } = o;
|
|
365
|
+
return n.syncExecuteCommand(E.id, { op: l, unitId: a, subUnitId: d, objects: c, type: y.GROUP }) ? (t.pushUndoRedo({
|
|
366
366
|
unitID: a,
|
|
367
367
|
undoMutations: [
|
|
368
|
-
{ id:
|
|
368
|
+
{ id: E.id, params: { op: h, unitId: a, subUnitId: d, objects: _r(c), type: y.UNGROUP } },
|
|
369
369
|
{ id: j.id, params: s }
|
|
370
370
|
],
|
|
371
371
|
redoMutations: [
|
|
372
|
-
{ id:
|
|
372
|
+
{ id: E.id, params: { op: l, unitId: a, subUnitId: d, objects: c, type: y.GROUP } },
|
|
373
373
|
{ id: j.id, params: s }
|
|
374
374
|
]
|
|
375
375
|
}), !0) : !1;
|
|
376
376
|
}
|
|
377
|
-
},
|
|
377
|
+
}, Ft = {
|
|
378
378
|
id: "sheet.command.ungroup-sheet-image",
|
|
379
|
-
type:
|
|
379
|
+
type: F.COMMAND,
|
|
380
380
|
handler: (i, e) => {
|
|
381
|
-
const n = i.get(
|
|
381
|
+
const n = i.get(V), t = i.get(ge), r = i.get(H);
|
|
382
382
|
if (!e) return !1;
|
|
383
383
|
const s = [];
|
|
384
|
-
e.forEach(({ parent:
|
|
385
|
-
s.push(
|
|
384
|
+
e.forEach(({ parent: u, children: f }) => {
|
|
385
|
+
s.push(u.unitId), f.forEach((m) => {
|
|
386
386
|
s.push(m.unitId);
|
|
387
387
|
});
|
|
388
388
|
});
|
|
389
|
-
const o = r.getUngroupDrawingOp(e), { unitId: a, subUnitId: d, undo:
|
|
390
|
-
return n.syncExecuteCommand(
|
|
389
|
+
const o = r.getUngroupDrawingOp(e), { unitId: a, subUnitId: d, undo: h, redo: l, objects: c } = o;
|
|
390
|
+
return n.syncExecuteCommand(E.id, { op: l, unitId: a, subUnitId: d, objects: c, type: y.UNGROUP }) ? (t.pushUndoRedo({
|
|
391
391
|
unitID: a,
|
|
392
392
|
undoMutations: [
|
|
393
|
-
{ id:
|
|
393
|
+
{ id: E.id, params: { op: h, unitId: a, subUnitId: d, objects: wr(c), type: y.GROUP } },
|
|
394
394
|
{ id: j.id, params: s }
|
|
395
395
|
],
|
|
396
396
|
redoMutations: [
|
|
397
|
-
{ id:
|
|
397
|
+
{ id: E.id, params: { op: l, unitId: a, subUnitId: d, objects: c, type: y.UNGROUP } },
|
|
398
398
|
{ id: j.id, params: s }
|
|
399
399
|
]
|
|
400
400
|
}), !0) : !1;
|
|
401
401
|
}
|
|
402
402
|
};
|
|
403
|
-
function
|
|
404
|
-
const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY:
|
|
403
|
+
function $(i, e, n) {
|
|
404
|
+
const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: h = 0 } = i, { column: l, columnOffset: c, row: g, rowOffset: u } = t, { column: f, columnOffset: m, row: p, rowOffset: S } = r, C = n.attachRangeWithCoord({
|
|
405
405
|
startColumn: l,
|
|
406
406
|
endColumn: l,
|
|
407
|
-
startRow:
|
|
408
|
-
endRow:
|
|
407
|
+
startRow: g,
|
|
408
|
+
endRow: g
|
|
409
409
|
});
|
|
410
|
-
if (
|
|
410
|
+
if (C == null)
|
|
411
411
|
return;
|
|
412
|
-
const
|
|
412
|
+
const v = n.attachRangeWithCoord({
|
|
413
413
|
startColumn: f,
|
|
414
414
|
endColumn: f,
|
|
415
415
|
startRow: p,
|
|
416
416
|
endRow: p
|
|
417
417
|
});
|
|
418
|
-
if (
|
|
418
|
+
if (v == null)
|
|
419
419
|
return;
|
|
420
|
-
const { startX:
|
|
421
|
-
let
|
|
422
|
-
|
|
423
|
-
const M = n.getCurrentSkeleton(),
|
|
424
|
-
return
|
|
420
|
+
const { startX: R, startY: _ } = C, { startX: b, startY: w } = v;
|
|
421
|
+
let T = Q(R + c, 1), D = Q(_ + u, 1), P = Q(b + m - T, 1), U = Q(w + S - D, 1);
|
|
422
|
+
C.startX === v.endX && (P = 0), C.startY === v.endY && (U = 0);
|
|
423
|
+
const M = n.getCurrentSkeleton(), I = M.rowHeaderWidth + M.columnTotalWidth, A = M.columnHeaderHeight + M.rowTotalHeight;
|
|
424
|
+
return T + P > I && (T = I - P), D + U > A && (D = A - U), {
|
|
425
425
|
flipY: s,
|
|
426
426
|
flipX: o,
|
|
427
427
|
angle: a,
|
|
428
428
|
skewX: d,
|
|
429
|
-
skewY:
|
|
430
|
-
left:
|
|
431
|
-
top:
|
|
432
|
-
width:
|
|
433
|
-
height:
|
|
429
|
+
skewY: h,
|
|
430
|
+
left: T,
|
|
431
|
+
top: D,
|
|
432
|
+
width: P,
|
|
433
|
+
height: U
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
436
|
function N(i, e) {
|
|
437
|
-
const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: d = 0, skewX:
|
|
437
|
+
const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: d = 0, skewX: h = 0, skewY: l = 0 } = i, c = e.getSelectionCellByPosition(n, t);
|
|
438
438
|
if (c == null)
|
|
439
439
|
return;
|
|
440
|
-
const
|
|
440
|
+
const g = {
|
|
441
441
|
column: c.actualColumn,
|
|
442
442
|
columnOffset: Q(n - c.startX, 1),
|
|
443
443
|
row: c.actualRow,
|
|
444
444
|
rowOffset: Q(t - c.startY, 1)
|
|
445
|
-
},
|
|
446
|
-
if (
|
|
445
|
+
}, u = e.getSelectionCellByPosition(n + r, t + s);
|
|
446
|
+
if (u == null)
|
|
447
447
|
return;
|
|
448
448
|
const f = {
|
|
449
|
-
column:
|
|
450
|
-
columnOffset: Q(n + r -
|
|
451
|
-
row:
|
|
452
|
-
rowOffset: Q(t + s -
|
|
449
|
+
column: u.actualColumn,
|
|
450
|
+
columnOffset: Q(n + r - u.startX, 1),
|
|
451
|
+
row: u.actualRow,
|
|
452
|
+
rowOffset: Q(t + s - u.startY, 1)
|
|
453
453
|
};
|
|
454
454
|
return {
|
|
455
455
|
flipY: o,
|
|
456
456
|
flipX: a,
|
|
457
457
|
angle: d,
|
|
458
|
-
skewX:
|
|
458
|
+
skewX: h,
|
|
459
459
|
skewY: l,
|
|
460
|
-
from:
|
|
460
|
+
from: g,
|
|
461
461
|
to: f
|
|
462
462
|
};
|
|
463
463
|
}
|
|
464
|
-
var
|
|
465
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
464
|
+
var vr = Object.defineProperty, Sr = Object.getOwnPropertyDescriptor, Cr = (i, e, n, t) => {
|
|
465
|
+
for (var r = t > 1 ? void 0 : t ? Sr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
466
466
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
467
|
-
return t && r &&
|
|
468
|
-
},
|
|
469
|
-
let
|
|
470
|
-
constructor(i, e, n, t, r, s, o, a, d,
|
|
471
|
-
super(), this.
|
|
467
|
+
return t && r && vr(e, n, r), r;
|
|
468
|
+
}, k = (i, e) => (n, t) => e(n, t, i);
|
|
469
|
+
let Ue = class extends ae {
|
|
470
|
+
constructor(i, e, n, t, r, s, o, a, d, h) {
|
|
471
|
+
super(), this._commandService = i, this._univerInstanceService = e, this._selectionManagerService = n, this._imageIoService = t, this._sheetDrawingService = r, this._drawingManagerService = s, this._contextService = o, this._messageService = a, this._localeService = d, this._renderManagerService = h, this._init();
|
|
472
|
+
}
|
|
473
|
+
// TODO@wzhudev: selection render service would be a render unit, we we cannot
|
|
474
|
+
// easily access it here.
|
|
475
|
+
get _selectionRenderService() {
|
|
476
|
+
return this._renderManagerService.getRenderById(
|
|
477
|
+
this._univerInstanceService.getCurrentUnitForType(B.UNIVER_SHEET).getUnitId()
|
|
478
|
+
).with(Ge);
|
|
479
|
+
}
|
|
480
|
+
get _skeletonManagerService() {
|
|
481
|
+
return this._renderManagerService.getRenderById(
|
|
482
|
+
this._univerInstanceService.getCurrentUnitForType(B.UNIVER_SHEET).getUnitId()
|
|
483
|
+
).with(ie);
|
|
472
484
|
}
|
|
473
485
|
_init() {
|
|
474
486
|
this._initCommandListeners(), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._drawingAddListener();
|
|
@@ -479,19 +491,19 @@ let Le = class extends de {
|
|
|
479
491
|
_initCommandListeners() {
|
|
480
492
|
this.disposeWithMe(
|
|
481
493
|
this._commandService.onCommandExecuted(async (i) => {
|
|
482
|
-
if (i.id ===
|
|
494
|
+
if (i.id === Be.id || i.id === xe.id) {
|
|
483
495
|
const e = i.params;
|
|
484
496
|
if (e.files == null)
|
|
485
497
|
return;
|
|
486
498
|
const n = e.files.length;
|
|
487
499
|
if (n > ct) {
|
|
488
500
|
this._messageService.show({
|
|
489
|
-
type:
|
|
501
|
+
type: be.Error,
|
|
490
502
|
content: this._localeService.t("update-status.exceedMaxCount", String(ct))
|
|
491
503
|
});
|
|
492
504
|
return;
|
|
493
505
|
}
|
|
494
|
-
this._imageIoService.setWaitCount(n), i.id ===
|
|
506
|
+
this._imageIoService.setWaitCount(n), i.id === Be.id ? e.files.forEach(async (t) => {
|
|
495
507
|
await this._insertCellImage(t);
|
|
496
508
|
}) : e.files.forEach(async (t) => {
|
|
497
509
|
await this._insertFloatImage(t);
|
|
@@ -506,16 +518,16 @@ let Le = class extends de {
|
|
|
506
518
|
let e;
|
|
507
519
|
try {
|
|
508
520
|
e = await this._imageIoService.saveImage(i);
|
|
509
|
-
} catch (
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
type:
|
|
513
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
514
|
-
}) :
|
|
515
|
-
type:
|
|
521
|
+
} catch (C) {
|
|
522
|
+
const v = C.message;
|
|
523
|
+
v === He.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
524
|
+
type: be.Error,
|
|
525
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Sn / (1024 * 1024)))
|
|
526
|
+
}) : v === He.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
527
|
+
type: be.Error,
|
|
516
528
|
content: this._localeService.t("update-status.invalidImageType")
|
|
517
|
-
}) :
|
|
518
|
-
type:
|
|
529
|
+
}) : v === He.ERROR_IMAGE && this._messageService.show({
|
|
530
|
+
type: be.Error,
|
|
519
531
|
content: this._localeService.t("update-status.invalidImage")
|
|
520
532
|
});
|
|
521
533
|
}
|
|
@@ -524,36 +536,36 @@ let Le = class extends de {
|
|
|
524
536
|
const n = this._getUnitInfo();
|
|
525
537
|
if (n == null)
|
|
526
538
|
return;
|
|
527
|
-
const { unitId: t, subUnitId: r } = n, { imageId: s, imageSourceType: o, source: a, base64Cache: d } = e, { width:
|
|
528
|
-
if (
|
|
539
|
+
const { unitId: t, subUnitId: r } = n, { imageId: s, imageSourceType: o, source: a, base64Cache: d } = e, { width: h, height: l, image: c } = await Cn(d || ""), g = this._renderManagerService.getRenderById(t);
|
|
540
|
+
if (g == null)
|
|
529
541
|
return;
|
|
530
|
-
const { width:
|
|
542
|
+
const { width: u, height: f } = g.scene;
|
|
531
543
|
this._imageIoService.addImageSourceCache(a, o, c);
|
|
532
544
|
let m = 1;
|
|
533
|
-
if (
|
|
534
|
-
const
|
|
535
|
-
m = Math.max(
|
|
545
|
+
if (h > dt || l > lt) {
|
|
546
|
+
const C = dt / h, v = lt / l;
|
|
547
|
+
m = Math.max(C, v);
|
|
536
548
|
}
|
|
537
|
-
const p = this._getImagePosition(
|
|
549
|
+
const p = this._getImagePosition(h * m, l * m, u, f);
|
|
538
550
|
if (p == null)
|
|
539
551
|
return;
|
|
540
|
-
const
|
|
552
|
+
const S = {
|
|
541
553
|
unitId: t,
|
|
542
554
|
subUnitId: r,
|
|
543
555
|
drawingId: s,
|
|
544
|
-
drawingType:
|
|
556
|
+
drawingType: Ve.DRAWING_IMAGE,
|
|
545
557
|
imageSourceType: o,
|
|
546
558
|
source: a,
|
|
547
|
-
transform:
|
|
559
|
+
transform: $(p, this._selectionRenderService, this._skeletonManagerService),
|
|
548
560
|
sheetTransform: p
|
|
549
561
|
};
|
|
550
|
-
this._commandService.executeCommand(
|
|
562
|
+
this._commandService.executeCommand(st.id, {
|
|
551
563
|
unitId: t,
|
|
552
|
-
drawings: [
|
|
564
|
+
drawings: [S]
|
|
553
565
|
});
|
|
554
566
|
}
|
|
555
567
|
_getUnitInfo() {
|
|
556
|
-
const i = this._univerInstanceService.getCurrentUnitForType(
|
|
568
|
+
const i = this._univerInstanceService.getCurrentUnitForType(B.UNIVER_SHEET);
|
|
557
569
|
if (i == null)
|
|
558
570
|
return;
|
|
559
571
|
const e = i.getActiveSheet();
|
|
@@ -566,7 +578,7 @@ let Le = class extends de {
|
|
|
566
578
|
};
|
|
567
579
|
}
|
|
568
580
|
_getImagePosition(i, e, n, t) {
|
|
569
|
-
const r = this._selectionManagerService.
|
|
581
|
+
const r = this._selectionManagerService.getCurrentSelections();
|
|
570
582
|
let s = {
|
|
571
583
|
startRow: 0,
|
|
572
584
|
endRow: 0,
|
|
@@ -574,32 +586,32 @@ let Le = class extends de {
|
|
|
574
586
|
endColumn: 0
|
|
575
587
|
};
|
|
576
588
|
r && r.length > 0 && (s = r[r.length - 1].range);
|
|
577
|
-
const o = this.
|
|
589
|
+
const o = Pn(this._skeletonManagerService.getCurrent().skeleton, s);
|
|
578
590
|
if (o == null)
|
|
579
591
|
return;
|
|
580
|
-
let { startColumn: a, startRow: d, startX:
|
|
581
|
-
if (
|
|
582
|
-
const m = this._selectionRenderService.getSelectionCellByPosition(
|
|
592
|
+
let { startColumn: a, startRow: d, startX: h, startY: l } = o, c = !1;
|
|
593
|
+
if (h + i > n && (h = n - i, h < 0 && (h = 0, i = n), c = !0), l + e > t && (l = t - e, l < 0 && (l = 0, e = t), c = !0), c) {
|
|
594
|
+
const m = this._selectionRenderService.getSelectionCellByPosition(h, l);
|
|
583
595
|
if (m == null)
|
|
584
596
|
return;
|
|
585
|
-
|
|
597
|
+
h = m.startX, l = m.startY, a = m.actualColumn, d = m.actualRow;
|
|
586
598
|
}
|
|
587
|
-
const
|
|
599
|
+
const g = {
|
|
588
600
|
column: a,
|
|
589
601
|
columnOffset: 0,
|
|
590
602
|
row: d,
|
|
591
603
|
rowOffset: 0
|
|
592
|
-
},
|
|
593
|
-
if (
|
|
604
|
+
}, u = this._selectionRenderService.getSelectionCellByPosition(h + i, l + e);
|
|
605
|
+
if (u == null)
|
|
594
606
|
return;
|
|
595
607
|
const f = {
|
|
596
|
-
column:
|
|
597
|
-
columnOffset:
|
|
598
|
-
row:
|
|
599
|
-
rowOffset: l + e -
|
|
608
|
+
column: u.actualColumn,
|
|
609
|
+
columnOffset: h + i - u.startX,
|
|
610
|
+
row: u.actualRow,
|
|
611
|
+
rowOffset: l + e - u.startY
|
|
600
612
|
};
|
|
601
613
|
return {
|
|
602
|
-
from:
|
|
614
|
+
from: g,
|
|
603
615
|
to: f
|
|
604
616
|
};
|
|
605
617
|
}
|
|
@@ -624,16 +636,16 @@ let Le = class extends de {
|
|
|
624
636
|
const d = this._sheetDrawingService.getDrawingByParam({ unitId: t, subUnitId: r, drawingId: s });
|
|
625
637
|
if (d == null)
|
|
626
638
|
return;
|
|
627
|
-
const
|
|
628
|
-
if (
|
|
639
|
+
const h = N({ ...d.transform, ...a }, this._selectionRenderService);
|
|
640
|
+
if (h == null)
|
|
629
641
|
return;
|
|
630
642
|
const l = {
|
|
631
643
|
...n,
|
|
632
|
-
transform: { ...d.transform, ...a,
|
|
633
|
-
sheetTransform: { ...
|
|
644
|
+
transform: { ...d.transform, ...a, ...$(h, this._selectionRenderService, this._skeletonManagerService) },
|
|
645
|
+
sheetTransform: { ...h }
|
|
634
646
|
};
|
|
635
647
|
e.push(l);
|
|
636
|
-
}), e.length > 0 && this._commandService.executeCommand(
|
|
648
|
+
}), e.length > 0 && this._commandService.executeCommand(Fe.id, {
|
|
637
649
|
unitId: i[0].unitId,
|
|
638
650
|
drawings: e
|
|
639
651
|
}));
|
|
@@ -641,11 +653,11 @@ let Le = class extends de {
|
|
|
641
653
|
}
|
|
642
654
|
_groupDrawingListener() {
|
|
643
655
|
this._drawingManagerService.featurePluginGroupUpdate$.subscribe((i) => {
|
|
644
|
-
this._commandService.executeCommand(
|
|
656
|
+
this._commandService.executeCommand(xt.id, i);
|
|
645
657
|
const { unitId: e, subUnitId: n, drawingId: t } = i[0].parent;
|
|
646
658
|
this._drawingManagerService.focusDrawing([{ unitId: e, subUnitId: n, drawingId: t }]);
|
|
647
659
|
}), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((i) => {
|
|
648
|
-
this._commandService.executeCommand(
|
|
660
|
+
this._commandService.executeCommand(Ft.id, i);
|
|
649
661
|
});
|
|
650
662
|
}
|
|
651
663
|
_focusDrawingListener() {
|
|
@@ -668,35 +680,33 @@ let Le = class extends de {
|
|
|
668
680
|
if (t == null)
|
|
669
681
|
return;
|
|
670
682
|
const { sheetTransform: r } = t;
|
|
671
|
-
t.transform =
|
|
683
|
+
t.transform = $(r, this._selectionRenderService, this._skeletonManagerService);
|
|
672
684
|
});
|
|
673
685
|
const e = i[0].unitId;
|
|
674
686
|
this._drawingManagerService.registerDrawingData(e, this._sheetDrawingService.getDrawingDataForUnit(e)), this._drawingManagerService.initializeNotification(e);
|
|
675
687
|
}
|
|
676
688
|
};
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
var x = function() {
|
|
693
|
-
return x = Object.assign || function(i) {
|
|
689
|
+
Ue = Cr([
|
|
690
|
+
se(oe.Rendered, Ue),
|
|
691
|
+
k(0, V),
|
|
692
|
+
k(1, he),
|
|
693
|
+
k(2, W(Jn)),
|
|
694
|
+
k(3, _t),
|
|
695
|
+
k(4, H),
|
|
696
|
+
k(5, z),
|
|
697
|
+
k(6, wt),
|
|
698
|
+
k(7, xn),
|
|
699
|
+
k(8, W(_e)),
|
|
700
|
+
k(9, K)
|
|
701
|
+
], Ue);
|
|
702
|
+
var Y = function() {
|
|
703
|
+
return Y = Object.assign || function(i) {
|
|
694
704
|
for (var e, n = 1, t = arguments.length; n < t; n++) {
|
|
695
705
|
e = arguments[n];
|
|
696
706
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
|
|
697
707
|
}
|
|
698
708
|
return i;
|
|
699
|
-
},
|
|
709
|
+
}, Y.apply(this, arguments);
|
|
700
710
|
}, Ir = function(i, e) {
|
|
701
711
|
var n = {};
|
|
702
712
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
|
|
@@ -704,17 +714,17 @@ var x = function() {
|
|
|
704
714
|
for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
|
|
705
715
|
e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
|
|
706
716
|
return n;
|
|
707
|
-
},
|
|
708
|
-
var n = i.icon, t = i.id, r = i.className, s = i.extend, o = Ir(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d =
|
|
709
|
-
return Ht(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current },
|
|
717
|
+
}, Yt = jt(function(i, e) {
|
|
718
|
+
var n = i.icon, t = i.id, r = i.className, s = i.extend, o = Ir(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Lt("_".concat(Dr()));
|
|
719
|
+
return Ht(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, Y({ ref: e, className: a }, o), s);
|
|
710
720
|
});
|
|
711
721
|
function Ht(i, e, n, t, r) {
|
|
712
|
-
return Bt(i.tag,
|
|
722
|
+
return Bt(i.tag, Y(Y({ key: e }, Rr(i, n, r)), t), (Mr(i, n).children || []).map(function(s, o) {
|
|
713
723
|
return Ht(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
|
|
714
724
|
}));
|
|
715
725
|
}
|
|
716
|
-
function
|
|
717
|
-
var t =
|
|
726
|
+
function Rr(i, e, n) {
|
|
727
|
+
var t = Y({}, i.attrs);
|
|
718
728
|
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
|
|
719
729
|
var r = e.defIds;
|
|
720
730
|
return !r || r.length === 0 || (i.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + e.idSuffix), Object.entries(t).forEach(function(s) {
|
|
@@ -724,37 +734,37 @@ function Dr(i, e, n) {
|
|
|
724
734
|
}
|
|
725
735
|
function Mr(i, e) {
|
|
726
736
|
var n, t = e.defIds;
|
|
727
|
-
return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ?
|
|
728
|
-
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ?
|
|
737
|
+
return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? Y(Y({}, i), { children: i.children.map(function(r) {
|
|
738
|
+
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? Y(Y({}, r), { attrs: Y(Y({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
729
739
|
}) }) : i;
|
|
730
740
|
}
|
|
731
|
-
function
|
|
741
|
+
function Dr() {
|
|
732
742
|
return Math.random().toString(36).substring(2, 8);
|
|
733
743
|
}
|
|
734
|
-
|
|
735
|
-
var
|
|
736
|
-
return Bt(
|
|
744
|
+
Yt.displayName = "UniverIcon";
|
|
745
|
+
var br = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, Xt = jt(function(i, e) {
|
|
746
|
+
return Bt(Yt, Object.assign({}, i, {
|
|
737
747
|
id: "add-image-single",
|
|
738
748
|
ref: e,
|
|
739
|
-
icon:
|
|
749
|
+
icon: br
|
|
740
750
|
}));
|
|
741
751
|
});
|
|
742
|
-
|
|
752
|
+
Xt.displayName = "AddImageSingle";
|
|
743
753
|
const Er = "univer-upload-file-menu", yr = "univer-upload-file-menu-input", pt = {
|
|
744
754
|
uploadFileMenu: Er,
|
|
745
755
|
uploadFileMenuInput: yr
|
|
746
|
-
},
|
|
747
|
-
var
|
|
748
|
-
const
|
|
749
|
-
const { type: e } = i, n = ee(
|
|
756
|
+
}, kt = "COMPONENT_UPLOAD_FILE_MENU";
|
|
757
|
+
var We = /* @__PURE__ */ ((i) => (i[i.cellImage = 0] = "cellImage", i[i.floatImage = 1] = "floatImage", i))(We || {});
|
|
758
|
+
const Or = (i) => {
|
|
759
|
+
const { type: e } = i, n = ee(V), t = Lt(null), r = () => {
|
|
750
760
|
var a;
|
|
751
761
|
(a = t.current) == null || a.click();
|
|
752
|
-
}, s =
|
|
762
|
+
}, s = In.map((a) => `.${a.replace("image/", "")}`).join(","), o = (a) => {
|
|
753
763
|
const d = a.target.files;
|
|
754
764
|
if (d == null)
|
|
755
765
|
return;
|
|
756
|
-
const
|
|
757
|
-
e ===
|
|
766
|
+
const h = Array.from(d);
|
|
767
|
+
e === We.floatImage ? n.executeCommand(xe.id, { files: h }) : e === We.cellImage && n.executeCommand(Be.id, { files: h }), t.current && (t.current.value = "");
|
|
758
768
|
};
|
|
759
769
|
return /* @__PURE__ */ L.createElement("div", { onClick: r, className: pt.uploadFileMenu }, /* @__PURE__ */ L.createElement(
|
|
760
770
|
"input",
|
|
@@ -767,95 +777,96 @@ const Tr = (i) => {
|
|
|
767
777
|
multiple: !0
|
|
768
778
|
}
|
|
769
779
|
));
|
|
770
|
-
},
|
|
771
|
-
function
|
|
780
|
+
}, zt = "addition-and-subtraction-single", Kt = "sheet.menu.image";
|
|
781
|
+
function Tr(i) {
|
|
772
782
|
return {
|
|
773
|
-
id:
|
|
783
|
+
id: Kt,
|
|
774
784
|
type: vt.SUBITEMS,
|
|
775
|
-
positions: [
|
|
776
|
-
group:
|
|
777
|
-
icon:
|
|
785
|
+
positions: [Fn.TOOLBAR_START],
|
|
786
|
+
group: Yn.TOOLBAR_FORMULAS_INSERT,
|
|
787
|
+
icon: zt,
|
|
778
788
|
tooltip: "sheetImage.title",
|
|
779
|
-
hidden$: St(i,
|
|
780
|
-
disabled$:
|
|
789
|
+
hidden$: St(i, B.UNIVER_SHEET),
|
|
790
|
+
disabled$: Un(i, { workbookTypes: [Ze], worksheetTypes: [Te], rangeTypes: [Zn] })
|
|
781
791
|
};
|
|
782
792
|
}
|
|
783
|
-
function
|
|
793
|
+
function Pr(i) {
|
|
784
794
|
return {
|
|
785
|
-
id:
|
|
795
|
+
id: xe.id,
|
|
786
796
|
title: "sheetImage.upload.float",
|
|
787
797
|
type: vt.SELECTOR,
|
|
788
798
|
label: {
|
|
789
|
-
name:
|
|
799
|
+
name: kt,
|
|
790
800
|
props: {
|
|
791
|
-
type:
|
|
801
|
+
type: We.floatImage
|
|
792
802
|
}
|
|
793
803
|
},
|
|
794
|
-
positions: [
|
|
795
|
-
hidden$: St(i,
|
|
804
|
+
positions: [Kt],
|
|
805
|
+
hidden$: St(i, B.UNIVER_SHEET)
|
|
796
806
|
};
|
|
797
807
|
}
|
|
798
|
-
const Ar = "univer-image-common-panel", Nr = "univer-image-common-panel-
|
|
799
|
-
imageCommonPanel:
|
|
800
|
-
imageCommonPanelGrid:
|
|
801
|
-
imageCommonPanelBorder:
|
|
802
|
-
imageCommonPanelTitle:
|
|
803
|
-
|
|
804
|
-
|
|
808
|
+
const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", Nr = "univer-image-common-panel-border", jr = "univer-image-common-panel-title", Lr = "univer-image-common-panel-subtitle", Br = "univer-image-common-panel-row", Wr = "univer-image-common-panel-row-vertical", $r = "univer-image-common-panel-column", Vr = "univer-image-common-panel-column-center", Gr = "univer-image-common-panel-inline", xr = "univer-image-common-panel-span2", Fr = "univer-image-common-panel-span3", Yr = "univer-image-common-panel-input", Hr = "univer-sheet-image-menu", Xr = "univer-sheet-image-menu-input", Z = {
|
|
809
|
+
imageCommonPanel: Ur,
|
|
810
|
+
imageCommonPanelGrid: Ar,
|
|
811
|
+
imageCommonPanelBorder: Nr,
|
|
812
|
+
imageCommonPanelTitle: jr,
|
|
813
|
+
imageCommonPanelSubtitle: Lr,
|
|
814
|
+
imageCommonPanelRow: Br,
|
|
815
|
+
imageCommonPanelRowVertical: Wr,
|
|
805
816
|
imageCommonPanelColumn: $r,
|
|
806
817
|
imageCommonPanelColumnCenter: Vr,
|
|
807
|
-
imageCommonPanelInline:
|
|
808
|
-
imageCommonPanelSpan2:
|
|
809
|
-
imageCommonPanelSpan3:
|
|
810
|
-
imageCommonPanelInput:
|
|
811
|
-
sheetImageMenu:
|
|
812
|
-
sheetImageMenuInput:
|
|
818
|
+
imageCommonPanelInline: Gr,
|
|
819
|
+
imageCommonPanelSpan2: xr,
|
|
820
|
+
imageCommonPanelSpan3: Fr,
|
|
821
|
+
imageCommonPanelInput: Yr,
|
|
822
|
+
sheetImageMenu: Hr,
|
|
823
|
+
sheetImageMenuInput: Xr
|
|
813
824
|
}, kr = (i) => {
|
|
814
|
-
var
|
|
815
|
-
const e = ee(
|
|
825
|
+
var v;
|
|
826
|
+
const e = ee(V), n = ee(_e), t = ee(z), r = ee(K), { drawings: s } = i, o = s[0];
|
|
816
827
|
if (o == null)
|
|
817
828
|
return;
|
|
818
|
-
const { unitId: a } = o, d = r.getRenderById(a),
|
|
819
|
-
if (
|
|
829
|
+
const { unitId: a } = o, d = r.getRenderById(a), h = d == null ? void 0 : d.scene;
|
|
830
|
+
if (h == null)
|
|
820
831
|
return;
|
|
821
|
-
const l =
|
|
822
|
-
function p(
|
|
832
|
+
const l = h.getTransformerByCreate(), [c, g] = et(!0), u = (v = o.anchorType) != null ? v : O.Position, [f, m] = et(u);
|
|
833
|
+
function p(R, _) {
|
|
823
834
|
const b = [];
|
|
824
|
-
return
|
|
825
|
-
const { oKey:
|
|
826
|
-
if (
|
|
835
|
+
return R.forEach((w) => {
|
|
836
|
+
const { oKey: T } = w, D = _.getDrawingOKey(T);
|
|
837
|
+
if (D == null)
|
|
827
838
|
return b.push(null), !0;
|
|
828
|
-
const { unitId:
|
|
839
|
+
const { unitId: P, subUnitId: U, drawingId: M, drawingType: I, anchorType: A, sheetTransform: G } = D;
|
|
829
840
|
b.push({
|
|
830
|
-
unitId:
|
|
831
|
-
subUnitId:
|
|
841
|
+
unitId: P,
|
|
842
|
+
subUnitId: U,
|
|
832
843
|
drawingId: M,
|
|
833
844
|
anchorType: A,
|
|
834
|
-
sheetTransform:
|
|
835
|
-
drawingType:
|
|
845
|
+
sheetTransform: G,
|
|
846
|
+
drawingType: I
|
|
836
847
|
});
|
|
837
848
|
}), b;
|
|
838
849
|
}
|
|
839
|
-
|
|
840
|
-
const
|
|
841
|
-
b === !0 &&
|
|
850
|
+
rt(() => {
|
|
851
|
+
const R = l.clearControl$.subscribe((b) => {
|
|
852
|
+
b === !0 && g(!1);
|
|
842
853
|
}), _ = l.changeStart$.subscribe((b) => {
|
|
843
|
-
var
|
|
844
|
-
const { objects: w } = b,
|
|
845
|
-
if (
|
|
846
|
-
|
|
847
|
-
else if (
|
|
848
|
-
|
|
849
|
-
const
|
|
850
|
-
m(
|
|
854
|
+
var D;
|
|
855
|
+
const { objects: w } = b, T = p(w, t);
|
|
856
|
+
if (T.length === 0)
|
|
857
|
+
g(!1);
|
|
858
|
+
else if (T.length >= 1) {
|
|
859
|
+
g(!0);
|
|
860
|
+
const P = ((D = T[0]) == null ? void 0 : D.anchorType) || O.Position;
|
|
861
|
+
m(P);
|
|
851
862
|
}
|
|
852
863
|
});
|
|
853
864
|
return () => {
|
|
854
|
-
_.unsubscribe(),
|
|
865
|
+
_.unsubscribe(), R.unsubscribe();
|
|
855
866
|
};
|
|
856
867
|
}, []);
|
|
857
|
-
function
|
|
858
|
-
m(
|
|
868
|
+
function S(R) {
|
|
869
|
+
m(R);
|
|
859
870
|
const _ = t.getFocusDrawings();
|
|
860
871
|
if (_.length === 0)
|
|
861
872
|
return;
|
|
@@ -863,119 +874,119 @@ const Ar = "univer-image-common-panel", Nr = "univer-image-common-panel-grid", j
|
|
|
863
874
|
unitId: w.unitId,
|
|
864
875
|
subUnitId: w.subUnitId,
|
|
865
876
|
drawingId: w.drawingId,
|
|
866
|
-
anchorType:
|
|
877
|
+
anchorType: R
|
|
867
878
|
}));
|
|
868
|
-
e.executeCommand(
|
|
879
|
+
e.executeCommand(Fe.id, {
|
|
869
880
|
unitId: _[0].unitId,
|
|
870
881
|
drawings: b
|
|
871
882
|
});
|
|
872
883
|
}
|
|
873
|
-
const
|
|
874
|
-
return /* @__PURE__ */ L.createElement("div", { className:
|
|
884
|
+
const C = (R) => R ? "block" : "none";
|
|
885
|
+
return /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelGrid, Z.imageCommonPanelBorder), style: { display: C(c) } }, /* @__PURE__ */ L.createElement("div", { className: Z.imageCommonPanelRow }, /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelColumn, Z.imageCommonPanelTitle) }, /* @__PURE__ */ L.createElement("div", null, n.t("drawing-anchor.title")))), /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelRow) }, /* @__PURE__ */ L.createElement("div", { className: Ee(Z.imageCommonPanelColumn) }, /* @__PURE__ */ L.createElement(ar, { value: f, onChange: S, direction: "vertical" }, /* @__PURE__ */ L.createElement(ke, { value: O.Both }, n.t("drawing-anchor.both")), /* @__PURE__ */ L.createElement(ke, { value: O.Position }, n.t("drawing-anchor.position")), /* @__PURE__ */ L.createElement(ke, { value: O.None }, n.t("drawing-anchor.none"))))));
|
|
875
886
|
}, zr = () => {
|
|
876
|
-
const i = ee(
|
|
877
|
-
return
|
|
887
|
+
const i = ee(z), e = i.getFocusDrawings(), [n, t] = et(e);
|
|
888
|
+
return rt(() => {
|
|
878
889
|
const r = i.focus$.subscribe((s) => {
|
|
879
890
|
t(s);
|
|
880
891
|
});
|
|
881
892
|
return () => {
|
|
882
893
|
r.unsubscribe();
|
|
883
894
|
};
|
|
884
|
-
}, []), !!(n != null && n.length) && /* @__PURE__ */ L.createElement("div", { className: Z.imageCommonPanel }, /* @__PURE__ */ L.createElement(
|
|
885
|
-
},
|
|
895
|
+
}, []), !!(n != null && n.length) && /* @__PURE__ */ L.createElement("div", { className: Z.imageCommonPanel }, /* @__PURE__ */ L.createElement(pn, { drawings: n }), /* @__PURE__ */ L.createElement(kr, { drawings: n }));
|
|
896
|
+
}, ve = {
|
|
886
897
|
id: "sheet.command.move-drawing",
|
|
887
|
-
type:
|
|
898
|
+
type: F.COMMAND,
|
|
888
899
|
handler: (i, e) => {
|
|
889
|
-
const n = i.get(
|
|
900
|
+
const n = i.get(V), t = i.get(H), r = i.get(Ge), { direction: s } = e, o = t.getFocusDrawings();
|
|
890
901
|
if (o.length === 0)
|
|
891
902
|
return !1;
|
|
892
903
|
const a = o[0].unitId, d = o.map((l) => {
|
|
893
904
|
const { transform: c } = l;
|
|
894
905
|
if (c == null)
|
|
895
906
|
return null;
|
|
896
|
-
const
|
|
897
|
-
return s === q.UP ?
|
|
907
|
+
const g = { ...c }, { left: u = 0, top: f = 0 } = c;
|
|
908
|
+
return s === q.UP ? g.top = f - 1 : s === q.DOWN ? g.top = f + 1 : s === q.LEFT ? g.left = u - 1 : s === q.RIGHT && (g.left = u + 1), {
|
|
898
909
|
...l,
|
|
899
|
-
transform:
|
|
900
|
-
sheetTransform: N(
|
|
910
|
+
transform: g,
|
|
911
|
+
sheetTransform: N(g, r)
|
|
901
912
|
};
|
|
902
913
|
}).filter((l) => l != null);
|
|
903
|
-
return n.syncExecuteCommand(
|
|
914
|
+
return n.syncExecuteCommand(Fe.id, {
|
|
904
915
|
unitId: a,
|
|
905
916
|
drawings: d
|
|
906
917
|
}) ? (n.syncExecuteCommand(j.id, [a]), !0) : !1;
|
|
907
918
|
}
|
|
908
|
-
},
|
|
919
|
+
}, Jt = {
|
|
909
920
|
id: "sheet.command.delete-drawing",
|
|
910
|
-
type:
|
|
921
|
+
type: F.COMMAND,
|
|
911
922
|
handler: (i) => {
|
|
912
|
-
const e = i.get(
|
|
923
|
+
const e = i.get(V), t = i.get(H).getFocusDrawings();
|
|
913
924
|
if (t.length === 0)
|
|
914
925
|
return !1;
|
|
915
926
|
const r = t[0].unitId, s = t.map((o) => {
|
|
916
|
-
const { unitId: a, subUnitId: d, drawingId:
|
|
927
|
+
const { unitId: a, subUnitId: d, drawingId: h, drawingType: l } = o;
|
|
917
928
|
return {
|
|
918
929
|
unitId: a,
|
|
919
930
|
subUnitId: d,
|
|
920
|
-
drawingId:
|
|
931
|
+
drawingId: h,
|
|
921
932
|
drawingType: l
|
|
922
933
|
};
|
|
923
934
|
});
|
|
924
|
-
return e.executeCommand(
|
|
935
|
+
return e.executeCommand(it.id, {
|
|
925
936
|
unitId: r,
|
|
926
937
|
drawings: s
|
|
927
938
|
});
|
|
928
939
|
}
|
|
929
940
|
};
|
|
930
|
-
function
|
|
931
|
-
return !i.getContextValue(
|
|
941
|
+
function Se(i) {
|
|
942
|
+
return !i.getContextValue(rn) && !i.getContextValue(sn) && i.getContextValue(we);
|
|
932
943
|
}
|
|
933
944
|
const Kr = {
|
|
934
|
-
id:
|
|
945
|
+
id: ve.id,
|
|
935
946
|
description: "shortcut.sheet.drawing-move-down",
|
|
936
947
|
group: "4_sheet-drawing-view",
|
|
937
948
|
binding: ue.ARROW_DOWN,
|
|
938
949
|
priority: 100,
|
|
939
|
-
preconditions:
|
|
950
|
+
preconditions: Se,
|
|
940
951
|
staticParameters: {
|
|
941
952
|
direction: q.DOWN
|
|
942
953
|
}
|
|
943
954
|
}, Jr = {
|
|
944
|
-
id:
|
|
955
|
+
id: ve.id,
|
|
945
956
|
description: "shortcut.sheet.drawing-move-up",
|
|
946
957
|
group: "4_sheet-drawing-view",
|
|
947
958
|
binding: ue.ARROW_UP,
|
|
948
959
|
priority: 100,
|
|
949
|
-
preconditions:
|
|
960
|
+
preconditions: Se,
|
|
950
961
|
staticParameters: {
|
|
951
962
|
direction: q.UP
|
|
952
963
|
}
|
|
953
964
|
}, Zr = {
|
|
954
|
-
id:
|
|
965
|
+
id: ve.id,
|
|
955
966
|
description: "shortcut.sheet.drawing-move-left",
|
|
956
967
|
group: "4_sheet-drawing-view",
|
|
957
968
|
binding: ue.ARROW_LEFT,
|
|
958
969
|
priority: 100,
|
|
959
|
-
preconditions:
|
|
970
|
+
preconditions: Se,
|
|
960
971
|
staticParameters: {
|
|
961
972
|
direction: q.LEFT
|
|
962
973
|
}
|
|
963
974
|
}, qr = {
|
|
964
|
-
id:
|
|
975
|
+
id: ve.id,
|
|
965
976
|
description: "shortcut.sheet.drawing-move-right",
|
|
966
977
|
group: "4_sheet-drawing-view",
|
|
967
978
|
binding: ue.ARROW_RIGHT,
|
|
968
979
|
priority: 100,
|
|
969
|
-
preconditions:
|
|
980
|
+
preconditions: Se,
|
|
970
981
|
staticParameters: {
|
|
971
982
|
direction: q.RIGHT
|
|
972
983
|
}
|
|
973
984
|
}, Qr = {
|
|
974
|
-
id:
|
|
985
|
+
id: Jt.id,
|
|
975
986
|
description: "shortcut.sheet.drawing-delete",
|
|
976
987
|
group: "4_sheet-drawing-view",
|
|
977
988
|
// when focusing on any other input tag do not trigger this shortcut
|
|
978
|
-
preconditions:
|
|
989
|
+
preconditions: Se,
|
|
979
990
|
binding: ue.DELETE,
|
|
980
991
|
mac: ue.BACKSPACE
|
|
981
992
|
};
|
|
@@ -985,19 +996,19 @@ var ei = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, ni = (i, e
|
|
|
985
996
|
return t && r && ei(e, n, r), r;
|
|
986
997
|
}, me = (i, e) => (n, t) => e(n, t, i);
|
|
987
998
|
const ri = {};
|
|
988
|
-
let pe = class extends
|
|
999
|
+
let pe = class extends ae {
|
|
989
1000
|
constructor(i, e, n, t, r, s) {
|
|
990
1001
|
super(), this._config = i, this._injector = e, this._componentManager = n, this._menuService = t, this._commandService = r, this._shortcutService = s, this._init();
|
|
991
1002
|
}
|
|
992
1003
|
_initCustomComponents() {
|
|
993
1004
|
const i = this._componentManager;
|
|
994
|
-
this.disposeWithMe(i.register(
|
|
1005
|
+
this.disposeWithMe(i.register(zt, Xt)), this.disposeWithMe(i.register(kt, Or)), this.disposeWithMe(i.register(Wt, zr));
|
|
995
1006
|
}
|
|
996
1007
|
_initMenus() {
|
|
997
1008
|
const { menu: i = {} } = this._config;
|
|
998
1009
|
[
|
|
999
|
-
|
|
1000
|
-
|
|
1010
|
+
Tr,
|
|
1011
|
+
Pr
|
|
1001
1012
|
// UploadCellImageMenuFactory,
|
|
1002
1013
|
].forEach((e) => {
|
|
1003
1014
|
this._menuService.addMenuItem(e(this._injector), i);
|
|
@@ -1005,18 +1016,18 @@ let pe = class extends de {
|
|
|
1005
1016
|
}
|
|
1006
1017
|
_initCommands() {
|
|
1007
1018
|
[
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1019
|
+
xe,
|
|
1020
|
+
Be,
|
|
1021
|
+
st,
|
|
1022
|
+
it,
|
|
1023
|
+
Fe,
|
|
1024
|
+
$t,
|
|
1014
1025
|
j,
|
|
1015
|
-
|
|
1016
|
-
Xt,
|
|
1026
|
+
Vt,
|
|
1017
1027
|
xt,
|
|
1018
|
-
|
|
1019
|
-
|
|
1028
|
+
Ft,
|
|
1029
|
+
ve,
|
|
1030
|
+
Jt,
|
|
1020
1031
|
Gt
|
|
1021
1032
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
1022
1033
|
}
|
|
@@ -1037,47 +1048,58 @@ let pe = class extends de {
|
|
|
1037
1048
|
}
|
|
1038
1049
|
};
|
|
1039
1050
|
pe = ni([
|
|
1040
|
-
|
|
1041
|
-
me(1, W(
|
|
1051
|
+
se(oe.Rendered, pe),
|
|
1052
|
+
me(1, W(nt)),
|
|
1042
1053
|
me(2, W(Hn)),
|
|
1043
|
-
me(3,
|
|
1044
|
-
me(4,
|
|
1045
|
-
me(5,
|
|
1054
|
+
me(3, Xn),
|
|
1055
|
+
me(4, V),
|
|
1056
|
+
me(5, kn)
|
|
1046
1057
|
], pe);
|
|
1047
1058
|
var ii = Object.defineProperty, si = Object.getOwnPropertyDescriptor, oi = (i, e, n, t) => {
|
|
1048
1059
|
for (var r = t > 1 ? void 0 : t ? si(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1049
1060
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1050
1061
|
return t && r && ii(e, n, r), r;
|
|
1051
|
-
},
|
|
1062
|
+
}, de = (i, e) => (n, t) => e(n, t, i);
|
|
1052
1063
|
const ai = [
|
|
1053
1064
|
Ct.id,
|
|
1054
|
-
Rt.id,
|
|
1055
1065
|
It.id,
|
|
1056
|
-
|
|
1066
|
+
Rt.id,
|
|
1057
1067
|
Mt.id,
|
|
1068
|
+
Dt.id,
|
|
1058
1069
|
bt.id,
|
|
1059
|
-
Ot.id,
|
|
1060
1070
|
Et.id,
|
|
1061
|
-
tt.id,
|
|
1062
|
-
nt.id,
|
|
1063
1071
|
yt.id,
|
|
1072
|
+
qe.id,
|
|
1073
|
+
Qe.id,
|
|
1074
|
+
Ot.id,
|
|
1064
1075
|
Tt.id,
|
|
1065
1076
|
Pt.id,
|
|
1066
1077
|
Ut.id,
|
|
1067
1078
|
At.id,
|
|
1068
|
-
Nt.id
|
|
1069
|
-
jt.id
|
|
1079
|
+
Nt.id
|
|
1070
1080
|
], ci = [
|
|
1081
|
+
qn.id,
|
|
1071
1082
|
Qn.id,
|
|
1072
1083
|
er.id,
|
|
1073
1084
|
tr.id,
|
|
1074
1085
|
nr.id,
|
|
1075
|
-
rr.id
|
|
1076
|
-
ir.id
|
|
1086
|
+
rr.id
|
|
1077
1087
|
];
|
|
1078
|
-
let
|
|
1079
|
-
constructor(i, e, n, t, r, s
|
|
1080
|
-
super(), this.
|
|
1088
|
+
let Ae = class extends ae {
|
|
1089
|
+
constructor(i, e, n, t, r, s) {
|
|
1090
|
+
super(), this._commandService = i, this._sheetInterceptorService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._drawingManagerService = r, this._univerInstanceService = s, this._init();
|
|
1091
|
+
}
|
|
1092
|
+
// TODO@wzhudev: selection render service would be a render unit, we we cannot
|
|
1093
|
+
// easily access it here.
|
|
1094
|
+
get _selectionRenderService() {
|
|
1095
|
+
return this._renderManagerService.getRenderById(
|
|
1096
|
+
this._univerInstanceService.getCurrentUnitForType(B.UNIVER_SHEET).getUnitId()
|
|
1097
|
+
).with(Ge);
|
|
1098
|
+
}
|
|
1099
|
+
get _skeletonManagerService() {
|
|
1100
|
+
return this._renderManagerService.getRenderById(
|
|
1101
|
+
this._univerInstanceService.getCurrentUnitForType(B.UNIVER_SHEET).getUnitId()
|
|
1102
|
+
).with(ie);
|
|
1081
1103
|
}
|
|
1082
1104
|
_init() {
|
|
1083
1105
|
this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
|
|
@@ -1093,15 +1115,13 @@ let We = class extends de {
|
|
|
1093
1115
|
const e = i.id;
|
|
1094
1116
|
if (e === Ct.id)
|
|
1095
1117
|
return this._moveRowInterceptor(i.params, "insert");
|
|
1096
|
-
if (e === Rt.id)
|
|
1097
|
-
return this._moveColInterceptor(i.params, "insert");
|
|
1098
1118
|
if (e === It.id)
|
|
1119
|
+
return this._moveColInterceptor(i.params, "insert");
|
|
1120
|
+
if (e === Rt.id)
|
|
1099
1121
|
return this._moveRowInterceptor(i.params, "remove");
|
|
1100
|
-
if (e ===
|
|
1122
|
+
if (e === Mt.id)
|
|
1101
1123
|
return this._moveColInterceptor(i.params, "remove");
|
|
1102
|
-
if (e ===
|
|
1103
|
-
return this._moveRangeInterceptor(i.params);
|
|
1104
|
-
if (e === Mt.id) {
|
|
1124
|
+
if (e === Dt.id) {
|
|
1105
1125
|
const { range: n } = i.params;
|
|
1106
1126
|
return this._getRangeMoveUndo(
|
|
1107
1127
|
n,
|
|
@@ -1115,14 +1135,14 @@ let We = class extends de {
|
|
|
1115
1135
|
1
|
|
1116
1136
|
/* deleteUp */
|
|
1117
1137
|
);
|
|
1118
|
-
} else if (e ===
|
|
1138
|
+
} else if (e === Et.id) {
|
|
1119
1139
|
const { range: n } = i.params;
|
|
1120
1140
|
return this._getRangeMoveUndo(
|
|
1121
1141
|
n,
|
|
1122
1142
|
2
|
|
1123
1143
|
/* insertDown */
|
|
1124
1144
|
);
|
|
1125
|
-
} else if (e ===
|
|
1145
|
+
} else if (e === yt.id) {
|
|
1126
1146
|
const { range: n } = i.params;
|
|
1127
1147
|
return this._getRangeMoveUndo(
|
|
1128
1148
|
n,
|
|
@@ -1135,8 +1155,8 @@ let We = class extends de {
|
|
|
1135
1155
|
} else if (e === At.id || e === Nt.id) {
|
|
1136
1156
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1137
1157
|
return this._getDrawingUndoForColVisible(t, r, s);
|
|
1138
|
-
} else if (e ===
|
|
1139
|
-
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e ===
|
|
1158
|
+
} else if (e === qe.id || e === Qe.id || e === Ot.id || e === Tt.id) {
|
|
1159
|
+
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === qe.id || e === Qe.id;
|
|
1140
1160
|
return this._getDrawingUndoForRowAndColSize(t, r, s, o);
|
|
1141
1161
|
}
|
|
1142
1162
|
return { redos: [], undos: [] };
|
|
@@ -1145,22 +1165,22 @@ let We = class extends de {
|
|
|
1145
1165
|
);
|
|
1146
1166
|
}
|
|
1147
1167
|
_getRangeMoveUndo(i, e) {
|
|
1148
|
-
const n =
|
|
1168
|
+
const n = le(this._univerInstanceService);
|
|
1149
1169
|
if (n == null)
|
|
1150
1170
|
return { redos: [], undos: [] };
|
|
1151
|
-
const t = n.unitId, r = n.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(t, r), d = [],
|
|
1171
|
+
const t = n.unitId, r = n.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(t, r), d = [], h = [];
|
|
1152
1172
|
if (Object.keys(a).forEach((l) => {
|
|
1153
|
-
const c = a[l], { updateDrawings:
|
|
1154
|
-
d.push(...
|
|
1155
|
-
}), d.length === 0 &&
|
|
1173
|
+
const c = a[l], { updateDrawings: g, deleteDrawings: u } = this._getUpdateOrDeleteDrawings(i, e, c);
|
|
1174
|
+
d.push(...g), h.push(...u);
|
|
1175
|
+
}), d.length === 0 && h.length === 0)
|
|
1156
1176
|
return { redos: [], undos: [] };
|
|
1157
1177
|
if (d.length > 0) {
|
|
1158
|
-
const l = this._sheetDrawingService.getBatchUpdateOp(d), { undo: c, redo:
|
|
1159
|
-
s.push({ id:
|
|
1178
|
+
const l = this._sheetDrawingService.getBatchUpdateOp(d), { undo: c, redo: g, objects: u } = l;
|
|
1179
|
+
s.push({ id: E.id, params: { unitId: t, subUnitId: r, op: g, objects: u, type: y.UPDATE } }), o.push({ id: E.id, params: { unitId: t, subUnitId: r, op: c, objects: u, type: y.UPDATE } });
|
|
1160
1180
|
}
|
|
1161
|
-
if (
|
|
1162
|
-
const l = this._sheetDrawingService.getBatchRemoveOp(
|
|
1163
|
-
s.push({ id:
|
|
1181
|
+
if (h.length > 0) {
|
|
1182
|
+
const l = this._sheetDrawingService.getBatchRemoveOp(h), c = l.undo, g = l.redo, u = l.objects;
|
|
1183
|
+
s.push({ id: E.id, params: { unitId: t, subUnitId: r, op: g, objects: u, type: y.REMOVE } }), o.push({ id: E.id, params: { unitId: t, subUnitId: r, op: c, objects: u, type: y.INSERT } });
|
|
1164
1184
|
}
|
|
1165
1185
|
return s.push({ id: j.id, params: [t] }), o.push({ id: j.id, params: [t] }), {
|
|
1166
1186
|
redos: s,
|
|
@@ -1168,37 +1188,37 @@ let We = class extends de {
|
|
|
1168
1188
|
};
|
|
1169
1189
|
}
|
|
1170
1190
|
_getUpdateOrDeleteDrawings(i, e, n) {
|
|
1171
|
-
const t = [], r = [], { sheetTransform: s, anchorType: o =
|
|
1191
|
+
const t = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: h, drawingId: l } = n, { from: c, to: g } = s, { row: u, column: f } = c, { row: m, column: p } = g;
|
|
1172
1192
|
if (s == null || a == null)
|
|
1173
1193
|
return {
|
|
1174
1194
|
updateDrawings: t,
|
|
1175
1195
|
deleteDrawings: r
|
|
1176
1196
|
};
|
|
1177
|
-
const { startRow:
|
|
1197
|
+
const { startRow: S, endRow: C, startColumn: v, endColumn: R } = i;
|
|
1178
1198
|
let _ = null, b = null;
|
|
1179
|
-
if (e === 0 &&
|
|
1180
|
-
if (f >=
|
|
1181
|
-
r.push({ unitId: d, subUnitId:
|
|
1199
|
+
if (e === 0 && u >= S && m <= C)
|
|
1200
|
+
if (f >= v && p <= R)
|
|
1201
|
+
r.push({ unitId: d, subUnitId: h, drawingId: l });
|
|
1182
1202
|
else {
|
|
1183
|
-
const w = this._shrinkCol(s, a,
|
|
1203
|
+
const w = this._shrinkCol(s, a, v, R, o);
|
|
1184
1204
|
_ = w == null ? void 0 : w.newSheetTransform, b = w == null ? void 0 : w.newTransform;
|
|
1185
1205
|
}
|
|
1186
|
-
else if (e === 1 && f >=
|
|
1187
|
-
if (
|
|
1188
|
-
r.push({ unitId: d, subUnitId:
|
|
1206
|
+
else if (e === 1 && f >= v && p <= R)
|
|
1207
|
+
if (u >= S && m <= C)
|
|
1208
|
+
r.push({ unitId: d, subUnitId: h, drawingId: l });
|
|
1189
1209
|
else {
|
|
1190
|
-
const w = this._shrinkRow(s, a,
|
|
1210
|
+
const w = this._shrinkRow(s, a, S, C, o);
|
|
1191
1211
|
_ = w == null ? void 0 : w.newSheetTransform, b = w == null ? void 0 : w.newTransform;
|
|
1192
1212
|
}
|
|
1193
1213
|
else if (e === 2) {
|
|
1194
|
-
const w = this._expandRow(s, a,
|
|
1214
|
+
const w = this._expandRow(s, a, S, C, o);
|
|
1195
1215
|
_ = w == null ? void 0 : w.newSheetTransform, b = w == null ? void 0 : w.newTransform;
|
|
1196
1216
|
} else if (e === 3) {
|
|
1197
|
-
const w = this._expandCol(s, a,
|
|
1217
|
+
const w = this._expandCol(s, a, v, R, o);
|
|
1198
1218
|
_ = w == null ? void 0 : w.newSheetTransform, b = w == null ? void 0 : w.newTransform;
|
|
1199
1219
|
}
|
|
1200
1220
|
if (_ != null && b != null) {
|
|
1201
|
-
const w =
|
|
1221
|
+
const w = $(_, this._selectionRenderService, this._skeletonManagerService);
|
|
1202
1222
|
t.push({ ...n, sheetTransform: _, transform: w });
|
|
1203
1223
|
}
|
|
1204
1224
|
return { updateDrawings: t, deleteDrawings: r };
|
|
@@ -1214,89 +1234,89 @@ let We = class extends de {
|
|
|
1214
1234
|
_getDrawingUndoForColVisible(i, e, n) {
|
|
1215
1235
|
const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
|
|
1216
1236
|
if (Object.keys(t).forEach((l) => {
|
|
1217
|
-
const c = t[l], { sheetTransform:
|
|
1218
|
-
if (f ===
|
|
1219
|
-
this._remainDrawingSize(
|
|
1237
|
+
const c = t[l], { sheetTransform: g, transform: u, anchorType: f = O.Position } = c;
|
|
1238
|
+
if (f === O.None)
|
|
1239
|
+
this._remainDrawingSize(u, r, c);
|
|
1220
1240
|
else {
|
|
1221
|
-
const { from: m, to: p } =
|
|
1241
|
+
const { from: m, to: p } = g, { row: S, column: C } = m, { row: v, column: R } = p;
|
|
1222
1242
|
for (let _ = 0; _ < n.length; _++) {
|
|
1223
|
-
const b = n[_], { startRow: w, endRow:
|
|
1224
|
-
if (
|
|
1243
|
+
const b = n[_], { startRow: w, endRow: T, startColumn: D, endColumn: P } = b;
|
|
1244
|
+
if (R < D)
|
|
1225
1245
|
continue;
|
|
1226
|
-
if (f ===
|
|
1227
|
-
let
|
|
1228
|
-
if (
|
|
1229
|
-
const
|
|
1230
|
-
if (
|
|
1246
|
+
if (f === O.Position) {
|
|
1247
|
+
let I = null, A = null;
|
|
1248
|
+
if (C >= D && C <= P) {
|
|
1249
|
+
const G = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: P, startRow: m.row, endRow: p.row });
|
|
1250
|
+
if (G == null)
|
|
1231
1251
|
return;
|
|
1232
|
-
A = { ...
|
|
1252
|
+
A = { ...u, left: G.startX };
|
|
1233
1253
|
}
|
|
1234
|
-
if (A != null && (
|
|
1235
|
-
r.push({ ...c, sheetTransform:
|
|
1254
|
+
if (A != null && (I = N(A, this._selectionRenderService), I != null && A != null)) {
|
|
1255
|
+
r.push({ ...c, sheetTransform: I, transform: A });
|
|
1236
1256
|
break;
|
|
1237
1257
|
}
|
|
1238
|
-
this._remainDrawingSize(
|
|
1258
|
+
this._remainDrawingSize(u, r, c);
|
|
1239
1259
|
continue;
|
|
1240
1260
|
}
|
|
1241
|
-
if (
|
|
1261
|
+
if (C >= D && R <= P)
|
|
1242
1262
|
continue;
|
|
1243
|
-
let
|
|
1244
|
-
if (
|
|
1245
|
-
const
|
|
1246
|
-
if (
|
|
1263
|
+
let U = null, M = null;
|
|
1264
|
+
if (C >= D && C <= P) {
|
|
1265
|
+
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: P, startRow: m.row, endRow: p.row });
|
|
1266
|
+
if (I == null)
|
|
1247
1267
|
return;
|
|
1248
1268
|
M = {
|
|
1249
|
-
...
|
|
1250
|
-
left: (
|
|
1251
|
-
width: ((
|
|
1269
|
+
...u,
|
|
1270
|
+
left: (I == null ? void 0 : I.startX) || 0,
|
|
1271
|
+
width: ((u == null ? void 0 : u.width) || 0) - I.endX + I.startX
|
|
1252
1272
|
};
|
|
1253
|
-
} else if (
|
|
1254
|
-
const
|
|
1255
|
-
if (
|
|
1273
|
+
} else if (R >= D && R <= P) {
|
|
1274
|
+
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: R, startRow: m.row, endRow: p.row });
|
|
1275
|
+
if (I == null)
|
|
1256
1276
|
return;
|
|
1257
1277
|
M = {
|
|
1258
|
-
...
|
|
1259
|
-
left:
|
|
1278
|
+
...u,
|
|
1279
|
+
left: I.startX - ((u == null ? void 0 : u.width) || 0)
|
|
1260
1280
|
};
|
|
1261
1281
|
} else {
|
|
1262
|
-
const
|
|
1263
|
-
if (
|
|
1282
|
+
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: P, startRow: m.row, endRow: p.row });
|
|
1283
|
+
if (I == null)
|
|
1264
1284
|
return;
|
|
1265
1285
|
if (M = {
|
|
1266
|
-
...
|
|
1267
|
-
width: ((
|
|
1268
|
-
},
|
|
1269
|
-
s.push({ ...c, sheetTransform:
|
|
1286
|
+
...u,
|
|
1287
|
+
width: ((u == null ? void 0 : u.width) || 0) - I.endX + I.startX
|
|
1288
|
+
}, U = N(M, this._selectionRenderService), U != null && M != null) {
|
|
1289
|
+
s.push({ ...c, sheetTransform: U, transform: M });
|
|
1270
1290
|
break;
|
|
1271
1291
|
}
|
|
1272
1292
|
}
|
|
1273
|
-
if (M != null && (
|
|
1274
|
-
r.push({ ...c, sheetTransform:
|
|
1293
|
+
if (M != null && (U = N(M, this._selectionRenderService)), M != null && U != null) {
|
|
1294
|
+
r.push({ ...c, sheetTransform: U, transform: M });
|
|
1275
1295
|
break;
|
|
1276
1296
|
} else
|
|
1277
|
-
this._remainDrawingSize(
|
|
1297
|
+
this._remainDrawingSize(u, r, c);
|
|
1278
1298
|
}
|
|
1279
1299
|
}
|
|
1280
1300
|
}), r.length === 0 && s.length === 0)
|
|
1281
1301
|
return { redos: [], undos: [] };
|
|
1282
|
-
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, e, r), d = [],
|
|
1302
|
+
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, e, r), d = [], h = [];
|
|
1283
1303
|
if (s.length > 0) {
|
|
1284
1304
|
const { redos: l, undos: c } = this._createUndoAndRedoMutation(i, e, s);
|
|
1285
|
-
d.push(...l),
|
|
1305
|
+
d.push(...l), h.push(...c);
|
|
1286
1306
|
}
|
|
1287
1307
|
return {
|
|
1288
1308
|
redos: o,
|
|
1289
1309
|
undos: a,
|
|
1290
1310
|
preRedos: d,
|
|
1291
|
-
preUndos:
|
|
1311
|
+
preUndos: h
|
|
1292
1312
|
};
|
|
1293
1313
|
}
|
|
1294
1314
|
_createUndoAndRedoMutation(i, e, n) {
|
|
1295
1315
|
const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, a = [
|
|
1296
|
-
{ id:
|
|
1316
|
+
{ id: E.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: y.UPDATE } },
|
|
1297
1317
|
{ id: j.id, params: [i] }
|
|
1298
1318
|
], d = [
|
|
1299
|
-
{ id:
|
|
1319
|
+
{ id: E.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type: y.UPDATE } },
|
|
1300
1320
|
{ id: j.id, params: [i] }
|
|
1301
1321
|
];
|
|
1302
1322
|
return {
|
|
@@ -1308,100 +1328,104 @@ let We = class extends de {
|
|
|
1308
1328
|
_getDrawingUndoForRowVisible(i, e, n) {
|
|
1309
1329
|
const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
|
|
1310
1330
|
if (Object.keys(t).forEach((l) => {
|
|
1311
|
-
const c = t[l], { sheetTransform:
|
|
1312
|
-
if (f ===
|
|
1313
|
-
this._remainDrawingSize(
|
|
1331
|
+
const c = t[l], { sheetTransform: g, transform: u, anchorType: f = O.Position } = c;
|
|
1332
|
+
if (f === O.None)
|
|
1333
|
+
this._remainDrawingSize(u, r, c);
|
|
1314
1334
|
else {
|
|
1315
|
-
const { from: m, to: p } =
|
|
1335
|
+
const { from: m, to: p } = g, { row: S, column: C } = m, { row: v, column: R } = p;
|
|
1316
1336
|
for (let _ = 0; _ < n.length; _++) {
|
|
1317
|
-
const b = n[_], { startRow: w, endRow:
|
|
1318
|
-
if (
|
|
1337
|
+
const b = n[_], { startRow: w, endRow: T, startColumn: D, endColumn: P } = b;
|
|
1338
|
+
if (v < w)
|
|
1319
1339
|
continue;
|
|
1320
|
-
if (f ===
|
|
1321
|
-
let
|
|
1322
|
-
if (
|
|
1323
|
-
const
|
|
1324
|
-
if (
|
|
1340
|
+
if (f === O.Position) {
|
|
1341
|
+
let I = null, A = null;
|
|
1342
|
+
if (S >= w && S <= T) {
|
|
1343
|
+
const G = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: S, endRow: T });
|
|
1344
|
+
if (G == null)
|
|
1325
1345
|
return;
|
|
1326
|
-
A = { ...
|
|
1346
|
+
A = { ...u, top: G.startY };
|
|
1327
1347
|
}
|
|
1328
|
-
if (A != null && (
|
|
1329
|
-
r.push({ ...c, sheetTransform:
|
|
1348
|
+
if (A != null && (I = N(A, this._selectionRenderService), I != null && A != null)) {
|
|
1349
|
+
r.push({ ...c, sheetTransform: I, transform: A });
|
|
1330
1350
|
break;
|
|
1331
1351
|
}
|
|
1332
|
-
this._remainDrawingSize(
|
|
1352
|
+
this._remainDrawingSize(u, r, c);
|
|
1333
1353
|
continue;
|
|
1334
1354
|
}
|
|
1335
|
-
if (
|
|
1355
|
+
if (S >= w && v <= T)
|
|
1336
1356
|
continue;
|
|
1337
|
-
let
|
|
1338
|
-
if (
|
|
1339
|
-
const
|
|
1340
|
-
if (
|
|
1357
|
+
let U = null, M = null;
|
|
1358
|
+
if (S >= w && S <= T) {
|
|
1359
|
+
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: S, endRow: T });
|
|
1360
|
+
if (I == null)
|
|
1341
1361
|
return;
|
|
1342
1362
|
M = {
|
|
1343
|
-
...
|
|
1344
|
-
top: (
|
|
1345
|
-
height: ((
|
|
1363
|
+
...u,
|
|
1364
|
+
top: (I == null ? void 0 : I.startY) || 0,
|
|
1365
|
+
height: ((u == null ? void 0 : u.height) || 0) - I.endY + I.startY
|
|
1346
1366
|
};
|
|
1347
|
-
} else if (
|
|
1348
|
-
const
|
|
1349
|
-
if (
|
|
1367
|
+
} else if (v >= w && v <= T) {
|
|
1368
|
+
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow: v });
|
|
1369
|
+
if (I == null)
|
|
1350
1370
|
return;
|
|
1351
1371
|
M = {
|
|
1352
|
-
...
|
|
1353
|
-
top:
|
|
1372
|
+
...u,
|
|
1373
|
+
top: I.startY - ((u == null ? void 0 : u.height) || 0)
|
|
1354
1374
|
};
|
|
1355
1375
|
} else {
|
|
1356
|
-
const
|
|
1357
|
-
if (
|
|
1376
|
+
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow: T });
|
|
1377
|
+
if (I == null)
|
|
1358
1378
|
return;
|
|
1359
1379
|
if (M = {
|
|
1360
|
-
...
|
|
1361
|
-
height: ((
|
|
1362
|
-
},
|
|
1363
|
-
s.push({ ...c, sheetTransform:
|
|
1380
|
+
...u,
|
|
1381
|
+
height: ((u == null ? void 0 : u.height) || 0) - I.endY + I.startY
|
|
1382
|
+
}, U = N(M, this._selectionRenderService), U != null && M != null) {
|
|
1383
|
+
s.push({ ...c, sheetTransform: U, transform: M });
|
|
1364
1384
|
break;
|
|
1365
1385
|
}
|
|
1366
1386
|
}
|
|
1367
|
-
if (M != null && (
|
|
1368
|
-
r.push({ ...c, sheetTransform:
|
|
1387
|
+
if (M != null && (U = N(M, this._selectionRenderService)), M != null && U != null) {
|
|
1388
|
+
r.push({ ...c, sheetTransform: U, transform: M });
|
|
1369
1389
|
break;
|
|
1370
1390
|
} else
|
|
1371
|
-
this._remainDrawingSize(
|
|
1391
|
+
this._remainDrawingSize(u, r, c);
|
|
1372
1392
|
}
|
|
1373
1393
|
}
|
|
1374
1394
|
}), r.length === 0 && s.length === 0)
|
|
1375
1395
|
return { redos: [], undos: [] };
|
|
1376
|
-
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, e, r), d = [],
|
|
1396
|
+
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, e, r), d = [], h = [];
|
|
1377
1397
|
if (s.length > 0) {
|
|
1378
1398
|
const { redos: l, undos: c } = this._createUndoAndRedoMutation(i, e, s);
|
|
1379
|
-
d.push(...l),
|
|
1399
|
+
d.push(...l), h.push(...c);
|
|
1380
1400
|
}
|
|
1381
1401
|
return {
|
|
1382
1402
|
redos: o,
|
|
1383
1403
|
undos: a,
|
|
1384
1404
|
preRedos: d,
|
|
1385
|
-
preUndos:
|
|
1405
|
+
preUndos: h
|
|
1386
1406
|
};
|
|
1387
1407
|
}
|
|
1388
1408
|
_getDrawingUndoForRowAndColSize(i, e, n, t) {
|
|
1389
1409
|
const r = this._drawingManagerService.getDrawingData(i, e), s = [];
|
|
1390
1410
|
return Object.keys(r).forEach((o) => {
|
|
1391
|
-
const a = r[o], { sheetTransform: d, transform:
|
|
1392
|
-
if (l ===
|
|
1393
|
-
this._remainDrawingSize(
|
|
1411
|
+
const a = r[o], { sheetTransform: d, transform: h, anchorType: l = O.Position } = a;
|
|
1412
|
+
if (l === O.None)
|
|
1413
|
+
this._remainDrawingSize(h, s, a);
|
|
1394
1414
|
else {
|
|
1395
|
-
const { from: c, to:
|
|
1396
|
-
for (let
|
|
1397
|
-
const
|
|
1398
|
-
if (m <
|
|
1415
|
+
const { from: c, to: g } = d, { row: u, column: f } = c, { row: m, column: p } = g;
|
|
1416
|
+
for (let S = 0; S < n.length; S++) {
|
|
1417
|
+
const C = n[S], { startRow: v, endRow: R, startColumn: _, endColumn: b } = C;
|
|
1418
|
+
if (m < v || p < _)
|
|
1399
1419
|
continue;
|
|
1400
|
-
if (l ===
|
|
1401
|
-
this._remainDrawingSize(
|
|
1420
|
+
if (l === O.Position && (u <= v && m >= R || f <= _ && p >= b)) {
|
|
1421
|
+
this._remainDrawingSize(h, s, a);
|
|
1402
1422
|
continue;
|
|
1403
1423
|
}
|
|
1404
|
-
const w =
|
|
1424
|
+
const w = $(
|
|
1425
|
+
{ ...d },
|
|
1426
|
+
this._selectionRenderService,
|
|
1427
|
+
this._skeletonManagerService
|
|
1428
|
+
);
|
|
1405
1429
|
if (w != null) {
|
|
1406
1430
|
s.push({
|
|
1407
1431
|
...a,
|
|
@@ -1418,7 +1442,7 @@ let We = class extends de {
|
|
|
1418
1442
|
if (e === "insert")
|
|
1419
1443
|
n = i.unitId, t = i.subUnitId;
|
|
1420
1444
|
else {
|
|
1421
|
-
const r =
|
|
1445
|
+
const r = le(this._univerInstanceService);
|
|
1422
1446
|
if (r == null)
|
|
1423
1447
|
return;
|
|
1424
1448
|
n = r.unitId, t = r.subUnitId;
|
|
@@ -1429,160 +1453,100 @@ let We = class extends de {
|
|
|
1429
1453
|
const n = this._getUnitIdAndSubUnitId(i, e);
|
|
1430
1454
|
if (n == null)
|
|
1431
1455
|
return { redos: [], undos: [] };
|
|
1432
|
-
const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, a = s.endRow, d = [],
|
|
1433
|
-
if (Object.keys(l).forEach((
|
|
1434
|
-
const f = l[
|
|
1456
|
+
const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, a = s.endRow, d = [], h = [], l = this._sheetDrawingService.getDrawingData(t, r), c = [], g = [];
|
|
1457
|
+
if (Object.keys(l).forEach((u) => {
|
|
1458
|
+
const f = l[u], { sheetTransform: m, transform: p, anchorType: S = O.Position } = f;
|
|
1435
1459
|
if (m == null || p == null)
|
|
1436
1460
|
return;
|
|
1437
|
-
let
|
|
1461
|
+
let C, v;
|
|
1438
1462
|
if (e === "insert") {
|
|
1439
|
-
const _ = this._expandRow(m, p, o, a,
|
|
1440
|
-
|
|
1463
|
+
const _ = this._expandRow(m, p, o, a, S);
|
|
1464
|
+
C = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
|
|
1441
1465
|
} else {
|
|
1442
|
-
const { from: _, to: b } = m, { row: w } = _, { row:
|
|
1443
|
-
if (
|
|
1444
|
-
|
|
1466
|
+
const { from: _, to: b } = m, { row: w } = _, { row: T } = b;
|
|
1467
|
+
if (w >= o && T <= a)
|
|
1468
|
+
g.push({ unitId: t, subUnitId: r, drawingId: u });
|
|
1445
1469
|
else {
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1470
|
+
const D = this._shrinkRow(m, p, o, a, S);
|
|
1471
|
+
C = D == null ? void 0 : D.newSheetTransform, v = D == null ? void 0 : D.newTransform;
|
|
1448
1472
|
}
|
|
1449
1473
|
}
|
|
1450
|
-
if (!
|
|
1474
|
+
if (!C || !v)
|
|
1451
1475
|
return;
|
|
1452
|
-
const
|
|
1453
|
-
c.push(
|
|
1454
|
-
}), c.length === 0 &&
|
|
1476
|
+
const R = { unitId: t, subUnitId: r, drawingId: u, transform: v, sheetTransform: C };
|
|
1477
|
+
c.push(R);
|
|
1478
|
+
}), c.length === 0 && g.length === 0)
|
|
1455
1479
|
return { redos: [], undos: [] };
|
|
1456
1480
|
if (c.length > 0) {
|
|
1457
|
-
const
|
|
1458
|
-
d.push({ id:
|
|
1481
|
+
const u = this._sheetDrawingService.getBatchUpdateOp(c), { undo: f, redo: m, objects: p } = u;
|
|
1482
|
+
d.push({ id: E.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: y.UPDATE } }), h.push({ id: E.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: y.UPDATE } });
|
|
1459
1483
|
}
|
|
1460
|
-
if (
|
|
1461
|
-
const
|
|
1462
|
-
d.push({ id:
|
|
1484
|
+
if (g.length > 0) {
|
|
1485
|
+
const u = this._sheetDrawingService.getBatchRemoveOp(g), f = u.undo, m = u.redo, p = u.objects;
|
|
1486
|
+
d.push({ id: E.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: y.REMOVE } }), h.push({ id: E.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: y.INSERT } });
|
|
1463
1487
|
}
|
|
1464
|
-
return d.push({ id: j.id, params: [t] }),
|
|
1488
|
+
return d.push({ id: j.id, params: [t] }), h.push({ id: j.id, params: [t] }), {
|
|
1465
1489
|
redos: d,
|
|
1466
|
-
undos:
|
|
1490
|
+
undos: h
|
|
1467
1491
|
};
|
|
1468
1492
|
}
|
|
1469
|
-
_moveRangeInterceptor(i) {
|
|
1470
|
-
const { fromRange: e, toRange: n } = i, t = oe(this._univerInstanceService);
|
|
1471
|
-
if (!t)
|
|
1472
|
-
return { redos: [], undos: [] };
|
|
1473
|
-
const { unitId: r, subUnitId: s } = t, o = this._sheetDrawingService.getDrawingData(r, s), a = [], d = this._selectionRenderService.attachRangeWithCoord(e), g = this._selectionRenderService.attachRangeWithCoord(n);
|
|
1474
|
-
if (!d || !g)
|
|
1475
|
-
return { redos: [], undos: [] };
|
|
1476
|
-
Object.keys(o).forEach((u) => {
|
|
1477
|
-
const h = o[u], { sheetTransform: f, transform: m, anchorType: p = E.Position } = h;
|
|
1478
|
-
if (!f || !m || p === E.None)
|
|
1479
|
-
return;
|
|
1480
|
-
const { left: v = 0, top: R = 0, width: S = 0, height: D = 0 } = m, { drawingStartX: _, drawingEndX: b, drawingStartY: w, drawingEndY: U } = {
|
|
1481
|
-
drawingStartX: v,
|
|
1482
|
-
drawingEndX: v + S,
|
|
1483
|
-
drawingStartY: R,
|
|
1484
|
-
drawingEndY: R + D
|
|
1485
|
-
};
|
|
1486
|
-
if (!(d.startX <= _ && b <= d.endX && d.startY <= U && w <= d.endY))
|
|
1487
|
-
return;
|
|
1488
|
-
const { to: I, from: P } = f, M = n.startRow - e.startRow, C = n.startColumn - e.startColumn;
|
|
1489
|
-
let A, $;
|
|
1490
|
-
if (p === E.Both) {
|
|
1491
|
-
const k = this._selectionRenderService.attachRangeWithCoord({
|
|
1492
|
-
startRow: I.row,
|
|
1493
|
-
endRow: P.row,
|
|
1494
|
-
startColumn: I.column,
|
|
1495
|
-
endColumn: P.column
|
|
1496
|
-
}), z = this._selectionRenderService.attachRangeWithCoord({
|
|
1497
|
-
startRow: I.row + M,
|
|
1498
|
-
endRow: P.row + M,
|
|
1499
|
-
startColumn: I.column + C,
|
|
1500
|
-
endColumn: P.column + C
|
|
1501
|
-
});
|
|
1502
|
-
if (!z || !k)
|
|
1503
|
-
return;
|
|
1504
|
-
const B = z.endX - z.startX - (k.endX - k.startX), en = z.endY - z.startY - (k.endY - k.startY);
|
|
1505
|
-
A = {
|
|
1506
|
-
to: { ...I, row: I.row + M, column: I.column + C, columnOffset: I.columnOffset + B },
|
|
1507
|
-
from: { ...P, row: P.row + M, column: P.column + C, columnOffset: I.columnOffset + B, rowOffset: I.rowOffset + en }
|
|
1508
|
-
}, $ = V(A, this._selectionRenderService, this._sheetSkeletonManagerService);
|
|
1509
|
-
} else {
|
|
1510
|
-
const k = g.startX - d.startX, z = g.startY - d.startY;
|
|
1511
|
-
$ = {
|
|
1512
|
-
...m,
|
|
1513
|
-
left: v + k,
|
|
1514
|
-
top: R + z
|
|
1515
|
-
}, A = N($, this._selectionRenderService);
|
|
1516
|
-
}
|
|
1517
|
-
if (!A || !$)
|
|
1518
|
-
return;
|
|
1519
|
-
const Ie = { unitId: r, subUnitId: s, drawingId: u, transform: $, sheetTransform: A };
|
|
1520
|
-
a.push(Ie);
|
|
1521
|
-
});
|
|
1522
|
-
const l = [], c = [];
|
|
1523
|
-
if (a.length > 0) {
|
|
1524
|
-
const u = this._sheetDrawingService.getBatchUpdateOp(a), { undo: h, redo: f, objects: m } = u;
|
|
1525
|
-
l.push({ id: y.id, params: { unitId: r, subUnitId: s, op: f, objects: m, type: T.UPDATE } }), c.push({ id: y.id, params: { unitId: r, subUnitId: s, op: h, objects: m, type: T.UPDATE } });
|
|
1526
|
-
}
|
|
1527
|
-
return { redos: l, undos: c };
|
|
1528
|
-
}
|
|
1529
1493
|
_moveColInterceptor(i, e) {
|
|
1530
1494
|
const n = this._getUnitIdAndSubUnitId(i, e);
|
|
1531
1495
|
if (n == null)
|
|
1532
1496
|
return { redos: [], undos: [] };
|
|
1533
|
-
const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, a = s.endColumn, d = [],
|
|
1534
|
-
if (Object.keys(l).forEach((
|
|
1535
|
-
const f = l[
|
|
1497
|
+
const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, a = s.endColumn, d = [], h = [], l = this._sheetDrawingService.getDrawingData(t, r), c = [], g = [];
|
|
1498
|
+
if (Object.keys(l).forEach((u) => {
|
|
1499
|
+
const f = l[u], { sheetTransform: m, transform: p, anchorType: S = O.Position } = f;
|
|
1536
1500
|
if (m == null || p == null)
|
|
1537
1501
|
return;
|
|
1538
|
-
let
|
|
1502
|
+
let C, v;
|
|
1539
1503
|
if (e === "insert") {
|
|
1540
|
-
const _ = this._expandCol(m, p, o, a,
|
|
1541
|
-
|
|
1504
|
+
const _ = this._expandCol(m, p, o, a, S);
|
|
1505
|
+
C = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
|
|
1542
1506
|
} else {
|
|
1543
|
-
const { from: _, to: b } = m, { column: w } = _, { column:
|
|
1544
|
-
if (w >= o &&
|
|
1545
|
-
|
|
1507
|
+
const { from: _, to: b } = m, { column: w } = _, { column: T } = b;
|
|
1508
|
+
if (w >= o && T <= a)
|
|
1509
|
+
g.push({ unitId: t, subUnitId: r, drawingId: u });
|
|
1546
1510
|
else {
|
|
1547
|
-
const
|
|
1548
|
-
|
|
1511
|
+
const D = this._shrinkCol(m, p, o, a, S);
|
|
1512
|
+
C = D == null ? void 0 : D.newSheetTransform, v = D == null ? void 0 : D.newTransform;
|
|
1549
1513
|
}
|
|
1550
1514
|
}
|
|
1551
|
-
if (!
|
|
1515
|
+
if (!C || !v)
|
|
1552
1516
|
return;
|
|
1553
|
-
const
|
|
1554
|
-
c.push(
|
|
1555
|
-
}), c.length === 0 &&
|
|
1517
|
+
const R = { unitId: t, subUnitId: r, drawingId: u, transform: v, sheetTransform: C };
|
|
1518
|
+
c.push(R);
|
|
1519
|
+
}), c.length === 0 && g.length === 0)
|
|
1556
1520
|
return { redos: [], undos: [] };
|
|
1557
1521
|
if (c.length > 0) {
|
|
1558
|
-
const
|
|
1559
|
-
d.push({ id:
|
|
1522
|
+
const u = this._sheetDrawingService.getBatchUpdateOp(c), { undo: f, redo: m, objects: p } = u;
|
|
1523
|
+
d.push({ id: E.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: y.UPDATE } }), h.push({ id: E.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: y.UPDATE } });
|
|
1560
1524
|
}
|
|
1561
|
-
if (
|
|
1562
|
-
const
|
|
1563
|
-
d.push({ id:
|
|
1525
|
+
if (g.length > 0) {
|
|
1526
|
+
const u = this._sheetDrawingService.getBatchRemoveOp(g), f = u.undo, m = u.redo, p = u.objects;
|
|
1527
|
+
d.push({ id: E.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: y.REMOVE } }), h.push({ id: E.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: y.INSERT } });
|
|
1564
1528
|
}
|
|
1565
|
-
return d.push({ id: j.id, params: [t] }),
|
|
1529
|
+
return d.push({ id: j.id, params: [t] }), h.push({ id: j.id, params: [t] }), { redos: d, undos: h };
|
|
1566
1530
|
}
|
|
1567
|
-
_expandCol(i, e, n, t, r =
|
|
1568
|
-
const s = t - n + 1, { from: o, to: a } = i, { column: d } = o, { column:
|
|
1569
|
-
if (r ===
|
|
1531
|
+
_expandCol(i, e, n, t, r = O.Position) {
|
|
1532
|
+
const s = t - n + 1, { from: o, to: a } = i, { column: d } = o, { column: h } = a;
|
|
1533
|
+
if (r === O.None)
|
|
1570
1534
|
return {
|
|
1571
1535
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1572
1536
|
newTransform: e
|
|
1573
1537
|
};
|
|
1574
1538
|
let l = null, c = null;
|
|
1575
1539
|
if (d >= n) {
|
|
1576
|
-
const
|
|
1577
|
-
if (
|
|
1540
|
+
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: a.row });
|
|
1541
|
+
if (g == null)
|
|
1578
1542
|
return;
|
|
1579
|
-
c = { ...e, left: (e.left || 0) +
|
|
1580
|
-
} else if (
|
|
1581
|
-
if (r ===
|
|
1543
|
+
c = { ...e, left: (e.left || 0) + g.endX - g.startX }, l = N(c, this._selectionRenderService);
|
|
1544
|
+
} else if (h >= t)
|
|
1545
|
+
if (r === O.Both)
|
|
1582
1546
|
l = {
|
|
1583
1547
|
from: { ...o },
|
|
1584
|
-
to: { ...a, column:
|
|
1585
|
-
}, c =
|
|
1548
|
+
to: { ...a, column: h + s }
|
|
1549
|
+
}, c = $(l, this._selectionRenderService, this._skeletonManagerService);
|
|
1586
1550
|
else
|
|
1587
1551
|
return {
|
|
1588
1552
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
@@ -1593,95 +1557,85 @@ let We = class extends de {
|
|
|
1593
1557
|
newTransform: c
|
|
1594
1558
|
} : null;
|
|
1595
1559
|
}
|
|
1596
|
-
_shrinkCol(i, e, n, t, r =
|
|
1597
|
-
const s = t - n + 1, { from: o, to: a } = i, { column: d } = o, { column:
|
|
1598
|
-
if (r ===
|
|
1560
|
+
_shrinkCol(i, e, n, t, r = O.Position) {
|
|
1561
|
+
const s = t - n + 1, { from: o, to: a } = i, { column: d } = o, { column: h } = a;
|
|
1562
|
+
if (r === O.None)
|
|
1599
1563
|
return {
|
|
1600
1564
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1601
1565
|
newTransform: e
|
|
1602
1566
|
};
|
|
1603
1567
|
let l = null, c = null;
|
|
1604
|
-
if (d > t)
|
|
1605
|
-
const u = this._selectionRenderService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: a.row });
|
|
1606
|
-
if (u == null)
|
|
1607
|
-
return;
|
|
1608
|
-
c = { ...e, left: (e.left || 0) - (u.endX - u.startX) }, l = N(c, this._selectionRenderService);
|
|
1609
|
-
} else if (d >= n && g <= t) {
|
|
1610
|
-
const u = this._selectionRenderService.attachRangeWithCoord({
|
|
1611
|
-
startColumn: n,
|
|
1612
|
-
endColumn: t,
|
|
1613
|
-
startRow: 0,
|
|
1614
|
-
endRow: 0
|
|
1615
|
-
});
|
|
1568
|
+
if (d > t)
|
|
1616
1569
|
l = {
|
|
1617
|
-
from: { ...o,
|
|
1618
|
-
to: { ...a,
|
|
1619
|
-
}, c =
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1570
|
+
from: { ...o, column: d - s },
|
|
1571
|
+
to: { ...a, column: h - s }
|
|
1572
|
+
}, c = $(l, this._selectionRenderService, this._skeletonManagerService);
|
|
1573
|
+
else {
|
|
1574
|
+
if (d >= n && h <= t)
|
|
1575
|
+
return null;
|
|
1576
|
+
if (d < n && h > t)
|
|
1577
|
+
if (r === O.Both)
|
|
1578
|
+
l = {
|
|
1579
|
+
from: { ...o },
|
|
1580
|
+
to: { ...a, column: h - s }
|
|
1581
|
+
}, c = $(l, this._selectionRenderService, this._skeletonManagerService);
|
|
1582
|
+
else
|
|
1583
|
+
return {
|
|
1584
|
+
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1585
|
+
newTransform: e
|
|
1586
|
+
};
|
|
1587
|
+
else if (d >= n && d <= t) {
|
|
1588
|
+
if (d === n)
|
|
1589
|
+
c = { ...e, left: (e.left || 0) - i.from.columnOffset };
|
|
1590
|
+
else {
|
|
1591
|
+
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: d - 1, startRow: o.row, endRow: a.row });
|
|
1592
|
+
if (g == null)
|
|
1593
|
+
return;
|
|
1594
|
+
c = { ...e, left: (e.left || 0) - g.endX + g.startX - i.from.columnOffset };
|
|
1595
|
+
}
|
|
1596
|
+
l = N(c, this._selectionRenderService);
|
|
1597
|
+
} else if (h >= n && h <= t && r === O.Both) {
|
|
1598
|
+
const g = this._skeletonManagerService.attachRangeWithCoord({
|
|
1599
|
+
startColumn: n - 1,
|
|
1600
|
+
endColumn: n - 1,
|
|
1601
|
+
startRow: o.row,
|
|
1602
|
+
endRow: a.row
|
|
1603
|
+
});
|
|
1604
|
+
if (g == null)
|
|
1605
|
+
return;
|
|
1625
1606
|
l = {
|
|
1626
1607
|
from: { ...o },
|
|
1627
|
-
to: { ...a, column: g -
|
|
1628
|
-
}, c =
|
|
1629
|
-
else
|
|
1630
|
-
return {
|
|
1631
|
-
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1632
|
-
newTransform: e
|
|
1633
|
-
};
|
|
1634
|
-
else if (d >= n && d <= t) {
|
|
1635
|
-
if (d === n)
|
|
1636
|
-
c = { ...e, left: (e.left || 0) - i.from.columnOffset };
|
|
1637
|
-
else {
|
|
1638
|
-
const u = this._selectionRenderService.attachRangeWithCoord({ startColumn: n, endColumn: d - 1, startRow: o.row, endRow: a.row });
|
|
1639
|
-
if (u == null)
|
|
1640
|
-
return;
|
|
1641
|
-
c = { ...e, left: (e.left || 0) - u.endX + u.startX - i.from.columnOffset };
|
|
1608
|
+
to: { ...a, column: n - 1, columnOffset: g.endX - g.startX }
|
|
1609
|
+
}, c = $(l, this._selectionRenderService, this._skeletonManagerService);
|
|
1642
1610
|
}
|
|
1643
|
-
l = N(c, this._selectionRenderService);
|
|
1644
|
-
} else if (g >= n && g <= t && r === E.Both) {
|
|
1645
|
-
const u = this._selectionRenderService.attachRangeWithCoord({
|
|
1646
|
-
startColumn: n - 1,
|
|
1647
|
-
endColumn: n - 1,
|
|
1648
|
-
startRow: o.row,
|
|
1649
|
-
endRow: a.row
|
|
1650
|
-
});
|
|
1651
|
-
if (u == null)
|
|
1652
|
-
return;
|
|
1653
|
-
l = {
|
|
1654
|
-
from: { ...o },
|
|
1655
|
-
to: { ...a, column: n - 1, columnOffset: u.endX - u.startX }
|
|
1656
|
-
}, c = V(l, this._selectionRenderService, this._sheetSkeletonManagerService);
|
|
1657
1611
|
}
|
|
1658
1612
|
return l != null && c != null ? {
|
|
1659
1613
|
newSheetTransform: l,
|
|
1660
1614
|
newTransform: c
|
|
1661
1615
|
} : null;
|
|
1662
1616
|
}
|
|
1663
|
-
_expandRow(i, e, n, t, r =
|
|
1664
|
-
const s = t - n + 1, { from: o, to: a } = i, { row: d } = o, { row:
|
|
1665
|
-
if (r ===
|
|
1617
|
+
_expandRow(i, e, n, t, r = O.Position) {
|
|
1618
|
+
const s = t - n + 1, { from: o, to: a } = i, { row: d } = o, { row: h } = a;
|
|
1619
|
+
if (r === O.None)
|
|
1666
1620
|
return {
|
|
1667
1621
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1668
1622
|
newTransform: e
|
|
1669
1623
|
};
|
|
1670
1624
|
let l = null, c = null;
|
|
1671
1625
|
if (d >= n) {
|
|
1672
|
-
const
|
|
1673
|
-
if (
|
|
1626
|
+
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: a.column });
|
|
1627
|
+
if (g == null)
|
|
1674
1628
|
return;
|
|
1675
|
-
c = { ...e, top: (e.top || 0) +
|
|
1676
|
-
} else if (
|
|
1677
|
-
if (r ===
|
|
1629
|
+
c = { ...e, top: (e.top || 0) + g.endY - g.startY }, l = N(c, this._selectionRenderService);
|
|
1630
|
+
} else if (h >= t)
|
|
1631
|
+
if (r === O.Both)
|
|
1678
1632
|
l = {
|
|
1679
1633
|
from: { ...o },
|
|
1680
1634
|
to: {
|
|
1681
1635
|
...a,
|
|
1682
|
-
row:
|
|
1636
|
+
row: h + s
|
|
1683
1637
|
}
|
|
1684
|
-
}, c =
|
|
1638
|
+
}, c = $(l, this._selectionRenderService, this._skeletonManagerService);
|
|
1685
1639
|
else
|
|
1686
1640
|
return {
|
|
1687
1641
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
@@ -1692,9 +1646,9 @@ let We = class extends de {
|
|
|
1692
1646
|
newTransform: c
|
|
1693
1647
|
} : null;
|
|
1694
1648
|
}
|
|
1695
|
-
_shrinkRow(i, e, n, t, r =
|
|
1696
|
-
const s = t - n + 1, { from: o, to: a } = i, { row: d } = o, { row:
|
|
1697
|
-
if (r ===
|
|
1649
|
+
_shrinkRow(i, e, n, t, r = O.Position) {
|
|
1650
|
+
const s = t - n + 1, { from: o, to: a } = i, { row: d } = o, { row: h } = a;
|
|
1651
|
+
if (r === O.None)
|
|
1698
1652
|
return {
|
|
1699
1653
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1700
1654
|
newTransform: e
|
|
@@ -1703,51 +1657,41 @@ let We = class extends de {
|
|
|
1703
1657
|
if (d > t)
|
|
1704
1658
|
l = {
|
|
1705
1659
|
from: { ...o, row: d - s },
|
|
1706
|
-
to: { ...a, row:
|
|
1707
|
-
}, c =
|
|
1708
|
-
else
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1660
|
+
to: { ...a, row: h - s }
|
|
1661
|
+
}, c = $(l, this._selectionRenderService, this._skeletonManagerService);
|
|
1662
|
+
else {
|
|
1663
|
+
if (d >= n && h <= t)
|
|
1664
|
+
return null;
|
|
1665
|
+
if (d < n && h > t)
|
|
1666
|
+
if (r === O.Both)
|
|
1667
|
+
l = {
|
|
1668
|
+
from: { ...o },
|
|
1669
|
+
to: { ...a, row: h - s }
|
|
1670
|
+
}, c = $(l, this._selectionRenderService, this._skeletonManagerService);
|
|
1671
|
+
else
|
|
1672
|
+
return {
|
|
1673
|
+
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1674
|
+
newTransform: e
|
|
1675
|
+
};
|
|
1676
|
+
else if (d >= n && d <= t) {
|
|
1677
|
+
if (d === n)
|
|
1678
|
+
c = { ...e, top: (e.top || 0) - i.from.rowOffset };
|
|
1679
|
+
else {
|
|
1680
|
+
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: d - 1, startColumn: o.column, endColumn: a.column });
|
|
1681
|
+
if (g == null)
|
|
1682
|
+
return;
|
|
1683
|
+
c = { ...e, top: (e.top || 0) - g.endY + g.startY - i.from.rowOffset };
|
|
1684
|
+
}
|
|
1685
|
+
l = N(c, this._selectionRenderService);
|
|
1686
|
+
} else if (h >= n && h <= t && r === O.Both) {
|
|
1687
|
+
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: n - 1, endRow: n - 1 });
|
|
1688
|
+
if (g == null)
|
|
1689
|
+
return;
|
|
1724
1690
|
l = {
|
|
1725
1691
|
from: { ...o },
|
|
1726
|
-
to: { ...a, row: g -
|
|
1727
|
-
}, c =
|
|
1728
|
-
else
|
|
1729
|
-
return {
|
|
1730
|
-
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1731
|
-
newTransform: e
|
|
1732
|
-
};
|
|
1733
|
-
else if (d >= n && d <= t) {
|
|
1734
|
-
if (d === n)
|
|
1735
|
-
c = { ...e, top: (e.top || 0) - i.from.rowOffset };
|
|
1736
|
-
else {
|
|
1737
|
-
const u = this._selectionRenderService.attachRangeWithCoord({ startRow: n, endRow: d - 1, startColumn: o.column, endColumn: a.column });
|
|
1738
|
-
if (u == null)
|
|
1739
|
-
return;
|
|
1740
|
-
c = { ...e, top: (e.top || 0) - u.endY + u.startY - i.from.rowOffset };
|
|
1692
|
+
to: { ...a, row: n - 1, rowOffset: g.endY - g.startY }
|
|
1693
|
+
}, c = $(l, this._selectionRenderService, this._skeletonManagerService);
|
|
1741
1694
|
}
|
|
1742
|
-
l = N(c, this._selectionRenderService);
|
|
1743
|
-
} else if (g >= n && g <= t && r === E.Both) {
|
|
1744
|
-
const u = this._selectionRenderService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: n - 1, endRow: n - 1 });
|
|
1745
|
-
if (u == null)
|
|
1746
|
-
return;
|
|
1747
|
-
l = {
|
|
1748
|
-
from: { ...o },
|
|
1749
|
-
to: { ...a, row: n - 1, rowOffset: u.endY - u.startY }
|
|
1750
|
-
}, c = V(l, this._selectionRenderService, this._sheetSkeletonManagerService);
|
|
1751
1695
|
}
|
|
1752
1696
|
return l != null && c != null ? {
|
|
1753
1697
|
newSheetTransform: l,
|
|
@@ -1757,16 +1701,16 @@ let We = class extends de {
|
|
|
1757
1701
|
_commandListener() {
|
|
1758
1702
|
this.disposeWithMe(
|
|
1759
1703
|
this._commandService.onCommandExecuted((i) => {
|
|
1760
|
-
i.id ===
|
|
1704
|
+
i.id === ir.id && setTimeout(() => {
|
|
1761
1705
|
const e = i.params, { unitId: n, subUnitId: t } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
|
|
1762
1706
|
Object.keys(r).forEach((a) => {
|
|
1763
1707
|
const d = r[a];
|
|
1764
|
-
Object.keys(d).forEach((
|
|
1765
|
-
const l = d[
|
|
1708
|
+
Object.keys(d).forEach((h) => {
|
|
1709
|
+
const l = d[h].data;
|
|
1766
1710
|
l != null && Object.keys(l).forEach((c) => {
|
|
1767
|
-
if (a === n &&
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1711
|
+
if (a === n && h === t) {
|
|
1712
|
+
const g = l[c];
|
|
1713
|
+
g.transform = $(g.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(l[c]);
|
|
1770
1714
|
} else
|
|
1771
1715
|
o.push(l[c]);
|
|
1772
1716
|
});
|
|
@@ -1789,29 +1733,29 @@ let We = class extends de {
|
|
|
1789
1733
|
_refreshDrawingTransform(i, e, n) {
|
|
1790
1734
|
const t = this._drawingManagerService.getDrawingData(i, e), r = [];
|
|
1791
1735
|
Object.keys(t).forEach((s) => {
|
|
1792
|
-
const o = t[s], { sheetTransform: a, anchorType: d =
|
|
1793
|
-
if (d ===
|
|
1736
|
+
const o = t[s], { sheetTransform: a, anchorType: d = O.Position } = o;
|
|
1737
|
+
if (d === O.None)
|
|
1794
1738
|
return !0;
|
|
1795
|
-
const { from:
|
|
1739
|
+
const { from: h, to: l } = a, { row: c, column: g } = h, { row: u, column: f } = l;
|
|
1796
1740
|
for (let m = 0; m < n.length; m++) {
|
|
1797
|
-
const p = n[m], { startRow:
|
|
1798
|
-
if (
|
|
1741
|
+
const p = n[m], { startRow: S, endRow: C, startColumn: v, endColumn: R } = p;
|
|
1742
|
+
if (on.intersects(
|
|
1799
1743
|
{
|
|
1800
|
-
startRow:
|
|
1801
|
-
endRow:
|
|
1802
|
-
startColumn:
|
|
1803
|
-
endColumn:
|
|
1744
|
+
startRow: S,
|
|
1745
|
+
endRow: C,
|
|
1746
|
+
startColumn: v,
|
|
1747
|
+
endColumn: R
|
|
1804
1748
|
},
|
|
1805
1749
|
{
|
|
1806
1750
|
startRow: c,
|
|
1807
|
-
endRow:
|
|
1808
|
-
startColumn:
|
|
1751
|
+
endRow: u,
|
|
1752
|
+
startColumn: g,
|
|
1809
1753
|
endColumn: f
|
|
1810
1754
|
}
|
|
1811
|
-
) || c >
|
|
1755
|
+
) || c > C || g > R) {
|
|
1812
1756
|
r.push({
|
|
1813
1757
|
...o,
|
|
1814
|
-
transform:
|
|
1758
|
+
transform: $(a, this._selectionRenderService, this._skeletonManagerService)
|
|
1815
1759
|
});
|
|
1816
1760
|
break;
|
|
1817
1761
|
}
|
|
@@ -1819,23 +1763,22 @@ let We = class extends de {
|
|
|
1819
1763
|
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(j.id, [i]));
|
|
1820
1764
|
}
|
|
1821
1765
|
};
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
], We);
|
|
1766
|
+
Ae = oi([
|
|
1767
|
+
se(oe.Rendered, Ae),
|
|
1768
|
+
de(0, V),
|
|
1769
|
+
de(1, W(sr)),
|
|
1770
|
+
de(2, K),
|
|
1771
|
+
de(3, H),
|
|
1772
|
+
de(4, z),
|
|
1773
|
+
de(5, he)
|
|
1774
|
+
], Ae);
|
|
1832
1775
|
var di = Object.defineProperty, li = Object.getOwnPropertyDescriptor, ui = (i, e, n, t) => {
|
|
1833
1776
|
for (var r = t > 1 ? void 0 : t ? li(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1834
1777
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1835
1778
|
return t && r && di(e, n, r), r;
|
|
1836
|
-
},
|
|
1837
|
-
function
|
|
1838
|
-
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(
|
|
1779
|
+
}, ne = (i, e) => (n, t) => e(n, t, i);
|
|
1780
|
+
function gi(i, e, n, t) {
|
|
1781
|
+
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(On.VIEW_MAIN), a = {
|
|
1839
1782
|
left: !0,
|
|
1840
1783
|
top: !0
|
|
1841
1784
|
};
|
|
@@ -1844,57 +1787,57 @@ function hi(i, e, n, t) {
|
|
|
1844
1787
|
...i,
|
|
1845
1788
|
absolute: a
|
|
1846
1789
|
};
|
|
1847
|
-
const { left: d, right:
|
|
1848
|
-
let
|
|
1849
|
-
d <
|
|
1790
|
+
const { left: d, right: h, top: l, bottom: c } = i, g = t.getFreeze(), { startColumn: u, startRow: f, xSplit: m, ySplit: p } = g, S = n.getNoMergeCellPositionByIndexWithNoHeader(f - p, u - m), C = n.getNoMergeCellPositionByIndexWithNoHeader(f, u), { rowHeaderWidth: v, columnHeaderHeight: R } = n, _ = C.startX - S.startX, b = C.startY - S.startY, { top: w, left: T, viewportScrollX: D, viewportScrollY: P } = o;
|
|
1791
|
+
let U, M;
|
|
1792
|
+
d < T ? (a.left = !0, U = (_ + v + (d - T)) * r, M = Math.max(
|
|
1850
1793
|
Math.min(
|
|
1851
|
-
(_ +
|
|
1852
|
-
(_ +
|
|
1794
|
+
(_ + v + (h - T)) * r,
|
|
1795
|
+
(_ + v) * r
|
|
1853
1796
|
),
|
|
1854
|
-
(
|
|
1855
|
-
)) : (a.left = !1,
|
|
1856
|
-
let
|
|
1857
|
-
return l < w ? (a.top = !0,
|
|
1797
|
+
(h - D) * r
|
|
1798
|
+
)) : (a.left = !1, U = Math.max((d - D) * r, (_ + v) * r), M = Math.max((h - D) * r, (_ + v) * r));
|
|
1799
|
+
let I, A;
|
|
1800
|
+
return l < w ? (a.top = !0, I = (b + R + (l - w)) * s, A = Math.max(
|
|
1858
1801
|
Math.min(
|
|
1859
|
-
(b +
|
|
1860
|
-
(b +
|
|
1802
|
+
(b + R + (h - w)) * s,
|
|
1803
|
+
(b + R) * s
|
|
1861
1804
|
),
|
|
1862
|
-
(c -
|
|
1863
|
-
)) : (a.top = !1,
|
|
1864
|
-
left:
|
|
1805
|
+
(c - P) * s
|
|
1806
|
+
)) : (a.top = !1, I = Math.max((l - P) * s, (b + R) * s), A = Math.max((c - P) * s, (b + R) * s)), {
|
|
1807
|
+
left: U,
|
|
1865
1808
|
right: M,
|
|
1866
|
-
top:
|
|
1809
|
+
top: I,
|
|
1867
1810
|
bottom: A,
|
|
1868
1811
|
absolute: a
|
|
1869
1812
|
};
|
|
1870
1813
|
}
|
|
1871
|
-
const
|
|
1872
|
-
const { scene: r } = e, { left: s, top: o, width: a, height: d, angle:
|
|
1814
|
+
const ze = (i, e, n, t) => {
|
|
1815
|
+
const { scene: r } = e, { left: s, top: o, width: a, height: d, angle: h } = i, l = {
|
|
1873
1816
|
left: s,
|
|
1874
1817
|
right: s + a,
|
|
1875
1818
|
top: o,
|
|
1876
1819
|
bottom: o + d
|
|
1877
|
-
}, c =
|
|
1820
|
+
}, c = gi(l, r, n, t);
|
|
1878
1821
|
return {
|
|
1879
1822
|
startX: c.left,
|
|
1880
1823
|
endX: c.right,
|
|
1881
1824
|
startY: c.top,
|
|
1882
1825
|
endY: c.bottom,
|
|
1883
|
-
rotate:
|
|
1826
|
+
rotate: h,
|
|
1884
1827
|
width: a,
|
|
1885
1828
|
height: d,
|
|
1886
1829
|
absolute: c.absolute
|
|
1887
1830
|
};
|
|
1888
1831
|
};
|
|
1889
|
-
let
|
|
1832
|
+
let tt = class extends ae {
|
|
1890
1833
|
constructor(e, n, t, r, s, o, a) {
|
|
1891
1834
|
super();
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1835
|
+
X(this, "_domLayerMap", /* @__PURE__ */ new Map());
|
|
1836
|
+
X(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
1837
|
+
X(this, "_transformChange$", new ht());
|
|
1838
|
+
X(this, "transformChange$", this._transformChange$.asObservable());
|
|
1839
|
+
X(this, "_remove$", new ht());
|
|
1840
|
+
X(this, "remove$", this._remove$.asObservable());
|
|
1898
1841
|
this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._selectionRenderService = s, this._canvasFloatDomService = o, this._sheetDrawingService = a, this._drawingAddListener(), this._scrollUpdateListener(), this._featureUpdateListener(), this._deleteListener();
|
|
1899
1842
|
}
|
|
1900
1843
|
_ensureMap(e, n) {
|
|
@@ -1918,35 +1861,35 @@ let it = class extends de {
|
|
|
1918
1861
|
// eslint-disable-next-line max-lines-per-function
|
|
1919
1862
|
this._drawingManagerService.add$.subscribe((e) => {
|
|
1920
1863
|
e.forEach((n) => {
|
|
1921
|
-
var
|
|
1922
|
-
const { unitId: t, subUnitId: r, drawingId: s } = n, o =
|
|
1864
|
+
var ot, at;
|
|
1865
|
+
const { unitId: t, subUnitId: r, drawingId: s } = n, o = le(this._univerInstanceService, { unitId: t, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(n), d = (ot = this._renderManagerService.getRenderById(t)) == null ? void 0 : ot.with(ie).getWorksheetSkeleton(r);
|
|
1923
1866
|
if (a == null || o == null || d == null)
|
|
1924
1867
|
return;
|
|
1925
|
-
const { transform:
|
|
1926
|
-
if (l !==
|
|
1868
|
+
const { transform: h, drawingType: l } = a;
|
|
1869
|
+
if (l !== Ye.DRAWING_DOM)
|
|
1927
1870
|
return;
|
|
1928
1871
|
const c = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1929
1872
|
if (c == null)
|
|
1930
1873
|
return;
|
|
1931
|
-
const { scene:
|
|
1932
|
-
if (
|
|
1874
|
+
const { scene: g, canvas: u } = c;
|
|
1875
|
+
if (h == null)
|
|
1933
1876
|
return !0;
|
|
1934
|
-
const { left: f, top: m, width: p, height:
|
|
1935
|
-
if (
|
|
1936
|
-
|
|
1877
|
+
const { left: f, top: m, width: p, height: S, angle: C, flipX: v, flipY: R, skewX: _, skewY: b } = h, w = Rn({ unitId: t, subUnitId: r, drawingId: s }), T = g.getObject(w);
|
|
1878
|
+
if (T != null) {
|
|
1879
|
+
T.transformByState({ left: f, top: m, width: p, height: S, angle: C, flipX: v, flipY: R, skewX: _, skewY: b });
|
|
1937
1880
|
return;
|
|
1938
1881
|
}
|
|
1939
|
-
const
|
|
1882
|
+
const D = {
|
|
1940
1883
|
left: f,
|
|
1941
1884
|
top: m,
|
|
1942
1885
|
width: p,
|
|
1943
|
-
height:
|
|
1886
|
+
height: S,
|
|
1944
1887
|
zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
|
|
1945
|
-
},
|
|
1946
|
-
|
|
1947
|
-
const
|
|
1888
|
+
}, P = new En(w, D);
|
|
1889
|
+
g.addObject(P, yn).attachTransformerTo(P);
|
|
1890
|
+
const U = this._ensureMap(t, r), M = new an(), I = ze(P, c.renderObject, d.skeleton, o.worksheet), A = new Wn(I), G = {
|
|
1948
1891
|
dispose: M,
|
|
1949
|
-
rect:
|
|
1892
|
+
rect: P,
|
|
1950
1893
|
position$: A,
|
|
1951
1894
|
unitId: t,
|
|
1952
1895
|
subUnitId: r
|
|
@@ -1955,29 +1898,29 @@ let it = class extends de {
|
|
|
1955
1898
|
position$: A,
|
|
1956
1899
|
id: s,
|
|
1957
1900
|
componentKey: a.componentKey,
|
|
1958
|
-
onPointerDown: (
|
|
1959
|
-
|
|
1901
|
+
onPointerDown: (x) => {
|
|
1902
|
+
u.dispatchEvent(new PointerEvent(x.type, x));
|
|
1960
1903
|
},
|
|
1961
|
-
onPointerMove: (
|
|
1962
|
-
|
|
1904
|
+
onPointerMove: (x) => {
|
|
1905
|
+
u.dispatchEvent(new PointerEvent(x.type, x));
|
|
1963
1906
|
},
|
|
1964
|
-
onPointerUp: (
|
|
1965
|
-
|
|
1907
|
+
onPointerUp: (x) => {
|
|
1908
|
+
u.dispatchEvent(new PointerEvent(x.type, x));
|
|
1966
1909
|
},
|
|
1967
|
-
onWheel: (
|
|
1968
|
-
|
|
1910
|
+
onWheel: (x) => {
|
|
1911
|
+
u.dispatchEvent(new WheelEvent(x.type, x));
|
|
1969
1912
|
},
|
|
1970
|
-
props: (
|
|
1913
|
+
props: (at = U.get(s)) == null ? void 0 : at.props
|
|
1971
1914
|
});
|
|
1972
|
-
const
|
|
1973
|
-
const
|
|
1915
|
+
const J = P.onTransformChange$.subscribeEvent(() => {
|
|
1916
|
+
const x = ze(P, c.renderObject, d.skeleton, o.worksheet);
|
|
1974
1917
|
A.next(
|
|
1975
|
-
|
|
1918
|
+
x
|
|
1976
1919
|
);
|
|
1977
1920
|
});
|
|
1978
1921
|
M.add(() => {
|
|
1979
1922
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
1980
|
-
}),
|
|
1923
|
+
}), J && M.add(J), this._domLayerInfoMap.set(s, G);
|
|
1981
1924
|
});
|
|
1982
1925
|
})
|
|
1983
1926
|
);
|
|
@@ -1986,25 +1929,25 @@ let it = class extends de {
|
|
|
1986
1929
|
this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
1987
1930
|
var t, r;
|
|
1988
1931
|
const n = (s, o) => {
|
|
1989
|
-
var
|
|
1990
|
-
const a = this._getSceneAndTransformerByDrawingSearch(s), d = this._ensureMap(s, o),
|
|
1991
|
-
!a || !l || !c ||
|
|
1992
|
-
const f = this._domLayerInfoMap.get(
|
|
1932
|
+
var g;
|
|
1933
|
+
const a = this._getSceneAndTransformerByDrawingSearch(s), d = this._ensureMap(s, o), h = Array.from(d.keys()), l = le(this._univerInstanceService, { unitId: s, subUnitId: o }), c = (g = this._renderManagerService.getRenderById(s)) == null ? void 0 : g.with(ie).getWorksheetSkeleton(o);
|
|
1934
|
+
!a || !l || !c || h.forEach((u) => {
|
|
1935
|
+
const f = this._domLayerInfoMap.get(u);
|
|
1993
1936
|
if (f) {
|
|
1994
|
-
const m =
|
|
1937
|
+
const m = ze(f.rect, a.renderObject, c.skeleton, l.worksheet);
|
|
1995
1938
|
f.position$.next(m);
|
|
1996
1939
|
}
|
|
1997
1940
|
});
|
|
1998
1941
|
};
|
|
1999
|
-
if (e.id ===
|
|
1942
|
+
if (e.id === An.id) {
|
|
2000
1943
|
const s = e.params, { unitId: o, sheetId: a } = s;
|
|
2001
1944
|
n(o, a);
|
|
2002
|
-
} else if (e.id ===
|
|
1945
|
+
} else if (e.id === Nn.id) {
|
|
2003
1946
|
const s = e.params, { unitId: o } = s;
|
|
2004
1947
|
Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((d) => {
|
|
2005
1948
|
n(o, d);
|
|
2006
1949
|
});
|
|
2007
|
-
} else if (e.id ===
|
|
1950
|
+
} else if (e.id === or.id) {
|
|
2008
1951
|
const { unitId: s, subUnitId: o } = e.params;
|
|
2009
1952
|
n(s, o);
|
|
2010
1953
|
}
|
|
@@ -2022,7 +1965,7 @@ let it = class extends de {
|
|
|
2022
1965
|
}, d = this._selectionRenderService.getSelectionCellByPosition(t, s);
|
|
2023
1966
|
if (d == null)
|
|
2024
1967
|
return;
|
|
2025
|
-
const
|
|
1968
|
+
const h = {
|
|
2026
1969
|
column: d.actualColumn,
|
|
2027
1970
|
columnOffset: t - d.startX,
|
|
2028
1971
|
row: d.actualRow,
|
|
@@ -2030,7 +1973,7 @@ let it = class extends de {
|
|
|
2030
1973
|
};
|
|
2031
1974
|
return {
|
|
2032
1975
|
from: a,
|
|
2033
|
-
to:
|
|
1976
|
+
to: h
|
|
2034
1977
|
};
|
|
2035
1978
|
}
|
|
2036
1979
|
_featureUpdateListener() {
|
|
@@ -2038,7 +1981,7 @@ let it = class extends de {
|
|
|
2038
1981
|
this._drawingManagerService.update$.subscribe((e) => {
|
|
2039
1982
|
e.forEach((n) => {
|
|
2040
1983
|
const t = this._drawingManagerService.getDrawingByParam(n);
|
|
2041
|
-
if (!t || t.drawingType !==
|
|
1984
|
+
if (!t || t.drawingType !== Ye.DRAWING_DOM)
|
|
2042
1985
|
return;
|
|
2043
1986
|
const r = {
|
|
2044
1987
|
...t.transform
|
|
@@ -2058,13 +2001,13 @@ let it = class extends de {
|
|
|
2058
2001
|
);
|
|
2059
2002
|
}
|
|
2060
2003
|
addFloatDomToPosition(e) {
|
|
2061
|
-
const n =
|
|
2004
|
+
const n = le(this._univerInstanceService, {
|
|
2062
2005
|
unitId: e.unitId,
|
|
2063
2006
|
subUnitId: e.subUnitId
|
|
2064
2007
|
});
|
|
2065
2008
|
if (!n)
|
|
2066
2009
|
throw new Error("cannot find current target!");
|
|
2067
|
-
const { unitId: t, subUnitId: r } = n, { initPosition: s, componentKey: o } = e, a =
|
|
2010
|
+
const { unitId: t, subUnitId: r } = n, { initPosition: s, componentKey: o } = e, a = re.generateRandomId(), d = this._getPosition(s);
|
|
2068
2011
|
if (d == null)
|
|
2069
2012
|
return;
|
|
2070
2013
|
this._ensureMap(t, r).set(a, e);
|
|
@@ -2072,7 +2015,7 @@ let it = class extends de {
|
|
|
2072
2015
|
unitId: t,
|
|
2073
2016
|
subUnitId: r,
|
|
2074
2017
|
drawingId: a,
|
|
2075
|
-
drawingType:
|
|
2018
|
+
drawingType: Ye.DRAWING_DOM,
|
|
2076
2019
|
componentKey: o,
|
|
2077
2020
|
sheetTransform: d,
|
|
2078
2021
|
transform: {
|
|
@@ -2082,7 +2025,7 @@ let it = class extends de {
|
|
|
2082
2025
|
height: s.endY - s.startY
|
|
2083
2026
|
}
|
|
2084
2027
|
};
|
|
2085
|
-
return this._commandService.executeCommand(
|
|
2028
|
+
return this._commandService.executeCommand(st.id, {
|
|
2086
2029
|
unitId: t,
|
|
2087
2030
|
drawings: [l]
|
|
2088
2031
|
}), {
|
|
@@ -2104,26 +2047,26 @@ let it = class extends de {
|
|
|
2104
2047
|
const d = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: e });
|
|
2105
2048
|
if (!d)
|
|
2106
2049
|
return;
|
|
2107
|
-
const
|
|
2108
|
-
this._commandService.syncExecuteCommand(
|
|
2050
|
+
const h = this._sheetDrawingService.getBatchRemoveOp([d]), { redo: l, objects: c } = h;
|
|
2051
|
+
this._commandService.syncExecuteCommand(E.id, { unitId: r, subUnitId: s, op: l, objects: c, type: y.REMOVE });
|
|
2109
2052
|
}
|
|
2110
2053
|
}
|
|
2111
2054
|
};
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
],
|
|
2121
|
-
var
|
|
2055
|
+
tt = ui([
|
|
2056
|
+
ne(0, W(K)),
|
|
2057
|
+
ne(1, he),
|
|
2058
|
+
ne(2, W(V)),
|
|
2059
|
+
ne(3, z),
|
|
2060
|
+
ne(4, Ge),
|
|
2061
|
+
ne(5, W(zn)),
|
|
2062
|
+
ne(6, H)
|
|
2063
|
+
], tt);
|
|
2064
|
+
var hi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, fi = (i, e, n, t) => {
|
|
2122
2065
|
for (var r = t > 1 ? void 0 : t ? mi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2123
2066
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2124
|
-
return t && r &&
|
|
2125
|
-
},
|
|
2126
|
-
let
|
|
2067
|
+
return t && r && hi(e, n, r), r;
|
|
2068
|
+
}, Oe = (i, e) => (n, t) => e(n, t, i);
|
|
2069
|
+
let Ne = class extends ae {
|
|
2127
2070
|
constructor(i, e, n, t) {
|
|
2128
2071
|
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
|
|
2129
2072
|
}
|
|
@@ -2148,16 +2091,16 @@ let Be = class extends de {
|
|
|
2148
2091
|
const { unitId: t, subUnitId: r } = e, s = this._renderManagerService.getRenderById(t);
|
|
2149
2092
|
if (!s)
|
|
2150
2093
|
return n(i);
|
|
2151
|
-
const o = s.with(
|
|
2094
|
+
const o = s.with(ie).getWorksheetSkeleton(r);
|
|
2152
2095
|
if (!o)
|
|
2153
2096
|
return n(i);
|
|
2154
2097
|
const a = this._drawingManagerService.getDrawingDataForUnit(t), d = a == null ? void 0 : a[e.subUnitId];
|
|
2155
2098
|
if (!d)
|
|
2156
2099
|
return n(i);
|
|
2157
|
-
const { scaleX:
|
|
2158
|
-
return
|
|
2159
|
-
if (!
|
|
2160
|
-
const f = o.skeleton.getCellPositionByOffset(
|
|
2100
|
+
const { scaleX: h, scaleY: l } = s.scene, c = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = d.order.map((u) => d.data[u]).filter((u) => u.drawingType !== Ve.DRAWING_DOM);
|
|
2101
|
+
return g.length ? (g.forEach((u) => {
|
|
2102
|
+
if (!u.groupId && u.transform && re.isDefine(u.transform.left) && re.isDefine(u.transform.top) && re.isDefine(u.transform.width) && re.isDefine(u.transform.height)) {
|
|
2103
|
+
const f = o.skeleton.getCellPositionByOffset(u.transform.left, u.transform.top, h, l, { x: 0, y: 0 }), m = o.skeleton.getCellPositionByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, h, l, { x: 0, y: 0 });
|
|
2161
2104
|
f.column < c.startColumn && (c.startColumn = f.column), f.row < c.startRow && (c.startRow = f.row), c.endRow < m.row && (c.endRow = m.row), c.endColumn < m.column && (c.endColumn = m.column);
|
|
2162
2105
|
}
|
|
2163
2106
|
}), n(c)) : n(i);
|
|
@@ -2167,26 +2110,26 @@ let Be = class extends de {
|
|
|
2167
2110
|
);
|
|
2168
2111
|
}
|
|
2169
2112
|
};
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
],
|
|
2113
|
+
Ne = fi([
|
|
2114
|
+
se(oe.Rendered, Ne),
|
|
2115
|
+
Oe(0, W(jn)),
|
|
2116
|
+
Oe(1, W(wn)),
|
|
2117
|
+
Oe(2, z),
|
|
2118
|
+
Oe(3, K)
|
|
2119
|
+
], Ne);
|
|
2177
2120
|
var pi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, _i = (i, e, n, t) => {
|
|
2178
2121
|
for (var r = t > 1 ? void 0 : t ? wi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2179
2122
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2180
2123
|
return t && r && pi(e, n, r), r;
|
|
2181
2124
|
}, fe = (i, e) => (n, t) => e(n, t, i);
|
|
2182
|
-
let
|
|
2125
|
+
let je = class extends ae {
|
|
2183
2126
|
constructor(i, e, n, t, r) {
|
|
2184
2127
|
super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
2185
2128
|
}
|
|
2186
2129
|
_initDrawingVisible() {
|
|
2187
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2130
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(B.UNIVER_SHEET);
|
|
2188
2131
|
this.disposeWithMe(
|
|
2189
|
-
|
|
2132
|
+
Re([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
2190
2133
|
if (!e) {
|
|
2191
2134
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
2192
2135
|
return;
|
|
@@ -2197,15 +2140,15 @@ let $e = class extends de {
|
|
|
2197
2140
|
return;
|
|
2198
2141
|
}
|
|
2199
2142
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
2200
|
-
if (this._permissionService.composePermission([new ft(r).id, new
|
|
2143
|
+
if (this._permissionService.composePermission([new ft(r).id, new Xe(r, s).id]).every((a) => a.value))
|
|
2201
2144
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
2202
2145
|
else {
|
|
2203
2146
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
2204
|
-
const a = e.getUnitId(), d = t.getSheetId(),
|
|
2205
|
-
if (
|
|
2147
|
+
const a = e.getUnitId(), d = t.getSheetId(), h = this._drawingManagerService.getDrawingData(a, d), l = Object.values(h), c = this._renderManagerService.getRenderById(a), g = c == null ? void 0 : c.scene;
|
|
2148
|
+
if (g == null)
|
|
2206
2149
|
return;
|
|
2207
|
-
|
|
2208
|
-
f.classType ===
|
|
2150
|
+
g.getAllObjects().forEach((f) => {
|
|
2151
|
+
f.classType === ce.IMAGE && l.some((m) => f.oKey.includes(m.drawingId)) && g.removeObject(f);
|
|
2209
2152
|
});
|
|
2210
2153
|
}
|
|
2211
2154
|
});
|
|
@@ -2213,9 +2156,9 @@ let $e = class extends de {
|
|
|
2213
2156
|
);
|
|
2214
2157
|
}
|
|
2215
2158
|
_initDrawingEditable() {
|
|
2216
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2159
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(B.UNIVER_SHEET);
|
|
2217
2160
|
this.disposeWithMe(
|
|
2218
|
-
|
|
2161
|
+
Re([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
2219
2162
|
if (!e) {
|
|
2220
2163
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
2221
2164
|
return;
|
|
@@ -2226,15 +2169,15 @@ let $e = class extends de {
|
|
|
2226
2169
|
return;
|
|
2227
2170
|
}
|
|
2228
2171
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
2229
|
-
if (this._permissionService.composePermission([new
|
|
2172
|
+
if (this._permissionService.composePermission([new Ze(r).id, new Te(r, s).id]).every((a) => a.value))
|
|
2230
2173
|
this._drawingManagerService.setDrawingEditable(!0);
|
|
2231
2174
|
else {
|
|
2232
2175
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
2233
|
-
const a = e.getUnitId(), d = t.getSheetId(),
|
|
2234
|
-
if (
|
|
2176
|
+
const a = e.getUnitId(), d = t.getSheetId(), h = this._drawingManagerService.getDrawingData(a, d), l = Object.values(h), c = this._renderManagerService.getRenderById(a), g = c == null ? void 0 : c.scene;
|
|
2177
|
+
if (g == null)
|
|
2235
2178
|
return;
|
|
2236
|
-
|
|
2237
|
-
f.classType ===
|
|
2179
|
+
g.getAllObjects().forEach((f) => {
|
|
2180
|
+
f.classType === ce.IMAGE && l.some((m) => f.oKey.includes(m.drawingId)) && g.detachTransformerFrom(f);
|
|
2238
2181
|
});
|
|
2239
2182
|
}
|
|
2240
2183
|
});
|
|
@@ -2242,9 +2185,9 @@ let $e = class extends de {
|
|
|
2242
2185
|
);
|
|
2243
2186
|
}
|
|
2244
2187
|
_initViewPermissionChange() {
|
|
2245
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2188
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(B.UNIVER_SHEET);
|
|
2246
2189
|
this.disposeWithMe(
|
|
2247
|
-
|
|
2190
|
+
Re([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
2248
2191
|
e && e.activeSheet$.subscribe((t) => {
|
|
2249
2192
|
var c;
|
|
2250
2193
|
if (!t)
|
|
@@ -2254,26 +2197,26 @@ let $e = class extends de {
|
|
|
2254
2197
|
const a = this._renderManagerService.getRenderById(r), d = a == null ? void 0 : a.scene;
|
|
2255
2198
|
if (d == null)
|
|
2256
2199
|
return;
|
|
2257
|
-
const
|
|
2200
|
+
const h = d.getTransformerByCreate(), l = this._permissionService.composePermission$([new ft(r).id, new Xe(r, s).id]).pipe(mt((g) => g.every((u) => u.value)));
|
|
2258
2201
|
l == null || l.pipe(
|
|
2259
|
-
|
|
2260
|
-
|
|
2202
|
+
Me((g) => g !== o),
|
|
2203
|
+
De()
|
|
2261
2204
|
).subscribe({
|
|
2262
|
-
next: (
|
|
2263
|
-
o =
|
|
2264
|
-
const
|
|
2265
|
-
|
|
2266
|
-
p.classType ===
|
|
2267
|
-
}),
|
|
2205
|
+
next: (g) => {
|
|
2206
|
+
o = g, this._drawingManagerService.setDrawingVisible(g);
|
|
2207
|
+
const u = d.getAllObjects(), f = this._drawingManagerService.getDrawingData(r, s), m = Object.values(f);
|
|
2208
|
+
g ? this._drawingManagerService.addNotification(m) : (u.forEach((p) => {
|
|
2209
|
+
p.classType === ce.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.removeObject(p);
|
|
2210
|
+
}), h.clearSelectedObjects());
|
|
2268
2211
|
}
|
|
2269
|
-
}), (c = this._permissionService.getPermissionPoint$(new
|
|
2270
|
-
|
|
2271
|
-
|
|
2212
|
+
}), (c = this._permissionService.getPermissionPoint$(new Xe(r, s).id)) == null || c.pipe(
|
|
2213
|
+
Me((g) => g.value !== o),
|
|
2214
|
+
De()
|
|
2272
2215
|
).subscribe({
|
|
2273
2216
|
complete: () => {
|
|
2274
2217
|
o = !0, this._drawingManagerService.setDrawingVisible(!0);
|
|
2275
|
-
const
|
|
2276
|
-
this._drawingManagerService.addNotification(
|
|
2218
|
+
const g = this._drawingManagerService.getDrawingData(r, s), u = Object.values(g);
|
|
2219
|
+
this._drawingManagerService.addNotification(u);
|
|
2277
2220
|
}
|
|
2278
2221
|
});
|
|
2279
2222
|
});
|
|
@@ -2281,9 +2224,9 @@ let $e = class extends de {
|
|
|
2281
2224
|
);
|
|
2282
2225
|
}
|
|
2283
2226
|
_initEditPermissionChange() {
|
|
2284
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2227
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(B.UNIVER_SHEET);
|
|
2285
2228
|
this.disposeWithMe(
|
|
2286
|
-
|
|
2229
|
+
Re([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
2287
2230
|
e && e.activeSheet$.subscribe((t) => {
|
|
2288
2231
|
var c;
|
|
2289
2232
|
if (!t)
|
|
@@ -2293,31 +2236,31 @@ let $e = class extends de {
|
|
|
2293
2236
|
const a = this._renderManagerService.getRenderById(r), d = a == null ? void 0 : a.scene;
|
|
2294
2237
|
if (d == null)
|
|
2295
2238
|
return;
|
|
2296
|
-
const
|
|
2239
|
+
const h = d.getTransformerByCreate(), l = this._permissionService.composePermission$([new Ze(r).id, new Te(r, s).id]).pipe(mt((g) => g.every((u) => u.value)));
|
|
2297
2240
|
l == null || l.pipe(
|
|
2298
|
-
|
|
2299
|
-
|
|
2241
|
+
Me((g) => g !== o),
|
|
2242
|
+
De()
|
|
2300
2243
|
).subscribe({
|
|
2301
|
-
next: (
|
|
2302
|
-
o =
|
|
2303
|
-
const
|
|
2304
|
-
|
|
2305
|
-
p.classType ===
|
|
2306
|
-
}), this._drawingManagerService.addNotification(m)) : (
|
|
2307
|
-
p.classType ===
|
|
2308
|
-
}),
|
|
2244
|
+
next: (g) => {
|
|
2245
|
+
o = g, this._drawingManagerService.setDrawingEditable(g);
|
|
2246
|
+
const u = d.getAllObjects(), f = this._drawingManagerService.getDrawingData(r, s), m = Object.values(f);
|
|
2247
|
+
g ? (u.forEach((p) => {
|
|
2248
|
+
p.classType === ce.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.attachTransformerTo(p);
|
|
2249
|
+
}), this._drawingManagerService.addNotification(m)) : (u.forEach((p) => {
|
|
2250
|
+
p.classType === ce.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.detachTransformerFrom(p);
|
|
2251
|
+
}), h.clearSelectedObjects());
|
|
2309
2252
|
}
|
|
2310
|
-
}), (c = this._permissionService.getPermissionPoint$(new
|
|
2311
|
-
|
|
2312
|
-
|
|
2253
|
+
}), (c = this._permissionService.getPermissionPoint$(new Te(r, s).id)) == null || c.pipe(
|
|
2254
|
+
Me((g) => g.value !== o),
|
|
2255
|
+
De()
|
|
2313
2256
|
).subscribe({
|
|
2314
2257
|
complete: () => {
|
|
2315
2258
|
o = !0;
|
|
2316
|
-
const
|
|
2317
|
-
if (
|
|
2259
|
+
const g = e.getUnitId(), u = t.getSheetId(), f = this._drawingManagerService.getDrawingData(g, u), m = Object.values(f), p = this._renderManagerService.getRenderById(g), S = p == null ? void 0 : p.scene;
|
|
2260
|
+
if (S == null)
|
|
2318
2261
|
return;
|
|
2319
|
-
this._drawingManagerService.setDrawingEditable(!0),
|
|
2320
|
-
|
|
2262
|
+
this._drawingManagerService.setDrawingEditable(!0), S.getAllObjects().forEach((v) => {
|
|
2263
|
+
v.classType === ce.IMAGE && m.some((R) => v.oKey.includes(R.drawingId)) && S.detachTransformerFrom(v);
|
|
2321
2264
|
});
|
|
2322
2265
|
}
|
|
2323
2266
|
});
|
|
@@ -2326,67 +2269,71 @@ let $e = class extends de {
|
|
|
2326
2269
|
);
|
|
2327
2270
|
}
|
|
2328
2271
|
};
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
fe(0,
|
|
2332
|
-
fe(1,
|
|
2333
|
-
fe(2,
|
|
2334
|
-
fe(3,
|
|
2335
|
-
fe(4, W(
|
|
2336
|
-
],
|
|
2272
|
+
je = _i([
|
|
2273
|
+
se(oe.Rendered, je),
|
|
2274
|
+
fe(0, z),
|
|
2275
|
+
fe(1, K),
|
|
2276
|
+
fe(2, dn),
|
|
2277
|
+
fe(3, he),
|
|
2278
|
+
fe(4, W(cn))
|
|
2279
|
+
], je);
|
|
2337
2280
|
var vi = Object.defineProperty, Si = Object.getOwnPropertyDescriptor, Ci = (i, e, n, t) => {
|
|
2338
2281
|
for (var r = t > 1 ? void 0 : t ? Si(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2339
2282
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2340
2283
|
return t && r && vi(e, n, r), r;
|
|
2341
|
-
},
|
|
2342
|
-
let
|
|
2343
|
-
constructor(e, n, t
|
|
2284
|
+
}, Ke = (i, e) => (n, t) => e(n, t, i);
|
|
2285
|
+
let Le = class extends ae {
|
|
2286
|
+
constructor(e, n, t) {
|
|
2344
2287
|
super();
|
|
2345
|
-
|
|
2346
|
-
this._sheetClipboardService = e, this.
|
|
2288
|
+
X(this, "_copyInfo");
|
|
2289
|
+
this._sheetClipboardService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._initCopyPaste();
|
|
2347
2290
|
}
|
|
2348
2291
|
_initCopyPaste() {
|
|
2349
2292
|
this._sheetClipboardService.addClipboardHook({
|
|
2350
2293
|
id: "SHEET_IMAGE_UI_PLUGIN",
|
|
2351
2294
|
onBeforeCopy: (e, n, t) => this._collect(e, n, t),
|
|
2352
2295
|
onPasteCells: (e, n, t, r) => {
|
|
2353
|
-
const { copyType: s = ut.COPY, pasteType: o } = r, { range: a } = e || {}, { range: d, unitId:
|
|
2354
|
-
return this._generateMutations(d, { copyType: s, pasteType: o, copyRange: a, unitId:
|
|
2296
|
+
const { copyType: s = ut.COPY, pasteType: o } = r, { range: a } = e || {}, { range: d, unitId: h, subUnitId: l } = n;
|
|
2297
|
+
return this._generateMutations(d, { copyType: s, pasteType: o, copyRange: a, unitId: h, subUnitId: l });
|
|
2355
2298
|
},
|
|
2356
2299
|
onPastePlainText: (e, n) => ({ undos: [], redos: [] })
|
|
2357
2300
|
});
|
|
2358
2301
|
}
|
|
2359
2302
|
_collect(e, n, t) {
|
|
2360
|
-
|
|
2361
|
-
|
|
2303
|
+
var g;
|
|
2304
|
+
const r = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(ie);
|
|
2305
|
+
if (!r) return;
|
|
2306
|
+
const s = r.attachRangeWithCoord(t);
|
|
2307
|
+
if (!s)
|
|
2362
2308
|
return;
|
|
2363
|
-
const { startX:
|
|
2364
|
-
Object.keys(
|
|
2365
|
-
const
|
|
2366
|
-
if (
|
|
2309
|
+
const { startX: o, endX: a, startY: d, endY: h } = s, l = this._sheetDrawingService.getDrawingData(e, n), c = [];
|
|
2310
|
+
Object.keys(l).forEach((u) => {
|
|
2311
|
+
const f = l[u], { transform: m } = f;
|
|
2312
|
+
if (f.anchorType !== O.Both || !m)
|
|
2367
2313
|
return;
|
|
2368
|
-
const { left:
|
|
2369
|
-
drawingStartX:
|
|
2370
|
-
drawingEndX:
|
|
2371
|
-
drawingStartY:
|
|
2372
|
-
drawingEndY:
|
|
2314
|
+
const { left: p = 0, top: S = 0, width: C = 0, height: v = 0 } = m, { drawingStartX: R, drawingEndX: _, drawingStartY: b, drawingEndY: w } = {
|
|
2315
|
+
drawingStartX: p,
|
|
2316
|
+
drawingEndX: p + C,
|
|
2317
|
+
drawingStartY: S,
|
|
2318
|
+
drawingEndY: S + v
|
|
2373
2319
|
};
|
|
2374
|
-
|
|
2375
|
-
}),
|
|
2376
|
-
drawings:
|
|
2320
|
+
o <= R && _ <= a && d <= b && w <= h && c.push(f);
|
|
2321
|
+
}), c.length && (this._copyInfo = {
|
|
2322
|
+
drawings: c,
|
|
2377
2323
|
unitId: e,
|
|
2378
2324
|
subUnitId: n
|
|
2379
2325
|
});
|
|
2380
2326
|
}
|
|
2381
2327
|
// eslint-disable-next-line max-lines-per-function
|
|
2382
2328
|
_generateMutations(e, n) {
|
|
2329
|
+
var D;
|
|
2383
2330
|
if (!this._copyInfo)
|
|
2384
2331
|
return { redos: [], undos: [] };
|
|
2385
2332
|
if ([
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2333
|
+
Ie.SPECIAL_PASTE_COL_WIDTH,
|
|
2334
|
+
Ie.SPECIAL_PASTE_VALUE,
|
|
2335
|
+
Ie.SPECIAL_PASTE_FORMAT,
|
|
2336
|
+
Ie.SPECIAL_PASTE_FORMULA
|
|
2390
2337
|
].includes(
|
|
2391
2338
|
n.pasteType
|
|
2392
2339
|
))
|
|
@@ -2394,96 +2341,101 @@ let Ve = class extends de {
|
|
|
2394
2341
|
const { copyRange: t } = n;
|
|
2395
2342
|
if (!t)
|
|
2396
2343
|
return { redos: [], undos: [] };
|
|
2397
|
-
const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [a, d], mapFunc:
|
|
2344
|
+
const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [a, d], mapFunc: h } = Ln([t, e]), { row: l, col: c } = h(a.startRow, a.startColumn), { row: g, col: u } = h(d.startRow, d.startColumn), f = (D = this._renderManagerService.getRenderById(s)) == null ? void 0 : D.with(ie);
|
|
2345
|
+
if (!f)
|
|
2346
|
+
return { redos: [], undos: [] };
|
|
2347
|
+
const m = f.attachRangeWithCoord({
|
|
2398
2348
|
startRow: l,
|
|
2399
2349
|
endRow: l,
|
|
2400
2350
|
startColumn: c,
|
|
2401
2351
|
endColumn: c
|
|
2402
|
-
}),
|
|
2403
|
-
startRow:
|
|
2404
|
-
endRow:
|
|
2405
|
-
startColumn:
|
|
2406
|
-
endColumn:
|
|
2352
|
+
}), p = f.attachRangeWithCoord({
|
|
2353
|
+
startRow: g,
|
|
2354
|
+
endRow: g,
|
|
2355
|
+
startColumn: u,
|
|
2356
|
+
endColumn: u
|
|
2407
2357
|
});
|
|
2408
|
-
if (!
|
|
2358
|
+
if (!m || !p)
|
|
2409
2359
|
return { redos: [], undos: [] };
|
|
2410
|
-
const
|
|
2411
|
-
return r.forEach((
|
|
2412
|
-
const { transform:
|
|
2413
|
-
if (!
|
|
2360
|
+
const S = [], C = [], v = p.startX - m.startX, R = p.startY - m.startY, _ = g - l, b = u - c, w = n.copyType === ut.CUT, { _sheetDrawingService: T } = this;
|
|
2361
|
+
return r.forEach((P) => {
|
|
2362
|
+
const { transform: U, sheetTransform: M } = P;
|
|
2363
|
+
if (!U)
|
|
2414
2364
|
return;
|
|
2415
|
-
const
|
|
2416
|
-
...
|
|
2365
|
+
const I = {
|
|
2366
|
+
...P,
|
|
2417
2367
|
unitId: s,
|
|
2418
2368
|
subUnitId: o,
|
|
2419
|
-
drawingId:
|
|
2369
|
+
drawingId: w ? P.drawingId : re.generateRandomId(),
|
|
2420
2370
|
transform: {
|
|
2421
|
-
...
|
|
2422
|
-
left:
|
|
2423
|
-
top:
|
|
2371
|
+
...U,
|
|
2372
|
+
left: U.left + v,
|
|
2373
|
+
top: U.top + R
|
|
2424
2374
|
},
|
|
2425
2375
|
sheetTransform: {
|
|
2426
|
-
to: { ...
|
|
2427
|
-
from: { ...
|
|
2376
|
+
to: { ...M.to, row: M.to.row + _, column: M.to.column + b },
|
|
2377
|
+
from: { ...M.from, row: M.from.row + _, column: M.from.column + b }
|
|
2428
2378
|
}
|
|
2429
2379
|
};
|
|
2430
|
-
if (
|
|
2431
|
-
const { undo:
|
|
2432
|
-
|
|
2433
|
-
id:
|
|
2380
|
+
if (w) {
|
|
2381
|
+
const { undo: A, redo: G, objects: J } = T.getBatchUpdateOp([I]);
|
|
2382
|
+
S.push({
|
|
2383
|
+
id: E.id,
|
|
2434
2384
|
params: {
|
|
2435
2385
|
unitId: s,
|
|
2436
2386
|
subUnitId: o,
|
|
2437
|
-
type:
|
|
2438
|
-
op:
|
|
2439
|
-
objects:
|
|
2387
|
+
type: y.UPDATE,
|
|
2388
|
+
op: G,
|
|
2389
|
+
objects: J
|
|
2440
2390
|
}
|
|
2441
|
-
}),
|
|
2442
|
-
id:
|
|
2391
|
+
}), C.push({
|
|
2392
|
+
id: E.id,
|
|
2443
2393
|
params: {
|
|
2444
2394
|
unitId: s,
|
|
2445
2395
|
subUnitId: o,
|
|
2446
|
-
type:
|
|
2447
|
-
op:
|
|
2448
|
-
objects:
|
|
2396
|
+
type: y.UPDATE,
|
|
2397
|
+
op: A,
|
|
2398
|
+
objects: J
|
|
2449
2399
|
}
|
|
2450
2400
|
});
|
|
2451
2401
|
} else {
|
|
2452
|
-
const { undo:
|
|
2453
|
-
|
|
2402
|
+
const { undo: A, redo: G, objects: J } = T.getBatchAddOp([I]);
|
|
2403
|
+
S.push({ id: E.id, params: { op: G, unitId: s, subUnitId: o, objects: J, type: y.INSERT } }), C.push({ id: E.id, params: { op: A, unitId: s, subUnitId: o, objects: J, type: y.REMOVE } });
|
|
2454
2404
|
}
|
|
2455
2405
|
}), {
|
|
2456
|
-
redos:
|
|
2457
|
-
undos:
|
|
2406
|
+
redos: S,
|
|
2407
|
+
undos: C
|
|
2458
2408
|
};
|
|
2459
2409
|
}
|
|
2460
2410
|
};
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
],
|
|
2468
|
-
var
|
|
2469
|
-
for (var r = t > 1 ? void 0 : t ? Ri(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2411
|
+
Le = Ci([
|
|
2412
|
+
se(oe.Ready, Le),
|
|
2413
|
+
Ke(0, Bn),
|
|
2414
|
+
Ke(1, K),
|
|
2415
|
+
Ke(2, H)
|
|
2416
|
+
], Le);
|
|
2417
|
+
var Zt = Object.defineProperty, Ii = Object.getOwnPropertyDescriptor, Ri = (i, e, n) => e in i ? Zt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Mi = (i, e, n, t) => {
|
|
2418
|
+
for (var r = t > 1 ? void 0 : t ? Ii(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2470
2419
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2471
|
-
return t && r &&
|
|
2472
|
-
},
|
|
2473
|
-
const
|
|
2474
|
-
let
|
|
2420
|
+
return t && r && Zt(e, n, r), r;
|
|
2421
|
+
}, Je = (i, e) => (n, t) => e(n, t, i), qt = (i, e, n) => Ri(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2422
|
+
const Di = "SHEET_IMAGE_UI_PLUGIN";
|
|
2423
|
+
let $e = class extends ln {
|
|
2475
2424
|
constructor(e = {}, n, t, r) {
|
|
2476
2425
|
super();
|
|
2477
|
-
|
|
2478
|
-
this._injector = n, this._localeService = t, this._renderManagerService = r, this._pluginConfig =
|
|
2426
|
+
X(this, "_pluginConfig");
|
|
2427
|
+
this._injector = n, this._localeService = t, this._renderManagerService = r, this._pluginConfig = re.deepMerge({}, ri, e);
|
|
2479
2428
|
}
|
|
2480
2429
|
onStarting(e) {
|
|
2481
2430
|
super.onStarting(e), this._initDependencies(e);
|
|
2482
2431
|
}
|
|
2432
|
+
onRendered() {
|
|
2433
|
+
this._registerRenderModules();
|
|
2434
|
+
}
|
|
2483
2435
|
_initDependencies(e) {
|
|
2484
2436
|
const n = [
|
|
2485
2437
|
// services
|
|
2486
|
-
[
|
|
2438
|
+
[tt],
|
|
2487
2439
|
// controllers
|
|
2488
2440
|
[
|
|
2489
2441
|
pe,
|
|
@@ -2491,39 +2443,45 @@ let Xe = class extends hn {
|
|
|
2491
2443
|
useFactory: () => this._injector.createInstance(pe, this._pluginConfig)
|
|
2492
2444
|
}
|
|
2493
2445
|
],
|
|
2494
|
-
[
|
|
2495
|
-
[
|
|
2496
|
-
[
|
|
2497
|
-
[Ve]
|
|
2446
|
+
[Pe],
|
|
2447
|
+
[Ne],
|
|
2448
|
+
[je]
|
|
2498
2449
|
], t = [
|
|
2499
|
-
|
|
2500
|
-
|
|
2450
|
+
Ue,
|
|
2451
|
+
Ae
|
|
2501
2452
|
];
|
|
2502
|
-
n.forEach((r) => e.add(r)), t.forEach((r) => this._renderManagerService.registerRenderModule(
|
|
2453
|
+
n.forEach((r) => e.add(r)), t.forEach((r) => this._renderManagerService.registerRenderModule(B.UNIVER_SHEET, r));
|
|
2454
|
+
}
|
|
2455
|
+
_registerRenderModules() {
|
|
2456
|
+
[
|
|
2457
|
+
[Le]
|
|
2458
|
+
].forEach((e) => {
|
|
2459
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(B.UNIVER_SHEET, e));
|
|
2460
|
+
});
|
|
2503
2461
|
}
|
|
2504
2462
|
};
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
],
|
|
2463
|
+
qt($e, "type", B.UNIVER_SHEET);
|
|
2464
|
+
qt($e, "pluginName", Di);
|
|
2465
|
+
$e = Mi([
|
|
2466
|
+
un(Mn, _n, vn),
|
|
2467
|
+
Je(1, W(nt)),
|
|
2468
|
+
Je(2, W(_e)),
|
|
2469
|
+
Je(3, K)
|
|
2470
|
+
], $e);
|
|
2513
2471
|
export {
|
|
2514
2472
|
j as ClearSheetDrawingTransformerOperation,
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2473
|
+
Jt as DeleteDrawingsCommand,
|
|
2474
|
+
Vt as EditSheetDrawingOperation,
|
|
2475
|
+
xt as GroupSheetDrawingCommand,
|
|
2476
|
+
Be as InsertCellImageOperation,
|
|
2477
|
+
xe as InsertFloatImageOperation,
|
|
2478
|
+
st as InsertSheetDrawingCommand,
|
|
2479
|
+
ve as MoveDrawingsCommand,
|
|
2480
|
+
it as RemoveSheetDrawingCommand,
|
|
2523
2481
|
Gt as SetDrawingArrangeCommand,
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2482
|
+
Fe as SetSheetDrawingCommand,
|
|
2483
|
+
tt as SheetCanvasFloatDomManagerService,
|
|
2484
|
+
$t as SidebarSheetDrawingOperation,
|
|
2485
|
+
Ft as UngroupSheetDrawingCommand,
|
|
2486
|
+
$e as UniverSheetsDrawingUIPlugin
|
|
2529
2487
|
};
|