@univerjs/sheets-drawing-ui 0.5.0-alpha.0 → 0.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +392 -390
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/types/controllers/sheet-drawing-update.controller.d.ts +2 -2
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +14 -14
package/lib/es/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var V = (i, e, n) =>
|
|
4
|
-
import { CommandType as H, ICommandService as
|
|
5
|
-
import { IDrawingManagerService as K, IImageIoService as
|
|
6
|
-
import { ImageCropperObject as
|
|
7
|
-
import { IRenderManagerService as J, precisionTo as ne, getGroupState as
|
|
8
|
-
import { ISheetDrawingService as F, SetDrawingApplyMutation as
|
|
9
|
-
import { SheetCanvasPopManagerService as
|
|
10
|
-
import { ISidebarService as
|
|
11
|
-
import { takeUntil as vt, combineLatest as
|
|
12
|
-
import { SheetInterceptorService as at, getSheetCommandTarget as ce, SheetsSelectionsService as pr, WorkbookEditablePermission as tt, WorksheetEditPermission as
|
|
13
|
-
import
|
|
1
|
+
var mn = Object.defineProperty;
|
|
2
|
+
var fn = (i, e, n) => e in i ? mn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var V = (i, e, n) => fn(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CommandType as H, ICommandService as B, IUndoRedoService as ue, sequenceExecute as It, LocaleService as Be, IUniverInstanceService as fe, useDependency as ae, Inject as W, Injector as Rt, IContextService as Dt, RxDisposable as pn, UniverInstanceType as Y, connectInjector as wn, toDisposable as _n, FOCUSING_COMMON_DRAWINGS as me, Disposable as ie, Direction as te, FOCUSING_FX_BAR_EDITOR as vn, EDITOR_ACTIVATED as Sn, FOCUSING_PANEL_EDITOR as Cn, Tools as ge, UserManagerService as In, IPermissionService as Rn, Rectangle as Dn, LifecycleService as Mn, LifecycleStages as bn, DisposableCollection as yn, fromEventSubject as On, generateRandomId as Tn, DependentOn as Pn, Plugin as En, registerDependencies as Un, touchDependencies as Xe, IConfigService as An } from "@univerjs/core";
|
|
5
|
+
import { IDrawingManagerService as K, IImageIoService as Mt, DrawingTypeEnum as k, ArrangeTypeEnum as ve, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Nn, DRAWING_IMAGE_COUNT_LIMIT as mt, ImageUploadStatusType as He, DRAWING_IMAGE_ALLOW_SIZE as jn, getImageSize as Wn, 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 $n, COMPONENT_IMAGE_POPUP_MENU as Ln, OpenImageCropOperation as Bn, ImageResetSizeOperation as Gn, DrawingCommonPanel as Vn, DrawingRenderService as kn, UniverDrawingUIPlugin as Yn } from "@univerjs/drawing-ui";
|
|
7
|
+
import { IRenderManagerService as J, precisionTo as ne, getGroupState as Fn, transformObjectOutOfGroup as Xn, RENDER_CLASS_TYPE as de, Rect as wt, ObjectType as Hn, DRAWING_OBJECT_LAYER_INDEX as zn, SHEET_VIEWPORT_KEY as Kn } from "@univerjs/engine-render";
|
|
8
|
+
import { ISheetDrawingService as F, SetDrawingApplyMutation as T, DrawingApplyType as P, SheetDrawingAnchorType as y, UniverSheetsDrawingPlugin as Jn } from "@univerjs/sheets-drawing";
|
|
9
|
+
import { SheetCanvasPopManagerService as Zn, attachRangeWithCoord as Pe, ISheetSelectionRenderService as pe, SheetSkeletonManagerService as q, getCurrentRangeDisable$ as qn, COPY_TYPE as _t, PREDEFINED_HOOK_NAME as Se, virtualizeDiscreteRanges as Qn, ISheetClipboardService as er, SheetPrintInterceptorService as tr, VIEWPORT_KEY as nr, SetZoomRatioOperation as rr } from "@univerjs/sheets-ui";
|
|
10
|
+
import { ISidebarService as ir, IUIPartsService as sr, BuiltInUIPart as or, ILocalFileService as ar, IMessageService as cr, MenuItemType as bt, getMenuHiddenObservable as yt, RibbonStartGroup as dr, KeyCode as le, ComponentManager as lr, IMenuManagerService as ur, IShortcutService as hr, CanvasFloatDomService as gr } from "@univerjs/ui";
|
|
11
|
+
import { takeUntil as vt, combineLatest as Ce, map as Ee, filter as re, distinctUntilChanged as Ie, Subject as Ke, take as mr, BehaviorSubject as fr, switchMap as St } from "rxjs";
|
|
12
|
+
import { SheetInterceptorService as at, getSheetCommandTarget as ce, SheetsSelectionsService as pr, WorkbookEditablePermission as tt, WorksheetEditPermission as Te, RangeProtectionPermissionEditPoint as wr, WorkbookViewPermission as Ct, WorksheetViewPermission as Je, InsertRowCommand as Ot, InsertColCommand as Tt, RemoveRowCommand as Pt, RemoveColCommand as Et, DeleteRangeMoveLeftCommand as Ut, DeleteRangeMoveUpCommand as At, InsertRangeMoveDownCommand as Nt, InsertRangeMoveRightCommand as jt, DeltaRowHeightCommand as nt, SetRowHeightCommand as rt, DeltaColumnWidthCommand as Wt, SetColWidthCommand as xt, SetRowHiddenCommand as $t, SetSpecificRowsVisibleCommand as Lt, SetSpecificColsVisibleCommand as Bt, SetColHiddenCommand as Gt, MoveColsCommand as Vt, MoveRowsCommand as kt, MoveRangeCommand as Yt, SetRowVisibleMutation as _r, SetRowHiddenMutation as vr, SetColVisibleMutation as Sr, SetColHiddenMutation as Cr, SetWorksheetRowHeightMutation as Ir, SetWorksheetColWidthMutation as Rr, SetWorksheetActiveOperation as Dr, SetFrozenMutation as Mr } from "@univerjs/sheets";
|
|
13
|
+
import Ft, { useEffect as ct, forwardRef as Xt, useRef as br, createElement as Ht, useState as it } from "react";
|
|
14
14
|
import { MessageType as Re, RadioGroup as yr, Radio as Ze } from "@univerjs/design";
|
|
15
|
-
const Or = "sheets-drawing-ui.config",
|
|
15
|
+
const Or = "sheets-drawing-ui.config", Tr = {}, j = {
|
|
16
16
|
id: "sheet.operation.clear-drawing-transformer",
|
|
17
17
|
type: H.MUTATION,
|
|
18
18
|
handler: (i, e) => {
|
|
@@ -27,14 +27,14 @@ const Or = "sheets-drawing-ui.config", Pr = {}, j = {
|
|
|
27
27
|
type: H.COMMAND,
|
|
28
28
|
handler: (i, e) => {
|
|
29
29
|
var S, v, R;
|
|
30
|
-
const n = i.get(
|
|
30
|
+
const n = i.get(B), t = i.get(ue), r = i.get(at), s = i.get(F);
|
|
31
31
|
if (!e) return !1;
|
|
32
32
|
const { drawings: o } = e, d = [];
|
|
33
33
|
o.forEach((_) => {
|
|
34
|
-
const { unitId:
|
|
35
|
-
d.push(
|
|
34
|
+
const { unitId: I } = _;
|
|
35
|
+
d.push(I);
|
|
36
36
|
});
|
|
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:
|
|
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: T.id, params: { unitId: g, subUnitId: c, op: h, objects: u, type: P.REMOVE } }, p = { id: T.id, params: { unitId: g, subUnitId: c, op: a, objects: u, type: P.INSERT } };
|
|
38
38
|
return It([...(S = m.preRedos) != null ? S : [], f, ...m.redos], n) ? (t.pushUndoRedo({
|
|
39
39
|
unitID: g,
|
|
40
40
|
undoMutations: [
|
|
@@ -51,17 +51,17 @@ const Or = "sheets-drawing-ui.config", Pr = {}, j = {
|
|
|
51
51
|
]
|
|
52
52
|
}), !0) : !1;
|
|
53
53
|
}
|
|
54
|
-
},
|
|
54
|
+
}, zt = "COMPONENT_SHEET_DRAWING_PANEL", Kt = {
|
|
55
55
|
id: "sidebar.operation.sheet-image",
|
|
56
56
|
type: H.COMMAND,
|
|
57
57
|
handler: async (i, e) => {
|
|
58
|
-
const n = i.get(
|
|
58
|
+
const n = i.get(ir), t = i.get(Be), r = i.get(fe), s = i.get(K);
|
|
59
59
|
if (!ce(r)) return !1;
|
|
60
60
|
switch (e.value) {
|
|
61
61
|
case "open":
|
|
62
62
|
n.open({
|
|
63
63
|
header: { title: t.t("sheetImage.panel.title") },
|
|
64
|
-
children: { label:
|
|
64
|
+
children: { label: zt },
|
|
65
65
|
onClose: () => {
|
|
66
66
|
s.focusDrawing(null);
|
|
67
67
|
},
|
|
@@ -75,15 +75,15 @@ const Or = "sheets-drawing-ui.config", Pr = {}, j = {
|
|
|
75
75
|
}
|
|
76
76
|
return !0;
|
|
77
77
|
}
|
|
78
|
-
},
|
|
78
|
+
}, Jt = {
|
|
79
79
|
id: "sheet.operation.edit-sheet-image",
|
|
80
80
|
type: H.OPERATION,
|
|
81
81
|
handler: (i, e) => {
|
|
82
|
-
const n = i.get(K), t = i.get(
|
|
83
|
-
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(
|
|
82
|
+
const n = i.get(K), t = i.get(B);
|
|
83
|
+
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(Kt.id, { value: "open" }), !0);
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
var
|
|
86
|
+
var Zt = { exports: {} }, Ve = {};
|
|
87
87
|
/**
|
|
88
88
|
* @license React
|
|
89
89
|
* react-jsx-runtime.production.min.js
|
|
@@ -93,8 +93,8 @@ var Jt = { exports: {} }, Ve = {};
|
|
|
93
93
|
* This source code is licensed under the MIT license found in the
|
|
94
94
|
* LICENSE file in the root directory of this source tree.
|
|
95
95
|
*/
|
|
96
|
-
var
|
|
97
|
-
function
|
|
96
|
+
var Pr = Ft, Er = Symbol.for("react.element"), Ur = Symbol.for("react.fragment"), Ar = Object.prototype.hasOwnProperty, Nr = Pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, jr = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
97
|
+
function qt(i, e, n) {
|
|
98
98
|
var t, r = {}, s = null, o = null;
|
|
99
99
|
n !== void 0 && (s = "" + n), e.key !== void 0 && (s = "" + e.key), e.ref !== void 0 && (o = e.ref);
|
|
100
100
|
for (t in e) Ar.call(e, t) && !jr.hasOwnProperty(t) && (r[t] = e[t]);
|
|
@@ -102,18 +102,18 @@ function Zt(i, e, n) {
|
|
|
102
102
|
return { $$typeof: Er, type: i, key: s, ref: o, props: r, _owner: Nr.current };
|
|
103
103
|
}
|
|
104
104
|
Ve.Fragment = Ur;
|
|
105
|
-
Ve.jsx =
|
|
106
|
-
Ve.jsxs =
|
|
107
|
-
|
|
108
|
-
var $ =
|
|
109
|
-
const
|
|
110
|
-
uploadLoading:
|
|
111
|
-
uploadLoadingBody:
|
|
105
|
+
Ve.jsx = qt;
|
|
106
|
+
Ve.jsxs = qt;
|
|
107
|
+
Zt.exports = Ve;
|
|
108
|
+
var $ = Zt.exports;
|
|
109
|
+
const Wr = "univer-upload-loading", xr = "univer-upload-loading-body", $r = "univer-upload-loading-body-animation", Lr = "univer-UniverCircleAnimation", Br = "univer-upload-loading-body-text", De = {
|
|
110
|
+
uploadLoading: Wr,
|
|
111
|
+
uploadLoadingBody: xr,
|
|
112
112
|
uploadLoadingBodyAnimation: $r,
|
|
113
|
-
univerCircleAnimation:
|
|
114
|
-
uploadLoadingBodyText:
|
|
113
|
+
univerCircleAnimation: Lr,
|
|
114
|
+
uploadLoadingBodyText: Br
|
|
115
115
|
}, Gr = () => {
|
|
116
|
-
const i =
|
|
116
|
+
const i = ae(Mt), e = ae(Be), [n, t] = Ft.useState(0);
|
|
117
117
|
return ct(() => {
|
|
118
118
|
const r = i.change$.subscribe((s) => {
|
|
119
119
|
t(s);
|
|
@@ -130,15 +130,15 @@ var Vr = Object.defineProperty, kr = Object.getOwnPropertyDescriptor, Yr = (i, e
|
|
|
130
130
|
for (var r = t > 1 ? void 0 : t ? kr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
131
131
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
132
132
|
return t && r && Vr(e, n, r), r;
|
|
133
|
-
},
|
|
134
|
-
let Ue = class extends
|
|
133
|
+
}, se = (i, e) => (n, t) => e(n, t, i);
|
|
134
|
+
let Ue = class extends pn {
|
|
135
135
|
constructor(e, n, t, r, s, o, d) {
|
|
136
136
|
super();
|
|
137
137
|
V(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
138
138
|
this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = d, this._init();
|
|
139
139
|
}
|
|
140
140
|
_init() {
|
|
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(
|
|
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(or.CONTENT, () => wn(Gr, this._injector));
|
|
142
142
|
}
|
|
143
143
|
_dispose(e) {
|
|
144
144
|
const n = e.getUnitId();
|
|
@@ -153,7 +153,7 @@ let Ue = class extends fn {
|
|
|
153
153
|
_hasCropObject(e) {
|
|
154
154
|
const n = e.getAllObjectsByOrder();
|
|
155
155
|
for (const t of n)
|
|
156
|
-
if (t instanceof
|
|
156
|
+
if (t instanceof $n)
|
|
157
157
|
return !0;
|
|
158
158
|
return !1;
|
|
159
159
|
}
|
|
@@ -167,7 +167,7 @@ let Ue = class extends fn {
|
|
|
167
167
|
return;
|
|
168
168
|
let r;
|
|
169
169
|
this.disposeWithMe(
|
|
170
|
-
|
|
170
|
+
_n(
|
|
171
171
|
t.createControl$.subscribe(() => {
|
|
172
172
|
if (this._contextService.setContextValue(me, !0), this._hasCropObject(n))
|
|
173
173
|
return;
|
|
@@ -184,7 +184,7 @@ let Ue = class extends fn {
|
|
|
184
184
|
return;
|
|
185
185
|
const { unitId: c, subUnitId: a, drawingId: h, drawingType: u } = g, m = g.data;
|
|
186
186
|
m && m.disablePopup || (r == null || r.dispose(), r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
|
|
187
|
-
componentKey:
|
|
187
|
+
componentKey: Ln,
|
|
188
188
|
direction: "horizontal",
|
|
189
189
|
offset: [2, 0],
|
|
190
190
|
extraProps: {
|
|
@@ -212,7 +212,7 @@ let Ue = class extends fn {
|
|
|
212
212
|
{
|
|
213
213
|
label: "image-popup.edit",
|
|
214
214
|
index: 0,
|
|
215
|
-
commandId:
|
|
215
|
+
commandId: Jt.id,
|
|
216
216
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
217
217
|
disable: r === k.DRAWING_DOM
|
|
218
218
|
},
|
|
@@ -233,7 +233,7 @@ let Ue = class extends fn {
|
|
|
233
233
|
{
|
|
234
234
|
label: "image-popup.reset",
|
|
235
235
|
index: 3,
|
|
236
|
-
commandId:
|
|
236
|
+
commandId: Gn.id,
|
|
237
237
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
238
238
|
disable: r === k.DRAWING_DOM
|
|
239
239
|
}
|
|
@@ -241,16 +241,16 @@ let Ue = class extends fn {
|
|
|
241
241
|
}
|
|
242
242
|
};
|
|
243
243
|
Ue = Yr([
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
se(0, W(Rt)),
|
|
245
|
+
se(1, K),
|
|
246
|
+
se(2, W(Zn)),
|
|
247
|
+
se(3, J),
|
|
248
|
+
se(4, fe),
|
|
249
|
+
se(5, Dt),
|
|
250
|
+
se(6, W(sr))
|
|
251
251
|
], Ue);
|
|
252
|
-
function
|
|
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:
|
|
252
|
+
function L(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: C } = r, S = n.getCurrentSkeleton(), v = Pe(S, {
|
|
254
254
|
startColumn: c,
|
|
255
255
|
endColumn: c,
|
|
256
256
|
startRow: h,
|
|
@@ -258,7 +258,7 @@ function B(i, e, n) {
|
|
|
258
258
|
});
|
|
259
259
|
if (v == null)
|
|
260
260
|
return;
|
|
261
|
-
const R =
|
|
261
|
+
const R = Pe(S, {
|
|
262
262
|
startColumn: m,
|
|
263
263
|
endColumn: m,
|
|
264
264
|
startRow: p,
|
|
@@ -266,8 +266,8 @@ function B(i, e, n) {
|
|
|
266
266
|
});
|
|
267
267
|
if (R == null)
|
|
268
268
|
return;
|
|
269
|
-
const { startX: _, startY:
|
|
270
|
-
let b = ne(_ + a, 1), A = ne(
|
|
269
|
+
const { startX: _, startY: I } = v, { startX: w, startY: O } = R;
|
|
270
|
+
let b = ne(_ + a, 1), A = ne(I + u, 1), E = ne(w + f - b, 1), M = ne(O + C - A, 1);
|
|
271
271
|
v.startX === R.endX && (E = 0), v.startY === R.endY && (M = 0);
|
|
272
272
|
const D = S.rowHeaderWidth + S.columnTotalWidth, U = S.columnHeaderHeight + S.rowTotalHeight;
|
|
273
273
|
return b + E > D && (b = D - E), A + M > U && (A = U - M), {
|
|
@@ -283,7 +283,7 @@ function B(i, e, n) {
|
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
function N(i, e) {
|
|
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.
|
|
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.getCellWithCoordByOffset(n, t);
|
|
287
287
|
if (a == null)
|
|
288
288
|
return;
|
|
289
289
|
const h = {
|
|
@@ -291,7 +291,7 @@ function N(i, e) {
|
|
|
291
291
|
columnOffset: ne(n - a.startX, 1),
|
|
292
292
|
row: a.actualRow,
|
|
293
293
|
rowOffset: ne(t - a.startY, 1)
|
|
294
|
-
}, u = e.
|
|
294
|
+
}, u = e.getCellWithCoordByOffset(n + r, t + s);
|
|
295
295
|
if (u == null)
|
|
296
296
|
return;
|
|
297
297
|
const m = {
|
|
@@ -315,7 +315,7 @@ var Fr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, Hr = (i, e
|
|
|
315
315
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
316
316
|
return t && r && Fr(e, n, r), r;
|
|
317
317
|
}, Me = (i, e) => (n, t) => e(n, t, i);
|
|
318
|
-
let st = class extends
|
|
318
|
+
let st = class extends ie {
|
|
319
319
|
constructor(i, e, n, t, r) {
|
|
320
320
|
super(), this._context = i, this._sheetDrawingService = e, this._drawingManagerService = n, this._sheetSelectionRenderService = t, this._sheetSkeletonManagerService = r, this._init();
|
|
321
321
|
}
|
|
@@ -329,7 +329,7 @@ let st = class extends re {
|
|
|
329
329
|
const n = i[e];
|
|
330
330
|
for (const t in n.data) {
|
|
331
331
|
const r = n.data[t];
|
|
332
|
-
r.transform =
|
|
332
|
+
r.transform = L(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
@@ -338,8 +338,8 @@ let st = class extends re {
|
|
|
338
338
|
st = Hr([
|
|
339
339
|
Me(1, F),
|
|
340
340
|
Me(2, K),
|
|
341
|
-
Me(3,
|
|
342
|
-
Me(4,
|
|
341
|
+
Me(3, W(pe)),
|
|
342
|
+
Me(4, W(q))
|
|
343
343
|
], st);
|
|
344
344
|
var X = function() {
|
|
345
345
|
return X = Object.assign || function(i) {
|
|
@@ -356,13 +356,13 @@ var X = function() {
|
|
|
356
356
|
for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
|
|
357
357
|
e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
|
|
358
358
|
return n;
|
|
359
|
-
},
|
|
359
|
+
}, Qt = Xt(function(i, e) {
|
|
360
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
|
|
361
|
+
return en(n, "".concat(t), { defIds: n.defIds, idSuffix: l.current }, X({ ref: e, className: d }, o), s);
|
|
362
362
|
});
|
|
363
|
-
function
|
|
364
|
-
return
|
|
365
|
-
return
|
|
363
|
+
function en(i, e, n, t, r) {
|
|
364
|
+
return Ht(i.tag, X(X({ key: e }, Kr(i, n, r)), t), (Jr(i, n).children || []).map(function(s, o) {
|
|
365
|
+
return en(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
|
|
366
366
|
}));
|
|
367
367
|
}
|
|
368
368
|
function Kr(i, e, n) {
|
|
@@ -383,20 +383,20 @@ function Jr(i, e) {
|
|
|
383
383
|
function Zr() {
|
|
384
384
|
return Math.random().toString(36).substring(2, 8);
|
|
385
385
|
}
|
|
386
|
-
|
|
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" } }] },
|
|
388
|
-
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" } }] }, tn = Xt(function(i, e) {
|
|
388
|
+
return Ht(Qt, Object.assign({}, i, {
|
|
389
389
|
id: "add-image-single",
|
|
390
390
|
ref: e,
|
|
391
391
|
icon: qr
|
|
392
392
|
}));
|
|
393
393
|
});
|
|
394
|
-
|
|
395
|
-
const
|
|
394
|
+
tn.displayName = "AddImageSingle";
|
|
395
|
+
const nn = {
|
|
396
396
|
id: "sheet.command.delete-drawing",
|
|
397
397
|
type: H.COMMAND,
|
|
398
398
|
handler: (i) => {
|
|
399
|
-
const e = i.get(
|
|
399
|
+
const e = i.get(B), t = i.get(F).getFocusDrawings();
|
|
400
400
|
if (t.length === 0)
|
|
401
401
|
return !1;
|
|
402
402
|
const r = t[0].unitId, s = t.map((o) => {
|
|
@@ -417,7 +417,7 @@ const tn = {
|
|
|
417
417
|
function Qr(i) {
|
|
418
418
|
const e = [];
|
|
419
419
|
return i.forEach((n) => {
|
|
420
|
-
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d } = t, l =
|
|
420
|
+
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d } = t, l = Fn(0, 0, r.map((a) => a.transform || {})), g = r.map((a) => {
|
|
421
421
|
const h = a.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: m, drawingId: f } = a;
|
|
422
422
|
return {
|
|
423
423
|
unitId: u,
|
|
@@ -450,7 +450,7 @@ function ei(i) {
|
|
|
450
450
|
if (l == null)
|
|
451
451
|
return;
|
|
452
452
|
const g = r.map((a) => {
|
|
453
|
-
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 = Xn(h || {}, l, l.width || 0, l.height || 0);
|
|
454
454
|
return {
|
|
455
455
|
unitId: u,
|
|
456
456
|
subUnitId: m,
|
|
@@ -474,11 +474,11 @@ function ei(i) {
|
|
|
474
474
|
});
|
|
475
475
|
}), e;
|
|
476
476
|
}
|
|
477
|
-
const
|
|
477
|
+
const rn = {
|
|
478
478
|
id: "sheet.command.group-sheet-image",
|
|
479
479
|
type: H.COMMAND,
|
|
480
480
|
handler: (i, e) => {
|
|
481
|
-
const n = i.get(
|
|
481
|
+
const n = i.get(B), t = i.get(ue), r = i.get(F);
|
|
482
482
|
if (!e) return !1;
|
|
483
483
|
const s = [];
|
|
484
484
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -487,14 +487,14 @@ const nn = {
|
|
|
487
487
|
});
|
|
488
488
|
});
|
|
489
489
|
const o = r.getGroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
|
|
490
|
-
return n.syncExecuteCommand(
|
|
490
|
+
return n.syncExecuteCommand(T.id, { op: c, unitId: d, subUnitId: l, objects: a, type: P.GROUP }) ? (t.pushUndoRedo({
|
|
491
491
|
unitID: d,
|
|
492
492
|
undoMutations: [
|
|
493
|
-
{ id:
|
|
493
|
+
{ id: T.id, params: { op: g, unitId: d, subUnitId: l, objects: ei(a), type: P.UNGROUP } },
|
|
494
494
|
{ id: j.id, params: s }
|
|
495
495
|
],
|
|
496
496
|
redoMutations: [
|
|
497
|
-
{ id:
|
|
497
|
+
{ id: T.id, params: { op: c, unitId: d, subUnitId: l, objects: a, type: P.GROUP } },
|
|
498
498
|
{ id: j.id, params: s }
|
|
499
499
|
]
|
|
500
500
|
}), !0) : !1;
|
|
@@ -504,9 +504,9 @@ const nn = {
|
|
|
504
504
|
type: H.COMMAND,
|
|
505
505
|
handler: (i, e) => {
|
|
506
506
|
var S, v, R;
|
|
507
|
-
const n = i.get(
|
|
507
|
+
const n = i.get(B), t = i.get(ue), r = i.get(F), s = i.get(at);
|
|
508
508
|
if (!e) return !1;
|
|
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:
|
|
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: T.id, params: { op: h, unitId: g, subUnitId: c, objects: u, type: P.INSERT } }, p = { id: T.id, params: { op: a, unitId: g, subUnitId: c, objects: u, type: P.REMOVE } };
|
|
510
510
|
return It([...(S = m.preRedos) != null ? S : [], f, ...m.redos], n) ? (t.pushUndoRedo({
|
|
511
511
|
unitID: g,
|
|
512
512
|
undoMutations: [
|
|
@@ -523,24 +523,24 @@ const nn = {
|
|
|
523
523
|
]
|
|
524
524
|
}), !0) : !1;
|
|
525
525
|
}
|
|
526
|
-
},
|
|
526
|
+
}, sn = {
|
|
527
527
|
id: "sheet.command.set-drawing-arrange",
|
|
528
528
|
type: H.COMMAND,
|
|
529
529
|
handler: (i, e) => {
|
|
530
|
-
const n = i.get(
|
|
530
|
+
const n = i.get(B), t = i.get(ue);
|
|
531
531
|
if (!e) return !1;
|
|
532
532
|
const r = i.get(F), { unitId: s, subUnitId: o, drawingIds: d, arrangeType: l } = e, g = { unitId: s, subUnitId: o, drawingIds: d };
|
|
533
533
|
let c;
|
|
534
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)
|
|
535
535
|
return !1;
|
|
536
536
|
const { objects: a, redo: h, undo: u } = c;
|
|
537
|
-
return n.syncExecuteCommand(
|
|
537
|
+
return n.syncExecuteCommand(T.id, { op: h, unitId: s, subUnitId: o, objects: a, type: P.ARRANGE }) ? (t.pushUndoRedo({
|
|
538
538
|
unitID: s,
|
|
539
539
|
undoMutations: [
|
|
540
|
-
{ id:
|
|
540
|
+
{ id: T.id, params: { op: u, unitId: s, subUnitId: o, objects: a, type: P.ARRANGE } }
|
|
541
541
|
],
|
|
542
542
|
redoMutations: [
|
|
543
|
-
{ id:
|
|
543
|
+
{ id: T.id, params: { op: h, unitId: s, subUnitId: o, objects: a, type: P.ARRANGE } }
|
|
544
544
|
]
|
|
545
545
|
}), !0) : !1;
|
|
546
546
|
}
|
|
@@ -548,26 +548,26 @@ const nn = {
|
|
|
548
548
|
id: "sheet.command.set-sheet-image",
|
|
549
549
|
type: H.COMMAND,
|
|
550
550
|
handler: (i, e) => {
|
|
551
|
-
const n = i.get(
|
|
551
|
+
const n = i.get(B), t = i.get(ue), r = i.get(F);
|
|
552
552
|
if (!e) return !1;
|
|
553
553
|
const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
|
|
554
|
-
return n.syncExecuteCommand(
|
|
554
|
+
return n.syncExecuteCommand(T.id, { unitId: d, subUnitId: l, op: c, objects: a, type: P.UPDATE }) ? (t.pushUndoRedo({
|
|
555
555
|
unitID: d,
|
|
556
556
|
undoMutations: [
|
|
557
|
-
{ id:
|
|
557
|
+
{ id: T.id, params: { unitId: d, subUnitId: l, op: g, objects: a, type: P.UPDATE } },
|
|
558
558
|
{ id: j.id, params: [d] }
|
|
559
559
|
],
|
|
560
560
|
redoMutations: [
|
|
561
|
-
{ id:
|
|
561
|
+
{ id: T.id, params: { unitId: d, subUnitId: l, op: c, objects: a, type: P.UPDATE } },
|
|
562
562
|
{ id: j.id, params: [d] }
|
|
563
563
|
]
|
|
564
564
|
}), !0) : !1;
|
|
565
565
|
}
|
|
566
|
-
},
|
|
566
|
+
}, on = {
|
|
567
567
|
id: "sheet.command.ungroup-sheet-image",
|
|
568
568
|
type: H.COMMAND,
|
|
569
569
|
handler: (i, e) => {
|
|
570
|
-
const n = i.get(
|
|
570
|
+
const n = i.get(B), t = i.get(ue), r = i.get(F);
|
|
571
571
|
if (!e) return !1;
|
|
572
572
|
const s = [];
|
|
573
573
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -576,14 +576,14 @@ const nn = {
|
|
|
576
576
|
});
|
|
577
577
|
});
|
|
578
578
|
const o = r.getUngroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
|
|
579
|
-
return n.syncExecuteCommand(
|
|
579
|
+
return n.syncExecuteCommand(T.id, { op: c, unitId: d, subUnitId: l, objects: a, type: P.UNGROUP }) ? (t.pushUndoRedo({
|
|
580
580
|
unitID: d,
|
|
581
581
|
undoMutations: [
|
|
582
|
-
{ id:
|
|
582
|
+
{ id: T.id, params: { op: g, unitId: d, subUnitId: l, objects: Qr(a), type: P.GROUP } },
|
|
583
583
|
{ id: j.id, params: s }
|
|
584
584
|
],
|
|
585
585
|
redoMutations: [
|
|
586
|
-
{ id:
|
|
586
|
+
{ id: T.id, params: { op: c, unitId: d, subUnitId: l, objects: a, type: P.UNGROUP } },
|
|
587
587
|
{ id: j.id, params: s }
|
|
588
588
|
]
|
|
589
589
|
}), !0) : !1;
|
|
@@ -594,7 +594,7 @@ var ti = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, ri = (i, e
|
|
|
594
594
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
595
595
|
return t && r && ti(e, n, r), r;
|
|
596
596
|
}, z = (i, e) => (n, t) => e(n, t, i);
|
|
597
|
-
let Ae = class extends
|
|
597
|
+
let Ae = class extends ie {
|
|
598
598
|
constructor(e, n, t, r, s, o, d, l, g, c, a, h) {
|
|
599
599
|
super();
|
|
600
600
|
V(this, "_workbookSelections");
|
|
@@ -603,7 +603,7 @@ let Ae = class extends re {
|
|
|
603
603
|
async insertFloatImage() {
|
|
604
604
|
const e = await this._fileOpenerService.openFile({
|
|
605
605
|
multiple: !0,
|
|
606
|
-
accept:
|
|
606
|
+
accept: Nn.map((t) => `.${t.replace("image/", "")}`).join(",")
|
|
607
607
|
}), n = e.length;
|
|
608
608
|
return n > mt ? (this._messageService.show({
|
|
609
609
|
type: Re.Error,
|
|
@@ -618,7 +618,7 @@ let Ae = class extends re {
|
|
|
618
618
|
const v = S.message;
|
|
619
619
|
v === He.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
620
620
|
type: Re.Error,
|
|
621
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
621
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(jn / (1024 * 1024)))
|
|
622
622
|
}) : v === He.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
623
623
|
type: Re.Error,
|
|
624
624
|
content: this._localeService.t("update-status.invalidImageType")
|
|
@@ -629,7 +629,7 @@ let Ae = class extends re {
|
|
|
629
629
|
}
|
|
630
630
|
if (n == null)
|
|
631
631
|
return;
|
|
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
|
|
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 Wn(g || ""), { width: u, height: m } = this._context.scene;
|
|
633
633
|
this._imageIoService.addImageSourceCache(l, d, h);
|
|
634
634
|
let f = 1;
|
|
635
635
|
if (c > ft || a > pt) {
|
|
@@ -639,19 +639,19 @@ let Ae = class extends re {
|
|
|
639
639
|
const p = this._getImagePosition(c * f, a * f, u, m);
|
|
640
640
|
if (p == null)
|
|
641
641
|
return;
|
|
642
|
-
const
|
|
642
|
+
const C = {
|
|
643
643
|
unitId: r,
|
|
644
644
|
subUnitId: s,
|
|
645
645
|
drawingId: o,
|
|
646
646
|
drawingType: k.DRAWING_IMAGE,
|
|
647
647
|
imageSourceType: d,
|
|
648
648
|
source: l,
|
|
649
|
-
transform:
|
|
649
|
+
transform: L(p, this._selectionRenderService, this._skeletonManagerService),
|
|
650
650
|
sheetTransform: p
|
|
651
651
|
};
|
|
652
652
|
this._commandService.executeCommand(ke.id, {
|
|
653
653
|
unitId: r,
|
|
654
|
-
drawings: [
|
|
654
|
+
drawings: [C]
|
|
655
655
|
});
|
|
656
656
|
}
|
|
657
657
|
_getUnitInfo() {
|
|
@@ -670,12 +670,12 @@ let Ae = class extends re {
|
|
|
670
670
|
endColumn: 0
|
|
671
671
|
};
|
|
672
672
|
s && s.length > 0 && (o = s[s.length - 1].range);
|
|
673
|
-
const d =
|
|
673
|
+
const d = Pe(this._skeletonManagerService.getCurrent().skeleton, o);
|
|
674
674
|
if (d == null)
|
|
675
675
|
return;
|
|
676
676
|
let { startColumn: l, startRow: g, startX: c, startY: a } = d, h = !1;
|
|
677
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) {
|
|
678
|
-
const p = this._selectionRenderService.
|
|
678
|
+
const p = this._selectionRenderService.getCellWithCoordByOffset(c, a);
|
|
679
679
|
if (p == null)
|
|
680
680
|
return;
|
|
681
681
|
c = p.startX, a = p.startY, l = p.actualColumn, g = p.actualRow;
|
|
@@ -685,7 +685,7 @@ let Ae = class extends re {
|
|
|
685
685
|
columnOffset: 0,
|
|
686
686
|
row: g,
|
|
687
687
|
rowOffset: 0
|
|
688
|
-
}, m = this._selectionRenderService.
|
|
688
|
+
}, m = this._selectionRenderService.getCellWithCoordByOffset(c + e, a + n);
|
|
689
689
|
if (m == null)
|
|
690
690
|
return;
|
|
691
691
|
const f = {
|
|
@@ -700,18 +700,18 @@ let Ae = class extends re {
|
|
|
700
700
|
};
|
|
701
701
|
}
|
|
702
702
|
_updateOrderListener() {
|
|
703
|
-
this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
|
|
703
|
+
this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
|
|
704
704
|
const { unitId: n, subUnitId: t, drawingIds: r, arrangeType: s } = e;
|
|
705
|
-
this._commandService.executeCommand(
|
|
705
|
+
this._commandService.executeCommand(sn.id, {
|
|
706
706
|
unitId: n,
|
|
707
707
|
subUnitId: t,
|
|
708
708
|
drawingIds: r,
|
|
709
709
|
arrangeType: s
|
|
710
710
|
});
|
|
711
|
-
});
|
|
711
|
+
}));
|
|
712
712
|
}
|
|
713
713
|
_updateImageListener() {
|
|
714
|
-
this._drawingManagerService.featurePluginUpdate$.subscribe((e) => {
|
|
714
|
+
this.disposeWithMe(this._drawingManagerService.featurePluginUpdate$.subscribe((e) => {
|
|
715
715
|
const n = [];
|
|
716
716
|
e.length !== 0 && (e.forEach((t) => {
|
|
717
717
|
const { unitId: r, subUnitId: s, drawingId: o, drawingType: d, transform: l } = t;
|
|
@@ -725,7 +725,7 @@ let Ae = class extends re {
|
|
|
725
725
|
return;
|
|
726
726
|
const a = {
|
|
727
727
|
...t,
|
|
728
|
-
transform: { ...g.transform, ...l, ...
|
|
728
|
+
transform: { ...g.transform, ...l, ...L(c, this._selectionRenderService, this._skeletonManagerService) },
|
|
729
729
|
sheetTransform: { ...c }
|
|
730
730
|
};
|
|
731
731
|
n.push(a);
|
|
@@ -733,16 +733,16 @@ let Ae = class extends re {
|
|
|
733
733
|
unitId: e[0].unitId,
|
|
734
734
|
drawings: n
|
|
735
735
|
}));
|
|
736
|
-
});
|
|
736
|
+
}));
|
|
737
737
|
}
|
|
738
738
|
_groupDrawingListener() {
|
|
739
|
-
this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
|
|
740
|
-
this._commandService.executeCommand(
|
|
739
|
+
this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
|
|
740
|
+
this._commandService.executeCommand(rn.id, e);
|
|
741
741
|
const { unitId: n, subUnitId: t, drawingId: r } = e[0].parent;
|
|
742
742
|
this._drawingManagerService.focusDrawing([{ unitId: n, subUnitId: t, drawingId: r }]);
|
|
743
|
-
}), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
|
|
744
|
-
this._commandService.executeCommand(
|
|
745
|
-
});
|
|
743
|
+
})), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
|
|
744
|
+
this._commandService.executeCommand(on.id, e);
|
|
745
|
+
}));
|
|
746
746
|
}
|
|
747
747
|
_focusDrawingListener() {
|
|
748
748
|
this.disposeWithMe(
|
|
@@ -753,17 +753,17 @@ let Ae = class extends re {
|
|
|
753
753
|
}
|
|
754
754
|
};
|
|
755
755
|
Ae = ri([
|
|
756
|
-
z(1,
|
|
757
|
-
z(2,
|
|
756
|
+
z(1, W(q)),
|
|
757
|
+
z(2, B),
|
|
758
758
|
z(3, pe),
|
|
759
|
-
z(4,
|
|
760
|
-
z(5,
|
|
759
|
+
z(4, Mt),
|
|
760
|
+
z(5, ar),
|
|
761
761
|
z(6, F),
|
|
762
762
|
z(7, K),
|
|
763
|
-
z(8,
|
|
764
|
-
z(9,
|
|
765
|
-
z(10,
|
|
766
|
-
z(11,
|
|
763
|
+
z(8, Dt),
|
|
764
|
+
z(9, cr),
|
|
765
|
+
z(10, W(Be)),
|
|
766
|
+
z(11, W(pr))
|
|
767
767
|
], Ae);
|
|
768
768
|
const dt = {
|
|
769
769
|
id: "sheet.command.insert-float-image",
|
|
@@ -776,7 +776,7 @@ const dt = {
|
|
|
776
776
|
id: "sheet.command.move-drawing",
|
|
777
777
|
type: H.COMMAND,
|
|
778
778
|
handler: (i, e) => {
|
|
779
|
-
const n = i.get(
|
|
779
|
+
const n = i.get(B), t = i.get(F), r = i.get(pe), { direction: s } = e, o = t.getFocusDrawings();
|
|
780
780
|
if (o.length === 0)
|
|
781
781
|
return !1;
|
|
782
782
|
const d = o[0].unitId, l = o.map((c) => {
|
|
@@ -795,23 +795,23 @@ const dt = {
|
|
|
795
795
|
drawings: l
|
|
796
796
|
}) ? (n.syncExecuteCommand(j.id, [d]), !0) : !1;
|
|
797
797
|
}
|
|
798
|
-
},
|
|
798
|
+
}, an = "addition-and-subtraction-single", cn = "sheet.menu.image";
|
|
799
799
|
function ii(i) {
|
|
800
800
|
return {
|
|
801
|
-
id:
|
|
802
|
-
type:
|
|
803
|
-
icon:
|
|
801
|
+
id: cn,
|
|
802
|
+
type: bt.SUBITEMS,
|
|
803
|
+
icon: an,
|
|
804
804
|
tooltip: "sheetImage.title",
|
|
805
|
-
hidden$:
|
|
806
|
-
disabled$:
|
|
805
|
+
hidden$: yt(i, Y.UNIVER_SHEET),
|
|
806
|
+
disabled$: qn(i, { workbookTypes: [tt], worksheetTypes: [Te], rangeTypes: [wr] })
|
|
807
807
|
};
|
|
808
808
|
}
|
|
809
809
|
function si(i) {
|
|
810
810
|
return {
|
|
811
811
|
id: dt.id,
|
|
812
812
|
title: "sheetImage.upload.float",
|
|
813
|
-
type:
|
|
814
|
-
hidden$:
|
|
813
|
+
type: bt.BUTTON,
|
|
814
|
+
hidden$: yt(i, Y.UNIVER_SHEET)
|
|
815
815
|
};
|
|
816
816
|
}
|
|
817
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 = {
|
|
@@ -831,22 +831,22 @@ const oi = "univer-image-common-panel", ai = "univer-image-common-panel-grid", c
|
|
|
831
831
|
sheetImageMenu: vi,
|
|
832
832
|
sheetImageMenuInput: Si
|
|
833
833
|
};
|
|
834
|
-
function
|
|
834
|
+
function dn(i) {
|
|
835
835
|
var e, n, t = "";
|
|
836
836
|
if (typeof i == "string" || typeof i == "number") t += i;
|
|
837
837
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
838
838
|
var r = i.length;
|
|
839
|
-
for (e = 0; e < r; e++) i[e] && (n =
|
|
839
|
+
for (e = 0; e < r; e++) i[e] && (n = dn(i[e])) && (t && (t += " "), t += n);
|
|
840
840
|
} else for (n in i) i[n] && (t && (t += " "), t += n);
|
|
841
841
|
return t;
|
|
842
842
|
}
|
|
843
843
|
function be() {
|
|
844
|
-
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e =
|
|
844
|
+
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = dn(i)) && (t && (t += " "), t += e);
|
|
845
845
|
return t;
|
|
846
846
|
}
|
|
847
|
-
const
|
|
847
|
+
const Ci = (i) => {
|
|
848
848
|
var v;
|
|
849
|
-
const e =
|
|
849
|
+
const e = ae(B), n = ae(Be), t = ae(K), r = ae(J), { drawings: s } = i, o = s[0];
|
|
850
850
|
if (o == null)
|
|
851
851
|
return;
|
|
852
852
|
const { unitId: d } = o, l = r.getRenderById(d), g = l == null ? void 0 : l.scene;
|
|
@@ -854,28 +854,28 @@ const Ii = (i) => {
|
|
|
854
854
|
return;
|
|
855
855
|
const c = g.getTransformerByCreate(), [a, h] = it(!0), u = (v = o.anchorType) != null ? v : y.Position, [m, f] = it(u);
|
|
856
856
|
function p(R, _) {
|
|
857
|
-
const
|
|
857
|
+
const I = [];
|
|
858
858
|
return R.forEach((w) => {
|
|
859
859
|
const { oKey: O } = w, b = _.getDrawingOKey(O);
|
|
860
860
|
if (b == null)
|
|
861
|
-
return
|
|
862
|
-
const { unitId: A, subUnitId: E, drawingId: M, drawingType: D, anchorType: U, sheetTransform:
|
|
863
|
-
|
|
861
|
+
return I.push(null), !0;
|
|
862
|
+
const { unitId: A, subUnitId: E, drawingId: M, drawingType: D, anchorType: U, sheetTransform: x } = b;
|
|
863
|
+
I.push({
|
|
864
864
|
unitId: A,
|
|
865
865
|
subUnitId: E,
|
|
866
866
|
drawingId: M,
|
|
867
867
|
anchorType: U,
|
|
868
|
-
sheetTransform:
|
|
868
|
+
sheetTransform: x,
|
|
869
869
|
drawingType: D
|
|
870
870
|
});
|
|
871
|
-
}),
|
|
871
|
+
}), I;
|
|
872
872
|
}
|
|
873
873
|
ct(() => {
|
|
874
|
-
const R = c.clearControl$.subscribe((
|
|
875
|
-
|
|
876
|
-
}), _ = c.changeStart$.subscribe((
|
|
874
|
+
const R = c.clearControl$.subscribe((I) => {
|
|
875
|
+
I === !0 && h(!1);
|
|
876
|
+
}), _ = c.changeStart$.subscribe((I) => {
|
|
877
877
|
var b;
|
|
878
|
-
const { objects: w } =
|
|
878
|
+
const { objects: w } = I, O = p(w, t);
|
|
879
879
|
if (O.length === 0)
|
|
880
880
|
h(!1);
|
|
881
881
|
else if (O.length >= 1) {
|
|
@@ -888,12 +888,12 @@ const Ii = (i) => {
|
|
|
888
888
|
_.unsubscribe(), R.unsubscribe();
|
|
889
889
|
};
|
|
890
890
|
}, []);
|
|
891
|
-
function
|
|
891
|
+
function C(R) {
|
|
892
892
|
f(R);
|
|
893
893
|
const _ = t.getFocusDrawings();
|
|
894
894
|
if (_.length === 0)
|
|
895
895
|
return;
|
|
896
|
-
const
|
|
896
|
+
const I = _.map((w) => ({
|
|
897
897
|
unitId: w.unitId,
|
|
898
898
|
subUnitId: w.subUnitId,
|
|
899
899
|
drawingId: w.drawingId,
|
|
@@ -901,20 +901,20 @@ const Ii = (i) => {
|
|
|
901
901
|
}));
|
|
902
902
|
e.executeCommand(Ye.id, {
|
|
903
903
|
unitId: _[0].unitId,
|
|
904
|
-
drawings:
|
|
904
|
+
drawings: I
|
|
905
905
|
});
|
|
906
906
|
}
|
|
907
907
|
const S = (R) => R ? "block" : "none";
|
|
908
908
|
return /* @__PURE__ */ $.jsxs("div", { className: be(ee.imageCommonPanelGrid, ee.imageCommonPanelBorder), style: { display: S(a) }, children: [
|
|
909
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:
|
|
910
|
+
/* @__PURE__ */ $.jsx("div", { className: be(ee.imageCommonPanelRow), children: /* @__PURE__ */ $.jsx("div", { className: be(ee.imageCommonPanelColumn), children: /* @__PURE__ */ $.jsxs(yr, { value: m, onChange: C, direction: "vertical", children: [
|
|
911
911
|
/* @__PURE__ */ $.jsx(Ze, { value: y.Both, children: n.t("drawing-anchor.both") }),
|
|
912
912
|
/* @__PURE__ */ $.jsx(Ze, { value: y.Position, children: n.t("drawing-anchor.position") }),
|
|
913
913
|
/* @__PURE__ */ $.jsx(Ze, { value: y.None, children: n.t("drawing-anchor.none") })
|
|
914
914
|
] }) }) })
|
|
915
915
|
] });
|
|
916
|
-
},
|
|
917
|
-
const i =
|
|
916
|
+
}, Ii = () => {
|
|
917
|
+
const i = ae(K), e = i.getFocusDrawings(), [n, t] = it(e);
|
|
918
918
|
return ct(() => {
|
|
919
919
|
const r = i.focus$.subscribe((s) => {
|
|
920
920
|
t(s);
|
|
@@ -923,12 +923,12 @@ const Ii = (i) => {
|
|
|
923
923
|
r.unsubscribe();
|
|
924
924
|
};
|
|
925
925
|
}, []), !!(n != null && n.length) && /* @__PURE__ */ $.jsxs("div", { className: ee.imageCommonPanel, children: [
|
|
926
|
-
/* @__PURE__ */ $.jsx(
|
|
927
|
-
/* @__PURE__ */ $.jsx(
|
|
926
|
+
/* @__PURE__ */ $.jsx(Vn, { drawings: n }),
|
|
927
|
+
/* @__PURE__ */ $.jsx(Ci, { drawings: n })
|
|
928
928
|
] });
|
|
929
929
|
}, Ri = {
|
|
930
|
-
[
|
|
931
|
-
[
|
|
930
|
+
[dr.FORMULAS_INSERT]: {
|
|
931
|
+
[cn]: {
|
|
932
932
|
order: 3,
|
|
933
933
|
menuItemFactory: ii,
|
|
934
934
|
[dt.id]: {
|
|
@@ -939,7 +939,7 @@ const Ii = (i) => {
|
|
|
939
939
|
}
|
|
940
940
|
};
|
|
941
941
|
function _e(i) {
|
|
942
|
-
return !i.getContextValue(
|
|
942
|
+
return !i.getContextValue(vn) && !i.getContextValue(Sn) && !i.getContextValue(Cn) && i.getContextValue(me);
|
|
943
943
|
}
|
|
944
944
|
const Di = {
|
|
945
945
|
id: we.id,
|
|
@@ -982,7 +982,7 @@ const Di = {
|
|
|
982
982
|
direction: te.RIGHT
|
|
983
983
|
}
|
|
984
984
|
}, Oi = {
|
|
985
|
-
id:
|
|
985
|
+
id: nn.id,
|
|
986
986
|
description: "shortcut.sheet.drawing-delete",
|
|
987
987
|
group: "4_sheet-drawing-view",
|
|
988
988
|
// when focusing on any other input tag do not trigger this shortcut
|
|
@@ -990,18 +990,18 @@ const Di = {
|
|
|
990
990
|
binding: le.DELETE,
|
|
991
991
|
mac: le.BACKSPACE
|
|
992
992
|
};
|
|
993
|
-
var
|
|
994
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
993
|
+
var Ti = Object.defineProperty, Pi = Object.getOwnPropertyDescriptor, Ei = (i, e, n, t) => {
|
|
994
|
+
for (var r = t > 1 ? void 0 : t ? Pi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
995
995
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
996
|
-
return t && r &&
|
|
996
|
+
return t && r && Ti(e, n, r), r;
|
|
997
997
|
}, ye = (i, e) => (n, t) => e(n, t, i);
|
|
998
|
-
let Ne = class extends
|
|
998
|
+
let Ne = class extends ie {
|
|
999
999
|
constructor(i, e, n, t) {
|
|
1000
1000
|
super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._shortcutService = t, this._init();
|
|
1001
1001
|
}
|
|
1002
1002
|
_initCustomComponents() {
|
|
1003
1003
|
const i = this._componentManager;
|
|
1004
|
-
this.disposeWithMe(i.register(
|
|
1004
|
+
this.disposeWithMe(i.register(an, tn)), this.disposeWithMe(i.register(zt, Ii));
|
|
1005
1005
|
}
|
|
1006
1006
|
_initMenus() {
|
|
1007
1007
|
this._menuManagerService.mergeMenu(Ri);
|
|
@@ -1012,14 +1012,14 @@ let Ne = class extends re {
|
|
|
1012
1012
|
ke,
|
|
1013
1013
|
Ge,
|
|
1014
1014
|
Ye,
|
|
1015
|
-
zt,
|
|
1016
|
-
j,
|
|
1017
1015
|
Kt,
|
|
1018
|
-
|
|
1019
|
-
|
|
1016
|
+
j,
|
|
1017
|
+
Jt,
|
|
1018
|
+
rn,
|
|
1019
|
+
on,
|
|
1020
1020
|
we,
|
|
1021
|
-
|
|
1022
|
-
|
|
1021
|
+
nn,
|
|
1022
|
+
sn
|
|
1023
1023
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
1024
1024
|
}
|
|
1025
1025
|
_initShortcuts() {
|
|
@@ -1039,17 +1039,17 @@ let Ne = class extends re {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
};
|
|
1041
1041
|
Ne = Ei([
|
|
1042
|
-
ye(0,
|
|
1043
|
-
ye(1,
|
|
1044
|
-
ye(2,
|
|
1045
|
-
ye(3,
|
|
1042
|
+
ye(0, W(lr)),
|
|
1043
|
+
ye(1, ur),
|
|
1044
|
+
ye(2, B),
|
|
1045
|
+
ye(3, hr)
|
|
1046
1046
|
], Ne);
|
|
1047
1047
|
var Ui = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, Ni = (i, e, n, t) => {
|
|
1048
1048
|
for (var r = t > 1 ? void 0 : t ? Ai(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1049
1049
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1050
1050
|
return t && r && Ui(e, n, r), r;
|
|
1051
1051
|
}, qe = (i, e) => (n, t) => e(n, t, i);
|
|
1052
|
-
let je = class extends
|
|
1052
|
+
let je = class extends ie {
|
|
1053
1053
|
constructor(e, n, t) {
|
|
1054
1054
|
super();
|
|
1055
1055
|
V(this, "_copyInfo");
|
|
@@ -1078,13 +1078,13 @@ let je = class extends re {
|
|
|
1078
1078
|
const m = c[u], { transform: f } = m;
|
|
1079
1079
|
if (m.anchorType !== y.Both || !f)
|
|
1080
1080
|
return;
|
|
1081
|
-
const { left: p = 0, top:
|
|
1081
|
+
const { left: p = 0, top: C = 0, width: S = 0, height: v = 0 } = f, { drawingStartX: R, drawingEndX: _, drawingStartY: I, drawingEndY: w } = {
|
|
1082
1082
|
drawingStartX: p,
|
|
1083
1083
|
drawingEndX: p + S,
|
|
1084
|
-
drawingStartY:
|
|
1085
|
-
drawingEndY:
|
|
1084
|
+
drawingStartY: C,
|
|
1085
|
+
drawingEndY: C + v
|
|
1086
1086
|
};
|
|
1087
|
-
o <= R && _ <= d && l <=
|
|
1087
|
+
o <= R && _ <= d && l <= I && w <= g && a.push(m);
|
|
1088
1088
|
}), a.length && (this._copyInfo = {
|
|
1089
1089
|
drawings: a,
|
|
1090
1090
|
unitId: e,
|
|
@@ -1108,7 +1108,7 @@ let je = class extends re {
|
|
|
1108
1108
|
const { copyRange: t } = n;
|
|
1109
1109
|
if (!t)
|
|
1110
1110
|
return { redos: [], undos: [] };
|
|
1111
|
-
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);
|
|
1112
1112
|
if (!m)
|
|
1113
1113
|
return { redos: [], undos: [] };
|
|
1114
1114
|
const f = m.attachRangeWithCoord({
|
|
@@ -1124,7 +1124,7 @@ let je = class extends re {
|
|
|
1124
1124
|
});
|
|
1125
1125
|
if (!f || !p)
|
|
1126
1126
|
return { redos: [], undos: [] };
|
|
1127
|
-
const
|
|
1127
|
+
const C = [], S = [], v = p.startX - f.startX, R = p.startY - f.startY, _ = h - c, I = u - a, w = n.copyType === _t.CUT, { _sheetDrawingService: O } = this;
|
|
1128
1128
|
return r.forEach((A) => {
|
|
1129
1129
|
const { transform: E, sheetTransform: M } = A;
|
|
1130
1130
|
if (!E)
|
|
@@ -1140,59 +1140,59 @@ let je = class extends re {
|
|
|
1140
1140
|
top: E.top + R
|
|
1141
1141
|
},
|
|
1142
1142
|
sheetTransform: {
|
|
1143
|
-
to: { ...M.to, row: M.to.row + _, column: M.to.column +
|
|
1144
|
-
from: { ...M.from, row: M.from.row + _, column: M.from.column +
|
|
1143
|
+
to: { ...M.to, row: M.to.row + _, column: M.to.column + I },
|
|
1144
|
+
from: { ...M.from, row: M.from.row + _, column: M.from.column + I }
|
|
1145
1145
|
}
|
|
1146
1146
|
};
|
|
1147
1147
|
if (w) {
|
|
1148
|
-
const { undo: U, redo:
|
|
1149
|
-
|
|
1150
|
-
id:
|
|
1148
|
+
const { undo: U, redo: x, objects: Z } = O.getBatchUpdateOp([D]);
|
|
1149
|
+
C.push({
|
|
1150
|
+
id: T.id,
|
|
1151
1151
|
params: {
|
|
1152
1152
|
unitId: s,
|
|
1153
1153
|
subUnitId: o,
|
|
1154
|
-
type:
|
|
1155
|
-
op:
|
|
1154
|
+
type: P.UPDATE,
|
|
1155
|
+
op: x,
|
|
1156
1156
|
objects: Z
|
|
1157
1157
|
}
|
|
1158
1158
|
}), S.push({
|
|
1159
|
-
id:
|
|
1159
|
+
id: T.id,
|
|
1160
1160
|
params: {
|
|
1161
1161
|
unitId: s,
|
|
1162
1162
|
subUnitId: o,
|
|
1163
|
-
type:
|
|
1163
|
+
type: P.UPDATE,
|
|
1164
1164
|
op: U,
|
|
1165
1165
|
objects: Z
|
|
1166
1166
|
}
|
|
1167
1167
|
});
|
|
1168
1168
|
} else {
|
|
1169
|
-
const { undo: U, redo:
|
|
1170
|
-
|
|
1169
|
+
const { undo: U, redo: x, objects: Z } = O.getBatchAddOp([D]);
|
|
1170
|
+
C.push({ id: T.id, params: { op: x, unitId: s, subUnitId: o, objects: Z, type: P.INSERT } }), S.push({ id: T.id, params: { op: U, unitId: s, subUnitId: o, objects: Z, type: P.REMOVE } });
|
|
1171
1171
|
}
|
|
1172
1172
|
}), {
|
|
1173
|
-
redos:
|
|
1173
|
+
redos: C,
|
|
1174
1174
|
undos: S
|
|
1175
1175
|
};
|
|
1176
1176
|
}
|
|
1177
1177
|
};
|
|
1178
1178
|
je = Ni([
|
|
1179
|
-
qe(0,
|
|
1179
|
+
qe(0, er),
|
|
1180
1180
|
qe(1, J),
|
|
1181
1181
|
qe(2, F)
|
|
1182
1182
|
], je);
|
|
1183
|
-
var ji = Object.defineProperty,
|
|
1184
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1183
|
+
var ji = Object.defineProperty, Wi = Object.getOwnPropertyDescriptor, xi = (i, e, n, t) => {
|
|
1184
|
+
for (var r = t > 1 ? void 0 : t ? Wi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1185
1185
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1186
1186
|
return t && r && ji(e, n, r), r;
|
|
1187
1187
|
}, he = (i, e) => (n, t) => e(n, t, i);
|
|
1188
|
-
let
|
|
1188
|
+
let We = class extends ie {
|
|
1189
1189
|
constructor(i, e, n, t, r) {
|
|
1190
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();
|
|
1191
1191
|
}
|
|
1192
1192
|
_initDrawingVisible() {
|
|
1193
1193
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
|
|
1194
1194
|
this.disposeWithMe(
|
|
1195
|
-
|
|
1195
|
+
Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1196
1196
|
if (!e) {
|
|
1197
1197
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1198
1198
|
return;
|
|
@@ -1203,7 +1203,7 @@ let xe = class extends re {
|
|
|
1203
1203
|
return;
|
|
1204
1204
|
}
|
|
1205
1205
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
1206
|
-
if (this._permissionService.composePermission([new
|
|
1206
|
+
if (this._permissionService.composePermission([new Ct(r).id, new Je(r, s).id]).every((d) => d.value))
|
|
1207
1207
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
1208
1208
|
else {
|
|
1209
1209
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
@@ -1221,7 +1221,7 @@ let xe = class extends re {
|
|
|
1221
1221
|
_initDrawingEditable() {
|
|
1222
1222
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
|
|
1223
1223
|
this.disposeWithMe(
|
|
1224
|
-
|
|
1224
|
+
Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1225
1225
|
if (!e) {
|
|
1226
1226
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1227
1227
|
return;
|
|
@@ -1232,7 +1232,7 @@ let xe = class extends re {
|
|
|
1232
1232
|
return;
|
|
1233
1233
|
}
|
|
1234
1234
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
1235
|
-
if (this._permissionService.composePermission([new tt(r).id, new
|
|
1235
|
+
if (this._permissionService.composePermission([new tt(r).id, new Te(r, s).id]).every((d) => d.value))
|
|
1236
1236
|
this._drawingManagerService.setDrawingEditable(!0);
|
|
1237
1237
|
else {
|
|
1238
1238
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
@@ -1250,7 +1250,7 @@ let xe = class extends re {
|
|
|
1250
1250
|
_initViewPermissionChange() {
|
|
1251
1251
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
|
|
1252
1252
|
this.disposeWithMe(
|
|
1253
|
-
|
|
1253
|
+
Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1254
1254
|
e && e.activeSheet$.subscribe((t) => {
|
|
1255
1255
|
var a;
|
|
1256
1256
|
if (!t)
|
|
@@ -1260,21 +1260,21 @@ let xe = class extends re {
|
|
|
1260
1260
|
const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
|
|
1261
1261
|
if (l == null)
|
|
1262
1262
|
return;
|
|
1263
|
-
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new
|
|
1263
|
+
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new Ct(r).id, new Je(r, s).id]).pipe(Ee((h) => h.every((u) => u.value)));
|
|
1264
1264
|
c == null || c.pipe(
|
|
1265
|
-
|
|
1266
|
-
|
|
1265
|
+
re((h) => h !== o),
|
|
1266
|
+
Ie()
|
|
1267
1267
|
).subscribe({
|
|
1268
1268
|
next: (h) => {
|
|
1269
1269
|
o = h, this._drawingManagerService.setDrawingVisible(h);
|
|
1270
1270
|
const u = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
|
|
1271
1271
|
h ? this._drawingManagerService.addNotification(f) : (u.forEach((p) => {
|
|
1272
|
-
p.classType === de.IMAGE && f.some((
|
|
1272
|
+
p.classType === de.IMAGE && f.some((C) => p.oKey.includes(C.drawingId)) && l.removeObject(p);
|
|
1273
1273
|
}), g.clearSelectedObjects());
|
|
1274
1274
|
}
|
|
1275
1275
|
}), (a = this._permissionService.getPermissionPoint$(new Je(r, s).id)) == null || a.pipe(
|
|
1276
|
-
|
|
1277
|
-
|
|
1276
|
+
re((h) => h.value !== o),
|
|
1277
|
+
Ie()
|
|
1278
1278
|
).subscribe({
|
|
1279
1279
|
complete: () => {
|
|
1280
1280
|
o = !0, this._drawingManagerService.setDrawingVisible(!0);
|
|
@@ -1289,7 +1289,7 @@ let xe = class extends re {
|
|
|
1289
1289
|
_initEditPermissionChange() {
|
|
1290
1290
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
|
|
1291
1291
|
this.disposeWithMe(
|
|
1292
|
-
|
|
1292
|
+
Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1293
1293
|
e && e.activeSheet$.subscribe((t) => {
|
|
1294
1294
|
var a;
|
|
1295
1295
|
if (!t)
|
|
@@ -1299,31 +1299,31 @@ let xe = class extends re {
|
|
|
1299
1299
|
const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
|
|
1300
1300
|
if (l == null)
|
|
1301
1301
|
return;
|
|
1302
|
-
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new tt(r).id, new
|
|
1302
|
+
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new tt(r).id, new Te(r, s).id]).pipe(Ee((h) => h.every((u) => u.value)));
|
|
1303
1303
|
c == null || c.pipe(
|
|
1304
|
-
|
|
1305
|
-
|
|
1304
|
+
re((h) => h !== o),
|
|
1305
|
+
Ie()
|
|
1306
1306
|
).subscribe({
|
|
1307
1307
|
next: (h) => {
|
|
1308
1308
|
o = h, this._drawingManagerService.setDrawingEditable(h);
|
|
1309
1309
|
const u = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
|
|
1310
1310
|
h ? (u.forEach((p) => {
|
|
1311
|
-
p.classType === de.IMAGE && f.some((
|
|
1311
|
+
p.classType === de.IMAGE && f.some((C) => p.oKey.includes(C.drawingId)) && l.attachTransformerTo(p);
|
|
1312
1312
|
}), this._drawingManagerService.addNotification(f)) : (u.forEach((p) => {
|
|
1313
|
-
p.classType === de.IMAGE && f.some((
|
|
1313
|
+
p.classType === de.IMAGE && f.some((C) => p.oKey.includes(C.drawingId)) && l.detachTransformerFrom(p);
|
|
1314
1314
|
}), g.clearSelectedObjects());
|
|
1315
1315
|
}
|
|
1316
|
-
}), (a = this._permissionService.getPermissionPoint$(new
|
|
1317
|
-
|
|
1318
|
-
|
|
1316
|
+
}), (a = this._permissionService.getPermissionPoint$(new Te(r, s).id)) == null || a.pipe(
|
|
1317
|
+
re((h) => h.value !== o),
|
|
1318
|
+
Ie()
|
|
1319
1319
|
).subscribe({
|
|
1320
1320
|
complete: () => {
|
|
1321
1321
|
o = !0;
|
|
1322
|
-
const h = e.getUnitId(), u = t.getSheetId(), m = this._drawingManagerService.getDrawingData(h, u), f = Object.values(m), p = this._renderManagerService.getRenderById(h),
|
|
1323
|
-
if (
|
|
1322
|
+
const h = e.getUnitId(), u = t.getSheetId(), m = this._drawingManagerService.getDrawingData(h, u), f = Object.values(m), p = this._renderManagerService.getRenderById(h), C = p == null ? void 0 : p.scene;
|
|
1323
|
+
if (C == null)
|
|
1324
1324
|
return;
|
|
1325
|
-
this._drawingManagerService.setDrawingEditable(!0),
|
|
1326
|
-
v.classType === de.IMAGE && f.some((R) => v.oKey.includes(R.drawingId)) &&
|
|
1325
|
+
this._drawingManagerService.setDrawingEditable(!0), C.getAllObjectsByOrder().forEach((v) => {
|
|
1326
|
+
v.classType === de.IMAGE && f.some((R) => v.oKey.includes(R.drawingId)) && C.detachTransformerFrom(v);
|
|
1327
1327
|
});
|
|
1328
1328
|
}
|
|
1329
1329
|
});
|
|
@@ -1332,19 +1332,19 @@ let xe = class extends re {
|
|
|
1332
1332
|
);
|
|
1333
1333
|
}
|
|
1334
1334
|
};
|
|
1335
|
-
|
|
1335
|
+
We = xi([
|
|
1336
1336
|
he(0, K),
|
|
1337
1337
|
he(1, J),
|
|
1338
|
-
he(2,
|
|
1338
|
+
he(2, Rn),
|
|
1339
1339
|
he(3, fe),
|
|
1340
|
-
he(4,
|
|
1341
|
-
],
|
|
1342
|
-
var $i = Object.defineProperty,
|
|
1343
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1340
|
+
he(4, W(In))
|
|
1341
|
+
], We);
|
|
1342
|
+
var $i = Object.defineProperty, Li = Object.getOwnPropertyDescriptor, Bi = (i, e, n, t) => {
|
|
1343
|
+
for (var r = t > 1 ? void 0 : t ? Li(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1344
1344
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1345
1345
|
return t && r && $i(e, n, r), r;
|
|
1346
1346
|
}, Oe = (i, e) => (n, t) => e(n, t, i);
|
|
1347
|
-
let
|
|
1347
|
+
let xe = class extends ie {
|
|
1348
1348
|
constructor(i, e, n, t) {
|
|
1349
1349
|
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
|
|
1350
1350
|
}
|
|
@@ -1378,7 +1378,7 @@ let Le = class extends re {
|
|
|
1378
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);
|
|
1379
1379
|
return h.length ? (h.forEach((u) => {
|
|
1380
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)) {
|
|
1381
|
-
const m = o.skeleton.
|
|
1381
|
+
const m = o.skeleton.getCellIndexByOffset(u.transform.left, u.transform.top, g, c, { x: 0, y: 0 }), f = o.skeleton.getCellIndexByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, c, { x: 0, y: 0 });
|
|
1382
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);
|
|
1383
1383
|
}
|
|
1384
1384
|
}), n(a)) : n(i);
|
|
@@ -1388,46 +1388,46 @@ let Le = class extends re {
|
|
|
1388
1388
|
);
|
|
1389
1389
|
}
|
|
1390
1390
|
};
|
|
1391
|
-
|
|
1392
|
-
Oe(0,
|
|
1393
|
-
Oe(1,
|
|
1391
|
+
xe = Bi([
|
|
1392
|
+
Oe(0, W(tr)),
|
|
1393
|
+
Oe(1, W(kn)),
|
|
1394
1394
|
Oe(2, K),
|
|
1395
1395
|
Oe(3, J)
|
|
1396
|
-
],
|
|
1396
|
+
], xe);
|
|
1397
1397
|
var Gi = Object.defineProperty, Vi = Object.getOwnPropertyDescriptor, ki = (i, e, n, t) => {
|
|
1398
1398
|
for (var r = t > 1 ? void 0 : t ? Vi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1399
1399
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1400
1400
|
return t && r && Gi(e, n, r), r;
|
|
1401
1401
|
}, Q = (i, e) => (n, t) => e(n, t, i);
|
|
1402
1402
|
const Yi = [
|
|
1403
|
-
yt.id,
|
|
1404
1403
|
Ot.id,
|
|
1405
|
-
Pt.id,
|
|
1406
1404
|
Tt.id,
|
|
1405
|
+
Pt.id,
|
|
1407
1406
|
Et.id,
|
|
1408
1407
|
Ut.id,
|
|
1409
1408
|
At.id,
|
|
1410
1409
|
Nt.id,
|
|
1410
|
+
jt.id,
|
|
1411
1411
|
nt.id,
|
|
1412
1412
|
rt.id,
|
|
1413
|
-
|
|
1413
|
+
Wt.id,
|
|
1414
1414
|
xt.id,
|
|
1415
|
-
Lt.id,
|
|
1416
1415
|
$t.id,
|
|
1416
|
+
Lt.id,
|
|
1417
1417
|
Bt.id,
|
|
1418
|
-
Wt.id,
|
|
1419
1418
|
Gt.id,
|
|
1420
1419
|
Vt.id,
|
|
1421
|
-
kt.id
|
|
1420
|
+
kt.id,
|
|
1421
|
+
Yt.id
|
|
1422
1422
|
], Fi = [
|
|
1423
1423
|
_r.id,
|
|
1424
1424
|
vr.id,
|
|
1425
1425
|
Sr.id,
|
|
1426
|
-
Ir.id,
|
|
1427
1426
|
Cr.id,
|
|
1427
|
+
Ir.id,
|
|
1428
1428
|
Rr.id
|
|
1429
1429
|
];
|
|
1430
|
-
let ot = class extends
|
|
1430
|
+
let ot = class extends ie {
|
|
1431
1431
|
constructor(i, e, n, t, r, s, o, d, l) {
|
|
1432
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();
|
|
1433
1433
|
}
|
|
@@ -1440,51 +1440,51 @@ let ot = class extends re {
|
|
|
1440
1440
|
if (i.params == null)
|
|
1441
1441
|
return { redos: [], undos: [] };
|
|
1442
1442
|
const e = i.id;
|
|
1443
|
-
if (e ===
|
|
1443
|
+
if (e === Ot.id)
|
|
1444
1444
|
return this._moveRowInterceptor(i.params, "insert");
|
|
1445
|
-
if ([
|
|
1445
|
+
if ([Vt.id, kt.id, Yt.id].includes(e))
|
|
1446
1446
|
return this._moveRangeInterceptor(i.params);
|
|
1447
|
-
if (e ===
|
|
1447
|
+
if (e === Tt.id)
|
|
1448
1448
|
return this._moveColInterceptor(i.params, "insert");
|
|
1449
1449
|
if (e === Pt.id)
|
|
1450
1450
|
return this._moveRowInterceptor(i.params, "remove");
|
|
1451
|
-
if (e ===
|
|
1451
|
+
if (e === Et.id)
|
|
1452
1452
|
return this._moveColInterceptor(i.params, "remove");
|
|
1453
|
-
if (e ===
|
|
1453
|
+
if (e === Ut.id) {
|
|
1454
1454
|
const { range: n } = i.params;
|
|
1455
1455
|
return this._getRangeMoveUndo(
|
|
1456
1456
|
n,
|
|
1457
1457
|
0
|
|
1458
1458
|
/* deleteLeft */
|
|
1459
1459
|
);
|
|
1460
|
-
} else if (e ===
|
|
1460
|
+
} else if (e === At.id) {
|
|
1461
1461
|
const { range: n } = i.params;
|
|
1462
1462
|
return this._getRangeMoveUndo(
|
|
1463
1463
|
n,
|
|
1464
1464
|
1
|
|
1465
1465
|
/* deleteUp */
|
|
1466
1466
|
);
|
|
1467
|
-
} else if (e ===
|
|
1467
|
+
} else if (e === Nt.id) {
|
|
1468
1468
|
const { range: n } = i.params;
|
|
1469
1469
|
return this._getRangeMoveUndo(
|
|
1470
1470
|
n,
|
|
1471
1471
|
2
|
|
1472
1472
|
/* insertDown */
|
|
1473
1473
|
);
|
|
1474
|
-
} else if (e ===
|
|
1474
|
+
} else if (e === jt.id) {
|
|
1475
1475
|
const { range: n } = i.params;
|
|
1476
1476
|
return this._getRangeMoveUndo(
|
|
1477
1477
|
n,
|
|
1478
1478
|
3
|
|
1479
1479
|
/* insertRight */
|
|
1480
1480
|
);
|
|
1481
|
-
} else if (e ===
|
|
1481
|
+
} else if (e === $t.id || e === Lt.id) {
|
|
1482
1482
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1483
1483
|
return this._getDrawingUndoForRowVisible(t, r, s);
|
|
1484
|
-
} else if (e === Bt.id || e ===
|
|
1484
|
+
} else if (e === Bt.id || e === Gt.id) {
|
|
1485
1485
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1486
1486
|
return this._getDrawingUndoForColVisible(t, r, s);
|
|
1487
|
-
} else if (e === nt.id || e === rt.id || e ===
|
|
1487
|
+
} else if (e === nt.id || e === rt.id || e === Wt.id || e === xt.id) {
|
|
1488
1488
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === nt.id || e === rt.id;
|
|
1489
1489
|
return this._getDrawingUndoForRowAndColSize(t, r, s, o);
|
|
1490
1490
|
}
|
|
@@ -1505,11 +1505,11 @@ let ot = class extends re {
|
|
|
1505
1505
|
return { redos: [], undos: [] };
|
|
1506
1506
|
if (l.length > 0) {
|
|
1507
1507
|
const c = this._sheetDrawingService.getBatchUpdateOp(l), { undo: a, redo: h, objects: u } = c;
|
|
1508
|
-
s.push({ id:
|
|
1508
|
+
s.push({ id: T.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: P.UPDATE } }), o.push({ id: T.id, params: { unitId: t, subUnitId: r, op: a, objects: u, type: P.UPDATE } });
|
|
1509
1509
|
}
|
|
1510
1510
|
if (g.length > 0) {
|
|
1511
1511
|
const c = this._sheetDrawingService.getBatchRemoveOp(g), a = c.undo, h = c.redo, u = c.objects;
|
|
1512
|
-
s.push({ id:
|
|
1512
|
+
s.push({ id: T.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: P.REMOVE } }), o.push({ id: T.id, params: { unitId: t, subUnitId: r, op: a, objects: u, type: P.INSERT } });
|
|
1513
1513
|
}
|
|
1514
1514
|
return s.push({ id: j.id, params: [t] }), o.push({ id: j.id, params: [t] }), {
|
|
1515
1515
|
redos: s,
|
|
@@ -1523,31 +1523,31 @@ let ot = class extends re {
|
|
|
1523
1523
|
updateDrawings: t,
|
|
1524
1524
|
deleteDrawings: r
|
|
1525
1525
|
};
|
|
1526
|
-
const { startRow:
|
|
1527
|
-
let _ = null,
|
|
1528
|
-
if (e === 0 && u >=
|
|
1526
|
+
const { startRow: C, endRow: S, startColumn: v, endColumn: R } = i;
|
|
1527
|
+
let _ = null, I = null;
|
|
1528
|
+
if (e === 0 && u >= C && f <= S)
|
|
1529
1529
|
if (m >= v && p <= R)
|
|
1530
1530
|
r.push({ unitId: l, subUnitId: g, drawingId: c });
|
|
1531
1531
|
else {
|
|
1532
1532
|
const w = this._shrinkCol(s, d, v, R, o);
|
|
1533
|
-
_ = w == null ? void 0 : w.newSheetTransform,
|
|
1533
|
+
_ = w == null ? void 0 : w.newSheetTransform, I = w == null ? void 0 : w.newTransform;
|
|
1534
1534
|
}
|
|
1535
1535
|
else if (e === 1 && m >= v && p <= R)
|
|
1536
|
-
if (u >=
|
|
1536
|
+
if (u >= C && f <= S)
|
|
1537
1537
|
r.push({ unitId: l, subUnitId: g, drawingId: c });
|
|
1538
1538
|
else {
|
|
1539
|
-
const w = this._shrinkRow(s, d,
|
|
1540
|
-
_ = w == null ? void 0 : w.newSheetTransform,
|
|
1539
|
+
const w = this._shrinkRow(s, d, C, S, o);
|
|
1540
|
+
_ = w == null ? void 0 : w.newSheetTransform, I = w == null ? void 0 : w.newTransform;
|
|
1541
1541
|
}
|
|
1542
1542
|
else if (e === 2) {
|
|
1543
|
-
const w = this._expandRow(s, d,
|
|
1544
|
-
_ = w == null ? void 0 : w.newSheetTransform,
|
|
1543
|
+
const w = this._expandRow(s, d, C, S, o);
|
|
1544
|
+
_ = w == null ? void 0 : w.newSheetTransform, I = w == null ? void 0 : w.newTransform;
|
|
1545
1545
|
} else if (e === 3) {
|
|
1546
1546
|
const w = this._expandCol(s, d, v, R, o);
|
|
1547
|
-
_ = w == null ? void 0 : w.newSheetTransform,
|
|
1547
|
+
_ = w == null ? void 0 : w.newSheetTransform, I = w == null ? void 0 : w.newTransform;
|
|
1548
1548
|
}
|
|
1549
|
-
if (_ != null &&
|
|
1550
|
-
const w =
|
|
1549
|
+
if (_ != null && I != null) {
|
|
1550
|
+
const w = L(_, this._selectionRenderService, this._skeletonManagerService);
|
|
1551
1551
|
t.push({ ...n, sheetTransform: _, transform: w });
|
|
1552
1552
|
}
|
|
1553
1553
|
return { updateDrawings: t, deleteDrawings: r };
|
|
@@ -1567,18 +1567,18 @@ let ot = class extends re {
|
|
|
1567
1567
|
if (m === y.None)
|
|
1568
1568
|
this._remainDrawingSize(u, r, a);
|
|
1569
1569
|
else {
|
|
1570
|
-
const { from: f, to: p } = h, { row:
|
|
1570
|
+
const { from: f, to: p } = h, { row: C, column: S } = f, { row: v, column: R } = p;
|
|
1571
1571
|
for (let _ = 0; _ < n.length; _++) {
|
|
1572
|
-
const
|
|
1572
|
+
const I = n[_], { startRow: w, endRow: O, startColumn: b, endColumn: A } = I;
|
|
1573
1573
|
if (R < b)
|
|
1574
1574
|
continue;
|
|
1575
1575
|
if (m === y.Position) {
|
|
1576
1576
|
let D = null, U = null;
|
|
1577
1577
|
if (S >= b && S <= A) {
|
|
1578
|
-
const
|
|
1579
|
-
if (
|
|
1578
|
+
const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: A, startRow: f.row, endRow: p.row });
|
|
1579
|
+
if (x == null)
|
|
1580
1580
|
return;
|
|
1581
|
-
U = { ...u, left:
|
|
1581
|
+
U = { ...u, left: x.startX };
|
|
1582
1582
|
}
|
|
1583
1583
|
if (U != null && (D = N(U, this._selectionRenderService), D != null && U != null)) {
|
|
1584
1584
|
r.push({ ...a, sheetTransform: D, transform: U });
|
|
@@ -1642,10 +1642,10 @@ let ot = class extends re {
|
|
|
1642
1642
|
}
|
|
1643
1643
|
_createUndoAndRedoMutation(i, e, n) {
|
|
1644
1644
|
const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, d = [
|
|
1645
|
-
{ id:
|
|
1645
|
+
{ id: T.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: P.UPDATE } },
|
|
1646
1646
|
{ id: j.id, params: [i] }
|
|
1647
1647
|
], l = [
|
|
1648
|
-
{ id:
|
|
1648
|
+
{ id: T.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type: P.UPDATE } },
|
|
1649
1649
|
{ id: j.id, params: [i] }
|
|
1650
1650
|
];
|
|
1651
1651
|
return {
|
|
@@ -1661,18 +1661,18 @@ let ot = class extends re {
|
|
|
1661
1661
|
if (m === y.None)
|
|
1662
1662
|
this._remainDrawingSize(u, r, a);
|
|
1663
1663
|
else {
|
|
1664
|
-
const { from: f, to: p } = h, { row:
|
|
1664
|
+
const { from: f, to: p } = h, { row: C, column: S } = f, { row: v, column: R } = p;
|
|
1665
1665
|
for (let _ = 0; _ < n.length; _++) {
|
|
1666
|
-
const
|
|
1666
|
+
const I = n[_], { startRow: w, endRow: O, startColumn: b, endColumn: A } = I;
|
|
1667
1667
|
if (v < w)
|
|
1668
1668
|
continue;
|
|
1669
1669
|
if (m === y.Position) {
|
|
1670
1670
|
let D = null, U = null;
|
|
1671
|
-
if (
|
|
1672
|
-
const
|
|
1673
|
-
if (
|
|
1671
|
+
if (C >= w && C <= O) {
|
|
1672
|
+
const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: C, endRow: O });
|
|
1673
|
+
if (x == null)
|
|
1674
1674
|
return;
|
|
1675
|
-
U = { ...u, top:
|
|
1675
|
+
U = { ...u, top: x.startY };
|
|
1676
1676
|
}
|
|
1677
1677
|
if (U != null && (D = N(U, this._selectionRenderService), D != null && U != null)) {
|
|
1678
1678
|
r.push({ ...a, sheetTransform: D, transform: U });
|
|
@@ -1681,11 +1681,11 @@ let ot = class extends re {
|
|
|
1681
1681
|
this._remainDrawingSize(u, r, a);
|
|
1682
1682
|
continue;
|
|
1683
1683
|
}
|
|
1684
|
-
if (
|
|
1684
|
+
if (C >= w && v <= O)
|
|
1685
1685
|
continue;
|
|
1686
1686
|
let E = null, M = null;
|
|
1687
|
-
if (
|
|
1688
|
-
const D = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow:
|
|
1687
|
+
if (C >= w && C <= O) {
|
|
1688
|
+
const D = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: C, endRow: O });
|
|
1689
1689
|
if (D == null)
|
|
1690
1690
|
return;
|
|
1691
1691
|
M = {
|
|
@@ -1742,15 +1742,15 @@ let ot = class extends re {
|
|
|
1742
1742
|
this._remainDrawingSize(g, s, d);
|
|
1743
1743
|
else {
|
|
1744
1744
|
const { from: a, to: h } = l, { row: u, column: m } = a, { row: f, column: p } = h;
|
|
1745
|
-
for (let
|
|
1746
|
-
const S = n[
|
|
1745
|
+
for (let C = 0; C < n.length; C++) {
|
|
1746
|
+
const S = n[C], { startRow: v, endRow: R, startColumn: _, endColumn: I } = S;
|
|
1747
1747
|
if (f < v || p < _)
|
|
1748
1748
|
continue;
|
|
1749
|
-
if (c === y.Position && (u <= v && f >= R || m <= _ && p >=
|
|
1749
|
+
if (c === y.Position && (u <= v && f >= R || m <= _ && p >= I)) {
|
|
1750
1750
|
this._remainDrawingSize(g, s, d);
|
|
1751
1751
|
continue;
|
|
1752
1752
|
}
|
|
1753
|
-
const w =
|
|
1753
|
+
const w = L(
|
|
1754
1754
|
{ ...l },
|
|
1755
1755
|
this._selectionRenderService,
|
|
1756
1756
|
this._skeletonManagerService
|
|
@@ -1786,30 +1786,30 @@ let ot = class extends re {
|
|
|
1786
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();
|
|
1787
1787
|
if (!o)
|
|
1788
1788
|
return { redos: [], undos: [] };
|
|
1789
|
-
const d =
|
|
1789
|
+
const d = Pe(o, n);
|
|
1790
1790
|
if (!d)
|
|
1791
1791
|
return { redos: [], undos: [] };
|
|
1792
1792
|
const { startX: l, endX: g, startY: c, endY: a } = d, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
|
|
1793
1793
|
Object.keys(h).forEach((_) => {
|
|
1794
|
-
const
|
|
1795
|
-
if (
|
|
1794
|
+
const I = h[_];
|
|
1795
|
+
if (I.anchorType !== y.Both)
|
|
1796
1796
|
return;
|
|
1797
|
-
const { transform: w } =
|
|
1797
|
+
const { transform: w } = I;
|
|
1798
1798
|
if (!w)
|
|
1799
1799
|
return;
|
|
1800
|
-
const { left: O = 0, top: b = 0, width: A = 0, height: E = 0 } = w, { drawingStartX: M, drawingEndX: D, drawingStartY: U, drawingEndY:
|
|
1800
|
+
const { left: O = 0, top: b = 0, width: A = 0, height: E = 0 } = w, { drawingStartX: M, drawingEndX: D, drawingStartY: U, drawingEndY: x } = {
|
|
1801
1801
|
drawingStartX: O,
|
|
1802
1802
|
drawingEndX: O + A,
|
|
1803
1803
|
drawingStartY: b,
|
|
1804
1804
|
drawingEndY: b + E
|
|
1805
1805
|
};
|
|
1806
|
-
l <= M && D <= g && c <= U &&
|
|
1806
|
+
l <= M && D <= g && c <= U && x <= a && u.push(I);
|
|
1807
1807
|
});
|
|
1808
|
-
const m = [], f = [], p = e.startRow - n.startRow,
|
|
1809
|
-
const
|
|
1810
|
-
to: { ...
|
|
1811
|
-
from: { ...
|
|
1812
|
-
}, O =
|
|
1808
|
+
const m = [], f = [], p = e.startRow - n.startRow, C = e.startColumn - n.startColumn, S = u.map((_) => {
|
|
1809
|
+
const I = _.sheetTransform, w = {
|
|
1810
|
+
to: { ...I.to, row: I.to.row + p, column: I.to.column + C },
|
|
1811
|
+
from: { ...I.from, row: I.from.row + p, column: I.from.column + C }
|
|
1812
|
+
}, O = L(w, this._selectionRenderService, this._skeletonManagerService);
|
|
1813
1813
|
return {
|
|
1814
1814
|
unitId: r,
|
|
1815
1815
|
subUnitId: s,
|
|
@@ -1819,8 +1819,8 @@ let ot = class extends re {
|
|
|
1819
1819
|
};
|
|
1820
1820
|
});
|
|
1821
1821
|
if (S.length) {
|
|
1822
|
-
const _ = this._sheetDrawingService.getBatchUpdateOp(S), { undo:
|
|
1823
|
-
m.push({ id:
|
|
1822
|
+
const _ = this._sheetDrawingService.getBatchUpdateOp(S), { undo: I, redo: w, objects: O } = _;
|
|
1823
|
+
m.push({ id: T.id, params: { unitId: r, subUnitId: s, op: w, objects: O, type: P.UPDATE } }), f.push({ id: T.id, params: { unitId: r, subUnitId: s, op: I, objects: O, type: P.UPDATE } });
|
|
1824
1824
|
}
|
|
1825
1825
|
return { redos: m, undos: f };
|
|
1826
1826
|
}
|
|
@@ -1830,19 +1830,19 @@ let ot = class extends re {
|
|
|
1830
1830
|
return { redos: [], undos: [] };
|
|
1831
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 = [];
|
|
1832
1832
|
if (Object.keys(c).forEach((u) => {
|
|
1833
|
-
const m = c[u], { sheetTransform: f, transform: p, anchorType:
|
|
1833
|
+
const m = c[u], { sheetTransform: f, transform: p, anchorType: C = y.Position } = m;
|
|
1834
1834
|
if (f == null || p == null)
|
|
1835
1835
|
return;
|
|
1836
1836
|
let S, v;
|
|
1837
1837
|
if (e === "insert") {
|
|
1838
|
-
const _ = this._expandRow(f, p, o, d,
|
|
1838
|
+
const _ = this._expandRow(f, p, o, d, C);
|
|
1839
1839
|
S = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
|
|
1840
1840
|
} else {
|
|
1841
|
-
const { from: _, to:
|
|
1842
|
-
if (
|
|
1841
|
+
const { from: _, to: I } = f, { row: w } = _, { row: O } = I;
|
|
1842
|
+
if (C === y.Both && w >= o && O <= d)
|
|
1843
1843
|
h.push({ unitId: t, subUnitId: r, drawingId: u });
|
|
1844
1844
|
else {
|
|
1845
|
-
const b = this._shrinkRow(f, p, o, d,
|
|
1845
|
+
const b = this._shrinkRow(f, p, o, d, C);
|
|
1846
1846
|
S = b == null ? void 0 : b.newSheetTransform, v = b == null ? void 0 : b.newTransform;
|
|
1847
1847
|
}
|
|
1848
1848
|
}
|
|
@@ -1854,11 +1854,11 @@ let ot = class extends re {
|
|
|
1854
1854
|
return { redos: [], undos: [] };
|
|
1855
1855
|
if (a.length > 0) {
|
|
1856
1856
|
const u = this._sheetDrawingService.getBatchUpdateOp(a), { undo: m, redo: f, objects: p } = u;
|
|
1857
|
-
l.push({ id:
|
|
1857
|
+
l.push({ id: T.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: P.UPDATE } }), g.push({ id: T.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: P.UPDATE } });
|
|
1858
1858
|
}
|
|
1859
1859
|
if (h.length > 0) {
|
|
1860
1860
|
const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
|
|
1861
|
-
l.push({ id:
|
|
1861
|
+
l.push({ id: T.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: P.REMOVE } }), g.push({ id: T.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: P.INSERT } });
|
|
1862
1862
|
}
|
|
1863
1863
|
return l.push({ id: j.id, params: [t] }), g.push({ id: j.id, params: [t] }), {
|
|
1864
1864
|
redos: l,
|
|
@@ -1871,19 +1871,19 @@ let ot = class extends re {
|
|
|
1871
1871
|
return { redos: [], undos: [] };
|
|
1872
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 = [];
|
|
1873
1873
|
if (Object.keys(c).forEach((u) => {
|
|
1874
|
-
const m = c[u], { sheetTransform: f, transform: p, anchorType:
|
|
1874
|
+
const m = c[u], { sheetTransform: f, transform: p, anchorType: C = y.Position } = m;
|
|
1875
1875
|
if (f == null || p == null)
|
|
1876
1876
|
return;
|
|
1877
1877
|
let S, v;
|
|
1878
1878
|
if (e === "insert") {
|
|
1879
|
-
const _ = this._expandCol(f, p, o, d,
|
|
1879
|
+
const _ = this._expandCol(f, p, o, d, C);
|
|
1880
1880
|
S = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
|
|
1881
1881
|
} else {
|
|
1882
|
-
const { from: _, to:
|
|
1883
|
-
if (
|
|
1882
|
+
const { from: _, to: I } = f, { column: w } = _, { column: O } = I;
|
|
1883
|
+
if (C === y.Both && w >= o && O <= d)
|
|
1884
1884
|
h.push({ unitId: t, subUnitId: r, drawingId: u });
|
|
1885
1885
|
else {
|
|
1886
|
-
const b = this._shrinkCol(f, p, o, d,
|
|
1886
|
+
const b = this._shrinkCol(f, p, o, d, C);
|
|
1887
1887
|
S = b == null ? void 0 : b.newSheetTransform, v = b == null ? void 0 : b.newTransform;
|
|
1888
1888
|
}
|
|
1889
1889
|
}
|
|
@@ -1895,11 +1895,11 @@ let ot = class extends re {
|
|
|
1895
1895
|
return { redos: [], undos: [] };
|
|
1896
1896
|
if (a.length > 0) {
|
|
1897
1897
|
const u = this._sheetDrawingService.getBatchUpdateOp(a), { undo: m, redo: f, objects: p } = u;
|
|
1898
|
-
l.push({ id:
|
|
1898
|
+
l.push({ id: T.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: P.UPDATE } }), g.push({ id: T.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: P.UPDATE } });
|
|
1899
1899
|
}
|
|
1900
1900
|
if (h.length > 0) {
|
|
1901
1901
|
const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
|
|
1902
|
-
l.push({ id:
|
|
1902
|
+
l.push({ id: T.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: P.REMOVE } }), g.push({ id: T.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: P.INSERT } });
|
|
1903
1903
|
}
|
|
1904
1904
|
return l.push({ id: j.id, params: [t] }), g.push({ id: j.id, params: [t] }), { redos: l, undos: g };
|
|
1905
1905
|
}
|
|
@@ -1921,7 +1921,7 @@ let ot = class extends re {
|
|
|
1921
1921
|
c = {
|
|
1922
1922
|
from: { ...o },
|
|
1923
1923
|
to: { ...d, column: g + s }
|
|
1924
|
-
}, a =
|
|
1924
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1925
1925
|
else
|
|
1926
1926
|
return {
|
|
1927
1927
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
@@ -1944,7 +1944,7 @@ let ot = class extends re {
|
|
|
1944
1944
|
c = {
|
|
1945
1945
|
from: { ...o, column: l - s },
|
|
1946
1946
|
to: { ...d, column: g - s }
|
|
1947
|
-
}, a =
|
|
1947
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1948
1948
|
else {
|
|
1949
1949
|
if (l >= n && g <= t)
|
|
1950
1950
|
return null;
|
|
@@ -1953,7 +1953,7 @@ let ot = class extends re {
|
|
|
1953
1953
|
c = {
|
|
1954
1954
|
from: { ...o },
|
|
1955
1955
|
to: { ...d, column: g - s }
|
|
1956
|
-
}, a =
|
|
1956
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1957
1957
|
else
|
|
1958
1958
|
return {
|
|
1959
1959
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
@@ -1981,7 +1981,7 @@ let ot = class extends re {
|
|
|
1981
1981
|
c = {
|
|
1982
1982
|
from: { ...o },
|
|
1983
1983
|
to: { ...d, column: n - 1, columnOffset: h.endX - h.startX }
|
|
1984
|
-
}, a =
|
|
1984
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1985
1985
|
}
|
|
1986
1986
|
}
|
|
1987
1987
|
return c != null && a != null ? {
|
|
@@ -2010,7 +2010,7 @@ let ot = class extends re {
|
|
|
2010
2010
|
...d,
|
|
2011
2011
|
row: g + s
|
|
2012
2012
|
}
|
|
2013
|
-
}, a =
|
|
2013
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
2014
2014
|
else
|
|
2015
2015
|
return {
|
|
2016
2016
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
@@ -2033,7 +2033,7 @@ let ot = class extends re {
|
|
|
2033
2033
|
c = {
|
|
2034
2034
|
from: { ...o, row: l - s },
|
|
2035
2035
|
to: { ...d, row: g - s }
|
|
2036
|
-
}, a =
|
|
2036
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
2037
2037
|
else {
|
|
2038
2038
|
if (l >= n && g <= t)
|
|
2039
2039
|
return null;
|
|
@@ -2042,7 +2042,7 @@ let ot = class extends re {
|
|
|
2042
2042
|
c = {
|
|
2043
2043
|
from: { ...o },
|
|
2044
2044
|
to: { ...d, row: g - s }
|
|
2045
|
-
}, a =
|
|
2045
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
2046
2046
|
else
|
|
2047
2047
|
return {
|
|
2048
2048
|
newSheetTransform: N({ ...e }, this._selectionRenderService),
|
|
@@ -2065,7 +2065,7 @@ let ot = class extends re {
|
|
|
2065
2065
|
c = {
|
|
2066
2066
|
from: { ...o },
|
|
2067
2067
|
to: { ...d, row: n - 1, rowOffset: h.endY - h.startY }
|
|
2068
|
-
}, a =
|
|
2068
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
2069
2069
|
}
|
|
2070
2070
|
}
|
|
2071
2071
|
return c != null && a != null ? {
|
|
@@ -2085,7 +2085,7 @@ let ot = class extends re {
|
|
|
2085
2085
|
c != null && Object.keys(c).forEach((a) => {
|
|
2086
2086
|
if (d === n && g === t) {
|
|
2087
2087
|
const h = c[a];
|
|
2088
|
-
h.transform =
|
|
2088
|
+
h.transform = L(h.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(c[a]);
|
|
2089
2089
|
} else
|
|
2090
2090
|
o.push(c[a]);
|
|
2091
2091
|
});
|
|
@@ -2113,8 +2113,8 @@ let ot = class extends re {
|
|
|
2113
2113
|
return !0;
|
|
2114
2114
|
const { from: c, to: a } = d, { row: h, column: u } = c, { row: m, column: f } = a;
|
|
2115
2115
|
for (let p = 0; p < n.length; p++) {
|
|
2116
|
-
const
|
|
2117
|
-
if (
|
|
2116
|
+
const C = n[p], { startRow: S, endRow: v, startColumn: R, endColumn: _ } = C;
|
|
2117
|
+
if (Dn.intersects(
|
|
2118
2118
|
{
|
|
2119
2119
|
startRow: S,
|
|
2120
2120
|
endRow: v,
|
|
@@ -2128,13 +2128,13 @@ let ot = class extends re {
|
|
|
2128
2128
|
endColumn: f
|
|
2129
2129
|
}
|
|
2130
2130
|
) || h > v || u > _) {
|
|
2131
|
-
const
|
|
2131
|
+
const I = g === y.Position, w = L(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2132
2132
|
r.push({
|
|
2133
2133
|
...o,
|
|
2134
2134
|
transform: {
|
|
2135
2135
|
...w,
|
|
2136
|
-
width:
|
|
2137
|
-
height:
|
|
2136
|
+
width: I ? l == null ? void 0 : l.width : w == null ? void 0 : w.width,
|
|
2137
|
+
height: I ? l == null ? void 0 : l.height : w == null ? void 0 : w.height
|
|
2138
2138
|
}
|
|
2139
2139
|
});
|
|
2140
2140
|
break;
|
|
@@ -2145,10 +2145,10 @@ let ot = class extends re {
|
|
|
2145
2145
|
};
|
|
2146
2146
|
ot = ki([
|
|
2147
2147
|
Q(1, J),
|
|
2148
|
-
Q(2,
|
|
2148
|
+
Q(2, B),
|
|
2149
2149
|
Q(3, pe),
|
|
2150
|
-
Q(4,
|
|
2151
|
-
Q(5,
|
|
2150
|
+
Q(4, W(q)),
|
|
2151
|
+
Q(5, W(at)),
|
|
2152
2152
|
Q(6, F),
|
|
2153
2153
|
Q(7, K),
|
|
2154
2154
|
Q(8, fe)
|
|
@@ -2157,9 +2157,9 @@ var Xi = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, zi = (i, e
|
|
|
2157
2157
|
for (var r = t > 1 ? void 0 : t ? Hi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2158
2158
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2159
2159
|
return t && r && Xi(e, n, r), r;
|
|
2160
|
-
},
|
|
2160
|
+
}, oe = (i, e) => (n, t) => e(n, t, i);
|
|
2161
2161
|
function Ki(i, e, n, t) {
|
|
2162
|
-
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(
|
|
2162
|
+
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(Kn.VIEW_MAIN), d = {
|
|
2163
2163
|
left: !0,
|
|
2164
2164
|
top: !0
|
|
2165
2165
|
};
|
|
@@ -2168,7 +2168,7 @@ function Ki(i, e, n, t) {
|
|
|
2168
2168
|
...i,
|
|
2169
2169
|
absolute: d
|
|
2170
2170
|
};
|
|
2171
|
-
const { left: l, right: g, top: c, bottom: a } = i, h = t.getFreeze(), { startColumn: u, startRow: m, xSplit: f, ySplit: p } = h,
|
|
2171
|
+
const { left: l, right: g, top: c, bottom: a } = i, h = t.getFreeze(), { startColumn: u, startRow: m, xSplit: f, ySplit: p } = h, C = n.getNoMergeCellPositionByIndexWithNoHeader(m - p, u - f), S = n.getNoMergeCellPositionByIndexWithNoHeader(m, u), { rowHeaderWidth: v, columnHeaderHeight: R } = n, _ = S.startX - C.startX, I = S.startY - C.startY, { top: w, left: O, viewportScrollX: b, viewportScrollY: A } = o;
|
|
2172
2172
|
let E, M;
|
|
2173
2173
|
l < O ? (d.left = !0, E = (_ + v + (l - O)) * r, M = Math.max(
|
|
2174
2174
|
Math.min(
|
|
@@ -2178,13 +2178,13 @@ function Ki(i, e, n, t) {
|
|
|
2178
2178
|
(g - b) * r
|
|
2179
2179
|
)) : (d.left = !1, E = Math.max((l - b) * r, (_ + v) * r), M = Math.max((g - b) * r, (_ + v) * r));
|
|
2180
2180
|
let D, U;
|
|
2181
|
-
return c < w ? (d.top = !0, D = (
|
|
2181
|
+
return c < w ? (d.top = !0, D = (I + R + (c - w)) * s, U = Math.max(
|
|
2182
2182
|
Math.min(
|
|
2183
|
-
(
|
|
2184
|
-
(
|
|
2183
|
+
(I + R + (g - w)) * s,
|
|
2184
|
+
(I + R) * s
|
|
2185
2185
|
),
|
|
2186
2186
|
(a - A) * s
|
|
2187
|
-
)) : (d.top = !1, D = Math.max((c - A) * s, (
|
|
2187
|
+
)) : (d.top = !1, D = Math.max((c - A) * s, (I + R) * s), U = Math.max((a - A) * s, (I + R) * s)), {
|
|
2188
2188
|
left: E,
|
|
2189
2189
|
right: M,
|
|
2190
2190
|
top: D,
|
|
@@ -2210,7 +2210,7 @@ const Qe = (i, e, n, t) => {
|
|
|
2210
2210
|
absolute: a.absolute
|
|
2211
2211
|
};
|
|
2212
2212
|
};
|
|
2213
|
-
let $e = class extends
|
|
2213
|
+
let $e = class extends ie {
|
|
2214
2214
|
constructor(e, n, t, r, s, o, d) {
|
|
2215
2215
|
super();
|
|
2216
2216
|
V(this, "_domLayerMap", /* @__PURE__ */ new Map());
|
|
@@ -2225,7 +2225,7 @@ let $e = class extends re {
|
|
|
2225
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();
|
|
2226
2226
|
}
|
|
2227
2227
|
_bindScrollEvent() {
|
|
2228
|
-
this._lifecycleService.lifecycle$.pipe(
|
|
2228
|
+
this._lifecycleService.lifecycle$.pipe(re((e) => e === bn.Rendered), mr(1)).subscribe(() => {
|
|
2229
2229
|
this._scrollUpdateListener();
|
|
2230
2230
|
});
|
|
2231
2231
|
}
|
|
@@ -2280,13 +2280,13 @@ let $e = class extends re {
|
|
|
2280
2280
|
return !0;
|
|
2281
2281
|
if (g !== r)
|
|
2282
2282
|
return;
|
|
2283
|
-
const { left:
|
|
2283
|
+
const { left: C, top: S, width: v, height: R, angle: _, flipX: I, flipY: w, skewX: O, skewY: b } = a, A = ze({ unitId: t, subUnitId: r, drawingId: s }), E = f.getObject(A);
|
|
2284
2284
|
if (E != null) {
|
|
2285
|
-
E.transformByState({ left:
|
|
2285
|
+
E.transformByState({ left: C, top: S, width: v, height: R, angle: _, flipX: I, flipY: w, skewX: O, skewY: b });
|
|
2286
2286
|
return;
|
|
2287
2287
|
}
|
|
2288
2288
|
const M = {
|
|
2289
|
-
left:
|
|
2289
|
+
left: C,
|
|
2290
2290
|
top: S,
|
|
2291
2291
|
width: v,
|
|
2292
2292
|
height: R,
|
|
@@ -2294,8 +2294,8 @@ let $e = class extends re {
|
|
|
2294
2294
|
}, D = h === k.DRAWING_CHART;
|
|
2295
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);
|
|
2296
2296
|
const U = new wt(A, M);
|
|
2297
|
-
D && U.setObjectType(
|
|
2298
|
-
const
|
|
2297
|
+
D && U.setObjectType(Hn.CHART), f.addObject(U, zn), d.allowTransform !== !1 && f.attachTransformerTo(U);
|
|
2298
|
+
const x = this._ensureMap(t, r), Z = new yn(), hn = Qe(U, m.renderObject, c.skeleton, o.worksheet), Fe = new fr(hn), gn = {
|
|
2299
2299
|
dispose: Z,
|
|
2300
2300
|
rect: U,
|
|
2301
2301
|
position$: Fe,
|
|
@@ -2318,7 +2318,7 @@ let $e = class extends re {
|
|
|
2318
2318
|
onWheel: (G) => {
|
|
2319
2319
|
p.dispatchEvent(new WheelEvent(G.type, G));
|
|
2320
2320
|
},
|
|
2321
|
-
props: (gt = (ht =
|
|
2321
|
+
props: (gt = (ht = x.get(s)) == null ? void 0 : ht.props) != null ? gt : this._getFloatDomProps(s),
|
|
2322
2322
|
data: u,
|
|
2323
2323
|
unitId: t
|
|
2324
2324
|
});
|
|
@@ -2330,8 +2330,8 @@ let $e = class extends re {
|
|
|
2330
2330
|
});
|
|
2331
2331
|
Z.add(() => {
|
|
2332
2332
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
2333
|
-
}), lt && Z.add(lt), this._domLayerInfoMap.set(s,
|
|
2334
|
-
...
|
|
2333
|
+
}), lt && Z.add(lt), this._domLayerInfoMap.set(s, gn), x.set(s, {
|
|
2334
|
+
...x.get(s)
|
|
2335
2335
|
});
|
|
2336
2336
|
});
|
|
2337
2337
|
})
|
|
@@ -2361,21 +2361,23 @@ let $e = class extends re {
|
|
|
2361
2361
|
};
|
|
2362
2362
|
this.disposeWithMe(
|
|
2363
2363
|
this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(
|
|
2364
|
-
|
|
2364
|
+
re((n) => !!n),
|
|
2365
|
+
St((n) => n.activeSheet$),
|
|
2366
|
+
re((n) => !!n),
|
|
2365
2367
|
Ee((n) => {
|
|
2366
2368
|
const t = this._renderManagerService.getRenderById(n.getUnitId());
|
|
2367
|
-
return t ? { render: t, unitId: n.getUnitId(), subUnitId: n.
|
|
2369
|
+
return t ? { render: t, unitId: n.getUnitId(), subUnitId: n.getSheetId() } : null;
|
|
2368
2370
|
}),
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
(n) =>
|
|
2371
|
+
re((n) => !!n),
|
|
2372
|
+
St(
|
|
2373
|
+
(n) => On(n.render.scene.getViewport(nr.VIEW_MAIN).onScrollAfter$).pipe(Ee(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
|
|
2372
2374
|
)
|
|
2373
2375
|
).subscribe(({ unitId: n, subUnitId: t }) => {
|
|
2374
2376
|
e(n, t);
|
|
2375
2377
|
})
|
|
2376
2378
|
), this.disposeWithMe(this._commandService.onCommandExecuted((n) => {
|
|
2377
2379
|
var t, r;
|
|
2378
|
-
if (n.id ===
|
|
2380
|
+
if (n.id === rr.id) {
|
|
2379
2381
|
const s = n.params, { unitId: o } = s;
|
|
2380
2382
|
Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((l) => {
|
|
2381
2383
|
e(o, l);
|
|
@@ -2391,7 +2393,7 @@ let $e = class extends re {
|
|
|
2391
2393
|
const { startX: t, endX: r, startY: s, endY: o } = e, d = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(pe);
|
|
2392
2394
|
if (d == null)
|
|
2393
2395
|
return;
|
|
2394
|
-
const l = d.
|
|
2396
|
+
const l = d.getCellWithCoordByOffset(t, s);
|
|
2395
2397
|
if (l == null)
|
|
2396
2398
|
return;
|
|
2397
2399
|
const g = {
|
|
@@ -2399,7 +2401,7 @@ let $e = class extends re {
|
|
|
2399
2401
|
columnOffset: t - l.startX,
|
|
2400
2402
|
row: l.actualRow,
|
|
2401
2403
|
rowOffset: s - l.startY
|
|
2402
|
-
}, c = d.
|
|
2404
|
+
}, c = d.getCellWithCoordByOffset(r, o);
|
|
2403
2405
|
if (c == null)
|
|
2404
2406
|
return;
|
|
2405
2407
|
const a = {
|
|
@@ -2451,7 +2453,7 @@ let $e = class extends re {
|
|
|
2451
2453
|
});
|
|
2452
2454
|
if (!t)
|
|
2453
2455
|
throw new Error("cannot find current target!");
|
|
2454
|
-
const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: d, data: l, allowTransform: g = !0 } = e, c = n != null ? n :
|
|
2456
|
+
const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: d, data: l, allowTransform: g = !0 } = e, c = n != null ? n : Tn(), a = this._getPosition(o, r);
|
|
2455
2457
|
if (a == null)
|
|
2456
2458
|
return;
|
|
2457
2459
|
this._ensureMap(r, s).set(c, e);
|
|
@@ -2494,7 +2496,7 @@ let $e = class extends re {
|
|
|
2494
2496
|
if (!l)
|
|
2495
2497
|
return;
|
|
2496
2498
|
const g = this._sheetDrawingService.getBatchRemoveOp([l]), { redo: c, objects: a } = g;
|
|
2497
|
-
this._commandService.syncExecuteCommand(
|
|
2499
|
+
this._commandService.syncExecuteCommand(T.id, { unitId: r, subUnitId: s, op: c, objects: a, type: P.REMOVE });
|
|
2498
2500
|
}
|
|
2499
2501
|
}
|
|
2500
2502
|
addHook(e) {
|
|
@@ -2507,33 +2509,33 @@ let $e = class extends re {
|
|
|
2507
2509
|
}
|
|
2508
2510
|
};
|
|
2509
2511
|
$e = zi([
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2512
|
+
oe(0, W(J)),
|
|
2513
|
+
oe(1, fe),
|
|
2514
|
+
oe(2, W(B)),
|
|
2515
|
+
oe(3, K),
|
|
2516
|
+
oe(4, W(gr)),
|
|
2517
|
+
oe(5, F),
|
|
2518
|
+
oe(6, W(Mn))
|
|
2517
2519
|
], $e);
|
|
2518
|
-
var
|
|
2520
|
+
var ln = Object.defineProperty, Ji = Object.getOwnPropertyDescriptor, Zi = (i, e, n) => e in i ? ln(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, qi = (i, e, n, t) => {
|
|
2519
2521
|
for (var r = t > 1 ? void 0 : t ? Ji(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2520
2522
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2521
|
-
return t && r &&
|
|
2522
|
-
}, et = (i, e) => (n, t) => e(n, t, i),
|
|
2523
|
+
return t && r && ln(e, n, r), r;
|
|
2524
|
+
}, et = (i, e) => (n, t) => e(n, t, i), un = (i, e, n) => Zi(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2523
2525
|
const Qi = "SHEET_IMAGE_UI_PLUGIN";
|
|
2524
|
-
let
|
|
2525
|
-
constructor(i =
|
|
2526
|
+
let Le = class extends En {
|
|
2527
|
+
constructor(i = Tr, e, n, t) {
|
|
2526
2528
|
super(), this._config = i, this._injector = e, this._renderManagerService = n, this._configService = t;
|
|
2527
2529
|
const { menu: r, ...s } = this._config;
|
|
2528
2530
|
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Or, s);
|
|
2529
2531
|
}
|
|
2530
2532
|
onStarting() {
|
|
2531
|
-
|
|
2533
|
+
Un(this._injector, [
|
|
2532
2534
|
[$e],
|
|
2533
2535
|
[Ne],
|
|
2534
2536
|
[Ue],
|
|
2535
|
-
[Le],
|
|
2536
2537
|
[xe],
|
|
2538
|
+
[We],
|
|
2537
2539
|
[je]
|
|
2538
2540
|
]), Xe(this._injector, [
|
|
2539
2541
|
[$e]
|
|
@@ -2546,8 +2548,8 @@ let Be = class extends Tn {
|
|
|
2546
2548
|
}
|
|
2547
2549
|
onRendered() {
|
|
2548
2550
|
this._registerRenderModules(), Xe(this._injector, [
|
|
2551
|
+
[We],
|
|
2549
2552
|
[xe],
|
|
2550
|
-
[Le],
|
|
2551
2553
|
[Ne]
|
|
2552
2554
|
]);
|
|
2553
2555
|
}
|
|
@@ -2564,28 +2566,28 @@ let Be = class extends Tn {
|
|
|
2564
2566
|
});
|
|
2565
2567
|
}
|
|
2566
2568
|
};
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
Pn(xn,
|
|
2571
|
-
et(1,
|
|
2569
|
+
un(Le, "type", Y.UNIVER_SHEET);
|
|
2570
|
+
un(Le, "pluginName", Qi);
|
|
2571
|
+
Le = qi([
|
|
2572
|
+
Pn(xn, Yn, Jn),
|
|
2573
|
+
et(1, W(Rt)),
|
|
2572
2574
|
et(2, J),
|
|
2573
|
-
et(3,
|
|
2574
|
-
],
|
|
2575
|
+
et(3, An)
|
|
2576
|
+
], Le);
|
|
2575
2577
|
export {
|
|
2576
2578
|
j as ClearSheetDrawingTransformerOperation,
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2579
|
+
nn as DeleteDrawingsCommand,
|
|
2580
|
+
Jt as EditSheetDrawingOperation,
|
|
2581
|
+
rn as GroupSheetDrawingCommand,
|
|
2582
|
+
cn as IMAGE_MENU_ID,
|
|
2581
2583
|
dt as InsertFloatImageCommand,
|
|
2582
2584
|
ke as InsertSheetDrawingCommand,
|
|
2583
2585
|
we as MoveDrawingsCommand,
|
|
2584
2586
|
Ge as RemoveSheetDrawingCommand,
|
|
2585
|
-
|
|
2587
|
+
sn as SetDrawingArrangeCommand,
|
|
2586
2588
|
Ye as SetSheetDrawingCommand,
|
|
2587
2589
|
$e as SheetCanvasFloatDomManagerService,
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2590
|
+
Kt as SidebarSheetDrawingOperation,
|
|
2591
|
+
on as UngroupSheetDrawingCommand,
|
|
2592
|
+
Le as UniverSheetsDrawingUIPlugin
|
|
2591
2593
|
};
|