@univerjs/sheets-drawing-ui 0.6.0-nightly.202502121606 → 0.6.0-nightly.202502141606
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/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +175 -174
- package/lib/es/index.js +475 -492
- package/lib/types/facade/f-enum.d.ts +3 -2
- package/lib/types/facade/f-event.d.ts +3 -2
- package/lib/types/facade/f-over-grid-image.d.ts +2 -1
- package/lib/types/facade/f-univer.d.ts +2 -1
- package/lib/types/facade/f-worksheet.d.ts +2 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +17 -17
package/lib/es/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Q = (i, n, e) =>
|
|
4
|
-
import { CommandType as te, ICommandService as G, IUndoRedoService as Ye, sequenceExecute as
|
|
5
|
-
import { DocDrawingController as
|
|
6
|
-
import { SetDrawingSelectedOperation as
|
|
7
|
-
import { ImageCropperObject as
|
|
8
|
-
import { IRenderManagerService as ne, precisionTo as vt,
|
|
9
|
-
import { ISheetDrawingService as ae,
|
|
10
|
-
import { SheetCanvasPopManagerService as
|
|
11
|
-
import { ISidebarService as
|
|
12
|
-
import { takeUntil as Mn, combineLatest as St, switchMap as Se, EMPTY as pe, tap as yn, map as Ee, distinctUntilChanged as Tn, Subject as Zt, filter as
|
|
13
|
-
import { SheetInterceptorService as
|
|
1
|
+
var Er = Object.defineProperty;
|
|
2
|
+
var Or = (i, n, e) => n in i ? Er(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
|
|
3
|
+
var Q = (i, n, e) => Or(i, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { CommandType as te, ICommandService as G, IUndoRedoService as Ye, sequenceExecute as kn, LocaleService as $t, IUniverInstanceService as Ge, Inject as N, Injector as tt, IContextService as Bn, RxDisposable as Ur, UniverInstanceType as F, toDisposable as Pr, FOCUSING_COMMON_DRAWINGS as Le, DrawingTypeEnum as L, Disposable as le, ArrangeTypeEnum as mt, createDocumentModelWithStyle as Ar, ObjectRelativeFromV as Nr, ObjectRelativeFromH as kr, WrapTextType as Br, PositionedObjectLayoutType as Wr, BooleanNumber as jr, BuildTextUtils as $r, Range as xr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as pt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as wt, InterceptorEffectEnum as Lr, ObjectMatrix as Fr, Tools as ye, IPermissionService as Yr, UserManagerService as Gr, Rectangle as Xr, Direction as Ie, FOCUSING_FX_BAR_EDITOR as Vr, EDITOR_ACTIVATED as Hr, FOCUSING_PANEL_EDITOR as zr, LifecycleService as Kr, LifecycleStages as Zr, DisposableCollection as _t, fromEventSubject as Jr, generateRandomId as Ht, DependentOn as qr, IConfigService as Qr, Plugin as ei, merge as ti, registerDependencies as ni, touchDependencies as zt } from "@univerjs/core";
|
|
5
|
+
import { DocDrawingController as ri, UniverDocsDrawingPlugin as ii } from "@univerjs/docs-drawing";
|
|
6
|
+
import { SetDrawingSelectedOperation as xt, IImageIoService as Wn, IDrawingManagerService as oe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as wn, DRAWING_IMAGE_COUNT_LIMIT as _n, ImageUploadStatusType as Be, DRAWING_IMAGE_ALLOW_SIZE as vn, getImageSize as Sn, DRAWING_IMAGE_WIDTH_LIMIT as In, DRAWING_IMAGE_HEIGHT_LIMIT as Cn, ImageSourceType as si, getDrawingShapeKeyByDrawingSearch as Ce, UniverDrawingPlugin as oi } from "@univerjs/drawing";
|
|
7
|
+
import { ImageCropperObject as ai, COMPONENT_IMAGE_POPUP_MENU as ci, OpenImageCropOperation as di, ImageResetSizeOperation as li, DrawingRenderService as jn, DrawingCommonPanel as ui, UniverDrawingUIPlugin as hi } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as ne, precisionTo as vt, transformObjectOutOfGroup as gi, getGroupState as fi, RENDER_CLASS_TYPE as We, Rect as je, ObjectType as bn, DRAWING_OBJECT_LAYER_INDEX as Kt, SHEET_VIEWPORT_KEY as $n } from "@univerjs/engine-render";
|
|
9
|
+
import { ISheetDrawingService as ae, DrawingApplyType as P, SetDrawingApplyMutation as A, SheetDrawingAnchorType as U, UniverSheetsDrawingPlugin as mi } from "@univerjs/sheets-drawing";
|
|
10
|
+
import { SheetCanvasPopManagerService as pi, convertPositionSheetOverGridToAbsolute as wi, ISheetSelectionRenderService as Xe, SheetSkeletonManagerService as V, attachRangeWithCoord as xn, IEditorBridgeService as _i, IAutoFillService as vi, HoverManagerService as Si, PREDEFINED_HOOK_NAME as xe, COPY_TYPE as be, discreteRangeToRange as Rn, virtualizeDiscreteRanges as Ii, ISheetClipboardService as Ci, SheetPrintInterceptorService as bi, getCurrentRangeDisable$ as Ri, SetZoomRatioOperation as Dn, SetScrollOperation as Di } from "@univerjs/sheets-ui";
|
|
11
|
+
import { ISidebarService as Mi, useDependency as Te, IUIPartsService as yi, BuiltInUIPart as Ti, connectInjector as Ei, ILocalFileService as Oi, IMessageService as Ui, IClipboardInterfaceService as Pi, MenuItemType as cn, getMenuHiddenObservable as Ln, RibbonStartGroup as Ai, KeyCode as Fe, ComponentManager as Ni, IMenuManagerService as ki, IShortcutService as Bi, CanvasFloatDomService as Wi } from "@univerjs/ui";
|
|
12
|
+
import { takeUntil as Mn, combineLatest as St, switchMap as Se, EMPTY as pe, tap as yn, map as Ee, distinctUntilChanged as Tn, Subject as Zt, filter as ji, take as $i, BehaviorSubject as Ze, of as En } from "rxjs";
|
|
13
|
+
import { SheetInterceptorService as Lt, getSheetCommandTarget as H, SheetsSelectionsService as dn, SetRangeValuesCommand as xi, SetWorksheetRowHeightMutation as Fn, SetWorksheetColWidthMutation as Yn, SetWorksheetRowIsAutoHeightMutation as Li, SetWorksheetRowAutoHeightMutation as Gn, AddWorksheetMergeMutation as Fi, RemoveWorksheetMergeMutation as Yi, AFTER_CELL_EDIT as Gi, INTERCEPTOR_POINT as Xi, InterceptCellContentPriority as Vi, WorkbookViewPermission as On, WorksheetViewPermission as Un, WorkbookEditablePermission as Qt, WorksheetEditPermission as en, InsertRowCommand as Xn, InsertColCommand as Vn, RemoveRowCommand as Hn, RemoveColCommand as zn, DeleteRangeMoveLeftCommand as Kn, DeleteRangeMoveUpCommand as Zn, InsertRangeMoveDownCommand as Jn, InsertRangeMoveRightCommand as qn, DeltaRowHeightCommand as tn, SetRowHeightCommand as nn, DeltaColumnWidthCommand as Qn, SetColWidthCommand as er, SetRowHiddenCommand as tr, SetSpecificRowsVisibleCommand as nr, SetSpecificColsVisibleCommand as rr, SetColHiddenCommand as ir, MoveColsCommand as sr, MoveRowsCommand as or, MoveRangeCommand as ar, SetRowVisibleMutation as Hi, SetRowHiddenMutation as zi, SetColVisibleMutation as Ki, SetColHiddenMutation as Zi, SetWorksheetActiveOperation as Ji, RangeProtectionPermissionEditPoint as qi, SetFrozenMutation as Qi, COMMAND_LISTENER_SKELETON_CHANGE as es } from "@univerjs/sheets";
|
|
14
14
|
import { jsx as ee, jsxs as Tt } from "react/jsx-runtime";
|
|
15
|
-
import
|
|
16
|
-
import { docDrawingPositionToTransform as
|
|
17
|
-
import { MessageType as Re, RadioGroup as
|
|
18
|
-
const
|
|
15
|
+
import ts, { useEffect as ln, forwardRef as cr, useRef as ns, createElement as dr, useState as rn } from "react";
|
|
16
|
+
import { docDrawingPositionToTransform as rs, ReplaceSnapshotCommand as is } from "@univerjs/docs-ui";
|
|
17
|
+
import { MessageType as Re, RadioGroup as ss, Radio as Jt } from "@univerjs/design";
|
|
18
|
+
const os = "sheets-drawing-ui.config", Pn = {}, x = {
|
|
19
19
|
id: "sheet.operation.clear-drawing-transformer",
|
|
20
20
|
type: te.MUTATION,
|
|
21
21
|
handler: (i, n) => {
|
|
@@ -30,27 +30,27 @@ const as = "sheets-drawing-ui.config", Un = {}, L = {
|
|
|
30
30
|
type: te.COMMAND,
|
|
31
31
|
handler: (i, n) => {
|
|
32
32
|
var S, C, D;
|
|
33
|
-
const e = i.get(G), t = i.get(Ye), r = i.get(
|
|
33
|
+
const e = i.get(G), t = i.get(Ye), r = i.get(Lt), s = i.get(ae);
|
|
34
34
|
if (!n) return !1;
|
|
35
35
|
const { drawings: o } = n, a = [];
|
|
36
36
|
o.forEach((v) => {
|
|
37
37
|
const { unitId: b } = v;
|
|
38
38
|
a.push(b);
|
|
39
39
|
});
|
|
40
|
-
const c = s.getBatchRemoveOp(o), { unitId: u, subUnitId: d, undo: l, redo: g, objects: h } = c, f = r.onCommandExecute({ id: nt.id, params: n }), p = { id:
|
|
41
|
-
return
|
|
40
|
+
const c = s.getBatchRemoveOp(o), { unitId: u, subUnitId: d, undo: l, redo: g, objects: h } = c, f = r.onCommandExecute({ id: nt.id, params: n }), p = { id: A.id, params: { unitId: u, subUnitId: d, op: g, objects: h, type: P.REMOVE } }, m = { id: A.id, params: { unitId: u, subUnitId: d, op: l, objects: h, type: P.INSERT } };
|
|
41
|
+
return kn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], e) ? (t.pushUndoRedo({
|
|
42
42
|
unitID: u,
|
|
43
43
|
undoMutations: [
|
|
44
44
|
...(C = f.preUndos) != null ? C : [],
|
|
45
45
|
m,
|
|
46
46
|
...f.undos,
|
|
47
|
-
{ id:
|
|
47
|
+
{ id: x.id, params: a }
|
|
48
48
|
],
|
|
49
49
|
redoMutations: [
|
|
50
50
|
...(D = f.preRedos) != null ? D : [],
|
|
51
51
|
p,
|
|
52
52
|
...f.redos,
|
|
53
|
-
{ id:
|
|
53
|
+
{ id: x.id, params: a }
|
|
54
54
|
]
|
|
55
55
|
}), !0) : !1;
|
|
56
56
|
}
|
|
@@ -58,7 +58,7 @@ const as = "sheets-drawing-ui.config", Un = {}, L = {
|
|
|
58
58
|
id: "sidebar.operation.sheet-image",
|
|
59
59
|
type: te.COMMAND,
|
|
60
60
|
handler: async (i, n) => {
|
|
61
|
-
const e = i.get(
|
|
61
|
+
const e = i.get(Mi), t = i.get($t), r = i.get(Ge), s = i.get(G);
|
|
62
62
|
if (!H(r)) return !1;
|
|
63
63
|
switch (n.value) {
|
|
64
64
|
case "open":
|
|
@@ -66,7 +66,7 @@ const as = "sheets-drawing-ui.config", Un = {}, L = {
|
|
|
66
66
|
header: { title: t.t("sheetImage.panel.title") },
|
|
67
67
|
children: { label: lr },
|
|
68
68
|
onClose: () => {
|
|
69
|
-
s.syncExecuteCommand(
|
|
69
|
+
s.syncExecuteCommand(xt.id, []);
|
|
70
70
|
},
|
|
71
71
|
width: 360
|
|
72
72
|
});
|
|
@@ -83,16 +83,15 @@ const as = "sheets-drawing-ui.config", Un = {}, L = {
|
|
|
83
83
|
type: te.OPERATION,
|
|
84
84
|
handler: (i, n) => {
|
|
85
85
|
const e = i.get(G);
|
|
86
|
-
return n == null ? !1 : (e.syncExecuteCommand(
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
uploadLoading:
|
|
90
|
-
uploadLoadingBody:
|
|
91
|
-
uploadLoadingBodyAnimation:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const i = Te(Wn), n = Te(xt), [e, t] = ns.useState(0);
|
|
86
|
+
return n == null ? !1 : (e.syncExecuteCommand(xt.id, [n]), e.executeCommand(ur.id, { value: "open" }), !0);
|
|
87
|
+
}
|
|
88
|
+
}, as = "univer-upload-loading", cs = "univer-upload-loading-body", ds = "univer-upload-loading-body-animation", ls = "univer-upload-loading-body-text", It = {
|
|
89
|
+
uploadLoading: as,
|
|
90
|
+
uploadLoadingBody: cs,
|
|
91
|
+
uploadLoadingBodyAnimation: ds,
|
|
92
|
+
uploadLoadingBodyText: ls
|
|
93
|
+
}, us = () => {
|
|
94
|
+
const i = Te(Wn), n = Te($t), [e, t] = ts.useState(0);
|
|
96
95
|
return ln(() => {
|
|
97
96
|
const r = i.change$.subscribe((s) => {
|
|
98
97
|
t(s);
|
|
@@ -105,10 +104,10 @@ const as = "sheets-drawing-ui.config", Un = {}, L = {
|
|
|
105
104
|
/* @__PURE__ */ ee("div", { className: It.uploadLoadingBodyText, children: `${n.t("uploadLoading.loading")}: ${e}` })
|
|
106
105
|
] }) });
|
|
107
106
|
};
|
|
108
|
-
var
|
|
109
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
110
|
-
(o = i[s]) && (r =
|
|
111
|
-
return
|
|
107
|
+
var hs = Object.getOwnPropertyDescriptor, gs = (i, n, e, t) => {
|
|
108
|
+
for (var r = t > 1 ? void 0 : t ? hs(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
109
|
+
(o = i[s]) && (r = o(r) || r);
|
|
110
|
+
return r;
|
|
112
111
|
}, we = (i, n) => (e, t) => n(e, t, i);
|
|
113
112
|
let Et = class extends Ur {
|
|
114
113
|
constructor(n, e, t, r, s, o, a, c) {
|
|
@@ -117,7 +116,7 @@ let Et = class extends Ur {
|
|
|
117
116
|
this._injector = n, this._drawingManagerService = e, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = a, this._commandService = c, this._init();
|
|
118
117
|
}
|
|
119
118
|
_init() {
|
|
120
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
119
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(Mn(this.dispose$)).subscribe((n) => this._create(n)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(Mn(this.dispose$)).subscribe((n) => this._dispose(n)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((n) => this._create(n)), this._uiPartsService.registerComponent(Ti.CONTENT, () => Ei(us, this._injector));
|
|
121
120
|
}
|
|
122
121
|
_dispose(n) {
|
|
123
122
|
const e = n.getUnitId();
|
|
@@ -132,7 +131,7 @@ let Et = class extends Ur {
|
|
|
132
131
|
_hasCropObject(n) {
|
|
133
132
|
const e = n.getAllObjectsByOrder();
|
|
134
133
|
for (const t of e)
|
|
135
|
-
if (t instanceof
|
|
134
|
+
if (t instanceof ai)
|
|
136
135
|
return !0;
|
|
137
136
|
return !1;
|
|
138
137
|
}
|
|
@@ -146,9 +145,9 @@ let Et = class extends Ur {
|
|
|
146
145
|
return;
|
|
147
146
|
let r;
|
|
148
147
|
this.disposeWithMe(
|
|
149
|
-
|
|
148
|
+
Pr(
|
|
150
149
|
t.createControl$.subscribe(() => {
|
|
151
|
-
if (this._contextService.setContextValue(
|
|
150
|
+
if (this._contextService.setContextValue(Le, !0), this._hasCropObject(e))
|
|
152
151
|
return;
|
|
153
152
|
const o = t.getSelectedObjectMap();
|
|
154
153
|
if (o.size > 1) {
|
|
@@ -167,7 +166,7 @@ let Et = class extends Ur {
|
|
|
167
166
|
r == null || r.dispose();
|
|
168
167
|
const p = this._canvasPopManagerService.getFeatureMenu(d, l, g, h);
|
|
169
168
|
r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
170
|
-
componentKey:
|
|
169
|
+
componentKey: ci,
|
|
171
170
|
direction: "horizontal",
|
|
172
171
|
offset: [2, 0],
|
|
173
172
|
extraProps: {
|
|
@@ -178,11 +177,11 @@ let Et = class extends Ur {
|
|
|
178
177
|
)
|
|
179
178
|
), this.disposeWithMe(
|
|
180
179
|
t.clearControl$.subscribe(() => {
|
|
181
|
-
r == null || r.dispose(), this._contextService.setContextValue(
|
|
180
|
+
r == null || r.dispose(), this._contextService.setContextValue(Le, !1), this._commandService.syncExecuteCommand(xt.id, []);
|
|
182
181
|
})
|
|
183
182
|
), this.disposeWithMe(
|
|
184
183
|
this._contextService.contextChanged$.subscribe((o) => {
|
|
185
|
-
o[
|
|
184
|
+
o[Le] === !1 && (r == null || r.dispose());
|
|
186
185
|
})
|
|
187
186
|
), this.disposeWithMe(
|
|
188
187
|
t.changing$.subscribe(() => {
|
|
@@ -197,7 +196,7 @@ let Et = class extends Ur {
|
|
|
197
196
|
index: 0,
|
|
198
197
|
commandId: hr.id,
|
|
199
198
|
commandParams: { unitId: n, subUnitId: e, drawingId: t },
|
|
200
|
-
disable: r ===
|
|
199
|
+
disable: r === L.DRAWING_DOM
|
|
201
200
|
},
|
|
202
201
|
{
|
|
203
202
|
label: "image-popup.delete",
|
|
@@ -209,35 +208,35 @@ let Et = class extends Ur {
|
|
|
209
208
|
{
|
|
210
209
|
label: "image-popup.crop",
|
|
211
210
|
index: 2,
|
|
212
|
-
commandId:
|
|
211
|
+
commandId: di.id,
|
|
213
212
|
commandParams: { unitId: n, subUnitId: e, drawingId: t },
|
|
214
|
-
disable: r ===
|
|
213
|
+
disable: r === L.DRAWING_DOM
|
|
215
214
|
},
|
|
216
215
|
{
|
|
217
216
|
label: "image-popup.reset",
|
|
218
217
|
index: 3,
|
|
219
|
-
commandId:
|
|
218
|
+
commandId: li.id,
|
|
220
219
|
commandParams: [{ unitId: n, subUnitId: e, drawingId: t }],
|
|
221
|
-
disable: r ===
|
|
220
|
+
disable: r === L.DRAWING_DOM
|
|
222
221
|
}
|
|
223
222
|
];
|
|
224
223
|
}
|
|
225
224
|
};
|
|
226
|
-
Et =
|
|
225
|
+
Et = gs([
|
|
227
226
|
we(0, N(tt)),
|
|
228
227
|
we(1, oe),
|
|
229
|
-
we(2, N(
|
|
228
|
+
we(2, N(pi)),
|
|
230
229
|
we(3, ne),
|
|
231
230
|
we(4, Ge),
|
|
232
231
|
we(5, Bn),
|
|
233
|
-
we(6, N(
|
|
232
|
+
we(6, N(yi)),
|
|
234
233
|
we(7, G)
|
|
235
234
|
], Et);
|
|
236
235
|
function z(i, n, e) {
|
|
237
236
|
const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: c = 0, skewY: u = 0 } = i, d = e.getCurrent();
|
|
238
237
|
if (d == null)
|
|
239
238
|
return;
|
|
240
|
-
const l =
|
|
239
|
+
const l = wi(
|
|
241
240
|
d.unitId,
|
|
242
241
|
d.sheetId,
|
|
243
242
|
{ from: t, to: r },
|
|
@@ -257,7 +256,7 @@ function z(i, n, e) {
|
|
|
257
256
|
height: p
|
|
258
257
|
};
|
|
259
258
|
}
|
|
260
|
-
function
|
|
259
|
+
function $(i, n) {
|
|
261
260
|
const { left: e = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: c = 0, skewX: u = 0, skewY: d = 0 } = i, l = n.getCellWithCoordByOffset(e, t);
|
|
262
261
|
if (l == null)
|
|
263
262
|
return;
|
|
@@ -285,10 +284,10 @@ function x(i, n) {
|
|
|
285
284
|
to: f
|
|
286
285
|
};
|
|
287
286
|
}
|
|
288
|
-
var
|
|
289
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
290
|
-
(o = i[s]) && (r =
|
|
291
|
-
return
|
|
287
|
+
var fs = Object.getOwnPropertyDescriptor, ms = (i, n, e, t) => {
|
|
288
|
+
for (var r = t > 1 ? void 0 : t ? fs(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
289
|
+
(o = i[s]) && (r = o(r) || r);
|
|
290
|
+
return r;
|
|
292
291
|
}, Ct = (i, n) => (e, t) => n(e, t, i);
|
|
293
292
|
let sn = class extends le {
|
|
294
293
|
constructor(i, n, e, t, r) {
|
|
@@ -310,13 +309,13 @@ let sn = class extends le {
|
|
|
310
309
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
311
310
|
}
|
|
312
311
|
};
|
|
313
|
-
sn =
|
|
312
|
+
sn = ms([
|
|
314
313
|
Ct(1, ae),
|
|
315
314
|
Ct(2, oe),
|
|
316
315
|
Ct(3, N(Xe)),
|
|
317
316
|
Ct(4, N(V))
|
|
318
317
|
], sn);
|
|
319
|
-
function
|
|
318
|
+
function ps(i) {
|
|
320
319
|
const n = [];
|
|
321
320
|
return i.forEach((e) => {
|
|
322
321
|
const { parent: t, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = t, c = fi(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
@@ -336,7 +335,7 @@ function Ss(i) {
|
|
|
336
335
|
unitId: s,
|
|
337
336
|
subUnitId: o,
|
|
338
337
|
drawingId: a,
|
|
339
|
-
drawingType:
|
|
338
|
+
drawingType: L.DRAWING_GROUP,
|
|
340
339
|
transform: c
|
|
341
340
|
};
|
|
342
341
|
n.push({
|
|
@@ -345,14 +344,14 @@ function Ss(i) {
|
|
|
345
344
|
});
|
|
346
345
|
}), n;
|
|
347
346
|
}
|
|
348
|
-
function
|
|
347
|
+
function ws(i) {
|
|
349
348
|
const n = [];
|
|
350
349
|
return i.forEach((e) => {
|
|
351
350
|
const { parent: t, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: c = { width: 0, height: 0 } } = t;
|
|
352
351
|
if (c == null)
|
|
353
352
|
return;
|
|
354
353
|
const u = r.map((l) => {
|
|
355
|
-
const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m =
|
|
354
|
+
const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m = gi(g || {}, c, c.width || 0, c.height || 0);
|
|
356
355
|
return {
|
|
357
356
|
unitId: h,
|
|
358
357
|
subUnitId: f,
|
|
@@ -364,7 +363,7 @@ function Is(i) {
|
|
|
364
363
|
unitId: s,
|
|
365
364
|
subUnitId: o,
|
|
366
365
|
drawingId: a,
|
|
367
|
-
drawingType:
|
|
366
|
+
drawingType: L.DRAWING_GROUP,
|
|
368
367
|
transform: {
|
|
369
368
|
left: 0,
|
|
370
369
|
top: 0
|
|
@@ -389,39 +388,39 @@ const gr = {
|
|
|
389
388
|
});
|
|
390
389
|
});
|
|
391
390
|
const o = r.getGroupDrawingOp(n), { unitId: a, subUnitId: c, undo: u, redo: d, objects: l } = o;
|
|
392
|
-
return e.syncExecuteCommand(
|
|
391
|
+
return e.syncExecuteCommand(A.id, { op: d, unitId: a, subUnitId: c, objects: l, type: P.GROUP }) ? (t.pushUndoRedo({
|
|
393
392
|
unitID: a,
|
|
394
393
|
undoMutations: [
|
|
395
|
-
{ id:
|
|
396
|
-
{ id:
|
|
394
|
+
{ id: A.id, params: { op: u, unitId: a, subUnitId: c, objects: ws(l), type: P.UNGROUP } },
|
|
395
|
+
{ id: x.id, params: s }
|
|
397
396
|
],
|
|
398
397
|
redoMutations: [
|
|
399
|
-
{ id:
|
|
400
|
-
{ id:
|
|
398
|
+
{ id: A.id, params: { op: d, unitId: a, subUnitId: c, objects: l, type: P.GROUP } },
|
|
399
|
+
{ id: x.id, params: s }
|
|
401
400
|
]
|
|
402
401
|
}), !0) : !1;
|
|
403
402
|
}
|
|
404
|
-
},
|
|
403
|
+
}, Ft = {
|
|
405
404
|
id: "sheet.command.insert-sheet-image",
|
|
406
405
|
type: te.COMMAND,
|
|
407
406
|
handler: (i, n) => {
|
|
408
407
|
var S, C, D;
|
|
409
|
-
const e = i.get(G), t = i.get(Ye), r = i.get(ae), s = i.get(
|
|
408
|
+
const e = i.get(G), t = i.get(Ye), r = i.get(ae), s = i.get(Lt);
|
|
410
409
|
if (!n) return !1;
|
|
411
|
-
const o = n.drawings, a = o.map((v) => v.unitId), c = r.getBatchAddOp(o), { unitId: u, subUnitId: d, undo: l, redo: g, objects: h } = c, f = s.onCommandExecute({ id:
|
|
412
|
-
return
|
|
410
|
+
const o = n.drawings, a = o.map((v) => v.unitId), c = r.getBatchAddOp(o), { unitId: u, subUnitId: d, undo: l, redo: g, objects: h } = c, f = s.onCommandExecute({ id: Ft.id, params: n }), p = { id: A.id, params: { op: g, unitId: u, subUnitId: d, objects: h, type: P.INSERT } }, m = { id: A.id, params: { op: l, unitId: u, subUnitId: d, objects: h, type: P.REMOVE } };
|
|
411
|
+
return kn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], e) ? (t.pushUndoRedo({
|
|
413
412
|
unitID: u,
|
|
414
413
|
undoMutations: [
|
|
415
414
|
...(C = f.preUndos) != null ? C : [],
|
|
416
415
|
m,
|
|
417
416
|
...f.undos,
|
|
418
|
-
{ id:
|
|
417
|
+
{ id: x.id, params: a }
|
|
419
418
|
],
|
|
420
419
|
redoMutations: [
|
|
421
420
|
...(D = f.preRedos) != null ? D : [],
|
|
422
421
|
p,
|
|
423
422
|
...f.redos,
|
|
424
|
-
{ id:
|
|
423
|
+
{ id: x.id, params: a }
|
|
425
424
|
]
|
|
426
425
|
}), !0) : !1;
|
|
427
426
|
}
|
|
@@ -436,13 +435,13 @@ const gr = {
|
|
|
436
435
|
if (c === mt.forward ? d = r.getForwardDrawingsOp(u) : c === mt.backward ? d = r.getBackwardDrawingOp(u) : c === mt.front ? d = r.getFrontDrawingsOp(u) : c === mt.back && (d = r.getBackDrawingsOp(u)), d == null)
|
|
437
436
|
return !1;
|
|
438
437
|
const { objects: l, redo: g, undo: h } = d;
|
|
439
|
-
return e.syncExecuteCommand(
|
|
438
|
+
return e.syncExecuteCommand(A.id, { op: g, unitId: s, subUnitId: o, objects: l, type: P.ARRANGE }) ? (t.pushUndoRedo({
|
|
440
439
|
unitID: s,
|
|
441
440
|
undoMutations: [
|
|
442
|
-
{ id:
|
|
441
|
+
{ id: A.id, params: { op: h, unitId: s, subUnitId: o, objects: l, type: P.ARRANGE } }
|
|
443
442
|
],
|
|
444
443
|
redoMutations: [
|
|
445
|
-
{ id:
|
|
444
|
+
{ id: A.id, params: { op: g, unitId: s, subUnitId: o, objects: l, type: P.ARRANGE } }
|
|
446
445
|
]
|
|
447
446
|
}), !0) : !1;
|
|
448
447
|
}
|
|
@@ -453,15 +452,15 @@ const gr = {
|
|
|
453
452
|
const e = i.get(G), t = i.get(Ye), r = i.get(ae);
|
|
454
453
|
if (!n) return !1;
|
|
455
454
|
const { drawings: s } = n, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: c, undo: u, redo: d, objects: l } = o;
|
|
456
|
-
return e.syncExecuteCommand(
|
|
455
|
+
return e.syncExecuteCommand(A.id, { unitId: a, subUnitId: c, op: d, objects: l, type: P.UPDATE }) ? (t.pushUndoRedo({
|
|
457
456
|
unitID: a,
|
|
458
457
|
undoMutations: [
|
|
459
|
-
{ id:
|
|
460
|
-
{ id:
|
|
458
|
+
{ id: A.id, params: { unitId: a, subUnitId: c, op: u, objects: l, type: P.UPDATE } },
|
|
459
|
+
{ id: x.id, params: [a] }
|
|
461
460
|
],
|
|
462
461
|
redoMutations: [
|
|
463
|
-
{ id:
|
|
464
|
-
{ id:
|
|
462
|
+
{ id: A.id, params: { unitId: a, subUnitId: c, op: d, objects: l, type: P.UPDATE } },
|
|
463
|
+
{ id: x.id, params: [a] }
|
|
465
464
|
]
|
|
466
465
|
}), !0) : !1;
|
|
467
466
|
}
|
|
@@ -478,31 +477,31 @@ const gr = {
|
|
|
478
477
|
});
|
|
479
478
|
});
|
|
480
479
|
const o = r.getUngroupDrawingOp(n), { unitId: a, subUnitId: c, undo: u, redo: d, objects: l } = o;
|
|
481
|
-
return e.syncExecuteCommand(
|
|
480
|
+
return e.syncExecuteCommand(A.id, { op: d, unitId: a, subUnitId: c, objects: l, type: P.UNGROUP }) ? (t.pushUndoRedo({
|
|
482
481
|
unitID: a,
|
|
483
482
|
undoMutations: [
|
|
484
|
-
{ id:
|
|
485
|
-
{ id:
|
|
483
|
+
{ id: A.id, params: { op: u, unitId: a, subUnitId: c, objects: ps(l), type: P.GROUP } },
|
|
484
|
+
{ id: x.id, params: s }
|
|
486
485
|
],
|
|
487
486
|
redoMutations: [
|
|
488
|
-
{ id:
|
|
489
|
-
{ id:
|
|
487
|
+
{ id: A.id, params: { op: d, unitId: a, subUnitId: c, objects: l, type: P.UNGROUP } },
|
|
488
|
+
{ id: x.id, params: s }
|
|
490
489
|
]
|
|
491
490
|
}), !0) : !1;
|
|
492
491
|
}
|
|
493
492
|
};
|
|
494
|
-
var
|
|
495
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
496
|
-
(o = i[s]) && (r =
|
|
497
|
-
return
|
|
493
|
+
var _s = Object.getOwnPropertyDescriptor, vs = (i, n, e, t) => {
|
|
494
|
+
for (var r = t > 1 ? void 0 : t ? _s(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
495
|
+
(o = i[s]) && (r = o(r) || r);
|
|
496
|
+
return r;
|
|
498
497
|
}, ie = (i, n) => (e, t) => n(e, t, i);
|
|
499
|
-
function
|
|
498
|
+
function Ss(i, n, e) {
|
|
500
499
|
const t = e * Math.PI / 180, r = Math.abs(i * Math.cos(t)) + Math.abs(n * Math.sin(t)), s = Math.abs(i * Math.sin(t)) + Math.abs(n * Math.cos(t));
|
|
501
500
|
return { rotatedWidth: r, rotatedHeight: s };
|
|
502
501
|
}
|
|
503
502
|
function pr(i, n, e, t, r) {
|
|
504
503
|
var S;
|
|
505
|
-
const { rotatedHeight: s, rotatedWidth: o } =
|
|
504
|
+
const { rotatedHeight: s, rotatedWidth: o } = Ss(e, t, r), c = i.get(ne).getRenderById(n.unitId);
|
|
506
505
|
if (!c)
|
|
507
506
|
return !1;
|
|
508
507
|
const d = (S = c.with(V).getSkeletonParam(n.subUnitId)) == null ? void 0 : S.skeleton;
|
|
@@ -570,13 +569,13 @@ let et = class extends le {
|
|
|
570
569
|
unitId: r,
|
|
571
570
|
subUnitId: s,
|
|
572
571
|
drawingId: o,
|
|
573
|
-
drawingType:
|
|
572
|
+
drawingType: L.DRAWING_IMAGE,
|
|
574
573
|
imageSourceType: a,
|
|
575
574
|
source: c,
|
|
576
575
|
transform: z(m, this._selectionRenderService, this._skeletonManagerService),
|
|
577
576
|
sheetTransform: m
|
|
578
577
|
};
|
|
579
|
-
return this._commandService.executeCommand(
|
|
578
|
+
return this._commandService.executeCommand(Ft.id, {
|
|
580
579
|
unitId: r,
|
|
581
580
|
drawings: [w]
|
|
582
581
|
});
|
|
@@ -606,7 +605,7 @@ let et = class extends le {
|
|
|
606
605
|
const d = this._workbookSelections.getCurrentLastSelection();
|
|
607
606
|
if (!d)
|
|
608
607
|
return !1;
|
|
609
|
-
const l =
|
|
608
|
+
const l = Ar("", {}), g = pr(
|
|
610
609
|
this._injector,
|
|
611
610
|
{
|
|
612
611
|
unitId: this._context.unitId,
|
|
@@ -626,11 +625,11 @@ let et = class extends le {
|
|
|
626
625
|
height: g.height
|
|
627
626
|
},
|
|
628
627
|
positionH: {
|
|
629
|
-
relativeFrom:
|
|
628
|
+
relativeFrom: kr.PAGE,
|
|
630
629
|
posOffset: 0
|
|
631
630
|
},
|
|
632
631
|
positionV: {
|
|
633
|
-
relativeFrom:
|
|
632
|
+
relativeFrom: Nr.PARAGRAPH,
|
|
634
633
|
posOffset: 0
|
|
635
634
|
},
|
|
636
635
|
angle: 0
|
|
@@ -638,22 +637,22 @@ let et = class extends le {
|
|
|
638
637
|
unitId: l.getUnitId(),
|
|
639
638
|
subUnitId: l.getUnitId(),
|
|
640
639
|
drawingId: t,
|
|
641
|
-
drawingType:
|
|
640
|
+
drawingType: L.DRAWING_IMAGE,
|
|
642
641
|
imageSourceType: r,
|
|
643
642
|
source: s,
|
|
644
|
-
transform:
|
|
643
|
+
transform: rs(h),
|
|
645
644
|
docTransform: h,
|
|
646
|
-
behindDoc:
|
|
645
|
+
behindDoc: jr.FALSE,
|
|
647
646
|
title: "",
|
|
648
647
|
description: "",
|
|
649
|
-
layoutType:
|
|
648
|
+
layoutType: Wr.INLINE,
|
|
650
649
|
// Insert inline drawing by default.
|
|
651
|
-
wrapText:
|
|
650
|
+
wrapText: Br.BOTH_SIDES,
|
|
652
651
|
distB: 0,
|
|
653
652
|
distL: 0,
|
|
654
653
|
distR: 0,
|
|
655
654
|
distT: 0
|
|
656
|
-
}, p =
|
|
655
|
+
}, p = $r.drawing.add({
|
|
657
656
|
documentDataModel: l,
|
|
658
657
|
drawings: [f],
|
|
659
658
|
selection: {
|
|
@@ -662,7 +661,7 @@ let et = class extends le {
|
|
|
662
661
|
endOffset: 0
|
|
663
662
|
}
|
|
664
663
|
});
|
|
665
|
-
return p ? (l.apply(p), this._commandService.syncExecuteCommand(
|
|
664
|
+
return p ? (l.apply(p), this._commandService.syncExecuteCommand(xi.id, {
|
|
666
665
|
value: {
|
|
667
666
|
[d.primary.actualRow]: {
|
|
668
667
|
[d.primary.actualColumn]: {
|
|
@@ -689,7 +688,7 @@ let et = class extends le {
|
|
|
689
688
|
endColumn: 0
|
|
690
689
|
};
|
|
691
690
|
s && s.length > 0 && (o = s[s.length - 1].range);
|
|
692
|
-
const a =
|
|
691
|
+
const a = xn(this._skeletonManagerService.getCurrent().skeleton, o);
|
|
693
692
|
if (a == null)
|
|
694
693
|
return;
|
|
695
694
|
let { startColumn: c, startRow: u, startX: d, startY: l } = a, g = !1;
|
|
@@ -739,7 +738,7 @@ let et = class extends le {
|
|
|
739
738
|
const u = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
|
|
740
739
|
if (u == null || u.unitId !== this._context.unitId)
|
|
741
740
|
return;
|
|
742
|
-
const d =
|
|
741
|
+
const d = $({ ...u.transform, ...c }, this._selectionRenderService);
|
|
743
742
|
if (d == null)
|
|
744
743
|
return;
|
|
745
744
|
const l = {
|
|
@@ -758,7 +757,7 @@ let et = class extends le {
|
|
|
758
757
|
this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((n) => {
|
|
759
758
|
this._commandService.executeCommand(gr.id, n);
|
|
760
759
|
const { unitId: e, subUnitId: t, drawingId: r } = n[0].parent;
|
|
761
|
-
this._commandService.syncExecuteCommand(
|
|
760
|
+
this._commandService.syncExecuteCommand(xt.id, [{ unitId: e, subUnitId: t, drawingId: r }]);
|
|
762
761
|
})), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((n) => {
|
|
763
762
|
this._commandService.executeCommand(mr.id, n);
|
|
764
763
|
}));
|
|
@@ -766,29 +765,29 @@ let et = class extends le {
|
|
|
766
765
|
_focusDrawingListener() {
|
|
767
766
|
this.disposeWithMe(
|
|
768
767
|
this._drawingManagerService.focus$.subscribe((n) => {
|
|
769
|
-
n == null || n.length === 0 ? (this._contextService.setContextValue(
|
|
768
|
+
n == null || n.length === 0 ? (this._contextService.setContextValue(Le, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(Le, !0), this._sheetDrawingService.focusDrawing(n));
|
|
770
769
|
})
|
|
771
770
|
);
|
|
772
771
|
}
|
|
773
772
|
};
|
|
774
|
-
et =
|
|
773
|
+
et = vs([
|
|
775
774
|
ie(1, N(V)),
|
|
776
775
|
ie(2, G),
|
|
777
776
|
ie(3, Xe),
|
|
778
777
|
ie(4, Wn),
|
|
779
|
-
ie(5,
|
|
778
|
+
ie(5, Oi),
|
|
780
779
|
ie(6, ae),
|
|
781
780
|
ie(7, oe),
|
|
782
781
|
ie(8, Bn),
|
|
783
782
|
ie(9, Ui),
|
|
784
|
-
ie(10, N(
|
|
783
|
+
ie(10, N($t)),
|
|
785
784
|
ie(11, N(dn)),
|
|
786
785
|
ie(12, N(tt))
|
|
787
786
|
], et);
|
|
788
|
-
var
|
|
789
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
790
|
-
(o = i[s]) && (r =
|
|
791
|
-
return
|
|
787
|
+
var Is = Object.getOwnPropertyDescriptor, Cs = (i, n, e, t) => {
|
|
788
|
+
for (var r = t > 1 ? void 0 : t ? Is(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
789
|
+
(o = i[s]) && (r = o(r) || r);
|
|
790
|
+
return r;
|
|
792
791
|
}, De = (i, n) => (e, t) => n(e, t, i);
|
|
793
792
|
function on(i, n, e) {
|
|
794
793
|
var t, r, s, o;
|
|
@@ -817,13 +816,13 @@ let Ot = class extends le {
|
|
|
817
816
|
_initHandleResize() {
|
|
818
817
|
this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
819
818
|
let n, e = [];
|
|
820
|
-
if (i.id ===
|
|
819
|
+
if (i.id === Fn.id) {
|
|
821
820
|
const t = i.params;
|
|
822
821
|
e = t.ranges, n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
823
822
|
} else if (i.id === Yn.id) {
|
|
824
823
|
const t = i.params;
|
|
825
824
|
e = t.ranges, n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
826
|
-
} else if (i.id ===
|
|
825
|
+
} else if (i.id === Li.id) {
|
|
827
826
|
const t = i.params;
|
|
828
827
|
e = t.ranges, n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
829
828
|
} else if (i.id === Gn.id) {
|
|
@@ -834,15 +833,15 @@ let Ot = class extends le {
|
|
|
834
833
|
startColumn: 0,
|
|
835
834
|
endColumn: 9999
|
|
836
835
|
}));
|
|
837
|
-
} else if (i.id ===
|
|
836
|
+
} else if (i.id === Fi.id) {
|
|
838
837
|
const t = i.params;
|
|
839
838
|
e = t.ranges, n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
840
|
-
} else if (i.id ===
|
|
839
|
+
} else if (i.id === Yi.id) {
|
|
841
840
|
const t = i.params;
|
|
842
841
|
e = t.ranges, n = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
843
842
|
}
|
|
844
843
|
n && e.length && e.forEach((t) => {
|
|
845
|
-
const r =
|
|
844
|
+
const r = xr.transformRange(t, n.worksheet);
|
|
846
845
|
for (let s = r.startRow; s <= r.endRow; s++)
|
|
847
846
|
for (let o = r.startColumn; o <= r.endColumn; o++)
|
|
848
847
|
on(this._injector, { unitId: n.unitId, subUnitId: n.subUnitId, row: s, col: o }, n.worksheet.getCellRaw(s, o));
|
|
@@ -853,11 +852,11 @@ let Ot = class extends le {
|
|
|
853
852
|
this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
|
|
854
853
|
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(pt), this._docDrawingController.loadDrawingDataForUnit(pt), this._drawingManagerService.initializeNotification(pt)) : this._drawingManagerService.removeDrawingDataForUnit(pt);
|
|
855
854
|
})), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
856
|
-
i.id ===
|
|
855
|
+
i.id === is.id && i.params.unitId === wt && (this._drawingManagerService.removeDrawingDataForUnit(wt), this._docDrawingController.loadDrawingDataForUnit(wt), this._drawingManagerService.initializeNotification(wt));
|
|
857
856
|
}));
|
|
858
857
|
}
|
|
859
858
|
_handleWriteCell() {
|
|
860
|
-
this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
859
|
+
this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(Gi, {
|
|
861
860
|
priority: 9999,
|
|
862
861
|
handler: (i, n, e) => (on(this._injector, { unitId: n.unitId, subUnitId: n.subUnitId, row: n.row, col: n.col }, i), e(i))
|
|
863
862
|
}));
|
|
@@ -865,10 +864,10 @@ let Ot = class extends le {
|
|
|
865
864
|
_initCellContentInterceptor() {
|
|
866
865
|
this.disposeWithMe(
|
|
867
866
|
this._sheetInterceptorService.intercept(
|
|
868
|
-
|
|
867
|
+
Xi.CELL_CONTENT,
|
|
869
868
|
{
|
|
870
|
-
effect:
|
|
871
|
-
priority:
|
|
869
|
+
effect: Lr.Style,
|
|
870
|
+
priority: Vi.CELL_IMAGE,
|
|
872
871
|
handler: (i, n, e) => {
|
|
873
872
|
var t;
|
|
874
873
|
return i != null && i.p && ((t = i.p.drawingsOrder) != null && t.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }), e(i);
|
|
@@ -878,21 +877,21 @@ let Ot = class extends le {
|
|
|
878
877
|
);
|
|
879
878
|
}
|
|
880
879
|
};
|
|
881
|
-
Ot =
|
|
880
|
+
Ot = Cs([
|
|
882
881
|
De(0, G),
|
|
883
|
-
De(1, N(
|
|
882
|
+
De(1, N(Lt)),
|
|
884
883
|
De(2, Ge),
|
|
885
884
|
De(3, N(tt)),
|
|
886
885
|
De(4, oe),
|
|
887
|
-
De(5, N(
|
|
888
|
-
De(6, N(
|
|
886
|
+
De(5, N(ri)),
|
|
887
|
+
De(6, N(_i))
|
|
889
888
|
], Ot);
|
|
890
|
-
var
|
|
891
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
892
|
-
(o = i[s]) && (r =
|
|
893
|
-
return
|
|
889
|
+
var bs = Object.getOwnPropertyDescriptor, Rs = (i, n, e, t) => {
|
|
890
|
+
for (var r = t > 1 ? void 0 : t ? bs(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
891
|
+
(o = i[s]) && (r = o(r) || r);
|
|
892
|
+
return r;
|
|
894
893
|
}, An = (i, n) => (e, t) => n(e, t, i);
|
|
895
|
-
let
|
|
894
|
+
let Ut = class extends le {
|
|
896
895
|
constructor(i, n) {
|
|
897
896
|
super(), this._autoFillService = i, this._injector = n, this._initAutoFillHooks();
|
|
898
897
|
}
|
|
@@ -901,7 +900,7 @@ let Pt = class extends le {
|
|
|
901
900
|
this._autoFillService.addHook({
|
|
902
901
|
id: "sheet-cell-image-autofill",
|
|
903
902
|
onBeforeSubmit: (i, n, e, t) => {
|
|
904
|
-
new
|
|
903
|
+
new Fr(t).forValue((r, s, o) => {
|
|
905
904
|
on(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
|
|
906
905
|
});
|
|
907
906
|
}
|
|
@@ -909,16 +908,16 @@ let Pt = class extends le {
|
|
|
909
908
|
);
|
|
910
909
|
}
|
|
911
910
|
};
|
|
912
|
-
|
|
913
|
-
An(0, N(
|
|
911
|
+
Ut = Rs([
|
|
912
|
+
An(0, N(vi)),
|
|
914
913
|
An(1, N(tt))
|
|
915
|
-
],
|
|
916
|
-
var
|
|
917
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
918
|
-
(o = i[s]) && (r =
|
|
919
|
-
return
|
|
914
|
+
], Ut);
|
|
915
|
+
var Ds = Object.getOwnPropertyDescriptor, Ms = (i, n, e, t) => {
|
|
916
|
+
for (var r = t > 1 ? void 0 : t ? Ds(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
917
|
+
(o = i[s]) && (r = o(r) || r);
|
|
918
|
+
return r;
|
|
920
919
|
}, bt = (i, n) => (e, t) => n(e, t, i);
|
|
921
|
-
let
|
|
920
|
+
let Pt = class extends le {
|
|
922
921
|
constructor(n, e, t, r) {
|
|
923
922
|
super();
|
|
924
923
|
Q(this, "_isSetCursor", !1);
|
|
@@ -929,18 +928,18 @@ let Ut = class extends le {
|
|
|
929
928
|
_initImageClick() {
|
|
930
929
|
}
|
|
931
930
|
};
|
|
932
|
-
|
|
933
|
-
bt(0, N(
|
|
931
|
+
Pt = Ms([
|
|
932
|
+
bt(0, N(Si)),
|
|
934
933
|
bt(1, N(ne)),
|
|
935
934
|
bt(2, N(dn)),
|
|
936
|
-
bt(3, N(
|
|
937
|
-
],
|
|
935
|
+
bt(3, N(jn))
|
|
936
|
+
], Pt);
|
|
938
937
|
const Gt = {
|
|
939
938
|
id: "sheet.command.insert-float-image",
|
|
940
939
|
type: te.COMMAND,
|
|
941
940
|
handler: async (i, n) => {
|
|
942
941
|
var s, o;
|
|
943
|
-
const t = (s = i.get(ne).getCurrentTypeOfRenderer(
|
|
942
|
+
const t = (s = i.get(ne).getCurrentTypeOfRenderer(F.UNIVER_SHEET)) == null ? void 0 : s.with(et);
|
|
944
943
|
if (!t)
|
|
945
944
|
return !1;
|
|
946
945
|
const r = n == null ? void 0 : n.files;
|
|
@@ -955,28 +954,28 @@ const Gt = {
|
|
|
955
954
|
type: te.COMMAND,
|
|
956
955
|
handler: (i) => {
|
|
957
956
|
var e, t;
|
|
958
|
-
return (t = (e = i.get(ne).getCurrentTypeOfRenderer(
|
|
957
|
+
return (t = (e = i.get(ne).getCurrentTypeOfRenderer(F.UNIVER_SHEET)) == null ? void 0 : e.with(et).insertCellImage()) != null ? t : !1;
|
|
959
958
|
}
|
|
960
959
|
};
|
|
961
|
-
var
|
|
962
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
963
|
-
(o = i[s]) && (r =
|
|
964
|
-
return
|
|
960
|
+
var ys = Object.getOwnPropertyDescriptor, Ts = (i, n, e, t) => {
|
|
961
|
+
for (var r = t > 1 ? void 0 : t ? ys(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
962
|
+
(o = i[s]) && (r = o(r) || r);
|
|
963
|
+
return r;
|
|
965
964
|
}, Je = (i, n) => (e, t) => n(e, t, i);
|
|
966
965
|
const wr = "image/png";
|
|
967
|
-
function
|
|
966
|
+
function Es(i) {
|
|
968
967
|
const n = i.split(","), e = atob(n[1]), t = e.length, r = new Uint8Array(t);
|
|
969
968
|
for (let s = 0; s < t; s++)
|
|
970
969
|
r[s] = e.charCodeAt(s);
|
|
971
970
|
return new Blob([r], { type: wr });
|
|
972
971
|
}
|
|
973
|
-
function
|
|
974
|
-
const n = new ClipboardItem({ [wr]:
|
|
972
|
+
function Os(i) {
|
|
973
|
+
const n = new ClipboardItem({ [wr]: Es(i) });
|
|
975
974
|
navigator.clipboard.write([n]).catch((e) => {
|
|
976
975
|
console.error("Could not copy image using clipboard API: ", e);
|
|
977
976
|
});
|
|
978
977
|
}
|
|
979
|
-
function
|
|
978
|
+
function Us() {
|
|
980
979
|
function i() {
|
|
981
980
|
const t = document.createElement("input");
|
|
982
981
|
return t.style.position = "absolute", t.style.height = "1px", t.style.width = "1px", t.style.opacity = "0", t;
|
|
@@ -987,10 +986,10 @@ function Ls() {
|
|
|
987
986
|
};
|
|
988
987
|
}
|
|
989
988
|
const Nn = [
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
989
|
+
xe.SPECIAL_PASTE_COL_WIDTH,
|
|
990
|
+
xe.SPECIAL_PASTE_VALUE,
|
|
991
|
+
xe.SPECIAL_PASTE_FORMAT,
|
|
992
|
+
xe.SPECIAL_PASTE_FORMULA
|
|
994
993
|
];
|
|
995
994
|
let At = class extends le {
|
|
996
995
|
constructor(n, e, t, r, s) {
|
|
@@ -1017,8 +1016,8 @@ let At = class extends le {
|
|
|
1017
1016
|
this._commandService.executeCommand(nt.id, c);
|
|
1018
1017
|
}
|
|
1019
1018
|
setTimeout(() => {
|
|
1020
|
-
const c =
|
|
1021
|
-
o.drawingType ===
|
|
1019
|
+
const c = Us();
|
|
1020
|
+
o.drawingType === L.DRAWING_IMAGE && o.imageSourceType === si.BASE64 ? Os(o.source) : this._clipboardInterfaceService.writeText(""), c();
|
|
1022
1021
|
}, 200);
|
|
1023
1022
|
const a = {
|
|
1024
1023
|
unitId: o.unitId,
|
|
@@ -1038,10 +1037,10 @@ let At = class extends le {
|
|
|
1038
1037
|
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: d, pasteRange: c }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, be.COPY);
|
|
1039
1038
|
},
|
|
1040
1039
|
onPastePlainText: (n, e) => ({ undos: [], redos: [] }),
|
|
1041
|
-
onPasteUnrecognized: (n) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: n, pasteType:
|
|
1040
|
+
onPasteUnrecognized: (n) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: n, pasteType: xe.DEFAULT_PASTE }, be.COPY) : { undos: [], redos: [] },
|
|
1042
1041
|
onPasteFiles: (n, e) => {
|
|
1043
1042
|
if (this._copyInfo)
|
|
1044
|
-
return this._generateSingleDrawingPasteMutations({ pasteTo: n, pasteType:
|
|
1043
|
+
return this._generateSingleDrawingPasteMutations({ pasteTo: n, pasteType: xe.DEFAULT_PASTE }, be.COPY);
|
|
1045
1044
|
{
|
|
1046
1045
|
const t = e.filter((r) => r.type.includes("image"));
|
|
1047
1046
|
if (t.length)
|
|
@@ -1069,7 +1068,7 @@ let At = class extends le {
|
|
|
1069
1068
|
const { startX: o, endX: a, startY: c, endY: u } = s, d = this._drawingService.getDrawingData(n, e), l = this._focusedDrawings.slice();
|
|
1070
1069
|
if (Object.keys(d).forEach((h) => {
|
|
1071
1070
|
const f = d[h], { transform: p } = f;
|
|
1072
|
-
if (f.anchorType !==
|
|
1071
|
+
if (f.anchorType !== U.Both || !p)
|
|
1073
1072
|
return;
|
|
1074
1073
|
const { left: m = 0, top: w = 0, width: S = 0, height: C = 0 } = p, { drawingStartX: D, drawingEndX: v, drawingStartY: b, drawingEndY: _ } = {
|
|
1075
1074
|
drawingStartX: m,
|
|
@@ -1112,7 +1111,7 @@ let At = class extends le {
|
|
|
1112
1111
|
};
|
|
1113
1112
|
return {
|
|
1114
1113
|
transform: w,
|
|
1115
|
-
sheetTransform: (S =
|
|
1114
|
+
sheetTransform: (S = $(w, d)) != null ? S : p
|
|
1116
1115
|
};
|
|
1117
1116
|
}
|
|
1118
1117
|
});
|
|
@@ -1139,27 +1138,27 @@ let At = class extends le {
|
|
|
1139
1138
|
if (o) {
|
|
1140
1139
|
const { undo: p, redo: m, objects: w } = u.getBatchUpdateOp([f]);
|
|
1141
1140
|
a.push({
|
|
1142
|
-
id:
|
|
1141
|
+
id: A.id,
|
|
1143
1142
|
params: {
|
|
1144
1143
|
unitId: t,
|
|
1145
1144
|
subUnitId: r,
|
|
1146
|
-
type:
|
|
1145
|
+
type: P.UPDATE,
|
|
1147
1146
|
op: m,
|
|
1148
1147
|
objects: w
|
|
1149
1148
|
}
|
|
1150
1149
|
}), c.push({
|
|
1151
|
-
id:
|
|
1150
|
+
id: A.id,
|
|
1152
1151
|
params: {
|
|
1153
1152
|
unitId: t,
|
|
1154
1153
|
subUnitId: r,
|
|
1155
|
-
type:
|
|
1154
|
+
type: P.UPDATE,
|
|
1156
1155
|
op: p,
|
|
1157
1156
|
objects: w
|
|
1158
1157
|
}
|
|
1159
1158
|
});
|
|
1160
1159
|
} else {
|
|
1161
1160
|
const { undo: p, redo: m, objects: w } = u.getBatchAddOp([f]);
|
|
1162
|
-
a.push({ id:
|
|
1161
|
+
a.push({ id: A.id, params: { op: m, unitId: t, subUnitId: r, objects: w, type: P.INSERT } }), c.push({ id: A.id, params: { op: p, unitId: t, subUnitId: r, objects: w, type: P.REMOVE } });
|
|
1163
1162
|
}
|
|
1164
1163
|
}), { redos: a, undos: c };
|
|
1165
1164
|
}
|
|
@@ -1186,7 +1185,7 @@ let At = class extends le {
|
|
|
1186
1185
|
pasteTo: { unitId: t, subUnitId: r, range: Rn(o) },
|
|
1187
1186
|
pasteType: s
|
|
1188
1187
|
}, c);
|
|
1189
|
-
const { ranges: [l, g], mapFunc: h } =
|
|
1188
|
+
const { ranges: [l, g], mapFunc: h } = Ii([a, o]), { row: f, col: p } = h(l.startRow, l.startColumn), { row: m, col: w } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
|
|
1190
1189
|
startRow: f,
|
|
1191
1190
|
endRow: f,
|
|
1192
1191
|
startColumn: p,
|
|
@@ -1230,24 +1229,24 @@ let At = class extends le {
|
|
|
1230
1229
|
});
|
|
1231
1230
|
}
|
|
1232
1231
|
};
|
|
1233
|
-
At =
|
|
1234
|
-
Je(0,
|
|
1232
|
+
At = Ts([
|
|
1233
|
+
Je(0, Ci),
|
|
1235
1234
|
Je(1, ne),
|
|
1236
1235
|
Je(2, oe),
|
|
1237
|
-
Je(3,
|
|
1236
|
+
Je(3, Pi),
|
|
1238
1237
|
Je(4, G)
|
|
1239
1238
|
], At);
|
|
1240
|
-
var
|
|
1241
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1242
|
-
(o = i[s]) && (r =
|
|
1243
|
-
return
|
|
1239
|
+
var Ps = Object.getOwnPropertyDescriptor, As = (i, n, e, t) => {
|
|
1240
|
+
for (var r = t > 1 ? void 0 : t ? Ps(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
1241
|
+
(o = i[s]) && (r = o(r) || r);
|
|
1242
|
+
return r;
|
|
1244
1243
|
}, qe = (i, n) => (e, t) => n(e, t, i);
|
|
1245
1244
|
let Nt = class extends le {
|
|
1246
1245
|
constructor(i, n, e, t, r) {
|
|
1247
1246
|
super(), this._drawingManagerService = i, this._renderManagerService = n, this._permissionService = e, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1248
1247
|
}
|
|
1249
1248
|
_initDrawingVisible() {
|
|
1250
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1249
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), n = this._userManagerService.currentUser$, e = St([i, n]);
|
|
1251
1250
|
this.disposeWithMe(
|
|
1252
1251
|
e.pipe(
|
|
1253
1252
|
Se(([t, r]) => t ? t.activeSheet$.pipe(
|
|
@@ -1259,7 +1258,7 @@ let Nt = class extends le {
|
|
|
1259
1258
|
const o = t.getUnitId(), a = s.getSheetId();
|
|
1260
1259
|
this._permissionService.composePermission([
|
|
1261
1260
|
new On(o).id,
|
|
1262
|
-
new
|
|
1261
|
+
new Un(o, a).id
|
|
1263
1262
|
]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(t, s);
|
|
1264
1263
|
})
|
|
1265
1264
|
) : (this._drawingManagerService.setDrawingVisible(!1), pe))
|
|
@@ -1276,7 +1275,7 @@ let Nt = class extends le {
|
|
|
1276
1275
|
});
|
|
1277
1276
|
}
|
|
1278
1277
|
_initDrawingEditable() {
|
|
1279
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1278
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), n = this._userManagerService.currentUser$, e = St([i, n]);
|
|
1280
1279
|
this.disposeWithMe(
|
|
1281
1280
|
e.pipe(
|
|
1282
1281
|
Se(([t, r]) => t ? t.activeSheet$.pipe(
|
|
@@ -1305,7 +1304,7 @@ let Nt = class extends le {
|
|
|
1305
1304
|
});
|
|
1306
1305
|
}
|
|
1307
1306
|
_initViewPermissionChange() {
|
|
1308
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1307
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), n = this._userManagerService.currentUser$;
|
|
1309
1308
|
this.disposeWithMe(
|
|
1310
1309
|
St([i, n]).pipe(
|
|
1311
1310
|
Se(([e, t]) => e ? e.activeSheet$.pipe(
|
|
@@ -1318,7 +1317,7 @@ let Nt = class extends le {
|
|
|
1318
1317
|
const u = c.getTransformerByCreate();
|
|
1319
1318
|
return this._permissionService.composePermission$([
|
|
1320
1319
|
new On(s).id,
|
|
1321
|
-
new
|
|
1320
|
+
new Un(s, o).id
|
|
1322
1321
|
]).pipe(
|
|
1323
1322
|
Ee((l) => l.every((g) => g.value)),
|
|
1324
1323
|
Tn()
|
|
@@ -1343,7 +1342,7 @@ let Nt = class extends le {
|
|
|
1343
1342
|
},
|
|
1344
1343
|
complete: () => {
|
|
1345
1344
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
1346
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
1345
|
+
const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET), t = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getUnitId(), s = t == null ? void 0 : t.getSheetId();
|
|
1347
1346
|
if (!r || !s)
|
|
1348
1347
|
return;
|
|
1349
1348
|
const o = this._drawingManagerService.getDrawingData(r, s), a = Object.values(o);
|
|
@@ -1353,7 +1352,7 @@ let Nt = class extends le {
|
|
|
1353
1352
|
);
|
|
1354
1353
|
}
|
|
1355
1354
|
_initEditPermissionChange() {
|
|
1356
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1355
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), n = this._userManagerService.currentUser$;
|
|
1357
1356
|
this.disposeWithMe(
|
|
1358
1357
|
St([i, n]).pipe(
|
|
1359
1358
|
Se(([e, t]) => e ? e.activeSheet$.pipe(
|
|
@@ -1392,7 +1391,7 @@ let Nt = class extends le {
|
|
|
1392
1391
|
}), r.clearSelectedObjects());
|
|
1393
1392
|
},
|
|
1394
1393
|
complete: () => {
|
|
1395
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
1394
|
+
const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET);
|
|
1396
1395
|
if (!e)
|
|
1397
1396
|
return;
|
|
1398
1397
|
const t = e.getUnitId(), r = e.getActiveSheet();
|
|
@@ -1410,19 +1409,19 @@ let Nt = class extends le {
|
|
|
1410
1409
|
);
|
|
1411
1410
|
}
|
|
1412
1411
|
};
|
|
1413
|
-
Nt =
|
|
1412
|
+
Nt = As([
|
|
1414
1413
|
qe(0, oe),
|
|
1415
1414
|
qe(1, ne),
|
|
1416
|
-
qe(2,
|
|
1415
|
+
qe(2, Yr),
|
|
1417
1416
|
qe(3, Ge),
|
|
1418
1417
|
qe(4, N(Gr))
|
|
1419
1418
|
], Nt);
|
|
1420
|
-
var
|
|
1421
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1422
|
-
(o = i[s]) && (r =
|
|
1423
|
-
return
|
|
1419
|
+
var Ns = Object.getOwnPropertyDescriptor, ks = (i, n, e, t) => {
|
|
1420
|
+
for (var r = t > 1 ? void 0 : t ? Ns(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
1421
|
+
(o = i[s]) && (r = o(r) || r);
|
|
1422
|
+
return r;
|
|
1424
1423
|
}, Rt = (i, n) => (e, t) => n(e, t, i);
|
|
1425
|
-
let
|
|
1424
|
+
let kt = class extends le {
|
|
1426
1425
|
constructor(i, n, e, t) {
|
|
1427
1426
|
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = n, this._drawingManagerService = e, this._renderManagerService = t, this._initPrinting();
|
|
1428
1427
|
}
|
|
@@ -1453,7 +1452,7 @@ let jt = class extends le {
|
|
|
1453
1452
|
const a = this._drawingManagerService.getDrawingDataForUnit(t), c = a == null ? void 0 : a[n.subUnitId];
|
|
1454
1453
|
if (!c)
|
|
1455
1454
|
return e(i);
|
|
1456
|
-
const { scaleX: u, scaleY: d } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = c.order.map((h) => c.data[h]).filter((h) => h.drawingType !==
|
|
1455
|
+
const { scaleX: u, scaleY: d } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = c.order.map((h) => c.data[h]).filter((h) => h.drawingType !== L.DRAWING_DOM);
|
|
1457
1456
|
return g.length ? (g.forEach((h) => {
|
|
1458
1457
|
if (!h.groupId && h.transform && ye.isDefine(h.transform.left) && ye.isDefine(h.transform.top) && ye.isDefine(h.transform.width) && ye.isDefine(h.transform.height)) {
|
|
1459
1458
|
const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, d, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, d, { x: 0, y: 0 });
|
|
@@ -1466,18 +1465,18 @@ let jt = class extends le {
|
|
|
1466
1465
|
);
|
|
1467
1466
|
}
|
|
1468
1467
|
};
|
|
1469
|
-
|
|
1470
|
-
Rt(0, N(
|
|
1471
|
-
Rt(1, N(
|
|
1468
|
+
kt = ks([
|
|
1469
|
+
Rt(0, N(bi)),
|
|
1470
|
+
Rt(1, N(jn)),
|
|
1472
1471
|
Rt(2, oe),
|
|
1473
1472
|
Rt(3, ne)
|
|
1474
|
-
],
|
|
1475
|
-
var
|
|
1476
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1477
|
-
(o = i[s]) && (r =
|
|
1478
|
-
return
|
|
1473
|
+
], kt);
|
|
1474
|
+
var Bs = Object.getOwnPropertyDescriptor, Ws = (i, n, e, t) => {
|
|
1475
|
+
for (var r = t > 1 ? void 0 : t ? Bs(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
1476
|
+
(o = i[s]) && (r = o(r) || r);
|
|
1477
|
+
return r;
|
|
1479
1478
|
}, _e = (i, n) => (e, t) => n(e, t, i);
|
|
1480
|
-
const
|
|
1479
|
+
const js = [
|
|
1481
1480
|
Xn.id,
|
|
1482
1481
|
Vn.id,
|
|
1483
1482
|
Hn.id,
|
|
@@ -1497,12 +1496,12 @@ const Zs = [
|
|
|
1497
1496
|
sr.id,
|
|
1498
1497
|
or.id,
|
|
1499
1498
|
ar.id
|
|
1500
|
-
],
|
|
1499
|
+
], $s = [
|
|
1500
|
+
Hi.id,
|
|
1501
1501
|
zi.id,
|
|
1502
1502
|
Ki.id,
|
|
1503
1503
|
Zi.id,
|
|
1504
|
-
|
|
1505
|
-
kn.id,
|
|
1504
|
+
Fn.id,
|
|
1506
1505
|
Yn.id
|
|
1507
1506
|
];
|
|
1508
1507
|
let an = class extends le {
|
|
@@ -1513,7 +1512,7 @@ let an = class extends le {
|
|
|
1513
1512
|
this.disposeWithMe(
|
|
1514
1513
|
this._sheetInterceptorService.interceptCommand({
|
|
1515
1514
|
getMutations: (i) => {
|
|
1516
|
-
if (!
|
|
1515
|
+
if (!js.includes(i.id))
|
|
1517
1516
|
return { redos: [], undos: [] };
|
|
1518
1517
|
if (i.params == null)
|
|
1519
1518
|
return { redos: [], undos: [] };
|
|
@@ -1583,19 +1582,19 @@ let an = class extends le {
|
|
|
1583
1582
|
return { redos: [], undos: [] };
|
|
1584
1583
|
if (c.length > 0) {
|
|
1585
1584
|
const d = this._sheetDrawingService.getBatchUpdateOp(c), { undo: l, redo: g, objects: h } = d;
|
|
1586
|
-
s.push({ id:
|
|
1585
|
+
s.push({ id: A.id, params: { unitId: t, subUnitId: r, op: g, objects: h, type: P.UPDATE } }), o.push({ id: A.id, params: { unitId: t, subUnitId: r, op: l, objects: h, type: P.UPDATE } });
|
|
1587
1586
|
}
|
|
1588
1587
|
if (u.length > 0) {
|
|
1589
1588
|
const d = this._sheetDrawingService.getBatchRemoveOp(u), l = d.undo, g = d.redo, h = d.objects;
|
|
1590
|
-
s.push({ id:
|
|
1589
|
+
s.push({ id: A.id, params: { unitId: t, subUnitId: r, op: g, objects: h, type: P.REMOVE } }), o.push({ id: A.id, params: { unitId: t, subUnitId: r, op: l, objects: h, type: P.INSERT } });
|
|
1591
1590
|
}
|
|
1592
|
-
return s.push({ id:
|
|
1591
|
+
return s.push({ id: x.id, params: [t] }), o.push({ id: x.id, params: [t] }), {
|
|
1593
1592
|
redos: s,
|
|
1594
1593
|
undos: o
|
|
1595
1594
|
};
|
|
1596
1595
|
}
|
|
1597
1596
|
_getUpdateOrDeleteDrawings(i, n, e) {
|
|
1598
|
-
const t = [], r = [], { sheetTransform: s, anchorType: o =
|
|
1597
|
+
const t = [], r = [], { sheetTransform: s, anchorType: o = U.Position, transform: a, unitId: c, subUnitId: u, drawingId: d } = e, { from: l, to: g } = s, { row: h, column: f } = l, { row: p, column: m } = g;
|
|
1599
1598
|
if (s == null || a == null)
|
|
1600
1599
|
return {
|
|
1601
1600
|
updateDrawings: t,
|
|
@@ -1631,7 +1630,7 @@ let an = class extends le {
|
|
|
1631
1630
|
return { updateDrawings: t, deleteDrawings: r };
|
|
1632
1631
|
}
|
|
1633
1632
|
_remainDrawingSize(i, n, e) {
|
|
1634
|
-
const t =
|
|
1633
|
+
const t = $({ ...i }, this._selectionRenderService);
|
|
1635
1634
|
t != null && n.push({
|
|
1636
1635
|
...e,
|
|
1637
1636
|
sheetTransform: t
|
|
@@ -1641,8 +1640,8 @@ let an = class extends le {
|
|
|
1641
1640
|
_getDrawingUndoForColVisible(i, n, e) {
|
|
1642
1641
|
const t = this._drawingManagerService.getDrawingData(i, n), r = [], s = [];
|
|
1643
1642
|
if (Object.keys(t).forEach((d) => {
|
|
1644
|
-
const l = t[d], { sheetTransform: g, transform: h, anchorType: f =
|
|
1645
|
-
if (f ===
|
|
1643
|
+
const l = t[d], { sheetTransform: g, transform: h, anchorType: f = U.Position } = l;
|
|
1644
|
+
if (f === U.None)
|
|
1646
1645
|
this._remainDrawingSize(h, r, l);
|
|
1647
1646
|
else {
|
|
1648
1647
|
const { from: p, to: m } = g, { row: w, column: S } = p, { row: C, column: D } = m;
|
|
@@ -1650,7 +1649,7 @@ let an = class extends le {
|
|
|
1650
1649
|
const b = e[v], { startRow: _, endRow: E, startColumn: M, endColumn: y } = b;
|
|
1651
1650
|
if (D < M)
|
|
1652
1651
|
continue;
|
|
1653
|
-
if (f ===
|
|
1652
|
+
if (f === U.Position) {
|
|
1654
1653
|
let R = null, O = null;
|
|
1655
1654
|
if (S >= M && S <= y) {
|
|
1656
1655
|
const B = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: y, startRow: p.row, endRow: m.row });
|
|
@@ -1658,7 +1657,7 @@ let an = class extends le {
|
|
|
1658
1657
|
return;
|
|
1659
1658
|
O = { ...h, left: B.startX };
|
|
1660
1659
|
}
|
|
1661
|
-
if (O != null && (R =
|
|
1660
|
+
if (O != null && (R = $(O, this._selectionRenderService), R != null && O != null)) {
|
|
1662
1661
|
r.push({ ...l, sheetTransform: R, transform: O });
|
|
1663
1662
|
break;
|
|
1664
1663
|
}
|
|
@@ -1692,12 +1691,12 @@ let an = class extends le {
|
|
|
1692
1691
|
if (I = {
|
|
1693
1692
|
...h,
|
|
1694
1693
|
width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
|
|
1695
|
-
}, T =
|
|
1694
|
+
}, T = $(I, this._selectionRenderService), T != null && I != null) {
|
|
1696
1695
|
s.push({ ...l, sheetTransform: T, transform: I });
|
|
1697
1696
|
break;
|
|
1698
1697
|
}
|
|
1699
1698
|
}
|
|
1700
|
-
if (I != null && (T =
|
|
1699
|
+
if (I != null && (T = $(I, this._selectionRenderService)), I != null && T != null) {
|
|
1701
1700
|
r.push({ ...l, sheetTransform: T, transform: I });
|
|
1702
1701
|
break;
|
|
1703
1702
|
} else
|
|
@@ -1720,11 +1719,11 @@ let an = class extends le {
|
|
|
1720
1719
|
}
|
|
1721
1720
|
_createUndoAndRedoMutation(i, n, e) {
|
|
1722
1721
|
const t = this._sheetDrawingService.getBatchUpdateOp(e), { undo: r, redo: s, objects: o } = t, a = [
|
|
1723
|
-
{ id:
|
|
1724
|
-
{ id:
|
|
1722
|
+
{ id: A.id, params: { unitId: i, subUnitId: n, op: s, objects: o, type: P.UPDATE } },
|
|
1723
|
+
{ id: x.id, params: [i] }
|
|
1725
1724
|
], c = [
|
|
1726
|
-
{ id:
|
|
1727
|
-
{ id:
|
|
1725
|
+
{ id: A.id, params: { unitId: i, subUnitId: n, op: r, objects: o, type: P.UPDATE } },
|
|
1726
|
+
{ id: x.id, params: [i] }
|
|
1728
1727
|
];
|
|
1729
1728
|
return {
|
|
1730
1729
|
redos: a,
|
|
@@ -1735,8 +1734,8 @@ let an = class extends le {
|
|
|
1735
1734
|
_getDrawingUndoForRowVisible(i, n, e) {
|
|
1736
1735
|
const t = this._drawingManagerService.getDrawingData(i, n), r = [], s = [];
|
|
1737
1736
|
if (Object.keys(t).forEach((d) => {
|
|
1738
|
-
const l = t[d], { sheetTransform: g, transform: h, anchorType: f =
|
|
1739
|
-
if (f ===
|
|
1737
|
+
const l = t[d], { sheetTransform: g, transform: h, anchorType: f = U.Position } = l;
|
|
1738
|
+
if (f === U.None)
|
|
1740
1739
|
this._remainDrawingSize(h, r, l);
|
|
1741
1740
|
else {
|
|
1742
1741
|
const { from: p, to: m } = g, { row: w, column: S } = p, { row: C, column: D } = m;
|
|
@@ -1744,7 +1743,7 @@ let an = class extends le {
|
|
|
1744
1743
|
const b = e[v], { startRow: _, endRow: E, startColumn: M, endColumn: y } = b;
|
|
1745
1744
|
if (C < _)
|
|
1746
1745
|
continue;
|
|
1747
|
-
if (f ===
|
|
1746
|
+
if (f === U.Position) {
|
|
1748
1747
|
let R = null, O = null;
|
|
1749
1748
|
if (w >= _ && w <= E) {
|
|
1750
1749
|
const B = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: E });
|
|
@@ -1752,7 +1751,7 @@ let an = class extends le {
|
|
|
1752
1751
|
return;
|
|
1753
1752
|
O = { ...h, top: B.startY };
|
|
1754
1753
|
}
|
|
1755
|
-
if (O != null && (R =
|
|
1754
|
+
if (O != null && (R = $(O, this._selectionRenderService), R != null && O != null)) {
|
|
1756
1755
|
r.push({ ...l, sheetTransform: R, transform: O });
|
|
1757
1756
|
break;
|
|
1758
1757
|
}
|
|
@@ -1786,12 +1785,12 @@ let an = class extends le {
|
|
|
1786
1785
|
if (I = {
|
|
1787
1786
|
...h,
|
|
1788
1787
|
height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
|
|
1789
|
-
}, T =
|
|
1788
|
+
}, T = $(I, this._selectionRenderService), T != null && I != null) {
|
|
1790
1789
|
s.push({ ...l, sheetTransform: T, transform: I });
|
|
1791
1790
|
break;
|
|
1792
1791
|
}
|
|
1793
1792
|
}
|
|
1794
|
-
if (I != null && (T =
|
|
1793
|
+
if (I != null && (T = $(I, this._selectionRenderService)), I != null && T != null) {
|
|
1795
1794
|
r.push({ ...l, sheetTransform: T, transform: I });
|
|
1796
1795
|
break;
|
|
1797
1796
|
} else
|
|
@@ -1815,8 +1814,8 @@ let an = class extends le {
|
|
|
1815
1814
|
_getDrawingUndoForRowAndColSize(i, n, e, t) {
|
|
1816
1815
|
const r = this._drawingManagerService.getDrawingData(i, n), s = [];
|
|
1817
1816
|
return Object.keys(r).forEach((o) => {
|
|
1818
|
-
const a = r[o], { sheetTransform: c, transform: u, anchorType: d =
|
|
1819
|
-
if (d ===
|
|
1817
|
+
const a = r[o], { sheetTransform: c, transform: u, anchorType: d = U.Position } = a;
|
|
1818
|
+
if (d === U.None)
|
|
1820
1819
|
this._remainDrawingSize(u, s, a);
|
|
1821
1820
|
else {
|
|
1822
1821
|
const { from: l, to: g } = c, { row: h, column: f } = l, { row: p, column: m } = g;
|
|
@@ -1824,7 +1823,7 @@ let an = class extends le {
|
|
|
1824
1823
|
const S = e[w], { startRow: C, endRow: D, startColumn: v, endColumn: b } = S;
|
|
1825
1824
|
if (p < C || m < v)
|
|
1826
1825
|
continue;
|
|
1827
|
-
if (d ===
|
|
1826
|
+
if (d === U.Position && (h <= C && p >= D || f <= v && m >= b)) {
|
|
1828
1827
|
this._remainDrawingSize(u, s, a);
|
|
1829
1828
|
continue;
|
|
1830
1829
|
}
|
|
@@ -1864,13 +1863,13 @@ let an = class extends le {
|
|
|
1864
1863
|
const { unitId: r, subUnitId: s } = t, o = (D = (C = this._renderManagerService.getRenderById(r)) == null ? void 0 : C.with(V)) == null ? void 0 : D.getCurrentSkeleton();
|
|
1865
1864
|
if (!o)
|
|
1866
1865
|
return { redos: [], undos: [] };
|
|
1867
|
-
const a =
|
|
1866
|
+
const a = xn(o, e);
|
|
1868
1867
|
if (!a)
|
|
1869
1868
|
return { redos: [], undos: [] };
|
|
1870
1869
|
const { startX: c, endX: u, startY: d, endY: l } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
|
|
1871
1870
|
Object.keys(g).forEach((v) => {
|
|
1872
1871
|
const b = g[v];
|
|
1873
|
-
if (b.anchorType !==
|
|
1872
|
+
if (b.anchorType !== U.Both)
|
|
1874
1873
|
return;
|
|
1875
1874
|
const { transform: _ } = b;
|
|
1876
1875
|
if (!_)
|
|
@@ -1898,7 +1897,7 @@ let an = class extends le {
|
|
|
1898
1897
|
});
|
|
1899
1898
|
if (S.length) {
|
|
1900
1899
|
const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: b, redo: _, objects: E } = v;
|
|
1901
|
-
f.push({ id:
|
|
1900
|
+
f.push({ id: A.id, params: { unitId: r, subUnitId: s, op: _, objects: E, type: P.UPDATE } }), p.push({ id: A.id, params: { unitId: r, subUnitId: s, op: b, objects: E, type: P.UPDATE } });
|
|
1902
1901
|
}
|
|
1903
1902
|
return { redos: f, undos: p };
|
|
1904
1903
|
}
|
|
@@ -1908,7 +1907,7 @@ let an = class extends le {
|
|
|
1908
1907
|
return { redos: [], undos: [] };
|
|
1909
1908
|
const { unitId: t, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow, c = [], u = [], d = this._sheetDrawingService.getDrawingData(t, r), l = [], g = [];
|
|
1910
1909
|
if (Object.keys(d).forEach((h) => {
|
|
1911
|
-
const f = d[h], { sheetTransform: p, transform: m, anchorType: w =
|
|
1910
|
+
const f = d[h], { sheetTransform: p, transform: m, anchorType: w = U.Position } = f;
|
|
1912
1911
|
if (p == null || m == null)
|
|
1913
1912
|
return;
|
|
1914
1913
|
let S, C;
|
|
@@ -1917,7 +1916,7 @@ let an = class extends le {
|
|
|
1917
1916
|
S = v == null ? void 0 : v.newSheetTransform, C = v == null ? void 0 : v.newTransform;
|
|
1918
1917
|
} else {
|
|
1919
1918
|
const { from: v, to: b } = p, { row: _ } = v, { row: E } = b;
|
|
1920
|
-
if (w ===
|
|
1919
|
+
if (w === U.Both && _ >= o && E <= a)
|
|
1921
1920
|
g.push({ unitId: t, subUnitId: r, drawingId: h });
|
|
1922
1921
|
else {
|
|
1923
1922
|
const M = this._shrinkRow(p, m, o, a, w);
|
|
@@ -1932,13 +1931,13 @@ let an = class extends le {
|
|
|
1932
1931
|
return { redos: [], undos: [] };
|
|
1933
1932
|
if (l.length > 0) {
|
|
1934
1933
|
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
|
|
1935
|
-
c.push({ id:
|
|
1934
|
+
c.push({ id: A.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: P.UPDATE } }), u.push({ id: A.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: P.UPDATE } });
|
|
1936
1935
|
}
|
|
1937
1936
|
if (g.length > 0) {
|
|
1938
1937
|
const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
|
|
1939
|
-
c.push({ id:
|
|
1938
|
+
c.push({ id: A.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: P.REMOVE } }), u.push({ id: A.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: P.INSERT } });
|
|
1940
1939
|
}
|
|
1941
|
-
return c.push({ id:
|
|
1940
|
+
return c.push({ id: x.id, params: [t] }), u.push({ id: x.id, params: [t] }), {
|
|
1942
1941
|
redos: c,
|
|
1943
1942
|
undos: u
|
|
1944
1943
|
};
|
|
@@ -1949,7 +1948,7 @@ let an = class extends le {
|
|
|
1949
1948
|
return { redos: [], undos: [] };
|
|
1950
1949
|
const { unitId: t, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn, c = [], u = [], d = this._sheetDrawingService.getDrawingData(t, r), l = [], g = [];
|
|
1951
1950
|
if (Object.keys(d).forEach((h) => {
|
|
1952
|
-
const f = d[h], { sheetTransform: p, transform: m, anchorType: w =
|
|
1951
|
+
const f = d[h], { sheetTransform: p, transform: m, anchorType: w = U.Position } = f;
|
|
1953
1952
|
if (p == null || m == null)
|
|
1954
1953
|
return;
|
|
1955
1954
|
let S, C;
|
|
@@ -1958,7 +1957,7 @@ let an = class extends le {
|
|
|
1958
1957
|
S = v == null ? void 0 : v.newSheetTransform, C = v == null ? void 0 : v.newTransform;
|
|
1959
1958
|
} else {
|
|
1960
1959
|
const { from: v, to: b } = p, { column: _ } = v, { column: E } = b;
|
|
1961
|
-
if (w ===
|
|
1960
|
+
if (w === U.Both && _ >= o && E <= a)
|
|
1962
1961
|
g.push({ unitId: t, subUnitId: r, drawingId: h });
|
|
1963
1962
|
else {
|
|
1964
1963
|
const M = this._shrinkCol(p, m, o, a, w);
|
|
@@ -1973,19 +1972,19 @@ let an = class extends le {
|
|
|
1973
1972
|
return { redos: [], undos: [] };
|
|
1974
1973
|
if (l.length > 0) {
|
|
1975
1974
|
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
|
|
1976
|
-
c.push({ id:
|
|
1975
|
+
c.push({ id: A.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: P.UPDATE } }), u.push({ id: A.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: P.UPDATE } });
|
|
1977
1976
|
}
|
|
1978
1977
|
if (g.length > 0) {
|
|
1979
1978
|
const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
|
|
1980
|
-
c.push({ id:
|
|
1979
|
+
c.push({ id: A.id, params: { unitId: t, subUnitId: r, op: p, objects: m, type: P.REMOVE } }), u.push({ id: A.id, params: { unitId: t, subUnitId: r, op: f, objects: m, type: P.INSERT } });
|
|
1981
1980
|
}
|
|
1982
|
-
return c.push({ id:
|
|
1981
|
+
return c.push({ id: x.id, params: [t] }), u.push({ id: x.id, params: [t] }), { redos: c, undos: u };
|
|
1983
1982
|
}
|
|
1984
|
-
_expandCol(i, n, e, t, r =
|
|
1983
|
+
_expandCol(i, n, e, t, r = U.Position) {
|
|
1985
1984
|
const s = t - e + 1, { from: o, to: a } = i, { column: c } = o, { column: u } = a;
|
|
1986
|
-
if (r ===
|
|
1985
|
+
if (r === U.None)
|
|
1987
1986
|
return {
|
|
1988
|
-
newSheetTransform:
|
|
1987
|
+
newSheetTransform: $({ ...n }, this._selectionRenderService),
|
|
1989
1988
|
newTransform: n
|
|
1990
1989
|
};
|
|
1991
1990
|
let d = null, l = null;
|
|
@@ -1993,16 +1992,16 @@ let an = class extends le {
|
|
|
1993
1992
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: t, startRow: o.row, endRow: a.row });
|
|
1994
1993
|
if (g == null)
|
|
1995
1994
|
return;
|
|
1996
|
-
l = { ...n, left: (n.left || 0) + g.endX - g.startX }, d =
|
|
1995
|
+
l = { ...n, left: (n.left || 0) + g.endX - g.startX }, d = $(l, this._selectionRenderService);
|
|
1997
1996
|
} else if (u >= t)
|
|
1998
|
-
if (r ===
|
|
1997
|
+
if (r === U.Both)
|
|
1999
1998
|
d = {
|
|
2000
1999
|
from: { ...o },
|
|
2001
2000
|
to: { ...a, column: u + s }
|
|
2002
2001
|
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2003
2002
|
else
|
|
2004
2003
|
return {
|
|
2005
|
-
newSheetTransform:
|
|
2004
|
+
newSheetTransform: $({ ...n }, this._selectionRenderService),
|
|
2006
2005
|
newTransform: n
|
|
2007
2006
|
};
|
|
2008
2007
|
return d != null && l != null ? {
|
|
@@ -2010,11 +2009,11 @@ let an = class extends le {
|
|
|
2010
2009
|
newTransform: l
|
|
2011
2010
|
} : null;
|
|
2012
2011
|
}
|
|
2013
|
-
_shrinkCol(i, n, e, t, r =
|
|
2012
|
+
_shrinkCol(i, n, e, t, r = U.Position) {
|
|
2014
2013
|
const s = t - e + 1, { from: o, to: a } = i, { column: c } = o, { column: u } = a;
|
|
2015
|
-
if (r ===
|
|
2014
|
+
if (r === U.None)
|
|
2016
2015
|
return {
|
|
2017
|
-
newSheetTransform:
|
|
2016
|
+
newSheetTransform: $({ ...n }, this._selectionRenderService),
|
|
2018
2017
|
newTransform: n
|
|
2019
2018
|
};
|
|
2020
2019
|
let d = null, l = null;
|
|
@@ -2027,14 +2026,14 @@ let an = class extends le {
|
|
|
2027
2026
|
if (c >= e && u <= t)
|
|
2028
2027
|
return null;
|
|
2029
2028
|
if (c < e && u > t)
|
|
2030
|
-
if (r ===
|
|
2029
|
+
if (r === U.Both)
|
|
2031
2030
|
d = {
|
|
2032
2031
|
from: { ...o },
|
|
2033
2032
|
to: { ...a, column: u - s }
|
|
2034
2033
|
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2035
2034
|
else
|
|
2036
2035
|
return {
|
|
2037
|
-
newSheetTransform:
|
|
2036
|
+
newSheetTransform: $({ ...n }, this._selectionRenderService),
|
|
2038
2037
|
newTransform: n
|
|
2039
2038
|
};
|
|
2040
2039
|
else if (c >= e && c <= t) {
|
|
@@ -2046,8 +2045,8 @@ let an = class extends le {
|
|
|
2046
2045
|
return;
|
|
2047
2046
|
l = { ...n, left: (n.left || 0) - g.endX + g.startX - i.from.columnOffset };
|
|
2048
2047
|
}
|
|
2049
|
-
d =
|
|
2050
|
-
} else if (u >= e && u <= t && r ===
|
|
2048
|
+
d = $(l, this._selectionRenderService);
|
|
2049
|
+
} else if (u >= e && u <= t && r === U.Both) {
|
|
2051
2050
|
const g = this._skeletonManagerService.attachRangeWithCoord({
|
|
2052
2051
|
startColumn: e - 1,
|
|
2053
2052
|
endColumn: e - 1,
|
|
@@ -2067,11 +2066,11 @@ let an = class extends le {
|
|
|
2067
2066
|
newTransform: l
|
|
2068
2067
|
} : null;
|
|
2069
2068
|
}
|
|
2070
|
-
_expandRow(i, n, e, t, r =
|
|
2069
|
+
_expandRow(i, n, e, t, r = U.Position) {
|
|
2071
2070
|
const s = t - e + 1, { from: o, to: a } = i, { row: c } = o, { row: u } = a;
|
|
2072
|
-
if (r ===
|
|
2071
|
+
if (r === U.None)
|
|
2073
2072
|
return {
|
|
2074
|
-
newSheetTransform:
|
|
2073
|
+
newSheetTransform: $({ ...n }, this._selectionRenderService),
|
|
2075
2074
|
newTransform: n
|
|
2076
2075
|
};
|
|
2077
2076
|
let d = null, l = null;
|
|
@@ -2079,9 +2078,9 @@ let an = class extends le {
|
|
|
2079
2078
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: t, startColumn: o.column, endColumn: a.column });
|
|
2080
2079
|
if (g == null)
|
|
2081
2080
|
return;
|
|
2082
|
-
l = { ...n, top: (n.top || 0) + g.endY - g.startY }, d =
|
|
2081
|
+
l = { ...n, top: (n.top || 0) + g.endY - g.startY }, d = $(l, this._selectionRenderService);
|
|
2083
2082
|
} else if (u >= t)
|
|
2084
|
-
if (r ===
|
|
2083
|
+
if (r === U.Both)
|
|
2085
2084
|
d = {
|
|
2086
2085
|
from: { ...o },
|
|
2087
2086
|
to: {
|
|
@@ -2091,7 +2090,7 @@ let an = class extends le {
|
|
|
2091
2090
|
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2092
2091
|
else
|
|
2093
2092
|
return {
|
|
2094
|
-
newSheetTransform:
|
|
2093
|
+
newSheetTransform: $({ ...n }, this._selectionRenderService),
|
|
2095
2094
|
newTransform: n
|
|
2096
2095
|
};
|
|
2097
2096
|
return d != null && l != null ? {
|
|
@@ -2099,11 +2098,11 @@ let an = class extends le {
|
|
|
2099
2098
|
newTransform: l
|
|
2100
2099
|
} : null;
|
|
2101
2100
|
}
|
|
2102
|
-
_shrinkRow(i, n, e, t, r =
|
|
2101
|
+
_shrinkRow(i, n, e, t, r = U.Position) {
|
|
2103
2102
|
const s = t - e + 1, { from: o, to: a } = i, { row: c } = o, { row: u } = a;
|
|
2104
|
-
if (r ===
|
|
2103
|
+
if (r === U.None)
|
|
2105
2104
|
return {
|
|
2106
|
-
newSheetTransform:
|
|
2105
|
+
newSheetTransform: $({ ...n }, this._selectionRenderService),
|
|
2107
2106
|
newTransform: n
|
|
2108
2107
|
};
|
|
2109
2108
|
let d = null, l = null;
|
|
@@ -2116,14 +2115,14 @@ let an = class extends le {
|
|
|
2116
2115
|
if (c >= e && u <= t)
|
|
2117
2116
|
return null;
|
|
2118
2117
|
if (c < e && u > t)
|
|
2119
|
-
if (r ===
|
|
2118
|
+
if (r === U.Both)
|
|
2120
2119
|
d = {
|
|
2121
2120
|
from: { ...o },
|
|
2122
2121
|
to: { ...a, row: u - s }
|
|
2123
2122
|
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2124
2123
|
else
|
|
2125
2124
|
return {
|
|
2126
|
-
newSheetTransform:
|
|
2125
|
+
newSheetTransform: $({ ...n }, this._selectionRenderService),
|
|
2127
2126
|
newTransform: n
|
|
2128
2127
|
};
|
|
2129
2128
|
else if (c >= e && c <= t) {
|
|
@@ -2135,8 +2134,8 @@ let an = class extends le {
|
|
|
2135
2134
|
return;
|
|
2136
2135
|
l = { ...n, top: (n.top || 0) - g.endY + g.startY - i.from.rowOffset };
|
|
2137
2136
|
}
|
|
2138
|
-
d =
|
|
2139
|
-
} else if (u >= e && u <= t && r ===
|
|
2137
|
+
d = $(l, this._selectionRenderService);
|
|
2138
|
+
} else if (u >= e && u <= t && r === U.Both) {
|
|
2140
2139
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: e - 1, endRow: e - 1 });
|
|
2141
2140
|
if (g == null)
|
|
2142
2141
|
return;
|
|
@@ -2157,7 +2156,7 @@ let an = class extends le {
|
|
|
2157
2156
|
// but the skeleton changes like other render modules. These two signals are not equivalent.
|
|
2158
2157
|
// As a temp solution, I subscribed to activate$ here.
|
|
2159
2158
|
this._commandService.onCommandExecuted((i) => {
|
|
2160
|
-
if (i.id ===
|
|
2159
|
+
if (i.id === Ji.id) {
|
|
2161
2160
|
const { unitId: n, subUnitId: e } = i.params;
|
|
2162
2161
|
this._updateDrawings(n, e);
|
|
2163
2162
|
}
|
|
@@ -2208,7 +2207,7 @@ let an = class extends le {
|
|
|
2208
2207
|
_sheetRefreshListener() {
|
|
2209
2208
|
this.disposeWithMe(
|
|
2210
2209
|
this._commandService.onCommandExecuted((i) => {
|
|
2211
|
-
|
|
2210
|
+
$s.includes(i.id) && requestIdleCallback(() => {
|
|
2212
2211
|
const n = i.params, { unitId: e, subUnitId: t, ranges: r } = n;
|
|
2213
2212
|
this._refreshDrawingTransform(e, t, r);
|
|
2214
2213
|
});
|
|
@@ -2218,13 +2217,13 @@ let an = class extends le {
|
|
|
2218
2217
|
_refreshDrawingTransform(i, n, e) {
|
|
2219
2218
|
const t = this._drawingManagerService.getDrawingData(i, n), r = [];
|
|
2220
2219
|
Object.keys(t).forEach((s) => {
|
|
2221
|
-
const o = t[s], { sheetTransform: a, transform: c, anchorType: u =
|
|
2222
|
-
if (u ===
|
|
2220
|
+
const o = t[s], { sheetTransform: a, transform: c, anchorType: u = U.Position } = o;
|
|
2221
|
+
if (u === U.None)
|
|
2223
2222
|
return !0;
|
|
2224
2223
|
const { from: d, to: l } = a, { row: g, column: h } = d, { row: f, column: p } = l;
|
|
2225
2224
|
for (let m = 0; m < e.length; m++) {
|
|
2226
2225
|
const w = e[m], { startRow: S, endRow: C, startColumn: D, endColumn: v } = w;
|
|
2227
|
-
if (
|
|
2226
|
+
if (Xr.intersects(
|
|
2228
2227
|
{
|
|
2229
2228
|
startRow: S,
|
|
2230
2229
|
endRow: C,
|
|
@@ -2238,7 +2237,7 @@ let an = class extends le {
|
|
|
2238
2237
|
endColumn: p
|
|
2239
2238
|
}
|
|
2240
2239
|
) || g > C || h > v) {
|
|
2241
|
-
const b = u ===
|
|
2240
|
+
const b = u === U.Position, _ = z(a, this._selectionRenderService, this._skeletonManagerService);
|
|
2242
2241
|
r.push({
|
|
2243
2242
|
...o,
|
|
2244
2243
|
transform: {
|
|
@@ -2250,15 +2249,15 @@ let an = class extends le {
|
|
|
2250
2249
|
break;
|
|
2251
2250
|
}
|
|
2252
2251
|
}
|
|
2253
|
-
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(
|
|
2252
|
+
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(x.id, [i]));
|
|
2254
2253
|
}
|
|
2255
2254
|
};
|
|
2256
|
-
an =
|
|
2255
|
+
an = Ws([
|
|
2257
2256
|
_e(1, ne),
|
|
2258
2257
|
_e(2, G),
|
|
2259
2258
|
_e(3, Xe),
|
|
2260
2259
|
_e(4, N(V)),
|
|
2261
|
-
_e(5, N(
|
|
2260
|
+
_e(5, N(Lt)),
|
|
2262
2261
|
_e(6, ae),
|
|
2263
2262
|
_e(7, oe),
|
|
2264
2263
|
_e(8, Ge)
|
|
@@ -2271,7 +2270,7 @@ var se = function() {
|
|
|
2271
2270
|
}
|
|
2272
2271
|
return i;
|
|
2273
2272
|
}, se.apply(this, arguments);
|
|
2274
|
-
},
|
|
2273
|
+
}, xs = function(i, n) {
|
|
2275
2274
|
var e = {};
|
|
2276
2275
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && n.indexOf(t) < 0 && (e[t] = i[t]);
|
|
2277
2276
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -2279,15 +2278,15 @@ var se = function() {
|
|
|
2279
2278
|
n.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (e[t[r]] = i[t[r]]);
|
|
2280
2279
|
return e;
|
|
2281
2280
|
}, _r = cr(function(i, n) {
|
|
2282
|
-
var e = i.icon, t = i.id, r = i.className, s = i.extend, o =
|
|
2281
|
+
var e = i.icon, t = i.id, r = i.className, s = i.extend, o = xs(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), c = ns("_".concat(Ys()));
|
|
2283
2282
|
return vr(e, "".concat(t), { defIds: e.defIds, idSuffix: c.current }, se({ ref: n, className: a }, o), s);
|
|
2284
2283
|
});
|
|
2285
2284
|
function vr(i, n, e, t, r) {
|
|
2286
|
-
return dr(i.tag, se(se({ key: n },
|
|
2285
|
+
return dr(i.tag, se(se({ key: n }, Ls(i, e, r)), t), (Fs(i, e).children || []).map(function(s, o) {
|
|
2287
2286
|
return vr(s, "".concat(n, "-").concat(i.tag, "-").concat(o), e, void 0, r);
|
|
2288
2287
|
}));
|
|
2289
2288
|
}
|
|
2290
|
-
function
|
|
2289
|
+
function Ls(i, n, e) {
|
|
2291
2290
|
var t = se({}, i.attrs);
|
|
2292
2291
|
e != null && e.colorChannel1 && t.fill === "colorChannel1" && (t.fill = e.colorChannel1);
|
|
2293
2292
|
var r = n.defIds;
|
|
@@ -2296,21 +2295,21 @@ function Qs(i, n, e) {
|
|
|
2296
2295
|
typeof a == "string" && (t[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(n.idSuffix, ")")));
|
|
2297
2296
|
})), t;
|
|
2298
2297
|
}
|
|
2299
|
-
function
|
|
2298
|
+
function Fs(i, n) {
|
|
2300
2299
|
var e, t = n.defIds;
|
|
2301
2300
|
return !t || t.length === 0 ? i : i.tag === "defs" && (!((e = i.children) === null || e === void 0) && e.length) ? se(se({}, i), { children: i.children.map(function(r) {
|
|
2302
2301
|
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? se(se({}, r), { attrs: se(se({}, r.attrs), { id: r.attrs.id + n.idSuffix }) }) : r;
|
|
2303
2302
|
}) }) : i;
|
|
2304
2303
|
}
|
|
2305
|
-
function
|
|
2304
|
+
function Ys() {
|
|
2306
2305
|
return Math.random().toString(36).substring(2, 8);
|
|
2307
2306
|
}
|
|
2308
2307
|
_r.displayName = "UniverIcon";
|
|
2309
|
-
var
|
|
2308
|
+
var Gs = { 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" } }] }, Sr = cr(function(i, n) {
|
|
2310
2309
|
return dr(_r, Object.assign({}, i, {
|
|
2311
2310
|
id: "add-image-single",
|
|
2312
2311
|
ref: n,
|
|
2313
|
-
icon:
|
|
2312
|
+
icon: Gs
|
|
2314
2313
|
}));
|
|
2315
2314
|
});
|
|
2316
2315
|
Sr.displayName = "AddImageSingle";
|
|
@@ -2350,56 +2349,47 @@ const Ir = {
|
|
|
2350
2349
|
return s === Ie.UP ? g.top = f - 1 : s === Ie.DOWN ? g.top = f + 1 : s === Ie.LEFT ? g.left = h - 1 : s === Ie.RIGHT && (g.left = h + 1), {
|
|
2351
2350
|
...d,
|
|
2352
2351
|
transform: g,
|
|
2353
|
-
sheetTransform:
|
|
2352
|
+
sheetTransform: $(g, r)
|
|
2354
2353
|
};
|
|
2355
2354
|
}).filter((d) => d != null);
|
|
2356
2355
|
return e.syncExecuteCommand(Yt.id, {
|
|
2357
2356
|
unitId: a,
|
|
2358
2357
|
drawings: c
|
|
2359
|
-
}) ? (e.syncExecuteCommand(
|
|
2358
|
+
}) ? (e.syncExecuteCommand(x.id, [a]), !0) : !1;
|
|
2360
2359
|
}
|
|
2361
2360
|
}, Cr = "addition-and-subtraction-single", br = "sheet.menu.image";
|
|
2362
|
-
function
|
|
2361
|
+
function Xs(i) {
|
|
2363
2362
|
return {
|
|
2364
2363
|
id: br,
|
|
2365
2364
|
type: cn.SUBITEMS,
|
|
2366
2365
|
icon: Cr,
|
|
2367
2366
|
tooltip: "sheetImage.title",
|
|
2368
|
-
hidden$:
|
|
2369
|
-
disabled$:
|
|
2367
|
+
hidden$: Ln(i, F.UNIVER_SHEET),
|
|
2368
|
+
disabled$: Ri(i, { workbookTypes: [Qt], worksheetTypes: [en], rangeTypes: [qi] })
|
|
2370
2369
|
};
|
|
2371
2370
|
}
|
|
2372
|
-
function
|
|
2371
|
+
function Vs(i) {
|
|
2373
2372
|
return {
|
|
2374
2373
|
id: Gt.id,
|
|
2375
2374
|
title: "sheetImage.upload.float",
|
|
2376
2375
|
type: cn.BUTTON,
|
|
2377
|
-
hidden$:
|
|
2376
|
+
hidden$: Ln(i, F.UNIVER_SHEET)
|
|
2378
2377
|
};
|
|
2379
2378
|
}
|
|
2380
|
-
function
|
|
2379
|
+
function Hs(i) {
|
|
2381
2380
|
return {
|
|
2382
2381
|
id: un.id,
|
|
2383
2382
|
title: "sheetImage.upload.cell",
|
|
2384
2383
|
type: cn.BUTTON
|
|
2385
2384
|
};
|
|
2386
2385
|
}
|
|
2387
|
-
const
|
|
2388
|
-
imageCommonPanel:
|
|
2389
|
-
imageCommonPanelGrid:
|
|
2390
|
-
imageCommonPanelBorder:
|
|
2391
|
-
imageCommonPanelTitle:
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
imageCommonPanelRowVertical: go,
|
|
2395
|
-
imageCommonPanelColumn: fo,
|
|
2396
|
-
imageCommonPanelColumnCenter: mo,
|
|
2397
|
-
imageCommonPanelInline: po,
|
|
2398
|
-
imageCommonPanelSpan2: wo,
|
|
2399
|
-
imageCommonPanelSpan3: _o,
|
|
2400
|
-
imageCommonPanelInput: vo,
|
|
2401
|
-
sheetImageMenu: So,
|
|
2402
|
-
sheetImageMenuInput: Io
|
|
2386
|
+
const zs = "univer-image-common-panel", Ks = "univer-image-common-panel-grid", Zs = "univer-image-common-panel-border", Js = "univer-image-common-panel-title", qs = "univer-image-common-panel-row", Qs = "univer-image-common-panel-column", ve = {
|
|
2387
|
+
imageCommonPanel: zs,
|
|
2388
|
+
imageCommonPanelGrid: Ks,
|
|
2389
|
+
imageCommonPanelBorder: Zs,
|
|
2390
|
+
imageCommonPanelTitle: Js,
|
|
2391
|
+
imageCommonPanelRow: qs,
|
|
2392
|
+
imageCommonPanelColumn: Qs
|
|
2403
2393
|
};
|
|
2404
2394
|
function Rr(i) {
|
|
2405
2395
|
var n, e, t = "";
|
|
@@ -2414,15 +2404,15 @@ function Dt() {
|
|
|
2414
2404
|
for (var i, n, e = 0, t = "", r = arguments.length; e < r; e++) (i = arguments[e]) && (n = Rr(i)) && (t && (t += " "), t += n);
|
|
2415
2405
|
return t;
|
|
2416
2406
|
}
|
|
2417
|
-
const
|
|
2407
|
+
const eo = (i) => {
|
|
2418
2408
|
var C;
|
|
2419
|
-
const n = Te(G), e = Te(
|
|
2409
|
+
const n = Te(G), e = Te($t), t = Te(oe), r = Te(ne), { drawings: s } = i, o = s[0];
|
|
2420
2410
|
if (o == null)
|
|
2421
2411
|
return;
|
|
2422
2412
|
const { unitId: a } = o, c = r.getRenderById(a), u = c == null ? void 0 : c.scene;
|
|
2423
2413
|
if (u == null)
|
|
2424
2414
|
return;
|
|
2425
|
-
const d = u.getTransformerByCreate(), [l, g] = rn(!0), h = (C = o.anchorType) != null ? C :
|
|
2415
|
+
const d = u.getTransformerByCreate(), [l, g] = rn(!0), h = (C = o.anchorType) != null ? C : U.Position, [f, p] = rn(h);
|
|
2426
2416
|
function m(D, v) {
|
|
2427
2417
|
const b = [];
|
|
2428
2418
|
return D.forEach((_) => {
|
|
@@ -2450,7 +2440,7 @@ const Co = (i) => {
|
|
|
2450
2440
|
g(!1);
|
|
2451
2441
|
else if (E.length >= 1) {
|
|
2452
2442
|
g(!0);
|
|
2453
|
-
const y = ((M = E[0]) == null ? void 0 : M.anchorType) ||
|
|
2443
|
+
const y = ((M = E[0]) == null ? void 0 : M.anchorType) || U.Position;
|
|
2454
2444
|
p(y);
|
|
2455
2445
|
}
|
|
2456
2446
|
});
|
|
@@ -2477,13 +2467,13 @@ const Co = (i) => {
|
|
|
2477
2467
|
const S = (D) => D ? "block" : "none";
|
|
2478
2468
|
return /* @__PURE__ */ Tt("div", { className: Dt(ve.imageCommonPanelGrid, ve.imageCommonPanelBorder), style: { display: S(l) }, children: [
|
|
2479
2469
|
/* @__PURE__ */ ee("div", { className: ve.imageCommonPanelRow, children: /* @__PURE__ */ ee("div", { className: Dt(ve.imageCommonPanelColumn, ve.imageCommonPanelTitle), children: /* @__PURE__ */ ee("div", { children: e.t("drawing-anchor.title") }) }) }),
|
|
2480
|
-
/* @__PURE__ */ ee("div", { className: Dt(ve.imageCommonPanelRow), children: /* @__PURE__ */ ee("div", { className: Dt(ve.imageCommonPanelColumn), children: /* @__PURE__ */ Tt(
|
|
2481
|
-
/* @__PURE__ */ ee(Jt, { value:
|
|
2482
|
-
/* @__PURE__ */ ee(Jt, { value:
|
|
2483
|
-
/* @__PURE__ */ ee(Jt, { value:
|
|
2470
|
+
/* @__PURE__ */ ee("div", { className: Dt(ve.imageCommonPanelRow), children: /* @__PURE__ */ ee("div", { className: Dt(ve.imageCommonPanelColumn), children: /* @__PURE__ */ Tt(ss, { value: f, onChange: w, direction: "vertical", children: [
|
|
2471
|
+
/* @__PURE__ */ ee(Jt, { value: U.Both, children: e.t("drawing-anchor.both") }),
|
|
2472
|
+
/* @__PURE__ */ ee(Jt, { value: U.Position, children: e.t("drawing-anchor.position") }),
|
|
2473
|
+
/* @__PURE__ */ ee(Jt, { value: U.None, children: e.t("drawing-anchor.none") })
|
|
2484
2474
|
] }) }) })
|
|
2485
2475
|
] });
|
|
2486
|
-
},
|
|
2476
|
+
}, to = () => {
|
|
2487
2477
|
const i = Te(oe), n = i.getFocusDrawings(), [e, t] = rn(n);
|
|
2488
2478
|
return ln(() => {
|
|
2489
2479
|
const r = i.focus$.subscribe((s) => {
|
|
@@ -2493,102 +2483,102 @@ const Co = (i) => {
|
|
|
2493
2483
|
r.unsubscribe();
|
|
2494
2484
|
};
|
|
2495
2485
|
}, []), !!(e != null && e.length) && /* @__PURE__ */ Tt("div", { className: ve.imageCommonPanel, children: [
|
|
2496
|
-
/* @__PURE__ */ ee(
|
|
2497
|
-
/* @__PURE__ */ ee(
|
|
2486
|
+
/* @__PURE__ */ ee(ui, { drawings: e }),
|
|
2487
|
+
/* @__PURE__ */ ee(eo, { drawings: e })
|
|
2498
2488
|
] });
|
|
2499
|
-
},
|
|
2500
|
-
[
|
|
2489
|
+
}, no = {
|
|
2490
|
+
[Ai.FORMULAS_INSERT]: {
|
|
2501
2491
|
[br]: {
|
|
2502
2492
|
order: 3,
|
|
2503
|
-
menuItemFactory:
|
|
2493
|
+
menuItemFactory: Xs,
|
|
2504
2494
|
[Gt.id]: {
|
|
2505
2495
|
order: 0,
|
|
2506
|
-
menuItemFactory:
|
|
2496
|
+
menuItemFactory: Vs
|
|
2507
2497
|
},
|
|
2508
2498
|
[un.id]: {
|
|
2509
2499
|
order: 1,
|
|
2510
|
-
menuItemFactory:
|
|
2500
|
+
menuItemFactory: Hs
|
|
2511
2501
|
}
|
|
2512
2502
|
}
|
|
2513
2503
|
}
|
|
2514
2504
|
};
|
|
2515
2505
|
function it(i) {
|
|
2516
|
-
return !i.getContextValue(
|
|
2506
|
+
return !i.getContextValue(Vr) && !i.getContextValue(Hr) && !i.getContextValue(zr) && i.getContextValue(Le);
|
|
2517
2507
|
}
|
|
2518
|
-
const
|
|
2508
|
+
const ro = {
|
|
2519
2509
|
id: rt.id,
|
|
2520
2510
|
description: "shortcut.sheet.drawing-move-down",
|
|
2521
2511
|
group: "4_sheet-drawing-view",
|
|
2522
|
-
binding:
|
|
2512
|
+
binding: Fe.ARROW_DOWN,
|
|
2523
2513
|
priority: 100,
|
|
2524
2514
|
preconditions: it,
|
|
2525
2515
|
staticParameters: {
|
|
2526
2516
|
direction: Ie.DOWN
|
|
2527
2517
|
}
|
|
2528
|
-
},
|
|
2518
|
+
}, io = {
|
|
2529
2519
|
id: rt.id,
|
|
2530
2520
|
description: "shortcut.sheet.drawing-move-up",
|
|
2531
2521
|
group: "4_sheet-drawing-view",
|
|
2532
|
-
binding:
|
|
2522
|
+
binding: Fe.ARROW_UP,
|
|
2533
2523
|
priority: 100,
|
|
2534
2524
|
preconditions: it,
|
|
2535
2525
|
staticParameters: {
|
|
2536
2526
|
direction: Ie.UP
|
|
2537
2527
|
}
|
|
2538
|
-
},
|
|
2528
|
+
}, so = {
|
|
2539
2529
|
id: rt.id,
|
|
2540
2530
|
description: "shortcut.sheet.drawing-move-left",
|
|
2541
2531
|
group: "4_sheet-drawing-view",
|
|
2542
|
-
binding:
|
|
2532
|
+
binding: Fe.ARROW_LEFT,
|
|
2543
2533
|
priority: 100,
|
|
2544
2534
|
preconditions: it,
|
|
2545
2535
|
staticParameters: {
|
|
2546
2536
|
direction: Ie.LEFT
|
|
2547
2537
|
}
|
|
2548
|
-
},
|
|
2538
|
+
}, oo = {
|
|
2549
2539
|
id: rt.id,
|
|
2550
2540
|
description: "shortcut.sheet.drawing-move-right",
|
|
2551
2541
|
group: "4_sheet-drawing-view",
|
|
2552
|
-
binding:
|
|
2542
|
+
binding: Fe.ARROW_RIGHT,
|
|
2553
2543
|
priority: 100,
|
|
2554
2544
|
preconditions: it,
|
|
2555
2545
|
staticParameters: {
|
|
2556
2546
|
direction: Ie.RIGHT
|
|
2557
2547
|
}
|
|
2558
|
-
},
|
|
2548
|
+
}, ao = {
|
|
2559
2549
|
id: Ir.id,
|
|
2560
2550
|
description: "shortcut.sheet.drawing-delete",
|
|
2561
2551
|
group: "4_sheet-drawing-view",
|
|
2562
2552
|
// when focusing on any other input tag do not trigger this shortcut
|
|
2563
2553
|
preconditions: it,
|
|
2564
|
-
binding:
|
|
2565
|
-
mac:
|
|
2554
|
+
binding: Fe.DELETE,
|
|
2555
|
+
mac: Fe.BACKSPACE
|
|
2566
2556
|
};
|
|
2567
|
-
var
|
|
2568
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2569
|
-
(o = i[s]) && (r =
|
|
2570
|
-
return
|
|
2571
|
-
},
|
|
2557
|
+
var co = Object.getOwnPropertyDescriptor, lo = (i, n, e, t) => {
|
|
2558
|
+
for (var r = t > 1 ? void 0 : t ? co(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
2559
|
+
(o = i[s]) && (r = o(r) || r);
|
|
2560
|
+
return r;
|
|
2561
|
+
}, $e = (i, n) => (e, t) => n(e, t, i);
|
|
2572
2562
|
let Bt = class extends le {
|
|
2573
2563
|
constructor(i, n, e, t, r, s) {
|
|
2574
2564
|
super(), this._componentManager = i, this._menuManagerService = n, this._commandService = e, this._shortcutService = t, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
|
|
2575
2565
|
}
|
|
2576
2566
|
_initCustomComponents() {
|
|
2577
2567
|
const i = this._componentManager;
|
|
2578
|
-
this.disposeWithMe(i.register(Cr, Sr)), this.disposeWithMe(i.register(lr,
|
|
2568
|
+
this.disposeWithMe(i.register(Cr, Sr)), this.disposeWithMe(i.register(lr, to));
|
|
2579
2569
|
}
|
|
2580
2570
|
_initMenus() {
|
|
2581
|
-
this._menuManagerService.mergeMenu(
|
|
2571
|
+
this._menuManagerService.mergeMenu(no);
|
|
2582
2572
|
}
|
|
2583
2573
|
_initCommands() {
|
|
2584
2574
|
[
|
|
2585
2575
|
Gt,
|
|
2586
2576
|
un,
|
|
2587
|
-
|
|
2577
|
+
Ft,
|
|
2588
2578
|
nt,
|
|
2589
2579
|
Yt,
|
|
2590
2580
|
ur,
|
|
2591
|
-
|
|
2581
|
+
x,
|
|
2592
2582
|
hr,
|
|
2593
2583
|
gr,
|
|
2594
2584
|
mr,
|
|
@@ -2600,11 +2590,11 @@ let Bt = class extends le {
|
|
|
2600
2590
|
_initShortcuts() {
|
|
2601
2591
|
[
|
|
2602
2592
|
// sheet drawing shortcuts
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2593
|
+
ro,
|
|
2594
|
+
io,
|
|
2595
|
+
so,
|
|
2596
|
+
oo,
|
|
2597
|
+
ao
|
|
2608
2598
|
].forEach((i) => {
|
|
2609
2599
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2610
2600
|
});
|
|
@@ -2613,21 +2603,21 @@ let Bt = class extends le {
|
|
|
2613
2603
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
2614
2604
|
}
|
|
2615
2605
|
};
|
|
2616
|
-
Bt =
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2606
|
+
Bt = lo([
|
|
2607
|
+
$e(0, N(Ni)),
|
|
2608
|
+
$e(1, ki),
|
|
2609
|
+
$e(2, G),
|
|
2610
|
+
$e(3, Bi),
|
|
2611
|
+
$e(4, oe),
|
|
2612
|
+
$e(5, N(dn))
|
|
2623
2613
|
], Bt);
|
|
2624
|
-
var
|
|
2625
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2626
|
-
(o = i[s]) && (r =
|
|
2627
|
-
return
|
|
2614
|
+
var uo = Object.getOwnPropertyDescriptor, ho = (i, n, e, t) => {
|
|
2615
|
+
for (var r = t > 1 ? void 0 : t ? uo(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
2616
|
+
(o = i[s]) && (r = o(r) || r);
|
|
2617
|
+
return r;
|
|
2628
2618
|
}, Me = (i, n) => (e, t) => n(e, t, i);
|
|
2629
|
-
function
|
|
2630
|
-
const { scaleX: s, scaleY: o } = n.getAncestorScale(), a = n.getViewport(
|
|
2619
|
+
function go(i, n, e, t, r) {
|
|
2620
|
+
const { scaleX: s, scaleY: o } = n.getAncestorScale(), a = n.getViewport($n.VIEW_MAIN), c = t.getFreeze(), { startColumn: u, startRow: d, xSplit: l, ySplit: g } = c, h = {
|
|
2631
2621
|
left: !0,
|
|
2632
2622
|
// left means the left of pic is in a viewMainLeft
|
|
2633
2623
|
top: !0
|
|
@@ -2673,7 +2663,7 @@ const fe = (i, n, e, t, r) => {
|
|
|
2673
2663
|
right: o + c,
|
|
2674
2664
|
top: a,
|
|
2675
2665
|
bottom: a + u
|
|
2676
|
-
}, g =
|
|
2666
|
+
}, g = go(l, s, e, t, r), { scaleX: h, scaleY: f } = s.getAncestorScale();
|
|
2677
2667
|
return {
|
|
2678
2668
|
startX: g.left,
|
|
2679
2669
|
endX: g.right,
|
|
@@ -2706,7 +2696,7 @@ let Wt = class extends le {
|
|
|
2706
2696
|
this._renderManagerService = n, this._univerInstanceService = e, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
2707
2697
|
}
|
|
2708
2698
|
_bindScrollEvent() {
|
|
2709
|
-
this._lifecycleService.lifecycle$.pipe(
|
|
2699
|
+
this._lifecycleService.lifecycle$.pipe(ji((n) => n === Zr.Rendered), $i(1)).subscribe(() => {
|
|
2710
2700
|
this._scrollUpdateListener();
|
|
2711
2701
|
});
|
|
2712
2702
|
}
|
|
@@ -2744,7 +2734,7 @@ let Wt = class extends le {
|
|
|
2744
2734
|
this._drawingManagerService.add$.subscribe((n) => {
|
|
2745
2735
|
n.forEach((e) => {
|
|
2746
2736
|
var J, ce, q;
|
|
2747
|
-
const { unitId: t, subUnitId: r, drawingId: s } = e, o = H(this._univerInstanceService, { unitId: t, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), c = this._univerInstanceService.getUnit(t,
|
|
2737
|
+
const { unitId: t, subUnitId: r, drawingId: s } = e, o = H(this._univerInstanceService, { unitId: t, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), c = this._univerInstanceService.getUnit(t, F.UNIVER_SHEET);
|
|
2748
2738
|
if (!c)
|
|
2749
2739
|
return;
|
|
2750
2740
|
const u = c.getActiveSheet().getSheetId();
|
|
@@ -2754,7 +2744,7 @@ let Wt = class extends le {
|
|
|
2754
2744
|
if (!d)
|
|
2755
2745
|
return;
|
|
2756
2746
|
const { transform: l, drawingType: g, data: h } = a;
|
|
2757
|
-
if (g !==
|
|
2747
|
+
if (g !== L.DRAWING_DOM && g !== L.DRAWING_CHART)
|
|
2758
2748
|
return;
|
|
2759
2749
|
const f = this._getSceneAndTransformerByDrawingSearch(t);
|
|
2760
2750
|
if (f == null)
|
|
@@ -2775,12 +2765,12 @@ let Wt = class extends le {
|
|
|
2775
2765
|
width: C,
|
|
2776
2766
|
height: D,
|
|
2777
2767
|
zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
|
|
2778
|
-
}, R = g ===
|
|
2768
|
+
}, R = g === L.DRAWING_CHART;
|
|
2779
2769
|
if (R) {
|
|
2780
2770
|
const W = h ? h.backgroundColor : "white";
|
|
2781
2771
|
I.fill = W, I.rotateEnabled = !1, h && h.border && (I.stroke = h.border), I.paintFirst = "stroke", I.strokeWidth = 1, I.borderEnabled = !1, I.radius = 8;
|
|
2782
2772
|
}
|
|
2783
|
-
const O = new
|
|
2773
|
+
const O = new je(y, I);
|
|
2784
2774
|
R && O.setObjectType(bn.CHART), p.addObject(O, Kt), a.allowTransform !== !1 && p.attachTransformerTo(O);
|
|
2785
2775
|
const B = this._ensureMap(t, r), K = new _t(), Z = fe(O, f.renderUnit, d.skeleton, o.worksheet), Y = new Ze(Z), me = {
|
|
2786
2776
|
dispose: K,
|
|
@@ -2847,7 +2837,7 @@ let Wt = class extends le {
|
|
|
2847
2837
|
});
|
|
2848
2838
|
};
|
|
2849
2839
|
this.disposeWithMe(
|
|
2850
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2840
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
|
|
2851
2841
|
Se((e) => e ? e.activeSheet$ : En(null)),
|
|
2852
2842
|
Ee((e) => {
|
|
2853
2843
|
if (!e) return null;
|
|
@@ -2855,7 +2845,7 @@ let Wt = class extends le {
|
|
|
2855
2845
|
return r ? { render: r, unitId: t, subUnitId: e.getSheetId() } : null;
|
|
2856
2846
|
}),
|
|
2857
2847
|
Se(
|
|
2858
|
-
(e) => e ?
|
|
2848
|
+
(e) => e ? Jr(e.render.scene.getViewport($n.VIEW_MAIN).onScrollAfter$).pipe(Ee(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : En(null)
|
|
2859
2849
|
)
|
|
2860
2850
|
).subscribe((e) => {
|
|
2861
2851
|
if (!e) return;
|
|
@@ -2869,7 +2859,7 @@ let Wt = class extends le {
|
|
|
2869
2859
|
Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((c) => {
|
|
2870
2860
|
n(o, c);
|
|
2871
2861
|
});
|
|
2872
|
-
} else if (e.id ===
|
|
2862
|
+
} else if (e.id === Qi.id) {
|
|
2873
2863
|
const { unitId: s, subUnitId: o } = e.params;
|
|
2874
2864
|
n(s, o);
|
|
2875
2865
|
}
|
|
@@ -2907,7 +2897,7 @@ let Wt = class extends le {
|
|
|
2907
2897
|
this._drawingManagerService.update$.subscribe((n) => {
|
|
2908
2898
|
n.forEach((e) => {
|
|
2909
2899
|
const t = this._drawingManagerService.getDrawingByParam(e);
|
|
2910
|
-
if (!t || t.drawingType !==
|
|
2900
|
+
if (!t || t.drawingType !== L.DRAWING_DOM && t.drawingType !== L.DRAWING_CHART)
|
|
2911
2901
|
return;
|
|
2912
2902
|
const r = {
|
|
2913
2903
|
...t.transform
|
|
@@ -2930,7 +2920,7 @@ let Wt = class extends le {
|
|
|
2930
2920
|
const s = this._domLayerInfoMap.get(t), o = this._getSceneAndTransformerByDrawingSearch(n);
|
|
2931
2921
|
if (s && o) {
|
|
2932
2922
|
const { scene: a } = o, c = Ce({ unitId: n, subUnitId: e, drawingId: t }), u = a.getObject(c);
|
|
2933
|
-
u && u instanceof
|
|
2923
|
+
u && u instanceof je && u.setProps(r);
|
|
2934
2924
|
}
|
|
2935
2925
|
}
|
|
2936
2926
|
// CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
|
|
@@ -2949,7 +2939,7 @@ let Wt = class extends le {
|
|
|
2949
2939
|
unitId: r,
|
|
2950
2940
|
subUnitId: s,
|
|
2951
2941
|
drawingId: d,
|
|
2952
|
-
drawingType: n.type ||
|
|
2942
|
+
drawingType: n.type || L.DRAWING_DOM,
|
|
2953
2943
|
componentKey: a,
|
|
2954
2944
|
sheetTransform: l,
|
|
2955
2945
|
transform: {
|
|
@@ -2961,7 +2951,7 @@ let Wt = class extends le {
|
|
|
2961
2951
|
data: c,
|
|
2962
2952
|
allowTransform: u
|
|
2963
2953
|
};
|
|
2964
|
-
return this._commandService.executeCommand(
|
|
2954
|
+
return this._commandService.executeCommand(Ft.id, {
|
|
2965
2955
|
unitId: r,
|
|
2966
2956
|
drawings: [h]
|
|
2967
2957
|
}), this._add$.next({ unitId: r, subUnitId: s, id: d }), {
|
|
@@ -2984,7 +2974,7 @@ let Wt = class extends le {
|
|
|
2984
2974
|
if (!c)
|
|
2985
2975
|
return;
|
|
2986
2976
|
const u = this._sheetDrawingService.getBatchRemoveOp([c]), { redo: d, objects: l } = u;
|
|
2987
|
-
this._commandService.syncExecuteCommand(
|
|
2977
|
+
this._commandService.syncExecuteCommand(A.id, { unitId: r, subUnitId: s, op: d, objects: l, type: P.REMOVE });
|
|
2988
2978
|
}
|
|
2989
2979
|
}
|
|
2990
2980
|
addHook(n) {
|
|
@@ -3010,17 +3000,16 @@ let Wt = class extends le {
|
|
|
3010
3000
|
if (!u) return;
|
|
3011
3001
|
const d = (_ = this._renderManagerService.getRenderById(o)) == null ? void 0 : _.with(V).getWorksheetSkeleton(a);
|
|
3012
3002
|
if (!d) return;
|
|
3013
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Ht(), { position: p, position$: m } = this._createRangePositionObserver(n, u, d.skeleton)
|
|
3014
|
-
if (
|
|
3003
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Ht(), { position: p, position$: m } = this._createRangePositionObserver(n, u, d.skeleton);
|
|
3004
|
+
if (this._getPosition(p, o) == null)
|
|
3015
3005
|
return;
|
|
3016
3006
|
this._ensureMap(o, a).set(f, e);
|
|
3017
3007
|
const C = c.scene, { scaleX: D } = C.getAncestorScale(), v = Mt(p, t, D), b = {
|
|
3018
3008
|
unitId: o,
|
|
3019
3009
|
subUnitId: a,
|
|
3020
3010
|
drawingId: f,
|
|
3021
|
-
drawingType: e.type ||
|
|
3011
|
+
drawingType: e.type || L.DRAWING_DOM,
|
|
3022
3012
|
componentKey: l,
|
|
3023
|
-
sheetTransform: w,
|
|
3024
3013
|
transform: {
|
|
3025
3014
|
left: v.startX,
|
|
3026
3015
|
top: v.startY,
|
|
@@ -3031,7 +3020,7 @@ let Wt = class extends le {
|
|
|
3031
3020
|
allowTransform: h
|
|
3032
3021
|
};
|
|
3033
3022
|
{
|
|
3034
|
-
const { unitId: I, subUnitId: R, drawingId: O } = b, B = H(this._univerInstanceService, { unitId: I, subUnitId: R }), K = b, Z = this._univerInstanceService.getUnit(I,
|
|
3023
|
+
const { unitId: I, subUnitId: R, drawingId: O } = b, B = H(this._univerInstanceService, { unitId: I, subUnitId: R }), K = b, Z = this._univerInstanceService.getUnit(I, F.UNIVER_SHEET);
|
|
3035
3024
|
if (!Z)
|
|
3036
3025
|
return;
|
|
3037
3026
|
const Y = Z.getActiveSheet().getSheetId();
|
|
@@ -3044,17 +3033,17 @@ let Wt = class extends le {
|
|
|
3044
3033
|
if (!X)
|
|
3045
3034
|
return;
|
|
3046
3035
|
const { transform: J, drawingType: ce, data: q } = K;
|
|
3047
|
-
if (ce !==
|
|
3036
|
+
if (ce !== L.DRAWING_DOM && ce !== L.DRAWING_CHART)
|
|
3048
3037
|
return;
|
|
3049
3038
|
const W = this._getSceneAndTransformerByDrawingSearch(I);
|
|
3050
3039
|
if (W == null)
|
|
3051
3040
|
return;
|
|
3052
|
-
const { scene: Oe, canvas:
|
|
3041
|
+
const { scene: Oe, canvas: Ue } = W;
|
|
3053
3042
|
if (J == null || Y !== R)
|
|
3054
3043
|
return;
|
|
3055
|
-
const { left: st, top: ot, width: at, height: ct, angle: Xt, flipX: Vt, flipY: dt, skewX: lt, skewY:
|
|
3044
|
+
const { left: st, top: ot, width: at, height: ct, angle: Xt, flipX: Vt, flipY: dt, skewX: lt, skewY: Pe } = J, ut = Ce({ unitId: I, subUnitId: R, drawingId: O }), ue = Oe.getObject(ut);
|
|
3056
3045
|
if (ue != null) {
|
|
3057
|
-
ue.transformByState({ left: st, top: ot, width: at, height: ct, angle: Xt, flipX: Vt, flipY: dt, skewX: lt, skewY:
|
|
3046
|
+
ue.transformByState({ left: st, top: ot, width: at, height: ct, angle: Xt, flipX: Vt, flipY: dt, skewX: lt, skewY: Pe });
|
|
3058
3047
|
return;
|
|
3059
3048
|
}
|
|
3060
3049
|
const re = {
|
|
@@ -3064,12 +3053,12 @@ let Wt = class extends le {
|
|
|
3064
3053
|
width: at,
|
|
3065
3054
|
height: ct,
|
|
3066
3055
|
zIndex: this._drawingManagerService.getDrawingOrder(I, R).length - 1
|
|
3067
|
-
}, Ae = ce ===
|
|
3056
|
+
}, Ae = ce === L.DRAWING_CHART;
|
|
3068
3057
|
if (Ae) {
|
|
3069
|
-
const
|
|
3070
|
-
re.fill =
|
|
3058
|
+
const k = q ? q.backgroundColor : "white";
|
|
3059
|
+
re.fill = k, re.rotateEnabled = !1, q && q.border && (re.stroke = q.border), re.paintFirst = "stroke", re.strokeWidth = 1, re.borderEnabled = !1, re.radius = 8;
|
|
3071
3060
|
}
|
|
3072
|
-
const de = new
|
|
3061
|
+
const de = new je(ut, re);
|
|
3073
3062
|
Ae && de.setObjectType(bn.CHART), Oe.addObject(de, Kt), K.allowTransform !== !1 && Oe.attachTransformerTo(de);
|
|
3074
3063
|
const Ve = this._ensureMap(I, R), he = new _t(), ht = Oe.getMainViewport(), { rowHeaderWidth: Ne, columnHeaderHeight: He } = X.skeleton, gt = {
|
|
3075
3064
|
top: He,
|
|
@@ -3083,10 +3072,10 @@ let Wt = class extends le {
|
|
|
3083
3072
|
domAnchor: t,
|
|
3084
3073
|
unitId: I,
|
|
3085
3074
|
subUnitId: R
|
|
3086
|
-
},
|
|
3087
|
-
ge.position$ =
|
|
3075
|
+
}, j = fe(de, W.renderUnit, X.skeleton, B.worksheet, ge), ke = new Ze(j);
|
|
3076
|
+
ge.position$ = ke;
|
|
3088
3077
|
let ze = {
|
|
3089
|
-
position$:
|
|
3078
|
+
position$: ke,
|
|
3090
3079
|
id: O,
|
|
3091
3080
|
componentKey: K.componentKey,
|
|
3092
3081
|
onPointerDown: () => {
|
|
@@ -3095,8 +3084,8 @@ let Wt = class extends le {
|
|
|
3095
3084
|
},
|
|
3096
3085
|
onPointerUp: () => {
|
|
3097
3086
|
},
|
|
3098
|
-
onWheel: (
|
|
3099
|
-
|
|
3087
|
+
onWheel: (k) => {
|
|
3088
|
+
Ue.dispatchEvent(new WheelEvent(k.type, k));
|
|
3100
3089
|
},
|
|
3101
3090
|
props: (y = (M = Ve.get(O)) == null ? void 0 : M.props) != null ? y : this._getFloatDomProps(O),
|
|
3102
3091
|
data: q,
|
|
@@ -3104,46 +3093,45 @@ let Wt = class extends le {
|
|
|
3104
3093
|
};
|
|
3105
3094
|
e.eventPassThrough && (ze = {
|
|
3106
3095
|
...ze,
|
|
3107
|
-
onPointerDown: (
|
|
3108
|
-
|
|
3096
|
+
onPointerDown: (k) => {
|
|
3097
|
+
Ue.dispatchEvent(new PointerEvent(k.type, k));
|
|
3109
3098
|
},
|
|
3110
|
-
onPointerMove: (
|
|
3111
|
-
|
|
3099
|
+
onPointerMove: (k) => {
|
|
3100
|
+
Ue.dispatchEvent(new PointerEvent(k.type, k));
|
|
3112
3101
|
},
|
|
3113
|
-
onPointerUp: (
|
|
3114
|
-
|
|
3102
|
+
onPointerUp: (k) => {
|
|
3103
|
+
Ue.dispatchEvent(new PointerEvent(k.type, k));
|
|
3115
3104
|
}
|
|
3116
|
-
}), this._canvasFloatDomService.addFloatDom(ze), this.disposeWithMe(m.subscribe((
|
|
3105
|
+
}), this._canvasFloatDomService.addFloatDom(ze), this.disposeWithMe(m.subscribe((k) => {
|
|
3117
3106
|
var gn, fn, mn, pn;
|
|
3118
3107
|
const hn = Mt({
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
height: (fn = t.height) != null ? fn : j.height,
|
|
3108
|
+
startX: k.startX,
|
|
3109
|
+
startY: k.startY,
|
|
3110
|
+
endX: k.endX,
|
|
3111
|
+
endY: k.endY,
|
|
3112
|
+
width: (gn = t.width) != null ? gn : k.width,
|
|
3113
|
+
height: (fn = t.height) != null ? fn : k.height,
|
|
3126
3114
|
absolute: {
|
|
3127
3115
|
left: p.absolute.left,
|
|
3128
3116
|
top: p.absolute.top
|
|
3129
3117
|
}
|
|
3130
|
-
}, t),
|
|
3118
|
+
}, t), Mr = Ce({ unitId: I, subUnitId: R, drawingId: O }), yr = new je(Mr, {
|
|
3131
3119
|
left: hn.startX,
|
|
3132
3120
|
top: hn.startY,
|
|
3133
|
-
width: (mn = t.width) != null ? mn :
|
|
3134
|
-
height: (pn = t.height) != null ? pn :
|
|
3121
|
+
width: (mn = t.width) != null ? mn : k.width,
|
|
3122
|
+
height: (pn = t.height) != null ? pn : k.height,
|
|
3135
3123
|
zIndex: this._drawingManagerService.getDrawingOrder(I, R).length - 1
|
|
3136
|
-
}),
|
|
3137
|
-
|
|
3124
|
+
}), Tr = fe(yr, W.renderUnit, X.skeleton, B.worksheet, ge);
|
|
3125
|
+
ke.next(Tr);
|
|
3138
3126
|
}));
|
|
3139
3127
|
const Ke = (T = this._renderManagerService.getRenderById(I)) == null ? void 0 : T.with(V);
|
|
3140
|
-
Ke == null || Ke.currentSkeleton$.subscribe((
|
|
3141
|
-
|
|
3128
|
+
Ke == null || Ke.currentSkeleton$.subscribe((k) => {
|
|
3129
|
+
k && X.sheetId !== k.sheetId && this._removeDom(f, !0);
|
|
3142
3130
|
});
|
|
3143
3131
|
const ft = de.onTransformChange$.subscribeEvent(() => {
|
|
3144
|
-
const
|
|
3145
|
-
|
|
3146
|
-
|
|
3132
|
+
const k = fe(de, W.renderUnit, X.skeleton, B.worksheet, ge);
|
|
3133
|
+
ke.next(
|
|
3134
|
+
k
|
|
3147
3135
|
);
|
|
3148
3136
|
});
|
|
3149
3137
|
he.add(() => {
|
|
@@ -3179,18 +3167,15 @@ let Wt = class extends le {
|
|
|
3179
3167
|
startColumn: n,
|
|
3180
3168
|
endColumn: n
|
|
3181
3169
|
}, u, d.skeleton), w = p;
|
|
3182
|
-
w.startY = 0
|
|
3183
|
-
const S = this._getPosition(p, o);
|
|
3184
|
-
if (S == null)
|
|
3170
|
+
if (w.startY = 0, this._getPosition(p, o) == null)
|
|
3185
3171
|
return;
|
|
3186
3172
|
this._ensureMap(o, a).set(f, e);
|
|
3187
3173
|
const D = {
|
|
3188
3174
|
unitId: o,
|
|
3189
3175
|
subUnitId: a,
|
|
3190
3176
|
drawingId: f,
|
|
3191
|
-
drawingType: e.type ||
|
|
3177
|
+
drawingType: e.type || L.DRAWING_DOM,
|
|
3192
3178
|
componentKey: l,
|
|
3193
|
-
sheetTransform: S,
|
|
3194
3179
|
transform: {
|
|
3195
3180
|
left: w.startX,
|
|
3196
3181
|
top: w.startY,
|
|
@@ -3201,7 +3186,7 @@ let Wt = class extends le {
|
|
|
3201
3186
|
allowTransform: h
|
|
3202
3187
|
};
|
|
3203
3188
|
{
|
|
3204
|
-
const { unitId: y, subUnitId: T, drawingId: I } = D, R = H(this._univerInstanceService, { unitId: y, subUnitId: T }), O = D, B = this._univerInstanceService.getUnit(y,
|
|
3189
|
+
const { unitId: y, subUnitId: T, drawingId: I } = D, R = H(this._univerInstanceService, { unitId: y, subUnitId: T }), O = D, B = this._univerInstanceService.getUnit(y, F.UNIVER_SHEET);
|
|
3205
3190
|
if (!B)
|
|
3206
3191
|
return;
|
|
3207
3192
|
const K = B.getActiveSheet().getSheetId();
|
|
@@ -3219,13 +3204,12 @@ let Wt = class extends le {
|
|
|
3219
3204
|
const { scene: ce, canvas: q } = J;
|
|
3220
3205
|
if (me == null || K !== T)
|
|
3221
3206
|
return;
|
|
3222
|
-
const { left: W, top: Oe, width:
|
|
3207
|
+
const { left: W, top: Oe, width: Ue, height: st, angle: ot, flipX: at, flipY: ct, skewX: Xt, skewY: Vt } = me, dt = Ce({ unitId: y, subUnitId: T, drawingId: I }), lt = ce.getObject(dt);
|
|
3223
3208
|
if (lt != null) {
|
|
3224
|
-
lt.transformByState({ left: W, top: Oe, width:
|
|
3209
|
+
lt.transformByState({ left: W, top: Oe, width: Ue, height: st, angle: ot, flipX: at, flipY: ct, skewX: Xt, skewY: Vt });
|
|
3225
3210
|
return;
|
|
3226
3211
|
}
|
|
3227
|
-
const
|
|
3228
|
-
rotate: 0,
|
|
3212
|
+
const Pe = Mt({
|
|
3229
3213
|
startX: w.startX,
|
|
3230
3214
|
startY: 0,
|
|
3231
3215
|
endX: p.endX,
|
|
@@ -3237,12 +3221,12 @@ let Wt = class extends le {
|
|
|
3237
3221
|
top: p.absolute.top
|
|
3238
3222
|
}
|
|
3239
3223
|
}, t), ut = {
|
|
3240
|
-
left:
|
|
3241
|
-
top:
|
|
3242
|
-
width:
|
|
3243
|
-
height:
|
|
3224
|
+
left: Pe.startX,
|
|
3225
|
+
top: Pe.startY,
|
|
3226
|
+
width: Pe.width,
|
|
3227
|
+
height: Pe.height,
|
|
3244
3228
|
zIndex: this._drawingManagerService.getDrawingOrder(y, T).length - 1
|
|
3245
|
-
}, ue = new
|
|
3229
|
+
}, ue = new je(dt, ut);
|
|
3246
3230
|
ce.addObject(ue, Kt), O.allowTransform !== !1 && ce.attachTransformerTo(ue);
|
|
3247
3231
|
const re = this._ensureMap(y, T), Ae = new _t(), de = ce.getMainViewport(), Ve = {
|
|
3248
3232
|
top: 0,
|
|
@@ -3272,8 +3256,8 @@ let Wt = class extends le {
|
|
|
3272
3256
|
},
|
|
3273
3257
|
onPointerUp: () => {
|
|
3274
3258
|
},
|
|
3275
|
-
onWheel: (
|
|
3276
|
-
q.dispatchEvent(new WheelEvent(
|
|
3259
|
+
onWheel: (j) => {
|
|
3260
|
+
q.dispatchEvent(new WheelEvent(j.type, j));
|
|
3277
3261
|
},
|
|
3278
3262
|
props: (E = (_ = re.get(I)) == null ? void 0 : _.props) != null ? E : this._getFloatDomProps(I),
|
|
3279
3263
|
data: X,
|
|
@@ -3281,37 +3265,36 @@ let Wt = class extends le {
|
|
|
3281
3265
|
};
|
|
3282
3266
|
e.eventPassThrough && (He = {
|
|
3283
3267
|
...He,
|
|
3284
|
-
onPointerDown: (
|
|
3285
|
-
q.dispatchEvent(new PointerEvent(
|
|
3268
|
+
onPointerDown: (j) => {
|
|
3269
|
+
q.dispatchEvent(new PointerEvent(j.type, j));
|
|
3286
3270
|
},
|
|
3287
|
-
onPointerMove: (
|
|
3288
|
-
q.dispatchEvent(new PointerEvent(
|
|
3271
|
+
onPointerMove: (j) => {
|
|
3272
|
+
q.dispatchEvent(new PointerEvent(j.type, j));
|
|
3289
3273
|
},
|
|
3290
|
-
onPointerUp: (
|
|
3291
|
-
q.dispatchEvent(new PointerEvent(
|
|
3274
|
+
onPointerUp: (j) => {
|
|
3275
|
+
q.dispatchEvent(new PointerEvent(j.type, j));
|
|
3292
3276
|
}
|
|
3293
3277
|
}), this._canvasFloatDomService.addFloatDom(He);
|
|
3294
3278
|
const gt = ue.onTransformChange$.subscribeEvent(() => {
|
|
3295
|
-
const
|
|
3279
|
+
const j = fe(ue, J.renderUnit, Y.skeleton, R.worksheet, he);
|
|
3296
3280
|
Ne.next(
|
|
3297
|
-
|
|
3281
|
+
j
|
|
3298
3282
|
);
|
|
3299
3283
|
});
|
|
3300
|
-
this.disposeWithMe(m.subscribe((
|
|
3301
|
-
const
|
|
3302
|
-
|
|
3303
|
-
startX: $.startX,
|
|
3284
|
+
this.disposeWithMe(m.subscribe((j) => {
|
|
3285
|
+
const ke = Mt({
|
|
3286
|
+
startX: j.startX,
|
|
3304
3287
|
startY: 0,
|
|
3305
|
-
endX:
|
|
3306
|
-
endY:
|
|
3288
|
+
endX: j.endX,
|
|
3289
|
+
endY: j.endY,
|
|
3307
3290
|
width: t.width,
|
|
3308
3291
|
height: t.height,
|
|
3309
3292
|
absolute: {
|
|
3310
3293
|
left: p.absolute.left,
|
|
3311
3294
|
top: p.absolute.top
|
|
3312
3295
|
}
|
|
3313
|
-
}, t), ze = Ce({ unitId: y, subUnitId: T, drawingId: I }), Ke = new
|
|
3314
|
-
left:
|
|
3296
|
+
}, t), ze = Ce({ unitId: y, subUnitId: T, drawingId: I }), Ke = new je(ze, {
|
|
3297
|
+
left: ke.startX,
|
|
3315
3298
|
top: 0,
|
|
3316
3299
|
width: t.width,
|
|
3317
3300
|
height: t.height,
|
|
@@ -3320,8 +3303,8 @@ let Wt = class extends le {
|
|
|
3320
3303
|
Ne.next(ft);
|
|
3321
3304
|
}));
|
|
3322
3305
|
const ge = (M = this._renderManagerService.getRenderById(y)) == null ? void 0 : M.with(V);
|
|
3323
|
-
ge == null || ge.currentSkeleton$.subscribe((
|
|
3324
|
-
|
|
3306
|
+
ge == null || ge.currentSkeleton$.subscribe((j) => {
|
|
3307
|
+
j && d.sheetId !== j.sheetId && this._removeDom(f, !0);
|
|
3325
3308
|
}), Ae.add(() => {
|
|
3326
3309
|
this._canvasFloatDomService.removeFloatDom(I);
|
|
3327
3310
|
}), gt && Ae.add(gt), this._domLayerInfoMap.set(I, he), re.set(I, {
|
|
@@ -3356,7 +3339,7 @@ let Wt = class extends le {
|
|
|
3356
3339
|
d();
|
|
3357
3340
|
return;
|
|
3358
3341
|
}
|
|
3359
|
-
(
|
|
3342
|
+
(es.indexOf(m.id) > -1 || m.id === Di.id || m.id === Dn.id) && d();
|
|
3360
3343
|
}));
|
|
3361
3344
|
const g = (m, w) => {
|
|
3362
3345
|
r = m, s = w, d();
|
|
@@ -3400,14 +3383,14 @@ let Wt = class extends le {
|
|
|
3400
3383
|
};
|
|
3401
3384
|
}
|
|
3402
3385
|
};
|
|
3403
|
-
Wt =
|
|
3386
|
+
Wt = ho([
|
|
3404
3387
|
Me(0, N(ne)),
|
|
3405
3388
|
Me(1, Ge),
|
|
3406
3389
|
Me(2, N(G)),
|
|
3407
3390
|
Me(3, oe),
|
|
3408
|
-
Me(4, N(
|
|
3391
|
+
Me(4, N(Wi)),
|
|
3409
3392
|
Me(5, ae),
|
|
3410
|
-
Me(6, N(
|
|
3393
|
+
Me(6, N(Kr))
|
|
3411
3394
|
], Wt);
|
|
3412
3395
|
function Qe(i, n, e) {
|
|
3413
3396
|
const t = e.getCellWithCoordByIndex(i, n), r = t.isMergedMainCell ? t.mergeInfo : t;
|
|
@@ -3455,33 +3438,33 @@ function yt(i, n) {
|
|
|
3455
3438
|
const e = Number.parseFloat(i);
|
|
3456
3439
|
return n * e / 100;
|
|
3457
3440
|
}
|
|
3458
|
-
var
|
|
3459
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
3460
|
-
(o = i[s]) && (r =
|
|
3461
|
-
return
|
|
3462
|
-
}, qt = (i, n) => (e, t) => n(e, t, i),
|
|
3463
|
-
const
|
|
3464
|
-
let
|
|
3465
|
-
constructor(i =
|
|
3441
|
+
var fo = Object.defineProperty, mo = Object.getOwnPropertyDescriptor, po = (i, n, e) => n in i ? fo(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e, wo = (i, n, e, t) => {
|
|
3442
|
+
for (var r = t > 1 ? void 0 : t ? mo(n, e) : n, s = i.length - 1, o; s >= 0; s--)
|
|
3443
|
+
(o = i[s]) && (r = o(r) || r);
|
|
3444
|
+
return r;
|
|
3445
|
+
}, qt = (i, n) => (e, t) => n(e, t, i), Dr = (i, n, e) => po(i, typeof n != "symbol" ? n + "" : n, e);
|
|
3446
|
+
const _o = "SHEET_IMAGE_UI_PLUGIN";
|
|
3447
|
+
let jt = class extends ei {
|
|
3448
|
+
constructor(i = Pn, n, e, t) {
|
|
3466
3449
|
super(), this._config = i, this._injector = n, this._renderManagerService = e, this._configService = t;
|
|
3467
3450
|
const { menu: r, ...s } = ti(
|
|
3468
3451
|
{},
|
|
3469
|
-
|
|
3452
|
+
Pn,
|
|
3470
3453
|
this._config
|
|
3471
3454
|
);
|
|
3472
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
3455
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(os, s);
|
|
3473
3456
|
}
|
|
3474
3457
|
onStarting() {
|
|
3475
3458
|
ni(this._injector, [
|
|
3476
3459
|
[Wt],
|
|
3477
3460
|
[Bt],
|
|
3478
3461
|
[Et],
|
|
3479
|
-
[
|
|
3462
|
+
[kt],
|
|
3480
3463
|
[Nt],
|
|
3481
3464
|
[At],
|
|
3482
3465
|
[Ot],
|
|
3483
|
-
[
|
|
3484
|
-
[
|
|
3466
|
+
[Pt],
|
|
3467
|
+
[Ut]
|
|
3485
3468
|
]), zt(this._injector, [
|
|
3486
3469
|
[Wt]
|
|
3487
3470
|
]);
|
|
@@ -3494,11 +3477,11 @@ let $t = class extends ei {
|
|
|
3494
3477
|
onRendered() {
|
|
3495
3478
|
this._registerRenderModules(), zt(this._injector, [
|
|
3496
3479
|
[Nt],
|
|
3497
|
-
[
|
|
3480
|
+
[kt],
|
|
3498
3481
|
[Bt],
|
|
3499
3482
|
[Ot],
|
|
3500
|
-
[
|
|
3501
|
-
[
|
|
3483
|
+
[Pt],
|
|
3484
|
+
[Ut]
|
|
3502
3485
|
]);
|
|
3503
3486
|
}
|
|
3504
3487
|
onSteady() {
|
|
@@ -3510,25 +3493,25 @@ let $t = class extends ei {
|
|
|
3510
3493
|
[an],
|
|
3511
3494
|
[sn]
|
|
3512
3495
|
].forEach((i) => {
|
|
3513
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3496
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(F.UNIVER_SHEET, i));
|
|
3514
3497
|
});
|
|
3515
3498
|
}
|
|
3516
3499
|
};
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3500
|
+
Dr(jt, "type", F.UNIVER_SHEET);
|
|
3501
|
+
Dr(jt, "pluginName", _o);
|
|
3502
|
+
jt = wo([
|
|
3503
|
+
qr(oi, ii, hi, mi),
|
|
3521
3504
|
qt(1, N(tt)),
|
|
3522
3505
|
qt(2, ne),
|
|
3523
|
-
qt(3,
|
|
3524
|
-
],
|
|
3506
|
+
qt(3, Qr)
|
|
3507
|
+
], jt);
|
|
3525
3508
|
export {
|
|
3526
|
-
|
|
3509
|
+
x as ClearSheetDrawingTransformerOperation,
|
|
3527
3510
|
Ir as DeleteDrawingsCommand,
|
|
3528
3511
|
hr as EditSheetDrawingOperation,
|
|
3529
3512
|
gr as GroupSheetDrawingCommand,
|
|
3530
3513
|
Gt as InsertFloatImageCommand,
|
|
3531
|
-
|
|
3514
|
+
Ft as InsertSheetDrawingCommand,
|
|
3532
3515
|
rt as MoveDrawingsCommand,
|
|
3533
3516
|
nt as RemoveSheetDrawingCommand,
|
|
3534
3517
|
br as SHEETS_IMAGE_MENU_ID,
|
|
@@ -3537,5 +3520,5 @@ export {
|
|
|
3537
3520
|
Wt as SheetCanvasFloatDomManagerService,
|
|
3538
3521
|
ur as SidebarSheetDrawingOperation,
|
|
3539
3522
|
mr as UngroupSheetDrawingCommand,
|
|
3540
|
-
|
|
3523
|
+
jt as UniverSheetsDrawingUIPlugin
|
|
3541
3524
|
};
|