@univerjs/sheets-drawing-ui 0.5.3-nightly.202501060906 → 0.5.3-nightly.202501070959
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +2 -2
- package/lib/es/facade.js +664 -180
- package/lib/es/index.js +652 -655
- package/lib/types/controllers/drawing-popup-menu.controller.d.ts +3 -2
- package/lib/types/controllers/sheet-drawing-update.controller.d.ts +9 -0
- package/lib/types/facade/f-enum.d.ts +19 -0
- package/lib/types/facade/f-event.d.ts +236 -0
- package/lib/types/facade/f-over-grid-image.d.ts +275 -15
- package/lib/types/facade/f-univer.d.ts +13 -0
- package/lib/types/facade/index.d.ts +6 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var V = (i, e, n) =>
|
|
4
|
-
import { CommandType as Y, ICommandService as
|
|
5
|
-
import { DocDrawingController as
|
|
6
|
-
import {
|
|
7
|
-
import { ImageCropperObject as
|
|
8
|
-
import { IRenderManagerService as X, precisionTo as ye, getGroupState as
|
|
9
|
-
import { ISheetDrawingService as z, SetDrawingApplyMutation as O, DrawingApplyType as
|
|
10
|
-
import { SheetCanvasPopManagerService as
|
|
11
|
-
import { ISidebarService as
|
|
12
|
-
import { takeUntil as
|
|
13
|
-
import { SheetInterceptorService as
|
|
14
|
-
import
|
|
15
|
-
import { docDrawingPositionToTransform as
|
|
16
|
-
import { MessageType as
|
|
17
|
-
const
|
|
1
|
+
var Wn = Object.defineProperty;
|
|
2
|
+
var xn = (i, e, n) => e in i ? Wn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var V = (i, e, n) => xn(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CommandType as Y, ICommandService as B, IUndoRedoService as me, sequenceExecute as Gt, LocaleService as Ke, IUniverInstanceService as fe, useDependency as de, Inject as U, Injector as Se, IContextService as Ft, RxDisposable as $n, UniverInstanceType as F, connectInjector as Bn, toDisposable as Ln, FOCUSING_COMMON_DRAWINGS as he, DrawingTypeEnum as k, Disposable as q, ArrangeTypeEnum as Me, createDocumentModelWithStyle as Gn, ObjectRelativeFromH as Fn, ObjectRelativeFromV as Vn, BooleanNumber as kn, PositionedObjectLayoutType as Hn, WrapTextType as Yn, BuildTextUtils as Xn, Range as zn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as be, DOCS_ZEN_EDITOR_UNIT_ID_KEY as De, InterceptorEffectEnum as Kn, ObjectMatrix as Jn, Tools as we, UserManagerService as qn, IPermissionService as Zn, Rectangle as Qn, Direction as ie, FOCUSING_FX_BAR_EDITOR as er, EDITOR_ACTIVATED as tr, FOCUSING_PANEL_EDITOR as nr, LifecycleService as rr, LifecycleStages as ir, DisposableCollection as sr, fromEventSubject as or, generateRandomId as ar, DependentOn as cr, Plugin as dr, merge as lr, registerDependencies as ur, touchDependencies as nt, IConfigService as hr } from "@univerjs/core";
|
|
5
|
+
import { DocDrawingController as gr, UniverDocsDrawingPlugin as mr } from "@univerjs/docs-drawing";
|
|
6
|
+
import { SetDrawingSelectedOperation as Je, IImageIoService as Vt, IDrawingManagerService as Q, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Dt, DRAWING_IMAGE_COUNT_LIMIT as yt, ImageUploadStatusType as le, DRAWING_IMAGE_ALLOW_SIZE as Ot, getImageSize as Et, DRAWING_IMAGE_WIDTH_LIMIT as Tt, DRAWING_IMAGE_HEIGHT_LIMIT as Pt, getDrawingShapeKeyByDrawingSearch as rt, UniverDrawingPlugin as fr } from "@univerjs/drawing";
|
|
7
|
+
import { ImageCropperObject as pr, COMPONENT_IMAGE_POPUP_MENU as _r, OpenImageCropOperation as wr, ImageResetSizeOperation as vr, DrawingRenderService as kt, DrawingCommonPanel as Sr, UniverDrawingUIPlugin as Ir } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as X, precisionTo as ye, getGroupState as Cr, transformObjectOutOfGroup as Rr, RENDER_CLASS_TYPE as ue, Rect as Ut, ObjectType as Mr, DRAWING_OBJECT_LAYER_INDEX as br, SHEET_VIEWPORT_KEY as Ht } from "@univerjs/engine-render";
|
|
9
|
+
import { ISheetDrawingService as z, SetDrawingApplyMutation as O, DrawingApplyType as E, SheetDrawingAnchorType as y, UniverSheetsDrawingPlugin as Dr } from "@univerjs/sheets-drawing";
|
|
10
|
+
import { SheetCanvasPopManagerService as yr, convertPositionSheetOverGridToAbsolute as Or, ISheetSelectionRenderService as Ie, SheetSkeletonManagerService as Z, attachRangeWithCoord as Yt, IEditorBridgeService as Er, IAutoFillService as Tr, HoverManagerService as Pr, COPY_TYPE as At, PREDEFINED_HOOK_NAME as Oe, virtualizeDiscreteRanges as Ur, ISheetClipboardService as Ar, SheetPrintInterceptorService as Nr, getCurrentRangeDisable$ as jr, SetZoomRatioOperation as Wr } from "@univerjs/sheets-ui";
|
|
11
|
+
import { ISidebarService as xr, IUIPartsService as $r, BuiltInUIPart as Br, ILocalFileService as Lr, IMessageService as Gr, MenuItemType as wt, getMenuHiddenObservable as Xt, RibbonStartGroup as Fr, KeyCode as ge, ComponentManager as Vr, IMenuManagerService as kr, IShortcutService as Hr, CanvasFloatDomService as Yr } from "@univerjs/ui";
|
|
12
|
+
import { takeUntil as Nt, combineLatest as Ee, map as $e, filter as se, distinctUntilChanged as Te, Subject as it, take as Xr, BehaviorSubject as zr, switchMap as jt } from "rxjs";
|
|
13
|
+
import { SheetInterceptorService as qe, getSheetCommandTarget as H, SheetsSelectionsService as zt, SetRangeValuesCommand as Kr, SetWorksheetRowHeightMutation as Kt, SetWorksheetColWidthMutation as Jt, SetWorksheetRowIsAutoHeightMutation as Jr, SetWorksheetRowAutoHeightMutation as qr, AddWorksheetMergeMutation as Zr, RemoveWorksheetMergeMutation as Qr, AFTER_CELL_EDIT as ei, INTERCEPTOR_POINT as ti, InterceptCellContentPriority as ni, WorkbookViewPermission as Wt, WorksheetViewPermission as st, WorkbookEditablePermission as ut, WorksheetEditPermission as xe, InsertRowCommand as qt, InsertColCommand as Zt, RemoveRowCommand as Qt, RemoveColCommand as en, DeleteRangeMoveLeftCommand as tn, DeleteRangeMoveUpCommand as nn, InsertRangeMoveDownCommand as rn, InsertRangeMoveRightCommand as sn, DeltaRowHeightCommand as ht, SetRowHeightCommand as gt, DeltaColumnWidthCommand as on, SetColWidthCommand as an, SetRowHiddenCommand as cn, SetSpecificRowsVisibleCommand as dn, SetSpecificColsVisibleCommand as ln, SetColHiddenCommand as un, MoveColsCommand as hn, MoveRowsCommand as gn, MoveRangeCommand as mn, SetRowVisibleMutation as ri, SetRowHiddenMutation as ii, SetColVisibleMutation as si, SetColHiddenMutation as oi, SetWorksheetActiveOperation as ai, RangeProtectionPermissionEditPoint as ci, SetFrozenMutation as di } from "@univerjs/sheets";
|
|
14
|
+
import fn, { useEffect as vt, forwardRef as pn, useRef as li, createElement as _n, useState as mt } from "react";
|
|
15
|
+
import { docDrawingPositionToTransform as ui, ReplaceSnapshotCommand as hi } from "@univerjs/docs-ui";
|
|
16
|
+
import { MessageType as oe, RadioGroup as gi, Radio as ot } from "@univerjs/design";
|
|
17
|
+
const mi = "sheets-drawing-ui.config", xt = {}, W = {
|
|
18
18
|
id: "sheet.operation.clear-drawing-transformer",
|
|
19
19
|
type: Y.MUTATION,
|
|
20
20
|
handler: (i, e) => {
|
|
@@ -24,20 +24,20 @@ const gi = "sheets-drawing-ui.config", Wt = {}, W = {
|
|
|
24
24
|
(s = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
|
|
25
25
|
}), !0;
|
|
26
26
|
}
|
|
27
|
-
},
|
|
27
|
+
}, Ze = {
|
|
28
28
|
id: "sheet.command.remove-sheet-image",
|
|
29
29
|
type: Y.COMMAND,
|
|
30
30
|
handler: (i, e) => {
|
|
31
31
|
var I, S, R;
|
|
32
|
-
const n = i.get(
|
|
32
|
+
const n = i.get(B), t = i.get(me), r = i.get(qe), s = i.get(z);
|
|
33
33
|
if (!e) return !1;
|
|
34
34
|
const { drawings: o } = e, d = [];
|
|
35
|
-
o.forEach((
|
|
36
|
-
const { unitId: C } =
|
|
35
|
+
o.forEach((w) => {
|
|
36
|
+
const { unitId: C } = w;
|
|
37
37
|
d.push(C);
|
|
38
38
|
});
|
|
39
|
-
const l = s.getBatchRemoveOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = r.onCommandExecute({ id:
|
|
40
|
-
return
|
|
39
|
+
const l = s.getBatchRemoveOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = r.onCommandExecute({ id: Ze.id, params: e }), f = { id: O.id, params: { unitId: g, subUnitId: c, op: h, objects: u, type: E.REMOVE } }, p = { id: O.id, params: { unitId: g, subUnitId: c, op: a, objects: u, type: E.INSERT } };
|
|
40
|
+
return Gt([...(I = m.preRedos) != null ? I : [], f, ...m.redos], n) ? (t.pushUndoRedo({
|
|
41
41
|
unitID: g,
|
|
42
42
|
undoMutations: [
|
|
43
43
|
...(S = m.preUndos) != null ? S : [],
|
|
@@ -53,11 +53,11 @@ const gi = "sheets-drawing-ui.config", Wt = {}, W = {
|
|
|
53
53
|
]
|
|
54
54
|
}), !0) : !1;
|
|
55
55
|
}
|
|
56
|
-
}, wn = "COMPONENT_SHEET_DRAWING_PANEL",
|
|
56
|
+
}, wn = "COMPONENT_SHEET_DRAWING_PANEL", vn = {
|
|
57
57
|
id: "sidebar.operation.sheet-image",
|
|
58
58
|
type: Y.COMMAND,
|
|
59
59
|
handler: async (i, e) => {
|
|
60
|
-
const n = i.get(
|
|
60
|
+
const n = i.get(xr), t = i.get(Ke), r = i.get(fe), s = i.get(B);
|
|
61
61
|
if (!H(r)) return !1;
|
|
62
62
|
switch (e.value) {
|
|
63
63
|
case "open":
|
|
@@ -65,7 +65,7 @@ const gi = "sheets-drawing-ui.config", Wt = {}, W = {
|
|
|
65
65
|
header: { title: t.t("sheetImage.panel.title") },
|
|
66
66
|
children: { label: wn },
|
|
67
67
|
onClose: () => {
|
|
68
|
-
s.
|
|
68
|
+
s.syncExecuteCommand(Je.id, []);
|
|
69
69
|
},
|
|
70
70
|
width: 360
|
|
71
71
|
});
|
|
@@ -77,15 +77,15 @@ const gi = "sheets-drawing-ui.config", Wt = {}, W = {
|
|
|
77
77
|
}
|
|
78
78
|
return !0;
|
|
79
79
|
}
|
|
80
|
-
},
|
|
80
|
+
}, Sn = {
|
|
81
81
|
id: "sheet.operation.edit-sheet-image",
|
|
82
82
|
type: Y.OPERATION,
|
|
83
83
|
handler: (i, e) => {
|
|
84
|
-
const n = i.get(
|
|
85
|
-
return e == null ? !1 : (n.
|
|
84
|
+
const n = i.get(B);
|
|
85
|
+
return e == null ? !1 : (n.syncExecuteCommand(Je.id, [e]), n.executeCommand(vn.id, { value: "open" }), !0);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
var
|
|
88
|
+
var at = { exports: {} }, pe = {};
|
|
89
89
|
/**
|
|
90
90
|
* @license React
|
|
91
91
|
* react-jsx-runtime.production.min.js
|
|
@@ -95,11 +95,11 @@ var ot = { exports: {} }, pe = {};
|
|
|
95
95
|
* This source code is licensed under the MIT license found in the
|
|
96
96
|
* LICENSE file in the root directory of this source tree.
|
|
97
97
|
*/
|
|
98
|
-
var
|
|
99
|
-
function
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
var i =
|
|
98
|
+
var $t;
|
|
99
|
+
function fi() {
|
|
100
|
+
if ($t) return pe;
|
|
101
|
+
$t = 1;
|
|
102
|
+
var i = fn, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, r = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
103
103
|
function o(d, l, g) {
|
|
104
104
|
var c, a = {}, h = null, u = null;
|
|
105
105
|
g !== void 0 && (h = "" + g), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (u = l.ref);
|
|
@@ -109,20 +109,20 @@ function mi() {
|
|
|
109
109
|
}
|
|
110
110
|
return pe.Fragment = n, pe.jsx = o, pe.jsxs = o, pe;
|
|
111
111
|
}
|
|
112
|
-
var
|
|
113
|
-
function
|
|
114
|
-
return
|
|
112
|
+
var Bt;
|
|
113
|
+
function pi() {
|
|
114
|
+
return Bt || (Bt = 1, at.exports = fi()), at.exports;
|
|
115
115
|
}
|
|
116
|
-
var $ =
|
|
117
|
-
const
|
|
118
|
-
uploadLoading:
|
|
116
|
+
var $ = pi();
|
|
117
|
+
const _i = "univer-upload-loading", wi = "univer-upload-loading-body", vi = "univer-upload-loading-body-animation", Si = "univer-UniverCircleAnimation", Ii = "univer-upload-loading-body-text", Pe = {
|
|
118
|
+
uploadLoading: _i,
|
|
119
119
|
uploadLoadingBody: wi,
|
|
120
|
-
uploadLoadingBodyAnimation:
|
|
121
|
-
univerCircleAnimation:
|
|
122
|
-
uploadLoadingBodyText:
|
|
123
|
-
},
|
|
124
|
-
const i = de(
|
|
125
|
-
return
|
|
120
|
+
uploadLoadingBodyAnimation: vi,
|
|
121
|
+
univerCircleAnimation: Si,
|
|
122
|
+
uploadLoadingBodyText: Ii
|
|
123
|
+
}, Ci = () => {
|
|
124
|
+
const i = de(Vt), e = de(Ke), [n, t] = fn.useState(0);
|
|
125
|
+
return vt(() => {
|
|
126
126
|
const r = i.change$.subscribe((s) => {
|
|
127
127
|
t(s);
|
|
128
128
|
});
|
|
@@ -134,19 +134,19 @@ const pi = "univer-upload-loading", wi = "univer-upload-loading-body", _i = "uni
|
|
|
134
134
|
/* @__PURE__ */ $.jsx("div", { className: Pe.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${n}` })
|
|
135
135
|
] }) });
|
|
136
136
|
};
|
|
137
|
-
var
|
|
138
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
137
|
+
var Ri = Object.defineProperty, Mi = Object.getOwnPropertyDescriptor, bi = (i, e, n, t) => {
|
|
138
|
+
for (var r = t > 1 ? void 0 : t ? Mi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
139
139
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
140
|
-
return t && r &&
|
|
141
|
-
},
|
|
142
|
-
let Be = class extends
|
|
143
|
-
constructor(e, n, t, r, s, o, d) {
|
|
140
|
+
return t && r && Ri(e, n, r), r;
|
|
141
|
+
}, te = (i, e) => (n, t) => e(n, t, i);
|
|
142
|
+
let Be = class extends $n {
|
|
143
|
+
constructor(e, n, t, r, s, o, d, l) {
|
|
144
144
|
super();
|
|
145
145
|
V(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
146
|
-
this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = d, this._init();
|
|
146
|
+
this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = d, this._commandService = l, this._init();
|
|
147
147
|
}
|
|
148
148
|
_init() {
|
|
149
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
149
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(Nt(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(Nt(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(Br.CONTENT, () => Bn(Ci, this._injector));
|
|
150
150
|
}
|
|
151
151
|
_dispose(e) {
|
|
152
152
|
const n = e.getUnitId();
|
|
@@ -161,7 +161,7 @@ let Be = class extends xn {
|
|
|
161
161
|
_hasCropObject(e) {
|
|
162
162
|
const n = e.getAllObjectsByOrder();
|
|
163
163
|
for (const t of n)
|
|
164
|
-
if (t instanceof
|
|
164
|
+
if (t instanceof pr)
|
|
165
165
|
return !0;
|
|
166
166
|
return !1;
|
|
167
167
|
}
|
|
@@ -175,7 +175,7 @@ let Be = class extends xn {
|
|
|
175
175
|
return;
|
|
176
176
|
let r;
|
|
177
177
|
this.disposeWithMe(
|
|
178
|
-
|
|
178
|
+
Ln(
|
|
179
179
|
t.createControl$.subscribe(() => {
|
|
180
180
|
if (this._contextService.setContextValue(he, !0), this._hasCropObject(n))
|
|
181
181
|
return;
|
|
@@ -196,22 +196,18 @@ let Be = class extends xn {
|
|
|
196
196
|
r == null || r.dispose();
|
|
197
197
|
const f = this._canvasPopManagerService.getFeatureMenu(c, a, h, u);
|
|
198
198
|
r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
|
|
199
|
-
componentKey:
|
|
199
|
+
componentKey: _r,
|
|
200
200
|
direction: "horizontal",
|
|
201
201
|
offset: [2, 0],
|
|
202
202
|
extraProps: {
|
|
203
203
|
menuItems: f || this._getImageMenuItems(c, a, h, u)
|
|
204
204
|
}
|
|
205
|
-
}))
|
|
206
|
-
unitId: c,
|
|
207
|
-
subUnitId: a,
|
|
208
|
-
drawingId: h
|
|
209
|
-
}]);
|
|
205
|
+
}));
|
|
210
206
|
})
|
|
211
207
|
)
|
|
212
208
|
), this.disposeWithMe(
|
|
213
209
|
t.clearControl$.subscribe(() => {
|
|
214
|
-
r == null || r.dispose(), this._contextService.setContextValue(he, !1), this.
|
|
210
|
+
r == null || r.dispose(), this._contextService.setContextValue(he, !1), this._commandService.syncExecuteCommand(Je.id, []);
|
|
215
211
|
})
|
|
216
212
|
), this.disposeWithMe(
|
|
217
213
|
this._contextService.contextChanged$.subscribe((o) => {
|
|
@@ -228,14 +224,14 @@ let Be = class extends xn {
|
|
|
228
224
|
{
|
|
229
225
|
label: "image-popup.edit",
|
|
230
226
|
index: 0,
|
|
231
|
-
commandId:
|
|
227
|
+
commandId: Sn.id,
|
|
232
228
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
233
229
|
disable: r === k.DRAWING_DOM
|
|
234
230
|
},
|
|
235
231
|
{
|
|
236
232
|
label: "image-popup.delete",
|
|
237
233
|
index: 1,
|
|
238
|
-
commandId:
|
|
234
|
+
commandId: Ze.id,
|
|
239
235
|
commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
|
|
240
236
|
disable: !1
|
|
241
237
|
},
|
|
@@ -249,27 +245,28 @@ let Be = class extends xn {
|
|
|
249
245
|
{
|
|
250
246
|
label: "image-popup.reset",
|
|
251
247
|
index: 3,
|
|
252
|
-
commandId:
|
|
248
|
+
commandId: vr.id,
|
|
253
249
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
254
250
|
disable: r === k.DRAWING_DOM
|
|
255
251
|
}
|
|
256
252
|
];
|
|
257
253
|
}
|
|
258
254
|
};
|
|
259
|
-
Be =
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
255
|
+
Be = bi([
|
|
256
|
+
te(0, U(Se)),
|
|
257
|
+
te(1, Q),
|
|
258
|
+
te(2, U(yr)),
|
|
259
|
+
te(3, X),
|
|
260
|
+
te(4, fe),
|
|
261
|
+
te(5, Ft),
|
|
262
|
+
te(6, U($r)),
|
|
263
|
+
te(7, B)
|
|
267
264
|
], Be);
|
|
268
|
-
function
|
|
265
|
+
function L(i, e, n) {
|
|
269
266
|
const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: d = 0, skewX: l = 0, skewY: g = 0 } = i, c = n.getCurrent();
|
|
270
267
|
if (c == null)
|
|
271
268
|
return;
|
|
272
|
-
const a =
|
|
269
|
+
const a = Or(
|
|
273
270
|
c.unitId,
|
|
274
271
|
c.sheetId,
|
|
275
272
|
{ from: t, to: r },
|
|
@@ -317,12 +314,12 @@ function j(i, e) {
|
|
|
317
314
|
to: m
|
|
318
315
|
};
|
|
319
316
|
}
|
|
320
|
-
var Di = Object.defineProperty,
|
|
321
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
317
|
+
var Di = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, Oi = (i, e, n, t) => {
|
|
318
|
+
for (var r = t > 1 ? void 0 : t ? yi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
322
319
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
323
320
|
return t && r && Di(e, n, r), r;
|
|
324
321
|
}, Ue = (i, e) => (n, t) => e(n, t, i);
|
|
325
|
-
let
|
|
322
|
+
let ft = class extends q {
|
|
326
323
|
constructor(i, e, n, t, r) {
|
|
327
324
|
super(), this._context = i, this._sheetDrawingService = e, this._drawingManagerService = n, this._sheetSelectionRenderService = t, this._sheetSkeletonManagerService = r, this._init();
|
|
328
325
|
}
|
|
@@ -336,22 +333,22 @@ let mt = class extends Z {
|
|
|
336
333
|
const n = i[e];
|
|
337
334
|
for (const t in n.data) {
|
|
338
335
|
const r = n.data[t];
|
|
339
|
-
r.transform =
|
|
336
|
+
r.transform = L(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
|
|
340
337
|
}
|
|
341
338
|
}
|
|
342
339
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
343
340
|
}
|
|
344
341
|
};
|
|
345
|
-
|
|
342
|
+
ft = Oi([
|
|
346
343
|
Ue(1, z),
|
|
347
|
-
Ue(2,
|
|
344
|
+
Ue(2, Q),
|
|
348
345
|
Ue(3, U(Ie)),
|
|
349
|
-
Ue(4, U(
|
|
350
|
-
],
|
|
351
|
-
function
|
|
346
|
+
Ue(4, U(Z))
|
|
347
|
+
], ft);
|
|
348
|
+
function Ei(i) {
|
|
352
349
|
const e = [];
|
|
353
350
|
return i.forEach((n) => {
|
|
354
|
-
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d } = t, l =
|
|
351
|
+
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d } = t, l = Cr(0, 0, r.map((a) => a.transform || {})), g = r.map((a) => {
|
|
355
352
|
const h = a.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: m, drawingId: f } = a;
|
|
356
353
|
return {
|
|
357
354
|
unitId: u,
|
|
@@ -384,7 +381,7 @@ function Ti(i) {
|
|
|
384
381
|
if (l == null)
|
|
385
382
|
return;
|
|
386
383
|
const g = r.map((a) => {
|
|
387
|
-
const { transform: h } = a, { unitId: u, subUnitId: m, drawingId: f } = a, p =
|
|
384
|
+
const { transform: h } = a, { unitId: u, subUnitId: m, drawingId: f } = a, p = Rr(h || {}, l, l.width || 0, l.height || 0);
|
|
388
385
|
return {
|
|
389
386
|
unitId: u,
|
|
390
387
|
subUnitId: m,
|
|
@@ -408,11 +405,11 @@ function Ti(i) {
|
|
|
408
405
|
});
|
|
409
406
|
}), e;
|
|
410
407
|
}
|
|
411
|
-
const
|
|
408
|
+
const In = {
|
|
412
409
|
id: "sheet.command.group-sheet-image",
|
|
413
410
|
type: Y.COMMAND,
|
|
414
411
|
handler: (i, e) => {
|
|
415
|
-
const n = i.get(
|
|
412
|
+
const n = i.get(B), t = i.get(me), r = i.get(z);
|
|
416
413
|
if (!e) return !1;
|
|
417
414
|
const s = [];
|
|
418
415
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -421,27 +418,27 @@ const Sn = {
|
|
|
421
418
|
});
|
|
422
419
|
});
|
|
423
420
|
const o = r.getGroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
|
|
424
|
-
return n.syncExecuteCommand(O.id, { op: c, unitId: d, subUnitId: l, objects: a, type:
|
|
421
|
+
return n.syncExecuteCommand(O.id, { op: c, unitId: d, subUnitId: l, objects: a, type: E.GROUP }) ? (t.pushUndoRedo({
|
|
425
422
|
unitID: d,
|
|
426
423
|
undoMutations: [
|
|
427
|
-
{ id: O.id, params: { op: g, unitId: d, subUnitId: l, objects: Ti(a), type:
|
|
424
|
+
{ id: O.id, params: { op: g, unitId: d, subUnitId: l, objects: Ti(a), type: E.UNGROUP } },
|
|
428
425
|
{ id: W.id, params: s }
|
|
429
426
|
],
|
|
430
427
|
redoMutations: [
|
|
431
|
-
{ id: O.id, params: { op: c, unitId: d, subUnitId: l, objects: a, type:
|
|
428
|
+
{ id: O.id, params: { op: c, unitId: d, subUnitId: l, objects: a, type: E.GROUP } },
|
|
432
429
|
{ id: W.id, params: s }
|
|
433
430
|
]
|
|
434
431
|
}), !0) : !1;
|
|
435
432
|
}
|
|
436
|
-
},
|
|
433
|
+
}, Qe = {
|
|
437
434
|
id: "sheet.command.insert-sheet-image",
|
|
438
435
|
type: Y.COMMAND,
|
|
439
436
|
handler: (i, e) => {
|
|
440
437
|
var I, S, R;
|
|
441
|
-
const n = i.get(
|
|
438
|
+
const n = i.get(B), t = i.get(me), r = i.get(z), s = i.get(qe);
|
|
442
439
|
if (!e) return !1;
|
|
443
|
-
const o = e.drawings, d = o.map((
|
|
444
|
-
return
|
|
440
|
+
const o = e.drawings, d = o.map((w) => w.unitId), l = r.getBatchAddOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = s.onCommandExecute({ id: Qe.id, params: e }), f = { id: O.id, params: { op: h, unitId: g, subUnitId: c, objects: u, type: E.INSERT } }, p = { id: O.id, params: { op: a, unitId: g, subUnitId: c, objects: u, type: E.REMOVE } };
|
|
441
|
+
return Gt([...(I = m.preRedos) != null ? I : [], f, ...m.redos], n) ? (t.pushUndoRedo({
|
|
445
442
|
unitID: g,
|
|
446
443
|
undoMutations: [
|
|
447
444
|
...(S = m.preUndos) != null ? S : [],
|
|
@@ -457,51 +454,51 @@ const Sn = {
|
|
|
457
454
|
]
|
|
458
455
|
}), !0) : !1;
|
|
459
456
|
}
|
|
460
|
-
},
|
|
457
|
+
}, Cn = {
|
|
461
458
|
id: "sheet.command.set-drawing-arrange",
|
|
462
459
|
type: Y.COMMAND,
|
|
463
460
|
handler: (i, e) => {
|
|
464
|
-
const n = i.get(
|
|
461
|
+
const n = i.get(B), t = i.get(me);
|
|
465
462
|
if (!e) return !1;
|
|
466
463
|
const r = i.get(z), { unitId: s, subUnitId: o, drawingIds: d, arrangeType: l } = e, g = { unitId: s, subUnitId: o, drawingIds: d };
|
|
467
464
|
let c;
|
|
468
465
|
if (l === Me.forward ? c = r.getForwardDrawingsOp(g) : l === Me.backward ? c = r.getBackwardDrawingOp(g) : l === Me.front ? c = r.getFrontDrawingsOp(g) : l === Me.back && (c = r.getBackDrawingsOp(g)), c == null)
|
|
469
466
|
return !1;
|
|
470
467
|
const { objects: a, redo: h, undo: u } = c;
|
|
471
|
-
return n.syncExecuteCommand(O.id, { op: h, unitId: s, subUnitId: o, objects: a, type:
|
|
468
|
+
return n.syncExecuteCommand(O.id, { op: h, unitId: s, subUnitId: o, objects: a, type: E.ARRANGE }) ? (t.pushUndoRedo({
|
|
472
469
|
unitID: s,
|
|
473
470
|
undoMutations: [
|
|
474
|
-
{ id: O.id, params: { op: u, unitId: s, subUnitId: o, objects: a, type:
|
|
471
|
+
{ id: O.id, params: { op: u, unitId: s, subUnitId: o, objects: a, type: E.ARRANGE } }
|
|
475
472
|
],
|
|
476
473
|
redoMutations: [
|
|
477
|
-
{ id: O.id, params: { op: h, unitId: s, subUnitId: o, objects: a, type:
|
|
474
|
+
{ id: O.id, params: { op: h, unitId: s, subUnitId: o, objects: a, type: E.ARRANGE } }
|
|
478
475
|
]
|
|
479
476
|
}), !0) : !1;
|
|
480
477
|
}
|
|
481
|
-
},
|
|
478
|
+
}, et = {
|
|
482
479
|
id: "sheet.command.set-sheet-image",
|
|
483
480
|
type: Y.COMMAND,
|
|
484
481
|
handler: (i, e) => {
|
|
485
|
-
const n = i.get(
|
|
482
|
+
const n = i.get(B), t = i.get(me), r = i.get(z);
|
|
486
483
|
if (!e) return !1;
|
|
487
484
|
const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
|
|
488
|
-
return n.syncExecuteCommand(O.id, { unitId: d, subUnitId: l, op: c, objects: a, type:
|
|
485
|
+
return n.syncExecuteCommand(O.id, { unitId: d, subUnitId: l, op: c, objects: a, type: E.UPDATE }) ? (t.pushUndoRedo({
|
|
489
486
|
unitID: d,
|
|
490
487
|
undoMutations: [
|
|
491
|
-
{ id: O.id, params: { unitId: d, subUnitId: l, op: g, objects: a, type:
|
|
488
|
+
{ id: O.id, params: { unitId: d, subUnitId: l, op: g, objects: a, type: E.UPDATE } },
|
|
492
489
|
{ id: W.id, params: [d] }
|
|
493
490
|
],
|
|
494
491
|
redoMutations: [
|
|
495
|
-
{ id: O.id, params: { unitId: d, subUnitId: l, op: c, objects: a, type:
|
|
492
|
+
{ id: O.id, params: { unitId: d, subUnitId: l, op: c, objects: a, type: E.UPDATE } },
|
|
496
493
|
{ id: W.id, params: [d] }
|
|
497
494
|
]
|
|
498
495
|
}), !0) : !1;
|
|
499
496
|
}
|
|
500
|
-
},
|
|
497
|
+
}, Rn = {
|
|
501
498
|
id: "sheet.command.ungroup-sheet-image",
|
|
502
499
|
type: Y.COMMAND,
|
|
503
500
|
handler: (i, e) => {
|
|
504
|
-
const n = i.get(
|
|
501
|
+
const n = i.get(B), t = i.get(me), r = i.get(z);
|
|
505
502
|
if (!e) return !1;
|
|
506
503
|
const s = [];
|
|
507
504
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -510,34 +507,34 @@ const Sn = {
|
|
|
510
507
|
});
|
|
511
508
|
});
|
|
512
509
|
const o = r.getUngroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
|
|
513
|
-
return n.syncExecuteCommand(O.id, { op: c, unitId: d, subUnitId: l, objects: a, type:
|
|
510
|
+
return n.syncExecuteCommand(O.id, { op: c, unitId: d, subUnitId: l, objects: a, type: E.UNGROUP }) ? (t.pushUndoRedo({
|
|
514
511
|
unitID: d,
|
|
515
512
|
undoMutations: [
|
|
516
|
-
{ id: O.id, params: { op: g, unitId: d, subUnitId: l, objects:
|
|
513
|
+
{ id: O.id, params: { op: g, unitId: d, subUnitId: l, objects: Ei(a), type: E.GROUP } },
|
|
517
514
|
{ id: W.id, params: s }
|
|
518
515
|
],
|
|
519
516
|
redoMutations: [
|
|
520
|
-
{ id: O.id, params: { op: c, unitId: d, subUnitId: l, objects: a, type:
|
|
517
|
+
{ id: O.id, params: { op: c, unitId: d, subUnitId: l, objects: a, type: E.UNGROUP } },
|
|
521
518
|
{ id: W.id, params: s }
|
|
522
519
|
]
|
|
523
520
|
}), !0) : !1;
|
|
524
521
|
}
|
|
525
522
|
};
|
|
526
|
-
var
|
|
527
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
523
|
+
var Pi = Object.defineProperty, Ui = Object.getOwnPropertyDescriptor, Ai = (i, e, n, t) => {
|
|
524
|
+
for (var r = t > 1 ? void 0 : t ? Ui(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
528
525
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
529
|
-
return t && r &&
|
|
526
|
+
return t && r && Pi(e, n, r), r;
|
|
530
527
|
}, K = (i, e) => (n, t) => e(n, t, i);
|
|
531
|
-
function
|
|
528
|
+
function Ni(i, e, n) {
|
|
532
529
|
const t = n * Math.PI / 180, r = Math.abs(i * Math.cos(t)) + Math.abs(e * Math.sin(t)), s = Math.abs(i * Math.sin(t)) + Math.abs(e * Math.cos(t));
|
|
533
530
|
return { rotatedWidth: r, rotatedHeight: s };
|
|
534
531
|
}
|
|
535
|
-
function
|
|
532
|
+
function Mn(i, e, n, t, r) {
|
|
536
533
|
var I;
|
|
537
|
-
const { rotatedHeight: s, rotatedWidth: o } =
|
|
534
|
+
const { rotatedHeight: s, rotatedWidth: o } = Ni(n, t, r), l = i.get(X).getRenderById(e.unitId);
|
|
538
535
|
if (!l)
|
|
539
536
|
return !1;
|
|
540
|
-
const c = (I = l.with(
|
|
537
|
+
const c = (I = l.with(Z).getWorksheetSkeleton(e.subUnitId)) == null ? void 0 : I.skeleton;
|
|
541
538
|
if (c == null)
|
|
542
539
|
return !1;
|
|
543
540
|
const a = c.getCellByIndex(e.row, e.col), h = a.mergeInfo.endX - a.mergeInfo.startX - 2, u = a.mergeInfo.endY - a.mergeInfo.startY - 2, m = o / s, p = Math.ceil(Math.min(h, u * m)) / o, v = !p || Number.isNaN(p) ? 1e-3 : p;
|
|
@@ -546,7 +543,7 @@ function Rn(i, e, n, t, r) {
|
|
|
546
543
|
height: t * v
|
|
547
544
|
};
|
|
548
545
|
}
|
|
549
|
-
let ve = class extends
|
|
546
|
+
let ve = class extends q {
|
|
550
547
|
constructor(e, n, t, r, s, o, d, l, g, c, a, h, u) {
|
|
551
548
|
super();
|
|
552
549
|
V(this, "_workbookSelections");
|
|
@@ -557,9 +554,9 @@ let ve = class extends Z {
|
|
|
557
554
|
multiple: !0,
|
|
558
555
|
accept: Dt.map((t) => `.${t.replace("image/", "")}`).join(",")
|
|
559
556
|
}), n = e.length;
|
|
560
|
-
return n >
|
|
561
|
-
type:
|
|
562
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
557
|
+
return n > yt ? (this._messageService.show({
|
|
558
|
+
type: oe.Error,
|
|
559
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(yt))
|
|
563
560
|
}), !1) : n === 0 ? !1 : (e.forEach(async (t) => await this._insertFloatImage(t)), !0);
|
|
564
561
|
}
|
|
565
562
|
async insertCellImage() {
|
|
@@ -576,23 +573,23 @@ let ve = class extends Z {
|
|
|
576
573
|
} catch (I) {
|
|
577
574
|
const S = I.message;
|
|
578
575
|
S === le.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
579
|
-
type:
|
|
580
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
576
|
+
type: oe.Error,
|
|
577
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Ot / (1024 * 1024)))
|
|
581
578
|
}) : S === le.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
582
|
-
type:
|
|
579
|
+
type: oe.Error,
|
|
583
580
|
content: this._localeService.t("update-status.invalidImageType")
|
|
584
581
|
}) : S === le.ERROR_IMAGE && this._messageService.show({
|
|
585
|
-
type:
|
|
582
|
+
type: oe.Error,
|
|
586
583
|
content: this._localeService.t("update-status.invalidImage")
|
|
587
584
|
});
|
|
588
585
|
}
|
|
589
586
|
if (n == null)
|
|
590
587
|
return;
|
|
591
|
-
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
|
|
588
|
+
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 Et(g || ""), { width: u, height: m } = this._context.scene;
|
|
592
589
|
this._imageIoService.addImageSourceCache(l, d, h);
|
|
593
590
|
let f = 1;
|
|
594
|
-
if (c > Tt || a >
|
|
595
|
-
const I = Tt / c, S =
|
|
591
|
+
if (c > Tt || a > Pt) {
|
|
592
|
+
const I = Tt / c, S = Pt / a;
|
|
596
593
|
f = Math.max(I, S);
|
|
597
594
|
}
|
|
598
595
|
const p = this._getImagePosition(c * f, a * f, u, m);
|
|
@@ -605,10 +602,10 @@ let ve = class extends Z {
|
|
|
605
602
|
drawingType: k.DRAWING_IMAGE,
|
|
606
603
|
imageSourceType: d,
|
|
607
604
|
source: l,
|
|
608
|
-
transform:
|
|
605
|
+
transform: L(p, this._selectionRenderService, this._skeletonManagerService),
|
|
609
606
|
sheetTransform: p
|
|
610
607
|
};
|
|
611
|
-
this._commandService.executeCommand(
|
|
608
|
+
this._commandService.executeCommand(Qe.id, {
|
|
612
609
|
unitId: r,
|
|
613
610
|
drawings: [v]
|
|
614
611
|
});
|
|
@@ -621,24 +618,24 @@ let ve = class extends Z {
|
|
|
621
618
|
} catch (p) {
|
|
622
619
|
const v = p.message;
|
|
623
620
|
v === le.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
624
|
-
type:
|
|
625
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
621
|
+
type: oe.Error,
|
|
622
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Ot / (1024 * 1024)))
|
|
626
623
|
}) : v === le.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
627
|
-
type:
|
|
624
|
+
type: oe.Error,
|
|
628
625
|
content: this._localeService.t("update-status.invalidImageType")
|
|
629
626
|
}) : v === le.ERROR_IMAGE && this._messageService.show({
|
|
630
|
-
type:
|
|
627
|
+
type: oe.Error,
|
|
631
628
|
content: this._localeService.t("update-status.invalidImage")
|
|
632
629
|
});
|
|
633
630
|
}
|
|
634
631
|
if (n == null)
|
|
635
632
|
return;
|
|
636
|
-
const { imageId: t, imageSourceType: r, source: s, base64Cache: o } = n, { width: d, height: l, image: g } = await
|
|
633
|
+
const { imageId: t, imageSourceType: r, source: s, base64Cache: o } = n, { width: d, height: l, image: g } = await Et(o || "");
|
|
637
634
|
this._imageIoService.addImageSourceCache(s, r, g);
|
|
638
635
|
const c = this._workbookSelections.getCurrentLastSelection();
|
|
639
636
|
if (!c)
|
|
640
637
|
return !1;
|
|
641
|
-
const a =
|
|
638
|
+
const a = Gn("", {}), h = Mn(
|
|
642
639
|
this._injector,
|
|
643
640
|
{
|
|
644
641
|
unitId: this._context.unitId,
|
|
@@ -658,11 +655,11 @@ let ve = class extends Z {
|
|
|
658
655
|
height: h.height
|
|
659
656
|
},
|
|
660
657
|
positionH: {
|
|
661
|
-
relativeFrom:
|
|
658
|
+
relativeFrom: Fn.PAGE,
|
|
662
659
|
posOffset: 0
|
|
663
660
|
},
|
|
664
661
|
positionV: {
|
|
665
|
-
relativeFrom:
|
|
662
|
+
relativeFrom: Vn.PARAGRAPH,
|
|
666
663
|
posOffset: 0
|
|
667
664
|
},
|
|
668
665
|
angle: 0
|
|
@@ -673,19 +670,19 @@ let ve = class extends Z {
|
|
|
673
670
|
drawingType: k.DRAWING_IMAGE,
|
|
674
671
|
imageSourceType: r,
|
|
675
672
|
source: s,
|
|
676
|
-
transform:
|
|
673
|
+
transform: ui(u),
|
|
677
674
|
docTransform: u,
|
|
678
|
-
behindDoc:
|
|
675
|
+
behindDoc: kn.FALSE,
|
|
679
676
|
title: "",
|
|
680
677
|
description: "",
|
|
681
|
-
layoutType:
|
|
678
|
+
layoutType: Hn.INLINE,
|
|
682
679
|
// Insert inline drawing by default.
|
|
683
|
-
wrapText:
|
|
680
|
+
wrapText: Yn.BOTH_SIDES,
|
|
684
681
|
distB: 0,
|
|
685
682
|
distL: 0,
|
|
686
683
|
distR: 0,
|
|
687
684
|
distT: 0
|
|
688
|
-
}, f =
|
|
685
|
+
}, f = Xn.drawing.add({
|
|
689
686
|
documentDataModel: a,
|
|
690
687
|
drawings: [m],
|
|
691
688
|
selection: {
|
|
@@ -694,7 +691,7 @@ let ve = class extends Z {
|
|
|
694
691
|
endOffset: 0
|
|
695
692
|
}
|
|
696
693
|
});
|
|
697
|
-
return f ? (a.apply(f), this._commandService.syncExecuteCommand(
|
|
694
|
+
return f ? (a.apply(f), this._commandService.syncExecuteCommand(Kr.id, {
|
|
698
695
|
value: {
|
|
699
696
|
[c.primary.actualRow]: {
|
|
700
697
|
[c.primary.actualColumn]: {
|
|
@@ -721,7 +718,7 @@ let ve = class extends Z {
|
|
|
721
718
|
endColumn: 0
|
|
722
719
|
};
|
|
723
720
|
s && s.length > 0 && (o = s[s.length - 1].range);
|
|
724
|
-
const d =
|
|
721
|
+
const d = Yt(this._skeletonManagerService.getCurrent().skeleton, o);
|
|
725
722
|
if (d == null)
|
|
726
723
|
return;
|
|
727
724
|
let { startColumn: l, startRow: g, startX: c, startY: a } = d, h = !1;
|
|
@@ -753,7 +750,7 @@ let ve = class extends Z {
|
|
|
753
750
|
_updateOrderListener() {
|
|
754
751
|
this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
|
|
755
752
|
const { unitId: n, subUnitId: t, drawingIds: r, arrangeType: s } = e;
|
|
756
|
-
this._commandService.executeCommand(
|
|
753
|
+
this._commandService.executeCommand(Cn.id, {
|
|
757
754
|
unitId: n,
|
|
758
755
|
subUnitId: t,
|
|
759
756
|
drawingIds: r,
|
|
@@ -776,11 +773,11 @@ let ve = class extends Z {
|
|
|
776
773
|
return;
|
|
777
774
|
const a = {
|
|
778
775
|
...t,
|
|
779
|
-
transform: { ...g.transform, ...l, ...
|
|
776
|
+
transform: { ...g.transform, ...l, ...L(c, this._selectionRenderService, this._skeletonManagerService) },
|
|
780
777
|
sheetTransform: { ...c }
|
|
781
778
|
};
|
|
782
779
|
n.push(a);
|
|
783
|
-
}), n.length > 0 && this._commandService.executeCommand(
|
|
780
|
+
}), n.length > 0 && this._commandService.executeCommand(et.id, {
|
|
784
781
|
unitId: e[0].unitId,
|
|
785
782
|
drawings: n
|
|
786
783
|
}));
|
|
@@ -788,11 +785,11 @@ let ve = class extends Z {
|
|
|
788
785
|
}
|
|
789
786
|
_groupDrawingListener() {
|
|
790
787
|
this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
|
|
791
|
-
this._commandService.executeCommand(
|
|
788
|
+
this._commandService.executeCommand(In.id, e);
|
|
792
789
|
const { unitId: n, subUnitId: t, drawingId: r } = e[0].parent;
|
|
793
|
-
this.
|
|
790
|
+
this._commandService.syncExecuteCommand(Je.id, [{ unitId: n, subUnitId: t, drawingId: r }]);
|
|
794
791
|
})), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
|
|
795
|
-
this._commandService.executeCommand(
|
|
792
|
+
this._commandService.executeCommand(Rn.id, e);
|
|
796
793
|
}));
|
|
797
794
|
}
|
|
798
795
|
_focusDrawingListener() {
|
|
@@ -803,29 +800,29 @@ let ve = class extends Z {
|
|
|
803
800
|
);
|
|
804
801
|
}
|
|
805
802
|
};
|
|
806
|
-
ve =
|
|
807
|
-
K(1, U(
|
|
808
|
-
K(2,
|
|
803
|
+
ve = Ai([
|
|
804
|
+
K(1, U(Z)),
|
|
805
|
+
K(2, B),
|
|
809
806
|
K(3, Ie),
|
|
810
|
-
K(4,
|
|
811
|
-
K(5,
|
|
807
|
+
K(4, Vt),
|
|
808
|
+
K(5, Lr),
|
|
812
809
|
K(6, z),
|
|
813
|
-
K(7,
|
|
814
|
-
K(8,
|
|
815
|
-
K(9,
|
|
810
|
+
K(7, Q),
|
|
811
|
+
K(8, Ft),
|
|
812
|
+
K(9, Gr),
|
|
816
813
|
K(10, U(Ke)),
|
|
817
|
-
K(11, U(
|
|
814
|
+
K(11, U(zt)),
|
|
818
815
|
K(12, U(Se))
|
|
819
816
|
], ve);
|
|
820
|
-
var
|
|
821
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
817
|
+
var ji = Object.defineProperty, Wi = Object.getOwnPropertyDescriptor, xi = (i, e, n, t) => {
|
|
818
|
+
for (var r = t > 1 ? void 0 : t ? Wi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
822
819
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
823
|
-
return t && r &&
|
|
820
|
+
return t && r && ji(e, n, r), r;
|
|
824
821
|
}, ae = (i, e) => (n, t) => e(n, t, i);
|
|
825
|
-
function
|
|
822
|
+
function pt(i, e, n) {
|
|
826
823
|
var t, r, s, o;
|
|
827
824
|
if (((r = (t = n == null ? void 0 : n.p) == null ? void 0 : t.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = n.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
|
|
828
|
-
const d = n.p.drawings[n.p.drawingsOrder[0]], l =
|
|
825
|
+
const d = n.p.drawings[n.p.drawingsOrder[0]], l = Mn(
|
|
829
826
|
i,
|
|
830
827
|
{
|
|
831
828
|
unitId: e.unitId,
|
|
@@ -842,23 +839,23 @@ function ft(i, e, n) {
|
|
|
842
839
|
}
|
|
843
840
|
return !1;
|
|
844
841
|
}
|
|
845
|
-
let Le = class extends
|
|
842
|
+
let Le = class extends q {
|
|
846
843
|
constructor(i, e, n, t, r, s, o) {
|
|
847
844
|
super(), this._commandService = i, this._sheetInterceptorService = e, this._univerInstanceService = n, this._injector = t, this._drawingManagerService = r, this._docDrawingController = s, this._editorBridgeService = o, this._initHandleResize(), this._handleInitEditor(), this._handleWriteCell(), this._initCellContentInterceptor();
|
|
848
845
|
}
|
|
849
846
|
_initHandleResize() {
|
|
850
847
|
this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
851
848
|
let e, n = [];
|
|
852
|
-
if (i.id ===
|
|
849
|
+
if (i.id === Kt.id) {
|
|
853
850
|
const t = i.params;
|
|
854
851
|
n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
855
|
-
} else if (i.id ===
|
|
852
|
+
} else if (i.id === Jt.id) {
|
|
856
853
|
const t = i.params;
|
|
857
854
|
n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
858
|
-
} else if (i.id ===
|
|
855
|
+
} else if (i.id === Jr.id) {
|
|
859
856
|
const t = i.params;
|
|
860
857
|
n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
861
|
-
} else if (i.id ===
|
|
858
|
+
} else if (i.id === qr.id) {
|
|
862
859
|
const t = i.params;
|
|
863
860
|
e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId }), n = t.rowsAutoHeightInfo.map((r) => ({
|
|
864
861
|
startRow: r.row,
|
|
@@ -866,41 +863,41 @@ let Le = class extends Z {
|
|
|
866
863
|
startColumn: 0,
|
|
867
864
|
endColumn: 9999
|
|
868
865
|
}));
|
|
869
|
-
} else if (i.id ===
|
|
866
|
+
} else if (i.id === Zr.id) {
|
|
870
867
|
const t = i.params;
|
|
871
868
|
n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
872
|
-
} else if (i.id ===
|
|
869
|
+
} else if (i.id === Qr.id) {
|
|
873
870
|
const t = i.params;
|
|
874
871
|
n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
875
872
|
}
|
|
876
873
|
e && n.length && n.forEach((t) => {
|
|
877
|
-
const r =
|
|
874
|
+
const r = zn.transformRange(t, e.worksheet);
|
|
878
875
|
for (let s = r.startRow; s <= r.endRow; s++)
|
|
879
876
|
for (let o = r.startColumn; o <= r.endColumn; o++)
|
|
880
|
-
|
|
877
|
+
pt(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: s, col: o }, e.worksheet.getCellRaw(s, o));
|
|
881
878
|
});
|
|
882
879
|
}));
|
|
883
880
|
}
|
|
884
881
|
_handleInitEditor() {
|
|
885
882
|
this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
|
|
886
|
-
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(
|
|
883
|
+
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(be), this._docDrawingController.loadDrawingDataForUnit(be), this._drawingManagerService.initializeNotification(be)) : this._drawingManagerService.removeDrawingDataForUnit(be);
|
|
887
884
|
})), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
888
|
-
i.id ===
|
|
885
|
+
i.id === hi.id && i.params.unitId === De && (this._drawingManagerService.removeDrawingDataForUnit(De), this._docDrawingController.loadDrawingDataForUnit(De), this._drawingManagerService.initializeNotification(De));
|
|
889
886
|
}));
|
|
890
887
|
}
|
|
891
888
|
_handleWriteCell() {
|
|
892
|
-
this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
889
|
+
this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(ei, {
|
|
893
890
|
priority: 9999,
|
|
894
|
-
handler: (i, e, n) => (
|
|
891
|
+
handler: (i, e, n) => (pt(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: e.row, col: e.col }, i), n(i))
|
|
895
892
|
}));
|
|
896
893
|
}
|
|
897
894
|
_initCellContentInterceptor() {
|
|
898
895
|
this.disposeWithMe(
|
|
899
896
|
this._sheetInterceptorService.intercept(
|
|
900
|
-
|
|
897
|
+
ti.CELL_CONTENT,
|
|
901
898
|
{
|
|
902
|
-
effect:
|
|
903
|
-
priority:
|
|
899
|
+
effect: Kn.Style,
|
|
900
|
+
priority: ni.CELL_IMAGE,
|
|
904
901
|
handler: (i, e, n) => {
|
|
905
902
|
var t;
|
|
906
903
|
return i != null && i.p && ((t = i.p.drawingsOrder) != null && t.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }), n(i);
|
|
@@ -910,21 +907,21 @@ let Le = class extends Z {
|
|
|
910
907
|
);
|
|
911
908
|
}
|
|
912
909
|
};
|
|
913
|
-
Le =
|
|
914
|
-
ae(0,
|
|
915
|
-
ae(1, U(
|
|
910
|
+
Le = xi([
|
|
911
|
+
ae(0, B),
|
|
912
|
+
ae(1, U(qe)),
|
|
916
913
|
ae(2, fe),
|
|
917
914
|
ae(3, U(Se)),
|
|
918
|
-
ae(4,
|
|
919
|
-
ae(5, U(
|
|
920
|
-
ae(6, U(
|
|
915
|
+
ae(4, Q),
|
|
916
|
+
ae(5, U(gr)),
|
|
917
|
+
ae(6, U(Er))
|
|
921
918
|
], Le);
|
|
922
|
-
var
|
|
923
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
919
|
+
var $i = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, Li = (i, e, n, t) => {
|
|
920
|
+
for (var r = t > 1 ? void 0 : t ? Bi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
924
921
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
925
|
-
return t && r &&
|
|
926
|
-
},
|
|
927
|
-
let Ge = class extends
|
|
922
|
+
return t && r && $i(e, n, r), r;
|
|
923
|
+
}, Lt = (i, e) => (n, t) => e(n, t, i);
|
|
924
|
+
let Ge = class extends q {
|
|
928
925
|
constructor(i, e) {
|
|
929
926
|
super(), this._autoFillService = i, this._injector = e, this._initAutoFillHooks();
|
|
930
927
|
}
|
|
@@ -933,24 +930,24 @@ let Ge = class extends Z {
|
|
|
933
930
|
this._autoFillService.addHook({
|
|
934
931
|
id: "sheet-cell-image-autofill",
|
|
935
932
|
onBeforeSubmit: (i, e, n, t) => {
|
|
936
|
-
new
|
|
937
|
-
|
|
933
|
+
new Jn(t).forValue((r, s, o) => {
|
|
934
|
+
pt(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
|
|
938
935
|
});
|
|
939
936
|
}
|
|
940
937
|
})
|
|
941
938
|
);
|
|
942
939
|
}
|
|
943
940
|
};
|
|
944
|
-
Ge =
|
|
945
|
-
|
|
946
|
-
|
|
941
|
+
Ge = Li([
|
|
942
|
+
Lt(0, U(Tr)),
|
|
943
|
+
Lt(1, U(Se))
|
|
947
944
|
], Ge);
|
|
948
|
-
var
|
|
949
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
945
|
+
var Gi = Object.defineProperty, Fi = Object.getOwnPropertyDescriptor, Vi = (i, e, n, t) => {
|
|
946
|
+
for (var r = t > 1 ? void 0 : t ? Fi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
950
947
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
951
|
-
return t && r &&
|
|
948
|
+
return t && r && Gi(e, n, r), r;
|
|
952
949
|
}, Ae = (i, e) => (n, t) => e(n, t, i);
|
|
953
|
-
let Fe = class extends
|
|
950
|
+
let Fe = class extends q {
|
|
954
951
|
constructor(e, n, t, r) {
|
|
955
952
|
super();
|
|
956
953
|
V(this, "_isSetCursor", !1);
|
|
@@ -961,18 +958,18 @@ let Fe = class extends Z {
|
|
|
961
958
|
_initImageClick() {
|
|
962
959
|
}
|
|
963
960
|
};
|
|
964
|
-
Fe =
|
|
965
|
-
Ae(0, U(
|
|
961
|
+
Fe = Vi([
|
|
962
|
+
Ae(0, U(Pr)),
|
|
966
963
|
Ae(1, U(X)),
|
|
967
|
-
Ae(2, U(
|
|
968
|
-
Ae(3, U(
|
|
964
|
+
Ae(2, U(zt)),
|
|
965
|
+
Ae(3, U(kt))
|
|
969
966
|
], Fe);
|
|
970
|
-
var
|
|
971
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
967
|
+
var ki = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, Yi = (i, e, n, t) => {
|
|
968
|
+
for (var r = t > 1 ? void 0 : t ? Hi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
972
969
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
973
|
-
return t && r &&
|
|
974
|
-
},
|
|
975
|
-
let Ve = class extends
|
|
970
|
+
return t && r && ki(e, n, r), r;
|
|
971
|
+
}, ct = (i, e) => (n, t) => e(n, t, i);
|
|
972
|
+
let Ve = class extends q {
|
|
976
973
|
constructor(e, n, t) {
|
|
977
974
|
super();
|
|
978
975
|
V(this, "_copyInfo");
|
|
@@ -983,7 +980,7 @@ let Ve = class extends Z {
|
|
|
983
980
|
id: "SHEET_IMAGE_UI_PLUGIN",
|
|
984
981
|
onBeforeCopy: (e, n, t) => this._collect(e, n, t),
|
|
985
982
|
onPasteCells: (e, n, t, r) => {
|
|
986
|
-
const { copyType: s =
|
|
983
|
+
const { copyType: s = At.COPY, pasteType: o } = r, { range: d } = e || {}, { range: l, unitId: g, subUnitId: c } = n;
|
|
987
984
|
return this._generateMutations(l, { copyType: s, pasteType: o, copyRange: d, unitId: g, subUnitId: c });
|
|
988
985
|
},
|
|
989
986
|
onPastePlainText: (e, n) => ({ undos: [], redos: [] })
|
|
@@ -991,7 +988,7 @@ let Ve = class extends Z {
|
|
|
991
988
|
}
|
|
992
989
|
_collect(e, n, t) {
|
|
993
990
|
var h;
|
|
994
|
-
const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(
|
|
991
|
+
const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(Z);
|
|
995
992
|
if (!r) return;
|
|
996
993
|
const s = r.attachRangeWithCoord(t);
|
|
997
994
|
if (!s)
|
|
@@ -1001,13 +998,13 @@ let Ve = class extends Z {
|
|
|
1001
998
|
const m = c[u], { transform: f } = m;
|
|
1002
999
|
if (m.anchorType !== y.Both || !f)
|
|
1003
1000
|
return;
|
|
1004
|
-
const { left: p = 0, top: v = 0, width: I = 0, height: S = 0 } = f, { drawingStartX: R, drawingEndX:
|
|
1001
|
+
const { left: p = 0, top: v = 0, width: I = 0, height: S = 0 } = f, { drawingStartX: R, drawingEndX: w, drawingStartY: C, drawingEndY: _ } = {
|
|
1005
1002
|
drawingStartX: p,
|
|
1006
1003
|
drawingEndX: p + I,
|
|
1007
1004
|
drawingStartY: v,
|
|
1008
1005
|
drawingEndY: v + S
|
|
1009
1006
|
};
|
|
1010
|
-
o <= R &&
|
|
1007
|
+
o <= R && w <= d && l <= C && _ <= g && a.push(m);
|
|
1011
1008
|
}), a.length && (this._copyInfo = {
|
|
1012
1009
|
drawings: a,
|
|
1013
1010
|
unitId: e,
|
|
@@ -1016,7 +1013,7 @@ let Ve = class extends Z {
|
|
|
1016
1013
|
}
|
|
1017
1014
|
// eslint-disable-next-line max-lines-per-function
|
|
1018
1015
|
_generateMutations(e, n) {
|
|
1019
|
-
var
|
|
1016
|
+
var D;
|
|
1020
1017
|
if (!this._copyInfo)
|
|
1021
1018
|
return { redos: [], undos: [] };
|
|
1022
1019
|
if ([
|
|
@@ -1031,7 +1028,7 @@ let Ve = class extends Z {
|
|
|
1031
1028
|
const { copyRange: t } = n;
|
|
1032
1029
|
if (!t)
|
|
1033
1030
|
return { redos: [], undos: [] };
|
|
1034
|
-
const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [d, l], mapFunc: g } =
|
|
1031
|
+
const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [d, l], mapFunc: g } = Ur([t, e]), { row: c, col: a } = g(d.startRow, d.startColumn), { row: h, col: u } = g(l.startRow, l.startColumn), m = (D = this._renderManagerService.getRenderById(s)) == null ? void 0 : D.with(Z);
|
|
1035
1032
|
if (!m)
|
|
1036
1033
|
return { redos: [], undos: [] };
|
|
1037
1034
|
const f = m.attachRangeWithCoord({
|
|
@@ -1047,34 +1044,34 @@ let Ve = class extends Z {
|
|
|
1047
1044
|
});
|
|
1048
1045
|
if (!f || !p)
|
|
1049
1046
|
return { redos: [], undos: [] };
|
|
1050
|
-
const v = [], I = [], S = p.startX - f.startX, R = p.startY - f.startY,
|
|
1047
|
+
const v = [], I = [], S = p.startX - f.startX, R = p.startY - f.startY, w = h - c, C = u - a, _ = n.copyType === At.CUT, { _sheetDrawingService: T } = this;
|
|
1051
1048
|
return r.forEach((N) => {
|
|
1052
|
-
const { transform: A, sheetTransform:
|
|
1049
|
+
const { transform: A, sheetTransform: b } = N;
|
|
1053
1050
|
if (!A)
|
|
1054
1051
|
return;
|
|
1055
1052
|
const M = {
|
|
1056
1053
|
...N,
|
|
1057
1054
|
unitId: s,
|
|
1058
1055
|
subUnitId: o,
|
|
1059
|
-
drawingId:
|
|
1056
|
+
drawingId: _ ? N.drawingId : we.generateRandomId(),
|
|
1060
1057
|
transform: {
|
|
1061
1058
|
...A,
|
|
1062
1059
|
left: A.left + S,
|
|
1063
1060
|
top: A.top + R
|
|
1064
1061
|
},
|
|
1065
1062
|
sheetTransform: {
|
|
1066
|
-
to: { ...
|
|
1067
|
-
from: { ...
|
|
1063
|
+
to: { ...b.to, row: b.to.row + w, column: b.to.column + C },
|
|
1064
|
+
from: { ...b.from, row: b.from.row + w, column: b.from.column + C }
|
|
1068
1065
|
}
|
|
1069
1066
|
};
|
|
1070
|
-
if (
|
|
1071
|
-
const { undo: P, redo: x, objects: ee } =
|
|
1067
|
+
if (_) {
|
|
1068
|
+
const { undo: P, redo: x, objects: ee } = T.getBatchUpdateOp([M]);
|
|
1072
1069
|
v.push({
|
|
1073
1070
|
id: O.id,
|
|
1074
1071
|
params: {
|
|
1075
1072
|
unitId: s,
|
|
1076
1073
|
subUnitId: o,
|
|
1077
|
-
type:
|
|
1074
|
+
type: E.UPDATE,
|
|
1078
1075
|
op: x,
|
|
1079
1076
|
objects: ee
|
|
1080
1077
|
}
|
|
@@ -1083,14 +1080,14 @@ let Ve = class extends Z {
|
|
|
1083
1080
|
params: {
|
|
1084
1081
|
unitId: s,
|
|
1085
1082
|
subUnitId: o,
|
|
1086
|
-
type:
|
|
1083
|
+
type: E.UPDATE,
|
|
1087
1084
|
op: P,
|
|
1088
1085
|
objects: ee
|
|
1089
1086
|
}
|
|
1090
1087
|
});
|
|
1091
1088
|
} else {
|
|
1092
|
-
const { undo: P, redo: x, objects: ee } =
|
|
1093
|
-
v.push({ id: O.id, params: { op: x, unitId: s, subUnitId: o, objects: ee, type:
|
|
1089
|
+
const { undo: P, redo: x, objects: ee } = T.getBatchAddOp([M]);
|
|
1090
|
+
v.push({ id: O.id, params: { op: x, unitId: s, subUnitId: o, objects: ee, type: E.INSERT } }), I.push({ id: O.id, params: { op: P, unitId: s, subUnitId: o, objects: ee, type: E.REMOVE } });
|
|
1094
1091
|
}
|
|
1095
1092
|
}), {
|
|
1096
1093
|
redos: v,
|
|
@@ -1098,24 +1095,24 @@ let Ve = class extends Z {
|
|
|
1098
1095
|
};
|
|
1099
1096
|
}
|
|
1100
1097
|
};
|
|
1101
|
-
Ve =
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1098
|
+
Ve = Yi([
|
|
1099
|
+
ct(0, Ar),
|
|
1100
|
+
ct(1, X),
|
|
1101
|
+
ct(2, z)
|
|
1105
1102
|
], Ve);
|
|
1106
|
-
var
|
|
1107
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1103
|
+
var Xi = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, Ki = (i, e, n, t) => {
|
|
1104
|
+
for (var r = t > 1 ? void 0 : t ? zi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1108
1105
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1109
|
-
return t && r &&
|
|
1110
|
-
},
|
|
1111
|
-
let ke = class extends
|
|
1106
|
+
return t && r && Xi(e, n, r), r;
|
|
1107
|
+
}, _e = (i, e) => (n, t) => e(n, t, i);
|
|
1108
|
+
let ke = class extends q {
|
|
1112
1109
|
constructor(i, e, n, t, r) {
|
|
1113
1110
|
super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1114
1111
|
}
|
|
1115
1112
|
_initDrawingVisible() {
|
|
1116
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1113
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
|
|
1117
1114
|
this.disposeWithMe(
|
|
1118
|
-
|
|
1115
|
+
Ee([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1119
1116
|
if (!e) {
|
|
1120
1117
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1121
1118
|
return;
|
|
@@ -1126,7 +1123,7 @@ let ke = class extends Z {
|
|
|
1126
1123
|
return;
|
|
1127
1124
|
}
|
|
1128
1125
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
1129
|
-
if (this._permissionService.composePermission([new
|
|
1126
|
+
if (this._permissionService.composePermission([new Wt(r).id, new st(r, s).id]).every((d) => d.value))
|
|
1130
1127
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
1131
1128
|
else {
|
|
1132
1129
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
@@ -1142,9 +1139,9 @@ let ke = class extends Z {
|
|
|
1142
1139
|
);
|
|
1143
1140
|
}
|
|
1144
1141
|
_initDrawingEditable() {
|
|
1145
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1142
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
|
|
1146
1143
|
this.disposeWithMe(
|
|
1147
|
-
|
|
1144
|
+
Ee([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1148
1145
|
if (!e) {
|
|
1149
1146
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1150
1147
|
return;
|
|
@@ -1155,7 +1152,7 @@ let ke = class extends Z {
|
|
|
1155
1152
|
return;
|
|
1156
1153
|
}
|
|
1157
1154
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
1158
|
-
if (this._permissionService.composePermission([new
|
|
1155
|
+
if (this._permissionService.composePermission([new ut(r).id, new xe(r, s).id]).every((d) => d.value))
|
|
1159
1156
|
this._drawingManagerService.setDrawingEditable(!0);
|
|
1160
1157
|
else {
|
|
1161
1158
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
@@ -1171,9 +1168,9 @@ let ke = class extends Z {
|
|
|
1171
1168
|
);
|
|
1172
1169
|
}
|
|
1173
1170
|
_initViewPermissionChange() {
|
|
1174
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1171
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
|
|
1175
1172
|
this.disposeWithMe(
|
|
1176
|
-
|
|
1173
|
+
Ee([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1177
1174
|
e && e.activeSheet$.subscribe((t) => {
|
|
1178
1175
|
var a;
|
|
1179
1176
|
if (!t)
|
|
@@ -1183,10 +1180,10 @@ let ke = class extends Z {
|
|
|
1183
1180
|
const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
|
|
1184
1181
|
if (l == null)
|
|
1185
1182
|
return;
|
|
1186
|
-
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new
|
|
1183
|
+
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new Wt(r).id, new st(r, s).id]).pipe($e((h) => h.every((u) => u.value)));
|
|
1187
1184
|
c == null || c.pipe(
|
|
1188
|
-
|
|
1189
|
-
|
|
1185
|
+
se((h) => h !== o),
|
|
1186
|
+
Te()
|
|
1190
1187
|
).subscribe({
|
|
1191
1188
|
next: (h) => {
|
|
1192
1189
|
o = h, this._drawingManagerService.setDrawingVisible(h);
|
|
@@ -1195,9 +1192,9 @@ let ke = class extends Z {
|
|
|
1195
1192
|
p.classType === ue.IMAGE && f.some((v) => p.oKey.includes(v.drawingId)) && l.removeObject(p);
|
|
1196
1193
|
}), g.clearSelectedObjects());
|
|
1197
1194
|
}
|
|
1198
|
-
}), (a = this._permissionService.getPermissionPoint$(new
|
|
1199
|
-
|
|
1200
|
-
|
|
1195
|
+
}), (a = this._permissionService.getPermissionPoint$(new st(r, s).id)) == null || a.pipe(
|
|
1196
|
+
se((h) => h.value !== o),
|
|
1197
|
+
Te()
|
|
1201
1198
|
).subscribe({
|
|
1202
1199
|
complete: () => {
|
|
1203
1200
|
o = !0, this._drawingManagerService.setDrawingVisible(!0);
|
|
@@ -1210,9 +1207,9 @@ let ke = class extends Z {
|
|
|
1210
1207
|
);
|
|
1211
1208
|
}
|
|
1212
1209
|
_initEditPermissionChange() {
|
|
1213
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1210
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
|
|
1214
1211
|
this.disposeWithMe(
|
|
1215
|
-
|
|
1212
|
+
Ee([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1216
1213
|
e && e.activeSheet$.subscribe((t) => {
|
|
1217
1214
|
var a;
|
|
1218
1215
|
if (!t)
|
|
@@ -1222,10 +1219,10 @@ let ke = class extends Z {
|
|
|
1222
1219
|
const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
|
|
1223
1220
|
if (l == null)
|
|
1224
1221
|
return;
|
|
1225
|
-
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new
|
|
1222
|
+
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new ut(r).id, new xe(r, s).id]).pipe($e((h) => h.every((u) => u.value)));
|
|
1226
1223
|
c == null || c.pipe(
|
|
1227
|
-
|
|
1228
|
-
|
|
1224
|
+
se((h) => h !== o),
|
|
1225
|
+
Te()
|
|
1229
1226
|
).subscribe({
|
|
1230
1227
|
next: (h) => {
|
|
1231
1228
|
o = h, this._drawingManagerService.setDrawingEditable(h);
|
|
@@ -1237,8 +1234,8 @@ let ke = class extends Z {
|
|
|
1237
1234
|
}), g.clearSelectedObjects());
|
|
1238
1235
|
}
|
|
1239
1236
|
}), (a = this._permissionService.getPermissionPoint$(new xe(r, s).id)) == null || a.pipe(
|
|
1240
|
-
|
|
1241
|
-
|
|
1237
|
+
se((h) => h.value !== o),
|
|
1238
|
+
Te()
|
|
1242
1239
|
).subscribe({
|
|
1243
1240
|
complete: () => {
|
|
1244
1241
|
o = !0;
|
|
@@ -1255,19 +1252,19 @@ let ke = class extends Z {
|
|
|
1255
1252
|
);
|
|
1256
1253
|
}
|
|
1257
1254
|
};
|
|
1258
|
-
ke =
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1255
|
+
ke = Ki([
|
|
1256
|
+
_e(0, Q),
|
|
1257
|
+
_e(1, X),
|
|
1258
|
+
_e(2, Zn),
|
|
1259
|
+
_e(3, fe),
|
|
1260
|
+
_e(4, U(qn))
|
|
1264
1261
|
], ke);
|
|
1265
|
-
var
|
|
1266
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1262
|
+
var Ji = Object.defineProperty, qi = Object.getOwnPropertyDescriptor, Zi = (i, e, n, t) => {
|
|
1263
|
+
for (var r = t > 1 ? void 0 : t ? qi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1267
1264
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1268
|
-
return t && r &&
|
|
1265
|
+
return t && r && Ji(e, n, r), r;
|
|
1269
1266
|
}, Ne = (i, e) => (n, t) => e(n, t, i);
|
|
1270
|
-
let He = class extends
|
|
1267
|
+
let He = class extends q {
|
|
1271
1268
|
constructor(i, e, n, t) {
|
|
1272
1269
|
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
|
|
1273
1270
|
}
|
|
@@ -1292,7 +1289,7 @@ let He = class extends Z {
|
|
|
1292
1289
|
const { unitId: t, subUnitId: r } = e, s = this._renderManagerService.getRenderById(t);
|
|
1293
1290
|
if (!s)
|
|
1294
1291
|
return n(i);
|
|
1295
|
-
const o = s.with(
|
|
1292
|
+
const o = s.with(Z).getWorksheetSkeleton(r);
|
|
1296
1293
|
if (!o)
|
|
1297
1294
|
return n(i);
|
|
1298
1295
|
const d = this._drawingManagerService.getDrawingDataForUnit(t), l = d == null ? void 0 : d[e.subUnitId];
|
|
@@ -1300,7 +1297,7 @@ let He = class extends Z {
|
|
|
1300
1297
|
return n(i);
|
|
1301
1298
|
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);
|
|
1302
1299
|
return h.length ? (h.forEach((u) => {
|
|
1303
|
-
if (!u.groupId && u.transform &&
|
|
1300
|
+
if (!u.groupId && u.transform && we.isDefine(u.transform.left) && we.isDefine(u.transform.top) && we.isDefine(u.transform.width) && we.isDefine(u.transform.height)) {
|
|
1304
1301
|
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 });
|
|
1305
1302
|
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);
|
|
1306
1303
|
}
|
|
@@ -1311,19 +1308,18 @@ let He = class extends Z {
|
|
|
1311
1308
|
);
|
|
1312
1309
|
}
|
|
1313
1310
|
};
|
|
1314
|
-
He =
|
|
1315
|
-
Ne(0, U(
|
|
1316
|
-
Ne(1, U(
|
|
1317
|
-
Ne(2,
|
|
1311
|
+
He = Zi([
|
|
1312
|
+
Ne(0, U(Nr)),
|
|
1313
|
+
Ne(1, U(kt)),
|
|
1314
|
+
Ne(2, Q),
|
|
1318
1315
|
Ne(3, X)
|
|
1319
1316
|
], He);
|
|
1320
|
-
var
|
|
1321
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1317
|
+
var Qi = Object.defineProperty, es = Object.getOwnPropertyDescriptor, ts = (i, e, n, t) => {
|
|
1318
|
+
for (var r = t > 1 ? void 0 : t ? es(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1322
1319
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1323
|
-
return t && r &&
|
|
1324
|
-
},
|
|
1325
|
-
const
|
|
1326
|
-
Jt.id,
|
|
1320
|
+
return t && r && Qi(e, n, r), r;
|
|
1321
|
+
}, ne = (i, e) => (n, t) => e(n, t, i);
|
|
1322
|
+
const ns = [
|
|
1327
1323
|
qt.id,
|
|
1328
1324
|
Zt.id,
|
|
1329
1325
|
Qt.id,
|
|
@@ -1331,9 +1327,9 @@ const ts = [
|
|
|
1331
1327
|
tn.id,
|
|
1332
1328
|
nn.id,
|
|
1333
1329
|
rn.id,
|
|
1334
|
-
ut.id,
|
|
1335
|
-
ht.id,
|
|
1336
1330
|
sn.id,
|
|
1331
|
+
ht.id,
|
|
1332
|
+
gt.id,
|
|
1337
1333
|
on.id,
|
|
1338
1334
|
an.id,
|
|
1339
1335
|
cn.id,
|
|
@@ -1341,16 +1337,17 @@ const ts = [
|
|
|
1341
1337
|
ln.id,
|
|
1342
1338
|
un.id,
|
|
1343
1339
|
hn.id,
|
|
1344
|
-
gn.id
|
|
1345
|
-
|
|
1346
|
-
|
|
1340
|
+
gn.id,
|
|
1341
|
+
mn.id
|
|
1342
|
+
], rs = [
|
|
1347
1343
|
ri.id,
|
|
1348
1344
|
ii.id,
|
|
1349
1345
|
si.id,
|
|
1350
|
-
|
|
1351
|
-
Kt.id
|
|
1346
|
+
oi.id,
|
|
1347
|
+
Kt.id,
|
|
1348
|
+
Jt.id
|
|
1352
1349
|
];
|
|
1353
|
-
let
|
|
1350
|
+
let _t = class extends q {
|
|
1354
1351
|
constructor(i, e, n, t, r, s, o, d, l) {
|
|
1355
1352
|
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();
|
|
1356
1353
|
}
|
|
@@ -1358,57 +1355,57 @@ let pt = class extends Z {
|
|
|
1358
1355
|
this.disposeWithMe(
|
|
1359
1356
|
this._sheetInterceptorService.interceptCommand({
|
|
1360
1357
|
getMutations: (i) => {
|
|
1361
|
-
if (!
|
|
1358
|
+
if (!ns.includes(i.id))
|
|
1362
1359
|
return { redos: [], undos: [] };
|
|
1363
1360
|
if (i.params == null)
|
|
1364
1361
|
return { redos: [], undos: [] };
|
|
1365
1362
|
const e = i.id;
|
|
1366
|
-
if (e ===
|
|
1363
|
+
if (e === qt.id)
|
|
1367
1364
|
return this._moveRowInterceptor(i.params, "insert");
|
|
1368
|
-
if ([
|
|
1365
|
+
if ([hn.id, gn.id, mn.id].includes(e))
|
|
1369
1366
|
return this._moveRangeInterceptor(i.params);
|
|
1370
|
-
if (e === qt.id)
|
|
1371
|
-
return this._moveColInterceptor(i.params, "insert");
|
|
1372
1367
|
if (e === Zt.id)
|
|
1373
|
-
return this.
|
|
1368
|
+
return this._moveColInterceptor(i.params, "insert");
|
|
1374
1369
|
if (e === Qt.id)
|
|
1370
|
+
return this._moveRowInterceptor(i.params, "remove");
|
|
1371
|
+
if (e === en.id)
|
|
1375
1372
|
return this._moveColInterceptor(i.params, "remove");
|
|
1376
|
-
if (e ===
|
|
1373
|
+
if (e === tn.id) {
|
|
1377
1374
|
const { range: n } = i.params;
|
|
1378
1375
|
return this._getRangeMoveUndo(
|
|
1379
1376
|
n,
|
|
1380
1377
|
0
|
|
1381
1378
|
/* deleteLeft */
|
|
1382
1379
|
);
|
|
1383
|
-
} else if (e ===
|
|
1380
|
+
} else if (e === nn.id) {
|
|
1384
1381
|
const { range: n } = i.params;
|
|
1385
1382
|
return this._getRangeMoveUndo(
|
|
1386
1383
|
n,
|
|
1387
1384
|
1
|
|
1388
1385
|
/* deleteUp */
|
|
1389
1386
|
);
|
|
1390
|
-
} else if (e ===
|
|
1387
|
+
} else if (e === rn.id) {
|
|
1391
1388
|
const { range: n } = i.params;
|
|
1392
1389
|
return this._getRangeMoveUndo(
|
|
1393
1390
|
n,
|
|
1394
1391
|
2
|
|
1395
1392
|
/* insertDown */
|
|
1396
1393
|
);
|
|
1397
|
-
} else if (e ===
|
|
1394
|
+
} else if (e === sn.id) {
|
|
1398
1395
|
const { range: n } = i.params;
|
|
1399
1396
|
return this._getRangeMoveUndo(
|
|
1400
1397
|
n,
|
|
1401
1398
|
3
|
|
1402
1399
|
/* insertRight */
|
|
1403
1400
|
);
|
|
1404
|
-
} else if (e ===
|
|
1401
|
+
} else if (e === cn.id || e === dn.id) {
|
|
1405
1402
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1406
1403
|
return this._getDrawingUndoForRowVisible(t, r, s);
|
|
1407
|
-
} else if (e ===
|
|
1404
|
+
} else if (e === ln.id || e === un.id) {
|
|
1408
1405
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1409
1406
|
return this._getDrawingUndoForColVisible(t, r, s);
|
|
1410
|
-
} else if (e ===
|
|
1411
|
-
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e ===
|
|
1407
|
+
} else if (e === ht.id || e === gt.id || e === on.id || e === an.id) {
|
|
1408
|
+
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === ht.id || e === gt.id;
|
|
1412
1409
|
return this._getDrawingUndoForRowAndColSize(t, r, s, o);
|
|
1413
1410
|
}
|
|
1414
1411
|
return { redos: [], undos: [] };
|
|
@@ -1428,11 +1425,11 @@ let pt = class extends Z {
|
|
|
1428
1425
|
return { redos: [], undos: [] };
|
|
1429
1426
|
if (l.length > 0) {
|
|
1430
1427
|
const c = this._sheetDrawingService.getBatchUpdateOp(l), { undo: a, redo: h, objects: u } = c;
|
|
1431
|
-
s.push({ id: O.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type:
|
|
1428
|
+
s.push({ id: O.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: E.UPDATE } }), o.push({ id: O.id, params: { unitId: t, subUnitId: r, op: a, objects: u, type: E.UPDATE } });
|
|
1432
1429
|
}
|
|
1433
1430
|
if (g.length > 0) {
|
|
1434
1431
|
const c = this._sheetDrawingService.getBatchRemoveOp(g), a = c.undo, h = c.redo, u = c.objects;
|
|
1435
|
-
s.push({ id: O.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type:
|
|
1432
|
+
s.push({ id: O.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: E.REMOVE } }), o.push({ id: O.id, params: { unitId: t, subUnitId: r, op: a, objects: u, type: E.INSERT } });
|
|
1436
1433
|
}
|
|
1437
1434
|
return s.push({ id: W.id, params: [t] }), o.push({ id: W.id, params: [t] }), {
|
|
1438
1435
|
redos: s,
|
|
@@ -1447,31 +1444,31 @@ let pt = class extends Z {
|
|
|
1447
1444
|
deleteDrawings: r
|
|
1448
1445
|
};
|
|
1449
1446
|
const { startRow: v, endRow: I, startColumn: S, endColumn: R } = i;
|
|
1450
|
-
let
|
|
1447
|
+
let w = null, C = null;
|
|
1451
1448
|
if (e === 0 && u >= v && f <= I)
|
|
1452
1449
|
if (m >= S && p <= R)
|
|
1453
1450
|
r.push({ unitId: l, subUnitId: g, drawingId: c });
|
|
1454
1451
|
else {
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1452
|
+
const _ = this._shrinkCol(s, d, S, R, o);
|
|
1453
|
+
w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
1457
1454
|
}
|
|
1458
1455
|
else if (e === 1 && m >= S && p <= R)
|
|
1459
1456
|
if (u >= v && f <= I)
|
|
1460
1457
|
r.push({ unitId: l, subUnitId: g, drawingId: c });
|
|
1461
1458
|
else {
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1459
|
+
const _ = this._shrinkRow(s, d, v, I, o);
|
|
1460
|
+
w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
1464
1461
|
}
|
|
1465
1462
|
else if (e === 2) {
|
|
1466
|
-
const
|
|
1467
|
-
|
|
1463
|
+
const _ = this._expandRow(s, d, v, I, o);
|
|
1464
|
+
w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
1468
1465
|
} else if (e === 3) {
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1466
|
+
const _ = this._expandCol(s, d, S, R, o);
|
|
1467
|
+
w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
1471
1468
|
}
|
|
1472
|
-
if (
|
|
1473
|
-
const
|
|
1474
|
-
t.push({ ...n, sheetTransform:
|
|
1469
|
+
if (w != null && C != null) {
|
|
1470
|
+
const _ = L(w, this._selectionRenderService, this._skeletonManagerService);
|
|
1471
|
+
t.push({ ...n, sheetTransform: w, transform: _ });
|
|
1475
1472
|
}
|
|
1476
1473
|
return { updateDrawings: t, deleteDrawings: r };
|
|
1477
1474
|
}
|
|
@@ -1491,13 +1488,13 @@ let pt = class extends Z {
|
|
|
1491
1488
|
this._remainDrawingSize(u, r, a);
|
|
1492
1489
|
else {
|
|
1493
1490
|
const { from: f, to: p } = h, { row: v, column: I } = f, { row: S, column: R } = p;
|
|
1494
|
-
for (let
|
|
1495
|
-
const C = n[
|
|
1496
|
-
if (R <
|
|
1491
|
+
for (let w = 0; w < n.length; w++) {
|
|
1492
|
+
const C = n[w], { startRow: _, endRow: T, startColumn: D, endColumn: N } = C;
|
|
1493
|
+
if (R < D)
|
|
1497
1494
|
continue;
|
|
1498
1495
|
if (m === y.Position) {
|
|
1499
1496
|
let M = null, P = null;
|
|
1500
|
-
if (I >=
|
|
1497
|
+
if (I >= D && I <= N) {
|
|
1501
1498
|
const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: I, endColumn: N, startRow: f.row, endRow: p.row });
|
|
1502
1499
|
if (x == null)
|
|
1503
1500
|
return;
|
|
@@ -1510,40 +1507,40 @@ let pt = class extends Z {
|
|
|
1510
1507
|
this._remainDrawingSize(u, r, a);
|
|
1511
1508
|
continue;
|
|
1512
1509
|
}
|
|
1513
|
-
if (I >=
|
|
1510
|
+
if (I >= D && R <= N)
|
|
1514
1511
|
continue;
|
|
1515
|
-
let A = null,
|
|
1516
|
-
if (I >=
|
|
1512
|
+
let A = null, b = null;
|
|
1513
|
+
if (I >= D && I <= N) {
|
|
1517
1514
|
const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: I, endColumn: N, startRow: f.row, endRow: p.row });
|
|
1518
1515
|
if (M == null)
|
|
1519
1516
|
return;
|
|
1520
|
-
|
|
1517
|
+
b = {
|
|
1521
1518
|
...u,
|
|
1522
1519
|
left: (M == null ? void 0 : M.startX) || 0,
|
|
1523
1520
|
width: ((u == null ? void 0 : u.width) || 0) - M.endX + M.startX
|
|
1524
1521
|
};
|
|
1525
|
-
} else if (R >=
|
|
1526
|
-
const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
1522
|
+
} else if (R >= D && R <= N) {
|
|
1523
|
+
const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: R, startRow: f.row, endRow: p.row });
|
|
1527
1524
|
if (M == null)
|
|
1528
1525
|
return;
|
|
1529
|
-
|
|
1526
|
+
b = {
|
|
1530
1527
|
...u,
|
|
1531
1528
|
left: M.startX - ((u == null ? void 0 : u.width) || 0)
|
|
1532
1529
|
};
|
|
1533
1530
|
} else {
|
|
1534
|
-
const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
1531
|
+
const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: N, startRow: f.row, endRow: p.row });
|
|
1535
1532
|
if (M == null)
|
|
1536
1533
|
return;
|
|
1537
|
-
if (
|
|
1534
|
+
if (b = {
|
|
1538
1535
|
...u,
|
|
1539
1536
|
width: ((u == null ? void 0 : u.width) || 0) - M.endX + M.startX
|
|
1540
|
-
}, A = j(
|
|
1541
|
-
s.push({ ...a, sheetTransform: A, transform:
|
|
1537
|
+
}, A = j(b, this._selectionRenderService), A != null && b != null) {
|
|
1538
|
+
s.push({ ...a, sheetTransform: A, transform: b });
|
|
1542
1539
|
break;
|
|
1543
1540
|
}
|
|
1544
1541
|
}
|
|
1545
|
-
if (
|
|
1546
|
-
r.push({ ...a, sheetTransform: A, transform:
|
|
1542
|
+
if (b != null && (A = j(b, this._selectionRenderService)), b != null && A != null) {
|
|
1543
|
+
r.push({ ...a, sheetTransform: A, transform: b });
|
|
1547
1544
|
break;
|
|
1548
1545
|
} else
|
|
1549
1546
|
this._remainDrawingSize(u, r, a);
|
|
@@ -1565,10 +1562,10 @@ let pt = class extends Z {
|
|
|
1565
1562
|
}
|
|
1566
1563
|
_createUndoAndRedoMutation(i, e, n) {
|
|
1567
1564
|
const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, d = [
|
|
1568
|
-
{ id: O.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type:
|
|
1565
|
+
{ id: O.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: E.UPDATE } },
|
|
1569
1566
|
{ id: W.id, params: [i] }
|
|
1570
1567
|
], l = [
|
|
1571
|
-
{ id: O.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type:
|
|
1568
|
+
{ id: O.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type: E.UPDATE } },
|
|
1572
1569
|
{ id: W.id, params: [i] }
|
|
1573
1570
|
];
|
|
1574
1571
|
return {
|
|
@@ -1585,14 +1582,14 @@ let pt = class extends Z {
|
|
|
1585
1582
|
this._remainDrawingSize(u, r, a);
|
|
1586
1583
|
else {
|
|
1587
1584
|
const { from: f, to: p } = h, { row: v, column: I } = f, { row: S, column: R } = p;
|
|
1588
|
-
for (let
|
|
1589
|
-
const C = n[
|
|
1590
|
-
if (S <
|
|
1585
|
+
for (let w = 0; w < n.length; w++) {
|
|
1586
|
+
const C = n[w], { startRow: _, endRow: T, startColumn: D, endColumn: N } = C;
|
|
1587
|
+
if (S < _)
|
|
1591
1588
|
continue;
|
|
1592
1589
|
if (m === y.Position) {
|
|
1593
1590
|
let M = null, P = null;
|
|
1594
|
-
if (v >=
|
|
1595
|
-
const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: v, endRow:
|
|
1591
|
+
if (v >= _ && v <= T) {
|
|
1592
|
+
const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: v, endRow: T });
|
|
1596
1593
|
if (x == null)
|
|
1597
1594
|
return;
|
|
1598
1595
|
P = { ...u, top: x.startY };
|
|
@@ -1604,40 +1601,40 @@ let pt = class extends Z {
|
|
|
1604
1601
|
this._remainDrawingSize(u, r, a);
|
|
1605
1602
|
continue;
|
|
1606
1603
|
}
|
|
1607
|
-
if (v >=
|
|
1604
|
+
if (v >= _ && S <= T)
|
|
1608
1605
|
continue;
|
|
1609
|
-
let A = null,
|
|
1610
|
-
if (v >=
|
|
1611
|
-
const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: v, endRow:
|
|
1606
|
+
let A = null, b = null;
|
|
1607
|
+
if (v >= _ && v <= T) {
|
|
1608
|
+
const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: v, endRow: T });
|
|
1612
1609
|
if (M == null)
|
|
1613
1610
|
return;
|
|
1614
|
-
|
|
1611
|
+
b = {
|
|
1615
1612
|
...u,
|
|
1616
1613
|
top: (M == null ? void 0 : M.startY) || 0,
|
|
1617
1614
|
height: ((u == null ? void 0 : u.height) || 0) - M.endY + M.startY
|
|
1618
1615
|
};
|
|
1619
|
-
} else if (S >=
|
|
1620
|
-
const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow:
|
|
1616
|
+
} else if (S >= _ && S <= T) {
|
|
1617
|
+
const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: _, endRow: S });
|
|
1621
1618
|
if (M == null)
|
|
1622
1619
|
return;
|
|
1623
|
-
|
|
1620
|
+
b = {
|
|
1624
1621
|
...u,
|
|
1625
1622
|
top: M.startY - ((u == null ? void 0 : u.height) || 0)
|
|
1626
1623
|
};
|
|
1627
1624
|
} else {
|
|
1628
|
-
const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow:
|
|
1625
|
+
const M = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: _, endRow: T });
|
|
1629
1626
|
if (M == null)
|
|
1630
1627
|
return;
|
|
1631
|
-
if (
|
|
1628
|
+
if (b = {
|
|
1632
1629
|
...u,
|
|
1633
1630
|
height: ((u == null ? void 0 : u.height) || 0) - M.endY + M.startY
|
|
1634
|
-
}, A = j(
|
|
1635
|
-
s.push({ ...a, sheetTransform: A, transform:
|
|
1631
|
+
}, A = j(b, this._selectionRenderService), A != null && b != null) {
|
|
1632
|
+
s.push({ ...a, sheetTransform: A, transform: b });
|
|
1636
1633
|
break;
|
|
1637
1634
|
}
|
|
1638
1635
|
}
|
|
1639
|
-
if (
|
|
1640
|
-
r.push({ ...a, sheetTransform: A, transform:
|
|
1636
|
+
if (b != null && (A = j(b, this._selectionRenderService)), b != null && A != null) {
|
|
1637
|
+
r.push({ ...a, sheetTransform: A, transform: b });
|
|
1641
1638
|
break;
|
|
1642
1639
|
} else
|
|
1643
1640
|
this._remainDrawingSize(u, r, a);
|
|
@@ -1666,22 +1663,22 @@ let pt = class extends Z {
|
|
|
1666
1663
|
else {
|
|
1667
1664
|
const { from: a, to: h } = l, { row: u, column: m } = a, { row: f, column: p } = h;
|
|
1668
1665
|
for (let v = 0; v < n.length; v++) {
|
|
1669
|
-
const I = n[v], { startRow: S, endRow: R, startColumn:
|
|
1670
|
-
if (f < S || p <
|
|
1666
|
+
const I = n[v], { startRow: S, endRow: R, startColumn: w, endColumn: C } = I;
|
|
1667
|
+
if (f < S || p < w)
|
|
1671
1668
|
continue;
|
|
1672
|
-
if (c === y.Position && (u <= S && f >= R || m <=
|
|
1669
|
+
if (c === y.Position && (u <= S && f >= R || m <= w && p >= C)) {
|
|
1673
1670
|
this._remainDrawingSize(g, s, d);
|
|
1674
1671
|
continue;
|
|
1675
1672
|
}
|
|
1676
|
-
const
|
|
1673
|
+
const _ = L(
|
|
1677
1674
|
{ ...l },
|
|
1678
1675
|
this._selectionRenderService,
|
|
1679
1676
|
this._skeletonManagerService
|
|
1680
1677
|
);
|
|
1681
|
-
if (
|
|
1678
|
+
if (_ != null) {
|
|
1682
1679
|
s.push({
|
|
1683
1680
|
...d,
|
|
1684
|
-
transform:
|
|
1681
|
+
transform: _
|
|
1685
1682
|
});
|
|
1686
1683
|
break;
|
|
1687
1684
|
}
|
|
@@ -1706,44 +1703,44 @@ let pt = class extends Z {
|
|
|
1706
1703
|
const { toRange: e, fromRange: n } = i, t = H(this._univerInstanceService);
|
|
1707
1704
|
if (!t)
|
|
1708
1705
|
return { redos: [], undos: [] };
|
|
1709
|
-
const { unitId: r, subUnitId: s } = t, o = (R = (S = this._renderManagerService.getRenderById(r)) == null ? void 0 : S.with(
|
|
1706
|
+
const { unitId: r, subUnitId: s } = t, o = (R = (S = this._renderManagerService.getRenderById(r)) == null ? void 0 : S.with(Z)) == null ? void 0 : R.getCurrentSkeleton();
|
|
1710
1707
|
if (!o)
|
|
1711
1708
|
return { redos: [], undos: [] };
|
|
1712
|
-
const d =
|
|
1709
|
+
const d = Yt(o, n);
|
|
1713
1710
|
if (!d)
|
|
1714
1711
|
return { redos: [], undos: [] };
|
|
1715
1712
|
const { startX: l, endX: g, startY: c, endY: a } = d, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
|
|
1716
|
-
Object.keys(h).forEach((
|
|
1717
|
-
const C = h[
|
|
1713
|
+
Object.keys(h).forEach((w) => {
|
|
1714
|
+
const C = h[w];
|
|
1718
1715
|
if (C.anchorType !== y.Both)
|
|
1719
1716
|
return;
|
|
1720
|
-
const { transform:
|
|
1721
|
-
if (!
|
|
1717
|
+
const { transform: _ } = C;
|
|
1718
|
+
if (!_)
|
|
1722
1719
|
return;
|
|
1723
|
-
const { left:
|
|
1724
|
-
drawingStartX:
|
|
1725
|
-
drawingEndX:
|
|
1726
|
-
drawingStartY:
|
|
1727
|
-
drawingEndY:
|
|
1720
|
+
const { left: T = 0, top: D = 0, width: N = 0, height: A = 0 } = _, { drawingStartX: b, drawingEndX: M, drawingStartY: P, drawingEndY: x } = {
|
|
1721
|
+
drawingStartX: T,
|
|
1722
|
+
drawingEndX: T + N,
|
|
1723
|
+
drawingStartY: D,
|
|
1724
|
+
drawingEndY: D + A
|
|
1728
1725
|
};
|
|
1729
|
-
l <=
|
|
1726
|
+
l <= b && M <= g && c <= P && x <= a && u.push(C);
|
|
1730
1727
|
});
|
|
1731
|
-
const m = [], f = [], p = e.startRow - n.startRow, v = e.startColumn - n.startColumn, I = u.map((
|
|
1732
|
-
const C =
|
|
1728
|
+
const m = [], f = [], p = e.startRow - n.startRow, v = e.startColumn - n.startColumn, I = u.map((w) => {
|
|
1729
|
+
const C = w.sheetTransform, _ = {
|
|
1733
1730
|
to: { ...C.to, row: C.to.row + p, column: C.to.column + v },
|
|
1734
1731
|
from: { ...C.from, row: C.from.row + p, column: C.from.column + v }
|
|
1735
|
-
},
|
|
1732
|
+
}, T = L(_, this._selectionRenderService, this._skeletonManagerService);
|
|
1736
1733
|
return {
|
|
1737
1734
|
unitId: r,
|
|
1738
1735
|
subUnitId: s,
|
|
1739
|
-
drawingId:
|
|
1740
|
-
transform:
|
|
1741
|
-
sheetTransform:
|
|
1736
|
+
drawingId: w.drawingId,
|
|
1737
|
+
transform: T,
|
|
1738
|
+
sheetTransform: _
|
|
1742
1739
|
};
|
|
1743
1740
|
});
|
|
1744
1741
|
if (I.length) {
|
|
1745
|
-
const
|
|
1746
|
-
m.push({ id: O.id, params: { unitId: r, subUnitId: s, op:
|
|
1742
|
+
const w = this._sheetDrawingService.getBatchUpdateOp(I), { undo: C, redo: _, objects: T } = w;
|
|
1743
|
+
m.push({ id: O.id, params: { unitId: r, subUnitId: s, op: _, objects: T, type: E.UPDATE } }), f.push({ id: O.id, params: { unitId: r, subUnitId: s, op: C, objects: T, type: E.UPDATE } });
|
|
1747
1744
|
}
|
|
1748
1745
|
return { redos: m, undos: f };
|
|
1749
1746
|
}
|
|
@@ -1758,15 +1755,15 @@ let pt = class extends Z {
|
|
|
1758
1755
|
return;
|
|
1759
1756
|
let I, S;
|
|
1760
1757
|
if (e === "insert") {
|
|
1761
|
-
const
|
|
1762
|
-
I =
|
|
1758
|
+
const w = this._expandRow(f, p, o, d, v);
|
|
1759
|
+
I = w == null ? void 0 : w.newSheetTransform, S = w == null ? void 0 : w.newTransform;
|
|
1763
1760
|
} else {
|
|
1764
|
-
const { from:
|
|
1765
|
-
if (v === y.Both &&
|
|
1761
|
+
const { from: w, to: C } = f, { row: _ } = w, { row: T } = C;
|
|
1762
|
+
if (v === y.Both && _ >= o && T <= d)
|
|
1766
1763
|
h.push({ unitId: t, subUnitId: r, drawingId: u });
|
|
1767
1764
|
else {
|
|
1768
|
-
const
|
|
1769
|
-
I =
|
|
1765
|
+
const D = this._shrinkRow(f, p, o, d, v);
|
|
1766
|
+
I = D == null ? void 0 : D.newSheetTransform, S = D == null ? void 0 : D.newTransform;
|
|
1770
1767
|
}
|
|
1771
1768
|
}
|
|
1772
1769
|
if (!I || !S)
|
|
@@ -1777,11 +1774,11 @@ let pt = class extends Z {
|
|
|
1777
1774
|
return { redos: [], undos: [] };
|
|
1778
1775
|
if (a.length > 0) {
|
|
1779
1776
|
const u = this._sheetDrawingService.getBatchUpdateOp(a), { undo: m, redo: f, objects: p } = u;
|
|
1780
|
-
l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type:
|
|
1777
|
+
l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.UPDATE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.UPDATE } });
|
|
1781
1778
|
}
|
|
1782
1779
|
if (h.length > 0) {
|
|
1783
1780
|
const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
|
|
1784
|
-
l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type:
|
|
1781
|
+
l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.REMOVE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.INSERT } });
|
|
1785
1782
|
}
|
|
1786
1783
|
return l.push({ id: W.id, params: [t] }), g.push({ id: W.id, params: [t] }), {
|
|
1787
1784
|
redos: l,
|
|
@@ -1799,15 +1796,15 @@ let pt = class extends Z {
|
|
|
1799
1796
|
return;
|
|
1800
1797
|
let I, S;
|
|
1801
1798
|
if (e === "insert") {
|
|
1802
|
-
const
|
|
1803
|
-
I =
|
|
1799
|
+
const w = this._expandCol(f, p, o, d, v);
|
|
1800
|
+
I = w == null ? void 0 : w.newSheetTransform, S = w == null ? void 0 : w.newTransform;
|
|
1804
1801
|
} else {
|
|
1805
|
-
const { from:
|
|
1806
|
-
if (v === y.Both &&
|
|
1802
|
+
const { from: w, to: C } = f, { column: _ } = w, { column: T } = C;
|
|
1803
|
+
if (v === y.Both && _ >= o && T <= d)
|
|
1807
1804
|
h.push({ unitId: t, subUnitId: r, drawingId: u });
|
|
1808
1805
|
else {
|
|
1809
|
-
const
|
|
1810
|
-
I =
|
|
1806
|
+
const D = this._shrinkCol(f, p, o, d, v);
|
|
1807
|
+
I = D == null ? void 0 : D.newSheetTransform, S = D == null ? void 0 : D.newTransform;
|
|
1811
1808
|
}
|
|
1812
1809
|
}
|
|
1813
1810
|
if (!I || !S)
|
|
@@ -1818,11 +1815,11 @@ let pt = class extends Z {
|
|
|
1818
1815
|
return { redos: [], undos: [] };
|
|
1819
1816
|
if (a.length > 0) {
|
|
1820
1817
|
const u = this._sheetDrawingService.getBatchUpdateOp(a), { undo: m, redo: f, objects: p } = u;
|
|
1821
|
-
l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type:
|
|
1818
|
+
l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.UPDATE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.UPDATE } });
|
|
1822
1819
|
}
|
|
1823
1820
|
if (h.length > 0) {
|
|
1824
1821
|
const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
|
|
1825
|
-
l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type:
|
|
1822
|
+
l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.REMOVE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.INSERT } });
|
|
1826
1823
|
}
|
|
1827
1824
|
return l.push({ id: W.id, params: [t] }), g.push({ id: W.id, params: [t] }), { redos: l, undos: g };
|
|
1828
1825
|
}
|
|
@@ -1844,7 +1841,7 @@ let pt = class extends Z {
|
|
|
1844
1841
|
c = {
|
|
1845
1842
|
from: { ...o },
|
|
1846
1843
|
to: { ...d, column: g + s }
|
|
1847
|
-
}, a =
|
|
1844
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1848
1845
|
else
|
|
1849
1846
|
return {
|
|
1850
1847
|
newSheetTransform: j({ ...e }, this._selectionRenderService),
|
|
@@ -1867,7 +1864,7 @@ let pt = class extends Z {
|
|
|
1867
1864
|
c = {
|
|
1868
1865
|
from: { ...o, column: l - s },
|
|
1869
1866
|
to: { ...d, column: g - s }
|
|
1870
|
-
}, a =
|
|
1867
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1871
1868
|
else {
|
|
1872
1869
|
if (l >= n && g <= t)
|
|
1873
1870
|
return null;
|
|
@@ -1876,7 +1873,7 @@ let pt = class extends Z {
|
|
|
1876
1873
|
c = {
|
|
1877
1874
|
from: { ...o },
|
|
1878
1875
|
to: { ...d, column: g - s }
|
|
1879
|
-
}, a =
|
|
1876
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1880
1877
|
else
|
|
1881
1878
|
return {
|
|
1882
1879
|
newSheetTransform: j({ ...e }, this._selectionRenderService),
|
|
@@ -1904,7 +1901,7 @@ let pt = class extends Z {
|
|
|
1904
1901
|
c = {
|
|
1905
1902
|
from: { ...o },
|
|
1906
1903
|
to: { ...d, column: n - 1, columnOffset: h.endX - h.startX }
|
|
1907
|
-
}, a =
|
|
1904
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1908
1905
|
}
|
|
1909
1906
|
}
|
|
1910
1907
|
return c != null && a != null ? {
|
|
@@ -1933,7 +1930,7 @@ let pt = class extends Z {
|
|
|
1933
1930
|
...d,
|
|
1934
1931
|
row: g + s
|
|
1935
1932
|
}
|
|
1936
|
-
}, a =
|
|
1933
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1937
1934
|
else
|
|
1938
1935
|
return {
|
|
1939
1936
|
newSheetTransform: j({ ...e }, this._selectionRenderService),
|
|
@@ -1956,7 +1953,7 @@ let pt = class extends Z {
|
|
|
1956
1953
|
c = {
|
|
1957
1954
|
from: { ...o, row: l - s },
|
|
1958
1955
|
to: { ...d, row: g - s }
|
|
1959
|
-
}, a =
|
|
1956
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1960
1957
|
else {
|
|
1961
1958
|
if (l >= n && g <= t)
|
|
1962
1959
|
return null;
|
|
@@ -1965,7 +1962,7 @@ let pt = class extends Z {
|
|
|
1965
1962
|
c = {
|
|
1966
1963
|
from: { ...o },
|
|
1967
1964
|
to: { ...d, row: g - s }
|
|
1968
|
-
}, a =
|
|
1965
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1969
1966
|
else
|
|
1970
1967
|
return {
|
|
1971
1968
|
newSheetTransform: j({ ...e }, this._selectionRenderService),
|
|
@@ -1988,7 +1985,7 @@ let pt = class extends Z {
|
|
|
1988
1985
|
c = {
|
|
1989
1986
|
from: { ...o },
|
|
1990
1987
|
to: { ...d, row: n - 1, rowOffset: h.endY - h.startY }
|
|
1991
|
-
}, a =
|
|
1988
|
+
}, a = L(c, this._selectionRenderService, this._skeletonManagerService);
|
|
1992
1989
|
}
|
|
1993
1990
|
}
|
|
1994
1991
|
return c != null && a != null ? {
|
|
@@ -1999,7 +1996,7 @@ let pt = class extends Z {
|
|
|
1999
1996
|
_commandListener() {
|
|
2000
1997
|
this.disposeWithMe(
|
|
2001
1998
|
this._commandService.onCommandExecuted((i) => {
|
|
2002
|
-
i.id ===
|
|
1999
|
+
i.id === ai.id && setTimeout(() => {
|
|
2003
2000
|
const e = i.params, { unitId: n, subUnitId: t } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
|
|
2004
2001
|
Object.keys(r).forEach((d) => {
|
|
2005
2002
|
const l = r[d];
|
|
@@ -2008,7 +2005,7 @@ let pt = class extends Z {
|
|
|
2008
2005
|
c != null && Object.keys(c).forEach((a) => {
|
|
2009
2006
|
if (d === n && g === t) {
|
|
2010
2007
|
const h = c[a];
|
|
2011
|
-
h.transform =
|
|
2008
|
+
h.transform = L(h.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(c[a]);
|
|
2012
2009
|
} else
|
|
2013
2010
|
o.push(c[a]);
|
|
2014
2011
|
});
|
|
@@ -2021,7 +2018,7 @@ let pt = class extends Z {
|
|
|
2021
2018
|
_sheetRefreshListener() {
|
|
2022
2019
|
this.disposeWithMe(
|
|
2023
2020
|
this._commandService.onCommandExecuted((i) => {
|
|
2024
|
-
|
|
2021
|
+
rs.includes(i.id) && requestIdleCallback(() => {
|
|
2025
2022
|
const e = i.params, { unitId: n, subUnitId: t, ranges: r } = e;
|
|
2026
2023
|
this._refreshDrawingTransform(n, t, r);
|
|
2027
2024
|
});
|
|
@@ -2036,13 +2033,13 @@ let pt = class extends Z {
|
|
|
2036
2033
|
return !0;
|
|
2037
2034
|
const { from: c, to: a } = d, { row: h, column: u } = c, { row: m, column: f } = a;
|
|
2038
2035
|
for (let p = 0; p < n.length; p++) {
|
|
2039
|
-
const v = n[p], { startRow: I, endRow: S, startColumn: R, endColumn:
|
|
2040
|
-
if (
|
|
2036
|
+
const v = n[p], { startRow: I, endRow: S, startColumn: R, endColumn: w } = v;
|
|
2037
|
+
if (Qn.intersects(
|
|
2041
2038
|
{
|
|
2042
2039
|
startRow: I,
|
|
2043
2040
|
endRow: S,
|
|
2044
2041
|
startColumn: R,
|
|
2045
|
-
endColumn:
|
|
2042
|
+
endColumn: w
|
|
2046
2043
|
},
|
|
2047
2044
|
{
|
|
2048
2045
|
startRow: h,
|
|
@@ -2050,14 +2047,14 @@ let pt = class extends Z {
|
|
|
2050
2047
|
startColumn: u,
|
|
2051
2048
|
endColumn: f
|
|
2052
2049
|
}
|
|
2053
|
-
) || h > S || u >
|
|
2054
|
-
const C = g === y.Position,
|
|
2050
|
+
) || h > S || u > w) {
|
|
2051
|
+
const C = g === y.Position, _ = L(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2055
2052
|
r.push({
|
|
2056
2053
|
...o,
|
|
2057
2054
|
transform: {
|
|
2058
|
-
...
|
|
2059
|
-
width: C ? l == null ? void 0 : l.width :
|
|
2060
|
-
height: C ? l == null ? void 0 : l.height :
|
|
2055
|
+
..._,
|
|
2056
|
+
width: C ? l == null ? void 0 : l.width : _ == null ? void 0 : _.width,
|
|
2057
|
+
height: C ? l == null ? void 0 : l.height : _ == null ? void 0 : _.height
|
|
2061
2058
|
}
|
|
2062
2059
|
});
|
|
2063
2060
|
break;
|
|
@@ -2066,16 +2063,16 @@ let pt = class extends Z {
|
|
|
2066
2063
|
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(W.id, [i]));
|
|
2067
2064
|
}
|
|
2068
2065
|
};
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
],
|
|
2066
|
+
_t = ts([
|
|
2067
|
+
ne(1, X),
|
|
2068
|
+
ne(2, B),
|
|
2069
|
+
ne(3, Ie),
|
|
2070
|
+
ne(4, U(Z)),
|
|
2071
|
+
ne(5, U(qe)),
|
|
2072
|
+
ne(6, z),
|
|
2073
|
+
ne(7, Q),
|
|
2074
|
+
ne(8, fe)
|
|
2075
|
+
], _t);
|
|
2079
2076
|
var J = function() {
|
|
2080
2077
|
return J = Object.assign || function(i) {
|
|
2081
2078
|
for (var e, n = 1, t = arguments.length; n < t; n++) {
|
|
@@ -2084,23 +2081,23 @@ var J = function() {
|
|
|
2084
2081
|
}
|
|
2085
2082
|
return i;
|
|
2086
2083
|
}, J.apply(this, arguments);
|
|
2087
|
-
},
|
|
2084
|
+
}, is = function(i, e) {
|
|
2088
2085
|
var n = {};
|
|
2089
2086
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
|
|
2090
2087
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
2091
2088
|
for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
|
|
2092
2089
|
e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
|
|
2093
2090
|
return n;
|
|
2094
|
-
},
|
|
2095
|
-
var n = i.icon, t = i.id, r = i.className, s = i.extend, o =
|
|
2091
|
+
}, bn = pn(function(i, e) {
|
|
2092
|
+
var n = i.icon, t = i.id, r = i.className, s = i.extend, o = is(i, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), l = li("_".concat(as()));
|
|
2096
2093
|
return Dn(n, "".concat(t), { defIds: n.defIds, idSuffix: l.current }, J({ ref: e, className: d }, o), s);
|
|
2097
2094
|
});
|
|
2098
2095
|
function Dn(i, e, n, t, r) {
|
|
2099
|
-
return
|
|
2096
|
+
return _n(i.tag, J(J({ key: e }, ss(i, n, r)), t), (os(i, n).children || []).map(function(s, o) {
|
|
2100
2097
|
return Dn(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
|
|
2101
2098
|
}));
|
|
2102
2099
|
}
|
|
2103
|
-
function
|
|
2100
|
+
function ss(i, e, n) {
|
|
2104
2101
|
var t = J({}, i.attrs);
|
|
2105
2102
|
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
|
|
2106
2103
|
var r = e.defIds;
|
|
@@ -2109,29 +2106,29 @@ function is(i, e, n) {
|
|
|
2109
2106
|
typeof d == "string" && (t[o] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
2110
2107
|
})), t;
|
|
2111
2108
|
}
|
|
2112
|
-
function
|
|
2109
|
+
function os(i, e) {
|
|
2113
2110
|
var n, t = e.defIds;
|
|
2114
2111
|
return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? J(J({}, i), { children: i.children.map(function(r) {
|
|
2115
2112
|
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? J(J({}, r), { attrs: J(J({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
2116
2113
|
}) }) : i;
|
|
2117
2114
|
}
|
|
2118
|
-
function
|
|
2115
|
+
function as() {
|
|
2119
2116
|
return Math.random().toString(36).substring(2, 8);
|
|
2120
2117
|
}
|
|
2121
|
-
|
|
2122
|
-
var
|
|
2123
|
-
return
|
|
2118
|
+
bn.displayName = "UniverIcon";
|
|
2119
|
+
var cs = { 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" } }] }, yn = pn(function(i, e) {
|
|
2120
|
+
return _n(bn, Object.assign({}, i, {
|
|
2124
2121
|
id: "add-image-single",
|
|
2125
2122
|
ref: e,
|
|
2126
|
-
icon:
|
|
2123
|
+
icon: cs
|
|
2127
2124
|
}));
|
|
2128
2125
|
});
|
|
2129
|
-
|
|
2130
|
-
const
|
|
2126
|
+
yn.displayName = "AddImageSingle";
|
|
2127
|
+
const On = {
|
|
2131
2128
|
id: "sheet.command.delete-drawing",
|
|
2132
2129
|
type: Y.COMMAND,
|
|
2133
2130
|
handler: (i) => {
|
|
2134
|
-
const e = i.get(
|
|
2131
|
+
const e = i.get(B), t = i.get(z).getFocusDrawings();
|
|
2135
2132
|
if (t.length === 0)
|
|
2136
2133
|
return !1;
|
|
2137
2134
|
const r = t[0].unitId, s = t.map((o) => {
|
|
@@ -2143,30 +2140,30 @@ const yn = {
|
|
|
2143
2140
|
drawingType: c
|
|
2144
2141
|
};
|
|
2145
2142
|
});
|
|
2146
|
-
return e.executeCommand(
|
|
2143
|
+
return e.executeCommand(Ze.id, {
|
|
2147
2144
|
unitId: r,
|
|
2148
2145
|
drawings: s
|
|
2149
2146
|
});
|
|
2150
2147
|
}
|
|
2151
|
-
},
|
|
2148
|
+
}, St = {
|
|
2152
2149
|
id: "sheet.command.insert-float-image",
|
|
2153
2150
|
type: Y.COMMAND,
|
|
2154
2151
|
handler: (i) => {
|
|
2155
2152
|
var n, t;
|
|
2156
|
-
return (t = (n = i.get(X).getCurrentTypeOfRenderer(
|
|
2153
|
+
return (t = (n = i.get(X).getCurrentTypeOfRenderer(F.UNIVER_SHEET)) == null ? void 0 : n.with(ve).insertFloatImage()) != null ? t : !1;
|
|
2157
2154
|
}
|
|
2158
|
-
},
|
|
2155
|
+
}, It = {
|
|
2159
2156
|
id: "sheet.command.insert-cell-image",
|
|
2160
2157
|
type: Y.COMMAND,
|
|
2161
2158
|
handler: (i) => {
|
|
2162
2159
|
var n, t;
|
|
2163
|
-
return (t = (n = i.get(X).getCurrentTypeOfRenderer(
|
|
2160
|
+
return (t = (n = i.get(X).getCurrentTypeOfRenderer(F.UNIVER_SHEET)) == null ? void 0 : n.with(ve).insertCellImage()) != null ? t : !1;
|
|
2164
2161
|
}
|
|
2165
2162
|
}, Ce = {
|
|
2166
2163
|
id: "sheet.command.move-drawing",
|
|
2167
2164
|
type: Y.COMMAND,
|
|
2168
2165
|
handler: (i, e) => {
|
|
2169
|
-
const n = i.get(
|
|
2166
|
+
const n = i.get(B), t = i.get(z), r = i.get(Ie), { direction: s } = e, o = t.getFocusDrawings();
|
|
2170
2167
|
if (o.length === 0)
|
|
2171
2168
|
return !1;
|
|
2172
2169
|
const d = o[0].unitId, l = o.map((c) => {
|
|
@@ -2174,173 +2171,173 @@ const yn = {
|
|
|
2174
2171
|
if (a == null)
|
|
2175
2172
|
return null;
|
|
2176
2173
|
const h = { ...a }, { left: u = 0, top: m = 0 } = a;
|
|
2177
|
-
return s ===
|
|
2174
|
+
return s === ie.UP ? h.top = m - 1 : s === ie.DOWN ? h.top = m + 1 : s === ie.LEFT ? h.left = u - 1 : s === ie.RIGHT && (h.left = u + 1), {
|
|
2178
2175
|
...c,
|
|
2179
2176
|
transform: h,
|
|
2180
2177
|
sheetTransform: j(h, r)
|
|
2181
2178
|
};
|
|
2182
2179
|
}).filter((c) => c != null);
|
|
2183
|
-
return n.syncExecuteCommand(
|
|
2180
|
+
return n.syncExecuteCommand(et.id, {
|
|
2184
2181
|
unitId: d,
|
|
2185
2182
|
drawings: l
|
|
2186
2183
|
}) ? (n.syncExecuteCommand(W.id, [d]), !0) : !1;
|
|
2187
2184
|
}
|
|
2188
|
-
},
|
|
2189
|
-
function
|
|
2185
|
+
}, En = "addition-and-subtraction-single", Tn = "sheet.menu.image";
|
|
2186
|
+
function ds(i) {
|
|
2190
2187
|
return {
|
|
2191
2188
|
id: Tn,
|
|
2192
2189
|
type: wt.SUBITEMS,
|
|
2193
|
-
icon:
|
|
2190
|
+
icon: En,
|
|
2194
2191
|
tooltip: "sheetImage.title",
|
|
2195
|
-
hidden$:
|
|
2196
|
-
disabled$:
|
|
2192
|
+
hidden$: Xt(i, F.UNIVER_SHEET),
|
|
2193
|
+
disabled$: jr(i, { workbookTypes: [ut], worksheetTypes: [xe], rangeTypes: [ci] })
|
|
2197
2194
|
};
|
|
2198
2195
|
}
|
|
2199
|
-
function
|
|
2196
|
+
function ls(i) {
|
|
2200
2197
|
return {
|
|
2201
|
-
id:
|
|
2198
|
+
id: St.id,
|
|
2202
2199
|
title: "sheetImage.upload.float",
|
|
2203
2200
|
type: wt.BUTTON,
|
|
2204
|
-
hidden$:
|
|
2201
|
+
hidden$: Xt(i, F.UNIVER_SHEET)
|
|
2205
2202
|
};
|
|
2206
2203
|
}
|
|
2207
|
-
function
|
|
2204
|
+
function us(i) {
|
|
2208
2205
|
return {
|
|
2209
|
-
id:
|
|
2206
|
+
id: It.id,
|
|
2210
2207
|
title: "sheetImage.upload.cell",
|
|
2211
2208
|
type: wt.BUTTON
|
|
2212
2209
|
};
|
|
2213
2210
|
}
|
|
2214
|
-
const
|
|
2215
|
-
imageCommonPanel:
|
|
2216
|
-
imageCommonPanelGrid:
|
|
2217
|
-
imageCommonPanelBorder:
|
|
2218
|
-
imageCommonPanelTitle:
|
|
2219
|
-
imageCommonPanelSubtitle:
|
|
2220
|
-
imageCommonPanelRow:
|
|
2211
|
+
const hs = "univer-image-common-panel", gs = "univer-image-common-panel-grid", ms = "univer-image-common-panel-border", fs = "univer-image-common-panel-title", ps = "univer-image-common-panel-subtitle", _s = "univer-image-common-panel-row", ws = "univer-image-common-panel-row-vertical", vs = "univer-image-common-panel-column", Ss = "univer-image-common-panel-column-center", Is = "univer-image-common-panel-inline", Cs = "univer-image-common-panel-span2", Rs = "univer-image-common-panel-span3", Ms = "univer-image-common-panel-input", bs = "univer-sheet-image-menu", Ds = "univer-sheet-image-menu-input", re = {
|
|
2212
|
+
imageCommonPanel: hs,
|
|
2213
|
+
imageCommonPanelGrid: gs,
|
|
2214
|
+
imageCommonPanelBorder: ms,
|
|
2215
|
+
imageCommonPanelTitle: fs,
|
|
2216
|
+
imageCommonPanelSubtitle: ps,
|
|
2217
|
+
imageCommonPanelRow: _s,
|
|
2221
2218
|
imageCommonPanelRowVertical: ws,
|
|
2222
|
-
imageCommonPanelColumn:
|
|
2223
|
-
imageCommonPanelColumnCenter:
|
|
2224
|
-
imageCommonPanelInline:
|
|
2225
|
-
imageCommonPanelSpan2:
|
|
2226
|
-
imageCommonPanelSpan3:
|
|
2227
|
-
imageCommonPanelInput:
|
|
2228
|
-
sheetImageMenu:
|
|
2219
|
+
imageCommonPanelColumn: vs,
|
|
2220
|
+
imageCommonPanelColumnCenter: Ss,
|
|
2221
|
+
imageCommonPanelInline: Is,
|
|
2222
|
+
imageCommonPanelSpan2: Cs,
|
|
2223
|
+
imageCommonPanelSpan3: Rs,
|
|
2224
|
+
imageCommonPanelInput: Ms,
|
|
2225
|
+
sheetImageMenu: bs,
|
|
2229
2226
|
sheetImageMenuInput: Ds
|
|
2230
2227
|
};
|
|
2231
|
-
function
|
|
2228
|
+
function Pn(i) {
|
|
2232
2229
|
var e, n, t = "";
|
|
2233
2230
|
if (typeof i == "string" || typeof i == "number") t += i;
|
|
2234
2231
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
2235
2232
|
var r = i.length;
|
|
2236
|
-
for (e = 0; e < r; e++) i[e] && (n =
|
|
2233
|
+
for (e = 0; e < r; e++) i[e] && (n = Pn(i[e])) && (t && (t += " "), t += n);
|
|
2237
2234
|
} else for (n in i) i[n] && (t && (t += " "), t += n);
|
|
2238
2235
|
return t;
|
|
2239
2236
|
}
|
|
2240
2237
|
function je() {
|
|
2241
|
-
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e =
|
|
2238
|
+
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = Pn(i)) && (t && (t += " "), t += e);
|
|
2242
2239
|
return t;
|
|
2243
2240
|
}
|
|
2244
|
-
const
|
|
2241
|
+
const ys = (i) => {
|
|
2245
2242
|
var S;
|
|
2246
|
-
const e = de(
|
|
2243
|
+
const e = de(B), n = de(Ke), t = de(Q), r = de(X), { drawings: s } = i, o = s[0];
|
|
2247
2244
|
if (o == null)
|
|
2248
2245
|
return;
|
|
2249
2246
|
const { unitId: d } = o, l = r.getRenderById(d), g = l == null ? void 0 : l.scene;
|
|
2250
2247
|
if (g == null)
|
|
2251
2248
|
return;
|
|
2252
|
-
const c = g.getTransformerByCreate(), [a, h] =
|
|
2253
|
-
function p(R,
|
|
2249
|
+
const c = g.getTransformerByCreate(), [a, h] = mt(!0), u = (S = o.anchorType) != null ? S : y.Position, [m, f] = mt(u);
|
|
2250
|
+
function p(R, w) {
|
|
2254
2251
|
const C = [];
|
|
2255
|
-
return R.forEach((
|
|
2256
|
-
const { oKey:
|
|
2257
|
-
if (
|
|
2252
|
+
return R.forEach((_) => {
|
|
2253
|
+
const { oKey: T } = _, D = w.getDrawingOKey(T);
|
|
2254
|
+
if (D == null)
|
|
2258
2255
|
return C.push(null), !0;
|
|
2259
|
-
const { unitId: N, subUnitId: A, drawingId:
|
|
2256
|
+
const { unitId: N, subUnitId: A, drawingId: b, drawingType: M, anchorType: P, sheetTransform: x } = D;
|
|
2260
2257
|
C.push({
|
|
2261
2258
|
unitId: N,
|
|
2262
2259
|
subUnitId: A,
|
|
2263
|
-
drawingId:
|
|
2260
|
+
drawingId: b,
|
|
2264
2261
|
anchorType: P,
|
|
2265
2262
|
sheetTransform: x,
|
|
2266
2263
|
drawingType: M
|
|
2267
2264
|
});
|
|
2268
2265
|
}), C;
|
|
2269
2266
|
}
|
|
2270
|
-
|
|
2267
|
+
vt(() => {
|
|
2271
2268
|
const R = c.clearControl$.subscribe((C) => {
|
|
2272
2269
|
C === !0 && h(!1);
|
|
2273
|
-
}),
|
|
2274
|
-
var
|
|
2275
|
-
const { objects:
|
|
2276
|
-
if (
|
|
2270
|
+
}), w = c.changeStart$.subscribe((C) => {
|
|
2271
|
+
var D;
|
|
2272
|
+
const { objects: _ } = C, T = p(_, t);
|
|
2273
|
+
if (T.length === 0)
|
|
2277
2274
|
h(!1);
|
|
2278
|
-
else if (
|
|
2275
|
+
else if (T.length >= 1) {
|
|
2279
2276
|
h(!0);
|
|
2280
|
-
const N = ((
|
|
2277
|
+
const N = ((D = T[0]) == null ? void 0 : D.anchorType) || y.Position;
|
|
2281
2278
|
f(N);
|
|
2282
2279
|
}
|
|
2283
2280
|
});
|
|
2284
2281
|
return () => {
|
|
2285
|
-
|
|
2282
|
+
w.unsubscribe(), R.unsubscribe();
|
|
2286
2283
|
};
|
|
2287
2284
|
}, []);
|
|
2288
2285
|
function v(R) {
|
|
2289
2286
|
f(R);
|
|
2290
|
-
const
|
|
2291
|
-
if (
|
|
2287
|
+
const w = t.getFocusDrawings();
|
|
2288
|
+
if (w.length === 0)
|
|
2292
2289
|
return;
|
|
2293
|
-
const C =
|
|
2294
|
-
unitId:
|
|
2295
|
-
subUnitId:
|
|
2296
|
-
drawingId:
|
|
2290
|
+
const C = w.map((_) => ({
|
|
2291
|
+
unitId: _.unitId,
|
|
2292
|
+
subUnitId: _.subUnitId,
|
|
2293
|
+
drawingId: _.drawingId,
|
|
2297
2294
|
anchorType: R
|
|
2298
2295
|
}));
|
|
2299
|
-
e.executeCommand(
|
|
2300
|
-
unitId:
|
|
2296
|
+
e.executeCommand(et.id, {
|
|
2297
|
+
unitId: w[0].unitId,
|
|
2301
2298
|
drawings: C
|
|
2302
2299
|
});
|
|
2303
2300
|
}
|
|
2304
2301
|
const I = (R) => R ? "block" : "none";
|
|
2305
|
-
return /* @__PURE__ */ $.jsxs("div", { className: je(
|
|
2306
|
-
/* @__PURE__ */ $.jsx("div", { className:
|
|
2307
|
-
/* @__PURE__ */ $.jsx("div", { className: je(
|
|
2308
|
-
/* @__PURE__ */ $.jsx(
|
|
2309
|
-
/* @__PURE__ */ $.jsx(
|
|
2310
|
-
/* @__PURE__ */ $.jsx(
|
|
2302
|
+
return /* @__PURE__ */ $.jsxs("div", { className: je(re.imageCommonPanelGrid, re.imageCommonPanelBorder), style: { display: I(a) }, children: [
|
|
2303
|
+
/* @__PURE__ */ $.jsx("div", { className: re.imageCommonPanelRow, children: /* @__PURE__ */ $.jsx("div", { className: je(re.imageCommonPanelColumn, re.imageCommonPanelTitle), children: /* @__PURE__ */ $.jsx("div", { children: n.t("drawing-anchor.title") }) }) }),
|
|
2304
|
+
/* @__PURE__ */ $.jsx("div", { className: je(re.imageCommonPanelRow), children: /* @__PURE__ */ $.jsx("div", { className: je(re.imageCommonPanelColumn), children: /* @__PURE__ */ $.jsxs(gi, { value: m, onChange: v, direction: "vertical", children: [
|
|
2305
|
+
/* @__PURE__ */ $.jsx(ot, { value: y.Both, children: n.t("drawing-anchor.both") }),
|
|
2306
|
+
/* @__PURE__ */ $.jsx(ot, { value: y.Position, children: n.t("drawing-anchor.position") }),
|
|
2307
|
+
/* @__PURE__ */ $.jsx(ot, { value: y.None, children: n.t("drawing-anchor.none") })
|
|
2311
2308
|
] }) }) })
|
|
2312
2309
|
] });
|
|
2313
|
-
},
|
|
2314
|
-
const i = de(
|
|
2315
|
-
return
|
|
2310
|
+
}, Os = () => {
|
|
2311
|
+
const i = de(Q), e = i.getFocusDrawings(), [n, t] = mt(e);
|
|
2312
|
+
return vt(() => {
|
|
2316
2313
|
const r = i.focus$.subscribe((s) => {
|
|
2317
2314
|
t(s);
|
|
2318
2315
|
});
|
|
2319
2316
|
return () => {
|
|
2320
2317
|
r.unsubscribe();
|
|
2321
2318
|
};
|
|
2322
|
-
}, []), !!(n != null && n.length) && /* @__PURE__ */ $.jsxs("div", { className:
|
|
2323
|
-
/* @__PURE__ */ $.jsx(
|
|
2324
|
-
/* @__PURE__ */ $.jsx(
|
|
2319
|
+
}, []), !!(n != null && n.length) && /* @__PURE__ */ $.jsxs("div", { className: re.imageCommonPanel, children: [
|
|
2320
|
+
/* @__PURE__ */ $.jsx(Sr, { drawings: n }),
|
|
2321
|
+
/* @__PURE__ */ $.jsx(ys, { drawings: n })
|
|
2325
2322
|
] });
|
|
2326
|
-
},
|
|
2327
|
-
[
|
|
2323
|
+
}, Es = {
|
|
2324
|
+
[Fr.FORMULAS_INSERT]: {
|
|
2328
2325
|
[Tn]: {
|
|
2329
2326
|
order: 3,
|
|
2330
|
-
menuItemFactory:
|
|
2331
|
-
[
|
|
2327
|
+
menuItemFactory: ds,
|
|
2328
|
+
[St.id]: {
|
|
2332
2329
|
order: 0,
|
|
2333
|
-
menuItemFactory:
|
|
2330
|
+
menuItemFactory: ls
|
|
2334
2331
|
},
|
|
2335
|
-
[
|
|
2332
|
+
[It.id]: {
|
|
2336
2333
|
order: 1,
|
|
2337
|
-
menuItemFactory:
|
|
2334
|
+
menuItemFactory: us
|
|
2338
2335
|
}
|
|
2339
2336
|
}
|
|
2340
2337
|
}
|
|
2341
2338
|
};
|
|
2342
2339
|
function Re(i) {
|
|
2343
|
-
return !i.getContextValue(
|
|
2340
|
+
return !i.getContextValue(er) && !i.getContextValue(tr) && !i.getContextValue(nr) && i.getContextValue(he);
|
|
2344
2341
|
}
|
|
2345
2342
|
const Ts = {
|
|
2346
2343
|
id: Ce.id,
|
|
@@ -2350,9 +2347,9 @@ const Ts = {
|
|
|
2350
2347
|
priority: 100,
|
|
2351
2348
|
preconditions: Re,
|
|
2352
2349
|
staticParameters: {
|
|
2353
|
-
direction:
|
|
2350
|
+
direction: ie.DOWN
|
|
2354
2351
|
}
|
|
2355
|
-
},
|
|
2352
|
+
}, Ps = {
|
|
2356
2353
|
id: Ce.id,
|
|
2357
2354
|
description: "shortcut.sheet.drawing-move-up",
|
|
2358
2355
|
group: "4_sheet-drawing-view",
|
|
@@ -2360,9 +2357,9 @@ const Ts = {
|
|
|
2360
2357
|
priority: 100,
|
|
2361
2358
|
preconditions: Re,
|
|
2362
2359
|
staticParameters: {
|
|
2363
|
-
direction:
|
|
2360
|
+
direction: ie.UP
|
|
2364
2361
|
}
|
|
2365
|
-
},
|
|
2362
|
+
}, Us = {
|
|
2366
2363
|
id: Ce.id,
|
|
2367
2364
|
description: "shortcut.sheet.drawing-move-left",
|
|
2368
2365
|
group: "4_sheet-drawing-view",
|
|
@@ -2370,9 +2367,9 @@ const Ts = {
|
|
|
2370
2367
|
priority: 100,
|
|
2371
2368
|
preconditions: Re,
|
|
2372
2369
|
staticParameters: {
|
|
2373
|
-
direction:
|
|
2370
|
+
direction: ie.LEFT
|
|
2374
2371
|
}
|
|
2375
|
-
},
|
|
2372
|
+
}, As = {
|
|
2376
2373
|
id: Ce.id,
|
|
2377
2374
|
description: "shortcut.sheet.drawing-move-right",
|
|
2378
2375
|
group: "4_sheet-drawing-view",
|
|
@@ -2380,10 +2377,10 @@ const Ts = {
|
|
|
2380
2377
|
priority: 100,
|
|
2381
2378
|
preconditions: Re,
|
|
2382
2379
|
staticParameters: {
|
|
2383
|
-
direction:
|
|
2380
|
+
direction: ie.RIGHT
|
|
2384
2381
|
}
|
|
2385
|
-
},
|
|
2386
|
-
id:
|
|
2382
|
+
}, Ns = {
|
|
2383
|
+
id: On.id,
|
|
2387
2384
|
description: "shortcut.sheet.drawing-delete",
|
|
2388
2385
|
group: "4_sheet-drawing-view",
|
|
2389
2386
|
// when focusing on any other input tag do not trigger this shortcut
|
|
@@ -2391,47 +2388,47 @@ const Ts = {
|
|
|
2391
2388
|
binding: ge.DELETE,
|
|
2392
2389
|
mac: ge.BACKSPACE
|
|
2393
2390
|
};
|
|
2394
|
-
var
|
|
2395
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2391
|
+
var js = Object.defineProperty, Ws = Object.getOwnPropertyDescriptor, xs = (i, e, n, t) => {
|
|
2392
|
+
for (var r = t > 1 ? void 0 : t ? Ws(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2396
2393
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2397
|
-
return t && r &&
|
|
2394
|
+
return t && r && js(e, n, r), r;
|
|
2398
2395
|
}, We = (i, e) => (n, t) => e(n, t, i);
|
|
2399
|
-
let Ye = class extends
|
|
2396
|
+
let Ye = class extends q {
|
|
2400
2397
|
constructor(i, e, n, t) {
|
|
2401
2398
|
super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._shortcutService = t, this._init();
|
|
2402
2399
|
}
|
|
2403
2400
|
_initCustomComponents() {
|
|
2404
2401
|
const i = this._componentManager;
|
|
2405
|
-
this.disposeWithMe(i.register(
|
|
2402
|
+
this.disposeWithMe(i.register(En, yn)), this.disposeWithMe(i.register(wn, Os));
|
|
2406
2403
|
}
|
|
2407
2404
|
_initMenus() {
|
|
2408
|
-
this._menuManagerService.mergeMenu(
|
|
2405
|
+
this._menuManagerService.mergeMenu(Es);
|
|
2409
2406
|
}
|
|
2410
2407
|
_initCommands() {
|
|
2411
2408
|
[
|
|
2412
|
-
vt,
|
|
2413
2409
|
St,
|
|
2414
|
-
|
|
2415
|
-
qe,
|
|
2410
|
+
It,
|
|
2416
2411
|
Qe,
|
|
2417
|
-
|
|
2418
|
-
|
|
2412
|
+
Ze,
|
|
2413
|
+
et,
|
|
2419
2414
|
vn,
|
|
2415
|
+
W,
|
|
2420
2416
|
Sn,
|
|
2421
|
-
|
|
2417
|
+
In,
|
|
2418
|
+
Rn,
|
|
2422
2419
|
Ce,
|
|
2423
|
-
|
|
2424
|
-
|
|
2420
|
+
On,
|
|
2421
|
+
Cn
|
|
2425
2422
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
2426
2423
|
}
|
|
2427
2424
|
_initShortcuts() {
|
|
2428
2425
|
[
|
|
2429
2426
|
// sheet drawing shortcuts
|
|
2430
2427
|
Ts,
|
|
2431
|
-
Es,
|
|
2432
2428
|
Ps,
|
|
2433
2429
|
Us,
|
|
2434
|
-
As
|
|
2430
|
+
As,
|
|
2431
|
+
Ns
|
|
2435
2432
|
].forEach((i) => {
|
|
2436
2433
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2437
2434
|
});
|
|
@@ -2440,19 +2437,19 @@ let Ye = class extends Z {
|
|
|
2440
2437
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
2441
2438
|
}
|
|
2442
2439
|
};
|
|
2443
|
-
Ye =
|
|
2444
|
-
We(0, U(
|
|
2445
|
-
We(1,
|
|
2446
|
-
We(2,
|
|
2447
|
-
We(3,
|
|
2440
|
+
Ye = xs([
|
|
2441
|
+
We(0, U(Vr)),
|
|
2442
|
+
We(1, kr),
|
|
2443
|
+
We(2, B),
|
|
2444
|
+
We(3, Hr)
|
|
2448
2445
|
], Ye);
|
|
2449
|
-
var
|
|
2450
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2446
|
+
var $s = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, Ls = (i, e, n, t) => {
|
|
2447
|
+
for (var r = t > 1 ? void 0 : t ? Bs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2451
2448
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2452
|
-
return t && r &&
|
|
2449
|
+
return t && r && $s(e, n, r), r;
|
|
2453
2450
|
}, ce = (i, e) => (n, t) => e(n, t, i);
|
|
2454
|
-
function
|
|
2455
|
-
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(
|
|
2451
|
+
function Gs(i, e, n, t) {
|
|
2452
|
+
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(Ht.VIEW_MAIN), d = {
|
|
2456
2453
|
left: !0,
|
|
2457
2454
|
top: !0
|
|
2458
2455
|
};
|
|
@@ -2461,37 +2458,37 @@ function Ls(i, e, n, t) {
|
|
|
2461
2458
|
...i,
|
|
2462
2459
|
absolute: d
|
|
2463
2460
|
};
|
|
2464
|
-
const { left: l, right: g, top: c, bottom: a } = i, h = t.getFreeze(), { startColumn: u, startRow: m, xSplit: f, ySplit: p } = h, v = n.getNoMergeCellPositionByIndexWithNoHeader(m - p, u - f), I = n.getNoMergeCellPositionByIndexWithNoHeader(m, u), { rowHeaderWidth: S, columnHeaderHeight: R } = n,
|
|
2465
|
-
let A,
|
|
2466
|
-
l <
|
|
2461
|
+
const { left: l, right: g, top: c, bottom: a } = i, h = t.getFreeze(), { startColumn: u, startRow: m, xSplit: f, ySplit: p } = h, v = n.getNoMergeCellPositionByIndexWithNoHeader(m - p, u - f), I = n.getNoMergeCellPositionByIndexWithNoHeader(m, u), { rowHeaderWidth: S, columnHeaderHeight: R } = n, w = I.startX - v.startX, C = I.startY - v.startY, { top: _, left: T, viewportScrollX: D, viewportScrollY: N } = o;
|
|
2462
|
+
let A, b;
|
|
2463
|
+
l < T ? (d.left = !0, A = (w + S + (l - T)) * r, b = Math.max(
|
|
2467
2464
|
Math.min(
|
|
2468
|
-
(
|
|
2469
|
-
(
|
|
2465
|
+
(w + S + (g - T)) * r,
|
|
2466
|
+
(w + S) * r
|
|
2470
2467
|
),
|
|
2471
|
-
(g -
|
|
2472
|
-
)) : (d.left = !1, A = Math.max((l -
|
|
2468
|
+
(g - D) * r
|
|
2469
|
+
)) : (d.left = !1, A = Math.max((l - D) * r, (w + S) * r), b = Math.max((g - D) * r, (w + S) * r));
|
|
2473
2470
|
let M, P;
|
|
2474
|
-
return c <
|
|
2471
|
+
return c < _ ? (d.top = !0, M = (C + R + (c - _)) * s, P = Math.max(
|
|
2475
2472
|
Math.min(
|
|
2476
|
-
(C + R + (g -
|
|
2473
|
+
(C + R + (g - _)) * s,
|
|
2477
2474
|
(C + R) * s
|
|
2478
2475
|
),
|
|
2479
2476
|
(a - N) * s
|
|
2480
2477
|
)) : (d.top = !1, M = Math.max((c - N) * s, (C + R) * s), P = Math.max((a - N) * s, (C + R) * s)), {
|
|
2481
2478
|
left: A,
|
|
2482
|
-
right:
|
|
2479
|
+
right: b,
|
|
2483
2480
|
top: M,
|
|
2484
2481
|
bottom: P,
|
|
2485
2482
|
absolute: d
|
|
2486
2483
|
};
|
|
2487
2484
|
}
|
|
2488
|
-
const
|
|
2485
|
+
const dt = (i, e, n, t) => {
|
|
2489
2486
|
const { scene: r } = e, { left: s, top: o, width: d, height: l, angle: g } = i, c = {
|
|
2490
2487
|
left: s,
|
|
2491
2488
|
right: s + d,
|
|
2492
2489
|
top: o,
|
|
2493
2490
|
bottom: o + l
|
|
2494
|
-
}, a =
|
|
2491
|
+
}, a = Gs(c, r, n, t), { scaleX: h, scaleY: u } = r.getAncestorScale();
|
|
2495
2492
|
return {
|
|
2496
2493
|
startX: a.left,
|
|
2497
2494
|
endX: a.right,
|
|
@@ -2503,22 +2500,22 @@ const ct = (i, e, n, t) => {
|
|
|
2503
2500
|
absolute: a.absolute
|
|
2504
2501
|
};
|
|
2505
2502
|
};
|
|
2506
|
-
let Xe = class extends
|
|
2503
|
+
let Xe = class extends q {
|
|
2507
2504
|
constructor(e, n, t, r, s, o, d) {
|
|
2508
2505
|
super();
|
|
2509
2506
|
V(this, "_domLayerMap", /* @__PURE__ */ new Map());
|
|
2510
2507
|
V(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
2511
|
-
V(this, "_transformChange$", new
|
|
2508
|
+
V(this, "_transformChange$", new it());
|
|
2512
2509
|
V(this, "transformChange$", this._transformChange$.asObservable());
|
|
2513
|
-
V(this, "_add$", new
|
|
2510
|
+
V(this, "_add$", new it());
|
|
2514
2511
|
V(this, "add$", this._add$.asObservable());
|
|
2515
|
-
V(this, "_remove$", new
|
|
2512
|
+
V(this, "_remove$", new it());
|
|
2516
2513
|
V(this, "remove$", this._remove$.asObservable());
|
|
2517
2514
|
V(this, "_hooks", []);
|
|
2518
2515
|
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();
|
|
2519
2516
|
}
|
|
2520
2517
|
_bindScrollEvent() {
|
|
2521
|
-
this._lifecycleService.lifecycle$.pipe(
|
|
2518
|
+
this._lifecycleService.lifecycle$.pipe(se((e) => e === ir.Rendered), Xr(1)).subscribe(() => {
|
|
2522
2519
|
this._scrollUpdateListener();
|
|
2523
2520
|
});
|
|
2524
2521
|
}
|
|
@@ -2552,14 +2549,14 @@ let Xe = class extends Z {
|
|
|
2552
2549
|
// eslint-disable-next-line max-lines-per-function
|
|
2553
2550
|
this._drawingManagerService.add$.subscribe((e) => {
|
|
2554
2551
|
e.forEach((n) => {
|
|
2555
|
-
var
|
|
2556
|
-
const { unitId: t, subUnitId: r, drawingId: s } = n, o = H(this._univerInstanceService, { unitId: t, subUnitId: r }), d = this._drawingManagerService.getDrawingByParam(n), l = this._univerInstanceService.getUnit(t,
|
|
2552
|
+
var Rt, Mt, bt;
|
|
2553
|
+
const { unitId: t, subUnitId: r, drawingId: s } = n, o = H(this._univerInstanceService, { unitId: t, subUnitId: r }), d = this._drawingManagerService.getDrawingByParam(n), l = this._univerInstanceService.getUnit(t, F.UNIVER_SHEET);
|
|
2557
2554
|
if (!l)
|
|
2558
2555
|
return;
|
|
2559
2556
|
const g = l.getActiveSheet().getSheetId();
|
|
2560
2557
|
if (!d || !o)
|
|
2561
2558
|
return;
|
|
2562
|
-
const c = (
|
|
2559
|
+
const c = (Rt = this._renderManagerService.getRenderById(t)) == null ? void 0 : Rt.with(Z).getWorksheetSkeleton(r);
|
|
2563
2560
|
if (!c)
|
|
2564
2561
|
return;
|
|
2565
2562
|
const { transform: a, drawingType: h, data: u } = d;
|
|
@@ -2573,12 +2570,12 @@ let Xe = class extends Z {
|
|
|
2573
2570
|
return !0;
|
|
2574
2571
|
if (g !== r)
|
|
2575
2572
|
return;
|
|
2576
|
-
const { left: v, top: I, width: S, height: R, angle:
|
|
2573
|
+
const { left: v, top: I, width: S, height: R, angle: w, flipX: C, flipY: _, skewX: T, skewY: D } = a, N = rt({ unitId: t, subUnitId: r, drawingId: s }), A = f.getObject(N);
|
|
2577
2574
|
if (A != null) {
|
|
2578
|
-
A.transformByState({ left: v, top: I, width: S, height: R, angle:
|
|
2575
|
+
A.transformByState({ left: v, top: I, width: S, height: R, angle: w, flipX: C, flipY: _, skewX: T, skewY: D });
|
|
2579
2576
|
return;
|
|
2580
2577
|
}
|
|
2581
|
-
const
|
|
2578
|
+
const b = {
|
|
2582
2579
|
left: v,
|
|
2583
2580
|
top: I,
|
|
2584
2581
|
width: S,
|
|
@@ -2586,47 +2583,47 @@ let Xe = class extends Z {
|
|
|
2586
2583
|
zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
|
|
2587
2584
|
}, M = h === k.DRAWING_CHART;
|
|
2588
2585
|
if (M) {
|
|
2589
|
-
const
|
|
2590
|
-
|
|
2586
|
+
const G = u ? u.backgroundColor : "white";
|
|
2587
|
+
b.fill = G, b.rotateEnabled = !1, u && u.border && (b.stroke = u.border), b.paintFirst = "stroke", b.strokeWidth = 1, b.borderEnabled = !1, b.radius = 8;
|
|
2591
2588
|
}
|
|
2592
|
-
const P = new
|
|
2593
|
-
M && P.setObjectType(
|
|
2594
|
-
const x = this._ensureMap(t, r), ee = new
|
|
2589
|
+
const P = new Ut(N, b);
|
|
2590
|
+
M && P.setObjectType(Mr.CHART), f.addObject(P, br), d.allowTransform !== !1 && f.attachTransformerTo(P);
|
|
2591
|
+
const x = this._ensureMap(t, r), ee = new sr(), Nn = dt(P, m.renderObject, c.skeleton, o.worksheet), tt = new zr(Nn), jn = {
|
|
2595
2592
|
dispose: ee,
|
|
2596
2593
|
rect: P,
|
|
2597
|
-
position$:
|
|
2594
|
+
position$: tt,
|
|
2598
2595
|
unitId: t,
|
|
2599
2596
|
subUnitId: r
|
|
2600
2597
|
};
|
|
2601
2598
|
this._canvasFloatDomService.addFloatDom({
|
|
2602
|
-
position$:
|
|
2599
|
+
position$: tt,
|
|
2603
2600
|
id: s,
|
|
2604
2601
|
componentKey: d.componentKey,
|
|
2605
|
-
onPointerDown: (
|
|
2606
|
-
p.dispatchEvent(new PointerEvent(
|
|
2602
|
+
onPointerDown: (G) => {
|
|
2603
|
+
p.dispatchEvent(new PointerEvent(G.type, G));
|
|
2607
2604
|
},
|
|
2608
|
-
onPointerMove: (
|
|
2609
|
-
p.dispatchEvent(new PointerEvent(
|
|
2605
|
+
onPointerMove: (G) => {
|
|
2606
|
+
p.dispatchEvent(new PointerEvent(G.type, G));
|
|
2610
2607
|
},
|
|
2611
|
-
onPointerUp: (
|
|
2612
|
-
p.dispatchEvent(new PointerEvent(
|
|
2608
|
+
onPointerUp: (G) => {
|
|
2609
|
+
p.dispatchEvent(new PointerEvent(G.type, G));
|
|
2613
2610
|
},
|
|
2614
|
-
onWheel: (
|
|
2615
|
-
p.dispatchEvent(new WheelEvent(
|
|
2611
|
+
onWheel: (G) => {
|
|
2612
|
+
p.dispatchEvent(new WheelEvent(G.type, G));
|
|
2616
2613
|
},
|
|
2617
|
-
props: (
|
|
2614
|
+
props: (bt = (Mt = x.get(s)) == null ? void 0 : Mt.props) != null ? bt : this._getFloatDomProps(s),
|
|
2618
2615
|
data: u,
|
|
2619
2616
|
unitId: t
|
|
2620
2617
|
});
|
|
2621
|
-
const
|
|
2622
|
-
const
|
|
2623
|
-
|
|
2624
|
-
|
|
2618
|
+
const Ct = P.onTransformChange$.subscribeEvent(() => {
|
|
2619
|
+
const G = dt(P, m.renderObject, c.skeleton, o.worksheet);
|
|
2620
|
+
tt.next(
|
|
2621
|
+
G
|
|
2625
2622
|
);
|
|
2626
2623
|
});
|
|
2627
2624
|
ee.add(() => {
|
|
2628
2625
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
2629
|
-
}),
|
|
2626
|
+
}), Ct && ee.add(Ct), this._domLayerInfoMap.set(s, jn), x.set(s, {
|
|
2630
2627
|
...x.get(s)
|
|
2631
2628
|
});
|
|
2632
2629
|
});
|
|
@@ -2634,7 +2631,7 @@ let Xe = class extends Z {
|
|
|
2634
2631
|
), this.disposeWithMe(
|
|
2635
2632
|
this._drawingManagerService.remove$.subscribe((e) => {
|
|
2636
2633
|
e.forEach((n) => {
|
|
2637
|
-
const { unitId: t, subUnitId: r, drawingId: s } = n, o =
|
|
2634
|
+
const { unitId: t, subUnitId: r, drawingId: s } = n, o = rt({ unitId: t, subUnitId: r, drawingId: s }), d = this._getSceneAndTransformerByDrawingSearch(t);
|
|
2638
2635
|
if (d == null)
|
|
2639
2636
|
return;
|
|
2640
2637
|
const { transformer: l, scene: g } = d, c = g.getObject(o);
|
|
@@ -2646,39 +2643,39 @@ let Xe = class extends Z {
|
|
|
2646
2643
|
_scrollUpdateListener() {
|
|
2647
2644
|
const e = (n, t) => {
|
|
2648
2645
|
var g;
|
|
2649
|
-
const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), d = H(this._univerInstanceService, { unitId: n, subUnitId: t }), l = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(
|
|
2646
|
+
const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), d = H(this._univerInstanceService, { unitId: n, subUnitId: t }), l = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(Z).getWorksheetSkeleton(t);
|
|
2650
2647
|
!r || !d || !l || o.forEach((c) => {
|
|
2651
2648
|
const a = this._domLayerInfoMap.get(c);
|
|
2652
2649
|
if (a) {
|
|
2653
|
-
const h =
|
|
2650
|
+
const h = dt(a.rect, r.renderObject, l.skeleton, d.worksheet);
|
|
2654
2651
|
a.position$.next(h);
|
|
2655
2652
|
}
|
|
2656
2653
|
});
|
|
2657
2654
|
};
|
|
2658
2655
|
this.disposeWithMe(
|
|
2659
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2656
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
|
|
2657
|
+
se((n) => !!n),
|
|
2658
|
+
jt((n) => n.activeSheet$),
|
|
2659
|
+
se((n) => !!n),
|
|
2663
2660
|
$e((n) => {
|
|
2664
2661
|
const t = this._renderManagerService.getRenderById(n.getUnitId());
|
|
2665
2662
|
return t ? { render: t, unitId: n.getUnitId(), subUnitId: n.getSheetId() } : null;
|
|
2666
2663
|
}),
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
(n) =>
|
|
2664
|
+
se((n) => !!n),
|
|
2665
|
+
jt(
|
|
2666
|
+
(n) => or(n.render.scene.getViewport(Ht.VIEW_MAIN).onScrollAfter$).pipe($e(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
|
|
2670
2667
|
)
|
|
2671
2668
|
).subscribe(({ unitId: n, subUnitId: t }) => {
|
|
2672
2669
|
e(n, t);
|
|
2673
2670
|
})
|
|
2674
2671
|
), this.disposeWithMe(this._commandService.onCommandExecuted((n) => {
|
|
2675
2672
|
var t, r;
|
|
2676
|
-
if (n.id ===
|
|
2673
|
+
if (n.id === Wr.id) {
|
|
2677
2674
|
const s = n.params, { unitId: o } = s;
|
|
2678
2675
|
Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((l) => {
|
|
2679
2676
|
e(o, l);
|
|
2680
2677
|
});
|
|
2681
|
-
} else if (n.id ===
|
|
2678
|
+
} else if (n.id === di.id) {
|
|
2682
2679
|
const { unitId: s, subUnitId: o } = n.params;
|
|
2683
2680
|
e(s, o);
|
|
2684
2681
|
}
|
|
@@ -2738,8 +2735,8 @@ let Xe = class extends Z {
|
|
|
2738
2735
|
updateFloatDomProps(e, n, t, r) {
|
|
2739
2736
|
const s = this._domLayerInfoMap.get(t), o = this._getSceneAndTransformerByDrawingSearch(e);
|
|
2740
2737
|
if (s && o) {
|
|
2741
|
-
const { scene: d } = o, l =
|
|
2742
|
-
g && g instanceof
|
|
2738
|
+
const { scene: d } = o, l = rt({ unitId: e, subUnitId: n, drawingId: t }), g = d.getObject(l);
|
|
2739
|
+
g && g instanceof Ut && g.setProps(r);
|
|
2743
2740
|
}
|
|
2744
2741
|
}
|
|
2745
2742
|
addFloatDomToPosition(e, n) {
|
|
@@ -2749,7 +2746,7 @@ let Xe = class extends Z {
|
|
|
2749
2746
|
});
|
|
2750
2747
|
if (!t)
|
|
2751
2748
|
throw new Error("cannot find current target!");
|
|
2752
|
-
const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: d, data: l, allowTransform: g = !0 } = e, c = n != null ? n :
|
|
2749
|
+
const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: d, data: l, allowTransform: g = !0 } = e, c = n != null ? n : ar(), a = this._getPosition(o, r);
|
|
2753
2750
|
if (a == null)
|
|
2754
2751
|
return;
|
|
2755
2752
|
this._ensureMap(r, s).set(c, e);
|
|
@@ -2769,7 +2766,7 @@ let Xe = class extends Z {
|
|
|
2769
2766
|
data: l,
|
|
2770
2767
|
allowTransform: g
|
|
2771
2768
|
};
|
|
2772
|
-
return this._commandService.executeCommand(
|
|
2769
|
+
return this._commandService.executeCommand(Qe.id, {
|
|
2773
2770
|
unitId: r,
|
|
2774
2771
|
drawings: [u]
|
|
2775
2772
|
}), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
|
|
@@ -2792,7 +2789,7 @@ let Xe = class extends Z {
|
|
|
2792
2789
|
if (!l)
|
|
2793
2790
|
return;
|
|
2794
2791
|
const g = this._sheetDrawingService.getBatchRemoveOp([l]), { redo: c, objects: a } = g;
|
|
2795
|
-
this._commandService.syncExecuteCommand(O.id, { unitId: r, subUnitId: s, op: c, objects: a, type:
|
|
2792
|
+
this._commandService.syncExecuteCommand(O.id, { unitId: r, subUnitId: s, op: c, objects: a, type: E.REMOVE });
|
|
2796
2793
|
}
|
|
2797
2794
|
}
|
|
2798
2795
|
addHook(e) {
|
|
@@ -2804,33 +2801,33 @@ let Xe = class extends Z {
|
|
|
2804
2801
|
};
|
|
2805
2802
|
}
|
|
2806
2803
|
};
|
|
2807
|
-
Xe =
|
|
2804
|
+
Xe = Ls([
|
|
2808
2805
|
ce(0, U(X)),
|
|
2809
2806
|
ce(1, fe),
|
|
2810
|
-
ce(2, U(
|
|
2811
|
-
ce(3,
|
|
2812
|
-
ce(4, U(
|
|
2807
|
+
ce(2, U(B)),
|
|
2808
|
+
ce(3, Q),
|
|
2809
|
+
ce(4, U(Yr)),
|
|
2813
2810
|
ce(5, z),
|
|
2814
|
-
ce(6, U(
|
|
2811
|
+
ce(6, U(rr))
|
|
2815
2812
|
], Xe);
|
|
2816
|
-
var
|
|
2817
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2813
|
+
var Un = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, Vs = (i, e, n) => e in i ? Un(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, ks = (i, e, n, t) => {
|
|
2814
|
+
for (var r = t > 1 ? void 0 : t ? Fs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2818
2815
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2819
|
-
return t && r &&
|
|
2820
|
-
},
|
|
2821
|
-
const
|
|
2822
|
-
let ze = class extends
|
|
2823
|
-
constructor(i =
|
|
2816
|
+
return t && r && Un(e, n, r), r;
|
|
2817
|
+
}, lt = (i, e) => (n, t) => e(n, t, i), An = (i, e, n) => Vs(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2818
|
+
const Hs = "SHEET_IMAGE_UI_PLUGIN";
|
|
2819
|
+
let ze = class extends dr {
|
|
2820
|
+
constructor(i = xt, e, n, t) {
|
|
2824
2821
|
super(), this._config = i, this._injector = e, this._renderManagerService = n, this._configService = t;
|
|
2825
|
-
const { menu: r, ...s } =
|
|
2822
|
+
const { menu: r, ...s } = lr(
|
|
2826
2823
|
{},
|
|
2827
|
-
|
|
2824
|
+
xt,
|
|
2828
2825
|
this._config
|
|
2829
2826
|
);
|
|
2830
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
2827
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(mi, s);
|
|
2831
2828
|
}
|
|
2832
2829
|
onStarting() {
|
|
2833
|
-
|
|
2830
|
+
ur(this._injector, [
|
|
2834
2831
|
[Xe],
|
|
2835
2832
|
[Ye],
|
|
2836
2833
|
[Be],
|
|
@@ -2840,17 +2837,17 @@ let ze = class extends cr {
|
|
|
2840
2837
|
[Le],
|
|
2841
2838
|
[Fe],
|
|
2842
2839
|
[Ge]
|
|
2843
|
-
]),
|
|
2840
|
+
]), nt(this._injector, [
|
|
2844
2841
|
[Xe]
|
|
2845
2842
|
]);
|
|
2846
2843
|
}
|
|
2847
2844
|
onReady() {
|
|
2848
|
-
|
|
2845
|
+
nt(this._injector, [
|
|
2849
2846
|
[Ve]
|
|
2850
2847
|
]);
|
|
2851
2848
|
}
|
|
2852
2849
|
onRendered() {
|
|
2853
|
-
this._registerRenderModules(),
|
|
2850
|
+
this._registerRenderModules(), nt(this._injector, [
|
|
2854
2851
|
[ke],
|
|
2855
2852
|
[He],
|
|
2856
2853
|
[Ye],
|
|
@@ -2865,35 +2862,35 @@ let ze = class extends cr {
|
|
|
2865
2862
|
_registerRenderModules() {
|
|
2866
2863
|
[
|
|
2867
2864
|
[ve],
|
|
2868
|
-
[
|
|
2869
|
-
[
|
|
2865
|
+
[_t],
|
|
2866
|
+
[ft]
|
|
2870
2867
|
].forEach((i) => {
|
|
2871
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
2868
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(F.UNIVER_SHEET, i));
|
|
2872
2869
|
});
|
|
2873
2870
|
}
|
|
2874
2871
|
};
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
ze =
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2872
|
+
An(ze, "type", F.UNIVER_SHEET);
|
|
2873
|
+
An(ze, "pluginName", Hs);
|
|
2874
|
+
ze = ks([
|
|
2875
|
+
cr(fr, mr, Ir, Dr),
|
|
2876
|
+
lt(1, U(Se)),
|
|
2877
|
+
lt(2, X),
|
|
2878
|
+
lt(3, hr)
|
|
2882
2879
|
], ze);
|
|
2883
2880
|
export {
|
|
2884
2881
|
W as ClearSheetDrawingTransformerOperation,
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2882
|
+
On as DeleteDrawingsCommand,
|
|
2883
|
+
Sn as EditSheetDrawingOperation,
|
|
2884
|
+
In as GroupSheetDrawingCommand,
|
|
2885
|
+
St as InsertFloatImageCommand,
|
|
2886
|
+
Qe as InsertSheetDrawingCommand,
|
|
2890
2887
|
Ce as MoveDrawingsCommand,
|
|
2891
|
-
|
|
2888
|
+
Ze as RemoveSheetDrawingCommand,
|
|
2892
2889
|
Tn as SHEETS_IMAGE_MENU_ID,
|
|
2893
|
-
|
|
2894
|
-
|
|
2890
|
+
Cn as SetDrawingArrangeCommand,
|
|
2891
|
+
et as SetSheetDrawingCommand,
|
|
2895
2892
|
Xe as SheetCanvasFloatDomManagerService,
|
|
2896
|
-
|
|
2897
|
-
|
|
2893
|
+
vn as SidebarSheetDrawingOperation,
|
|
2894
|
+
Rn as UngroupSheetDrawingCommand,
|
|
2898
2895
|
ze as UniverSheetsDrawingUIPlugin
|
|
2899
2896
|
};
|