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