@univerjs/sheets-drawing-ui 0.1.14 → 0.1.15
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 +288 -286
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +4 -3
- package/lib/umd/index.js +1 -1
- package/package.json +25 -24
package/lib/es/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var H = (r, e, n) => (
|
|
4
|
-
import { CommandType as $, ICommandService as B, IUndoRedoService as ie, LocaleService as de, IUniverInstanceService as ue, RxDisposable as
|
|
1
|
+
var Gt = Object.defineProperty;
|
|
2
|
+
var xt = (r, e, n) => e in r ? Gt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
|
|
3
|
+
var H = (r, e, n) => (xt(r, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { CommandType as $, ICommandService as B, IUndoRedoService as ie, LocaleService as de, IUniverInstanceService as ue, RxDisposable as $t, UniverInstanceType as ee, toDisposable as Ae, FOCUSING_COMMON_DRAWINGS as le, OnLifecycle as me, LifecycleStages as he, IContextService as rt, Disposable as ge, Direction as K, FOCUSING_FORMULA_EDITOR as Ft, EDITOR_ACTIVATED as Vt, Rectangle as Yt, DrawingTypeEnum as Ne, DisposableCollection as Xt, Tools as ne, Plugin as Ht, DependentOn as kt } from "@univerjs/core";
|
|
5
5
|
import { Inject as W, Injector as Ve } from "@wendellhu/redi";
|
|
6
|
-
import { ImageCropperObject as
|
|
7
|
-
import { ISheetDrawingService as Y, SetDrawingApplyMutation as b, DrawingApplyType as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as
|
|
8
|
-
import { IDrawingManagerService as k, IImageIoService as
|
|
9
|
-
import { IRenderManagerService as se, getGroupState as
|
|
10
|
-
import { SheetCanvasPopManagerService as
|
|
11
|
-
import { takeUntil as
|
|
12
|
-
import { ISidebarService as
|
|
13
|
-
import { useDependency as Z, connectInjector as
|
|
14
|
-
import { getSheetCommandTarget as re, SelectionManagerService as
|
|
15
|
-
import
|
|
16
|
-
import { MessageType as _e, RadioGroup as
|
|
6
|
+
import { ImageCropperObject as zt, COMPONENT_IMAGE_POPUP_MENU as Kt, OpenImageCropOperation as Jt, ImageResetSizeOperation as Zt, DrawingCommonPanel as qt, DrawingRenderService as Qt, UniverDrawingUIPlugin as en } from "@univerjs/drawing-ui";
|
|
7
|
+
import { ISheetDrawingService as Y, SetDrawingApplyMutation as b, DrawingApplyType as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as tn } from "@univerjs/sheets-drawing";
|
|
8
|
+
import { IDrawingManagerService as k, IImageIoService as ot, ArrangeTypeEnum as we, DrawingTypeEnum as ye, DRAWING_IMAGE_COUNT_LIMIT as Je, ImageUploadStatusType as Le, DRAWING_IMAGE_ALLOW_SIZE as nn, getImageSize as rn, DRAWING_IMAGE_WIDTH_LIMIT as Ze, DRAWING_IMAGE_HEIGHT_LIMIT as qe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as on, getDrawingShapeKeyByDrawingSearch as sn, UniverDrawingPlugin as an } from "@univerjs/drawing";
|
|
9
|
+
import { IRenderManagerService as se, getGroupState as cn, transformObjectOutOfGroup as ln, precisionTo as J, Rect as dn, DRAWING_OBJECT_LAYER_INDEX as un, SHEET_VIEWPORT_KEY as mn } from "@univerjs/engine-render";
|
|
10
|
+
import { SheetCanvasPopManagerService as hn, ISelectionRenderService as Te, getCurrentRangeDisable$ as gn, SheetSkeletonManagerService as Be, SetScrollOperation as fn, SetZoomRatioOperation as pn, SheetPrintInterceptorService as wn } from "@univerjs/sheets-ui";
|
|
11
|
+
import { takeUntil as Qe, Subject as et, BehaviorSubject as _n } from "rxjs";
|
|
12
|
+
import { ISidebarService as vn, BuiltInUIPart as Sn, IUIPartsService as Cn, IMessageService as Rn, MenuItemType as it, MenuPosition as In, MenuGroup as Dn, getMenuHiddenObservable as st, KeyCode as oe, ComponentManager as Mn, IMenuService as On, IShortcutService as bn, CanvasFloatDomService as Pn } from "@univerjs/ui";
|
|
13
|
+
import { useDependency as Z, connectInjector as yn } from "@wendellhu/redi/react-bindings";
|
|
14
|
+
import { getSheetCommandTarget as re, SelectionManagerService as Tn, WorkbookEditablePermission as En, WorksheetEditPermission as Un, RangeProtectionPermissionEditPoint as An, InsertRowCommand as at, InsertColCommand as ct, RemoveRowCommand as lt, RemoveColCommand as dt, DeleteRangeMoveLeftCommand as ut, DeleteRangeMoveUpCommand as mt, InsertRangeMoveDownCommand as ht, InsertRangeMoveRightCommand as gt, DeltaRowHeightCommand as Ge, SetRowHeightCommand as xe, DeltaColumnWidthCommand as ft, SetColWidthCommand as pt, SetRowHiddenCommand as wt, SetSpecificRowsVisibleCommand as _t, SetSpecificColsVisibleCommand as vt, SetColHiddenCommand as St, SetRowVisibleMutation as Nn, SetRowHiddenMutation as Ln, SetColVisibleMutation as jn, SetColHiddenMutation as Wn, SetWorksheetRowHeightMutation as Bn, SetWorksheetColWidthMutation as Gn, SetWorksheetActiveOperation as xn, SheetInterceptorService as $n, SetFrozenMutation as Fn } from "@univerjs/sheets";
|
|
15
|
+
import j, { useEffect as Ye, forwardRef as Ct, useRef as Rt, createElement as It, useState as $e } from "react";
|
|
16
|
+
import { MessageType as _e, RadioGroup as Vn, Radio as je } from "@univerjs/design";
|
|
17
17
|
import ve from "clsx";
|
|
18
|
-
const
|
|
18
|
+
const L = {
|
|
19
19
|
id: "sheet.operation.clear-drawing-transformer",
|
|
20
20
|
type: $.MUTATION,
|
|
21
21
|
handler: (r, e) => {
|
|
@@ -42,26 +42,26 @@ const N = {
|
|
|
42
42
|
unitID: c,
|
|
43
43
|
undoMutations: [
|
|
44
44
|
{ id: b.id, params: { unitId: c, subUnitId: u, op: d, objects: h, type: P.INSERT } },
|
|
45
|
-
{ id:
|
|
45
|
+
{ id: L.id, params: s }
|
|
46
46
|
],
|
|
47
47
|
redoMutations: [
|
|
48
48
|
{ id: b.id, params: { unitId: c, subUnitId: u, op: l, objects: h, type: P.REMOVE } },
|
|
49
|
-
{ id:
|
|
49
|
+
{ id: L.id, params: s }
|
|
50
50
|
]
|
|
51
51
|
}), !0) : !1;
|
|
52
52
|
}
|
|
53
|
-
},
|
|
53
|
+
}, Dt = "COMPONENT_SHEET_DRAWING_PANEL", Mt = {
|
|
54
54
|
id: "sidebar.operation.sheet-image",
|
|
55
55
|
type: $.COMMAND,
|
|
56
56
|
handler: async (r, e) => {
|
|
57
|
-
const n = r.get(
|
|
57
|
+
const n = r.get(vn), t = r.get(de), o = r.get(ue), i = r.get(k);
|
|
58
58
|
if (!re(o))
|
|
59
59
|
return !1;
|
|
60
60
|
switch (e.value) {
|
|
61
61
|
case "open":
|
|
62
62
|
n.open({
|
|
63
63
|
header: { title: t.t("sheetImage.panel.title") },
|
|
64
|
-
children: { label:
|
|
64
|
+
children: { label: Dt },
|
|
65
65
|
onClose: () => {
|
|
66
66
|
i.focusDrawing(null);
|
|
67
67
|
},
|
|
@@ -75,21 +75,21 @@ const N = {
|
|
|
75
75
|
}
|
|
76
76
|
return !0;
|
|
77
77
|
}
|
|
78
|
-
},
|
|
78
|
+
}, Ot = {
|
|
79
79
|
id: "sheet.operation.edit-sheet-image",
|
|
80
80
|
type: $.OPERATION,
|
|
81
81
|
handler: (r, e) => {
|
|
82
82
|
const n = r.get(k), t = r.get(B);
|
|
83
|
-
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
uploadLoading:
|
|
87
|
-
uploadLoadingBody:
|
|
88
|
-
uploadLoadingBodyAnimation:
|
|
89
|
-
univerCircleAnimation:
|
|
90
|
-
uploadLoadingBodyText:
|
|
91
|
-
},
|
|
92
|
-
const r = Z(
|
|
83
|
+
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(Mt.id, { value: "open" }), !0);
|
|
84
|
+
}
|
|
85
|
+
}, Yn = "univer-upload-loading", Xn = "univer-upload-loading-body", Hn = "univer-upload-loading-body-animation", kn = "univer-UniverCircleAnimation", zn = "univer-upload-loading-body-text", Se = {
|
|
86
|
+
uploadLoading: Yn,
|
|
87
|
+
uploadLoadingBody: Xn,
|
|
88
|
+
uploadLoadingBodyAnimation: Hn,
|
|
89
|
+
univerCircleAnimation: kn,
|
|
90
|
+
uploadLoadingBodyText: zn
|
|
91
|
+
}, Kn = () => {
|
|
92
|
+
const r = Z(ot), e = Z(de), [n, t] = j.useState(0);
|
|
93
93
|
return Ye(() => {
|
|
94
94
|
const o = r.change$.subscribe((i) => {
|
|
95
95
|
t(i);
|
|
@@ -97,21 +97,21 @@ const N = {
|
|
|
97
97
|
return () => {
|
|
98
98
|
o.unsubscribe();
|
|
99
99
|
};
|
|
100
|
-
}, [r]), /* @__PURE__ */
|
|
100
|
+
}, [r]), /* @__PURE__ */ j.createElement("div", { style: { display: n > 0 ? "block" : "none" }, className: Se.uploadLoading }, /* @__PURE__ */ j.createElement("div", { className: Se.uploadLoadingBody }, /* @__PURE__ */ j.createElement("div", { className: Se.uploadLoadingBodyAnimation }), /* @__PURE__ */ j.createElement("div", { className: Se.uploadLoadingBodyText }, `${e.t("uploadLoading.loading")}: ${n}`)));
|
|
101
101
|
};
|
|
102
|
-
var
|
|
103
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
102
|
+
var Jn = Object.defineProperty, Zn = Object.getOwnPropertyDescriptor, qn = (r, e, n, t) => {
|
|
103
|
+
for (var o = t > 1 ? void 0 : t ? Zn(e, n) : e, i = r.length - 1, s; i >= 0; i--)
|
|
104
104
|
(s = r[i]) && (o = (t ? s(e, n, o) : s(o)) || o);
|
|
105
|
-
return t && o &&
|
|
105
|
+
return t && o && Jn(e, n, o), o;
|
|
106
106
|
}, q = (r, e) => (n, t) => e(n, t, r);
|
|
107
|
-
let Re = class extends
|
|
107
|
+
let Re = class extends $t {
|
|
108
108
|
constructor(e, n, t, o, i, s, a) {
|
|
109
109
|
super();
|
|
110
110
|
H(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
111
111
|
this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = o, this._univerInstanceService = i, this._contextService = s, this._uiPartsService = a, this._init();
|
|
112
112
|
}
|
|
113
113
|
_init() {
|
|
114
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(ee.UNIVER_SHEET).pipe(
|
|
114
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(ee.UNIVER_SHEET).pipe(Qe(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(ee.UNIVER_SHEET).pipe(Qe(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(ee.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(Sn.CONTENT, () => yn(Kn, this._injector));
|
|
115
115
|
}
|
|
116
116
|
_dispose(e) {
|
|
117
117
|
const n = e.getUnitId();
|
|
@@ -126,7 +126,7 @@ let Re = class extends Gt {
|
|
|
126
126
|
_hasCropObject(e) {
|
|
127
127
|
const n = e.getAllObjects();
|
|
128
128
|
for (const t of n)
|
|
129
|
-
if (t instanceof
|
|
129
|
+
if (t instanceof zt)
|
|
130
130
|
return !0;
|
|
131
131
|
return !1;
|
|
132
132
|
}
|
|
@@ -157,7 +157,7 @@ let Re = class extends Gt {
|
|
|
157
157
|
return;
|
|
158
158
|
const { unitId: d, subUnitId: l, drawingId: h } = u;
|
|
159
159
|
o.push(this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
160
|
-
componentKey:
|
|
160
|
+
componentKey: Kt,
|
|
161
161
|
direction: "horizontal",
|
|
162
162
|
offset: [2, 0],
|
|
163
163
|
extraProps: {
|
|
@@ -189,7 +189,7 @@ let Re = class extends Gt {
|
|
|
189
189
|
{
|
|
190
190
|
label: "image-popup.edit",
|
|
191
191
|
index: 0,
|
|
192
|
-
commandId:
|
|
192
|
+
commandId: Ot.id,
|
|
193
193
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
194
194
|
disable: !1
|
|
195
195
|
},
|
|
@@ -203,29 +203,29 @@ let Re = class extends Gt {
|
|
|
203
203
|
{
|
|
204
204
|
label: "image-popup.crop",
|
|
205
205
|
index: 2,
|
|
206
|
-
commandId:
|
|
206
|
+
commandId: Jt.id,
|
|
207
207
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
208
208
|
disable: !1
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
label: "image-popup.reset",
|
|
212
212
|
index: 3,
|
|
213
|
-
commandId:
|
|
213
|
+
commandId: Zt.id,
|
|
214
214
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
215
215
|
disable: !1
|
|
216
216
|
}
|
|
217
217
|
];
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
|
-
Re =
|
|
220
|
+
Re = qn([
|
|
221
221
|
me(he.Steady, Re),
|
|
222
222
|
q(0, W(Ve)),
|
|
223
223
|
q(1, k),
|
|
224
|
-
q(2, W(
|
|
224
|
+
q(2, W(hn)),
|
|
225
225
|
q(3, se),
|
|
226
226
|
q(4, ue),
|
|
227
|
-
q(5,
|
|
228
|
-
q(6, W(
|
|
227
|
+
q(5, rt),
|
|
228
|
+
q(6, W(Cn))
|
|
229
229
|
], Re);
|
|
230
230
|
const Ee = {
|
|
231
231
|
id: "sheet.operation.insert-float-image",
|
|
@@ -247,11 +247,11 @@ const Ee = {
|
|
|
247
247
|
unitID: c,
|
|
248
248
|
undoMutations: [
|
|
249
249
|
{ id: b.id, params: { op: d, unitId: c, subUnitId: u, objects: h, type: P.REMOVE } },
|
|
250
|
-
{ id:
|
|
250
|
+
{ id: L.id, params: s }
|
|
251
251
|
],
|
|
252
252
|
redoMutations: [
|
|
253
253
|
{ id: b.id, params: { op: l, unitId: c, subUnitId: u, objects: h, type: P.INSERT } },
|
|
254
|
-
{ id:
|
|
254
|
+
{ id: L.id, params: s }
|
|
255
255
|
]
|
|
256
256
|
}), !0) : !1;
|
|
257
257
|
}
|
|
@@ -267,15 +267,15 @@ const Ee = {
|
|
|
267
267
|
unitID: a,
|
|
268
268
|
undoMutations: [
|
|
269
269
|
{ id: b.id, params: { unitId: a, subUnitId: c, op: u, objects: l, type: P.UPDATE } },
|
|
270
|
-
{ id:
|
|
270
|
+
{ id: L.id, params: [a] }
|
|
271
271
|
],
|
|
272
272
|
redoMutations: [
|
|
273
273
|
{ id: b.id, params: { unitId: a, subUnitId: c, op: d, objects: l, type: P.UPDATE } },
|
|
274
|
-
{ id:
|
|
274
|
+
{ id: L.id, params: [a] }
|
|
275
275
|
]
|
|
276
276
|
}), !0) : !1;
|
|
277
277
|
}
|
|
278
|
-
},
|
|
278
|
+
}, bt = {
|
|
279
279
|
id: "sheet.command.set-drawing-arrange",
|
|
280
280
|
type: $.COMMAND,
|
|
281
281
|
handler: (r, e) => {
|
|
@@ -298,10 +298,10 @@ const Ee = {
|
|
|
298
298
|
}), !0) : !1;
|
|
299
299
|
}
|
|
300
300
|
};
|
|
301
|
-
function
|
|
301
|
+
function Qn(r) {
|
|
302
302
|
const e = [];
|
|
303
303
|
return r.forEach((n) => {
|
|
304
|
-
const { parent: t, children: o } = n, { unitId: i, subUnitId: s, drawingId: a } = t, c =
|
|
304
|
+
const { parent: t, children: o } = n, { unitId: i, subUnitId: s, drawingId: a } = t, c = cn(0, 0, o.map((l) => l.transform || {})), u = o.map((l) => {
|
|
305
305
|
const h = l.transform || { left: 0, top: 0 }, { unitId: m, subUnitId: f, drawingId: g } = l;
|
|
306
306
|
return {
|
|
307
307
|
unitId: m,
|
|
@@ -327,14 +327,14 @@ function Zn(r) {
|
|
|
327
327
|
});
|
|
328
328
|
}), e;
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function er(r) {
|
|
331
331
|
const e = [];
|
|
332
332
|
return r.forEach((n) => {
|
|
333
333
|
const { parent: t, children: o } = n, { unitId: i, subUnitId: s, drawingId: a, transform: c = { width: 0, height: 0 } } = t;
|
|
334
334
|
if (c == null)
|
|
335
335
|
return;
|
|
336
336
|
const u = o.map((l) => {
|
|
337
|
-
const { transform: h } = l, { unitId: m, subUnitId: f, drawingId: g } = l, _ =
|
|
337
|
+
const { transform: h } = l, { unitId: m, subUnitId: f, drawingId: g } = l, _ = ln(h || {}, c, c.width || 0, c.height || 0);
|
|
338
338
|
return {
|
|
339
339
|
unitId: m,
|
|
340
340
|
subUnitId: f,
|
|
@@ -358,7 +358,7 @@ function qn(r) {
|
|
|
358
358
|
});
|
|
359
359
|
}), e;
|
|
360
360
|
}
|
|
361
|
-
const
|
|
361
|
+
const Pt = {
|
|
362
362
|
id: "sheet.command.group-sheet-image",
|
|
363
363
|
type: $.COMMAND,
|
|
364
364
|
handler: (r, e) => {
|
|
@@ -375,16 +375,16 @@ const Ot = {
|
|
|
375
375
|
return n.syncExecuteCommand(b.id, { op: d, unitId: a, subUnitId: c, objects: l, type: P.GROUP }) ? (t.pushUndoRedo({
|
|
376
376
|
unitID: a,
|
|
377
377
|
undoMutations: [
|
|
378
|
-
{ id: b.id, params: { op: u, unitId: a, subUnitId: c, objects:
|
|
379
|
-
{ id:
|
|
378
|
+
{ id: b.id, params: { op: u, unitId: a, subUnitId: c, objects: er(l), type: P.UNGROUP } },
|
|
379
|
+
{ id: L.id, params: i }
|
|
380
380
|
],
|
|
381
381
|
redoMutations: [
|
|
382
382
|
{ id: b.id, params: { op: d, unitId: a, subUnitId: c, objects: l, type: P.GROUP } },
|
|
383
|
-
{ id:
|
|
383
|
+
{ id: L.id, params: i }
|
|
384
384
|
]
|
|
385
385
|
}), !0) : !1;
|
|
386
386
|
}
|
|
387
|
-
},
|
|
387
|
+
}, yt = {
|
|
388
388
|
id: "sheet.command.ungroup-sheet-image",
|
|
389
389
|
type: $.COMMAND,
|
|
390
390
|
handler: (r, e) => {
|
|
@@ -401,12 +401,12 @@ const Ot = {
|
|
|
401
401
|
return n.syncExecuteCommand(b.id, { op: d, unitId: a, subUnitId: c, objects: l, type: P.UNGROUP }) ? (t.pushUndoRedo({
|
|
402
402
|
unitID: a,
|
|
403
403
|
undoMutations: [
|
|
404
|
-
{ id: b.id, params: { op: u, unitId: a, subUnitId: c, objects:
|
|
405
|
-
{ id:
|
|
404
|
+
{ id: b.id, params: { op: u, unitId: a, subUnitId: c, objects: Qn(l), type: P.GROUP } },
|
|
405
|
+
{ id: L.id, params: i }
|
|
406
406
|
],
|
|
407
407
|
redoMutations: [
|
|
408
408
|
{ id: b.id, params: { op: d, unitId: a, subUnitId: c, objects: l, type: P.UNGROUP } },
|
|
409
|
-
{ id:
|
|
409
|
+
{ id: L.id, params: i }
|
|
410
410
|
]
|
|
411
411
|
}), !0) : !1;
|
|
412
412
|
}
|
|
@@ -437,7 +437,7 @@ function x(r, e) {
|
|
|
437
437
|
height: w
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function N(r, e) {
|
|
441
441
|
const { left: n = 0, top: t = 0, width: o = 0, height: i = 0 } = r, s = e.getSelectionCellByPosition(n, t);
|
|
442
442
|
if (s == null)
|
|
443
443
|
return;
|
|
@@ -460,10 +460,10 @@ function A(r, e) {
|
|
|
460
460
|
to: u
|
|
461
461
|
};
|
|
462
462
|
}
|
|
463
|
-
var
|
|
464
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
463
|
+
var tr = Object.defineProperty, nr = Object.getOwnPropertyDescriptor, rr = (r, e, n, t) => {
|
|
464
|
+
for (var o = t > 1 ? void 0 : t ? nr(e, n) : e, i = r.length - 1, s; i >= 0; i--)
|
|
465
465
|
(s = r[i]) && (o = (t ? s(e, n, o) : s(o)) || o);
|
|
466
|
-
return t && o &&
|
|
466
|
+
return t && o && tr(e, n, o), o;
|
|
467
467
|
}, V = (r, e) => (n, t) => e(n, t, r);
|
|
468
468
|
let Ie = class extends ge {
|
|
469
469
|
constructor(r, e, n, t, o, i, s, a, c, u, d) {
|
|
@@ -483,10 +483,10 @@ let Ie = class extends ge {
|
|
|
483
483
|
if (e.files == null)
|
|
484
484
|
return;
|
|
485
485
|
const n = e.files.length;
|
|
486
|
-
if (n >
|
|
486
|
+
if (n > Je) {
|
|
487
487
|
this._messageService.show({
|
|
488
488
|
type: _e.Error,
|
|
489
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
489
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(Je))
|
|
490
490
|
});
|
|
491
491
|
return;
|
|
492
492
|
}
|
|
@@ -509,7 +509,7 @@ let Ie = class extends ge {
|
|
|
509
509
|
const v = C.message;
|
|
510
510
|
v === Le.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
511
511
|
type: _e.Error,
|
|
512
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
512
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(nn / (1024 * 1024)))
|
|
513
513
|
}) : v === Le.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
514
514
|
type: _e.Error,
|
|
515
515
|
content: this._localeService.t("update-status.invalidImageType")
|
|
@@ -523,14 +523,14 @@ let Ie = class extends ge {
|
|
|
523
523
|
const n = this._getUnitInfo();
|
|
524
524
|
if (n == null)
|
|
525
525
|
return;
|
|
526
|
-
const { unitId: t, subUnitId: o } = n, { imageId: i, imageSourceType: s, source: a, base64Cache: c } = e, { width: u, height: d, image: l } = await
|
|
526
|
+
const { unitId: t, subUnitId: o } = n, { imageId: i, imageSourceType: s, source: a, base64Cache: c } = e, { width: u, height: d, image: l } = await rn(c || ""), h = this._renderManagerService.getRenderById(t);
|
|
527
527
|
if (h == null)
|
|
528
528
|
return;
|
|
529
529
|
const { width: m, height: f } = h.scene;
|
|
530
530
|
this._imageIoService.addImageSourceCache(a, s, l);
|
|
531
531
|
let g = 1;
|
|
532
|
-
if (u >
|
|
533
|
-
const C =
|
|
532
|
+
if (u > Ze || d > qe) {
|
|
533
|
+
const C = Ze / u, v = qe / d;
|
|
534
534
|
g = Math.max(C, v);
|
|
535
535
|
}
|
|
536
536
|
const _ = this._getImagePosition(u * g, d * g, m, f);
|
|
@@ -605,7 +605,7 @@ let Ie = class extends ge {
|
|
|
605
605
|
_updateOrderListener() {
|
|
606
606
|
this._drawingManagerService.featurePluginOrderUpdate$.subscribe((r) => {
|
|
607
607
|
const { unitId: e, subUnitId: n, drawingIds: t, arrangeType: o } = r;
|
|
608
|
-
this._commandService.executeCommand(
|
|
608
|
+
this._commandService.executeCommand(bt.id, {
|
|
609
609
|
unitId: e,
|
|
610
610
|
subUnitId: n,
|
|
611
611
|
drawingIds: t,
|
|
@@ -623,7 +623,7 @@ let Ie = class extends ge {
|
|
|
623
623
|
const c = this._sheetDrawingService.getDrawingByParam({ unitId: t, subUnitId: o, drawingId: i });
|
|
624
624
|
if (c == null)
|
|
625
625
|
return;
|
|
626
|
-
const u =
|
|
626
|
+
const u = N({ ...c.transform, ...a }, this._selectionRenderService);
|
|
627
627
|
if (u == null)
|
|
628
628
|
return;
|
|
629
629
|
const d = {
|
|
@@ -640,11 +640,11 @@ let Ie = class extends ge {
|
|
|
640
640
|
}
|
|
641
641
|
_groupDrawingListener() {
|
|
642
642
|
this._drawingManagerService.featurePluginGroupUpdate$.subscribe((r) => {
|
|
643
|
-
this._commandService.executeCommand(
|
|
643
|
+
this._commandService.executeCommand(Pt.id, r);
|
|
644
644
|
const { unitId: e, subUnitId: n, drawingId: t } = r[0].parent;
|
|
645
645
|
this._drawingManagerService.focusDrawing([{ unitId: e, subUnitId: n, drawingId: t }]);
|
|
646
646
|
}), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((r) => {
|
|
647
|
-
this._commandService.executeCommand(
|
|
647
|
+
this._commandService.executeCommand(yt.id, r);
|
|
648
648
|
});
|
|
649
649
|
}
|
|
650
650
|
_focusDrawingListener() {
|
|
@@ -655,17 +655,17 @@ let Ie = class extends ge {
|
|
|
655
655
|
);
|
|
656
656
|
}
|
|
657
657
|
};
|
|
658
|
-
Ie =
|
|
658
|
+
Ie = rr([
|
|
659
659
|
me(he.Rendered, Ie),
|
|
660
660
|
V(0, B),
|
|
661
661
|
V(1, ue),
|
|
662
|
-
V(2, W(
|
|
662
|
+
V(2, W(Tn)),
|
|
663
663
|
V(3, Te),
|
|
664
|
-
V(4,
|
|
664
|
+
V(4, ot),
|
|
665
665
|
V(5, Y),
|
|
666
666
|
V(6, k),
|
|
667
|
-
V(7,
|
|
668
|
-
V(8,
|
|
667
|
+
V(7, rt),
|
|
668
|
+
V(8, Rn),
|
|
669
669
|
V(9, W(de)),
|
|
670
670
|
V(10, se)
|
|
671
671
|
], Ie);
|
|
@@ -678,7 +678,7 @@ var F = function() {
|
|
|
678
678
|
}
|
|
679
679
|
return r;
|
|
680
680
|
}, F.apply(this, arguments);
|
|
681
|
-
},
|
|
681
|
+
}, or = function(r, e) {
|
|
682
682
|
var n = {};
|
|
683
683
|
for (var t in r)
|
|
684
684
|
Object.prototype.hasOwnProperty.call(r, t) && e.indexOf(t) < 0 && (n[t] = r[t]);
|
|
@@ -686,16 +686,16 @@ var F = function() {
|
|
|
686
686
|
for (var o = 0, t = Object.getOwnPropertySymbols(r); o < t.length; o++)
|
|
687
687
|
e.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(r, t[o]) && (n[t[o]] = r[t[o]]);
|
|
688
688
|
return n;
|
|
689
|
-
},
|
|
690
|
-
var n = r.icon, t = r.id, o = r.className, i = r.extend, s =
|
|
691
|
-
return
|
|
689
|
+
}, Tt = Ct(function(r, e) {
|
|
690
|
+
var n = r.icon, t = r.id, o = r.className, i = r.extend, s = or(r, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(o || "").trim(), c = Rt("_".concat(ar()));
|
|
691
|
+
return Et(n, "".concat(t), { defIds: n.defIds, idSuffix: c.current }, F({ ref: e, className: a }, s), i);
|
|
692
692
|
});
|
|
693
|
-
function
|
|
694
|
-
return
|
|
695
|
-
return
|
|
693
|
+
function Et(r, e, n, t, o) {
|
|
694
|
+
return It(r.tag, F(F({ key: e }, ir(r, n, o)), t), (sr(r, n).children || []).map(function(i, s) {
|
|
695
|
+
return Et(i, "".concat(e, "-").concat(r.tag, "-").concat(s), n, void 0, o);
|
|
696
696
|
}));
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function ir(r, e, n) {
|
|
699
699
|
var t = F({}, r.attrs);
|
|
700
700
|
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
|
|
701
701
|
var o = e.defIds;
|
|
@@ -704,95 +704,95 @@ function rr(r, e, n) {
|
|
|
704
704
|
typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
705
705
|
})), t;
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function sr(r, e) {
|
|
708
708
|
var n, t = e.defIds;
|
|
709
709
|
return !t || t.length === 0 ? r : r.tag === "defs" && (!((n = r.children) === null || n === void 0) && n.length) ? F(F({}, r), { children: r.children.map(function(o) {
|
|
710
710
|
return typeof o.attrs.id == "string" && t && t.indexOf(o.attrs.id) > -1 ? F(F({}, o), { attrs: F(F({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
|
|
711
711
|
}) }) : r;
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function ar() {
|
|
714
714
|
return Math.random().toString(36).substring(2, 8);
|
|
715
715
|
}
|
|
716
|
-
|
|
717
|
-
var
|
|
718
|
-
return
|
|
716
|
+
Tt.displayName = "UniverIcon";
|
|
717
|
+
var cr = { 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" } }] }, Ut = Ct(function(r, e) {
|
|
718
|
+
return It(Tt, Object.assign({}, r, {
|
|
719
719
|
id: "add-image-single",
|
|
720
720
|
ref: e,
|
|
721
|
-
icon:
|
|
721
|
+
icon: cr
|
|
722
722
|
}));
|
|
723
723
|
});
|
|
724
|
-
|
|
725
|
-
const
|
|
726
|
-
uploadFileMenu:
|
|
727
|
-
uploadFileMenuInput:
|
|
728
|
-
},
|
|
724
|
+
Ut.displayName = "AddImageSingle";
|
|
725
|
+
const lr = "univer-upload-file-menu", dr = "univer-upload-file-menu-input", tt = {
|
|
726
|
+
uploadFileMenu: lr,
|
|
727
|
+
uploadFileMenuInput: dr
|
|
728
|
+
}, At = "COMPONENT_UPLOAD_FILE_MENU";
|
|
729
729
|
var be = /* @__PURE__ */ ((r) => (r[r.cellImage = 0] = "cellImage", r[r.floatImage = 1] = "floatImage", r))(be || {});
|
|
730
|
-
const
|
|
731
|
-
const { type: e } = r, n = Z(B), t =
|
|
730
|
+
const ur = (r) => {
|
|
731
|
+
const { type: e } = r, n = Z(B), t = Rt(null), o = () => {
|
|
732
732
|
var a;
|
|
733
733
|
(a = t.current) == null || a.click();
|
|
734
|
-
}, i =
|
|
734
|
+
}, i = on.map((a) => `.${a.replace("image/", "")}`).join(","), s = (a) => {
|
|
735
735
|
const c = a.target.files;
|
|
736
736
|
if (c == null)
|
|
737
737
|
return;
|
|
738
738
|
const u = Array.from(c);
|
|
739
739
|
e === be.floatImage ? n.executeCommand(Ee.id, { files: u }) : e === be.cellImage && n.executeCommand(Oe.id, { files: u }), t.current && (t.current.value = "");
|
|
740
740
|
};
|
|
741
|
-
return /* @__PURE__ */
|
|
741
|
+
return /* @__PURE__ */ j.createElement("div", { onClick: o, className: tt.uploadFileMenu }, /* @__PURE__ */ j.createElement(
|
|
742
742
|
"input",
|
|
743
743
|
{
|
|
744
744
|
type: "file",
|
|
745
|
-
className:
|
|
745
|
+
className: tt.uploadFileMenuInput,
|
|
746
746
|
ref: t,
|
|
747
747
|
onChange: s,
|
|
748
748
|
accept: i,
|
|
749
749
|
multiple: !0
|
|
750
750
|
}
|
|
751
751
|
));
|
|
752
|
-
},
|
|
753
|
-
function
|
|
752
|
+
}, Nt = "addition-and-subtraction-single", Lt = "sheet.menu.image";
|
|
753
|
+
function mr(r) {
|
|
754
754
|
return {
|
|
755
|
-
id:
|
|
756
|
-
type:
|
|
757
|
-
positions: [
|
|
758
|
-
group:
|
|
759
|
-
icon:
|
|
755
|
+
id: Lt,
|
|
756
|
+
type: it.SUBITEMS,
|
|
757
|
+
positions: [In.TOOLBAR_START],
|
|
758
|
+
group: Dn.TOOLBAR_FORMULAS_INSERT,
|
|
759
|
+
icon: Nt,
|
|
760
760
|
tooltip: "sheetImage.title",
|
|
761
|
-
hidden$:
|
|
762
|
-
disabled$:
|
|
761
|
+
hidden$: st(r, ee.UNIVER_SHEET),
|
|
762
|
+
disabled$: gn(r, { workbookTypes: [En], worksheetTypes: [Un], rangeTypes: [An] })
|
|
763
763
|
};
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function hr(r) {
|
|
766
766
|
return {
|
|
767
767
|
id: Ee.id,
|
|
768
768
|
title: "sheetImage.upload.float",
|
|
769
|
-
type:
|
|
769
|
+
type: it.SELECTOR,
|
|
770
770
|
label: {
|
|
771
|
-
name:
|
|
771
|
+
name: At,
|
|
772
772
|
props: {
|
|
773
773
|
type: be.floatImage
|
|
774
774
|
}
|
|
775
775
|
},
|
|
776
|
-
positions: [
|
|
777
|
-
hidden$:
|
|
776
|
+
positions: [Lt],
|
|
777
|
+
hidden$: st(r, ee.UNIVER_SHEET)
|
|
778
778
|
};
|
|
779
779
|
}
|
|
780
|
-
const
|
|
781
|
-
imageCommonPanel:
|
|
782
|
-
imageCommonPanelGrid:
|
|
783
|
-
imageCommonPanelBorder:
|
|
784
|
-
imageCommonPanelTitle:
|
|
785
|
-
imageCommonPanelRow:
|
|
786
|
-
imageCommonPanelRowVertical:
|
|
787
|
-
imageCommonPanelColumn:
|
|
788
|
-
imageCommonPanelColumnCenter:
|
|
789
|
-
imageCommonPanelInline:
|
|
790
|
-
imageCommonPanelSpan2:
|
|
791
|
-
imageCommonPanelSpan3:
|
|
792
|
-
imageCommonPanelInput:
|
|
793
|
-
sheetImageMenu:
|
|
794
|
-
sheetImageMenuInput:
|
|
795
|
-
},
|
|
780
|
+
const gr = "univer-image-common-panel", fr = "univer-image-common-panel-grid", pr = "univer-image-common-panel-border", wr = "univer-image-common-panel-title", _r = "univer-image-common-panel-row", vr = "univer-image-common-panel-row-vertical", Sr = "univer-image-common-panel-column", Cr = "univer-image-common-panel-column-center", Rr = "univer-image-common-panel-inline", Ir = "univer-image-common-panel-span2", Dr = "univer-image-common-panel-span3", Mr = "univer-image-common-panel-input", Or = "univer-sheet-image-menu", br = "univer-sheet-image-menu-input", z = {
|
|
781
|
+
imageCommonPanel: gr,
|
|
782
|
+
imageCommonPanelGrid: fr,
|
|
783
|
+
imageCommonPanelBorder: pr,
|
|
784
|
+
imageCommonPanelTitle: wr,
|
|
785
|
+
imageCommonPanelRow: _r,
|
|
786
|
+
imageCommonPanelRowVertical: vr,
|
|
787
|
+
imageCommonPanelColumn: Sr,
|
|
788
|
+
imageCommonPanelColumnCenter: Cr,
|
|
789
|
+
imageCommonPanelInline: Rr,
|
|
790
|
+
imageCommonPanelSpan2: Ir,
|
|
791
|
+
imageCommonPanelSpan3: Dr,
|
|
792
|
+
imageCommonPanelInput: Mr,
|
|
793
|
+
sheetImageMenu: Or,
|
|
794
|
+
sheetImageMenuInput: br
|
|
795
|
+
}, Pr = (r) => {
|
|
796
796
|
var v;
|
|
797
797
|
const e = Z(B), n = Z(de), t = Z(k), o = Z(se), { drawings: i } = r, s = i[0];
|
|
798
798
|
if (s == null)
|
|
@@ -807,12 +807,12 @@ const mr = "univer-image-common-panel", hr = "univer-image-common-panel-grid", g
|
|
|
807
807
|
const { oKey: T } = p, D = w.getDrawingOKey(T);
|
|
808
808
|
if (D == null)
|
|
809
809
|
return M.push(null), !0;
|
|
810
|
-
const { unitId: E, subUnitId: U, drawingId: y, drawingType: S, anchorType:
|
|
810
|
+
const { unitId: E, subUnitId: U, drawingId: y, drawingType: S, anchorType: A, sheetTransform: X } = D;
|
|
811
811
|
M.push({
|
|
812
812
|
unitId: E,
|
|
813
813
|
subUnitId: U,
|
|
814
814
|
drawingId: y,
|
|
815
|
-
anchorType:
|
|
815
|
+
anchorType: A,
|
|
816
816
|
sheetTransform: X,
|
|
817
817
|
drawingType: S
|
|
818
818
|
});
|
|
@@ -853,8 +853,8 @@ const mr = "univer-image-common-panel", hr = "univer-image-common-panel-grid", g
|
|
|
853
853
|
});
|
|
854
854
|
}
|
|
855
855
|
const C = (R) => R ? "block" : "none";
|
|
856
|
-
return /* @__PURE__ */
|
|
857
|
-
},
|
|
856
|
+
return /* @__PURE__ */ j.createElement("div", { className: ve(z.imageCommonPanelGrid, z.imageCommonPanelBorder), style: { display: C(l) } }, /* @__PURE__ */ j.createElement("div", { className: z.imageCommonPanelRow }, /* @__PURE__ */ j.createElement("div", { className: ve(z.imageCommonPanelColumn, z.imageCommonPanelTitle) }, /* @__PURE__ */ j.createElement("div", null, n.t("drawing-anchor.title")))), /* @__PURE__ */ j.createElement("div", { className: ve(z.imageCommonPanelRow) }, /* @__PURE__ */ j.createElement("div", { className: ve(z.imageCommonPanelColumn) }, /* @__PURE__ */ j.createElement(Vn, { value: f, onChange: I, direction: "vertical" }, /* @__PURE__ */ j.createElement(je, { value: O.Both }, n.t("drawing-anchor.both")), /* @__PURE__ */ j.createElement(je, { value: O.Position }, n.t("drawing-anchor.position")), /* @__PURE__ */ j.createElement(je, { value: O.None }, n.t("drawing-anchor.none"))))));
|
|
857
|
+
}, yr = () => {
|
|
858
858
|
const r = Z(k), e = r.getFocusDrawings();
|
|
859
859
|
if (e == null || e.length === 0)
|
|
860
860
|
return;
|
|
@@ -866,7 +866,7 @@ const mr = "univer-image-common-panel", hr = "univer-image-common-panel-grid", g
|
|
|
866
866
|
return () => {
|
|
867
867
|
o.unsubscribe();
|
|
868
868
|
};
|
|
869
|
-
}, []), /* @__PURE__ */
|
|
869
|
+
}, []), /* @__PURE__ */ j.createElement("div", { className: z.imageCommonPanel }, /* @__PURE__ */ j.createElement(qt, { drawings: n }), /* @__PURE__ */ j.createElement(Pr, { drawings: n }));
|
|
870
870
|
}, fe = {
|
|
871
871
|
id: "sheet.command.move-drawing",
|
|
872
872
|
type: $.COMMAND,
|
|
@@ -882,15 +882,15 @@ const mr = "univer-image-common-panel", hr = "univer-image-common-panel-grid", g
|
|
|
882
882
|
return i === K.UP ? h.top = f - 1 : i === K.DOWN ? h.top = f + 1 : i === K.LEFT ? h.left = m - 1 : i === K.RIGHT && (h.left = m + 1), {
|
|
883
883
|
...d,
|
|
884
884
|
transform: h,
|
|
885
|
-
sheetTransform:
|
|
885
|
+
sheetTransform: N(h, o)
|
|
886
886
|
};
|
|
887
887
|
}).filter((d) => d != null);
|
|
888
888
|
return n.syncExecuteCommand(Ue.id, {
|
|
889
889
|
unitId: a,
|
|
890
890
|
drawings: c
|
|
891
|
-
}) ? (n.syncExecuteCommand(
|
|
891
|
+
}) ? (n.syncExecuteCommand(L.id, [a]), !0) : !1;
|
|
892
892
|
}
|
|
893
|
-
},
|
|
893
|
+
}, jt = {
|
|
894
894
|
id: "sheet.command.delete-drawing",
|
|
895
895
|
type: $.COMMAND,
|
|
896
896
|
handler: (r) => {
|
|
@@ -913,9 +913,9 @@ const mr = "univer-image-common-panel", hr = "univer-image-common-panel-grid", g
|
|
|
913
913
|
}
|
|
914
914
|
};
|
|
915
915
|
function pe(r) {
|
|
916
|
-
return !r.getContextValue(
|
|
916
|
+
return !r.getContextValue(Ft) && !r.getContextValue(Vt) && r.getContextValue(le);
|
|
917
917
|
}
|
|
918
|
-
const
|
|
918
|
+
const Tr = {
|
|
919
919
|
id: fe.id,
|
|
920
920
|
description: "shortcut.sheet.drawing-move-down",
|
|
921
921
|
group: "4_sheet-drawing-view",
|
|
@@ -925,7 +925,7 @@ const Pr = {
|
|
|
925
925
|
staticParameters: {
|
|
926
926
|
direction: K.DOWN
|
|
927
927
|
}
|
|
928
|
-
},
|
|
928
|
+
}, Er = {
|
|
929
929
|
id: fe.id,
|
|
930
930
|
description: "shortcut.sheet.drawing-move-up",
|
|
931
931
|
group: "4_sheet-drawing-view",
|
|
@@ -935,7 +935,7 @@ const Pr = {
|
|
|
935
935
|
staticParameters: {
|
|
936
936
|
direction: K.UP
|
|
937
937
|
}
|
|
938
|
-
},
|
|
938
|
+
}, Ur = {
|
|
939
939
|
id: fe.id,
|
|
940
940
|
description: "shortcut.sheet.drawing-move-left",
|
|
941
941
|
group: "4_sheet-drawing-view",
|
|
@@ -945,7 +945,7 @@ const Pr = {
|
|
|
945
945
|
staticParameters: {
|
|
946
946
|
direction: K.LEFT
|
|
947
947
|
}
|
|
948
|
-
},
|
|
948
|
+
}, Ar = {
|
|
949
949
|
id: fe.id,
|
|
950
950
|
description: "shortcut.sheet.drawing-move-right",
|
|
951
951
|
group: "4_sheet-drawing-view",
|
|
@@ -955,8 +955,8 @@ const Pr = {
|
|
|
955
955
|
staticParameters: {
|
|
956
956
|
direction: K.RIGHT
|
|
957
957
|
}
|
|
958
|
-
},
|
|
959
|
-
id:
|
|
958
|
+
}, Nr = {
|
|
959
|
+
id: jt.id,
|
|
960
960
|
description: "shortcut.sheet.drawing-delete",
|
|
961
961
|
group: "4_sheet-drawing-view",
|
|
962
962
|
// when focusing on any other input tag do not trigger this shortcut
|
|
@@ -964,25 +964,25 @@ const Pr = {
|
|
|
964
964
|
binding: oe.DELETE,
|
|
965
965
|
mac: oe.BACKSPACE
|
|
966
966
|
};
|
|
967
|
-
var
|
|
968
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
967
|
+
var Lr = Object.defineProperty, jr = Object.getOwnPropertyDescriptor, Wr = (r, e, n, t) => {
|
|
968
|
+
for (var o = t > 1 ? void 0 : t ? jr(e, n) : e, i = r.length - 1, s; i >= 0; i--)
|
|
969
969
|
(s = r[i]) && (o = (t ? s(e, n, o) : s(o)) || o);
|
|
970
|
-
return t && o &&
|
|
970
|
+
return t && o && Lr(e, n, o), o;
|
|
971
971
|
}, ae = (r, e) => (n, t) => e(n, t, r);
|
|
972
|
-
const
|
|
972
|
+
const Br = {};
|
|
973
973
|
let ce = class extends ge {
|
|
974
974
|
constructor(r, e, n, t, o, i) {
|
|
975
975
|
super(), this._config = r, this._injector = e, this._componentManager = n, this._menuService = t, this._commandService = o, this._shortcutService = i, this._init();
|
|
976
976
|
}
|
|
977
977
|
_initCustomComponents() {
|
|
978
978
|
const r = this._componentManager;
|
|
979
|
-
this.disposeWithMe(r.register(
|
|
979
|
+
this.disposeWithMe(r.register(Nt, Ut)), this.disposeWithMe(r.register(At, ur)), this.disposeWithMe(r.register(Dt, yr));
|
|
980
980
|
}
|
|
981
981
|
_initMenus() {
|
|
982
982
|
const { menu: r = {} } = this._config;
|
|
983
983
|
[
|
|
984
|
-
|
|
985
|
-
|
|
984
|
+
mr,
|
|
985
|
+
hr
|
|
986
986
|
// UploadCellImageMenuFactory,
|
|
987
987
|
].forEach((e) => {
|
|
988
988
|
this._menuService.addMenuItem(e(this._injector), r);
|
|
@@ -995,24 +995,24 @@ let ce = class extends ge {
|
|
|
995
995
|
He,
|
|
996
996
|
Xe,
|
|
997
997
|
Ue,
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
Dt,
|
|
998
|
+
Mt,
|
|
999
|
+
L,
|
|
1001
1000
|
Ot,
|
|
1002
|
-
|
|
1001
|
+
Pt,
|
|
1002
|
+
yt,
|
|
1003
1003
|
fe,
|
|
1004
|
-
|
|
1005
|
-
|
|
1004
|
+
jt,
|
|
1005
|
+
bt
|
|
1006
1006
|
].forEach((r) => this.disposeWithMe(this._commandService.registerCommand(r)));
|
|
1007
1007
|
}
|
|
1008
1008
|
_initShortcuts() {
|
|
1009
1009
|
[
|
|
1010
1010
|
// sheet drawing shortcuts
|
|
1011
|
-
Pr,
|
|
1012
|
-
yr,
|
|
1013
1011
|
Tr,
|
|
1014
1012
|
Er,
|
|
1015
|
-
Ur
|
|
1013
|
+
Ur,
|
|
1014
|
+
Ar,
|
|
1015
|
+
Nr
|
|
1016
1016
|
].forEach((r) => {
|
|
1017
1017
|
this.disposeWithMe(this._shortcutService.registerShortcut(r));
|
|
1018
1018
|
});
|
|
@@ -1021,43 +1021,43 @@ let ce = class extends ge {
|
|
|
1021
1021
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
1022
1022
|
}
|
|
1023
1023
|
};
|
|
1024
|
-
ce =
|
|
1024
|
+
ce = Wr([
|
|
1025
1025
|
me(he.Rendered, ce),
|
|
1026
1026
|
ae(1, W(Ve)),
|
|
1027
|
-
ae(2, W(
|
|
1028
|
-
ae(3,
|
|
1027
|
+
ae(2, W(Mn)),
|
|
1028
|
+
ae(3, On),
|
|
1029
1029
|
ae(4, B),
|
|
1030
|
-
ae(5,
|
|
1030
|
+
ae(5, bn)
|
|
1031
1031
|
], ce);
|
|
1032
|
-
var
|
|
1033
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
1032
|
+
var Gr = Object.defineProperty, xr = Object.getOwnPropertyDescriptor, $r = (r, e, n, t) => {
|
|
1033
|
+
for (var o = t > 1 ? void 0 : t ? xr(e, n) : e, i = r.length - 1, s; i >= 0; i--)
|
|
1034
1034
|
(s = r[i]) && (o = (t ? s(e, n, o) : s(o)) || o);
|
|
1035
|
-
return t && o &&
|
|
1035
|
+
return t && o && Gr(e, n, o), o;
|
|
1036
1036
|
}, te = (r, e) => (n, t) => e(n, t, r);
|
|
1037
|
-
const
|
|
1038
|
-
it.id,
|
|
1039
|
-
st.id,
|
|
1037
|
+
const Fr = [
|
|
1040
1038
|
at.id,
|
|
1041
1039
|
ct.id,
|
|
1042
1040
|
lt.id,
|
|
1043
1041
|
dt.id,
|
|
1044
1042
|
ut.id,
|
|
1045
1043
|
mt.id,
|
|
1046
|
-
Ge.id,
|
|
1047
|
-
xe.id,
|
|
1048
1044
|
ht.id,
|
|
1049
1045
|
gt.id,
|
|
1046
|
+
Ge.id,
|
|
1047
|
+
xe.id,
|
|
1050
1048
|
ft.id,
|
|
1051
1049
|
pt.id,
|
|
1052
1050
|
wt.id,
|
|
1053
|
-
_t.id
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1051
|
+
_t.id,
|
|
1052
|
+
vt.id,
|
|
1053
|
+
St.id
|
|
1054
|
+
], Vr = [
|
|
1057
1055
|
Nn.id,
|
|
1058
1056
|
Ln.id,
|
|
1059
1057
|
jn.id,
|
|
1060
|
-
Wn.id
|
|
1058
|
+
Wn.id,
|
|
1059
|
+
Bn.id,
|
|
1060
|
+
Gn.id
|
|
1061
1061
|
];
|
|
1062
1062
|
let De = class extends ge {
|
|
1063
1063
|
constructor(r, e, n, t, o, i) {
|
|
@@ -1070,54 +1070,54 @@ let De = class extends ge {
|
|
|
1070
1070
|
this.disposeWithMe(
|
|
1071
1071
|
this._sheetInterceptorService.interceptCommand({
|
|
1072
1072
|
getMutations: (r) => {
|
|
1073
|
-
if (!
|
|
1073
|
+
if (!Fr.includes(r.id))
|
|
1074
1074
|
return { redos: [], undos: [] };
|
|
1075
1075
|
if (r.params == null)
|
|
1076
1076
|
return { redos: [], undos: [] };
|
|
1077
1077
|
const e = r.id;
|
|
1078
|
-
if (e ===
|
|
1078
|
+
if (e === at.id)
|
|
1079
1079
|
return this._moveRowInterceptor(r.params, "insert");
|
|
1080
|
-
if (e ===
|
|
1080
|
+
if (e === ct.id)
|
|
1081
1081
|
return this._moveColInterceptor(r.params, "insert");
|
|
1082
|
-
if (e ===
|
|
1082
|
+
if (e === lt.id)
|
|
1083
1083
|
return this._moveRowInterceptor(r.params, "remove");
|
|
1084
|
-
if (e ===
|
|
1084
|
+
if (e === dt.id)
|
|
1085
1085
|
return this._moveColInterceptor(r.params, "remove");
|
|
1086
|
-
if (e ===
|
|
1086
|
+
if (e === ut.id) {
|
|
1087
1087
|
const { range: n } = r.params;
|
|
1088
1088
|
return this._getRangeMoveUndo(
|
|
1089
1089
|
n,
|
|
1090
1090
|
0
|
|
1091
1091
|
/* deleteLeft */
|
|
1092
1092
|
);
|
|
1093
|
-
} else if (e ===
|
|
1093
|
+
} else if (e === mt.id) {
|
|
1094
1094
|
const { range: n } = r.params;
|
|
1095
1095
|
return this._getRangeMoveUndo(
|
|
1096
1096
|
n,
|
|
1097
1097
|
1
|
|
1098
1098
|
/* deleteUp */
|
|
1099
1099
|
);
|
|
1100
|
-
} else if (e ===
|
|
1100
|
+
} else if (e === ht.id) {
|
|
1101
1101
|
const { range: n } = r.params;
|
|
1102
1102
|
return this._getRangeMoveUndo(
|
|
1103
1103
|
n,
|
|
1104
1104
|
2
|
|
1105
1105
|
/* insertDown */
|
|
1106
1106
|
);
|
|
1107
|
-
} else if (e ===
|
|
1107
|
+
} else if (e === gt.id) {
|
|
1108
1108
|
const { range: n } = r.params;
|
|
1109
1109
|
return this._getRangeMoveUndo(
|
|
1110
1110
|
n,
|
|
1111
1111
|
3
|
|
1112
1112
|
/* insertRight */
|
|
1113
1113
|
);
|
|
1114
|
-
} else if (e ===
|
|
1114
|
+
} else if (e === wt.id || e === _t.id) {
|
|
1115
1115
|
const n = r.params, { unitId: t, subUnitId: o, ranges: i } = n;
|
|
1116
1116
|
return this._getDrawingUndoForRowVisible(t, o, i);
|
|
1117
|
-
} else if (e ===
|
|
1117
|
+
} else if (e === vt.id || e === St.id) {
|
|
1118
1118
|
const n = r.params, { unitId: t, subUnitId: o, ranges: i } = n;
|
|
1119
1119
|
return this._getDrawingUndoForColVisible(t, o, i);
|
|
1120
|
-
} else if (e === Ge.id || e === xe.id || e ===
|
|
1120
|
+
} else if (e === Ge.id || e === xe.id || e === ft.id || e === pt.id) {
|
|
1121
1121
|
const n = r.params, { unitId: t, subUnitId: o, ranges: i } = n, s = e === Ge.id || e === xe.id;
|
|
1122
1122
|
return this._getDrawingUndoForRowAndColSize(t, o, i, s);
|
|
1123
1123
|
}
|
|
@@ -1144,7 +1144,7 @@ let De = class extends ge {
|
|
|
1144
1144
|
const d = this._sheetDrawingService.getBatchRemoveOp(u), l = d.undo, h = d.redo, m = d.objects;
|
|
1145
1145
|
i.push({ id: b.id, params: { unitId: t, subUnitId: o, op: h, objects: m, type: P.REMOVE } }), s.push({ id: b.id, params: { unitId: t, subUnitId: o, op: l, objects: m, type: P.INSERT } });
|
|
1146
1146
|
}
|
|
1147
|
-
return i.push({ id:
|
|
1147
|
+
return i.push({ id: L.id, params: [t] }), s.push({ id: L.id, params: [t] }), {
|
|
1148
1148
|
redos: i,
|
|
1149
1149
|
undos: s
|
|
1150
1150
|
};
|
|
@@ -1186,7 +1186,7 @@ let De = class extends ge {
|
|
|
1186
1186
|
return { updateDrawings: t, deleteDrawings: o };
|
|
1187
1187
|
}
|
|
1188
1188
|
_remainDrawingSize(r, e, n) {
|
|
1189
|
-
const t =
|
|
1189
|
+
const t = N({ ...r }, this._selectionRenderService);
|
|
1190
1190
|
t != null && e.push({
|
|
1191
1191
|
...n,
|
|
1192
1192
|
sheetTransform: t
|
|
@@ -1206,15 +1206,15 @@ let De = class extends ge {
|
|
|
1206
1206
|
if (R < D)
|
|
1207
1207
|
continue;
|
|
1208
1208
|
if (f === O.Position) {
|
|
1209
|
-
let S = null,
|
|
1209
|
+
let S = null, A = null;
|
|
1210
1210
|
if (C >= D && C <= E) {
|
|
1211
1211
|
const X = this._selectionRenderService.attachRangeWithCoord({ startColumn: C, endColumn: E, startRow: g.row, endRow: _.row });
|
|
1212
1212
|
if (X == null)
|
|
1213
1213
|
return;
|
|
1214
|
-
|
|
1214
|
+
A = { ...m, left: X.startX };
|
|
1215
1215
|
}
|
|
1216
|
-
if (
|
|
1217
|
-
o.push({ ...l, sheetTransform: S, transform:
|
|
1216
|
+
if (A != null && (S = N(A, this._selectionRenderService), S != null && A != null)) {
|
|
1217
|
+
o.push({ ...l, sheetTransform: S, transform: A });
|
|
1218
1218
|
break;
|
|
1219
1219
|
}
|
|
1220
1220
|
this._remainDrawingSize(m, o, l);
|
|
@@ -1247,12 +1247,12 @@ let De = class extends ge {
|
|
|
1247
1247
|
if (y = {
|
|
1248
1248
|
...m,
|
|
1249
1249
|
width: ((m == null ? void 0 : m.width) || 0) - S.endX + S.startX
|
|
1250
|
-
}, U =
|
|
1250
|
+
}, U = N(y, this._selectionRenderService), U != null && y != null) {
|
|
1251
1251
|
i.push({ ...l, sheetTransform: U, transform: y });
|
|
1252
1252
|
break;
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
|
-
if (y != null && (U =
|
|
1255
|
+
if (y != null && (U = N(y, this._selectionRenderService)), y != null && U != null) {
|
|
1256
1256
|
o.push({ ...l, sheetTransform: U, transform: y });
|
|
1257
1257
|
break;
|
|
1258
1258
|
} else
|
|
@@ -1276,10 +1276,10 @@ let De = class extends ge {
|
|
|
1276
1276
|
_createUndoAndRedoMutation(r, e, n) {
|
|
1277
1277
|
const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: o, redo: i, objects: s } = t, a = [
|
|
1278
1278
|
{ id: b.id, params: { unitId: r, subUnitId: e, op: i, objects: s, type: P.UPDATE } },
|
|
1279
|
-
{ id:
|
|
1279
|
+
{ id: L.id, params: [r] }
|
|
1280
1280
|
], c = [
|
|
1281
1281
|
{ id: b.id, params: { unitId: r, subUnitId: e, op: o, objects: s, type: P.UPDATE } },
|
|
1282
|
-
{ id:
|
|
1282
|
+
{ id: L.id, params: [r] }
|
|
1283
1283
|
];
|
|
1284
1284
|
return {
|
|
1285
1285
|
redos: a,
|
|
@@ -1300,15 +1300,15 @@ let De = class extends ge {
|
|
|
1300
1300
|
if (v < p)
|
|
1301
1301
|
continue;
|
|
1302
1302
|
if (f === O.Position) {
|
|
1303
|
-
let S = null,
|
|
1303
|
+
let S = null, A = null;
|
|
1304
1304
|
if (I >= p && I <= T) {
|
|
1305
1305
|
const X = this._selectionRenderService.attachRangeWithCoord({ startColumn: g.column, endColumn: _.column, startRow: I, endRow: T });
|
|
1306
1306
|
if (X == null)
|
|
1307
1307
|
return;
|
|
1308
|
-
|
|
1308
|
+
A = { ...m, top: X.startY };
|
|
1309
1309
|
}
|
|
1310
|
-
if (
|
|
1311
|
-
o.push({ ...l, sheetTransform: S, transform:
|
|
1310
|
+
if (A != null && (S = N(A, this._selectionRenderService), S != null && A != null)) {
|
|
1311
|
+
o.push({ ...l, sheetTransform: S, transform: A });
|
|
1312
1312
|
break;
|
|
1313
1313
|
}
|
|
1314
1314
|
this._remainDrawingSize(m, o, l);
|
|
@@ -1341,12 +1341,12 @@ let De = class extends ge {
|
|
|
1341
1341
|
if (y = {
|
|
1342
1342
|
...m,
|
|
1343
1343
|
height: ((m == null ? void 0 : m.height) || 0) - S.endY + S.startY
|
|
1344
|
-
}, U =
|
|
1344
|
+
}, U = N(y, this._selectionRenderService), U != null && y != null) {
|
|
1345
1345
|
i.push({ ...l, sheetTransform: U, transform: y });
|
|
1346
1346
|
break;
|
|
1347
1347
|
}
|
|
1348
1348
|
}
|
|
1349
|
-
if (y != null && (U =
|
|
1349
|
+
if (y != null && (U = N(y, this._selectionRenderService)), y != null && U != null) {
|
|
1350
1350
|
o.push({ ...l, sheetTransform: U, transform: y });
|
|
1351
1351
|
break;
|
|
1352
1352
|
} else
|
|
@@ -1443,7 +1443,7 @@ let De = class extends ge {
|
|
|
1443
1443
|
const m = this._sheetDrawingService.getBatchRemoveOp(h), f = m.undo, g = m.redo, _ = m.objects;
|
|
1444
1444
|
c.push({ id: b.id, params: { unitId: t, subUnitId: o, op: g, objects: _, type: P.REMOVE } }), u.push({ id: b.id, params: { unitId: t, subUnitId: o, op: f, objects: _, type: P.INSERT } });
|
|
1445
1445
|
}
|
|
1446
|
-
return c.push({ id:
|
|
1446
|
+
return c.push({ id: L.id, params: [t] }), u.push({ id: L.id, params: [t] }), {
|
|
1447
1447
|
redos: c,
|
|
1448
1448
|
undos: u
|
|
1449
1449
|
};
|
|
@@ -1484,13 +1484,13 @@ let De = class extends ge {
|
|
|
1484
1484
|
const m = this._sheetDrawingService.getBatchRemoveOp(h), f = m.undo, g = m.redo, _ = m.objects;
|
|
1485
1485
|
c.push({ id: b.id, params: { unitId: t, subUnitId: o, op: g, objects: _, type: P.REMOVE } }), u.push({ id: b.id, params: { unitId: t, subUnitId: o, op: f, objects: _, type: P.INSERT } });
|
|
1486
1486
|
}
|
|
1487
|
-
return c.push({ id:
|
|
1487
|
+
return c.push({ id: L.id, params: [t] }), u.push({ id: L.id, params: [t] }), { redos: c, undos: u };
|
|
1488
1488
|
}
|
|
1489
1489
|
_expandCol(r, e, n, t, o = O.Position) {
|
|
1490
1490
|
const i = t - n + 1, { from: s, to: a } = r, { column: c } = s, { column: u } = a;
|
|
1491
1491
|
if (o === O.None)
|
|
1492
1492
|
return {
|
|
1493
|
-
newSheetTransform:
|
|
1493
|
+
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1494
1494
|
newTransform: e
|
|
1495
1495
|
};
|
|
1496
1496
|
let d = null, l = null;
|
|
@@ -1498,7 +1498,7 @@ let De = class extends ge {
|
|
|
1498
1498
|
const h = this._selectionRenderService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: s.row, endRow: a.row });
|
|
1499
1499
|
if (h == null)
|
|
1500
1500
|
return;
|
|
1501
|
-
l = { ...e, left: (e.left || 0) + h.endX - h.startX }, d =
|
|
1501
|
+
l = { ...e, left: (e.left || 0) + h.endX - h.startX }, d = N(l, this._selectionRenderService);
|
|
1502
1502
|
} else if (u >= t)
|
|
1503
1503
|
if (o === O.Both)
|
|
1504
1504
|
d = {
|
|
@@ -1507,7 +1507,7 @@ let De = class extends ge {
|
|
|
1507
1507
|
}, l = x(d, this._selectionRenderService);
|
|
1508
1508
|
else
|
|
1509
1509
|
return {
|
|
1510
|
-
newSheetTransform:
|
|
1510
|
+
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1511
1511
|
newTransform: e
|
|
1512
1512
|
};
|
|
1513
1513
|
return d != null && l != null ? {
|
|
@@ -1519,7 +1519,7 @@ let De = class extends ge {
|
|
|
1519
1519
|
const i = t - n + 1, { from: s, to: a } = r, { column: c } = s, { column: u } = a;
|
|
1520
1520
|
if (o === O.None)
|
|
1521
1521
|
return {
|
|
1522
|
-
newSheetTransform:
|
|
1522
|
+
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1523
1523
|
newTransform: e
|
|
1524
1524
|
};
|
|
1525
1525
|
let d = null, l = null;
|
|
@@ -1539,7 +1539,7 @@ let De = class extends ge {
|
|
|
1539
1539
|
}, l = x(d, this._selectionRenderService);
|
|
1540
1540
|
else
|
|
1541
1541
|
return {
|
|
1542
|
-
newSheetTransform:
|
|
1542
|
+
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1543
1543
|
newTransform: e
|
|
1544
1544
|
};
|
|
1545
1545
|
else if (c >= n && c <= t) {
|
|
@@ -1551,7 +1551,7 @@ let De = class extends ge {
|
|
|
1551
1551
|
return;
|
|
1552
1552
|
l = { ...e, left: (e.left || 0) - h.endX + h.startX - r.from.columnOffset };
|
|
1553
1553
|
}
|
|
1554
|
-
d =
|
|
1554
|
+
d = N(l, this._selectionRenderService);
|
|
1555
1555
|
} else if (u >= n && u <= t && o === O.Both) {
|
|
1556
1556
|
const h = this._selectionRenderService.attachRangeWithCoord({
|
|
1557
1557
|
startColumn: n - 1,
|
|
@@ -1576,7 +1576,7 @@ let De = class extends ge {
|
|
|
1576
1576
|
const i = t - n + 1, { from: s, to: a } = r, { row: c } = s, { row: u } = a;
|
|
1577
1577
|
if (o === O.None)
|
|
1578
1578
|
return {
|
|
1579
|
-
newSheetTransform:
|
|
1579
|
+
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1580
1580
|
newTransform: e
|
|
1581
1581
|
};
|
|
1582
1582
|
let d = null, l = null;
|
|
@@ -1584,7 +1584,7 @@ let De = class extends ge {
|
|
|
1584
1584
|
const h = this._selectionRenderService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: s.column, endColumn: a.column });
|
|
1585
1585
|
if (h == null)
|
|
1586
1586
|
return;
|
|
1587
|
-
l = { ...e, top: (e.top || 0) + h.endY - h.startY }, d =
|
|
1587
|
+
l = { ...e, top: (e.top || 0) + h.endY - h.startY }, d = N(l, this._selectionRenderService);
|
|
1588
1588
|
} else if (u >= t)
|
|
1589
1589
|
if (o === O.Both)
|
|
1590
1590
|
d = {
|
|
@@ -1596,7 +1596,7 @@ let De = class extends ge {
|
|
|
1596
1596
|
}, l = x(d, this._selectionRenderService);
|
|
1597
1597
|
else
|
|
1598
1598
|
return {
|
|
1599
|
-
newSheetTransform:
|
|
1599
|
+
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1600
1600
|
newTransform: e
|
|
1601
1601
|
};
|
|
1602
1602
|
return d != null && l != null ? {
|
|
@@ -1608,7 +1608,7 @@ let De = class extends ge {
|
|
|
1608
1608
|
const i = t - n + 1, { from: s, to: a } = r, { row: c } = s, { row: u } = a;
|
|
1609
1609
|
if (o === O.None)
|
|
1610
1610
|
return {
|
|
1611
|
-
newSheetTransform:
|
|
1611
|
+
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1612
1612
|
newTransform: e
|
|
1613
1613
|
};
|
|
1614
1614
|
let d = null, l = null;
|
|
@@ -1628,7 +1628,7 @@ let De = class extends ge {
|
|
|
1628
1628
|
}, l = x(d, this._selectionRenderService);
|
|
1629
1629
|
else
|
|
1630
1630
|
return {
|
|
1631
|
-
newSheetTransform:
|
|
1631
|
+
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1632
1632
|
newTransform: e
|
|
1633
1633
|
};
|
|
1634
1634
|
else if (c >= n && c <= t) {
|
|
@@ -1640,7 +1640,7 @@ let De = class extends ge {
|
|
|
1640
1640
|
return;
|
|
1641
1641
|
l = { ...e, top: (e.top || 0) - h.endY + h.startY - r.from.rowOffset };
|
|
1642
1642
|
}
|
|
1643
|
-
d =
|
|
1643
|
+
d = N(l, this._selectionRenderService);
|
|
1644
1644
|
} else if (u >= n && u <= t && o === O.Both) {
|
|
1645
1645
|
const h = this._selectionRenderService.attachRangeWithCoord({ startColumn: s.column, endColumn: s.column, startRow: n - 1, endRow: n - 1 });
|
|
1646
1646
|
if (h == null)
|
|
@@ -1659,7 +1659,7 @@ let De = class extends ge {
|
|
|
1659
1659
|
_commandListener() {
|
|
1660
1660
|
this.disposeWithMe(
|
|
1661
1661
|
this._commandService.onCommandExecuted((r) => {
|
|
1662
|
-
if (r.id ===
|
|
1662
|
+
if (r.id === xn.id) {
|
|
1663
1663
|
const e = r.params, { unitId: n, subUnitId: t } = e, o = this._drawingManagerService.drawingManagerData, i = [], s = [];
|
|
1664
1664
|
Object.keys(o).forEach((a) => {
|
|
1665
1665
|
const c = o[a];
|
|
@@ -1677,7 +1677,7 @@ let De = class extends ge {
|
|
|
1677
1677
|
_sheetRefreshListener() {
|
|
1678
1678
|
this.disposeWithMe(
|
|
1679
1679
|
this._commandService.onCommandExecuted((r) => {
|
|
1680
|
-
|
|
1680
|
+
Vr.includes(r.id) && requestIdleCallback(() => {
|
|
1681
1681
|
const e = r.params, { unitId: n, subUnitId: t, ranges: o } = e;
|
|
1682
1682
|
this._refreshDrawingTransform(n, t, o);
|
|
1683
1683
|
});
|
|
@@ -1693,7 +1693,7 @@ let De = class extends ge {
|
|
|
1693
1693
|
const { from: u, to: d } = a, { row: l, column: h } = u, { row: m, column: f } = d;
|
|
1694
1694
|
for (let g = 0; g < n.length; g++) {
|
|
1695
1695
|
const _ = n[g], { startRow: I, endRow: C, startColumn: v, endColumn: R } = _;
|
|
1696
|
-
if (
|
|
1696
|
+
if (Yt.intersects(
|
|
1697
1697
|
{
|
|
1698
1698
|
startRow: I,
|
|
1699
1699
|
endRow: C,
|
|
@@ -1714,25 +1714,25 @@ let De = class extends ge {
|
|
|
1714
1714
|
break;
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
|
-
}), o.length !== 0 && (this._drawingManagerService.refreshTransform(o), this._commandService.syncExecuteCommand(
|
|
1717
|
+
}), o.length !== 0 && (this._drawingManagerService.refreshTransform(o), this._commandService.syncExecuteCommand(L.id, [r]));
|
|
1718
1718
|
}
|
|
1719
1719
|
};
|
|
1720
|
-
De =
|
|
1720
|
+
De = $r([
|
|
1721
1721
|
me(he.Rendered, De),
|
|
1722
1722
|
te(0, B),
|
|
1723
|
-
te(1, W(
|
|
1723
|
+
te(1, W($n)),
|
|
1724
1724
|
te(2, Y),
|
|
1725
1725
|
te(3, k),
|
|
1726
1726
|
te(4, Te),
|
|
1727
1727
|
te(5, ue)
|
|
1728
1728
|
], De);
|
|
1729
|
-
var
|
|
1730
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
1729
|
+
var Yr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, Hr = (r, e, n, t) => {
|
|
1730
|
+
for (var o = t > 1 ? void 0 : t ? Xr(e, n) : e, i = r.length - 1, s; i >= 0; i--)
|
|
1731
1731
|
(s = r[i]) && (o = (t ? s(e, n, o) : s(o)) || o);
|
|
1732
|
-
return t && o &&
|
|
1732
|
+
return t && o && Yr(e, n, o), o;
|
|
1733
1733
|
}, Q = (r, e) => (n, t) => e(n, t, r);
|
|
1734
|
-
function
|
|
1735
|
-
const { scaleX: o, scaleY: i } = e.getAncestorScale(), s = e.getViewport(
|
|
1734
|
+
function kr(r, e, n, t) {
|
|
1735
|
+
const { scaleX: o, scaleY: i } = e.getAncestorScale(), s = e.getViewport(mn.VIEW_MAIN), a = {
|
|
1736
1736
|
left: !0,
|
|
1737
1737
|
top: !0
|
|
1738
1738
|
};
|
|
@@ -1750,18 +1750,18 @@ function Xr(r, e, n, t) {
|
|
|
1750
1750
|
),
|
|
1751
1751
|
(u - D) * o
|
|
1752
1752
|
)) : (a.left = !1, U = Math.max((c - D) * o, (w + v) * o), y = Math.max((u - D) * o, (w + v) * o));
|
|
1753
|
-
let S,
|
|
1754
|
-
return d < p ? (a.top = !0, S = (M + R + (d - p)) * i,
|
|
1753
|
+
let S, A;
|
|
1754
|
+
return d < p ? (a.top = !0, S = (M + R + (d - p)) * i, A = Math.max(
|
|
1755
1755
|
Math.min(
|
|
1756
1756
|
(M + R + (u - p)) * i,
|
|
1757
1757
|
(M + R) * i
|
|
1758
1758
|
),
|
|
1759
1759
|
(l - E) * i
|
|
1760
|
-
)) : (a.top = !1, S = Math.max((d - E) * i, (M + R) * i),
|
|
1760
|
+
)) : (a.top = !1, S = Math.max((d - E) * i, (M + R) * i), A = Math.max((l - E) * i, (M + R) * i)), {
|
|
1761
1761
|
left: U,
|
|
1762
1762
|
right: y,
|
|
1763
1763
|
top: S,
|
|
1764
|
-
bottom:
|
|
1764
|
+
bottom: A,
|
|
1765
1765
|
absolute: a
|
|
1766
1766
|
};
|
|
1767
1767
|
}
|
|
@@ -1771,7 +1771,7 @@ const We = (r, e, n, t) => {
|
|
|
1771
1771
|
right: i + a,
|
|
1772
1772
|
top: s,
|
|
1773
1773
|
bottom: s + c
|
|
1774
|
-
}, l =
|
|
1774
|
+
}, l = kr(d, o, n, t);
|
|
1775
1775
|
return {
|
|
1776
1776
|
startX: l.left,
|
|
1777
1777
|
endX: l.right,
|
|
@@ -1788,9 +1788,9 @@ let Fe = class extends ge {
|
|
|
1788
1788
|
super();
|
|
1789
1789
|
H(this, "_domLayerMap", /* @__PURE__ */ new Map());
|
|
1790
1790
|
H(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
1791
|
-
H(this, "_transformChange$", new
|
|
1791
|
+
H(this, "_transformChange$", new et());
|
|
1792
1792
|
H(this, "transformChange$", this._transformChange$.asObservable());
|
|
1793
|
-
H(this, "_remove$", new
|
|
1793
|
+
H(this, "_remove$", new et());
|
|
1794
1794
|
H(this, "remove$", this._remove$.asObservable());
|
|
1795
1795
|
this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = o, this._selectionRenderService = i, this._canvasFloatDomService = s, this._sheetDrawingService = a, this._drawingAddListener(), this._scrollUpdateListener(), this._featureUpdateListener(), this._deleteListener();
|
|
1796
1796
|
}
|
|
@@ -1815,8 +1815,8 @@ let Fe = class extends ge {
|
|
|
1815
1815
|
// eslint-disable-next-line max-lines-per-function
|
|
1816
1816
|
this._drawingManagerService.add$.subscribe((e) => {
|
|
1817
1817
|
e.forEach((n) => {
|
|
1818
|
-
var
|
|
1819
|
-
const { unitId: t, subUnitId: o, drawingId: i } = n, s = re(this._univerInstanceService, { unitId: t, subUnitId: o }), a = this._drawingManagerService.getDrawingByParam(n), c = (
|
|
1818
|
+
var ze, Ke;
|
|
1819
|
+
const { unitId: t, subUnitId: o, drawingId: i } = n, s = re(this._univerInstanceService, { unitId: t, subUnitId: o }), a = this._drawingManagerService.getDrawingByParam(n), c = (ze = this._renderManagerService.getRenderById(t)) == null ? void 0 : ze.with(Be).getUnitSkeleton(t, o);
|
|
1820
1820
|
if (a == null || s == null || c == null)
|
|
1821
1821
|
return;
|
|
1822
1822
|
const { transform: u, drawingType: d } = a;
|
|
@@ -1828,7 +1828,7 @@ let Fe = class extends ge {
|
|
|
1828
1828
|
const { scene: h, canvas: m } = l;
|
|
1829
1829
|
if (u == null)
|
|
1830
1830
|
return !0;
|
|
1831
|
-
const { left: f, top: g, width: _, height: I, angle: C, flipX: v, flipY: R, skewX: w, skewY: M } = u, p =
|
|
1831
|
+
const { left: f, top: g, width: _, height: I, angle: C, flipX: v, flipY: R, skewX: w, skewY: M } = u, p = sn({ unitId: t, subUnitId: o, drawingId: i }), T = h.getObject(p);
|
|
1832
1832
|
if (T != null) {
|
|
1833
1833
|
T.transformByState({ left: f, top: g, width: _, height: I, angle: C, flipX: v, flipY: R, skewX: w, skewY: M });
|
|
1834
1834
|
return;
|
|
@@ -1839,17 +1839,17 @@ let Fe = class extends ge {
|
|
|
1839
1839
|
width: _,
|
|
1840
1840
|
height: I,
|
|
1841
1841
|
zIndex: this._drawingManagerService.getDrawingOrder(t, o).length - 1
|
|
1842
|
-
}, E = new
|
|
1843
|
-
h.addObject(E,
|
|
1844
|
-
const U = new
|
|
1845
|
-
dispose:
|
|
1842
|
+
}, E = new dn(p, D);
|
|
1843
|
+
h.addObject(E, un).attachTransformerTo(E);
|
|
1844
|
+
const U = this._ensureMap(t, o), y = new Xt(), S = We(E, l.renderObject, c.skeleton, s.worksheet), A = new _n(S), X = {
|
|
1845
|
+
dispose: y,
|
|
1846
1846
|
rect: E,
|
|
1847
|
-
position$:
|
|
1847
|
+
position$: A,
|
|
1848
1848
|
unitId: t,
|
|
1849
1849
|
subUnitId: o
|
|
1850
1850
|
};
|
|
1851
1851
|
this._canvasFloatDomService.addFloatDom({
|
|
1852
|
-
position$:
|
|
1852
|
+
position$: A,
|
|
1853
1853
|
id: i,
|
|
1854
1854
|
componentKey: a.componentKey,
|
|
1855
1855
|
onPointerDown: (G) => {
|
|
@@ -1863,17 +1863,18 @@ let Fe = class extends ge {
|
|
|
1863
1863
|
},
|
|
1864
1864
|
onWheel: (G) => {
|
|
1865
1865
|
m.dispatchEvent(new WheelEvent(G.type, G));
|
|
1866
|
-
}
|
|
1866
|
+
},
|
|
1867
|
+
props: (Ke = U.get(i)) == null ? void 0 : Ke.props
|
|
1867
1868
|
});
|
|
1868
|
-
const
|
|
1869
|
+
const ke = E.onTransformChangeObservable.add(() => {
|
|
1869
1870
|
const G = We(E, l.renderObject, c.skeleton, s.worksheet);
|
|
1870
|
-
|
|
1871
|
+
A.next(
|
|
1871
1872
|
G
|
|
1872
1873
|
);
|
|
1873
1874
|
});
|
|
1874
|
-
|
|
1875
|
+
y.add(() => {
|
|
1875
1876
|
this._canvasFloatDomService.removeFloatDom(i);
|
|
1876
|
-
}),
|
|
1877
|
+
}), ke && y.add(ke), this._domLayerInfoMap.set(i, X);
|
|
1877
1878
|
});
|
|
1878
1879
|
})
|
|
1879
1880
|
);
|
|
@@ -1892,15 +1893,15 @@ let Fe = class extends ge {
|
|
|
1892
1893
|
}
|
|
1893
1894
|
});
|
|
1894
1895
|
};
|
|
1895
|
-
if (e.id ===
|
|
1896
|
+
if (e.id === fn.id) {
|
|
1896
1897
|
const i = e.params, { unitId: s, sheetId: a } = i;
|
|
1897
1898
|
n(s, a);
|
|
1898
|
-
} else if (e.id ===
|
|
1899
|
+
} else if (e.id === pn.id) {
|
|
1899
1900
|
const i = e.params, { unitId: s } = i;
|
|
1900
1901
|
Array.from((o = (t = this._domLayerMap.get(s)) == null ? void 0 : t.keys()) != null ? o : []).forEach((c) => {
|
|
1901
1902
|
n(s, c);
|
|
1902
1903
|
});
|
|
1903
|
-
} else if (e.id ===
|
|
1904
|
+
} else if (e.id === Fn.id) {
|
|
1904
1905
|
const { unitId: i, subUnitId: s } = e.params;
|
|
1905
1906
|
n(i, s);
|
|
1906
1907
|
}
|
|
@@ -1963,7 +1964,8 @@ let Fe = class extends ge {
|
|
|
1963
1964
|
const { unitId: t, subUnitId: o } = n, { initPosition: i, componentKey: s } = e, a = ne.generateRandomId(), c = this._getPosition(i);
|
|
1964
1965
|
if (c == null)
|
|
1965
1966
|
return;
|
|
1966
|
-
|
|
1967
|
+
this._ensureMap(t, o).set(a, e);
|
|
1968
|
+
const d = {
|
|
1967
1969
|
unitId: t,
|
|
1968
1970
|
subUnitId: o,
|
|
1969
1971
|
drawingId: a,
|
|
@@ -1979,8 +1981,8 @@ let Fe = class extends ge {
|
|
|
1979
1981
|
};
|
|
1980
1982
|
return this._commandService.executeCommand(He.id, {
|
|
1981
1983
|
unitId: t,
|
|
1982
|
-
drawings: [
|
|
1983
|
-
}),
|
|
1984
|
+
drawings: [d]
|
|
1985
|
+
}), {
|
|
1984
1986
|
id: a,
|
|
1985
1987
|
dispose: () => {
|
|
1986
1988
|
this._removeDom(a, !0);
|
|
@@ -2003,19 +2005,19 @@ let Fe = class extends ge {
|
|
|
2003
2005
|
}
|
|
2004
2006
|
}
|
|
2005
2007
|
};
|
|
2006
|
-
Fe =
|
|
2008
|
+
Fe = Hr([
|
|
2007
2009
|
Q(0, W(se)),
|
|
2008
2010
|
Q(1, ue),
|
|
2009
2011
|
Q(2, W(B)),
|
|
2010
2012
|
Q(3, k),
|
|
2011
2013
|
Q(4, Te),
|
|
2012
|
-
Q(5, W(
|
|
2014
|
+
Q(5, W(Pn)),
|
|
2013
2015
|
Q(6, Y)
|
|
2014
2016
|
], Fe);
|
|
2015
|
-
var
|
|
2016
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
2017
|
+
var zr = Object.defineProperty, Kr = Object.getOwnPropertyDescriptor, Jr = (r, e, n, t) => {
|
|
2018
|
+
for (var o = t > 1 ? void 0 : t ? Kr(e, n) : e, i = r.length - 1, s; i >= 0; i--)
|
|
2017
2019
|
(s = r[i]) && (o = (t ? s(e, n, o) : s(o)) || o);
|
|
2018
|
-
return t && o &&
|
|
2020
|
+
return t && o && zr(e, n, o), o;
|
|
2019
2021
|
}, Ce = (r, e) => (n, t) => e(n, t, r);
|
|
2020
2022
|
let Me = class extends ge {
|
|
2021
2023
|
constructor(r, e, n, t) {
|
|
@@ -2061,24 +2063,24 @@ let Me = class extends ge {
|
|
|
2061
2063
|
);
|
|
2062
2064
|
}
|
|
2063
2065
|
};
|
|
2064
|
-
Me =
|
|
2066
|
+
Me = Jr([
|
|
2065
2067
|
me(he.Rendered, Me),
|
|
2066
|
-
Ce(0, W(
|
|
2067
|
-
Ce(1, W(
|
|
2068
|
+
Ce(0, W(wn)),
|
|
2069
|
+
Ce(1, W(Qt)),
|
|
2068
2070
|
Ce(2, k),
|
|
2069
2071
|
Ce(3, se)
|
|
2070
2072
|
], Me);
|
|
2071
|
-
var
|
|
2072
|
-
for (var o = t > 1 ? void 0 : t ?
|
|
2073
|
+
var Wt = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, qr = (r, e, n) => e in r ? Wt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n, Qr = (r, e, n, t) => {
|
|
2074
|
+
for (var o = t > 1 ? void 0 : t ? Zr(e, n) : e, i = r.length - 1, s; i >= 0; i--)
|
|
2073
2075
|
(s = r[i]) && (o = (t ? s(e, n, o) : s(o)) || o);
|
|
2074
|
-
return t && o &&
|
|
2075
|
-
},
|
|
2076
|
-
const
|
|
2077
|
-
let Pe = class extends
|
|
2076
|
+
return t && o && Wt(e, n, o), o;
|
|
2077
|
+
}, nt = (r, e) => (n, t) => e(n, t, r), Bt = (r, e, n) => (qr(r, typeof e != "symbol" ? e + "" : e, n), n);
|
|
2078
|
+
const eo = "SHEET_IMAGE_UI_PLUGIN";
|
|
2079
|
+
let Pe = class extends Ht {
|
|
2078
2080
|
constructor(e = {}, n, t) {
|
|
2079
2081
|
super();
|
|
2080
2082
|
H(this, "_pluginConfig");
|
|
2081
|
-
this._injector = n, this._localeService = t, this._pluginConfig = ne.deepMerge({},
|
|
2083
|
+
this._injector = n, this._localeService = t, this._pluginConfig = ne.deepMerge({}, Br, e);
|
|
2082
2084
|
}
|
|
2083
2085
|
onStarting(e) {
|
|
2084
2086
|
super.onStarting(e), this._initDependencies(e);
|
|
@@ -2101,12 +2103,12 @@ let Pe = class extends Yt {
|
|
|
2101
2103
|
].forEach((t) => e.add(t));
|
|
2102
2104
|
}
|
|
2103
2105
|
};
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
Pe =
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2106
|
+
Bt(Pe, "type", ee.UNIVER_SHEET);
|
|
2107
|
+
Bt(Pe, "pluginName", eo);
|
|
2108
|
+
Pe = Qr([
|
|
2109
|
+
kt(an, en, tn),
|
|
2110
|
+
nt(1, W(Ve)),
|
|
2111
|
+
nt(2, W(de))
|
|
2110
2112
|
], Pe);
|
|
2111
2113
|
export {
|
|
2112
2114
|
Fe as SheetCanvasFloatDomManagerService,
|