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