@univerjs/sheets-drawing-ui 0.4.2-nightly.202411081606 → 0.4.2-nightly.202411091134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +9 -1
- package/lib/es/facade.js +12 -418
- package/lib/es/index.js +695 -672
- package/lib/types/facade/f-worksheet.d.ts +1 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +9 -1
- package/package.json +10 -10
package/lib/es/index.js
CHANGED
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as H, ICommandService as W, IUndoRedoService as ue, sequenceExecute as It, LocaleService as
|
|
5
|
-
import { IDrawingManagerService as K, IImageIoService as Dt, DrawingTypeEnum as k, ArrangeTypeEnum as ve, DRAWING_IMAGE_ALLOW_IMAGE_LIST as
|
|
6
|
-
import { ImageCropperObject as
|
|
7
|
-
import { IRenderManagerService as J, precisionTo as ne, getGroupState as
|
|
8
|
-
import { ISheetDrawingService as F, SetDrawingApplyMutation as P, DrawingApplyType as T, SheetDrawingAnchorType as y, UniverSheetsDrawingPlugin as
|
|
9
|
-
import { SheetCanvasPopManagerService as
|
|
10
|
-
import { ISidebarService as
|
|
11
|
-
import { takeUntil as vt, combineLatest as Ie, map as Ee, filter as ae, distinctUntilChanged as Ce, Subject as Ke, take as
|
|
12
|
-
import { SheetInterceptorService as at, getSheetCommandTarget as ce, SheetsSelectionsService as
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
const br = "sheets-drawing-ui.config", yr = {}, j = {
|
|
1
|
+
var gn = Object.defineProperty;
|
|
2
|
+
var mn = (i, e, n) => e in i ? gn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var V = (i, e, n) => mn(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CommandType as H, ICommandService as W, IUndoRedoService as ue, sequenceExecute as It, LocaleService as We, IUniverInstanceService as fe, useDependency as oe, Inject as x, Injector as Ct, IContextService as Rt, RxDisposable as fn, UniverInstanceType as Y, connectInjector as pn, toDisposable as wn, FOCUSING_COMMON_DRAWINGS as me, Disposable as re, Direction as te, FOCUSING_FX_BAR_EDITOR as _n, EDITOR_ACTIVATED as vn, FOCUSING_PANEL_EDITOR as Sn, Tools as ge, UserManagerService as In, IPermissionService as Cn, Rectangle as Rn, LifecycleService as Dn, LifecycleStages as Mn, DisposableCollection as bn, fromEventSubject as yn, generateRandomId as On, DependentOn as Pn, Plugin as Tn, registerDependencies as En, touchDependencies as Xe, IConfigService as Un } from "@univerjs/core";
|
|
5
|
+
import { IDrawingManagerService as K, IImageIoService as Dt, DrawingTypeEnum as k, ArrangeTypeEnum as ve, DRAWING_IMAGE_ALLOW_IMAGE_LIST as An, DRAWING_IMAGE_COUNT_LIMIT as mt, ImageUploadStatusType as He, DRAWING_IMAGE_ALLOW_SIZE as Nn, getImageSize as jn, DRAWING_IMAGE_WIDTH_LIMIT as ft, DRAWING_IMAGE_HEIGHT_LIMIT as pt, getDrawingShapeKeyByDrawingSearch as ze, UniverDrawingPlugin as xn } from "@univerjs/drawing";
|
|
6
|
+
import { ImageCropperObject as Ln, COMPONENT_IMAGE_POPUP_MENU as $n, OpenImageCropOperation as Bn, ImageResetSizeOperation as Wn, DrawingCommonPanel as Gn, DrawingRenderService as Vn, UniverDrawingUIPlugin as kn } from "@univerjs/drawing-ui";
|
|
7
|
+
import { IRenderManagerService as J, precisionTo as ne, getGroupState as Yn, transformObjectOutOfGroup as Fn, RENDER_CLASS_TYPE as de, Rect as wt, ObjectType as Xn, DRAWING_OBJECT_LAYER_INDEX as Hn, SHEET_VIEWPORT_KEY as zn } from "@univerjs/engine-render";
|
|
8
|
+
import { ISheetDrawingService as F, SetDrawingApplyMutation as P, DrawingApplyType as T, SheetDrawingAnchorType as y, UniverSheetsDrawingPlugin as Kn } from "@univerjs/sheets-drawing";
|
|
9
|
+
import { SheetCanvasPopManagerService as Jn, attachRangeWithCoord as Te, ISheetSelectionRenderService as pe, SheetSkeletonManagerService as q, getCurrentRangeDisable$ as Zn, COPY_TYPE as _t, PREDEFINED_HOOK_NAME as Se, virtualizeDiscreteRanges as qn, ISheetClipboardService as Qn, SheetPrintInterceptorService as er, VIEWPORT_KEY as tr, SetZoomRatioOperation as nr } from "@univerjs/sheets-ui";
|
|
10
|
+
import { ISidebarService as rr, IUIPartsService as ir, BuiltInUIPart as sr, ILocalFileService as or, IMessageService as ar, MenuItemType as Mt, getMenuHiddenObservable as bt, RibbonStartGroup as cr, KeyCode as le, ComponentManager as dr, IMenuManagerService as lr, IShortcutService as ur, CanvasFloatDomService as hr } from "@univerjs/ui";
|
|
11
|
+
import { takeUntil as vt, combineLatest as Ie, map as Ee, filter as ae, distinctUntilChanged as Ce, Subject as Ke, take as gr, BehaviorSubject as mr, switchMap as fr } from "rxjs";
|
|
12
|
+
import { SheetInterceptorService as at, getSheetCommandTarget as ce, SheetsSelectionsService as pr, WorkbookEditablePermission as tt, WorksheetEditPermission as Pe, RangeProtectionPermissionEditPoint as wr, WorkbookViewPermission as St, WorksheetViewPermission as Je, InsertRowCommand as yt, InsertColCommand as Ot, RemoveRowCommand as Pt, RemoveColCommand as Tt, DeleteRangeMoveLeftCommand as Et, DeleteRangeMoveUpCommand as Ut, InsertRangeMoveDownCommand as At, InsertRangeMoveRightCommand as Nt, DeltaRowHeightCommand as nt, SetRowHeightCommand as rt, DeltaColumnWidthCommand as jt, SetColWidthCommand as xt, SetRowHiddenCommand as Lt, SetSpecificRowsVisibleCommand as $t, SetSpecificColsVisibleCommand as Bt, SetColHiddenCommand as Wt, MoveColsCommand as Gt, MoveRowsCommand as Vt, MoveRangeCommand as kt, SetRowVisibleMutation as _r, SetRowHiddenMutation as vr, SetColVisibleMutation as Sr, SetColHiddenMutation as Ir, SetWorksheetRowHeightMutation as Cr, SetWorksheetColWidthMutation as Rr, SetWorksheetActiveOperation as Dr, SetFrozenMutation as Mr } from "@univerjs/sheets";
|
|
13
|
+
import Yt, { useEffect as ct, forwardRef as Ft, useRef as br, createElement as Xt, useState as it } from "react";
|
|
14
|
+
import { MessageType as Re, RadioGroup as yr, Radio as Ze } from "@univerjs/design";
|
|
15
|
+
const Or = "sheets-drawing-ui.config", Pr = {}, j = {
|
|
17
16
|
id: "sheet.operation.clear-drawing-transformer",
|
|
18
17
|
type: H.MUTATION,
|
|
19
18
|
handler: (i, e) => {
|
|
20
|
-
const
|
|
21
|
-
return e.forEach((
|
|
19
|
+
const n = i.get(J);
|
|
20
|
+
return e.forEach((t) => {
|
|
22
21
|
var r, s;
|
|
23
|
-
(s = (r =
|
|
22
|
+
(s = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
|
|
24
23
|
}), !0;
|
|
25
24
|
}
|
|
26
|
-
},
|
|
25
|
+
}, Ge = {
|
|
27
26
|
id: "sheet.command.remove-sheet-image",
|
|
28
27
|
type: H.COMMAND,
|
|
29
28
|
handler: (i, e) => {
|
|
30
29
|
var S, v, R;
|
|
31
|
-
const
|
|
30
|
+
const n = i.get(W), t = i.get(ue), r = i.get(at), s = i.get(F);
|
|
32
31
|
if (!e) return !1;
|
|
33
32
|
const { drawings: o } = e, d = [];
|
|
34
33
|
o.forEach((_) => {
|
|
35
34
|
const { unitId: C } = _;
|
|
36
35
|
d.push(C);
|
|
37
36
|
});
|
|
38
|
-
const l = s.getBatchRemoveOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = r.onCommandExecute({ id:
|
|
39
|
-
return It([...(S = m.preRedos) != null ? S : [], f, ...m.redos],
|
|
37
|
+
const l = s.getBatchRemoveOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = r.onCommandExecute({ id: Ge.id, params: e }), f = { id: P.id, params: { unitId: g, subUnitId: c, op: h, objects: u, type: T.REMOVE } }, p = { id: P.id, params: { unitId: g, subUnitId: c, op: a, objects: u, type: T.INSERT } };
|
|
38
|
+
return It([...(S = m.preRedos) != null ? S : [], f, ...m.redos], n) ? (t.pushUndoRedo({
|
|
40
39
|
unitID: g,
|
|
41
40
|
undoMutations: [
|
|
42
41
|
...(v = m.preUndos) != null ? v : [],
|
|
@@ -52,17 +51,17 @@ const br = "sheets-drawing-ui.config", yr = {}, j = {
|
|
|
52
51
|
]
|
|
53
52
|
}), !0) : !1;
|
|
54
53
|
}
|
|
55
|
-
},
|
|
54
|
+
}, Ht = "COMPONENT_SHEET_DRAWING_PANEL", zt = {
|
|
56
55
|
id: "sidebar.operation.sheet-image",
|
|
57
56
|
type: H.COMMAND,
|
|
58
57
|
handler: async (i, e) => {
|
|
59
|
-
const
|
|
58
|
+
const n = i.get(rr), t = i.get(We), r = i.get(fe), s = i.get(K);
|
|
60
59
|
if (!ce(r)) return !1;
|
|
61
60
|
switch (e.value) {
|
|
62
61
|
case "open":
|
|
63
|
-
|
|
64
|
-
header: { title:
|
|
65
|
-
children: { label:
|
|
62
|
+
n.open({
|
|
63
|
+
header: { title: t.t("sheetImage.panel.title") },
|
|
64
|
+
children: { label: Ht },
|
|
66
65
|
onClose: () => {
|
|
67
66
|
s.focusDrawing(null);
|
|
68
67
|
},
|
|
@@ -71,84 +70,108 @@ const br = "sheets-drawing-ui.config", yr = {}, j = {
|
|
|
71
70
|
break;
|
|
72
71
|
case "close":
|
|
73
72
|
default:
|
|
74
|
-
|
|
73
|
+
n.close();
|
|
75
74
|
break;
|
|
76
75
|
}
|
|
77
76
|
return !0;
|
|
78
77
|
}
|
|
79
|
-
},
|
|
78
|
+
}, Kt = {
|
|
80
79
|
id: "sheet.operation.edit-sheet-image",
|
|
81
80
|
type: H.OPERATION,
|
|
82
81
|
handler: (i, e) => {
|
|
83
|
-
const
|
|
84
|
-
return e == null ? !1 : (
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
82
|
+
const n = i.get(K), t = i.get(W);
|
|
83
|
+
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(zt.id, { value: "open" }), !0);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var Jt = { exports: {} }, Ve = {};
|
|
87
|
+
/**
|
|
88
|
+
* @license React
|
|
89
|
+
* react-jsx-runtime.production.min.js
|
|
90
|
+
*
|
|
91
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the MIT license found in the
|
|
94
|
+
* LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/
|
|
96
|
+
var Tr = Yt, Er = Symbol.for("react.element"), Ur = Symbol.for("react.fragment"), Ar = Object.prototype.hasOwnProperty, Nr = Tr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, jr = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
97
|
+
function Zt(i, e, n) {
|
|
98
|
+
var t, r = {}, s = null, o = null;
|
|
99
|
+
n !== void 0 && (s = "" + n), e.key !== void 0 && (s = "" + e.key), e.ref !== void 0 && (o = e.ref);
|
|
100
|
+
for (t in e) Ar.call(e, t) && !jr.hasOwnProperty(t) && (r[t] = e[t]);
|
|
101
|
+
if (i && i.defaultProps) for (t in e = i.defaultProps, e) r[t] === void 0 && (r[t] = e[t]);
|
|
102
|
+
return { $$typeof: Er, type: i, key: s, ref: o, props: r, _owner: Nr.current };
|
|
103
|
+
}
|
|
104
|
+
Ve.Fragment = Ur;
|
|
105
|
+
Ve.jsx = Zt;
|
|
106
|
+
Ve.jsxs = Zt;
|
|
107
|
+
Jt.exports = Ve;
|
|
108
|
+
var $ = Jt.exports;
|
|
109
|
+
const xr = "univer-upload-loading", Lr = "univer-upload-loading-body", $r = "univer-upload-loading-body-animation", Br = "univer-UniverCircleAnimation", Wr = "univer-upload-loading-body-text", De = {
|
|
110
|
+
uploadLoading: xr,
|
|
111
|
+
uploadLoadingBody: Lr,
|
|
112
|
+
uploadLoadingBodyAnimation: $r,
|
|
113
|
+
univerCircleAnimation: Br,
|
|
114
|
+
uploadLoadingBodyText: Wr
|
|
115
|
+
}, Gr = () => {
|
|
116
|
+
const i = oe(Dt), e = oe(We), [n, t] = Yt.useState(0);
|
|
94
117
|
return ct(() => {
|
|
95
118
|
const r = i.change$.subscribe((s) => {
|
|
96
|
-
|
|
119
|
+
t(s);
|
|
97
120
|
});
|
|
98
121
|
return () => {
|
|
99
122
|
r.unsubscribe();
|
|
100
123
|
};
|
|
101
|
-
}, [i]), /* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
124
|
+
}, [i]), /* @__PURE__ */ $.jsx("div", { style: { display: n > 0 ? "block" : "none" }, className: De.uploadLoading, children: /* @__PURE__ */ $.jsxs("div", { className: De.uploadLoadingBody, children: [
|
|
125
|
+
/* @__PURE__ */ $.jsx("div", { className: De.uploadLoadingBodyAnimation }),
|
|
126
|
+
/* @__PURE__ */ $.jsx("div", { className: De.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${n}` })
|
|
104
127
|
] }) });
|
|
105
128
|
};
|
|
106
|
-
var
|
|
107
|
-
for (var r =
|
|
108
|
-
(o = i[s]) && (r = (
|
|
109
|
-
return
|
|
110
|
-
}, ie = (i, e) => (
|
|
111
|
-
let
|
|
112
|
-
constructor(e,
|
|
129
|
+
var Vr = Object.defineProperty, kr = Object.getOwnPropertyDescriptor, Yr = (i, e, n, t) => {
|
|
130
|
+
for (var r = t > 1 ? void 0 : t ? kr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
131
|
+
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
132
|
+
return t && r && Vr(e, n, r), r;
|
|
133
|
+
}, ie = (i, e) => (n, t) => e(n, t, i);
|
|
134
|
+
let Ue = class extends fn {
|
|
135
|
+
constructor(e, n, t, r, s, o, d) {
|
|
113
136
|
super();
|
|
114
|
-
|
|
115
|
-
this._injector = e, this._drawingManagerService =
|
|
137
|
+
V(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
138
|
+
this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = d, this._init();
|
|
116
139
|
}
|
|
117
140
|
_init() {
|
|
118
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(vt(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(Y.UNIVER_SHEET).pipe(vt(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(Y.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(
|
|
141
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(vt(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(Y.UNIVER_SHEET).pipe(vt(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(Y.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(sr.CONTENT, () => pn(Gr, this._injector));
|
|
119
142
|
}
|
|
120
143
|
_dispose(e) {
|
|
121
|
-
const
|
|
122
|
-
this._renderManagerService.removeRender(
|
|
144
|
+
const n = e.getUnitId();
|
|
145
|
+
this._renderManagerService.removeRender(n);
|
|
123
146
|
}
|
|
124
147
|
_create(e) {
|
|
125
148
|
if (!e)
|
|
126
149
|
return;
|
|
127
|
-
const
|
|
128
|
-
this._renderManagerService.has(
|
|
150
|
+
const n = e.getUnitId();
|
|
151
|
+
this._renderManagerService.has(n) && !this._initImagePopupMenu.has(n) && (this._popupMenuListener(n), this._initImagePopupMenu.add(n));
|
|
129
152
|
}
|
|
130
153
|
_hasCropObject(e) {
|
|
131
|
-
const
|
|
132
|
-
for (const
|
|
133
|
-
if (
|
|
154
|
+
const n = e.getAllObjectsByOrder();
|
|
155
|
+
for (const t of n)
|
|
156
|
+
if (t instanceof Ln)
|
|
134
157
|
return !0;
|
|
135
158
|
return !1;
|
|
136
159
|
}
|
|
137
160
|
_popupMenuListener(e) {
|
|
138
161
|
var s;
|
|
139
|
-
const
|
|
140
|
-
if (!t)
|
|
141
|
-
return;
|
|
142
|
-
const n = t.getTransformerByCreate();
|
|
162
|
+
const n = (s = this._renderManagerService.getRenderById(e)) == null ? void 0 : s.scene;
|
|
143
163
|
if (!n)
|
|
144
164
|
return;
|
|
165
|
+
const t = n.getTransformerByCreate();
|
|
166
|
+
if (!t)
|
|
167
|
+
return;
|
|
145
168
|
let r;
|
|
146
169
|
this.disposeWithMe(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if (this._contextService.setContextValue(me, !0), this._hasCropObject(
|
|
170
|
+
wn(
|
|
171
|
+
t.createControl$.subscribe(() => {
|
|
172
|
+
if (this._contextService.setContextValue(me, !0), this._hasCropObject(n))
|
|
150
173
|
return;
|
|
151
|
-
const o =
|
|
174
|
+
const o = t.getSelectedObjectMap();
|
|
152
175
|
if (o.size > 1) {
|
|
153
176
|
r == null || r.dispose();
|
|
154
177
|
return;
|
|
@@ -161,7 +184,7 @@ let Ae = class extends hn {
|
|
|
161
184
|
return;
|
|
162
185
|
const { unitId: c, subUnitId: a, drawingId: h, drawingType: u } = g, m = g.data;
|
|
163
186
|
m && m.disablePopup || (r == null || r.dispose(), r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
|
|
164
|
-
componentKey:
|
|
187
|
+
componentKey: $n,
|
|
165
188
|
direction: "horizontal",
|
|
166
189
|
offset: [2, 0],
|
|
167
190
|
extraProps: {
|
|
@@ -175,59 +198,59 @@ let Ae = class extends hn {
|
|
|
175
198
|
})
|
|
176
199
|
)
|
|
177
200
|
), this.disposeWithMe(
|
|
178
|
-
|
|
201
|
+
t.clearControl$.subscribe(() => {
|
|
179
202
|
r == null || r.dispose(), this._contextService.setContextValue(me, !1), this._drawingManagerService.focusDrawing(null);
|
|
180
203
|
})
|
|
181
204
|
), this.disposeWithMe(
|
|
182
|
-
|
|
205
|
+
t.changing$.subscribe(() => {
|
|
183
206
|
r == null || r.dispose();
|
|
184
207
|
})
|
|
185
208
|
);
|
|
186
209
|
}
|
|
187
|
-
_getImageMenuItems(e,
|
|
210
|
+
_getImageMenuItems(e, n, t, r) {
|
|
188
211
|
return [
|
|
189
212
|
{
|
|
190
213
|
label: "image-popup.edit",
|
|
191
214
|
index: 0,
|
|
192
|
-
commandId:
|
|
193
|
-
commandParams: { unitId: e, subUnitId:
|
|
215
|
+
commandId: Kt.id,
|
|
216
|
+
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
194
217
|
disable: r === k.DRAWING_DOM
|
|
195
218
|
},
|
|
196
219
|
{
|
|
197
220
|
label: "image-popup.delete",
|
|
198
221
|
index: 1,
|
|
199
|
-
commandId:
|
|
200
|
-
commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId:
|
|
222
|
+
commandId: Ge.id,
|
|
223
|
+
commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
|
|
201
224
|
disable: !1
|
|
202
225
|
},
|
|
203
226
|
{
|
|
204
227
|
label: "image-popup.crop",
|
|
205
228
|
index: 2,
|
|
206
229
|
commandId: Bn.id,
|
|
207
|
-
commandParams: { unitId: e, subUnitId:
|
|
230
|
+
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
208
231
|
disable: r === k.DRAWING_DOM
|
|
209
232
|
},
|
|
210
233
|
{
|
|
211
234
|
label: "image-popup.reset",
|
|
212
235
|
index: 3,
|
|
213
|
-
commandId:
|
|
214
|
-
commandParams: [{ unitId: e, subUnitId:
|
|
236
|
+
commandId: Wn.id,
|
|
237
|
+
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
215
238
|
disable: r === k.DRAWING_DOM
|
|
216
239
|
}
|
|
217
240
|
];
|
|
218
241
|
}
|
|
219
242
|
};
|
|
220
|
-
|
|
221
|
-
ie(0,
|
|
243
|
+
Ue = Yr([
|
|
244
|
+
ie(0, x(Ct)),
|
|
222
245
|
ie(1, K),
|
|
223
|
-
ie(2,
|
|
246
|
+
ie(2, x(Jn)),
|
|
224
247
|
ie(3, J),
|
|
225
248
|
ie(4, fe),
|
|
226
249
|
ie(5, Rt),
|
|
227
|
-
ie(6,
|
|
228
|
-
],
|
|
229
|
-
function
|
|
230
|
-
const { from:
|
|
250
|
+
ie(6, x(ir))
|
|
251
|
+
], Ue);
|
|
252
|
+
function B(i, e, n) {
|
|
253
|
+
const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: d = 0, skewX: l = 0, skewY: g = 0 } = i, { column: c, columnOffset: a, row: h, rowOffset: u } = t, { column: m, columnOffset: f, row: p, rowOffset: I } = r, S = n.getCurrentSkeleton(), v = Te(S, {
|
|
231
254
|
startColumn: c,
|
|
232
255
|
endColumn: c,
|
|
233
256
|
startRow: h,
|
|
@@ -260,22 +283,22 @@ function $(i, e, t) {
|
|
|
260
283
|
};
|
|
261
284
|
}
|
|
262
285
|
function N(i, e) {
|
|
263
|
-
const { left:
|
|
286
|
+
const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: d = !1, angle: l = 0, skewX: g = 0, skewY: c = 0 } = i, a = e.getSelectionCellByPosition(n, t);
|
|
264
287
|
if (a == null)
|
|
265
288
|
return;
|
|
266
289
|
const h = {
|
|
267
290
|
column: a.actualColumn,
|
|
268
|
-
columnOffset: ne(
|
|
291
|
+
columnOffset: ne(n - a.startX, 1),
|
|
269
292
|
row: a.actualRow,
|
|
270
|
-
rowOffset: ne(
|
|
271
|
-
}, u = e.getSelectionCellByPosition(
|
|
293
|
+
rowOffset: ne(t - a.startY, 1)
|
|
294
|
+
}, u = e.getSelectionCellByPosition(n + r, t + s);
|
|
272
295
|
if (u == null)
|
|
273
296
|
return;
|
|
274
297
|
const m = {
|
|
275
298
|
column: u.actualColumn,
|
|
276
|
-
columnOffset: ne(
|
|
299
|
+
columnOffset: ne(n + r - u.startX, 1),
|
|
277
300
|
row: u.actualRow,
|
|
278
|
-
rowOffset: ne(
|
|
301
|
+
rowOffset: ne(t + s - u.startY, 1)
|
|
279
302
|
};
|
|
280
303
|
return {
|
|
281
304
|
flipY: o,
|
|
@@ -287,14 +310,14 @@ function N(i, e) {
|
|
|
287
310
|
to: m
|
|
288
311
|
};
|
|
289
312
|
}
|
|
290
|
-
var
|
|
291
|
-
for (var r =
|
|
292
|
-
(o = i[s]) && (r = (
|
|
293
|
-
return
|
|
294
|
-
}, Me = (i, e) => (
|
|
313
|
+
var Fr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, Hr = (i, e, n, t) => {
|
|
314
|
+
for (var r = t > 1 ? void 0 : t ? Xr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
315
|
+
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
316
|
+
return t && r && Fr(e, n, r), r;
|
|
317
|
+
}, Me = (i, e) => (n, t) => e(n, t, i);
|
|
295
318
|
let st = class extends re {
|
|
296
|
-
constructor(i, e,
|
|
297
|
-
super(), this._context = i, this._sheetDrawingService = e, this._drawingManagerService =
|
|
319
|
+
constructor(i, e, n, t, r) {
|
|
320
|
+
super(), this._context = i, this._sheetDrawingService = e, this._drawingManagerService = n, this._sheetSelectionRenderService = t, this._sheetSkeletonManagerService = r, this._init();
|
|
298
321
|
}
|
|
299
322
|
_init() {
|
|
300
323
|
this._drawingInitializeListener();
|
|
@@ -303,80 +326,80 @@ let st = class extends re {
|
|
|
303
326
|
this._sheetDrawingService.initializeNotification(this._context.unitId);
|
|
304
327
|
const i = this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId);
|
|
305
328
|
for (const e in i) {
|
|
306
|
-
const
|
|
307
|
-
for (const
|
|
308
|
-
const r =
|
|
309
|
-
r.transform =
|
|
329
|
+
const n = i[e];
|
|
330
|
+
for (const t in n.data) {
|
|
331
|
+
const r = n.data[t];
|
|
332
|
+
r.transform = B(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
|
|
310
333
|
}
|
|
311
334
|
}
|
|
312
335
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
313
336
|
}
|
|
314
337
|
};
|
|
315
|
-
st =
|
|
338
|
+
st = Hr([
|
|
316
339
|
Me(1, F),
|
|
317
340
|
Me(2, K),
|
|
318
|
-
Me(3,
|
|
319
|
-
Me(4,
|
|
341
|
+
Me(3, x(pe)),
|
|
342
|
+
Me(4, x(q))
|
|
320
343
|
], st);
|
|
321
344
|
var X = function() {
|
|
322
345
|
return X = Object.assign || function(i) {
|
|
323
|
-
for (var e,
|
|
324
|
-
e = arguments[
|
|
346
|
+
for (var e, n = 1, t = arguments.length; n < t; n++) {
|
|
347
|
+
e = arguments[n];
|
|
325
348
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
|
|
326
349
|
}
|
|
327
350
|
return i;
|
|
328
351
|
}, X.apply(this, arguments);
|
|
329
|
-
},
|
|
330
|
-
var
|
|
331
|
-
for (var
|
|
352
|
+
}, zr = function(i, e) {
|
|
353
|
+
var n = {};
|
|
354
|
+
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
|
|
332
355
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
333
|
-
for (var r = 0,
|
|
334
|
-
e.indexOf(
|
|
335
|
-
return
|
|
336
|
-
},
|
|
337
|
-
var
|
|
338
|
-
return
|
|
356
|
+
for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
|
|
357
|
+
e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
|
|
358
|
+
return n;
|
|
359
|
+
}, qt = Ft(function(i, e) {
|
|
360
|
+
var n = i.icon, t = i.id, r = i.className, s = i.extend, o = zr(i, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), l = br("_".concat(Zr()));
|
|
361
|
+
return Qt(n, "".concat(t), { defIds: n.defIds, idSuffix: l.current }, X({ ref: e, className: d }, o), s);
|
|
339
362
|
});
|
|
340
|
-
function
|
|
341
|
-
return
|
|
342
|
-
return
|
|
363
|
+
function Qt(i, e, n, t, r) {
|
|
364
|
+
return Xt(i.tag, X(X({ key: e }, Kr(i, n, r)), t), (Jr(i, n).children || []).map(function(s, o) {
|
|
365
|
+
return Qt(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
|
|
343
366
|
}));
|
|
344
367
|
}
|
|
345
|
-
function
|
|
346
|
-
var
|
|
347
|
-
|
|
368
|
+
function Kr(i, e, n) {
|
|
369
|
+
var t = X({}, i.attrs);
|
|
370
|
+
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
|
|
348
371
|
var r = e.defIds;
|
|
349
|
-
return !r || r.length === 0 || (i.tag === "use" &&
|
|
372
|
+
return !r || r.length === 0 || (i.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + e.idSuffix), Object.entries(t).forEach(function(s) {
|
|
350
373
|
var o = s[0], d = s[1];
|
|
351
|
-
typeof d == "string" && (
|
|
352
|
-
})),
|
|
374
|
+
typeof d == "string" && (t[o] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
375
|
+
})), t;
|
|
353
376
|
}
|
|
354
|
-
function
|
|
355
|
-
var
|
|
356
|
-
return !
|
|
357
|
-
return typeof r.attrs.id == "string" &&
|
|
377
|
+
function Jr(i, e) {
|
|
378
|
+
var n, t = e.defIds;
|
|
379
|
+
return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? X(X({}, i), { children: i.children.map(function(r) {
|
|
380
|
+
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? X(X({}, r), { attrs: X(X({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
358
381
|
}) }) : i;
|
|
359
382
|
}
|
|
360
|
-
function
|
|
383
|
+
function Zr() {
|
|
361
384
|
return Math.random().toString(36).substring(2, 8);
|
|
362
385
|
}
|
|
363
|
-
|
|
364
|
-
var
|
|
365
|
-
return
|
|
386
|
+
qt.displayName = "UniverIcon";
|
|
387
|
+
var qr = { 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" } }] }, en = Ft(function(i, e) {
|
|
388
|
+
return Xt(qt, Object.assign({}, i, {
|
|
366
389
|
id: "add-image-single",
|
|
367
390
|
ref: e,
|
|
368
|
-
icon:
|
|
391
|
+
icon: qr
|
|
369
392
|
}));
|
|
370
393
|
});
|
|
371
|
-
|
|
372
|
-
const
|
|
394
|
+
en.displayName = "AddImageSingle";
|
|
395
|
+
const tn = {
|
|
373
396
|
id: "sheet.command.delete-drawing",
|
|
374
397
|
type: H.COMMAND,
|
|
375
398
|
handler: (i) => {
|
|
376
|
-
const e = i.get(W),
|
|
377
|
-
if (
|
|
399
|
+
const e = i.get(W), t = i.get(F).getFocusDrawings();
|
|
400
|
+
if (t.length === 0)
|
|
378
401
|
return !1;
|
|
379
|
-
const r =
|
|
402
|
+
const r = t[0].unitId, s = t.map((o) => {
|
|
380
403
|
const { unitId: d, subUnitId: l, drawingId: g, drawingType: c } = o;
|
|
381
404
|
return {
|
|
382
405
|
unitId: d,
|
|
@@ -385,16 +408,16 @@ const qt = {
|
|
|
385
408
|
drawingType: c
|
|
386
409
|
};
|
|
387
410
|
});
|
|
388
|
-
return e.executeCommand(
|
|
411
|
+
return e.executeCommand(Ge.id, {
|
|
389
412
|
unitId: r,
|
|
390
413
|
drawings: s
|
|
391
414
|
});
|
|
392
415
|
}
|
|
393
416
|
};
|
|
394
|
-
function
|
|
417
|
+
function Qr(i) {
|
|
395
418
|
const e = [];
|
|
396
|
-
return i.forEach((
|
|
397
|
-
const { parent:
|
|
419
|
+
return i.forEach((n) => {
|
|
420
|
+
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d } = t, l = Yn(0, 0, r.map((a) => a.transform || {})), g = r.map((a) => {
|
|
398
421
|
const h = a.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: m, drawingId: f } = a;
|
|
399
422
|
return {
|
|
400
423
|
unitId: u,
|
|
@@ -420,14 +443,14 @@ function Fr(i) {
|
|
|
420
443
|
});
|
|
421
444
|
}), e;
|
|
422
445
|
}
|
|
423
|
-
function
|
|
446
|
+
function ei(i) {
|
|
424
447
|
const e = [];
|
|
425
|
-
return i.forEach((
|
|
426
|
-
const { parent:
|
|
448
|
+
return i.forEach((n) => {
|
|
449
|
+
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d, transform: l = { width: 0, height: 0 } } = t;
|
|
427
450
|
if (l == null)
|
|
428
451
|
return;
|
|
429
452
|
const g = r.map((a) => {
|
|
430
|
-
const { transform: h } = a, { unitId: u, subUnitId: m, drawingId: f } = a, p =
|
|
453
|
+
const { transform: h } = a, { unitId: u, subUnitId: m, drawingId: f } = a, p = Fn(h || {}, l, l.width || 0, l.height || 0);
|
|
431
454
|
return {
|
|
432
455
|
unitId: u,
|
|
433
456
|
subUnitId: m,
|
|
@@ -451,11 +474,11 @@ function Xr(i) {
|
|
|
451
474
|
});
|
|
452
475
|
}), e;
|
|
453
476
|
}
|
|
454
|
-
const
|
|
477
|
+
const nn = {
|
|
455
478
|
id: "sheet.command.group-sheet-image",
|
|
456
479
|
type: H.COMMAND,
|
|
457
480
|
handler: (i, e) => {
|
|
458
|
-
const
|
|
481
|
+
const n = i.get(W), t = i.get(ue), r = i.get(F);
|
|
459
482
|
if (!e) return !1;
|
|
460
483
|
const s = [];
|
|
461
484
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -464,10 +487,10 @@ const Qt = {
|
|
|
464
487
|
});
|
|
465
488
|
});
|
|
466
489
|
const o = r.getGroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
|
|
467
|
-
return
|
|
490
|
+
return n.syncExecuteCommand(P.id, { op: c, unitId: d, subUnitId: l, objects: a, type: T.GROUP }) ? (t.pushUndoRedo({
|
|
468
491
|
unitID: d,
|
|
469
492
|
undoMutations: [
|
|
470
|
-
{ id: P.id, params: { op: g, unitId: d, subUnitId: l, objects:
|
|
493
|
+
{ id: P.id, params: { op: g, unitId: d, subUnitId: l, objects: ei(a), type: T.UNGROUP } },
|
|
471
494
|
{ id: j.id, params: s }
|
|
472
495
|
],
|
|
473
496
|
redoMutations: [
|
|
@@ -481,10 +504,10 @@ const Qt = {
|
|
|
481
504
|
type: H.COMMAND,
|
|
482
505
|
handler: (i, e) => {
|
|
483
506
|
var S, v, R;
|
|
484
|
-
const
|
|
507
|
+
const n = i.get(W), t = i.get(ue), r = i.get(F), s = i.get(at);
|
|
485
508
|
if (!e) return !1;
|
|
486
509
|
const o = e.drawings, d = o.map((_) => _.unitId), l = r.getBatchAddOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = s.onCommandExecute({ id: ke.id, params: e }), f = { id: P.id, params: { op: h, unitId: g, subUnitId: c, objects: u, type: T.INSERT } }, p = { id: P.id, params: { op: a, unitId: g, subUnitId: c, objects: u, type: T.REMOVE } };
|
|
487
|
-
return It([...(S = m.preRedos) != null ? S : [], f, ...m.redos],
|
|
510
|
+
return It([...(S = m.preRedos) != null ? S : [], f, ...m.redos], n) ? (t.pushUndoRedo({
|
|
488
511
|
unitID: g,
|
|
489
512
|
undoMutations: [
|
|
490
513
|
...(v = m.preUndos) != null ? v : [],
|
|
@@ -500,18 +523,18 @@ const Qt = {
|
|
|
500
523
|
]
|
|
501
524
|
}), !0) : !1;
|
|
502
525
|
}
|
|
503
|
-
},
|
|
526
|
+
}, rn = {
|
|
504
527
|
id: "sheet.command.set-drawing-arrange",
|
|
505
528
|
type: H.COMMAND,
|
|
506
529
|
handler: (i, e) => {
|
|
507
|
-
const
|
|
530
|
+
const n = i.get(W), t = i.get(ue);
|
|
508
531
|
if (!e) return !1;
|
|
509
532
|
const r = i.get(F), { unitId: s, subUnitId: o, drawingIds: d, arrangeType: l } = e, g = { unitId: s, subUnitId: o, drawingIds: d };
|
|
510
533
|
let c;
|
|
511
534
|
if (l === ve.forward ? c = r.getForwardDrawingsOp(g) : l === ve.backward ? c = r.getBackwardDrawingOp(g) : l === ve.front ? c = r.getFrontDrawingsOp(g) : l === ve.back && (c = r.getBackDrawingsOp(g)), c == null)
|
|
512
535
|
return !1;
|
|
513
536
|
const { objects: a, redo: h, undo: u } = c;
|
|
514
|
-
return
|
|
537
|
+
return n.syncExecuteCommand(P.id, { op: h, unitId: s, subUnitId: o, objects: a, type: T.ARRANGE }) ? (t.pushUndoRedo({
|
|
515
538
|
unitID: s,
|
|
516
539
|
undoMutations: [
|
|
517
540
|
{ id: P.id, params: { op: u, unitId: s, subUnitId: o, objects: a, type: T.ARRANGE } }
|
|
@@ -525,10 +548,10 @@ const Qt = {
|
|
|
525
548
|
id: "sheet.command.set-sheet-image",
|
|
526
549
|
type: H.COMMAND,
|
|
527
550
|
handler: (i, e) => {
|
|
528
|
-
const
|
|
551
|
+
const n = i.get(W), t = i.get(ue), r = i.get(F);
|
|
529
552
|
if (!e) return !1;
|
|
530
553
|
const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
|
|
531
|
-
return
|
|
554
|
+
return n.syncExecuteCommand(P.id, { unitId: d, subUnitId: l, op: c, objects: a, type: T.UPDATE }) ? (t.pushUndoRedo({
|
|
532
555
|
unitID: d,
|
|
533
556
|
undoMutations: [
|
|
534
557
|
{ id: P.id, params: { unitId: d, subUnitId: l, op: g, objects: a, type: T.UPDATE } },
|
|
@@ -540,11 +563,11 @@ const Qt = {
|
|
|
540
563
|
]
|
|
541
564
|
}), !0) : !1;
|
|
542
565
|
}
|
|
543
|
-
},
|
|
566
|
+
}, sn = {
|
|
544
567
|
id: "sheet.command.ungroup-sheet-image",
|
|
545
568
|
type: H.COMMAND,
|
|
546
569
|
handler: (i, e) => {
|
|
547
|
-
const
|
|
570
|
+
const n = i.get(W), t = i.get(ue), r = i.get(F);
|
|
548
571
|
if (!e) return !1;
|
|
549
572
|
const s = [];
|
|
550
573
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -553,10 +576,10 @@ const Qt = {
|
|
|
553
576
|
});
|
|
554
577
|
});
|
|
555
578
|
const o = r.getUngroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
|
|
556
|
-
return
|
|
579
|
+
return n.syncExecuteCommand(P.id, { op: c, unitId: d, subUnitId: l, objects: a, type: T.UNGROUP }) ? (t.pushUndoRedo({
|
|
557
580
|
unitID: d,
|
|
558
581
|
undoMutations: [
|
|
559
|
-
{ id: P.id, params: { op: g, unitId: d, subUnitId: l, objects:
|
|
582
|
+
{ id: P.id, params: { op: g, unitId: d, subUnitId: l, objects: Qr(a), type: T.GROUP } },
|
|
560
583
|
{ id: j.id, params: s }
|
|
561
584
|
],
|
|
562
585
|
redoMutations: [
|
|
@@ -566,36 +589,36 @@ const Qt = {
|
|
|
566
589
|
}), !0) : !1;
|
|
567
590
|
}
|
|
568
591
|
};
|
|
569
|
-
var
|
|
570
|
-
for (var r =
|
|
571
|
-
(o = i[s]) && (r = (
|
|
572
|
-
return
|
|
573
|
-
}, z = (i, e) => (
|
|
574
|
-
let
|
|
575
|
-
constructor(e,
|
|
592
|
+
var ti = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, ri = (i, e, n, t) => {
|
|
593
|
+
for (var r = t > 1 ? void 0 : t ? ni(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
594
|
+
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
595
|
+
return t && r && ti(e, n, r), r;
|
|
596
|
+
}, z = (i, e) => (n, t) => e(n, t, i);
|
|
597
|
+
let Ae = class extends re {
|
|
598
|
+
constructor(e, n, t, r, s, o, d, l, g, c, a, h) {
|
|
576
599
|
super();
|
|
577
|
-
|
|
578
|
-
this._context = e, this._skeletonManagerService =
|
|
600
|
+
V(this, "_workbookSelections");
|
|
601
|
+
this._context = e, this._skeletonManagerService = n, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = d, this._drawingManagerService = l, this._contextService = g, this._messageService = c, this._localeService = a, this._workbookSelections = h.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
|
|
579
602
|
}
|
|
580
603
|
async insertFloatImage() {
|
|
581
604
|
const e = await this._fileOpenerService.openFile({
|
|
582
605
|
multiple: !0,
|
|
583
|
-
accept:
|
|
584
|
-
}),
|
|
585
|
-
return
|
|
606
|
+
accept: An.map((t) => `.${t.replace("image/", "")}`).join(",")
|
|
607
|
+
}), n = e.length;
|
|
608
|
+
return n > mt ? (this._messageService.show({
|
|
586
609
|
type: Re.Error,
|
|
587
610
|
content: this._localeService.t("update-status.exceedMaxCount", String(mt))
|
|
588
|
-
}), !1) :
|
|
611
|
+
}), !1) : n === 0 ? !1 : (e.forEach(async (t) => await this._insertFloatImage(t)), !0);
|
|
589
612
|
}
|
|
590
613
|
async _insertFloatImage(e) {
|
|
591
|
-
let
|
|
614
|
+
let n;
|
|
592
615
|
try {
|
|
593
|
-
|
|
616
|
+
n = await this._imageIoService.saveImage(e);
|
|
594
617
|
} catch (S) {
|
|
595
618
|
const v = S.message;
|
|
596
619
|
v === He.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
597
620
|
type: Re.Error,
|
|
598
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
621
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Nn / (1024 * 1024)))
|
|
599
622
|
}) : v === He.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
600
623
|
type: Re.Error,
|
|
601
624
|
content: this._localeService.t("update-status.invalidImageType")
|
|
@@ -604,9 +627,9 @@ let Ne = class extends re {
|
|
|
604
627
|
content: this._localeService.t("update-status.invalidImage")
|
|
605
628
|
});
|
|
606
629
|
}
|
|
607
|
-
if (
|
|
630
|
+
if (n == null)
|
|
608
631
|
return;
|
|
609
|
-
const
|
|
632
|
+
const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: d, source: l, base64Cache: g } = n, { width: c, height: a, image: h } = await jn(g || ""), { width: u, height: m } = this._context.scene;
|
|
610
633
|
this._imageIoService.addImageSourceCache(l, d, h);
|
|
611
634
|
let f = 1;
|
|
612
635
|
if (c > ft || a > pt) {
|
|
@@ -623,7 +646,7 @@ let Ne = class extends re {
|
|
|
623
646
|
drawingType: k.DRAWING_IMAGE,
|
|
624
647
|
imageSourceType: d,
|
|
625
648
|
source: l,
|
|
626
|
-
transform:
|
|
649
|
+
transform: B(p, this._selectionRenderService, this._skeletonManagerService),
|
|
627
650
|
sheetTransform: p
|
|
628
651
|
};
|
|
629
652
|
this._commandService.executeCommand(ke.id, {
|
|
@@ -632,13 +655,13 @@ let Ne = class extends re {
|
|
|
632
655
|
});
|
|
633
656
|
}
|
|
634
657
|
_getUnitInfo() {
|
|
635
|
-
const e = this._context.unit,
|
|
658
|
+
const e = this._context.unit, n = e.getActiveSheet(), t = e.getUnitId(), r = n.getSheetId();
|
|
636
659
|
return {
|
|
637
|
-
unitId:
|
|
660
|
+
unitId: t,
|
|
638
661
|
subUnitId: r
|
|
639
662
|
};
|
|
640
663
|
}
|
|
641
|
-
_getImagePosition(e,
|
|
664
|
+
_getImagePosition(e, n, t, r) {
|
|
642
665
|
const s = this._workbookSelections.getCurrentSelections();
|
|
643
666
|
let o = {
|
|
644
667
|
startRow: 0,
|
|
@@ -651,7 +674,7 @@ let Ne = class extends re {
|
|
|
651
674
|
if (d == null)
|
|
652
675
|
return;
|
|
653
676
|
let { startColumn: l, startRow: g, startX: c, startY: a } = d, h = !1;
|
|
654
|
-
if (c + e >
|
|
677
|
+
if (c + e > t && (c = t - e, c < 0 && (c = 0, e = t), h = !0), a + n > r && (a = r - n, a < 0 && (a = 0, n = r), h = !0), h) {
|
|
655
678
|
const p = this._selectionRenderService.getSelectionCellByPosition(c, a);
|
|
656
679
|
if (p == null)
|
|
657
680
|
return;
|
|
@@ -662,14 +685,14 @@ let Ne = class extends re {
|
|
|
662
685
|
columnOffset: 0,
|
|
663
686
|
row: g,
|
|
664
687
|
rowOffset: 0
|
|
665
|
-
}, m = this._selectionRenderService.getSelectionCellByPosition(c + e, a +
|
|
688
|
+
}, m = this._selectionRenderService.getSelectionCellByPosition(c + e, a + n);
|
|
666
689
|
if (m == null)
|
|
667
690
|
return;
|
|
668
691
|
const f = {
|
|
669
692
|
column: m.actualColumn,
|
|
670
693
|
columnOffset: c + e - m.startX,
|
|
671
694
|
row: m.actualRow,
|
|
672
|
-
rowOffset: a +
|
|
695
|
+
rowOffset: a + n - m.startY
|
|
673
696
|
};
|
|
674
697
|
return {
|
|
675
698
|
from: u,
|
|
@@ -678,10 +701,10 @@ let Ne = class extends re {
|
|
|
678
701
|
}
|
|
679
702
|
_updateOrderListener() {
|
|
680
703
|
this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
|
|
681
|
-
const { unitId:
|
|
682
|
-
this._commandService.executeCommand(
|
|
683
|
-
unitId:
|
|
684
|
-
subUnitId:
|
|
704
|
+
const { unitId: n, subUnitId: t, drawingIds: r, arrangeType: s } = e;
|
|
705
|
+
this._commandService.executeCommand(rn.id, {
|
|
706
|
+
unitId: n,
|
|
707
|
+
subUnitId: t,
|
|
685
708
|
drawingIds: r,
|
|
686
709
|
arrangeType: s
|
|
687
710
|
});
|
|
@@ -689,9 +712,9 @@ let Ne = class extends re {
|
|
|
689
712
|
}
|
|
690
713
|
_updateImageListener() {
|
|
691
714
|
this._drawingManagerService.featurePluginUpdate$.subscribe((e) => {
|
|
692
|
-
const
|
|
693
|
-
e.length !== 0 && (e.forEach((
|
|
694
|
-
const { unitId: r, subUnitId: s, drawingId: o, drawingType: d, transform: l } =
|
|
715
|
+
const n = [];
|
|
716
|
+
e.length !== 0 && (e.forEach((t) => {
|
|
717
|
+
const { unitId: r, subUnitId: s, drawingId: o, drawingType: d, transform: l } = t;
|
|
695
718
|
if (l == null)
|
|
696
719
|
return;
|
|
697
720
|
const g = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
|
|
@@ -701,24 +724,24 @@ let Ne = class extends re {
|
|
|
701
724
|
if (c == null)
|
|
702
725
|
return;
|
|
703
726
|
const a = {
|
|
704
|
-
...
|
|
705
|
-
transform: { ...g.transform, ...l,
|
|
727
|
+
...t,
|
|
728
|
+
transform: { ...g.transform, ...l, ...B(c, this._selectionRenderService, this._skeletonManagerService) },
|
|
706
729
|
sheetTransform: { ...c }
|
|
707
730
|
};
|
|
708
|
-
|
|
709
|
-
}),
|
|
731
|
+
n.push(a);
|
|
732
|
+
}), n.length > 0 && this._commandService.executeCommand(Ye.id, {
|
|
710
733
|
unitId: e[0].unitId,
|
|
711
|
-
drawings:
|
|
734
|
+
drawings: n
|
|
712
735
|
}));
|
|
713
736
|
});
|
|
714
737
|
}
|
|
715
738
|
_groupDrawingListener() {
|
|
716
739
|
this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
|
|
717
|
-
this._commandService.executeCommand(
|
|
718
|
-
const { unitId:
|
|
719
|
-
this._drawingManagerService.focusDrawing([{ unitId:
|
|
740
|
+
this._commandService.executeCommand(nn.id, e);
|
|
741
|
+
const { unitId: n, subUnitId: t, drawingId: r } = e[0].parent;
|
|
742
|
+
this._drawingManagerService.focusDrawing([{ unitId: n, subUnitId: t, drawingId: r }]);
|
|
720
743
|
}), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
|
|
721
|
-
this._commandService.executeCommand(
|
|
744
|
+
this._commandService.executeCommand(sn.id, e);
|
|
722
745
|
});
|
|
723
746
|
}
|
|
724
747
|
_focusDrawingListener() {
|
|
@@ -729,31 +752,31 @@ let Ne = class extends re {
|
|
|
729
752
|
);
|
|
730
753
|
}
|
|
731
754
|
};
|
|
732
|
-
|
|
733
|
-
z(1,
|
|
755
|
+
Ae = ri([
|
|
756
|
+
z(1, x(q)),
|
|
734
757
|
z(2, W),
|
|
735
758
|
z(3, pe),
|
|
736
759
|
z(4, Dt),
|
|
737
|
-
z(5,
|
|
760
|
+
z(5, or),
|
|
738
761
|
z(6, F),
|
|
739
762
|
z(7, K),
|
|
740
763
|
z(8, Rt),
|
|
741
|
-
z(9,
|
|
742
|
-
z(10,
|
|
743
|
-
z(11,
|
|
744
|
-
],
|
|
764
|
+
z(9, ar),
|
|
765
|
+
z(10, x(We)),
|
|
766
|
+
z(11, x(pr))
|
|
767
|
+
], Ae);
|
|
745
768
|
const dt = {
|
|
746
769
|
id: "sheet.command.insert-float-image",
|
|
747
770
|
type: H.COMMAND,
|
|
748
771
|
handler: (i) => {
|
|
749
|
-
var
|
|
750
|
-
return (
|
|
772
|
+
var n, t;
|
|
773
|
+
return (t = (n = i.get(J).getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : n.with(Ae).insertFloatImage()) != null ? t : !1;
|
|
751
774
|
}
|
|
752
775
|
}, we = {
|
|
753
776
|
id: "sheet.command.move-drawing",
|
|
754
777
|
type: H.COMMAND,
|
|
755
778
|
handler: (i, e) => {
|
|
756
|
-
const
|
|
779
|
+
const n = i.get(W), t = i.get(F), r = i.get(pe), { direction: s } = e, o = t.getFocusDrawings();
|
|
757
780
|
if (o.length === 0)
|
|
758
781
|
return !1;
|
|
759
782
|
const d = o[0].unitId, l = o.map((c) => {
|
|
@@ -767,23 +790,23 @@ const dt = {
|
|
|
767
790
|
sheetTransform: N(h, r)
|
|
768
791
|
};
|
|
769
792
|
}).filter((c) => c != null);
|
|
770
|
-
return
|
|
793
|
+
return n.syncExecuteCommand(Ye.id, {
|
|
771
794
|
unitId: d,
|
|
772
795
|
drawings: l
|
|
773
|
-
}) ? (
|
|
796
|
+
}) ? (n.syncExecuteCommand(j.id, [d]), !0) : !1;
|
|
774
797
|
}
|
|
775
|
-
},
|
|
776
|
-
function
|
|
798
|
+
}, on = "addition-and-subtraction-single", an = "sheet.menu.image";
|
|
799
|
+
function ii(i) {
|
|
777
800
|
return {
|
|
778
|
-
id:
|
|
801
|
+
id: an,
|
|
779
802
|
type: Mt.SUBITEMS,
|
|
780
|
-
icon:
|
|
803
|
+
icon: on,
|
|
781
804
|
tooltip: "sheetImage.title",
|
|
782
805
|
hidden$: bt(i, Y.UNIVER_SHEET),
|
|
783
|
-
disabled$:
|
|
806
|
+
disabled$: Zn(i, { workbookTypes: [tt], worksheetTypes: [Pe], rangeTypes: [wr] })
|
|
784
807
|
};
|
|
785
808
|
}
|
|
786
|
-
function
|
|
809
|
+
function si(i) {
|
|
787
810
|
return {
|
|
788
811
|
id: dt.id,
|
|
789
812
|
title: "sheetImage.upload.float",
|
|
@@ -791,39 +814,39 @@ function Zr(i) {
|
|
|
791
814
|
hidden$: bt(i, Y.UNIVER_SHEET)
|
|
792
815
|
};
|
|
793
816
|
}
|
|
794
|
-
const
|
|
795
|
-
imageCommonPanel:
|
|
796
|
-
imageCommonPanelGrid:
|
|
797
|
-
imageCommonPanelBorder:
|
|
798
|
-
imageCommonPanelTitle:
|
|
799
|
-
imageCommonPanelSubtitle:
|
|
800
|
-
imageCommonPanelRow:
|
|
801
|
-
imageCommonPanelRowVertical:
|
|
802
|
-
imageCommonPanelColumn:
|
|
803
|
-
imageCommonPanelColumnCenter:
|
|
804
|
-
imageCommonPanelInline:
|
|
805
|
-
imageCommonPanelSpan2:
|
|
806
|
-
imageCommonPanelSpan3:
|
|
807
|
-
imageCommonPanelInput:
|
|
808
|
-
sheetImageMenu:
|
|
809
|
-
sheetImageMenuInput:
|
|
817
|
+
const oi = "univer-image-common-panel", ai = "univer-image-common-panel-grid", ci = "univer-image-common-panel-border", di = "univer-image-common-panel-title", li = "univer-image-common-panel-subtitle", ui = "univer-image-common-panel-row", hi = "univer-image-common-panel-row-vertical", gi = "univer-image-common-panel-column", mi = "univer-image-common-panel-column-center", fi = "univer-image-common-panel-inline", pi = "univer-image-common-panel-span2", wi = "univer-image-common-panel-span3", _i = "univer-image-common-panel-input", vi = "univer-sheet-image-menu", Si = "univer-sheet-image-menu-input", ee = {
|
|
818
|
+
imageCommonPanel: oi,
|
|
819
|
+
imageCommonPanelGrid: ai,
|
|
820
|
+
imageCommonPanelBorder: ci,
|
|
821
|
+
imageCommonPanelTitle: di,
|
|
822
|
+
imageCommonPanelSubtitle: li,
|
|
823
|
+
imageCommonPanelRow: ui,
|
|
824
|
+
imageCommonPanelRowVertical: hi,
|
|
825
|
+
imageCommonPanelColumn: gi,
|
|
826
|
+
imageCommonPanelColumnCenter: mi,
|
|
827
|
+
imageCommonPanelInline: fi,
|
|
828
|
+
imageCommonPanelSpan2: pi,
|
|
829
|
+
imageCommonPanelSpan3: wi,
|
|
830
|
+
imageCommonPanelInput: _i,
|
|
831
|
+
sheetImageMenu: vi,
|
|
832
|
+
sheetImageMenuInput: Si
|
|
810
833
|
};
|
|
811
|
-
function
|
|
812
|
-
var e,
|
|
813
|
-
if (typeof i == "string" || typeof i == "number")
|
|
834
|
+
function cn(i) {
|
|
835
|
+
var e, n, t = "";
|
|
836
|
+
if (typeof i == "string" || typeof i == "number") t += i;
|
|
814
837
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
815
838
|
var r = i.length;
|
|
816
|
-
for (e = 0; e < r; e++) i[e] && (
|
|
817
|
-
} else for (
|
|
818
|
-
return
|
|
839
|
+
for (e = 0; e < r; e++) i[e] && (n = cn(i[e])) && (t && (t += " "), t += n);
|
|
840
|
+
} else for (n in i) i[n] && (t && (t += " "), t += n);
|
|
841
|
+
return t;
|
|
819
842
|
}
|
|
820
843
|
function be() {
|
|
821
|
-
for (var i, e,
|
|
822
|
-
return
|
|
844
|
+
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = cn(i)) && (t && (t += " "), t += e);
|
|
845
|
+
return t;
|
|
823
846
|
}
|
|
824
|
-
const
|
|
847
|
+
const Ii = (i) => {
|
|
825
848
|
var v;
|
|
826
|
-
const e = oe(W),
|
|
849
|
+
const e = oe(W), n = oe(We), t = oe(K), r = oe(J), { drawings: s } = i, o = s[0];
|
|
827
850
|
if (o == null)
|
|
828
851
|
return;
|
|
829
852
|
const { unitId: d } = o, l = r.getRenderById(d), g = l == null ? void 0 : l.scene;
|
|
@@ -852,7 +875,7 @@ const gi = (i) => {
|
|
|
852
875
|
C === !0 && h(!1);
|
|
853
876
|
}), _ = c.changeStart$.subscribe((C) => {
|
|
854
877
|
var b;
|
|
855
|
-
const { objects: w } = C, O = p(w,
|
|
878
|
+
const { objects: w } = C, O = p(w, t);
|
|
856
879
|
if (O.length === 0)
|
|
857
880
|
h(!1);
|
|
858
881
|
else if (O.length >= 1) {
|
|
@@ -867,7 +890,7 @@ const gi = (i) => {
|
|
|
867
890
|
}, []);
|
|
868
891
|
function I(R) {
|
|
869
892
|
f(R);
|
|
870
|
-
const _ =
|
|
893
|
+
const _ = t.getFocusDrawings();
|
|
871
894
|
if (_.length === 0)
|
|
872
895
|
return;
|
|
873
896
|
const C = _.map((w) => ({
|
|
@@ -882,43 +905,43 @@ const gi = (i) => {
|
|
|
882
905
|
});
|
|
883
906
|
}
|
|
884
907
|
const S = (R) => R ? "block" : "none";
|
|
885
|
-
return /* @__PURE__ */
|
|
886
|
-
/* @__PURE__ */
|
|
887
|
-
/* @__PURE__ */
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
908
|
+
return /* @__PURE__ */ $.jsxs("div", { className: be(ee.imageCommonPanelGrid, ee.imageCommonPanelBorder), style: { display: S(a) }, children: [
|
|
909
|
+
/* @__PURE__ */ $.jsx("div", { className: ee.imageCommonPanelRow, children: /* @__PURE__ */ $.jsx("div", { className: be(ee.imageCommonPanelColumn, ee.imageCommonPanelTitle), children: /* @__PURE__ */ $.jsx("div", { children: n.t("drawing-anchor.title") }) }) }),
|
|
910
|
+
/* @__PURE__ */ $.jsx("div", { className: be(ee.imageCommonPanelRow), children: /* @__PURE__ */ $.jsx("div", { className: be(ee.imageCommonPanelColumn), children: /* @__PURE__ */ $.jsxs(yr, { value: m, onChange: I, direction: "vertical", children: [
|
|
911
|
+
/* @__PURE__ */ $.jsx(Ze, { value: y.Both, children: n.t("drawing-anchor.both") }),
|
|
912
|
+
/* @__PURE__ */ $.jsx(Ze, { value: y.Position, children: n.t("drawing-anchor.position") }),
|
|
913
|
+
/* @__PURE__ */ $.jsx(Ze, { value: y.None, children: n.t("drawing-anchor.none") })
|
|
891
914
|
] }) }) })
|
|
892
915
|
] });
|
|
893
|
-
},
|
|
894
|
-
const i = oe(K), e = i.getFocusDrawings(), [
|
|
916
|
+
}, Ci = () => {
|
|
917
|
+
const i = oe(K), e = i.getFocusDrawings(), [n, t] = it(e);
|
|
895
918
|
return ct(() => {
|
|
896
919
|
const r = i.focus$.subscribe((s) => {
|
|
897
|
-
|
|
920
|
+
t(s);
|
|
898
921
|
});
|
|
899
922
|
return () => {
|
|
900
923
|
r.unsubscribe();
|
|
901
924
|
};
|
|
902
|
-
}, []), !!(
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
925
|
+
}, []), !!(n != null && n.length) && /* @__PURE__ */ $.jsxs("div", { className: ee.imageCommonPanel, children: [
|
|
926
|
+
/* @__PURE__ */ $.jsx(Gn, { drawings: n }),
|
|
927
|
+
/* @__PURE__ */ $.jsx(Ii, { drawings: n })
|
|
905
928
|
] });
|
|
906
|
-
},
|
|
907
|
-
[
|
|
908
|
-
[
|
|
929
|
+
}, Ri = {
|
|
930
|
+
[cr.FORMULAS_INSERT]: {
|
|
931
|
+
[an]: {
|
|
909
932
|
order: 3,
|
|
910
|
-
menuItemFactory:
|
|
933
|
+
menuItemFactory: ii,
|
|
911
934
|
[dt.id]: {
|
|
912
935
|
order: 0,
|
|
913
|
-
menuItemFactory:
|
|
936
|
+
menuItemFactory: si
|
|
914
937
|
}
|
|
915
938
|
}
|
|
916
939
|
}
|
|
917
940
|
};
|
|
918
941
|
function _e(i) {
|
|
919
|
-
return !i.getContextValue(
|
|
942
|
+
return !i.getContextValue(_n) && !i.getContextValue(vn) && !i.getContextValue(Sn) && i.getContextValue(me);
|
|
920
943
|
}
|
|
921
|
-
const
|
|
944
|
+
const Di = {
|
|
922
945
|
id: we.id,
|
|
923
946
|
description: "shortcut.sheet.drawing-move-down",
|
|
924
947
|
group: "4_sheet-drawing-view",
|
|
@@ -928,7 +951,7 @@ const pi = {
|
|
|
928
951
|
staticParameters: {
|
|
929
952
|
direction: te.DOWN
|
|
930
953
|
}
|
|
931
|
-
},
|
|
954
|
+
}, Mi = {
|
|
932
955
|
id: we.id,
|
|
933
956
|
description: "shortcut.sheet.drawing-move-up",
|
|
934
957
|
group: "4_sheet-drawing-view",
|
|
@@ -938,7 +961,7 @@ const pi = {
|
|
|
938
961
|
staticParameters: {
|
|
939
962
|
direction: te.UP
|
|
940
963
|
}
|
|
941
|
-
},
|
|
964
|
+
}, bi = {
|
|
942
965
|
id: we.id,
|
|
943
966
|
description: "shortcut.sheet.drawing-move-left",
|
|
944
967
|
group: "4_sheet-drawing-view",
|
|
@@ -948,7 +971,7 @@ const pi = {
|
|
|
948
971
|
staticParameters: {
|
|
949
972
|
direction: te.LEFT
|
|
950
973
|
}
|
|
951
|
-
},
|
|
974
|
+
}, yi = {
|
|
952
975
|
id: we.id,
|
|
953
976
|
description: "shortcut.sheet.drawing-move-right",
|
|
954
977
|
group: "4_sheet-drawing-view",
|
|
@@ -958,8 +981,8 @@ const pi = {
|
|
|
958
981
|
staticParameters: {
|
|
959
982
|
direction: te.RIGHT
|
|
960
983
|
}
|
|
961
|
-
},
|
|
962
|
-
id:
|
|
984
|
+
}, Oi = {
|
|
985
|
+
id: tn.id,
|
|
963
986
|
description: "shortcut.sheet.drawing-delete",
|
|
964
987
|
group: "4_sheet-drawing-view",
|
|
965
988
|
// when focusing on any other input tag do not trigger this shortcut
|
|
@@ -967,46 +990,46 @@ const pi = {
|
|
|
967
990
|
binding: le.DELETE,
|
|
968
991
|
mac: le.BACKSPACE
|
|
969
992
|
};
|
|
970
|
-
var
|
|
971
|
-
for (var r =
|
|
972
|
-
(o = i[s]) && (r = (
|
|
973
|
-
return
|
|
974
|
-
}, ye = (i, e) => (
|
|
975
|
-
let
|
|
976
|
-
constructor(i, e,
|
|
977
|
-
super(), this._componentManager = i, this._menuManagerService = e, this._commandService =
|
|
993
|
+
var Pi = Object.defineProperty, Ti = Object.getOwnPropertyDescriptor, Ei = (i, e, n, t) => {
|
|
994
|
+
for (var r = t > 1 ? void 0 : t ? Ti(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
995
|
+
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
996
|
+
return t && r && Pi(e, n, r), r;
|
|
997
|
+
}, ye = (i, e) => (n, t) => e(n, t, i);
|
|
998
|
+
let Ne = class extends re {
|
|
999
|
+
constructor(i, e, n, t) {
|
|
1000
|
+
super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._shortcutService = t, this._init();
|
|
978
1001
|
}
|
|
979
1002
|
_initCustomComponents() {
|
|
980
1003
|
const i = this._componentManager;
|
|
981
|
-
this.disposeWithMe(i.register(
|
|
1004
|
+
this.disposeWithMe(i.register(on, en)), this.disposeWithMe(i.register(Ht, Ci));
|
|
982
1005
|
}
|
|
983
1006
|
_initMenus() {
|
|
984
|
-
this._menuManagerService.mergeMenu(
|
|
1007
|
+
this._menuManagerService.mergeMenu(Ri);
|
|
985
1008
|
}
|
|
986
1009
|
_initCommands() {
|
|
987
1010
|
[
|
|
988
1011
|
dt,
|
|
989
1012
|
ke,
|
|
990
|
-
|
|
1013
|
+
Ge,
|
|
991
1014
|
Ye,
|
|
992
|
-
Ht,
|
|
993
|
-
j,
|
|
994
1015
|
zt,
|
|
995
|
-
|
|
996
|
-
|
|
1016
|
+
j,
|
|
1017
|
+
Kt,
|
|
1018
|
+
nn,
|
|
1019
|
+
sn,
|
|
997
1020
|
we,
|
|
998
|
-
|
|
999
|
-
|
|
1021
|
+
tn,
|
|
1022
|
+
rn
|
|
1000
1023
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
1001
1024
|
}
|
|
1002
1025
|
_initShortcuts() {
|
|
1003
1026
|
[
|
|
1004
1027
|
// sheet drawing shortcuts
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1028
|
+
Di,
|
|
1029
|
+
Mi,
|
|
1030
|
+
bi,
|
|
1031
|
+
yi,
|
|
1032
|
+
Oi
|
|
1010
1033
|
].forEach((i) => {
|
|
1011
1034
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
1012
1035
|
});
|
|
@@ -1015,42 +1038,42 @@ let je = class extends re {
|
|
|
1015
1038
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
1016
1039
|
}
|
|
1017
1040
|
};
|
|
1018
|
-
|
|
1019
|
-
ye(0,
|
|
1020
|
-
ye(1,
|
|
1041
|
+
Ne = Ei([
|
|
1042
|
+
ye(0, x(dr)),
|
|
1043
|
+
ye(1, lr),
|
|
1021
1044
|
ye(2, W),
|
|
1022
|
-
ye(3,
|
|
1023
|
-
],
|
|
1024
|
-
var
|
|
1025
|
-
for (var r =
|
|
1026
|
-
(o = i[s]) && (r = (
|
|
1027
|
-
return
|
|
1028
|
-
}, qe = (i, e) => (
|
|
1029
|
-
let
|
|
1030
|
-
constructor(e,
|
|
1045
|
+
ye(3, ur)
|
|
1046
|
+
], Ne);
|
|
1047
|
+
var Ui = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, Ni = (i, e, n, t) => {
|
|
1048
|
+
for (var r = t > 1 ? void 0 : t ? Ai(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1049
|
+
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1050
|
+
return t && r && Ui(e, n, r), r;
|
|
1051
|
+
}, qe = (i, e) => (n, t) => e(n, t, i);
|
|
1052
|
+
let je = class extends re {
|
|
1053
|
+
constructor(e, n, t) {
|
|
1031
1054
|
super();
|
|
1032
|
-
|
|
1033
|
-
this._sheetClipboardService = e, this._renderManagerService =
|
|
1055
|
+
V(this, "_copyInfo");
|
|
1056
|
+
this._sheetClipboardService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._initCopyPaste();
|
|
1034
1057
|
}
|
|
1035
1058
|
_initCopyPaste() {
|
|
1036
1059
|
this._sheetClipboardService.addClipboardHook({
|
|
1037
1060
|
id: "SHEET_IMAGE_UI_PLUGIN",
|
|
1038
|
-
onBeforeCopy: (e,
|
|
1039
|
-
onPasteCells: (e,
|
|
1040
|
-
const { copyType: s = _t.COPY, pasteType: o } = r, { range: d } = e || {}, { range: l, unitId: g, subUnitId: c } =
|
|
1061
|
+
onBeforeCopy: (e, n, t) => this._collect(e, n, t),
|
|
1062
|
+
onPasteCells: (e, n, t, r) => {
|
|
1063
|
+
const { copyType: s = _t.COPY, pasteType: o } = r, { range: d } = e || {}, { range: l, unitId: g, subUnitId: c } = n;
|
|
1041
1064
|
return this._generateMutations(l, { copyType: s, pasteType: o, copyRange: d, unitId: g, subUnitId: c });
|
|
1042
1065
|
},
|
|
1043
|
-
onPastePlainText: (e,
|
|
1066
|
+
onPastePlainText: (e, n) => ({ undos: [], redos: [] })
|
|
1044
1067
|
});
|
|
1045
1068
|
}
|
|
1046
|
-
_collect(e,
|
|
1069
|
+
_collect(e, n, t) {
|
|
1047
1070
|
var h;
|
|
1048
1071
|
const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(q);
|
|
1049
1072
|
if (!r) return;
|
|
1050
|
-
const s = r.attachRangeWithCoord(
|
|
1073
|
+
const s = r.attachRangeWithCoord(t);
|
|
1051
1074
|
if (!s)
|
|
1052
1075
|
return;
|
|
1053
|
-
const { startX: o, endX: d, startY: l, endY: g } = s, c = this._sheetDrawingService.getDrawingData(e,
|
|
1076
|
+
const { startX: o, endX: d, startY: l, endY: g } = s, c = this._sheetDrawingService.getDrawingData(e, n), a = [];
|
|
1054
1077
|
Object.keys(c).forEach((u) => {
|
|
1055
1078
|
const m = c[u], { transform: f } = m;
|
|
1056
1079
|
if (m.anchorType !== y.Both || !f)
|
|
@@ -1065,11 +1088,11 @@ let Be = class extends re {
|
|
|
1065
1088
|
}), a.length && (this._copyInfo = {
|
|
1066
1089
|
drawings: a,
|
|
1067
1090
|
unitId: e,
|
|
1068
|
-
subUnitId:
|
|
1091
|
+
subUnitId: n
|
|
1069
1092
|
});
|
|
1070
1093
|
}
|
|
1071
1094
|
// eslint-disable-next-line max-lines-per-function
|
|
1072
|
-
_generateMutations(e,
|
|
1095
|
+
_generateMutations(e, n) {
|
|
1073
1096
|
var b;
|
|
1074
1097
|
if (!this._copyInfo)
|
|
1075
1098
|
return { redos: [], undos: [] };
|
|
@@ -1079,13 +1102,13 @@ let Be = class extends re {
|
|
|
1079
1102
|
Se.SPECIAL_PASTE_FORMAT,
|
|
1080
1103
|
Se.SPECIAL_PASTE_FORMULA
|
|
1081
1104
|
].includes(
|
|
1082
|
-
|
|
1105
|
+
n.pasteType
|
|
1083
1106
|
))
|
|
1084
1107
|
return { redos: [], undos: [] };
|
|
1085
|
-
const { copyRange:
|
|
1086
|
-
if (!
|
|
1108
|
+
const { copyRange: t } = n;
|
|
1109
|
+
if (!t)
|
|
1087
1110
|
return { redos: [], undos: [] };
|
|
1088
|
-
const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [d, l], mapFunc: g } =
|
|
1111
|
+
const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [d, l], mapFunc: g } = qn([t, e]), { row: c, col: a } = g(d.startRow, d.startColumn), { row: h, col: u } = g(l.startRow, l.startColumn), m = (b = this._renderManagerService.getRenderById(s)) == null ? void 0 : b.with(q);
|
|
1089
1112
|
if (!m)
|
|
1090
1113
|
return { redos: [], undos: [] };
|
|
1091
1114
|
const f = m.attachRangeWithCoord({
|
|
@@ -1101,7 +1124,7 @@ let Be = class extends re {
|
|
|
1101
1124
|
});
|
|
1102
1125
|
if (!f || !p)
|
|
1103
1126
|
return { redos: [], undos: [] };
|
|
1104
|
-
const I = [], S = [], v = p.startX - f.startX, R = p.startY - f.startY, _ = h - c, C = u - a, w =
|
|
1127
|
+
const I = [], S = [], v = p.startX - f.startX, R = p.startY - f.startY, _ = h - c, C = u - a, w = n.copyType === _t.CUT, { _sheetDrawingService: O } = this;
|
|
1105
1128
|
return r.forEach((A) => {
|
|
1106
1129
|
const { transform: E, sheetTransform: M } = A;
|
|
1107
1130
|
if (!E)
|
|
@@ -1152,39 +1175,39 @@ let Be = class extends re {
|
|
|
1152
1175
|
};
|
|
1153
1176
|
}
|
|
1154
1177
|
};
|
|
1155
|
-
|
|
1156
|
-
qe(0,
|
|
1178
|
+
je = Ni([
|
|
1179
|
+
qe(0, Qn),
|
|
1157
1180
|
qe(1, J),
|
|
1158
1181
|
qe(2, F)
|
|
1159
|
-
],
|
|
1160
|
-
var
|
|
1161
|
-
for (var r =
|
|
1162
|
-
(o = i[s]) && (r = (
|
|
1163
|
-
return
|
|
1164
|
-
}, he = (i, e) => (
|
|
1165
|
-
let
|
|
1166
|
-
constructor(i, e,
|
|
1167
|
-
super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService =
|
|
1182
|
+
], je);
|
|
1183
|
+
var ji = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, Li = (i, e, n, t) => {
|
|
1184
|
+
for (var r = t > 1 ? void 0 : t ? xi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1185
|
+
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1186
|
+
return t && r && ji(e, n, r), r;
|
|
1187
|
+
}, he = (i, e) => (n, t) => e(n, t, i);
|
|
1188
|
+
let xe = class extends re {
|
|
1189
|
+
constructor(i, e, n, t, r) {
|
|
1190
|
+
super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1168
1191
|
}
|
|
1169
1192
|
_initDrawingVisible() {
|
|
1170
1193
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
|
|
1171
1194
|
this.disposeWithMe(
|
|
1172
|
-
Ie([i, this._userManagerService.currentUser$]).subscribe(([e,
|
|
1195
|
+
Ie([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1173
1196
|
if (!e) {
|
|
1174
1197
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1175
1198
|
return;
|
|
1176
1199
|
}
|
|
1177
|
-
e.activeSheet$.subscribe((
|
|
1178
|
-
if (!
|
|
1200
|
+
e.activeSheet$.subscribe((t) => {
|
|
1201
|
+
if (!t) {
|
|
1179
1202
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1180
1203
|
return;
|
|
1181
1204
|
}
|
|
1182
|
-
const r = e.getUnitId(), s =
|
|
1205
|
+
const r = e.getUnitId(), s = t.getSheetId();
|
|
1183
1206
|
if (this._permissionService.composePermission([new St(r).id, new Je(r, s).id]).every((d) => d.value))
|
|
1184
1207
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
1185
1208
|
else {
|
|
1186
1209
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1187
|
-
const d = e.getUnitId(), l =
|
|
1210
|
+
const d = e.getUnitId(), l = t.getSheetId(), g = this._drawingManagerService.getDrawingData(d, l), c = Object.values(g), a = this._renderManagerService.getRenderById(d), h = a == null ? void 0 : a.scene;
|
|
1188
1211
|
if (h == null)
|
|
1189
1212
|
return;
|
|
1190
1213
|
h.getAllObjectsByOrder().forEach((m) => {
|
|
@@ -1198,22 +1221,22 @@ let Le = class extends re {
|
|
|
1198
1221
|
_initDrawingEditable() {
|
|
1199
1222
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
|
|
1200
1223
|
this.disposeWithMe(
|
|
1201
|
-
Ie([i, this._userManagerService.currentUser$]).subscribe(([e,
|
|
1224
|
+
Ie([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1202
1225
|
if (!e) {
|
|
1203
1226
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1204
1227
|
return;
|
|
1205
1228
|
}
|
|
1206
|
-
e.activeSheet$.subscribe((
|
|
1207
|
-
if (!
|
|
1229
|
+
e.activeSheet$.subscribe((t) => {
|
|
1230
|
+
if (!t) {
|
|
1208
1231
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1209
1232
|
return;
|
|
1210
1233
|
}
|
|
1211
|
-
const r = e.getUnitId(), s =
|
|
1234
|
+
const r = e.getUnitId(), s = t.getSheetId();
|
|
1212
1235
|
if (this._permissionService.composePermission([new tt(r).id, new Pe(r, s).id]).every((d) => d.value))
|
|
1213
1236
|
this._drawingManagerService.setDrawingEditable(!0);
|
|
1214
1237
|
else {
|
|
1215
1238
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1216
|
-
const d = e.getUnitId(), l =
|
|
1239
|
+
const d = e.getUnitId(), l = t.getSheetId(), g = this._drawingManagerService.getDrawingData(d, l), c = Object.values(g), a = this._renderManagerService.getRenderById(d), h = a == null ? void 0 : a.scene;
|
|
1217
1240
|
if (h == null)
|
|
1218
1241
|
return;
|
|
1219
1242
|
h.getAllObjectsByOrder().forEach((m) => {
|
|
@@ -1227,12 +1250,12 @@ let Le = class extends re {
|
|
|
1227
1250
|
_initViewPermissionChange() {
|
|
1228
1251
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
|
|
1229
1252
|
this.disposeWithMe(
|
|
1230
|
-
Ie([i, this._userManagerService.currentUser$]).subscribe(([e,
|
|
1231
|
-
e && e.activeSheet$.subscribe((
|
|
1253
|
+
Ie([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1254
|
+
e && e.activeSheet$.subscribe((t) => {
|
|
1232
1255
|
var a;
|
|
1233
|
-
if (!
|
|
1256
|
+
if (!t)
|
|
1234
1257
|
return;
|
|
1235
|
-
const r = e.getUnitId(), s =
|
|
1258
|
+
const r = e.getUnitId(), s = t.getSheetId();
|
|
1236
1259
|
let o = !0;
|
|
1237
1260
|
const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
|
|
1238
1261
|
if (l == null)
|
|
@@ -1266,12 +1289,12 @@ let Le = class extends re {
|
|
|
1266
1289
|
_initEditPermissionChange() {
|
|
1267
1290
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
|
|
1268
1291
|
this.disposeWithMe(
|
|
1269
|
-
Ie([i, this._userManagerService.currentUser$]).subscribe(([e,
|
|
1270
|
-
e && e.activeSheet$.subscribe((
|
|
1292
|
+
Ie([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1293
|
+
e && e.activeSheet$.subscribe((t) => {
|
|
1271
1294
|
var a;
|
|
1272
|
-
if (!
|
|
1295
|
+
if (!t)
|
|
1273
1296
|
return;
|
|
1274
|
-
const r = e.getUnitId(), s =
|
|
1297
|
+
const r = e.getUnitId(), s = t.getSheetId();
|
|
1275
1298
|
let o = !0;
|
|
1276
1299
|
const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
|
|
1277
1300
|
if (l == null)
|
|
@@ -1296,7 +1319,7 @@ let Le = class extends re {
|
|
|
1296
1319
|
).subscribe({
|
|
1297
1320
|
complete: () => {
|
|
1298
1321
|
o = !0;
|
|
1299
|
-
const h = e.getUnitId(), u =
|
|
1322
|
+
const h = e.getUnitId(), u = t.getSheetId(), m = this._drawingManagerService.getDrawingData(h, u), f = Object.values(m), p = this._renderManagerService.getRenderById(h), I = p == null ? void 0 : p.scene;
|
|
1300
1323
|
if (I == null)
|
|
1301
1324
|
return;
|
|
1302
1325
|
this._drawingManagerService.setDrawingEditable(!0), I.getAllObjectsByOrder().forEach((v) => {
|
|
@@ -1309,32 +1332,32 @@ let Le = class extends re {
|
|
|
1309
1332
|
);
|
|
1310
1333
|
}
|
|
1311
1334
|
};
|
|
1312
|
-
|
|
1335
|
+
xe = Li([
|
|
1313
1336
|
he(0, K),
|
|
1314
1337
|
he(1, J),
|
|
1315
|
-
he(2,
|
|
1338
|
+
he(2, Cn),
|
|
1316
1339
|
he(3, fe),
|
|
1317
|
-
he(4,
|
|
1318
|
-
],
|
|
1319
|
-
var
|
|
1320
|
-
for (var r =
|
|
1321
|
-
(o = i[s]) && (r = (
|
|
1322
|
-
return
|
|
1323
|
-
}, Oe = (i, e) => (
|
|
1324
|
-
let
|
|
1325
|
-
constructor(i, e,
|
|
1326
|
-
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService =
|
|
1340
|
+
he(4, x(In))
|
|
1341
|
+
], xe);
|
|
1342
|
+
var $i = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, Wi = (i, e, n, t) => {
|
|
1343
|
+
for (var r = t > 1 ? void 0 : t ? Bi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1344
|
+
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1345
|
+
return t && r && $i(e, n, r), r;
|
|
1346
|
+
}, Oe = (i, e) => (n, t) => e(n, t, i);
|
|
1347
|
+
let Le = class extends re {
|
|
1348
|
+
constructor(i, e, n, t) {
|
|
1349
|
+
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
|
|
1327
1350
|
}
|
|
1328
1351
|
_initPrinting() {
|
|
1329
1352
|
this.disposeWithMe(
|
|
1330
1353
|
this._sheetPrintInterceptorService.interceptor.intercept(
|
|
1331
1354
|
this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_COMPONENT_COLLECT,
|
|
1332
1355
|
{
|
|
1333
|
-
handler: (i, e,
|
|
1334
|
-
const { unitId:
|
|
1356
|
+
handler: (i, e, n) => {
|
|
1357
|
+
const { unitId: t, scene: r, subUnitId: s } = e, o = this._drawingManagerService.getDrawingDataForUnit(t), d = o == null ? void 0 : o[s];
|
|
1335
1358
|
return d && d.order.forEach((l) => {
|
|
1336
1359
|
this._drawingRenderService.renderDrawing(d.data[l], r);
|
|
1337
|
-
}),
|
|
1360
|
+
}), n();
|
|
1338
1361
|
}
|
|
1339
1362
|
}
|
|
1340
1363
|
)
|
|
@@ -1342,41 +1365,41 @@ let $e = class extends re {
|
|
|
1342
1365
|
this._sheetPrintInterceptorService.interceptor.intercept(
|
|
1343
1366
|
this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_RANGE,
|
|
1344
1367
|
{
|
|
1345
|
-
handler: (i, e,
|
|
1346
|
-
const { unitId:
|
|
1368
|
+
handler: (i, e, n) => {
|
|
1369
|
+
const { unitId: t, subUnitId: r } = e, s = this._renderManagerService.getRenderById(t);
|
|
1347
1370
|
if (!s)
|
|
1348
|
-
return
|
|
1371
|
+
return n(i);
|
|
1349
1372
|
const o = s.with(q).getWorksheetSkeleton(r);
|
|
1350
1373
|
if (!o)
|
|
1351
|
-
return
|
|
1352
|
-
const d = this._drawingManagerService.getDrawingDataForUnit(
|
|
1374
|
+
return n(i);
|
|
1375
|
+
const d = this._drawingManagerService.getDrawingDataForUnit(t), l = d == null ? void 0 : d[e.subUnitId];
|
|
1353
1376
|
if (!l)
|
|
1354
|
-
return
|
|
1377
|
+
return n(i);
|
|
1355
1378
|
const { scaleX: g, scaleY: c } = s.scene, a = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = l.order.map((u) => l.data[u]).filter((u) => u.drawingType !== k.DRAWING_DOM);
|
|
1356
1379
|
return h.length ? (h.forEach((u) => {
|
|
1357
1380
|
if (!u.groupId && u.transform && ge.isDefine(u.transform.left) && ge.isDefine(u.transform.top) && ge.isDefine(u.transform.width) && ge.isDefine(u.transform.height)) {
|
|
1358
1381
|
const m = o.skeleton.getCellPositionByOffset(u.transform.left, u.transform.top, g, c, { x: 0, y: 0 }), f = o.skeleton.getCellPositionByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, c, { x: 0, y: 0 });
|
|
1359
1382
|
m.column < a.startColumn && (a.startColumn = m.column), m.row < a.startRow && (a.startRow = m.row), a.endRow < f.row && (a.endRow = f.row), a.endColumn < f.column && (a.endColumn = f.column);
|
|
1360
1383
|
}
|
|
1361
|
-
}),
|
|
1384
|
+
}), n(a)) : n(i);
|
|
1362
1385
|
}
|
|
1363
1386
|
}
|
|
1364
1387
|
)
|
|
1365
1388
|
);
|
|
1366
1389
|
}
|
|
1367
1390
|
};
|
|
1368
|
-
|
|
1369
|
-
Oe(0,
|
|
1370
|
-
Oe(1,
|
|
1391
|
+
Le = Wi([
|
|
1392
|
+
Oe(0, x(er)),
|
|
1393
|
+
Oe(1, x(Vn)),
|
|
1371
1394
|
Oe(2, K),
|
|
1372
1395
|
Oe(3, J)
|
|
1373
|
-
],
|
|
1374
|
-
var
|
|
1375
|
-
for (var r =
|
|
1376
|
-
(o = i[s]) && (r = (
|
|
1377
|
-
return
|
|
1378
|
-
}, Q = (i, e) => (
|
|
1379
|
-
const
|
|
1396
|
+
], Le);
|
|
1397
|
+
var Gi = Object.defineProperty, Vi = Object.getOwnPropertyDescriptor, ki = (i, e, n, t) => {
|
|
1398
|
+
for (var r = t > 1 ? void 0 : t ? Vi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1399
|
+
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1400
|
+
return t && r && Gi(e, n, r), r;
|
|
1401
|
+
}, Q = (i, e) => (n, t) => e(n, t, i);
|
|
1402
|
+
const Yi = [
|
|
1380
1403
|
yt.id,
|
|
1381
1404
|
Ot.id,
|
|
1382
1405
|
Pt.id,
|
|
@@ -1388,38 +1411,38 @@ const Bi = [
|
|
|
1388
1411
|
nt.id,
|
|
1389
1412
|
rt.id,
|
|
1390
1413
|
jt.id,
|
|
1391
|
-
|
|
1414
|
+
xt.id,
|
|
1392
1415
|
Lt.id,
|
|
1393
1416
|
$t.id,
|
|
1417
|
+
Bt.id,
|
|
1394
1418
|
Wt.id,
|
|
1395
1419
|
Gt.id,
|
|
1396
|
-
xt.id,
|
|
1397
1420
|
Vt.id,
|
|
1398
1421
|
kt.id
|
|
1399
|
-
],
|
|
1400
|
-
fr.id,
|
|
1401
|
-
pr.id,
|
|
1402
|
-
wr.id,
|
|
1422
|
+
], Fi = [
|
|
1403
1423
|
_r.id,
|
|
1404
1424
|
vr.id,
|
|
1405
|
-
Sr.id
|
|
1425
|
+
Sr.id,
|
|
1426
|
+
Ir.id,
|
|
1427
|
+
Cr.id,
|
|
1428
|
+
Rr.id
|
|
1406
1429
|
];
|
|
1407
1430
|
let ot = class extends re {
|
|
1408
|
-
constructor(i, e,
|
|
1409
|
-
super(), this._context = i, this._renderManagerService = e, this._commandService =
|
|
1431
|
+
constructor(i, e, n, t, r, s, o, d, l) {
|
|
1432
|
+
super(), this._context = i, this._renderManagerService = e, this._commandService = n, this._selectionRenderService = t, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = d, this._univerInstanceService = l, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
|
|
1410
1433
|
}
|
|
1411
1434
|
_sheetInterceptorListener() {
|
|
1412
1435
|
this.disposeWithMe(
|
|
1413
1436
|
this._sheetInterceptorService.interceptCommand({
|
|
1414
1437
|
getMutations: (i) => {
|
|
1415
|
-
if (!
|
|
1438
|
+
if (!Yi.includes(i.id))
|
|
1416
1439
|
return { redos: [], undos: [] };
|
|
1417
1440
|
if (i.params == null)
|
|
1418
1441
|
return { redos: [], undos: [] };
|
|
1419
1442
|
const e = i.id;
|
|
1420
1443
|
if (e === yt.id)
|
|
1421
1444
|
return this._moveRowInterceptor(i.params, "insert");
|
|
1422
|
-
if ([
|
|
1445
|
+
if ([Gt.id, Vt.id, kt.id].includes(e))
|
|
1423
1446
|
return this._moveRangeInterceptor(i.params);
|
|
1424
1447
|
if (e === Ot.id)
|
|
1425
1448
|
return this._moveColInterceptor(i.params, "insert");
|
|
@@ -1428,42 +1451,42 @@ let ot = class extends re {
|
|
|
1428
1451
|
if (e === Tt.id)
|
|
1429
1452
|
return this._moveColInterceptor(i.params, "remove");
|
|
1430
1453
|
if (e === Et.id) {
|
|
1431
|
-
const { range:
|
|
1454
|
+
const { range: n } = i.params;
|
|
1432
1455
|
return this._getRangeMoveUndo(
|
|
1433
|
-
|
|
1456
|
+
n,
|
|
1434
1457
|
0
|
|
1435
1458
|
/* deleteLeft */
|
|
1436
1459
|
);
|
|
1437
1460
|
} else if (e === Ut.id) {
|
|
1438
|
-
const { range:
|
|
1461
|
+
const { range: n } = i.params;
|
|
1439
1462
|
return this._getRangeMoveUndo(
|
|
1440
|
-
|
|
1463
|
+
n,
|
|
1441
1464
|
1
|
|
1442
1465
|
/* deleteUp */
|
|
1443
1466
|
);
|
|
1444
1467
|
} else if (e === At.id) {
|
|
1445
|
-
const { range:
|
|
1468
|
+
const { range: n } = i.params;
|
|
1446
1469
|
return this._getRangeMoveUndo(
|
|
1447
|
-
|
|
1470
|
+
n,
|
|
1448
1471
|
2
|
|
1449
1472
|
/* insertDown */
|
|
1450
1473
|
);
|
|
1451
1474
|
} else if (e === Nt.id) {
|
|
1452
|
-
const { range:
|
|
1475
|
+
const { range: n } = i.params;
|
|
1453
1476
|
return this._getRangeMoveUndo(
|
|
1454
|
-
|
|
1477
|
+
n,
|
|
1455
1478
|
3
|
|
1456
1479
|
/* insertRight */
|
|
1457
1480
|
);
|
|
1458
1481
|
} else if (e === Lt.id || e === $t.id) {
|
|
1459
|
-
const
|
|
1460
|
-
return this._getDrawingUndoForRowVisible(
|
|
1461
|
-
} else if (e ===
|
|
1462
|
-
const
|
|
1463
|
-
return this._getDrawingUndoForColVisible(
|
|
1464
|
-
} else if (e === nt.id || e === rt.id || e === jt.id || e ===
|
|
1465
|
-
const
|
|
1466
|
-
return this._getDrawingUndoForRowAndColSize(
|
|
1482
|
+
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1483
|
+
return this._getDrawingUndoForRowVisible(t, r, s);
|
|
1484
|
+
} else if (e === Bt.id || e === Wt.id) {
|
|
1485
|
+
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1486
|
+
return this._getDrawingUndoForColVisible(t, r, s);
|
|
1487
|
+
} else if (e === nt.id || e === rt.id || e === jt.id || e === xt.id) {
|
|
1488
|
+
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === nt.id || e === rt.id;
|
|
1489
|
+
return this._getDrawingUndoForRowAndColSize(t, r, s, o);
|
|
1467
1490
|
}
|
|
1468
1491
|
return { redos: [], undos: [] };
|
|
1469
1492
|
}
|
|
@@ -1471,10 +1494,10 @@ let ot = class extends re {
|
|
|
1471
1494
|
);
|
|
1472
1495
|
}
|
|
1473
1496
|
_getRangeMoveUndo(i, e) {
|
|
1474
|
-
const
|
|
1475
|
-
if (
|
|
1497
|
+
const n = ce(this._univerInstanceService);
|
|
1498
|
+
if (n == null)
|
|
1476
1499
|
return { redos: [], undos: [] };
|
|
1477
|
-
const
|
|
1500
|
+
const t = n.unitId, r = n.subUnitId, s = [], o = [], d = this._sheetDrawingService.getDrawingData(t, r), l = [], g = [];
|
|
1478
1501
|
if (Object.keys(d).forEach((c) => {
|
|
1479
1502
|
const a = d[c], { updateDrawings: h, deleteDrawings: u } = this._getUpdateOrDeleteDrawings(i, e, a);
|
|
1480
1503
|
l.push(...h), g.push(...u);
|
|
@@ -1482,22 +1505,22 @@ let ot = class extends re {
|
|
|
1482
1505
|
return { redos: [], undos: [] };
|
|
1483
1506
|
if (l.length > 0) {
|
|
1484
1507
|
const c = this._sheetDrawingService.getBatchUpdateOp(l), { undo: a, redo: h, objects: u } = c;
|
|
1485
|
-
s.push({ id: P.id, params: { unitId:
|
|
1508
|
+
s.push({ id: P.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: T.UPDATE } }), o.push({ id: P.id, params: { unitId: t, subUnitId: r, op: a, objects: u, type: T.UPDATE } });
|
|
1486
1509
|
}
|
|
1487
1510
|
if (g.length > 0) {
|
|
1488
1511
|
const c = this._sheetDrawingService.getBatchRemoveOp(g), a = c.undo, h = c.redo, u = c.objects;
|
|
1489
|
-
s.push({ id: P.id, params: { unitId:
|
|
1512
|
+
s.push({ id: P.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: T.REMOVE } }), o.push({ id: P.id, params: { unitId: t, subUnitId: r, op: a, objects: u, type: T.INSERT } });
|
|
1490
1513
|
}
|
|
1491
|
-
return s.push({ id: j.id, params: [
|
|
1514
|
+
return s.push({ id: j.id, params: [t] }), o.push({ id: j.id, params: [t] }), {
|
|
1492
1515
|
redos: s,
|
|
1493
1516
|
undos: o
|
|
1494
1517
|
};
|
|
1495
1518
|
}
|
|
1496
|
-
_getUpdateOrDeleteDrawings(i, e,
|
|
1497
|
-
const
|
|
1519
|
+
_getUpdateOrDeleteDrawings(i, e, n) {
|
|
1520
|
+
const t = [], r = [], { sheetTransform: s, anchorType: o = y.Position, transform: d, unitId: l, subUnitId: g, drawingId: c } = n, { from: a, to: h } = s, { row: u, column: m } = a, { row: f, column: p } = h;
|
|
1498
1521
|
if (s == null || d == null)
|
|
1499
1522
|
return {
|
|
1500
|
-
updateDrawings:
|
|
1523
|
+
updateDrawings: t,
|
|
1501
1524
|
deleteDrawings: r
|
|
1502
1525
|
};
|
|
1503
1526
|
const { startRow: I, endRow: S, startColumn: v, endColumn: R } = i;
|
|
@@ -1524,29 +1547,29 @@ let ot = class extends re {
|
|
|
1524
1547
|
_ = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
|
|
1525
1548
|
}
|
|
1526
1549
|
if (_ != null && C != null) {
|
|
1527
|
-
const w =
|
|
1528
|
-
|
|
1550
|
+
const w = B(_, this._selectionRenderService, this._skeletonManagerService);
|
|
1551
|
+
t.push({ ...n, sheetTransform: _, transform: w });
|
|
1529
1552
|
}
|
|
1530
|
-
return { updateDrawings:
|
|
1553
|
+
return { updateDrawings: t, deleteDrawings: r };
|
|
1531
1554
|
}
|
|
1532
|
-
_remainDrawingSize(i, e,
|
|
1533
|
-
const
|
|
1534
|
-
|
|
1535
|
-
...
|
|
1536
|
-
sheetTransform:
|
|
1555
|
+
_remainDrawingSize(i, e, n) {
|
|
1556
|
+
const t = N({ ...i }, this._selectionRenderService);
|
|
1557
|
+
t != null && e.push({
|
|
1558
|
+
...n,
|
|
1559
|
+
sheetTransform: t
|
|
1537
1560
|
});
|
|
1538
1561
|
}
|
|
1539
1562
|
// eslint-disable-next-line max-lines-per-function
|
|
1540
|
-
_getDrawingUndoForColVisible(i, e,
|
|
1541
|
-
const
|
|
1542
|
-
if (Object.keys(
|
|
1543
|
-
const a =
|
|
1563
|
+
_getDrawingUndoForColVisible(i, e, n) {
|
|
1564
|
+
const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
|
|
1565
|
+
if (Object.keys(t).forEach((c) => {
|
|
1566
|
+
const a = t[c], { sheetTransform: h, transform: u, anchorType: m = y.Position } = a;
|
|
1544
1567
|
if (m === y.None)
|
|
1545
1568
|
this._remainDrawingSize(u, r, a);
|
|
1546
1569
|
else {
|
|
1547
1570
|
const { from: f, to: p } = h, { row: I, column: S } = f, { row: v, column: R } = p;
|
|
1548
|
-
for (let _ = 0; _ <
|
|
1549
|
-
const C =
|
|
1571
|
+
for (let _ = 0; _ < n.length; _++) {
|
|
1572
|
+
const C = n[_], { startRow: w, endRow: O, startColumn: b, endColumn: A } = C;
|
|
1550
1573
|
if (R < b)
|
|
1551
1574
|
continue;
|
|
1552
1575
|
if (m === y.Position) {
|
|
@@ -1617,8 +1640,8 @@ let ot = class extends re {
|
|
|
1617
1640
|
preUndos: g
|
|
1618
1641
|
};
|
|
1619
1642
|
}
|
|
1620
|
-
_createUndoAndRedoMutation(i, e,
|
|
1621
|
-
const
|
|
1643
|
+
_createUndoAndRedoMutation(i, e, n) {
|
|
1644
|
+
const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, d = [
|
|
1622
1645
|
{ id: P.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: T.UPDATE } },
|
|
1623
1646
|
{ id: j.id, params: [i] }
|
|
1624
1647
|
], l = [
|
|
@@ -1631,16 +1654,16 @@ let ot = class extends re {
|
|
|
1631
1654
|
};
|
|
1632
1655
|
}
|
|
1633
1656
|
// eslint-disable-next-line max-lines-per-function
|
|
1634
|
-
_getDrawingUndoForRowVisible(i, e,
|
|
1635
|
-
const
|
|
1636
|
-
if (Object.keys(
|
|
1637
|
-
const a =
|
|
1657
|
+
_getDrawingUndoForRowVisible(i, e, n) {
|
|
1658
|
+
const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
|
|
1659
|
+
if (Object.keys(t).forEach((c) => {
|
|
1660
|
+
const a = t[c], { sheetTransform: h, transform: u, anchorType: m = y.Position } = a;
|
|
1638
1661
|
if (m === y.None)
|
|
1639
1662
|
this._remainDrawingSize(u, r, a);
|
|
1640
1663
|
else {
|
|
1641
1664
|
const { from: f, to: p } = h, { row: I, column: S } = f, { row: v, column: R } = p;
|
|
1642
|
-
for (let _ = 0; _ <
|
|
1643
|
-
const C =
|
|
1665
|
+
for (let _ = 0; _ < n.length; _++) {
|
|
1666
|
+
const C = n[_], { startRow: w, endRow: O, startColumn: b, endColumn: A } = C;
|
|
1644
1667
|
if (v < w)
|
|
1645
1668
|
continue;
|
|
1646
1669
|
if (m === y.Position) {
|
|
@@ -1711,7 +1734,7 @@ let ot = class extends re {
|
|
|
1711
1734
|
preUndos: g
|
|
1712
1735
|
};
|
|
1713
1736
|
}
|
|
1714
|
-
_getDrawingUndoForRowAndColSize(i, e,
|
|
1737
|
+
_getDrawingUndoForRowAndColSize(i, e, n, t) {
|
|
1715
1738
|
const r = this._drawingManagerService.getDrawingData(i, e), s = [];
|
|
1716
1739
|
return Object.keys(r).forEach((o) => {
|
|
1717
1740
|
const d = r[o], { sheetTransform: l, transform: g, anchorType: c = y.Position } = d;
|
|
@@ -1719,15 +1742,15 @@ let ot = class extends re {
|
|
|
1719
1742
|
this._remainDrawingSize(g, s, d);
|
|
1720
1743
|
else {
|
|
1721
1744
|
const { from: a, to: h } = l, { row: u, column: m } = a, { row: f, column: p } = h;
|
|
1722
|
-
for (let I = 0; I <
|
|
1723
|
-
const S =
|
|
1745
|
+
for (let I = 0; I < n.length; I++) {
|
|
1746
|
+
const S = n[I], { startRow: v, endRow: R, startColumn: _, endColumn: C } = S;
|
|
1724
1747
|
if (f < v || p < _)
|
|
1725
1748
|
continue;
|
|
1726
1749
|
if (c === y.Position && (u <= v && f >= R || m <= _ && p >= C)) {
|
|
1727
1750
|
this._remainDrawingSize(g, s, d);
|
|
1728
1751
|
continue;
|
|
1729
1752
|
}
|
|
1730
|
-
const w =
|
|
1753
|
+
const w = B(
|
|
1731
1754
|
{ ...l },
|
|
1732
1755
|
this._selectionRenderService,
|
|
1733
1756
|
this._skeletonManagerService
|
|
@@ -1744,26 +1767,26 @@ let ot = class extends re {
|
|
|
1744
1767
|
}), s.length === 0 ? { redos: [], undos: [] } : this._createUndoAndRedoMutation(i, e, s);
|
|
1745
1768
|
}
|
|
1746
1769
|
_getUnitIdAndSubUnitId(i, e) {
|
|
1747
|
-
let
|
|
1770
|
+
let n, t;
|
|
1748
1771
|
if (e === "insert")
|
|
1749
|
-
|
|
1772
|
+
n = i.unitId, t = i.subUnitId;
|
|
1750
1773
|
else {
|
|
1751
1774
|
const r = ce(this._univerInstanceService);
|
|
1752
1775
|
if (r == null)
|
|
1753
1776
|
return;
|
|
1754
|
-
|
|
1777
|
+
n = r.unitId, t = r.subUnitId;
|
|
1755
1778
|
}
|
|
1756
|
-
return { unitId:
|
|
1779
|
+
return { unitId: n, subUnitId: t };
|
|
1757
1780
|
}
|
|
1758
1781
|
_moveRangeInterceptor(i) {
|
|
1759
1782
|
var v, R;
|
|
1760
|
-
const { toRange: e, fromRange:
|
|
1761
|
-
if (!
|
|
1783
|
+
const { toRange: e, fromRange: n } = i, t = ce(this._univerInstanceService);
|
|
1784
|
+
if (!t)
|
|
1762
1785
|
return { redos: [], undos: [] };
|
|
1763
|
-
const { unitId: r, subUnitId: s } =
|
|
1786
|
+
const { unitId: r, subUnitId: s } = t, o = (R = (v = this._renderManagerService.getRenderById(r)) == null ? void 0 : v.with(q)) == null ? void 0 : R.getCurrentSkeleton();
|
|
1764
1787
|
if (!o)
|
|
1765
1788
|
return { redos: [], undos: [] };
|
|
1766
|
-
const d = Te(o,
|
|
1789
|
+
const d = Te(o, n);
|
|
1767
1790
|
if (!d)
|
|
1768
1791
|
return { redos: [], undos: [] };
|
|
1769
1792
|
const { startX: l, endX: g, startY: c, endY: a } = d, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
|
|
@@ -1782,11 +1805,11 @@ let ot = class extends re {
|
|
|
1782
1805
|
};
|
|
1783
1806
|
l <= M && D <= g && c <= U && L <= a && u.push(C);
|
|
1784
1807
|
});
|
|
1785
|
-
const m = [], f = [], p = e.startRow -
|
|
1808
|
+
const m = [], f = [], p = e.startRow - n.startRow, I = e.startColumn - n.startColumn, S = u.map((_) => {
|
|
1786
1809
|
const C = _.sheetTransform, w = {
|
|
1787
1810
|
to: { ...C.to, row: C.to.row + p, column: C.to.column + I },
|
|
1788
1811
|
from: { ...C.from, row: C.from.row + p, column: C.from.column + I }
|
|
1789
|
-
}, O =
|
|
1812
|
+
}, O = B(w, this._selectionRenderService, this._skeletonManagerService);
|
|
1790
1813
|
return {
|
|
1791
1814
|
unitId: r,
|
|
1792
1815
|
subUnitId: s,
|
|
@@ -1802,10 +1825,10 @@ let ot = class extends re {
|
|
|
1802
1825
|
return { redos: m, undos: f };
|
|
1803
1826
|
}
|
|
1804
1827
|
_moveRowInterceptor(i, e) {
|
|
1805
|
-
const
|
|
1806
|
-
if (
|
|
1828
|
+
const n = this._getUnitIdAndSubUnitId(i, e);
|
|
1829
|
+
if (n == null)
|
|
1807
1830
|
return { redos: [], undos: [] };
|
|
1808
|
-
const { unitId:
|
|
1831
|
+
const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, d = s.endRow, l = [], g = [], c = this._sheetDrawingService.getDrawingData(t, r), a = [], h = [];
|
|
1809
1832
|
if (Object.keys(c).forEach((u) => {
|
|
1810
1833
|
const m = c[u], { sheetTransform: f, transform: p, anchorType: I = y.Position } = m;
|
|
1811
1834
|
if (f == null || p == null)
|
|
@@ -1817,7 +1840,7 @@ let ot = class extends re {
|
|
|
1817
1840
|
} else {
|
|
1818
1841
|
const { from: _, to: C } = f, { row: w } = _, { row: O } = C;
|
|
1819
1842
|
if (I === y.Both && w >= o && O <= d)
|
|
1820
|
-
h.push({ unitId:
|
|
1843
|
+
h.push({ unitId: t, subUnitId: r, drawingId: u });
|
|
1821
1844
|
else {
|
|
1822
1845
|
const b = this._shrinkRow(f, p, o, d, I);
|
|
1823
1846
|
S = b == null ? void 0 : b.newSheetTransform, v = b == null ? void 0 : b.newTransform;
|
|
@@ -1825,28 +1848,28 @@ let ot = class extends re {
|
|
|
1825
1848
|
}
|
|
1826
1849
|
if (!S || !v)
|
|
1827
1850
|
return;
|
|
1828
|
-
const R = { unitId:
|
|
1851
|
+
const R = { unitId: t, subUnitId: r, drawingId: u, transform: v, sheetTransform: S };
|
|
1829
1852
|
a.push(R);
|
|
1830
1853
|
}), a.length === 0 && h.length === 0)
|
|
1831
1854
|
return { redos: [], undos: [] };
|
|
1832
1855
|
if (a.length > 0) {
|
|
1833
1856
|
const u = this._sheetDrawingService.getBatchUpdateOp(a), { undo: m, redo: f, objects: p } = u;
|
|
1834
|
-
l.push({ id: P.id, params: { unitId:
|
|
1857
|
+
l.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.UPDATE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.UPDATE } });
|
|
1835
1858
|
}
|
|
1836
1859
|
if (h.length > 0) {
|
|
1837
1860
|
const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
|
|
1838
|
-
l.push({ id: P.id, params: { unitId:
|
|
1861
|
+
l.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.INSERT } });
|
|
1839
1862
|
}
|
|
1840
|
-
return l.push({ id: j.id, params: [
|
|
1863
|
+
return l.push({ id: j.id, params: [t] }), g.push({ id: j.id, params: [t] }), {
|
|
1841
1864
|
redos: l,
|
|
1842
1865
|
undos: g
|
|
1843
1866
|
};
|
|
1844
1867
|
}
|
|
1845
1868
|
_moveColInterceptor(i, e) {
|
|
1846
|
-
const
|
|
1847
|
-
if (
|
|
1869
|
+
const n = this._getUnitIdAndSubUnitId(i, e);
|
|
1870
|
+
if (n == null)
|
|
1848
1871
|
return { redos: [], undos: [] };
|
|
1849
|
-
const { unitId:
|
|
1872
|
+
const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, d = s.endColumn, l = [], g = [], c = this._sheetDrawingService.getDrawingData(t, r), a = [], h = [];
|
|
1850
1873
|
if (Object.keys(c).forEach((u) => {
|
|
1851
1874
|
const m = c[u], { sheetTransform: f, transform: p, anchorType: I = y.Position } = m;
|
|
1852
1875
|
if (f == null || p == null)
|
|
@@ -1858,7 +1881,7 @@ let ot = class extends re {
|
|
|
1858
1881
|
} else {
|
|
1859
1882
|
const { from: _, to: C } = f, { column: w } = _, { column: O } = C;
|
|
1860
1883
|
if (I === y.Both && w >= o && O <= d)
|
|
1861
|
-
h.push({ unitId:
|
|
1884
|
+
h.push({ unitId: t, subUnitId: r, drawingId: u });
|
|
1862
1885
|
else {
|
|
1863
1886
|
const b = this._shrinkCol(f, p, o, d, I);
|
|
1864
1887
|
S = b == null ? void 0 : b.newSheetTransform, v = b == null ? void 0 : b.newTransform;
|
|
@@ -1866,39 +1889,39 @@ let ot = class extends re {
|
|
|
1866
1889
|
}
|
|
1867
1890
|
if (!S || !v)
|
|
1868
1891
|
return;
|
|
1869
|
-
const R = { unitId:
|
|
1892
|
+
const R = { unitId: t, subUnitId: r, drawingId: u, transform: v, sheetTransform: S };
|
|
1870
1893
|
a.push(R);
|
|
1871
1894
|
}), a.length === 0 && h.length === 0)
|
|
1872
1895
|
return { redos: [], undos: [] };
|
|
1873
1896
|
if (a.length > 0) {
|
|
1874
1897
|
const u = this._sheetDrawingService.getBatchUpdateOp(a), { undo: m, redo: f, objects: p } = u;
|
|
1875
|
-
l.push({ id: P.id, params: { unitId:
|
|
1898
|
+
l.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.UPDATE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.UPDATE } });
|
|
1876
1899
|
}
|
|
1877
1900
|
if (h.length > 0) {
|
|
1878
1901
|
const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
|
|
1879
|
-
l.push({ id: P.id, params: { unitId:
|
|
1902
|
+
l.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.INSERT } });
|
|
1880
1903
|
}
|
|
1881
|
-
return l.push({ id: j.id, params: [
|
|
1904
|
+
return l.push({ id: j.id, params: [t] }), g.push({ id: j.id, params: [t] }), { redos: l, undos: g };
|
|
1882
1905
|
}
|
|
1883
|
-
_expandCol(i, e,
|
|
1884
|
-
const s =
|
|
1906
|
+
_expandCol(i, e, n, t, r = y.Position) {
|
|
1907
|
+
const s = t - n + 1, { from: o, to: d } = i, { column: l } = o, { column: g } = d;
|
|
1885
1908
|
if (r === y.None)
|
|
1886
1909
|
return {
|
|
1887
1910
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1888
1911
|
newTransform: e
|
|
1889
1912
|
};
|
|
1890
1913
|
let c = null, a = null;
|
|
1891
|
-
if (l >=
|
|
1892
|
-
const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
1914
|
+
if (l >= n) {
|
|
1915
|
+
const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: d.row });
|
|
1893
1916
|
if (h == null)
|
|
1894
1917
|
return;
|
|
1895
1918
|
a = { ...e, left: (e.left || 0) + h.endX - h.startX }, c = N(a, this._selectionRenderService);
|
|
1896
|
-
} else if (g >=
|
|
1919
|
+
} else if (g >= t)
|
|
1897
1920
|
if (r === y.Both)
|
|
1898
1921
|
c = {
|
|
1899
1922
|
from: { ...o },
|
|
1900
1923
|
to: { ...d, column: g + s }
|
|
1901
|
-
}, a =
|
|
1924
|
+
}, a = B(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1902
1925
|
else
|
|
1903
1926
|
return {
|
|
1904
1927
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
@@ -1909,47 +1932,47 @@ let ot = class extends re {
|
|
|
1909
1932
|
newTransform: a
|
|
1910
1933
|
} : null;
|
|
1911
1934
|
}
|
|
1912
|
-
_shrinkCol(i, e,
|
|
1913
|
-
const s =
|
|
1935
|
+
_shrinkCol(i, e, n, t, r = y.Position) {
|
|
1936
|
+
const s = t - n + 1, { from: o, to: d } = i, { column: l } = o, { column: g } = d;
|
|
1914
1937
|
if (r === y.None)
|
|
1915
1938
|
return {
|
|
1916
1939
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1917
1940
|
newTransform: e
|
|
1918
1941
|
};
|
|
1919
1942
|
let c = null, a = null;
|
|
1920
|
-
if (l >
|
|
1943
|
+
if (l > t)
|
|
1921
1944
|
c = {
|
|
1922
1945
|
from: { ...o, column: l - s },
|
|
1923
1946
|
to: { ...d, column: g - s }
|
|
1924
|
-
}, a =
|
|
1947
|
+
}, a = B(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1925
1948
|
else {
|
|
1926
|
-
if (l >=
|
|
1949
|
+
if (l >= n && g <= t)
|
|
1927
1950
|
return null;
|
|
1928
|
-
if (l <
|
|
1951
|
+
if (l < n && g > t)
|
|
1929
1952
|
if (r === y.Both)
|
|
1930
1953
|
c = {
|
|
1931
1954
|
from: { ...o },
|
|
1932
1955
|
to: { ...d, column: g - s }
|
|
1933
|
-
}, a =
|
|
1956
|
+
}, a = B(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1934
1957
|
else
|
|
1935
1958
|
return {
|
|
1936
1959
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1937
1960
|
newTransform: e
|
|
1938
1961
|
};
|
|
1939
|
-
else if (l >=
|
|
1940
|
-
if (l ===
|
|
1962
|
+
else if (l >= n && l <= t) {
|
|
1963
|
+
if (l === n)
|
|
1941
1964
|
a = { ...e, left: (e.left || 0) - i.from.columnOffset };
|
|
1942
1965
|
else {
|
|
1943
|
-
const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
1966
|
+
const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: l - 1, startRow: o.row, endRow: d.row });
|
|
1944
1967
|
if (h == null)
|
|
1945
1968
|
return;
|
|
1946
1969
|
a = { ...e, left: (e.left || 0) - h.endX + h.startX - i.from.columnOffset };
|
|
1947
1970
|
}
|
|
1948
1971
|
c = N(a, this._selectionRenderService);
|
|
1949
|
-
} else if (g >=
|
|
1972
|
+
} else if (g >= n && g <= t && r === y.Both) {
|
|
1950
1973
|
const h = this._skeletonManagerService.attachRangeWithCoord({
|
|
1951
|
-
startColumn:
|
|
1952
|
-
endColumn:
|
|
1974
|
+
startColumn: n - 1,
|
|
1975
|
+
endColumn: n - 1,
|
|
1953
1976
|
startRow: o.row,
|
|
1954
1977
|
endRow: d.row
|
|
1955
1978
|
});
|
|
@@ -1957,8 +1980,8 @@ let ot = class extends re {
|
|
|
1957
1980
|
return;
|
|
1958
1981
|
c = {
|
|
1959
1982
|
from: { ...o },
|
|
1960
|
-
to: { ...d, column:
|
|
1961
|
-
}, a =
|
|
1983
|
+
to: { ...d, column: n - 1, columnOffset: h.endX - h.startX }
|
|
1984
|
+
}, a = B(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1962
1985
|
}
|
|
1963
1986
|
}
|
|
1964
1987
|
return c != null && a != null ? {
|
|
@@ -1966,20 +1989,20 @@ let ot = class extends re {
|
|
|
1966
1989
|
newTransform: a
|
|
1967
1990
|
} : null;
|
|
1968
1991
|
}
|
|
1969
|
-
_expandRow(i, e,
|
|
1970
|
-
const s =
|
|
1992
|
+
_expandRow(i, e, n, t, r = y.Position) {
|
|
1993
|
+
const s = t - n + 1, { from: o, to: d } = i, { row: l } = o, { row: g } = d;
|
|
1971
1994
|
if (r === y.None)
|
|
1972
1995
|
return {
|
|
1973
1996
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
1974
1997
|
newTransform: e
|
|
1975
1998
|
};
|
|
1976
1999
|
let c = null, a = null;
|
|
1977
|
-
if (l >=
|
|
1978
|
-
const h = this._skeletonManagerService.attachRangeWithCoord({ startRow:
|
|
2000
|
+
if (l >= n) {
|
|
2001
|
+
const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: d.column });
|
|
1979
2002
|
if (h == null)
|
|
1980
2003
|
return;
|
|
1981
2004
|
a = { ...e, top: (e.top || 0) + h.endY - h.startY }, c = N(a, this._selectionRenderService);
|
|
1982
|
-
} else if (g >=
|
|
2005
|
+
} else if (g >= t)
|
|
1983
2006
|
if (r === y.Both)
|
|
1984
2007
|
c = {
|
|
1985
2008
|
from: { ...o },
|
|
@@ -1987,7 +2010,7 @@ let ot = class extends re {
|
|
|
1987
2010
|
...d,
|
|
1988
2011
|
row: g + s
|
|
1989
2012
|
}
|
|
1990
|
-
}, a =
|
|
2013
|
+
}, a = B(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1991
2014
|
else
|
|
1992
2015
|
return {
|
|
1993
2016
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
@@ -1998,51 +2021,51 @@ let ot = class extends re {
|
|
|
1998
2021
|
newTransform: a
|
|
1999
2022
|
} : null;
|
|
2000
2023
|
}
|
|
2001
|
-
_shrinkRow(i, e,
|
|
2002
|
-
const s =
|
|
2024
|
+
_shrinkRow(i, e, n, t, r = y.Position) {
|
|
2025
|
+
const s = t - n + 1, { from: o, to: d } = i, { row: l } = o, { row: g } = d;
|
|
2003
2026
|
if (r === y.None)
|
|
2004
2027
|
return {
|
|
2005
2028
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
2006
2029
|
newTransform: e
|
|
2007
2030
|
};
|
|
2008
2031
|
let c = null, a = null;
|
|
2009
|
-
if (l >
|
|
2032
|
+
if (l > t)
|
|
2010
2033
|
c = {
|
|
2011
2034
|
from: { ...o, row: l - s },
|
|
2012
2035
|
to: { ...d, row: g - s }
|
|
2013
|
-
}, a =
|
|
2036
|
+
}, a = B(c, this._selectionRenderService, this._skeletonManagerService);
|
|
2014
2037
|
else {
|
|
2015
|
-
if (l >=
|
|
2038
|
+
if (l >= n && g <= t)
|
|
2016
2039
|
return null;
|
|
2017
|
-
if (l <
|
|
2040
|
+
if (l < n && g > t)
|
|
2018
2041
|
if (r === y.Both)
|
|
2019
2042
|
c = {
|
|
2020
2043
|
from: { ...o },
|
|
2021
2044
|
to: { ...d, row: g - s }
|
|
2022
|
-
}, a =
|
|
2045
|
+
}, a = B(c, this._selectionRenderService, this._skeletonManagerService);
|
|
2023
2046
|
else
|
|
2024
2047
|
return {
|
|
2025
2048
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
2026
2049
|
newTransform: e
|
|
2027
2050
|
};
|
|
2028
|
-
else if (l >=
|
|
2029
|
-
if (l ===
|
|
2051
|
+
else if (l >= n && l <= t) {
|
|
2052
|
+
if (l === n)
|
|
2030
2053
|
a = { ...e, top: (e.top || 0) - i.from.rowOffset };
|
|
2031
2054
|
else {
|
|
2032
|
-
const h = this._skeletonManagerService.attachRangeWithCoord({ startRow:
|
|
2055
|
+
const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: l - 1, startColumn: o.column, endColumn: d.column });
|
|
2033
2056
|
if (h == null)
|
|
2034
2057
|
return;
|
|
2035
2058
|
a = { ...e, top: (e.top || 0) - h.endY + h.startY - i.from.rowOffset };
|
|
2036
2059
|
}
|
|
2037
2060
|
c = N(a, this._selectionRenderService);
|
|
2038
|
-
} else if (g >=
|
|
2039
|
-
const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow:
|
|
2061
|
+
} else if (g >= n && g <= t && r === y.Both) {
|
|
2062
|
+
const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: n - 1, endRow: n - 1 });
|
|
2040
2063
|
if (h == null)
|
|
2041
2064
|
return;
|
|
2042
2065
|
c = {
|
|
2043
2066
|
from: { ...o },
|
|
2044
|
-
to: { ...d, row:
|
|
2045
|
-
}, a =
|
|
2067
|
+
to: { ...d, row: n - 1, rowOffset: h.endY - h.startY }
|
|
2068
|
+
}, a = B(c, this._selectionRenderService, this._skeletonManagerService);
|
|
2046
2069
|
}
|
|
2047
2070
|
}
|
|
2048
2071
|
return c != null && a != null ? {
|
|
@@ -2053,16 +2076,16 @@ let ot = class extends re {
|
|
|
2053
2076
|
_commandListener() {
|
|
2054
2077
|
this.disposeWithMe(
|
|
2055
2078
|
this._commandService.onCommandExecuted((i) => {
|
|
2056
|
-
i.id ===
|
|
2057
|
-
const e = i.params, { unitId:
|
|
2079
|
+
i.id === Dr.id && setTimeout(() => {
|
|
2080
|
+
const e = i.params, { unitId: n, subUnitId: t } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
|
|
2058
2081
|
Object.keys(r).forEach((d) => {
|
|
2059
2082
|
const l = r[d];
|
|
2060
2083
|
l != null && Object.keys(l).forEach((g) => {
|
|
2061
2084
|
const c = l[g].data;
|
|
2062
2085
|
c != null && Object.keys(c).forEach((a) => {
|
|
2063
|
-
if (d ===
|
|
2086
|
+
if (d === n && g === t) {
|
|
2064
2087
|
const h = c[a];
|
|
2065
|
-
h.transform =
|
|
2088
|
+
h.transform = B(h.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(c[a]);
|
|
2066
2089
|
} else
|
|
2067
2090
|
o.push(c[a]);
|
|
2068
2091
|
});
|
|
@@ -2075,23 +2098,23 @@ let ot = class extends re {
|
|
|
2075
2098
|
_sheetRefreshListener() {
|
|
2076
2099
|
this.disposeWithMe(
|
|
2077
2100
|
this._commandService.onCommandExecuted((i) => {
|
|
2078
|
-
|
|
2079
|
-
const e = i.params, { unitId:
|
|
2080
|
-
this._refreshDrawingTransform(
|
|
2101
|
+
Fi.includes(i.id) && requestIdleCallback(() => {
|
|
2102
|
+
const e = i.params, { unitId: n, subUnitId: t, ranges: r } = e;
|
|
2103
|
+
this._refreshDrawingTransform(n, t, r);
|
|
2081
2104
|
});
|
|
2082
2105
|
})
|
|
2083
2106
|
);
|
|
2084
2107
|
}
|
|
2085
|
-
_refreshDrawingTransform(i, e,
|
|
2086
|
-
const
|
|
2087
|
-
Object.keys(
|
|
2088
|
-
const o =
|
|
2108
|
+
_refreshDrawingTransform(i, e, n) {
|
|
2109
|
+
const t = this._drawingManagerService.getDrawingData(i, e), r = [];
|
|
2110
|
+
Object.keys(t).forEach((s) => {
|
|
2111
|
+
const o = t[s], { sheetTransform: d, transform: l, anchorType: g = y.Position } = o;
|
|
2089
2112
|
if (g === y.None)
|
|
2090
2113
|
return !0;
|
|
2091
2114
|
const { from: c, to: a } = d, { row: h, column: u } = c, { row: m, column: f } = a;
|
|
2092
|
-
for (let p = 0; p <
|
|
2093
|
-
const I =
|
|
2094
|
-
if (
|
|
2115
|
+
for (let p = 0; p < n.length; p++) {
|
|
2116
|
+
const I = n[p], { startRow: S, endRow: v, startColumn: R, endColumn: _ } = I;
|
|
2117
|
+
if (Rn.intersects(
|
|
2095
2118
|
{
|
|
2096
2119
|
startRow: S,
|
|
2097
2120
|
endRow: v,
|
|
@@ -2105,7 +2128,7 @@ let ot = class extends re {
|
|
|
2105
2128
|
endColumn: f
|
|
2106
2129
|
}
|
|
2107
2130
|
) || h > v || u > _) {
|
|
2108
|
-
const C = g === y.Position, w =
|
|
2131
|
+
const C = g === y.Position, w = B(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2109
2132
|
r.push({
|
|
2110
2133
|
...o,
|
|
2111
2134
|
transform: {
|
|
@@ -2120,23 +2143,23 @@ let ot = class extends re {
|
|
|
2120
2143
|
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(j.id, [i]));
|
|
2121
2144
|
}
|
|
2122
2145
|
};
|
|
2123
|
-
ot =
|
|
2146
|
+
ot = ki([
|
|
2124
2147
|
Q(1, J),
|
|
2125
2148
|
Q(2, W),
|
|
2126
2149
|
Q(3, pe),
|
|
2127
|
-
Q(4,
|
|
2128
|
-
Q(5,
|
|
2150
|
+
Q(4, x(q)),
|
|
2151
|
+
Q(5, x(at)),
|
|
2129
2152
|
Q(6, F),
|
|
2130
2153
|
Q(7, K),
|
|
2131
2154
|
Q(8, fe)
|
|
2132
2155
|
], ot);
|
|
2133
|
-
var
|
|
2134
|
-
for (var r =
|
|
2135
|
-
(o = i[s]) && (r = (
|
|
2136
|
-
return
|
|
2137
|
-
}, se = (i, e) => (
|
|
2138
|
-
function
|
|
2139
|
-
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(
|
|
2156
|
+
var Xi = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, zi = (i, e, n, t) => {
|
|
2157
|
+
for (var r = t > 1 ? void 0 : t ? Hi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2158
|
+
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2159
|
+
return t && r && Xi(e, n, r), r;
|
|
2160
|
+
}, se = (i, e) => (n, t) => e(n, t, i);
|
|
2161
|
+
function Ki(i, e, n, t) {
|
|
2162
|
+
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(zn.VIEW_MAIN), d = {
|
|
2140
2163
|
left: !0,
|
|
2141
2164
|
top: !0
|
|
2142
2165
|
};
|
|
@@ -2145,7 +2168,7 @@ function xi(i, e, t, n) {
|
|
|
2145
2168
|
...i,
|
|
2146
2169
|
absolute: d
|
|
2147
2170
|
};
|
|
2148
|
-
const { left: l, right: g, top: c, bottom: a } = i, h =
|
|
2171
|
+
const { left: l, right: g, top: c, bottom: a } = i, h = t.getFreeze(), { startColumn: u, startRow: m, xSplit: f, ySplit: p } = h, I = n.getNoMergeCellPositionByIndexWithNoHeader(m - p, u - f), S = n.getNoMergeCellPositionByIndexWithNoHeader(m, u), { rowHeaderWidth: v, columnHeaderHeight: R } = n, _ = S.startX - I.startX, C = S.startY - I.startY, { top: w, left: O, viewportScrollX: b, viewportScrollY: A } = o;
|
|
2149
2172
|
let E, M;
|
|
2150
2173
|
l < O ? (d.left = !0, E = (_ + v + (l - O)) * r, M = Math.max(
|
|
2151
2174
|
Math.min(
|
|
@@ -2169,13 +2192,13 @@ function xi(i, e, t, n) {
|
|
|
2169
2192
|
absolute: d
|
|
2170
2193
|
};
|
|
2171
2194
|
}
|
|
2172
|
-
const Qe = (i, e,
|
|
2195
|
+
const Qe = (i, e, n, t) => {
|
|
2173
2196
|
const { scene: r } = e, { left: s, top: o, width: d, height: l, angle: g } = i, c = {
|
|
2174
2197
|
left: s,
|
|
2175
2198
|
right: s + d,
|
|
2176
2199
|
top: o,
|
|
2177
2200
|
bottom: o + l
|
|
2178
|
-
}, a =
|
|
2201
|
+
}, a = Ki(c, r, n, t), { scaleX: h, scaleY: u } = r.getAncestorScale();
|
|
2179
2202
|
return {
|
|
2180
2203
|
startX: a.left,
|
|
2181
2204
|
endX: a.right,
|
|
@@ -2187,30 +2210,30 @@ const Qe = (i, e, t, n) => {
|
|
|
2187
2210
|
absolute: a.absolute
|
|
2188
2211
|
};
|
|
2189
2212
|
};
|
|
2190
|
-
let
|
|
2191
|
-
constructor(e,
|
|
2213
|
+
let $e = class extends re {
|
|
2214
|
+
constructor(e, n, t, r, s, o, d) {
|
|
2192
2215
|
super();
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
this._renderManagerService = e, this._univerInstanceService =
|
|
2216
|
+
V(this, "_domLayerMap", /* @__PURE__ */ new Map());
|
|
2217
|
+
V(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
2218
|
+
V(this, "_transformChange$", new Ke());
|
|
2219
|
+
V(this, "transformChange$", this._transformChange$.asObservable());
|
|
2220
|
+
V(this, "_add$", new Ke());
|
|
2221
|
+
V(this, "add$", this._add$.asObservable());
|
|
2222
|
+
V(this, "_remove$", new Ke());
|
|
2223
|
+
V(this, "remove$", this._remove$.asObservable());
|
|
2224
|
+
V(this, "_hooks", []);
|
|
2225
|
+
this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = d, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
2203
2226
|
}
|
|
2204
2227
|
_bindScrollEvent() {
|
|
2205
|
-
this._lifecycleService.lifecycle$.pipe(ae((e) => e ===
|
|
2228
|
+
this._lifecycleService.lifecycle$.pipe(ae((e) => e === Mn.Rendered), gr(1)).subscribe(() => {
|
|
2206
2229
|
this._scrollUpdateListener();
|
|
2207
2230
|
});
|
|
2208
2231
|
}
|
|
2209
|
-
_ensureMap(e,
|
|
2210
|
-
let
|
|
2211
|
-
|
|
2212
|
-
let r =
|
|
2213
|
-
return r || (r = /* @__PURE__ */ new Map(),
|
|
2232
|
+
_ensureMap(e, n) {
|
|
2233
|
+
let t = this._domLayerMap.get(e);
|
|
2234
|
+
t || (t = /* @__PURE__ */ new Map(), this._domLayerMap.set(e, t));
|
|
2235
|
+
let r = t.get(n);
|
|
2236
|
+
return r || (r = /* @__PURE__ */ new Map(), t.set(n, r)), r;
|
|
2214
2237
|
}
|
|
2215
2238
|
getFloatDomInfo(e) {
|
|
2216
2239
|
return this._domLayerInfoMap.get(e);
|
|
@@ -2218,38 +2241,38 @@ let We = class extends re {
|
|
|
2218
2241
|
_getSceneAndTransformerByDrawingSearch(e) {
|
|
2219
2242
|
if (e == null)
|
|
2220
2243
|
return;
|
|
2221
|
-
const
|
|
2222
|
-
if (
|
|
2244
|
+
const n = this._renderManagerService.getRenderById(e), t = n == null ? void 0 : n.scene;
|
|
2245
|
+
if (n == null || t == null)
|
|
2223
2246
|
return null;
|
|
2224
|
-
const r =
|
|
2225
|
-
return { scene:
|
|
2247
|
+
const r = t.getTransformerByCreate(), s = n.engine.getCanvasElement();
|
|
2248
|
+
return { scene: t, transformer: r, renderObject: n, canvas: s };
|
|
2226
2249
|
}
|
|
2227
2250
|
_getFloatDomProps(e) {
|
|
2228
|
-
let
|
|
2229
|
-
return this._hooks.forEach((
|
|
2230
|
-
|
|
2231
|
-
}),
|
|
2251
|
+
let n;
|
|
2252
|
+
return this._hooks.forEach((t) => {
|
|
2253
|
+
n = t.onGetFloatDomProps(e);
|
|
2254
|
+
}), n;
|
|
2232
2255
|
}
|
|
2233
2256
|
// eslint-disable-next-line max-lines-per-function
|
|
2234
2257
|
_drawingAddListener() {
|
|
2235
2258
|
this.disposeWithMe(
|
|
2236
2259
|
// eslint-disable-next-line max-lines-per-function
|
|
2237
2260
|
this._drawingManagerService.add$.subscribe((e) => {
|
|
2238
|
-
e.forEach((
|
|
2261
|
+
e.forEach((n) => {
|
|
2239
2262
|
var ut, ht, gt;
|
|
2240
|
-
const { unitId:
|
|
2263
|
+
const { unitId: t, subUnitId: r, drawingId: s } = n, o = ce(this._univerInstanceService, { unitId: t, subUnitId: r }), d = this._drawingManagerService.getDrawingByParam(n), l = this._univerInstanceService.getUnit(t);
|
|
2241
2264
|
if (!l)
|
|
2242
2265
|
return;
|
|
2243
2266
|
const g = l.getActiveSheet().getSheetId();
|
|
2244
2267
|
if (!d || !o)
|
|
2245
2268
|
return;
|
|
2246
|
-
const c = (ut = this._renderManagerService.getRenderById(
|
|
2269
|
+
const c = (ut = this._renderManagerService.getRenderById(t)) == null ? void 0 : ut.with(q).getWorksheetSkeleton(r);
|
|
2247
2270
|
if (!c)
|
|
2248
2271
|
return;
|
|
2249
2272
|
const { transform: a, drawingType: h, data: u } = d;
|
|
2250
2273
|
if (h !== k.DRAWING_DOM && h !== k.DRAWING_CHART)
|
|
2251
2274
|
return;
|
|
2252
|
-
const m = this._getSceneAndTransformerByDrawingSearch(
|
|
2275
|
+
const m = this._getSceneAndTransformerByDrawingSearch(t);
|
|
2253
2276
|
if (m == null)
|
|
2254
2277
|
return;
|
|
2255
2278
|
const { scene: f, canvas: p } = m;
|
|
@@ -2257,7 +2280,7 @@ let We = class extends re {
|
|
|
2257
2280
|
return !0;
|
|
2258
2281
|
if (g !== r)
|
|
2259
2282
|
return;
|
|
2260
|
-
const { left: I, top: S, width: v, height: R, angle: _, flipX: C, flipY: w, skewX: O, skewY: b } = a, A = ze({ unitId:
|
|
2283
|
+
const { left: I, top: S, width: v, height: R, angle: _, flipX: C, flipY: w, skewX: O, skewY: b } = a, A = ze({ unitId: t, subUnitId: r, drawingId: s }), E = f.getObject(A);
|
|
2261
2284
|
if (E != null) {
|
|
2262
2285
|
E.transformByState({ left: I, top: S, width: v, height: R, angle: _, flipX: C, flipY: w, skewX: O, skewY: b });
|
|
2263
2286
|
return;
|
|
@@ -2267,16 +2290,16 @@ let We = class extends re {
|
|
|
2267
2290
|
top: S,
|
|
2268
2291
|
width: v,
|
|
2269
2292
|
height: R,
|
|
2270
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2293
|
+
zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
|
|
2271
2294
|
}, D = h === k.DRAWING_CHART;
|
|
2272
2295
|
D && (M.fill = "white", M.rotateEnabled = !1, u && u.border && (M.stroke = u.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8);
|
|
2273
2296
|
const U = new wt(A, M);
|
|
2274
|
-
D && U.setObjectType(
|
|
2275
|
-
const L = this._ensureMap(
|
|
2297
|
+
D && U.setObjectType(Xn.CHART), f.addObject(U, Hn), d.allowTransform !== !1 && f.attachTransformerTo(U);
|
|
2298
|
+
const L = this._ensureMap(t, r), Z = new bn(), un = Qe(U, m.renderObject, c.skeleton, o.worksheet), Fe = new mr(un), hn = {
|
|
2276
2299
|
dispose: Z,
|
|
2277
2300
|
rect: U,
|
|
2278
2301
|
position$: Fe,
|
|
2279
|
-
unitId:
|
|
2302
|
+
unitId: t,
|
|
2280
2303
|
subUnitId: r
|
|
2281
2304
|
};
|
|
2282
2305
|
this._canvasFloatDomService.addFloatDom({
|
|
@@ -2297,7 +2320,7 @@ let We = class extends re {
|
|
|
2297
2320
|
},
|
|
2298
2321
|
props: (gt = (ht = L.get(s)) == null ? void 0 : ht.props) != null ? gt : this._getFloatDomProps(s),
|
|
2299
2322
|
data: u,
|
|
2300
|
-
unitId:
|
|
2323
|
+
unitId: t
|
|
2301
2324
|
});
|
|
2302
2325
|
const lt = U.onTransformChange$.subscribeEvent(() => {
|
|
2303
2326
|
const G = Qe(U, m.renderObject, c.skeleton, o.worksheet);
|
|
@@ -2307,15 +2330,15 @@ let We = class extends re {
|
|
|
2307
2330
|
});
|
|
2308
2331
|
Z.add(() => {
|
|
2309
2332
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
2310
|
-
}), lt && Z.add(lt), this._domLayerInfoMap.set(s,
|
|
2333
|
+
}), lt && Z.add(lt), this._domLayerInfoMap.set(s, hn), L.set(s, {
|
|
2311
2334
|
...L.get(s)
|
|
2312
2335
|
});
|
|
2313
2336
|
});
|
|
2314
2337
|
})
|
|
2315
2338
|
), this.disposeWithMe(
|
|
2316
2339
|
this._drawingManagerService.remove$.subscribe((e) => {
|
|
2317
|
-
e.forEach((
|
|
2318
|
-
const { unitId:
|
|
2340
|
+
e.forEach((n) => {
|
|
2341
|
+
const { unitId: t, subUnitId: r, drawingId: s } = n, o = ze({ unitId: t, subUnitId: r, drawingId: s }), d = this._getSceneAndTransformerByDrawingSearch(t);
|
|
2319
2342
|
if (d == null)
|
|
2320
2343
|
return;
|
|
2321
2344
|
const { transformer: l, scene: g } = d, c = g.getObject(o);
|
|
@@ -2325,9 +2348,9 @@ let We = class extends re {
|
|
|
2325
2348
|
);
|
|
2326
2349
|
}
|
|
2327
2350
|
_scrollUpdateListener() {
|
|
2328
|
-
const e = (
|
|
2351
|
+
const e = (n, t) => {
|
|
2329
2352
|
var g;
|
|
2330
|
-
const r = this._getSceneAndTransformerByDrawingSearch(
|
|
2353
|
+
const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), d = ce(this._univerInstanceService, { unitId: n, subUnitId: t }), l = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(q).getWorksheetSkeleton(t);
|
|
2331
2354
|
!r || !d || !l || o.forEach((c) => {
|
|
2332
2355
|
const a = this._domLayerInfoMap.get(c);
|
|
2333
2356
|
if (a) {
|
|
@@ -2338,42 +2361,42 @@ let We = class extends re {
|
|
|
2338
2361
|
};
|
|
2339
2362
|
this.disposeWithMe(
|
|
2340
2363
|
this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(
|
|
2341
|
-
ae((
|
|
2342
|
-
Ee((
|
|
2343
|
-
const
|
|
2344
|
-
return
|
|
2364
|
+
ae((n) => !!n),
|
|
2365
|
+
Ee((n) => {
|
|
2366
|
+
const t = this._renderManagerService.getRenderById(n.getUnitId());
|
|
2367
|
+
return t ? { render: t, unitId: n.getUnitId(), subUnitId: n.getActiveSheet().getSheetId() } : null;
|
|
2345
2368
|
}),
|
|
2346
|
-
ae((
|
|
2347
|
-
|
|
2348
|
-
(
|
|
2369
|
+
ae((n) => !!n),
|
|
2370
|
+
fr(
|
|
2371
|
+
(n) => yn(n.render.scene.getViewport(tr.VIEW_MAIN).onScrollAfter$).pipe(Ee(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
|
|
2349
2372
|
)
|
|
2350
|
-
).subscribe(({ unitId:
|
|
2351
|
-
e(
|
|
2373
|
+
).subscribe(({ unitId: n, subUnitId: t }) => {
|
|
2374
|
+
e(n, t);
|
|
2352
2375
|
})
|
|
2353
|
-
), this.disposeWithMe(this._commandService.onCommandExecuted((
|
|
2354
|
-
var
|
|
2355
|
-
if (
|
|
2356
|
-
const s =
|
|
2357
|
-
Array.from((r = (
|
|
2376
|
+
), this.disposeWithMe(this._commandService.onCommandExecuted((n) => {
|
|
2377
|
+
var t, r;
|
|
2378
|
+
if (n.id === nr.id) {
|
|
2379
|
+
const s = n.params, { unitId: o } = s;
|
|
2380
|
+
Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((l) => {
|
|
2358
2381
|
e(o, l);
|
|
2359
2382
|
});
|
|
2360
|
-
} else if (
|
|
2361
|
-
const { unitId: s, subUnitId: o } =
|
|
2383
|
+
} else if (n.id === Mr.id) {
|
|
2384
|
+
const { unitId: s, subUnitId: o } = n.params;
|
|
2362
2385
|
e(s, o);
|
|
2363
2386
|
}
|
|
2364
2387
|
}));
|
|
2365
2388
|
}
|
|
2366
|
-
_getPosition(e,
|
|
2389
|
+
_getPosition(e, n) {
|
|
2367
2390
|
var h;
|
|
2368
|
-
const { startX:
|
|
2391
|
+
const { startX: t, endX: r, startY: s, endY: o } = e, d = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(pe);
|
|
2369
2392
|
if (d == null)
|
|
2370
2393
|
return;
|
|
2371
|
-
const l = d.getSelectionCellByPosition(
|
|
2394
|
+
const l = d.getSelectionCellByPosition(t, s);
|
|
2372
2395
|
if (l == null)
|
|
2373
2396
|
return;
|
|
2374
2397
|
const g = {
|
|
2375
2398
|
column: l.actualColumn,
|
|
2376
|
-
columnOffset:
|
|
2399
|
+
columnOffset: t - l.startX,
|
|
2377
2400
|
row: l.actualRow,
|
|
2378
2401
|
rowOffset: s - l.startY
|
|
2379
2402
|
}, c = d.getSelectionCellByPosition(r, o);
|
|
@@ -2393,14 +2416,14 @@ let We = class extends re {
|
|
|
2393
2416
|
_featureUpdateListener() {
|
|
2394
2417
|
this.disposeWithMe(
|
|
2395
2418
|
this._drawingManagerService.update$.subscribe((e) => {
|
|
2396
|
-
e.forEach((
|
|
2397
|
-
const
|
|
2398
|
-
if (!
|
|
2419
|
+
e.forEach((n) => {
|
|
2420
|
+
const t = this._drawingManagerService.getDrawingByParam(n);
|
|
2421
|
+
if (!t || t.drawingType !== k.DRAWING_DOM && t.drawingType !== k.DRAWING_CHART)
|
|
2399
2422
|
return;
|
|
2400
2423
|
const r = {
|
|
2401
|
-
...
|
|
2424
|
+
...t.transform
|
|
2402
2425
|
};
|
|
2403
|
-
this._transformChange$.next({ id:
|
|
2426
|
+
this._transformChange$.next({ id: n.drawingId, value: r });
|
|
2404
2427
|
});
|
|
2405
2428
|
})
|
|
2406
2429
|
);
|
|
@@ -2408,27 +2431,27 @@ let We = class extends re {
|
|
|
2408
2431
|
_deleteListener() {
|
|
2409
2432
|
this.disposeWithMe(
|
|
2410
2433
|
this._drawingManagerService.remove$.subscribe((e) => {
|
|
2411
|
-
e.forEach((
|
|
2412
|
-
this._removeDom(
|
|
2434
|
+
e.forEach((n) => {
|
|
2435
|
+
this._removeDom(n.drawingId);
|
|
2413
2436
|
});
|
|
2414
2437
|
})
|
|
2415
2438
|
);
|
|
2416
2439
|
}
|
|
2417
|
-
updateFloatDomProps(e,
|
|
2418
|
-
const s = this._domLayerInfoMap.get(
|
|
2440
|
+
updateFloatDomProps(e, n, t, r) {
|
|
2441
|
+
const s = this._domLayerInfoMap.get(t), o = this._getSceneAndTransformerByDrawingSearch(e);
|
|
2419
2442
|
if (s && o) {
|
|
2420
|
-
const { scene: d } = o, l = ze({ unitId: e, subUnitId:
|
|
2443
|
+
const { scene: d } = o, l = ze({ unitId: e, subUnitId: n, drawingId: t }), g = d.getObject(l);
|
|
2421
2444
|
g && g instanceof wt && g.setProps(r);
|
|
2422
2445
|
}
|
|
2423
2446
|
}
|
|
2424
|
-
addFloatDomToPosition(e,
|
|
2425
|
-
const
|
|
2447
|
+
addFloatDomToPosition(e, n) {
|
|
2448
|
+
const t = ce(this._univerInstanceService, {
|
|
2426
2449
|
unitId: e.unitId,
|
|
2427
2450
|
subUnitId: e.subUnitId
|
|
2428
2451
|
});
|
|
2429
|
-
if (!
|
|
2452
|
+
if (!t)
|
|
2430
2453
|
throw new Error("cannot find current target!");
|
|
2431
|
-
const { unitId: r, subUnitId: s } =
|
|
2454
|
+
const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: d, data: l, allowTransform: g = !0 } = e, c = n != null ? n : On(), a = this._getPosition(o, r);
|
|
2432
2455
|
if (a == null)
|
|
2433
2456
|
return;
|
|
2434
2457
|
this._ensureMap(r, s).set(c, e);
|
|
@@ -2458,14 +2481,14 @@ let We = class extends re {
|
|
|
2458
2481
|
}
|
|
2459
2482
|
};
|
|
2460
2483
|
}
|
|
2461
|
-
_removeDom(e,
|
|
2462
|
-
const
|
|
2463
|
-
if (!
|
|
2484
|
+
_removeDom(e, n = !1) {
|
|
2485
|
+
const t = this._domLayerInfoMap.get(e);
|
|
2486
|
+
if (!t)
|
|
2464
2487
|
return;
|
|
2465
|
-
const { unitId: r, subUnitId: s } =
|
|
2466
|
-
this._domLayerInfoMap.delete(e),
|
|
2488
|
+
const { unitId: r, subUnitId: s } = t;
|
|
2489
|
+
this._domLayerInfoMap.delete(e), t.dispose.dispose();
|
|
2467
2490
|
const o = this._getSceneAndTransformerByDrawingSearch(r);
|
|
2468
|
-
if (o && o.scene.removeObject(
|
|
2491
|
+
if (o && o.scene.removeObject(t.rect), n) {
|
|
2469
2492
|
this._ensureMap(r, s).delete(e);
|
|
2470
2493
|
const l = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: e });
|
|
2471
2494
|
if (!l)
|
|
@@ -2477,63 +2500,63 @@ let We = class extends re {
|
|
|
2477
2500
|
addHook(e) {
|
|
2478
2501
|
return this._hooks.push(e), {
|
|
2479
2502
|
dispose: () => {
|
|
2480
|
-
const
|
|
2481
|
-
this._hooks.splice(
|
|
2503
|
+
const n = this._hooks.findIndex((t) => t === e);
|
|
2504
|
+
this._hooks.splice(n, 1);
|
|
2482
2505
|
}
|
|
2483
2506
|
};
|
|
2484
2507
|
}
|
|
2485
2508
|
};
|
|
2486
|
-
|
|
2487
|
-
se(0,
|
|
2509
|
+
$e = zi([
|
|
2510
|
+
se(0, x(J)),
|
|
2488
2511
|
se(1, fe),
|
|
2489
|
-
se(2,
|
|
2512
|
+
se(2, x(W)),
|
|
2490
2513
|
se(3, K),
|
|
2491
|
-
se(4,
|
|
2514
|
+
se(4, x(hr)),
|
|
2492
2515
|
se(5, F),
|
|
2493
|
-
se(6,
|
|
2494
|
-
],
|
|
2495
|
-
var
|
|
2496
|
-
for (var r =
|
|
2497
|
-
(o = i[s]) && (r = (
|
|
2498
|
-
return
|
|
2499
|
-
}, et = (i, e) => (
|
|
2500
|
-
const
|
|
2501
|
-
let
|
|
2502
|
-
constructor(i =
|
|
2503
|
-
super(), this._config = i, this._injector = e, this._renderManagerService =
|
|
2516
|
+
se(6, x(Dn))
|
|
2517
|
+
], $e);
|
|
2518
|
+
var dn = Object.defineProperty, Ji = Object.getOwnPropertyDescriptor, Zi = (i, e, n) => e in i ? dn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, qi = (i, e, n, t) => {
|
|
2519
|
+
for (var r = t > 1 ? void 0 : t ? Ji(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2520
|
+
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2521
|
+
return t && r && dn(e, n, r), r;
|
|
2522
|
+
}, et = (i, e) => (n, t) => e(n, t, i), ln = (i, e, n) => Zi(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2523
|
+
const Qi = "SHEET_IMAGE_UI_PLUGIN";
|
|
2524
|
+
let Be = class extends Tn {
|
|
2525
|
+
constructor(i = Pr, e, n, t) {
|
|
2526
|
+
super(), this._config = i, this._injector = e, this._renderManagerService = n, this._configService = t;
|
|
2504
2527
|
const { menu: r, ...s } = this._config;
|
|
2505
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
2528
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Or, s);
|
|
2506
2529
|
}
|
|
2507
2530
|
onStarting() {
|
|
2508
|
-
|
|
2509
|
-
[We],
|
|
2510
|
-
[je],
|
|
2511
|
-
[Ae],
|
|
2531
|
+
En(this._injector, [
|
|
2512
2532
|
[$e],
|
|
2533
|
+
[Ne],
|
|
2534
|
+
[Ue],
|
|
2513
2535
|
[Le],
|
|
2514
|
-
[
|
|
2536
|
+
[xe],
|
|
2537
|
+
[je]
|
|
2515
2538
|
]), Xe(this._injector, [
|
|
2516
|
-
[
|
|
2539
|
+
[$e]
|
|
2517
2540
|
]);
|
|
2518
2541
|
}
|
|
2519
2542
|
onReady() {
|
|
2520
2543
|
Xe(this._injector, [
|
|
2521
|
-
[
|
|
2544
|
+
[je]
|
|
2522
2545
|
]);
|
|
2523
2546
|
}
|
|
2524
2547
|
onRendered() {
|
|
2525
2548
|
this._registerRenderModules(), Xe(this._injector, [
|
|
2549
|
+
[xe],
|
|
2526
2550
|
[Le],
|
|
2527
|
-
[
|
|
2528
|
-
[je]
|
|
2551
|
+
[Ne]
|
|
2529
2552
|
]);
|
|
2530
2553
|
}
|
|
2531
2554
|
onSteady() {
|
|
2532
|
-
this._injector.get(
|
|
2555
|
+
this._injector.get(Ue);
|
|
2533
2556
|
}
|
|
2534
2557
|
_registerRenderModules() {
|
|
2535
2558
|
[
|
|
2536
|
-
[
|
|
2559
|
+
[Ae],
|
|
2537
2560
|
[ot],
|
|
2538
2561
|
[st]
|
|
2539
2562
|
].forEach((i) => {
|
|
@@ -2541,28 +2564,28 @@ let Ge = class extends yn {
|
|
|
2541
2564
|
});
|
|
2542
2565
|
}
|
|
2543
2566
|
};
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
et(1,
|
|
2567
|
+
ln(Be, "type", Y.UNIVER_SHEET);
|
|
2568
|
+
ln(Be, "pluginName", Qi);
|
|
2569
|
+
Be = qi([
|
|
2570
|
+
Pn(xn, kn, Kn),
|
|
2571
|
+
et(1, x(Ct)),
|
|
2549
2572
|
et(2, J),
|
|
2550
|
-
et(3,
|
|
2551
|
-
],
|
|
2573
|
+
et(3, Un)
|
|
2574
|
+
], Be);
|
|
2552
2575
|
export {
|
|
2553
2576
|
j as ClearSheetDrawingTransformerOperation,
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2577
|
+
tn as DeleteDrawingsCommand,
|
|
2578
|
+
Kt as EditSheetDrawingOperation,
|
|
2579
|
+
nn as GroupSheetDrawingCommand,
|
|
2580
|
+
an as IMAGE_MENU_ID,
|
|
2558
2581
|
dt as InsertFloatImageCommand,
|
|
2559
2582
|
ke as InsertSheetDrawingCommand,
|
|
2560
2583
|
we as MoveDrawingsCommand,
|
|
2561
|
-
|
|
2562
|
-
|
|
2584
|
+
Ge as RemoveSheetDrawingCommand,
|
|
2585
|
+
rn as SetDrawingArrangeCommand,
|
|
2563
2586
|
Ye as SetSheetDrawingCommand,
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2587
|
+
$e as SheetCanvasFloatDomManagerService,
|
|
2588
|
+
zt as SidebarSheetDrawingOperation,
|
|
2589
|
+
sn as UngroupSheetDrawingCommand,
|
|
2590
|
+
Be as UniverSheetsDrawingUIPlugin
|
|
2568
2591
|
};
|