@univerjs/sheets-drawing-ui 0.8.0-beta.0 → 0.8.0-nightly.202505261607
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +918 -972
- package/lib/index.js +918 -972
- package/lib/types/views/menu/image.menu.d.ts +0 -1
- package/lib/umd/index.js +2 -2
- package/package.json +12 -13
- package/LICENSE +0 -176
package/lib/index.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var ee = (i, t, e) =>
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { DocDrawingController as
|
|
6
|
-
import { SetDrawingSelectedOperation as
|
|
7
|
-
import { ImageCropperObject as
|
|
8
|
-
import { IRenderManagerService as
|
|
9
|
-
import { ISheetDrawingService as
|
|
10
|
-
import { MessageType as
|
|
11
|
-
import { SheetCanvasPopManagerService as
|
|
12
|
-
import { ISidebarService as
|
|
13
|
-
import { takeUntil as
|
|
14
|
-
import { SheetInterceptorService as
|
|
15
|
-
import { docDrawingPositionToTransform as Bn, ReplaceSnapshotCommand as
|
|
16
|
-
import { jsx as
|
|
17
|
-
import { useMemo as
|
|
18
|
-
const
|
|
1
|
+
var yr = Object.defineProperty;
|
|
2
|
+
var Er = (i, t, e) => t in i ? yr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var ee = (i, t, e) => Er(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { CommandType as J, ICommandService as G, IUndoRedoService as xe, sequenceExecute as xn, LocaleService as tt, IUniverInstanceService as Se, Inject as A, Injector as Ye, IContextService as Yn, IImageIoService as Tr, RxDisposable as Or, UniverInstanceType as F, FOCUSING_COMMON_DRAWINGS as $e, DrawingTypeEnum as B, Disposable as ne, ArrangeTypeEnum as mt, createDocumentModelWithStyle as Vt, ObjectRelativeFromV as mn, ObjectRelativeFromH as pn, WrapTextType as wn, PositionedObjectLayoutType as _n, BooleanNumber as Sn, BuildTextUtils as Ht, ImageSourceType as vn, generateRandomId as Dt, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ze, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Be, InterceptorEffectEnum as Ur, ObjectMatrix as Pr, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Ar, Tools as Re, IPermissionService as Nr, UserManagerService as kr, LifecycleService as Wr, LifecycleStages as Br, DisposableCollection as pt, fromEventSubject as jr, PRINT_CHART_COMPONENT_KEY as $r, Rectangle as Fr, Direction as _e, FOCUSING_FX_BAR_EDITOR as xr, EDITOR_ACTIVATED as Yr, FOCUSING_PANEL_EDITOR as Xr, DependentOn as Gr, IConfigService as Lr, Plugin as Vr, merge as Hr, registerDependencies as zr, touchDependencies as Ft } from "@univerjs/core";
|
|
5
|
+
import { DocDrawingController as Kr, UniverDocsDrawingPlugin as Jr } from "@univerjs/docs-drawing";
|
|
6
|
+
import { SetDrawingSelectedOperation as At, IDrawingManagerService as re, IImageIoService as Zr, DRAWING_IMAGE_ALLOW_IMAGE_LIST as In, DRAWING_IMAGE_COUNT_LIMIT as Cn, ImageUploadStatusType as Ue, DRAWING_IMAGE_ALLOW_SIZE as Dn, getImageSize as xt, DRAWING_IMAGE_WIDTH_LIMIT as Rn, DRAWING_IMAGE_HEIGHT_LIMIT as bn, ImageSourceType as qr, getDrawingShapeKeyByDrawingSearch as ve, UniverDrawingPlugin as Qr } from "@univerjs/drawing";
|
|
7
|
+
import { ImageCropperObject as ei, COMPONENT_IMAGE_POPUP_MENU as ti, OpenImageCropOperation as ni, ImageResetSizeOperation as ri, DrawingRenderService as Xn, DrawingCommonPanel as ii, UniverDrawingUIPlugin as si } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as Z, CURSOR_TYPE as oi, precisionTo as wt, transformObjectOutOfGroup as ai, getGroupState as ci, getCurrentTypeOfRenderer as sn, RENDER_CLASS_TYPE as Pe, Rect as Ae, ObjectType as Mn, DRAWING_OBJECT_LAYER_INDEX as Yt, SHEET_VIEWPORT_KEY as Gn } from "@univerjs/engine-render";
|
|
9
|
+
import { ISheetDrawingService as ie, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as di } from "@univerjs/sheets-drawing";
|
|
10
|
+
import { MessageType as pe, render as li, unmount as ui, clsx as hi, RadioGroup as gi, Radio as Xt } from "@univerjs/design";
|
|
11
|
+
import { SheetCanvasPopManagerService as fi, HoverManagerService as mi, SheetSkeletonManagerService as V, convertPositionSheetOverGridToAbsolute as pi, ISheetSelectionRenderService as Xe, attachRangeWithCoord as Ln, IEditorBridgeService as wi, IAutoFillService as _i, EditingRenderController as Si, SetCellEditVisibleOperation as yn, PREDEFINED_HOOK_NAME as je, COPY_TYPE as Ie, discreteRangeToRange as En, virtualizeDiscreteRanges as vi, ISheetClipboardService as Ii, SetZoomRatioOperation as Tn, SetScrollOperation as Ci, SheetPrintInterceptorService as Di, getCurrentRangeDisable$ as Ri } from "@univerjs/sheets-ui";
|
|
12
|
+
import { ISidebarService as bi, IMessageService as Vn, ILocalFileService as Mi, IDialogService as yi, IClipboardInterfaceService as Ei, CanvasFloatDomService as Ti, PrintFloatDomSingle as Oi, ComponentManager as Hn, connectInjector as Ui, useDependency as qe, getMenuHiddenObservable as on, MenuItemType as an, RibbonInsertGroup as Pi, KeyCode as Fe, IMenuManagerService as Ai, IShortcutService as Ni } from "@univerjs/ui";
|
|
13
|
+
import { takeUntil as On, throttleTime as ki, combineLatest as _t, switchMap as we, EMPTY as fe, tap as Un, map as be, distinctUntilChanged as Pn, Subject as Gt, filter as Wi, take as Bi, BehaviorSubject as We, of as An } from "rxjs";
|
|
14
|
+
import { SheetInterceptorService as Nt, getSheetCommandTarget as se, SheetsSelectionsService as cn, SetRangeValuesCommand as Nn, INTERCEPTOR_POINT as ji, InterceptCellContentPriority as $i, WorkbookViewPermission as kn, WorksheetViewPermission as Wn, WorkbookEditablePermission as zt, WorksheetEditPermission as Kt, SetFrozenMutation as Fi, SetWorksheetRowAutoHeightMutation as xi, COMMAND_LISTENER_SKELETON_CHANGE as Yi, InsertRowCommand as zn, InsertColCommand as Kn, RemoveRowCommand as Jn, RemoveColCommand as Zn, DeleteRangeMoveLeftCommand as qn, DeleteRangeMoveUpCommand as Qn, InsertRangeMoveDownCommand as er, InsertRangeMoveRightCommand as tr, DeltaRowHeightCommand as Jt, SetRowHeightCommand as Zt, DeltaColumnWidthCommand as nr, SetColWidthCommand as rr, SetRowHiddenCommand as ir, SetSpecificRowsVisibleCommand as sr, SetSpecificColsVisibleCommand as or, SetColHiddenCommand as ar, MoveColsCommand as cr, MoveRowsCommand as dr, MoveRangeCommand as lr, SetRowVisibleMutation as Xi, SetRowHiddenMutation as Gi, SetColVisibleMutation as Li, SetColHiddenMutation as Vi, SetWorksheetRowHeightMutation as Hi, SetWorksheetColWidthMutation as zi, SetWorksheetActiveOperation as Ki, RangeProtectionPermissionEditPoint as Ji } from "@univerjs/sheets";
|
|
15
|
+
import { docDrawingPositionToTransform as Bn, ReplaceSnapshotCommand as Zi, InnerPasteCommand as qi } from "@univerjs/docs-ui";
|
|
16
|
+
import { jsx as oe, jsxs as qt } from "react/jsx-runtime";
|
|
17
|
+
import { useMemo as Qi, useState as Qt, useEffect as ur } from "react";
|
|
18
|
+
const es = "sheets-drawing-ui.config", jn = {}, Y = {
|
|
19
19
|
id: "sheet.operation.clear-drawing-transformer",
|
|
20
|
-
type:
|
|
20
|
+
type: J.MUTATION,
|
|
21
21
|
handler: (i, t) => {
|
|
22
|
-
const e = i.get(
|
|
22
|
+
const e = i.get(Z);
|
|
23
23
|
return t.forEach((n) => {
|
|
24
24
|
var r, s;
|
|
25
25
|
(s = (r = e.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
|
|
26
26
|
}), !0;
|
|
27
27
|
}
|
|
28
|
-
},
|
|
28
|
+
}, nt = {
|
|
29
29
|
id: "sheet.command.remove-sheet-image",
|
|
30
|
-
type:
|
|
30
|
+
type: J.COMMAND,
|
|
31
31
|
handler: (i, t) => {
|
|
32
|
-
var
|
|
33
|
-
const e = i.get(G), n = i.get(
|
|
32
|
+
var v, I, R;
|
|
33
|
+
const e = i.get(G), n = i.get(xe), r = i.get(Nt), s = i.get(ie);
|
|
34
34
|
if (!t) return !1;
|
|
35
35
|
const { drawings: o } = t, a = [];
|
|
36
|
-
o.forEach((
|
|
37
|
-
const { unitId: C } =
|
|
36
|
+
o.forEach((S) => {
|
|
37
|
+
const { unitId: C } = S;
|
|
38
38
|
a.push(C);
|
|
39
39
|
});
|
|
40
|
-
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id:
|
|
41
|
-
return
|
|
40
|
+
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id: nt.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, m = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
|
|
41
|
+
return xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
|
|
42
42
|
unitID: u,
|
|
43
43
|
undoMutations: [
|
|
44
44
|
...(I = f.preUndos) != null ? I : [],
|
|
@@ -47,26 +47,26 @@ const cs = "sheets-drawing-ui.config", $n = {}, Y = {
|
|
|
47
47
|
{ id: Y.id, params: a }
|
|
48
48
|
],
|
|
49
49
|
redoMutations: [
|
|
50
|
-
...(
|
|
50
|
+
...(R = f.preRedos) != null ? R : [],
|
|
51
51
|
p,
|
|
52
52
|
...f.redos,
|
|
53
53
|
{ id: Y.id, params: a }
|
|
54
54
|
]
|
|
55
55
|
}), !0) : !1;
|
|
56
56
|
}
|
|
57
|
-
},
|
|
57
|
+
}, hr = "COMPONENT_SHEET_DRAWING_PANEL", gr = {
|
|
58
58
|
id: "sidebar.operation.sheet-image",
|
|
59
|
-
type:
|
|
59
|
+
type: J.COMMAND,
|
|
60
60
|
handler: async (i, t) => {
|
|
61
|
-
const e = i.get(
|
|
62
|
-
if (!
|
|
61
|
+
const e = i.get(bi), n = i.get(tt), r = i.get(Se), s = i.get(G);
|
|
62
|
+
if (!se(r)) return !1;
|
|
63
63
|
switch (t.value) {
|
|
64
64
|
case "open":
|
|
65
65
|
e.open({
|
|
66
66
|
header: { title: n.t("sheetImage.panel.title") },
|
|
67
|
-
children: { label:
|
|
67
|
+
children: { label: hr },
|
|
68
68
|
onClose: () => {
|
|
69
|
-
s.syncExecuteCommand(
|
|
69
|
+
s.syncExecuteCommand(At.id, []);
|
|
70
70
|
},
|
|
71
71
|
width: 360
|
|
72
72
|
});
|
|
@@ -78,27 +78,27 @@ const cs = "sheets-drawing-ui.config", $n = {}, Y = {
|
|
|
78
78
|
}
|
|
79
79
|
return !0;
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, fr = {
|
|
82
82
|
id: "sheet.operation.edit-sheet-image",
|
|
83
|
-
type:
|
|
83
|
+
type: J.OPERATION,
|
|
84
84
|
handler: (i, t) => {
|
|
85
85
|
const e = i.get(G);
|
|
86
|
-
return t == null ? !1 : (e.syncExecuteCommand(
|
|
86
|
+
return t == null ? !1 : (e.syncExecuteCommand(At.id, [t]), e.executeCommand(gr.id, { value: "open" }), !0);
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
-
var
|
|
90
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
89
|
+
var ts = Object.getOwnPropertyDescriptor, ns = (i, t, e, n) => {
|
|
90
|
+
for (var r = n > 1 ? void 0 : n ? ts(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
91
91
|
(o = i[s]) && (r = o(r) || r);
|
|
92
92
|
return r;
|
|
93
|
-
},
|
|
94
|
-
let Rt = class extends
|
|
93
|
+
}, ce = (i, t) => (e, n) => t(e, n, i);
|
|
94
|
+
let Rt = class extends Or {
|
|
95
95
|
constructor(t, e, n, r, s, o, a, d, u, c) {
|
|
96
96
|
super();
|
|
97
97
|
ee(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
98
98
|
this._injector = t, this._localeService = e, this._drawingManagerService = n, this._canvasPopManagerService = r, this._renderManagerService = s, this._univerInstanceService = o, this._messageService = a, this._contextService = d, this._ioService = u, this._commandService = c, this._init();
|
|
99
99
|
}
|
|
100
100
|
_init() {
|
|
101
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
101
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(On(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(On(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
|
|
102
102
|
}
|
|
103
103
|
_setupLoadingStatus() {
|
|
104
104
|
const t = "image-upload-loading";
|
|
@@ -106,7 +106,7 @@ let Rt = class extends jr {
|
|
|
106
106
|
this.disposeWithMe(this._ioService.change$.subscribe((n) => {
|
|
107
107
|
n > 0 && !e ? e = this._messageService.show({
|
|
108
108
|
id: t,
|
|
109
|
-
type:
|
|
109
|
+
type: pe.Loading,
|
|
110
110
|
content: `${this._localeService.t("uploadLoading.loading")}: ${n}`,
|
|
111
111
|
duration: 0
|
|
112
112
|
}) : n === 0 && (e == null || e.dispose(), e = void 0);
|
|
@@ -126,7 +126,7 @@ let Rt = class extends jr {
|
|
|
126
126
|
_hasCropObject(t) {
|
|
127
127
|
const e = t.getAllObjectsByOrder();
|
|
128
128
|
for (const n of e)
|
|
129
|
-
if (n instanceof
|
|
129
|
+
if (n instanceof ei)
|
|
130
130
|
return !0;
|
|
131
131
|
return !1;
|
|
132
132
|
}
|
|
@@ -141,7 +141,7 @@ let Rt = class extends jr {
|
|
|
141
141
|
let r;
|
|
142
142
|
this.disposeWithMe(
|
|
143
143
|
n.createControl$.subscribe(() => {
|
|
144
|
-
if (this._contextService.setContextValue(
|
|
144
|
+
if (this._contextService.setContextValue($e, !0), this._hasCropObject(e))
|
|
145
145
|
return;
|
|
146
146
|
const o = n.getSelectedObjectMap();
|
|
147
147
|
if (o.size > 1) {
|
|
@@ -160,7 +160,7 @@ let Rt = class extends jr {
|
|
|
160
160
|
r == null || r.dispose();
|
|
161
161
|
const p = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
|
|
162
162
|
r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
163
|
-
componentKey:
|
|
163
|
+
componentKey: ti,
|
|
164
164
|
direction: "horizontal",
|
|
165
165
|
offset: [2, 0],
|
|
166
166
|
extraProps: {
|
|
@@ -170,11 +170,11 @@ let Rt = class extends jr {
|
|
|
170
170
|
})
|
|
171
171
|
), this.disposeWithMe(
|
|
172
172
|
n.clearControl$.subscribe(() => {
|
|
173
|
-
r == null || r.dispose(), this._contextService.setContextValue(
|
|
173
|
+
r == null || r.dispose(), this._contextService.setContextValue($e, !1), this._commandService.syncExecuteCommand(At.id, []);
|
|
174
174
|
})
|
|
175
175
|
), this.disposeWithMe(
|
|
176
176
|
this._contextService.contextChanged$.subscribe((o) => {
|
|
177
|
-
o[
|
|
177
|
+
o[$e] === !1 && (r == null || r.dispose());
|
|
178
178
|
})
|
|
179
179
|
), this.disposeWithMe(
|
|
180
180
|
n.changing$.subscribe(() => {
|
|
@@ -187,62 +187,62 @@ let Rt = class extends jr {
|
|
|
187
187
|
{
|
|
188
188
|
label: "image-popup.edit",
|
|
189
189
|
index: 0,
|
|
190
|
-
commandId:
|
|
190
|
+
commandId: fr.id,
|
|
191
191
|
commandParams: { unitId: t, subUnitId: e, drawingId: n },
|
|
192
|
-
disable: r ===
|
|
192
|
+
disable: r === B.DRAWING_DOM
|
|
193
193
|
},
|
|
194
194
|
{
|
|
195
195
|
label: "image-popup.delete",
|
|
196
196
|
index: 1,
|
|
197
|
-
commandId:
|
|
197
|
+
commandId: nt.id,
|
|
198
198
|
commandParams: { unitId: t, drawings: [{ unitId: t, subUnitId: e, drawingId: n }] },
|
|
199
199
|
disable: !1
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
label: "image-popup.crop",
|
|
203
203
|
index: 2,
|
|
204
|
-
commandId:
|
|
204
|
+
commandId: ni.id,
|
|
205
205
|
commandParams: { unitId: t, subUnitId: e, drawingId: n },
|
|
206
|
-
disable: r ===
|
|
206
|
+
disable: r === B.DRAWING_DOM
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
209
|
label: "image-popup.reset",
|
|
210
210
|
index: 3,
|
|
211
|
-
commandId:
|
|
211
|
+
commandId: ri.id,
|
|
212
212
|
commandParams: [{ unitId: t, subUnitId: e, drawingId: n }],
|
|
213
|
-
disable: r ===
|
|
213
|
+
disable: r === B.DRAWING_DOM
|
|
214
214
|
}
|
|
215
215
|
];
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
|
-
Rt =
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
218
|
+
Rt = ns([
|
|
219
|
+
ce(0, A(Ye)),
|
|
220
|
+
ce(1, A(tt)),
|
|
221
|
+
ce(2, re),
|
|
222
|
+
ce(3, A(fi)),
|
|
223
|
+
ce(4, Z),
|
|
224
|
+
ce(5, Se),
|
|
225
|
+
ce(6, Vn),
|
|
226
|
+
ce(7, Yn),
|
|
227
|
+
ce(8, Tr),
|
|
228
|
+
ce(9, G)
|
|
229
229
|
], Rt);
|
|
230
|
-
var
|
|
231
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
230
|
+
var rs = Object.getOwnPropertyDescriptor, is = (i, t, e, n) => {
|
|
231
|
+
for (var r = n > 1 ? void 0 : n ? rs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
232
232
|
(o = i[s]) && (r = o(r) || r);
|
|
233
233
|
return r;
|
|
234
234
|
}, St = (i, t) => (e, n) => t(e, n, i);
|
|
235
|
-
let
|
|
235
|
+
let en = class extends ne {
|
|
236
236
|
constructor(t, e, n, r, s) {
|
|
237
237
|
super();
|
|
238
238
|
ee(this, "_isSetCursor", !1);
|
|
239
239
|
this._context = t, this._hoverManagerService = e, this._selectionsService = n, this._drawingRenderService = r, this._sheetSkeletonManagerService = s, this._initHover(), this._initImageClick();
|
|
240
240
|
}
|
|
241
241
|
_initHover() {
|
|
242
|
-
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(
|
|
242
|
+
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(ki(33)).subscribe((t) => {
|
|
243
243
|
var n, r;
|
|
244
244
|
let e = [];
|
|
245
|
-
t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(
|
|
245
|
+
t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(oi.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
|
|
246
246
|
}));
|
|
247
247
|
}
|
|
248
248
|
_initImageClick() {
|
|
@@ -256,25 +256,25 @@ let tn = class extends re {
|
|
|
256
256
|
}));
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
|
|
260
|
-
St(1, A(
|
|
261
|
-
St(2, A(
|
|
262
|
-
St(3, A(
|
|
259
|
+
en = is([
|
|
260
|
+
St(1, A(mi)),
|
|
261
|
+
St(2, A(cn)),
|
|
262
|
+
St(3, A(Xn)),
|
|
263
263
|
St(4, A(V))
|
|
264
|
-
],
|
|
264
|
+
], en);
|
|
265
265
|
function z(i, t, e) {
|
|
266
266
|
const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: u = 0 } = i, c = e.getCurrent();
|
|
267
267
|
if (c == null)
|
|
268
268
|
return;
|
|
269
|
-
const l =
|
|
269
|
+
const l = pi(
|
|
270
270
|
c.unitId,
|
|
271
271
|
c.sheetId,
|
|
272
272
|
{ from: n, to: r },
|
|
273
273
|
e
|
|
274
274
|
);
|
|
275
275
|
let { left: g, top: h, width: f, height: p } = l;
|
|
276
|
-
const m = e.getCurrentSkeleton(), _ = m.rowHeaderWidth + m.columnTotalWidth,
|
|
277
|
-
return g + f > _ && (g = _ - f), h + p >
|
|
276
|
+
const m = e.getCurrentSkeleton(), _ = m.rowHeaderWidth + m.columnTotalWidth, v = m.columnHeaderHeight + m.rowTotalHeight;
|
|
277
|
+
return g + f > _ && (g = _ - f), h + p > v && (h = v - p), {
|
|
278
278
|
flipY: s,
|
|
279
279
|
flipX: o,
|
|
280
280
|
angle: a,
|
|
@@ -292,17 +292,17 @@ function $(i, t) {
|
|
|
292
292
|
return;
|
|
293
293
|
const g = {
|
|
294
294
|
column: l.actualColumn,
|
|
295
|
-
columnOffset:
|
|
295
|
+
columnOffset: wt(e - l.startX, 1),
|
|
296
296
|
row: l.actualRow,
|
|
297
|
-
rowOffset:
|
|
297
|
+
rowOffset: wt(n - l.startY, 1)
|
|
298
298
|
}, h = t.getCellWithCoordByOffset(e + r, n + s);
|
|
299
299
|
if (h == null)
|
|
300
300
|
return;
|
|
301
301
|
const f = {
|
|
302
302
|
column: h.actualColumn,
|
|
303
|
-
columnOffset:
|
|
303
|
+
columnOffset: wt(e + r - h.startX, 1),
|
|
304
304
|
row: h.actualRow,
|
|
305
|
-
rowOffset:
|
|
305
|
+
rowOffset: wt(n + s - h.startY, 1)
|
|
306
306
|
};
|
|
307
307
|
return {
|
|
308
308
|
flipY: o,
|
|
@@ -314,12 +314,12 @@ function $(i, t) {
|
|
|
314
314
|
to: f
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
|
-
var
|
|
318
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
317
|
+
var ss = Object.getOwnPropertyDescriptor, os = (i, t, e, n) => {
|
|
318
|
+
for (var r = n > 1 ? void 0 : n ? ss(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
319
319
|
(o = i[s]) && (r = o(r) || r);
|
|
320
320
|
return r;
|
|
321
|
-
},
|
|
322
|
-
let
|
|
321
|
+
}, vt = (i, t) => (e, n) => t(e, n, i);
|
|
322
|
+
let tn = class extends ne {
|
|
323
323
|
constructor(i, t, e, n, r) {
|
|
324
324
|
super(), this._context = i, this._sheetDrawingService = t, this._drawingManagerService = e, this._sheetSelectionRenderService = n, this._sheetSkeletonManagerService = r, this._init();
|
|
325
325
|
}
|
|
@@ -339,16 +339,16 @@ let nn = class extends re {
|
|
|
339
339
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
],
|
|
348
|
-
function
|
|
342
|
+
tn = os([
|
|
343
|
+
vt(1, ie),
|
|
344
|
+
vt(2, re),
|
|
345
|
+
vt(3, A(Xe)),
|
|
346
|
+
vt(4, A(V))
|
|
347
|
+
], tn);
|
|
348
|
+
function as(i) {
|
|
349
349
|
const t = [];
|
|
350
350
|
return i.forEach((e) => {
|
|
351
|
-
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d =
|
|
351
|
+
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = ci(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
352
352
|
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: p } = l;
|
|
353
353
|
return {
|
|
354
354
|
unitId: h,
|
|
@@ -365,7 +365,7 @@ function ms(i) {
|
|
|
365
365
|
unitId: s,
|
|
366
366
|
subUnitId: o,
|
|
367
367
|
drawingId: a,
|
|
368
|
-
drawingType:
|
|
368
|
+
drawingType: B.DRAWING_GROUP,
|
|
369
369
|
transform: d
|
|
370
370
|
};
|
|
371
371
|
t.push({
|
|
@@ -374,14 +374,14 @@ function ms(i) {
|
|
|
374
374
|
});
|
|
375
375
|
}), t;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function cs(i) {
|
|
378
378
|
const t = [];
|
|
379
379
|
return i.forEach((e) => {
|
|
380
380
|
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: d = { width: 0, height: 0 } } = n;
|
|
381
381
|
if (d == null)
|
|
382
382
|
return;
|
|
383
383
|
const u = r.map((l) => {
|
|
384
|
-
const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m =
|
|
384
|
+
const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m = ai(g || {}, d, d.width || 0, d.height || 0);
|
|
385
385
|
return {
|
|
386
386
|
unitId: h,
|
|
387
387
|
subUnitId: f,
|
|
@@ -393,7 +393,7 @@ function ps(i) {
|
|
|
393
393
|
unitId: s,
|
|
394
394
|
subUnitId: o,
|
|
395
395
|
drawingId: a,
|
|
396
|
-
drawingType:
|
|
396
|
+
drawingType: B.DRAWING_GROUP,
|
|
397
397
|
transform: {
|
|
398
398
|
left: 0,
|
|
399
399
|
top: 0
|
|
@@ -405,11 +405,11 @@ function ps(i) {
|
|
|
405
405
|
});
|
|
406
406
|
}), t;
|
|
407
407
|
}
|
|
408
|
-
const
|
|
408
|
+
const mr = {
|
|
409
409
|
id: "sheet.command.group-sheet-image",
|
|
410
|
-
type:
|
|
410
|
+
type: J.COMMAND,
|
|
411
411
|
handler: (i, t) => {
|
|
412
|
-
const e = i.get(G), n = i.get(
|
|
412
|
+
const e = i.get(G), n = i.get(xe), r = i.get(ie);
|
|
413
413
|
if (!t) return !1;
|
|
414
414
|
const s = [];
|
|
415
415
|
t.forEach(({ parent: h, children: f }) => {
|
|
@@ -421,7 +421,7 @@ const _r = {
|
|
|
421
421
|
return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP }) ? (n.pushUndoRedo({
|
|
422
422
|
unitID: a,
|
|
423
423
|
undoMutations: [
|
|
424
|
-
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects:
|
|
424
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: cs(l), type: U.UNGROUP } },
|
|
425
425
|
{ id: Y.id, params: s }
|
|
426
426
|
],
|
|
427
427
|
redoMutations: [
|
|
@@ -430,15 +430,15 @@ const _r = {
|
|
|
430
430
|
]
|
|
431
431
|
}), !0) : !1;
|
|
432
432
|
}
|
|
433
|
-
},
|
|
433
|
+
}, kt = {
|
|
434
434
|
id: "sheet.command.insert-sheet-image",
|
|
435
|
-
type:
|
|
435
|
+
type: J.COMMAND,
|
|
436
436
|
handler: (i, t) => {
|
|
437
|
-
var
|
|
438
|
-
const e = i.get(G), n = i.get(
|
|
437
|
+
var v, I, R;
|
|
438
|
+
const e = i.get(G), n = i.get(xe), r = i.get(ie), s = i.get(Nt);
|
|
439
439
|
if (!t) return !1;
|
|
440
|
-
const o = t.drawings, a = o.map((
|
|
441
|
-
return
|
|
440
|
+
const o = t.drawings, a = o.map((S) => S.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = s.onCommandExecute({ id: kt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, m = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
|
|
441
|
+
return xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
|
|
442
442
|
unitID: u,
|
|
443
443
|
undoMutations: [
|
|
444
444
|
...(I = f.preUndos) != null ? I : [],
|
|
@@ -447,22 +447,22 @@ const _r = {
|
|
|
447
447
|
{ id: Y.id, params: a }
|
|
448
448
|
],
|
|
449
449
|
redoMutations: [
|
|
450
|
-
...(
|
|
450
|
+
...(R = f.preRedos) != null ? R : [],
|
|
451
451
|
p,
|
|
452
452
|
...f.redos,
|
|
453
453
|
{ id: Y.id, params: a }
|
|
454
454
|
]
|
|
455
455
|
}), !0) : !1;
|
|
456
456
|
}
|
|
457
|
-
},
|
|
457
|
+
}, pr = {
|
|
458
458
|
id: "sheet.command.set-drawing-arrange",
|
|
459
|
-
type:
|
|
459
|
+
type: J.COMMAND,
|
|
460
460
|
handler: (i, t) => {
|
|
461
|
-
const e = i.get(G), n = i.get(
|
|
461
|
+
const e = i.get(G), n = i.get(xe);
|
|
462
462
|
if (!t) return !1;
|
|
463
|
-
const r = i.get(
|
|
463
|
+
const r = i.get(ie), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
|
|
464
464
|
let c;
|
|
465
|
-
if (d ===
|
|
465
|
+
if (d === mt.forward ? c = r.getForwardDrawingsOp(u) : d === mt.backward ? c = r.getBackwardDrawingOp(u) : d === mt.front ? c = r.getFrontDrawingsOp(u) : d === mt.back && (c = r.getBackDrawingsOp(u)), c == null)
|
|
466
466
|
return !1;
|
|
467
467
|
const { objects: l, redo: g, undo: h } = c;
|
|
468
468
|
return e.syncExecuteCommand(P.id, { op: g, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE }) ? (n.pushUndoRedo({
|
|
@@ -475,11 +475,11 @@ const _r = {
|
|
|
475
475
|
]
|
|
476
476
|
}), !0) : !1;
|
|
477
477
|
}
|
|
478
|
-
},
|
|
478
|
+
}, Wt = {
|
|
479
479
|
id: "sheet.command.set-sheet-image",
|
|
480
|
-
type:
|
|
480
|
+
type: J.COMMAND,
|
|
481
481
|
handler: (i, t) => {
|
|
482
|
-
const e = i.get(G), n = i.get(
|
|
482
|
+
const e = i.get(G), n = i.get(xe), r = i.get(ie);
|
|
483
483
|
if (!t) return !1;
|
|
484
484
|
const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
485
485
|
return e.syncExecuteCommand(P.id, { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE }) ? (n.pushUndoRedo({
|
|
@@ -494,11 +494,11 @@ const _r = {
|
|
|
494
494
|
]
|
|
495
495
|
}), !0) : !1;
|
|
496
496
|
}
|
|
497
|
-
},
|
|
497
|
+
}, wr = {
|
|
498
498
|
id: "sheet.command.ungroup-sheet-image",
|
|
499
|
-
type:
|
|
499
|
+
type: J.COMMAND,
|
|
500
500
|
handler: (i, t) => {
|
|
501
|
-
const e = i.get(G), n = i.get(
|
|
501
|
+
const e = i.get(G), n = i.get(xe), r = i.get(ie);
|
|
502
502
|
if (!t) return !1;
|
|
503
503
|
const s = [];
|
|
504
504
|
t.forEach(({ parent: h, children: f }) => {
|
|
@@ -510,7 +510,7 @@ const _r = {
|
|
|
510
510
|
return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP }) ? (n.pushUndoRedo({
|
|
511
511
|
unitID: a,
|
|
512
512
|
undoMutations: [
|
|
513
|
-
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects:
|
|
513
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: as(l), type: U.GROUP } },
|
|
514
514
|
{ id: Y.id, params: s }
|
|
515
515
|
],
|
|
516
516
|
redoMutations: [
|
|
@@ -520,21 +520,21 @@ const _r = {
|
|
|
520
520
|
}), !0) : !1;
|
|
521
521
|
}
|
|
522
522
|
};
|
|
523
|
-
var
|
|
524
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
523
|
+
var ds = Object.getOwnPropertyDescriptor, ls = (i, t, e, n) => {
|
|
524
|
+
for (var r = n > 1 ? void 0 : n ? ds(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
525
525
|
(o = i[s]) && (r = o(r) || r);
|
|
526
526
|
return r;
|
|
527
527
|
}, te = (i, t) => (e, n) => t(e, n, i);
|
|
528
|
-
function
|
|
528
|
+
function us(i, t, e) {
|
|
529
529
|
const n = e * Math.PI / 180, r = Math.abs(i * Math.cos(n)) + Math.abs(t * Math.sin(n)), s = Math.abs(i * Math.sin(n)) + Math.abs(t * Math.cos(n));
|
|
530
530
|
return { rotatedWidth: r, rotatedHeight: s };
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
var
|
|
534
|
-
const { rotatedHeight: s, rotatedWidth: o } =
|
|
532
|
+
function nn(i, t, e, n, r) {
|
|
533
|
+
var v;
|
|
534
|
+
const { rotatedHeight: s, rotatedWidth: o } = us(e, n, r), d = i.get(Z).getRenderById(t.unitId);
|
|
535
535
|
if (!d)
|
|
536
536
|
return !1;
|
|
537
|
-
const c = (
|
|
537
|
+
const c = (v = d.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : v.skeleton;
|
|
538
538
|
if (c == null)
|
|
539
539
|
return !1;
|
|
540
540
|
const l = c.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(g, h * f)) / o, _ = !m || Number.isNaN(m) ? 1e-3 : m;
|
|
@@ -543,7 +543,7 @@ function rn(i, t, e, n, r) {
|
|
|
543
543
|
height: n * _
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
|
-
let
|
|
546
|
+
let Qe = class extends ne {
|
|
547
547
|
constructor(t, e, n, r, s, o, a, d, u, c, l, g, h) {
|
|
548
548
|
super();
|
|
549
549
|
ee(this, "_workbookSelections");
|
|
@@ -552,17 +552,17 @@ let et = class extends re {
|
|
|
552
552
|
async insertFloatImage() {
|
|
553
553
|
const t = await this._fileOpenerService.openFile({
|
|
554
554
|
multiple: !0,
|
|
555
|
-
accept:
|
|
555
|
+
accept: In.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
556
556
|
}), e = t.length;
|
|
557
|
-
return e >
|
|
558
|
-
type:
|
|
559
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
557
|
+
return e > Cn ? (this._messageService.show({
|
|
558
|
+
type: pe.Error,
|
|
559
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(Cn))
|
|
560
560
|
}), !1) : e === 0 ? !1 : (t.forEach(async (n) => await this.insertFloatImageByFile(n)), !0);
|
|
561
561
|
}
|
|
562
562
|
async insertCellImage() {
|
|
563
563
|
const e = (await this._fileOpenerService.openFile({
|
|
564
564
|
multiple: !1,
|
|
565
|
-
accept:
|
|
565
|
+
accept: In.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
566
566
|
}))[0];
|
|
567
567
|
return e ? (await this._insertCellImage(e), !0) : !1;
|
|
568
568
|
}
|
|
@@ -573,27 +573,27 @@ let et = class extends re {
|
|
|
573
573
|
let e;
|
|
574
574
|
try {
|
|
575
575
|
e = await this._imageIoService.saveImage(t);
|
|
576
|
-
} catch (
|
|
577
|
-
const I =
|
|
578
|
-
I ===
|
|
579
|
-
type:
|
|
580
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
581
|
-
}) : I ===
|
|
582
|
-
type:
|
|
576
|
+
} catch (v) {
|
|
577
|
+
const I = v.message;
|
|
578
|
+
I === Ue.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
579
|
+
type: pe.Error,
|
|
580
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Dn / (1024 * 1024)))
|
|
581
|
+
}) : I === Ue.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
582
|
+
type: pe.Error,
|
|
583
583
|
content: this._localeService.t("update-status.invalidImageType")
|
|
584
|
-
}) : I ===
|
|
585
|
-
type:
|
|
584
|
+
}) : I === Ue.ERROR_IMAGE && this._messageService.show({
|
|
585
|
+
type: pe.Error,
|
|
586
586
|
content: this._localeService.t("update-status.invalidImage")
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
589
|
if (e == null)
|
|
590
590
|
return;
|
|
591
|
-
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await
|
|
591
|
+
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await xt(u || ""), { width: h, height: f } = this._context.scene;
|
|
592
592
|
this._imageIoService.addImageSourceCache(d, a, g);
|
|
593
593
|
let p = 1;
|
|
594
|
-
if (c > Rn || l >
|
|
595
|
-
const
|
|
596
|
-
p = Math.max(
|
|
594
|
+
if (c > Rn || l > bn) {
|
|
595
|
+
const v = Rn / c, I = bn / l;
|
|
596
|
+
p = Math.max(v, I);
|
|
597
597
|
}
|
|
598
598
|
const m = this._getImagePosition(c * p, l * p, h, f);
|
|
599
599
|
if (m == null)
|
|
@@ -602,46 +602,46 @@ let et = class extends re {
|
|
|
602
602
|
unitId: r,
|
|
603
603
|
subUnitId: s,
|
|
604
604
|
drawingId: o,
|
|
605
|
-
drawingType:
|
|
605
|
+
drawingType: B.DRAWING_IMAGE,
|
|
606
606
|
imageSourceType: a,
|
|
607
607
|
source: d,
|
|
608
608
|
transform: z(m, this._selectionRenderService, this._skeletonManagerService),
|
|
609
609
|
sheetTransform: m
|
|
610
610
|
};
|
|
611
|
-
return this._commandService.executeCommand(
|
|
611
|
+
return this._commandService.executeCommand(kt.id, {
|
|
612
612
|
unitId: r,
|
|
613
613
|
drawings: [_]
|
|
614
614
|
});
|
|
615
615
|
}
|
|
616
616
|
// eslint-disable-next-line max-lines-per-function
|
|
617
617
|
async _insertCellImage(t, e) {
|
|
618
|
-
var I,
|
|
618
|
+
var I, R;
|
|
619
619
|
let n;
|
|
620
620
|
try {
|
|
621
621
|
n = await this._imageIoService.saveImage(t);
|
|
622
|
-
} catch (
|
|
623
|
-
const C =
|
|
624
|
-
C ===
|
|
625
|
-
type:
|
|
626
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
627
|
-
}) : C ===
|
|
628
|
-
type:
|
|
622
|
+
} catch (S) {
|
|
623
|
+
const C = S.message;
|
|
624
|
+
C === Ue.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
625
|
+
type: pe.Error,
|
|
626
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Dn / (1024 * 1024)))
|
|
627
|
+
}) : C === Ue.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
628
|
+
type: pe.Error,
|
|
629
629
|
content: this._localeService.t("update-status.invalidImageType")
|
|
630
|
-
}) : C ===
|
|
631
|
-
type:
|
|
630
|
+
}) : C === Ue.ERROR_IMAGE && this._messageService.show({
|
|
631
|
+
type: pe.Error,
|
|
632
632
|
content: this._localeService.t("update-status.invalidImage")
|
|
633
633
|
});
|
|
634
634
|
}
|
|
635
635
|
if (n == null)
|
|
636
636
|
return !1;
|
|
637
|
-
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await
|
|
637
|
+
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await xt(a || "");
|
|
638
638
|
this._imageIoService.addImageSourceCache(o, s, c);
|
|
639
639
|
const l = this._workbookSelections.getCurrentLastSelection();
|
|
640
640
|
if (!l)
|
|
641
641
|
return !1;
|
|
642
642
|
let g = l.primary.actualRow, h = l.primary.actualColumn;
|
|
643
643
|
l.primary.isMerged && (g = l.primary.startRow, h = l.primary.startColumn);
|
|
644
|
-
const f =
|
|
644
|
+
const f = Vt("", {}), p = nn(
|
|
645
645
|
this._injector,
|
|
646
646
|
{
|
|
647
647
|
unitId: this._context.unitId,
|
|
@@ -661,11 +661,11 @@ let et = class extends re {
|
|
|
661
661
|
height: p.height
|
|
662
662
|
},
|
|
663
663
|
positionH: {
|
|
664
|
-
relativeFrom:
|
|
664
|
+
relativeFrom: pn.PAGE,
|
|
665
665
|
posOffset: 0
|
|
666
666
|
},
|
|
667
667
|
positionV: {
|
|
668
|
-
relativeFrom:
|
|
668
|
+
relativeFrom: mn.PARAGRAPH,
|
|
669
669
|
posOffset: 0
|
|
670
670
|
},
|
|
671
671
|
angle: 0
|
|
@@ -673,7 +673,7 @@ let et = class extends re {
|
|
|
673
673
|
unitId: f.getUnitId(),
|
|
674
674
|
subUnitId: f.getUnitId(),
|
|
675
675
|
drawingId: r,
|
|
676
|
-
drawingType:
|
|
676
|
+
drawingType: B.DRAWING_IMAGE,
|
|
677
677
|
imageSourceType: s,
|
|
678
678
|
source: o,
|
|
679
679
|
transform: Bn(m),
|
|
@@ -681,14 +681,14 @@ let et = class extends re {
|
|
|
681
681
|
behindDoc: Sn.FALSE,
|
|
682
682
|
title: "",
|
|
683
683
|
description: "",
|
|
684
|
-
layoutType:
|
|
684
|
+
layoutType: _n.INLINE,
|
|
685
685
|
// Insert inline drawing by default.
|
|
686
|
-
wrapText:
|
|
686
|
+
wrapText: wn.BOTH_SIDES,
|
|
687
687
|
distB: 0,
|
|
688
688
|
distL: 0,
|
|
689
689
|
distR: 0,
|
|
690
690
|
distT: 0
|
|
691
|
-
},
|
|
691
|
+
}, v = Ht.drawing.add({
|
|
692
692
|
documentDataModel: f,
|
|
693
693
|
drawings: [_],
|
|
694
694
|
selection: {
|
|
@@ -697,10 +697,10 @@ let et = class extends re {
|
|
|
697
697
|
endOffset: 0
|
|
698
698
|
}
|
|
699
699
|
});
|
|
700
|
-
return
|
|
700
|
+
return v ? (f.apply(v), this._commandService.syncExecuteCommand(Nn.id, {
|
|
701
701
|
value: {
|
|
702
702
|
[(I = e == null ? void 0 : e.row) != null ? I : g]: {
|
|
703
|
-
[(
|
|
703
|
+
[(R = e == null ? void 0 : e.col) != null ? R : h]: {
|
|
704
704
|
p: f.getSnapshot(),
|
|
705
705
|
t: 1
|
|
706
706
|
}
|
|
@@ -713,12 +713,12 @@ let et = class extends re {
|
|
|
713
713
|
// eslint-disable-next-line max-lines-per-function
|
|
714
714
|
async insertCellImageByUrl(t, e) {
|
|
715
715
|
var g, h;
|
|
716
|
-
const { width: n, height: r, image: s } = await
|
|
717
|
-
this._imageIoService.addImageSourceCache(t,
|
|
716
|
+
const { width: n, height: r, image: s } = await xt(t || "");
|
|
717
|
+
this._imageIoService.addImageSourceCache(t, vn.URL, s);
|
|
718
718
|
const o = this._workbookSelections.getCurrentLastSelection();
|
|
719
719
|
if (!o)
|
|
720
720
|
return !1;
|
|
721
|
-
const a =
|
|
721
|
+
const a = Vt("", {}), d = nn(
|
|
722
722
|
this._injector,
|
|
723
723
|
{
|
|
724
724
|
unitId: this._context.unitId,
|
|
@@ -738,34 +738,34 @@ let et = class extends re {
|
|
|
738
738
|
height: d.height
|
|
739
739
|
},
|
|
740
740
|
positionH: {
|
|
741
|
-
relativeFrom:
|
|
741
|
+
relativeFrom: pn.PAGE,
|
|
742
742
|
posOffset: 0
|
|
743
743
|
},
|
|
744
744
|
positionV: {
|
|
745
|
-
relativeFrom:
|
|
745
|
+
relativeFrom: mn.PARAGRAPH,
|
|
746
746
|
posOffset: 0
|
|
747
747
|
},
|
|
748
748
|
angle: 0
|
|
749
749
|
}, c = {
|
|
750
750
|
unitId: a.getUnitId(),
|
|
751
751
|
subUnitId: a.getUnitId(),
|
|
752
|
-
drawingId:
|
|
753
|
-
drawingType:
|
|
754
|
-
imageSourceType:
|
|
752
|
+
drawingId: Dt(),
|
|
753
|
+
drawingType: B.DRAWING_IMAGE,
|
|
754
|
+
imageSourceType: vn.URL,
|
|
755
755
|
source: t,
|
|
756
756
|
transform: Bn(u),
|
|
757
757
|
docTransform: u,
|
|
758
758
|
behindDoc: Sn.FALSE,
|
|
759
759
|
title: "",
|
|
760
760
|
description: "",
|
|
761
|
-
layoutType:
|
|
761
|
+
layoutType: _n.INLINE,
|
|
762
762
|
// Insert inline drawing by default.
|
|
763
|
-
wrapText:
|
|
763
|
+
wrapText: wn.BOTH_SIDES,
|
|
764
764
|
distB: 0,
|
|
765
765
|
distL: 0,
|
|
766
766
|
distR: 0,
|
|
767
767
|
distT: 0
|
|
768
|
-
}, l =
|
|
768
|
+
}, l = Ht.drawing.add({
|
|
769
769
|
documentDataModel: a,
|
|
770
770
|
drawings: [c],
|
|
771
771
|
selection: {
|
|
@@ -774,7 +774,7 @@ let et = class extends re {
|
|
|
774
774
|
endOffset: 0
|
|
775
775
|
}
|
|
776
776
|
});
|
|
777
|
-
return l ? (a.apply(l), this._commandService.syncExecuteCommand(
|
|
777
|
+
return l ? (a.apply(l), this._commandService.syncExecuteCommand(Nn.id, {
|
|
778
778
|
value: {
|
|
779
779
|
[(g = e == null ? void 0 : e.row) != null ? g : o.primary.actualRow]: {
|
|
780
780
|
[(h = e == null ? void 0 : e.col) != null ? h : o.primary.actualColumn]: {
|
|
@@ -803,7 +803,7 @@ let et = class extends re {
|
|
|
803
803
|
endColumn: 0
|
|
804
804
|
};
|
|
805
805
|
s && s.length > 0 && (o = s[s.length - 1].range);
|
|
806
|
-
const a =
|
|
806
|
+
const a = Ln(this._skeletonManagerService.getCurrent().skeleton, o);
|
|
807
807
|
if (a == null)
|
|
808
808
|
return;
|
|
809
809
|
let { startColumn: d, startRow: u, startX: c, startY: l } = a, g = !1;
|
|
@@ -835,7 +835,7 @@ let et = class extends re {
|
|
|
835
835
|
_updateOrderListener() {
|
|
836
836
|
this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((t) => {
|
|
837
837
|
const { unitId: e, subUnitId: n, drawingIds: r, arrangeType: s } = t;
|
|
838
|
-
this._commandService.executeCommand(
|
|
838
|
+
this._commandService.executeCommand(pr.id, {
|
|
839
839
|
unitId: e,
|
|
840
840
|
subUnitId: n,
|
|
841
841
|
drawingIds: r,
|
|
@@ -862,7 +862,7 @@ let et = class extends re {
|
|
|
862
862
|
sheetTransform: { ...c }
|
|
863
863
|
};
|
|
864
864
|
e.push(l);
|
|
865
|
-
}), e.length > 0 && this._commandService.executeCommand(
|
|
865
|
+
}), e.length > 0 && this._commandService.executeCommand(Wt.id, {
|
|
866
866
|
unitId: t[0].unitId,
|
|
867
867
|
drawings: e
|
|
868
868
|
}));
|
|
@@ -870,44 +870,44 @@ let et = class extends re {
|
|
|
870
870
|
}
|
|
871
871
|
_groupDrawingListener() {
|
|
872
872
|
this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((t) => {
|
|
873
|
-
this._commandService.executeCommand(
|
|
873
|
+
this._commandService.executeCommand(mr.id, t);
|
|
874
874
|
const { unitId: e, subUnitId: n, drawingId: r } = t[0].parent;
|
|
875
|
-
this._commandService.syncExecuteCommand(
|
|
875
|
+
this._commandService.syncExecuteCommand(At.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
|
|
876
876
|
})), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((t) => {
|
|
877
|
-
this._commandService.executeCommand(
|
|
877
|
+
this._commandService.executeCommand(wr.id, t);
|
|
878
878
|
}));
|
|
879
879
|
}
|
|
880
880
|
_focusDrawingListener() {
|
|
881
881
|
this.disposeWithMe(
|
|
882
882
|
this._drawingManagerService.focus$.subscribe((t) => {
|
|
883
|
-
t == null || t.length === 0 ? (this._contextService.setContextValue(
|
|
883
|
+
t == null || t.length === 0 ? (this._contextService.setContextValue($e, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue($e, !0), this._sheetDrawingService.focusDrawing(t));
|
|
884
884
|
})
|
|
885
885
|
);
|
|
886
886
|
}
|
|
887
887
|
};
|
|
888
|
-
|
|
888
|
+
Qe = ls([
|
|
889
889
|
te(1, A(V)),
|
|
890
890
|
te(2, G),
|
|
891
|
-
te(3,
|
|
892
|
-
te(4,
|
|
893
|
-
te(5,
|
|
894
|
-
te(6,
|
|
895
|
-
te(7,
|
|
896
|
-
te(8,
|
|
897
|
-
te(9,
|
|
898
|
-
te(10, A(
|
|
899
|
-
te(11, A(
|
|
900
|
-
te(12, A(
|
|
901
|
-
],
|
|
902
|
-
var
|
|
903
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
891
|
+
te(3, Xe),
|
|
892
|
+
te(4, Zr),
|
|
893
|
+
te(5, Mi),
|
|
894
|
+
te(6, ie),
|
|
895
|
+
te(7, re),
|
|
896
|
+
te(8, Yn),
|
|
897
|
+
te(9, Vn),
|
|
898
|
+
te(10, A(tt)),
|
|
899
|
+
te(11, A(cn)),
|
|
900
|
+
te(12, A(Ye))
|
|
901
|
+
], Qe);
|
|
902
|
+
var hs = Object.getOwnPropertyDescriptor, gs = (i, t, e, n) => {
|
|
903
|
+
for (var r = n > 1 ? void 0 : n ? hs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
904
904
|
(o = i[s]) && (r = o(r) || r);
|
|
905
905
|
return r;
|
|
906
|
-
},
|
|
907
|
-
function
|
|
906
|
+
}, Ne = (i, t) => (e, n) => t(e, n, i);
|
|
907
|
+
function _r(i, t, e) {
|
|
908
908
|
var n, r, s, o;
|
|
909
909
|
if (((r = (n = e == null ? void 0 : e.p) == null ? void 0 : n.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = e.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
|
|
910
|
-
const a = e.p.drawings[e.p.drawingsOrder[0]], d =
|
|
910
|
+
const a = e.p.drawings[e.p.drawingsOrder[0]], d = nn(
|
|
911
911
|
i,
|
|
912
912
|
{
|
|
913
913
|
unitId: t.unitId,
|
|
@@ -924,47 +924,47 @@ function Ir(i, t, e) {
|
|
|
924
924
|
}
|
|
925
925
|
return !1;
|
|
926
926
|
}
|
|
927
|
-
let
|
|
927
|
+
let bt = class extends ne {
|
|
928
928
|
constructor(i, t, e, n, r, s) {
|
|
929
929
|
super(), this._commandService = i, this._sheetInterceptorService = t, this._injector = e, this._drawingManagerService = n, this._docDrawingController = r, this._editorBridgeService = s, this._handleInitEditor(), this._initCellContentInterceptor();
|
|
930
930
|
}
|
|
931
931
|
_handleInitEditor() {
|
|
932
932
|
this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
|
|
933
|
-
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(
|
|
933
|
+
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(Ze), this._docDrawingController.loadDrawingDataForUnit(Ze), this._drawingManagerService.initializeNotification(Ze)) : this._drawingManagerService.removeDrawingDataForUnit(Ze);
|
|
934
934
|
})), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
935
|
-
i.id ===
|
|
935
|
+
i.id === Zi.id && i.params.unitId === Be && (this._drawingManagerService.removeDrawingDataForUnit(Be), this._docDrawingController.loadDrawingDataForUnit(Be), this._drawingManagerService.initializeNotification(Be));
|
|
936
936
|
}));
|
|
937
937
|
}
|
|
938
938
|
_initCellContentInterceptor() {
|
|
939
939
|
this.disposeWithMe(
|
|
940
940
|
this._sheetInterceptorService.intercept(
|
|
941
|
-
|
|
941
|
+
ji.CELL_CONTENT,
|
|
942
942
|
{
|
|
943
|
-
effect:
|
|
944
|
-
priority:
|
|
943
|
+
effect: Ur.Style,
|
|
944
|
+
priority: $i.CELL_IMAGE,
|
|
945
945
|
handler: (i, t, e) => {
|
|
946
946
|
var n;
|
|
947
|
-
return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 },
|
|
947
|
+
return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, _r(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
950
|
)
|
|
951
951
|
);
|
|
952
952
|
}
|
|
953
953
|
};
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
],
|
|
962
|
-
var
|
|
963
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
954
|
+
bt = gs([
|
|
955
|
+
Ne(0, G),
|
|
956
|
+
Ne(1, A(Nt)),
|
|
957
|
+
Ne(2, A(Ye)),
|
|
958
|
+
Ne(3, re),
|
|
959
|
+
Ne(4, A(Kr)),
|
|
960
|
+
Ne(5, A(wi))
|
|
961
|
+
], bt);
|
|
962
|
+
var fs = Object.getOwnPropertyDescriptor, ms = (i, t, e, n) => {
|
|
963
|
+
for (var r = n > 1 ? void 0 : n ? fs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
964
964
|
(o = i[s]) && (r = o(r) || r);
|
|
965
965
|
return r;
|
|
966
|
-
},
|
|
967
|
-
let
|
|
966
|
+
}, $n = (i, t) => (e, n) => t(e, n, i);
|
|
967
|
+
let Mt = class extends ne {
|
|
968
968
|
constructor(i, t) {
|
|
969
969
|
super(), this._autoFillService = i, this._injector = t, this._initAutoFillHooks();
|
|
970
970
|
}
|
|
@@ -973,35 +973,35 @@ let yt = class extends re {
|
|
|
973
973
|
this._autoFillService.addHook({
|
|
974
974
|
id: "sheet-cell-image-autofill",
|
|
975
975
|
onBeforeSubmit: (i, t, e, n) => {
|
|
976
|
-
new
|
|
977
|
-
|
|
976
|
+
new Pr(n).forValue((r, s, o) => {
|
|
977
|
+
_r(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
|
|
978
978
|
});
|
|
979
979
|
}
|
|
980
980
|
})
|
|
981
981
|
);
|
|
982
982
|
}
|
|
983
983
|
};
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
],
|
|
988
|
-
var
|
|
989
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
984
|
+
Mt = ms([
|
|
985
|
+
$n(0, A(_i)),
|
|
986
|
+
$n(1, A(Ye))
|
|
987
|
+
], Mt);
|
|
988
|
+
var ps = Object.getOwnPropertyDescriptor, ws = (i, t, e, n) => {
|
|
989
|
+
for (var r = n > 1 ? void 0 : n ? ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
990
990
|
(o = i[s]) && (r = o(r) || r);
|
|
991
991
|
return r;
|
|
992
|
-
},
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
|
|
992
|
+
}, He = (i, t) => (e, n) => t(e, n, i);
|
|
993
|
+
const _s = [
|
|
994
|
+
Ze,
|
|
995
|
+
Ar,
|
|
996
996
|
Be
|
|
997
997
|
];
|
|
998
|
-
let
|
|
998
|
+
let yt = class extends ne {
|
|
999
999
|
constructor(i, t, e, n, r) {
|
|
1000
1000
|
super(), this._commandService = i, this._univerInstanceService = t, this._dialogService = e, this._renderManagerService = n, this._localeService = r, this._initDocImageCopyPasteHooks();
|
|
1001
1001
|
}
|
|
1002
1002
|
_setCellImage(i) {
|
|
1003
1003
|
var r;
|
|
1004
|
-
const t =
|
|
1004
|
+
const t = Vt("", {}), e = (r = sn(F.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(Si), n = Ht.drawing.add({
|
|
1005
1005
|
documentDataModel: t,
|
|
1006
1006
|
drawings: [i],
|
|
1007
1007
|
selection: {
|
|
@@ -1016,20 +1016,20 @@ let Et = class extends re {
|
|
|
1016
1016
|
this.disposeWithMe(
|
|
1017
1017
|
this._commandService.beforeCommandExecuted((i) => {
|
|
1018
1018
|
var t, e;
|
|
1019
|
-
if (i.id ===
|
|
1020
|
-
const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(
|
|
1019
|
+
if (i.id === qi.id) {
|
|
1020
|
+
const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(F.UNIVER_DOC);
|
|
1021
1021
|
if (s == null || !Object.keys((t = r.drawings) != null ? t : {}).length)
|
|
1022
1022
|
return;
|
|
1023
1023
|
const o = s.getUnitId();
|
|
1024
|
-
if (
|
|
1024
|
+
if (_s.includes(o)) {
|
|
1025
1025
|
if (o !== Be) {
|
|
1026
1026
|
const a = () => {
|
|
1027
|
-
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(
|
|
1027
|
+
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(yn.id, {
|
|
1028
1028
|
visible: !1
|
|
1029
1029
|
});
|
|
1030
1030
|
};
|
|
1031
1031
|
((e = s.getBody()) == null ? void 0 : e.dataStream) === `\r
|
|
1032
|
-
` ? (this._commandService.syncExecuteCommand(
|
|
1032
|
+
` ? (this._commandService.syncExecuteCommand(yn.id, {
|
|
1033
1033
|
visible: !1
|
|
1034
1034
|
}), this._setCellImage(Object.values(r.drawings)[0])) : this._dialogService.open({
|
|
1035
1035
|
id: "sheet-cell-image-copy-paste",
|
|
@@ -1057,23 +1057,23 @@ let Et = class extends re {
|
|
|
1057
1057
|
);
|
|
1058
1058
|
}
|
|
1059
1059
|
};
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
],
|
|
1060
|
+
yt = ws([
|
|
1061
|
+
He(0, G),
|
|
1062
|
+
He(1, Se),
|
|
1063
|
+
He(2, yi),
|
|
1064
|
+
He(3, Z),
|
|
1065
|
+
He(4, A(tt))
|
|
1066
|
+
], yt);
|
|
1067
1067
|
const Bt = {
|
|
1068
1068
|
id: "sheet.command.insert-float-image",
|
|
1069
|
-
type:
|
|
1069
|
+
type: J.COMMAND,
|
|
1070
1070
|
handler: async (i, t) => {
|
|
1071
1071
|
var o, a;
|
|
1072
|
-
const e = i.get(Se), n = i.get(
|
|
1073
|
-
|
|
1072
|
+
const e = i.get(Se), n = i.get(Z), r = (o = sn(
|
|
1073
|
+
F.UNIVER_SHEET,
|
|
1074
1074
|
e,
|
|
1075
1075
|
n
|
|
1076
|
-
)) == null ? void 0 : o.with(
|
|
1076
|
+
)) == null ? void 0 : o.with(Qe);
|
|
1077
1077
|
if (!r)
|
|
1078
1078
|
return !1;
|
|
1079
1079
|
const s = t == null ? void 0 : t.files;
|
|
@@ -1083,38 +1083,38 @@ const Bt = {
|
|
|
1083
1083
|
} else
|
|
1084
1084
|
return (a = r.insertFloatImage()) != null ? a : !1;
|
|
1085
1085
|
}
|
|
1086
|
-
},
|
|
1086
|
+
}, dn = {
|
|
1087
1087
|
id: "sheet.command.insert-cell-image",
|
|
1088
|
-
type:
|
|
1088
|
+
type: J.COMMAND,
|
|
1089
1089
|
handler: (i) => {
|
|
1090
1090
|
var n, r;
|
|
1091
|
-
const t = i.get(Se), e = i.get(
|
|
1092
|
-
return (r = (n =
|
|
1093
|
-
|
|
1091
|
+
const t = i.get(Se), e = i.get(Z);
|
|
1092
|
+
return (r = (n = sn(
|
|
1093
|
+
F.UNIVER_SHEET,
|
|
1094
1094
|
t,
|
|
1095
1095
|
e
|
|
1096
|
-
)) == null ? void 0 : n.with(
|
|
1096
|
+
)) == null ? void 0 : n.with(Qe).insertCellImage()) != null ? r : !1;
|
|
1097
1097
|
}
|
|
1098
1098
|
};
|
|
1099
|
-
var
|
|
1100
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1099
|
+
var Ss = Object.getOwnPropertyDescriptor, vs = (i, t, e, n) => {
|
|
1100
|
+
for (var r = n > 1 ? void 0 : n ? Ss(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1101
1101
|
(o = i[s]) && (r = o(r) || r);
|
|
1102
1102
|
return r;
|
|
1103
|
-
},
|
|
1104
|
-
const
|
|
1105
|
-
function
|
|
1103
|
+
}, ze = (i, t) => (e, n) => t(e, n, i);
|
|
1104
|
+
const Sr = "image/png";
|
|
1105
|
+
function Is(i) {
|
|
1106
1106
|
const t = i.split(","), e = atob(t[1]), n = e.length, r = new Uint8Array(n);
|
|
1107
1107
|
for (let s = 0; s < n; s++)
|
|
1108
1108
|
r[s] = e.charCodeAt(s);
|
|
1109
|
-
return new Blob([r], { type:
|
|
1109
|
+
return new Blob([r], { type: Sr });
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1112
|
-
const t = new ClipboardItem({ [
|
|
1111
|
+
function Cs(i) {
|
|
1112
|
+
const t = new ClipboardItem({ [Sr]: Is(i) });
|
|
1113
1113
|
navigator.clipboard.write([t]).catch((e) => {
|
|
1114
1114
|
console.error("Could not copy image using clipboard API: ", e);
|
|
1115
1115
|
});
|
|
1116
1116
|
}
|
|
1117
|
-
function
|
|
1117
|
+
function Ds() {
|
|
1118
1118
|
function i() {
|
|
1119
1119
|
const n = document.createElement("input");
|
|
1120
1120
|
return n.style.position = "absolute", n.style.height = "1px", n.style.width = "1px", n.style.opacity = "0", n;
|
|
@@ -1125,12 +1125,12 @@ function Us() {
|
|
|
1125
1125
|
};
|
|
1126
1126
|
}
|
|
1127
1127
|
const Fn = [
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1128
|
+
je.SPECIAL_PASTE_COL_WIDTH,
|
|
1129
|
+
je.SPECIAL_PASTE_VALUE,
|
|
1130
|
+
je.SPECIAL_PASTE_FORMAT,
|
|
1131
|
+
je.SPECIAL_PASTE_FORMULA
|
|
1132
1132
|
];
|
|
1133
|
-
let
|
|
1133
|
+
let Et = class extends ne {
|
|
1134
1134
|
constructor(t, e, n, r, s) {
|
|
1135
1135
|
super();
|
|
1136
1136
|
ee(this, "_copyInfo");
|
|
@@ -1147,16 +1147,16 @@ let Tt = class extends re {
|
|
|
1147
1147
|
const s = this._focusedDrawings;
|
|
1148
1148
|
if (s.length > 0) {
|
|
1149
1149
|
const [o] = s;
|
|
1150
|
-
if (r ===
|
|
1150
|
+
if (r === Ie.CUT) {
|
|
1151
1151
|
const d = {
|
|
1152
1152
|
unitId: t,
|
|
1153
1153
|
drawings: [o]
|
|
1154
1154
|
};
|
|
1155
|
-
this._commandService.executeCommand(
|
|
1155
|
+
this._commandService.executeCommand(nt.id, d);
|
|
1156
1156
|
}
|
|
1157
1157
|
setTimeout(() => {
|
|
1158
|
-
const d =
|
|
1159
|
-
o.drawingType ===
|
|
1158
|
+
const d = Ds();
|
|
1159
|
+
o.drawingType === B.DRAWING_IMAGE && o.imageSourceType === qr.BASE64 ? Cs(o.source) : this._clipboardInterfaceService.writeText(""), d();
|
|
1160
1160
|
}, 200);
|
|
1161
1161
|
const a = {
|
|
1162
1162
|
unitId: o.unitId,
|
|
@@ -1172,14 +1172,14 @@ let Tt = class extends re {
|
|
|
1172
1172
|
onPasteCells: (t, e, n, r) => {
|
|
1173
1173
|
if (!this._copyInfo)
|
|
1174
1174
|
return { redos: [], undos: [] };
|
|
1175
|
-
const { copyType: s =
|
|
1176
|
-
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o },
|
|
1175
|
+
const { copyType: s = Ie.COPY, pasteType: o } = r, { range: a } = t || {}, { range: d, unitId: u, subUnitId: c } = e;
|
|
1176
|
+
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, Ie.COPY);
|
|
1177
1177
|
},
|
|
1178
1178
|
onPastePlainText: (t, e) => ({ undos: [], redos: [] }),
|
|
1179
|
-
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1179
|
+
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: je.DEFAULT_PASTE }, Ie.COPY) : { undos: [], redos: [] },
|
|
1180
1180
|
onPasteFiles: (t, e) => {
|
|
1181
1181
|
if (this._copyInfo)
|
|
1182
|
-
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1182
|
+
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: je.DEFAULT_PASTE }, Ie.COPY);
|
|
1183
1183
|
{
|
|
1184
1184
|
const n = e.filter((r) => r.type.includes("image"));
|
|
1185
1185
|
if (n.length)
|
|
@@ -1209,13 +1209,13 @@ let Tt = class extends re {
|
|
|
1209
1209
|
const f = c[h], { transform: p } = f;
|
|
1210
1210
|
if (f.anchorType !== O.Both || !p)
|
|
1211
1211
|
return;
|
|
1212
|
-
const { left: m = 0, top: _ = 0, width:
|
|
1212
|
+
const { left: m = 0, top: _ = 0, width: v = 0, height: I = 0 } = p, { drawingStartX: R, drawingEndX: S, drawingStartY: C, drawingEndY: w } = {
|
|
1213
1213
|
drawingStartX: m,
|
|
1214
|
-
drawingEndX: m +
|
|
1214
|
+
drawingEndX: m + v,
|
|
1215
1215
|
drawingStartY: _,
|
|
1216
1216
|
drawingEndY: _ + I
|
|
1217
1217
|
};
|
|
1218
|
-
o <=
|
|
1218
|
+
o <= R && S <= a && d <= C && w <= u && l.push(f);
|
|
1219
1219
|
}), l.length)
|
|
1220
1220
|
return {
|
|
1221
1221
|
copyRange: n,
|
|
@@ -1228,16 +1228,16 @@ let Tt = class extends re {
|
|
|
1228
1228
|
const { pasteType: n, pasteTo: r } = t;
|
|
1229
1229
|
if (Fn.includes(n))
|
|
1230
1230
|
return { redos: [], undos: [] };
|
|
1231
|
-
const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(V), c = d == null ? void 0 : d.with(
|
|
1231
|
+
const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(V), c = d == null ? void 0 : d.with(Xe), l = this._copyInfo;
|
|
1232
1232
|
if (!u || !c)
|
|
1233
1233
|
return { redos: [], undos: [] };
|
|
1234
|
-
const { drawings: g } = l, h =
|
|
1234
|
+
const { drawings: g } = l, h = En(a);
|
|
1235
1235
|
return this._generateMutations(g, {
|
|
1236
1236
|
unitId: s,
|
|
1237
1237
|
subUnitId: o,
|
|
1238
|
-
isCut: e ===
|
|
1238
|
+
isCut: e === Ie.CUT,
|
|
1239
1239
|
getTransform: (f, p) => {
|
|
1240
|
-
var
|
|
1240
|
+
var v;
|
|
1241
1241
|
const m = u.attachRangeWithCoord({
|
|
1242
1242
|
startRow: h.startRow,
|
|
1243
1243
|
endRow: h.endRow,
|
|
@@ -1250,7 +1250,7 @@ let Tt = class extends re {
|
|
|
1250
1250
|
};
|
|
1251
1251
|
return {
|
|
1252
1252
|
transform: _,
|
|
1253
|
-
sheetTransform: (
|
|
1253
|
+
sheetTransform: (v = $(_, c)) != null ? v : p
|
|
1254
1254
|
};
|
|
1255
1255
|
}
|
|
1256
1256
|
});
|
|
@@ -1321,10 +1321,10 @@ let Tt = class extends re {
|
|
|
1321
1321
|
const { drawings: c } = this._copyInfo;
|
|
1322
1322
|
if (!a)
|
|
1323
1323
|
return this._generateSingleDrawingPasteMutations({
|
|
1324
|
-
pasteTo: { unitId: n, subUnitId: r, range:
|
|
1324
|
+
pasteTo: { unitId: n, subUnitId: r, range: En(o) },
|
|
1325
1325
|
pasteType: s
|
|
1326
1326
|
}, d);
|
|
1327
|
-
const { ranges: [l, g], mapFunc: h } =
|
|
1327
|
+
const { ranges: [l, g], mapFunc: h } = vi([a, o]), { row: f, col: p } = h(l.startRow, l.startColumn), { row: m, col: _ } = h(g.startRow, g.startColumn), v = u.attachRangeWithCoord({
|
|
1328
1328
|
startRow: f,
|
|
1329
1329
|
endRow: f,
|
|
1330
1330
|
startColumn: p,
|
|
@@ -1335,9 +1335,9 @@ let Tt = class extends re {
|
|
|
1335
1335
|
startColumn: _,
|
|
1336
1336
|
endColumn: _
|
|
1337
1337
|
});
|
|
1338
|
-
if (!
|
|
1338
|
+
if (!v || !I || !this._copyInfo)
|
|
1339
1339
|
return { redos: [], undos: [] };
|
|
1340
|
-
const
|
|
1340
|
+
const R = I.startX - v.startX, S = I.startY - v.startY, C = m - f, w = _ - p;
|
|
1341
1341
|
return this._generateMutations(c, {
|
|
1342
1342
|
unitId: n,
|
|
1343
1343
|
subUnitId: r,
|
|
@@ -1346,8 +1346,8 @@ let Tt = class extends re {
|
|
|
1346
1346
|
return {
|
|
1347
1347
|
transform: {
|
|
1348
1348
|
...D,
|
|
1349
|
-
left: ((T = D == null ? void 0 : D.left) != null ? T : 0) +
|
|
1350
|
-
top: ((M = D == null ? void 0 : D.top) != null ? M : 0) +
|
|
1349
|
+
left: ((T = D == null ? void 0 : D.left) != null ? T : 0) + R,
|
|
1350
|
+
top: ((M = D == null ? void 0 : D.top) != null ? M : 0) + S
|
|
1351
1351
|
},
|
|
1352
1352
|
sheetTransform: {
|
|
1353
1353
|
...E,
|
|
@@ -1364,43 +1364,43 @@ let Tt = class extends re {
|
|
|
1364
1364
|
}
|
|
1365
1365
|
};
|
|
1366
1366
|
},
|
|
1367
|
-
isCut: d ===
|
|
1367
|
+
isCut: d === Ie.CUT
|
|
1368
1368
|
});
|
|
1369
1369
|
}
|
|
1370
1370
|
};
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
],
|
|
1378
|
-
var
|
|
1379
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1371
|
+
Et = vs([
|
|
1372
|
+
ze(0, Ii),
|
|
1373
|
+
ze(1, Z),
|
|
1374
|
+
ze(2, re),
|
|
1375
|
+
ze(3, Ei),
|
|
1376
|
+
ze(4, G)
|
|
1377
|
+
], Et);
|
|
1378
|
+
var Rs = Object.getOwnPropertyDescriptor, bs = (i, t, e, n) => {
|
|
1379
|
+
for (var r = n > 1 ? void 0 : n ? Rs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1380
1380
|
(o = i[s]) && (r = o(r) || r);
|
|
1381
1381
|
return r;
|
|
1382
|
-
},
|
|
1383
|
-
let
|
|
1382
|
+
}, Ke = (i, t) => (e, n) => t(e, n, i);
|
|
1383
|
+
let Tt = class extends ne {
|
|
1384
1384
|
constructor(i, t, e, n, r) {
|
|
1385
1385
|
super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1386
1386
|
}
|
|
1387
1387
|
_initDrawingVisible() {
|
|
1388
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1388
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = _t([i, t]);
|
|
1389
1389
|
this.disposeWithMe(
|
|
1390
1390
|
e.pipe(
|
|
1391
|
-
|
|
1392
|
-
|
|
1391
|
+
we(([n, r]) => n ? n.activeSheet$.pipe(
|
|
1392
|
+
Un((s) => {
|
|
1393
1393
|
if (!s) {
|
|
1394
1394
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1395
1395
|
return;
|
|
1396
1396
|
}
|
|
1397
1397
|
const o = n.getUnitId(), a = s.getSheetId();
|
|
1398
1398
|
this._permissionService.composePermission([
|
|
1399
|
-
new
|
|
1400
|
-
new
|
|
1399
|
+
new kn(o).id,
|
|
1400
|
+
new Wn(o, a).id
|
|
1401
1401
|
]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(n, s);
|
|
1402
1402
|
})
|
|
1403
|
-
) : (this._drawingManagerService.setDrawingVisible(!1),
|
|
1403
|
+
) : (this._drawingManagerService.setDrawingVisible(!1), fe))
|
|
1404
1404
|
).subscribe()
|
|
1405
1405
|
);
|
|
1406
1406
|
}
|
|
@@ -1410,26 +1410,26 @@ let Ot = class extends re {
|
|
|
1410
1410
|
if (!a)
|
|
1411
1411
|
return;
|
|
1412
1412
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1413
|
-
u.classType ===
|
|
1413
|
+
u.classType === Pe.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.removeObject(u);
|
|
1414
1414
|
});
|
|
1415
1415
|
}
|
|
1416
1416
|
_initDrawingEditable() {
|
|
1417
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1417
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = _t([i, t]);
|
|
1418
1418
|
this.disposeWithMe(
|
|
1419
1419
|
e.pipe(
|
|
1420
|
-
|
|
1421
|
-
|
|
1420
|
+
we(([n, r]) => n ? n.activeSheet$.pipe(
|
|
1421
|
+
Un((s) => {
|
|
1422
1422
|
if (!s) {
|
|
1423
1423
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1424
1424
|
return;
|
|
1425
1425
|
}
|
|
1426
1426
|
const o = n.getUnitId(), a = s.getSheetId();
|
|
1427
1427
|
this._permissionService.composePermission([
|
|
1428
|
-
new
|
|
1429
|
-
new
|
|
1428
|
+
new zt(o).id,
|
|
1429
|
+
new Kt(o, a).id
|
|
1430
1430
|
]).every((u) => u.value) ? this._drawingManagerService.setDrawingEditable(!0) : this._handleDrawingEditableFalse(n, s);
|
|
1431
1431
|
})
|
|
1432
|
-
) : (this._drawingManagerService.setDrawingEditable(!1),
|
|
1432
|
+
) : (this._drawingManagerService.setDrawingEditable(!1), fe))
|
|
1433
1433
|
).subscribe()
|
|
1434
1434
|
);
|
|
1435
1435
|
}
|
|
@@ -1439,29 +1439,29 @@ let Ot = class extends re {
|
|
|
1439
1439
|
if (!a)
|
|
1440
1440
|
return;
|
|
1441
1441
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1442
|
-
u.classType ===
|
|
1442
|
+
u.classType === Pe.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.detachTransformerFrom(u);
|
|
1443
1443
|
});
|
|
1444
1444
|
}
|
|
1445
1445
|
_initViewPermissionChange() {
|
|
1446
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1446
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1447
1447
|
this.disposeWithMe(
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1448
|
+
_t([i, t]).pipe(
|
|
1449
|
+
we(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1450
|
+
we((r) => {
|
|
1451
1451
|
if (!r)
|
|
1452
|
-
return
|
|
1452
|
+
return fe;
|
|
1453
1453
|
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
|
|
1454
1454
|
if (!d)
|
|
1455
|
-
return
|
|
1455
|
+
return fe;
|
|
1456
1456
|
const u = d.getTransformerByCreate();
|
|
1457
1457
|
return this._permissionService.composePermission$([
|
|
1458
|
-
new
|
|
1459
|
-
new
|
|
1458
|
+
new kn(s).id,
|
|
1459
|
+
new Wn(s, o).id
|
|
1460
1460
|
]).pipe(
|
|
1461
|
-
|
|
1462
|
-
|
|
1461
|
+
be((l) => l.every((g) => g.value)),
|
|
1462
|
+
Pn()
|
|
1463
1463
|
).pipe(
|
|
1464
|
-
|
|
1464
|
+
be((l) => ({
|
|
1465
1465
|
permission: l,
|
|
1466
1466
|
scene: d,
|
|
1467
1467
|
transformer: u,
|
|
@@ -1470,18 +1470,18 @@ let Ot = class extends re {
|
|
|
1470
1470
|
}))
|
|
1471
1471
|
);
|
|
1472
1472
|
})
|
|
1473
|
-
) :
|
|
1473
|
+
) : fe)
|
|
1474
1474
|
).subscribe({
|
|
1475
1475
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1476
1476
|
this._drawingManagerService.setDrawingVisible(e);
|
|
1477
1477
|
const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
|
|
1478
1478
|
e ? this._drawingManagerService.addNotification(u) : (a.forEach((c) => {
|
|
1479
|
-
c.classType ===
|
|
1479
|
+
c.classType === Pe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.removeObject(c);
|
|
1480
1480
|
}), r.clearSelectedObjects());
|
|
1481
1481
|
},
|
|
1482
1482
|
complete: () => {
|
|
1483
1483
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
1484
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
1484
|
+
const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET), n = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getUnitId(), s = n == null ? void 0 : n.getSheetId();
|
|
1485
1485
|
if (!r || !s)
|
|
1486
1486
|
return;
|
|
1487
1487
|
const o = this._drawingManagerService.getDrawingData(r, s), a = Object.values(o);
|
|
@@ -1491,25 +1491,25 @@ let Ot = class extends re {
|
|
|
1491
1491
|
);
|
|
1492
1492
|
}
|
|
1493
1493
|
_initEditPermissionChange() {
|
|
1494
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1494
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1495
1495
|
this.disposeWithMe(
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1496
|
+
_t([i, t]).pipe(
|
|
1497
|
+
we(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1498
|
+
we((r) => {
|
|
1499
1499
|
if (!r)
|
|
1500
|
-
return
|
|
1500
|
+
return fe;
|
|
1501
1501
|
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
|
|
1502
1502
|
if (!d)
|
|
1503
|
-
return
|
|
1503
|
+
return fe;
|
|
1504
1504
|
const u = d.getTransformerByCreate();
|
|
1505
1505
|
return this._permissionService.composePermission$([
|
|
1506
|
-
new
|
|
1507
|
-
new
|
|
1506
|
+
new zt(s).id,
|
|
1507
|
+
new Kt(s, o).id
|
|
1508
1508
|
]).pipe(
|
|
1509
|
-
|
|
1510
|
-
|
|
1509
|
+
be((l) => l.every((g) => g.value)),
|
|
1510
|
+
Pn()
|
|
1511
1511
|
).pipe(
|
|
1512
|
-
|
|
1512
|
+
be((l) => ({
|
|
1513
1513
|
permission: l,
|
|
1514
1514
|
scene: d,
|
|
1515
1515
|
transformer: u,
|
|
@@ -1518,19 +1518,19 @@ let Ot = class extends re {
|
|
|
1518
1518
|
}))
|
|
1519
1519
|
);
|
|
1520
1520
|
})
|
|
1521
|
-
) :
|
|
1521
|
+
) : fe)
|
|
1522
1522
|
).subscribe({
|
|
1523
1523
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1524
1524
|
this._drawingManagerService.setDrawingEditable(e);
|
|
1525
1525
|
const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
|
|
1526
1526
|
e ? (a.forEach((c) => {
|
|
1527
|
-
c.classType ===
|
|
1527
|
+
c.classType === Pe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.attachTransformerTo(c);
|
|
1528
1528
|
}), this._drawingManagerService.addNotification(u)) : (a.forEach((c) => {
|
|
1529
|
-
c.classType ===
|
|
1529
|
+
c.classType === Pe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.detachTransformerFrom(c);
|
|
1530
1530
|
}), r.clearSelectedObjects());
|
|
1531
1531
|
},
|
|
1532
1532
|
complete: () => {
|
|
1533
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
1533
|
+
const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET);
|
|
1534
1534
|
if (!e)
|
|
1535
1535
|
return;
|
|
1536
1536
|
const n = e.getUnitId(), r = e.getActiveSheet();
|
|
@@ -1541,27 +1541,27 @@ let Ot = class extends re {
|
|
|
1541
1541
|
return;
|
|
1542
1542
|
const d = this._drawingManagerService.getDrawingData(n, s), u = Object.values(d);
|
|
1543
1543
|
this._drawingManagerService.setDrawingEditable(!0), a.getAllObjectsByOrder().forEach((l) => {
|
|
1544
|
-
l.classType ===
|
|
1544
|
+
l.classType === Pe.IMAGE && u.some((g) => l.oKey.includes(g.drawingId)) && a.detachTransformerFrom(l);
|
|
1545
1545
|
});
|
|
1546
1546
|
}
|
|
1547
1547
|
})
|
|
1548
1548
|
);
|
|
1549
1549
|
}
|
|
1550
1550
|
};
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
],
|
|
1558
|
-
var
|
|
1559
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1551
|
+
Tt = bs([
|
|
1552
|
+
Ke(0, re),
|
|
1553
|
+
Ke(1, Z),
|
|
1554
|
+
Ke(2, Nr),
|
|
1555
|
+
Ke(3, Se),
|
|
1556
|
+
Ke(4, A(kr))
|
|
1557
|
+
], Tt);
|
|
1558
|
+
var Ms = Object.getOwnPropertyDescriptor, ys = (i, t, e, n) => {
|
|
1559
|
+
for (var r = n > 1 ? void 0 : n ? Ms(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1560
1560
|
(o = i[s]) && (r = o(r) || r);
|
|
1561
1561
|
return r;
|
|
1562
|
-
},
|
|
1563
|
-
function
|
|
1564
|
-
const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(
|
|
1562
|
+
}, Ce = (i, t) => (e, n) => t(e, n, i);
|
|
1563
|
+
function vr(i, t, e, n, r, s = !1) {
|
|
1564
|
+
const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(Gn.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, f = {
|
|
1565
1565
|
left: !0,
|
|
1566
1566
|
// left means the left of pic is in a viewMainLeft
|
|
1567
1567
|
top: !0
|
|
@@ -1571,43 +1571,43 @@ function Dr(i, t, e, n, r, s = !1) {
|
|
|
1571
1571
|
...i,
|
|
1572
1572
|
absolute: f
|
|
1573
1573
|
};
|
|
1574
|
-
const { left: p, right: m, top: _, bottom:
|
|
1575
|
-
let { top: I, left:
|
|
1574
|
+
const { left: p, right: m, top: _, bottom: v } = i;
|
|
1575
|
+
let { top: I, left: R, viewportScrollX: S, viewportScrollY: C } = d;
|
|
1576
1576
|
const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: D, columnHeaderHeight: E } = e, T = {
|
|
1577
1577
|
top: s ? 0 : E,
|
|
1578
1578
|
left: s ? 0 : D
|
|
1579
1579
|
};
|
|
1580
|
-
w && (Re.isDefine(T.top) && (T.top = w.top), Re.isDefine(T.left) && (T.left = w.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (
|
|
1581
|
-
let M = 0,
|
|
1582
|
-
const N = e.rowStartY(l - h) + E,
|
|
1580
|
+
w && (Re.isDefine(T.top) && (T.top = w.top), Re.isDefine(T.left) && (T.left = w.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (S = 0);
|
|
1581
|
+
let M = 0, b = 0;
|
|
1582
|
+
const N = e.rowStartY(l - h) + E, x = e.colStartX(c - g) + D, q = e.rowStartY(l) + E, H = e.colStartX(c) + D;
|
|
1583
1583
|
if (g === 0)
|
|
1584
|
-
f.left = !1, M = (p -
|
|
1584
|
+
f.left = !1, M = (p - S) * o, b = (m - S) * o;
|
|
1585
1585
|
else {
|
|
1586
|
-
const k = p - (
|
|
1587
|
-
m < H ? (M = k * o,
|
|
1586
|
+
const k = p - (x - D), ae = m - (x - D);
|
|
1587
|
+
m < H ? (M = k * o, b = ae * o) : p <= H && m >= H ? (M = k * o, b = Math.max(R, (m - S) * o)) : p > H && (f.left = !1, M = Math.max((p - S) * o, R), b = Math.max((m - S) * o, R));
|
|
1588
1588
|
}
|
|
1589
|
-
let
|
|
1589
|
+
let L = 0, X = 0;
|
|
1590
1590
|
if (h === 0)
|
|
1591
|
-
f.top = !1,
|
|
1591
|
+
f.top = !1, L = (_ - C) * a, X = (v - C) * a;
|
|
1592
1592
|
else {
|
|
1593
|
-
const k = _ - (N - E),
|
|
1594
|
-
|
|
1593
|
+
const k = _ - (N - E), ae = v - (N - E);
|
|
1594
|
+
v < q ? (L = k * a, X = ae * a) : _ <= q && v >= q ? (L = k * a, X = Math.max(I, (v - C) * a)) : _ > q && (f.top = !1, L = Math.max((_ - C) * a, I), X = Math.max((v - C) * a, I));
|
|
1595
1595
|
}
|
|
1596
|
-
return M = Math.max(M, T.left),
|
|
1596
|
+
return M = Math.max(M, T.left), L = Math.max(L, T.top), b = Math.max(b, T.left), X = Math.max(X, T.top), {
|
|
1597
1597
|
left: M,
|
|
1598
|
-
right:
|
|
1599
|
-
top:
|
|
1600
|
-
bottom:
|
|
1598
|
+
right: b,
|
|
1599
|
+
top: L,
|
|
1600
|
+
bottom: X,
|
|
1601
1601
|
absolute: f
|
|
1602
1602
|
};
|
|
1603
1603
|
}
|
|
1604
|
-
const
|
|
1604
|
+
const ge = (i, t, e, n, r) => {
|
|
1605
1605
|
const { left: s, top: o, width: a, height: d, angle: u } = i, c = {
|
|
1606
1606
|
left: s,
|
|
1607
1607
|
right: s + a,
|
|
1608
1608
|
top: o,
|
|
1609
1609
|
bottom: o + d
|
|
1610
|
-
}, l =
|
|
1610
|
+
}, l = vr(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
|
|
1611
1611
|
return {
|
|
1612
1612
|
startX: l.left,
|
|
1613
1613
|
endX: l.right,
|
|
@@ -1619,23 +1619,23 @@ const fe = (i, t, e, n, r) => {
|
|
|
1619
1619
|
absolute: l.absolute
|
|
1620
1620
|
};
|
|
1621
1621
|
};
|
|
1622
|
-
let
|
|
1622
|
+
let et = class extends ne {
|
|
1623
1623
|
constructor(t, e, n, r, s, o, a) {
|
|
1624
1624
|
super();
|
|
1625
1625
|
/**
|
|
1626
1626
|
* for update dom container position when scrolling and zoom
|
|
1627
1627
|
*/
|
|
1628
1628
|
ee(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
1629
|
-
ee(this, "_transformChange$", new
|
|
1629
|
+
ee(this, "_transformChange$", new Gt());
|
|
1630
1630
|
ee(this, "transformChange$", this._transformChange$.asObservable());
|
|
1631
|
-
ee(this, "_add$", new
|
|
1631
|
+
ee(this, "_add$", new Gt());
|
|
1632
1632
|
ee(this, "add$", this._add$.asObservable());
|
|
1633
|
-
ee(this, "_remove$", new
|
|
1633
|
+
ee(this, "_remove$", new Gt());
|
|
1634
1634
|
ee(this, "remove$", this._remove$.asObservable());
|
|
1635
1635
|
this._renderManagerService = t, this._univerInstanceService = e, this._commandService = n, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
1636
1636
|
}
|
|
1637
1637
|
_bindScrollEvent() {
|
|
1638
|
-
this._lifecycleService.lifecycle$.pipe(
|
|
1638
|
+
this._lifecycleService.lifecycle$.pipe(Wi((t) => t === Br.Rendered), Bi(1)).subscribe(() => {
|
|
1639
1639
|
this._scrollUpdateListener();
|
|
1640
1640
|
});
|
|
1641
1641
|
}
|
|
@@ -1661,7 +1661,7 @@ let tt = class extends re {
|
|
|
1661
1661
|
this._drawingManagerService.add$.subscribe((t) => {
|
|
1662
1662
|
t.forEach((e) => {
|
|
1663
1663
|
var K;
|
|
1664
|
-
const { unitId: n, subUnitId: r, drawingId: s } = e, o =
|
|
1664
|
+
const { unitId: n, subUnitId: r, drawingId: s } = e, o = se(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), d = this._univerInstanceService.getUnit(n, F.UNIVER_SHEET);
|
|
1665
1665
|
if (!d)
|
|
1666
1666
|
return;
|
|
1667
1667
|
const u = d.getActiveSheet().getSheetId();
|
|
@@ -1671,7 +1671,7 @@ let tt = class extends re {
|
|
|
1671
1671
|
if (!c)
|
|
1672
1672
|
return;
|
|
1673
1673
|
const { transform: l, drawingType: g, data: h } = a;
|
|
1674
|
-
if (g !==
|
|
1674
|
+
if (g !== B.DRAWING_DOM && g !== B.DRAWING_CHART)
|
|
1675
1675
|
return;
|
|
1676
1676
|
const f = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1677
1677
|
if (f == null)
|
|
@@ -1681,26 +1681,26 @@ let tt = class extends re {
|
|
|
1681
1681
|
return !0;
|
|
1682
1682
|
if (u !== r)
|
|
1683
1683
|
return;
|
|
1684
|
-
const { left: _, top:
|
|
1684
|
+
const { left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D } = l, E = ve({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(E);
|
|
1685
1685
|
if (T != null) {
|
|
1686
|
-
T.transformByState({ left: _, top:
|
|
1686
|
+
T.transformByState({ left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D });
|
|
1687
1687
|
return;
|
|
1688
1688
|
}
|
|
1689
1689
|
const M = {
|
|
1690
1690
|
left: _,
|
|
1691
|
-
top:
|
|
1691
|
+
top: v,
|
|
1692
1692
|
width: I,
|
|
1693
|
-
height:
|
|
1693
|
+
height: R,
|
|
1694
1694
|
zIndex: this._drawingManagerService.getDrawingOrder(n, r).length - 1
|
|
1695
|
-
},
|
|
1696
|
-
if (M.rotateEnabled = !1,
|
|
1695
|
+
}, b = g === B.DRAWING_CHART;
|
|
1696
|
+
if (M.rotateEnabled = !1, b) {
|
|
1697
1697
|
const k = h ? h.backgroundColor : "white";
|
|
1698
1698
|
M.fill = k, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
|
|
1699
1699
|
}
|
|
1700
|
-
const N = new
|
|
1701
|
-
|
|
1702
|
-
const
|
|
1703
|
-
dispose:
|
|
1700
|
+
const N = new Ae(E, M);
|
|
1701
|
+
b && N.setObjectType(Mn.CHART), p.addObject(N, Yt), a.allowTransform !== !1 && p.attachTransformerTo(N);
|
|
1702
|
+
const x = new pt(), q = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet), H = new We(q), L = {
|
|
1703
|
+
dispose: x,
|
|
1704
1704
|
rect: N,
|
|
1705
1705
|
position$: H,
|
|
1706
1706
|
unitId: n,
|
|
@@ -1726,22 +1726,22 @@ let tt = class extends re {
|
|
|
1726
1726
|
data: h,
|
|
1727
1727
|
unitId: n
|
|
1728
1728
|
});
|
|
1729
|
-
const
|
|
1730
|
-
const k =
|
|
1729
|
+
const X = N.onTransformChange$.subscribeEvent(() => {
|
|
1730
|
+
const k = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet);
|
|
1731
1731
|
H.next(
|
|
1732
1732
|
k
|
|
1733
1733
|
);
|
|
1734
1734
|
});
|
|
1735
|
-
|
|
1735
|
+
x.add(() => {
|
|
1736
1736
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
1737
|
-
}),
|
|
1737
|
+
}), X && x.add(X), this._domLayerInfoMap.set(s, L);
|
|
1738
1738
|
});
|
|
1739
1739
|
})
|
|
1740
1740
|
), this.disposeWithMe(
|
|
1741
1741
|
this._drawingManagerService.remove$.subscribe((t) => {
|
|
1742
1742
|
t.forEach((e) => {
|
|
1743
1743
|
var l;
|
|
1744
|
-
const { unitId: n, subUnitId: r, drawingId: s } = e, o =
|
|
1744
|
+
const { unitId: n, subUnitId: r, drawingId: s } = e, o = ve({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1745
1745
|
if (a == null)
|
|
1746
1746
|
return;
|
|
1747
1747
|
const { transformer: d, scene: u } = a, c = u.getObject(o);
|
|
@@ -1753,25 +1753,25 @@ let tt = class extends re {
|
|
|
1753
1753
|
_scrollUpdateListener() {
|
|
1754
1754
|
const t = (e, n) => {
|
|
1755
1755
|
var d;
|
|
1756
|
-
const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o =
|
|
1756
|
+
const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = se(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (d = this._renderManagerService.getRenderById(e)) == null ? void 0 : d.with(V).getSkeletonParam(n);
|
|
1757
1757
|
!r || !o || !a || s.forEach((u) => {
|
|
1758
1758
|
const c = this._domLayerInfoMap.get(u);
|
|
1759
1759
|
if (c) {
|
|
1760
|
-
const l =
|
|
1760
|
+
const l = ge(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
|
|
1761
1761
|
c.position$.next(l);
|
|
1762
1762
|
}
|
|
1763
1763
|
});
|
|
1764
1764
|
};
|
|
1765
1765
|
this.disposeWithMe(
|
|
1766
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1767
|
-
|
|
1768
|
-
|
|
1766
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
|
|
1767
|
+
we((e) => e ? e.activeSheet$ : An(null)),
|
|
1768
|
+
be((e) => {
|
|
1769
1769
|
if (!e) return null;
|
|
1770
1770
|
const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
|
|
1771
1771
|
return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
|
|
1772
1772
|
}),
|
|
1773
|
-
|
|
1774
|
-
(e) => e ?
|
|
1773
|
+
we(
|
|
1774
|
+
(e) => e ? jr(e.render.scene.getViewport(Gn.VIEW_MAIN).onScrollAfter$).pipe(be(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : An(null)
|
|
1775
1775
|
)
|
|
1776
1776
|
).subscribe((e) => {
|
|
1777
1777
|
if (!e) return;
|
|
@@ -1779,12 +1779,12 @@ let tt = class extends re {
|
|
|
1779
1779
|
t(n, r);
|
|
1780
1780
|
})
|
|
1781
1781
|
), this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
1782
|
-
if (e.id ===
|
|
1782
|
+
if (e.id === Tn.id) {
|
|
1783
1783
|
const n = e.params, { unitId: r } = n;
|
|
1784
1784
|
Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
|
|
1785
1785
|
t(r, o);
|
|
1786
1786
|
});
|
|
1787
|
-
} else if (e.id ===
|
|
1787
|
+
} else if (e.id === Fi.id) {
|
|
1788
1788
|
const { unitId: n, subUnitId: r } = e.params;
|
|
1789
1789
|
t(n, r);
|
|
1790
1790
|
}
|
|
@@ -1792,7 +1792,7 @@ let tt = class extends re {
|
|
|
1792
1792
|
}
|
|
1793
1793
|
_getPosition(t, e) {
|
|
1794
1794
|
var g;
|
|
1795
|
-
const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(
|
|
1795
|
+
const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Xe);
|
|
1796
1796
|
if (a == null)
|
|
1797
1797
|
return;
|
|
1798
1798
|
const d = a.getCellWithCoordByOffset(n, s);
|
|
@@ -1822,7 +1822,7 @@ let tt = class extends re {
|
|
|
1822
1822
|
this._drawingManagerService.update$.subscribe((t) => {
|
|
1823
1823
|
t.forEach((e) => {
|
|
1824
1824
|
const n = this._drawingManagerService.getDrawingByParam(e);
|
|
1825
|
-
if (!n || n.drawingType !==
|
|
1825
|
+
if (!n || n.drawingType !== B.DRAWING_DOM && n.drawingType !== B.DRAWING_CHART)
|
|
1826
1826
|
return;
|
|
1827
1827
|
const r = {
|
|
1828
1828
|
...n.transform
|
|
@@ -1844,26 +1844,26 @@ let tt = class extends re {
|
|
|
1844
1844
|
updateFloatDomProps(t, e, n, r) {
|
|
1845
1845
|
const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1846
1846
|
if (s && o) {
|
|
1847
|
-
const { scene: a } = o, d =
|
|
1848
|
-
u && u instanceof
|
|
1847
|
+
const { scene: a } = o, d = ve({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(d);
|
|
1848
|
+
u && u instanceof Ae && u.setProps(r);
|
|
1849
1849
|
}
|
|
1850
1850
|
}
|
|
1851
1851
|
// CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
|
|
1852
1852
|
addFloatDomToPosition(t, e) {
|
|
1853
|
-
const n =
|
|
1853
|
+
const n = se(this._univerInstanceService, {
|
|
1854
1854
|
unitId: t.unitId,
|
|
1855
1855
|
subUnitId: t.subUnitId
|
|
1856
1856
|
});
|
|
1857
1857
|
if (!n)
|
|
1858
1858
|
throw new Error("cannot find current target!");
|
|
1859
|
-
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e :
|
|
1859
|
+
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e : Dt(), l = this._getPosition(o, r);
|
|
1860
1860
|
if (l == null)
|
|
1861
1861
|
return;
|
|
1862
1862
|
const g = {
|
|
1863
1863
|
unitId: r,
|
|
1864
1864
|
subUnitId: s,
|
|
1865
1865
|
drawingId: c,
|
|
1866
|
-
drawingType: t.type ||
|
|
1866
|
+
drawingType: t.type || B.DRAWING_DOM,
|
|
1867
1867
|
componentKey: a,
|
|
1868
1868
|
sheetTransform: l,
|
|
1869
1869
|
transform: {
|
|
@@ -1875,7 +1875,7 @@ let tt = class extends re {
|
|
|
1875
1875
|
data: d,
|
|
1876
1876
|
allowTransform: u
|
|
1877
1877
|
};
|
|
1878
|
-
return this._commandService.executeCommand(
|
|
1878
|
+
return this._commandService.executeCommand(kt.id, {
|
|
1879
1879
|
unitId: r,
|
|
1880
1880
|
drawings: [g]
|
|
1881
1881
|
}), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
|
|
@@ -1903,7 +1903,7 @@ let tt = class extends re {
|
|
|
1903
1903
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
1904
1904
|
addFloatDomToRange(t, e, n, r) {
|
|
1905
1905
|
var C, w, y;
|
|
1906
|
-
const s =
|
|
1906
|
+
const s = se(this._univerInstanceService, {
|
|
1907
1907
|
unitId: e.unitId,
|
|
1908
1908
|
subUnitId: e.subUnitId
|
|
1909
1909
|
});
|
|
@@ -1915,30 +1915,30 @@ let tt = class extends re {
|
|
|
1915
1915
|
if (!u) return;
|
|
1916
1916
|
const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(V).getWorksheetSkeleton(a);
|
|
1917
1917
|
if (!c) return;
|
|
1918
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r :
|
|
1918
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Dt(), { position: p, position$: m } = this._createRangePositionObserver(t, u, c.skeleton);
|
|
1919
1919
|
if (this._getPosition(p, o) == null)
|
|
1920
1920
|
return;
|
|
1921
|
-
const
|
|
1921
|
+
const v = d.scene, { scaleX: I } = v.getAncestorScale(), R = It(p, n, I), S = {
|
|
1922
1922
|
unitId: o,
|
|
1923
1923
|
subUnitId: a,
|
|
1924
1924
|
drawingId: f,
|
|
1925
|
-
drawingType: e.type ||
|
|
1925
|
+
drawingType: e.type || B.DRAWING_DOM,
|
|
1926
1926
|
componentKey: l,
|
|
1927
1927
|
transform: {
|
|
1928
|
-
left:
|
|
1929
|
-
top:
|
|
1930
|
-
width:
|
|
1931
|
-
height:
|
|
1928
|
+
left: R.startX,
|
|
1929
|
+
top: R.startY,
|
|
1930
|
+
width: R.width,
|
|
1931
|
+
height: R.height
|
|
1932
1932
|
},
|
|
1933
1933
|
data: g,
|
|
1934
1934
|
allowTransform: h
|
|
1935
1935
|
};
|
|
1936
1936
|
{
|
|
1937
|
-
const { unitId: D, subUnitId: E, drawingId: T } =
|
|
1937
|
+
const { unitId: D, subUnitId: E, drawingId: T } = S, M = se(this._univerInstanceService, { unitId: D, subUnitId: E }), b = S, N = this._univerInstanceService.getUnit(D, F.UNIVER_SHEET);
|
|
1938
1938
|
if (!N)
|
|
1939
1939
|
return;
|
|
1940
|
-
const
|
|
1941
|
-
if (!
|
|
1940
|
+
const x = N.getActiveSheet().getSheetId();
|
|
1941
|
+
if (!b || !M)
|
|
1942
1942
|
return;
|
|
1943
1943
|
const q = (w = this._renderManagerService.getRenderById(D)) == null ? void 0 : w.with(V);
|
|
1944
1944
|
if (!q)
|
|
@@ -1946,52 +1946,52 @@ let tt = class extends re {
|
|
|
1946
1946
|
const H = q.getWorksheetSkeleton(E);
|
|
1947
1947
|
if (!H)
|
|
1948
1948
|
return;
|
|
1949
|
-
const { transform:
|
|
1950
|
-
if (
|
|
1949
|
+
const { transform: L, drawingType: X, data: K } = b;
|
|
1950
|
+
if (X !== B.DRAWING_DOM && X !== B.DRAWING_CHART)
|
|
1951
1951
|
return;
|
|
1952
1952
|
const k = this._getSceneAndTransformerByDrawingSearch(D);
|
|
1953
1953
|
if (k == null)
|
|
1954
1954
|
return;
|
|
1955
|
-
const { scene:
|
|
1956
|
-
if (
|
|
1955
|
+
const { scene: ae, canvas: Me } = k;
|
|
1956
|
+
if (L == null || x !== E)
|
|
1957
1957
|
return;
|
|
1958
|
-
const { left:
|
|
1959
|
-
if (
|
|
1960
|
-
|
|
1958
|
+
const { left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY: ye } = L, ut = ve({ unitId: D, subUnitId: E, drawingId: T }), de = ae.getObject(ut);
|
|
1959
|
+
if (de != null) {
|
|
1960
|
+
de.transformByState({ left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY: ye });
|
|
1961
1961
|
return;
|
|
1962
1962
|
}
|
|
1963
1963
|
const Q = {
|
|
1964
|
-
left:
|
|
1964
|
+
left: st,
|
|
1965
1965
|
// from floatDomParam.transform
|
|
1966
|
-
top:
|
|
1967
|
-
width:
|
|
1968
|
-
height:
|
|
1966
|
+
top: ot,
|
|
1967
|
+
width: at,
|
|
1968
|
+
height: ct,
|
|
1969
1969
|
zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
|
|
1970
|
-
},
|
|
1971
|
-
if (
|
|
1970
|
+
}, Ee = X === B.DRAWING_CHART;
|
|
1971
|
+
if (Ee) {
|
|
1972
1972
|
const W = K ? K.backgroundColor : "white";
|
|
1973
1973
|
Q.fill = W, Q.rotateEnabled = !1, K && K.border && (Q.stroke = K.border), Q.paintFirst = "stroke", Q.strokeWidth = 1, Q.borderEnabled = !1, Q.radius = 8;
|
|
1974
1974
|
}
|
|
1975
|
-
const
|
|
1976
|
-
|
|
1977
|
-
const
|
|
1978
|
-
top:
|
|
1979
|
-
left:
|
|
1980
|
-
bottom:
|
|
1981
|
-
right:
|
|
1982
|
-
},
|
|
1983
|
-
dispose:
|
|
1984
|
-
rect:
|
|
1985
|
-
boundsOfViewArea:
|
|
1975
|
+
const le = new Ae(ut, Q);
|
|
1976
|
+
Ee && le.setObjectType(Mn.CHART), ae.addObject(le, Yt), b.allowTransform !== !1 && ae.attachTransformerTo(le);
|
|
1977
|
+
const ue = new pt(), ht = ae.getMainViewport(), { rowHeaderWidth: Te, columnHeaderHeight: Ge } = H.skeleton, gt = {
|
|
1978
|
+
top: Ge,
|
|
1979
|
+
left: Te,
|
|
1980
|
+
bottom: ht.bottom,
|
|
1981
|
+
right: ht.right
|
|
1982
|
+
}, he = {
|
|
1983
|
+
dispose: ue,
|
|
1984
|
+
rect: le,
|
|
1985
|
+
boundsOfViewArea: gt,
|
|
1986
1986
|
domAnchor: n,
|
|
1987
1987
|
unitId: D,
|
|
1988
1988
|
subUnitId: E
|
|
1989
|
-
},
|
|
1990
|
-
|
|
1991
|
-
let
|
|
1992
|
-
position$:
|
|
1989
|
+
}, j = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he), Oe = new We(j);
|
|
1990
|
+
he.position$ = Oe;
|
|
1991
|
+
let Le = {
|
|
1992
|
+
position$: Oe,
|
|
1993
1993
|
id: T,
|
|
1994
|
-
componentKey:
|
|
1994
|
+
componentKey: b.componentKey,
|
|
1995
1995
|
onPointerDown: () => {
|
|
1996
1996
|
},
|
|
1997
1997
|
onPointerMove: () => {
|
|
@@ -1999,57 +1999,57 @@ let tt = class extends re {
|
|
|
1999
1999
|
onPointerUp: () => {
|
|
2000
2000
|
},
|
|
2001
2001
|
onWheel: (W) => {
|
|
2002
|
-
|
|
2002
|
+
Me.dispatchEvent(new WheelEvent(W.type, W));
|
|
2003
2003
|
},
|
|
2004
2004
|
data: K,
|
|
2005
2005
|
unitId: D
|
|
2006
2006
|
};
|
|
2007
|
-
e.eventPassThrough && (
|
|
2008
|
-
...
|
|
2007
|
+
e.eventPassThrough && (Le = {
|
|
2008
|
+
...Le,
|
|
2009
2009
|
onPointerDown: (W) => {
|
|
2010
|
-
|
|
2010
|
+
Me.dispatchEvent(new PointerEvent(W.type, W));
|
|
2011
2011
|
},
|
|
2012
2012
|
onPointerMove: (W) => {
|
|
2013
|
-
|
|
2013
|
+
Me.dispatchEvent(new PointerEvent(W.type, W));
|
|
2014
2014
|
},
|
|
2015
2015
|
onPointerUp: (W) => {
|
|
2016
|
-
|
|
2016
|
+
Me.dispatchEvent(new PointerEvent(W.type, W));
|
|
2017
2017
|
}
|
|
2018
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2019
|
-
var hn, gn, fn
|
|
2020
|
-
const
|
|
2018
|
+
}), this._canvasFloatDomService.addFloatDom(Le), this.disposeWithMe(m.subscribe((W) => {
|
|
2019
|
+
var un, hn, gn, fn;
|
|
2020
|
+
const ln = It({
|
|
2021
2021
|
startX: W.startX,
|
|
2022
2022
|
startY: W.startY,
|
|
2023
2023
|
endX: W.endX,
|
|
2024
2024
|
endY: W.endY,
|
|
2025
|
-
width: (
|
|
2026
|
-
height: (
|
|
2025
|
+
width: (un = n.width) != null ? un : W.width,
|
|
2026
|
+
height: (hn = n.height) != null ? hn : W.height,
|
|
2027
2027
|
absolute: {
|
|
2028
2028
|
left: p.absolute.left,
|
|
2029
2029
|
top: p.absolute.top
|
|
2030
2030
|
}
|
|
2031
|
-
}, n),
|
|
2032
|
-
left:
|
|
2033
|
-
top:
|
|
2034
|
-
width: (
|
|
2035
|
-
height: (
|
|
2031
|
+
}, n), Rr = ve({ unitId: D, subUnitId: E, drawingId: T }), br = new Ae(Rr, {
|
|
2032
|
+
left: ln.startX,
|
|
2033
|
+
top: ln.startY,
|
|
2034
|
+
width: (gn = n.width) != null ? gn : W.width,
|
|
2035
|
+
height: (fn = n.height) != null ? fn : W.height,
|
|
2036
2036
|
zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
|
|
2037
|
-
}),
|
|
2038
|
-
|
|
2037
|
+
}), Mr = ge(br, k.renderUnit.scene, H.skeleton, M.worksheet, he);
|
|
2038
|
+
Oe.next(Mr);
|
|
2039
2039
|
}));
|
|
2040
|
-
const
|
|
2041
|
-
|
|
2040
|
+
const Ve = (y = this._renderManagerService.getRenderById(D)) == null ? void 0 : y.with(V);
|
|
2041
|
+
Ve == null || Ve.currentSkeleton$.subscribe((W) => {
|
|
2042
2042
|
W && H.sheetId !== W.sheetId && this._removeDom(f, !0);
|
|
2043
2043
|
});
|
|
2044
|
-
const
|
|
2045
|
-
const W =
|
|
2046
|
-
|
|
2044
|
+
const ft = le.onTransformChange$.subscribeEvent(() => {
|
|
2045
|
+
const W = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he);
|
|
2046
|
+
Oe.next(
|
|
2047
2047
|
W
|
|
2048
2048
|
);
|
|
2049
2049
|
});
|
|
2050
|
-
|
|
2050
|
+
ue.add(() => {
|
|
2051
2051
|
this._canvasFloatDomService.removeFloatDom(T);
|
|
2052
|
-
}),
|
|
2052
|
+
}), ft && ue.add(ft), this._domLayerInfoMap.set(T, he);
|
|
2053
2053
|
}
|
|
2054
2054
|
return {
|
|
2055
2055
|
id: f,
|
|
@@ -2060,8 +2060,8 @@ let tt = class extends re {
|
|
|
2060
2060
|
}
|
|
2061
2061
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
2062
2062
|
addFloatDomToColumnHeader(t, e, n, r) {
|
|
2063
|
-
var
|
|
2064
|
-
const s =
|
|
2063
|
+
var R, S, C;
|
|
2064
|
+
const s = se(this._univerInstanceService, {
|
|
2065
2065
|
unitId: e.unitId,
|
|
2066
2066
|
subUnitId: e.subUnitId
|
|
2067
2067
|
});
|
|
@@ -2071,9 +2071,9 @@ let tt = class extends re {
|
|
|
2071
2071
|
if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
|
|
2072
2072
|
const u = this._renderManagerService.getRenderById(o);
|
|
2073
2073
|
if (!u) return;
|
|
2074
|
-
const c = (
|
|
2074
|
+
const c = (R = this._renderManagerService.getRenderById(o)) == null ? void 0 : R.with(V).getWorksheetSkeleton(a);
|
|
2075
2075
|
if (!c) return;
|
|
2076
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r :
|
|
2076
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Dt(), { position: p, position$: m } = this._createRangePositionObserver({
|
|
2077
2077
|
startRow: 0,
|
|
2078
2078
|
endRow: 0,
|
|
2079
2079
|
startColumn: t,
|
|
@@ -2085,7 +2085,7 @@ let tt = class extends re {
|
|
|
2085
2085
|
unitId: o,
|
|
2086
2086
|
subUnitId: a,
|
|
2087
2087
|
drawingId: f,
|
|
2088
|
-
drawingType: e.type ||
|
|
2088
|
+
drawingType: e.type || B.DRAWING_DOM,
|
|
2089
2089
|
componentKey: l,
|
|
2090
2090
|
transform: {
|
|
2091
2091
|
left: _.startX,
|
|
@@ -2097,30 +2097,30 @@ let tt = class extends re {
|
|
|
2097
2097
|
allowTransform: h
|
|
2098
2098
|
};
|
|
2099
2099
|
{
|
|
2100
|
-
const { unitId: w, subUnitId: y, drawingId: D } = I, E =
|
|
2100
|
+
const { unitId: w, subUnitId: y, drawingId: D } = I, E = se(this._univerInstanceService, { unitId: w, subUnitId: y }), T = I, M = this._univerInstanceService.getUnit(w, F.UNIVER_SHEET);
|
|
2101
2101
|
if (!M)
|
|
2102
2102
|
return;
|
|
2103
|
-
const
|
|
2103
|
+
const b = M.getActiveSheet().getSheetId();
|
|
2104
2104
|
if (!T || !E)
|
|
2105
2105
|
return;
|
|
2106
|
-
const N = (
|
|
2106
|
+
const N = (S = this._renderManagerService.getRenderById(w)) == null ? void 0 : S.with(V);
|
|
2107
2107
|
if (!N)
|
|
2108
2108
|
return;
|
|
2109
|
-
const
|
|
2110
|
-
if (!
|
|
2109
|
+
const x = N.getWorksheetSkeleton(y);
|
|
2110
|
+
if (!x)
|
|
2111
2111
|
return;
|
|
2112
|
-
const { transform: q, data: H } = T,
|
|
2113
|
-
if (
|
|
2112
|
+
const { transform: q, data: H } = T, L = this._getSceneAndTransformerByDrawingSearch(w);
|
|
2113
|
+
if (L == null)
|
|
2114
2114
|
return;
|
|
2115
|
-
const { scene:
|
|
2116
|
-
if (q == null ||
|
|
2115
|
+
const { scene: X, canvas: K } = L;
|
|
2116
|
+
if (q == null || b !== y)
|
|
2117
2117
|
return;
|
|
2118
|
-
const { left: k, top:
|
|
2119
|
-
if (
|
|
2120
|
-
|
|
2118
|
+
const { left: k, top: ae, width: Me, height: st, angle: ot, flipX: at, flipY: ct, skewX: jt, skewY: $t } = q, dt = ve({ unitId: w, subUnitId: y, drawingId: D }), lt = X.getObject(dt);
|
|
2119
|
+
if (lt != null) {
|
|
2120
|
+
lt.transformByState({ left: k, top: ae, width: Me, height: st, angle: ot, flipX: at, flipY: ct, skewX: jt, skewY: $t });
|
|
2121
2121
|
return;
|
|
2122
2122
|
}
|
|
2123
|
-
const
|
|
2123
|
+
const ye = It({
|
|
2124
2124
|
startX: _.startX,
|
|
2125
2125
|
startY: 0,
|
|
2126
2126
|
endX: p.endX,
|
|
@@ -2131,34 +2131,34 @@ let tt = class extends re {
|
|
|
2131
2131
|
left: p.absolute.left,
|
|
2132
2132
|
top: p.absolute.top
|
|
2133
2133
|
}
|
|
2134
|
-
}, n),
|
|
2135
|
-
left:
|
|
2136
|
-
top:
|
|
2137
|
-
width:
|
|
2138
|
-
height:
|
|
2134
|
+
}, n), ut = {
|
|
2135
|
+
left: ye.startX,
|
|
2136
|
+
top: ye.startY,
|
|
2137
|
+
width: ye.width,
|
|
2138
|
+
height: ye.height,
|
|
2139
2139
|
zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
|
|
2140
|
-
},
|
|
2141
|
-
|
|
2142
|
-
const Q = new
|
|
2140
|
+
}, de = new Ae(dt, ut);
|
|
2141
|
+
X.addObject(de, Yt), T.allowTransform !== !1 && X.attachTransformerTo(de);
|
|
2142
|
+
const Q = new pt(), Ee = X.getMainViewport(), le = {
|
|
2143
2143
|
top: 0,
|
|
2144
2144
|
//viewMain.top,
|
|
2145
|
-
left:
|
|
2146
|
-
bottom:
|
|
2147
|
-
right:
|
|
2148
|
-
},
|
|
2145
|
+
left: Ee.left,
|
|
2146
|
+
bottom: Ee.bottom,
|
|
2147
|
+
right: Ee.right
|
|
2148
|
+
}, ue = {
|
|
2149
2149
|
dispose: Q,
|
|
2150
|
-
rect:
|
|
2150
|
+
rect: de,
|
|
2151
2151
|
// position$,
|
|
2152
2152
|
unitId: w,
|
|
2153
2153
|
subUnitId: y,
|
|
2154
|
-
boundsOfViewArea:
|
|
2154
|
+
boundsOfViewArea: le,
|
|
2155
2155
|
domAnchor: n,
|
|
2156
2156
|
scrollDirectionResponse: "HORIZONTAL"
|
|
2157
2157
|
/* HORIZONTAL */
|
|
2158
|
-
},
|
|
2159
|
-
|
|
2160
|
-
let
|
|
2161
|
-
position$:
|
|
2158
|
+
}, ht = ge(de, L.renderUnit.scene, x.skeleton, E.worksheet, ue), Te = new We(ht);
|
|
2159
|
+
ue.position$ = Te;
|
|
2160
|
+
let Ge = {
|
|
2161
|
+
position$: Te,
|
|
2162
2162
|
id: D,
|
|
2163
2163
|
componentKey: T.componentKey,
|
|
2164
2164
|
onPointerDown: () => {
|
|
@@ -2167,57 +2167,57 @@ let tt = class extends re {
|
|
|
2167
2167
|
},
|
|
2168
2168
|
onPointerUp: () => {
|
|
2169
2169
|
},
|
|
2170
|
-
onWheel: (
|
|
2171
|
-
K.dispatchEvent(new WheelEvent(
|
|
2170
|
+
onWheel: (j) => {
|
|
2171
|
+
K.dispatchEvent(new WheelEvent(j.type, j));
|
|
2172
2172
|
},
|
|
2173
2173
|
data: H,
|
|
2174
2174
|
unitId: w
|
|
2175
2175
|
};
|
|
2176
|
-
e.eventPassThrough && (
|
|
2177
|
-
...
|
|
2178
|
-
onPointerDown: (
|
|
2179
|
-
K.dispatchEvent(new PointerEvent(
|
|
2176
|
+
e.eventPassThrough && (Ge = {
|
|
2177
|
+
...Ge,
|
|
2178
|
+
onPointerDown: (j) => {
|
|
2179
|
+
K.dispatchEvent(new PointerEvent(j.type, j));
|
|
2180
2180
|
},
|
|
2181
|
-
onPointerMove: (
|
|
2182
|
-
K.dispatchEvent(new PointerEvent(
|
|
2181
|
+
onPointerMove: (j) => {
|
|
2182
|
+
K.dispatchEvent(new PointerEvent(j.type, j));
|
|
2183
2183
|
},
|
|
2184
|
-
onPointerUp: (
|
|
2185
|
-
K.dispatchEvent(new PointerEvent(
|
|
2184
|
+
onPointerUp: (j) => {
|
|
2185
|
+
K.dispatchEvent(new PointerEvent(j.type, j));
|
|
2186
2186
|
}
|
|
2187
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2188
|
-
const
|
|
2189
|
-
const
|
|
2190
|
-
|
|
2191
|
-
|
|
2187
|
+
}), this._canvasFloatDomService.addFloatDom(Ge);
|
|
2188
|
+
const gt = de.onTransformChange$.subscribeEvent(() => {
|
|
2189
|
+
const j = ge(de, L.renderUnit.scene, x.skeleton, E.worksheet, ue);
|
|
2190
|
+
Te.next(
|
|
2191
|
+
j
|
|
2192
2192
|
);
|
|
2193
2193
|
});
|
|
2194
|
-
this.disposeWithMe(m.subscribe((
|
|
2195
|
-
const
|
|
2196
|
-
startX:
|
|
2194
|
+
this.disposeWithMe(m.subscribe((j) => {
|
|
2195
|
+
const Oe = It({
|
|
2196
|
+
startX: j.startX,
|
|
2197
2197
|
startY: 0,
|
|
2198
|
-
endX:
|
|
2199
|
-
endY:
|
|
2198
|
+
endX: j.endX,
|
|
2199
|
+
endY: j.endY,
|
|
2200
2200
|
width: n.width,
|
|
2201
2201
|
height: n.height,
|
|
2202
2202
|
absolute: {
|
|
2203
2203
|
left: p.absolute.left,
|
|
2204
2204
|
top: p.absolute.top
|
|
2205
2205
|
}
|
|
2206
|
-
}, n),
|
|
2207
|
-
left:
|
|
2206
|
+
}, n), Le = ve({ unitId: w, subUnitId: y, drawingId: D }), Ve = new Ae(Le, {
|
|
2207
|
+
left: Oe.startX,
|
|
2208
2208
|
top: 0,
|
|
2209
2209
|
width: n.width,
|
|
2210
2210
|
height: n.height,
|
|
2211
2211
|
zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
|
|
2212
|
-
}),
|
|
2213
|
-
|
|
2212
|
+
}), ft = ge(Ve, L.renderUnit.scene, x.skeleton, E.worksheet, ue);
|
|
2213
|
+
Te.next(ft);
|
|
2214
2214
|
}));
|
|
2215
|
-
const
|
|
2216
|
-
|
|
2217
|
-
|
|
2215
|
+
const he = (C = this._renderManagerService.getRenderById(w)) == null ? void 0 : C.with(V);
|
|
2216
|
+
he == null || he.currentSkeleton$.subscribe((j) => {
|
|
2217
|
+
j && c.sheetId !== j.sheetId && this._removeDom(f, !0);
|
|
2218
2218
|
}), Q.add(() => {
|
|
2219
2219
|
this._canvasFloatDomService.removeFloatDom(D);
|
|
2220
|
-
}),
|
|
2220
|
+
}), gt && Q.add(gt), this._domLayerInfoMap.set(D, ue);
|
|
2221
2221
|
}
|
|
2222
2222
|
return {
|
|
2223
2223
|
id: f,
|
|
@@ -2239,16 +2239,16 @@ let tt = class extends re {
|
|
|
2239
2239
|
// eslint-disable-next-line max-lines-per-function
|
|
2240
2240
|
_createRangePositionObserver(t, e, n) {
|
|
2241
2241
|
let { startRow: r, startColumn: s } = t;
|
|
2242
|
-
const o = Je(r, s, n), a = new
|
|
2242
|
+
const o = Je(r, s, n), a = new We(o), d = Je(t.endRow, t.endColumn, n), u = new We(d), c = () => {
|
|
2243
2243
|
const m = Je(r, s, n), _ = Je(t.endRow, t.endColumn, n);
|
|
2244
2244
|
a.next(m), u.next(_);
|
|
2245
|
-
}, l = new
|
|
2245
|
+
}, l = new pt();
|
|
2246
2246
|
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((m) => {
|
|
2247
|
-
if (m.id ===
|
|
2247
|
+
if (m.id === xi.id && m.params.rowsAutoHeightInfo.findIndex((v) => v.row === r) > -1) {
|
|
2248
2248
|
c();
|
|
2249
2249
|
return;
|
|
2250
2250
|
}
|
|
2251
|
-
(
|
|
2251
|
+
(Yi.indexOf(m.id) > -1 || m.id === Ci.id || m.id === Tn.id) && c();
|
|
2252
2252
|
}));
|
|
2253
2253
|
const g = (m, _) => {
|
|
2254
2254
|
r = m, s = _, c();
|
|
@@ -2265,7 +2265,7 @@ let tt = class extends re {
|
|
|
2265
2265
|
endX: d.right,
|
|
2266
2266
|
endY: d.bottom
|
|
2267
2267
|
}), f = a.pipe(
|
|
2268
|
-
|
|
2268
|
+
be((m) => {
|
|
2269
2269
|
const _ = Je(t.endRow, t.endColumn, n);
|
|
2270
2270
|
return {
|
|
2271
2271
|
rotate: 0,
|
|
@@ -2292,15 +2292,15 @@ let tt = class extends re {
|
|
|
2292
2292
|
};
|
|
2293
2293
|
}
|
|
2294
2294
|
};
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
],
|
|
2295
|
+
et = ys([
|
|
2296
|
+
Ce(0, A(Z)),
|
|
2297
|
+
Ce(1, Se),
|
|
2298
|
+
Ce(2, A(G)),
|
|
2299
|
+
Ce(3, re),
|
|
2300
|
+
Ce(4, A(Ti)),
|
|
2301
|
+
Ce(5, ie),
|
|
2302
|
+
Ce(6, A(Wr))
|
|
2303
|
+
], et);
|
|
2304
2304
|
function Je(i, t, e) {
|
|
2305
2305
|
const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
|
|
2306
2306
|
return {
|
|
@@ -2310,22 +2310,22 @@ function Je(i, t, e) {
|
|
|
2310
2310
|
bottom: r.endY
|
|
2311
2311
|
};
|
|
2312
2312
|
}
|
|
2313
|
-
function
|
|
2313
|
+
function It(i, t, e) {
|
|
2314
2314
|
var u, c;
|
|
2315
2315
|
e = e != null ? e : 1;
|
|
2316
2316
|
const n = i.endX - i.startX, r = i.endY - i.startY, s = (u = t == null ? void 0 : t.width) != null ? u : n, o = (c = t == null ? void 0 : t.height) != null ? c : r;
|
|
2317
2317
|
let a = 0, d = 0;
|
|
2318
2318
|
if (t) {
|
|
2319
2319
|
if (t.horizonOffsetAlign === "right") {
|
|
2320
|
-
const l =
|
|
2320
|
+
const l = Ct(t.marginX, n * e);
|
|
2321
2321
|
a = i.endX - l - s;
|
|
2322
2322
|
} else
|
|
2323
|
-
a = i.startX +
|
|
2323
|
+
a = i.startX + Ct(t.marginX, n);
|
|
2324
2324
|
if (t.verticalOffsetAlign === "bottom") {
|
|
2325
|
-
const l =
|
|
2325
|
+
const l = Ct(t.marginY, r * e);
|
|
2326
2326
|
d = i.endY - l - o;
|
|
2327
2327
|
} else
|
|
2328
|
-
d = i.startY +
|
|
2328
|
+
d = i.startY + Ct(t.marginY, r);
|
|
2329
2329
|
}
|
|
2330
2330
|
return {
|
|
2331
2331
|
rotate: 0,
|
|
@@ -2341,15 +2341,15 @@ function Ct(i, t, e) {
|
|
|
2341
2341
|
}
|
|
2342
2342
|
};
|
|
2343
2343
|
}
|
|
2344
|
-
function
|
|
2344
|
+
function Ct(i, t) {
|
|
2345
2345
|
if (i === void 0) return 0;
|
|
2346
2346
|
if (typeof i == "number") return i;
|
|
2347
2347
|
const e = Number.parseFloat(i);
|
|
2348
2348
|
return t * e / 100;
|
|
2349
2349
|
}
|
|
2350
|
-
const
|
|
2351
|
-
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s =
|
|
2352
|
-
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g =
|
|
2350
|
+
const Es = (i) => {
|
|
2351
|
+
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = Qi(() => t.map((o) => {
|
|
2352
|
+
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = vr(
|
|
2353
2353
|
{
|
|
2354
2354
|
left: c != null ? c : 0,
|
|
2355
2355
|
right: (c != null ? c : 0) + (a != null ? a : 0),
|
|
@@ -2371,7 +2371,7 @@ const Ws = (i) => {
|
|
|
2371
2371
|
height: d * f,
|
|
2372
2372
|
absolute: g.absolute
|
|
2373
2373
|
}, m = {
|
|
2374
|
-
position$: new
|
|
2374
|
+
position$: new We(p),
|
|
2375
2375
|
position: p,
|
|
2376
2376
|
id: o.drawingId,
|
|
2377
2377
|
componentKey: o.componentKey,
|
|
@@ -2388,14 +2388,14 @@ const Ws = (i) => {
|
|
|
2388
2388
|
};
|
|
2389
2389
|
return [o.drawingId, m];
|
|
2390
2390
|
}), [t, e, n, r]);
|
|
2391
|
-
return /* @__PURE__ */
|
|
2391
|
+
return /* @__PURE__ */ oe("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ oe(Oi, { layer: a, id: o, position: a.position }, o)) });
|
|
2392
2392
|
};
|
|
2393
|
-
var
|
|
2394
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2393
|
+
var Ts = Object.getOwnPropertyDescriptor, Os = (i, t, e, n) => {
|
|
2394
|
+
for (var r = n > 1 ? void 0 : n ? Ts(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2395
2395
|
(o = i[s]) && (r = o(r) || r);
|
|
2396
2396
|
return r;
|
|
2397
|
-
},
|
|
2398
|
-
let
|
|
2397
|
+
}, De = (i, t) => (e, n) => t(e, n, i);
|
|
2398
|
+
let Ot = class extends ne {
|
|
2399
2399
|
constructor(i, t, e, n, r, s, o) {
|
|
2400
2400
|
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = t, this._drawingManagerService = e, this._renderManagerService = n, this._canvasFloatDomManagerService = r, this._componetManager = s, this._injector = o, this._initPrinting(), this._initPrintingDom();
|
|
2401
2401
|
}
|
|
@@ -2408,7 +2408,7 @@ let Ut = class extends re {
|
|
|
2408
2408
|
const { unitId: n, scene: r, subUnitId: s } = t, o = this._drawingManagerService.getDrawingDataForUnit(n), a = o == null ? void 0 : o[s];
|
|
2409
2409
|
return a && a.order.forEach((d) => {
|
|
2410
2410
|
const u = a.data[d];
|
|
2411
|
-
u.drawingType !==
|
|
2411
|
+
u.drawingType !== B.DRAWING_CHART && u.drawingType !== B.DRAWING_DOM && this._drawingRenderService.renderDrawing(u, r);
|
|
2412
2412
|
}), e();
|
|
2413
2413
|
}
|
|
2414
2414
|
}
|
|
@@ -2449,12 +2449,12 @@ let Ut = class extends re {
|
|
|
2449
2449
|
if (o) {
|
|
2450
2450
|
const a = o.order.map((u) => {
|
|
2451
2451
|
const c = o.data[u];
|
|
2452
|
-
if (c.drawingType ===
|
|
2452
|
+
if (c.drawingType === B.DRAWING_CHART)
|
|
2453
2453
|
return {
|
|
2454
2454
|
...c,
|
|
2455
|
-
componentKey: this._componetManager.get(
|
|
2455
|
+
componentKey: this._componetManager.get($r)
|
|
2456
2456
|
};
|
|
2457
|
-
if (c.drawingType ===
|
|
2457
|
+
if (c.drawingType === B.DRAWING_DOM) {
|
|
2458
2458
|
const l = this._sheetPrintInterceptorService.getPrintComponent(c.componentKey);
|
|
2459
2459
|
return {
|
|
2460
2460
|
...c,
|
|
@@ -2462,12 +2462,12 @@ let Ut = class extends re {
|
|
|
2462
2462
|
};
|
|
2463
2463
|
}
|
|
2464
2464
|
return null;
|
|
2465
|
-
}).filter(Boolean), d =
|
|
2466
|
-
return
|
|
2467
|
-
/* @__PURE__ */
|
|
2465
|
+
}).filter(Boolean), d = Ui(Es, this._injector);
|
|
2466
|
+
return li(
|
|
2467
|
+
/* @__PURE__ */ oe(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
|
|
2468
2468
|
t.root
|
|
2469
2469
|
), i == null || i.add(() => {
|
|
2470
|
-
|
|
2470
|
+
ui(t.root);
|
|
2471
2471
|
}), e(i);
|
|
2472
2472
|
}
|
|
2473
2473
|
}
|
|
@@ -2476,31 +2476,32 @@ let Ut = class extends re {
|
|
|
2476
2476
|
);
|
|
2477
2477
|
}
|
|
2478
2478
|
};
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
],
|
|
2488
|
-
var
|
|
2489
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2479
|
+
Ot = Os([
|
|
2480
|
+
De(0, A(Di)),
|
|
2481
|
+
De(1, A(Xn)),
|
|
2482
|
+
De(2, re),
|
|
2483
|
+
De(3, Z),
|
|
2484
|
+
De(4, A(et)),
|
|
2485
|
+
De(5, A(Hn)),
|
|
2486
|
+
De(6, A(Ye))
|
|
2487
|
+
], Ot);
|
|
2488
|
+
var Us = Object.getOwnPropertyDescriptor, Ps = (i, t, e, n) => {
|
|
2489
|
+
for (var r = n > 1 ? void 0 : n ? Us(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2490
2490
|
(o = i[s]) && (r = o(r) || r);
|
|
2491
2491
|
return r;
|
|
2492
|
-
},
|
|
2493
|
-
const
|
|
2492
|
+
}, me = (i, t) => (e, n) => t(e, n, i);
|
|
2493
|
+
const As = [
|
|
2494
|
+
zn.id,
|
|
2494
2495
|
Kn.id,
|
|
2495
|
-
Zn.id,
|
|
2496
2496
|
Jn.id,
|
|
2497
|
+
Zn.id,
|
|
2497
2498
|
qn.id,
|
|
2498
2499
|
Qn.id,
|
|
2499
2500
|
er.id,
|
|
2500
2501
|
tr.id,
|
|
2501
|
-
nr.id,
|
|
2502
2502
|
Jt.id,
|
|
2503
|
-
|
|
2503
|
+
Zt.id,
|
|
2504
|
+
nr.id,
|
|
2504
2505
|
rr.id,
|
|
2505
2506
|
ir.id,
|
|
2506
2507
|
sr.id,
|
|
@@ -2508,17 +2509,16 @@ const Fs = [
|
|
|
2508
2509
|
ar.id,
|
|
2509
2510
|
cr.id,
|
|
2510
2511
|
dr.id,
|
|
2511
|
-
lr.id
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
ts.id
|
|
2512
|
+
lr.id
|
|
2513
|
+
], Ns = [
|
|
2514
|
+
Xi.id,
|
|
2515
|
+
Gi.id,
|
|
2516
|
+
Li.id,
|
|
2517
|
+
Vi.id,
|
|
2518
|
+
Hi.id,
|
|
2519
|
+
zi.id
|
|
2520
2520
|
];
|
|
2521
|
-
let
|
|
2521
|
+
let rn = class extends ne {
|
|
2522
2522
|
constructor(i, t, e, n, r, s, o, a, d) {
|
|
2523
2523
|
super(), this._context = i, this._renderManagerService = t, this._commandService = e, this._selectionRenderService = n, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService = d, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
|
|
2524
2524
|
}
|
|
@@ -2526,57 +2526,57 @@ let sn = class extends re {
|
|
|
2526
2526
|
this.disposeWithMe(
|
|
2527
2527
|
this._sheetInterceptorService.interceptCommand({
|
|
2528
2528
|
getMutations: (i) => {
|
|
2529
|
-
if (!
|
|
2529
|
+
if (!As.includes(i.id))
|
|
2530
2530
|
return { redos: [], undos: [] };
|
|
2531
2531
|
if (i.params == null)
|
|
2532
2532
|
return { redos: [], undos: [] };
|
|
2533
2533
|
const t = i.id;
|
|
2534
|
-
if (t ===
|
|
2534
|
+
if (t === zn.id)
|
|
2535
2535
|
return this._moveRowInterceptor(i.params, "insert");
|
|
2536
|
-
if ([
|
|
2536
|
+
if ([cr.id, dr.id, lr.id].includes(t))
|
|
2537
2537
|
return this._moveRangeInterceptor(i.params);
|
|
2538
|
-
if (t ===
|
|
2538
|
+
if (t === Kn.id)
|
|
2539
2539
|
return this._moveColInterceptor(i.params, "insert");
|
|
2540
2540
|
if (t === Jn.id)
|
|
2541
2541
|
return this._moveRowInterceptor(i.params, "remove");
|
|
2542
|
-
if (t ===
|
|
2542
|
+
if (t === Zn.id)
|
|
2543
2543
|
return this._moveColInterceptor(i.params, "remove");
|
|
2544
|
-
if (t ===
|
|
2544
|
+
if (t === qn.id) {
|
|
2545
2545
|
const { range: e } = i.params;
|
|
2546
2546
|
return this._getRangeMoveUndo(
|
|
2547
2547
|
e,
|
|
2548
2548
|
0
|
|
2549
2549
|
/* deleteLeft */
|
|
2550
2550
|
);
|
|
2551
|
-
} else if (t ===
|
|
2551
|
+
} else if (t === Qn.id) {
|
|
2552
2552
|
const { range: e } = i.params;
|
|
2553
2553
|
return this._getRangeMoveUndo(
|
|
2554
2554
|
e,
|
|
2555
2555
|
1
|
|
2556
2556
|
/* deleteUp */
|
|
2557
2557
|
);
|
|
2558
|
-
} else if (t ===
|
|
2558
|
+
} else if (t === er.id) {
|
|
2559
2559
|
const { range: e } = i.params;
|
|
2560
2560
|
return this._getRangeMoveUndo(
|
|
2561
2561
|
e,
|
|
2562
2562
|
2
|
|
2563
2563
|
/* insertDown */
|
|
2564
2564
|
);
|
|
2565
|
-
} else if (t ===
|
|
2565
|
+
} else if (t === tr.id) {
|
|
2566
2566
|
const { range: e } = i.params;
|
|
2567
2567
|
return this._getRangeMoveUndo(
|
|
2568
2568
|
e,
|
|
2569
2569
|
3
|
|
2570
2570
|
/* insertRight */
|
|
2571
2571
|
);
|
|
2572
|
-
} else if (t ===
|
|
2572
|
+
} else if (t === ir.id || t === sr.id) {
|
|
2573
2573
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2574
2574
|
return this._getDrawingUndoForRowVisible(n, r, s);
|
|
2575
|
-
} else if (t ===
|
|
2575
|
+
} else if (t === or.id || t === ar.id) {
|
|
2576
2576
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2577
2577
|
return this._getDrawingUndoForColVisible(n, r, s);
|
|
2578
|
-
} else if (t === Jt.id || t ===
|
|
2579
|
-
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === Jt.id || t ===
|
|
2578
|
+
} else if (t === Jt.id || t === Zt.id || t === nr.id || t === rr.id) {
|
|
2579
|
+
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === Jt.id || t === Zt.id;
|
|
2580
2580
|
return this._getDrawingUndoForRowAndColSize(n, r, s, o);
|
|
2581
2581
|
}
|
|
2582
2582
|
return { redos: [], undos: [] };
|
|
@@ -2585,7 +2585,7 @@ let sn = class extends re {
|
|
|
2585
2585
|
);
|
|
2586
2586
|
}
|
|
2587
2587
|
_getRangeMoveUndo(i, t) {
|
|
2588
|
-
const e =
|
|
2588
|
+
const e = se(this._univerInstanceService);
|
|
2589
2589
|
if (e == null)
|
|
2590
2590
|
return { redos: [], undos: [] };
|
|
2591
2591
|
const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r), d = [], u = [];
|
|
@@ -2614,32 +2614,32 @@ let sn = class extends re {
|
|
|
2614
2614
|
updateDrawings: n,
|
|
2615
2615
|
deleteDrawings: r
|
|
2616
2616
|
};
|
|
2617
|
-
const { startRow: _, endRow:
|
|
2618
|
-
let
|
|
2619
|
-
if (t === 0 && h >= _ && p <=
|
|
2620
|
-
if (f >= I && m <=
|
|
2617
|
+
const { startRow: _, endRow: v, startColumn: I, endColumn: R } = i;
|
|
2618
|
+
let S = null, C = null;
|
|
2619
|
+
if (t === 0 && h >= _ && p <= v)
|
|
2620
|
+
if (f >= I && m <= R)
|
|
2621
2621
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2622
2622
|
else {
|
|
2623
|
-
const w = this._shrinkCol(s, a, I,
|
|
2624
|
-
|
|
2623
|
+
const w = this._shrinkCol(s, a, I, R, o);
|
|
2624
|
+
S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
|
|
2625
2625
|
}
|
|
2626
|
-
else if (t === 1 && f >= I && m <=
|
|
2627
|
-
if (h >= _ && p <=
|
|
2626
|
+
else if (t === 1 && f >= I && m <= R)
|
|
2627
|
+
if (h >= _ && p <= v)
|
|
2628
2628
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2629
2629
|
else {
|
|
2630
|
-
const w = this._shrinkRow(s, a, _,
|
|
2631
|
-
|
|
2630
|
+
const w = this._shrinkRow(s, a, _, v, o);
|
|
2631
|
+
S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
|
|
2632
2632
|
}
|
|
2633
2633
|
else if (t === 2) {
|
|
2634
|
-
const w = this._expandRow(s, a, _,
|
|
2635
|
-
|
|
2634
|
+
const w = this._expandRow(s, a, _, v, o);
|
|
2635
|
+
S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
|
|
2636
2636
|
} else if (t === 3) {
|
|
2637
|
-
const w = this._expandCol(s, a, I,
|
|
2638
|
-
|
|
2637
|
+
const w = this._expandCol(s, a, I, R, o);
|
|
2638
|
+
S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
|
|
2639
2639
|
}
|
|
2640
|
-
if (
|
|
2641
|
-
const w = z(
|
|
2642
|
-
n.push({ ...e, sheetTransform:
|
|
2640
|
+
if (S != null && C != null) {
|
|
2641
|
+
const w = z(S, this._selectionRenderService, this._skeletonManagerService);
|
|
2642
|
+
n.push({ ...e, sheetTransform: S, transform: w });
|
|
2643
2643
|
}
|
|
2644
2644
|
return { updateDrawings: n, deleteDrawings: r };
|
|
2645
2645
|
}
|
|
@@ -2658,53 +2658,53 @@ let sn = class extends re {
|
|
|
2658
2658
|
if (f === O.None)
|
|
2659
2659
|
this._remainDrawingSize(h, r, l);
|
|
2660
2660
|
else {
|
|
2661
|
-
const { from: p, to: m } = g, { row: _, column:
|
|
2662
|
-
for (let
|
|
2663
|
-
const C = e[
|
|
2664
|
-
if (
|
|
2661
|
+
const { from: p, to: m } = g, { row: _, column: v } = p, { row: I, column: R } = m;
|
|
2662
|
+
for (let S = 0; S < e.length; S++) {
|
|
2663
|
+
const C = e[S], { startRow: w, endRow: y, startColumn: D, endColumn: E } = C;
|
|
2664
|
+
if (R < D)
|
|
2665
2665
|
continue;
|
|
2666
2666
|
if (f === O.Position) {
|
|
2667
|
-
let
|
|
2668
|
-
if (
|
|
2669
|
-
const
|
|
2670
|
-
if (
|
|
2667
|
+
let b = null, N = null;
|
|
2668
|
+
if (v >= D && v <= E) {
|
|
2669
|
+
const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: v, endColumn: E, startRow: p.row, endRow: m.row });
|
|
2670
|
+
if (x == null)
|
|
2671
2671
|
return;
|
|
2672
|
-
N = { ...h, left:
|
|
2672
|
+
N = { ...h, left: x.startX };
|
|
2673
2673
|
}
|
|
2674
|
-
if (N != null && (
|
|
2675
|
-
r.push({ ...l, sheetTransform:
|
|
2674
|
+
if (N != null && (b = $(N, this._selectionRenderService), b != null && N != null)) {
|
|
2675
|
+
r.push({ ...l, sheetTransform: b, transform: N });
|
|
2676
2676
|
break;
|
|
2677
2677
|
}
|
|
2678
2678
|
this._remainDrawingSize(h, r, l);
|
|
2679
2679
|
continue;
|
|
2680
2680
|
}
|
|
2681
|
-
if (
|
|
2681
|
+
if (v >= D && R <= E)
|
|
2682
2682
|
continue;
|
|
2683
2683
|
let T = null, M = null;
|
|
2684
|
-
if (
|
|
2685
|
-
const
|
|
2686
|
-
if (
|
|
2684
|
+
if (v >= D && v <= E) {
|
|
2685
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: v, endColumn: E, startRow: p.row, endRow: m.row });
|
|
2686
|
+
if (b == null)
|
|
2687
2687
|
return;
|
|
2688
2688
|
M = {
|
|
2689
2689
|
...h,
|
|
2690
|
-
left: (
|
|
2691
|
-
width: ((h == null ? void 0 : h.width) || 0) -
|
|
2690
|
+
left: (b == null ? void 0 : b.startX) || 0,
|
|
2691
|
+
width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
|
|
2692
2692
|
};
|
|
2693
|
-
} else if (
|
|
2694
|
-
const
|
|
2695
|
-
if (
|
|
2693
|
+
} else if (R >= D && R <= E) {
|
|
2694
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: R, startRow: p.row, endRow: m.row });
|
|
2695
|
+
if (b == null)
|
|
2696
2696
|
return;
|
|
2697
2697
|
M = {
|
|
2698
2698
|
...h,
|
|
2699
|
-
left:
|
|
2699
|
+
left: b.startX - ((h == null ? void 0 : h.width) || 0)
|
|
2700
2700
|
};
|
|
2701
2701
|
} else {
|
|
2702
|
-
const
|
|
2703
|
-
if (
|
|
2702
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: E, startRow: p.row, endRow: m.row });
|
|
2703
|
+
if (b == null)
|
|
2704
2704
|
return;
|
|
2705
2705
|
if (M = {
|
|
2706
2706
|
...h,
|
|
2707
|
-
width: ((h == null ? void 0 : h.width) || 0) -
|
|
2707
|
+
width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
|
|
2708
2708
|
}, T = $(M, this._selectionRenderService), T != null && M != null) {
|
|
2709
2709
|
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2710
2710
|
break;
|
|
@@ -2752,21 +2752,21 @@ let sn = class extends re {
|
|
|
2752
2752
|
if (f === O.None)
|
|
2753
2753
|
this._remainDrawingSize(h, r, l);
|
|
2754
2754
|
else {
|
|
2755
|
-
const { from: p, to: m } = g, { row: _, column:
|
|
2756
|
-
for (let
|
|
2757
|
-
const C = e[
|
|
2755
|
+
const { from: p, to: m } = g, { row: _, column: v } = p, { row: I, column: R } = m;
|
|
2756
|
+
for (let S = 0; S < e.length; S++) {
|
|
2757
|
+
const C = e[S], { startRow: w, endRow: y, startColumn: D, endColumn: E } = C;
|
|
2758
2758
|
if (I < w)
|
|
2759
2759
|
continue;
|
|
2760
2760
|
if (f === O.Position) {
|
|
2761
|
-
let
|
|
2761
|
+
let b = null, N = null;
|
|
2762
2762
|
if (_ >= w && _ <= y) {
|
|
2763
|
-
const
|
|
2764
|
-
if (
|
|
2763
|
+
const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: y });
|
|
2764
|
+
if (x == null)
|
|
2765
2765
|
return;
|
|
2766
|
-
N = { ...h, top:
|
|
2766
|
+
N = { ...h, top: x.startY };
|
|
2767
2767
|
}
|
|
2768
|
-
if (N != null && (
|
|
2769
|
-
r.push({ ...l, sheetTransform:
|
|
2768
|
+
if (N != null && (b = $(N, this._selectionRenderService), b != null && N != null)) {
|
|
2769
|
+
r.push({ ...l, sheetTransform: b, transform: N });
|
|
2770
2770
|
break;
|
|
2771
2771
|
}
|
|
2772
2772
|
this._remainDrawingSize(h, r, l);
|
|
@@ -2776,29 +2776,29 @@ let sn = class extends re {
|
|
|
2776
2776
|
continue;
|
|
2777
2777
|
let T = null, M = null;
|
|
2778
2778
|
if (_ >= w && _ <= y) {
|
|
2779
|
-
const
|
|
2780
|
-
if (
|
|
2779
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: y });
|
|
2780
|
+
if (b == null)
|
|
2781
2781
|
return;
|
|
2782
2782
|
M = {
|
|
2783
2783
|
...h,
|
|
2784
|
-
top: (
|
|
2785
|
-
height: ((h == null ? void 0 : h.height) || 0) -
|
|
2784
|
+
top: (b == null ? void 0 : b.startY) || 0,
|
|
2785
|
+
height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
|
|
2786
2786
|
};
|
|
2787
2787
|
} else if (I >= w && I <= y) {
|
|
2788
|
-
const
|
|
2789
|
-
if (
|
|
2788
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: I });
|
|
2789
|
+
if (b == null)
|
|
2790
2790
|
return;
|
|
2791
2791
|
M = {
|
|
2792
2792
|
...h,
|
|
2793
|
-
top:
|
|
2793
|
+
top: b.startY - ((h == null ? void 0 : h.height) || 0)
|
|
2794
2794
|
};
|
|
2795
2795
|
} else {
|
|
2796
|
-
const
|
|
2797
|
-
if (
|
|
2796
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: y });
|
|
2797
|
+
if (b == null)
|
|
2798
2798
|
return;
|
|
2799
2799
|
if (M = {
|
|
2800
2800
|
...h,
|
|
2801
|
-
height: ((h == null ? void 0 : h.height) || 0) -
|
|
2801
|
+
height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
|
|
2802
2802
|
}, T = $(M, this._selectionRenderService), T != null && M != null) {
|
|
2803
2803
|
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2804
2804
|
break;
|
|
@@ -2834,10 +2834,10 @@ let sn = class extends re {
|
|
|
2834
2834
|
else {
|
|
2835
2835
|
const { from: l, to: g } = d, { row: h, column: f } = l, { row: p, column: m } = g;
|
|
2836
2836
|
for (let _ = 0; _ < e.length; _++) {
|
|
2837
|
-
const
|
|
2838
|
-
if (p < I || m <
|
|
2837
|
+
const v = e[_], { startRow: I, endRow: R, startColumn: S, endColumn: C } = v;
|
|
2838
|
+
if (p < I || m < S)
|
|
2839
2839
|
continue;
|
|
2840
|
-
if (c === O.Position && (h <= I && p >=
|
|
2840
|
+
if (c === O.Position && (h <= I && p >= R || f <= S && m >= C)) {
|
|
2841
2841
|
this._remainDrawingSize(u, s, a);
|
|
2842
2842
|
continue;
|
|
2843
2843
|
}
|
|
@@ -2858,7 +2858,7 @@ let sn = class extends re {
|
|
|
2858
2858
|
if (t === "insert")
|
|
2859
2859
|
e = i.unitId, n = i.subUnitId;
|
|
2860
2860
|
else {
|
|
2861
|
-
const r =
|
|
2861
|
+
const r = se(this._univerInstanceService);
|
|
2862
2862
|
if (r == null)
|
|
2863
2863
|
return;
|
|
2864
2864
|
e = r.unitId, n = r.subUnitId;
|
|
@@ -2866,47 +2866,47 @@ let sn = class extends re {
|
|
|
2866
2866
|
return { unitId: e, subUnitId: n };
|
|
2867
2867
|
}
|
|
2868
2868
|
_moveRangeInterceptor(i) {
|
|
2869
|
-
var I,
|
|
2870
|
-
const { toRange: t, fromRange: e } = i, n =
|
|
2869
|
+
var I, R;
|
|
2870
|
+
const { toRange: t, fromRange: e } = i, n = se(this._univerInstanceService);
|
|
2871
2871
|
if (!n)
|
|
2872
2872
|
return { redos: [], undos: [] };
|
|
2873
|
-
const { unitId: r, subUnitId: s } = n, o = (
|
|
2873
|
+
const { unitId: r, subUnitId: s } = n, o = (R = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(V)) == null ? void 0 : R.getCurrentSkeleton();
|
|
2874
2874
|
if (!o)
|
|
2875
2875
|
return { redos: [], undos: [] };
|
|
2876
|
-
const a =
|
|
2876
|
+
const a = Ln(o, e);
|
|
2877
2877
|
if (!a)
|
|
2878
2878
|
return { redos: [], undos: [] };
|
|
2879
2879
|
const { startX: d, endX: u, startY: c, endY: l } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
|
|
2880
|
-
Object.keys(g).forEach((
|
|
2881
|
-
const C = g[
|
|
2880
|
+
Object.keys(g).forEach((S) => {
|
|
2881
|
+
const C = g[S];
|
|
2882
2882
|
if (C.anchorType !== O.Both)
|
|
2883
2883
|
return;
|
|
2884
2884
|
const { transform: w } = C;
|
|
2885
2885
|
if (!w)
|
|
2886
2886
|
return;
|
|
2887
|
-
const { left: y = 0, top: D = 0, width: E = 0, height: T = 0 } = w, { drawingStartX: M, drawingEndX:
|
|
2887
|
+
const { left: y = 0, top: D = 0, width: E = 0, height: T = 0 } = w, { drawingStartX: M, drawingEndX: b, drawingStartY: N, drawingEndY: x } = {
|
|
2888
2888
|
drawingStartX: y,
|
|
2889
2889
|
drawingEndX: y + E,
|
|
2890
2890
|
drawingStartY: D,
|
|
2891
2891
|
drawingEndY: D + T
|
|
2892
2892
|
};
|
|
2893
|
-
d <= M &&
|
|
2893
|
+
d <= M && b <= u && c <= N && x <= l && h.push(C);
|
|
2894
2894
|
});
|
|
2895
|
-
const f = [], p = [], m = t.startRow - e.startRow, _ = t.startColumn - e.startColumn,
|
|
2896
|
-
const C =
|
|
2895
|
+
const f = [], p = [], m = t.startRow - e.startRow, _ = t.startColumn - e.startColumn, v = h.map((S) => {
|
|
2896
|
+
const C = S.sheetTransform, w = {
|
|
2897
2897
|
to: { ...C.to, row: C.to.row + m, column: C.to.column + _ },
|
|
2898
2898
|
from: { ...C.from, row: C.from.row + m, column: C.from.column + _ }
|
|
2899
2899
|
}, y = z(w, this._selectionRenderService, this._skeletonManagerService);
|
|
2900
2900
|
return {
|
|
2901
2901
|
unitId: r,
|
|
2902
2902
|
subUnitId: s,
|
|
2903
|
-
drawingId:
|
|
2903
|
+
drawingId: S.drawingId,
|
|
2904
2904
|
transform: y,
|
|
2905
2905
|
sheetTransform: w
|
|
2906
2906
|
};
|
|
2907
2907
|
});
|
|
2908
|
-
if (
|
|
2909
|
-
const
|
|
2908
|
+
if (v.length) {
|
|
2909
|
+
const S = this._sheetDrawingService.getBatchUpdateOp(v), { undo: C, redo: w, objects: y } = S;
|
|
2910
2910
|
f.push({ id: P.id, params: { unitId: r, subUnitId: s, op: w, objects: y, type: U.UPDATE } }), p.push({ id: P.id, params: { unitId: r, subUnitId: s, op: C, objects: y, type: U.UPDATE } });
|
|
2911
2911
|
}
|
|
2912
2912
|
return { redos: f, undos: p };
|
|
@@ -2920,23 +2920,23 @@ let sn = class extends re {
|
|
|
2920
2920
|
const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
|
|
2921
2921
|
if (p == null || m == null)
|
|
2922
2922
|
return;
|
|
2923
|
-
let
|
|
2923
|
+
let v, I;
|
|
2924
2924
|
if (t === "insert") {
|
|
2925
|
-
const
|
|
2926
|
-
|
|
2925
|
+
const S = this._expandRow(p, m, o, a, _);
|
|
2926
|
+
v = S == null ? void 0 : S.newSheetTransform, I = S == null ? void 0 : S.newTransform;
|
|
2927
2927
|
} else {
|
|
2928
|
-
const { from:
|
|
2928
|
+
const { from: S, to: C } = p, { row: w } = S, { row: y } = C;
|
|
2929
2929
|
if (_ === O.Both && w >= o && y <= a)
|
|
2930
2930
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2931
2931
|
else {
|
|
2932
2932
|
const D = this._shrinkRow(p, m, o, a, _);
|
|
2933
|
-
|
|
2933
|
+
v = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
|
|
2934
2934
|
}
|
|
2935
2935
|
}
|
|
2936
|
-
if (!
|
|
2936
|
+
if (!v || !I)
|
|
2937
2937
|
return;
|
|
2938
|
-
const
|
|
2939
|
-
l.push(
|
|
2938
|
+
const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: v };
|
|
2939
|
+
l.push(R);
|
|
2940
2940
|
}), l.length === 0 && g.length === 0)
|
|
2941
2941
|
return { redos: [], undos: [] };
|
|
2942
2942
|
if (l.length > 0) {
|
|
@@ -2961,23 +2961,23 @@ let sn = class extends re {
|
|
|
2961
2961
|
const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
|
|
2962
2962
|
if (p == null || m == null)
|
|
2963
2963
|
return;
|
|
2964
|
-
let
|
|
2964
|
+
let v, I;
|
|
2965
2965
|
if (t === "insert") {
|
|
2966
|
-
const
|
|
2967
|
-
|
|
2966
|
+
const S = this._expandCol(p, m, o, a, _);
|
|
2967
|
+
v = S == null ? void 0 : S.newSheetTransform, I = S == null ? void 0 : S.newTransform;
|
|
2968
2968
|
} else {
|
|
2969
|
-
const { from:
|
|
2969
|
+
const { from: S, to: C } = p, { column: w } = S, { column: y } = C;
|
|
2970
2970
|
if (_ === O.Both && w >= o && y <= a)
|
|
2971
2971
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2972
2972
|
else {
|
|
2973
2973
|
const D = this._shrinkCol(p, m, o, a, _);
|
|
2974
|
-
|
|
2974
|
+
v = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
|
|
2975
2975
|
}
|
|
2976
2976
|
}
|
|
2977
|
-
if (!
|
|
2977
|
+
if (!v || !I)
|
|
2978
2978
|
return;
|
|
2979
|
-
const
|
|
2980
|
-
l.push(
|
|
2979
|
+
const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: v };
|
|
2980
|
+
l.push(R);
|
|
2981
2981
|
}), l.length === 0 && g.length === 0)
|
|
2982
2982
|
return { redos: [], undos: [] };
|
|
2983
2983
|
if (l.length > 0) {
|
|
@@ -3166,7 +3166,7 @@ let sn = class extends re {
|
|
|
3166
3166
|
// but the skeleton changes like other render modules. These two signals are not equivalent.
|
|
3167
3167
|
// As a temp solution, I subscribed to activate$ here.
|
|
3168
3168
|
this._commandService.onCommandExecuted((i) => {
|
|
3169
|
-
if (i.id ===
|
|
3169
|
+
if (i.id === Ki.id) {
|
|
3170
3170
|
const { unitId: t, subUnitId: e } = i.params;
|
|
3171
3171
|
this._updateDrawings(t, e);
|
|
3172
3172
|
}
|
|
@@ -3217,7 +3217,7 @@ let sn = class extends re {
|
|
|
3217
3217
|
_sheetRefreshListener() {
|
|
3218
3218
|
this.disposeWithMe(
|
|
3219
3219
|
this._commandService.onCommandExecuted((i) => {
|
|
3220
|
-
|
|
3220
|
+
Ns.includes(i.id) && requestIdleCallback(() => {
|
|
3221
3221
|
const t = i.params, { unitId: e, subUnitId: n, ranges: r } = t;
|
|
3222
3222
|
this._refreshDrawingTransform(e, n, r);
|
|
3223
3223
|
});
|
|
@@ -3232,13 +3232,13 @@ let sn = class extends re {
|
|
|
3232
3232
|
return !0;
|
|
3233
3233
|
const { from: c, to: l } = a, { row: g, column: h } = c, { row: f, column: p } = l;
|
|
3234
3234
|
for (let m = 0; m < e.length; m++) {
|
|
3235
|
-
const _ = e[m], { startRow:
|
|
3236
|
-
if (
|
|
3235
|
+
const _ = e[m], { startRow: v, endRow: I, startColumn: R, endColumn: S } = _;
|
|
3236
|
+
if (Fr.intersects(
|
|
3237
3237
|
{
|
|
3238
|
-
startRow:
|
|
3238
|
+
startRow: v,
|
|
3239
3239
|
endRow: I,
|
|
3240
|
-
startColumn:
|
|
3241
|
-
endColumn:
|
|
3240
|
+
startColumn: R,
|
|
3241
|
+
endColumn: S
|
|
3242
3242
|
},
|
|
3243
3243
|
{
|
|
3244
3244
|
startRow: g,
|
|
@@ -3246,7 +3246,7 @@ let sn = class extends re {
|
|
|
3246
3246
|
startColumn: h,
|
|
3247
3247
|
endColumn: p
|
|
3248
3248
|
}
|
|
3249
|
-
) || g > I || h >
|
|
3249
|
+
) || g > I || h > S) {
|
|
3250
3250
|
const C = u === O.Position, w = z(a, this._selectionRenderService, this._skeletonManagerService);
|
|
3251
3251
|
r.push({
|
|
3252
3252
|
...o,
|
|
@@ -3262,75 +3262,21 @@ let sn = class extends re {
|
|
|
3262
3262
|
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(Y.id, [i]));
|
|
3263
3263
|
}
|
|
3264
3264
|
};
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
],
|
|
3275
|
-
|
|
3276
|
-
return ne = Object.assign || function(i) {
|
|
3277
|
-
for (var t, e = 1, n = arguments.length; e < n; e++) {
|
|
3278
|
-
t = arguments[e];
|
|
3279
|
-
for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (i[r] = t[r]);
|
|
3280
|
-
}
|
|
3281
|
-
return i;
|
|
3282
|
-
}, ne.apply(this, arguments);
|
|
3283
|
-
}, Ls = function(i, t) {
|
|
3284
|
-
var e = {};
|
|
3285
|
-
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && t.indexOf(n) < 0 && (e[n] = i[n]);
|
|
3286
|
-
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
3287
|
-
for (var r = 0, n = Object.getOwnPropertySymbols(i); r < n.length; r++)
|
|
3288
|
-
t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (e[n[r]] = i[n[r]]);
|
|
3289
|
-
return e;
|
|
3290
|
-
}, br = hr(function(i, t) {
|
|
3291
|
-
var e = i.icon, n = i.id, r = i.className, s = i.extend, o = Ls(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), d = as("_".concat(Vs()));
|
|
3292
|
-
return Rr(e, "".concat(n), { defIds: e.defIds, idSuffix: d.current }, ne({ ref: t, className: a }, o), s);
|
|
3293
|
-
});
|
|
3294
|
-
function Rr(i, t, e, n, r) {
|
|
3295
|
-
return gr(i.tag, ne(ne({ key: t }, Gs(i, e, r)), n), (Xs(i, e).children || []).map(function(s, o) {
|
|
3296
|
-
return Rr(s, "".concat(t, "-").concat(i.tag, "-").concat(o), e, void 0, r);
|
|
3297
|
-
}));
|
|
3298
|
-
}
|
|
3299
|
-
function Gs(i, t, e) {
|
|
3300
|
-
var n = ne({}, i.attrs);
|
|
3301
|
-
e != null && e.colorChannel1 && n.fill === "colorChannel1" && (n.fill = e.colorChannel1), i.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(function(s) {
|
|
3302
|
-
var o = s[0], a = s[1];
|
|
3303
|
-
o === "mask" && typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
3304
|
-
});
|
|
3305
|
-
var r = t.defIds;
|
|
3306
|
-
return !r || r.length === 0 || (i.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(s) {
|
|
3307
|
-
var o = s[0], a = s[1];
|
|
3308
|
-
typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
3309
|
-
})), n;
|
|
3310
|
-
}
|
|
3311
|
-
function Xs(i, t) {
|
|
3312
|
-
var e, n = t.defIds;
|
|
3313
|
-
return !n || n.length === 0 ? i : i.tag === "defs" && (!((e = i.children) === null || e === void 0) && e.length) ? ne(ne({}, i), { children: i.children.map(function(r) {
|
|
3314
|
-
return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? ne(ne({}, r), { attrs: ne(ne({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
|
|
3315
|
-
}) }) : i;
|
|
3316
|
-
}
|
|
3317
|
-
function Vs() {
|
|
3318
|
-
return Math.random().toString(36).substring(2, 8);
|
|
3319
|
-
}
|
|
3320
|
-
br.displayName = "UniverIcon";
|
|
3321
|
-
var Hs = { 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" } }] }, Mr = hr(function(i, t) {
|
|
3322
|
-
return gr(br, Object.assign({}, i, {
|
|
3323
|
-
id: "add-image-single",
|
|
3324
|
-
ref: t,
|
|
3325
|
-
icon: Hs
|
|
3326
|
-
}));
|
|
3327
|
-
});
|
|
3328
|
-
Mr.displayName = "AddImageSingle";
|
|
3329
|
-
const yr = {
|
|
3265
|
+
rn = Ps([
|
|
3266
|
+
me(1, Z),
|
|
3267
|
+
me(2, G),
|
|
3268
|
+
me(3, Xe),
|
|
3269
|
+
me(4, A(V)),
|
|
3270
|
+
me(5, A(Nt)),
|
|
3271
|
+
me(6, ie),
|
|
3272
|
+
me(7, re),
|
|
3273
|
+
me(8, Se)
|
|
3274
|
+
], rn);
|
|
3275
|
+
const Ir = {
|
|
3330
3276
|
id: "sheet.command.delete-drawing",
|
|
3331
|
-
type:
|
|
3277
|
+
type: J.COMMAND,
|
|
3332
3278
|
handler: (i) => {
|
|
3333
|
-
const t = i.get(G), n = i.get(
|
|
3279
|
+
const t = i.get(G), n = i.get(ie).getFocusDrawings();
|
|
3334
3280
|
if (n.length === 0)
|
|
3335
3281
|
return !1;
|
|
3336
3282
|
const r = n[0].unitId, s = n.map((o) => {
|
|
@@ -3342,16 +3288,16 @@ const yr = {
|
|
|
3342
3288
|
drawingType: c
|
|
3343
3289
|
};
|
|
3344
3290
|
});
|
|
3345
|
-
return t.executeCommand(
|
|
3291
|
+
return t.executeCommand(nt.id, {
|
|
3346
3292
|
unitId: r,
|
|
3347
3293
|
drawings: s
|
|
3348
3294
|
});
|
|
3349
3295
|
}
|
|
3350
|
-
},
|
|
3296
|
+
}, rt = {
|
|
3351
3297
|
id: "sheet.command.move-drawing",
|
|
3352
|
-
type:
|
|
3298
|
+
type: J.COMMAND,
|
|
3353
3299
|
handler: (i, t) => {
|
|
3354
|
-
const e = i.get(G), n = i.get(
|
|
3300
|
+
const e = i.get(G), n = i.get(ie), r = i.get(Xe), { direction: s } = t, o = n.getFocusDrawings();
|
|
3355
3301
|
if (o.length === 0)
|
|
3356
3302
|
return !1;
|
|
3357
3303
|
const a = o[0].unitId, d = o.map((c) => {
|
|
@@ -3359,76 +3305,49 @@ const yr = {
|
|
|
3359
3305
|
if (l == null)
|
|
3360
3306
|
return null;
|
|
3361
3307
|
const g = { ...l }, { left: h = 0, top: f = 0 } = l;
|
|
3362
|
-
return s ===
|
|
3308
|
+
return s === _e.UP ? g.top = f - 1 : s === _e.DOWN ? g.top = f + 1 : s === _e.LEFT ? g.left = h - 1 : s === _e.RIGHT && (g.left = h + 1), {
|
|
3363
3309
|
...c,
|
|
3364
3310
|
transform: g,
|
|
3365
3311
|
sheetTransform: $(g, r)
|
|
3366
3312
|
};
|
|
3367
3313
|
}).filter((c) => c != null);
|
|
3368
|
-
return e.syncExecuteCommand(
|
|
3314
|
+
return e.syncExecuteCommand(Wt.id, {
|
|
3369
3315
|
unitId: a,
|
|
3370
3316
|
drawings: d
|
|
3371
3317
|
}) ? (e.syncExecuteCommand(Y.id, [a]), !0) : !1;
|
|
3372
3318
|
}
|
|
3373
|
-
},
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
id: Tr,
|
|
3377
|
-
type: cn.SUBITEMS,
|
|
3378
|
-
icon: Er,
|
|
3379
|
-
tooltip: "sheetImage.title",
|
|
3380
|
-
hidden$: an(i, x.UNIVER_SHEET),
|
|
3381
|
-
disabled$: Ui(i, { workbookTypes: [Kt], worksheetTypes: [Zt], rangeTypes: [rs] })
|
|
3382
|
-
};
|
|
3383
|
-
}
|
|
3384
|
-
function Ks(i) {
|
|
3385
|
-
return {
|
|
3386
|
-
id: Bt.id,
|
|
3387
|
-
title: "sheetImage.upload.float",
|
|
3388
|
-
type: cn.BUTTON,
|
|
3389
|
-
hidden$: an(i, x.UNIVER_SHEET)
|
|
3390
|
-
};
|
|
3391
|
-
}
|
|
3392
|
-
function Zs(i) {
|
|
3393
|
-
return {
|
|
3394
|
-
id: ln.id,
|
|
3395
|
-
title: "sheetImage.upload.cell",
|
|
3396
|
-
type: cn.BUTTON,
|
|
3397
|
-
hidden$: an(i, x.UNIVER_SHEET)
|
|
3398
|
-
};
|
|
3399
|
-
}
|
|
3400
|
-
const Js = (i) => {
|
|
3401
|
-
var S;
|
|
3402
|
-
const t = Qe(G), e = Qe(nt), n = Qe(ie), r = Qe(J), { drawings: s } = i, o = s[0];
|
|
3319
|
+
}, ks = (i) => {
|
|
3320
|
+
var v;
|
|
3321
|
+
const t = qe(G), e = qe(tt), n = qe(re), r = qe(Z), { drawings: s } = i, o = s[0];
|
|
3403
3322
|
if (o == null)
|
|
3404
3323
|
return;
|
|
3405
3324
|
const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
|
|
3406
3325
|
if (u == null)
|
|
3407
3326
|
return;
|
|
3408
|
-
const c = u.getTransformerByCreate(), [l, g] =
|
|
3409
|
-
function m(I,
|
|
3410
|
-
const
|
|
3327
|
+
const c = u.getTransformerByCreate(), [l, g] = Qt(!0), h = (v = o.anchorType) != null ? v : O.Position, [f, p] = Qt(h);
|
|
3328
|
+
function m(I, R) {
|
|
3329
|
+
const S = [];
|
|
3411
3330
|
return I.forEach((C) => {
|
|
3412
|
-
const { oKey: w } = C, y =
|
|
3331
|
+
const { oKey: w } = C, y = R.getDrawingOKey(w);
|
|
3413
3332
|
if (y == null)
|
|
3414
|
-
return
|
|
3415
|
-
const { unitId: D, subUnitId: E, drawingId: T, drawingType: M, anchorType:
|
|
3416
|
-
|
|
3333
|
+
return S.push(null), !0;
|
|
3334
|
+
const { unitId: D, subUnitId: E, drawingId: T, drawingType: M, anchorType: b, sheetTransform: N } = y;
|
|
3335
|
+
S.push({
|
|
3417
3336
|
unitId: D,
|
|
3418
3337
|
subUnitId: E,
|
|
3419
3338
|
drawingId: T,
|
|
3420
|
-
anchorType:
|
|
3339
|
+
anchorType: b,
|
|
3421
3340
|
sheetTransform: N,
|
|
3422
3341
|
drawingType: M
|
|
3423
3342
|
});
|
|
3424
|
-
}),
|
|
3343
|
+
}), S;
|
|
3425
3344
|
}
|
|
3426
|
-
|
|
3427
|
-
const I = c.clearControl$.subscribe((
|
|
3428
|
-
|
|
3429
|
-
}),
|
|
3345
|
+
ur(() => {
|
|
3346
|
+
const I = c.clearControl$.subscribe((S) => {
|
|
3347
|
+
S === !0 && g(!1);
|
|
3348
|
+
}), R = c.changeStart$.subscribe((S) => {
|
|
3430
3349
|
var y;
|
|
3431
|
-
const { objects: C } =
|
|
3350
|
+
const { objects: C } = S, w = m(C, n);
|
|
3432
3351
|
if (w.length === 0)
|
|
3433
3352
|
g(!1);
|
|
3434
3353
|
else if (w.length >= 1) {
|
|
@@ -3438,169 +3357,196 @@ const Js = (i) => {
|
|
|
3438
3357
|
}
|
|
3439
3358
|
});
|
|
3440
3359
|
return () => {
|
|
3441
|
-
|
|
3360
|
+
R.unsubscribe(), I.unsubscribe();
|
|
3442
3361
|
};
|
|
3443
3362
|
}, []);
|
|
3444
3363
|
function _(I) {
|
|
3445
3364
|
p(I);
|
|
3446
|
-
const
|
|
3447
|
-
if (
|
|
3365
|
+
const R = n.getFocusDrawings();
|
|
3366
|
+
if (R.length === 0)
|
|
3448
3367
|
return;
|
|
3449
|
-
const
|
|
3368
|
+
const S = R.map((C) => ({
|
|
3450
3369
|
unitId: C.unitId,
|
|
3451
3370
|
subUnitId: C.subUnitId,
|
|
3452
3371
|
drawingId: C.drawingId,
|
|
3453
3372
|
anchorType: I
|
|
3454
3373
|
}));
|
|
3455
|
-
t.executeCommand(
|
|
3456
|
-
unitId:
|
|
3457
|
-
drawings:
|
|
3374
|
+
t.executeCommand(Wt.id, {
|
|
3375
|
+
unitId: R[0].unitId,
|
|
3376
|
+
drawings: S
|
|
3458
3377
|
});
|
|
3459
3378
|
}
|
|
3460
|
-
return /* @__PURE__ */
|
|
3379
|
+
return /* @__PURE__ */ qt(
|
|
3461
3380
|
"div",
|
|
3462
3381
|
{
|
|
3463
|
-
className:
|
|
3382
|
+
className: hi("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
|
|
3464
3383
|
"univer-hidden": !l
|
|
3465
3384
|
}),
|
|
3466
3385
|
children: [
|
|
3467
|
-
/* @__PURE__ */
|
|
3386
|
+
/* @__PURE__ */ oe(
|
|
3468
3387
|
"header",
|
|
3469
3388
|
{
|
|
3470
3389
|
className: "univer-text-gray-600 dark:!univer-text-gray-200",
|
|
3471
|
-
children: /* @__PURE__ */
|
|
3390
|
+
children: /* @__PURE__ */ oe("div", { children: e.t("drawing-anchor.title") })
|
|
3472
3391
|
}
|
|
3473
3392
|
),
|
|
3474
|
-
/* @__PURE__ */
|
|
3475
|
-
/* @__PURE__ */
|
|
3476
|
-
/* @__PURE__ */
|
|
3477
|
-
/* @__PURE__ */
|
|
3393
|
+
/* @__PURE__ */ oe("div", { children: /* @__PURE__ */ qt(gi, { value: f, onChange: _, direction: "vertical", children: [
|
|
3394
|
+
/* @__PURE__ */ oe(Xt, { value: O.Both, children: e.t("drawing-anchor.both") }),
|
|
3395
|
+
/* @__PURE__ */ oe(Xt, { value: O.Position, children: e.t("drawing-anchor.position") }),
|
|
3396
|
+
/* @__PURE__ */ oe(Xt, { value: O.None, children: e.t("drawing-anchor.none") })
|
|
3478
3397
|
] }) })
|
|
3479
3398
|
]
|
|
3480
3399
|
}
|
|
3481
3400
|
);
|
|
3482
|
-
},
|
|
3483
|
-
const i =
|
|
3484
|
-
return
|
|
3401
|
+
}, Ws = () => {
|
|
3402
|
+
const i = qe(re), t = i.getFocusDrawings(), [e, n] = Qt(t);
|
|
3403
|
+
return ur(() => {
|
|
3485
3404
|
const r = i.focus$.subscribe((s) => {
|
|
3486
3405
|
n(s);
|
|
3487
3406
|
});
|
|
3488
3407
|
return () => {
|
|
3489
3408
|
r.unsubscribe();
|
|
3490
3409
|
};
|
|
3491
|
-
}, []), !!(e != null && e.length) && /* @__PURE__ */
|
|
3492
|
-
/* @__PURE__ */
|
|
3493
|
-
/* @__PURE__ */
|
|
3410
|
+
}, []), !!(e != null && e.length) && /* @__PURE__ */ qt("div", { className: "univer-text-sm", children: [
|
|
3411
|
+
/* @__PURE__ */ oe(ii, { drawings: e }),
|
|
3412
|
+
/* @__PURE__ */ oe(ks, { drawings: e })
|
|
3494
3413
|
] });
|
|
3495
|
-
},
|
|
3496
|
-
|
|
3497
|
-
|
|
3414
|
+
}, Cr = "sheet.menu.image";
|
|
3415
|
+
function Bs(i) {
|
|
3416
|
+
return {
|
|
3417
|
+
id: Cr,
|
|
3418
|
+
type: an.SUBITEMS,
|
|
3419
|
+
icon: "AddImageSingle",
|
|
3420
|
+
tooltip: "sheetImage.title",
|
|
3421
|
+
hidden$: on(i, F.UNIVER_SHEET),
|
|
3422
|
+
disabled$: Ri(i, { workbookTypes: [zt], worksheetTypes: [Kt], rangeTypes: [Ji] })
|
|
3423
|
+
};
|
|
3424
|
+
}
|
|
3425
|
+
function js(i) {
|
|
3426
|
+
return {
|
|
3427
|
+
id: Bt.id,
|
|
3428
|
+
title: "sheetImage.upload.float",
|
|
3429
|
+
type: an.BUTTON,
|
|
3430
|
+
hidden$: on(i, F.UNIVER_SHEET)
|
|
3431
|
+
};
|
|
3432
|
+
}
|
|
3433
|
+
function $s(i) {
|
|
3434
|
+
return {
|
|
3435
|
+
id: dn.id,
|
|
3436
|
+
title: "sheetImage.upload.cell",
|
|
3437
|
+
type: an.BUTTON,
|
|
3438
|
+
hidden$: on(i, F.UNIVER_SHEET)
|
|
3439
|
+
};
|
|
3440
|
+
}
|
|
3441
|
+
const Fs = {
|
|
3442
|
+
[Pi.MEDIA]: {
|
|
3443
|
+
[Cr]: {
|
|
3498
3444
|
order: 0,
|
|
3499
|
-
menuItemFactory:
|
|
3445
|
+
menuItemFactory: Bs,
|
|
3500
3446
|
[Bt.id]: {
|
|
3501
3447
|
order: 0,
|
|
3502
|
-
menuItemFactory:
|
|
3448
|
+
menuItemFactory: js
|
|
3503
3449
|
},
|
|
3504
|
-
[
|
|
3450
|
+
[dn.id]: {
|
|
3505
3451
|
order: 1,
|
|
3506
|
-
menuItemFactory:
|
|
3452
|
+
menuItemFactory: $s
|
|
3507
3453
|
}
|
|
3508
3454
|
}
|
|
3509
3455
|
}
|
|
3510
3456
|
};
|
|
3511
|
-
function
|
|
3512
|
-
return !i.getContextValue(
|
|
3457
|
+
function it(i) {
|
|
3458
|
+
return !i.getContextValue(xr) && !i.getContextValue(Yr) && !i.getContextValue(Xr) && i.getContextValue($e);
|
|
3513
3459
|
}
|
|
3514
|
-
const
|
|
3515
|
-
id:
|
|
3460
|
+
const xs = {
|
|
3461
|
+
id: rt.id,
|
|
3516
3462
|
description: "shortcut.drawing-move-down",
|
|
3517
3463
|
group: "4_drawing-view",
|
|
3518
3464
|
binding: Fe.ARROW_DOWN,
|
|
3519
3465
|
priority: 100,
|
|
3520
|
-
preconditions:
|
|
3466
|
+
preconditions: it,
|
|
3521
3467
|
staticParameters: {
|
|
3522
|
-
direction:
|
|
3468
|
+
direction: _e.DOWN
|
|
3523
3469
|
}
|
|
3524
|
-
},
|
|
3525
|
-
id:
|
|
3470
|
+
}, Ys = {
|
|
3471
|
+
id: rt.id,
|
|
3526
3472
|
description: "shortcut.drawing-move-up",
|
|
3527
3473
|
group: "4_drawing-view",
|
|
3528
3474
|
binding: Fe.ARROW_UP,
|
|
3529
3475
|
priority: 100,
|
|
3530
|
-
preconditions:
|
|
3476
|
+
preconditions: it,
|
|
3531
3477
|
staticParameters: {
|
|
3532
|
-
direction:
|
|
3478
|
+
direction: _e.UP
|
|
3533
3479
|
}
|
|
3534
|
-
},
|
|
3535
|
-
id:
|
|
3480
|
+
}, Xs = {
|
|
3481
|
+
id: rt.id,
|
|
3536
3482
|
description: "shortcut.drawing-move-left",
|
|
3537
3483
|
group: "4_drawing-view",
|
|
3538
3484
|
binding: Fe.ARROW_LEFT,
|
|
3539
3485
|
priority: 100,
|
|
3540
|
-
preconditions:
|
|
3486
|
+
preconditions: it,
|
|
3541
3487
|
staticParameters: {
|
|
3542
|
-
direction:
|
|
3488
|
+
direction: _e.LEFT
|
|
3543
3489
|
}
|
|
3544
|
-
},
|
|
3545
|
-
id:
|
|
3490
|
+
}, Gs = {
|
|
3491
|
+
id: rt.id,
|
|
3546
3492
|
description: "shortcut.drawing-move-right",
|
|
3547
3493
|
group: "4_drawing-view",
|
|
3548
3494
|
binding: Fe.ARROW_RIGHT,
|
|
3549
3495
|
priority: 100,
|
|
3550
|
-
preconditions:
|
|
3496
|
+
preconditions: it,
|
|
3551
3497
|
staticParameters: {
|
|
3552
|
-
direction:
|
|
3498
|
+
direction: _e.RIGHT
|
|
3553
3499
|
}
|
|
3554
|
-
},
|
|
3555
|
-
id:
|
|
3500
|
+
}, Ls = {
|
|
3501
|
+
id: Ir.id,
|
|
3556
3502
|
description: "shortcut.drawing-delete",
|
|
3557
3503
|
group: "4_drawing-view",
|
|
3558
3504
|
// when focusing on any other input tag do not trigger this shortcut
|
|
3559
|
-
preconditions:
|
|
3505
|
+
preconditions: it,
|
|
3560
3506
|
binding: Fe.DELETE,
|
|
3561
3507
|
mac: Fe.BACKSPACE
|
|
3562
3508
|
};
|
|
3563
|
-
var
|
|
3564
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
3509
|
+
var Vs = Object.getOwnPropertyDescriptor, Hs = (i, t, e, n) => {
|
|
3510
|
+
for (var r = n > 1 ? void 0 : n ? Vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3565
3511
|
(o = i[s]) && (r = o(r) || r);
|
|
3566
3512
|
return r;
|
|
3567
|
-
},
|
|
3568
|
-
let
|
|
3513
|
+
}, ke = (i, t) => (e, n) => t(e, n, i);
|
|
3514
|
+
let Ut = class extends ne {
|
|
3569
3515
|
constructor(i, t, e, n, r, s) {
|
|
3570
3516
|
super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
|
|
3571
3517
|
}
|
|
3572
3518
|
_initCustomComponents() {
|
|
3573
3519
|
const i = this._componentManager;
|
|
3574
|
-
this.disposeWithMe(i.register(
|
|
3520
|
+
this.disposeWithMe(i.register(hr, Ws));
|
|
3575
3521
|
}
|
|
3576
3522
|
_initMenus() {
|
|
3577
|
-
this._menuManagerService.mergeMenu(
|
|
3523
|
+
this._menuManagerService.mergeMenu(Fs);
|
|
3578
3524
|
}
|
|
3579
3525
|
_initCommands() {
|
|
3580
3526
|
[
|
|
3581
3527
|
Bt,
|
|
3582
|
-
|
|
3528
|
+
dn,
|
|
3529
|
+
kt,
|
|
3530
|
+
nt,
|
|
3583
3531
|
Wt,
|
|
3584
|
-
|
|
3585
|
-
jt,
|
|
3586
|
-
pr,
|
|
3532
|
+
gr,
|
|
3587
3533
|
Y,
|
|
3534
|
+
fr,
|
|
3535
|
+
mr,
|
|
3588
3536
|
wr,
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
yr,
|
|
3593
|
-
vr
|
|
3537
|
+
rt,
|
|
3538
|
+
Ir,
|
|
3539
|
+
pr
|
|
3594
3540
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
3595
3541
|
}
|
|
3596
3542
|
_initShortcuts() {
|
|
3597
3543
|
[
|
|
3598
3544
|
// sheet drawing shortcuts
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3545
|
+
xs,
|
|
3546
|
+
Ys,
|
|
3547
|
+
Xs,
|
|
3548
|
+
Gs,
|
|
3549
|
+
Ls
|
|
3604
3550
|
].forEach((i) => {
|
|
3605
3551
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
3606
3552
|
});
|
|
@@ -3609,58 +3555,58 @@ let Pt = class extends re {
|
|
|
3609
3555
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
3610
3556
|
}
|
|
3611
3557
|
};
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
],
|
|
3620
|
-
var
|
|
3621
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
3558
|
+
Ut = Hs([
|
|
3559
|
+
ke(0, A(Hn)),
|
|
3560
|
+
ke(1, Ai),
|
|
3561
|
+
ke(2, G),
|
|
3562
|
+
ke(3, Ni),
|
|
3563
|
+
ke(4, re),
|
|
3564
|
+
ke(5, A(cn))
|
|
3565
|
+
], Ut);
|
|
3566
|
+
var zs = Object.defineProperty, Ks = Object.getOwnPropertyDescriptor, Js = (i, t, e) => t in i ? zs(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Zs = (i, t, e, n) => {
|
|
3567
|
+
for (var r = n > 1 ? void 0 : n ? Ks(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3622
3568
|
(o = i[s]) && (r = o(r) || r);
|
|
3623
3569
|
return r;
|
|
3624
|
-
},
|
|
3625
|
-
const
|
|
3626
|
-
let
|
|
3627
|
-
constructor(i =
|
|
3570
|
+
}, Lt = (i, t) => (e, n) => t(e, n, i), Dr = (i, t, e) => Js(i, typeof t != "symbol" ? t + "" : t, e);
|
|
3571
|
+
const qs = "SHEET_IMAGE_UI_PLUGIN";
|
|
3572
|
+
let Pt = class extends Vr {
|
|
3573
|
+
constructor(i = jn, t, e, n) {
|
|
3628
3574
|
super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
|
|
3629
|
-
const { menu: r, ...s } =
|
|
3575
|
+
const { menu: r, ...s } = Hr(
|
|
3630
3576
|
{},
|
|
3631
|
-
|
|
3577
|
+
jn,
|
|
3632
3578
|
this._config
|
|
3633
3579
|
);
|
|
3634
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
3580
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(es, s);
|
|
3635
3581
|
}
|
|
3636
3582
|
onStarting() {
|
|
3637
|
-
|
|
3638
|
-
[
|
|
3639
|
-
[Pt],
|
|
3640
|
-
[Rt],
|
|
3583
|
+
zr(this._injector, [
|
|
3584
|
+
[et],
|
|
3641
3585
|
[Ut],
|
|
3586
|
+
[Rt],
|
|
3642
3587
|
[Ot],
|
|
3643
3588
|
[Tt],
|
|
3589
|
+
[Et],
|
|
3590
|
+
[bt],
|
|
3644
3591
|
[Mt],
|
|
3645
|
-
[yt]
|
|
3646
|
-
[Et]
|
|
3592
|
+
[yt]
|
|
3647
3593
|
]), Ft(this._injector, [
|
|
3648
|
-
[
|
|
3594
|
+
[et]
|
|
3649
3595
|
]);
|
|
3650
3596
|
}
|
|
3651
3597
|
onReady() {
|
|
3652
3598
|
Ft(this._injector, [
|
|
3653
|
-
[
|
|
3654
|
-
[
|
|
3599
|
+
[Et],
|
|
3600
|
+
[yt]
|
|
3655
3601
|
]);
|
|
3656
3602
|
}
|
|
3657
3603
|
onRendered() {
|
|
3658
3604
|
this._registerRenderModules(), Ft(this._injector, [
|
|
3605
|
+
[Tt],
|
|
3659
3606
|
[Ot],
|
|
3660
3607
|
[Ut],
|
|
3661
|
-
[
|
|
3662
|
-
[Mt]
|
|
3663
|
-
[yt]
|
|
3608
|
+
[bt],
|
|
3609
|
+
[Mt]
|
|
3664
3610
|
]);
|
|
3665
3611
|
}
|
|
3666
3612
|
onSteady() {
|
|
@@ -3668,38 +3614,38 @@ let At = class extends Qr {
|
|
|
3668
3614
|
}
|
|
3669
3615
|
_registerRenderModules() {
|
|
3670
3616
|
[
|
|
3671
|
-
[
|
|
3672
|
-
[
|
|
3673
|
-
[
|
|
3674
|
-
[
|
|
3617
|
+
[Qe],
|
|
3618
|
+
[rn],
|
|
3619
|
+
[tn],
|
|
3620
|
+
[en]
|
|
3675
3621
|
].forEach((i) => {
|
|
3676
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3622
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(F.UNIVER_SHEET, i));
|
|
3677
3623
|
});
|
|
3678
3624
|
}
|
|
3679
3625
|
};
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
],
|
|
3626
|
+
Dr(Pt, "type", F.UNIVER_SHEET);
|
|
3627
|
+
Dr(Pt, "pluginName", qs);
|
|
3628
|
+
Pt = Zs([
|
|
3629
|
+
Gr(Qr, Jr, si, di),
|
|
3630
|
+
Lt(1, A(Ye)),
|
|
3631
|
+
Lt(2, Z),
|
|
3632
|
+
Lt(3, Lr)
|
|
3633
|
+
], Pt);
|
|
3688
3634
|
export {
|
|
3689
3635
|
Y as ClearSheetDrawingTransformerOperation,
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3636
|
+
Ir as DeleteDrawingsCommand,
|
|
3637
|
+
fr as EditSheetDrawingOperation,
|
|
3638
|
+
mr as GroupSheetDrawingCommand,
|
|
3693
3639
|
Bt as InsertFloatImageCommand,
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3640
|
+
kt as InsertSheetDrawingCommand,
|
|
3641
|
+
rt as MoveDrawingsCommand,
|
|
3642
|
+
nt as RemoveSheetDrawingCommand,
|
|
3643
|
+
Cr as SHEETS_IMAGE_MENU_ID,
|
|
3644
|
+
pr as SetDrawingArrangeCommand,
|
|
3645
|
+
Wt as SetSheetDrawingCommand,
|
|
3646
|
+
et as SheetCanvasFloatDomManagerService,
|
|
3647
|
+
Qe as SheetDrawingUpdateController,
|
|
3648
|
+
gr as SidebarSheetDrawingOperation,
|
|
3649
|
+
wr as UngroupSheetDrawingCommand,
|
|
3650
|
+
Pt as UniverSheetsDrawingUIPlugin
|
|
3705
3651
|
};
|