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