@univerjs/sheets-drawing-ui 0.7.0-beta.0 → 0.7.0-nightly.202504301607
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +9 -2
- package/lib/es/index.js +1298 -1285
- package/lib/index.css +1 -1
- package/lib/index.js +1298 -1285
- package/lib/types/controllers/drawing-popup-menu.controller.d.ts +8 -5
- package/lib/umd/index.js +9 -2
- package/package.json +14 -14
- package/LICENSE +0 -176
- package/lib/types/views/upload-loading/UploadLoading.d.ts +0 -16
package/lib/es/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var te = (i, t, e) =>
|
|
4
|
-
import { CommandType as J, ICommandService as G, IUndoRedoService as
|
|
5
|
-
import { DocDrawingController as
|
|
6
|
-
import { SetDrawingSelectedOperation as
|
|
7
|
-
import { ImageCropperObject as
|
|
8
|
-
import { IRenderManagerService as q, CURSOR_TYPE as
|
|
9
|
-
import { ISheetDrawingService as oe, DrawingApplyType as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
const
|
|
1
|
+
var Nr = Object.defineProperty;
|
|
2
|
+
var kr = (i, t, e) => t in i ? Nr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var te = (i, t, e) => kr(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { CommandType as J, ICommandService as G, IUndoRedoService as Le, sequenceExecute as Ln, LocaleService as nt, IUniverInstanceService as Se, Inject as A, Injector as Ye, IContextService as Yn, IImageIoService as Wr, RxDisposable as jr, UniverInstanceType as F, FOCUSING_COMMON_DRAWINGS as xe, DrawingTypeEnum as j, Disposable as ie, ArrangeTypeEnum as pt, createDocumentModelWithStyle as Ht, ObjectRelativeFromV as pn, ObjectRelativeFromH as wn, WrapTextType as _n, PositionedObjectLayoutType as vn, BooleanNumber as Sn, BuildTextUtils as zt, ImageSourceType as In, generateRandomId as bt, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as qe, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Be, InterceptorEffectEnum as Br, ObjectMatrix as $r, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as xr, Tools as Re, IPermissionService as Fr, UserManagerService as Lr, LifecycleService as Yr, LifecycleStages as Gr, DisposableCollection as wt, fromEventSubject as Xr, PRINT_CHART_COMPONENT_KEY as Vr, Rectangle as Hr, Direction as ve, FOCUSING_FX_BAR_EDITOR as zr, EDITOR_ACTIVATED as Kr, FOCUSING_PANEL_EDITOR as Zr, DependentOn as Jr, IConfigService as qr, Plugin as Qr, merge as ei, registerDependencies as ti, touchDependencies as Ft } from "@univerjs/core";
|
|
5
|
+
import { DocDrawingController as ni, UniverDocsDrawingPlugin as ri } from "@univerjs/docs-drawing";
|
|
6
|
+
import { SetDrawingSelectedOperation as Nt, IDrawingManagerService as se, IImageIoService as ii, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Cn, DRAWING_IMAGE_COUNT_LIMIT as Dn, ImageUploadStatusType as Pe, DRAWING_IMAGE_ALLOW_SIZE as bn, getImageSize as Lt, DRAWING_IMAGE_WIDTH_LIMIT as Rn, DRAWING_IMAGE_HEIGHT_LIMIT as Mn, ImageSourceType as si, getDrawingShapeKeyByDrawingSearch as Ie, UniverDrawingPlugin as oi } from "@univerjs/drawing";
|
|
7
|
+
import { ImageCropperObject as ai, COMPONENT_IMAGE_POPUP_MENU as ci, OpenImageCropOperation as di, ImageResetSizeOperation as li, DrawingRenderService as Gn, DrawingCommonPanel as ui, UniverDrawingUIPlugin as hi } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as q, CURSOR_TYPE as gi, precisionTo as _t, transformObjectOutOfGroup as fi, getGroupState as mi, getCurrentTypeOfRenderer as on, RENDER_CLASS_TYPE as Ae, Rect as Ne, ObjectType as yn, DRAWING_OBJECT_LAYER_INDEX as Yt, SHEET_VIEWPORT_KEY as Xn } from "@univerjs/engine-render";
|
|
9
|
+
import { ISheetDrawingService as oe, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as pi } from "@univerjs/sheets-drawing";
|
|
10
|
+
import { MessageType as we, render as wi, unmount as _i, RadioGroup as vi, Radio as Gt } from "@univerjs/design";
|
|
11
|
+
import { SheetCanvasPopManagerService as Si, HoverManagerService as Ii, SheetSkeletonManagerService as V, convertPositionSheetOverGridToAbsolute as Ci, ISheetSelectionRenderService as Ge, attachRangeWithCoord as Vn, IEditorBridgeService as Di, IAutoFillService as bi, EditingRenderController as Ri, SetCellEditVisibleOperation as En, PREDEFINED_HOOK_NAME as $e, COPY_TYPE as Ce, discreteRangeToRange as Tn, virtualizeDiscreteRanges as Mi, ISheetClipboardService as yi, SetZoomRatioOperation as On, SetScrollOperation as Ei, SheetPrintInterceptorService as Ti, getCurrentRangeDisable$ as Oi } from "@univerjs/sheets-ui";
|
|
12
|
+
import { ISidebarService as Ui, IMessageService as Hn, ILocalFileService as Pi, IDialogService as Ai, IClipboardInterfaceService as Ni, CanvasFloatDomService as ki, PrintFloatDomSingle as Wi, ComponentManager as zn, connectInjector as ji, getMenuHiddenObservable as an, MenuItemType as cn, useDependency as Qe, RibbonStartGroup as Bi, KeyCode as Fe, IMenuManagerService as $i, IShortcutService as xi } from "@univerjs/ui";
|
|
13
|
+
import { takeUntil as Un, throttleTime as Fi, combineLatest as vt, switchMap as _e, EMPTY as me, tap as Pn, map as Me, distinctUntilChanged as An, Subject as Xt, filter as Li, take as Yi, BehaviorSubject as je, of as Nn } from "rxjs";
|
|
14
|
+
import { SheetInterceptorService as kt, getSheetCommandTarget as ae, SheetsSelectionsService as dn, SetRangeValuesCommand as kn, INTERCEPTOR_POINT as Gi, InterceptCellContentPriority as Xi, WorkbookViewPermission as Wn, WorksheetViewPermission as jn, WorkbookEditablePermission as Kt, WorksheetEditPermission as Zt, SetFrozenMutation as Vi, SetWorksheetRowAutoHeightMutation as Hi, COMMAND_LISTENER_SKELETON_CHANGE as zi, InsertRowCommand as Kn, InsertColCommand as Zn, RemoveRowCommand as Jn, RemoveColCommand as qn, DeleteRangeMoveLeftCommand as Qn, DeleteRangeMoveUpCommand as er, InsertRangeMoveDownCommand as tr, InsertRangeMoveRightCommand as nr, DeltaRowHeightCommand as Jt, SetRowHeightCommand as qt, DeltaColumnWidthCommand as rr, SetColWidthCommand as ir, SetRowHiddenCommand as sr, SetSpecificRowsVisibleCommand as or, SetSpecificColsVisibleCommand as ar, SetColHiddenCommand as cr, MoveColsCommand as dr, MoveRowsCommand as lr, MoveRangeCommand as ur, SetRowVisibleMutation as Ki, SetRowHiddenMutation as Zi, SetColVisibleMutation as Ji, SetColHiddenMutation as qi, SetWorksheetRowHeightMutation as Qi, SetWorksheetColWidthMutation as es, SetWorksheetActiveOperation as ts, RangeProtectionPermissionEditPoint as ns } from "@univerjs/sheets";
|
|
15
|
+
import { docDrawingPositionToTransform as Bn, ReplaceSnapshotCommand as rs, InnerPasteCommand as is } from "@univerjs/docs-ui";
|
|
16
|
+
import { jsx as Z, jsxs as Qt } from "react/jsx-runtime";
|
|
17
|
+
import { useMemo as ss, forwardRef as hr, useRef as os, createElement as gr, useState as en, useEffect as fr } from "react";
|
|
18
|
+
const as = "sheets-drawing-ui.config", $n = {}, L = {
|
|
19
19
|
id: "sheet.operation.clear-drawing-transformer",
|
|
20
20
|
type: J.MUTATION,
|
|
21
21
|
handler: (i, t) => {
|
|
@@ -25,48 +25,48 @@ const gs = "sheets-drawing-ui.config", Yn = {}, F = {
|
|
|
25
25
|
(s = (r = e.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
|
|
26
26
|
}), !0;
|
|
27
27
|
}
|
|
28
|
-
},
|
|
28
|
+
}, rt = {
|
|
29
29
|
id: "sheet.command.remove-sheet-image",
|
|
30
30
|
type: J.COMMAND,
|
|
31
31
|
handler: (i, t) => {
|
|
32
32
|
var S, C, b;
|
|
33
|
-
const e = i.get(G), n = i.get(
|
|
33
|
+
const e = i.get(G), n = i.get(Le), r = i.get(kt), s = i.get(oe);
|
|
34
34
|
if (!t) return !1;
|
|
35
35
|
const { drawings: o } = t, a = [];
|
|
36
36
|
o.forEach((v) => {
|
|
37
37
|
const { unitId: D } = v;
|
|
38
38
|
a.push(D);
|
|
39
39
|
});
|
|
40
|
-
const
|
|
41
|
-
return
|
|
40
|
+
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = r.onCommandExecute({ id: rt.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, f = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
|
|
41
|
+
return Ln([...(S = m.preRedos) != null ? S : [], p, ...m.redos], e) ? (n.pushUndoRedo({
|
|
42
42
|
unitID: u,
|
|
43
43
|
undoMutations: [
|
|
44
|
-
...(C =
|
|
45
|
-
|
|
46
|
-
...
|
|
47
|
-
{ id:
|
|
44
|
+
...(C = m.preUndos) != null ? C : [],
|
|
45
|
+
f,
|
|
46
|
+
...m.undos,
|
|
47
|
+
{ id: L.id, params: a }
|
|
48
48
|
],
|
|
49
49
|
redoMutations: [
|
|
50
|
-
...(b =
|
|
50
|
+
...(b = m.preRedos) != null ? b : [],
|
|
51
51
|
p,
|
|
52
|
-
...
|
|
53
|
-
{ id:
|
|
52
|
+
...m.redos,
|
|
53
|
+
{ id: L.id, params: a }
|
|
54
54
|
]
|
|
55
55
|
}), !0) : !1;
|
|
56
56
|
}
|
|
57
|
-
},
|
|
57
|
+
}, mr = "COMPONENT_SHEET_DRAWING_PANEL", pr = {
|
|
58
58
|
id: "sidebar.operation.sheet-image",
|
|
59
59
|
type: J.COMMAND,
|
|
60
60
|
handler: async (i, t) => {
|
|
61
|
-
const e = i.get(
|
|
61
|
+
const e = i.get(Ui), n = i.get(nt), r = i.get(Se), s = i.get(G);
|
|
62
62
|
if (!ae(r)) return !1;
|
|
63
63
|
switch (t.value) {
|
|
64
64
|
case "open":
|
|
65
65
|
e.open({
|
|
66
66
|
header: { title: n.t("sheetImage.panel.title") },
|
|
67
|
-
children: { label:
|
|
67
|
+
children: { label: mr },
|
|
68
68
|
onClose: () => {
|
|
69
|
-
s.syncExecuteCommand(
|
|
69
|
+
s.syncExecuteCommand(Nt.id, []);
|
|
70
70
|
},
|
|
71
71
|
width: 360
|
|
72
72
|
});
|
|
@@ -78,47 +78,42 @@ const gs = "sheets-drawing-ui.config", Yn = {}, F = {
|
|
|
78
78
|
}
|
|
79
79
|
return !0;
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, wr = {
|
|
82
82
|
id: "sheet.operation.edit-sheet-image",
|
|
83
83
|
type: J.OPERATION,
|
|
84
84
|
handler: (i, t) => {
|
|
85
85
|
const e = i.get(G);
|
|
86
|
-
return t == null ? !1 : (e.syncExecuteCommand(
|
|
87
|
-
}
|
|
88
|
-
}, ms = "univer-upload-loading", fs = "univer-upload-loading-body", ps = "univer-upload-loading-body-animation", ws = "univer-upload-loading-body-text", Ct = {
|
|
89
|
-
uploadLoading: ms,
|
|
90
|
-
uploadLoadingBody: fs,
|
|
91
|
-
uploadLoadingBodyAnimation: ps,
|
|
92
|
-
uploadLoadingBodyText: ws
|
|
93
|
-
}, _s = () => {
|
|
94
|
-
const i = Me(zn), t = Me(rt), [e, n] = ss.useState(0);
|
|
95
|
-
return gn(() => {
|
|
96
|
-
const r = i.change$.subscribe((s) => {
|
|
97
|
-
n(s);
|
|
98
|
-
});
|
|
99
|
-
return () => {
|
|
100
|
-
r.unsubscribe();
|
|
101
|
-
};
|
|
102
|
-
}, [i]), /* @__PURE__ */ K("div", { style: { display: e > 0 ? "block" : "none" }, className: Ct.uploadLoading, children: /* @__PURE__ */ Et("div", { className: Ct.uploadLoadingBody, children: [
|
|
103
|
-
/* @__PURE__ */ K("div", { className: Ct.uploadLoadingBodyAnimation }),
|
|
104
|
-
/* @__PURE__ */ K("div", { className: Ct.uploadLoadingBodyText, children: `${t.t("uploadLoading.loading")}: ${e}` })
|
|
105
|
-
] }) });
|
|
86
|
+
return t == null ? !1 : (e.syncExecuteCommand(Nt.id, [t]), e.executeCommand(pr.id, { value: "open" }), !0);
|
|
87
|
+
}
|
|
106
88
|
};
|
|
107
|
-
var
|
|
108
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
89
|
+
var cs = Object.getOwnPropertyDescriptor, ds = (i, t, e, n) => {
|
|
90
|
+
for (var r = n > 1 ? void 0 : n ? cs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
109
91
|
(o = i[s]) && (r = o(r) || r);
|
|
110
92
|
return r;
|
|
111
|
-
},
|
|
112
|
-
let
|
|
113
|
-
constructor(t, e, n, r, s, o, a, c) {
|
|
93
|
+
}, de = (i, t) => (e, n) => t(e, n, i);
|
|
94
|
+
let Rt = class extends jr {
|
|
95
|
+
constructor(t, e, n, r, s, o, a, d, u, c) {
|
|
114
96
|
super();
|
|
115
97
|
te(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
116
|
-
this._injector = t, this.
|
|
98
|
+
this._injector = t, this._localeService = e, this._drawingManagerService = n, this._canvasPopManagerService = r, this._renderManagerService = s, this._univerInstanceService = o, this._messageService = a, this._contextService = d, this._ioService = u, this._commandService = c, this._init();
|
|
117
99
|
}
|
|
118
100
|
_init() {
|
|
119
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
101
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(Un(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(Un(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
|
|
102
|
+
}
|
|
103
|
+
_setupLoadingStatus() {
|
|
104
|
+
const t = "image-upload-loading";
|
|
105
|
+
let e;
|
|
106
|
+
this.disposeWithMe(this._ioService.change$.subscribe((n) => {
|
|
107
|
+
n > 0 && !e ? e = this._messageService.show({
|
|
108
|
+
id: t,
|
|
109
|
+
type: we.Loading,
|
|
110
|
+
content: `${this._localeService.t("uploadLoading.loading")}: ${n}`,
|
|
111
|
+
duration: 0
|
|
112
|
+
}) : n === 0 && (e == null || e.dispose(), e = void 0);
|
|
113
|
+
}));
|
|
120
114
|
}
|
|
121
115
|
_dispose(t) {
|
|
116
|
+
super.dispose();
|
|
122
117
|
const e = t.getUnitId();
|
|
123
118
|
this._renderManagerService.removeRender(e);
|
|
124
119
|
}
|
|
@@ -131,7 +126,7 @@ let Tt = class extends xr {
|
|
|
131
126
|
_hasCropObject(t) {
|
|
132
127
|
const e = t.getAllObjectsByOrder();
|
|
133
128
|
for (const n of e)
|
|
134
|
-
if (n instanceof
|
|
129
|
+
if (n instanceof ai)
|
|
135
130
|
return !0;
|
|
136
131
|
return !1;
|
|
137
132
|
}
|
|
@@ -145,43 +140,41 @@ let Tt = class extends xr {
|
|
|
145
140
|
return;
|
|
146
141
|
let r;
|
|
147
142
|
this.disposeWithMe(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if (o.size > 1) {
|
|
154
|
-
r == null || r.dispose();
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
const a = o.values().next().value;
|
|
158
|
-
if (!a)
|
|
159
|
-
return;
|
|
160
|
-
const c = a.oKey, u = this._drawingManagerService.getDrawingOKey(c);
|
|
161
|
-
if (!u)
|
|
162
|
-
return;
|
|
163
|
-
const { unitId: d, subUnitId: l, drawingId: g, drawingType: h } = u, f = u.data;
|
|
164
|
-
if (f && f.disablePopup)
|
|
165
|
-
return;
|
|
143
|
+
n.createControl$.subscribe(() => {
|
|
144
|
+
if (this._contextService.setContextValue(xe, !0), this._hasCropObject(e))
|
|
145
|
+
return;
|
|
146
|
+
const o = n.getSelectedObjectMap();
|
|
147
|
+
if (o.size > 1) {
|
|
166
148
|
r == null || r.dispose();
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const a = o.values().next().value;
|
|
152
|
+
if (!a)
|
|
153
|
+
return;
|
|
154
|
+
const d = a.oKey, u = this._drawingManagerService.getDrawingOKey(d);
|
|
155
|
+
if (!u)
|
|
156
|
+
return;
|
|
157
|
+
const { unitId: c, subUnitId: l, drawingId: g, drawingType: h } = u, m = u.data;
|
|
158
|
+
if (m && m.disablePopup)
|
|
159
|
+
return;
|
|
160
|
+
r == null || r.dispose();
|
|
161
|
+
const p = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
|
|
162
|
+
r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
163
|
+
componentKey: ci,
|
|
164
|
+
direction: "horizontal",
|
|
165
|
+
offset: [2, 0],
|
|
166
|
+
extraProps: {
|
|
167
|
+
menuItems: p || this._getImageMenuItems(c, l, g, h)
|
|
168
|
+
}
|
|
169
|
+
}));
|
|
170
|
+
})
|
|
178
171
|
), this.disposeWithMe(
|
|
179
172
|
n.clearControl$.subscribe(() => {
|
|
180
|
-
r == null || r.dispose(), this._contextService.setContextValue(
|
|
173
|
+
r == null || r.dispose(), this._contextService.setContextValue(xe, !1), this._commandService.syncExecuteCommand(Nt.id, []);
|
|
181
174
|
})
|
|
182
175
|
), this.disposeWithMe(
|
|
183
176
|
this._contextService.contextChanged$.subscribe((o) => {
|
|
184
|
-
o[
|
|
177
|
+
o[xe] === !1 && (r == null || r.dispose());
|
|
185
178
|
})
|
|
186
179
|
), this.disposeWithMe(
|
|
187
180
|
n.changing$.subscribe(() => {
|
|
@@ -194,60 +187,62 @@ let Tt = class extends xr {
|
|
|
194
187
|
{
|
|
195
188
|
label: "image-popup.edit",
|
|
196
189
|
index: 0,
|
|
197
|
-
commandId:
|
|
190
|
+
commandId: wr.id,
|
|
198
191
|
commandParams: { unitId: t, subUnitId: e, drawingId: n },
|
|
199
|
-
disable: r ===
|
|
192
|
+
disable: r === j.DRAWING_DOM
|
|
200
193
|
},
|
|
201
194
|
{
|
|
202
195
|
label: "image-popup.delete",
|
|
203
196
|
index: 1,
|
|
204
|
-
commandId:
|
|
197
|
+
commandId: rt.id,
|
|
205
198
|
commandParams: { unitId: t, drawings: [{ unitId: t, subUnitId: e, drawingId: n }] },
|
|
206
199
|
disable: !1
|
|
207
200
|
},
|
|
208
201
|
{
|
|
209
202
|
label: "image-popup.crop",
|
|
210
203
|
index: 2,
|
|
211
|
-
commandId:
|
|
204
|
+
commandId: di.id,
|
|
212
205
|
commandParams: { unitId: t, subUnitId: e, drawingId: n },
|
|
213
|
-
disable: r ===
|
|
206
|
+
disable: r === j.DRAWING_DOM
|
|
214
207
|
},
|
|
215
208
|
{
|
|
216
209
|
label: "image-popup.reset",
|
|
217
210
|
index: 3,
|
|
218
|
-
commandId:
|
|
211
|
+
commandId: li.id,
|
|
219
212
|
commandParams: [{ unitId: t, subUnitId: e, drawingId: n }],
|
|
220
|
-
disable: r ===
|
|
213
|
+
disable: r === j.DRAWING_DOM
|
|
221
214
|
}
|
|
222
215
|
];
|
|
223
216
|
}
|
|
224
217
|
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
218
|
+
Rt = ds([
|
|
219
|
+
de(0, A(Ye)),
|
|
220
|
+
de(1, A(nt)),
|
|
221
|
+
de(2, se),
|
|
222
|
+
de(3, A(Si)),
|
|
223
|
+
de(4, q),
|
|
224
|
+
de(5, Se),
|
|
225
|
+
de(6, Hn),
|
|
226
|
+
de(7, Yn),
|
|
227
|
+
de(8, Wr),
|
|
228
|
+
de(9, G)
|
|
229
|
+
], Rt);
|
|
230
|
+
var ls = Object.getOwnPropertyDescriptor, us = (i, t, e, n) => {
|
|
231
|
+
for (var r = n > 1 ? void 0 : n ? ls(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
237
232
|
(o = i[s]) && (r = o(r) || r);
|
|
238
233
|
return r;
|
|
239
|
-
},
|
|
240
|
-
let
|
|
234
|
+
}, St = (i, t) => (e, n) => t(e, n, i);
|
|
235
|
+
let tn = class extends ie {
|
|
241
236
|
constructor(t, e, n, r, s) {
|
|
242
237
|
super();
|
|
243
238
|
te(this, "_isSetCursor", !1);
|
|
244
239
|
this._context = t, this._hoverManagerService = e, this._selectionsService = n, this._drawingRenderService = r, this._sheetSkeletonManagerService = s, this._initHover(), this._initImageClick();
|
|
245
240
|
}
|
|
246
241
|
_initHover() {
|
|
247
|
-
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(
|
|
242
|
+
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(Fi(33)).subscribe((t) => {
|
|
248
243
|
var n, r;
|
|
249
244
|
let e = [];
|
|
250
|
-
t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(
|
|
245
|
+
t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(gi.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
|
|
251
246
|
}));
|
|
252
247
|
}
|
|
253
248
|
_initImageClick() {
|
|
@@ -261,70 +256,70 @@ let sn = class extends ie {
|
|
|
261
256
|
}));
|
|
262
257
|
}
|
|
263
258
|
};
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
],
|
|
259
|
+
tn = us([
|
|
260
|
+
St(1, A(Ii)),
|
|
261
|
+
St(2, A(dn)),
|
|
262
|
+
St(3, A(Gn)),
|
|
263
|
+
St(4, A(V))
|
|
264
|
+
], tn);
|
|
270
265
|
function z(i, t, e) {
|
|
271
|
-
const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX:
|
|
272
|
-
if (
|
|
266
|
+
const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: u = 0 } = i, c = e.getCurrent();
|
|
267
|
+
if (c == null)
|
|
273
268
|
return;
|
|
274
269
|
const l = Ci(
|
|
275
|
-
|
|
276
|
-
|
|
270
|
+
c.unitId,
|
|
271
|
+
c.sheetId,
|
|
277
272
|
{ from: n, to: r },
|
|
278
273
|
e
|
|
279
274
|
);
|
|
280
|
-
let { left: g, top: h, width:
|
|
281
|
-
const
|
|
282
|
-
return g +
|
|
275
|
+
let { left: g, top: h, width: m, height: p } = l;
|
|
276
|
+
const f = e.getCurrentSkeleton(), _ = f.rowHeaderWidth + f.columnTotalWidth, S = f.columnHeaderHeight + f.rowTotalHeight;
|
|
277
|
+
return g + m > _ && (g = _ - m), h + p > S && (h = S - p), {
|
|
283
278
|
flipY: s,
|
|
284
279
|
flipX: o,
|
|
285
280
|
angle: a,
|
|
286
|
-
skewX:
|
|
281
|
+
skewX: d,
|
|
287
282
|
skewY: u,
|
|
288
283
|
left: g,
|
|
289
284
|
top: h,
|
|
290
|
-
width:
|
|
285
|
+
width: m,
|
|
291
286
|
height: p
|
|
292
287
|
};
|
|
293
288
|
}
|
|
294
289
|
function x(i, t) {
|
|
295
|
-
const { left: e = 0, top: n = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle:
|
|
290
|
+
const { left: e = 0, top: n = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: d = 0, skewX: u = 0, skewY: c = 0 } = i, l = t.getCellWithCoordByOffset(e, n);
|
|
296
291
|
if (l == null)
|
|
297
292
|
return;
|
|
298
293
|
const g = {
|
|
299
294
|
column: l.actualColumn,
|
|
300
|
-
columnOffset:
|
|
295
|
+
columnOffset: _t(e - l.startX, 1),
|
|
301
296
|
row: l.actualRow,
|
|
302
|
-
rowOffset:
|
|
297
|
+
rowOffset: _t(n - l.startY, 1)
|
|
303
298
|
}, h = t.getCellWithCoordByOffset(e + r, n + s);
|
|
304
299
|
if (h == null)
|
|
305
300
|
return;
|
|
306
|
-
const
|
|
301
|
+
const m = {
|
|
307
302
|
column: h.actualColumn,
|
|
308
|
-
columnOffset:
|
|
303
|
+
columnOffset: _t(e + r - h.startX, 1),
|
|
309
304
|
row: h.actualRow,
|
|
310
|
-
rowOffset:
|
|
305
|
+
rowOffset: _t(n + s - h.startY, 1)
|
|
311
306
|
};
|
|
312
307
|
return {
|
|
313
308
|
flipY: o,
|
|
314
309
|
flipX: a,
|
|
315
|
-
angle:
|
|
310
|
+
angle: d,
|
|
316
311
|
skewX: u,
|
|
317
|
-
skewY:
|
|
312
|
+
skewY: c,
|
|
318
313
|
from: g,
|
|
319
|
-
to:
|
|
314
|
+
to: m
|
|
320
315
|
};
|
|
321
316
|
}
|
|
322
|
-
var
|
|
323
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
317
|
+
var hs = Object.getOwnPropertyDescriptor, gs = (i, t, e, n) => {
|
|
318
|
+
for (var r = n > 1 ? void 0 : n ? hs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
324
319
|
(o = i[s]) && (r = o(r) || r);
|
|
325
320
|
return r;
|
|
326
|
-
},
|
|
327
|
-
let
|
|
321
|
+
}, It = (i, t) => (e, n) => t(e, n, i);
|
|
322
|
+
let nn = class extends ie {
|
|
328
323
|
constructor(i, t, e, n, r) {
|
|
329
324
|
super(), this._context = i, this._sheetDrawingService = t, this._drawingManagerService = e, this._sheetSelectionRenderService = n, this._sheetSkeletonManagerService = r, this._init();
|
|
330
325
|
}
|
|
@@ -344,230 +339,230 @@ let on = class extends ie {
|
|
|
344
339
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
345
340
|
}
|
|
346
341
|
};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
],
|
|
353
|
-
function
|
|
342
|
+
nn = gs([
|
|
343
|
+
It(1, oe),
|
|
344
|
+
It(2, se),
|
|
345
|
+
It(3, A(Ge)),
|
|
346
|
+
It(4, A(V))
|
|
347
|
+
], nn);
|
|
348
|
+
function fs(i) {
|
|
354
349
|
const t = [];
|
|
355
350
|
return i.forEach((e) => {
|
|
356
|
-
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n,
|
|
357
|
-
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId:
|
|
351
|
+
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = mi(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
352
|
+
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: m, drawingId: p } = l;
|
|
358
353
|
return {
|
|
359
354
|
unitId: h,
|
|
360
|
-
subUnitId:
|
|
355
|
+
subUnitId: m,
|
|
361
356
|
drawingId: p,
|
|
362
357
|
transform: {
|
|
363
358
|
...g,
|
|
364
|
-
left: g.left -
|
|
365
|
-
top: g.top -
|
|
359
|
+
left: g.left - d.left,
|
|
360
|
+
top: g.top - d.top
|
|
366
361
|
},
|
|
367
362
|
groupId: a
|
|
368
363
|
};
|
|
369
|
-
}),
|
|
364
|
+
}), c = {
|
|
370
365
|
unitId: s,
|
|
371
366
|
subUnitId: o,
|
|
372
367
|
drawingId: a,
|
|
373
|
-
drawingType:
|
|
374
|
-
transform:
|
|
368
|
+
drawingType: j.DRAWING_GROUP,
|
|
369
|
+
transform: d
|
|
375
370
|
};
|
|
376
371
|
t.push({
|
|
377
|
-
parent:
|
|
372
|
+
parent: c,
|
|
378
373
|
children: u
|
|
379
374
|
});
|
|
380
375
|
}), t;
|
|
381
376
|
}
|
|
382
|
-
function
|
|
377
|
+
function ms(i) {
|
|
383
378
|
const t = [];
|
|
384
379
|
return i.forEach((e) => {
|
|
385
|
-
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform:
|
|
386
|
-
if (
|
|
380
|
+
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: d = { width: 0, height: 0 } } = n;
|
|
381
|
+
if (d == null)
|
|
387
382
|
return;
|
|
388
383
|
const u = r.map((l) => {
|
|
389
|
-
const { transform: g } = l, { unitId: h, subUnitId:
|
|
384
|
+
const { transform: g } = l, { unitId: h, subUnitId: m, drawingId: p } = l, f = fi(g || {}, d, d.width || 0, d.height || 0);
|
|
390
385
|
return {
|
|
391
386
|
unitId: h,
|
|
392
|
-
subUnitId:
|
|
387
|
+
subUnitId: m,
|
|
393
388
|
drawingId: p,
|
|
394
|
-
transform:
|
|
389
|
+
transform: f,
|
|
395
390
|
groupId: void 0
|
|
396
391
|
};
|
|
397
|
-
}),
|
|
392
|
+
}), c = {
|
|
398
393
|
unitId: s,
|
|
399
394
|
subUnitId: o,
|
|
400
395
|
drawingId: a,
|
|
401
|
-
drawingType:
|
|
396
|
+
drawingType: j.DRAWING_GROUP,
|
|
402
397
|
transform: {
|
|
403
398
|
left: 0,
|
|
404
399
|
top: 0
|
|
405
400
|
}
|
|
406
401
|
};
|
|
407
402
|
t.push({
|
|
408
|
-
parent:
|
|
403
|
+
parent: c,
|
|
409
404
|
children: u
|
|
410
405
|
});
|
|
411
406
|
}), t;
|
|
412
407
|
}
|
|
413
|
-
const
|
|
408
|
+
const _r = {
|
|
414
409
|
id: "sheet.command.group-sheet-image",
|
|
415
410
|
type: J.COMMAND,
|
|
416
411
|
handler: (i, t) => {
|
|
417
|
-
const e = i.get(G), n = i.get(
|
|
412
|
+
const e = i.get(G), n = i.get(Le), r = i.get(oe);
|
|
418
413
|
if (!t) return !1;
|
|
419
414
|
const s = [];
|
|
420
|
-
t.forEach(({ parent: h, children:
|
|
421
|
-
s.push(h.unitId),
|
|
415
|
+
t.forEach(({ parent: h, children: m }) => {
|
|
416
|
+
s.push(h.unitId), m.forEach((p) => {
|
|
422
417
|
s.push(p.unitId);
|
|
423
418
|
});
|
|
424
419
|
});
|
|
425
|
-
const o = r.getGroupDrawingOp(t), { unitId: a, subUnitId:
|
|
426
|
-
return e.syncExecuteCommand(
|
|
420
|
+
const o = r.getGroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
421
|
+
return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP }) ? (n.pushUndoRedo({
|
|
427
422
|
unitID: a,
|
|
428
423
|
undoMutations: [
|
|
429
|
-
{ id:
|
|
430
|
-
{ id:
|
|
424
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ms(l), type: U.UNGROUP } },
|
|
425
|
+
{ id: L.id, params: s }
|
|
431
426
|
],
|
|
432
427
|
redoMutations: [
|
|
433
|
-
{ id:
|
|
434
|
-
{ id:
|
|
428
|
+
{ id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP } },
|
|
429
|
+
{ id: L.id, params: s }
|
|
435
430
|
]
|
|
436
431
|
}), !0) : !1;
|
|
437
432
|
}
|
|
438
|
-
},
|
|
433
|
+
}, Wt = {
|
|
439
434
|
id: "sheet.command.insert-sheet-image",
|
|
440
435
|
type: J.COMMAND,
|
|
441
436
|
handler: (i, t) => {
|
|
442
437
|
var S, C, b;
|
|
443
|
-
const e = i.get(G), n = i.get(
|
|
438
|
+
const e = i.get(G), n = i.get(Le), r = i.get(oe), s = i.get(kt);
|
|
444
439
|
if (!t) return !1;
|
|
445
|
-
const o = t.drawings, a = o.map((v) => v.unitId),
|
|
446
|
-
return
|
|
440
|
+
const o = t.drawings, a = o.map((v) => v.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = s.onCommandExecute({ id: Wt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, f = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
|
|
441
|
+
return Ln([...(S = m.preRedos) != null ? S : [], p, ...m.redos], e) ? (n.pushUndoRedo({
|
|
447
442
|
unitID: u,
|
|
448
443
|
undoMutations: [
|
|
449
|
-
...(C =
|
|
450
|
-
|
|
451
|
-
...
|
|
452
|
-
{ id:
|
|
444
|
+
...(C = m.preUndos) != null ? C : [],
|
|
445
|
+
f,
|
|
446
|
+
...m.undos,
|
|
447
|
+
{ id: L.id, params: a }
|
|
453
448
|
],
|
|
454
449
|
redoMutations: [
|
|
455
|
-
...(b =
|
|
450
|
+
...(b = m.preRedos) != null ? b : [],
|
|
456
451
|
p,
|
|
457
|
-
...
|
|
458
|
-
{ id:
|
|
452
|
+
...m.redos,
|
|
453
|
+
{ id: L.id, params: a }
|
|
459
454
|
]
|
|
460
455
|
}), !0) : !1;
|
|
461
456
|
}
|
|
462
|
-
},
|
|
457
|
+
}, vr = {
|
|
463
458
|
id: "sheet.command.set-drawing-arrange",
|
|
464
459
|
type: J.COMMAND,
|
|
465
460
|
handler: (i, t) => {
|
|
466
|
-
const e = i.get(G), n = i.get(
|
|
461
|
+
const e = i.get(G), n = i.get(Le);
|
|
467
462
|
if (!t) return !1;
|
|
468
|
-
const r = i.get(oe), { unitId: s, subUnitId: o, drawingIds: a, arrangeType:
|
|
469
|
-
let
|
|
470
|
-
if (
|
|
463
|
+
const r = i.get(oe), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
|
|
464
|
+
let c;
|
|
465
|
+
if (d === pt.forward ? c = r.getForwardDrawingsOp(u) : d === pt.backward ? c = r.getBackwardDrawingOp(u) : d === pt.front ? c = r.getFrontDrawingsOp(u) : d === pt.back && (c = r.getBackDrawingsOp(u)), c == null)
|
|
471
466
|
return !1;
|
|
472
|
-
const { objects: l, redo: g, undo: h } =
|
|
473
|
-
return e.syncExecuteCommand(
|
|
467
|
+
const { objects: l, redo: g, undo: h } = c;
|
|
468
|
+
return e.syncExecuteCommand(P.id, { op: g, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE }) ? (n.pushUndoRedo({
|
|
474
469
|
unitID: s,
|
|
475
470
|
undoMutations: [
|
|
476
|
-
{ id:
|
|
471
|
+
{ id: P.id, params: { op: h, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE } }
|
|
477
472
|
],
|
|
478
473
|
redoMutations: [
|
|
479
|
-
{ id:
|
|
474
|
+
{ id: P.id, params: { op: g, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE } }
|
|
480
475
|
]
|
|
481
476
|
}), !0) : !1;
|
|
482
477
|
}
|
|
483
|
-
},
|
|
478
|
+
}, jt = {
|
|
484
479
|
id: "sheet.command.set-sheet-image",
|
|
485
480
|
type: J.COMMAND,
|
|
486
481
|
handler: (i, t) => {
|
|
487
|
-
const e = i.get(G), n = i.get(
|
|
482
|
+
const e = i.get(G), n = i.get(Le), r = i.get(oe);
|
|
488
483
|
if (!t) return !1;
|
|
489
|
-
const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId:
|
|
490
|
-
return e.syncExecuteCommand(
|
|
484
|
+
const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
485
|
+
return e.syncExecuteCommand(P.id, { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE }) ? (n.pushUndoRedo({
|
|
491
486
|
unitID: a,
|
|
492
487
|
undoMutations: [
|
|
493
|
-
{ id:
|
|
494
|
-
{ id:
|
|
488
|
+
{ id: P.id, params: { unitId: a, subUnitId: d, op: u, objects: l, type: U.UPDATE } },
|
|
489
|
+
{ id: L.id, params: [a] }
|
|
495
490
|
],
|
|
496
491
|
redoMutations: [
|
|
497
|
-
{ id:
|
|
498
|
-
{ id:
|
|
492
|
+
{ id: P.id, params: { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE } },
|
|
493
|
+
{ id: L.id, params: [a] }
|
|
499
494
|
]
|
|
500
495
|
}), !0) : !1;
|
|
501
496
|
}
|
|
502
|
-
},
|
|
497
|
+
}, Sr = {
|
|
503
498
|
id: "sheet.command.ungroup-sheet-image",
|
|
504
499
|
type: J.COMMAND,
|
|
505
500
|
handler: (i, t) => {
|
|
506
|
-
const e = i.get(G), n = i.get(
|
|
501
|
+
const e = i.get(G), n = i.get(Le), r = i.get(oe);
|
|
507
502
|
if (!t) return !1;
|
|
508
503
|
const s = [];
|
|
509
|
-
t.forEach(({ parent: h, children:
|
|
510
|
-
s.push(h.unitId),
|
|
504
|
+
t.forEach(({ parent: h, children: m }) => {
|
|
505
|
+
s.push(h.unitId), m.forEach((p) => {
|
|
511
506
|
s.push(p.unitId);
|
|
512
507
|
});
|
|
513
508
|
});
|
|
514
|
-
const o = r.getUngroupDrawingOp(t), { unitId: a, subUnitId:
|
|
515
|
-
return e.syncExecuteCommand(
|
|
509
|
+
const o = r.getUngroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
510
|
+
return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP }) ? (n.pushUndoRedo({
|
|
516
511
|
unitID: a,
|
|
517
512
|
undoMutations: [
|
|
518
|
-
{ id:
|
|
519
|
-
{ id:
|
|
513
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: fs(l), type: U.GROUP } },
|
|
514
|
+
{ id: L.id, params: s }
|
|
520
515
|
],
|
|
521
516
|
redoMutations: [
|
|
522
|
-
{ id:
|
|
523
|
-
{ id:
|
|
517
|
+
{ id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP } },
|
|
518
|
+
{ id: L.id, params: s }
|
|
524
519
|
]
|
|
525
520
|
}), !0) : !1;
|
|
526
521
|
}
|
|
527
522
|
};
|
|
528
|
-
var
|
|
529
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
523
|
+
var ps = Object.getOwnPropertyDescriptor, ws = (i, t, e, n) => {
|
|
524
|
+
for (var r = n > 1 ? void 0 : n ? ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
530
525
|
(o = i[s]) && (r = o(r) || r);
|
|
531
526
|
return r;
|
|
532
527
|
}, ne = (i, t) => (e, n) => t(e, n, i);
|
|
533
|
-
function
|
|
528
|
+
function _s(i, t, e) {
|
|
534
529
|
const n = e * Math.PI / 180, r = Math.abs(i * Math.cos(n)) + Math.abs(t * Math.sin(n)), s = Math.abs(i * Math.sin(n)) + Math.abs(t * Math.cos(n));
|
|
535
530
|
return { rotatedWidth: r, rotatedHeight: s };
|
|
536
531
|
}
|
|
537
|
-
function
|
|
532
|
+
function rn(i, t, e, n, r) {
|
|
538
533
|
var S;
|
|
539
|
-
const { rotatedHeight: s, rotatedWidth: o } =
|
|
540
|
-
if (!
|
|
534
|
+
const { rotatedHeight: s, rotatedWidth: o } = _s(e, n, r), d = i.get(q).getRenderById(t.unitId);
|
|
535
|
+
if (!d)
|
|
541
536
|
return !1;
|
|
542
|
-
const
|
|
543
|
-
if (
|
|
537
|
+
const c = (S = d.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : S.skeleton;
|
|
538
|
+
if (c == null)
|
|
544
539
|
return !1;
|
|
545
|
-
const l =
|
|
540
|
+
const l = c.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, m = o / s, f = Math.ceil(Math.min(g, h * m)) / o, _ = !f || Number.isNaN(f) ? 1e-3 : f;
|
|
546
541
|
return {
|
|
547
542
|
width: e * _,
|
|
548
543
|
height: n * _
|
|
549
544
|
};
|
|
550
545
|
}
|
|
551
|
-
let
|
|
552
|
-
constructor(t, e, n, r, s, o, a,
|
|
546
|
+
let et = class extends ie {
|
|
547
|
+
constructor(t, e, n, r, s, o, a, d, u, c, l, g, h) {
|
|
553
548
|
super();
|
|
554
549
|
te(this, "_workbookSelections");
|
|
555
|
-
this._context = t, this._skeletonManagerService = e, this._commandService = n, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService =
|
|
550
|
+
this._context = t, this._skeletonManagerService = e, this._commandService = n, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService = d, this._contextService = u, this._messageService = c, this._localeService = l, this._injector = h, this._workbookSelections = g.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
|
|
556
551
|
}
|
|
557
552
|
async insertFloatImage() {
|
|
558
553
|
const t = await this._fileOpenerService.openFile({
|
|
559
554
|
multiple: !0,
|
|
560
|
-
accept:
|
|
555
|
+
accept: Cn.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
561
556
|
}), e = t.length;
|
|
562
|
-
return e >
|
|
563
|
-
type:
|
|
564
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
557
|
+
return e > Dn ? (this._messageService.show({
|
|
558
|
+
type: we.Error,
|
|
559
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(Dn))
|
|
565
560
|
}), !1) : e === 0 ? !1 : (t.forEach(async (n) => await this.insertFloatImageByFile(n)), !0);
|
|
566
561
|
}
|
|
567
562
|
async insertCellImage() {
|
|
568
563
|
const e = (await this._fileOpenerService.openFile({
|
|
569
564
|
multiple: !1,
|
|
570
|
-
accept:
|
|
565
|
+
accept: Cn.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
571
566
|
}))[0];
|
|
572
567
|
return e ? (await this._insertCellImage(e), !0) : !1;
|
|
573
568
|
}
|
|
@@ -580,40 +575,40 @@ let tt = class extends ie {
|
|
|
580
575
|
e = await this._imageIoService.saveImage(t);
|
|
581
576
|
} catch (S) {
|
|
582
577
|
const C = S.message;
|
|
583
|
-
C ===
|
|
584
|
-
type:
|
|
585
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
586
|
-
}) : C ===
|
|
587
|
-
type:
|
|
578
|
+
C === Pe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
579
|
+
type: we.Error,
|
|
580
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(bn / (1024 * 1024)))
|
|
581
|
+
}) : C === Pe.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
582
|
+
type: we.Error,
|
|
588
583
|
content: this._localeService.t("update-status.invalidImageType")
|
|
589
|
-
}) : C ===
|
|
590
|
-
type:
|
|
584
|
+
}) : C === Pe.ERROR_IMAGE && this._messageService.show({
|
|
585
|
+
type: we.Error,
|
|
591
586
|
content: this._localeService.t("update-status.invalidImage")
|
|
592
587
|
});
|
|
593
588
|
}
|
|
594
589
|
if (e == null)
|
|
595
590
|
return;
|
|
596
|
-
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source:
|
|
597
|
-
this._imageIoService.addImageSourceCache(
|
|
591
|
+
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await Lt(u || ""), { width: h, height: m } = this._context.scene;
|
|
592
|
+
this._imageIoService.addImageSourceCache(d, a, g);
|
|
598
593
|
let p = 1;
|
|
599
|
-
if (
|
|
600
|
-
const S =
|
|
594
|
+
if (c > Rn || l > Mn) {
|
|
595
|
+
const S = Rn / c, C = Mn / l;
|
|
601
596
|
p = Math.max(S, C);
|
|
602
597
|
}
|
|
603
|
-
const
|
|
604
|
-
if (
|
|
598
|
+
const f = this._getImagePosition(c * p, l * p, h, m);
|
|
599
|
+
if (f == null)
|
|
605
600
|
return;
|
|
606
601
|
const _ = {
|
|
607
602
|
unitId: r,
|
|
608
603
|
subUnitId: s,
|
|
609
604
|
drawingId: o,
|
|
610
|
-
drawingType:
|
|
605
|
+
drawingType: j.DRAWING_IMAGE,
|
|
611
606
|
imageSourceType: a,
|
|
612
|
-
source:
|
|
613
|
-
transform: z(
|
|
614
|
-
sheetTransform:
|
|
607
|
+
source: d,
|
|
608
|
+
transform: z(f, this._selectionRenderService, this._skeletonManagerService),
|
|
609
|
+
sheetTransform: f
|
|
615
610
|
};
|
|
616
|
-
return this._commandService.executeCommand(
|
|
611
|
+
return this._commandService.executeCommand(Wt.id, {
|
|
617
612
|
unitId: r,
|
|
618
613
|
drawings: [_]
|
|
619
614
|
});
|
|
@@ -626,25 +621,25 @@ let tt = class extends ie {
|
|
|
626
621
|
n = await this._imageIoService.saveImage(t);
|
|
627
622
|
} catch (C) {
|
|
628
623
|
const b = C.message;
|
|
629
|
-
b ===
|
|
630
|
-
type:
|
|
631
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
632
|
-
}) : b ===
|
|
633
|
-
type:
|
|
624
|
+
b === Pe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
625
|
+
type: we.Error,
|
|
626
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(bn / (1024 * 1024)))
|
|
627
|
+
}) : b === Pe.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
628
|
+
type: we.Error,
|
|
634
629
|
content: this._localeService.t("update-status.invalidImageType")
|
|
635
|
-
}) : b ===
|
|
636
|
-
type:
|
|
630
|
+
}) : b === Pe.ERROR_IMAGE && this._messageService.show({
|
|
631
|
+
type: we.Error,
|
|
637
632
|
content: this._localeService.t("update-status.invalidImage")
|
|
638
633
|
});
|
|
639
634
|
}
|
|
640
635
|
if (n == null)
|
|
641
636
|
return !1;
|
|
642
|
-
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width:
|
|
643
|
-
this._imageIoService.addImageSourceCache(o, s,
|
|
637
|
+
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await Lt(a || "");
|
|
638
|
+
this._imageIoService.addImageSourceCache(o, s, c);
|
|
644
639
|
const l = this._workbookSelections.getCurrentLastSelection();
|
|
645
640
|
if (!l)
|
|
646
641
|
return !1;
|
|
647
|
-
const g =
|
|
642
|
+
const g = Ht("", {}), h = rn(
|
|
648
643
|
this._injector,
|
|
649
644
|
{
|
|
650
645
|
unitId: this._context.unitId,
|
|
@@ -652,23 +647,23 @@ let tt = class extends ie {
|
|
|
652
647
|
row: l.primary.actualRow,
|
|
653
648
|
col: l.primary.actualColumn
|
|
654
649
|
},
|
|
655
|
-
|
|
650
|
+
d,
|
|
656
651
|
u,
|
|
657
652
|
0
|
|
658
653
|
);
|
|
659
654
|
if (!h)
|
|
660
655
|
return !1;
|
|
661
|
-
const
|
|
656
|
+
const m = {
|
|
662
657
|
size: {
|
|
663
658
|
width: h.width,
|
|
664
659
|
height: h.height
|
|
665
660
|
},
|
|
666
661
|
positionH: {
|
|
667
|
-
relativeFrom:
|
|
662
|
+
relativeFrom: wn.PAGE,
|
|
668
663
|
posOffset: 0
|
|
669
664
|
},
|
|
670
665
|
positionV: {
|
|
671
|
-
relativeFrom:
|
|
666
|
+
relativeFrom: pn.PARAGRAPH,
|
|
672
667
|
posOffset: 0
|
|
673
668
|
},
|
|
674
669
|
angle: 0
|
|
@@ -676,22 +671,22 @@ let tt = class extends ie {
|
|
|
676
671
|
unitId: g.getUnitId(),
|
|
677
672
|
subUnitId: g.getUnitId(),
|
|
678
673
|
drawingId: r,
|
|
679
|
-
drawingType:
|
|
674
|
+
drawingType: j.DRAWING_IMAGE,
|
|
680
675
|
imageSourceType: s,
|
|
681
676
|
source: o,
|
|
682
|
-
transform:
|
|
683
|
-
docTransform:
|
|
684
|
-
behindDoc:
|
|
677
|
+
transform: Bn(m),
|
|
678
|
+
docTransform: m,
|
|
679
|
+
behindDoc: Sn.FALSE,
|
|
685
680
|
title: "",
|
|
686
681
|
description: "",
|
|
687
|
-
layoutType:
|
|
682
|
+
layoutType: vn.INLINE,
|
|
688
683
|
// Insert inline drawing by default.
|
|
689
|
-
wrapText:
|
|
684
|
+
wrapText: _n.BOTH_SIDES,
|
|
690
685
|
distB: 0,
|
|
691
686
|
distL: 0,
|
|
692
687
|
distR: 0,
|
|
693
688
|
distT: 0
|
|
694
|
-
},
|
|
689
|
+
}, f = zt.drawing.add({
|
|
695
690
|
documentDataModel: g,
|
|
696
691
|
drawings: [p],
|
|
697
692
|
selection: {
|
|
@@ -700,7 +695,7 @@ let tt = class extends ie {
|
|
|
700
695
|
endOffset: 0
|
|
701
696
|
}
|
|
702
697
|
});
|
|
703
|
-
return
|
|
698
|
+
return f ? (g.apply(f), this._commandService.syncExecuteCommand(kn.id, {
|
|
704
699
|
value: {
|
|
705
700
|
[(_ = e == null ? void 0 : e.row) != null ? _ : l.primary.actualRow]: {
|
|
706
701
|
[(S = e == null ? void 0 : e.col) != null ? S : l.primary.actualColumn]: {
|
|
@@ -716,12 +711,12 @@ let tt = class extends ie {
|
|
|
716
711
|
// eslint-disable-next-line max-lines-per-function
|
|
717
712
|
async insertCellImageByUrl(t, e) {
|
|
718
713
|
var g, h;
|
|
719
|
-
const { width: n, height: r, image: s } = await
|
|
720
|
-
this._imageIoService.addImageSourceCache(t,
|
|
714
|
+
const { width: n, height: r, image: s } = await Lt(t || "");
|
|
715
|
+
this._imageIoService.addImageSourceCache(t, In.URL, s);
|
|
721
716
|
const o = this._workbookSelections.getCurrentLastSelection();
|
|
722
717
|
if (!o)
|
|
723
718
|
return !1;
|
|
724
|
-
const a =
|
|
719
|
+
const a = Ht("", {}), d = rn(
|
|
725
720
|
this._injector,
|
|
726
721
|
{
|
|
727
722
|
unitId: this._context.unitId,
|
|
@@ -733,51 +728,51 @@ let tt = class extends ie {
|
|
|
733
728
|
r,
|
|
734
729
|
0
|
|
735
730
|
);
|
|
736
|
-
if (!
|
|
731
|
+
if (!d)
|
|
737
732
|
return !1;
|
|
738
733
|
const u = {
|
|
739
734
|
size: {
|
|
740
|
-
width:
|
|
741
|
-
height:
|
|
735
|
+
width: d.width,
|
|
736
|
+
height: d.height
|
|
742
737
|
},
|
|
743
738
|
positionH: {
|
|
744
|
-
relativeFrom:
|
|
739
|
+
relativeFrom: wn.PAGE,
|
|
745
740
|
posOffset: 0
|
|
746
741
|
},
|
|
747
742
|
positionV: {
|
|
748
|
-
relativeFrom:
|
|
743
|
+
relativeFrom: pn.PARAGRAPH,
|
|
749
744
|
posOffset: 0
|
|
750
745
|
},
|
|
751
746
|
angle: 0
|
|
752
|
-
},
|
|
747
|
+
}, c = {
|
|
753
748
|
unitId: a.getUnitId(),
|
|
754
749
|
subUnitId: a.getUnitId(),
|
|
755
|
-
drawingId:
|
|
756
|
-
drawingType:
|
|
757
|
-
imageSourceType:
|
|
750
|
+
drawingId: bt(),
|
|
751
|
+
drawingType: j.DRAWING_IMAGE,
|
|
752
|
+
imageSourceType: In.URL,
|
|
758
753
|
source: t,
|
|
759
|
-
transform:
|
|
754
|
+
transform: Bn(u),
|
|
760
755
|
docTransform: u,
|
|
761
|
-
behindDoc:
|
|
756
|
+
behindDoc: Sn.FALSE,
|
|
762
757
|
title: "",
|
|
763
758
|
description: "",
|
|
764
|
-
layoutType:
|
|
759
|
+
layoutType: vn.INLINE,
|
|
765
760
|
// Insert inline drawing by default.
|
|
766
|
-
wrapText:
|
|
761
|
+
wrapText: _n.BOTH_SIDES,
|
|
767
762
|
distB: 0,
|
|
768
763
|
distL: 0,
|
|
769
764
|
distR: 0,
|
|
770
765
|
distT: 0
|
|
771
|
-
}, l =
|
|
766
|
+
}, l = zt.drawing.add({
|
|
772
767
|
documentDataModel: a,
|
|
773
|
-
drawings: [
|
|
768
|
+
drawings: [c],
|
|
774
769
|
selection: {
|
|
775
770
|
collapsed: !0,
|
|
776
771
|
startOffset: 0,
|
|
777
772
|
endOffset: 0
|
|
778
773
|
}
|
|
779
774
|
});
|
|
780
|
-
return l ? (a.apply(l), this._commandService.syncExecuteCommand(
|
|
775
|
+
return l ? (a.apply(l), this._commandService.syncExecuteCommand(kn.id, {
|
|
781
776
|
value: {
|
|
782
777
|
[(g = e == null ? void 0 : e.row) != null ? g : o.primary.actualRow]: {
|
|
783
778
|
[(h = e == null ? void 0 : e.col) != null ? h : o.primary.actualColumn]: {
|
|
@@ -806,29 +801,29 @@ let tt = class extends ie {
|
|
|
806
801
|
endColumn: 0
|
|
807
802
|
};
|
|
808
803
|
s && s.length > 0 && (o = s[s.length - 1].range);
|
|
809
|
-
const a =
|
|
804
|
+
const a = Vn(this._skeletonManagerService.getCurrent().skeleton, o);
|
|
810
805
|
if (a == null)
|
|
811
806
|
return;
|
|
812
|
-
let { startColumn:
|
|
813
|
-
if (
|
|
814
|
-
const
|
|
815
|
-
if (
|
|
807
|
+
let { startColumn: d, startRow: u, startX: c, startY: l } = a, g = !1;
|
|
808
|
+
if (c + t > n && (c = n - t, c < 0 && (c = 0, t = n), g = !0), l + e > r && (l = r - e, l < 0 && (l = 0, e = r), g = !0), g) {
|
|
809
|
+
const f = this._selectionRenderService.getCellWithCoordByOffset(c, l);
|
|
810
|
+
if (f == null)
|
|
816
811
|
return;
|
|
817
|
-
|
|
812
|
+
c = f.startX, l = f.startY, d = f.actualColumn, u = f.actualRow;
|
|
818
813
|
}
|
|
819
814
|
const h = {
|
|
820
|
-
column:
|
|
815
|
+
column: d,
|
|
821
816
|
columnOffset: 0,
|
|
822
817
|
row: u,
|
|
823
818
|
rowOffset: 0
|
|
824
|
-
},
|
|
825
|
-
if (
|
|
819
|
+
}, m = this._selectionRenderService.getCellWithCoordByOffset(c + t, l + e);
|
|
820
|
+
if (m == null)
|
|
826
821
|
return;
|
|
827
822
|
const p = {
|
|
828
|
-
column:
|
|
829
|
-
columnOffset:
|
|
830
|
-
row:
|
|
831
|
-
rowOffset: l + e -
|
|
823
|
+
column: m.actualColumn,
|
|
824
|
+
columnOffset: c + t - m.startX,
|
|
825
|
+
row: m.actualRow,
|
|
826
|
+
rowOffset: l + e - m.startY
|
|
832
827
|
};
|
|
833
828
|
return {
|
|
834
829
|
from: h,
|
|
@@ -838,7 +833,7 @@ let tt = class extends ie {
|
|
|
838
833
|
_updateOrderListener() {
|
|
839
834
|
this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((t) => {
|
|
840
835
|
const { unitId: e, subUnitId: n, drawingIds: r, arrangeType: s } = t;
|
|
841
|
-
this._commandService.executeCommand(
|
|
836
|
+
this._commandService.executeCommand(vr.id, {
|
|
842
837
|
unitId: e,
|
|
843
838
|
subUnitId: n,
|
|
844
839
|
drawingIds: r,
|
|
@@ -850,22 +845,22 @@ let tt = class extends ie {
|
|
|
850
845
|
this.disposeWithMe(this._drawingManagerService.featurePluginUpdate$.subscribe((t) => {
|
|
851
846
|
const e = [];
|
|
852
847
|
t.length !== 0 && (t.forEach((n) => {
|
|
853
|
-
const { unitId: r, subUnitId: s, drawingId: o, drawingType: a, transform:
|
|
854
|
-
if (
|
|
848
|
+
const { unitId: r, subUnitId: s, drawingId: o, drawingType: a, transform: d } = n;
|
|
849
|
+
if (d == null)
|
|
855
850
|
return;
|
|
856
851
|
const u = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
|
|
857
852
|
if (u == null || u.unitId !== this._context.unitId)
|
|
858
853
|
return;
|
|
859
|
-
const
|
|
860
|
-
if (
|
|
854
|
+
const c = x({ ...u.transform, ...d }, this._selectionRenderService);
|
|
855
|
+
if (c == null)
|
|
861
856
|
return;
|
|
862
857
|
const l = {
|
|
863
858
|
...n,
|
|
864
|
-
transform: { ...u.transform, ...
|
|
865
|
-
sheetTransform: { ...
|
|
859
|
+
transform: { ...u.transform, ...d, ...z(c, this._selectionRenderService, this._skeletonManagerService) },
|
|
860
|
+
sheetTransform: { ...c }
|
|
866
861
|
};
|
|
867
862
|
e.push(l);
|
|
868
|
-
}), e.length > 0 && this._commandService.executeCommand(
|
|
863
|
+
}), e.length > 0 && this._commandService.executeCommand(jt.id, {
|
|
869
864
|
unitId: t[0].unitId,
|
|
870
865
|
drawings: e
|
|
871
866
|
}));
|
|
@@ -873,44 +868,44 @@ let tt = class extends ie {
|
|
|
873
868
|
}
|
|
874
869
|
_groupDrawingListener() {
|
|
875
870
|
this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((t) => {
|
|
876
|
-
this._commandService.executeCommand(
|
|
871
|
+
this._commandService.executeCommand(_r.id, t);
|
|
877
872
|
const { unitId: e, subUnitId: n, drawingId: r } = t[0].parent;
|
|
878
|
-
this._commandService.syncExecuteCommand(
|
|
873
|
+
this._commandService.syncExecuteCommand(Nt.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
|
|
879
874
|
})), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((t) => {
|
|
880
|
-
this._commandService.executeCommand(
|
|
875
|
+
this._commandService.executeCommand(Sr.id, t);
|
|
881
876
|
}));
|
|
882
877
|
}
|
|
883
878
|
_focusDrawingListener() {
|
|
884
879
|
this.disposeWithMe(
|
|
885
880
|
this._drawingManagerService.focus$.subscribe((t) => {
|
|
886
|
-
t == null || t.length === 0 ? (this._contextService.setContextValue(
|
|
881
|
+
t == null || t.length === 0 ? (this._contextService.setContextValue(xe, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(xe, !0), this._sheetDrawingService.focusDrawing(t));
|
|
887
882
|
})
|
|
888
883
|
);
|
|
889
884
|
}
|
|
890
885
|
};
|
|
891
|
-
|
|
886
|
+
et = ws([
|
|
892
887
|
ne(1, A(V)),
|
|
893
888
|
ne(2, G),
|
|
894
|
-
ne(3,
|
|
895
|
-
ne(4,
|
|
896
|
-
ne(5,
|
|
889
|
+
ne(3, Ge),
|
|
890
|
+
ne(4, ii),
|
|
891
|
+
ne(5, Pi),
|
|
897
892
|
ne(6, oe),
|
|
898
893
|
ne(7, se),
|
|
899
|
-
ne(8,
|
|
900
|
-
ne(9,
|
|
901
|
-
ne(10, A(
|
|
902
|
-
ne(11, A(
|
|
903
|
-
ne(12, A(
|
|
904
|
-
],
|
|
905
|
-
var
|
|
906
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
894
|
+
ne(8, Yn),
|
|
895
|
+
ne(9, Hn),
|
|
896
|
+
ne(10, A(nt)),
|
|
897
|
+
ne(11, A(dn)),
|
|
898
|
+
ne(12, A(Ye))
|
|
899
|
+
], et);
|
|
900
|
+
var vs = Object.getOwnPropertyDescriptor, Ss = (i, t, e, n) => {
|
|
901
|
+
for (var r = n > 1 ? void 0 : n ? vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
907
902
|
(o = i[s]) && (r = o(r) || r);
|
|
908
903
|
return r;
|
|
909
|
-
},
|
|
910
|
-
function
|
|
904
|
+
}, ke = (i, t) => (e, n) => t(e, n, i);
|
|
905
|
+
function Ir(i, t, e) {
|
|
911
906
|
var n, r, s, o;
|
|
912
907
|
if (((r = (n = e == null ? void 0 : e.p) == null ? void 0 : n.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = e.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
|
|
913
|
-
const a = e.p.drawings[e.p.drawingsOrder[0]],
|
|
908
|
+
const a = e.p.drawings[e.p.drawingsOrder[0]], d = rn(
|
|
914
909
|
i,
|
|
915
910
|
{
|
|
916
911
|
unitId: t.unitId,
|
|
@@ -922,52 +917,52 @@ function Rr(i, t, e) {
|
|
|
922
917
|
a.docTransform.size.height,
|
|
923
918
|
a.docTransform.angle
|
|
924
919
|
);
|
|
925
|
-
if (
|
|
926
|
-
return a.transform.width =
|
|
920
|
+
if (d)
|
|
921
|
+
return a.transform.width = d.width, a.transform.height = d.height, a.docTransform.size.width = d.width, a.docTransform.size.height = d.height, a.transform.left = 0, a.transform.top = 0, a.docTransform.positionH.posOffset = 0, a.docTransform.positionV.posOffset = 0, e.p.documentStyle.pageSize.width = 1 / 0, e.p.documentStyle.pageSize.height = 1 / 0, !0;
|
|
927
922
|
}
|
|
928
923
|
return !1;
|
|
929
924
|
}
|
|
930
|
-
let
|
|
925
|
+
let Mt = class extends ie {
|
|
931
926
|
constructor(i, t, e, n, r, s) {
|
|
932
927
|
super(), this._commandService = i, this._sheetInterceptorService = t, this._injector = e, this._drawingManagerService = n, this._docDrawingController = r, this._editorBridgeService = s, this._handleInitEditor(), this._initCellContentInterceptor();
|
|
933
928
|
}
|
|
934
929
|
_handleInitEditor() {
|
|
935
930
|
this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
|
|
936
|
-
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(
|
|
931
|
+
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(qe), this._docDrawingController.loadDrawingDataForUnit(qe), this._drawingManagerService.initializeNotification(qe)) : this._drawingManagerService.removeDrawingDataForUnit(qe);
|
|
937
932
|
})), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
938
|
-
i.id ===
|
|
933
|
+
i.id === rs.id && i.params.unitId === Be && (this._drawingManagerService.removeDrawingDataForUnit(Be), this._docDrawingController.loadDrawingDataForUnit(Be), this._drawingManagerService.initializeNotification(Be));
|
|
939
934
|
}));
|
|
940
935
|
}
|
|
941
936
|
_initCellContentInterceptor() {
|
|
942
937
|
this.disposeWithMe(
|
|
943
938
|
this._sheetInterceptorService.intercept(
|
|
944
|
-
|
|
939
|
+
Gi.CELL_CONTENT,
|
|
945
940
|
{
|
|
946
|
-
effect:
|
|
947
|
-
priority:
|
|
941
|
+
effect: Br.Style,
|
|
942
|
+
priority: Xi.CELL_IMAGE,
|
|
948
943
|
handler: (i, t, e) => {
|
|
949
944
|
var n;
|
|
950
|
-
return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 },
|
|
945
|
+
return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, Ir(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
|
|
951
946
|
}
|
|
952
947
|
}
|
|
953
948
|
)
|
|
954
949
|
);
|
|
955
950
|
}
|
|
956
951
|
};
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
],
|
|
965
|
-
var
|
|
966
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
952
|
+
Mt = Ss([
|
|
953
|
+
ke(0, G),
|
|
954
|
+
ke(1, A(kt)),
|
|
955
|
+
ke(2, A(Ye)),
|
|
956
|
+
ke(3, se),
|
|
957
|
+
ke(4, A(ni)),
|
|
958
|
+
ke(5, A(Di))
|
|
959
|
+
], Mt);
|
|
960
|
+
var Is = Object.getOwnPropertyDescriptor, Cs = (i, t, e, n) => {
|
|
961
|
+
for (var r = n > 1 ? void 0 : n ? Is(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
967
962
|
(o = i[s]) && (r = o(r) || r);
|
|
968
963
|
return r;
|
|
969
|
-
},
|
|
970
|
-
let
|
|
964
|
+
}, xn = (i, t) => (e, n) => t(e, n, i);
|
|
965
|
+
let yt = class extends ie {
|
|
971
966
|
constructor(i, t) {
|
|
972
967
|
super(), this._autoFillService = i, this._injector = t, this._initAutoFillHooks();
|
|
973
968
|
}
|
|
@@ -976,35 +971,35 @@ let Pt = class extends ie {
|
|
|
976
971
|
this._autoFillService.addHook({
|
|
977
972
|
id: "sheet-cell-image-autofill",
|
|
978
973
|
onBeforeSubmit: (i, t, e, n) => {
|
|
979
|
-
new
|
|
980
|
-
|
|
974
|
+
new $r(n).forValue((r, s, o) => {
|
|
975
|
+
Ir(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
|
|
981
976
|
});
|
|
982
977
|
}
|
|
983
978
|
})
|
|
984
979
|
);
|
|
985
980
|
}
|
|
986
981
|
};
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
],
|
|
991
|
-
var
|
|
992
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
982
|
+
yt = Cs([
|
|
983
|
+
xn(0, A(bi)),
|
|
984
|
+
xn(1, A(Ye))
|
|
985
|
+
], yt);
|
|
986
|
+
var Ds = Object.getOwnPropertyDescriptor, bs = (i, t, e, n) => {
|
|
987
|
+
for (var r = n > 1 ? void 0 : n ? Ds(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
993
988
|
(o = i[s]) && (r = o(r) || r);
|
|
994
989
|
return r;
|
|
995
|
-
},
|
|
996
|
-
const
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
990
|
+
}, ze = (i, t) => (e, n) => t(e, n, i);
|
|
991
|
+
const Rs = [
|
|
992
|
+
qe,
|
|
993
|
+
xr,
|
|
994
|
+
Be
|
|
1000
995
|
];
|
|
1001
|
-
let
|
|
996
|
+
let Et = class extends ie {
|
|
1002
997
|
constructor(i, t, e, n, r) {
|
|
1003
998
|
super(), this._commandService = i, this._univerInstanceService = t, this._dialogService = e, this._renderManagerService = n, this._localeService = r, this._initDocImageCopyPasteHooks();
|
|
1004
999
|
}
|
|
1005
1000
|
_setCellImage(i) {
|
|
1006
1001
|
var r;
|
|
1007
|
-
const t =
|
|
1002
|
+
const t = Ht("", {}), e = (r = on(F.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(Ri), n = zt.drawing.add({
|
|
1008
1003
|
documentDataModel: t,
|
|
1009
1004
|
drawings: [i],
|
|
1010
1005
|
selection: {
|
|
@@ -1019,20 +1014,20 @@ let Ut = class extends ie {
|
|
|
1019
1014
|
this.disposeWithMe(
|
|
1020
1015
|
this._commandService.beforeCommandExecuted((i) => {
|
|
1021
1016
|
var t, e;
|
|
1022
|
-
if (i.id ===
|
|
1023
|
-
const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(
|
|
1017
|
+
if (i.id === is.id) {
|
|
1018
|
+
const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(F.UNIVER_DOC);
|
|
1024
1019
|
if (s == null || !Object.keys((t = r.drawings) != null ? t : {}).length)
|
|
1025
1020
|
return;
|
|
1026
1021
|
const o = s.getUnitId();
|
|
1027
|
-
if (
|
|
1028
|
-
if (o !==
|
|
1022
|
+
if (Rs.includes(o)) {
|
|
1023
|
+
if (o !== Be) {
|
|
1029
1024
|
const a = () => {
|
|
1030
|
-
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(
|
|
1025
|
+
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(En.id, {
|
|
1031
1026
|
visible: !1
|
|
1032
1027
|
});
|
|
1033
1028
|
};
|
|
1034
1029
|
((e = s.getBody()) == null ? void 0 : e.dataStream) === `\r
|
|
1035
|
-
` ? (this._commandService.syncExecuteCommand(
|
|
1030
|
+
` ? (this._commandService.syncExecuteCommand(En.id, {
|
|
1036
1031
|
visible: !1
|
|
1037
1032
|
}), this._setCellImage(Object.values(r.drawings)[0])) : this._dialogService.open({
|
|
1038
1033
|
id: "sheet-cell-image-copy-paste",
|
|
@@ -1060,64 +1055,64 @@ let Ut = class extends ie {
|
|
|
1060
1055
|
);
|
|
1061
1056
|
}
|
|
1062
1057
|
};
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
],
|
|
1070
|
-
const
|
|
1058
|
+
Et = bs([
|
|
1059
|
+
ze(0, G),
|
|
1060
|
+
ze(1, Se),
|
|
1061
|
+
ze(2, Ai),
|
|
1062
|
+
ze(3, q),
|
|
1063
|
+
ze(4, A(nt))
|
|
1064
|
+
], Et);
|
|
1065
|
+
const Bt = {
|
|
1071
1066
|
id: "sheet.command.insert-float-image",
|
|
1072
1067
|
type: J.COMMAND,
|
|
1073
1068
|
handler: async (i, t) => {
|
|
1074
1069
|
var o, a;
|
|
1075
|
-
const e = i.get(Se), n = i.get(q), r = (o =
|
|
1076
|
-
|
|
1070
|
+
const e = i.get(Se), n = i.get(q), r = (o = on(
|
|
1071
|
+
F.UNIVER_SHEET,
|
|
1077
1072
|
e,
|
|
1078
1073
|
n
|
|
1079
|
-
)) == null ? void 0 : o.with(
|
|
1074
|
+
)) == null ? void 0 : o.with(et);
|
|
1080
1075
|
if (!r)
|
|
1081
1076
|
return !1;
|
|
1082
1077
|
const s = t == null ? void 0 : t.files;
|
|
1083
1078
|
if (s) {
|
|
1084
|
-
const
|
|
1085
|
-
return (await Promise.all(
|
|
1079
|
+
const d = s.map((u) => r.insertFloatImageByFile(u));
|
|
1080
|
+
return (await Promise.all(d)).every((u) => u);
|
|
1086
1081
|
} else
|
|
1087
1082
|
return (a = r.insertFloatImage()) != null ? a : !1;
|
|
1088
1083
|
}
|
|
1089
|
-
},
|
|
1084
|
+
}, ln = {
|
|
1090
1085
|
id: "sheet.command.insert-cell-image",
|
|
1091
1086
|
type: J.COMMAND,
|
|
1092
1087
|
handler: (i) => {
|
|
1093
1088
|
var n, r;
|
|
1094
1089
|
const t = i.get(Se), e = i.get(q);
|
|
1095
|
-
return (r = (n =
|
|
1096
|
-
|
|
1090
|
+
return (r = (n = on(
|
|
1091
|
+
F.UNIVER_SHEET,
|
|
1097
1092
|
t,
|
|
1098
1093
|
e
|
|
1099
|
-
)) == null ? void 0 : n.with(
|
|
1094
|
+
)) == null ? void 0 : n.with(et).insertCellImage()) != null ? r : !1;
|
|
1100
1095
|
}
|
|
1101
1096
|
};
|
|
1102
|
-
var
|
|
1103
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1097
|
+
var Ms = Object.getOwnPropertyDescriptor, ys = (i, t, e, n) => {
|
|
1098
|
+
for (var r = n > 1 ? void 0 : n ? Ms(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1104
1099
|
(o = i[s]) && (r = o(r) || r);
|
|
1105
1100
|
return r;
|
|
1106
|
-
},
|
|
1107
|
-
const
|
|
1108
|
-
function
|
|
1101
|
+
}, Ke = (i, t) => (e, n) => t(e, n, i);
|
|
1102
|
+
const Cr = "image/png";
|
|
1103
|
+
function Es(i) {
|
|
1109
1104
|
const t = i.split(","), e = atob(t[1]), n = e.length, r = new Uint8Array(n);
|
|
1110
1105
|
for (let s = 0; s < n; s++)
|
|
1111
1106
|
r[s] = e.charCodeAt(s);
|
|
1112
|
-
return new Blob([r], { type:
|
|
1107
|
+
return new Blob([r], { type: Cr });
|
|
1113
1108
|
}
|
|
1114
|
-
function
|
|
1115
|
-
const t = new ClipboardItem({ [
|
|
1109
|
+
function Ts(i) {
|
|
1110
|
+
const t = new ClipboardItem({ [Cr]: Es(i) });
|
|
1116
1111
|
navigator.clipboard.write([t]).catch((e) => {
|
|
1117
1112
|
console.error("Could not copy image using clipboard API: ", e);
|
|
1118
1113
|
});
|
|
1119
1114
|
}
|
|
1120
|
-
function
|
|
1115
|
+
function Os() {
|
|
1121
1116
|
function i() {
|
|
1122
1117
|
const n = document.createElement("input");
|
|
1123
1118
|
return n.style.position = "absolute", n.style.height = "1px", n.style.width = "1px", n.style.opacity = "0", n;
|
|
@@ -1127,13 +1122,13 @@ function Ls() {
|
|
|
1127
1122
|
e.blur(), document.body.removeChild(e), t instanceof HTMLElement && t.focus();
|
|
1128
1123
|
};
|
|
1129
1124
|
}
|
|
1130
|
-
const
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1125
|
+
const Fn = [
|
|
1126
|
+
$e.SPECIAL_PASTE_COL_WIDTH,
|
|
1127
|
+
$e.SPECIAL_PASTE_VALUE,
|
|
1128
|
+
$e.SPECIAL_PASTE_FORMAT,
|
|
1129
|
+
$e.SPECIAL_PASTE_FORMULA
|
|
1135
1130
|
];
|
|
1136
|
-
let
|
|
1131
|
+
let Tt = class extends ie {
|
|
1137
1132
|
constructor(t, e, n, r, s) {
|
|
1138
1133
|
super();
|
|
1139
1134
|
te(this, "_copyInfo");
|
|
@@ -1151,15 +1146,15 @@ let At = class extends ie {
|
|
|
1151
1146
|
if (s.length > 0) {
|
|
1152
1147
|
const [o] = s;
|
|
1153
1148
|
if (r === Ce.CUT) {
|
|
1154
|
-
const
|
|
1149
|
+
const d = {
|
|
1155
1150
|
unitId: t,
|
|
1156
1151
|
drawings: [o]
|
|
1157
1152
|
};
|
|
1158
|
-
this._commandService.executeCommand(
|
|
1153
|
+
this._commandService.executeCommand(rt.id, d);
|
|
1159
1154
|
}
|
|
1160
1155
|
setTimeout(() => {
|
|
1161
|
-
const
|
|
1162
|
-
o.drawingType ===
|
|
1156
|
+
const d = Os();
|
|
1157
|
+
o.drawingType === j.DRAWING_IMAGE && o.imageSourceType === si.BASE64 ? Ts(o.source) : this._clipboardInterfaceService.writeText(""), d();
|
|
1163
1158
|
}, 200);
|
|
1164
1159
|
const a = {
|
|
1165
1160
|
unitId: o.unitId,
|
|
@@ -1175,14 +1170,14 @@ let At = class extends ie {
|
|
|
1175
1170
|
onPasteCells: (t, e, n, r) => {
|
|
1176
1171
|
if (!this._copyInfo)
|
|
1177
1172
|
return { redos: [], undos: [] };
|
|
1178
|
-
const { copyType: s = Ce.COPY, pasteType: o } = r, { range: a } = t || {}, { range:
|
|
1179
|
-
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId:
|
|
1173
|
+
const { copyType: s = Ce.COPY, pasteType: o } = r, { range: a } = t || {}, { range: d, unitId: u, subUnitId: c } = e;
|
|
1174
|
+
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, Ce.COPY);
|
|
1180
1175
|
},
|
|
1181
1176
|
onPastePlainText: (t, e) => ({ undos: [], redos: [] }),
|
|
1182
|
-
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1177
|
+
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: $e.DEFAULT_PASTE }, Ce.COPY) : { undos: [], redos: [] },
|
|
1183
1178
|
onPasteFiles: (t, e) => {
|
|
1184
1179
|
if (this._copyInfo)
|
|
1185
|
-
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1180
|
+
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: $e.DEFAULT_PASTE }, Ce.COPY);
|
|
1186
1181
|
{
|
|
1187
1182
|
const n = e.filter((r) => r.type.includes("image"));
|
|
1188
1183
|
if (n.length)
|
|
@@ -1190,7 +1185,7 @@ let At = class extends ie {
|
|
|
1190
1185
|
undos: [],
|
|
1191
1186
|
redos: [
|
|
1192
1187
|
{
|
|
1193
|
-
id:
|
|
1188
|
+
id: Bt.id,
|
|
1194
1189
|
params: { files: n }
|
|
1195
1190
|
}
|
|
1196
1191
|
]
|
|
@@ -1207,18 +1202,18 @@ let At = class extends ie {
|
|
|
1207
1202
|
const s = r.attachRangeWithCoord(n);
|
|
1208
1203
|
if (!s)
|
|
1209
1204
|
return;
|
|
1210
|
-
const { startX: o, endX: a, startY:
|
|
1211
|
-
if (Object.keys(
|
|
1212
|
-
const
|
|
1213
|
-
if (
|
|
1205
|
+
const { startX: o, endX: a, startY: d, endY: u } = s, c = this._drawingService.getDrawingData(t, e), l = this._focusedDrawings.slice();
|
|
1206
|
+
if (Object.keys(c).forEach((h) => {
|
|
1207
|
+
const m = c[h], { transform: p } = m;
|
|
1208
|
+
if (m.anchorType !== O.Both || !p)
|
|
1214
1209
|
return;
|
|
1215
|
-
const { left:
|
|
1216
|
-
drawingStartX:
|
|
1217
|
-
drawingEndX:
|
|
1210
|
+
const { left: f = 0, top: _ = 0, width: S = 0, height: C = 0 } = p, { drawingStartX: b, drawingEndX: v, drawingStartY: D, drawingEndY: w } = {
|
|
1211
|
+
drawingStartX: f,
|
|
1212
|
+
drawingEndX: f + S,
|
|
1218
1213
|
drawingStartY: _,
|
|
1219
1214
|
drawingEndY: _ + C
|
|
1220
1215
|
};
|
|
1221
|
-
o <= b && v <= a &&
|
|
1216
|
+
o <= b && v <= a && d <= D && w <= u && l.push(m);
|
|
1222
1217
|
}), l.length)
|
|
1223
1218
|
return {
|
|
1224
1219
|
copyRange: n,
|
|
@@ -1229,31 +1224,31 @@ let At = class extends ie {
|
|
|
1229
1224
|
}
|
|
1230
1225
|
_generateSingleDrawingPasteMutations(t, e) {
|
|
1231
1226
|
const { pasteType: n, pasteTo: r } = t;
|
|
1232
|
-
if (
|
|
1227
|
+
if (Fn.includes(n))
|
|
1233
1228
|
return { redos: [], undos: [] };
|
|
1234
|
-
const { unitId: s, subUnitId: o, range: a } = r,
|
|
1235
|
-
if (!u || !
|
|
1229
|
+
const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(V), c = d == null ? void 0 : d.with(Ge), l = this._copyInfo;
|
|
1230
|
+
if (!u || !c)
|
|
1236
1231
|
return { redos: [], undos: [] };
|
|
1237
|
-
const { drawings: g } = l, h =
|
|
1232
|
+
const { drawings: g } = l, h = Tn(a);
|
|
1238
1233
|
return this._generateMutations(g, {
|
|
1239
1234
|
unitId: s,
|
|
1240
1235
|
subUnitId: o,
|
|
1241
1236
|
isCut: e === Ce.CUT,
|
|
1242
|
-
getTransform: (
|
|
1237
|
+
getTransform: (m, p) => {
|
|
1243
1238
|
var S;
|
|
1244
|
-
const
|
|
1239
|
+
const f = u.attachRangeWithCoord({
|
|
1245
1240
|
startRow: h.startRow,
|
|
1246
1241
|
endRow: h.endRow,
|
|
1247
1242
|
startColumn: h.startColumn,
|
|
1248
1243
|
endColumn: h.endColumn
|
|
1249
1244
|
}), _ = {
|
|
1250
|
-
...
|
|
1251
|
-
left:
|
|
1252
|
-
top:
|
|
1245
|
+
...m,
|
|
1246
|
+
left: f == null ? void 0 : f.startX,
|
|
1247
|
+
top: f == null ? void 0 : f.startY
|
|
1253
1248
|
};
|
|
1254
1249
|
return {
|
|
1255
1250
|
transform: _,
|
|
1256
|
-
sheetTransform: (S = x(_,
|
|
1251
|
+
sheetTransform: (S = x(_, c)) != null ? S : p
|
|
1257
1252
|
};
|
|
1258
1253
|
}
|
|
1259
1254
|
});
|
|
@@ -1264,49 +1259,49 @@ let At = class extends ie {
|
|
|
1264
1259
|
subUnitId: r,
|
|
1265
1260
|
getTransform: s,
|
|
1266
1261
|
isCut: o
|
|
1267
|
-
} = e, a = [],
|
|
1268
|
-
return t.forEach((
|
|
1269
|
-
const { transform: l, sheetTransform: g } =
|
|
1262
|
+
} = e, a = [], d = [], { _drawingService: u } = this;
|
|
1263
|
+
return t.forEach((c) => {
|
|
1264
|
+
const { transform: l, sheetTransform: g } = c;
|
|
1270
1265
|
if (!l)
|
|
1271
1266
|
return;
|
|
1272
|
-
const h = s(l, g),
|
|
1273
|
-
...
|
|
1267
|
+
const h = s(l, g), m = {
|
|
1268
|
+
...c,
|
|
1274
1269
|
unitId: n,
|
|
1275
1270
|
subUnitId: r,
|
|
1276
|
-
drawingId: o ?
|
|
1271
|
+
drawingId: o ? c.drawingId : Re.generateRandomId(),
|
|
1277
1272
|
transform: h.transform,
|
|
1278
1273
|
sheetTransform: h.sheetTransform
|
|
1279
1274
|
};
|
|
1280
1275
|
if (o) {
|
|
1281
|
-
const { undo: p, redo:
|
|
1276
|
+
const { undo: p, redo: f, objects: _ } = u.getBatchUpdateOp([m]);
|
|
1282
1277
|
a.push({
|
|
1283
|
-
id:
|
|
1278
|
+
id: P.id,
|
|
1284
1279
|
params: {
|
|
1285
1280
|
unitId: n,
|
|
1286
1281
|
subUnitId: r,
|
|
1287
|
-
type:
|
|
1288
|
-
op:
|
|
1282
|
+
type: U.UPDATE,
|
|
1283
|
+
op: f,
|
|
1289
1284
|
objects: _
|
|
1290
1285
|
}
|
|
1291
|
-
}),
|
|
1292
|
-
id:
|
|
1286
|
+
}), d.push({
|
|
1287
|
+
id: P.id,
|
|
1293
1288
|
params: {
|
|
1294
1289
|
unitId: n,
|
|
1295
1290
|
subUnitId: r,
|
|
1296
|
-
type:
|
|
1291
|
+
type: U.UPDATE,
|
|
1297
1292
|
op: p,
|
|
1298
1293
|
objects: _
|
|
1299
1294
|
}
|
|
1300
1295
|
});
|
|
1301
1296
|
} else {
|
|
1302
|
-
const { undo: p, redo:
|
|
1303
|
-
a.push({ id:
|
|
1297
|
+
const { undo: p, redo: f, objects: _ } = u.getBatchAddOp([m]);
|
|
1298
|
+
a.push({ id: P.id, params: { op: f, unitId: n, subUnitId: r, objects: _, type: U.INSERT } }), d.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: _, type: U.REMOVE } });
|
|
1304
1299
|
}
|
|
1305
|
-
}), { redos: a, undos:
|
|
1300
|
+
}), { redos: a, undos: d };
|
|
1306
1301
|
}
|
|
1307
1302
|
// eslint-disable-next-line max-lines-per-function
|
|
1308
1303
|
_generateRangeDrawingsPasteMutations(t, e) {
|
|
1309
|
-
var
|
|
1304
|
+
var y;
|
|
1310
1305
|
const {
|
|
1311
1306
|
unitId: n,
|
|
1312
1307
|
subUnitId: r,
|
|
@@ -1314,43 +1309,43 @@ let At = class extends ie {
|
|
|
1314
1309
|
pasteRange: o
|
|
1315
1310
|
} = t, {
|
|
1316
1311
|
copyRange: a,
|
|
1317
|
-
copyType:
|
|
1312
|
+
copyType: d
|
|
1318
1313
|
} = e;
|
|
1319
|
-
if (
|
|
1314
|
+
if (Fn.includes(s))
|
|
1320
1315
|
return { redos: [], undos: [] };
|
|
1321
|
-
const u = (
|
|
1316
|
+
const u = (y = this._renderManagerService.getRenderById(n)) == null ? void 0 : y.with(V);
|
|
1322
1317
|
if (!u || !this._copyInfo)
|
|
1323
1318
|
return { redos: [], undos: [] };
|
|
1324
|
-
const { drawings:
|
|
1319
|
+
const { drawings: c } = this._copyInfo;
|
|
1325
1320
|
if (!a)
|
|
1326
1321
|
return this._generateSingleDrawingPasteMutations({
|
|
1327
|
-
pasteTo: { unitId: n, subUnitId: r, range:
|
|
1322
|
+
pasteTo: { unitId: n, subUnitId: r, range: Tn(o) },
|
|
1328
1323
|
pasteType: s
|
|
1329
|
-
},
|
|
1330
|
-
const { ranges: [l, g], mapFunc: h } =
|
|
1331
|
-
startRow:
|
|
1332
|
-
endRow:
|
|
1324
|
+
}, d);
|
|
1325
|
+
const { ranges: [l, g], mapFunc: h } = Mi([a, o]), { row: m, col: p } = h(l.startRow, l.startColumn), { row: f, col: _ } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
|
|
1326
|
+
startRow: m,
|
|
1327
|
+
endRow: m,
|
|
1333
1328
|
startColumn: p,
|
|
1334
1329
|
endColumn: p
|
|
1335
1330
|
}), C = u.attachRangeWithCoord({
|
|
1336
|
-
startRow:
|
|
1337
|
-
endRow:
|
|
1331
|
+
startRow: f,
|
|
1332
|
+
endRow: f,
|
|
1338
1333
|
startColumn: _,
|
|
1339
1334
|
endColumn: _
|
|
1340
1335
|
});
|
|
1341
1336
|
if (!S || !C || !this._copyInfo)
|
|
1342
1337
|
return { redos: [], undos: [] };
|
|
1343
|
-
const b = C.startX - S.startX, v = C.startY - S.startY, D =
|
|
1344
|
-
return this._generateMutations(
|
|
1338
|
+
const b = C.startX - S.startX, v = C.startY - S.startY, D = f - m, w = _ - p;
|
|
1339
|
+
return this._generateMutations(c, {
|
|
1345
1340
|
unitId: n,
|
|
1346
1341
|
subUnitId: r,
|
|
1347
1342
|
getTransform: (I, E) => {
|
|
1348
|
-
var T,
|
|
1343
|
+
var T, M;
|
|
1349
1344
|
return {
|
|
1350
1345
|
transform: {
|
|
1351
1346
|
...I,
|
|
1352
1347
|
left: ((T = I == null ? void 0 : I.left) != null ? T : 0) + b,
|
|
1353
|
-
top: ((
|
|
1348
|
+
top: ((M = I == null ? void 0 : I.top) != null ? M : 0) + v
|
|
1354
1349
|
},
|
|
1355
1350
|
sheetTransform: {
|
|
1356
1351
|
...E,
|
|
@@ -1367,40 +1362,40 @@ let At = class extends ie {
|
|
|
1367
1362
|
}
|
|
1368
1363
|
};
|
|
1369
1364
|
},
|
|
1370
|
-
isCut:
|
|
1365
|
+
isCut: d === Ce.CUT
|
|
1371
1366
|
});
|
|
1372
1367
|
}
|
|
1373
1368
|
};
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
],
|
|
1381
|
-
var
|
|
1382
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1369
|
+
Tt = ys([
|
|
1370
|
+
Ke(0, yi),
|
|
1371
|
+
Ke(1, q),
|
|
1372
|
+
Ke(2, se),
|
|
1373
|
+
Ke(3, Ni),
|
|
1374
|
+
Ke(4, G)
|
|
1375
|
+
], Tt);
|
|
1376
|
+
var Us = Object.getOwnPropertyDescriptor, Ps = (i, t, e, n) => {
|
|
1377
|
+
for (var r = n > 1 ? void 0 : n ? Us(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1383
1378
|
(o = i[s]) && (r = o(r) || r);
|
|
1384
1379
|
return r;
|
|
1385
|
-
},
|
|
1386
|
-
let
|
|
1380
|
+
}, Ze = (i, t) => (e, n) => t(e, n, i);
|
|
1381
|
+
let Ot = class extends ie {
|
|
1387
1382
|
constructor(i, t, e, n, r) {
|
|
1388
1383
|
super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1389
1384
|
}
|
|
1390
1385
|
_initDrawingVisible() {
|
|
1391
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1386
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = vt([i, t]);
|
|
1392
1387
|
this.disposeWithMe(
|
|
1393
1388
|
e.pipe(
|
|
1394
1389
|
_e(([n, r]) => n ? n.activeSheet$.pipe(
|
|
1395
|
-
|
|
1390
|
+
Pn((s) => {
|
|
1396
1391
|
if (!s) {
|
|
1397
1392
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1398
1393
|
return;
|
|
1399
1394
|
}
|
|
1400
1395
|
const o = n.getUnitId(), a = s.getSheetId();
|
|
1401
1396
|
this._permissionService.composePermission([
|
|
1402
|
-
new
|
|
1403
|
-
new
|
|
1397
|
+
new Wn(o).id,
|
|
1398
|
+
new jn(o, a).id
|
|
1404
1399
|
]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(n, s);
|
|
1405
1400
|
})
|
|
1406
1401
|
) : (this._drawingManagerService.setDrawingVisible(!1), me))
|
|
@@ -1413,23 +1408,23 @@ let Nt = class extends ie {
|
|
|
1413
1408
|
if (!a)
|
|
1414
1409
|
return;
|
|
1415
1410
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1416
|
-
u.classType ===
|
|
1411
|
+
u.classType === Ae.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.removeObject(u);
|
|
1417
1412
|
});
|
|
1418
1413
|
}
|
|
1419
1414
|
_initDrawingEditable() {
|
|
1420
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1415
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = vt([i, t]);
|
|
1421
1416
|
this.disposeWithMe(
|
|
1422
1417
|
e.pipe(
|
|
1423
1418
|
_e(([n, r]) => n ? n.activeSheet$.pipe(
|
|
1424
|
-
|
|
1419
|
+
Pn((s) => {
|
|
1425
1420
|
if (!s) {
|
|
1426
1421
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1427
1422
|
return;
|
|
1428
1423
|
}
|
|
1429
1424
|
const o = n.getUnitId(), a = s.getSheetId();
|
|
1430
1425
|
this._permissionService.composePermission([
|
|
1431
|
-
new
|
|
1432
|
-
new
|
|
1426
|
+
new Kt(o).id,
|
|
1427
|
+
new Zt(o, a).id
|
|
1433
1428
|
]).every((u) => u.value) ? this._drawingManagerService.setDrawingEditable(!0) : this._handleDrawingEditableFalse(n, s);
|
|
1434
1429
|
})
|
|
1435
1430
|
) : (this._drawingManagerService.setDrawingEditable(!1), me))
|
|
@@ -1442,31 +1437,31 @@ let Nt = class extends ie {
|
|
|
1442
1437
|
if (!a)
|
|
1443
1438
|
return;
|
|
1444
1439
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1445
|
-
u.classType ===
|
|
1440
|
+
u.classType === Ae.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.detachTransformerFrom(u);
|
|
1446
1441
|
});
|
|
1447
1442
|
}
|
|
1448
1443
|
_initViewPermissionChange() {
|
|
1449
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1444
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1450
1445
|
this.disposeWithMe(
|
|
1451
|
-
|
|
1446
|
+
vt([i, t]).pipe(
|
|
1452
1447
|
_e(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1453
1448
|
_e((r) => {
|
|
1454
1449
|
if (!r)
|
|
1455
1450
|
return me;
|
|
1456
|
-
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s),
|
|
1457
|
-
if (!
|
|
1451
|
+
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
|
|
1452
|
+
if (!d)
|
|
1458
1453
|
return me;
|
|
1459
|
-
const u =
|
|
1454
|
+
const u = d.getTransformerByCreate();
|
|
1460
1455
|
return this._permissionService.composePermission$([
|
|
1461
|
-
new
|
|
1462
|
-
new
|
|
1456
|
+
new Wn(s).id,
|
|
1457
|
+
new jn(s, o).id
|
|
1463
1458
|
]).pipe(
|
|
1464
|
-
|
|
1465
|
-
|
|
1459
|
+
Me((l) => l.every((g) => g.value)),
|
|
1460
|
+
An()
|
|
1466
1461
|
).pipe(
|
|
1467
|
-
|
|
1462
|
+
Me((l) => ({
|
|
1468
1463
|
permission: l,
|
|
1469
|
-
scene:
|
|
1464
|
+
scene: d,
|
|
1470
1465
|
transformer: u,
|
|
1471
1466
|
unitId: s,
|
|
1472
1467
|
subUnitId: o
|
|
@@ -1477,14 +1472,14 @@ let Nt = class extends ie {
|
|
|
1477
1472
|
).subscribe({
|
|
1478
1473
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1479
1474
|
this._drawingManagerService.setDrawingVisible(e);
|
|
1480
|
-
const a = n.getAllObjectsByOrder(),
|
|
1481
|
-
e ? this._drawingManagerService.addNotification(u) : (a.forEach((
|
|
1482
|
-
|
|
1475
|
+
const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
|
|
1476
|
+
e ? this._drawingManagerService.addNotification(u) : (a.forEach((c) => {
|
|
1477
|
+
c.classType === Ae.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.removeObject(c);
|
|
1483
1478
|
}), r.clearSelectedObjects());
|
|
1484
1479
|
},
|
|
1485
1480
|
complete: () => {
|
|
1486
1481
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
1487
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
1482
|
+
const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET), n = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getUnitId(), s = n == null ? void 0 : n.getSheetId();
|
|
1488
1483
|
if (!r || !s)
|
|
1489
1484
|
return;
|
|
1490
1485
|
const o = this._drawingManagerService.getDrawingData(r, s), a = Object.values(o);
|
|
@@ -1494,27 +1489,27 @@ let Nt = class extends ie {
|
|
|
1494
1489
|
);
|
|
1495
1490
|
}
|
|
1496
1491
|
_initEditPermissionChange() {
|
|
1497
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1492
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1498
1493
|
this.disposeWithMe(
|
|
1499
|
-
|
|
1494
|
+
vt([i, t]).pipe(
|
|
1500
1495
|
_e(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1501
1496
|
_e((r) => {
|
|
1502
1497
|
if (!r)
|
|
1503
1498
|
return me;
|
|
1504
|
-
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s),
|
|
1505
|
-
if (!
|
|
1499
|
+
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
|
|
1500
|
+
if (!d)
|
|
1506
1501
|
return me;
|
|
1507
|
-
const u =
|
|
1502
|
+
const u = d.getTransformerByCreate();
|
|
1508
1503
|
return this._permissionService.composePermission$([
|
|
1509
|
-
new
|
|
1510
|
-
new
|
|
1504
|
+
new Kt(s).id,
|
|
1505
|
+
new Zt(s, o).id
|
|
1511
1506
|
]).pipe(
|
|
1512
|
-
|
|
1513
|
-
|
|
1507
|
+
Me((l) => l.every((g) => g.value)),
|
|
1508
|
+
An()
|
|
1514
1509
|
).pipe(
|
|
1515
|
-
|
|
1510
|
+
Me((l) => ({
|
|
1516
1511
|
permission: l,
|
|
1517
|
-
scene:
|
|
1512
|
+
scene: d,
|
|
1518
1513
|
transformer: u,
|
|
1519
1514
|
unitId: s,
|
|
1520
1515
|
subUnitId: o
|
|
@@ -1525,15 +1520,15 @@ let Nt = class extends ie {
|
|
|
1525
1520
|
).subscribe({
|
|
1526
1521
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1527
1522
|
this._drawingManagerService.setDrawingEditable(e);
|
|
1528
|
-
const a = n.getAllObjectsByOrder(),
|
|
1529
|
-
e ? (a.forEach((
|
|
1530
|
-
|
|
1531
|
-
}), this._drawingManagerService.addNotification(u)) : (a.forEach((
|
|
1532
|
-
|
|
1523
|
+
const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
|
|
1524
|
+
e ? (a.forEach((c) => {
|
|
1525
|
+
c.classType === Ae.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.attachTransformerTo(c);
|
|
1526
|
+
}), this._drawingManagerService.addNotification(u)) : (a.forEach((c) => {
|
|
1527
|
+
c.classType === Ae.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.detachTransformerFrom(c);
|
|
1533
1528
|
}), r.clearSelectedObjects());
|
|
1534
1529
|
},
|
|
1535
1530
|
complete: () => {
|
|
1536
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
1531
|
+
const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET);
|
|
1537
1532
|
if (!e)
|
|
1538
1533
|
return;
|
|
1539
1534
|
const n = e.getUnitId(), r = e.getActiveSheet();
|
|
@@ -1542,75 +1537,75 @@ let Nt = class extends ie {
|
|
|
1542
1537
|
const s = r.getSheetId(), o = this._renderManagerService.getRenderById(n), a = o == null ? void 0 : o.scene;
|
|
1543
1538
|
if (!a)
|
|
1544
1539
|
return;
|
|
1545
|
-
const
|
|
1540
|
+
const d = this._drawingManagerService.getDrawingData(n, s), u = Object.values(d);
|
|
1546
1541
|
this._drawingManagerService.setDrawingEditable(!0), a.getAllObjectsByOrder().forEach((l) => {
|
|
1547
|
-
l.classType ===
|
|
1542
|
+
l.classType === Ae.IMAGE && u.some((g) => l.oKey.includes(g.drawingId)) && a.detachTransformerFrom(l);
|
|
1548
1543
|
});
|
|
1549
1544
|
}
|
|
1550
1545
|
})
|
|
1551
1546
|
);
|
|
1552
1547
|
}
|
|
1553
1548
|
};
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
],
|
|
1561
|
-
var
|
|
1562
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1549
|
+
Ot = Ps([
|
|
1550
|
+
Ze(0, se),
|
|
1551
|
+
Ze(1, q),
|
|
1552
|
+
Ze(2, Fr),
|
|
1553
|
+
Ze(3, Se),
|
|
1554
|
+
Ze(4, A(Lr))
|
|
1555
|
+
], Ot);
|
|
1556
|
+
var As = Object.getOwnPropertyDescriptor, Ns = (i, t, e, n) => {
|
|
1557
|
+
for (var r = n > 1 ? void 0 : n ? As(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1563
1558
|
(o = i[s]) && (r = o(r) || r);
|
|
1564
1559
|
return r;
|
|
1565
|
-
},
|
|
1566
|
-
function
|
|
1567
|
-
const { scaleX: o, scaleY: a } = t.getAncestorScale(),
|
|
1560
|
+
}, De = (i, t) => (e, n) => t(e, n, i);
|
|
1561
|
+
function Dr(i, t, e, n, r, s = !1) {
|
|
1562
|
+
const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(Xn.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, m = {
|
|
1568
1563
|
left: !0,
|
|
1569
1564
|
// left means the left of pic is in a viewMainLeft
|
|
1570
1565
|
top: !0
|
|
1571
1566
|
};
|
|
1572
|
-
if (!
|
|
1567
|
+
if (!d)
|
|
1573
1568
|
return {
|
|
1574
1569
|
...i,
|
|
1575
|
-
absolute:
|
|
1570
|
+
absolute: m
|
|
1576
1571
|
};
|
|
1577
|
-
const { left: p, right:
|
|
1578
|
-
let { top: C, left: b, viewportScrollX: v, viewportScrollY: D } =
|
|
1579
|
-
const { boundsOfViewArea: w, scrollDirectionResponse:
|
|
1572
|
+
const { left: p, right: f, top: _, bottom: S } = i;
|
|
1573
|
+
let { top: C, left: b, viewportScrollX: v, viewportScrollY: D } = d;
|
|
1574
|
+
const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: I, columnHeaderHeight: E } = e, T = {
|
|
1580
1575
|
top: s ? 0 : E,
|
|
1581
1576
|
left: s ? 0 : I
|
|
1582
1577
|
};
|
|
1583
|
-
w && (
|
|
1584
|
-
let
|
|
1585
|
-
const N = e.rowStartY(l - h) + E,
|
|
1578
|
+
w && (Re.isDefine(T.top) && (T.top = w.top), Re.isDefine(T.left) && (T.left = w.left)), y === "HORIZONTAL" && (D = 0), y === "VERTICAL" && (v = 0);
|
|
1579
|
+
let M = 0, R = 0;
|
|
1580
|
+
const N = e.rowStartY(l - h) + E, B = e.colStartX(c - g) + I, Q = e.rowStartY(l) + E, H = e.colStartX(c) + I;
|
|
1586
1581
|
if (g === 0)
|
|
1587
|
-
|
|
1582
|
+
m.left = !1, M = (p - v) * o, R = (f - v) * o;
|
|
1588
1583
|
else {
|
|
1589
|
-
const k = p - (
|
|
1590
|
-
|
|
1584
|
+
const k = p - (B - I), ce = f - (B - I);
|
|
1585
|
+
f < H ? (M = k * o, R = ce * o) : p <= H && f >= H ? (M = k * o, R = Math.max(b, (f - v) * o)) : p > H && (m.left = !1, M = Math.max((p - v) * o, b), R = Math.max((f - v) * o, b));
|
|
1591
1586
|
}
|
|
1592
1587
|
let X = 0, Y = 0;
|
|
1593
1588
|
if (h === 0)
|
|
1594
|
-
|
|
1589
|
+
m.top = !1, X = (_ - D) * a, Y = (S - D) * a;
|
|
1595
1590
|
else {
|
|
1596
1591
|
const k = _ - (N - E), ce = S - (N - E);
|
|
1597
|
-
S < Q ? (X = k * a, Y = ce * a) : _ <= Q && S >= Q ? (X = k * a, Y = Math.max(C, (S - D) * a)) : _ > Q && (
|
|
1592
|
+
S < Q ? (X = k * a, Y = ce * a) : _ <= Q && S >= Q ? (X = k * a, Y = Math.max(C, (S - D) * a)) : _ > Q && (m.top = !1, X = Math.max((_ - D) * a, C), Y = Math.max((S - D) * a, C));
|
|
1598
1593
|
}
|
|
1599
|
-
return
|
|
1600
|
-
left:
|
|
1594
|
+
return M = Math.max(M, T.left), X = Math.max(X, T.top), R = Math.max(R, T.left), Y = Math.max(Y, T.top), {
|
|
1595
|
+
left: M,
|
|
1601
1596
|
right: R,
|
|
1602
1597
|
top: X,
|
|
1603
1598
|
bottom: Y,
|
|
1604
|
-
absolute:
|
|
1599
|
+
absolute: m
|
|
1605
1600
|
};
|
|
1606
1601
|
}
|
|
1607
|
-
const
|
|
1608
|
-
const { left: s, top: o, width: a, height:
|
|
1602
|
+
const fe = (i, t, e, n, r) => {
|
|
1603
|
+
const { left: s, top: o, width: a, height: d, angle: u } = i, c = {
|
|
1609
1604
|
left: s,
|
|
1610
1605
|
right: s + a,
|
|
1611
1606
|
top: o,
|
|
1612
|
-
bottom: o +
|
|
1613
|
-
}, l =
|
|
1607
|
+
bottom: o + d
|
|
1608
|
+
}, l = Dr(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
|
|
1614
1609
|
return {
|
|
1615
1610
|
startX: l.left,
|
|
1616
1611
|
endX: l.right,
|
|
@@ -1618,27 +1613,27 @@ const ge = (i, t, e, n, r) => {
|
|
|
1618
1613
|
endY: l.bottom,
|
|
1619
1614
|
rotate: u,
|
|
1620
1615
|
width: a * g,
|
|
1621
|
-
height:
|
|
1616
|
+
height: d * h,
|
|
1622
1617
|
absolute: l.absolute
|
|
1623
1618
|
};
|
|
1624
1619
|
};
|
|
1625
|
-
let
|
|
1620
|
+
let tt = class extends ie {
|
|
1626
1621
|
constructor(t, e, n, r, s, o, a) {
|
|
1627
1622
|
super();
|
|
1628
1623
|
/**
|
|
1629
1624
|
* for update dom container position when scrolling and zoom
|
|
1630
1625
|
*/
|
|
1631
1626
|
te(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
1632
|
-
te(this, "_transformChange$", new
|
|
1627
|
+
te(this, "_transformChange$", new Xt());
|
|
1633
1628
|
te(this, "transformChange$", this._transformChange$.asObservable());
|
|
1634
|
-
te(this, "_add$", new
|
|
1629
|
+
te(this, "_add$", new Xt());
|
|
1635
1630
|
te(this, "add$", this._add$.asObservable());
|
|
1636
|
-
te(this, "_remove$", new
|
|
1631
|
+
te(this, "_remove$", new Xt());
|
|
1637
1632
|
te(this, "remove$", this._remove$.asObservable());
|
|
1638
1633
|
this._renderManagerService = t, this._univerInstanceService = e, this._commandService = n, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
1639
1634
|
}
|
|
1640
1635
|
_bindScrollEvent() {
|
|
1641
|
-
this._lifecycleService.lifecycle$.pipe(
|
|
1636
|
+
this._lifecycleService.lifecycle$.pipe(Li((t) => t === Gr.Rendered), Yi(1)).subscribe(() => {
|
|
1642
1637
|
this._scrollUpdateListener();
|
|
1643
1638
|
});
|
|
1644
1639
|
}
|
|
@@ -1663,47 +1658,47 @@ let nt = class extends ie {
|
|
|
1663
1658
|
// eslint-disable-next-line max-lines-per-function
|
|
1664
1659
|
this._drawingManagerService.add$.subscribe((t) => {
|
|
1665
1660
|
t.forEach((e) => {
|
|
1666
|
-
var
|
|
1667
|
-
const { unitId: n, subUnitId: r, drawingId: s } = e, o = ae(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e),
|
|
1668
|
-
if (!
|
|
1661
|
+
var K;
|
|
1662
|
+
const { unitId: n, subUnitId: r, drawingId: s } = e, o = ae(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), d = this._univerInstanceService.getUnit(n, F.UNIVER_SHEET);
|
|
1663
|
+
if (!d)
|
|
1669
1664
|
return;
|
|
1670
|
-
const u =
|
|
1665
|
+
const u = d.getActiveSheet().getSheetId();
|
|
1671
1666
|
if (!a || !o)
|
|
1672
1667
|
return;
|
|
1673
|
-
const
|
|
1674
|
-
if (!
|
|
1668
|
+
const c = (K = this._renderManagerService.getRenderById(n)) == null ? void 0 : K.with(V).getSkeletonParam(r);
|
|
1669
|
+
if (!c)
|
|
1675
1670
|
return;
|
|
1676
1671
|
const { transform: l, drawingType: g, data: h } = a;
|
|
1677
|
-
if (g !==
|
|
1672
|
+
if (g !== j.DRAWING_DOM && g !== j.DRAWING_CHART)
|
|
1678
1673
|
return;
|
|
1679
|
-
const
|
|
1680
|
-
if (
|
|
1674
|
+
const m = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1675
|
+
if (m == null)
|
|
1681
1676
|
return;
|
|
1682
|
-
const { scene: p, canvas:
|
|
1677
|
+
const { scene: p, canvas: f } = m;
|
|
1683
1678
|
if (l == null)
|
|
1684
1679
|
return !0;
|
|
1685
1680
|
if (u !== r)
|
|
1686
1681
|
return;
|
|
1687
|
-
const { left: _, top: S, width: C, height: b, angle: v, flipX: D, flipY: w, skewX:
|
|
1682
|
+
const { left: _, top: S, width: C, height: b, angle: v, flipX: D, flipY: w, skewX: y, skewY: I } = l, E = Ie({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(E);
|
|
1688
1683
|
if (T != null) {
|
|
1689
|
-
T.transformByState({ left: _, top: S, width: C, height: b, angle: v, flipX: D, flipY: w, skewX:
|
|
1684
|
+
T.transformByState({ left: _, top: S, width: C, height: b, angle: v, flipX: D, flipY: w, skewX: y, skewY: I });
|
|
1690
1685
|
return;
|
|
1691
1686
|
}
|
|
1692
|
-
const
|
|
1687
|
+
const M = {
|
|
1693
1688
|
left: _,
|
|
1694
1689
|
top: S,
|
|
1695
1690
|
width: C,
|
|
1696
1691
|
height: b,
|
|
1697
1692
|
zIndex: this._drawingManagerService.getDrawingOrder(n, r).length - 1
|
|
1698
|
-
}, R = g ===
|
|
1699
|
-
if (
|
|
1693
|
+
}, R = g === j.DRAWING_CHART;
|
|
1694
|
+
if (M.rotateEnabled = !1, R) {
|
|
1700
1695
|
const k = h ? h.backgroundColor : "white";
|
|
1701
|
-
|
|
1696
|
+
M.fill = k, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
|
|
1702
1697
|
}
|
|
1703
|
-
const N = new
|
|
1704
|
-
R && N.setObjectType(
|
|
1705
|
-
const
|
|
1706
|
-
dispose:
|
|
1698
|
+
const N = new Ne(E, M);
|
|
1699
|
+
R && N.setObjectType(yn.CHART), p.addObject(N, Yt), a.allowTransform !== !1 && p.attachTransformerTo(N);
|
|
1700
|
+
const B = new wt(), Q = fe(N, m.renderUnit.scene, c.skeleton, o.worksheet), H = new je(Q), X = {
|
|
1701
|
+
dispose: B,
|
|
1707
1702
|
rect: N,
|
|
1708
1703
|
position$: H,
|
|
1709
1704
|
unitId: n,
|
|
@@ -1715,29 +1710,29 @@ let nt = class extends ie {
|
|
|
1715
1710
|
id: s,
|
|
1716
1711
|
componentKey: a.componentKey,
|
|
1717
1712
|
onPointerDown: (k) => {
|
|
1718
|
-
|
|
1713
|
+
f.dispatchEvent(new PointerEvent(k.type, k));
|
|
1719
1714
|
},
|
|
1720
1715
|
onPointerMove: (k) => {
|
|
1721
|
-
|
|
1716
|
+
f.dispatchEvent(new PointerEvent(k.type, k));
|
|
1722
1717
|
},
|
|
1723
1718
|
onPointerUp: (k) => {
|
|
1724
|
-
|
|
1719
|
+
f.dispatchEvent(new PointerEvent(k.type, k));
|
|
1725
1720
|
},
|
|
1726
1721
|
onWheel: (k) => {
|
|
1727
|
-
|
|
1722
|
+
f.dispatchEvent(new WheelEvent(k.type, k));
|
|
1728
1723
|
},
|
|
1729
1724
|
data: h,
|
|
1730
1725
|
unitId: n
|
|
1731
1726
|
});
|
|
1732
1727
|
const Y = N.onTransformChange$.subscribeEvent(() => {
|
|
1733
|
-
const k =
|
|
1728
|
+
const k = fe(N, m.renderUnit.scene, c.skeleton, o.worksheet);
|
|
1734
1729
|
H.next(
|
|
1735
1730
|
k
|
|
1736
1731
|
);
|
|
1737
1732
|
});
|
|
1738
|
-
|
|
1733
|
+
B.add(() => {
|
|
1739
1734
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
1740
|
-
}), Y &&
|
|
1735
|
+
}), Y && B.add(Y), this._domLayerInfoMap.set(s, X);
|
|
1741
1736
|
});
|
|
1742
1737
|
})
|
|
1743
1738
|
), this.disposeWithMe(
|
|
@@ -1746,34 +1741,34 @@ let nt = class extends ie {
|
|
|
1746
1741
|
const { unitId: n, subUnitId: r, drawingId: s } = e, o = Ie({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1747
1742
|
if (a == null)
|
|
1748
1743
|
return;
|
|
1749
|
-
const { transformer:
|
|
1750
|
-
|
|
1744
|
+
const { transformer: d, scene: u } = a, c = u.getObject(o);
|
|
1745
|
+
c != null && c.oKey && d.clearControlByIds([c == null ? void 0 : c.oKey]);
|
|
1751
1746
|
});
|
|
1752
1747
|
})
|
|
1753
1748
|
);
|
|
1754
1749
|
}
|
|
1755
1750
|
_scrollUpdateListener() {
|
|
1756
1751
|
const t = (e, n) => {
|
|
1757
|
-
var
|
|
1758
|
-
const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = ae(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (
|
|
1752
|
+
var d;
|
|
1753
|
+
const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = ae(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (d = this._renderManagerService.getRenderById(e)) == null ? void 0 : d.with(V).getSkeletonParam(n);
|
|
1759
1754
|
!r || !o || !a || s.forEach((u) => {
|
|
1760
|
-
const
|
|
1761
|
-
if (
|
|
1762
|
-
const l =
|
|
1763
|
-
|
|
1755
|
+
const c = this._domLayerInfoMap.get(u);
|
|
1756
|
+
if (c) {
|
|
1757
|
+
const l = fe(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
|
|
1758
|
+
c.position$.next(l);
|
|
1764
1759
|
}
|
|
1765
1760
|
});
|
|
1766
1761
|
};
|
|
1767
1762
|
this.disposeWithMe(
|
|
1768
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1769
|
-
_e((e) => e ? e.activeSheet$ :
|
|
1770
|
-
|
|
1763
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
|
|
1764
|
+
_e((e) => e ? e.activeSheet$ : Nn(null)),
|
|
1765
|
+
Me((e) => {
|
|
1771
1766
|
if (!e) return null;
|
|
1772
1767
|
const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
|
|
1773
1768
|
return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
|
|
1774
1769
|
}),
|
|
1775
1770
|
_e(
|
|
1776
|
-
(e) => e ?
|
|
1771
|
+
(e) => e ? Xr(e.render.scene.getViewport(Xn.VIEW_MAIN).onScrollAfter$).pipe(Me(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : Nn(null)
|
|
1777
1772
|
)
|
|
1778
1773
|
).subscribe((e) => {
|
|
1779
1774
|
if (!e) return;
|
|
@@ -1781,12 +1776,12 @@ let nt = class extends ie {
|
|
|
1781
1776
|
t(n, r);
|
|
1782
1777
|
})
|
|
1783
1778
|
), this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
1784
|
-
if (e.id ===
|
|
1779
|
+
if (e.id === On.id) {
|
|
1785
1780
|
const n = e.params, { unitId: r } = n;
|
|
1786
1781
|
Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
|
|
1787
1782
|
t(r, o);
|
|
1788
1783
|
});
|
|
1789
|
-
} else if (e.id ===
|
|
1784
|
+
} else if (e.id === Vi.id) {
|
|
1790
1785
|
const { unitId: n, subUnitId: r } = e.params;
|
|
1791
1786
|
t(n, r);
|
|
1792
1787
|
}
|
|
@@ -1794,25 +1789,25 @@ let nt = class extends ie {
|
|
|
1794
1789
|
}
|
|
1795
1790
|
_getPosition(t, e) {
|
|
1796
1791
|
var g;
|
|
1797
|
-
const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(
|
|
1792
|
+
const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Ge);
|
|
1798
1793
|
if (a == null)
|
|
1799
1794
|
return;
|
|
1800
|
-
const
|
|
1801
|
-
if (c == null)
|
|
1802
|
-
return;
|
|
1803
|
-
const u = {
|
|
1804
|
-
column: c.actualColumn,
|
|
1805
|
-
columnOffset: n - c.startX,
|
|
1806
|
-
row: c.actualRow,
|
|
1807
|
-
rowOffset: s - c.startY
|
|
1808
|
-
}, d = a.getCellWithCoordByOffset(r, o);
|
|
1795
|
+
const d = a.getCellWithCoordByOffset(n, s);
|
|
1809
1796
|
if (d == null)
|
|
1810
1797
|
return;
|
|
1811
|
-
const
|
|
1798
|
+
const u = {
|
|
1812
1799
|
column: d.actualColumn,
|
|
1813
|
-
columnOffset:
|
|
1800
|
+
columnOffset: n - d.startX,
|
|
1814
1801
|
row: d.actualRow,
|
|
1815
|
-
rowOffset:
|
|
1802
|
+
rowOffset: s - d.startY
|
|
1803
|
+
}, c = a.getCellWithCoordByOffset(r, o);
|
|
1804
|
+
if (c == null)
|
|
1805
|
+
return;
|
|
1806
|
+
const l = {
|
|
1807
|
+
column: c.actualColumn,
|
|
1808
|
+
columnOffset: r - c.startX,
|
|
1809
|
+
row: c.actualRow,
|
|
1810
|
+
rowOffset: o - c.startY
|
|
1816
1811
|
};
|
|
1817
1812
|
return {
|
|
1818
1813
|
from: u,
|
|
@@ -1824,7 +1819,7 @@ let nt = class extends ie {
|
|
|
1824
1819
|
this._drawingManagerService.update$.subscribe((t) => {
|
|
1825
1820
|
t.forEach((e) => {
|
|
1826
1821
|
const n = this._drawingManagerService.getDrawingByParam(e);
|
|
1827
|
-
if (!n || n.drawingType !==
|
|
1822
|
+
if (!n || n.drawingType !== j.DRAWING_DOM && n.drawingType !== j.DRAWING_CHART)
|
|
1828
1823
|
return;
|
|
1829
1824
|
const r = {
|
|
1830
1825
|
...n.transform
|
|
@@ -1846,8 +1841,8 @@ let nt = class extends ie {
|
|
|
1846
1841
|
updateFloatDomProps(t, e, n, r) {
|
|
1847
1842
|
const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1848
1843
|
if (s && o) {
|
|
1849
|
-
const { scene: a } = o,
|
|
1850
|
-
u && u instanceof
|
|
1844
|
+
const { scene: a } = o, d = Ie({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(d);
|
|
1845
|
+
u && u instanceof Ne && u.setProps(r);
|
|
1851
1846
|
}
|
|
1852
1847
|
}
|
|
1853
1848
|
// CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
|
|
@@ -1858,14 +1853,14 @@ let nt = class extends ie {
|
|
|
1858
1853
|
});
|
|
1859
1854
|
if (!n)
|
|
1860
1855
|
throw new Error("cannot find current target!");
|
|
1861
|
-
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data:
|
|
1856
|
+
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e : bt(), l = this._getPosition(o, r);
|
|
1862
1857
|
if (l == null)
|
|
1863
1858
|
return;
|
|
1864
1859
|
const g = {
|
|
1865
1860
|
unitId: r,
|
|
1866
1861
|
subUnitId: s,
|
|
1867
|
-
drawingId:
|
|
1868
|
-
drawingType: t.type ||
|
|
1862
|
+
drawingId: c,
|
|
1863
|
+
drawingType: t.type || j.DRAWING_DOM,
|
|
1869
1864
|
componentKey: a,
|
|
1870
1865
|
sheetTransform: l,
|
|
1871
1866
|
transform: {
|
|
@@ -1874,16 +1869,16 @@ let nt = class extends ie {
|
|
|
1874
1869
|
width: o.endX - o.startX,
|
|
1875
1870
|
height: o.endY - o.startY
|
|
1876
1871
|
},
|
|
1877
|
-
data:
|
|
1872
|
+
data: d,
|
|
1878
1873
|
allowTransform: u
|
|
1879
1874
|
};
|
|
1880
|
-
return this._commandService.executeCommand(
|
|
1875
|
+
return this._commandService.executeCommand(Wt.id, {
|
|
1881
1876
|
unitId: r,
|
|
1882
1877
|
drawings: [g]
|
|
1883
|
-
}), this._add$.next({ unitId: r, subUnitId: s, id:
|
|
1884
|
-
id:
|
|
1878
|
+
}), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
|
|
1879
|
+
id: c,
|
|
1885
1880
|
dispose: () => {
|
|
1886
|
-
this._removeDom(
|
|
1881
|
+
this._removeDom(c, !0);
|
|
1887
1882
|
}
|
|
1888
1883
|
};
|
|
1889
1884
|
}
|
|
@@ -1898,33 +1893,33 @@ let nt = class extends ie {
|
|
|
1898
1893
|
const a = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: t });
|
|
1899
1894
|
if (!a)
|
|
1900
1895
|
return;
|
|
1901
|
-
const
|
|
1902
|
-
this._commandService.syncExecuteCommand(
|
|
1896
|
+
const d = this._sheetDrawingService.getBatchRemoveOp([a]), { redo: u, objects: c } = d;
|
|
1897
|
+
this._commandService.syncExecuteCommand(P.id, { unitId: r, subUnitId: s, op: u, objects: c, type: U.REMOVE });
|
|
1903
1898
|
}
|
|
1904
1899
|
}
|
|
1905
1900
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
1906
1901
|
addFloatDomToRange(t, e, n, r) {
|
|
1907
|
-
var D, w,
|
|
1902
|
+
var D, w, y;
|
|
1908
1903
|
const s = ae(this._univerInstanceService, {
|
|
1909
1904
|
unitId: e.unitId,
|
|
1910
1905
|
subUnitId: e.subUnitId
|
|
1911
1906
|
});
|
|
1912
1907
|
if (!s)
|
|
1913
1908
|
throw new Error("cannot find current target!");
|
|
1914
|
-
const { unitId: o, subUnitId: a } = s,
|
|
1915
|
-
if (!
|
|
1909
|
+
const { unitId: o, subUnitId: a } = s, d = this._getSceneAndTransformerByDrawingSearch(o);
|
|
1910
|
+
if (!d) return;
|
|
1916
1911
|
const u = this._renderManagerService.getRenderById(o);
|
|
1917
1912
|
if (!u) return;
|
|
1918
|
-
const
|
|
1919
|
-
if (!
|
|
1920
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e,
|
|
1913
|
+
const c = (D = this._renderManagerService.getRenderById(o)) == null ? void 0 : D.with(V).getWorksheetSkeleton(a);
|
|
1914
|
+
if (!c) return;
|
|
1915
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : bt(), { position: p, position$: f } = this._createRangePositionObserver(t, u, c.skeleton);
|
|
1921
1916
|
if (this._getPosition(p, o) == null)
|
|
1922
1917
|
return;
|
|
1923
|
-
const S =
|
|
1918
|
+
const S = d.scene, { scaleX: C } = S.getAncestorScale(), b = Ct(p, n, C), v = {
|
|
1924
1919
|
unitId: o,
|
|
1925
1920
|
subUnitId: a,
|
|
1926
|
-
drawingId:
|
|
1927
|
-
drawingType: e.type ||
|
|
1921
|
+
drawingId: m,
|
|
1922
|
+
drawingType: e.type || j.DRAWING_DOM,
|
|
1928
1923
|
componentKey: l,
|
|
1929
1924
|
transform: {
|
|
1930
1925
|
left: b.startX,
|
|
@@ -1936,11 +1931,11 @@ let nt = class extends ie {
|
|
|
1936
1931
|
allowTransform: h
|
|
1937
1932
|
};
|
|
1938
1933
|
{
|
|
1939
|
-
const { unitId: I, subUnitId: E, drawingId: T } = v,
|
|
1934
|
+
const { unitId: I, subUnitId: E, drawingId: T } = v, M = ae(this._univerInstanceService, { unitId: I, subUnitId: E }), R = v, N = this._univerInstanceService.getUnit(I, F.UNIVER_SHEET);
|
|
1940
1935
|
if (!N)
|
|
1941
1936
|
return;
|
|
1942
|
-
const
|
|
1943
|
-
if (!R || !
|
|
1937
|
+
const B = N.getActiveSheet().getSheetId();
|
|
1938
|
+
if (!R || !M)
|
|
1944
1939
|
return;
|
|
1945
1940
|
const Q = (w = this._renderManagerService.getRenderById(I)) == null ? void 0 : w.with(V);
|
|
1946
1941
|
if (!Q)
|
|
@@ -1948,50 +1943,50 @@ let nt = class extends ie {
|
|
|
1948
1943
|
const H = Q.getWorksheetSkeleton(E);
|
|
1949
1944
|
if (!H)
|
|
1950
1945
|
return;
|
|
1951
|
-
const { transform: X, drawingType: Y, data:
|
|
1952
|
-
if (Y !==
|
|
1946
|
+
const { transform: X, drawingType: Y, data: K } = R;
|
|
1947
|
+
if (Y !== j.DRAWING_DOM && Y !== j.DRAWING_CHART)
|
|
1953
1948
|
return;
|
|
1954
1949
|
const k = this._getSceneAndTransformerByDrawingSearch(I);
|
|
1955
1950
|
if (k == null)
|
|
1956
1951
|
return;
|
|
1957
|
-
const { scene: ce, canvas:
|
|
1958
|
-
if (X == null ||
|
|
1952
|
+
const { scene: ce, canvas: ye } = k;
|
|
1953
|
+
if (X == null || B !== E)
|
|
1959
1954
|
return;
|
|
1960
|
-
const { left:
|
|
1961
|
-
if (
|
|
1962
|
-
|
|
1955
|
+
const { left: ot, top: at, width: ct, height: dt, angle: $t, flipX: xt, flipY: lt, skewX: ut, skewY: Ee } = X, ht = Ie({ unitId: I, subUnitId: E, drawingId: T }), le = ce.getObject(ht);
|
|
1956
|
+
if (le != null) {
|
|
1957
|
+
le.transformByState({ left: ot, top: at, width: ct, height: dt, angle: $t, flipX: xt, flipY: lt, skewX: ut, skewY: Ee });
|
|
1963
1958
|
return;
|
|
1964
1959
|
}
|
|
1965
1960
|
const ee = {
|
|
1966
|
-
left:
|
|
1961
|
+
left: ot,
|
|
1967
1962
|
// from floatDomParam.transform
|
|
1968
|
-
top:
|
|
1969
|
-
width:
|
|
1970
|
-
height:
|
|
1963
|
+
top: at,
|
|
1964
|
+
width: ct,
|
|
1965
|
+
height: dt,
|
|
1971
1966
|
zIndex: this._drawingManagerService.getDrawingOrder(I, E).length - 1
|
|
1972
|
-
},
|
|
1973
|
-
if (
|
|
1974
|
-
const
|
|
1975
|
-
ee.fill =
|
|
1967
|
+
}, Te = Y === j.DRAWING_CHART;
|
|
1968
|
+
if (Te) {
|
|
1969
|
+
const W = K ? K.backgroundColor : "white";
|
|
1970
|
+
ee.fill = W, ee.rotateEnabled = !1, K && K.border && (ee.stroke = K.border), ee.paintFirst = "stroke", ee.strokeWidth = 1, ee.borderEnabled = !1, ee.radius = 8;
|
|
1976
1971
|
}
|
|
1977
|
-
const
|
|
1978
|
-
|
|
1979
|
-
const
|
|
1980
|
-
top:
|
|
1981
|
-
left:
|
|
1982
|
-
bottom:
|
|
1983
|
-
right:
|
|
1984
|
-
},
|
|
1985
|
-
dispose:
|
|
1986
|
-
rect:
|
|
1972
|
+
const ue = new Ne(ht, ee);
|
|
1973
|
+
Te && ue.setObjectType(yn.CHART), ce.addObject(ue, Yt), R.allowTransform !== !1 && ce.attachTransformerTo(ue);
|
|
1974
|
+
const he = new wt(), gt = ce.getMainViewport(), { rowHeaderWidth: Oe, columnHeaderHeight: Xe } = H.skeleton, ft = {
|
|
1975
|
+
top: Xe,
|
|
1976
|
+
left: Oe,
|
|
1977
|
+
bottom: gt.bottom,
|
|
1978
|
+
right: gt.right
|
|
1979
|
+
}, ge = {
|
|
1980
|
+
dispose: he,
|
|
1981
|
+
rect: ue,
|
|
1987
1982
|
boundsOfViewArea: ft,
|
|
1988
1983
|
domAnchor: n,
|
|
1989
1984
|
unitId: I,
|
|
1990
1985
|
subUnitId: E
|
|
1991
|
-
}, $ =
|
|
1992
|
-
|
|
1993
|
-
let
|
|
1994
|
-
position$:
|
|
1986
|
+
}, $ = fe(ue, k.renderUnit.scene, H.skeleton, M.worksheet, ge), Ue = new je($);
|
|
1987
|
+
ge.position$ = Ue;
|
|
1988
|
+
let Ve = {
|
|
1989
|
+
position$: Ue,
|
|
1995
1990
|
id: T,
|
|
1996
1991
|
componentKey: R.componentKey,
|
|
1997
1992
|
onPointerDown: () => {
|
|
@@ -2000,63 +1995,63 @@ let nt = class extends ie {
|
|
|
2000
1995
|
},
|
|
2001
1996
|
onPointerUp: () => {
|
|
2002
1997
|
},
|
|
2003
|
-
onWheel: (
|
|
2004
|
-
|
|
1998
|
+
onWheel: (W) => {
|
|
1999
|
+
ye.dispatchEvent(new WheelEvent(W.type, W));
|
|
2005
2000
|
},
|
|
2006
|
-
data:
|
|
2001
|
+
data: K,
|
|
2007
2002
|
unitId: I
|
|
2008
2003
|
};
|
|
2009
|
-
e.eventPassThrough && (
|
|
2010
|
-
...
|
|
2011
|
-
onPointerDown: (
|
|
2012
|
-
|
|
2004
|
+
e.eventPassThrough && (Ve = {
|
|
2005
|
+
...Ve,
|
|
2006
|
+
onPointerDown: (W) => {
|
|
2007
|
+
ye.dispatchEvent(new PointerEvent(W.type, W));
|
|
2013
2008
|
},
|
|
2014
|
-
onPointerMove: (
|
|
2015
|
-
|
|
2009
|
+
onPointerMove: (W) => {
|
|
2010
|
+
ye.dispatchEvent(new PointerEvent(W.type, W));
|
|
2016
2011
|
},
|
|
2017
|
-
onPointerUp: (
|
|
2018
|
-
|
|
2012
|
+
onPointerUp: (W) => {
|
|
2013
|
+
ye.dispatchEvent(new PointerEvent(W.type, W));
|
|
2019
2014
|
}
|
|
2020
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2021
|
-
var
|
|
2022
|
-
const
|
|
2023
|
-
startX:
|
|
2024
|
-
startY:
|
|
2025
|
-
endX:
|
|
2026
|
-
endY:
|
|
2027
|
-
width: (
|
|
2028
|
-
height: (
|
|
2015
|
+
}), this._canvasFloatDomService.addFloatDom(Ve), this.disposeWithMe(f.subscribe((W) => {
|
|
2016
|
+
var hn, gn, fn, mn;
|
|
2017
|
+
const un = Ct({
|
|
2018
|
+
startX: W.startX,
|
|
2019
|
+
startY: W.startY,
|
|
2020
|
+
endX: W.endX,
|
|
2021
|
+
endY: W.endY,
|
|
2022
|
+
width: (hn = n.width) != null ? hn : W.width,
|
|
2023
|
+
height: (gn = n.height) != null ? gn : W.height,
|
|
2029
2024
|
absolute: {
|
|
2030
2025
|
left: p.absolute.left,
|
|
2031
2026
|
top: p.absolute.top
|
|
2032
2027
|
}
|
|
2033
|
-
}, n),
|
|
2034
|
-
left:
|
|
2035
|
-
top:
|
|
2036
|
-
width: (
|
|
2037
|
-
height: (
|
|
2028
|
+
}, n), Ur = Ie({ unitId: I, subUnitId: E, drawingId: T }), Pr = new Ne(Ur, {
|
|
2029
|
+
left: un.startX,
|
|
2030
|
+
top: un.startY,
|
|
2031
|
+
width: (fn = n.width) != null ? fn : W.width,
|
|
2032
|
+
height: (mn = n.height) != null ? mn : W.height,
|
|
2038
2033
|
zIndex: this._drawingManagerService.getDrawingOrder(I, E).length - 1
|
|
2039
|
-
}),
|
|
2040
|
-
|
|
2034
|
+
}), Ar = fe(Pr, k.renderUnit.scene, H.skeleton, M.worksheet, ge);
|
|
2035
|
+
Ue.next(Ar);
|
|
2041
2036
|
}));
|
|
2042
|
-
const
|
|
2043
|
-
|
|
2044
|
-
|
|
2037
|
+
const He = (y = this._renderManagerService.getRenderById(I)) == null ? void 0 : y.with(V);
|
|
2038
|
+
He == null || He.currentSkeleton$.subscribe((W) => {
|
|
2039
|
+
W && H.sheetId !== W.sheetId && this._removeDom(m, !0);
|
|
2045
2040
|
});
|
|
2046
|
-
const
|
|
2047
|
-
const
|
|
2048
|
-
|
|
2049
|
-
|
|
2041
|
+
const mt = ue.onTransformChange$.subscribeEvent(() => {
|
|
2042
|
+
const W = fe(ue, k.renderUnit.scene, H.skeleton, M.worksheet, ge);
|
|
2043
|
+
Ue.next(
|
|
2044
|
+
W
|
|
2050
2045
|
);
|
|
2051
2046
|
});
|
|
2052
|
-
|
|
2047
|
+
he.add(() => {
|
|
2053
2048
|
this._canvasFloatDomService.removeFloatDom(T);
|
|
2054
|
-
}),
|
|
2049
|
+
}), mt && he.add(mt), this._domLayerInfoMap.set(T, ge);
|
|
2055
2050
|
}
|
|
2056
2051
|
return {
|
|
2057
|
-
id:
|
|
2052
|
+
id: m,
|
|
2058
2053
|
dispose: () => {
|
|
2059
|
-
this._removeDom(
|
|
2054
|
+
this._removeDom(m, !0);
|
|
2060
2055
|
}
|
|
2061
2056
|
};
|
|
2062
2057
|
}
|
|
@@ -2073,21 +2068,21 @@ let nt = class extends ie {
|
|
|
2073
2068
|
if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
|
|
2074
2069
|
const u = this._renderManagerService.getRenderById(o);
|
|
2075
2070
|
if (!u) return;
|
|
2076
|
-
const
|
|
2077
|
-
if (!
|
|
2078
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e,
|
|
2071
|
+
const c = (b = this._renderManagerService.getRenderById(o)) == null ? void 0 : b.with(V).getWorksheetSkeleton(a);
|
|
2072
|
+
if (!c) return;
|
|
2073
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : bt(), { position: p, position$: f } = this._createRangePositionObserver({
|
|
2079
2074
|
startRow: 0,
|
|
2080
2075
|
endRow: 0,
|
|
2081
2076
|
startColumn: t,
|
|
2082
2077
|
endColumn: t
|
|
2083
|
-
}, u,
|
|
2078
|
+
}, u, c.skeleton), _ = p;
|
|
2084
2079
|
if (_.startY = 0, this._getPosition(p, o) == null)
|
|
2085
2080
|
return;
|
|
2086
2081
|
const C = {
|
|
2087
2082
|
unitId: o,
|
|
2088
2083
|
subUnitId: a,
|
|
2089
|
-
drawingId:
|
|
2090
|
-
drawingType: e.type ||
|
|
2084
|
+
drawingId: m,
|
|
2085
|
+
drawingType: e.type || j.DRAWING_DOM,
|
|
2091
2086
|
componentKey: l,
|
|
2092
2087
|
transform: {
|
|
2093
2088
|
left: _.startX,
|
|
@@ -2099,30 +2094,30 @@ let nt = class extends ie {
|
|
|
2099
2094
|
allowTransform: h
|
|
2100
2095
|
};
|
|
2101
2096
|
{
|
|
2102
|
-
const { unitId: w, subUnitId:
|
|
2103
|
-
if (!
|
|
2097
|
+
const { unitId: w, subUnitId: y, drawingId: I } = C, E = ae(this._univerInstanceService, { unitId: w, subUnitId: y }), T = C, M = this._univerInstanceService.getUnit(w, F.UNIVER_SHEET);
|
|
2098
|
+
if (!M)
|
|
2104
2099
|
return;
|
|
2105
|
-
const R =
|
|
2100
|
+
const R = M.getActiveSheet().getSheetId();
|
|
2106
2101
|
if (!T || !E)
|
|
2107
2102
|
return;
|
|
2108
2103
|
const N = (v = this._renderManagerService.getRenderById(w)) == null ? void 0 : v.with(V);
|
|
2109
2104
|
if (!N)
|
|
2110
2105
|
return;
|
|
2111
|
-
const
|
|
2112
|
-
if (!
|
|
2106
|
+
const B = N.getWorksheetSkeleton(y);
|
|
2107
|
+
if (!B)
|
|
2113
2108
|
return;
|
|
2114
2109
|
const { transform: Q, data: H } = T, X = this._getSceneAndTransformerByDrawingSearch(w);
|
|
2115
2110
|
if (X == null)
|
|
2116
2111
|
return;
|
|
2117
|
-
const { scene: Y, canvas:
|
|
2118
|
-
if (Q == null || R !==
|
|
2112
|
+
const { scene: Y, canvas: K } = X;
|
|
2113
|
+
if (Q == null || R !== y)
|
|
2119
2114
|
return;
|
|
2120
|
-
const { left: k, top: ce, width:
|
|
2121
|
-
if (
|
|
2122
|
-
|
|
2115
|
+
const { left: k, top: ce, width: ye, height: ot, angle: at, flipX: ct, flipY: dt, skewX: $t, skewY: xt } = Q, lt = Ie({ unitId: w, subUnitId: y, drawingId: I }), ut = Y.getObject(lt);
|
|
2116
|
+
if (ut != null) {
|
|
2117
|
+
ut.transformByState({ left: k, top: ce, width: ye, height: ot, angle: at, flipX: ct, flipY: dt, skewX: $t, skewY: xt });
|
|
2123
2118
|
return;
|
|
2124
2119
|
}
|
|
2125
|
-
const
|
|
2120
|
+
const Ee = Ct({
|
|
2126
2121
|
startX: _.startX,
|
|
2127
2122
|
startY: 0,
|
|
2128
2123
|
endX: p.endX,
|
|
@@ -2133,34 +2128,34 @@ let nt = class extends ie {
|
|
|
2133
2128
|
left: p.absolute.left,
|
|
2134
2129
|
top: p.absolute.top
|
|
2135
2130
|
}
|
|
2136
|
-
}, n),
|
|
2137
|
-
left:
|
|
2138
|
-
top:
|
|
2139
|
-
width:
|
|
2140
|
-
height:
|
|
2141
|
-
zIndex: this._drawingManagerService.getDrawingOrder(w,
|
|
2142
|
-
},
|
|
2143
|
-
Y.addObject(
|
|
2144
|
-
const ee = new
|
|
2131
|
+
}, n), ht = {
|
|
2132
|
+
left: Ee.startX,
|
|
2133
|
+
top: Ee.startY,
|
|
2134
|
+
width: Ee.width,
|
|
2135
|
+
height: Ee.height,
|
|
2136
|
+
zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
|
|
2137
|
+
}, le = new Ne(lt, ht);
|
|
2138
|
+
Y.addObject(le, Yt), T.allowTransform !== !1 && Y.attachTransformerTo(le);
|
|
2139
|
+
const ee = new wt(), Te = Y.getMainViewport(), ue = {
|
|
2145
2140
|
top: 0,
|
|
2146
2141
|
//viewMain.top,
|
|
2147
|
-
left:
|
|
2148
|
-
bottom:
|
|
2149
|
-
right:
|
|
2150
|
-
},
|
|
2142
|
+
left: Te.left,
|
|
2143
|
+
bottom: Te.bottom,
|
|
2144
|
+
right: Te.right
|
|
2145
|
+
}, he = {
|
|
2151
2146
|
dispose: ee,
|
|
2152
|
-
rect:
|
|
2147
|
+
rect: le,
|
|
2153
2148
|
// position$,
|
|
2154
2149
|
unitId: w,
|
|
2155
|
-
subUnitId:
|
|
2156
|
-
boundsOfViewArea:
|
|
2150
|
+
subUnitId: y,
|
|
2151
|
+
boundsOfViewArea: ue,
|
|
2157
2152
|
domAnchor: n,
|
|
2158
2153
|
scrollDirectionResponse: "HORIZONTAL"
|
|
2159
2154
|
/* HORIZONTAL */
|
|
2160
|
-
},
|
|
2161
|
-
|
|
2162
|
-
let
|
|
2163
|
-
position$:
|
|
2155
|
+
}, gt = fe(le, X.renderUnit.scene, B.skeleton, E.worksheet, he), Oe = new je(gt);
|
|
2156
|
+
he.position$ = Oe;
|
|
2157
|
+
let Xe = {
|
|
2158
|
+
position$: Oe,
|
|
2164
2159
|
id: I,
|
|
2165
2160
|
componentKey: T.componentKey,
|
|
2166
2161
|
onPointerDown: () => {
|
|
@@ -2170,31 +2165,31 @@ let nt = class extends ie {
|
|
|
2170
2165
|
onPointerUp: () => {
|
|
2171
2166
|
},
|
|
2172
2167
|
onWheel: ($) => {
|
|
2173
|
-
|
|
2168
|
+
K.dispatchEvent(new WheelEvent($.type, $));
|
|
2174
2169
|
},
|
|
2175
2170
|
data: H,
|
|
2176
2171
|
unitId: w
|
|
2177
2172
|
};
|
|
2178
|
-
e.eventPassThrough && (
|
|
2179
|
-
...
|
|
2173
|
+
e.eventPassThrough && (Xe = {
|
|
2174
|
+
...Xe,
|
|
2180
2175
|
onPointerDown: ($) => {
|
|
2181
|
-
|
|
2176
|
+
K.dispatchEvent(new PointerEvent($.type, $));
|
|
2182
2177
|
},
|
|
2183
2178
|
onPointerMove: ($) => {
|
|
2184
|
-
|
|
2179
|
+
K.dispatchEvent(new PointerEvent($.type, $));
|
|
2185
2180
|
},
|
|
2186
2181
|
onPointerUp: ($) => {
|
|
2187
|
-
|
|
2182
|
+
K.dispatchEvent(new PointerEvent($.type, $));
|
|
2188
2183
|
}
|
|
2189
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2190
|
-
const ft =
|
|
2191
|
-
const $ =
|
|
2192
|
-
|
|
2184
|
+
}), this._canvasFloatDomService.addFloatDom(Xe);
|
|
2185
|
+
const ft = le.onTransformChange$.subscribeEvent(() => {
|
|
2186
|
+
const $ = fe(le, X.renderUnit.scene, B.skeleton, E.worksheet, he);
|
|
2187
|
+
Oe.next(
|
|
2193
2188
|
$
|
|
2194
2189
|
);
|
|
2195
2190
|
});
|
|
2196
|
-
this.disposeWithMe(
|
|
2197
|
-
const
|
|
2191
|
+
this.disposeWithMe(f.subscribe(($) => {
|
|
2192
|
+
const Ue = Ct({
|
|
2198
2193
|
startX: $.startX,
|
|
2199
2194
|
startY: 0,
|
|
2200
2195
|
endX: $.endX,
|
|
@@ -2205,26 +2200,26 @@ let nt = class extends ie {
|
|
|
2205
2200
|
left: p.absolute.left,
|
|
2206
2201
|
top: p.absolute.top
|
|
2207
2202
|
}
|
|
2208
|
-
}, n),
|
|
2209
|
-
left:
|
|
2203
|
+
}, n), Ve = Ie({ unitId: w, subUnitId: y, drawingId: I }), He = new Ne(Ve, {
|
|
2204
|
+
left: Ue.startX,
|
|
2210
2205
|
top: 0,
|
|
2211
2206
|
width: n.width,
|
|
2212
2207
|
height: n.height,
|
|
2213
|
-
zIndex: this._drawingManagerService.getDrawingOrder(w,
|
|
2214
|
-
}),
|
|
2215
|
-
|
|
2208
|
+
zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
|
|
2209
|
+
}), mt = fe(He, X.renderUnit.scene, B.skeleton, E.worksheet, he);
|
|
2210
|
+
Oe.next(mt);
|
|
2216
2211
|
}));
|
|
2217
|
-
const
|
|
2218
|
-
|
|
2219
|
-
$ &&
|
|
2212
|
+
const ge = (D = this._renderManagerService.getRenderById(w)) == null ? void 0 : D.with(V);
|
|
2213
|
+
ge == null || ge.currentSkeleton$.subscribe(($) => {
|
|
2214
|
+
$ && c.sheetId !== $.sheetId && this._removeDom(m, !0);
|
|
2220
2215
|
}), ee.add(() => {
|
|
2221
2216
|
this._canvasFloatDomService.removeFloatDom(I);
|
|
2222
|
-
}), ft && ee.add(ft), this._domLayerInfoMap.set(I,
|
|
2217
|
+
}), ft && ee.add(ft), this._domLayerInfoMap.set(I, he);
|
|
2223
2218
|
}
|
|
2224
2219
|
return {
|
|
2225
|
-
id:
|
|
2220
|
+
id: m,
|
|
2226
2221
|
dispose: () => {
|
|
2227
|
-
this._removeDom(
|
|
2222
|
+
this._removeDom(m, !0);
|
|
2228
2223
|
}
|
|
2229
2224
|
};
|
|
2230
2225
|
}
|
|
@@ -2241,51 +2236,51 @@ let nt = class extends ie {
|
|
|
2241
2236
|
// eslint-disable-next-line max-lines-per-function
|
|
2242
2237
|
_createRangePositionObserver(t, e, n) {
|
|
2243
2238
|
let { startRow: r, startColumn: s } = t;
|
|
2244
|
-
const o =
|
|
2245
|
-
const
|
|
2246
|
-
a.next(
|
|
2247
|
-
}, l = new
|
|
2248
|
-
l.add(e.engine.clientRect$.subscribe(() =>
|
|
2249
|
-
if (
|
|
2250
|
-
|
|
2239
|
+
const o = Je(r, s, n), a = new je(o), d = Je(t.endRow, t.endColumn, n), u = new je(d), c = () => {
|
|
2240
|
+
const f = Je(r, s, n), _ = Je(t.endRow, t.endColumn, n);
|
|
2241
|
+
a.next(f), u.next(_);
|
|
2242
|
+
}, l = new wt();
|
|
2243
|
+
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((f) => {
|
|
2244
|
+
if (f.id === Hi.id && f.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
|
|
2245
|
+
c();
|
|
2251
2246
|
return;
|
|
2252
2247
|
}
|
|
2253
|
-
(
|
|
2248
|
+
(zi.indexOf(f.id) > -1 || f.id === Ei.id || f.id === On.id) && c();
|
|
2254
2249
|
}));
|
|
2255
|
-
const g = (
|
|
2256
|
-
r =
|
|
2250
|
+
const g = (f, _) => {
|
|
2251
|
+
r = f, s = _, c();
|
|
2257
2252
|
}, h = () => ({
|
|
2258
2253
|
rotate: 0,
|
|
2259
|
-
width:
|
|
2260
|
-
height:
|
|
2254
|
+
width: d.right - o.left,
|
|
2255
|
+
height: d.bottom - o.top,
|
|
2261
2256
|
absolute: {
|
|
2262
2257
|
left: !0,
|
|
2263
2258
|
top: !0
|
|
2264
2259
|
},
|
|
2265
2260
|
startX: o.left,
|
|
2266
2261
|
startY: o.top,
|
|
2267
|
-
endX:
|
|
2268
|
-
endY:
|
|
2269
|
-
}),
|
|
2270
|
-
|
|
2271
|
-
const _ =
|
|
2262
|
+
endX: d.right,
|
|
2263
|
+
endY: d.bottom
|
|
2264
|
+
}), m = a.pipe(
|
|
2265
|
+
Me((f) => {
|
|
2266
|
+
const _ = Je(t.endRow, t.endColumn, n);
|
|
2272
2267
|
return {
|
|
2273
2268
|
rotate: 0,
|
|
2274
|
-
width: _.right -
|
|
2275
|
-
height: _.bottom -
|
|
2269
|
+
width: _.right - f.left,
|
|
2270
|
+
height: _.bottom - f.top,
|
|
2276
2271
|
absolute: {
|
|
2277
2272
|
left: !0,
|
|
2278
2273
|
top: !0
|
|
2279
2274
|
},
|
|
2280
|
-
startX:
|
|
2281
|
-
startY:
|
|
2275
|
+
startX: f.left,
|
|
2276
|
+
startY: f.top,
|
|
2282
2277
|
endX: _.right,
|
|
2283
2278
|
endY: _.bottom
|
|
2284
2279
|
};
|
|
2285
2280
|
})
|
|
2286
2281
|
), p = h();
|
|
2287
2282
|
return {
|
|
2288
|
-
position$:
|
|
2283
|
+
position$: m,
|
|
2289
2284
|
position: p,
|
|
2290
2285
|
updateRowCol: g,
|
|
2291
2286
|
topLeftPos$: a,
|
|
@@ -2294,16 +2289,16 @@ let nt = class extends ie {
|
|
|
2294
2289
|
};
|
|
2295
2290
|
}
|
|
2296
2291
|
};
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
],
|
|
2306
|
-
function
|
|
2292
|
+
tt = Ns([
|
|
2293
|
+
De(0, A(q)),
|
|
2294
|
+
De(1, Se),
|
|
2295
|
+
De(2, A(G)),
|
|
2296
|
+
De(3, se),
|
|
2297
|
+
De(4, A(ki)),
|
|
2298
|
+
De(5, oe),
|
|
2299
|
+
De(6, A(Yr))
|
|
2300
|
+
], tt);
|
|
2301
|
+
function Je(i, t, e) {
|
|
2307
2302
|
const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
|
|
2308
2303
|
return {
|
|
2309
2304
|
left: r.startX,
|
|
@@ -2312,27 +2307,27 @@ function Qe(i, t, e) {
|
|
|
2312
2307
|
bottom: r.endY
|
|
2313
2308
|
};
|
|
2314
2309
|
}
|
|
2315
|
-
function
|
|
2316
|
-
var u,
|
|
2310
|
+
function Ct(i, t, e) {
|
|
2311
|
+
var u, c;
|
|
2317
2312
|
e = e != null ? e : 1;
|
|
2318
|
-
const n = i.endX - i.startX, r = i.endY - i.startY, s = (u = t == null ? void 0 : t.width) != null ? u : n, o = (
|
|
2319
|
-
let a = 0,
|
|
2313
|
+
const n = i.endX - i.startX, r = i.endY - i.startY, s = (u = t == null ? void 0 : t.width) != null ? u : n, o = (c = t == null ? void 0 : t.height) != null ? c : r;
|
|
2314
|
+
let a = 0, d = 0;
|
|
2320
2315
|
if (t) {
|
|
2321
2316
|
if (t.horizonOffsetAlign === "right") {
|
|
2322
|
-
const l =
|
|
2317
|
+
const l = Dt(t.marginX, n * e);
|
|
2323
2318
|
a = i.endX - l - s;
|
|
2324
2319
|
} else
|
|
2325
|
-
a = i.startX +
|
|
2320
|
+
a = i.startX + Dt(t.marginX, n);
|
|
2326
2321
|
if (t.verticalOffsetAlign === "bottom") {
|
|
2327
|
-
const l =
|
|
2328
|
-
|
|
2322
|
+
const l = Dt(t.marginY, r * e);
|
|
2323
|
+
d = i.endY - l - o;
|
|
2329
2324
|
} else
|
|
2330
|
-
|
|
2325
|
+
d = i.startY + Dt(t.marginY, r);
|
|
2331
2326
|
}
|
|
2332
2327
|
return {
|
|
2333
2328
|
rotate: 0,
|
|
2334
2329
|
startX: a,
|
|
2335
|
-
startY:
|
|
2330
|
+
startY: d,
|
|
2336
2331
|
endX: i.endX,
|
|
2337
2332
|
endY: i.endY,
|
|
2338
2333
|
width: s,
|
|
@@ -2343,37 +2338,37 @@ function Rt(i, t, e) {
|
|
|
2343
2338
|
}
|
|
2344
2339
|
};
|
|
2345
2340
|
}
|
|
2346
|
-
function
|
|
2341
|
+
function Dt(i, t) {
|
|
2347
2342
|
if (i === void 0) return 0;
|
|
2348
2343
|
if (typeof i == "number") return i;
|
|
2349
2344
|
const e = Number.parseFloat(i);
|
|
2350
2345
|
return t * e / 100;
|
|
2351
2346
|
}
|
|
2352
|
-
const
|
|
2353
|
-
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s =
|
|
2354
|
-
const { width: a, height:
|
|
2347
|
+
const ks = (i) => {
|
|
2348
|
+
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = ss(() => t.map((o) => {
|
|
2349
|
+
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Dr(
|
|
2355
2350
|
{
|
|
2356
|
-
left:
|
|
2357
|
-
right: (
|
|
2351
|
+
left: c != null ? c : 0,
|
|
2352
|
+
right: (c != null ? c : 0) + (a != null ? a : 0),
|
|
2358
2353
|
top: l != null ? l : 0,
|
|
2359
|
-
bottom: (l != null ? l : 0) + (
|
|
2354
|
+
bottom: (l != null ? l : 0) + (d != null ? d : 0)
|
|
2360
2355
|
},
|
|
2361
2356
|
e,
|
|
2362
2357
|
n,
|
|
2363
2358
|
r,
|
|
2364
2359
|
void 0,
|
|
2365
2360
|
!0
|
|
2366
|
-
), { scaleX: h, scaleY:
|
|
2361
|
+
), { scaleX: h, scaleY: m } = e.getAncestorScale(), p = {
|
|
2367
2362
|
startX: g.left,
|
|
2368
2363
|
endX: g.right,
|
|
2369
2364
|
startY: g.top,
|
|
2370
2365
|
endY: g.bottom,
|
|
2371
2366
|
rotate: u,
|
|
2372
2367
|
width: a * h,
|
|
2373
|
-
height:
|
|
2368
|
+
height: d * m,
|
|
2374
2369
|
absolute: g.absolute
|
|
2375
|
-
},
|
|
2376
|
-
position$: new
|
|
2370
|
+
}, f = {
|
|
2371
|
+
position$: new je(p),
|
|
2377
2372
|
position: p,
|
|
2378
2373
|
id: o.drawingId,
|
|
2379
2374
|
componentKey: o.componentKey,
|
|
@@ -2388,16 +2383,16 @@ const Vs = (i) => {
|
|
|
2388
2383
|
unitId: o.unitId,
|
|
2389
2384
|
data: o.data
|
|
2390
2385
|
};
|
|
2391
|
-
return [o.drawingId,
|
|
2386
|
+
return [o.drawingId, f];
|
|
2392
2387
|
}), [t, e, n, r]);
|
|
2393
|
-
return /* @__PURE__ */
|
|
2388
|
+
return /* @__PURE__ */ Z("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ Z(Wi, { layer: a, id: o, position: a.position }, o)) });
|
|
2394
2389
|
};
|
|
2395
|
-
var
|
|
2396
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2390
|
+
var Ws = Object.getOwnPropertyDescriptor, js = (i, t, e, n) => {
|
|
2391
|
+
for (var r = n > 1 ? void 0 : n ? Ws(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2397
2392
|
(o = i[s]) && (r = o(r) || r);
|
|
2398
2393
|
return r;
|
|
2399
|
-
},
|
|
2400
|
-
let
|
|
2394
|
+
}, be = (i, t) => (e, n) => t(e, n, i);
|
|
2395
|
+
let Ut = class extends ie {
|
|
2401
2396
|
constructor(i, t, e, n, r, s, o) {
|
|
2402
2397
|
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = t, this._drawingManagerService = e, this._renderManagerService = n, this._canvasFloatDomManagerService = r, this._componetManager = s, this._injector = o, this._initPrinting(), this._initPrintingDom();
|
|
2403
2398
|
}
|
|
@@ -2408,9 +2403,9 @@ let kt = class extends ie {
|
|
|
2408
2403
|
{
|
|
2409
2404
|
handler: (i, t, e) => {
|
|
2410
2405
|
const { unitId: n, scene: r, subUnitId: s } = t, o = this._drawingManagerService.getDrawingDataForUnit(n), a = o == null ? void 0 : o[s];
|
|
2411
|
-
return a && a.order.forEach((
|
|
2412
|
-
const u = a.data[
|
|
2413
|
-
u.drawingType !==
|
|
2406
|
+
return a && a.order.forEach((d) => {
|
|
2407
|
+
const u = a.data[d];
|
|
2408
|
+
u.drawingType !== j.DRAWING_CHART && u.drawingType !== j.DRAWING_DOM && this._drawingRenderService.renderDrawing(u, r);
|
|
2414
2409
|
}), e();
|
|
2415
2410
|
}
|
|
2416
2411
|
}
|
|
@@ -2426,14 +2421,14 @@ let kt = class extends ie {
|
|
|
2426
2421
|
const o = s.with(V).getSkeletonParam(r);
|
|
2427
2422
|
if (!o)
|
|
2428
2423
|
return e(i);
|
|
2429
|
-
const a = this._drawingManagerService.getDrawingDataForUnit(n),
|
|
2430
|
-
if (!
|
|
2424
|
+
const a = this._drawingManagerService.getDrawingDataForUnit(n), d = a == null ? void 0 : a[t.subUnitId];
|
|
2425
|
+
if (!d)
|
|
2431
2426
|
return e(i);
|
|
2432
|
-
const { scaleX: u, scaleY:
|
|
2427
|
+
const { scaleX: u, scaleY: c } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = d.order.map((h) => d.data[h]);
|
|
2433
2428
|
return g.length ? (g.forEach((h) => {
|
|
2434
|
-
if (!h.groupId && h.transform &&
|
|
2435
|
-
const
|
|
2436
|
-
|
|
2429
|
+
if (!h.groupId && h.transform && Re.isDefine(h.transform.left) && Re.isDefine(h.transform.top) && Re.isDefine(h.transform.width) && Re.isDefine(h.transform.height)) {
|
|
2430
|
+
const m = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
|
|
2431
|
+
m.column < l.startColumn && (l.startColumn = m.column), m.row < l.startRow && (l.startRow = m.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
|
|
2437
2432
|
}
|
|
2438
2433
|
}), e(l)) : e(i);
|
|
2439
2434
|
}
|
|
@@ -2450,26 +2445,26 @@ let kt = class extends ie {
|
|
|
2450
2445
|
const { unitId: n, subUnitId: r } = t, s = this._drawingManagerService.getDrawingDataForUnit(n), o = s == null ? void 0 : s[r];
|
|
2451
2446
|
if (o) {
|
|
2452
2447
|
const a = o.order.map((u) => {
|
|
2453
|
-
const
|
|
2454
|
-
if (
|
|
2448
|
+
const c = o.data[u];
|
|
2449
|
+
if (c.drawingType === j.DRAWING_CHART)
|
|
2455
2450
|
return {
|
|
2456
|
-
...
|
|
2457
|
-
componentKey: this._componetManager.get(
|
|
2451
|
+
...c,
|
|
2452
|
+
componentKey: this._componetManager.get(Vr)
|
|
2458
2453
|
};
|
|
2459
|
-
if (
|
|
2460
|
-
const l = this._sheetPrintInterceptorService.getPrintComponent(
|
|
2454
|
+
if (c.drawingType === j.DRAWING_DOM) {
|
|
2455
|
+
const l = this._sheetPrintInterceptorService.getPrintComponent(c.componentKey);
|
|
2461
2456
|
return {
|
|
2462
|
-
...
|
|
2463
|
-
componentKey: this._componetManager.get(l ||
|
|
2457
|
+
...c,
|
|
2458
|
+
componentKey: this._componetManager.get(l || c.componentKey)
|
|
2464
2459
|
};
|
|
2465
2460
|
}
|
|
2466
2461
|
return null;
|
|
2467
|
-
}).filter(Boolean),
|
|
2468
|
-
return
|
|
2469
|
-
/* @__PURE__ */
|
|
2462
|
+
}).filter(Boolean), d = ji(ks, this._injector);
|
|
2463
|
+
return wi(
|
|
2464
|
+
/* @__PURE__ */ Z(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
|
|
2470
2465
|
t.root
|
|
2471
2466
|
), i == null || i.add(() => {
|
|
2472
|
-
|
|
2467
|
+
_i(t.root);
|
|
2473
2468
|
}), e(i);
|
|
2474
2469
|
}
|
|
2475
2470
|
}
|
|
@@ -2478,107 +2473,107 @@ let kt = class extends ie {
|
|
|
2478
2473
|
);
|
|
2479
2474
|
}
|
|
2480
2475
|
};
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
],
|
|
2490
|
-
var
|
|
2491
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2476
|
+
Ut = js([
|
|
2477
|
+
be(0, A(Ti)),
|
|
2478
|
+
be(1, A(Gn)),
|
|
2479
|
+
be(2, se),
|
|
2480
|
+
be(3, q),
|
|
2481
|
+
be(4, A(tt)),
|
|
2482
|
+
be(5, A(zn)),
|
|
2483
|
+
be(6, A(Ye))
|
|
2484
|
+
], Ut);
|
|
2485
|
+
var Bs = Object.getOwnPropertyDescriptor, $s = (i, t, e, n) => {
|
|
2486
|
+
for (var r = n > 1 ? void 0 : n ? Bs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2492
2487
|
(o = i[s]) && (r = o(r) || r);
|
|
2493
2488
|
return r;
|
|
2494
2489
|
}, pe = (i, t) => (e, n) => t(e, n, i);
|
|
2495
|
-
const
|
|
2490
|
+
const xs = [
|
|
2491
|
+
Kn.id,
|
|
2492
|
+
Zn.id,
|
|
2493
|
+
Jn.id,
|
|
2494
|
+
qn.id,
|
|
2495
|
+
Qn.id,
|
|
2496
2496
|
er.id,
|
|
2497
2497
|
tr.id,
|
|
2498
2498
|
nr.id,
|
|
2499
|
+
Jt.id,
|
|
2500
|
+
qt.id,
|
|
2499
2501
|
rr.id,
|
|
2500
2502
|
ir.id,
|
|
2501
2503
|
sr.id,
|
|
2502
2504
|
or.id,
|
|
2503
2505
|
ar.id,
|
|
2504
|
-
tn.id,
|
|
2505
|
-
nn.id,
|
|
2506
2506
|
cr.id,
|
|
2507
2507
|
dr.id,
|
|
2508
2508
|
lr.id,
|
|
2509
|
-
ur.id
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
fr.id,
|
|
2514
|
-
pr.id
|
|
2515
|
-
], qs = [
|
|
2509
|
+
ur.id
|
|
2510
|
+
], Fs = [
|
|
2511
|
+
Ki.id,
|
|
2512
|
+
Zi.id,
|
|
2516
2513
|
Ji.id,
|
|
2517
2514
|
qi.id,
|
|
2518
2515
|
Qi.id,
|
|
2519
|
-
es.id
|
|
2520
|
-
ts.id,
|
|
2521
|
-
ns.id
|
|
2516
|
+
es.id
|
|
2522
2517
|
];
|
|
2523
|
-
let
|
|
2524
|
-
constructor(i, t, e, n, r, s, o, a,
|
|
2525
|
-
super(), this._context = i, this._renderManagerService = t, this._commandService = e, this._selectionRenderService = n, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService =
|
|
2518
|
+
let sn = class extends ie {
|
|
2519
|
+
constructor(i, t, e, n, r, s, o, a, d) {
|
|
2520
|
+
super(), this._context = i, this._renderManagerService = t, this._commandService = e, this._selectionRenderService = n, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService = d, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
|
|
2526
2521
|
}
|
|
2527
2522
|
_sheetInterceptorListener() {
|
|
2528
2523
|
this.disposeWithMe(
|
|
2529
2524
|
this._sheetInterceptorService.interceptCommand({
|
|
2530
2525
|
getMutations: (i) => {
|
|
2531
|
-
if (!
|
|
2526
|
+
if (!xs.includes(i.id))
|
|
2532
2527
|
return { redos: [], undos: [] };
|
|
2533
2528
|
if (i.params == null)
|
|
2534
2529
|
return { redos: [], undos: [] };
|
|
2535
2530
|
const t = i.id;
|
|
2536
|
-
if (t ===
|
|
2531
|
+
if (t === Kn.id)
|
|
2537
2532
|
return this._moveRowInterceptor(i.params, "insert");
|
|
2538
|
-
if ([
|
|
2533
|
+
if ([dr.id, lr.id, ur.id].includes(t))
|
|
2539
2534
|
return this._moveRangeInterceptor(i.params);
|
|
2540
|
-
if (t ===
|
|
2535
|
+
if (t === Zn.id)
|
|
2541
2536
|
return this._moveColInterceptor(i.params, "insert");
|
|
2542
|
-
if (t ===
|
|
2537
|
+
if (t === Jn.id)
|
|
2543
2538
|
return this._moveRowInterceptor(i.params, "remove");
|
|
2544
|
-
if (t ===
|
|
2539
|
+
if (t === qn.id)
|
|
2545
2540
|
return this._moveColInterceptor(i.params, "remove");
|
|
2546
|
-
if (t ===
|
|
2541
|
+
if (t === Qn.id) {
|
|
2547
2542
|
const { range: e } = i.params;
|
|
2548
2543
|
return this._getRangeMoveUndo(
|
|
2549
2544
|
e,
|
|
2550
2545
|
0
|
|
2551
2546
|
/* deleteLeft */
|
|
2552
2547
|
);
|
|
2553
|
-
} else if (t ===
|
|
2548
|
+
} else if (t === er.id) {
|
|
2554
2549
|
const { range: e } = i.params;
|
|
2555
2550
|
return this._getRangeMoveUndo(
|
|
2556
2551
|
e,
|
|
2557
2552
|
1
|
|
2558
2553
|
/* deleteUp */
|
|
2559
2554
|
);
|
|
2560
|
-
} else if (t ===
|
|
2555
|
+
} else if (t === tr.id) {
|
|
2561
2556
|
const { range: e } = i.params;
|
|
2562
2557
|
return this._getRangeMoveUndo(
|
|
2563
2558
|
e,
|
|
2564
2559
|
2
|
|
2565
2560
|
/* insertDown */
|
|
2566
2561
|
);
|
|
2567
|
-
} else if (t ===
|
|
2562
|
+
} else if (t === nr.id) {
|
|
2568
2563
|
const { range: e } = i.params;
|
|
2569
2564
|
return this._getRangeMoveUndo(
|
|
2570
2565
|
e,
|
|
2571
2566
|
3
|
|
2572
2567
|
/* insertRight */
|
|
2573
2568
|
);
|
|
2574
|
-
} else if (t ===
|
|
2569
|
+
} else if (t === sr.id || t === or.id) {
|
|
2575
2570
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2576
2571
|
return this._getDrawingUndoForRowVisible(n, r, s);
|
|
2577
|
-
} else if (t ===
|
|
2572
|
+
} else if (t === ar.id || t === cr.id) {
|
|
2578
2573
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2579
2574
|
return this._getDrawingUndoForColVisible(n, r, s);
|
|
2580
|
-
} else if (t ===
|
|
2581
|
-
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t ===
|
|
2575
|
+
} else if (t === Jt.id || t === qt.id || t === rr.id || t === ir.id) {
|
|
2576
|
+
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === Jt.id || t === qt.id;
|
|
2582
2577
|
return this._getDrawingUndoForRowAndColSize(n, r, s, o);
|
|
2583
2578
|
}
|
|
2584
2579
|
return { redos: [], undos: [] };
|
|
@@ -2590,27 +2585,27 @@ let cn = class extends ie {
|
|
|
2590
2585
|
const e = ae(this._univerInstanceService);
|
|
2591
2586
|
if (e == null)
|
|
2592
2587
|
return { redos: [], undos: [] };
|
|
2593
|
-
const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r),
|
|
2594
|
-
if (Object.keys(a).forEach((
|
|
2595
|
-
const l = a[
|
|
2596
|
-
|
|
2597
|
-
}),
|
|
2588
|
+
const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r), d = [], u = [];
|
|
2589
|
+
if (Object.keys(a).forEach((c) => {
|
|
2590
|
+
const l = a[c], { updateDrawings: g, deleteDrawings: h } = this._getUpdateOrDeleteDrawings(i, t, l);
|
|
2591
|
+
d.push(...g), u.push(...h);
|
|
2592
|
+
}), d.length === 0 && u.length === 0)
|
|
2598
2593
|
return { redos: [], undos: [] };
|
|
2599
|
-
if (
|
|
2600
|
-
const
|
|
2601
|
-
s.push({ id:
|
|
2594
|
+
if (d.length > 0) {
|
|
2595
|
+
const c = this._sheetDrawingService.getBatchUpdateOp(d), { undo: l, redo: g, objects: h } = c;
|
|
2596
|
+
s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.UPDATE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: l, objects: h, type: U.UPDATE } });
|
|
2602
2597
|
}
|
|
2603
2598
|
if (u.length > 0) {
|
|
2604
|
-
const
|
|
2605
|
-
s.push({ id:
|
|
2599
|
+
const c = this._sheetDrawingService.getBatchRemoveOp(u), l = c.undo, g = c.redo, h = c.objects;
|
|
2600
|
+
s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: l, objects: h, type: U.INSERT } });
|
|
2606
2601
|
}
|
|
2607
|
-
return s.push({ id:
|
|
2602
|
+
return s.push({ id: L.id, params: [n] }), o.push({ id: L.id, params: [n] }), {
|
|
2608
2603
|
redos: s,
|
|
2609
2604
|
undos: o
|
|
2610
2605
|
};
|
|
2611
2606
|
}
|
|
2612
2607
|
_getUpdateOrDeleteDrawings(i, t, e) {
|
|
2613
|
-
const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId:
|
|
2608
|
+
const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column: m } = l, { row: p, column: f } = g;
|
|
2614
2609
|
if (s == null || a == null)
|
|
2615
2610
|
return {
|
|
2616
2611
|
updateDrawings: n,
|
|
@@ -2619,15 +2614,15 @@ let cn = class extends ie {
|
|
|
2619
2614
|
const { startRow: _, endRow: S, startColumn: C, endColumn: b } = i;
|
|
2620
2615
|
let v = null, D = null;
|
|
2621
2616
|
if (t === 0 && h >= _ && p <= S)
|
|
2622
|
-
if (
|
|
2623
|
-
r.push({ unitId:
|
|
2617
|
+
if (m >= C && f <= b)
|
|
2618
|
+
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2624
2619
|
else {
|
|
2625
2620
|
const w = this._shrinkCol(s, a, C, b, o);
|
|
2626
2621
|
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
2627
2622
|
}
|
|
2628
|
-
else if (t === 1 &&
|
|
2623
|
+
else if (t === 1 && m >= C && f <= b)
|
|
2629
2624
|
if (h >= _ && p <= S)
|
|
2630
|
-
r.push({ unitId:
|
|
2625
|
+
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2631
2626
|
else {
|
|
2632
2627
|
const w = this._shrinkRow(s, a, _, S, o);
|
|
2633
2628
|
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
@@ -2655,23 +2650,23 @@ let cn = class extends ie {
|
|
|
2655
2650
|
// eslint-disable-next-line max-lines-per-function
|
|
2656
2651
|
_getDrawingUndoForColVisible(i, t, e) {
|
|
2657
2652
|
const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
|
|
2658
|
-
if (Object.keys(n).forEach((
|
|
2659
|
-
const l = n[
|
|
2660
|
-
if (
|
|
2653
|
+
if (Object.keys(n).forEach((c) => {
|
|
2654
|
+
const l = n[c], { sheetTransform: g, transform: h, anchorType: m = O.Position } = l;
|
|
2655
|
+
if (m === O.None)
|
|
2661
2656
|
this._remainDrawingSize(h, r, l);
|
|
2662
2657
|
else {
|
|
2663
|
-
const { from: p, to:
|
|
2658
|
+
const { from: p, to: f } = g, { row: _, column: S } = p, { row: C, column: b } = f;
|
|
2664
2659
|
for (let v = 0; v < e.length; v++) {
|
|
2665
|
-
const D = e[v], { startRow: w, endRow:
|
|
2660
|
+
const D = e[v], { startRow: w, endRow: y, startColumn: I, endColumn: E } = D;
|
|
2666
2661
|
if (b < I)
|
|
2667
2662
|
continue;
|
|
2668
|
-
if (
|
|
2663
|
+
if (m === O.Position) {
|
|
2669
2664
|
let R = null, N = null;
|
|
2670
2665
|
if (S >= I && S <= E) {
|
|
2671
|
-
const
|
|
2672
|
-
if (
|
|
2666
|
+
const B = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow: f.row });
|
|
2667
|
+
if (B == null)
|
|
2673
2668
|
return;
|
|
2674
|
-
N = { ...h, left:
|
|
2669
|
+
N = { ...h, left: B.startX };
|
|
2675
2670
|
}
|
|
2676
2671
|
if (N != null && (R = x(N, this._selectionRenderService), R != null && N != null)) {
|
|
2677
2672
|
r.push({ ...l, sheetTransform: R, transform: N });
|
|
@@ -2682,38 +2677,38 @@ let cn = class extends ie {
|
|
|
2682
2677
|
}
|
|
2683
2678
|
if (S >= I && b <= E)
|
|
2684
2679
|
continue;
|
|
2685
|
-
let T = null,
|
|
2680
|
+
let T = null, M = null;
|
|
2686
2681
|
if (S >= I && S <= E) {
|
|
2687
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow:
|
|
2682
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow: f.row });
|
|
2688
2683
|
if (R == null)
|
|
2689
2684
|
return;
|
|
2690
|
-
|
|
2685
|
+
M = {
|
|
2691
2686
|
...h,
|
|
2692
2687
|
left: (R == null ? void 0 : R.startX) || 0,
|
|
2693
2688
|
width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
|
|
2694
2689
|
};
|
|
2695
2690
|
} else if (b >= I && b <= E) {
|
|
2696
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: I, endColumn: b, startRow: p.row, endRow:
|
|
2691
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: I, endColumn: b, startRow: p.row, endRow: f.row });
|
|
2697
2692
|
if (R == null)
|
|
2698
2693
|
return;
|
|
2699
|
-
|
|
2694
|
+
M = {
|
|
2700
2695
|
...h,
|
|
2701
2696
|
left: R.startX - ((h == null ? void 0 : h.width) || 0)
|
|
2702
2697
|
};
|
|
2703
2698
|
} else {
|
|
2704
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: I, endColumn: E, startRow: p.row, endRow:
|
|
2699
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: I, endColumn: E, startRow: p.row, endRow: f.row });
|
|
2705
2700
|
if (R == null)
|
|
2706
2701
|
return;
|
|
2707
|
-
if (
|
|
2702
|
+
if (M = {
|
|
2708
2703
|
...h,
|
|
2709
2704
|
width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
|
|
2710
|
-
}, T = x(
|
|
2711
|
-
s.push({ ...l, sheetTransform: T, transform:
|
|
2705
|
+
}, T = x(M, this._selectionRenderService), T != null && M != null) {
|
|
2706
|
+
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2712
2707
|
break;
|
|
2713
2708
|
}
|
|
2714
2709
|
}
|
|
2715
|
-
if (
|
|
2716
|
-
r.push({ ...l, sheetTransform: T, transform:
|
|
2710
|
+
if (M != null && (T = x(M, this._selectionRenderService)), M != null && T != null) {
|
|
2711
|
+
r.push({ ...l, sheetTransform: T, transform: M });
|
|
2717
2712
|
break;
|
|
2718
2713
|
} else
|
|
2719
2714
|
this._remainDrawingSize(h, r, l);
|
|
@@ -2721,51 +2716,51 @@ let cn = class extends ie {
|
|
|
2721
2716
|
}
|
|
2722
2717
|
}), r.length === 0 && s.length === 0)
|
|
2723
2718
|
return { redos: [], undos: [] };
|
|
2724
|
-
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r),
|
|
2719
|
+
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r), d = [], u = [];
|
|
2725
2720
|
if (s.length > 0) {
|
|
2726
|
-
const { redos:
|
|
2727
|
-
|
|
2721
|
+
const { redos: c, undos: l } = this._createUndoAndRedoMutation(i, t, s);
|
|
2722
|
+
d.push(...c), u.push(...l);
|
|
2728
2723
|
}
|
|
2729
2724
|
return {
|
|
2730
2725
|
redos: o,
|
|
2731
2726
|
undos: a,
|
|
2732
|
-
preRedos:
|
|
2727
|
+
preRedos: d,
|
|
2733
2728
|
preUndos: u
|
|
2734
2729
|
};
|
|
2735
2730
|
}
|
|
2736
2731
|
_createUndoAndRedoMutation(i, t, e) {
|
|
2737
2732
|
const n = this._sheetDrawingService.getBatchUpdateOp(e), { undo: r, redo: s, objects: o } = n, a = [
|
|
2738
|
-
{ id:
|
|
2739
|
-
{ id:
|
|
2740
|
-
],
|
|
2741
|
-
{ id:
|
|
2742
|
-
{ id:
|
|
2733
|
+
{ id: P.id, params: { unitId: i, subUnitId: t, op: s, objects: o, type: U.UPDATE } },
|
|
2734
|
+
{ id: L.id, params: [i] }
|
|
2735
|
+
], d = [
|
|
2736
|
+
{ id: P.id, params: { unitId: i, subUnitId: t, op: r, objects: o, type: U.UPDATE } },
|
|
2737
|
+
{ id: L.id, params: [i] }
|
|
2743
2738
|
];
|
|
2744
2739
|
return {
|
|
2745
2740
|
redos: a,
|
|
2746
|
-
undos:
|
|
2741
|
+
undos: d
|
|
2747
2742
|
};
|
|
2748
2743
|
}
|
|
2749
2744
|
// eslint-disable-next-line max-lines-per-function
|
|
2750
2745
|
_getDrawingUndoForRowVisible(i, t, e) {
|
|
2751
2746
|
const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
|
|
2752
|
-
if (Object.keys(n).forEach((
|
|
2753
|
-
const l = n[
|
|
2754
|
-
if (
|
|
2747
|
+
if (Object.keys(n).forEach((c) => {
|
|
2748
|
+
const l = n[c], { sheetTransform: g, transform: h, anchorType: m = O.Position } = l;
|
|
2749
|
+
if (m === O.None)
|
|
2755
2750
|
this._remainDrawingSize(h, r, l);
|
|
2756
2751
|
else {
|
|
2757
|
-
const { from: p, to:
|
|
2752
|
+
const { from: p, to: f } = g, { row: _, column: S } = p, { row: C, column: b } = f;
|
|
2758
2753
|
for (let v = 0; v < e.length; v++) {
|
|
2759
|
-
const D = e[v], { startRow: w, endRow:
|
|
2754
|
+
const D = e[v], { startRow: w, endRow: y, startColumn: I, endColumn: E } = D;
|
|
2760
2755
|
if (C < w)
|
|
2761
2756
|
continue;
|
|
2762
|
-
if (
|
|
2757
|
+
if (m === O.Position) {
|
|
2763
2758
|
let R = null, N = null;
|
|
2764
|
-
if (_ >= w && _ <=
|
|
2765
|
-
const
|
|
2766
|
-
if (
|
|
2759
|
+
if (_ >= w && _ <= y) {
|
|
2760
|
+
const B = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: y });
|
|
2761
|
+
if (B == null)
|
|
2767
2762
|
return;
|
|
2768
|
-
N = { ...h, top:
|
|
2763
|
+
N = { ...h, top: B.startY };
|
|
2769
2764
|
}
|
|
2770
2765
|
if (N != null && (R = x(N, this._selectionRenderService), R != null && N != null)) {
|
|
2771
2766
|
r.push({ ...l, sheetTransform: R, transform: N });
|
|
@@ -2774,40 +2769,40 @@ let cn = class extends ie {
|
|
|
2774
2769
|
this._remainDrawingSize(h, r, l);
|
|
2775
2770
|
continue;
|
|
2776
2771
|
}
|
|
2777
|
-
if (_ >= w && C <=
|
|
2772
|
+
if (_ >= w && C <= y)
|
|
2778
2773
|
continue;
|
|
2779
|
-
let T = null,
|
|
2780
|
-
if (_ >= w && _ <=
|
|
2781
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn:
|
|
2774
|
+
let T = null, M = null;
|
|
2775
|
+
if (_ >= w && _ <= y) {
|
|
2776
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: y });
|
|
2782
2777
|
if (R == null)
|
|
2783
2778
|
return;
|
|
2784
|
-
|
|
2779
|
+
M = {
|
|
2785
2780
|
...h,
|
|
2786
2781
|
top: (R == null ? void 0 : R.startY) || 0,
|
|
2787
2782
|
height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
|
|
2788
2783
|
};
|
|
2789
|
-
} else if (C >= w && C <=
|
|
2790
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn:
|
|
2784
|
+
} else if (C >= w && C <= y) {
|
|
2785
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: C });
|
|
2791
2786
|
if (R == null)
|
|
2792
2787
|
return;
|
|
2793
|
-
|
|
2788
|
+
M = {
|
|
2794
2789
|
...h,
|
|
2795
2790
|
top: R.startY - ((h == null ? void 0 : h.height) || 0)
|
|
2796
2791
|
};
|
|
2797
2792
|
} else {
|
|
2798
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn:
|
|
2793
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: y });
|
|
2799
2794
|
if (R == null)
|
|
2800
2795
|
return;
|
|
2801
|
-
if (
|
|
2796
|
+
if (M = {
|
|
2802
2797
|
...h,
|
|
2803
2798
|
height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
|
|
2804
|
-
}, T = x(
|
|
2805
|
-
s.push({ ...l, sheetTransform: T, transform:
|
|
2799
|
+
}, T = x(M, this._selectionRenderService), T != null && M != null) {
|
|
2800
|
+
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2806
2801
|
break;
|
|
2807
2802
|
}
|
|
2808
2803
|
}
|
|
2809
|
-
if (
|
|
2810
|
-
r.push({ ...l, sheetTransform: T, transform:
|
|
2804
|
+
if (M != null && (T = x(M, this._selectionRenderService)), M != null && T != null) {
|
|
2805
|
+
r.push({ ...l, sheetTransform: T, transform: M });
|
|
2811
2806
|
break;
|
|
2812
2807
|
} else
|
|
2813
2808
|
this._remainDrawingSize(h, r, l);
|
|
@@ -2815,35 +2810,35 @@ let cn = class extends ie {
|
|
|
2815
2810
|
}
|
|
2816
2811
|
}), r.length === 0 && s.length === 0)
|
|
2817
2812
|
return { redos: [], undos: [] };
|
|
2818
|
-
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r),
|
|
2813
|
+
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r), d = [], u = [];
|
|
2819
2814
|
if (s.length > 0) {
|
|
2820
|
-
const { redos:
|
|
2821
|
-
|
|
2815
|
+
const { redos: c, undos: l } = this._createUndoAndRedoMutation(i, t, s);
|
|
2816
|
+
d.push(...c), u.push(...l);
|
|
2822
2817
|
}
|
|
2823
2818
|
return {
|
|
2824
2819
|
redos: o,
|
|
2825
2820
|
undos: a,
|
|
2826
|
-
preRedos:
|
|
2821
|
+
preRedos: d,
|
|
2827
2822
|
preUndos: u
|
|
2828
2823
|
};
|
|
2829
2824
|
}
|
|
2830
2825
|
_getDrawingUndoForRowAndColSize(i, t, e, n) {
|
|
2831
2826
|
const r = this._drawingManagerService.getDrawingData(i, t), s = [];
|
|
2832
2827
|
return Object.keys(r).forEach((o) => {
|
|
2833
|
-
const a = r[o], { sheetTransform:
|
|
2834
|
-
if (
|
|
2828
|
+
const a = r[o], { sheetTransform: d, transform: u, anchorType: c = O.Position } = a;
|
|
2829
|
+
if (c === O.None)
|
|
2835
2830
|
this._remainDrawingSize(u, s, a);
|
|
2836
2831
|
else {
|
|
2837
|
-
const { from: l, to: g } =
|
|
2832
|
+
const { from: l, to: g } = d, { row: h, column: m } = l, { row: p, column: f } = g;
|
|
2838
2833
|
for (let _ = 0; _ < e.length; _++) {
|
|
2839
2834
|
const S = e[_], { startRow: C, endRow: b, startColumn: v, endColumn: D } = S;
|
|
2840
|
-
if (p < C ||
|
|
2835
|
+
if (p < C || f < v)
|
|
2841
2836
|
continue;
|
|
2842
|
-
if (
|
|
2837
|
+
if (c === O.Position && (h <= C && p >= b || m <= v && f >= D)) {
|
|
2843
2838
|
this._remainDrawingSize(u, s, a);
|
|
2844
2839
|
continue;
|
|
2845
2840
|
}
|
|
2846
|
-
const w = z({ ...
|
|
2841
|
+
const w = z({ ...d }, this._selectionRenderService, this._skeletonManagerService);
|
|
2847
2842
|
if (w != null) {
|
|
2848
2843
|
s.push({
|
|
2849
2844
|
...a,
|
|
@@ -2875,10 +2870,10 @@ let cn = class extends ie {
|
|
|
2875
2870
|
const { unitId: r, subUnitId: s } = n, o = (b = (C = this._renderManagerService.getRenderById(r)) == null ? void 0 : C.with(V)) == null ? void 0 : b.getCurrentSkeleton();
|
|
2876
2871
|
if (!o)
|
|
2877
2872
|
return { redos: [], undos: [] };
|
|
2878
|
-
const a =
|
|
2873
|
+
const a = Vn(o, e);
|
|
2879
2874
|
if (!a)
|
|
2880
2875
|
return { redos: [], undos: [] };
|
|
2881
|
-
const { startX:
|
|
2876
|
+
const { startX: d, endX: u, startY: c, endY: l } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
|
|
2882
2877
|
Object.keys(g).forEach((v) => {
|
|
2883
2878
|
const D = g[v];
|
|
2884
2879
|
if (D.anchorType !== O.Both)
|
|
@@ -2886,52 +2881,52 @@ let cn = class extends ie {
|
|
|
2886
2881
|
const { transform: w } = D;
|
|
2887
2882
|
if (!w)
|
|
2888
2883
|
return;
|
|
2889
|
-
const { left:
|
|
2890
|
-
drawingStartX:
|
|
2891
|
-
drawingEndX:
|
|
2884
|
+
const { left: y = 0, top: I = 0, width: E = 0, height: T = 0 } = w, { drawingStartX: M, drawingEndX: R, drawingStartY: N, drawingEndY: B } = {
|
|
2885
|
+
drawingStartX: y,
|
|
2886
|
+
drawingEndX: y + E,
|
|
2892
2887
|
drawingStartY: I,
|
|
2893
2888
|
drawingEndY: I + T
|
|
2894
2889
|
};
|
|
2895
|
-
|
|
2890
|
+
d <= M && R <= u && c <= N && B <= l && h.push(D);
|
|
2896
2891
|
});
|
|
2897
|
-
const
|
|
2892
|
+
const m = [], p = [], f = t.startRow - e.startRow, _ = t.startColumn - e.startColumn, S = h.map((v) => {
|
|
2898
2893
|
const D = v.sheetTransform, w = {
|
|
2899
|
-
to: { ...D.to, row: D.to.row +
|
|
2900
|
-
from: { ...D.from, row: D.from.row +
|
|
2901
|
-
},
|
|
2894
|
+
to: { ...D.to, row: D.to.row + f, column: D.to.column + _ },
|
|
2895
|
+
from: { ...D.from, row: D.from.row + f, column: D.from.column + _ }
|
|
2896
|
+
}, y = z(w, this._selectionRenderService, this._skeletonManagerService);
|
|
2902
2897
|
return {
|
|
2903
2898
|
unitId: r,
|
|
2904
2899
|
subUnitId: s,
|
|
2905
2900
|
drawingId: v.drawingId,
|
|
2906
|
-
transform:
|
|
2901
|
+
transform: y,
|
|
2907
2902
|
sheetTransform: w
|
|
2908
2903
|
};
|
|
2909
2904
|
});
|
|
2910
2905
|
if (S.length) {
|
|
2911
|
-
const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: D, redo: w, objects:
|
|
2912
|
-
|
|
2906
|
+
const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: D, redo: w, objects: y } = v;
|
|
2907
|
+
m.push({ id: P.id, params: { unitId: r, subUnitId: s, op: w, objects: y, type: U.UPDATE } }), p.push({ id: P.id, params: { unitId: r, subUnitId: s, op: D, objects: y, type: U.UPDATE } });
|
|
2913
2908
|
}
|
|
2914
|
-
return { redos:
|
|
2909
|
+
return { redos: m, undos: p };
|
|
2915
2910
|
}
|
|
2916
2911
|
_moveRowInterceptor(i, t) {
|
|
2917
2912
|
const e = this._getUnitIdAndSubUnitId(i, t);
|
|
2918
2913
|
if (e == null)
|
|
2919
2914
|
return { redos: [], undos: [] };
|
|
2920
|
-
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow,
|
|
2921
|
-
if (Object.keys(
|
|
2922
|
-
const
|
|
2923
|
-
if (p == null ||
|
|
2915
|
+
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
|
|
2916
|
+
if (Object.keys(c).forEach((h) => {
|
|
2917
|
+
const m = c[h], { sheetTransform: p, transform: f, anchorType: _ = O.Position } = m;
|
|
2918
|
+
if (p == null || f == null)
|
|
2924
2919
|
return;
|
|
2925
2920
|
let S, C;
|
|
2926
2921
|
if (t === "insert") {
|
|
2927
|
-
const v = this._expandRow(p,
|
|
2922
|
+
const v = this._expandRow(p, f, o, a, _);
|
|
2928
2923
|
S = v == null ? void 0 : v.newSheetTransform, C = v == null ? void 0 : v.newTransform;
|
|
2929
2924
|
} else {
|
|
2930
|
-
const { from: v, to: D } = p, { row: w } = v, { row:
|
|
2931
|
-
if (_ === O.Both && w >= o &&
|
|
2925
|
+
const { from: v, to: D } = p, { row: w } = v, { row: y } = D;
|
|
2926
|
+
if (_ === O.Both && w >= o && y <= a)
|
|
2932
2927
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2933
2928
|
else {
|
|
2934
|
-
const I = this._shrinkRow(p,
|
|
2929
|
+
const I = this._shrinkRow(p, f, o, a, _);
|
|
2935
2930
|
S = I == null ? void 0 : I.newSheetTransform, C = I == null ? void 0 : I.newTransform;
|
|
2936
2931
|
}
|
|
2937
2932
|
}
|
|
@@ -2942,15 +2937,15 @@ let cn = class extends ie {
|
|
|
2942
2937
|
}), l.length === 0 && g.length === 0)
|
|
2943
2938
|
return { redos: [], undos: [] };
|
|
2944
2939
|
if (l.length > 0) {
|
|
2945
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo:
|
|
2946
|
-
|
|
2940
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = h;
|
|
2941
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.UPDATE } });
|
|
2947
2942
|
}
|
|
2948
2943
|
if (g.length > 0) {
|
|
2949
|
-
const h = this._sheetDrawingService.getBatchRemoveOp(g),
|
|
2950
|
-
|
|
2944
|
+
const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, p = h.redo, f = h.objects;
|
|
2945
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.INSERT } });
|
|
2951
2946
|
}
|
|
2952
|
-
return
|
|
2953
|
-
redos:
|
|
2947
|
+
return d.push({ id: L.id, params: [n] }), u.push({ id: L.id, params: [n] }), {
|
|
2948
|
+
redos: d,
|
|
2954
2949
|
undos: u
|
|
2955
2950
|
};
|
|
2956
2951
|
}
|
|
@@ -2958,21 +2953,21 @@ let cn = class extends ie {
|
|
|
2958
2953
|
const e = this._getUnitIdAndSubUnitId(i, t);
|
|
2959
2954
|
if (e == null)
|
|
2960
2955
|
return { redos: [], undos: [] };
|
|
2961
|
-
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn,
|
|
2962
|
-
if (Object.keys(
|
|
2963
|
-
const
|
|
2964
|
-
if (p == null ||
|
|
2956
|
+
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
|
|
2957
|
+
if (Object.keys(c).forEach((h) => {
|
|
2958
|
+
const m = c[h], { sheetTransform: p, transform: f, anchorType: _ = O.Position } = m;
|
|
2959
|
+
if (p == null || f == null)
|
|
2965
2960
|
return;
|
|
2966
2961
|
let S, C;
|
|
2967
2962
|
if (t === "insert") {
|
|
2968
|
-
const v = this._expandCol(p,
|
|
2963
|
+
const v = this._expandCol(p, f, o, a, _);
|
|
2969
2964
|
S = v == null ? void 0 : v.newSheetTransform, C = v == null ? void 0 : v.newTransform;
|
|
2970
2965
|
} else {
|
|
2971
|
-
const { from: v, to: D } = p, { column: w } = v, { column:
|
|
2972
|
-
if (_ === O.Both && w >= o &&
|
|
2966
|
+
const { from: v, to: D } = p, { column: w } = v, { column: y } = D;
|
|
2967
|
+
if (_ === O.Both && w >= o && y <= a)
|
|
2973
2968
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2974
2969
|
else {
|
|
2975
|
-
const I = this._shrinkCol(p,
|
|
2970
|
+
const I = this._shrinkCol(p, f, o, a, _);
|
|
2976
2971
|
S = I == null ? void 0 : I.newSheetTransform, C = I == null ? void 0 : I.newTransform;
|
|
2977
2972
|
}
|
|
2978
2973
|
}
|
|
@@ -2983,81 +2978,81 @@ let cn = class extends ie {
|
|
|
2983
2978
|
}), l.length === 0 && g.length === 0)
|
|
2984
2979
|
return { redos: [], undos: [] };
|
|
2985
2980
|
if (l.length > 0) {
|
|
2986
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo:
|
|
2987
|
-
|
|
2981
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = h;
|
|
2982
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.UPDATE } });
|
|
2988
2983
|
}
|
|
2989
2984
|
if (g.length > 0) {
|
|
2990
|
-
const h = this._sheetDrawingService.getBatchRemoveOp(g),
|
|
2991
|
-
|
|
2985
|
+
const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, p = h.redo, f = h.objects;
|
|
2986
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.INSERT } });
|
|
2992
2987
|
}
|
|
2993
|
-
return
|
|
2988
|
+
return d.push({ id: L.id, params: [n] }), u.push({ id: L.id, params: [n] }), { redos: d, undos: u };
|
|
2994
2989
|
}
|
|
2995
2990
|
_expandCol(i, t, e, n, r = O.Position) {
|
|
2996
|
-
const s = n - e + 1, { from: o, to: a } = i, { column:
|
|
2991
|
+
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
2997
2992
|
if (r === O.None)
|
|
2998
2993
|
return {
|
|
2999
2994
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
3000
2995
|
newTransform: t
|
|
3001
2996
|
};
|
|
3002
|
-
let
|
|
3003
|
-
if (
|
|
2997
|
+
let c = null, l = null;
|
|
2998
|
+
if (d >= e) {
|
|
3004
2999
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: n, startRow: o.row, endRow: a.row });
|
|
3005
3000
|
if (g == null)
|
|
3006
3001
|
return;
|
|
3007
|
-
l = { ...t, left: (t.left || 0) + g.endX - g.startX },
|
|
3002
|
+
l = { ...t, left: (t.left || 0) + g.endX - g.startX }, c = x(l, this._selectionRenderService);
|
|
3008
3003
|
} else if (u >= n)
|
|
3009
3004
|
if (r === O.Both)
|
|
3010
|
-
|
|
3005
|
+
c = {
|
|
3011
3006
|
from: { ...o },
|
|
3012
3007
|
to: { ...a, column: u + s }
|
|
3013
|
-
}, l = z(
|
|
3008
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3014
3009
|
else
|
|
3015
3010
|
return {
|
|
3016
3011
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
3017
3012
|
newTransform: t
|
|
3018
3013
|
};
|
|
3019
|
-
return
|
|
3020
|
-
newSheetTransform:
|
|
3014
|
+
return c != null && l != null ? {
|
|
3015
|
+
newSheetTransform: c,
|
|
3021
3016
|
newTransform: l
|
|
3022
3017
|
} : null;
|
|
3023
3018
|
}
|
|
3024
3019
|
_shrinkCol(i, t, e, n, r = O.Position) {
|
|
3025
|
-
const s = n - e + 1, { from: o, to: a } = i, { column:
|
|
3020
|
+
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
3026
3021
|
if (r === O.None)
|
|
3027
3022
|
return {
|
|
3028
3023
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
3029
3024
|
newTransform: t
|
|
3030
3025
|
};
|
|
3031
|
-
let
|
|
3032
|
-
if (
|
|
3033
|
-
|
|
3034
|
-
from: { ...o, column:
|
|
3026
|
+
let c = null, l = null;
|
|
3027
|
+
if (d > n)
|
|
3028
|
+
c = {
|
|
3029
|
+
from: { ...o, column: d - s },
|
|
3035
3030
|
to: { ...a, column: u - s }
|
|
3036
|
-
}, l = z(
|
|
3031
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3037
3032
|
else {
|
|
3038
|
-
if (
|
|
3033
|
+
if (d >= e && u <= n)
|
|
3039
3034
|
return null;
|
|
3040
|
-
if (
|
|
3035
|
+
if (d < e && u > n)
|
|
3041
3036
|
if (r === O.Both)
|
|
3042
|
-
|
|
3037
|
+
c = {
|
|
3043
3038
|
from: { ...o },
|
|
3044
3039
|
to: { ...a, column: u - s }
|
|
3045
|
-
}, l = z(
|
|
3040
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3046
3041
|
else
|
|
3047
3042
|
return {
|
|
3048
3043
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
3049
3044
|
newTransform: t
|
|
3050
3045
|
};
|
|
3051
|
-
else if (
|
|
3052
|
-
if (
|
|
3046
|
+
else if (d >= e && d <= n) {
|
|
3047
|
+
if (d === e)
|
|
3053
3048
|
l = { ...t, left: (t.left || 0) - i.from.columnOffset };
|
|
3054
3049
|
else {
|
|
3055
|
-
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn:
|
|
3050
|
+
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: d - 1, startRow: o.row, endRow: a.row });
|
|
3056
3051
|
if (g == null)
|
|
3057
3052
|
return;
|
|
3058
3053
|
l = { ...t, left: (t.left || 0) - g.endX + g.startX - i.from.columnOffset };
|
|
3059
3054
|
}
|
|
3060
|
-
|
|
3055
|
+
c = x(l, this._selectionRenderService);
|
|
3061
3056
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3062
3057
|
const g = this._skeletonManagerService.attachRangeWithCoord({
|
|
3063
3058
|
startColumn: e - 1,
|
|
@@ -3067,98 +3062,98 @@ let cn = class extends ie {
|
|
|
3067
3062
|
});
|
|
3068
3063
|
if (g == null)
|
|
3069
3064
|
return;
|
|
3070
|
-
|
|
3065
|
+
c = {
|
|
3071
3066
|
from: { ...o },
|
|
3072
3067
|
to: { ...a, column: e - 1, columnOffset: g.endX - g.startX }
|
|
3073
|
-
}, l = z(
|
|
3068
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3074
3069
|
}
|
|
3075
3070
|
}
|
|
3076
|
-
return
|
|
3077
|
-
newSheetTransform:
|
|
3071
|
+
return c != null && l != null ? {
|
|
3072
|
+
newSheetTransform: c,
|
|
3078
3073
|
newTransform: l
|
|
3079
3074
|
} : null;
|
|
3080
3075
|
}
|
|
3081
3076
|
_expandRow(i, t, e, n, r = O.Position) {
|
|
3082
|
-
const s = n - e + 1, { from: o, to: a } = i, { row:
|
|
3077
|
+
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3083
3078
|
if (r === O.None)
|
|
3084
3079
|
return {
|
|
3085
3080
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
3086
3081
|
newTransform: t
|
|
3087
3082
|
};
|
|
3088
|
-
let
|
|
3089
|
-
if (
|
|
3083
|
+
let c = null, l = null;
|
|
3084
|
+
if (d >= e) {
|
|
3090
3085
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: n, startColumn: o.column, endColumn: a.column });
|
|
3091
3086
|
if (g == null)
|
|
3092
3087
|
return;
|
|
3093
|
-
l = { ...t, top: (t.top || 0) + g.endY - g.startY },
|
|
3088
|
+
l = { ...t, top: (t.top || 0) + g.endY - g.startY }, c = x(l, this._selectionRenderService);
|
|
3094
3089
|
} else if (u >= n)
|
|
3095
3090
|
if (r === O.Both)
|
|
3096
|
-
|
|
3091
|
+
c = {
|
|
3097
3092
|
from: { ...o },
|
|
3098
3093
|
to: {
|
|
3099
3094
|
...a,
|
|
3100
3095
|
row: u + s
|
|
3101
3096
|
}
|
|
3102
|
-
}, l = z(
|
|
3097
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3103
3098
|
else
|
|
3104
3099
|
return {
|
|
3105
3100
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
3106
3101
|
newTransform: t
|
|
3107
3102
|
};
|
|
3108
|
-
return
|
|
3109
|
-
newSheetTransform:
|
|
3103
|
+
return c != null && l != null ? {
|
|
3104
|
+
newSheetTransform: c,
|
|
3110
3105
|
newTransform: l
|
|
3111
3106
|
} : null;
|
|
3112
3107
|
}
|
|
3113
3108
|
_shrinkRow(i, t, e, n, r = O.Position) {
|
|
3114
|
-
const s = n - e + 1, { from: o, to: a } = i, { row:
|
|
3109
|
+
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3115
3110
|
if (r === O.None)
|
|
3116
3111
|
return {
|
|
3117
3112
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
3118
3113
|
newTransform: t
|
|
3119
3114
|
};
|
|
3120
|
-
let
|
|
3121
|
-
if (
|
|
3122
|
-
|
|
3123
|
-
from: { ...o, row:
|
|
3115
|
+
let c = null, l = null;
|
|
3116
|
+
if (d > n)
|
|
3117
|
+
c = {
|
|
3118
|
+
from: { ...o, row: d - s },
|
|
3124
3119
|
to: { ...a, row: u - s }
|
|
3125
|
-
}, l = z(
|
|
3120
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3126
3121
|
else {
|
|
3127
|
-
if (
|
|
3122
|
+
if (d >= e && u <= n)
|
|
3128
3123
|
return null;
|
|
3129
|
-
if (
|
|
3124
|
+
if (d < e && u > n)
|
|
3130
3125
|
if (r === O.Both)
|
|
3131
|
-
|
|
3126
|
+
c = {
|
|
3132
3127
|
from: { ...o },
|
|
3133
3128
|
to: { ...a, row: u - s }
|
|
3134
|
-
}, l = z(
|
|
3129
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3135
3130
|
else
|
|
3136
3131
|
return {
|
|
3137
3132
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
3138
3133
|
newTransform: t
|
|
3139
3134
|
};
|
|
3140
|
-
else if (
|
|
3141
|
-
if (
|
|
3135
|
+
else if (d >= e && d <= n) {
|
|
3136
|
+
if (d === e)
|
|
3142
3137
|
l = { ...t, top: (t.top || 0) - i.from.rowOffset };
|
|
3143
3138
|
else {
|
|
3144
|
-
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow:
|
|
3139
|
+
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: d - 1, startColumn: o.column, endColumn: a.column });
|
|
3145
3140
|
if (g == null)
|
|
3146
3141
|
return;
|
|
3147
3142
|
l = { ...t, top: (t.top || 0) - g.endY + g.startY - i.from.rowOffset };
|
|
3148
3143
|
}
|
|
3149
|
-
|
|
3144
|
+
c = x(l, this._selectionRenderService);
|
|
3150
3145
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3151
3146
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: e - 1, endRow: e - 1 });
|
|
3152
3147
|
if (g == null)
|
|
3153
3148
|
return;
|
|
3154
|
-
|
|
3149
|
+
c = {
|
|
3155
3150
|
from: { ...o },
|
|
3156
3151
|
to: { ...a, row: e - 1, rowOffset: g.endY - g.startY }
|
|
3157
|
-
}, l = z(
|
|
3152
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3158
3153
|
}
|
|
3159
3154
|
}
|
|
3160
|
-
return
|
|
3161
|
-
newSheetTransform:
|
|
3155
|
+
return c != null && l != null ? {
|
|
3156
|
+
newSheetTransform: c,
|
|
3162
3157
|
newTransform: l
|
|
3163
3158
|
} : null;
|
|
3164
3159
|
}
|
|
@@ -3168,7 +3163,7 @@ let cn = class extends ie {
|
|
|
3168
3163
|
// but the skeleton changes like other render modules. These two signals are not equivalent.
|
|
3169
3164
|
// As a temp solution, I subscribed to activate$ here.
|
|
3170
3165
|
this._commandService.onCommandExecuted((i) => {
|
|
3171
|
-
if (i.id ===
|
|
3166
|
+
if (i.id === ts.id) {
|
|
3172
3167
|
const { unitId: t, subUnitId: e } = i.params;
|
|
3173
3168
|
this._updateDrawings(t, e);
|
|
3174
3169
|
}
|
|
@@ -3204,13 +3199,13 @@ let cn = class extends ie {
|
|
|
3204
3199
|
Object.keys(e).forEach((s) => {
|
|
3205
3200
|
const o = e[s];
|
|
3206
3201
|
o != null && Object.keys(o).forEach((a) => {
|
|
3207
|
-
const
|
|
3208
|
-
|
|
3202
|
+
const d = o[a].data;
|
|
3203
|
+
d != null && Object.keys(d).forEach((u) => {
|
|
3209
3204
|
if (s === i && a === t) {
|
|
3210
|
-
const
|
|
3211
|
-
|
|
3205
|
+
const c = d[u];
|
|
3206
|
+
c.transform = z(c.sheetTransform, this._selectionRenderService, this._skeletonManagerService), n.push(d[u]);
|
|
3212
3207
|
} else
|
|
3213
|
-
r.push(
|
|
3208
|
+
r.push(d[u]);
|
|
3214
3209
|
});
|
|
3215
3210
|
});
|
|
3216
3211
|
}), this._drawingManagerService.removeNotification(r), this._drawingManagerService.addNotification(n);
|
|
@@ -3219,7 +3214,7 @@ let cn = class extends ie {
|
|
|
3219
3214
|
_sheetRefreshListener() {
|
|
3220
3215
|
this.disposeWithMe(
|
|
3221
3216
|
this._commandService.onCommandExecuted((i) => {
|
|
3222
|
-
|
|
3217
|
+
Fs.includes(i.id) && requestIdleCallback(() => {
|
|
3223
3218
|
const t = i.params, { unitId: e, subUnitId: n, ranges: r } = t;
|
|
3224
3219
|
this._refreshDrawingTransform(e, n, r);
|
|
3225
3220
|
});
|
|
@@ -3229,13 +3224,13 @@ let cn = class extends ie {
|
|
|
3229
3224
|
_refreshDrawingTransform(i, t, e) {
|
|
3230
3225
|
const n = this._drawingManagerService.getDrawingData(i, t), r = [];
|
|
3231
3226
|
Object.keys(n).forEach((s) => {
|
|
3232
|
-
const o = n[s], { sheetTransform: a, transform:
|
|
3227
|
+
const o = n[s], { sheetTransform: a, transform: d, anchorType: u = O.Position } = o;
|
|
3233
3228
|
if (u === O.None)
|
|
3234
3229
|
return !0;
|
|
3235
|
-
const { from:
|
|
3236
|
-
for (let
|
|
3237
|
-
const _ = e[
|
|
3238
|
-
if (
|
|
3230
|
+
const { from: c, to: l } = a, { row: g, column: h } = c, { row: m, column: p } = l;
|
|
3231
|
+
for (let f = 0; f < e.length; f++) {
|
|
3232
|
+
const _ = e[f], { startRow: S, endRow: C, startColumn: b, endColumn: v } = _;
|
|
3233
|
+
if (Hr.intersects(
|
|
3239
3234
|
{
|
|
3240
3235
|
startRow: S,
|
|
3241
3236
|
endRow: C,
|
|
@@ -3244,7 +3239,7 @@ let cn = class extends ie {
|
|
|
3244
3239
|
},
|
|
3245
3240
|
{
|
|
3246
3241
|
startRow: g,
|
|
3247
|
-
endRow:
|
|
3242
|
+
endRow: m,
|
|
3248
3243
|
startColumn: h,
|
|
3249
3244
|
endColumn: p
|
|
3250
3245
|
}
|
|
@@ -3254,26 +3249,26 @@ let cn = class extends ie {
|
|
|
3254
3249
|
...o,
|
|
3255
3250
|
transform: {
|
|
3256
3251
|
...w,
|
|
3257
|
-
width: D ?
|
|
3258
|
-
height: D ?
|
|
3252
|
+
width: D ? d == null ? void 0 : d.width : w == null ? void 0 : w.width,
|
|
3253
|
+
height: D ? d == null ? void 0 : d.height : w == null ? void 0 : w.height
|
|
3259
3254
|
}
|
|
3260
3255
|
});
|
|
3261
3256
|
break;
|
|
3262
3257
|
}
|
|
3263
3258
|
}
|
|
3264
|
-
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(
|
|
3259
|
+
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(L.id, [i]));
|
|
3265
3260
|
}
|
|
3266
3261
|
};
|
|
3267
|
-
|
|
3262
|
+
sn = $s([
|
|
3268
3263
|
pe(1, q),
|
|
3269
3264
|
pe(2, G),
|
|
3270
|
-
pe(3,
|
|
3265
|
+
pe(3, Ge),
|
|
3271
3266
|
pe(4, A(V)),
|
|
3272
|
-
pe(5, A(
|
|
3267
|
+
pe(5, A(kt)),
|
|
3273
3268
|
pe(6, oe),
|
|
3274
3269
|
pe(7, se),
|
|
3275
3270
|
pe(8, Se)
|
|
3276
|
-
],
|
|
3271
|
+
], sn);
|
|
3277
3272
|
var re = function() {
|
|
3278
3273
|
return re = Object.assign || function(i) {
|
|
3279
3274
|
for (var t, e = 1, n = arguments.length; e < n; e++) {
|
|
@@ -3282,23 +3277,23 @@ var re = function() {
|
|
|
3282
3277
|
}
|
|
3283
3278
|
return i;
|
|
3284
3279
|
}, re.apply(this, arguments);
|
|
3285
|
-
},
|
|
3280
|
+
}, Ls = function(i, t) {
|
|
3286
3281
|
var e = {};
|
|
3287
3282
|
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && t.indexOf(n) < 0 && (e[n] = i[n]);
|
|
3288
3283
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
3289
3284
|
for (var r = 0, n = Object.getOwnPropertySymbols(i); r < n.length; r++)
|
|
3290
3285
|
t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (e[n[r]] = i[n[r]]);
|
|
3291
3286
|
return e;
|
|
3292
|
-
},
|
|
3293
|
-
var e = i.icon, n = i.id, r = i.className, s = i.extend, o =
|
|
3294
|
-
return
|
|
3287
|
+
}, br = hr(function(i, t) {
|
|
3288
|
+
var e = i.icon, n = i.id, r = i.className, s = i.extend, o = Ls(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), d = os("_".concat(Xs()));
|
|
3289
|
+
return Rr(e, "".concat(n), { defIds: e.defIds, idSuffix: d.current }, re({ ref: t, className: a }, o), s);
|
|
3295
3290
|
});
|
|
3296
|
-
function
|
|
3297
|
-
return
|
|
3298
|
-
return
|
|
3291
|
+
function Rr(i, t, e, n, r) {
|
|
3292
|
+
return gr(i.tag, re(re({ key: t }, Ys(i, e, r)), n), (Gs(i, e).children || []).map(function(s, o) {
|
|
3293
|
+
return Rr(s, "".concat(t, "-").concat(i.tag, "-").concat(o), e, void 0, r);
|
|
3299
3294
|
}));
|
|
3300
3295
|
}
|
|
3301
|
-
function
|
|
3296
|
+
function Ys(i, t, e) {
|
|
3302
3297
|
var n = re({}, i.attrs);
|
|
3303
3298
|
e != null && e.colorChannel1 && n.fill === "colorChannel1" && (n.fill = e.colorChannel1), i.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(function(s) {
|
|
3304
3299
|
var o = s[0], a = s[1];
|
|
@@ -3310,25 +3305,25 @@ function eo(i, t, e) {
|
|
|
3310
3305
|
typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
3311
3306
|
})), n;
|
|
3312
3307
|
}
|
|
3313
|
-
function
|
|
3308
|
+
function Gs(i, t) {
|
|
3314
3309
|
var e, n = t.defIds;
|
|
3315
3310
|
return !n || n.length === 0 ? i : i.tag === "defs" && (!((e = i.children) === null || e === void 0) && e.length) ? re(re({}, i), { children: i.children.map(function(r) {
|
|
3316
3311
|
return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? re(re({}, r), { attrs: re(re({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
|
|
3317
3312
|
}) }) : i;
|
|
3318
3313
|
}
|
|
3319
|
-
function
|
|
3314
|
+
function Xs() {
|
|
3320
3315
|
return Math.random().toString(36).substring(2, 8);
|
|
3321
3316
|
}
|
|
3322
|
-
|
|
3323
|
-
var
|
|
3324
|
-
return
|
|
3317
|
+
br.displayName = "UniverIcon";
|
|
3318
|
+
var Vs = { 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" } }] }, Mr = hr(function(i, t) {
|
|
3319
|
+
return gr(br, Object.assign({}, i, {
|
|
3325
3320
|
id: "add-image-single",
|
|
3326
3321
|
ref: t,
|
|
3327
|
-
icon:
|
|
3322
|
+
icon: Vs
|
|
3328
3323
|
}));
|
|
3329
3324
|
});
|
|
3330
|
-
|
|
3331
|
-
const
|
|
3325
|
+
Mr.displayName = "AddImageSingle";
|
|
3326
|
+
const yr = {
|
|
3332
3327
|
id: "sheet.command.delete-drawing",
|
|
3333
3328
|
type: J.COMMAND,
|
|
3334
3329
|
handler: (i) => {
|
|
@@ -3336,113 +3331,106 @@ const Pr = {
|
|
|
3336
3331
|
if (n.length === 0)
|
|
3337
3332
|
return !1;
|
|
3338
3333
|
const r = n[0].unitId, s = n.map((o) => {
|
|
3339
|
-
const { unitId: a, subUnitId:
|
|
3334
|
+
const { unitId: a, subUnitId: d, drawingId: u, drawingType: c } = o;
|
|
3340
3335
|
return {
|
|
3341
3336
|
unitId: a,
|
|
3342
|
-
subUnitId:
|
|
3337
|
+
subUnitId: d,
|
|
3343
3338
|
drawingId: u,
|
|
3344
|
-
drawingType:
|
|
3339
|
+
drawingType: c
|
|
3345
3340
|
};
|
|
3346
3341
|
});
|
|
3347
|
-
return t.executeCommand(
|
|
3342
|
+
return t.executeCommand(rt.id, {
|
|
3348
3343
|
unitId: r,
|
|
3349
3344
|
drawings: s
|
|
3350
3345
|
});
|
|
3351
3346
|
}
|
|
3352
|
-
},
|
|
3347
|
+
}, it = {
|
|
3353
3348
|
id: "sheet.command.move-drawing",
|
|
3354
3349
|
type: J.COMMAND,
|
|
3355
3350
|
handler: (i, t) => {
|
|
3356
|
-
const e = i.get(G), n = i.get(oe), r = i.get(
|
|
3351
|
+
const e = i.get(G), n = i.get(oe), r = i.get(Ge), { direction: s } = t, o = n.getFocusDrawings();
|
|
3357
3352
|
if (o.length === 0)
|
|
3358
3353
|
return !1;
|
|
3359
|
-
const a = o[0].unitId,
|
|
3360
|
-
const { transform: l } =
|
|
3354
|
+
const a = o[0].unitId, d = o.map((c) => {
|
|
3355
|
+
const { transform: l } = c;
|
|
3361
3356
|
if (l == null)
|
|
3362
3357
|
return null;
|
|
3363
|
-
const g = { ...l }, { left: h = 0, top:
|
|
3364
|
-
return s === ve.UP ? g.top =
|
|
3365
|
-
...
|
|
3358
|
+
const g = { ...l }, { left: h = 0, top: m = 0 } = l;
|
|
3359
|
+
return s === ve.UP ? g.top = m - 1 : s === ve.DOWN ? g.top = m + 1 : s === ve.LEFT ? g.left = h - 1 : s === ve.RIGHT && (g.left = h + 1), {
|
|
3360
|
+
...c,
|
|
3366
3361
|
transform: g,
|
|
3367
3362
|
sheetTransform: x(g, r)
|
|
3368
3363
|
};
|
|
3369
|
-
}).filter((
|
|
3370
|
-
return e.syncExecuteCommand(
|
|
3364
|
+
}).filter((c) => c != null);
|
|
3365
|
+
return e.syncExecuteCommand(jt.id, {
|
|
3371
3366
|
unitId: a,
|
|
3372
|
-
drawings:
|
|
3373
|
-
}) ? (e.syncExecuteCommand(
|
|
3367
|
+
drawings: d
|
|
3368
|
+
}) ? (e.syncExecuteCommand(L.id, [a]), !0) : !1;
|
|
3374
3369
|
}
|
|
3375
|
-
},
|
|
3376
|
-
function
|
|
3370
|
+
}, Er = "addition-and-subtraction-single", Tr = "sheet.menu.image";
|
|
3371
|
+
function Hs(i) {
|
|
3377
3372
|
return {
|
|
3378
|
-
id:
|
|
3379
|
-
type:
|
|
3380
|
-
icon:
|
|
3373
|
+
id: Tr,
|
|
3374
|
+
type: cn.SUBITEMS,
|
|
3375
|
+
icon: Er,
|
|
3381
3376
|
tooltip: "sheetImage.title",
|
|
3382
|
-
hidden$:
|
|
3383
|
-
disabled$: Oi(i, { workbookTypes: [
|
|
3377
|
+
hidden$: an(i, F.UNIVER_SHEET),
|
|
3378
|
+
disabled$: Oi(i, { workbookTypes: [Kt], worksheetTypes: [Zt], rangeTypes: [ns] })
|
|
3384
3379
|
};
|
|
3385
3380
|
}
|
|
3386
|
-
function
|
|
3381
|
+
function zs(i) {
|
|
3387
3382
|
return {
|
|
3388
|
-
id:
|
|
3383
|
+
id: Bt.id,
|
|
3389
3384
|
title: "sheetImage.upload.float",
|
|
3390
|
-
type:
|
|
3391
|
-
hidden$:
|
|
3385
|
+
type: cn.BUTTON,
|
|
3386
|
+
hidden$: an(i, F.UNIVER_SHEET)
|
|
3392
3387
|
};
|
|
3393
3388
|
}
|
|
3394
|
-
function
|
|
3389
|
+
function Ks(i) {
|
|
3395
3390
|
return {
|
|
3396
|
-
id:
|
|
3391
|
+
id: ln.id,
|
|
3397
3392
|
title: "sheetImage.upload.cell",
|
|
3398
|
-
type:
|
|
3399
|
-
hidden$:
|
|
3393
|
+
type: cn.BUTTON,
|
|
3394
|
+
hidden$: an(i, F.UNIVER_SHEET)
|
|
3400
3395
|
};
|
|
3401
3396
|
}
|
|
3402
|
-
const
|
|
3403
|
-
imageCommonPanel: ao,
|
|
3404
|
-
imageCommonPanelGrid: co,
|
|
3405
|
-
imageCommonPanelBorder: lo,
|
|
3406
|
-
imageCommonPanelTitle: uo,
|
|
3407
|
-
imageCommonPanelRow: ho,
|
|
3408
|
-
imageCommonPanelColumn: go
|
|
3409
|
-
}, mo = (i) => {
|
|
3397
|
+
const Zs = (i) => {
|
|
3410
3398
|
var C;
|
|
3411
|
-
const t =
|
|
3399
|
+
const t = Qe(G), e = Qe(nt), n = Qe(se), r = Qe(q), { drawings: s } = i, o = s[0];
|
|
3412
3400
|
if (o == null)
|
|
3413
3401
|
return;
|
|
3414
|
-
const { unitId: a } = o,
|
|
3402
|
+
const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
|
|
3415
3403
|
if (u == null)
|
|
3416
3404
|
return;
|
|
3417
|
-
const
|
|
3418
|
-
function
|
|
3405
|
+
const c = u.getTransformerByCreate(), [l, g] = en(!0), h = (C = o.anchorType) != null ? C : O.Position, [m, p] = en(h);
|
|
3406
|
+
function f(b, v) {
|
|
3419
3407
|
const D = [];
|
|
3420
3408
|
return b.forEach((w) => {
|
|
3421
|
-
const { oKey:
|
|
3409
|
+
const { oKey: y } = w, I = v.getDrawingOKey(y);
|
|
3422
3410
|
if (I == null)
|
|
3423
3411
|
return D.push(null), !0;
|
|
3424
|
-
const { unitId: E, subUnitId: T, drawingId:
|
|
3412
|
+
const { unitId: E, subUnitId: T, drawingId: M, drawingType: R, anchorType: N, sheetTransform: B } = I;
|
|
3425
3413
|
D.push({
|
|
3426
3414
|
unitId: E,
|
|
3427
3415
|
subUnitId: T,
|
|
3428
|
-
drawingId:
|
|
3416
|
+
drawingId: M,
|
|
3429
3417
|
anchorType: N,
|
|
3430
|
-
sheetTransform:
|
|
3418
|
+
sheetTransform: B,
|
|
3431
3419
|
drawingType: R
|
|
3432
3420
|
});
|
|
3433
3421
|
}), D;
|
|
3434
3422
|
}
|
|
3435
|
-
|
|
3436
|
-
const b =
|
|
3423
|
+
fr(() => {
|
|
3424
|
+
const b = c.clearControl$.subscribe((D) => {
|
|
3437
3425
|
D === !0 && g(!1);
|
|
3438
|
-
}), v =
|
|
3426
|
+
}), v = c.changeStart$.subscribe((D) => {
|
|
3439
3427
|
var I;
|
|
3440
|
-
const { objects: w } = D,
|
|
3441
|
-
if (
|
|
3428
|
+
const { objects: w } = D, y = f(w, n);
|
|
3429
|
+
if (y.length === 0)
|
|
3442
3430
|
g(!1);
|
|
3443
|
-
else if (
|
|
3431
|
+
else if (y.length >= 1) {
|
|
3444
3432
|
g(!0);
|
|
3445
|
-
const E = ((I =
|
|
3433
|
+
const E = ((I = y[0]) == null ? void 0 : I.anchorType) || O.Position;
|
|
3446
3434
|
p(E);
|
|
3447
3435
|
}
|
|
3448
3436
|
});
|
|
@@ -3461,142 +3449,167 @@ const ao = "univer-image-common-panel", co = "univer-image-common-panel-grid", l
|
|
|
3461
3449
|
drawingId: w.drawingId,
|
|
3462
3450
|
anchorType: b
|
|
3463
3451
|
}));
|
|
3464
|
-
t.executeCommand(
|
|
3452
|
+
t.executeCommand(jt.id, {
|
|
3465
3453
|
unitId: v[0].unitId,
|
|
3466
3454
|
drawings: D
|
|
3467
3455
|
});
|
|
3468
3456
|
}
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3457
|
+
return /* @__PURE__ */ Qt(
|
|
3458
|
+
"div",
|
|
3459
|
+
{
|
|
3460
|
+
className: `
|
|
3461
|
+
univer-relative univer-mt-5 univer-w-full univer-border-b-0 univer-border-l-0 univer-border-r-0
|
|
3462
|
+
univer-border-t univer-border-solid univer-border-gray-200
|
|
3463
|
+
`,
|
|
3464
|
+
style: { display: ((b) => b ? "block" : "none")(l) },
|
|
3465
|
+
children: [
|
|
3466
|
+
/* @__PURE__ */ Z(
|
|
3467
|
+
"div",
|
|
3468
|
+
{
|
|
3469
|
+
className: `
|
|
3470
|
+
univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
|
|
3471
|
+
`,
|
|
3472
|
+
children: /* @__PURE__ */ Z("div", { className: "univer-w-full univer-text-left univer-text-gray-400", children: /* @__PURE__ */ Z("div", { children: e.t("drawing-anchor.title") }) })
|
|
3473
|
+
}
|
|
3474
|
+
),
|
|
3475
|
+
/* @__PURE__ */ Z(
|
|
3476
|
+
"div",
|
|
3477
|
+
{
|
|
3478
|
+
className: `
|
|
3479
|
+
univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
|
|
3480
|
+
`,
|
|
3481
|
+
children: /* @__PURE__ */ Z("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ Qt(vi, { value: m, onChange: _, direction: "vertical", children: [
|
|
3482
|
+
/* @__PURE__ */ Z(Gt, { value: O.Both, children: e.t("drawing-anchor.both") }),
|
|
3483
|
+
/* @__PURE__ */ Z(Gt, { value: O.Position, children: e.t("drawing-anchor.position") }),
|
|
3484
|
+
/* @__PURE__ */ Z(Gt, { value: O.None, children: e.t("drawing-anchor.none") })
|
|
3485
|
+
] }) })
|
|
3486
|
+
}
|
|
3487
|
+
)
|
|
3488
|
+
]
|
|
3489
|
+
}
|
|
3490
|
+
);
|
|
3491
|
+
}, Js = () => {
|
|
3492
|
+
const i = Qe(se), t = i.getFocusDrawings(), [e, n] = en(t);
|
|
3493
|
+
return fr(() => {
|
|
3481
3494
|
const r = i.focus$.subscribe((s) => {
|
|
3482
3495
|
n(s);
|
|
3483
3496
|
});
|
|
3484
3497
|
return () => {
|
|
3485
3498
|
r.unsubscribe();
|
|
3486
3499
|
};
|
|
3487
|
-
}, []), !!(e != null && e.length) && /* @__PURE__ */
|
|
3488
|
-
/* @__PURE__ */
|
|
3489
|
-
/* @__PURE__ */
|
|
3500
|
+
}, []), !!(e != null && e.length) && /* @__PURE__ */ Qt("div", { className: "univer-p-2 univer-text-center univer-text-sm", children: [
|
|
3501
|
+
/* @__PURE__ */ Z(ui, { drawings: e }),
|
|
3502
|
+
/* @__PURE__ */ Z(Zs, { drawings: e })
|
|
3490
3503
|
] });
|
|
3491
|
-
},
|
|
3492
|
-
[
|
|
3493
|
-
[
|
|
3504
|
+
}, qs = {
|
|
3505
|
+
[Bi.FORMULAS_INSERT]: {
|
|
3506
|
+
[Tr]: {
|
|
3494
3507
|
order: 3,
|
|
3495
|
-
menuItemFactory:
|
|
3496
|
-
[
|
|
3508
|
+
menuItemFactory: Hs,
|
|
3509
|
+
[Bt.id]: {
|
|
3497
3510
|
order: 0,
|
|
3498
|
-
menuItemFactory:
|
|
3511
|
+
menuItemFactory: zs
|
|
3499
3512
|
},
|
|
3500
|
-
[
|
|
3513
|
+
[ln.id]: {
|
|
3501
3514
|
order: 1,
|
|
3502
|
-
menuItemFactory:
|
|
3515
|
+
menuItemFactory: Ks
|
|
3503
3516
|
}
|
|
3504
3517
|
}
|
|
3505
3518
|
}
|
|
3506
3519
|
};
|
|
3507
|
-
function
|
|
3508
|
-
return !i.getContextValue(
|
|
3520
|
+
function st(i) {
|
|
3521
|
+
return !i.getContextValue(zr) && !i.getContextValue(Kr) && !i.getContextValue(Zr) && i.getContextValue(xe);
|
|
3509
3522
|
}
|
|
3510
|
-
const
|
|
3511
|
-
id:
|
|
3523
|
+
const Qs = {
|
|
3524
|
+
id: it.id,
|
|
3512
3525
|
description: "shortcut.drawing-move-down",
|
|
3513
3526
|
group: "4_drawing-view",
|
|
3514
|
-
binding:
|
|
3527
|
+
binding: Fe.ARROW_DOWN,
|
|
3515
3528
|
priority: 100,
|
|
3516
|
-
preconditions:
|
|
3529
|
+
preconditions: st,
|
|
3517
3530
|
staticParameters: {
|
|
3518
3531
|
direction: ve.DOWN
|
|
3519
3532
|
}
|
|
3520
|
-
},
|
|
3521
|
-
id:
|
|
3533
|
+
}, eo = {
|
|
3534
|
+
id: it.id,
|
|
3522
3535
|
description: "shortcut.drawing-move-up",
|
|
3523
3536
|
group: "4_drawing-view",
|
|
3524
|
-
binding:
|
|
3537
|
+
binding: Fe.ARROW_UP,
|
|
3525
3538
|
priority: 100,
|
|
3526
|
-
preconditions:
|
|
3539
|
+
preconditions: st,
|
|
3527
3540
|
staticParameters: {
|
|
3528
3541
|
direction: ve.UP
|
|
3529
3542
|
}
|
|
3530
|
-
},
|
|
3531
|
-
id:
|
|
3543
|
+
}, to = {
|
|
3544
|
+
id: it.id,
|
|
3532
3545
|
description: "shortcut.drawing-move-left",
|
|
3533
3546
|
group: "4_drawing-view",
|
|
3534
|
-
binding:
|
|
3547
|
+
binding: Fe.ARROW_LEFT,
|
|
3535
3548
|
priority: 100,
|
|
3536
|
-
preconditions:
|
|
3549
|
+
preconditions: st,
|
|
3537
3550
|
staticParameters: {
|
|
3538
3551
|
direction: ve.LEFT
|
|
3539
3552
|
}
|
|
3540
|
-
},
|
|
3541
|
-
id:
|
|
3553
|
+
}, no = {
|
|
3554
|
+
id: it.id,
|
|
3542
3555
|
description: "shortcut.drawing-move-right",
|
|
3543
3556
|
group: "4_drawing-view",
|
|
3544
|
-
binding:
|
|
3557
|
+
binding: Fe.ARROW_RIGHT,
|
|
3545
3558
|
priority: 100,
|
|
3546
|
-
preconditions:
|
|
3559
|
+
preconditions: st,
|
|
3547
3560
|
staticParameters: {
|
|
3548
3561
|
direction: ve.RIGHT
|
|
3549
3562
|
}
|
|
3550
|
-
},
|
|
3551
|
-
id:
|
|
3563
|
+
}, ro = {
|
|
3564
|
+
id: yr.id,
|
|
3552
3565
|
description: "shortcut.drawing-delete",
|
|
3553
3566
|
group: "4_drawing-view",
|
|
3554
3567
|
// when focusing on any other input tag do not trigger this shortcut
|
|
3555
|
-
preconditions:
|
|
3556
|
-
binding:
|
|
3557
|
-
mac:
|
|
3568
|
+
preconditions: st,
|
|
3569
|
+
binding: Fe.DELETE,
|
|
3570
|
+
mac: Fe.BACKSPACE
|
|
3558
3571
|
};
|
|
3559
|
-
var
|
|
3560
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
3572
|
+
var io = Object.getOwnPropertyDescriptor, so = (i, t, e, n) => {
|
|
3573
|
+
for (var r = n > 1 ? void 0 : n ? io(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3561
3574
|
(o = i[s]) && (r = o(r) || r);
|
|
3562
3575
|
return r;
|
|
3563
|
-
},
|
|
3564
|
-
let
|
|
3576
|
+
}, We = (i, t) => (e, n) => t(e, n, i);
|
|
3577
|
+
let Pt = class extends ie {
|
|
3565
3578
|
constructor(i, t, e, n, r, s) {
|
|
3566
3579
|
super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
|
|
3567
3580
|
}
|
|
3568
3581
|
_initCustomComponents() {
|
|
3569
3582
|
const i = this._componentManager;
|
|
3570
|
-
this.disposeWithMe(i.register(
|
|
3583
|
+
this.disposeWithMe(i.register(Er, Mr)), this.disposeWithMe(i.register(mr, Js));
|
|
3571
3584
|
}
|
|
3572
3585
|
_initMenus() {
|
|
3573
|
-
this._menuManagerService.mergeMenu(
|
|
3586
|
+
this._menuManagerService.mergeMenu(qs);
|
|
3574
3587
|
}
|
|
3575
3588
|
_initCommands() {
|
|
3576
3589
|
[
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3590
|
+
Bt,
|
|
3591
|
+
ln,
|
|
3592
|
+
Wt,
|
|
3593
|
+
rt,
|
|
3594
|
+
jt,
|
|
3595
|
+
pr,
|
|
3596
|
+
L,
|
|
3597
|
+
wr,
|
|
3598
|
+
_r,
|
|
3582
3599
|
Sr,
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
br,
|
|
3587
|
-
st,
|
|
3588
|
-
Pr,
|
|
3589
|
-
Dr
|
|
3600
|
+
it,
|
|
3601
|
+
yr,
|
|
3602
|
+
vr
|
|
3590
3603
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
3591
3604
|
}
|
|
3592
3605
|
_initShortcuts() {
|
|
3593
3606
|
[
|
|
3594
3607
|
// sheet drawing shortcuts
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3608
|
+
Qs,
|
|
3609
|
+
eo,
|
|
3610
|
+
to,
|
|
3611
|
+
no,
|
|
3612
|
+
ro
|
|
3600
3613
|
].forEach((i) => {
|
|
3601
3614
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
3602
3615
|
});
|
|
@@ -3605,97 +3618,97 @@ let Bt = class extends ie {
|
|
|
3605
3618
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
3606
3619
|
}
|
|
3607
3620
|
};
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
],
|
|
3616
|
-
var
|
|
3617
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
3621
|
+
Pt = so([
|
|
3622
|
+
We(0, A(zn)),
|
|
3623
|
+
We(1, $i),
|
|
3624
|
+
We(2, G),
|
|
3625
|
+
We(3, xi),
|
|
3626
|
+
We(4, se),
|
|
3627
|
+
We(5, A(dn))
|
|
3628
|
+
], Pt);
|
|
3629
|
+
var oo = Object.defineProperty, ao = Object.getOwnPropertyDescriptor, co = (i, t, e) => t in i ? oo(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, lo = (i, t, e, n) => {
|
|
3630
|
+
for (var r = n > 1 ? void 0 : n ? ao(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3618
3631
|
(o = i[s]) && (r = o(r) || r);
|
|
3619
3632
|
return r;
|
|
3620
|
-
},
|
|
3621
|
-
const
|
|
3622
|
-
let
|
|
3623
|
-
constructor(i =
|
|
3633
|
+
}, Vt = (i, t) => (e, n) => t(e, n, i), Or = (i, t, e) => co(i, typeof t != "symbol" ? t + "" : t, e);
|
|
3634
|
+
const uo = "SHEET_IMAGE_UI_PLUGIN";
|
|
3635
|
+
let At = class extends Qr {
|
|
3636
|
+
constructor(i = $n, t, e, n) {
|
|
3624
3637
|
super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
|
|
3625
|
-
const { menu: r, ...s } =
|
|
3638
|
+
const { menu: r, ...s } = ei(
|
|
3626
3639
|
{},
|
|
3627
|
-
|
|
3640
|
+
$n,
|
|
3628
3641
|
this._config
|
|
3629
3642
|
);
|
|
3630
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
3643
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(as, s);
|
|
3631
3644
|
}
|
|
3632
3645
|
onStarting() {
|
|
3633
|
-
|
|
3634
|
-
[
|
|
3635
|
-
[Bt],
|
|
3636
|
-
[Tt],
|
|
3637
|
-
[kt],
|
|
3638
|
-
[Nt],
|
|
3639
|
-
[At],
|
|
3640
|
-
[Ot],
|
|
3646
|
+
ti(this._injector, [
|
|
3647
|
+
[tt],
|
|
3641
3648
|
[Pt],
|
|
3642
|
-
[
|
|
3643
|
-
|
|
3644
|
-
[
|
|
3649
|
+
[Rt],
|
|
3650
|
+
[Ut],
|
|
3651
|
+
[Ot],
|
|
3652
|
+
[Tt],
|
|
3653
|
+
[Mt],
|
|
3654
|
+
[yt],
|
|
3655
|
+
[Et]
|
|
3656
|
+
]), Ft(this._injector, [
|
|
3657
|
+
[tt]
|
|
3645
3658
|
]);
|
|
3646
3659
|
}
|
|
3647
3660
|
onReady() {
|
|
3648
|
-
|
|
3649
|
-
[
|
|
3650
|
-
[
|
|
3661
|
+
Ft(this._injector, [
|
|
3662
|
+
[Tt],
|
|
3663
|
+
[Et]
|
|
3651
3664
|
]);
|
|
3652
3665
|
}
|
|
3653
3666
|
onRendered() {
|
|
3654
|
-
this._registerRenderModules(),
|
|
3655
|
-
[Nt],
|
|
3656
|
-
[kt],
|
|
3657
|
-
[Bt],
|
|
3667
|
+
this._registerRenderModules(), Ft(this._injector, [
|
|
3658
3668
|
[Ot],
|
|
3659
|
-
[
|
|
3669
|
+
[Ut],
|
|
3670
|
+
[Pt],
|
|
3671
|
+
[Mt],
|
|
3672
|
+
[yt]
|
|
3660
3673
|
]);
|
|
3661
3674
|
}
|
|
3662
3675
|
onSteady() {
|
|
3663
|
-
this._injector.get(
|
|
3676
|
+
this._injector.get(Rt);
|
|
3664
3677
|
}
|
|
3665
3678
|
_registerRenderModules() {
|
|
3666
3679
|
[
|
|
3667
|
-
[
|
|
3668
|
-
[
|
|
3669
|
-
[
|
|
3670
|
-
[
|
|
3680
|
+
[et],
|
|
3681
|
+
[sn],
|
|
3682
|
+
[nn],
|
|
3683
|
+
[tn]
|
|
3671
3684
|
].forEach((i) => {
|
|
3672
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3685
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(F.UNIVER_SHEET, i));
|
|
3673
3686
|
});
|
|
3674
3687
|
}
|
|
3675
3688
|
};
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
],
|
|
3689
|
+
Or(At, "type", F.UNIVER_SHEET);
|
|
3690
|
+
Or(At, "pluginName", uo);
|
|
3691
|
+
At = lo([
|
|
3692
|
+
Jr(oi, ri, hi, pi),
|
|
3693
|
+
Vt(1, A(Ye)),
|
|
3694
|
+
Vt(2, q),
|
|
3695
|
+
Vt(3, qr)
|
|
3696
|
+
], At);
|
|
3684
3697
|
export {
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3698
|
+
L as ClearSheetDrawingTransformerOperation,
|
|
3699
|
+
yr as DeleteDrawingsCommand,
|
|
3700
|
+
wr as EditSheetDrawingOperation,
|
|
3701
|
+
_r as GroupSheetDrawingCommand,
|
|
3702
|
+
Bt as InsertFloatImageCommand,
|
|
3703
|
+
Wt as InsertSheetDrawingCommand,
|
|
3704
|
+
it as MoveDrawingsCommand,
|
|
3705
|
+
rt as RemoveSheetDrawingCommand,
|
|
3706
|
+
Tr as SHEETS_IMAGE_MENU_ID,
|
|
3707
|
+
vr as SetDrawingArrangeCommand,
|
|
3708
|
+
jt as SetSheetDrawingCommand,
|
|
3709
|
+
tt as SheetCanvasFloatDomManagerService,
|
|
3710
|
+
et as SheetDrawingUpdateController,
|
|
3711
|
+
pr as SidebarSheetDrawingOperation,
|
|
3712
|
+
Sr as UngroupSheetDrawingCommand,
|
|
3713
|
+
At as UniverSheetsDrawingUIPlugin
|
|
3701
3714
|
};
|