@univerjs/sheets-drawing-ui 0.2.3 → 0.2.4-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +565 -549
- package/lib/types/controllers/drawing-popup-menu.controller.d.ts +1 -2
- package/lib/types/controllers/sheet-drawing.controller.d.ts +1 -2
- package/lib/types/plugin.d.ts +1 -2
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +8 -4
- package/lib/types/views/menu/image.menu.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +23 -25
package/lib/es/index.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as F, ICommandService as V, IUndoRedoService as ge, LocaleService as _e, IUniverInstanceService as he, RxDisposable as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
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";
|
|
1
|
+
var en = Object.defineProperty;
|
|
2
|
+
var tn = (i, e, n) => e in i ? en(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var H = (i, e, n) => tn(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CommandType as F, ICommandService as V, IUndoRedoService as ge, LocaleService as _e, IUniverInstanceService as he, useDependency as q, RxDisposable as nn, UniverInstanceType as B, connectInjector as rn, toDisposable as sn, FOCUSING_COMMON_DRAWINGS as we, OnLifecycle as ie, LifecycleStages as se, Inject as W, Injector as nt, IContextService as _t, Disposable as oe, Direction as Q, FOCUSING_FORMULA_EDITOR as on, EDITOR_ACTIVATED as an, Rectangle as cn, DrawingTypeEnum as Ye, DisposableCollection as dn, Tools as ne, UserManagerService as ln, IPermissionService as un, Plugin as gn, DependentOn as hn } from "@univerjs/core";
|
|
5
|
+
import { ImageCropperObject as mn, COMPONENT_IMAGE_POPUP_MENU as fn, OpenImageCropOperation as pn, ImageResetSizeOperation as wn, DrawingCommonPanel as _n, DrawingRenderService as vn, UniverDrawingUIPlugin as Sn } from "@univerjs/drawing-ui";
|
|
6
|
+
import { ISheetDrawingService as k, SetDrawingApplyMutation as E, DrawingApplyType as y, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as Cn } from "@univerjs/sheets-drawing";
|
|
7
|
+
import { IDrawingManagerService as z, IImageIoService as vt, ArrangeTypeEnum as Ce, DrawingTypeEnum as Ve, DRAWING_IMAGE_COUNT_LIMIT as dt, ImageUploadStatusType as ke, DRAWING_IMAGE_ALLOW_SIZE as In, getImageSize as Rn, DRAWING_IMAGE_WIDTH_LIMIT as lt, DRAWING_IMAGE_HEIGHT_LIMIT as ut, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Mn, getDrawingShapeKeyByDrawingSearch as Dn, UniverDrawingPlugin as bn } from "@univerjs/drawing";
|
|
8
|
+
import { IRenderManagerService as K, getGroupState as En, transformObjectOutOfGroup as yn, precisionTo as ee, Rect as On, DRAWING_OBJECT_LAYER_INDEX as Pn, SHEET_VIEWPORT_KEY as Tn, RENDER_CLASS_TYPE as ae } from "@univerjs/engine-render";
|
|
9
|
+
import { SheetCanvasPopManagerService as Un, ISheetSelectionRenderService as Ge, SheetSkeletonManagerService as re, attachRangeWithCoord as An, getCurrentRangeDisable$ as Nn, SetScrollOperation as jn, SetZoomRatioOperation as Ln, SheetPrintInterceptorService as Bn, COPY_TYPE as gt, PREDEFINED_HOOK_NAME as Ie, virtualizeDiscreteRanges as Wn, ISheetClipboardService as $n } from "@univerjs/sheets-ui";
|
|
10
|
+
import { takeUntil as ht, Subject as mt, BehaviorSubject as Vn, combineLatest as Re, map as ft, filter as Me, distinctUntilChanged as De } from "rxjs";
|
|
11
|
+
import { ISidebarService as Gn, BuiltInUIPart as xn, IUIPartsService as Fn, IMessageService as Yn, MenuItemType as St, MenuPosition as kn, MenuGroup as Hn, getMenuHiddenObservable as Ct, KeyCode as ue, ComponentManager as Xn, IMenuService as zn, IShortcutService as Kn, CanvasFloatDomService as Jn } from "@univerjs/ui";
|
|
12
|
+
import { getSheetCommandTarget as le, SheetsSelectionsService as Zn, WorkbookEditablePermission as Ze, WorksheetEditPermission as Pe, RangeProtectionPermissionEditPoint as qn, InsertRowCommand as It, InsertColCommand as Rt, RemoveRowCommand as Mt, RemoveColCommand as Dt, DeleteRangeMoveLeftCommand as bt, DeleteRangeMoveUpCommand as Et, InsertRangeMoveDownCommand as yt, InsertRangeMoveRightCommand as Ot, DeltaRowHeightCommand as qe, SetRowHeightCommand as Qe, DeltaColumnWidthCommand as Pt, SetColWidthCommand as Tt, SetRowHiddenCommand as Ut, SetSpecificRowsVisibleCommand as At, SetSpecificColsVisibleCommand as Nt, SetColHiddenCommand as jt, SetRowVisibleMutation as Qn, SetRowHiddenMutation as er, SetColVisibleMutation as tr, SetColHiddenMutation as nr, SetWorksheetRowHeightMutation as rr, SetWorksheetColWidthMutation as ir, SetWorksheetActiveOperation as sr, SheetInterceptorService as or, SetFrozenMutation as ar, WorkbookViewPermission as pt, WorksheetViewPermission as He } from "@univerjs/sheets";
|
|
13
|
+
import L, { useEffect as rt, forwardRef as Lt, useRef as Bt, createElement as Wt, useState as et } from "react";
|
|
14
|
+
import { MessageType as be, RadioGroup as cr, Radio as Xe } from "@univerjs/design";
|
|
17
15
|
import Ee from "clsx";
|
|
18
16
|
const j = {
|
|
19
17
|
id: "sheet.operation.clear-drawing-transformer",
|
|
@@ -29,37 +27,37 @@ const j = {
|
|
|
29
27
|
id: "sheet.command.remove-sheet-image",
|
|
30
28
|
type: F.COMMAND,
|
|
31
29
|
handler: (i, e) => {
|
|
32
|
-
const n = i.get(V), t = i.get(ge), r = i.get(
|
|
30
|
+
const n = i.get(V), t = i.get(ge), r = i.get(k);
|
|
33
31
|
if (!e) return !1;
|
|
34
32
|
const { drawings: s } = e, o = [];
|
|
35
33
|
s.forEach((f) => {
|
|
36
34
|
const { unitId: m } = f;
|
|
37
35
|
o.push(m);
|
|
38
36
|
});
|
|
39
|
-
const a = r.getBatchRemoveOp(s), { unitId: d, subUnitId: h, undo: l, redo: c, objects:
|
|
40
|
-
return n.syncExecuteCommand(E.id, { unitId: d, subUnitId: h, op: c, objects:
|
|
37
|
+
const a = r.getBatchRemoveOp(s), { unitId: d, subUnitId: h, undo: l, redo: c, objects: u } = a;
|
|
38
|
+
return n.syncExecuteCommand(E.id, { unitId: d, subUnitId: h, op: c, objects: u, type: y.REMOVE }) ? (t.pushUndoRedo({
|
|
41
39
|
unitID: d,
|
|
42
40
|
undoMutations: [
|
|
43
|
-
{ id: E.id, params: { unitId: d, subUnitId: h, op: l, objects:
|
|
41
|
+
{ id: E.id, params: { unitId: d, subUnitId: h, op: l, objects: u, type: y.INSERT } },
|
|
44
42
|
{ id: j.id, params: o }
|
|
45
43
|
],
|
|
46
44
|
redoMutations: [
|
|
47
|
-
{ id: E.id, params: { unitId: d, subUnitId: h, op: c, objects:
|
|
45
|
+
{ id: E.id, params: { unitId: d, subUnitId: h, op: c, objects: u, type: y.REMOVE } },
|
|
48
46
|
{ id: j.id, params: o }
|
|
49
47
|
]
|
|
50
48
|
}), !0) : !1;
|
|
51
49
|
}
|
|
52
|
-
},
|
|
50
|
+
}, $t = "COMPONENT_SHEET_DRAWING_PANEL", Vt = {
|
|
53
51
|
id: "sidebar.operation.sheet-image",
|
|
54
52
|
type: F.COMMAND,
|
|
55
53
|
handler: async (i, e) => {
|
|
56
|
-
const n = i.get(
|
|
54
|
+
const n = i.get(Gn), t = i.get(_e), r = i.get(he), s = i.get(z);
|
|
57
55
|
if (!le(r)) return !1;
|
|
58
56
|
switch (e.value) {
|
|
59
57
|
case "open":
|
|
60
58
|
n.open({
|
|
61
59
|
header: { title: t.t("sheetImage.panel.title") },
|
|
62
|
-
children: { label:
|
|
60
|
+
children: { label: $t },
|
|
63
61
|
onClose: () => {
|
|
64
62
|
s.focusDrawing(null);
|
|
65
63
|
},
|
|
@@ -73,21 +71,21 @@ const j = {
|
|
|
73
71
|
}
|
|
74
72
|
return !0;
|
|
75
73
|
}
|
|
76
|
-
},
|
|
74
|
+
}, Gt = {
|
|
77
75
|
id: "sheet.operation.edit-sheet-image",
|
|
78
76
|
type: F.OPERATION,
|
|
79
77
|
handler: (i, e) => {
|
|
80
78
|
const n = i.get(z), t = i.get(V);
|
|
81
|
-
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
uploadLoading:
|
|
85
|
-
uploadLoadingBody:
|
|
86
|
-
uploadLoadingBodyAnimation:
|
|
87
|
-
univerCircleAnimation:
|
|
88
|
-
uploadLoadingBodyText:
|
|
89
|
-
},
|
|
90
|
-
const i =
|
|
79
|
+
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(Vt.id, { value: "open" }), !0);
|
|
80
|
+
}
|
|
81
|
+
}, dr = "univer-upload-loading", lr = "univer-upload-loading-body", ur = "univer-upload-loading-body-animation", gr = "univer-UniverCircleAnimation", hr = "univer-upload-loading-body-text", ye = {
|
|
82
|
+
uploadLoading: dr,
|
|
83
|
+
uploadLoadingBody: lr,
|
|
84
|
+
uploadLoadingBodyAnimation: ur,
|
|
85
|
+
univerCircleAnimation: gr,
|
|
86
|
+
uploadLoadingBodyText: hr
|
|
87
|
+
}, mr = () => {
|
|
88
|
+
const i = q(vt), e = q(_e), [n, t] = L.useState(0);
|
|
91
89
|
return rt(() => {
|
|
92
90
|
const r = i.change$.subscribe((s) => {
|
|
93
91
|
t(s);
|
|
@@ -97,19 +95,19 @@ const j = {
|
|
|
97
95
|
};
|
|
98
96
|
}, [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
97
|
};
|
|
100
|
-
var
|
|
101
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
98
|
+
var fr = Object.defineProperty, pr = Object.getOwnPropertyDescriptor, wr = (i, e, n, t) => {
|
|
99
|
+
for (var r = t > 1 ? void 0 : t ? pr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
102
100
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
103
|
-
return t && r &&
|
|
101
|
+
return t && r && fr(e, n, r), r;
|
|
104
102
|
}, te = (i, e) => (n, t) => e(n, t, i);
|
|
105
|
-
let
|
|
103
|
+
let Te = class extends nn {
|
|
106
104
|
constructor(e, n, t, r, s, o, a) {
|
|
107
105
|
super();
|
|
108
|
-
|
|
106
|
+
H(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
109
107
|
this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = a, this._init();
|
|
110
108
|
}
|
|
111
109
|
_init() {
|
|
112
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(B.UNIVER_SHEET).pipe(
|
|
110
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(B.UNIVER_SHEET).pipe(ht(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(B.UNIVER_SHEET).pipe(ht(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(B.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(xn.CONTENT, () => rn(mr, this._injector));
|
|
113
111
|
}
|
|
114
112
|
_dispose(e) {
|
|
115
113
|
const n = e.getUnitId();
|
|
@@ -124,7 +122,7 @@ let Pe = class extends tn {
|
|
|
124
122
|
_hasCropObject(e) {
|
|
125
123
|
const n = e.getAllObjects();
|
|
126
124
|
for (const t of n)
|
|
127
|
-
if (t instanceof
|
|
125
|
+
if (t instanceof mn)
|
|
128
126
|
return !0;
|
|
129
127
|
return !1;
|
|
130
128
|
}
|
|
@@ -138,7 +136,7 @@ let Pe = class extends tn {
|
|
|
138
136
|
return;
|
|
139
137
|
let r;
|
|
140
138
|
this.disposeWithMe(
|
|
141
|
-
|
|
139
|
+
sn(
|
|
142
140
|
t.createControl$.subscribe(() => {
|
|
143
141
|
if (this._contextService.setContextValue(we, !0), this._hasCropObject(n))
|
|
144
142
|
return;
|
|
@@ -153,18 +151,18 @@ let Pe = class extends tn {
|
|
|
153
151
|
const d = a.oKey, h = this._drawingManagerService.getDrawingOKey(d);
|
|
154
152
|
if (!h)
|
|
155
153
|
return;
|
|
156
|
-
const { unitId: l, subUnitId: c, drawingId:
|
|
154
|
+
const { unitId: l, subUnitId: c, drawingId: u } = h;
|
|
157
155
|
r == null || r.dispose(), r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
158
|
-
componentKey:
|
|
156
|
+
componentKey: fn,
|
|
159
157
|
direction: "horizontal",
|
|
160
158
|
offset: [2, 0],
|
|
161
159
|
extraProps: {
|
|
162
|
-
menuItems: this._getImageMenuItems(l, c,
|
|
160
|
+
menuItems: this._getImageMenuItems(l, c, u)
|
|
163
161
|
}
|
|
164
162
|
})), this._drawingManagerService.focusDrawing([{
|
|
165
163
|
unitId: l,
|
|
166
164
|
subUnitId: c,
|
|
167
|
-
drawingId:
|
|
165
|
+
drawingId: u
|
|
168
166
|
}]);
|
|
169
167
|
})
|
|
170
168
|
)
|
|
@@ -183,7 +181,7 @@ let Pe = class extends tn {
|
|
|
183
181
|
{
|
|
184
182
|
label: "image-popup.edit",
|
|
185
183
|
index: 0,
|
|
186
|
-
commandId:
|
|
184
|
+
commandId: Gt.id,
|
|
187
185
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
188
186
|
disable: !1
|
|
189
187
|
},
|
|
@@ -197,30 +195,30 @@ let Pe = class extends tn {
|
|
|
197
195
|
{
|
|
198
196
|
label: "image-popup.crop",
|
|
199
197
|
index: 2,
|
|
200
|
-
commandId:
|
|
198
|
+
commandId: pn.id,
|
|
201
199
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
202
200
|
disable: !1
|
|
203
201
|
},
|
|
204
202
|
{
|
|
205
203
|
label: "image-popup.reset",
|
|
206
204
|
index: 3,
|
|
207
|
-
commandId:
|
|
205
|
+
commandId: wn.id,
|
|
208
206
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
209
207
|
disable: !1
|
|
210
208
|
}
|
|
211
209
|
];
|
|
212
210
|
}
|
|
213
211
|
};
|
|
214
|
-
|
|
215
|
-
se
|
|
212
|
+
Te = wr([
|
|
213
|
+
ie(se.Steady, Te),
|
|
216
214
|
te(0, W(nt)),
|
|
217
215
|
te(1, z),
|
|
218
|
-
te(2, W(
|
|
216
|
+
te(2, W(Un)),
|
|
219
217
|
te(3, K),
|
|
220
218
|
te(4, he),
|
|
221
|
-
te(5,
|
|
222
|
-
te(6, W(
|
|
223
|
-
],
|
|
219
|
+
te(5, _t),
|
|
220
|
+
te(6, W(Fn))
|
|
221
|
+
], Te);
|
|
224
222
|
const xe = {
|
|
225
223
|
id: "sheet.operation.insert-float-image",
|
|
226
224
|
type: F.OPERATION,
|
|
@@ -233,17 +231,17 @@ const xe = {
|
|
|
233
231
|
id: "sheet.command.insert-sheet-image",
|
|
234
232
|
type: F.COMMAND,
|
|
235
233
|
handler: (i, e) => {
|
|
236
|
-
const n = i.get(V), t = i.get(ge), r = i.get(
|
|
234
|
+
const n = i.get(V), t = i.get(ge), r = i.get(k);
|
|
237
235
|
if (!e) return !1;
|
|
238
|
-
const s = e.drawings, o = s.map((f) => f.unitId), a = r.getBatchAddOp(s), { unitId: d, subUnitId: h, undo: l, redo: c, objects:
|
|
239
|
-
return n.syncExecuteCommand(E.id, { op: c, unitId: d, subUnitId: h, objects:
|
|
236
|
+
const s = e.drawings, o = s.map((f) => f.unitId), a = r.getBatchAddOp(s), { unitId: d, subUnitId: h, undo: l, redo: c, objects: u } = a;
|
|
237
|
+
return n.syncExecuteCommand(E.id, { op: c, unitId: d, subUnitId: h, objects: u, type: y.INSERT }) ? (t.pushUndoRedo({
|
|
240
238
|
unitID: d,
|
|
241
239
|
undoMutations: [
|
|
242
|
-
{ id: E.id, params: { op: l, unitId: d, subUnitId: h, objects:
|
|
240
|
+
{ id: E.id, params: { op: l, unitId: d, subUnitId: h, objects: u, type: y.REMOVE } },
|
|
243
241
|
{ id: j.id, params: o }
|
|
244
242
|
],
|
|
245
243
|
redoMutations: [
|
|
246
|
-
{ id: E.id, params: { op: c, unitId: d, subUnitId: h, objects:
|
|
244
|
+
{ id: E.id, params: { op: c, unitId: d, subUnitId: h, objects: u, type: y.INSERT } },
|
|
247
245
|
{ id: j.id, params: o }
|
|
248
246
|
]
|
|
249
247
|
}), !0) : !1;
|
|
@@ -252,7 +250,7 @@ const xe = {
|
|
|
252
250
|
id: "sheet.command.set-sheet-image",
|
|
253
251
|
type: F.COMMAND,
|
|
254
252
|
handler: (i, e) => {
|
|
255
|
-
const n = i.get(V), t = i.get(ge), r = i.get(
|
|
253
|
+
const n = i.get(V), t = i.get(ge), r = i.get(k);
|
|
256
254
|
if (!e) return !1;
|
|
257
255
|
const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: h, redo: l, objects: c } = o;
|
|
258
256
|
return n.syncExecuteCommand(E.id, { unitId: a, subUnitId: d, op: l, objects: c, type: y.UPDATE }) ? (t.pushUndoRedo({
|
|
@@ -267,41 +265,41 @@ const xe = {
|
|
|
267
265
|
]
|
|
268
266
|
}), !0) : !1;
|
|
269
267
|
}
|
|
270
|
-
},
|
|
268
|
+
}, xt = {
|
|
271
269
|
id: "sheet.command.set-drawing-arrange",
|
|
272
270
|
type: F.COMMAND,
|
|
273
271
|
handler: (i, e) => {
|
|
274
272
|
const n = i.get(V), t = i.get(ge);
|
|
275
273
|
if (!e) return !1;
|
|
276
|
-
const r = i.get(
|
|
274
|
+
const r = i.get(k), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = e, h = { unitId: s, subUnitId: o, drawingIds: a };
|
|
277
275
|
let l;
|
|
278
276
|
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
277
|
return !1;
|
|
280
|
-
const { objects: c, redo:
|
|
281
|
-
return n.syncExecuteCommand(E.id, { op:
|
|
278
|
+
const { objects: c, redo: u, undo: g } = l;
|
|
279
|
+
return n.syncExecuteCommand(E.id, { op: u, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE }) ? (t.pushUndoRedo({
|
|
282
280
|
unitID: s,
|
|
283
281
|
undoMutations: [
|
|
284
|
-
{ id: E.id, params: { op:
|
|
282
|
+
{ id: E.id, params: { op: g, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE } }
|
|
285
283
|
],
|
|
286
284
|
redoMutations: [
|
|
287
|
-
{ id: E.id, params: { op:
|
|
285
|
+
{ id: E.id, params: { op: u, unitId: s, subUnitId: o, objects: c, type: y.ARRANGE } }
|
|
288
286
|
]
|
|
289
287
|
}), !0) : !1;
|
|
290
288
|
}
|
|
291
289
|
};
|
|
292
|
-
function
|
|
290
|
+
function _r(i) {
|
|
293
291
|
const e = [];
|
|
294
292
|
return i.forEach((n) => {
|
|
295
|
-
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a } = t, d =
|
|
296
|
-
const
|
|
293
|
+
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a } = t, d = En(0, 0, r.map((c) => c.transform || {})), h = r.map((c) => {
|
|
294
|
+
const u = c.transform || { left: 0, top: 0 }, { unitId: g, subUnitId: f, drawingId: m } = c;
|
|
297
295
|
return {
|
|
298
|
-
unitId:
|
|
296
|
+
unitId: g,
|
|
299
297
|
subUnitId: f,
|
|
300
298
|
drawingId: m,
|
|
301
299
|
transform: {
|
|
302
|
-
...
|
|
303
|
-
left:
|
|
304
|
-
top:
|
|
300
|
+
...u,
|
|
301
|
+
left: u.left - d.left,
|
|
302
|
+
top: u.top - d.top
|
|
305
303
|
},
|
|
306
304
|
groupId: a
|
|
307
305
|
};
|
|
@@ -318,16 +316,16 @@ function wr(i) {
|
|
|
318
316
|
});
|
|
319
317
|
}), e;
|
|
320
318
|
}
|
|
321
|
-
function
|
|
319
|
+
function vr(i) {
|
|
322
320
|
const e = [];
|
|
323
321
|
return i.forEach((n) => {
|
|
324
322
|
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a, transform: d = { width: 0, height: 0 } } = t;
|
|
325
323
|
if (d == null)
|
|
326
324
|
return;
|
|
327
325
|
const h = r.map((c) => {
|
|
328
|
-
const { transform:
|
|
326
|
+
const { transform: u } = c, { unitId: g, subUnitId: f, drawingId: m } = c, p = yn(u || {}, d, d.width || 0, d.height || 0);
|
|
329
327
|
return {
|
|
330
|
-
unitId:
|
|
328
|
+
unitId: g,
|
|
331
329
|
subUnitId: f,
|
|
332
330
|
drawingId: m,
|
|
333
331
|
transform: p,
|
|
@@ -349,15 +347,15 @@ function _r(i) {
|
|
|
349
347
|
});
|
|
350
348
|
}), e;
|
|
351
349
|
}
|
|
352
|
-
const
|
|
350
|
+
const Ft = {
|
|
353
351
|
id: "sheet.command.group-sheet-image",
|
|
354
352
|
type: F.COMMAND,
|
|
355
353
|
handler: (i, e) => {
|
|
356
|
-
const n = i.get(V), t = i.get(ge), r = i.get(
|
|
354
|
+
const n = i.get(V), t = i.get(ge), r = i.get(k);
|
|
357
355
|
if (!e) return !1;
|
|
358
356
|
const s = [];
|
|
359
|
-
e.forEach(({ parent:
|
|
360
|
-
s.push(
|
|
357
|
+
e.forEach(({ parent: g, children: f }) => {
|
|
358
|
+
s.push(g.unitId), f.forEach((m) => {
|
|
361
359
|
s.push(m.unitId);
|
|
362
360
|
});
|
|
363
361
|
});
|
|
@@ -365,7 +363,7 @@ const xt = {
|
|
|
365
363
|
return n.syncExecuteCommand(E.id, { op: l, unitId: a, subUnitId: d, objects: c, type: y.GROUP }) ? (t.pushUndoRedo({
|
|
366
364
|
unitID: a,
|
|
367
365
|
undoMutations: [
|
|
368
|
-
{ id: E.id, params: { op: h, unitId: a, subUnitId: d, objects:
|
|
366
|
+
{ id: E.id, params: { op: h, unitId: a, subUnitId: d, objects: vr(c), type: y.UNGROUP } },
|
|
369
367
|
{ id: j.id, params: s }
|
|
370
368
|
],
|
|
371
369
|
redoMutations: [
|
|
@@ -374,15 +372,15 @@ const xt = {
|
|
|
374
372
|
]
|
|
375
373
|
}), !0) : !1;
|
|
376
374
|
}
|
|
377
|
-
},
|
|
375
|
+
}, Yt = {
|
|
378
376
|
id: "sheet.command.ungroup-sheet-image",
|
|
379
377
|
type: F.COMMAND,
|
|
380
378
|
handler: (i, e) => {
|
|
381
|
-
const n = i.get(V), t = i.get(ge), r = i.get(
|
|
379
|
+
const n = i.get(V), t = i.get(ge), r = i.get(k);
|
|
382
380
|
if (!e) return !1;
|
|
383
381
|
const s = [];
|
|
384
|
-
e.forEach(({ parent:
|
|
385
|
-
s.push(
|
|
382
|
+
e.forEach(({ parent: g, children: f }) => {
|
|
383
|
+
s.push(g.unitId), f.forEach((m) => {
|
|
386
384
|
s.push(m.unitId);
|
|
387
385
|
});
|
|
388
386
|
});
|
|
@@ -390,7 +388,7 @@ const xt = {
|
|
|
390
388
|
return n.syncExecuteCommand(E.id, { op: l, unitId: a, subUnitId: d, objects: c, type: y.UNGROUP }) ? (t.pushUndoRedo({
|
|
391
389
|
unitID: a,
|
|
392
390
|
undoMutations: [
|
|
393
|
-
{ id: E.id, params: { op: h, unitId: a, subUnitId: d, objects:
|
|
391
|
+
{ id: E.id, params: { op: h, unitId: a, subUnitId: d, objects: _r(c), type: y.GROUP } },
|
|
394
392
|
{ id: j.id, params: s }
|
|
395
393
|
],
|
|
396
394
|
redoMutations: [
|
|
@@ -401,11 +399,11 @@ const xt = {
|
|
|
401
399
|
}
|
|
402
400
|
};
|
|
403
401
|
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:
|
|
402
|
+
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: u, rowOffset: g } = t, { column: f, columnOffset: m, row: p, rowOffset: S } = r, C = n.attachRangeWithCoord({
|
|
405
403
|
startColumn: l,
|
|
406
404
|
endColumn: l,
|
|
407
|
-
startRow:
|
|
408
|
-
endRow:
|
|
405
|
+
startRow: u,
|
|
406
|
+
endRow: u
|
|
409
407
|
});
|
|
410
408
|
if (C == null)
|
|
411
409
|
return;
|
|
@@ -418,18 +416,18 @@ function $(i, e, n) {
|
|
|
418
416
|
if (v == null)
|
|
419
417
|
return;
|
|
420
418
|
const { startX: R, startY: _ } = C, { startX: b, startY: w } = v;
|
|
421
|
-
let
|
|
422
|
-
C.startX === v.endX && (
|
|
419
|
+
let P = ee(R + c, 1), D = ee(_ + g, 1), T = ee(b + m - P, 1), U = ee(w + S - D, 1);
|
|
420
|
+
C.startX === v.endX && (T = 0), C.startY === v.endY && (U = 0);
|
|
423
421
|
const M = n.getCurrentSkeleton(), I = M.rowHeaderWidth + M.columnTotalWidth, A = M.columnHeaderHeight + M.rowTotalHeight;
|
|
424
|
-
return
|
|
422
|
+
return P + T > I && (P = I - T), D + U > A && (D = A - U), {
|
|
425
423
|
flipY: s,
|
|
426
424
|
flipX: o,
|
|
427
425
|
angle: a,
|
|
428
426
|
skewX: d,
|
|
429
427
|
skewY: h,
|
|
430
|
-
left:
|
|
428
|
+
left: P,
|
|
431
429
|
top: D,
|
|
432
|
-
width:
|
|
430
|
+
width: T,
|
|
433
431
|
height: U
|
|
434
432
|
};
|
|
435
433
|
}
|
|
@@ -437,19 +435,19 @@ function N(i, e) {
|
|
|
437
435
|
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
436
|
if (c == null)
|
|
439
437
|
return;
|
|
440
|
-
const
|
|
438
|
+
const u = {
|
|
441
439
|
column: c.actualColumn,
|
|
442
|
-
columnOffset:
|
|
440
|
+
columnOffset: ee(n - c.startX, 1),
|
|
443
441
|
row: c.actualRow,
|
|
444
|
-
rowOffset:
|
|
445
|
-
},
|
|
446
|
-
if (
|
|
442
|
+
rowOffset: ee(t - c.startY, 1)
|
|
443
|
+
}, g = e.getSelectionCellByPosition(n + r, t + s);
|
|
444
|
+
if (g == null)
|
|
447
445
|
return;
|
|
448
446
|
const f = {
|
|
449
|
-
column:
|
|
450
|
-
columnOffset:
|
|
451
|
-
row:
|
|
452
|
-
rowOffset:
|
|
447
|
+
column: g.actualColumn,
|
|
448
|
+
columnOffset: ee(n + r - g.startX, 1),
|
|
449
|
+
row: g.actualRow,
|
|
450
|
+
rowOffset: ee(t + s - g.startY, 1)
|
|
453
451
|
};
|
|
454
452
|
return {
|
|
455
453
|
flipY: o,
|
|
@@ -457,16 +455,16 @@ function N(i, e) {
|
|
|
457
455
|
angle: d,
|
|
458
456
|
skewX: h,
|
|
459
457
|
skewY: l,
|
|
460
|
-
from:
|
|
458
|
+
from: u,
|
|
461
459
|
to: f
|
|
462
460
|
};
|
|
463
461
|
}
|
|
464
|
-
var
|
|
465
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
462
|
+
var Sr = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, Ir = (i, e, n, t) => {
|
|
463
|
+
for (var r = t > 1 ? void 0 : t ? Cr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
466
464
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
467
|
-
return t && r &&
|
|
468
|
-
},
|
|
469
|
-
let Ue = class extends
|
|
465
|
+
return t && r && Sr(e, n, r), r;
|
|
466
|
+
}, X = (i, e) => (n, t) => e(n, t, i);
|
|
467
|
+
let Ue = class extends oe {
|
|
470
468
|
constructor(i, e, n, t, r, s, o, a, d, h) {
|
|
471
469
|
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
470
|
}
|
|
@@ -480,7 +478,7 @@ let Ue = class extends ae {
|
|
|
480
478
|
get _skeletonManagerService() {
|
|
481
479
|
return this._renderManagerService.getRenderById(
|
|
482
480
|
this._univerInstanceService.getCurrentUnitForType(B.UNIVER_SHEET).getUnitId()
|
|
483
|
-
).with(
|
|
481
|
+
).with(re);
|
|
484
482
|
}
|
|
485
483
|
_init() {
|
|
486
484
|
this._initCommandListeners(), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._drawingAddListener();
|
|
@@ -496,10 +494,10 @@ let Ue = class extends ae {
|
|
|
496
494
|
if (e.files == null)
|
|
497
495
|
return;
|
|
498
496
|
const n = e.files.length;
|
|
499
|
-
if (n >
|
|
497
|
+
if (n > dt) {
|
|
500
498
|
this._messageService.show({
|
|
501
499
|
type: be.Error,
|
|
502
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
500
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(dt))
|
|
503
501
|
});
|
|
504
502
|
return;
|
|
505
503
|
}
|
|
@@ -520,13 +518,13 @@ let Ue = class extends ae {
|
|
|
520
518
|
e = await this._imageIoService.saveImage(i);
|
|
521
519
|
} catch (C) {
|
|
522
520
|
const v = C.message;
|
|
523
|
-
v ===
|
|
521
|
+
v === ke.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
524
522
|
type: be.Error,
|
|
525
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
526
|
-
}) : v ===
|
|
523
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(In / (1024 * 1024)))
|
|
524
|
+
}) : v === ke.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
527
525
|
type: be.Error,
|
|
528
526
|
content: this._localeService.t("update-status.invalidImageType")
|
|
529
|
-
}) : v ===
|
|
527
|
+
}) : v === ke.ERROR_IMAGE && this._messageService.show({
|
|
530
528
|
type: be.Error,
|
|
531
529
|
content: this._localeService.t("update-status.invalidImage")
|
|
532
530
|
});
|
|
@@ -536,17 +534,17 @@ let Ue = class extends ae {
|
|
|
536
534
|
const n = this._getUnitInfo();
|
|
537
535
|
if (n == null)
|
|
538
536
|
return;
|
|
539
|
-
const { unitId: t, subUnitId: r } = n, { imageId: s, imageSourceType: o, source: a, base64Cache: d } = e, { width: h, height: l, image: c } = await
|
|
540
|
-
if (
|
|
537
|
+
const { unitId: t, subUnitId: r } = n, { imageId: s, imageSourceType: o, source: a, base64Cache: d } = e, { width: h, height: l, image: c } = await Rn(d || ""), u = this._renderManagerService.getRenderById(t);
|
|
538
|
+
if (u == null)
|
|
541
539
|
return;
|
|
542
|
-
const { width:
|
|
540
|
+
const { width: g, height: f } = u.scene;
|
|
543
541
|
this._imageIoService.addImageSourceCache(a, o, c);
|
|
544
542
|
let m = 1;
|
|
545
|
-
if (h >
|
|
546
|
-
const C =
|
|
543
|
+
if (h > lt || l > ut) {
|
|
544
|
+
const C = lt / h, v = ut / l;
|
|
547
545
|
m = Math.max(C, v);
|
|
548
546
|
}
|
|
549
|
-
const p = this._getImagePosition(h * m, l * m,
|
|
547
|
+
const p = this._getImagePosition(h * m, l * m, g, f);
|
|
550
548
|
if (p == null)
|
|
551
549
|
return;
|
|
552
550
|
const S = {
|
|
@@ -586,7 +584,7 @@ let Ue = class extends ae {
|
|
|
586
584
|
endColumn: 0
|
|
587
585
|
};
|
|
588
586
|
r && r.length > 0 && (s = r[r.length - 1].range);
|
|
589
|
-
const o =
|
|
587
|
+
const o = An(this._skeletonManagerService.getCurrent().skeleton, s);
|
|
590
588
|
if (o == null)
|
|
591
589
|
return;
|
|
592
590
|
let { startColumn: a, startRow: d, startX: h, startY: l } = o, c = !1;
|
|
@@ -596,29 +594,29 @@ let Ue = class extends ae {
|
|
|
596
594
|
return;
|
|
597
595
|
h = m.startX, l = m.startY, a = m.actualColumn, d = m.actualRow;
|
|
598
596
|
}
|
|
599
|
-
const
|
|
597
|
+
const u = {
|
|
600
598
|
column: a,
|
|
601
599
|
columnOffset: 0,
|
|
602
600
|
row: d,
|
|
603
601
|
rowOffset: 0
|
|
604
|
-
},
|
|
605
|
-
if (
|
|
602
|
+
}, g = this._selectionRenderService.getSelectionCellByPosition(h + i, l + e);
|
|
603
|
+
if (g == null)
|
|
606
604
|
return;
|
|
607
605
|
const f = {
|
|
608
|
-
column:
|
|
609
|
-
columnOffset: h + i -
|
|
610
|
-
row:
|
|
611
|
-
rowOffset: l + e -
|
|
606
|
+
column: g.actualColumn,
|
|
607
|
+
columnOffset: h + i - g.startX,
|
|
608
|
+
row: g.actualRow,
|
|
609
|
+
rowOffset: l + e - g.startY
|
|
612
610
|
};
|
|
613
611
|
return {
|
|
614
|
-
from:
|
|
612
|
+
from: u,
|
|
615
613
|
to: f
|
|
616
614
|
};
|
|
617
615
|
}
|
|
618
616
|
_updateOrderListener() {
|
|
619
617
|
this._drawingManagerService.featurePluginOrderUpdate$.subscribe((i) => {
|
|
620
618
|
const { unitId: e, subUnitId: n, drawingIds: t, arrangeType: r } = i;
|
|
621
|
-
this._commandService.executeCommand(
|
|
619
|
+
this._commandService.executeCommand(xt.id, {
|
|
622
620
|
unitId: e,
|
|
623
621
|
subUnitId: n,
|
|
624
622
|
drawingIds: t,
|
|
@@ -653,11 +651,11 @@ let Ue = class extends ae {
|
|
|
653
651
|
}
|
|
654
652
|
_groupDrawingListener() {
|
|
655
653
|
this._drawingManagerService.featurePluginGroupUpdate$.subscribe((i) => {
|
|
656
|
-
this._commandService.executeCommand(
|
|
654
|
+
this._commandService.executeCommand(Ft.id, i);
|
|
657
655
|
const { unitId: e, subUnitId: n, drawingId: t } = i[0].parent;
|
|
658
656
|
this._drawingManagerService.focusDrawing([{ unitId: e, subUnitId: n, drawingId: t }]);
|
|
659
657
|
}), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((i) => {
|
|
660
|
-
this._commandService.executeCommand(
|
|
658
|
+
this._commandService.executeCommand(Yt.id, i);
|
|
661
659
|
});
|
|
662
660
|
}
|
|
663
661
|
_focusDrawingListener() {
|
|
@@ -686,18 +684,18 @@ let Ue = class extends ae {
|
|
|
686
684
|
this._drawingManagerService.registerDrawingData(e, this._sheetDrawingService.getDrawingDataForUnit(e)), this._drawingManagerService.initializeNotification(e);
|
|
687
685
|
}
|
|
688
686
|
};
|
|
689
|
-
Ue =
|
|
690
|
-
se
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
687
|
+
Ue = Ir([
|
|
688
|
+
ie(se.Rendered, Ue),
|
|
689
|
+
X(0, V),
|
|
690
|
+
X(1, he),
|
|
691
|
+
X(2, W(Zn)),
|
|
692
|
+
X(3, vt),
|
|
693
|
+
X(4, k),
|
|
694
|
+
X(5, z),
|
|
695
|
+
X(6, _t),
|
|
696
|
+
X(7, Yn),
|
|
697
|
+
X(8, W(_e)),
|
|
698
|
+
X(9, K)
|
|
701
699
|
], Ue);
|
|
702
700
|
var Y = function() {
|
|
703
701
|
return Y = Object.assign || function(i) {
|
|
@@ -707,23 +705,23 @@ var Y = function() {
|
|
|
707
705
|
}
|
|
708
706
|
return i;
|
|
709
707
|
}, Y.apply(this, arguments);
|
|
710
|
-
},
|
|
708
|
+
}, Rr = function(i, e) {
|
|
711
709
|
var n = {};
|
|
712
710
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
|
|
713
711
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
714
712
|
for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
|
|
715
713
|
e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
|
|
716
714
|
return n;
|
|
717
|
-
},
|
|
718
|
-
var n = i.icon, t = i.id, r = i.className, s = i.extend, o =
|
|
715
|
+
}, kt = Lt(function(i, e) {
|
|
716
|
+
var n = i.icon, t = i.id, r = i.className, s = i.extend, o = Rr(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Bt("_".concat(br()));
|
|
719
717
|
return Ht(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, Y({ ref: e, className: a }, o), s);
|
|
720
718
|
});
|
|
721
719
|
function Ht(i, e, n, t, r) {
|
|
722
|
-
return
|
|
720
|
+
return Wt(i.tag, Y(Y({ key: e }, Mr(i, n, r)), t), (Dr(i, n).children || []).map(function(s, o) {
|
|
723
721
|
return Ht(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
|
|
724
722
|
}));
|
|
725
723
|
}
|
|
726
|
-
function
|
|
724
|
+
function Mr(i, e, n) {
|
|
727
725
|
var t = Y({}, i.attrs);
|
|
728
726
|
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
|
|
729
727
|
var r = e.defIds;
|
|
@@ -732,113 +730,113 @@ function Rr(i, e, n) {
|
|
|
732
730
|
typeof a == "string" && (t[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
733
731
|
})), t;
|
|
734
732
|
}
|
|
735
|
-
function
|
|
733
|
+
function Dr(i, e) {
|
|
736
734
|
var n, t = e.defIds;
|
|
737
735
|
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
736
|
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;
|
|
739
737
|
}) }) : i;
|
|
740
738
|
}
|
|
741
|
-
function
|
|
739
|
+
function br() {
|
|
742
740
|
return Math.random().toString(36).substring(2, 8);
|
|
743
741
|
}
|
|
744
|
-
|
|
745
|
-
var
|
|
746
|
-
return
|
|
742
|
+
kt.displayName = "UniverIcon";
|
|
743
|
+
var Er = { 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 = Lt(function(i, e) {
|
|
744
|
+
return Wt(kt, Object.assign({}, i, {
|
|
747
745
|
id: "add-image-single",
|
|
748
746
|
ref: e,
|
|
749
|
-
icon:
|
|
747
|
+
icon: Er
|
|
750
748
|
}));
|
|
751
749
|
});
|
|
752
750
|
Xt.displayName = "AddImageSingle";
|
|
753
|
-
const
|
|
754
|
-
uploadFileMenu:
|
|
755
|
-
uploadFileMenuInput:
|
|
756
|
-
},
|
|
751
|
+
const yr = "univer-upload-file-menu", Or = "univer-upload-file-menu-input", wt = {
|
|
752
|
+
uploadFileMenu: yr,
|
|
753
|
+
uploadFileMenuInput: Or
|
|
754
|
+
}, zt = "COMPONENT_UPLOAD_FILE_MENU";
|
|
757
755
|
var We = /* @__PURE__ */ ((i) => (i[i.cellImage = 0] = "cellImage", i[i.floatImage = 1] = "floatImage", i))(We || {});
|
|
758
|
-
const
|
|
759
|
-
const { type: e } = i, n =
|
|
756
|
+
const Pr = (i) => {
|
|
757
|
+
const { type: e } = i, n = q(V), t = Bt(null), r = () => {
|
|
760
758
|
var a;
|
|
761
759
|
(a = t.current) == null || a.click();
|
|
762
|
-
}, s =
|
|
760
|
+
}, s = Mn.map((a) => `.${a.replace("image/", "")}`).join(","), o = (a) => {
|
|
763
761
|
const d = a.target.files;
|
|
764
762
|
if (d == null)
|
|
765
763
|
return;
|
|
766
764
|
const h = Array.from(d);
|
|
767
765
|
e === We.floatImage ? n.executeCommand(xe.id, { files: h }) : e === We.cellImage && n.executeCommand(Be.id, { files: h }), t.current && (t.current.value = "");
|
|
768
766
|
};
|
|
769
|
-
return /* @__PURE__ */ L.createElement("div", { onClick: r, className:
|
|
767
|
+
return /* @__PURE__ */ L.createElement("div", { onClick: r, className: wt.uploadFileMenu }, /* @__PURE__ */ L.createElement(
|
|
770
768
|
"input",
|
|
771
769
|
{
|
|
772
770
|
type: "file",
|
|
773
|
-
className:
|
|
771
|
+
className: wt.uploadFileMenuInput,
|
|
774
772
|
ref: t,
|
|
775
773
|
onChange: o,
|
|
776
774
|
accept: s,
|
|
777
775
|
multiple: !0
|
|
778
776
|
}
|
|
779
777
|
));
|
|
780
|
-
},
|
|
778
|
+
}, Kt = "addition-and-subtraction-single", Jt = "sheet.menu.image";
|
|
781
779
|
function Tr(i) {
|
|
782
780
|
return {
|
|
783
|
-
id:
|
|
784
|
-
type:
|
|
785
|
-
positions: [
|
|
786
|
-
group:
|
|
787
|
-
icon:
|
|
781
|
+
id: Jt,
|
|
782
|
+
type: St.SUBITEMS,
|
|
783
|
+
positions: [kn.TOOLBAR_START],
|
|
784
|
+
group: Hn.TOOLBAR_FORMULAS_INSERT,
|
|
785
|
+
icon: Kt,
|
|
788
786
|
tooltip: "sheetImage.title",
|
|
789
|
-
hidden$:
|
|
790
|
-
disabled$:
|
|
787
|
+
hidden$: Ct(i, B.UNIVER_SHEET),
|
|
788
|
+
disabled$: Nn(i, { workbookTypes: [Ze], worksheetTypes: [Pe], rangeTypes: [qn] })
|
|
791
789
|
};
|
|
792
790
|
}
|
|
793
|
-
function
|
|
791
|
+
function Ur(i) {
|
|
794
792
|
return {
|
|
795
793
|
id: xe.id,
|
|
796
794
|
title: "sheetImage.upload.float",
|
|
797
|
-
type:
|
|
795
|
+
type: St.SELECTOR,
|
|
798
796
|
label: {
|
|
799
|
-
name:
|
|
797
|
+
name: zt,
|
|
800
798
|
props: {
|
|
801
799
|
type: We.floatImage
|
|
802
800
|
}
|
|
803
801
|
},
|
|
804
|
-
positions: [
|
|
805
|
-
hidden$:
|
|
802
|
+
positions: [Jt],
|
|
803
|
+
hidden$: Ct(i, B.UNIVER_SHEET)
|
|
806
804
|
};
|
|
807
805
|
}
|
|
808
|
-
const
|
|
809
|
-
imageCommonPanel:
|
|
810
|
-
imageCommonPanelGrid:
|
|
811
|
-
imageCommonPanelBorder:
|
|
812
|
-
imageCommonPanelTitle:
|
|
813
|
-
imageCommonPanelSubtitle:
|
|
814
|
-
imageCommonPanelRow:
|
|
815
|
-
imageCommonPanelRowVertical:
|
|
816
|
-
imageCommonPanelColumn:
|
|
817
|
-
imageCommonPanelColumnCenter:
|
|
818
|
-
imageCommonPanelInline:
|
|
819
|
-
imageCommonPanelSpan2:
|
|
820
|
-
imageCommonPanelSpan3:
|
|
821
|
-
imageCommonPanelInput:
|
|
806
|
+
const Ar = "univer-image-common-panel", Nr = "univer-image-common-panel-grid", jr = "univer-image-common-panel-border", Lr = "univer-image-common-panel-title", Br = "univer-image-common-panel-subtitle", Wr = "univer-image-common-panel-row", $r = "univer-image-common-panel-row-vertical", Vr = "univer-image-common-panel-column", Gr = "univer-image-common-panel-column-center", xr = "univer-image-common-panel-inline", Fr = "univer-image-common-panel-span2", Yr = "univer-image-common-panel-span3", kr = "univer-image-common-panel-input", Hr = "univer-sheet-image-menu", Xr = "univer-sheet-image-menu-input", Z = {
|
|
807
|
+
imageCommonPanel: Ar,
|
|
808
|
+
imageCommonPanelGrid: Nr,
|
|
809
|
+
imageCommonPanelBorder: jr,
|
|
810
|
+
imageCommonPanelTitle: Lr,
|
|
811
|
+
imageCommonPanelSubtitle: Br,
|
|
812
|
+
imageCommonPanelRow: Wr,
|
|
813
|
+
imageCommonPanelRowVertical: $r,
|
|
814
|
+
imageCommonPanelColumn: Vr,
|
|
815
|
+
imageCommonPanelColumnCenter: Gr,
|
|
816
|
+
imageCommonPanelInline: xr,
|
|
817
|
+
imageCommonPanelSpan2: Fr,
|
|
818
|
+
imageCommonPanelSpan3: Yr,
|
|
819
|
+
imageCommonPanelInput: kr,
|
|
822
820
|
sheetImageMenu: Hr,
|
|
823
821
|
sheetImageMenuInput: Xr
|
|
824
|
-
},
|
|
822
|
+
}, zr = (i) => {
|
|
825
823
|
var v;
|
|
826
|
-
const e =
|
|
824
|
+
const e = q(V), n = q(_e), t = q(z), r = q(K), { drawings: s } = i, o = s[0];
|
|
827
825
|
if (o == null)
|
|
828
826
|
return;
|
|
829
827
|
const { unitId: a } = o, d = r.getRenderById(a), h = d == null ? void 0 : d.scene;
|
|
830
828
|
if (h == null)
|
|
831
829
|
return;
|
|
832
|
-
const l = h.getTransformerByCreate(), [c,
|
|
830
|
+
const l = h.getTransformerByCreate(), [c, u] = et(!0), g = (v = o.anchorType) != null ? v : O.Position, [f, m] = et(g);
|
|
833
831
|
function p(R, _) {
|
|
834
832
|
const b = [];
|
|
835
833
|
return R.forEach((w) => {
|
|
836
|
-
const { oKey:
|
|
834
|
+
const { oKey: P } = w, D = _.getDrawingOKey(P);
|
|
837
835
|
if (D == null)
|
|
838
836
|
return b.push(null), !0;
|
|
839
|
-
const { unitId:
|
|
837
|
+
const { unitId: T, subUnitId: U, drawingId: M, drawingType: I, anchorType: A, sheetTransform: G } = D;
|
|
840
838
|
b.push({
|
|
841
|
-
unitId:
|
|
839
|
+
unitId: T,
|
|
842
840
|
subUnitId: U,
|
|
843
841
|
drawingId: M,
|
|
844
842
|
anchorType: A,
|
|
@@ -849,16 +847,16 @@ const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", N
|
|
|
849
847
|
}
|
|
850
848
|
rt(() => {
|
|
851
849
|
const R = l.clearControl$.subscribe((b) => {
|
|
852
|
-
b === !0 &&
|
|
850
|
+
b === !0 && u(!1);
|
|
853
851
|
}), _ = l.changeStart$.subscribe((b) => {
|
|
854
852
|
var D;
|
|
855
|
-
const { objects: w } = b,
|
|
856
|
-
if (
|
|
857
|
-
|
|
858
|
-
else if (
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
m(
|
|
853
|
+
const { objects: w } = b, P = p(w, t);
|
|
854
|
+
if (P.length === 0)
|
|
855
|
+
u(!1);
|
|
856
|
+
else if (P.length >= 1) {
|
|
857
|
+
u(!0);
|
|
858
|
+
const T = ((D = P[0]) == null ? void 0 : D.anchorType) || O.Position;
|
|
859
|
+
m(T);
|
|
862
860
|
}
|
|
863
861
|
});
|
|
864
862
|
return () => {
|
|
@@ -882,9 +880,9 @@ const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", N
|
|
|
882
880
|
});
|
|
883
881
|
}
|
|
884
882
|
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(
|
|
886
|
-
},
|
|
887
|
-
const i =
|
|
883
|
+
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(cr, { value: f, onChange: S, direction: "vertical" }, /* @__PURE__ */ L.createElement(Xe, { value: O.Both }, n.t("drawing-anchor.both")), /* @__PURE__ */ L.createElement(Xe, { value: O.Position }, n.t("drawing-anchor.position")), /* @__PURE__ */ L.createElement(Xe, { value: O.None }, n.t("drawing-anchor.none"))))));
|
|
884
|
+
}, Kr = () => {
|
|
885
|
+
const i = q(z), e = i.getFocusDrawings(), [n, t] = et(e);
|
|
888
886
|
return rt(() => {
|
|
889
887
|
const r = i.focus$.subscribe((s) => {
|
|
890
888
|
t(s);
|
|
@@ -892,23 +890,23 @@ const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", N
|
|
|
892
890
|
return () => {
|
|
893
891
|
r.unsubscribe();
|
|
894
892
|
};
|
|
895
|
-
}, []), !!(n != null && n.length) && /* @__PURE__ */ L.createElement("div", { className: Z.imageCommonPanel }, /* @__PURE__ */ L.createElement(
|
|
893
|
+
}, []), !!(n != null && n.length) && /* @__PURE__ */ L.createElement("div", { className: Z.imageCommonPanel }, /* @__PURE__ */ L.createElement(_n, { drawings: n }), /* @__PURE__ */ L.createElement(zr, { drawings: n }));
|
|
896
894
|
}, ve = {
|
|
897
895
|
id: "sheet.command.move-drawing",
|
|
898
896
|
type: F.COMMAND,
|
|
899
897
|
handler: (i, e) => {
|
|
900
|
-
const n = i.get(V), t = i.get(
|
|
898
|
+
const n = i.get(V), t = i.get(k), r = i.get(Ge), { direction: s } = e, o = t.getFocusDrawings();
|
|
901
899
|
if (o.length === 0)
|
|
902
900
|
return !1;
|
|
903
901
|
const a = o[0].unitId, d = o.map((l) => {
|
|
904
902
|
const { transform: c } = l;
|
|
905
903
|
if (c == null)
|
|
906
904
|
return null;
|
|
907
|
-
const
|
|
908
|
-
return s ===
|
|
905
|
+
const u = { ...c }, { left: g = 0, top: f = 0 } = c;
|
|
906
|
+
return s === Q.UP ? u.top = f - 1 : s === Q.DOWN ? u.top = f + 1 : s === Q.LEFT ? u.left = g - 1 : s === Q.RIGHT && (u.left = g + 1), {
|
|
909
907
|
...l,
|
|
910
|
-
transform:
|
|
911
|
-
sheetTransform: N(
|
|
908
|
+
transform: u,
|
|
909
|
+
sheetTransform: N(u, r)
|
|
912
910
|
};
|
|
913
911
|
}).filter((l) => l != null);
|
|
914
912
|
return n.syncExecuteCommand(Fe.id, {
|
|
@@ -916,11 +914,11 @@ const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", N
|
|
|
916
914
|
drawings: d
|
|
917
915
|
}) ? (n.syncExecuteCommand(j.id, [a]), !0) : !1;
|
|
918
916
|
}
|
|
919
|
-
},
|
|
917
|
+
}, Zt = {
|
|
920
918
|
id: "sheet.command.delete-drawing",
|
|
921
919
|
type: F.COMMAND,
|
|
922
920
|
handler: (i) => {
|
|
923
|
-
const e = i.get(V), t = i.get(
|
|
921
|
+
const e = i.get(V), t = i.get(k).getFocusDrawings();
|
|
924
922
|
if (t.length === 0)
|
|
925
923
|
return !1;
|
|
926
924
|
const r = t[0].unitId, s = t.map((o) => {
|
|
@@ -939,9 +937,9 @@ const Ur = "univer-image-common-panel", Ar = "univer-image-common-panel-grid", N
|
|
|
939
937
|
}
|
|
940
938
|
};
|
|
941
939
|
function Se(i) {
|
|
942
|
-
return !i.getContextValue(
|
|
940
|
+
return !i.getContextValue(on) && !i.getContextValue(an) && i.getContextValue(we);
|
|
943
941
|
}
|
|
944
|
-
const
|
|
942
|
+
const Jr = {
|
|
945
943
|
id: ve.id,
|
|
946
944
|
description: "shortcut.sheet.drawing-move-down",
|
|
947
945
|
group: "4_sheet-drawing-view",
|
|
@@ -949,9 +947,9 @@ const Kr = {
|
|
|
949
947
|
priority: 100,
|
|
950
948
|
preconditions: Se,
|
|
951
949
|
staticParameters: {
|
|
952
|
-
direction:
|
|
950
|
+
direction: Q.DOWN
|
|
953
951
|
}
|
|
954
|
-
},
|
|
952
|
+
}, Zr = {
|
|
955
953
|
id: ve.id,
|
|
956
954
|
description: "shortcut.sheet.drawing-move-up",
|
|
957
955
|
group: "4_sheet-drawing-view",
|
|
@@ -959,9 +957,9 @@ const Kr = {
|
|
|
959
957
|
priority: 100,
|
|
960
958
|
preconditions: Se,
|
|
961
959
|
staticParameters: {
|
|
962
|
-
direction:
|
|
960
|
+
direction: Q.UP
|
|
963
961
|
}
|
|
964
|
-
},
|
|
962
|
+
}, qr = {
|
|
965
963
|
id: ve.id,
|
|
966
964
|
description: "shortcut.sheet.drawing-move-left",
|
|
967
965
|
group: "4_sheet-drawing-view",
|
|
@@ -969,9 +967,9 @@ const Kr = {
|
|
|
969
967
|
priority: 100,
|
|
970
968
|
preconditions: Se,
|
|
971
969
|
staticParameters: {
|
|
972
|
-
direction:
|
|
970
|
+
direction: Q.LEFT
|
|
973
971
|
}
|
|
974
|
-
},
|
|
972
|
+
}, Qr = {
|
|
975
973
|
id: ve.id,
|
|
976
974
|
description: "shortcut.sheet.drawing-move-right",
|
|
977
975
|
group: "4_sheet-drawing-view",
|
|
@@ -979,10 +977,10 @@ const Kr = {
|
|
|
979
977
|
priority: 100,
|
|
980
978
|
preconditions: Se,
|
|
981
979
|
staticParameters: {
|
|
982
|
-
direction:
|
|
980
|
+
direction: Q.RIGHT
|
|
983
981
|
}
|
|
984
|
-
},
|
|
985
|
-
id:
|
|
982
|
+
}, ei = {
|
|
983
|
+
id: Zt.id,
|
|
986
984
|
description: "shortcut.sheet.drawing-delete",
|
|
987
985
|
group: "4_sheet-drawing-view",
|
|
988
986
|
// when focusing on any other input tag do not trigger this shortcut
|
|
@@ -990,25 +988,25 @@ const Kr = {
|
|
|
990
988
|
binding: ue.DELETE,
|
|
991
989
|
mac: ue.BACKSPACE
|
|
992
990
|
};
|
|
993
|
-
var
|
|
994
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
991
|
+
var ti = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, ri = (i, e, n, t) => {
|
|
992
|
+
for (var r = t > 1 ? void 0 : t ? ni(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
995
993
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
996
|
-
return t && r &&
|
|
994
|
+
return t && r && ti(e, n, r), r;
|
|
997
995
|
}, me = (i, e) => (n, t) => e(n, t, i);
|
|
998
|
-
const
|
|
999
|
-
let pe = class extends
|
|
996
|
+
const ii = {};
|
|
997
|
+
let pe = class extends oe {
|
|
1000
998
|
constructor(i, e, n, t, r, s) {
|
|
1001
999
|
super(), this._config = i, this._injector = e, this._componentManager = n, this._menuService = t, this._commandService = r, this._shortcutService = s, this._init();
|
|
1002
1000
|
}
|
|
1003
1001
|
_initCustomComponents() {
|
|
1004
1002
|
const i = this._componentManager;
|
|
1005
|
-
this.disposeWithMe(i.register(
|
|
1003
|
+
this.disposeWithMe(i.register(Kt, Xt)), this.disposeWithMe(i.register(zt, Pr)), this.disposeWithMe(i.register($t, Kr));
|
|
1006
1004
|
}
|
|
1007
1005
|
_initMenus() {
|
|
1008
1006
|
const { menu: i = {} } = this._config;
|
|
1009
1007
|
[
|
|
1010
1008
|
Tr,
|
|
1011
|
-
|
|
1009
|
+
Ur
|
|
1012
1010
|
// UploadCellImageMenuFactory,
|
|
1013
1011
|
].forEach((e) => {
|
|
1014
1012
|
this._menuService.addMenuItem(e(this._injector), i);
|
|
@@ -1021,24 +1019,24 @@ let pe = class extends ae {
|
|
|
1021
1019
|
st,
|
|
1022
1020
|
it,
|
|
1023
1021
|
Fe,
|
|
1024
|
-
$t,
|
|
1025
|
-
j,
|
|
1026
1022
|
Vt,
|
|
1027
|
-
|
|
1023
|
+
j,
|
|
1024
|
+
Gt,
|
|
1028
1025
|
Ft,
|
|
1026
|
+
Yt,
|
|
1029
1027
|
ve,
|
|
1030
|
-
|
|
1031
|
-
|
|
1028
|
+
Zt,
|
|
1029
|
+
xt
|
|
1032
1030
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
1033
1031
|
}
|
|
1034
1032
|
_initShortcuts() {
|
|
1035
1033
|
[
|
|
1036
1034
|
// sheet drawing shortcuts
|
|
1037
|
-
Kr,
|
|
1038
1035
|
Jr,
|
|
1039
1036
|
Zr,
|
|
1040
1037
|
qr,
|
|
1041
|
-
Qr
|
|
1038
|
+
Qr,
|
|
1039
|
+
ei
|
|
1042
1040
|
].forEach((i) => {
|
|
1043
1041
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
1044
1042
|
});
|
|
@@ -1047,21 +1045,20 @@ let pe = class extends ae {
|
|
|
1047
1045
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
1048
1046
|
}
|
|
1049
1047
|
};
|
|
1050
|
-
pe =
|
|
1051
|
-
se
|
|
1048
|
+
pe = ri([
|
|
1049
|
+
ie(se.Rendered, pe),
|
|
1052
1050
|
me(1, W(nt)),
|
|
1053
|
-
me(2, W(
|
|
1054
|
-
me(3,
|
|
1051
|
+
me(2, W(Xn)),
|
|
1052
|
+
me(3, zn),
|
|
1055
1053
|
me(4, V),
|
|
1056
|
-
me(5,
|
|
1054
|
+
me(5, Kn)
|
|
1057
1055
|
], pe);
|
|
1058
|
-
var
|
|
1059
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1056
|
+
var si = Object.defineProperty, oi = Object.getOwnPropertyDescriptor, ai = (i, e, n, t) => {
|
|
1057
|
+
for (var r = t > 1 ? void 0 : t ? oi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1060
1058
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1061
|
-
return t && r &&
|
|
1062
|
-
},
|
|
1063
|
-
const
|
|
1064
|
-
Ct.id,
|
|
1059
|
+
return t && r && si(e, n, r), r;
|
|
1060
|
+
}, ce = (i, e) => (n, t) => e(n, t, i);
|
|
1061
|
+
const ci = [
|
|
1065
1062
|
It.id,
|
|
1066
1063
|
Rt.id,
|
|
1067
1064
|
Mt.id,
|
|
@@ -1069,23 +1066,24 @@ const ai = [
|
|
|
1069
1066
|
bt.id,
|
|
1070
1067
|
Et.id,
|
|
1071
1068
|
yt.id,
|
|
1069
|
+
Ot.id,
|
|
1072
1070
|
qe.id,
|
|
1073
1071
|
Qe.id,
|
|
1074
|
-
Ot.id,
|
|
1075
|
-
Tt.id,
|
|
1076
1072
|
Pt.id,
|
|
1073
|
+
Tt.id,
|
|
1077
1074
|
Ut.id,
|
|
1078
1075
|
At.id,
|
|
1079
|
-
Nt.id
|
|
1080
|
-
|
|
1081
|
-
|
|
1076
|
+
Nt.id,
|
|
1077
|
+
jt.id
|
|
1078
|
+
], di = [
|
|
1082
1079
|
Qn.id,
|
|
1083
1080
|
er.id,
|
|
1084
1081
|
tr.id,
|
|
1085
1082
|
nr.id,
|
|
1086
|
-
rr.id
|
|
1083
|
+
rr.id,
|
|
1084
|
+
ir.id
|
|
1087
1085
|
];
|
|
1088
|
-
let Ae = class extends
|
|
1086
|
+
let Ae = class extends oe {
|
|
1089
1087
|
constructor(i, e, n, t, r, s) {
|
|
1090
1088
|
super(), this._commandService = i, this._sheetInterceptorService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._drawingManagerService = r, this._univerInstanceService = s, this._init();
|
|
1091
1089
|
}
|
|
@@ -1099,7 +1097,7 @@ let Ae = class extends ae {
|
|
|
1099
1097
|
get _skeletonManagerService() {
|
|
1100
1098
|
return this._renderManagerService.getRenderById(
|
|
1101
1099
|
this._univerInstanceService.getCurrentUnitForType(B.UNIVER_SHEET).getUnitId()
|
|
1102
|
-
).with(
|
|
1100
|
+
).with(re);
|
|
1103
1101
|
}
|
|
1104
1102
|
_init() {
|
|
1105
1103
|
this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
|
|
@@ -1108,54 +1106,54 @@ let Ae = class extends ae {
|
|
|
1108
1106
|
this.disposeWithMe(
|
|
1109
1107
|
this._sheetInterceptorService.interceptCommand({
|
|
1110
1108
|
getMutations: (i) => {
|
|
1111
|
-
if (!
|
|
1109
|
+
if (!ci.includes(i.id))
|
|
1112
1110
|
return { redos: [], undos: [] };
|
|
1113
1111
|
if (i.params == null)
|
|
1114
1112
|
return { redos: [], undos: [] };
|
|
1115
1113
|
const e = i.id;
|
|
1116
|
-
if (e === Ct.id)
|
|
1117
|
-
return this._moveRowInterceptor(i.params, "insert");
|
|
1118
1114
|
if (e === It.id)
|
|
1119
|
-
return this.
|
|
1115
|
+
return this._moveRowInterceptor(i.params, "insert");
|
|
1120
1116
|
if (e === Rt.id)
|
|
1121
|
-
return this.
|
|
1117
|
+
return this._moveColInterceptor(i.params, "insert");
|
|
1122
1118
|
if (e === Mt.id)
|
|
1119
|
+
return this._moveRowInterceptor(i.params, "remove");
|
|
1120
|
+
if (e === Dt.id)
|
|
1123
1121
|
return this._moveColInterceptor(i.params, "remove");
|
|
1124
|
-
if (e ===
|
|
1122
|
+
if (e === bt.id) {
|
|
1125
1123
|
const { range: n } = i.params;
|
|
1126
1124
|
return this._getRangeMoveUndo(
|
|
1127
1125
|
n,
|
|
1128
1126
|
0
|
|
1129
1127
|
/* deleteLeft */
|
|
1130
1128
|
);
|
|
1131
|
-
} else if (e ===
|
|
1129
|
+
} else if (e === Et.id) {
|
|
1132
1130
|
const { range: n } = i.params;
|
|
1133
1131
|
return this._getRangeMoveUndo(
|
|
1134
1132
|
n,
|
|
1135
1133
|
1
|
|
1136
1134
|
/* deleteUp */
|
|
1137
1135
|
);
|
|
1138
|
-
} else if (e ===
|
|
1136
|
+
} else if (e === yt.id) {
|
|
1139
1137
|
const { range: n } = i.params;
|
|
1140
1138
|
return this._getRangeMoveUndo(
|
|
1141
1139
|
n,
|
|
1142
1140
|
2
|
|
1143
1141
|
/* insertDown */
|
|
1144
1142
|
);
|
|
1145
|
-
} else if (e ===
|
|
1143
|
+
} else if (e === Ot.id) {
|
|
1146
1144
|
const { range: n } = i.params;
|
|
1147
1145
|
return this._getRangeMoveUndo(
|
|
1148
1146
|
n,
|
|
1149
1147
|
3
|
|
1150
1148
|
/* insertRight */
|
|
1151
1149
|
);
|
|
1152
|
-
} else if (e ===
|
|
1150
|
+
} else if (e === Ut.id || e === At.id) {
|
|
1153
1151
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1154
1152
|
return this._getDrawingUndoForRowVisible(t, r, s);
|
|
1155
|
-
} else if (e ===
|
|
1153
|
+
} else if (e === Nt.id || e === jt.id) {
|
|
1156
1154
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1157
1155
|
return this._getDrawingUndoForColVisible(t, r, s);
|
|
1158
|
-
} else if (e === qe.id || e === Qe.id || e ===
|
|
1156
|
+
} else if (e === qe.id || e === Qe.id || e === Pt.id || e === Tt.id) {
|
|
1159
1157
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === qe.id || e === Qe.id;
|
|
1160
1158
|
return this._getDrawingUndoForRowAndColSize(t, r, s, o);
|
|
1161
1159
|
}
|
|
@@ -1170,17 +1168,17 @@ let Ae = class extends ae {
|
|
|
1170
1168
|
return { redos: [], undos: [] };
|
|
1171
1169
|
const t = n.unitId, r = n.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(t, r), d = [], h = [];
|
|
1172
1170
|
if (Object.keys(a).forEach((l) => {
|
|
1173
|
-
const c = a[l], { updateDrawings:
|
|
1174
|
-
d.push(...
|
|
1171
|
+
const c = a[l], { updateDrawings: u, deleteDrawings: g } = this._getUpdateOrDeleteDrawings(i, e, c);
|
|
1172
|
+
d.push(...u), h.push(...g);
|
|
1175
1173
|
}), d.length === 0 && h.length === 0)
|
|
1176
1174
|
return { redos: [], undos: [] };
|
|
1177
1175
|
if (d.length > 0) {
|
|
1178
|
-
const l = this._sheetDrawingService.getBatchUpdateOp(d), { undo: c, redo:
|
|
1179
|
-
s.push({ id: E.id, params: { unitId: t, subUnitId: r, op:
|
|
1176
|
+
const l = this._sheetDrawingService.getBatchUpdateOp(d), { undo: c, redo: u, objects: g } = l;
|
|
1177
|
+
s.push({ id: E.id, params: { unitId: t, subUnitId: r, op: u, objects: g, type: y.UPDATE } }), o.push({ id: E.id, params: { unitId: t, subUnitId: r, op: c, objects: g, type: y.UPDATE } });
|
|
1180
1178
|
}
|
|
1181
1179
|
if (h.length > 0) {
|
|
1182
|
-
const l = this._sheetDrawingService.getBatchRemoveOp(h), c = l.undo,
|
|
1183
|
-
s.push({ id: E.id, params: { unitId: t, subUnitId: r, op:
|
|
1180
|
+
const l = this._sheetDrawingService.getBatchRemoveOp(h), c = l.undo, u = l.redo, g = l.objects;
|
|
1181
|
+
s.push({ id: E.id, params: { unitId: t, subUnitId: r, op: u, objects: g, type: y.REMOVE } }), o.push({ id: E.id, params: { unitId: t, subUnitId: r, op: c, objects: g, type: y.INSERT } });
|
|
1184
1182
|
}
|
|
1185
1183
|
return s.push({ id: j.id, params: [t] }), o.push({ id: j.id, params: [t] }), {
|
|
1186
1184
|
redos: s,
|
|
@@ -1188,7 +1186,7 @@ let Ae = class extends ae {
|
|
|
1188
1186
|
};
|
|
1189
1187
|
}
|
|
1190
1188
|
_getUpdateOrDeleteDrawings(i, e, n) {
|
|
1191
|
-
const t = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: h, drawingId: l } = n, { from: c, to:
|
|
1189
|
+
const t = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: h, drawingId: l } = n, { from: c, to: u } = s, { row: g, column: f } = c, { row: m, column: p } = u;
|
|
1192
1190
|
if (s == null || a == null)
|
|
1193
1191
|
return {
|
|
1194
1192
|
updateDrawings: t,
|
|
@@ -1196,7 +1194,7 @@ let Ae = class extends ae {
|
|
|
1196
1194
|
};
|
|
1197
1195
|
const { startRow: S, endRow: C, startColumn: v, endColumn: R } = i;
|
|
1198
1196
|
let _ = null, b = null;
|
|
1199
|
-
if (e === 0 &&
|
|
1197
|
+
if (e === 0 && g >= S && m <= C)
|
|
1200
1198
|
if (f >= v && p <= R)
|
|
1201
1199
|
r.push({ unitId: d, subUnitId: h, drawingId: l });
|
|
1202
1200
|
else {
|
|
@@ -1204,7 +1202,7 @@ let Ae = class extends ae {
|
|
|
1204
1202
|
_ = w == null ? void 0 : w.newSheetTransform, b = w == null ? void 0 : w.newTransform;
|
|
1205
1203
|
}
|
|
1206
1204
|
else if (e === 1 && f >= v && p <= R)
|
|
1207
|
-
if (
|
|
1205
|
+
if (g >= S && m <= C)
|
|
1208
1206
|
r.push({ unitId: d, subUnitId: h, drawingId: l });
|
|
1209
1207
|
else {
|
|
1210
1208
|
const w = this._shrinkRow(s, a, S, C, o);
|
|
@@ -1234,57 +1232,57 @@ let Ae = class extends ae {
|
|
|
1234
1232
|
_getDrawingUndoForColVisible(i, e, n) {
|
|
1235
1233
|
const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
|
|
1236
1234
|
if (Object.keys(t).forEach((l) => {
|
|
1237
|
-
const c = t[l], { sheetTransform:
|
|
1235
|
+
const c = t[l], { sheetTransform: u, transform: g, anchorType: f = O.Position } = c;
|
|
1238
1236
|
if (f === O.None)
|
|
1239
|
-
this._remainDrawingSize(
|
|
1237
|
+
this._remainDrawingSize(g, r, c);
|
|
1240
1238
|
else {
|
|
1241
|
-
const { from: m, to: p } =
|
|
1239
|
+
const { from: m, to: p } = u, { row: S, column: C } = m, { row: v, column: R } = p;
|
|
1242
1240
|
for (let _ = 0; _ < n.length; _++) {
|
|
1243
|
-
const b = n[_], { startRow: w, endRow:
|
|
1241
|
+
const b = n[_], { startRow: w, endRow: P, startColumn: D, endColumn: T } = b;
|
|
1244
1242
|
if (R < D)
|
|
1245
1243
|
continue;
|
|
1246
1244
|
if (f === O.Position) {
|
|
1247
1245
|
let I = null, A = null;
|
|
1248
|
-
if (C >= D && C <=
|
|
1249
|
-
const G = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn:
|
|
1246
|
+
if (C >= D && C <= T) {
|
|
1247
|
+
const G = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: T, startRow: m.row, endRow: p.row });
|
|
1250
1248
|
if (G == null)
|
|
1251
1249
|
return;
|
|
1252
|
-
A = { ...
|
|
1250
|
+
A = { ...g, left: G.startX };
|
|
1253
1251
|
}
|
|
1254
1252
|
if (A != null && (I = N(A, this._selectionRenderService), I != null && A != null)) {
|
|
1255
1253
|
r.push({ ...c, sheetTransform: I, transform: A });
|
|
1256
1254
|
break;
|
|
1257
1255
|
}
|
|
1258
|
-
this._remainDrawingSize(
|
|
1256
|
+
this._remainDrawingSize(g, r, c);
|
|
1259
1257
|
continue;
|
|
1260
1258
|
}
|
|
1261
|
-
if (C >= D && R <=
|
|
1259
|
+
if (C >= D && R <= T)
|
|
1262
1260
|
continue;
|
|
1263
1261
|
let U = null, M = null;
|
|
1264
|
-
if (C >= D && C <=
|
|
1265
|
-
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn:
|
|
1262
|
+
if (C >= D && C <= T) {
|
|
1263
|
+
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: T, startRow: m.row, endRow: p.row });
|
|
1266
1264
|
if (I == null)
|
|
1267
1265
|
return;
|
|
1268
1266
|
M = {
|
|
1269
|
-
...
|
|
1267
|
+
...g,
|
|
1270
1268
|
left: (I == null ? void 0 : I.startX) || 0,
|
|
1271
|
-
width: ((
|
|
1269
|
+
width: ((g == null ? void 0 : g.width) || 0) - I.endX + I.startX
|
|
1272
1270
|
};
|
|
1273
|
-
} else if (R >= D && R <=
|
|
1271
|
+
} else if (R >= D && R <= T) {
|
|
1274
1272
|
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: R, startRow: m.row, endRow: p.row });
|
|
1275
1273
|
if (I == null)
|
|
1276
1274
|
return;
|
|
1277
1275
|
M = {
|
|
1278
|
-
...
|
|
1279
|
-
left: I.startX - ((
|
|
1276
|
+
...g,
|
|
1277
|
+
left: I.startX - ((g == null ? void 0 : g.width) || 0)
|
|
1280
1278
|
};
|
|
1281
1279
|
} else {
|
|
1282
|
-
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn:
|
|
1280
|
+
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: T, startRow: m.row, endRow: p.row });
|
|
1283
1281
|
if (I == null)
|
|
1284
1282
|
return;
|
|
1285
1283
|
if (M = {
|
|
1286
|
-
...
|
|
1287
|
-
width: ((
|
|
1284
|
+
...g,
|
|
1285
|
+
width: ((g == null ? void 0 : g.width) || 0) - I.endX + I.startX
|
|
1288
1286
|
}, U = N(M, this._selectionRenderService), U != null && M != null) {
|
|
1289
1287
|
s.push({ ...c, sheetTransform: U, transform: M });
|
|
1290
1288
|
break;
|
|
@@ -1294,7 +1292,7 @@ let Ae = class extends ae {
|
|
|
1294
1292
|
r.push({ ...c, sheetTransform: U, transform: M });
|
|
1295
1293
|
break;
|
|
1296
1294
|
} else
|
|
1297
|
-
this._remainDrawingSize(
|
|
1295
|
+
this._remainDrawingSize(g, r, c);
|
|
1298
1296
|
}
|
|
1299
1297
|
}
|
|
1300
1298
|
}), r.length === 0 && s.length === 0)
|
|
@@ -1328,57 +1326,57 @@ let Ae = class extends ae {
|
|
|
1328
1326
|
_getDrawingUndoForRowVisible(i, e, n) {
|
|
1329
1327
|
const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
|
|
1330
1328
|
if (Object.keys(t).forEach((l) => {
|
|
1331
|
-
const c = t[l], { sheetTransform:
|
|
1329
|
+
const c = t[l], { sheetTransform: u, transform: g, anchorType: f = O.Position } = c;
|
|
1332
1330
|
if (f === O.None)
|
|
1333
|
-
this._remainDrawingSize(
|
|
1331
|
+
this._remainDrawingSize(g, r, c);
|
|
1334
1332
|
else {
|
|
1335
|
-
const { from: m, to: p } =
|
|
1333
|
+
const { from: m, to: p } = u, { row: S, column: C } = m, { row: v, column: R } = p;
|
|
1336
1334
|
for (let _ = 0; _ < n.length; _++) {
|
|
1337
|
-
const b = n[_], { startRow: w, endRow:
|
|
1335
|
+
const b = n[_], { startRow: w, endRow: P, startColumn: D, endColumn: T } = b;
|
|
1338
1336
|
if (v < w)
|
|
1339
1337
|
continue;
|
|
1340
1338
|
if (f === O.Position) {
|
|
1341
1339
|
let I = null, A = null;
|
|
1342
|
-
if (S >= w && S <=
|
|
1343
|
-
const G = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: S, endRow:
|
|
1340
|
+
if (S >= w && S <= P) {
|
|
1341
|
+
const G = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: S, endRow: P });
|
|
1344
1342
|
if (G == null)
|
|
1345
1343
|
return;
|
|
1346
|
-
A = { ...
|
|
1344
|
+
A = { ...g, top: G.startY };
|
|
1347
1345
|
}
|
|
1348
1346
|
if (A != null && (I = N(A, this._selectionRenderService), I != null && A != null)) {
|
|
1349
1347
|
r.push({ ...c, sheetTransform: I, transform: A });
|
|
1350
1348
|
break;
|
|
1351
1349
|
}
|
|
1352
|
-
this._remainDrawingSize(
|
|
1350
|
+
this._remainDrawingSize(g, r, c);
|
|
1353
1351
|
continue;
|
|
1354
1352
|
}
|
|
1355
|
-
if (S >= w && v <=
|
|
1353
|
+
if (S >= w && v <= P)
|
|
1356
1354
|
continue;
|
|
1357
1355
|
let U = null, M = null;
|
|
1358
|
-
if (S >= w && S <=
|
|
1359
|
-
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: S, endRow:
|
|
1356
|
+
if (S >= w && S <= P) {
|
|
1357
|
+
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: S, endRow: P });
|
|
1360
1358
|
if (I == null)
|
|
1361
1359
|
return;
|
|
1362
1360
|
M = {
|
|
1363
|
-
...
|
|
1361
|
+
...g,
|
|
1364
1362
|
top: (I == null ? void 0 : I.startY) || 0,
|
|
1365
|
-
height: ((
|
|
1363
|
+
height: ((g == null ? void 0 : g.height) || 0) - I.endY + I.startY
|
|
1366
1364
|
};
|
|
1367
|
-
} else if (v >= w && v <=
|
|
1365
|
+
} else if (v >= w && v <= P) {
|
|
1368
1366
|
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow: v });
|
|
1369
1367
|
if (I == null)
|
|
1370
1368
|
return;
|
|
1371
1369
|
M = {
|
|
1372
|
-
...
|
|
1373
|
-
top: I.startY - ((
|
|
1370
|
+
...g,
|
|
1371
|
+
top: I.startY - ((g == null ? void 0 : g.height) || 0)
|
|
1374
1372
|
};
|
|
1375
1373
|
} else {
|
|
1376
|
-
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow:
|
|
1374
|
+
const I = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow: P });
|
|
1377
1375
|
if (I == null)
|
|
1378
1376
|
return;
|
|
1379
1377
|
if (M = {
|
|
1380
|
-
...
|
|
1381
|
-
height: ((
|
|
1378
|
+
...g,
|
|
1379
|
+
height: ((g == null ? void 0 : g.height) || 0) - I.endY + I.startY
|
|
1382
1380
|
}, U = N(M, this._selectionRenderService), U != null && M != null) {
|
|
1383
1381
|
s.push({ ...c, sheetTransform: U, transform: M });
|
|
1384
1382
|
break;
|
|
@@ -1388,7 +1386,7 @@ let Ae = class extends ae {
|
|
|
1388
1386
|
r.push({ ...c, sheetTransform: U, transform: M });
|
|
1389
1387
|
break;
|
|
1390
1388
|
} else
|
|
1391
|
-
this._remainDrawingSize(
|
|
1389
|
+
this._remainDrawingSize(g, r, c);
|
|
1392
1390
|
}
|
|
1393
1391
|
}
|
|
1394
1392
|
}), r.length === 0 && s.length === 0)
|
|
@@ -1412,12 +1410,12 @@ let Ae = class extends ae {
|
|
|
1412
1410
|
if (l === O.None)
|
|
1413
1411
|
this._remainDrawingSize(h, s, a);
|
|
1414
1412
|
else {
|
|
1415
|
-
const { from: c, to:
|
|
1413
|
+
const { from: c, to: u } = d, { row: g, column: f } = c, { row: m, column: p } = u;
|
|
1416
1414
|
for (let S = 0; S < n.length; S++) {
|
|
1417
1415
|
const C = n[S], { startRow: v, endRow: R, startColumn: _, endColumn: b } = C;
|
|
1418
1416
|
if (m < v || p < _)
|
|
1419
1417
|
continue;
|
|
1420
|
-
if (l === O.Position && (
|
|
1418
|
+
if (l === O.Position && (g <= v && m >= R || f <= _ && p >= b)) {
|
|
1421
1419
|
this._remainDrawingSize(h, s, a);
|
|
1422
1420
|
continue;
|
|
1423
1421
|
}
|
|
@@ -1453,9 +1451,9 @@ let Ae = class extends ae {
|
|
|
1453
1451
|
const n = this._getUnitIdAndSubUnitId(i, e);
|
|
1454
1452
|
if (n == null)
|
|
1455
1453
|
return { redos: [], undos: [] };
|
|
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 = [],
|
|
1457
|
-
if (Object.keys(l).forEach((
|
|
1458
|
-
const f = l[
|
|
1454
|
+
const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, a = s.endRow, d = [], h = [], l = this._sheetDrawingService.getDrawingData(t, r), c = [], u = [];
|
|
1455
|
+
if (Object.keys(l).forEach((g) => {
|
|
1456
|
+
const f = l[g], { sheetTransform: m, transform: p, anchorType: S = O.Position } = f;
|
|
1459
1457
|
if (m == null || p == null)
|
|
1460
1458
|
return;
|
|
1461
1459
|
let C, v;
|
|
@@ -1463,9 +1461,9 @@ let Ae = class extends ae {
|
|
|
1463
1461
|
const _ = this._expandRow(m, p, o, a, S);
|
|
1464
1462
|
C = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
|
|
1465
1463
|
} else {
|
|
1466
|
-
const { from: _, to: b } = m, { row: w } = _, { row:
|
|
1467
|
-
if (w >= o &&
|
|
1468
|
-
|
|
1464
|
+
const { from: _, to: b } = m, { row: w } = _, { row: P } = b;
|
|
1465
|
+
if (w >= o && P <= a)
|
|
1466
|
+
u.push({ unitId: t, subUnitId: r, drawingId: g });
|
|
1469
1467
|
else {
|
|
1470
1468
|
const D = this._shrinkRow(m, p, o, a, S);
|
|
1471
1469
|
C = D == null ? void 0 : D.newSheetTransform, v = D == null ? void 0 : D.newTransform;
|
|
@@ -1473,16 +1471,16 @@ let Ae = class extends ae {
|
|
|
1473
1471
|
}
|
|
1474
1472
|
if (!C || !v)
|
|
1475
1473
|
return;
|
|
1476
|
-
const R = { unitId: t, subUnitId: r, drawingId:
|
|
1474
|
+
const R = { unitId: t, subUnitId: r, drawingId: g, transform: v, sheetTransform: C };
|
|
1477
1475
|
c.push(R);
|
|
1478
|
-
}), c.length === 0 &&
|
|
1476
|
+
}), c.length === 0 && u.length === 0)
|
|
1479
1477
|
return { redos: [], undos: [] };
|
|
1480
1478
|
if (c.length > 0) {
|
|
1481
|
-
const
|
|
1479
|
+
const g = this._sheetDrawingService.getBatchUpdateOp(c), { undo: f, redo: m, objects: p } = g;
|
|
1482
1480
|
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 } });
|
|
1483
1481
|
}
|
|
1484
|
-
if (
|
|
1485
|
-
const
|
|
1482
|
+
if (u.length > 0) {
|
|
1483
|
+
const g = this._sheetDrawingService.getBatchRemoveOp(u), f = g.undo, m = g.redo, p = g.objects;
|
|
1486
1484
|
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 } });
|
|
1487
1485
|
}
|
|
1488
1486
|
return d.push({ id: j.id, params: [t] }), h.push({ id: j.id, params: [t] }), {
|
|
@@ -1494,9 +1492,9 @@ let Ae = class extends ae {
|
|
|
1494
1492
|
const n = this._getUnitIdAndSubUnitId(i, e);
|
|
1495
1493
|
if (n == null)
|
|
1496
1494
|
return { redos: [], undos: [] };
|
|
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 = [],
|
|
1498
|
-
if (Object.keys(l).forEach((
|
|
1499
|
-
const f = l[
|
|
1495
|
+
const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, a = s.endColumn, d = [], h = [], l = this._sheetDrawingService.getDrawingData(t, r), c = [], u = [];
|
|
1496
|
+
if (Object.keys(l).forEach((g) => {
|
|
1497
|
+
const f = l[g], { sheetTransform: m, transform: p, anchorType: S = O.Position } = f;
|
|
1500
1498
|
if (m == null || p == null)
|
|
1501
1499
|
return;
|
|
1502
1500
|
let C, v;
|
|
@@ -1504,9 +1502,9 @@ let Ae = class extends ae {
|
|
|
1504
1502
|
const _ = this._expandCol(m, p, o, a, S);
|
|
1505
1503
|
C = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
|
|
1506
1504
|
} else {
|
|
1507
|
-
const { from: _, to: b } = m, { column: w } = _, { column:
|
|
1508
|
-
if (w >= o &&
|
|
1509
|
-
|
|
1505
|
+
const { from: _, to: b } = m, { column: w } = _, { column: P } = b;
|
|
1506
|
+
if (w >= o && P <= a)
|
|
1507
|
+
u.push({ unitId: t, subUnitId: r, drawingId: g });
|
|
1510
1508
|
else {
|
|
1511
1509
|
const D = this._shrinkCol(m, p, o, a, S);
|
|
1512
1510
|
C = D == null ? void 0 : D.newSheetTransform, v = D == null ? void 0 : D.newTransform;
|
|
@@ -1514,16 +1512,16 @@ let Ae = class extends ae {
|
|
|
1514
1512
|
}
|
|
1515
1513
|
if (!C || !v)
|
|
1516
1514
|
return;
|
|
1517
|
-
const R = { unitId: t, subUnitId: r, drawingId:
|
|
1515
|
+
const R = { unitId: t, subUnitId: r, drawingId: g, transform: v, sheetTransform: C };
|
|
1518
1516
|
c.push(R);
|
|
1519
|
-
}), c.length === 0 &&
|
|
1517
|
+
}), c.length === 0 && u.length === 0)
|
|
1520
1518
|
return { redos: [], undos: [] };
|
|
1521
1519
|
if (c.length > 0) {
|
|
1522
|
-
const
|
|
1520
|
+
const g = this._sheetDrawingService.getBatchUpdateOp(c), { undo: f, redo: m, objects: p } = g;
|
|
1523
1521
|
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 } });
|
|
1524
1522
|
}
|
|
1525
|
-
if (
|
|
1526
|
-
const
|
|
1523
|
+
if (u.length > 0) {
|
|
1524
|
+
const g = this._sheetDrawingService.getBatchRemoveOp(u), f = g.undo, m = g.redo, p = g.objects;
|
|
1527
1525
|
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 } });
|
|
1528
1526
|
}
|
|
1529
1527
|
return d.push({ id: j.id, params: [t] }), h.push({ id: j.id, params: [t] }), { redos: d, undos: h };
|
|
@@ -1537,10 +1535,10 @@ let Ae = class extends ae {
|
|
|
1537
1535
|
};
|
|
1538
1536
|
let l = null, c = null;
|
|
1539
1537
|
if (d >= n) {
|
|
1540
|
-
const
|
|
1541
|
-
if (
|
|
1538
|
+
const u = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: a.row });
|
|
1539
|
+
if (u == null)
|
|
1542
1540
|
return;
|
|
1543
|
-
c = { ...e, left: (e.left || 0) +
|
|
1541
|
+
c = { ...e, left: (e.left || 0) + u.endX - u.startX }, l = N(c, this._selectionRenderService);
|
|
1544
1542
|
} else if (h >= t)
|
|
1545
1543
|
if (r === O.Both)
|
|
1546
1544
|
l = {
|
|
@@ -1588,24 +1586,24 @@ let Ae = class extends ae {
|
|
|
1588
1586
|
if (d === n)
|
|
1589
1587
|
c = { ...e, left: (e.left || 0) - i.from.columnOffset };
|
|
1590
1588
|
else {
|
|
1591
|
-
const
|
|
1592
|
-
if (
|
|
1589
|
+
const u = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: d - 1, startRow: o.row, endRow: a.row });
|
|
1590
|
+
if (u == null)
|
|
1593
1591
|
return;
|
|
1594
|
-
c = { ...e, left: (e.left || 0) -
|
|
1592
|
+
c = { ...e, left: (e.left || 0) - u.endX + u.startX - i.from.columnOffset };
|
|
1595
1593
|
}
|
|
1596
1594
|
l = N(c, this._selectionRenderService);
|
|
1597
1595
|
} else if (h >= n && h <= t && r === O.Both) {
|
|
1598
|
-
const
|
|
1596
|
+
const u = this._skeletonManagerService.attachRangeWithCoord({
|
|
1599
1597
|
startColumn: n - 1,
|
|
1600
1598
|
endColumn: n - 1,
|
|
1601
1599
|
startRow: o.row,
|
|
1602
1600
|
endRow: a.row
|
|
1603
1601
|
});
|
|
1604
|
-
if (
|
|
1602
|
+
if (u == null)
|
|
1605
1603
|
return;
|
|
1606
1604
|
l = {
|
|
1607
1605
|
from: { ...o },
|
|
1608
|
-
to: { ...a, column: n - 1, columnOffset:
|
|
1606
|
+
to: { ...a, column: n - 1, columnOffset: u.endX - u.startX }
|
|
1609
1607
|
}, c = $(l, this._selectionRenderService, this._skeletonManagerService);
|
|
1610
1608
|
}
|
|
1611
1609
|
}
|
|
@@ -1623,10 +1621,10 @@ let Ae = class extends ae {
|
|
|
1623
1621
|
};
|
|
1624
1622
|
let l = null, c = null;
|
|
1625
1623
|
if (d >= n) {
|
|
1626
|
-
const
|
|
1627
|
-
if (
|
|
1624
|
+
const u = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: a.column });
|
|
1625
|
+
if (u == null)
|
|
1628
1626
|
return;
|
|
1629
|
-
c = { ...e, top: (e.top || 0) +
|
|
1627
|
+
c = { ...e, top: (e.top || 0) + u.endY - u.startY }, l = N(c, this._selectionRenderService);
|
|
1630
1628
|
} else if (h >= t)
|
|
1631
1629
|
if (r === O.Both)
|
|
1632
1630
|
l = {
|
|
@@ -1677,19 +1675,19 @@ let Ae = class extends ae {
|
|
|
1677
1675
|
if (d === n)
|
|
1678
1676
|
c = { ...e, top: (e.top || 0) - i.from.rowOffset };
|
|
1679
1677
|
else {
|
|
1680
|
-
const
|
|
1681
|
-
if (
|
|
1678
|
+
const u = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: d - 1, startColumn: o.column, endColumn: a.column });
|
|
1679
|
+
if (u == null)
|
|
1682
1680
|
return;
|
|
1683
|
-
c = { ...e, top: (e.top || 0) -
|
|
1681
|
+
c = { ...e, top: (e.top || 0) - u.endY + u.startY - i.from.rowOffset };
|
|
1684
1682
|
}
|
|
1685
1683
|
l = N(c, this._selectionRenderService);
|
|
1686
1684
|
} else if (h >= n && h <= t && r === O.Both) {
|
|
1687
|
-
const
|
|
1688
|
-
if (
|
|
1685
|
+
const u = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: n - 1, endRow: n - 1 });
|
|
1686
|
+
if (u == null)
|
|
1689
1687
|
return;
|
|
1690
1688
|
l = {
|
|
1691
1689
|
from: { ...o },
|
|
1692
|
-
to: { ...a, row: n - 1, rowOffset:
|
|
1690
|
+
to: { ...a, row: n - 1, rowOffset: u.endY - u.startY }
|
|
1693
1691
|
}, c = $(l, this._selectionRenderService, this._skeletonManagerService);
|
|
1694
1692
|
}
|
|
1695
1693
|
}
|
|
@@ -1701,7 +1699,7 @@ let Ae = class extends ae {
|
|
|
1701
1699
|
_commandListener() {
|
|
1702
1700
|
this.disposeWithMe(
|
|
1703
1701
|
this._commandService.onCommandExecuted((i) => {
|
|
1704
|
-
i.id ===
|
|
1702
|
+
i.id === sr.id && setTimeout(() => {
|
|
1705
1703
|
const e = i.params, { unitId: n, subUnitId: t } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
|
|
1706
1704
|
Object.keys(r).forEach((a) => {
|
|
1707
1705
|
const d = r[a];
|
|
@@ -1709,8 +1707,8 @@ let Ae = class extends ae {
|
|
|
1709
1707
|
const l = d[h].data;
|
|
1710
1708
|
l != null && Object.keys(l).forEach((c) => {
|
|
1711
1709
|
if (a === n && h === t) {
|
|
1712
|
-
const
|
|
1713
|
-
|
|
1710
|
+
const u = l[c];
|
|
1711
|
+
u.transform = $(u.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(l[c]);
|
|
1714
1712
|
} else
|
|
1715
1713
|
o.push(l[c]);
|
|
1716
1714
|
});
|
|
@@ -1723,7 +1721,7 @@ let Ae = class extends ae {
|
|
|
1723
1721
|
_sheetRefreshListener() {
|
|
1724
1722
|
this.disposeWithMe(
|
|
1725
1723
|
this._commandService.onCommandExecuted((i) => {
|
|
1726
|
-
|
|
1724
|
+
di.includes(i.id) && requestIdleCallback(() => {
|
|
1727
1725
|
const e = i.params, { unitId: n, subUnitId: t, ranges: r } = e;
|
|
1728
1726
|
this._refreshDrawingTransform(n, t, r);
|
|
1729
1727
|
});
|
|
@@ -1736,10 +1734,10 @@ let Ae = class extends ae {
|
|
|
1736
1734
|
const o = t[s], { sheetTransform: a, anchorType: d = O.Position } = o;
|
|
1737
1735
|
if (d === O.None)
|
|
1738
1736
|
return !0;
|
|
1739
|
-
const { from: h, to: l } = a, { row: c, column:
|
|
1737
|
+
const { from: h, to: l } = a, { row: c, column: u } = h, { row: g, column: f } = l;
|
|
1740
1738
|
for (let m = 0; m < n.length; m++) {
|
|
1741
1739
|
const p = n[m], { startRow: S, endRow: C, startColumn: v, endColumn: R } = p;
|
|
1742
|
-
if (
|
|
1740
|
+
if (cn.intersects(
|
|
1743
1741
|
{
|
|
1744
1742
|
startRow: S,
|
|
1745
1743
|
endRow: C,
|
|
@@ -1748,11 +1746,11 @@ let Ae = class extends ae {
|
|
|
1748
1746
|
},
|
|
1749
1747
|
{
|
|
1750
1748
|
startRow: c,
|
|
1751
|
-
endRow:
|
|
1752
|
-
startColumn:
|
|
1749
|
+
endRow: g,
|
|
1750
|
+
startColumn: u,
|
|
1753
1751
|
endColumn: f
|
|
1754
1752
|
}
|
|
1755
|
-
) || c > C ||
|
|
1753
|
+
) || c > C || u > R) {
|
|
1756
1754
|
r.push({
|
|
1757
1755
|
...o,
|
|
1758
1756
|
transform: $(a, this._selectionRenderService, this._skeletonManagerService)
|
|
@@ -1763,22 +1761,22 @@ let Ae = class extends ae {
|
|
|
1763
1761
|
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(j.id, [i]));
|
|
1764
1762
|
}
|
|
1765
1763
|
};
|
|
1766
|
-
Ae =
|
|
1767
|
-
se
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1764
|
+
Ae = ai([
|
|
1765
|
+
ie(se.Rendered, Ae),
|
|
1766
|
+
ce(0, V),
|
|
1767
|
+
ce(1, W(or)),
|
|
1768
|
+
ce(2, K),
|
|
1769
|
+
ce(3, k),
|
|
1770
|
+
ce(4, z),
|
|
1771
|
+
ce(5, he)
|
|
1774
1772
|
], Ae);
|
|
1775
|
-
var
|
|
1776
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1773
|
+
var li = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, gi = (i, e, n, t) => {
|
|
1774
|
+
for (var r = t > 1 ? void 0 : t ? ui(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1777
1775
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1778
|
-
return t && r &&
|
|
1779
|
-
},
|
|
1780
|
-
function
|
|
1781
|
-
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(
|
|
1776
|
+
return t && r && li(e, n, r), r;
|
|
1777
|
+
}, de = (i, e) => (n, t) => e(n, t, i);
|
|
1778
|
+
function hi(i, e, n, t) {
|
|
1779
|
+
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(Tn.VIEW_MAIN), a = {
|
|
1782
1780
|
left: !0,
|
|
1783
1781
|
top: !0
|
|
1784
1782
|
};
|
|
@@ -1787,11 +1785,11 @@ function gi(i, e, n, t) {
|
|
|
1787
1785
|
...i,
|
|
1788
1786
|
absolute: a
|
|
1789
1787
|
};
|
|
1790
|
-
const { left: d, right: h, top: l, bottom: c } = i,
|
|
1788
|
+
const { left: d, right: h, top: l, bottom: c } = i, u = t.getFreeze(), { startColumn: g, startRow: f, xSplit: m, ySplit: p } = u, S = n.getNoMergeCellPositionByIndexWithNoHeader(f - p, g - m), C = n.getNoMergeCellPositionByIndexWithNoHeader(f, g), { rowHeaderWidth: v, columnHeaderHeight: R } = n, _ = C.startX - S.startX, b = C.startY - S.startY, { top: w, left: P, viewportScrollX: D, viewportScrollY: T } = o;
|
|
1791
1789
|
let U, M;
|
|
1792
|
-
d <
|
|
1790
|
+
d < P ? (a.left = !0, U = (_ + v + (d - P)) * r, M = Math.max(
|
|
1793
1791
|
Math.min(
|
|
1794
|
-
(_ + v + (h -
|
|
1792
|
+
(_ + v + (h - P)) * r,
|
|
1795
1793
|
(_ + v) * r
|
|
1796
1794
|
),
|
|
1797
1795
|
(h - D) * r
|
|
@@ -1802,8 +1800,8 @@ function gi(i, e, n, t) {
|
|
|
1802
1800
|
(b + R + (h - w)) * s,
|
|
1803
1801
|
(b + R) * s
|
|
1804
1802
|
),
|
|
1805
|
-
(c -
|
|
1806
|
-
)) : (a.top = !1, I = Math.max((l -
|
|
1803
|
+
(c - T) * s
|
|
1804
|
+
)) : (a.top = !1, I = Math.max((l - T) * s, (b + R) * s), A = Math.max((c - T) * s, (b + R) * s)), {
|
|
1807
1805
|
left: U,
|
|
1808
1806
|
right: M,
|
|
1809
1807
|
top: I,
|
|
@@ -1817,7 +1815,7 @@ const ze = (i, e, n, t) => {
|
|
|
1817
1815
|
right: s + a,
|
|
1818
1816
|
top: o,
|
|
1819
1817
|
bottom: o + d
|
|
1820
|
-
}, c =
|
|
1818
|
+
}, c = hi(l, r, n, t);
|
|
1821
1819
|
return {
|
|
1822
1820
|
startX: c.left,
|
|
1823
1821
|
endX: c.right,
|
|
@@ -1829,16 +1827,17 @@ const ze = (i, e, n, t) => {
|
|
|
1829
1827
|
absolute: c.absolute
|
|
1830
1828
|
};
|
|
1831
1829
|
};
|
|
1832
|
-
let tt = class extends
|
|
1833
|
-
constructor(e, n, t, r, s, o
|
|
1830
|
+
let tt = class extends oe {
|
|
1831
|
+
constructor(e, n, t, r, s, o) {
|
|
1834
1832
|
super();
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1833
|
+
H(this, "_domLayerMap", /* @__PURE__ */ new Map());
|
|
1834
|
+
H(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
1835
|
+
H(this, "_transformChange$", new mt());
|
|
1836
|
+
H(this, "transformChange$", this._transformChange$.asObservable());
|
|
1837
|
+
H(this, "_remove$", new mt());
|
|
1838
|
+
H(this, "remove$", this._remove$.asObservable());
|
|
1839
|
+
H(this, "_hooks", []);
|
|
1840
|
+
this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._drawingAddListener(), this._scrollUpdateListener(), this._featureUpdateListener(), this._deleteListener();
|
|
1842
1841
|
}
|
|
1843
1842
|
_ensureMap(e, n) {
|
|
1844
1843
|
let t = this._domLayerMap.get(e);
|
|
@@ -1855,14 +1854,20 @@ let tt = class extends ae {
|
|
|
1855
1854
|
const r = t.getTransformerByCreate(), s = n.engine.getCanvasElement();
|
|
1856
1855
|
return { scene: t, transformer: r, renderObject: n, canvas: s };
|
|
1857
1856
|
}
|
|
1857
|
+
_getFloatDomProps(e) {
|
|
1858
|
+
let n;
|
|
1859
|
+
return this._hooks.forEach((t) => {
|
|
1860
|
+
n = t.onGetFloatDomProps(e);
|
|
1861
|
+
}), n;
|
|
1862
|
+
}
|
|
1858
1863
|
// eslint-disable-next-line max-lines-per-function
|
|
1859
1864
|
_drawingAddListener() {
|
|
1860
1865
|
this.disposeWithMe(
|
|
1861
1866
|
// eslint-disable-next-line max-lines-per-function
|
|
1862
1867
|
this._drawingManagerService.add$.subscribe((e) => {
|
|
1863
1868
|
e.forEach((n) => {
|
|
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(
|
|
1869
|
+
var ot, at, ct;
|
|
1870
|
+
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(re).getWorksheetSkeleton(r);
|
|
1866
1871
|
if (a == null || o == null || d == null)
|
|
1867
1872
|
return;
|
|
1868
1873
|
const { transform: h, drawingType: l } = a;
|
|
@@ -1871,12 +1876,12 @@ let tt = class extends ae {
|
|
|
1871
1876
|
const c = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1872
1877
|
if (c == null)
|
|
1873
1878
|
return;
|
|
1874
|
-
const { scene:
|
|
1879
|
+
const { scene: u, canvas: g } = c;
|
|
1875
1880
|
if (h == null)
|
|
1876
1881
|
return !0;
|
|
1877
|
-
const { left: f, top: m, width: p, height: S, angle: C, flipX: v, flipY: R, skewX: _, skewY: b } = h, w =
|
|
1878
|
-
if (
|
|
1879
|
-
|
|
1882
|
+
const { left: f, top: m, width: p, height: S, angle: C, flipX: v, flipY: R, skewX: _, skewY: b } = h, w = Dn({ unitId: t, subUnitId: r, drawingId: s }), P = u.getObject(w);
|
|
1883
|
+
if (P != null) {
|
|
1884
|
+
P.transformByState({ left: f, top: m, width: p, height: S, angle: C, flipX: v, flipY: R, skewX: _, skewY: b });
|
|
1880
1885
|
return;
|
|
1881
1886
|
}
|
|
1882
1887
|
const D = {
|
|
@@ -1885,11 +1890,11 @@ let tt = class extends ae {
|
|
|
1885
1890
|
width: p,
|
|
1886
1891
|
height: S,
|
|
1887
1892
|
zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
|
|
1888
|
-
},
|
|
1889
|
-
|
|
1890
|
-
const U = this._ensureMap(t, r), M = new
|
|
1893
|
+
}, T = new On(w, D);
|
|
1894
|
+
u.addObject(T, Pn).attachTransformerTo(T);
|
|
1895
|
+
const U = this._ensureMap(t, r), M = new dn(), I = ze(T, c.renderObject, d.skeleton, o.worksheet), A = new Vn(I), G = {
|
|
1891
1896
|
dispose: M,
|
|
1892
|
-
rect:
|
|
1897
|
+
rect: T,
|
|
1893
1898
|
position$: A,
|
|
1894
1899
|
unitId: t,
|
|
1895
1900
|
subUnitId: r
|
|
@@ -1899,21 +1904,21 @@ let tt = class extends ae {
|
|
|
1899
1904
|
id: s,
|
|
1900
1905
|
componentKey: a.componentKey,
|
|
1901
1906
|
onPointerDown: (x) => {
|
|
1902
|
-
|
|
1907
|
+
g.dispatchEvent(new PointerEvent(x.type, x));
|
|
1903
1908
|
},
|
|
1904
1909
|
onPointerMove: (x) => {
|
|
1905
|
-
|
|
1910
|
+
g.dispatchEvent(new PointerEvent(x.type, x));
|
|
1906
1911
|
},
|
|
1907
1912
|
onPointerUp: (x) => {
|
|
1908
|
-
|
|
1913
|
+
g.dispatchEvent(new PointerEvent(x.type, x));
|
|
1909
1914
|
},
|
|
1910
1915
|
onWheel: (x) => {
|
|
1911
|
-
|
|
1916
|
+
g.dispatchEvent(new WheelEvent(x.type, x));
|
|
1912
1917
|
},
|
|
1913
|
-
props: (at = U.get(s)) == null ? void 0 : at.props
|
|
1918
|
+
props: (ct = (at = U.get(s)) == null ? void 0 : at.props) != null ? ct : this._getFloatDomProps(s)
|
|
1914
1919
|
});
|
|
1915
|
-
const J =
|
|
1916
|
-
const x = ze(
|
|
1920
|
+
const J = T.onTransformChange$.subscribeEvent(() => {
|
|
1921
|
+
const x = ze(T, c.renderObject, d.skeleton, o.worksheet);
|
|
1917
1922
|
A.next(
|
|
1918
1923
|
x
|
|
1919
1924
|
);
|
|
@@ -1929,40 +1934,36 @@ let tt = class extends ae {
|
|
|
1929
1934
|
this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
1930
1935
|
var t, r;
|
|
1931
1936
|
const n = (s, o) => {
|
|
1932
|
-
var
|
|
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 = (
|
|
1934
|
-
!a || !l || !c || h.forEach((
|
|
1935
|
-
const f = this._domLayerInfoMap.get(
|
|
1937
|
+
var u;
|
|
1938
|
+
const a = this._getSceneAndTransformerByDrawingSearch(s), d = this._ensureMap(s, o), h = Array.from(d.keys()), l = le(this._univerInstanceService, { unitId: s, subUnitId: o }), c = (u = this._renderManagerService.getRenderById(s)) == null ? void 0 : u.with(re).getWorksheetSkeleton(o);
|
|
1939
|
+
!a || !l || !c || h.forEach((g) => {
|
|
1940
|
+
const f = this._domLayerInfoMap.get(g);
|
|
1936
1941
|
if (f) {
|
|
1937
1942
|
const m = ze(f.rect, a.renderObject, c.skeleton, l.worksheet);
|
|
1938
1943
|
f.position$.next(m);
|
|
1939
1944
|
}
|
|
1940
1945
|
});
|
|
1941
1946
|
};
|
|
1942
|
-
if (e.id ===
|
|
1947
|
+
if (e.id === jn.id) {
|
|
1943
1948
|
const s = e.params, { unitId: o, sheetId: a } = s;
|
|
1944
1949
|
n(o, a);
|
|
1945
|
-
} else if (e.id ===
|
|
1950
|
+
} else if (e.id === Ln.id) {
|
|
1946
1951
|
const s = e.params, { unitId: o } = s;
|
|
1947
1952
|
Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((d) => {
|
|
1948
1953
|
n(o, d);
|
|
1949
1954
|
});
|
|
1950
|
-
} else if (e.id ===
|
|
1955
|
+
} else if (e.id === ar.id) {
|
|
1951
1956
|
const { unitId: s, subUnitId: o } = e.params;
|
|
1952
1957
|
n(s, o);
|
|
1953
1958
|
}
|
|
1954
1959
|
}));
|
|
1955
1960
|
}
|
|
1956
|
-
_getPosition(e) {
|
|
1957
|
-
|
|
1958
|
-
|
|
1961
|
+
_getPosition(e, n) {
|
|
1962
|
+
var u;
|
|
1963
|
+
const { startX: t, endX: r, startY: s, endY: o } = e, a = (u = this._renderManagerService.getRenderById(n)) == null ? void 0 : u.with(Ge);
|
|
1964
|
+
if (a == null)
|
|
1959
1965
|
return;
|
|
1960
|
-
const
|
|
1961
|
-
column: o.actualColumn,
|
|
1962
|
-
columnOffset: n - o.startX,
|
|
1963
|
-
row: o.actualRow,
|
|
1964
|
-
rowOffset: r - o.startY
|
|
1965
|
-
}, d = this._selectionRenderService.getSelectionCellByPosition(t, s);
|
|
1966
|
+
const d = a.getSelectionCellByPosition(t, s);
|
|
1966
1967
|
if (d == null)
|
|
1967
1968
|
return;
|
|
1968
1969
|
const h = {
|
|
@@ -1970,10 +1971,18 @@ let tt = class extends ae {
|
|
|
1970
1971
|
columnOffset: t - d.startX,
|
|
1971
1972
|
row: d.actualRow,
|
|
1972
1973
|
rowOffset: s - d.startY
|
|
1974
|
+
}, l = a.getSelectionCellByPosition(r, o);
|
|
1975
|
+
if (l == null)
|
|
1976
|
+
return;
|
|
1977
|
+
const c = {
|
|
1978
|
+
column: l.actualColumn,
|
|
1979
|
+
columnOffset: r - l.startX,
|
|
1980
|
+
row: l.actualRow,
|
|
1981
|
+
rowOffset: o - l.startY
|
|
1973
1982
|
};
|
|
1974
1983
|
return {
|
|
1975
|
-
from:
|
|
1976
|
-
to:
|
|
1984
|
+
from: h,
|
|
1985
|
+
to: c
|
|
1977
1986
|
};
|
|
1978
1987
|
}
|
|
1979
1988
|
_featureUpdateListener() {
|
|
@@ -2007,7 +2016,7 @@ let tt = class extends ae {
|
|
|
2007
2016
|
});
|
|
2008
2017
|
if (!n)
|
|
2009
2018
|
throw new Error("cannot find current target!");
|
|
2010
|
-
const { unitId: t, subUnitId: r } = n, { initPosition: s, componentKey: o } = e, a =
|
|
2019
|
+
const { unitId: t, subUnitId: r } = n, { initPosition: s, componentKey: o } = e, a = ne.generateRandomId(), d = this._getPosition(s, t);
|
|
2011
2020
|
if (d == null)
|
|
2012
2021
|
return;
|
|
2013
2022
|
this._ensureMap(t, r).set(a, e);
|
|
@@ -2051,22 +2060,29 @@ let tt = class extends ae {
|
|
|
2051
2060
|
this._commandService.syncExecuteCommand(E.id, { unitId: r, subUnitId: s, op: l, objects: c, type: y.REMOVE });
|
|
2052
2061
|
}
|
|
2053
2062
|
}
|
|
2063
|
+
addHook(e) {
|
|
2064
|
+
return this._hooks.push(e), {
|
|
2065
|
+
dispose: () => {
|
|
2066
|
+
const n = this._hooks.findIndex((t) => t === e);
|
|
2067
|
+
this._hooks.splice(n, 1);
|
|
2068
|
+
}
|
|
2069
|
+
};
|
|
2070
|
+
}
|
|
2054
2071
|
};
|
|
2055
|
-
tt =
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
ne(6, H)
|
|
2072
|
+
tt = gi([
|
|
2073
|
+
de(0, W(K)),
|
|
2074
|
+
de(1, he),
|
|
2075
|
+
de(2, W(V)),
|
|
2076
|
+
de(3, z),
|
|
2077
|
+
de(4, W(Jn)),
|
|
2078
|
+
de(5, k)
|
|
2063
2079
|
], tt);
|
|
2064
|
-
var
|
|
2065
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2080
|
+
var mi = Object.defineProperty, fi = Object.getOwnPropertyDescriptor, pi = (i, e, n, t) => {
|
|
2081
|
+
for (var r = t > 1 ? void 0 : t ? fi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2066
2082
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2067
|
-
return t && r &&
|
|
2083
|
+
return t && r && mi(e, n, r), r;
|
|
2068
2084
|
}, Oe = (i, e) => (n, t) => e(n, t, i);
|
|
2069
|
-
let Ne = class extends
|
|
2085
|
+
let Ne = class extends oe {
|
|
2070
2086
|
constructor(i, e, n, t) {
|
|
2071
2087
|
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
|
|
2072
2088
|
}
|
|
@@ -2091,16 +2107,16 @@ let Ne = class extends ae {
|
|
|
2091
2107
|
const { unitId: t, subUnitId: r } = e, s = this._renderManagerService.getRenderById(t);
|
|
2092
2108
|
if (!s)
|
|
2093
2109
|
return n(i);
|
|
2094
|
-
const o = s.with(
|
|
2110
|
+
const o = s.with(re).getWorksheetSkeleton(r);
|
|
2095
2111
|
if (!o)
|
|
2096
2112
|
return n(i);
|
|
2097
2113
|
const a = this._drawingManagerService.getDrawingDataForUnit(t), d = a == null ? void 0 : a[e.subUnitId];
|
|
2098
2114
|
if (!d)
|
|
2099
2115
|
return n(i);
|
|
2100
|
-
const { scaleX: h, scaleY: l } = s.scene, c = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 },
|
|
2101
|
-
return
|
|
2102
|
-
if (!
|
|
2103
|
-
const f = o.skeleton.getCellPositionByOffset(
|
|
2116
|
+
const { scaleX: h, scaleY: l } = s.scene, c = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, u = d.order.map((g) => d.data[g]).filter((g) => g.drawingType !== Ve.DRAWING_DOM);
|
|
2117
|
+
return u.length ? (u.forEach((g) => {
|
|
2118
|
+
if (!g.groupId && g.transform && ne.isDefine(g.transform.left) && ne.isDefine(g.transform.top) && ne.isDefine(g.transform.width) && ne.isDefine(g.transform.height)) {
|
|
2119
|
+
const f = o.skeleton.getCellPositionByOffset(g.transform.left, g.transform.top, h, l, { x: 0, y: 0 }), m = o.skeleton.getCellPositionByOffset(g.transform.left + g.transform.width, g.transform.top + g.transform.height, h, l, { x: 0, y: 0 });
|
|
2104
2120
|
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);
|
|
2105
2121
|
}
|
|
2106
2122
|
}), n(c)) : n(i);
|
|
@@ -2110,19 +2126,19 @@ let Ne = class extends ae {
|
|
|
2110
2126
|
);
|
|
2111
2127
|
}
|
|
2112
2128
|
};
|
|
2113
|
-
Ne =
|
|
2114
|
-
se
|
|
2115
|
-
Oe(0, W(
|
|
2116
|
-
Oe(1, W(
|
|
2129
|
+
Ne = pi([
|
|
2130
|
+
ie(se.Rendered, Ne),
|
|
2131
|
+
Oe(0, W(Bn)),
|
|
2132
|
+
Oe(1, W(vn)),
|
|
2117
2133
|
Oe(2, z),
|
|
2118
2134
|
Oe(3, K)
|
|
2119
2135
|
], Ne);
|
|
2120
|
-
var
|
|
2121
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2136
|
+
var wi = Object.defineProperty, _i = Object.getOwnPropertyDescriptor, vi = (i, e, n, t) => {
|
|
2137
|
+
for (var r = t > 1 ? void 0 : t ? _i(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2122
2138
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2123
|
-
return t && r &&
|
|
2139
|
+
return t && r && wi(e, n, r), r;
|
|
2124
2140
|
}, fe = (i, e) => (n, t) => e(n, t, i);
|
|
2125
|
-
let je = class extends
|
|
2141
|
+
let je = class extends oe {
|
|
2126
2142
|
constructor(i, e, n, t, r) {
|
|
2127
2143
|
super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
2128
2144
|
}
|
|
@@ -2140,15 +2156,15 @@ let je = class extends ae {
|
|
|
2140
2156
|
return;
|
|
2141
2157
|
}
|
|
2142
2158
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
2143
|
-
if (this._permissionService.composePermission([new
|
|
2159
|
+
if (this._permissionService.composePermission([new pt(r).id, new He(r, s).id]).every((a) => a.value))
|
|
2144
2160
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
2145
2161
|
else {
|
|
2146
2162
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
2147
|
-
const a = e.getUnitId(), d = t.getSheetId(), h = this._drawingManagerService.getDrawingData(a, d), l = Object.values(h), c = this._renderManagerService.getRenderById(a),
|
|
2148
|
-
if (
|
|
2163
|
+
const a = e.getUnitId(), d = t.getSheetId(), h = this._drawingManagerService.getDrawingData(a, d), l = Object.values(h), c = this._renderManagerService.getRenderById(a), u = c == null ? void 0 : c.scene;
|
|
2164
|
+
if (u == null)
|
|
2149
2165
|
return;
|
|
2150
|
-
|
|
2151
|
-
f.classType ===
|
|
2166
|
+
u.getAllObjects().forEach((f) => {
|
|
2167
|
+
f.classType === ae.IMAGE && l.some((m) => f.oKey.includes(m.drawingId)) && u.removeObject(f);
|
|
2152
2168
|
});
|
|
2153
2169
|
}
|
|
2154
2170
|
});
|
|
@@ -2169,15 +2185,15 @@ let je = class extends ae {
|
|
|
2169
2185
|
return;
|
|
2170
2186
|
}
|
|
2171
2187
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
2172
|
-
if (this._permissionService.composePermission([new Ze(r).id, new
|
|
2188
|
+
if (this._permissionService.composePermission([new Ze(r).id, new Pe(r, s).id]).every((a) => a.value))
|
|
2173
2189
|
this._drawingManagerService.setDrawingEditable(!0);
|
|
2174
2190
|
else {
|
|
2175
2191
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
2176
|
-
const a = e.getUnitId(), d = t.getSheetId(), h = this._drawingManagerService.getDrawingData(a, d), l = Object.values(h), c = this._renderManagerService.getRenderById(a),
|
|
2177
|
-
if (
|
|
2192
|
+
const a = e.getUnitId(), d = t.getSheetId(), h = this._drawingManagerService.getDrawingData(a, d), l = Object.values(h), c = this._renderManagerService.getRenderById(a), u = c == null ? void 0 : c.scene;
|
|
2193
|
+
if (u == null)
|
|
2178
2194
|
return;
|
|
2179
|
-
|
|
2180
|
-
f.classType ===
|
|
2195
|
+
u.getAllObjects().forEach((f) => {
|
|
2196
|
+
f.classType === ae.IMAGE && l.some((m) => f.oKey.includes(m.drawingId)) && u.detachTransformerFrom(f);
|
|
2181
2197
|
});
|
|
2182
2198
|
}
|
|
2183
2199
|
});
|
|
@@ -2197,26 +2213,26 @@ let je = class extends ae {
|
|
|
2197
2213
|
const a = this._renderManagerService.getRenderById(r), d = a == null ? void 0 : a.scene;
|
|
2198
2214
|
if (d == null)
|
|
2199
2215
|
return;
|
|
2200
|
-
const h = d.getTransformerByCreate(), l = this._permissionService.composePermission$([new
|
|
2216
|
+
const h = d.getTransformerByCreate(), l = this._permissionService.composePermission$([new pt(r).id, new He(r, s).id]).pipe(ft((u) => u.every((g) => g.value)));
|
|
2201
2217
|
l == null || l.pipe(
|
|
2202
|
-
Me((
|
|
2218
|
+
Me((u) => u !== o),
|
|
2203
2219
|
De()
|
|
2204
2220
|
).subscribe({
|
|
2205
|
-
next: (
|
|
2206
|
-
o =
|
|
2207
|
-
const
|
|
2208
|
-
|
|
2209
|
-
p.classType ===
|
|
2221
|
+
next: (u) => {
|
|
2222
|
+
o = u, this._drawingManagerService.setDrawingVisible(u);
|
|
2223
|
+
const g = d.getAllObjects(), f = this._drawingManagerService.getDrawingData(r, s), m = Object.values(f);
|
|
2224
|
+
u ? this._drawingManagerService.addNotification(m) : (g.forEach((p) => {
|
|
2225
|
+
p.classType === ae.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.removeObject(p);
|
|
2210
2226
|
}), h.clearSelectedObjects());
|
|
2211
2227
|
}
|
|
2212
|
-
}), (c = this._permissionService.getPermissionPoint$(new
|
|
2213
|
-
Me((
|
|
2228
|
+
}), (c = this._permissionService.getPermissionPoint$(new He(r, s).id)) == null || c.pipe(
|
|
2229
|
+
Me((u) => u.value !== o),
|
|
2214
2230
|
De()
|
|
2215
2231
|
).subscribe({
|
|
2216
2232
|
complete: () => {
|
|
2217
2233
|
o = !0, this._drawingManagerService.setDrawingVisible(!0);
|
|
2218
|
-
const
|
|
2219
|
-
this._drawingManagerService.addNotification(
|
|
2234
|
+
const u = this._drawingManagerService.getDrawingData(r, s), g = Object.values(u);
|
|
2235
|
+
this._drawingManagerService.addNotification(g);
|
|
2220
2236
|
}
|
|
2221
2237
|
});
|
|
2222
2238
|
});
|
|
@@ -2236,31 +2252,31 @@ let je = class extends ae {
|
|
|
2236
2252
|
const a = this._renderManagerService.getRenderById(r), d = a == null ? void 0 : a.scene;
|
|
2237
2253
|
if (d == null)
|
|
2238
2254
|
return;
|
|
2239
|
-
const h = d.getTransformerByCreate(), l = this._permissionService.composePermission$([new Ze(r).id, new
|
|
2255
|
+
const h = d.getTransformerByCreate(), l = this._permissionService.composePermission$([new Ze(r).id, new Pe(r, s).id]).pipe(ft((u) => u.every((g) => g.value)));
|
|
2240
2256
|
l == null || l.pipe(
|
|
2241
|
-
Me((
|
|
2257
|
+
Me((u) => u !== o),
|
|
2242
2258
|
De()
|
|
2243
2259
|
).subscribe({
|
|
2244
|
-
next: (
|
|
2245
|
-
o =
|
|
2246
|
-
const
|
|
2247
|
-
|
|
2248
|
-
p.classType ===
|
|
2249
|
-
}), this._drawingManagerService.addNotification(m)) : (
|
|
2250
|
-
p.classType ===
|
|
2260
|
+
next: (u) => {
|
|
2261
|
+
o = u, this._drawingManagerService.setDrawingEditable(u);
|
|
2262
|
+
const g = d.getAllObjects(), f = this._drawingManagerService.getDrawingData(r, s), m = Object.values(f);
|
|
2263
|
+
u ? (g.forEach((p) => {
|
|
2264
|
+
p.classType === ae.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.attachTransformerTo(p);
|
|
2265
|
+
}), this._drawingManagerService.addNotification(m)) : (g.forEach((p) => {
|
|
2266
|
+
p.classType === ae.IMAGE && m.some((S) => p.oKey.includes(S.drawingId)) && d.detachTransformerFrom(p);
|
|
2251
2267
|
}), h.clearSelectedObjects());
|
|
2252
2268
|
}
|
|
2253
|
-
}), (c = this._permissionService.getPermissionPoint$(new
|
|
2254
|
-
Me((
|
|
2269
|
+
}), (c = this._permissionService.getPermissionPoint$(new Pe(r, s).id)) == null || c.pipe(
|
|
2270
|
+
Me((u) => u.value !== o),
|
|
2255
2271
|
De()
|
|
2256
2272
|
).subscribe({
|
|
2257
2273
|
complete: () => {
|
|
2258
2274
|
o = !0;
|
|
2259
|
-
const
|
|
2275
|
+
const u = e.getUnitId(), g = t.getSheetId(), f = this._drawingManagerService.getDrawingData(u, g), m = Object.values(f), p = this._renderManagerService.getRenderById(u), S = p == null ? void 0 : p.scene;
|
|
2260
2276
|
if (S == null)
|
|
2261
2277
|
return;
|
|
2262
2278
|
this._drawingManagerService.setDrawingEditable(!0), S.getAllObjects().forEach((v) => {
|
|
2263
|
-
v.classType ===
|
|
2279
|
+
v.classType === ae.IMAGE && m.some((R) => v.oKey.includes(R.drawingId)) && S.detachTransformerFrom(v);
|
|
2264
2280
|
});
|
|
2265
2281
|
}
|
|
2266
2282
|
});
|
|
@@ -2269,23 +2285,23 @@ let je = class extends ae {
|
|
|
2269
2285
|
);
|
|
2270
2286
|
}
|
|
2271
2287
|
};
|
|
2272
|
-
je =
|
|
2273
|
-
se
|
|
2288
|
+
je = vi([
|
|
2289
|
+
ie(se.Rendered, je),
|
|
2274
2290
|
fe(0, z),
|
|
2275
2291
|
fe(1, K),
|
|
2276
|
-
fe(2,
|
|
2292
|
+
fe(2, un),
|
|
2277
2293
|
fe(3, he),
|
|
2278
|
-
fe(4, W(
|
|
2294
|
+
fe(4, W(ln))
|
|
2279
2295
|
], je);
|
|
2280
|
-
var
|
|
2281
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2296
|
+
var Si = Object.defineProperty, Ci = Object.getOwnPropertyDescriptor, Ii = (i, e, n, t) => {
|
|
2297
|
+
for (var r = t > 1 ? void 0 : t ? Ci(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2282
2298
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2283
|
-
return t && r &&
|
|
2299
|
+
return t && r && Si(e, n, r), r;
|
|
2284
2300
|
}, Ke = (i, e) => (n, t) => e(n, t, i);
|
|
2285
|
-
let Le = class extends
|
|
2301
|
+
let Le = class extends oe {
|
|
2286
2302
|
constructor(e, n, t) {
|
|
2287
2303
|
super();
|
|
2288
|
-
|
|
2304
|
+
H(this, "_copyInfo");
|
|
2289
2305
|
this._sheetClipboardService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._initCopyPaste();
|
|
2290
2306
|
}
|
|
2291
2307
|
_initCopyPaste() {
|
|
@@ -2293,22 +2309,22 @@ let Le = class extends ae {
|
|
|
2293
2309
|
id: "SHEET_IMAGE_UI_PLUGIN",
|
|
2294
2310
|
onBeforeCopy: (e, n, t) => this._collect(e, n, t),
|
|
2295
2311
|
onPasteCells: (e, n, t, r) => {
|
|
2296
|
-
const { copyType: s =
|
|
2312
|
+
const { copyType: s = gt.COPY, pasteType: o } = r, { range: a } = e || {}, { range: d, unitId: h, subUnitId: l } = n;
|
|
2297
2313
|
return this._generateMutations(d, { copyType: s, pasteType: o, copyRange: a, unitId: h, subUnitId: l });
|
|
2298
2314
|
},
|
|
2299
2315
|
onPastePlainText: (e, n) => ({ undos: [], redos: [] })
|
|
2300
2316
|
});
|
|
2301
2317
|
}
|
|
2302
2318
|
_collect(e, n, t) {
|
|
2303
|
-
var
|
|
2304
|
-
const r = (
|
|
2319
|
+
var u;
|
|
2320
|
+
const r = (u = this._renderManagerService.getRenderById(e)) == null ? void 0 : u.with(re);
|
|
2305
2321
|
if (!r) return;
|
|
2306
2322
|
const s = r.attachRangeWithCoord(t);
|
|
2307
2323
|
if (!s)
|
|
2308
2324
|
return;
|
|
2309
2325
|
const { startX: o, endX: a, startY: d, endY: h } = s, l = this._sheetDrawingService.getDrawingData(e, n), c = [];
|
|
2310
|
-
Object.keys(l).forEach((
|
|
2311
|
-
const f = l[
|
|
2326
|
+
Object.keys(l).forEach((g) => {
|
|
2327
|
+
const f = l[g], { transform: m } = f;
|
|
2312
2328
|
if (f.anchorType !== O.Both || !m)
|
|
2313
2329
|
return;
|
|
2314
2330
|
const { left: p = 0, top: S = 0, width: C = 0, height: v = 0 } = m, { drawingStartX: R, drawingEndX: _, drawingStartY: b, drawingEndY: w } = {
|
|
@@ -2341,7 +2357,7 @@ let Le = class extends ae {
|
|
|
2341
2357
|
const { copyRange: t } = n;
|
|
2342
2358
|
if (!t)
|
|
2343
2359
|
return { redos: [], undos: [] };
|
|
2344
|
-
const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [a, d], mapFunc: h } =
|
|
2360
|
+
const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [a, d], mapFunc: h } = Wn([t, e]), { row: l, col: c } = h(a.startRow, a.startColumn), { row: u, col: g } = h(d.startRow, d.startColumn), f = (D = this._renderManagerService.getRenderById(s)) == null ? void 0 : D.with(re);
|
|
2345
2361
|
if (!f)
|
|
2346
2362
|
return { redos: [], undos: [] };
|
|
2347
2363
|
const m = f.attachRangeWithCoord({
|
|
@@ -2350,23 +2366,23 @@ let Le = class extends ae {
|
|
|
2350
2366
|
startColumn: c,
|
|
2351
2367
|
endColumn: c
|
|
2352
2368
|
}), p = f.attachRangeWithCoord({
|
|
2353
|
-
startRow:
|
|
2354
|
-
endRow:
|
|
2355
|
-
startColumn:
|
|
2356
|
-
endColumn:
|
|
2369
|
+
startRow: u,
|
|
2370
|
+
endRow: u,
|
|
2371
|
+
startColumn: g,
|
|
2372
|
+
endColumn: g
|
|
2357
2373
|
});
|
|
2358
2374
|
if (!m || !p)
|
|
2359
2375
|
return { redos: [], undos: [] };
|
|
2360
|
-
const S = [], C = [], v = p.startX - m.startX, R = p.startY - m.startY, _ =
|
|
2361
|
-
return r.forEach((
|
|
2362
|
-
const { transform: U, sheetTransform: M } =
|
|
2376
|
+
const S = [], C = [], v = p.startX - m.startX, R = p.startY - m.startY, _ = u - l, b = g - c, w = n.copyType === gt.CUT, { _sheetDrawingService: P } = this;
|
|
2377
|
+
return r.forEach((T) => {
|
|
2378
|
+
const { transform: U, sheetTransform: M } = T;
|
|
2363
2379
|
if (!U)
|
|
2364
2380
|
return;
|
|
2365
2381
|
const I = {
|
|
2366
|
-
...
|
|
2382
|
+
...T,
|
|
2367
2383
|
unitId: s,
|
|
2368
2384
|
subUnitId: o,
|
|
2369
|
-
drawingId: w ?
|
|
2385
|
+
drawingId: w ? T.drawingId : ne.generateRandomId(),
|
|
2370
2386
|
transform: {
|
|
2371
2387
|
...U,
|
|
2372
2388
|
left: U.left + v,
|
|
@@ -2378,7 +2394,7 @@ let Le = class extends ae {
|
|
|
2378
2394
|
}
|
|
2379
2395
|
};
|
|
2380
2396
|
if (w) {
|
|
2381
|
-
const { undo: A, redo: G, objects: J } =
|
|
2397
|
+
const { undo: A, redo: G, objects: J } = P.getBatchUpdateOp([I]);
|
|
2382
2398
|
S.push({
|
|
2383
2399
|
id: E.id,
|
|
2384
2400
|
params: {
|
|
@@ -2399,7 +2415,7 @@ let Le = class extends ae {
|
|
|
2399
2415
|
}
|
|
2400
2416
|
});
|
|
2401
2417
|
} else {
|
|
2402
|
-
const { undo: A, redo: G, objects: J } =
|
|
2418
|
+
const { undo: A, redo: G, objects: J } = P.getBatchAddOp([I]);
|
|
2403
2419
|
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 } });
|
|
2404
2420
|
}
|
|
2405
2421
|
}), {
|
|
@@ -2408,23 +2424,23 @@ let Le = class extends ae {
|
|
|
2408
2424
|
};
|
|
2409
2425
|
}
|
|
2410
2426
|
};
|
|
2411
|
-
Le =
|
|
2412
|
-
se
|
|
2413
|
-
Ke(0,
|
|
2427
|
+
Le = Ii([
|
|
2428
|
+
ie(se.Ready, Le),
|
|
2429
|
+
Ke(0, $n),
|
|
2414
2430
|
Ke(1, K),
|
|
2415
|
-
Ke(2,
|
|
2431
|
+
Ke(2, k)
|
|
2416
2432
|
], Le);
|
|
2417
|
-
var
|
|
2418
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2433
|
+
var qt = Object.defineProperty, Ri = Object.getOwnPropertyDescriptor, Mi = (i, e, n) => e in i ? qt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Di = (i, e, n, t) => {
|
|
2434
|
+
for (var r = t > 1 ? void 0 : t ? Ri(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2419
2435
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2420
|
-
return t && r &&
|
|
2421
|
-
}, Je = (i, e) => (n, t) => e(n, t, i),
|
|
2422
|
-
const
|
|
2423
|
-
let $e = class extends
|
|
2436
|
+
return t && r && qt(e, n, r), r;
|
|
2437
|
+
}, Je = (i, e) => (n, t) => e(n, t, i), Qt = (i, e, n) => Mi(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2438
|
+
const bi = "SHEET_IMAGE_UI_PLUGIN";
|
|
2439
|
+
let $e = class extends gn {
|
|
2424
2440
|
constructor(e = {}, n, t, r) {
|
|
2425
2441
|
super();
|
|
2426
|
-
|
|
2427
|
-
this._injector = n, this._localeService = t, this._renderManagerService = r, this._pluginConfig =
|
|
2442
|
+
H(this, "_pluginConfig");
|
|
2443
|
+
this._injector = n, this._localeService = t, this._renderManagerService = r, this._pluginConfig = ne.deepMerge({}, ii, e);
|
|
2428
2444
|
}
|
|
2429
2445
|
onStarting(e) {
|
|
2430
2446
|
super.onStarting(e), this._initDependencies(e);
|
|
@@ -2443,7 +2459,7 @@ let $e = class extends ln {
|
|
|
2443
2459
|
useFactory: () => this._injector.createInstance(pe, this._pluginConfig)
|
|
2444
2460
|
}
|
|
2445
2461
|
],
|
|
2446
|
-
[
|
|
2462
|
+
[Te],
|
|
2447
2463
|
[Ne],
|
|
2448
2464
|
[je]
|
|
2449
2465
|
], t = [
|
|
@@ -2460,28 +2476,28 @@ let $e = class extends ln {
|
|
|
2460
2476
|
});
|
|
2461
2477
|
}
|
|
2462
2478
|
};
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
$e =
|
|
2466
|
-
|
|
2479
|
+
Qt($e, "type", B.UNIVER_SHEET);
|
|
2480
|
+
Qt($e, "pluginName", bi);
|
|
2481
|
+
$e = Di([
|
|
2482
|
+
hn(bn, Sn, Cn),
|
|
2467
2483
|
Je(1, W(nt)),
|
|
2468
2484
|
Je(2, W(_e)),
|
|
2469
2485
|
Je(3, K)
|
|
2470
2486
|
], $e);
|
|
2471
2487
|
export {
|
|
2472
2488
|
j as ClearSheetDrawingTransformerOperation,
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2489
|
+
Zt as DeleteDrawingsCommand,
|
|
2490
|
+
Gt as EditSheetDrawingOperation,
|
|
2491
|
+
Ft as GroupSheetDrawingCommand,
|
|
2476
2492
|
Be as InsertCellImageOperation,
|
|
2477
2493
|
xe as InsertFloatImageOperation,
|
|
2478
2494
|
st as InsertSheetDrawingCommand,
|
|
2479
2495
|
ve as MoveDrawingsCommand,
|
|
2480
2496
|
it as RemoveSheetDrawingCommand,
|
|
2481
|
-
|
|
2497
|
+
xt as SetDrawingArrangeCommand,
|
|
2482
2498
|
Fe as SetSheetDrawingCommand,
|
|
2483
2499
|
tt as SheetCanvasFloatDomManagerService,
|
|
2484
|
-
|
|
2485
|
-
|
|
2500
|
+
Vt as SidebarSheetDrawingOperation,
|
|
2501
|
+
Yt as UngroupSheetDrawingCommand,
|
|
2486
2502
|
$e as UniverSheetsDrawingUIPlugin
|
|
2487
2503
|
};
|