@univerjs/sheets-drawing-ui 0.6.0-nightly.202502051606 → 0.6.0-nightly.202502071606
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 +1 -1
- package/lib/es/index.js +1106 -1101
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +6 -1
- package/lib/umd/index.js +1 -1
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
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 { SheetCanvasPopManagerService as
|
|
11
|
-
import { ISidebarService as
|
|
12
|
-
import { takeUntil as
|
|
13
|
-
import { SheetInterceptorService as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import
|
|
16
|
-
import { docDrawingPositionToTransform as
|
|
17
|
-
import { MessageType as
|
|
18
|
-
const
|
|
1
|
+
var Or = Object.defineProperty;
|
|
2
|
+
var Er = (i, e, n) => e in i ? Or(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var Q = (i, e, n) => Er(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CommandType as te, ICommandService as k, IUndoRedoService as Le, sequenceExecute as Nn, LocaleService as Lt, IUniverInstanceService as Fe, useDependency as De, Inject as N, Injector as et, IContextService as jn, RxDisposable as Pr, UniverInstanceType as H, connectInjector as Ur, toDisposable as Ar, FOCUSING_COMMON_DRAWINGS as $e, DrawingTypeEnum as F, Disposable as le, ArrangeTypeEnum as ft, createDocumentModelWithStyle as Nr, ObjectRelativeFromH as jr, ObjectRelativeFromV as Br, BooleanNumber as Wr, PositionedObjectLayoutType as $r, WrapTextType as xr, BuildTextUtils as Lr, Range as Fr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as mt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as pt, InterceptorEffectEnum as Yr, ObjectMatrix as kr, Tools as Me, UserManagerService as Gr, IPermissionService as Xr, Rectangle as Vr, Direction as ve, FOCUSING_FX_BAR_EDITOR as Hr, EDITOR_ACTIVATED as zr, FOCUSING_PANEL_EDITOR as Kr, LifecycleService as Zr, LifecycleStages as Jr, DisposableCollection as wt, fromEventSubject as qr, generateRandomId as zt, DependentOn as Qr, Plugin as ei, merge as ti, registerDependencies as ni, touchDependencies as Kt, IConfigService as ri } from "@univerjs/core";
|
|
5
|
+
import { DocDrawingController as ii, UniverDocsDrawingPlugin as si } from "@univerjs/docs-drawing";
|
|
6
|
+
import { SetDrawingSelectedOperation as Ft, IImageIoService as Bn, IDrawingManagerService as oe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as _n, DRAWING_IMAGE_COUNT_LIMIT as vn, ImageUploadStatusType as Ae, DRAWING_IMAGE_ALLOW_SIZE as Sn, getImageSize as In, DRAWING_IMAGE_WIDTH_LIMIT as Cn, DRAWING_IMAGE_HEIGHT_LIMIT as bn, ImageSourceType as oi, getDrawingShapeKeyByDrawingSearch as Se, UniverDrawingPlugin as ai } from "@univerjs/drawing";
|
|
7
|
+
import { ImageCropperObject as ci, COMPONENT_IMAGE_POPUP_MENU as di, OpenImageCropOperation as li, ImageResetSizeOperation as ui, DrawingRenderService as Wn, DrawingCommonPanel as hi, UniverDrawingUIPlugin as gi } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as ne, precisionTo as _t, getGroupState as fi, transformObjectOutOfGroup as mi, RENDER_CLASS_TYPE as Ne, Rect as je, ObjectType as Rn, DRAWING_OBJECT_LAYER_INDEX as Zt, SHEET_VIEWPORT_KEY as $n } from "@univerjs/engine-render";
|
|
9
|
+
import { ISheetDrawingService as ae, SetDrawingApplyMutation as U, DrawingApplyType as A, SheetDrawingAnchorType as P, UniverSheetsDrawingPlugin as pi } from "@univerjs/sheets-drawing";
|
|
10
|
+
import { SheetCanvasPopManagerService as wi, convertPositionSheetOverGridToAbsolute as _i, ISheetSelectionRenderService as Ye, SheetSkeletonManagerService as X, attachRangeWithCoord as xn, IEditorBridgeService as vi, IAutoFillService as Si, HoverManagerService as Ii, PREDEFINED_HOOK_NAME as We, COPY_TYPE as Ie, discreteRangeToRange as Dn, virtualizeDiscreteRanges as Ci, ISheetClipboardService as bi, SheetPrintInterceptorService as Ri, getCurrentRangeDisable$ as Di, SetZoomRatioOperation as Mn, SetScrollOperation as Mi } from "@univerjs/sheets-ui";
|
|
11
|
+
import { ISidebarService as yi, IUIPartsService as Ti, BuiltInUIPart as Oi, ILocalFileService as Ei, IMessageService as Pi, IClipboardInterfaceService as Ui, MenuItemType as dn, getMenuHiddenObservable as Ln, RibbonStartGroup as Ai, KeyCode as xe, ComponentManager as Ni, IMenuManagerService as ji, IShortcutService as Bi, CanvasFloatDomService as Wi } from "@univerjs/ui";
|
|
12
|
+
import { takeUntil as yn, combineLatest as vt, map as qe, filter as Je, distinctUntilChanged as St, Subject as Jt, take as $i, BehaviorSubject as He, switchMap as Tn, of as On } from "rxjs";
|
|
13
|
+
import { SheetInterceptorService as Yt, getSheetCommandTarget as V, SheetsSelectionsService as ln, SetRangeValuesCommand as xi, SetWorksheetRowHeightMutation as Fn, SetWorksheetColWidthMutation as Yn, SetWorksheetRowIsAutoHeightMutation as Li, SetWorksheetRowAutoHeightMutation as kn, AddWorksheetMergeMutation as Fi, RemoveWorksheetMergeMutation as Yi, AFTER_CELL_EDIT as ki, INTERCEPTOR_POINT as Gi, InterceptCellContentPriority as Xi, WorkbookViewPermission as En, WorksheetViewPermission as qt, WorkbookEditablePermission as tn, WorksheetEditPermission as Tt, InsertRowCommand as Gn, InsertColCommand as Xn, RemoveRowCommand as Vn, RemoveColCommand as Hn, DeleteRangeMoveLeftCommand as zn, DeleteRangeMoveUpCommand as Kn, InsertRangeMoveDownCommand as Zn, InsertRangeMoveRightCommand as Jn, DeltaRowHeightCommand as nn, SetRowHeightCommand as rn, DeltaColumnWidthCommand as qn, SetColWidthCommand as Qn, SetRowHiddenCommand as er, SetSpecificRowsVisibleCommand as tr, SetSpecificColsVisibleCommand as nr, SetColHiddenCommand as rr, MoveColsCommand as ir, MoveRowsCommand as sr, MoveRangeCommand as or, SetRowVisibleMutation as Vi, SetRowHiddenMutation as Hi, SetColVisibleMutation as zi, SetColHiddenMutation as Ki, SetWorksheetActiveOperation as Zi, RangeProtectionPermissionEditPoint as Ji, SetFrozenMutation as qi, COMMAND_LISTENER_SKELETON_CHANGE as Qi } from "@univerjs/sheets";
|
|
14
|
+
import { jsx as ee, jsxs as Ot } from "react/jsx-runtime";
|
|
15
|
+
import es, { useEffect as un, forwardRef as ar, useRef as ts, createElement as cr, useState as sn } from "react";
|
|
16
|
+
import { docDrawingPositionToTransform as ns, ReplaceSnapshotCommand as rs } from "@univerjs/docs-ui";
|
|
17
|
+
import { MessageType as Ce, RadioGroup as is, Radio as Qt } from "@univerjs/design";
|
|
18
|
+
const ss = "sheets-drawing-ui.config", Pn = {}, L = {
|
|
19
19
|
id: "sheet.operation.clear-drawing-transformer",
|
|
20
|
-
type:
|
|
20
|
+
type: te.MUTATION,
|
|
21
21
|
handler: (i, e) => {
|
|
22
|
-
const n = i.get(
|
|
22
|
+
const n = i.get(ne);
|
|
23
23
|
return e.forEach((t) => {
|
|
24
24
|
var r, s;
|
|
25
25
|
(s = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
|
|
26
26
|
}), !0;
|
|
27
27
|
}
|
|
28
|
-
},
|
|
28
|
+
}, tt = {
|
|
29
29
|
id: "sheet.command.remove-sheet-image",
|
|
30
|
-
type:
|
|
30
|
+
type: te.COMMAND,
|
|
31
31
|
handler: (i, e) => {
|
|
32
|
-
var S,
|
|
33
|
-
const n = i.get(
|
|
32
|
+
var S, C, D;
|
|
33
|
+
const n = i.get(k), t = i.get(Le), r = i.get(Yt), s = i.get(ae);
|
|
34
34
|
if (!e) return !1;
|
|
35
35
|
const { drawings: o } = e, c = [];
|
|
36
36
|
o.forEach((v) => {
|
|
37
|
-
const { unitId:
|
|
38
|
-
c.push(
|
|
37
|
+
const { unitId: b } = v;
|
|
38
|
+
c.push(b);
|
|
39
39
|
});
|
|
40
|
-
const a = s.getBatchRemoveOp(o), { unitId: g, subUnitId: d, undo: l, redo: h, objects: u } = a, m = r.onCommandExecute({ id:
|
|
41
|
-
return
|
|
40
|
+
const a = s.getBatchRemoveOp(o), { unitId: g, subUnitId: d, undo: l, redo: h, objects: u } = a, m = r.onCommandExecute({ id: tt.id, params: e }), p = { id: U.id, params: { unitId: g, subUnitId: d, op: h, objects: u, type: A.REMOVE } }, f = { id: U.id, params: { unitId: g, subUnitId: d, op: l, objects: u, type: A.INSERT } };
|
|
41
|
+
return Nn([...(S = m.preRedos) != null ? S : [], p, ...m.redos], n) ? (t.pushUndoRedo({
|
|
42
42
|
unitID: g,
|
|
43
43
|
undoMutations: [
|
|
44
|
-
...(
|
|
44
|
+
...(C = m.preUndos) != null ? C : [],
|
|
45
45
|
f,
|
|
46
46
|
...m.undos,
|
|
47
|
-
{ id:
|
|
47
|
+
{ id: L.id, params: c }
|
|
48
48
|
],
|
|
49
49
|
redoMutations: [
|
|
50
50
|
...(D = m.preRedos) != null ? D : [],
|
|
51
51
|
p,
|
|
52
52
|
...m.redos,
|
|
53
|
-
{ id:
|
|
53
|
+
{ id: L.id, params: c }
|
|
54
54
|
]
|
|
55
55
|
}), !0) : !1;
|
|
56
56
|
}
|
|
57
|
-
},
|
|
57
|
+
}, dr = "COMPONENT_SHEET_DRAWING_PANEL", lr = {
|
|
58
58
|
id: "sidebar.operation.sheet-image",
|
|
59
|
-
type:
|
|
59
|
+
type: te.COMMAND,
|
|
60
60
|
handler: async (i, e) => {
|
|
61
|
-
const n = i.get(
|
|
62
|
-
if (!
|
|
61
|
+
const n = i.get(yi), t = i.get(Lt), r = i.get(Fe), s = i.get(k);
|
|
62
|
+
if (!V(r)) return !1;
|
|
63
63
|
switch (e.value) {
|
|
64
64
|
case "open":
|
|
65
65
|
n.open({
|
|
66
66
|
header: { title: t.t("sheetImage.panel.title") },
|
|
67
|
-
children: { label:
|
|
67
|
+
children: { label: dr },
|
|
68
68
|
onClose: () => {
|
|
69
|
-
s.syncExecuteCommand(
|
|
69
|
+
s.syncExecuteCommand(Ft.id, []);
|
|
70
70
|
},
|
|
71
71
|
width: 360
|
|
72
72
|
});
|
|
@@ -78,46 +78,46 @@ const ns = "sheets-drawing-ui.config", Tn = {}, x = {
|
|
|
78
78
|
}
|
|
79
79
|
return !0;
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, ur = {
|
|
82
82
|
id: "sheet.operation.edit-sheet-image",
|
|
83
|
-
type:
|
|
83
|
+
type: te.OPERATION,
|
|
84
84
|
handler: (i, e) => {
|
|
85
|
-
const n = i.get(
|
|
86
|
-
return e == null ? !1 : (n.syncExecuteCommand(
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
uploadLoading:
|
|
90
|
-
uploadLoadingBody:
|
|
91
|
-
uploadLoadingBodyAnimation:
|
|
92
|
-
univerCircleAnimation:
|
|
93
|
-
uploadLoadingBodyText:
|
|
94
|
-
},
|
|
95
|
-
const i =
|
|
96
|
-
return
|
|
85
|
+
const n = i.get(k);
|
|
86
|
+
return e == null ? !1 : (n.syncExecuteCommand(Ft.id, [e]), n.executeCommand(lr.id, { value: "open" }), !0);
|
|
87
|
+
}
|
|
88
|
+
}, os = "univer-upload-loading", as = "univer-upload-loading-body", cs = "univer-upload-loading-body-animation", ds = "univer-UniverCircleAnimation", ls = "univer-upload-loading-body-text", It = {
|
|
89
|
+
uploadLoading: os,
|
|
90
|
+
uploadLoadingBody: as,
|
|
91
|
+
uploadLoadingBodyAnimation: cs,
|
|
92
|
+
univerCircleAnimation: ds,
|
|
93
|
+
uploadLoadingBodyText: ls
|
|
94
|
+
}, us = () => {
|
|
95
|
+
const i = De(Bn), e = De(Lt), [n, t] = es.useState(0);
|
|
96
|
+
return un(() => {
|
|
97
97
|
const r = i.change$.subscribe((s) => {
|
|
98
98
|
t(s);
|
|
99
99
|
});
|
|
100
100
|
return () => {
|
|
101
101
|
r.unsubscribe();
|
|
102
102
|
};
|
|
103
|
-
}, [i]), /* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
103
|
+
}, [i]), /* @__PURE__ */ ee("div", { style: { display: n > 0 ? "block" : "none" }, className: It.uploadLoading, children: /* @__PURE__ */ Ot("div", { className: It.uploadLoadingBody, children: [
|
|
104
|
+
/* @__PURE__ */ ee("div", { className: It.uploadLoadingBodyAnimation }),
|
|
105
|
+
/* @__PURE__ */ ee("div", { className: It.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${n}` })
|
|
106
106
|
] }) });
|
|
107
107
|
};
|
|
108
|
-
var
|
|
109
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
108
|
+
var hs = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, fs = (i, e, n, t) => {
|
|
109
|
+
for (var r = t > 1 ? void 0 : t ? gs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
110
110
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
111
|
-
return t && r &&
|
|
112
|
-
},
|
|
113
|
-
let
|
|
111
|
+
return t && r && hs(e, n, r), r;
|
|
112
|
+
}, pe = (i, e) => (n, t) => e(n, t, i);
|
|
113
|
+
let Et = class extends Pr {
|
|
114
114
|
constructor(e, n, t, r, s, o, c, a) {
|
|
115
115
|
super();
|
|
116
|
-
|
|
116
|
+
Q(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
117
117
|
this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = c, this._commandService = a, this._init();
|
|
118
118
|
}
|
|
119
119
|
_init() {
|
|
120
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
120
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(H.UNIVER_SHEET).pipe(yn(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(H.UNIVER_SHEET).pipe(yn(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(H.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(Oi.CONTENT, () => Ur(us, this._injector));
|
|
121
121
|
}
|
|
122
122
|
_dispose(e) {
|
|
123
123
|
const n = e.getUnitId();
|
|
@@ -132,7 +132,7 @@ let Ot = class extends Tr {
|
|
|
132
132
|
_hasCropObject(e) {
|
|
133
133
|
const n = e.getAllObjectsByOrder();
|
|
134
134
|
for (const t of n)
|
|
135
|
-
if (t instanceof
|
|
135
|
+
if (t instanceof ci)
|
|
136
136
|
return !0;
|
|
137
137
|
return !1;
|
|
138
138
|
}
|
|
@@ -146,9 +146,9 @@ let Ot = class extends Tr {
|
|
|
146
146
|
return;
|
|
147
147
|
let r;
|
|
148
148
|
this.disposeWithMe(
|
|
149
|
-
|
|
149
|
+
Ar(
|
|
150
150
|
t.createControl$.subscribe(() => {
|
|
151
|
-
if (this._contextService.setContextValue(
|
|
151
|
+
if (this._contextService.setContextValue($e, !0), this._hasCropObject(n))
|
|
152
152
|
return;
|
|
153
153
|
const o = t.getSelectedObjectMap();
|
|
154
154
|
if (o.size > 1) {
|
|
@@ -167,7 +167,7 @@ let Ot = class extends Tr {
|
|
|
167
167
|
r == null || r.dispose();
|
|
168
168
|
const p = this._canvasPopManagerService.getFeatureMenu(d, l, h, u);
|
|
169
169
|
r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(c, {
|
|
170
|
-
componentKey:
|
|
170
|
+
componentKey: di,
|
|
171
171
|
direction: "horizontal",
|
|
172
172
|
offset: [2, 0],
|
|
173
173
|
extraProps: {
|
|
@@ -178,11 +178,11 @@ let Ot = class extends Tr {
|
|
|
178
178
|
)
|
|
179
179
|
), this.disposeWithMe(
|
|
180
180
|
t.clearControl$.subscribe(() => {
|
|
181
|
-
r == null || r.dispose(), this._contextService.setContextValue(
|
|
181
|
+
r == null || r.dispose(), this._contextService.setContextValue($e, !1), this._commandService.syncExecuteCommand(Ft.id, []);
|
|
182
182
|
})
|
|
183
183
|
), this.disposeWithMe(
|
|
184
184
|
this._contextService.contextChanged$.subscribe((o) => {
|
|
185
|
-
o[
|
|
185
|
+
o[$e] === !1 && (r == null || r.dispose());
|
|
186
186
|
})
|
|
187
187
|
), this.disposeWithMe(
|
|
188
188
|
t.changing$.subscribe(() => {
|
|
@@ -195,49 +195,49 @@ let Ot = class extends Tr {
|
|
|
195
195
|
{
|
|
196
196
|
label: "image-popup.edit",
|
|
197
197
|
index: 0,
|
|
198
|
-
commandId:
|
|
198
|
+
commandId: ur.id,
|
|
199
199
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
200
|
-
disable: r ===
|
|
200
|
+
disable: r === F.DRAWING_DOM
|
|
201
201
|
},
|
|
202
202
|
{
|
|
203
203
|
label: "image-popup.delete",
|
|
204
204
|
index: 1,
|
|
205
|
-
commandId:
|
|
205
|
+
commandId: tt.id,
|
|
206
206
|
commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
|
|
207
207
|
disable: !1
|
|
208
208
|
},
|
|
209
209
|
{
|
|
210
210
|
label: "image-popup.crop",
|
|
211
211
|
index: 2,
|
|
212
|
-
commandId:
|
|
212
|
+
commandId: li.id,
|
|
213
213
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
214
|
-
disable: r ===
|
|
214
|
+
disable: r === F.DRAWING_DOM
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
217
|
label: "image-popup.reset",
|
|
218
218
|
index: 3,
|
|
219
|
-
commandId:
|
|
219
|
+
commandId: ui.id,
|
|
220
220
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
221
|
-
disable: r ===
|
|
221
|
+
disable: r === F.DRAWING_DOM
|
|
222
222
|
}
|
|
223
223
|
];
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
],
|
|
236
|
-
function
|
|
226
|
+
Et = fs([
|
|
227
|
+
pe(0, N(et)),
|
|
228
|
+
pe(1, oe),
|
|
229
|
+
pe(2, N(wi)),
|
|
230
|
+
pe(3, ne),
|
|
231
|
+
pe(4, Fe),
|
|
232
|
+
pe(5, jn),
|
|
233
|
+
pe(6, N(Ti)),
|
|
234
|
+
pe(7, k)
|
|
235
|
+
], Et);
|
|
236
|
+
function z(i, e, n) {
|
|
237
237
|
const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: c = 0, skewX: a = 0, skewY: g = 0 } = i, d = n.getCurrent();
|
|
238
238
|
if (d == null)
|
|
239
239
|
return;
|
|
240
|
-
const l =
|
|
240
|
+
const l = _i(
|
|
241
241
|
d.unitId,
|
|
242
242
|
d.sheetId,
|
|
243
243
|
{ from: t, to: r },
|
|
@@ -257,23 +257,23 @@ function V(i, e, n) {
|
|
|
257
257
|
height: p
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function x(i, e) {
|
|
261
261
|
const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: c = !1, angle: a = 0, skewX: g = 0, skewY: d = 0 } = i, l = e.getCellWithCoordByOffset(n, t);
|
|
262
262
|
if (l == null)
|
|
263
263
|
return;
|
|
264
264
|
const h = {
|
|
265
265
|
column: l.actualColumn,
|
|
266
|
-
columnOffset:
|
|
266
|
+
columnOffset: _t(n - l.startX, 1),
|
|
267
267
|
row: l.actualRow,
|
|
268
|
-
rowOffset:
|
|
268
|
+
rowOffset: _t(t - l.startY, 1)
|
|
269
269
|
}, u = e.getCellWithCoordByOffset(n + r, t + s);
|
|
270
270
|
if (u == null)
|
|
271
271
|
return;
|
|
272
272
|
const m = {
|
|
273
273
|
column: u.actualColumn,
|
|
274
|
-
columnOffset:
|
|
274
|
+
columnOffset: _t(n + r - u.startX, 1),
|
|
275
275
|
row: u.actualRow,
|
|
276
|
-
rowOffset:
|
|
276
|
+
rowOffset: _t(t + s - u.startY, 1)
|
|
277
277
|
};
|
|
278
278
|
return {
|
|
279
279
|
flipY: o,
|
|
@@ -285,12 +285,12 @@ function $(i, e) {
|
|
|
285
285
|
to: m
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
|
-
var
|
|
289
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
288
|
+
var ms = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, ws = (i, e, n, t) => {
|
|
289
|
+
for (var r = t > 1 ? void 0 : t ? ps(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
290
290
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
291
|
-
return t && r &&
|
|
292
|
-
},
|
|
293
|
-
let
|
|
291
|
+
return t && r && ms(e, n, r), r;
|
|
292
|
+
}, Ct = (i, e) => (n, t) => e(n, t, i);
|
|
293
|
+
let on = class extends le {
|
|
294
294
|
constructor(i, e, n, t, r) {
|
|
295
295
|
super(), this._context = i, this._sheetDrawingService = e, this._drawingManagerService = n, this._sheetSelectionRenderService = t, this._sheetSkeletonManagerService = r, this._init();
|
|
296
296
|
}
|
|
@@ -304,22 +304,22 @@ let sn = class extends oe {
|
|
|
304
304
|
const n = i[e];
|
|
305
305
|
for (const t in n.data) {
|
|
306
306
|
const r = n.data[t];
|
|
307
|
-
r.transform =
|
|
307
|
+
r.transform = z(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
311
311
|
}
|
|
312
312
|
};
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
],
|
|
319
|
-
function
|
|
313
|
+
on = ws([
|
|
314
|
+
Ct(1, ae),
|
|
315
|
+
Ct(2, oe),
|
|
316
|
+
Ct(3, N(Ye)),
|
|
317
|
+
Ct(4, N(X))
|
|
318
|
+
], on);
|
|
319
|
+
function _s(i) {
|
|
320
320
|
const e = [];
|
|
321
321
|
return i.forEach((n) => {
|
|
322
|
-
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: c } = t, a =
|
|
322
|
+
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: c } = t, a = fi(0, 0, r.map((l) => l.transform || {})), g = r.map((l) => {
|
|
323
323
|
const h = l.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: m, drawingId: p } = l;
|
|
324
324
|
return {
|
|
325
325
|
unitId: u,
|
|
@@ -336,7 +336,7 @@ function fs(i) {
|
|
|
336
336
|
unitId: s,
|
|
337
337
|
subUnitId: o,
|
|
338
338
|
drawingId: c,
|
|
339
|
-
drawingType:
|
|
339
|
+
drawingType: F.DRAWING_GROUP,
|
|
340
340
|
transform: a
|
|
341
341
|
};
|
|
342
342
|
e.push({
|
|
@@ -345,14 +345,14 @@ function fs(i) {
|
|
|
345
345
|
});
|
|
346
346
|
}), e;
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function vs(i) {
|
|
349
349
|
const e = [];
|
|
350
350
|
return i.forEach((n) => {
|
|
351
351
|
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: c, transform: a = { width: 0, height: 0 } } = t;
|
|
352
352
|
if (a == null)
|
|
353
353
|
return;
|
|
354
354
|
const g = r.map((l) => {
|
|
355
|
-
const { transform: h } = l, { unitId: u, subUnitId: m, drawingId: p } = l, f =
|
|
355
|
+
const { transform: h } = l, { unitId: u, subUnitId: m, drawingId: p } = l, f = mi(h || {}, a, a.width || 0, a.height || 0);
|
|
356
356
|
return {
|
|
357
357
|
unitId: u,
|
|
358
358
|
subUnitId: m,
|
|
@@ -364,7 +364,7 @@ function ps(i) {
|
|
|
364
364
|
unitId: s,
|
|
365
365
|
subUnitId: o,
|
|
366
366
|
drawingId: c,
|
|
367
|
-
drawingType:
|
|
367
|
+
drawingType: F.DRAWING_GROUP,
|
|
368
368
|
transform: {
|
|
369
369
|
left: 0,
|
|
370
370
|
top: 0
|
|
@@ -376,11 +376,11 @@ function ps(i) {
|
|
|
376
376
|
});
|
|
377
377
|
}), e;
|
|
378
378
|
}
|
|
379
|
-
const
|
|
379
|
+
const hr = {
|
|
380
380
|
id: "sheet.command.group-sheet-image",
|
|
381
|
-
type:
|
|
381
|
+
type: te.COMMAND,
|
|
382
382
|
handler: (i, e) => {
|
|
383
|
-
const n = i.get(
|
|
383
|
+
const n = i.get(k), t = i.get(Le), r = i.get(ae);
|
|
384
384
|
if (!e) return !1;
|
|
385
385
|
const s = [];
|
|
386
386
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -389,87 +389,87 @@ const dr = {
|
|
|
389
389
|
});
|
|
390
390
|
});
|
|
391
391
|
const o = r.getGroupDrawingOp(e), { unitId: c, subUnitId: a, undo: g, redo: d, objects: l } = o;
|
|
392
|
-
return n.syncExecuteCommand(
|
|
392
|
+
return n.syncExecuteCommand(U.id, { op: d, unitId: c, subUnitId: a, objects: l, type: A.GROUP }) ? (t.pushUndoRedo({
|
|
393
393
|
unitID: c,
|
|
394
394
|
undoMutations: [
|
|
395
|
-
{ id:
|
|
396
|
-
{ id:
|
|
395
|
+
{ id: U.id, params: { op: g, unitId: c, subUnitId: a, objects: vs(l), type: A.UNGROUP } },
|
|
396
|
+
{ id: L.id, params: s }
|
|
397
397
|
],
|
|
398
398
|
redoMutations: [
|
|
399
|
-
{ id:
|
|
400
|
-
{ id:
|
|
399
|
+
{ id: U.id, params: { op: d, unitId: c, subUnitId: a, objects: l, type: A.GROUP } },
|
|
400
|
+
{ id: L.id, params: s }
|
|
401
401
|
]
|
|
402
402
|
}), !0) : !1;
|
|
403
403
|
}
|
|
404
|
-
},
|
|
404
|
+
}, kt = {
|
|
405
405
|
id: "sheet.command.insert-sheet-image",
|
|
406
|
-
type:
|
|
406
|
+
type: te.COMMAND,
|
|
407
407
|
handler: (i, e) => {
|
|
408
|
-
var S,
|
|
409
|
-
const n = i.get(
|
|
408
|
+
var S, C, D;
|
|
409
|
+
const n = i.get(k), t = i.get(Le), r = i.get(ae), s = i.get(Yt);
|
|
410
410
|
if (!e) return !1;
|
|
411
|
-
const o = e.drawings, c = o.map((v) => v.unitId), a = r.getBatchAddOp(o), { unitId: g, subUnitId: d, undo: l, redo: h, objects: u } = a, m = s.onCommandExecute({ id:
|
|
412
|
-
return
|
|
411
|
+
const o = e.drawings, c = o.map((v) => v.unitId), a = r.getBatchAddOp(o), { unitId: g, subUnitId: d, undo: l, redo: h, objects: u } = a, m = s.onCommandExecute({ id: kt.id, params: e }), p = { id: U.id, params: { op: h, unitId: g, subUnitId: d, objects: u, type: A.INSERT } }, f = { id: U.id, params: { op: l, unitId: g, subUnitId: d, objects: u, type: A.REMOVE } };
|
|
412
|
+
return Nn([...(S = m.preRedos) != null ? S : [], p, ...m.redos], n) ? (t.pushUndoRedo({
|
|
413
413
|
unitID: g,
|
|
414
414
|
undoMutations: [
|
|
415
|
-
...(
|
|
415
|
+
...(C = m.preUndos) != null ? C : [],
|
|
416
416
|
f,
|
|
417
417
|
...m.undos,
|
|
418
|
-
{ id:
|
|
418
|
+
{ id: L.id, params: c }
|
|
419
419
|
],
|
|
420
420
|
redoMutations: [
|
|
421
421
|
...(D = m.preRedos) != null ? D : [],
|
|
422
422
|
p,
|
|
423
423
|
...m.redos,
|
|
424
|
-
{ id:
|
|
424
|
+
{ id: L.id, params: c }
|
|
425
425
|
]
|
|
426
426
|
}), !0) : !1;
|
|
427
427
|
}
|
|
428
|
-
},
|
|
428
|
+
}, gr = {
|
|
429
429
|
id: "sheet.command.set-drawing-arrange",
|
|
430
|
-
type:
|
|
430
|
+
type: te.COMMAND,
|
|
431
431
|
handler: (i, e) => {
|
|
432
|
-
const n = i.get(
|
|
432
|
+
const n = i.get(k), t = i.get(Le);
|
|
433
433
|
if (!e) return !1;
|
|
434
|
-
const r = i.get(
|
|
434
|
+
const r = i.get(ae), { unitId: s, subUnitId: o, drawingIds: c, arrangeType: a } = e, g = { unitId: s, subUnitId: o, drawingIds: c };
|
|
435
435
|
let d;
|
|
436
|
-
if (a ===
|
|
436
|
+
if (a === ft.forward ? d = r.getForwardDrawingsOp(g) : a === ft.backward ? d = r.getBackwardDrawingOp(g) : a === ft.front ? d = r.getFrontDrawingsOp(g) : a === ft.back && (d = r.getBackDrawingsOp(g)), d == null)
|
|
437
437
|
return !1;
|
|
438
438
|
const { objects: l, redo: h, undo: u } = d;
|
|
439
|
-
return n.syncExecuteCommand(
|
|
439
|
+
return n.syncExecuteCommand(U.id, { op: h, unitId: s, subUnitId: o, objects: l, type: A.ARRANGE }) ? (t.pushUndoRedo({
|
|
440
440
|
unitID: s,
|
|
441
441
|
undoMutations: [
|
|
442
|
-
{ id:
|
|
442
|
+
{ id: U.id, params: { op: u, unitId: s, subUnitId: o, objects: l, type: A.ARRANGE } }
|
|
443
443
|
],
|
|
444
444
|
redoMutations: [
|
|
445
|
-
{ id:
|
|
445
|
+
{ id: U.id, params: { op: h, unitId: s, subUnitId: o, objects: l, type: A.ARRANGE } }
|
|
446
446
|
]
|
|
447
447
|
}), !0) : !1;
|
|
448
448
|
}
|
|
449
|
-
},
|
|
449
|
+
}, Gt = {
|
|
450
450
|
id: "sheet.command.set-sheet-image",
|
|
451
|
-
type:
|
|
451
|
+
type: te.COMMAND,
|
|
452
452
|
handler: (i, e) => {
|
|
453
|
-
const n = i.get(
|
|
453
|
+
const n = i.get(k), t = i.get(Le), r = i.get(ae);
|
|
454
454
|
if (!e) return !1;
|
|
455
455
|
const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: c, subUnitId: a, undo: g, redo: d, objects: l } = o;
|
|
456
|
-
return n.syncExecuteCommand(
|
|
456
|
+
return n.syncExecuteCommand(U.id, { unitId: c, subUnitId: a, op: d, objects: l, type: A.UPDATE }) ? (t.pushUndoRedo({
|
|
457
457
|
unitID: c,
|
|
458
458
|
undoMutations: [
|
|
459
|
-
{ id:
|
|
460
|
-
{ id:
|
|
459
|
+
{ id: U.id, params: { unitId: c, subUnitId: a, op: g, objects: l, type: A.UPDATE } },
|
|
460
|
+
{ id: L.id, params: [c] }
|
|
461
461
|
],
|
|
462
462
|
redoMutations: [
|
|
463
|
-
{ id:
|
|
464
|
-
{ id:
|
|
463
|
+
{ id: U.id, params: { unitId: c, subUnitId: a, op: d, objects: l, type: A.UPDATE } },
|
|
464
|
+
{ id: L.id, params: [c] }
|
|
465
465
|
]
|
|
466
466
|
}), !0) : !1;
|
|
467
467
|
}
|
|
468
|
-
},
|
|
468
|
+
}, fr = {
|
|
469
469
|
id: "sheet.command.ungroup-sheet-image",
|
|
470
|
-
type:
|
|
470
|
+
type: te.COMMAND,
|
|
471
471
|
handler: (i, e) => {
|
|
472
|
-
const n = i.get(
|
|
472
|
+
const n = i.get(k), t = i.get(Le), r = i.get(ae);
|
|
473
473
|
if (!e) return !1;
|
|
474
474
|
const s = [];
|
|
475
475
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -478,34 +478,34 @@ const dr = {
|
|
|
478
478
|
});
|
|
479
479
|
});
|
|
480
480
|
const o = r.getUngroupDrawingOp(e), { unitId: c, subUnitId: a, undo: g, redo: d, objects: l } = o;
|
|
481
|
-
return n.syncExecuteCommand(
|
|
481
|
+
return n.syncExecuteCommand(U.id, { op: d, unitId: c, subUnitId: a, objects: l, type: A.UNGROUP }) ? (t.pushUndoRedo({
|
|
482
482
|
unitID: c,
|
|
483
483
|
undoMutations: [
|
|
484
|
-
{ id:
|
|
485
|
-
{ id:
|
|
484
|
+
{ id: U.id, params: { op: g, unitId: c, subUnitId: a, objects: _s(l), type: A.GROUP } },
|
|
485
|
+
{ id: L.id, params: s }
|
|
486
486
|
],
|
|
487
487
|
redoMutations: [
|
|
488
|
-
{ id:
|
|
489
|
-
{ id:
|
|
488
|
+
{ id: U.id, params: { op: d, unitId: c, subUnitId: a, objects: l, type: A.UNGROUP } },
|
|
489
|
+
{ id: L.id, params: s }
|
|
490
490
|
]
|
|
491
491
|
}), !0) : !1;
|
|
492
492
|
}
|
|
493
493
|
};
|
|
494
|
-
var
|
|
495
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
494
|
+
var Ss = Object.defineProperty, Is = Object.getOwnPropertyDescriptor, Cs = (i, e, n, t) => {
|
|
495
|
+
for (var r = t > 1 ? void 0 : t ? Is(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
496
496
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
497
|
-
return t && r &&
|
|
498
|
-
},
|
|
499
|
-
function
|
|
497
|
+
return t && r && Ss(e, n, r), r;
|
|
498
|
+
}, ie = (i, e) => (n, t) => e(n, t, i);
|
|
499
|
+
function bs(i, e, n) {
|
|
500
500
|
const t = n * Math.PI / 180, r = Math.abs(i * Math.cos(t)) + Math.abs(e * Math.sin(t)), s = Math.abs(i * Math.sin(t)) + Math.abs(e * Math.cos(t));
|
|
501
501
|
return { rotatedWidth: r, rotatedHeight: s };
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function mr(i, e, n, t, r) {
|
|
504
504
|
var S;
|
|
505
|
-
const { rotatedHeight: s, rotatedWidth: o } =
|
|
505
|
+
const { rotatedHeight: s, rotatedWidth: o } = bs(n, t, r), a = i.get(ne).getRenderById(e.unitId);
|
|
506
506
|
if (!a)
|
|
507
507
|
return !1;
|
|
508
|
-
const d = (S = a.with(
|
|
508
|
+
const d = (S = a.with(X).getSkeletonParam(e.subUnitId)) == null ? void 0 : S.skeleton;
|
|
509
509
|
if (d == null)
|
|
510
510
|
return !1;
|
|
511
511
|
const l = d.getCellByIndex(e.row, e.col), h = l.mergeInfo.endX - l.mergeInfo.startX - 2, u = l.mergeInfo.endY - l.mergeInfo.startY - 2, m = o / s, f = Math.ceil(Math.min(h, u * m)) / o, w = !f || Number.isNaN(f) ? 1e-3 : f;
|
|
@@ -514,26 +514,26 @@ function hr(i, e, n, t, r) {
|
|
|
514
514
|
height: t * w
|
|
515
515
|
};
|
|
516
516
|
}
|
|
517
|
-
let
|
|
517
|
+
let Qe = class extends le {
|
|
518
518
|
constructor(e, n, t, r, s, o, c, a, g, d, l, h, u) {
|
|
519
519
|
super();
|
|
520
|
-
|
|
520
|
+
Q(this, "_workbookSelections");
|
|
521
521
|
this._context = e, this._skeletonManagerService = n, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = c, this._drawingManagerService = a, this._contextService = g, this._messageService = d, this._localeService = l, this._injector = u, this._workbookSelections = h.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
|
|
522
522
|
}
|
|
523
523
|
async insertFloatImage() {
|
|
524
524
|
const e = await this._fileOpenerService.openFile({
|
|
525
525
|
multiple: !0,
|
|
526
|
-
accept:
|
|
526
|
+
accept: _n.map((t) => `.${t.replace("image/", "")}`).join(",")
|
|
527
527
|
}), n = e.length;
|
|
528
|
-
return n >
|
|
529
|
-
type:
|
|
530
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
528
|
+
return n > vn ? (this._messageService.show({
|
|
529
|
+
type: Ce.Error,
|
|
530
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(vn))
|
|
531
531
|
}), !1) : n === 0 ? !1 : (e.forEach(async (t) => await this.insertFloatImageByFile(t)), !0);
|
|
532
532
|
}
|
|
533
533
|
async insertCellImage() {
|
|
534
534
|
const n = (await this._fileOpenerService.openFile({
|
|
535
535
|
multiple: !1,
|
|
536
|
-
accept:
|
|
536
|
+
accept: _n.map((t) => `.${t.replace("image/", "")}`).join(",")
|
|
537
537
|
}))[0];
|
|
538
538
|
return n ? (await this._insertCellImage(n), !0) : !1;
|
|
539
539
|
}
|
|
@@ -542,26 +542,26 @@ let qe = class extends oe {
|
|
|
542
542
|
try {
|
|
543
543
|
n = await this._imageIoService.saveImage(e);
|
|
544
544
|
} catch (S) {
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
type:
|
|
548
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
549
|
-
}) :
|
|
550
|
-
type:
|
|
545
|
+
const C = S.message;
|
|
546
|
+
C === Ae.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
547
|
+
type: Ce.Error,
|
|
548
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Sn / (1024 * 1024)))
|
|
549
|
+
}) : C === Ae.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
550
|
+
type: Ce.Error,
|
|
551
551
|
content: this._localeService.t("update-status.invalidImageType")
|
|
552
|
-
}) :
|
|
553
|
-
type:
|
|
552
|
+
}) : C === Ae.ERROR_IMAGE && this._messageService.show({
|
|
553
|
+
type: Ce.Error,
|
|
554
554
|
content: this._localeService.t("update-status.invalidImage")
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
557
|
if (n == null)
|
|
558
558
|
return;
|
|
559
|
-
const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: c, source: a, base64Cache: g } = n, { width: d, height: l, image: h } = await
|
|
559
|
+
const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: c, source: a, base64Cache: g } = n, { width: d, height: l, image: h } = await In(g || ""), { width: u, height: m } = this._context.scene;
|
|
560
560
|
this._imageIoService.addImageSourceCache(a, c, h);
|
|
561
561
|
let p = 1;
|
|
562
|
-
if (d >
|
|
563
|
-
const S =
|
|
564
|
-
p = Math.max(S,
|
|
562
|
+
if (d > Cn || l > bn) {
|
|
563
|
+
const S = Cn / d, C = bn / l;
|
|
564
|
+
p = Math.max(S, C);
|
|
565
565
|
}
|
|
566
566
|
const f = this._getImagePosition(d * p, l * p, u, m);
|
|
567
567
|
if (f == null)
|
|
@@ -570,13 +570,13 @@ let qe = class extends oe {
|
|
|
570
570
|
unitId: r,
|
|
571
571
|
subUnitId: s,
|
|
572
572
|
drawingId: o,
|
|
573
|
-
drawingType:
|
|
573
|
+
drawingType: F.DRAWING_IMAGE,
|
|
574
574
|
imageSourceType: c,
|
|
575
575
|
source: a,
|
|
576
|
-
transform:
|
|
576
|
+
transform: z(f, this._selectionRenderService, this._skeletonManagerService),
|
|
577
577
|
sheetTransform: f
|
|
578
578
|
};
|
|
579
|
-
return this._commandService.executeCommand(
|
|
579
|
+
return this._commandService.executeCommand(kt.id, {
|
|
580
580
|
unitId: r,
|
|
581
581
|
drawings: [w]
|
|
582
582
|
});
|
|
@@ -588,25 +588,25 @@ let qe = class extends oe {
|
|
|
588
588
|
n = await this._imageIoService.saveImage(e);
|
|
589
589
|
} catch (f) {
|
|
590
590
|
const w = f.message;
|
|
591
|
-
w ===
|
|
592
|
-
type:
|
|
593
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
594
|
-
}) : w ===
|
|
595
|
-
type:
|
|
591
|
+
w === Ae.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
592
|
+
type: Ce.Error,
|
|
593
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Sn / (1024 * 1024)))
|
|
594
|
+
}) : w === Ae.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
595
|
+
type: Ce.Error,
|
|
596
596
|
content: this._localeService.t("update-status.invalidImageType")
|
|
597
|
-
}) : w ===
|
|
598
|
-
type:
|
|
597
|
+
}) : w === Ae.ERROR_IMAGE && this._messageService.show({
|
|
598
|
+
type: Ce.Error,
|
|
599
599
|
content: this._localeService.t("update-status.invalidImage")
|
|
600
600
|
});
|
|
601
601
|
}
|
|
602
602
|
if (n == null)
|
|
603
603
|
return;
|
|
604
|
-
const { imageId: t, imageSourceType: r, source: s, base64Cache: o } = n, { width: c, height: a, image: g } = await
|
|
604
|
+
const { imageId: t, imageSourceType: r, source: s, base64Cache: o } = n, { width: c, height: a, image: g } = await In(o || "");
|
|
605
605
|
this._imageIoService.addImageSourceCache(s, r, g);
|
|
606
606
|
const d = this._workbookSelections.getCurrentLastSelection();
|
|
607
607
|
if (!d)
|
|
608
608
|
return !1;
|
|
609
|
-
const l =
|
|
609
|
+
const l = Nr("", {}), h = mr(
|
|
610
610
|
this._injector,
|
|
611
611
|
{
|
|
612
612
|
unitId: this._context.unitId,
|
|
@@ -626,11 +626,11 @@ let qe = class extends oe {
|
|
|
626
626
|
height: h.height
|
|
627
627
|
},
|
|
628
628
|
positionH: {
|
|
629
|
-
relativeFrom:
|
|
629
|
+
relativeFrom: jr.PAGE,
|
|
630
630
|
posOffset: 0
|
|
631
631
|
},
|
|
632
632
|
positionV: {
|
|
633
|
-
relativeFrom:
|
|
633
|
+
relativeFrom: Br.PARAGRAPH,
|
|
634
634
|
posOffset: 0
|
|
635
635
|
},
|
|
636
636
|
angle: 0
|
|
@@ -638,22 +638,22 @@ let qe = class extends oe {
|
|
|
638
638
|
unitId: l.getUnitId(),
|
|
639
639
|
subUnitId: l.getUnitId(),
|
|
640
640
|
drawingId: t,
|
|
641
|
-
drawingType:
|
|
641
|
+
drawingType: F.DRAWING_IMAGE,
|
|
642
642
|
imageSourceType: r,
|
|
643
643
|
source: s,
|
|
644
|
-
transform:
|
|
644
|
+
transform: ns(u),
|
|
645
645
|
docTransform: u,
|
|
646
|
-
behindDoc:
|
|
646
|
+
behindDoc: Wr.FALSE,
|
|
647
647
|
title: "",
|
|
648
648
|
description: "",
|
|
649
|
-
layoutType:
|
|
649
|
+
layoutType: $r.INLINE,
|
|
650
650
|
// Insert inline drawing by default.
|
|
651
|
-
wrapText:
|
|
651
|
+
wrapText: xr.BOTH_SIDES,
|
|
652
652
|
distB: 0,
|
|
653
653
|
distL: 0,
|
|
654
654
|
distR: 0,
|
|
655
655
|
distT: 0
|
|
656
|
-
}, p =
|
|
656
|
+
}, p = Lr.drawing.add({
|
|
657
657
|
documentDataModel: l,
|
|
658
658
|
drawings: [m],
|
|
659
659
|
selection: {
|
|
@@ -662,7 +662,7 @@ let qe = class extends oe {
|
|
|
662
662
|
endOffset: 0
|
|
663
663
|
}
|
|
664
664
|
});
|
|
665
|
-
return p ? (l.apply(p), this._commandService.syncExecuteCommand(
|
|
665
|
+
return p ? (l.apply(p), this._commandService.syncExecuteCommand(xi.id, {
|
|
666
666
|
value: {
|
|
667
667
|
[d.primary.actualRow]: {
|
|
668
668
|
[d.primary.actualColumn]: {
|
|
@@ -689,7 +689,7 @@ let qe = class extends oe {
|
|
|
689
689
|
endColumn: 0
|
|
690
690
|
};
|
|
691
691
|
s && s.length > 0 && (o = s[s.length - 1].range);
|
|
692
|
-
const c =
|
|
692
|
+
const c = xn(this._skeletonManagerService.getCurrent().skeleton, o);
|
|
693
693
|
if (c == null)
|
|
694
694
|
return;
|
|
695
695
|
let { startColumn: a, startRow: g, startX: d, startY: l } = c, h = !1;
|
|
@@ -721,7 +721,7 @@ let qe = class extends oe {
|
|
|
721
721
|
_updateOrderListener() {
|
|
722
722
|
this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
|
|
723
723
|
const { unitId: n, subUnitId: t, drawingIds: r, arrangeType: s } = e;
|
|
724
|
-
this._commandService.executeCommand(
|
|
724
|
+
this._commandService.executeCommand(gr.id, {
|
|
725
725
|
unitId: n,
|
|
726
726
|
subUnitId: t,
|
|
727
727
|
drawingIds: r,
|
|
@@ -739,16 +739,16 @@ let qe = class extends oe {
|
|
|
739
739
|
const g = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
|
|
740
740
|
if (g == null || g.unitId !== this._context.unitId)
|
|
741
741
|
return;
|
|
742
|
-
const d =
|
|
742
|
+
const d = x({ ...g.transform, ...a }, this._selectionRenderService);
|
|
743
743
|
if (d == null)
|
|
744
744
|
return;
|
|
745
745
|
const l = {
|
|
746
746
|
...t,
|
|
747
|
-
transform: { ...g.transform, ...a, ...
|
|
747
|
+
transform: { ...g.transform, ...a, ...z(d, this._selectionRenderService, this._skeletonManagerService) },
|
|
748
748
|
sheetTransform: { ...d }
|
|
749
749
|
};
|
|
750
750
|
n.push(l);
|
|
751
|
-
}), n.length > 0 && this._commandService.executeCommand(
|
|
751
|
+
}), n.length > 0 && this._commandService.executeCommand(Gt.id, {
|
|
752
752
|
unitId: e[0].unitId,
|
|
753
753
|
drawings: n
|
|
754
754
|
}));
|
|
@@ -756,44 +756,44 @@ let qe = class extends oe {
|
|
|
756
756
|
}
|
|
757
757
|
_groupDrawingListener() {
|
|
758
758
|
this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
|
|
759
|
-
this._commandService.executeCommand(
|
|
759
|
+
this._commandService.executeCommand(hr.id, e);
|
|
760
760
|
const { unitId: n, subUnitId: t, drawingId: r } = e[0].parent;
|
|
761
|
-
this._commandService.syncExecuteCommand(
|
|
761
|
+
this._commandService.syncExecuteCommand(Ft.id, [{ unitId: n, subUnitId: t, drawingId: r }]);
|
|
762
762
|
})), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
|
|
763
|
-
this._commandService.executeCommand(
|
|
763
|
+
this._commandService.executeCommand(fr.id, e);
|
|
764
764
|
}));
|
|
765
765
|
}
|
|
766
766
|
_focusDrawingListener() {
|
|
767
767
|
this.disposeWithMe(
|
|
768
768
|
this._drawingManagerService.focus$.subscribe((e) => {
|
|
769
|
-
e == null || e.length === 0 ? (this._contextService.setContextValue(
|
|
769
|
+
e == null || e.length === 0 ? (this._contextService.setContextValue($e, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue($e, !0), this._sheetDrawingService.focusDrawing(e));
|
|
770
770
|
})
|
|
771
771
|
);
|
|
772
772
|
}
|
|
773
773
|
};
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
],
|
|
788
|
-
var
|
|
789
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
774
|
+
Qe = Cs([
|
|
775
|
+
ie(1, N(X)),
|
|
776
|
+
ie(2, k),
|
|
777
|
+
ie(3, Ye),
|
|
778
|
+
ie(4, Bn),
|
|
779
|
+
ie(5, Ei),
|
|
780
|
+
ie(6, ae),
|
|
781
|
+
ie(7, oe),
|
|
782
|
+
ie(8, jn),
|
|
783
|
+
ie(9, Pi),
|
|
784
|
+
ie(10, N(Lt)),
|
|
785
|
+
ie(11, N(ln)),
|
|
786
|
+
ie(12, N(et))
|
|
787
|
+
], Qe);
|
|
788
|
+
var Rs = Object.defineProperty, Ds = Object.getOwnPropertyDescriptor, Ms = (i, e, n, t) => {
|
|
789
|
+
for (var r = t > 1 ? void 0 : t ? Ds(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
790
790
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
791
|
-
return t && r &&
|
|
792
|
-
},
|
|
793
|
-
function
|
|
791
|
+
return t && r && Rs(e, n, r), r;
|
|
792
|
+
}, be = (i, e) => (n, t) => e(n, t, i);
|
|
793
|
+
function an(i, e, n) {
|
|
794
794
|
var t, r, s, o;
|
|
795
795
|
if (((r = (t = n == null ? void 0 : n.p) == null ? void 0 : t.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = n.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
|
|
796
|
-
const c = n.p.drawings[n.p.drawingsOrder[0]], a =
|
|
796
|
+
const c = n.p.drawings[n.p.drawingsOrder[0]], a = mr(
|
|
797
797
|
i,
|
|
798
798
|
{
|
|
799
799
|
unitId: e.unitId,
|
|
@@ -810,42 +810,42 @@ function on(i, e, n) {
|
|
|
810
810
|
}
|
|
811
811
|
return !1;
|
|
812
812
|
}
|
|
813
|
-
let
|
|
813
|
+
let Pt = class extends le {
|
|
814
814
|
constructor(i, e, n, t, r, s, o) {
|
|
815
815
|
super(), this._commandService = i, this._sheetInterceptorService = e, this._univerInstanceService = n, this._injector = t, this._drawingManagerService = r, this._docDrawingController = s, this._editorBridgeService = o, this._initHandleResize(), this._handleInitEditor(), this._handleWriteCell(), this._initCellContentInterceptor();
|
|
816
816
|
}
|
|
817
817
|
_initHandleResize() {
|
|
818
818
|
this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
819
819
|
let e, n = [];
|
|
820
|
-
if (i.id ===
|
|
820
|
+
if (i.id === Fn.id) {
|
|
821
821
|
const t = i.params;
|
|
822
|
-
n = t.ranges, e =
|
|
823
|
-
} else if (i.id ===
|
|
822
|
+
n = t.ranges, e = V(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
823
|
+
} else if (i.id === Yn.id) {
|
|
824
824
|
const t = i.params;
|
|
825
|
-
n = t.ranges, e =
|
|
826
|
-
} else if (i.id ===
|
|
825
|
+
n = t.ranges, e = V(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
826
|
+
} else if (i.id === Li.id) {
|
|
827
827
|
const t = i.params;
|
|
828
|
-
n = t.ranges, e =
|
|
829
|
-
} else if (i.id ===
|
|
828
|
+
n = t.ranges, e = V(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
829
|
+
} else if (i.id === kn.id) {
|
|
830
830
|
const t = i.params;
|
|
831
|
-
e =
|
|
831
|
+
e = V(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId }), n = t.rowsAutoHeightInfo.map((r) => ({
|
|
832
832
|
startRow: r.row,
|
|
833
833
|
endRow: r.row,
|
|
834
834
|
startColumn: 0,
|
|
835
835
|
endColumn: 9999
|
|
836
836
|
}));
|
|
837
|
-
} else if (i.id ===
|
|
837
|
+
} else if (i.id === Fi.id) {
|
|
838
838
|
const t = i.params;
|
|
839
|
-
n = t.ranges, e =
|
|
840
|
-
} else if (i.id ===
|
|
839
|
+
n = t.ranges, e = V(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
840
|
+
} else if (i.id === Yi.id) {
|
|
841
841
|
const t = i.params;
|
|
842
|
-
n = t.ranges, e =
|
|
842
|
+
n = t.ranges, e = V(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
|
|
843
843
|
}
|
|
844
844
|
e && n.length && n.forEach((t) => {
|
|
845
|
-
const r =
|
|
845
|
+
const r = Fr.transformRange(t, e.worksheet);
|
|
846
846
|
for (let s = r.startRow; s <= r.endRow; s++)
|
|
847
847
|
for (let o = r.startColumn; o <= r.endColumn; o++)
|
|
848
|
-
|
|
848
|
+
an(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: s, col: o }, e.worksheet.getCellRaw(s, o));
|
|
849
849
|
});
|
|
850
850
|
}));
|
|
851
851
|
}
|
|
@@ -853,22 +853,22 @@ let Et = class extends oe {
|
|
|
853
853
|
this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
|
|
854
854
|
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(mt), this._docDrawingController.loadDrawingDataForUnit(mt), this._drawingManagerService.initializeNotification(mt)) : this._drawingManagerService.removeDrawingDataForUnit(mt);
|
|
855
855
|
})), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
856
|
-
i.id ===
|
|
856
|
+
i.id === rs.id && i.params.unitId === pt && (this._drawingManagerService.removeDrawingDataForUnit(pt), this._docDrawingController.loadDrawingDataForUnit(pt), this._drawingManagerService.initializeNotification(pt));
|
|
857
857
|
}));
|
|
858
858
|
}
|
|
859
859
|
_handleWriteCell() {
|
|
860
|
-
this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(
|
|
860
|
+
this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(ki, {
|
|
861
861
|
priority: 9999,
|
|
862
|
-
handler: (i, e, n) => (
|
|
862
|
+
handler: (i, e, n) => (an(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: e.row, col: e.col }, i), n(i))
|
|
863
863
|
}));
|
|
864
864
|
}
|
|
865
865
|
_initCellContentInterceptor() {
|
|
866
866
|
this.disposeWithMe(
|
|
867
867
|
this._sheetInterceptorService.intercept(
|
|
868
|
-
|
|
868
|
+
Gi.CELL_CONTENT,
|
|
869
869
|
{
|
|
870
|
-
effect:
|
|
871
|
-
priority:
|
|
870
|
+
effect: Yr.Style,
|
|
871
|
+
priority: Xi.CELL_IMAGE,
|
|
872
872
|
handler: (i, e, n) => {
|
|
873
873
|
var t;
|
|
874
874
|
return i != null && i.p && ((t = i.p.drawingsOrder) != null && t.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }), n(i);
|
|
@@ -878,21 +878,21 @@ let Et = class extends oe {
|
|
|
878
878
|
);
|
|
879
879
|
}
|
|
880
880
|
};
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
],
|
|
890
|
-
var
|
|
891
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
881
|
+
Pt = Ms([
|
|
882
|
+
be(0, k),
|
|
883
|
+
be(1, N(Yt)),
|
|
884
|
+
be(2, Fe),
|
|
885
|
+
be(3, N(et)),
|
|
886
|
+
be(4, oe),
|
|
887
|
+
be(5, N(ii)),
|
|
888
|
+
be(6, N(vi))
|
|
889
|
+
], Pt);
|
|
890
|
+
var ys = Object.defineProperty, Ts = Object.getOwnPropertyDescriptor, Os = (i, e, n, t) => {
|
|
891
|
+
for (var r = t > 1 ? void 0 : t ? Ts(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
892
892
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
893
|
-
return t && r &&
|
|
894
|
-
},
|
|
895
|
-
let
|
|
893
|
+
return t && r && ys(e, n, r), r;
|
|
894
|
+
}, Un = (i, e) => (n, t) => e(n, t, i);
|
|
895
|
+
let Ut = class extends le {
|
|
896
896
|
constructor(i, e) {
|
|
897
897
|
super(), this._autoFillService = i, this._injector = e, this._initAutoFillHooks();
|
|
898
898
|
}
|
|
@@ -901,27 +901,27 @@ let Pt = class extends oe {
|
|
|
901
901
|
this._autoFillService.addHook({
|
|
902
902
|
id: "sheet-cell-image-autofill",
|
|
903
903
|
onBeforeSubmit: (i, e, n, t) => {
|
|
904
|
-
new
|
|
905
|
-
|
|
904
|
+
new kr(t).forValue((r, s, o) => {
|
|
905
|
+
an(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
|
|
906
906
|
});
|
|
907
907
|
}
|
|
908
908
|
})
|
|
909
909
|
);
|
|
910
910
|
}
|
|
911
911
|
};
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
],
|
|
916
|
-
var
|
|
917
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
912
|
+
Ut = Os([
|
|
913
|
+
Un(0, N(Si)),
|
|
914
|
+
Un(1, N(et))
|
|
915
|
+
], Ut);
|
|
916
|
+
var Es = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, Us = (i, e, n, t) => {
|
|
917
|
+
for (var r = t > 1 ? void 0 : t ? Ps(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
918
918
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
919
|
-
return t && r &&
|
|
920
|
-
},
|
|
921
|
-
let
|
|
919
|
+
return t && r && Es(e, n, r), r;
|
|
920
|
+
}, bt = (i, e) => (n, t) => e(n, t, i);
|
|
921
|
+
let At = class extends le {
|
|
922
922
|
constructor(e, n, t, r) {
|
|
923
923
|
super();
|
|
924
|
-
|
|
924
|
+
Q(this, "_isSetCursor", !1);
|
|
925
925
|
this._hoverManagerService = e, this._renderManagerService = n, this._selectionsService = t, this._drawingRenderService = r;
|
|
926
926
|
}
|
|
927
927
|
_initHover() {
|
|
@@ -929,18 +929,18 @@ let Ut = class extends oe {
|
|
|
929
929
|
_initImageClick() {
|
|
930
930
|
}
|
|
931
931
|
};
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
],
|
|
938
|
-
const
|
|
932
|
+
At = Us([
|
|
933
|
+
bt(0, N(Ii)),
|
|
934
|
+
bt(1, N(ne)),
|
|
935
|
+
bt(2, N(ln)),
|
|
936
|
+
bt(3, N(Wn))
|
|
937
|
+
], At);
|
|
938
|
+
const Xt = {
|
|
939
939
|
id: "sheet.command.insert-float-image",
|
|
940
|
-
type:
|
|
940
|
+
type: te.COMMAND,
|
|
941
941
|
handler: async (i, e) => {
|
|
942
942
|
var s, o;
|
|
943
|
-
const t = (s = i.get(
|
|
943
|
+
const t = (s = i.get(ne).getCurrentTypeOfRenderer(H.UNIVER_SHEET)) == null ? void 0 : s.with(Qe);
|
|
944
944
|
if (!t)
|
|
945
945
|
return !1;
|
|
946
946
|
const r = e == null ? void 0 : e.files;
|
|
@@ -950,33 +950,33 @@ const Gt = {
|
|
|
950
950
|
} else
|
|
951
951
|
return (o = t.insertFloatImage()) != null ? o : !1;
|
|
952
952
|
}
|
|
953
|
-
},
|
|
953
|
+
}, hn = {
|
|
954
954
|
id: "sheet.command.insert-cell-image",
|
|
955
|
-
type:
|
|
955
|
+
type: te.COMMAND,
|
|
956
956
|
handler: (i) => {
|
|
957
957
|
var n, t;
|
|
958
|
-
return (t = (n = i.get(
|
|
958
|
+
return (t = (n = i.get(ne).getCurrentTypeOfRenderer(H.UNIVER_SHEET)) == null ? void 0 : n.with(Qe).insertCellImage()) != null ? t : !1;
|
|
959
959
|
}
|
|
960
960
|
};
|
|
961
|
-
var
|
|
962
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
961
|
+
var As = Object.defineProperty, Ns = Object.getOwnPropertyDescriptor, js = (i, e, n, t) => {
|
|
962
|
+
for (var r = t > 1 ? void 0 : t ? Ns(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
963
963
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
964
|
-
return t && r &&
|
|
964
|
+
return t && r && As(e, n, r), r;
|
|
965
965
|
}, ze = (i, e) => (n, t) => e(n, t, i);
|
|
966
|
-
const
|
|
967
|
-
function
|
|
966
|
+
const pr = "image/png";
|
|
967
|
+
function Bs(i) {
|
|
968
968
|
const e = i.split(","), n = atob(e[1]), t = n.length, r = new Uint8Array(t);
|
|
969
969
|
for (let s = 0; s < t; s++)
|
|
970
970
|
r[s] = n.charCodeAt(s);
|
|
971
|
-
return new Blob([r], { type:
|
|
971
|
+
return new Blob([r], { type: pr });
|
|
972
972
|
}
|
|
973
|
-
function
|
|
974
|
-
const e = new ClipboardItem({ [
|
|
973
|
+
function Ws(i) {
|
|
974
|
+
const e = new ClipboardItem({ [pr]: Bs(i) });
|
|
975
975
|
navigator.clipboard.write([e]).catch((n) => {
|
|
976
976
|
console.error("Could not copy image using clipboard API: ", n);
|
|
977
977
|
});
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function $s() {
|
|
980
980
|
function i() {
|
|
981
981
|
const t = document.createElement("input");
|
|
982
982
|
return t.style.position = "absolute", t.style.height = "1px", t.style.width = "1px", t.style.opacity = "0", t;
|
|
@@ -986,16 +986,16 @@ function js() {
|
|
|
986
986
|
n.blur(), document.body.removeChild(n), e instanceof HTMLElement && e.focus();
|
|
987
987
|
};
|
|
988
988
|
}
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
989
|
+
const An = [
|
|
990
|
+
We.SPECIAL_PASTE_COL_WIDTH,
|
|
991
|
+
We.SPECIAL_PASTE_VALUE,
|
|
992
|
+
We.SPECIAL_PASTE_FORMAT,
|
|
993
|
+
We.SPECIAL_PASTE_FORMULA
|
|
994
994
|
];
|
|
995
|
-
let
|
|
995
|
+
let Nt = class extends le {
|
|
996
996
|
constructor(e, n, t, r, s) {
|
|
997
997
|
super();
|
|
998
|
-
|
|
998
|
+
Q(this, "_copyInfo");
|
|
999
999
|
this._sheetClipboardService = e, this._renderManagerService = n, this._drawingService = t, this._clipboardInterfaceService = r, this._commandService = s, this._initCopyPaste();
|
|
1000
1000
|
}
|
|
1001
1001
|
get _focusedDrawings() {
|
|
@@ -1009,16 +1009,16 @@ let At = class extends oe {
|
|
|
1009
1009
|
const s = this._focusedDrawings;
|
|
1010
1010
|
if (s.length > 0) {
|
|
1011
1011
|
const [o] = s;
|
|
1012
|
-
if (r ===
|
|
1012
|
+
if (r === Ie.CUT) {
|
|
1013
1013
|
const a = {
|
|
1014
1014
|
unitId: e,
|
|
1015
1015
|
drawings: [o]
|
|
1016
1016
|
};
|
|
1017
|
-
this._commandService.executeCommand(
|
|
1017
|
+
this._commandService.executeCommand(tt.id, a);
|
|
1018
1018
|
}
|
|
1019
1019
|
setTimeout(() => {
|
|
1020
|
-
const a =
|
|
1021
|
-
o.drawingType ===
|
|
1020
|
+
const a = $s();
|
|
1021
|
+
o.drawingType === F.DRAWING_IMAGE && o.imageSourceType === oi.BASE64 ? Ws(o.source) : this._clipboardInterfaceService.writeText(""), a();
|
|
1022
1022
|
}, 200);
|
|
1023
1023
|
const c = {
|
|
1024
1024
|
unitId: o.unitId,
|
|
@@ -1034,14 +1034,14 @@ let At = class extends oe {
|
|
|
1034
1034
|
onPasteCells: (e, n, t, r) => {
|
|
1035
1035
|
if (!this._copyInfo)
|
|
1036
1036
|
return { redos: [], undos: [] };
|
|
1037
|
-
const { copyType: s =
|
|
1038
|
-
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: g, subUnitId: d, pasteRange: a }, { copyRange: c, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: n, pasteType: o },
|
|
1037
|
+
const { copyType: s = Ie.COPY, pasteType: o } = r, { range: c } = e || {}, { range: a, unitId: g, subUnitId: d } = n;
|
|
1038
|
+
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: g, subUnitId: d, pasteRange: a }, { copyRange: c, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: n, pasteType: o }, Ie.COPY);
|
|
1039
1039
|
},
|
|
1040
1040
|
onPastePlainText: (e, n) => ({ undos: [], redos: [] }),
|
|
1041
|
-
onPasteUnrecognized: (e) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType:
|
|
1041
|
+
onPasteUnrecognized: (e) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: We.DEFAULT_PASTE }, Ie.COPY) : { undos: [], redos: [] },
|
|
1042
1042
|
onPasteFiles: (e, n) => {
|
|
1043
1043
|
if (this._copyInfo)
|
|
1044
|
-
return this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType:
|
|
1044
|
+
return this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: We.DEFAULT_PASTE }, Ie.COPY);
|
|
1045
1045
|
{
|
|
1046
1046
|
const t = n.filter((r) => r.type.includes("image"));
|
|
1047
1047
|
if (t.length)
|
|
@@ -1049,7 +1049,7 @@ let At = class extends oe {
|
|
|
1049
1049
|
undos: [],
|
|
1050
1050
|
redos: [
|
|
1051
1051
|
{
|
|
1052
|
-
id:
|
|
1052
|
+
id: Xt.id,
|
|
1053
1053
|
params: { files: t }
|
|
1054
1054
|
}
|
|
1055
1055
|
]
|
|
@@ -1061,7 +1061,7 @@ let At = class extends oe {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
_createDrawingsCopyInfoByRange(e, n, t) {
|
|
1063
1063
|
var h;
|
|
1064
|
-
const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(
|
|
1064
|
+
const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(X);
|
|
1065
1065
|
if (!r) return;
|
|
1066
1066
|
const s = r.attachRangeWithCoord(t);
|
|
1067
1067
|
if (!s)
|
|
@@ -1069,15 +1069,15 @@ let At = class extends oe {
|
|
|
1069
1069
|
const { startX: o, endX: c, startY: a, endY: g } = s, d = this._drawingService.getDrawingData(e, n), l = this._focusedDrawings.slice();
|
|
1070
1070
|
if (Object.keys(d).forEach((u) => {
|
|
1071
1071
|
const m = d[u], { transform: p } = m;
|
|
1072
|
-
if (m.anchorType !==
|
|
1072
|
+
if (m.anchorType !== P.Both || !p)
|
|
1073
1073
|
return;
|
|
1074
|
-
const { left: f = 0, top: w = 0, width: S = 0, height:
|
|
1074
|
+
const { left: f = 0, top: w = 0, width: S = 0, height: C = 0 } = p, { drawingStartX: D, drawingEndX: v, drawingStartY: b, drawingEndY: _ } = {
|
|
1075
1075
|
drawingStartX: f,
|
|
1076
1076
|
drawingEndX: f + S,
|
|
1077
1077
|
drawingStartY: w,
|
|
1078
|
-
drawingEndY: w +
|
|
1078
|
+
drawingEndY: w + C
|
|
1079
1079
|
};
|
|
1080
|
-
o <= D && v <= c && a <=
|
|
1080
|
+
o <= D && v <= c && a <= b && _ <= g && l.push(m);
|
|
1081
1081
|
}), l.length)
|
|
1082
1082
|
return {
|
|
1083
1083
|
copyRange: t,
|
|
@@ -1088,16 +1088,16 @@ let At = class extends oe {
|
|
|
1088
1088
|
}
|
|
1089
1089
|
_generateSingleDrawingPasteMutations(e, n) {
|
|
1090
1090
|
const { pasteType: t, pasteTo: r } = e;
|
|
1091
|
-
if (
|
|
1091
|
+
if (An.includes(t))
|
|
1092
1092
|
return { redos: [], undos: [] };
|
|
1093
|
-
const { unitId: s, subUnitId: o, range: c } = r, a = this._renderManagerService.getRenderById(s), g = a == null ? void 0 : a.with(
|
|
1093
|
+
const { unitId: s, subUnitId: o, range: c } = r, a = this._renderManagerService.getRenderById(s), g = a == null ? void 0 : a.with(X), d = a == null ? void 0 : a.with(Ye), l = this._copyInfo;
|
|
1094
1094
|
if (!g || !d)
|
|
1095
1095
|
return { redos: [], undos: [] };
|
|
1096
|
-
const { drawings: h } = l, u =
|
|
1096
|
+
const { drawings: h } = l, u = Dn(c);
|
|
1097
1097
|
return this._generateMutations(h, {
|
|
1098
1098
|
unitId: s,
|
|
1099
1099
|
subUnitId: o,
|
|
1100
|
-
isCut: n ===
|
|
1100
|
+
isCut: n === Ie.CUT,
|
|
1101
1101
|
getTransform: (m, p) => {
|
|
1102
1102
|
var S;
|
|
1103
1103
|
const f = g.attachRangeWithCoord({
|
|
@@ -1112,7 +1112,7 @@ let At = class extends oe {
|
|
|
1112
1112
|
};
|
|
1113
1113
|
return {
|
|
1114
1114
|
transform: w,
|
|
1115
|
-
sheetTransform: (S =
|
|
1115
|
+
sheetTransform: (S = x(w, d)) != null ? S : p
|
|
1116
1116
|
};
|
|
1117
1117
|
}
|
|
1118
1118
|
});
|
|
@@ -1132,40 +1132,40 @@ let At = class extends oe {
|
|
|
1132
1132
|
...d,
|
|
1133
1133
|
unitId: t,
|
|
1134
1134
|
subUnitId: r,
|
|
1135
|
-
drawingId: o ? d.drawingId :
|
|
1135
|
+
drawingId: o ? d.drawingId : Me.generateRandomId(),
|
|
1136
1136
|
transform: u.transform,
|
|
1137
1137
|
sheetTransform: u.sheetTransform
|
|
1138
1138
|
};
|
|
1139
1139
|
if (o) {
|
|
1140
1140
|
const { undo: p, redo: f, objects: w } = g.getBatchUpdateOp([m]);
|
|
1141
1141
|
c.push({
|
|
1142
|
-
id:
|
|
1142
|
+
id: U.id,
|
|
1143
1143
|
params: {
|
|
1144
1144
|
unitId: t,
|
|
1145
1145
|
subUnitId: r,
|
|
1146
|
-
type:
|
|
1146
|
+
type: A.UPDATE,
|
|
1147
1147
|
op: f,
|
|
1148
1148
|
objects: w
|
|
1149
1149
|
}
|
|
1150
1150
|
}), a.push({
|
|
1151
|
-
id:
|
|
1151
|
+
id: U.id,
|
|
1152
1152
|
params: {
|
|
1153
1153
|
unitId: t,
|
|
1154
1154
|
subUnitId: r,
|
|
1155
|
-
type:
|
|
1155
|
+
type: A.UPDATE,
|
|
1156
1156
|
op: p,
|
|
1157
1157
|
objects: w
|
|
1158
1158
|
}
|
|
1159
1159
|
});
|
|
1160
1160
|
} else {
|
|
1161
1161
|
const { undo: p, redo: f, objects: w } = g.getBatchAddOp([m]);
|
|
1162
|
-
c.push({ id:
|
|
1162
|
+
c.push({ id: U.id, params: { op: f, unitId: t, subUnitId: r, objects: w, type: A.INSERT } }), a.push({ id: U.id, params: { op: p, unitId: t, subUnitId: r, objects: w, type: A.REMOVE } });
|
|
1163
1163
|
}
|
|
1164
1164
|
}), { redos: c, undos: a };
|
|
1165
1165
|
}
|
|
1166
1166
|
// eslint-disable-next-line max-lines-per-function
|
|
1167
1167
|
_generateRangeDrawingsPasteMutations(e, n) {
|
|
1168
|
-
var
|
|
1168
|
+
var O;
|
|
1169
1169
|
const {
|
|
1170
1170
|
unitId: t,
|
|
1171
1171
|
subUnitId: r,
|
|
@@ -1175,81 +1175,81 @@ let At = class extends oe {
|
|
|
1175
1175
|
copyRange: c,
|
|
1176
1176
|
copyType: a
|
|
1177
1177
|
} = n;
|
|
1178
|
-
if (
|
|
1178
|
+
if (An.includes(s))
|
|
1179
1179
|
return { redos: [], undos: [] };
|
|
1180
|
-
const g = (
|
|
1180
|
+
const g = (O = this._renderManagerService.getRenderById(t)) == null ? void 0 : O.with(X);
|
|
1181
1181
|
if (!g || !this._copyInfo)
|
|
1182
1182
|
return { redos: [], undos: [] };
|
|
1183
1183
|
const { drawings: d } = this._copyInfo;
|
|
1184
1184
|
if (!c)
|
|
1185
1185
|
return this._generateSingleDrawingPasteMutations({
|
|
1186
|
-
pasteTo: { unitId: t, subUnitId: r, range:
|
|
1186
|
+
pasteTo: { unitId: t, subUnitId: r, range: Dn(o) },
|
|
1187
1187
|
pasteType: s
|
|
1188
1188
|
}, a);
|
|
1189
|
-
const { ranges: [l, h], mapFunc: u } =
|
|
1189
|
+
const { ranges: [l, h], mapFunc: u } = Ci([c, o]), { row: m, col: p } = u(l.startRow, l.startColumn), { row: f, col: w } = u(h.startRow, h.startColumn), S = g.attachRangeWithCoord({
|
|
1190
1190
|
startRow: m,
|
|
1191
1191
|
endRow: m,
|
|
1192
1192
|
startColumn: p,
|
|
1193
1193
|
endColumn: p
|
|
1194
|
-
}),
|
|
1194
|
+
}), C = g.attachRangeWithCoord({
|
|
1195
1195
|
startRow: f,
|
|
1196
1196
|
endRow: f,
|
|
1197
1197
|
startColumn: w,
|
|
1198
1198
|
endColumn: w
|
|
1199
1199
|
});
|
|
1200
|
-
if (!S || !
|
|
1200
|
+
if (!S || !C || !this._copyInfo)
|
|
1201
1201
|
return { redos: [], undos: [] };
|
|
1202
|
-
const D =
|
|
1202
|
+
const D = C.startX - S.startX, v = C.startY - S.startY, b = f - m, _ = w - p;
|
|
1203
1203
|
return this._generateMutations(d, {
|
|
1204
1204
|
unitId: t,
|
|
1205
1205
|
subUnitId: r,
|
|
1206
1206
|
getTransform: (M, y) => {
|
|
1207
|
-
var
|
|
1207
|
+
var T, I;
|
|
1208
1208
|
return {
|
|
1209
1209
|
transform: {
|
|
1210
1210
|
...M,
|
|
1211
|
-
left: ((
|
|
1212
|
-
top: ((
|
|
1211
|
+
left: ((T = M == null ? void 0 : M.left) != null ? T : 0) + D,
|
|
1212
|
+
top: ((I = M == null ? void 0 : M.top) != null ? I : 0) + v
|
|
1213
1213
|
},
|
|
1214
1214
|
sheetTransform: {
|
|
1215
1215
|
...y,
|
|
1216
1216
|
to: {
|
|
1217
1217
|
...y.to,
|
|
1218
|
-
row: y.to.row +
|
|
1218
|
+
row: y.to.row + b,
|
|
1219
1219
|
column: y.to.column + _
|
|
1220
1220
|
},
|
|
1221
1221
|
from: {
|
|
1222
1222
|
...y.from,
|
|
1223
|
-
row: y.from.row +
|
|
1223
|
+
row: y.from.row + b,
|
|
1224
1224
|
column: y.from.column + _
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
1227
|
};
|
|
1228
1228
|
},
|
|
1229
|
-
isCut: a ===
|
|
1229
|
+
isCut: a === Ie.CUT
|
|
1230
1230
|
});
|
|
1231
1231
|
}
|
|
1232
1232
|
};
|
|
1233
|
-
|
|
1234
|
-
ze(0,
|
|
1235
|
-
ze(1,
|
|
1236
|
-
ze(2,
|
|
1237
|
-
ze(3,
|
|
1238
|
-
ze(4,
|
|
1239
|
-
],
|
|
1240
|
-
var
|
|
1241
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1233
|
+
Nt = js([
|
|
1234
|
+
ze(0, bi),
|
|
1235
|
+
ze(1, ne),
|
|
1236
|
+
ze(2, oe),
|
|
1237
|
+
ze(3, Ui),
|
|
1238
|
+
ze(4, k)
|
|
1239
|
+
], Nt);
|
|
1240
|
+
var xs = Object.defineProperty, Ls = Object.getOwnPropertyDescriptor, Fs = (i, e, n, t) => {
|
|
1241
|
+
for (var r = t > 1 ? void 0 : t ? Ls(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1242
1242
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1243
|
-
return t && r &&
|
|
1243
|
+
return t && r && xs(e, n, r), r;
|
|
1244
1244
|
}, Ke = (i, e) => (n, t) => e(n, t, i);
|
|
1245
|
-
let
|
|
1245
|
+
let jt = class extends le {
|
|
1246
1246
|
constructor(i, e, n, t, r) {
|
|
1247
1247
|
super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1248
1248
|
}
|
|
1249
1249
|
_initDrawingVisible() {
|
|
1250
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1250
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(H.UNIVER_SHEET);
|
|
1251
1251
|
this.disposeWithMe(
|
|
1252
|
-
|
|
1252
|
+
vt([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1253
1253
|
if (!e) {
|
|
1254
1254
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1255
1255
|
return;
|
|
@@ -1260,7 +1260,7 @@ let Nt = class extends oe {
|
|
|
1260
1260
|
return;
|
|
1261
1261
|
}
|
|
1262
1262
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
1263
|
-
if (this._permissionService.composePermission([new
|
|
1263
|
+
if (this._permissionService.composePermission([new En(r).id, new qt(r, s).id]).every((c) => c.value))
|
|
1264
1264
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
1265
1265
|
else {
|
|
1266
1266
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
@@ -1268,7 +1268,7 @@ let Nt = class extends oe {
|
|
|
1268
1268
|
if (h == null)
|
|
1269
1269
|
return;
|
|
1270
1270
|
h.getAllObjectsByOrder().forEach((m) => {
|
|
1271
|
-
m.classType ===
|
|
1271
|
+
m.classType === Ne.IMAGE && d.some((p) => m.oKey.includes(p.drawingId)) && h.removeObject(m);
|
|
1272
1272
|
});
|
|
1273
1273
|
}
|
|
1274
1274
|
});
|
|
@@ -1276,9 +1276,9 @@ let Nt = class extends oe {
|
|
|
1276
1276
|
);
|
|
1277
1277
|
}
|
|
1278
1278
|
_initDrawingEditable() {
|
|
1279
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1279
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(H.UNIVER_SHEET);
|
|
1280
1280
|
this.disposeWithMe(
|
|
1281
|
-
|
|
1281
|
+
vt([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1282
1282
|
if (!e) {
|
|
1283
1283
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1284
1284
|
return;
|
|
@@ -1289,7 +1289,7 @@ let Nt = class extends oe {
|
|
|
1289
1289
|
return;
|
|
1290
1290
|
}
|
|
1291
1291
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
1292
|
-
if (this._permissionService.composePermission([new
|
|
1292
|
+
if (this._permissionService.composePermission([new tn(r).id, new Tt(r, s).id]).every((c) => c.value))
|
|
1293
1293
|
this._drawingManagerService.setDrawingEditable(!0);
|
|
1294
1294
|
else {
|
|
1295
1295
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
@@ -1297,7 +1297,7 @@ let Nt = class extends oe {
|
|
|
1297
1297
|
if (h == null)
|
|
1298
1298
|
return;
|
|
1299
1299
|
h.getAllObjectsByOrder().forEach((m) => {
|
|
1300
|
-
m.classType ===
|
|
1300
|
+
m.classType === Ne.IMAGE && d.some((p) => m.oKey.includes(p.drawingId)) && h.detachTransformerFrom(m);
|
|
1301
1301
|
});
|
|
1302
1302
|
}
|
|
1303
1303
|
});
|
|
@@ -1305,9 +1305,9 @@ let Nt = class extends oe {
|
|
|
1305
1305
|
);
|
|
1306
1306
|
}
|
|
1307
1307
|
_initViewPermissionChange() {
|
|
1308
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1308
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(H.UNIVER_SHEET);
|
|
1309
1309
|
this.disposeWithMe(
|
|
1310
|
-
|
|
1310
|
+
vt([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1311
1311
|
e && e.activeSheet$.subscribe((t) => {
|
|
1312
1312
|
var l;
|
|
1313
1313
|
if (!t)
|
|
@@ -1317,21 +1317,21 @@ let Nt = class extends oe {
|
|
|
1317
1317
|
const c = this._renderManagerService.getRenderById(r), a = c == null ? void 0 : c.scene;
|
|
1318
1318
|
if (a == null)
|
|
1319
1319
|
return;
|
|
1320
|
-
const g = a.getTransformerByCreate(), d = this._permissionService.composePermission$([new
|
|
1320
|
+
const g = a.getTransformerByCreate(), d = this._permissionService.composePermission$([new En(r).id, new qt(r, s).id]).pipe(qe((h) => h.every((u) => u.value)));
|
|
1321
1321
|
d == null || d.pipe(
|
|
1322
|
-
|
|
1323
|
-
|
|
1322
|
+
Je((h) => h !== o),
|
|
1323
|
+
St()
|
|
1324
1324
|
).subscribe({
|
|
1325
1325
|
next: (h) => {
|
|
1326
1326
|
o = h, this._drawingManagerService.setDrawingVisible(h);
|
|
1327
1327
|
const u = a.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), p = Object.values(m);
|
|
1328
1328
|
h ? this._drawingManagerService.addNotification(p) : (u.forEach((f) => {
|
|
1329
|
-
f.classType ===
|
|
1329
|
+
f.classType === Ne.IMAGE && p.some((w) => f.oKey.includes(w.drawingId)) && a.removeObject(f);
|
|
1330
1330
|
}), g.clearSelectedObjects());
|
|
1331
1331
|
}
|
|
1332
|
-
}), (l = this._permissionService.getPermissionPoint$(new
|
|
1333
|
-
|
|
1334
|
-
|
|
1332
|
+
}), (l = this._permissionService.getPermissionPoint$(new qt(r, s).id)) == null || l.pipe(
|
|
1333
|
+
Je((h) => h.value !== o),
|
|
1334
|
+
St()
|
|
1335
1335
|
).subscribe({
|
|
1336
1336
|
complete: () => {
|
|
1337
1337
|
o = !0, this._drawingManagerService.setDrawingVisible(!0);
|
|
@@ -1344,9 +1344,9 @@ let Nt = class extends oe {
|
|
|
1344
1344
|
);
|
|
1345
1345
|
}
|
|
1346
1346
|
_initEditPermissionChange() {
|
|
1347
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1347
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(H.UNIVER_SHEET);
|
|
1348
1348
|
this.disposeWithMe(
|
|
1349
|
-
|
|
1349
|
+
vt([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1350
1350
|
e && e.activeSheet$.subscribe((t) => {
|
|
1351
1351
|
var l;
|
|
1352
1352
|
if (!t)
|
|
@@ -1356,31 +1356,31 @@ let Nt = class extends oe {
|
|
|
1356
1356
|
const c = this._renderManagerService.getRenderById(r), a = c == null ? void 0 : c.scene;
|
|
1357
1357
|
if (a == null)
|
|
1358
1358
|
return;
|
|
1359
|
-
const g = a.getTransformerByCreate(), d = this._permissionService.composePermission$([new
|
|
1359
|
+
const g = a.getTransformerByCreate(), d = this._permissionService.composePermission$([new tn(r).id, new Tt(r, s).id]).pipe(qe((h) => h.every((u) => u.value)));
|
|
1360
1360
|
d == null || d.pipe(
|
|
1361
|
-
|
|
1362
|
-
|
|
1361
|
+
Je((h) => h !== o),
|
|
1362
|
+
St()
|
|
1363
1363
|
).subscribe({
|
|
1364
1364
|
next: (h) => {
|
|
1365
1365
|
o = h, this._drawingManagerService.setDrawingEditable(h);
|
|
1366
1366
|
const u = a.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), p = Object.values(m);
|
|
1367
1367
|
h ? (u.forEach((f) => {
|
|
1368
|
-
f.classType ===
|
|
1368
|
+
f.classType === Ne.IMAGE && p.some((w) => f.oKey.includes(w.drawingId)) && a.attachTransformerTo(f);
|
|
1369
1369
|
}), this._drawingManagerService.addNotification(p)) : (u.forEach((f) => {
|
|
1370
|
-
f.classType ===
|
|
1370
|
+
f.classType === Ne.IMAGE && p.some((w) => f.oKey.includes(w.drawingId)) && a.detachTransformerFrom(f);
|
|
1371
1371
|
}), g.clearSelectedObjects());
|
|
1372
1372
|
}
|
|
1373
|
-
}), (l = this._permissionService.getPermissionPoint$(new
|
|
1374
|
-
|
|
1375
|
-
|
|
1373
|
+
}), (l = this._permissionService.getPermissionPoint$(new Tt(r, s).id)) == null || l.pipe(
|
|
1374
|
+
Je((h) => h.value !== o),
|
|
1375
|
+
St()
|
|
1376
1376
|
).subscribe({
|
|
1377
1377
|
complete: () => {
|
|
1378
1378
|
o = !0;
|
|
1379
1379
|
const h = e.getUnitId(), u = t.getSheetId(), m = this._drawingManagerService.getDrawingData(h, u), p = Object.values(m), f = this._renderManagerService.getRenderById(h), w = f == null ? void 0 : f.scene;
|
|
1380
1380
|
if (w == null)
|
|
1381
1381
|
return;
|
|
1382
|
-
this._drawingManagerService.setDrawingEditable(!0), w.getAllObjectsByOrder().forEach((
|
|
1383
|
-
|
|
1382
|
+
this._drawingManagerService.setDrawingEditable(!0), w.getAllObjectsByOrder().forEach((C) => {
|
|
1383
|
+
C.classType === Ne.IMAGE && p.some((D) => C.oKey.includes(D.drawingId)) && w.detachTransformerFrom(C);
|
|
1384
1384
|
});
|
|
1385
1385
|
}
|
|
1386
1386
|
});
|
|
@@ -1389,19 +1389,19 @@ let Nt = class extends oe {
|
|
|
1389
1389
|
);
|
|
1390
1390
|
}
|
|
1391
1391
|
};
|
|
1392
|
-
|
|
1393
|
-
Ke(0,
|
|
1394
|
-
Ke(1,
|
|
1395
|
-
Ke(2,
|
|
1396
|
-
Ke(3,
|
|
1397
|
-
Ke(4, N(
|
|
1398
|
-
],
|
|
1399
|
-
var
|
|
1400
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1392
|
+
jt = Fs([
|
|
1393
|
+
Ke(0, oe),
|
|
1394
|
+
Ke(1, ne),
|
|
1395
|
+
Ke(2, Xr),
|
|
1396
|
+
Ke(3, Fe),
|
|
1397
|
+
Ke(4, N(Gr))
|
|
1398
|
+
], jt);
|
|
1399
|
+
var Ys = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, Gs = (i, e, n, t) => {
|
|
1400
|
+
for (var r = t > 1 ? void 0 : t ? ks(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1401
1401
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1402
|
-
return t && r &&
|
|
1403
|
-
},
|
|
1404
|
-
let
|
|
1402
|
+
return t && r && Ys(e, n, r), r;
|
|
1403
|
+
}, Rt = (i, e) => (n, t) => e(n, t, i);
|
|
1404
|
+
let Bt = class extends le {
|
|
1405
1405
|
constructor(i, e, n, t) {
|
|
1406
1406
|
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
|
|
1407
1407
|
}
|
|
@@ -1426,15 +1426,15 @@ let jt = class extends oe {
|
|
|
1426
1426
|
const { unitId: t, subUnitId: r } = e, s = this._renderManagerService.getRenderById(t);
|
|
1427
1427
|
if (!s)
|
|
1428
1428
|
return n(i);
|
|
1429
|
-
const o = s.with(
|
|
1429
|
+
const o = s.with(X).getSkeletonParam(r);
|
|
1430
1430
|
if (!o)
|
|
1431
1431
|
return n(i);
|
|
1432
1432
|
const c = this._drawingManagerService.getDrawingDataForUnit(t), a = c == null ? void 0 : c[e.subUnitId];
|
|
1433
1433
|
if (!a)
|
|
1434
1434
|
return n(i);
|
|
1435
|
-
const { scaleX: g, scaleY: d } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = a.order.map((u) => a.data[u]).filter((u) => u.drawingType !==
|
|
1435
|
+
const { scaleX: g, scaleY: d } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = a.order.map((u) => a.data[u]).filter((u) => u.drawingType !== F.DRAWING_DOM);
|
|
1436
1436
|
return h.length ? (h.forEach((u) => {
|
|
1437
|
-
if (!u.groupId && u.transform &&
|
|
1437
|
+
if (!u.groupId && u.transform && Me.isDefine(u.transform.left) && Me.isDefine(u.transform.top) && Me.isDefine(u.transform.width) && Me.isDefine(u.transform.height)) {
|
|
1438
1438
|
const m = o.skeleton.getCellIndexByOffset(u.transform.left, u.transform.top, g, d, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, d, { x: 0, y: 0 });
|
|
1439
1439
|
m.column < l.startColumn && (l.startColumn = m.column), m.row < l.startRow && (l.startRow = m.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
|
|
1440
1440
|
}
|
|
@@ -1445,46 +1445,46 @@ let jt = class extends oe {
|
|
|
1445
1445
|
);
|
|
1446
1446
|
}
|
|
1447
1447
|
};
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
],
|
|
1454
|
-
var
|
|
1455
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1448
|
+
Bt = Gs([
|
|
1449
|
+
Rt(0, N(Ri)),
|
|
1450
|
+
Rt(1, N(Wn)),
|
|
1451
|
+
Rt(2, oe),
|
|
1452
|
+
Rt(3, ne)
|
|
1453
|
+
], Bt);
|
|
1454
|
+
var Xs = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor, Hs = (i, e, n, t) => {
|
|
1455
|
+
for (var r = t > 1 ? void 0 : t ? Vs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1456
1456
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1457
|
-
return t && r &&
|
|
1458
|
-
},
|
|
1459
|
-
const
|
|
1460
|
-
Ln.id,
|
|
1461
|
-
Fn.id,
|
|
1462
|
-
Yn.id,
|
|
1457
|
+
return t && r && Xs(e, n, r), r;
|
|
1458
|
+
}, we = (i, e) => (n, t) => e(n, t, i);
|
|
1459
|
+
const zs = [
|
|
1463
1460
|
Gn.id,
|
|
1464
1461
|
Xn.id,
|
|
1465
1462
|
Vn.id,
|
|
1466
1463
|
Hn.id,
|
|
1467
1464
|
zn.id,
|
|
1468
|
-
tn.id,
|
|
1469
|
-
nn.id,
|
|
1470
1465
|
Kn.id,
|
|
1471
1466
|
Zn.id,
|
|
1472
1467
|
Jn.id,
|
|
1468
|
+
nn.id,
|
|
1469
|
+
rn.id,
|
|
1473
1470
|
qn.id,
|
|
1474
1471
|
Qn.id,
|
|
1475
1472
|
er.id,
|
|
1476
1473
|
tr.id,
|
|
1477
1474
|
nr.id,
|
|
1478
|
-
rr.id
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1475
|
+
rr.id,
|
|
1476
|
+
ir.id,
|
|
1477
|
+
sr.id,
|
|
1478
|
+
or.id
|
|
1479
|
+
], Ks = [
|
|
1483
1480
|
Vi.id,
|
|
1484
|
-
|
|
1485
|
-
|
|
1481
|
+
Hi.id,
|
|
1482
|
+
zi.id,
|
|
1483
|
+
Ki.id,
|
|
1484
|
+
Fn.id,
|
|
1485
|
+
Yn.id
|
|
1486
1486
|
];
|
|
1487
|
-
let
|
|
1487
|
+
let cn = class extends le {
|
|
1488
1488
|
constructor(i, e, n, t, r, s, o, c, a) {
|
|
1489
1489
|
super(), this._context = i, this._renderManagerService = e, this._commandService = n, this._selectionRenderService = t, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = c, this._univerInstanceService = a, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
|
|
1490
1490
|
}
|
|
@@ -1492,57 +1492,57 @@ let an = class extends oe {
|
|
|
1492
1492
|
this.disposeWithMe(
|
|
1493
1493
|
this._sheetInterceptorService.interceptCommand({
|
|
1494
1494
|
getMutations: (i) => {
|
|
1495
|
-
if (!
|
|
1495
|
+
if (!zs.includes(i.id))
|
|
1496
1496
|
return { redos: [], undos: [] };
|
|
1497
1497
|
if (i.params == null)
|
|
1498
1498
|
return { redos: [], undos: [] };
|
|
1499
1499
|
const e = i.id;
|
|
1500
|
-
if (e ===
|
|
1500
|
+
if (e === Gn.id)
|
|
1501
1501
|
return this._moveRowInterceptor(i.params, "insert");
|
|
1502
|
-
if ([
|
|
1502
|
+
if ([ir.id, sr.id, or.id].includes(e))
|
|
1503
1503
|
return this._moveRangeInterceptor(i.params);
|
|
1504
|
-
if (e ===
|
|
1504
|
+
if (e === Xn.id)
|
|
1505
1505
|
return this._moveColInterceptor(i.params, "insert");
|
|
1506
|
-
if (e ===
|
|
1506
|
+
if (e === Vn.id)
|
|
1507
1507
|
return this._moveRowInterceptor(i.params, "remove");
|
|
1508
|
-
if (e ===
|
|
1508
|
+
if (e === Hn.id)
|
|
1509
1509
|
return this._moveColInterceptor(i.params, "remove");
|
|
1510
|
-
if (e ===
|
|
1510
|
+
if (e === zn.id) {
|
|
1511
1511
|
const { range: n } = i.params;
|
|
1512
1512
|
return this._getRangeMoveUndo(
|
|
1513
1513
|
n,
|
|
1514
1514
|
0
|
|
1515
1515
|
/* deleteLeft */
|
|
1516
1516
|
);
|
|
1517
|
-
} else if (e ===
|
|
1517
|
+
} else if (e === Kn.id) {
|
|
1518
1518
|
const { range: n } = i.params;
|
|
1519
1519
|
return this._getRangeMoveUndo(
|
|
1520
1520
|
n,
|
|
1521
1521
|
1
|
|
1522
1522
|
/* deleteUp */
|
|
1523
1523
|
);
|
|
1524
|
-
} else if (e ===
|
|
1524
|
+
} else if (e === Zn.id) {
|
|
1525
1525
|
const { range: n } = i.params;
|
|
1526
1526
|
return this._getRangeMoveUndo(
|
|
1527
1527
|
n,
|
|
1528
1528
|
2
|
|
1529
1529
|
/* insertDown */
|
|
1530
1530
|
);
|
|
1531
|
-
} else if (e ===
|
|
1531
|
+
} else if (e === Jn.id) {
|
|
1532
1532
|
const { range: n } = i.params;
|
|
1533
1533
|
return this._getRangeMoveUndo(
|
|
1534
1534
|
n,
|
|
1535
1535
|
3
|
|
1536
1536
|
/* insertRight */
|
|
1537
1537
|
);
|
|
1538
|
-
} else if (e ===
|
|
1538
|
+
} else if (e === er.id || e === tr.id) {
|
|
1539
1539
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1540
1540
|
return this._getDrawingUndoForRowVisible(t, r, s);
|
|
1541
|
-
} else if (e ===
|
|
1541
|
+
} else if (e === nr.id || e === rr.id) {
|
|
1542
1542
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1543
1543
|
return this._getDrawingUndoForColVisible(t, r, s);
|
|
1544
|
-
} else if (e ===
|
|
1545
|
-
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e ===
|
|
1544
|
+
} else if (e === nn.id || e === rn.id || e === qn.id || e === Qn.id) {
|
|
1545
|
+
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === nn.id || e === rn.id;
|
|
1546
1546
|
return this._getDrawingUndoForRowAndColSize(t, r, s, o);
|
|
1547
1547
|
}
|
|
1548
1548
|
return { redos: [], undos: [] };
|
|
@@ -1551,7 +1551,7 @@ let an = class extends oe {
|
|
|
1551
1551
|
);
|
|
1552
1552
|
}
|
|
1553
1553
|
_getRangeMoveUndo(i, e) {
|
|
1554
|
-
const n =
|
|
1554
|
+
const n = V(this._univerInstanceService);
|
|
1555
1555
|
if (n == null)
|
|
1556
1556
|
return { redos: [], undos: [] };
|
|
1557
1557
|
const t = n.unitId, r = n.subUnitId, s = [], o = [], c = this._sheetDrawingService.getDrawingData(t, r), a = [], g = [];
|
|
@@ -1562,55 +1562,55 @@ let an = class extends oe {
|
|
|
1562
1562
|
return { redos: [], undos: [] };
|
|
1563
1563
|
if (a.length > 0) {
|
|
1564
1564
|
const d = this._sheetDrawingService.getBatchUpdateOp(a), { undo: l, redo: h, objects: u } = d;
|
|
1565
|
-
s.push({ id:
|
|
1565
|
+
s.push({ id: U.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: A.UPDATE } }), o.push({ id: U.id, params: { unitId: t, subUnitId: r, op: l, objects: u, type: A.UPDATE } });
|
|
1566
1566
|
}
|
|
1567
1567
|
if (g.length > 0) {
|
|
1568
1568
|
const d = this._sheetDrawingService.getBatchRemoveOp(g), l = d.undo, h = d.redo, u = d.objects;
|
|
1569
|
-
s.push({ id:
|
|
1569
|
+
s.push({ id: U.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: A.REMOVE } }), o.push({ id: U.id, params: { unitId: t, subUnitId: r, op: l, objects: u, type: A.INSERT } });
|
|
1570
1570
|
}
|
|
1571
|
-
return s.push({ id:
|
|
1571
|
+
return s.push({ id: L.id, params: [t] }), o.push({ id: L.id, params: [t] }), {
|
|
1572
1572
|
redos: s,
|
|
1573
1573
|
undos: o
|
|
1574
1574
|
};
|
|
1575
1575
|
}
|
|
1576
1576
|
_getUpdateOrDeleteDrawings(i, e, n) {
|
|
1577
|
-
const t = [], r = [], { sheetTransform: s, anchorType: o =
|
|
1577
|
+
const t = [], r = [], { sheetTransform: s, anchorType: o = P.Position, transform: c, unitId: a, subUnitId: g, drawingId: d } = n, { from: l, to: h } = s, { row: u, column: m } = l, { row: p, column: f } = h;
|
|
1578
1578
|
if (s == null || c == null)
|
|
1579
1579
|
return {
|
|
1580
1580
|
updateDrawings: t,
|
|
1581
1581
|
deleteDrawings: r
|
|
1582
1582
|
};
|
|
1583
|
-
const { startRow: w, endRow: S, startColumn:
|
|
1584
|
-
let v = null,
|
|
1583
|
+
const { startRow: w, endRow: S, startColumn: C, endColumn: D } = i;
|
|
1584
|
+
let v = null, b = null;
|
|
1585
1585
|
if (e === 0 && u >= w && p <= S)
|
|
1586
|
-
if (m >=
|
|
1586
|
+
if (m >= C && f <= D)
|
|
1587
1587
|
r.push({ unitId: a, subUnitId: g, drawingId: d });
|
|
1588
1588
|
else {
|
|
1589
|
-
const _ = this._shrinkCol(s, c,
|
|
1590
|
-
v = _ == null ? void 0 : _.newSheetTransform,
|
|
1589
|
+
const _ = this._shrinkCol(s, c, C, D, o);
|
|
1590
|
+
v = _ == null ? void 0 : _.newSheetTransform, b = _ == null ? void 0 : _.newTransform;
|
|
1591
1591
|
}
|
|
1592
|
-
else if (e === 1 && m >=
|
|
1592
|
+
else if (e === 1 && m >= C && f <= D)
|
|
1593
1593
|
if (u >= w && p <= S)
|
|
1594
1594
|
r.push({ unitId: a, subUnitId: g, drawingId: d });
|
|
1595
1595
|
else {
|
|
1596
1596
|
const _ = this._shrinkRow(s, c, w, S, o);
|
|
1597
|
-
v = _ == null ? void 0 : _.newSheetTransform,
|
|
1597
|
+
v = _ == null ? void 0 : _.newSheetTransform, b = _ == null ? void 0 : _.newTransform;
|
|
1598
1598
|
}
|
|
1599
1599
|
else if (e === 2) {
|
|
1600
1600
|
const _ = this._expandRow(s, c, w, S, o);
|
|
1601
|
-
v = _ == null ? void 0 : _.newSheetTransform,
|
|
1601
|
+
v = _ == null ? void 0 : _.newSheetTransform, b = _ == null ? void 0 : _.newTransform;
|
|
1602
1602
|
} else if (e === 3) {
|
|
1603
|
-
const _ = this._expandCol(s, c,
|
|
1604
|
-
v = _ == null ? void 0 : _.newSheetTransform,
|
|
1603
|
+
const _ = this._expandCol(s, c, C, D, o);
|
|
1604
|
+
v = _ == null ? void 0 : _.newSheetTransform, b = _ == null ? void 0 : _.newTransform;
|
|
1605
1605
|
}
|
|
1606
|
-
if (v != null &&
|
|
1607
|
-
const _ =
|
|
1606
|
+
if (v != null && b != null) {
|
|
1607
|
+
const _ = z(v, this._selectionRenderService, this._skeletonManagerService);
|
|
1608
1608
|
t.push({ ...n, sheetTransform: v, transform: _ });
|
|
1609
1609
|
}
|
|
1610
1610
|
return { updateDrawings: t, deleteDrawings: r };
|
|
1611
1611
|
}
|
|
1612
1612
|
_remainDrawingSize(i, e, n) {
|
|
1613
|
-
const t =
|
|
1613
|
+
const t = x({ ...i }, this._selectionRenderService);
|
|
1614
1614
|
t != null && e.push({
|
|
1615
1615
|
...n,
|
|
1616
1616
|
sheetTransform: t
|
|
@@ -1620,25 +1620,25 @@ let an = class extends oe {
|
|
|
1620
1620
|
_getDrawingUndoForColVisible(i, e, n) {
|
|
1621
1621
|
const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
|
|
1622
1622
|
if (Object.keys(t).forEach((d) => {
|
|
1623
|
-
const l = t[d], { sheetTransform: h, transform: u, anchorType: m =
|
|
1624
|
-
if (m ===
|
|
1623
|
+
const l = t[d], { sheetTransform: h, transform: u, anchorType: m = P.Position } = l;
|
|
1624
|
+
if (m === P.None)
|
|
1625
1625
|
this._remainDrawingSize(u, r, l);
|
|
1626
1626
|
else {
|
|
1627
|
-
const { from: p, to: f } = h, { row: w, column: S } = p, { row:
|
|
1627
|
+
const { from: p, to: f } = h, { row: w, column: S } = p, { row: C, column: D } = f;
|
|
1628
1628
|
for (let v = 0; v < n.length; v++) {
|
|
1629
|
-
const
|
|
1629
|
+
const b = n[v], { startRow: _, endRow: O, startColumn: M, endColumn: y } = b;
|
|
1630
1630
|
if (D < M)
|
|
1631
1631
|
continue;
|
|
1632
|
-
if (m ===
|
|
1633
|
-
let R = null,
|
|
1632
|
+
if (m === P.Position) {
|
|
1633
|
+
let R = null, E = null;
|
|
1634
1634
|
if (S >= M && S <= y) {
|
|
1635
|
-
const
|
|
1636
|
-
if (
|
|
1635
|
+
const B = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: y, startRow: p.row, endRow: f.row });
|
|
1636
|
+
if (B == null)
|
|
1637
1637
|
return;
|
|
1638
|
-
|
|
1638
|
+
E = { ...u, left: B.startX };
|
|
1639
1639
|
}
|
|
1640
|
-
if (
|
|
1641
|
-
r.push({ ...l, sheetTransform: R, transform:
|
|
1640
|
+
if (E != null && (R = x(E, this._selectionRenderService), R != null && E != null)) {
|
|
1641
|
+
r.push({ ...l, sheetTransform: R, transform: E });
|
|
1642
1642
|
break;
|
|
1643
1643
|
}
|
|
1644
1644
|
this._remainDrawingSize(u, r, l);
|
|
@@ -1646,12 +1646,12 @@ let an = class extends oe {
|
|
|
1646
1646
|
}
|
|
1647
1647
|
if (S >= M && D <= y)
|
|
1648
1648
|
continue;
|
|
1649
|
-
let
|
|
1649
|
+
let T = null, I = null;
|
|
1650
1650
|
if (S >= M && S <= y) {
|
|
1651
1651
|
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: y, startRow: p.row, endRow: f.row });
|
|
1652
1652
|
if (R == null)
|
|
1653
1653
|
return;
|
|
1654
|
-
|
|
1654
|
+
I = {
|
|
1655
1655
|
...u,
|
|
1656
1656
|
left: (R == null ? void 0 : R.startX) || 0,
|
|
1657
1657
|
width: ((u == null ? void 0 : u.width) || 0) - R.endX + R.startX
|
|
@@ -1660,7 +1660,7 @@ let an = class extends oe {
|
|
|
1660
1660
|
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: M, endColumn: D, startRow: p.row, endRow: f.row });
|
|
1661
1661
|
if (R == null)
|
|
1662
1662
|
return;
|
|
1663
|
-
|
|
1663
|
+
I = {
|
|
1664
1664
|
...u,
|
|
1665
1665
|
left: R.startX - ((u == null ? void 0 : u.width) || 0)
|
|
1666
1666
|
};
|
|
@@ -1668,16 +1668,16 @@ let an = class extends oe {
|
|
|
1668
1668
|
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: M, endColumn: y, startRow: p.row, endRow: f.row });
|
|
1669
1669
|
if (R == null)
|
|
1670
1670
|
return;
|
|
1671
|
-
if (
|
|
1671
|
+
if (I = {
|
|
1672
1672
|
...u,
|
|
1673
1673
|
width: ((u == null ? void 0 : u.width) || 0) - R.endX + R.startX
|
|
1674
|
-
},
|
|
1675
|
-
s.push({ ...l, sheetTransform:
|
|
1674
|
+
}, T = x(I, this._selectionRenderService), T != null && I != null) {
|
|
1675
|
+
s.push({ ...l, sheetTransform: T, transform: I });
|
|
1676
1676
|
break;
|
|
1677
1677
|
}
|
|
1678
1678
|
}
|
|
1679
|
-
if (
|
|
1680
|
-
r.push({ ...l, sheetTransform:
|
|
1679
|
+
if (I != null && (T = x(I, this._selectionRenderService)), I != null && T != null) {
|
|
1680
|
+
r.push({ ...l, sheetTransform: T, transform: I });
|
|
1681
1681
|
break;
|
|
1682
1682
|
} else
|
|
1683
1683
|
this._remainDrawingSize(u, r, l);
|
|
@@ -1699,11 +1699,11 @@ let an = class extends oe {
|
|
|
1699
1699
|
}
|
|
1700
1700
|
_createUndoAndRedoMutation(i, e, n) {
|
|
1701
1701
|
const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, c = [
|
|
1702
|
-
{ id:
|
|
1703
|
-
{ id:
|
|
1702
|
+
{ id: U.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: A.UPDATE } },
|
|
1703
|
+
{ id: L.id, params: [i] }
|
|
1704
1704
|
], a = [
|
|
1705
|
-
{ id:
|
|
1706
|
-
{ id:
|
|
1705
|
+
{ id: U.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type: A.UPDATE } },
|
|
1706
|
+
{ id: L.id, params: [i] }
|
|
1707
1707
|
];
|
|
1708
1708
|
return {
|
|
1709
1709
|
redos: c,
|
|
@@ -1714,64 +1714,64 @@ let an = class extends oe {
|
|
|
1714
1714
|
_getDrawingUndoForRowVisible(i, e, n) {
|
|
1715
1715
|
const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
|
|
1716
1716
|
if (Object.keys(t).forEach((d) => {
|
|
1717
|
-
const l = t[d], { sheetTransform: h, transform: u, anchorType: m =
|
|
1718
|
-
if (m ===
|
|
1717
|
+
const l = t[d], { sheetTransform: h, transform: u, anchorType: m = P.Position } = l;
|
|
1718
|
+
if (m === P.None)
|
|
1719
1719
|
this._remainDrawingSize(u, r, l);
|
|
1720
1720
|
else {
|
|
1721
|
-
const { from: p, to: f } = h, { row: w, column: S } = p, { row:
|
|
1721
|
+
const { from: p, to: f } = h, { row: w, column: S } = p, { row: C, column: D } = f;
|
|
1722
1722
|
for (let v = 0; v < n.length; v++) {
|
|
1723
|
-
const
|
|
1724
|
-
if (
|
|
1723
|
+
const b = n[v], { startRow: _, endRow: O, startColumn: M, endColumn: y } = b;
|
|
1724
|
+
if (C < _)
|
|
1725
1725
|
continue;
|
|
1726
|
-
if (m ===
|
|
1727
|
-
let R = null,
|
|
1728
|
-
if (w >= _ && w <=
|
|
1729
|
-
const
|
|
1730
|
-
if (
|
|
1726
|
+
if (m === P.Position) {
|
|
1727
|
+
let R = null, E = null;
|
|
1728
|
+
if (w >= _ && w <= O) {
|
|
1729
|
+
const B = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: O });
|
|
1730
|
+
if (B == null)
|
|
1731
1731
|
return;
|
|
1732
|
-
|
|
1732
|
+
E = { ...u, top: B.startY };
|
|
1733
1733
|
}
|
|
1734
|
-
if (
|
|
1735
|
-
r.push({ ...l, sheetTransform: R, transform:
|
|
1734
|
+
if (E != null && (R = x(E, this._selectionRenderService), R != null && E != null)) {
|
|
1735
|
+
r.push({ ...l, sheetTransform: R, transform: E });
|
|
1736
1736
|
break;
|
|
1737
1737
|
}
|
|
1738
1738
|
this._remainDrawingSize(u, r, l);
|
|
1739
1739
|
continue;
|
|
1740
1740
|
}
|
|
1741
|
-
if (w >= _ &&
|
|
1741
|
+
if (w >= _ && C <= O)
|
|
1742
1742
|
continue;
|
|
1743
|
-
let
|
|
1744
|
-
if (w >= _ && w <=
|
|
1745
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow:
|
|
1743
|
+
let T = null, I = null;
|
|
1744
|
+
if (w >= _ && w <= O) {
|
|
1745
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: O });
|
|
1746
1746
|
if (R == null)
|
|
1747
1747
|
return;
|
|
1748
|
-
|
|
1748
|
+
I = {
|
|
1749
1749
|
...u,
|
|
1750
1750
|
top: (R == null ? void 0 : R.startY) || 0,
|
|
1751
1751
|
height: ((u == null ? void 0 : u.height) || 0) - R.endY + R.startY
|
|
1752
1752
|
};
|
|
1753
|
-
} else if (
|
|
1754
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow:
|
|
1753
|
+
} else if (C >= _ && C <= O) {
|
|
1754
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: C });
|
|
1755
1755
|
if (R == null)
|
|
1756
1756
|
return;
|
|
1757
|
-
|
|
1757
|
+
I = {
|
|
1758
1758
|
...u,
|
|
1759
1759
|
top: R.startY - ((u == null ? void 0 : u.height) || 0)
|
|
1760
1760
|
};
|
|
1761
1761
|
} else {
|
|
1762
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow:
|
|
1762
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: O });
|
|
1763
1763
|
if (R == null)
|
|
1764
1764
|
return;
|
|
1765
|
-
if (
|
|
1765
|
+
if (I = {
|
|
1766
1766
|
...u,
|
|
1767
1767
|
height: ((u == null ? void 0 : u.height) || 0) - R.endY + R.startY
|
|
1768
|
-
},
|
|
1769
|
-
s.push({ ...l, sheetTransform:
|
|
1768
|
+
}, T = x(I, this._selectionRenderService), T != null && I != null) {
|
|
1769
|
+
s.push({ ...l, sheetTransform: T, transform: I });
|
|
1770
1770
|
break;
|
|
1771
1771
|
}
|
|
1772
1772
|
}
|
|
1773
|
-
if (
|
|
1774
|
-
r.push({ ...l, sheetTransform:
|
|
1773
|
+
if (I != null && (T = x(I, this._selectionRenderService)), I != null && T != null) {
|
|
1774
|
+
r.push({ ...l, sheetTransform: T, transform: I });
|
|
1775
1775
|
break;
|
|
1776
1776
|
} else
|
|
1777
1777
|
this._remainDrawingSize(u, r, l);
|
|
@@ -1794,20 +1794,20 @@ let an = class extends oe {
|
|
|
1794
1794
|
_getDrawingUndoForRowAndColSize(i, e, n, t) {
|
|
1795
1795
|
const r = this._drawingManagerService.getDrawingData(i, e), s = [];
|
|
1796
1796
|
return Object.keys(r).forEach((o) => {
|
|
1797
|
-
const c = r[o], { sheetTransform: a, transform: g, anchorType: d =
|
|
1798
|
-
if (d ===
|
|
1797
|
+
const c = r[o], { sheetTransform: a, transform: g, anchorType: d = P.Position } = c;
|
|
1798
|
+
if (d === P.None)
|
|
1799
1799
|
this._remainDrawingSize(g, s, c);
|
|
1800
1800
|
else {
|
|
1801
1801
|
const { from: l, to: h } = a, { row: u, column: m } = l, { row: p, column: f } = h;
|
|
1802
1802
|
for (let w = 0; w < n.length; w++) {
|
|
1803
|
-
const S = n[w], { startRow:
|
|
1804
|
-
if (p <
|
|
1803
|
+
const S = n[w], { startRow: C, endRow: D, startColumn: v, endColumn: b } = S;
|
|
1804
|
+
if (p < C || f < v)
|
|
1805
1805
|
continue;
|
|
1806
|
-
if (d ===
|
|
1806
|
+
if (d === P.Position && (u <= C && p >= D || m <= v && f >= b)) {
|
|
1807
1807
|
this._remainDrawingSize(g, s, c);
|
|
1808
1808
|
continue;
|
|
1809
1809
|
}
|
|
1810
|
-
const _ =
|
|
1810
|
+
const _ = z(
|
|
1811
1811
|
{ ...a },
|
|
1812
1812
|
this._selectionRenderService,
|
|
1813
1813
|
this._skeletonManagerService
|
|
@@ -1828,7 +1828,7 @@ let an = class extends oe {
|
|
|
1828
1828
|
if (e === "insert")
|
|
1829
1829
|
n = i.unitId, t = i.subUnitId;
|
|
1830
1830
|
else {
|
|
1831
|
-
const r =
|
|
1831
|
+
const r = V(this._univerInstanceService);
|
|
1832
1832
|
if (r == null)
|
|
1833
1833
|
return;
|
|
1834
1834
|
n = r.unitId, t = r.subUnitId;
|
|
@@ -1836,48 +1836,48 @@ let an = class extends oe {
|
|
|
1836
1836
|
return { unitId: n, subUnitId: t };
|
|
1837
1837
|
}
|
|
1838
1838
|
_moveRangeInterceptor(i) {
|
|
1839
|
-
var
|
|
1840
|
-
const { toRange: e, fromRange: n } = i, t =
|
|
1839
|
+
var C, D;
|
|
1840
|
+
const { toRange: e, fromRange: n } = i, t = V(this._univerInstanceService);
|
|
1841
1841
|
if (!t)
|
|
1842
1842
|
return { redos: [], undos: [] };
|
|
1843
|
-
const { unitId: r, subUnitId: s } = t, o = (D = (
|
|
1843
|
+
const { unitId: r, subUnitId: s } = t, o = (D = (C = this._renderManagerService.getRenderById(r)) == null ? void 0 : C.with(X)) == null ? void 0 : D.getCurrentSkeleton();
|
|
1844
1844
|
if (!o)
|
|
1845
1845
|
return { redos: [], undos: [] };
|
|
1846
|
-
const c =
|
|
1846
|
+
const c = xn(o, n);
|
|
1847
1847
|
if (!c)
|
|
1848
1848
|
return { redos: [], undos: [] };
|
|
1849
1849
|
const { startX: a, endX: g, startY: d, endY: l } = c, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
|
|
1850
1850
|
Object.keys(h).forEach((v) => {
|
|
1851
|
-
const
|
|
1852
|
-
if (
|
|
1851
|
+
const b = h[v];
|
|
1852
|
+
if (b.anchorType !== P.Both)
|
|
1853
1853
|
return;
|
|
1854
|
-
const { transform: _ } =
|
|
1854
|
+
const { transform: _ } = b;
|
|
1855
1855
|
if (!_)
|
|
1856
1856
|
return;
|
|
1857
|
-
const { left:
|
|
1858
|
-
drawingStartX:
|
|
1859
|
-
drawingEndX:
|
|
1857
|
+
const { left: O = 0, top: M = 0, width: y = 0, height: T = 0 } = _, { drawingStartX: I, drawingEndX: R, drawingStartY: E, drawingEndY: B } = {
|
|
1858
|
+
drawingStartX: O,
|
|
1859
|
+
drawingEndX: O + y,
|
|
1860
1860
|
drawingStartY: M,
|
|
1861
|
-
drawingEndY: M +
|
|
1861
|
+
drawingEndY: M + T
|
|
1862
1862
|
};
|
|
1863
|
-
a <=
|
|
1863
|
+
a <= I && R <= g && d <= E && B <= l && u.push(b);
|
|
1864
1864
|
});
|
|
1865
1865
|
const m = [], p = [], f = e.startRow - n.startRow, w = e.startColumn - n.startColumn, S = u.map((v) => {
|
|
1866
|
-
const
|
|
1867
|
-
to: { ...
|
|
1868
|
-
from: { ...
|
|
1869
|
-
},
|
|
1866
|
+
const b = v.sheetTransform, _ = {
|
|
1867
|
+
to: { ...b.to, row: b.to.row + f, column: b.to.column + w },
|
|
1868
|
+
from: { ...b.from, row: b.from.row + f, column: b.from.column + w }
|
|
1869
|
+
}, O = z(_, this._selectionRenderService, this._skeletonManagerService);
|
|
1870
1870
|
return {
|
|
1871
1871
|
unitId: r,
|
|
1872
1872
|
subUnitId: s,
|
|
1873
1873
|
drawingId: v.drawingId,
|
|
1874
|
-
transform:
|
|
1874
|
+
transform: O,
|
|
1875
1875
|
sheetTransform: _
|
|
1876
1876
|
};
|
|
1877
1877
|
});
|
|
1878
1878
|
if (S.length) {
|
|
1879
|
-
const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo:
|
|
1880
|
-
m.push({ id:
|
|
1879
|
+
const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: b, redo: _, objects: O } = v;
|
|
1880
|
+
m.push({ id: U.id, params: { unitId: r, subUnitId: s, op: _, objects: O, type: A.UPDATE } }), p.push({ id: U.id, params: { unitId: r, subUnitId: s, op: b, objects: O, type: A.UPDATE } });
|
|
1881
1881
|
}
|
|
1882
1882
|
return { redos: m, undos: p };
|
|
1883
1883
|
}
|
|
@@ -1887,37 +1887,37 @@ let an = class extends oe {
|
|
|
1887
1887
|
return { redos: [], undos: [] };
|
|
1888
1888
|
const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, c = s.endRow, a = [], g = [], d = this._sheetDrawingService.getDrawingData(t, r), l = [], h = [];
|
|
1889
1889
|
if (Object.keys(d).forEach((u) => {
|
|
1890
|
-
const m = d[u], { sheetTransform: p, transform: f, anchorType: w =
|
|
1890
|
+
const m = d[u], { sheetTransform: p, transform: f, anchorType: w = P.Position } = m;
|
|
1891
1891
|
if (p == null || f == null)
|
|
1892
1892
|
return;
|
|
1893
|
-
let S,
|
|
1893
|
+
let S, C;
|
|
1894
1894
|
if (e === "insert") {
|
|
1895
1895
|
const v = this._expandRow(p, f, o, c, w);
|
|
1896
|
-
S = v == null ? void 0 : v.newSheetTransform,
|
|
1896
|
+
S = v == null ? void 0 : v.newSheetTransform, C = v == null ? void 0 : v.newTransform;
|
|
1897
1897
|
} else {
|
|
1898
|
-
const { from: v, to:
|
|
1899
|
-
if (w ===
|
|
1898
|
+
const { from: v, to: b } = p, { row: _ } = v, { row: O } = b;
|
|
1899
|
+
if (w === P.Both && _ >= o && O <= c)
|
|
1900
1900
|
h.push({ unitId: t, subUnitId: r, drawingId: u });
|
|
1901
1901
|
else {
|
|
1902
1902
|
const M = this._shrinkRow(p, f, o, c, w);
|
|
1903
|
-
S = M == null ? void 0 : M.newSheetTransform,
|
|
1903
|
+
S = M == null ? void 0 : M.newSheetTransform, C = M == null ? void 0 : M.newTransform;
|
|
1904
1904
|
}
|
|
1905
1905
|
}
|
|
1906
|
-
if (!S || !
|
|
1906
|
+
if (!S || !C)
|
|
1907
1907
|
return;
|
|
1908
|
-
const D = { unitId: t, subUnitId: r, drawingId: u, transform:
|
|
1908
|
+
const D = { unitId: t, subUnitId: r, drawingId: u, transform: C, sheetTransform: S };
|
|
1909
1909
|
l.push(D);
|
|
1910
1910
|
}), l.length === 0 && h.length === 0)
|
|
1911
1911
|
return { redos: [], undos: [] };
|
|
1912
1912
|
if (l.length > 0) {
|
|
1913
1913
|
const u = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = u;
|
|
1914
|
-
a.push({ id:
|
|
1914
|
+
a.push({ id: U.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: A.UPDATE } }), g.push({ id: U.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: A.UPDATE } });
|
|
1915
1915
|
}
|
|
1916
1916
|
if (h.length > 0) {
|
|
1917
1917
|
const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, p = u.redo, f = u.objects;
|
|
1918
|
-
a.push({ id:
|
|
1918
|
+
a.push({ id: U.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: A.REMOVE } }), g.push({ id: U.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: A.INSERT } });
|
|
1919
1919
|
}
|
|
1920
|
-
return a.push({ id:
|
|
1920
|
+
return a.push({ id: L.id, params: [t] }), g.push({ id: L.id, params: [t] }), {
|
|
1921
1921
|
redos: a,
|
|
1922
1922
|
undos: g
|
|
1923
1923
|
};
|
|
@@ -1928,43 +1928,43 @@ let an = class extends oe {
|
|
|
1928
1928
|
return { redos: [], undos: [] };
|
|
1929
1929
|
const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, c = s.endColumn, a = [], g = [], d = this._sheetDrawingService.getDrawingData(t, r), l = [], h = [];
|
|
1930
1930
|
if (Object.keys(d).forEach((u) => {
|
|
1931
|
-
const m = d[u], { sheetTransform: p, transform: f, anchorType: w =
|
|
1931
|
+
const m = d[u], { sheetTransform: p, transform: f, anchorType: w = P.Position } = m;
|
|
1932
1932
|
if (p == null || f == null)
|
|
1933
1933
|
return;
|
|
1934
|
-
let S,
|
|
1934
|
+
let S, C;
|
|
1935
1935
|
if (e === "insert") {
|
|
1936
1936
|
const v = this._expandCol(p, f, o, c, w);
|
|
1937
|
-
S = v == null ? void 0 : v.newSheetTransform,
|
|
1937
|
+
S = v == null ? void 0 : v.newSheetTransform, C = v == null ? void 0 : v.newTransform;
|
|
1938
1938
|
} else {
|
|
1939
|
-
const { from: v, to:
|
|
1940
|
-
if (w ===
|
|
1939
|
+
const { from: v, to: b } = p, { column: _ } = v, { column: O } = b;
|
|
1940
|
+
if (w === P.Both && _ >= o && O <= c)
|
|
1941
1941
|
h.push({ unitId: t, subUnitId: r, drawingId: u });
|
|
1942
1942
|
else {
|
|
1943
1943
|
const M = this._shrinkCol(p, f, o, c, w);
|
|
1944
|
-
S = M == null ? void 0 : M.newSheetTransform,
|
|
1944
|
+
S = M == null ? void 0 : M.newSheetTransform, C = M == null ? void 0 : M.newTransform;
|
|
1945
1945
|
}
|
|
1946
1946
|
}
|
|
1947
|
-
if (!S || !
|
|
1947
|
+
if (!S || !C)
|
|
1948
1948
|
return;
|
|
1949
|
-
const D = { unitId: t, subUnitId: r, drawingId: u, transform:
|
|
1949
|
+
const D = { unitId: t, subUnitId: r, drawingId: u, transform: C, sheetTransform: S };
|
|
1950
1950
|
l.push(D);
|
|
1951
1951
|
}), l.length === 0 && h.length === 0)
|
|
1952
1952
|
return { redos: [], undos: [] };
|
|
1953
1953
|
if (l.length > 0) {
|
|
1954
1954
|
const u = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = u;
|
|
1955
|
-
a.push({ id:
|
|
1955
|
+
a.push({ id: U.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: A.UPDATE } }), g.push({ id: U.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: A.UPDATE } });
|
|
1956
1956
|
}
|
|
1957
1957
|
if (h.length > 0) {
|
|
1958
1958
|
const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, p = u.redo, f = u.objects;
|
|
1959
|
-
a.push({ id:
|
|
1959
|
+
a.push({ id: U.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: A.REMOVE } }), g.push({ id: U.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: A.INSERT } });
|
|
1960
1960
|
}
|
|
1961
|
-
return a.push({ id:
|
|
1961
|
+
return a.push({ id: L.id, params: [t] }), g.push({ id: L.id, params: [t] }), { redos: a, undos: g };
|
|
1962
1962
|
}
|
|
1963
|
-
_expandCol(i, e, n, t, r =
|
|
1963
|
+
_expandCol(i, e, n, t, r = P.Position) {
|
|
1964
1964
|
const s = t - n + 1, { from: o, to: c } = i, { column: a } = o, { column: g } = c;
|
|
1965
|
-
if (r ===
|
|
1965
|
+
if (r === P.None)
|
|
1966
1966
|
return {
|
|
1967
|
-
newSheetTransform:
|
|
1967
|
+
newSheetTransform: x({ ...e }, this._selectionRenderService),
|
|
1968
1968
|
newTransform: e
|
|
1969
1969
|
};
|
|
1970
1970
|
let d = null, l = null;
|
|
@@ -1972,16 +1972,16 @@ let an = class extends oe {
|
|
|
1972
1972
|
const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: c.row });
|
|
1973
1973
|
if (h == null)
|
|
1974
1974
|
return;
|
|
1975
|
-
l = { ...e, left: (e.left || 0) + h.endX - h.startX }, d =
|
|
1975
|
+
l = { ...e, left: (e.left || 0) + h.endX - h.startX }, d = x(l, this._selectionRenderService);
|
|
1976
1976
|
} else if (g >= t)
|
|
1977
|
-
if (r ===
|
|
1977
|
+
if (r === P.Both)
|
|
1978
1978
|
d = {
|
|
1979
1979
|
from: { ...o },
|
|
1980
1980
|
to: { ...c, column: g + s }
|
|
1981
|
-
}, l =
|
|
1981
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
1982
1982
|
else
|
|
1983
1983
|
return {
|
|
1984
|
-
newSheetTransform:
|
|
1984
|
+
newSheetTransform: x({ ...e }, this._selectionRenderService),
|
|
1985
1985
|
newTransform: e
|
|
1986
1986
|
};
|
|
1987
1987
|
return d != null && l != null ? {
|
|
@@ -1989,11 +1989,11 @@ let an = class extends oe {
|
|
|
1989
1989
|
newTransform: l
|
|
1990
1990
|
} : null;
|
|
1991
1991
|
}
|
|
1992
|
-
_shrinkCol(i, e, n, t, r =
|
|
1992
|
+
_shrinkCol(i, e, n, t, r = P.Position) {
|
|
1993
1993
|
const s = t - n + 1, { from: o, to: c } = i, { column: a } = o, { column: g } = c;
|
|
1994
|
-
if (r ===
|
|
1994
|
+
if (r === P.None)
|
|
1995
1995
|
return {
|
|
1996
|
-
newSheetTransform:
|
|
1996
|
+
newSheetTransform: x({ ...e }, this._selectionRenderService),
|
|
1997
1997
|
newTransform: e
|
|
1998
1998
|
};
|
|
1999
1999
|
let d = null, l = null;
|
|
@@ -2001,19 +2001,19 @@ let an = class extends oe {
|
|
|
2001
2001
|
d = {
|
|
2002
2002
|
from: { ...o, column: a - s },
|
|
2003
2003
|
to: { ...c, column: g - s }
|
|
2004
|
-
}, l =
|
|
2004
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2005
2005
|
else {
|
|
2006
2006
|
if (a >= n && g <= t)
|
|
2007
2007
|
return null;
|
|
2008
2008
|
if (a < n && g > t)
|
|
2009
|
-
if (r ===
|
|
2009
|
+
if (r === P.Both)
|
|
2010
2010
|
d = {
|
|
2011
2011
|
from: { ...o },
|
|
2012
2012
|
to: { ...c, column: g - s }
|
|
2013
|
-
}, l =
|
|
2013
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2014
2014
|
else
|
|
2015
2015
|
return {
|
|
2016
|
-
newSheetTransform:
|
|
2016
|
+
newSheetTransform: x({ ...e }, this._selectionRenderService),
|
|
2017
2017
|
newTransform: e
|
|
2018
2018
|
};
|
|
2019
2019
|
else if (a >= n && a <= t) {
|
|
@@ -2025,8 +2025,8 @@ let an = class extends oe {
|
|
|
2025
2025
|
return;
|
|
2026
2026
|
l = { ...e, left: (e.left || 0) - h.endX + h.startX - i.from.columnOffset };
|
|
2027
2027
|
}
|
|
2028
|
-
d =
|
|
2029
|
-
} else if (g >= n && g <= t && r ===
|
|
2028
|
+
d = x(l, this._selectionRenderService);
|
|
2029
|
+
} else if (g >= n && g <= t && r === P.Both) {
|
|
2030
2030
|
const h = this._skeletonManagerService.attachRangeWithCoord({
|
|
2031
2031
|
startColumn: n - 1,
|
|
2032
2032
|
endColumn: n - 1,
|
|
@@ -2038,7 +2038,7 @@ let an = class extends oe {
|
|
|
2038
2038
|
d = {
|
|
2039
2039
|
from: { ...o },
|
|
2040
2040
|
to: { ...c, column: n - 1, columnOffset: h.endX - h.startX }
|
|
2041
|
-
}, l =
|
|
2041
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
2044
|
return d != null && l != null ? {
|
|
@@ -2046,11 +2046,11 @@ let an = class extends oe {
|
|
|
2046
2046
|
newTransform: l
|
|
2047
2047
|
} : null;
|
|
2048
2048
|
}
|
|
2049
|
-
_expandRow(i, e, n, t, r =
|
|
2049
|
+
_expandRow(i, e, n, t, r = P.Position) {
|
|
2050
2050
|
const s = t - n + 1, { from: o, to: c } = i, { row: a } = o, { row: g } = c;
|
|
2051
|
-
if (r ===
|
|
2051
|
+
if (r === P.None)
|
|
2052
2052
|
return {
|
|
2053
|
-
newSheetTransform:
|
|
2053
|
+
newSheetTransform: x({ ...e }, this._selectionRenderService),
|
|
2054
2054
|
newTransform: e
|
|
2055
2055
|
};
|
|
2056
2056
|
let d = null, l = null;
|
|
@@ -2058,19 +2058,19 @@ let an = class extends oe {
|
|
|
2058
2058
|
const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: c.column });
|
|
2059
2059
|
if (h == null)
|
|
2060
2060
|
return;
|
|
2061
|
-
l = { ...e, top: (e.top || 0) + h.endY - h.startY }, d =
|
|
2061
|
+
l = { ...e, top: (e.top || 0) + h.endY - h.startY }, d = x(l, this._selectionRenderService);
|
|
2062
2062
|
} else if (g >= t)
|
|
2063
|
-
if (r ===
|
|
2063
|
+
if (r === P.Both)
|
|
2064
2064
|
d = {
|
|
2065
2065
|
from: { ...o },
|
|
2066
2066
|
to: {
|
|
2067
2067
|
...c,
|
|
2068
2068
|
row: g + s
|
|
2069
2069
|
}
|
|
2070
|
-
}, l =
|
|
2070
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2071
2071
|
else
|
|
2072
2072
|
return {
|
|
2073
|
-
newSheetTransform:
|
|
2073
|
+
newSheetTransform: x({ ...e }, this._selectionRenderService),
|
|
2074
2074
|
newTransform: e
|
|
2075
2075
|
};
|
|
2076
2076
|
return d != null && l != null ? {
|
|
@@ -2078,11 +2078,11 @@ let an = class extends oe {
|
|
|
2078
2078
|
newTransform: l
|
|
2079
2079
|
} : null;
|
|
2080
2080
|
}
|
|
2081
|
-
_shrinkRow(i, e, n, t, r =
|
|
2081
|
+
_shrinkRow(i, e, n, t, r = P.Position) {
|
|
2082
2082
|
const s = t - n + 1, { from: o, to: c } = i, { row: a } = o, { row: g } = c;
|
|
2083
|
-
if (r ===
|
|
2083
|
+
if (r === P.None)
|
|
2084
2084
|
return {
|
|
2085
|
-
newSheetTransform:
|
|
2085
|
+
newSheetTransform: x({ ...e }, this._selectionRenderService),
|
|
2086
2086
|
newTransform: e
|
|
2087
2087
|
};
|
|
2088
2088
|
let d = null, l = null;
|
|
@@ -2090,19 +2090,19 @@ let an = class extends oe {
|
|
|
2090
2090
|
d = {
|
|
2091
2091
|
from: { ...o, row: a - s },
|
|
2092
2092
|
to: { ...c, row: g - s }
|
|
2093
|
-
}, l =
|
|
2093
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2094
2094
|
else {
|
|
2095
2095
|
if (a >= n && g <= t)
|
|
2096
2096
|
return null;
|
|
2097
2097
|
if (a < n && g > t)
|
|
2098
|
-
if (r ===
|
|
2098
|
+
if (r === P.Both)
|
|
2099
2099
|
d = {
|
|
2100
2100
|
from: { ...o },
|
|
2101
2101
|
to: { ...c, row: g - s }
|
|
2102
|
-
}, l =
|
|
2102
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2103
2103
|
else
|
|
2104
2104
|
return {
|
|
2105
|
-
newSheetTransform:
|
|
2105
|
+
newSheetTransform: x({ ...e }, this._selectionRenderService),
|
|
2106
2106
|
newTransform: e
|
|
2107
2107
|
};
|
|
2108
2108
|
else if (a >= n && a <= t) {
|
|
@@ -2114,15 +2114,15 @@ let an = class extends oe {
|
|
|
2114
2114
|
return;
|
|
2115
2115
|
l = { ...e, top: (e.top || 0) - h.endY + h.startY - i.from.rowOffset };
|
|
2116
2116
|
}
|
|
2117
|
-
d =
|
|
2118
|
-
} else if (g >= n && g <= t && r ===
|
|
2117
|
+
d = x(l, this._selectionRenderService);
|
|
2118
|
+
} else if (g >= n && g <= t && r === P.Both) {
|
|
2119
2119
|
const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: n - 1, endRow: n - 1 });
|
|
2120
2120
|
if (h == null)
|
|
2121
2121
|
return;
|
|
2122
2122
|
d = {
|
|
2123
2123
|
from: { ...o },
|
|
2124
2124
|
to: { ...c, row: n - 1, rowOffset: h.endY - h.startY }
|
|
2125
|
-
}, l =
|
|
2125
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
2126
2126
|
}
|
|
2127
2127
|
}
|
|
2128
2128
|
return d != null && l != null ? {
|
|
@@ -2136,7 +2136,7 @@ let an = class extends oe {
|
|
|
2136
2136
|
// but the skeleton changes like other render modules. These two signals are not equivalent.
|
|
2137
2137
|
// As a temp solution, I subscribed to activate$ here.
|
|
2138
2138
|
this._commandService.onCommandExecuted((i) => {
|
|
2139
|
-
if (i.id ===
|
|
2139
|
+
if (i.id === Zi.id) {
|
|
2140
2140
|
const { unitId: e, subUnitId: n } = i.params;
|
|
2141
2141
|
this._updateDrawings(e, n);
|
|
2142
2142
|
}
|
|
@@ -2176,7 +2176,7 @@ let an = class extends oe {
|
|
|
2176
2176
|
a != null && Object.keys(a).forEach((g) => {
|
|
2177
2177
|
if (s === i && c === e) {
|
|
2178
2178
|
const d = a[g];
|
|
2179
|
-
d.transform =
|
|
2179
|
+
d.transform = z(d.sheetTransform, this._selectionRenderService, this._skeletonManagerService), t.push(a[g]);
|
|
2180
2180
|
} else
|
|
2181
2181
|
r.push(a[g]);
|
|
2182
2182
|
});
|
|
@@ -2187,7 +2187,7 @@ let an = class extends oe {
|
|
|
2187
2187
|
_sheetRefreshListener() {
|
|
2188
2188
|
this.disposeWithMe(
|
|
2189
2189
|
this._commandService.onCommandExecuted((i) => {
|
|
2190
|
-
|
|
2190
|
+
Ks.includes(i.id) && requestIdleCallback(() => {
|
|
2191
2191
|
const e = i.params, { unitId: n, subUnitId: t, ranges: r } = e;
|
|
2192
2192
|
this._refreshDrawingTransform(n, t, r);
|
|
2193
2193
|
});
|
|
@@ -2197,16 +2197,16 @@ let an = class extends oe {
|
|
|
2197
2197
|
_refreshDrawingTransform(i, e, n) {
|
|
2198
2198
|
const t = this._drawingManagerService.getDrawingData(i, e), r = [];
|
|
2199
2199
|
Object.keys(t).forEach((s) => {
|
|
2200
|
-
const o = t[s], { sheetTransform: c, transform: a, anchorType: g =
|
|
2201
|
-
if (g ===
|
|
2200
|
+
const o = t[s], { sheetTransform: c, transform: a, anchorType: g = P.Position } = o;
|
|
2201
|
+
if (g === P.None)
|
|
2202
2202
|
return !0;
|
|
2203
2203
|
const { from: d, to: l } = c, { row: h, column: u } = d, { row: m, column: p } = l;
|
|
2204
2204
|
for (let f = 0; f < n.length; f++) {
|
|
2205
|
-
const w = n[f], { startRow: S, endRow:
|
|
2206
|
-
if (
|
|
2205
|
+
const w = n[f], { startRow: S, endRow: C, startColumn: D, endColumn: v } = w;
|
|
2206
|
+
if (Vr.intersects(
|
|
2207
2207
|
{
|
|
2208
2208
|
startRow: S,
|
|
2209
|
-
endRow:
|
|
2209
|
+
endRow: C,
|
|
2210
2210
|
startColumn: D,
|
|
2211
2211
|
endColumn: v
|
|
2212
2212
|
},
|
|
@@ -2216,58 +2216,58 @@ let an = class extends oe {
|
|
|
2216
2216
|
startColumn: u,
|
|
2217
2217
|
endColumn: p
|
|
2218
2218
|
}
|
|
2219
|
-
) || h >
|
|
2220
|
-
const
|
|
2219
|
+
) || h > C || u > v) {
|
|
2220
|
+
const b = g === P.Position, _ = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
2221
2221
|
r.push({
|
|
2222
2222
|
...o,
|
|
2223
2223
|
transform: {
|
|
2224
2224
|
..._,
|
|
2225
|
-
width:
|
|
2226
|
-
height:
|
|
2225
|
+
width: b ? a == null ? void 0 : a.width : _ == null ? void 0 : _.width,
|
|
2226
|
+
height: b ? a == null ? void 0 : a.height : _ == null ? void 0 : _.height
|
|
2227
2227
|
}
|
|
2228
2228
|
});
|
|
2229
2229
|
break;
|
|
2230
2230
|
}
|
|
2231
2231
|
}
|
|
2232
|
-
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(
|
|
2232
|
+
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(L.id, [i]));
|
|
2233
2233
|
}
|
|
2234
2234
|
};
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
],
|
|
2245
|
-
var
|
|
2246
|
-
return
|
|
2235
|
+
cn = Hs([
|
|
2236
|
+
we(1, ne),
|
|
2237
|
+
we(2, k),
|
|
2238
|
+
we(3, Ye),
|
|
2239
|
+
we(4, N(X)),
|
|
2240
|
+
we(5, N(Yt)),
|
|
2241
|
+
we(6, ae),
|
|
2242
|
+
we(7, oe),
|
|
2243
|
+
we(8, Fe)
|
|
2244
|
+
], cn);
|
|
2245
|
+
var se = function() {
|
|
2246
|
+
return se = Object.assign || function(i) {
|
|
2247
2247
|
for (var e, n = 1, t = arguments.length; n < t; n++) {
|
|
2248
2248
|
e = arguments[n];
|
|
2249
2249
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
|
|
2250
2250
|
}
|
|
2251
2251
|
return i;
|
|
2252
|
-
},
|
|
2253
|
-
},
|
|
2252
|
+
}, se.apply(this, arguments);
|
|
2253
|
+
}, Zs = function(i, e) {
|
|
2254
2254
|
var n = {};
|
|
2255
2255
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
|
|
2256
2256
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
2257
2257
|
for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
|
|
2258
2258
|
e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
|
|
2259
2259
|
return n;
|
|
2260
|
-
},
|
|
2261
|
-
var n = i.icon, t = i.id, r = i.className, s = i.extend, o =
|
|
2262
|
-
return
|
|
2260
|
+
}, wr = ar(function(i, e) {
|
|
2261
|
+
var n = i.icon, t = i.id, r = i.className, s = i.extend, o = Zs(i, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), a = ts("_".concat(Qs()));
|
|
2262
|
+
return _r(n, "".concat(t), { defIds: n.defIds, idSuffix: a.current }, se({ ref: e, className: c }, o), s);
|
|
2263
2263
|
});
|
|
2264
|
-
function
|
|
2265
|
-
return
|
|
2266
|
-
return
|
|
2264
|
+
function _r(i, e, n, t, r) {
|
|
2265
|
+
return cr(i.tag, se(se({ key: e }, Js(i, n, r)), t), (qs(i, n).children || []).map(function(s, o) {
|
|
2266
|
+
return _r(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
|
|
2267
2267
|
}));
|
|
2268
2268
|
}
|
|
2269
|
-
function
|
|
2270
|
-
var t =
|
|
2269
|
+
function Js(i, e, n) {
|
|
2270
|
+
var t = se({}, i.attrs);
|
|
2271
2271
|
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
|
|
2272
2272
|
var r = e.defIds;
|
|
2273
2273
|
return !r || r.length === 0 || (i.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + e.idSuffix), Object.entries(t).forEach(function(s) {
|
|
@@ -2275,29 +2275,29 @@ function zs(i, e, n) {
|
|
|
2275
2275
|
typeof c == "string" && (t[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
2276
2276
|
})), t;
|
|
2277
2277
|
}
|
|
2278
|
-
function
|
|
2278
|
+
function qs(i, e) {
|
|
2279
2279
|
var n, t = e.defIds;
|
|
2280
|
-
return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ?
|
|
2281
|
-
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ?
|
|
2280
|
+
return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? se(se({}, i), { children: i.children.map(function(r) {
|
|
2281
|
+
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? se(se({}, r), { attrs: se(se({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
2282
2282
|
}) }) : i;
|
|
2283
2283
|
}
|
|
2284
|
-
function
|
|
2284
|
+
function Qs() {
|
|
2285
2285
|
return Math.random().toString(36).substring(2, 8);
|
|
2286
2286
|
}
|
|
2287
|
-
|
|
2288
|
-
var
|
|
2289
|
-
return
|
|
2287
|
+
wr.displayName = "UniverIcon";
|
|
2288
|
+
var eo = { 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" } }] }, vr = ar(function(i, e) {
|
|
2289
|
+
return cr(wr, Object.assign({}, i, {
|
|
2290
2290
|
id: "add-image-single",
|
|
2291
2291
|
ref: e,
|
|
2292
|
-
icon:
|
|
2292
|
+
icon: eo
|
|
2293
2293
|
}));
|
|
2294
2294
|
});
|
|
2295
|
-
|
|
2296
|
-
const
|
|
2295
|
+
vr.displayName = "AddImageSingle";
|
|
2296
|
+
const Sr = {
|
|
2297
2297
|
id: "sheet.command.delete-drawing",
|
|
2298
|
-
type:
|
|
2298
|
+
type: te.COMMAND,
|
|
2299
2299
|
handler: (i) => {
|
|
2300
|
-
const e = i.get(
|
|
2300
|
+
const e = i.get(k), t = i.get(ae).getFocusDrawings();
|
|
2301
2301
|
if (t.length === 0)
|
|
2302
2302
|
return !1;
|
|
2303
2303
|
const r = t[0].unitId, s = t.map((o) => {
|
|
@@ -2309,16 +2309,16 @@ const wr = {
|
|
|
2309
2309
|
drawingType: d
|
|
2310
2310
|
};
|
|
2311
2311
|
});
|
|
2312
|
-
return e.executeCommand(
|
|
2312
|
+
return e.executeCommand(tt.id, {
|
|
2313
2313
|
unitId: r,
|
|
2314
2314
|
drawings: s
|
|
2315
2315
|
});
|
|
2316
2316
|
}
|
|
2317
|
-
},
|
|
2317
|
+
}, nt = {
|
|
2318
2318
|
id: "sheet.command.move-drawing",
|
|
2319
|
-
type:
|
|
2319
|
+
type: te.COMMAND,
|
|
2320
2320
|
handler: (i, e) => {
|
|
2321
|
-
const n = i.get(
|
|
2321
|
+
const n = i.get(k), t = i.get(ae), r = i.get(Ye), { direction: s } = e, o = t.getFocusDrawings();
|
|
2322
2322
|
if (o.length === 0)
|
|
2323
2323
|
return !1;
|
|
2324
2324
|
const c = o[0].unitId, a = o.map((d) => {
|
|
@@ -2326,110 +2326,110 @@ const wr = {
|
|
|
2326
2326
|
if (l == null)
|
|
2327
2327
|
return null;
|
|
2328
2328
|
const h = { ...l }, { left: u = 0, top: m = 0 } = l;
|
|
2329
|
-
return s ===
|
|
2329
|
+
return s === ve.UP ? h.top = m - 1 : s === ve.DOWN ? h.top = m + 1 : s === ve.LEFT ? h.left = u - 1 : s === ve.RIGHT && (h.left = u + 1), {
|
|
2330
2330
|
...d,
|
|
2331
2331
|
transform: h,
|
|
2332
|
-
sheetTransform:
|
|
2332
|
+
sheetTransform: x(h, r)
|
|
2333
2333
|
};
|
|
2334
2334
|
}).filter((d) => d != null);
|
|
2335
|
-
return n.syncExecuteCommand(
|
|
2335
|
+
return n.syncExecuteCommand(Gt.id, {
|
|
2336
2336
|
unitId: c,
|
|
2337
2337
|
drawings: a
|
|
2338
|
-
}) ? (n.syncExecuteCommand(
|
|
2338
|
+
}) ? (n.syncExecuteCommand(L.id, [c]), !0) : !1;
|
|
2339
2339
|
}
|
|
2340
|
-
},
|
|
2341
|
-
function
|
|
2340
|
+
}, Ir = "addition-and-subtraction-single", Cr = "sheet.menu.image";
|
|
2341
|
+
function to(i) {
|
|
2342
2342
|
return {
|
|
2343
|
-
id:
|
|
2344
|
-
type:
|
|
2345
|
-
icon:
|
|
2343
|
+
id: Cr,
|
|
2344
|
+
type: dn.SUBITEMS,
|
|
2345
|
+
icon: Ir,
|
|
2346
2346
|
tooltip: "sheetImage.title",
|
|
2347
|
-
hidden$:
|
|
2348
|
-
disabled$:
|
|
2347
|
+
hidden$: Ln(i, H.UNIVER_SHEET),
|
|
2348
|
+
disabled$: Di(i, { workbookTypes: [tn], worksheetTypes: [Tt], rangeTypes: [Ji] })
|
|
2349
2349
|
};
|
|
2350
2350
|
}
|
|
2351
|
-
function
|
|
2351
|
+
function no(i) {
|
|
2352
2352
|
return {
|
|
2353
|
-
id:
|
|
2353
|
+
id: Xt.id,
|
|
2354
2354
|
title: "sheetImage.upload.float",
|
|
2355
|
-
type:
|
|
2356
|
-
hidden$:
|
|
2355
|
+
type: dn.BUTTON,
|
|
2356
|
+
hidden$: Ln(i, H.UNIVER_SHEET)
|
|
2357
2357
|
};
|
|
2358
2358
|
}
|
|
2359
|
-
function
|
|
2359
|
+
function ro(i) {
|
|
2360
2360
|
return {
|
|
2361
|
-
id:
|
|
2361
|
+
id: hn.id,
|
|
2362
2362
|
title: "sheetImage.upload.cell",
|
|
2363
|
-
type:
|
|
2363
|
+
type: dn.BUTTON
|
|
2364
2364
|
};
|
|
2365
2365
|
}
|
|
2366
|
-
const
|
|
2367
|
-
imageCommonPanel:
|
|
2368
|
-
imageCommonPanelGrid:
|
|
2369
|
-
imageCommonPanelBorder:
|
|
2370
|
-
imageCommonPanelTitle:
|
|
2371
|
-
imageCommonPanelSubtitle:
|
|
2372
|
-
imageCommonPanelRow:
|
|
2373
|
-
imageCommonPanelRowVertical:
|
|
2374
|
-
imageCommonPanelColumn:
|
|
2375
|
-
imageCommonPanelColumnCenter:
|
|
2376
|
-
imageCommonPanelInline:
|
|
2377
|
-
imageCommonPanelSpan2:
|
|
2378
|
-
imageCommonPanelSpan3:
|
|
2379
|
-
imageCommonPanelInput:
|
|
2380
|
-
sheetImageMenu:
|
|
2381
|
-
sheetImageMenuInput:
|
|
2366
|
+
const io = "univer-image-common-panel", so = "univer-image-common-panel-grid", oo = "univer-image-common-panel-border", ao = "univer-image-common-panel-title", co = "univer-image-common-panel-subtitle", lo = "univer-image-common-panel-row", uo = "univer-image-common-panel-row-vertical", ho = "univer-image-common-panel-column", go = "univer-image-common-panel-column-center", fo = "univer-image-common-panel-inline", mo = "univer-image-common-panel-span2", po = "univer-image-common-panel-span3", wo = "univer-image-common-panel-input", _o = "univer-sheet-image-menu", vo = "univer-sheet-image-menu-input", _e = {
|
|
2367
|
+
imageCommonPanel: io,
|
|
2368
|
+
imageCommonPanelGrid: so,
|
|
2369
|
+
imageCommonPanelBorder: oo,
|
|
2370
|
+
imageCommonPanelTitle: ao,
|
|
2371
|
+
imageCommonPanelSubtitle: co,
|
|
2372
|
+
imageCommonPanelRow: lo,
|
|
2373
|
+
imageCommonPanelRowVertical: uo,
|
|
2374
|
+
imageCommonPanelColumn: ho,
|
|
2375
|
+
imageCommonPanelColumnCenter: go,
|
|
2376
|
+
imageCommonPanelInline: fo,
|
|
2377
|
+
imageCommonPanelSpan2: mo,
|
|
2378
|
+
imageCommonPanelSpan3: po,
|
|
2379
|
+
imageCommonPanelInput: wo,
|
|
2380
|
+
sheetImageMenu: _o,
|
|
2381
|
+
sheetImageMenuInput: vo
|
|
2382
2382
|
};
|
|
2383
|
-
function
|
|
2383
|
+
function br(i) {
|
|
2384
2384
|
var e, n, t = "";
|
|
2385
2385
|
if (typeof i == "string" || typeof i == "number") t += i;
|
|
2386
2386
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
2387
2387
|
var r = i.length;
|
|
2388
|
-
for (e = 0; e < r; e++) i[e] && (n =
|
|
2388
|
+
for (e = 0; e < r; e++) i[e] && (n = br(i[e])) && (t && (t += " "), t += n);
|
|
2389
2389
|
} else for (n in i) i[n] && (t && (t += " "), t += n);
|
|
2390
2390
|
return t;
|
|
2391
2391
|
}
|
|
2392
|
-
function
|
|
2393
|
-
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e =
|
|
2392
|
+
function Dt() {
|
|
2393
|
+
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = br(i)) && (t && (t += " "), t += e);
|
|
2394
2394
|
return t;
|
|
2395
2395
|
}
|
|
2396
|
-
const
|
|
2397
|
-
var
|
|
2398
|
-
const e =
|
|
2396
|
+
const So = (i) => {
|
|
2397
|
+
var C;
|
|
2398
|
+
const e = De(k), n = De(Lt), t = De(oe), r = De(ne), { drawings: s } = i, o = s[0];
|
|
2399
2399
|
if (o == null)
|
|
2400
2400
|
return;
|
|
2401
2401
|
const { unitId: c } = o, a = r.getRenderById(c), g = a == null ? void 0 : a.scene;
|
|
2402
2402
|
if (g == null)
|
|
2403
2403
|
return;
|
|
2404
|
-
const d = g.getTransformerByCreate(), [l, h] =
|
|
2404
|
+
const d = g.getTransformerByCreate(), [l, h] = sn(!0), u = (C = o.anchorType) != null ? C : P.Position, [m, p] = sn(u);
|
|
2405
2405
|
function f(D, v) {
|
|
2406
|
-
const
|
|
2406
|
+
const b = [];
|
|
2407
2407
|
return D.forEach((_) => {
|
|
2408
|
-
const { oKey:
|
|
2408
|
+
const { oKey: O } = _, M = v.getDrawingOKey(O);
|
|
2409
2409
|
if (M == null)
|
|
2410
|
-
return
|
|
2411
|
-
const { unitId: y, subUnitId:
|
|
2412
|
-
|
|
2410
|
+
return b.push(null), !0;
|
|
2411
|
+
const { unitId: y, subUnitId: T, drawingId: I, drawingType: R, anchorType: E, sheetTransform: B } = M;
|
|
2412
|
+
b.push({
|
|
2413
2413
|
unitId: y,
|
|
2414
|
-
subUnitId:
|
|
2415
|
-
drawingId:
|
|
2416
|
-
anchorType:
|
|
2417
|
-
sheetTransform:
|
|
2414
|
+
subUnitId: T,
|
|
2415
|
+
drawingId: I,
|
|
2416
|
+
anchorType: E,
|
|
2417
|
+
sheetTransform: B,
|
|
2418
2418
|
drawingType: R
|
|
2419
2419
|
});
|
|
2420
|
-
}),
|
|
2420
|
+
}), b;
|
|
2421
2421
|
}
|
|
2422
|
-
|
|
2423
|
-
const D = d.clearControl$.subscribe((
|
|
2424
|
-
|
|
2425
|
-
}), v = d.changeStart$.subscribe((
|
|
2422
|
+
un(() => {
|
|
2423
|
+
const D = d.clearControl$.subscribe((b) => {
|
|
2424
|
+
b === !0 && h(!1);
|
|
2425
|
+
}), v = d.changeStart$.subscribe((b) => {
|
|
2426
2426
|
var M;
|
|
2427
|
-
const { objects: _ } =
|
|
2428
|
-
if (
|
|
2427
|
+
const { objects: _ } = b, O = f(_, t);
|
|
2428
|
+
if (O.length === 0)
|
|
2429
2429
|
h(!1);
|
|
2430
|
-
else if (
|
|
2430
|
+
else if (O.length >= 1) {
|
|
2431
2431
|
h(!0);
|
|
2432
|
-
const y = ((M =
|
|
2432
|
+
const y = ((M = O[0]) == null ? void 0 : M.anchorType) || P.Position;
|
|
2433
2433
|
p(y);
|
|
2434
2434
|
}
|
|
2435
2435
|
});
|
|
@@ -2442,148 +2442,148 @@ const wo = (i) => {
|
|
|
2442
2442
|
const v = t.getFocusDrawings();
|
|
2443
2443
|
if (v.length === 0)
|
|
2444
2444
|
return;
|
|
2445
|
-
const
|
|
2445
|
+
const b = v.map((_) => ({
|
|
2446
2446
|
unitId: _.unitId,
|
|
2447
2447
|
subUnitId: _.subUnitId,
|
|
2448
2448
|
drawingId: _.drawingId,
|
|
2449
2449
|
anchorType: D
|
|
2450
2450
|
}));
|
|
2451
|
-
e.executeCommand(
|
|
2451
|
+
e.executeCommand(Gt.id, {
|
|
2452
2452
|
unitId: v[0].unitId,
|
|
2453
|
-
drawings:
|
|
2453
|
+
drawings: b
|
|
2454
2454
|
});
|
|
2455
2455
|
}
|
|
2456
2456
|
const S = (D) => D ? "block" : "none";
|
|
2457
|
-
return /* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */
|
|
2462
|
-
/* @__PURE__ */
|
|
2457
|
+
return /* @__PURE__ */ Ot("div", { className: Dt(_e.imageCommonPanelGrid, _e.imageCommonPanelBorder), style: { display: S(l) }, children: [
|
|
2458
|
+
/* @__PURE__ */ ee("div", { className: _e.imageCommonPanelRow, children: /* @__PURE__ */ ee("div", { className: Dt(_e.imageCommonPanelColumn, _e.imageCommonPanelTitle), children: /* @__PURE__ */ ee("div", { children: n.t("drawing-anchor.title") }) }) }),
|
|
2459
|
+
/* @__PURE__ */ ee("div", { className: Dt(_e.imageCommonPanelRow), children: /* @__PURE__ */ ee("div", { className: Dt(_e.imageCommonPanelColumn), children: /* @__PURE__ */ Ot(is, { value: m, onChange: w, direction: "vertical", children: [
|
|
2460
|
+
/* @__PURE__ */ ee(Qt, { value: P.Both, children: n.t("drawing-anchor.both") }),
|
|
2461
|
+
/* @__PURE__ */ ee(Qt, { value: P.Position, children: n.t("drawing-anchor.position") }),
|
|
2462
|
+
/* @__PURE__ */ ee(Qt, { value: P.None, children: n.t("drawing-anchor.none") })
|
|
2463
2463
|
] }) }) })
|
|
2464
2464
|
] });
|
|
2465
|
-
},
|
|
2466
|
-
const i =
|
|
2467
|
-
return
|
|
2465
|
+
}, Io = () => {
|
|
2466
|
+
const i = De(oe), e = i.getFocusDrawings(), [n, t] = sn(e);
|
|
2467
|
+
return un(() => {
|
|
2468
2468
|
const r = i.focus$.subscribe((s) => {
|
|
2469
2469
|
t(s);
|
|
2470
2470
|
});
|
|
2471
2471
|
return () => {
|
|
2472
2472
|
r.unsubscribe();
|
|
2473
2473
|
};
|
|
2474
|
-
}, []), !!(n != null && n.length) && /* @__PURE__ */
|
|
2475
|
-
/* @__PURE__ */
|
|
2476
|
-
/* @__PURE__ */
|
|
2474
|
+
}, []), !!(n != null && n.length) && /* @__PURE__ */ Ot("div", { className: _e.imageCommonPanel, children: [
|
|
2475
|
+
/* @__PURE__ */ ee(hi, { drawings: n }),
|
|
2476
|
+
/* @__PURE__ */ ee(So, { drawings: n })
|
|
2477
2477
|
] });
|
|
2478
|
-
},
|
|
2479
|
-
[
|
|
2480
|
-
[
|
|
2478
|
+
}, Co = {
|
|
2479
|
+
[Ai.FORMULAS_INSERT]: {
|
|
2480
|
+
[Cr]: {
|
|
2481
2481
|
order: 3,
|
|
2482
|
-
menuItemFactory:
|
|
2483
|
-
[
|
|
2482
|
+
menuItemFactory: to,
|
|
2483
|
+
[Xt.id]: {
|
|
2484
2484
|
order: 0,
|
|
2485
|
-
menuItemFactory:
|
|
2485
|
+
menuItemFactory: no
|
|
2486
2486
|
},
|
|
2487
|
-
[
|
|
2487
|
+
[hn.id]: {
|
|
2488
2488
|
order: 1,
|
|
2489
|
-
menuItemFactory:
|
|
2489
|
+
menuItemFactory: ro
|
|
2490
2490
|
}
|
|
2491
2491
|
}
|
|
2492
2492
|
}
|
|
2493
2493
|
};
|
|
2494
|
-
function
|
|
2495
|
-
return !i.getContextValue(
|
|
2494
|
+
function rt(i) {
|
|
2495
|
+
return !i.getContextValue(Hr) && !i.getContextValue(zr) && !i.getContextValue(Kr) && i.getContextValue($e);
|
|
2496
2496
|
}
|
|
2497
|
-
const
|
|
2498
|
-
id:
|
|
2497
|
+
const bo = {
|
|
2498
|
+
id: nt.id,
|
|
2499
2499
|
description: "shortcut.sheet.drawing-move-down",
|
|
2500
2500
|
group: "4_sheet-drawing-view",
|
|
2501
|
-
binding:
|
|
2501
|
+
binding: xe.ARROW_DOWN,
|
|
2502
2502
|
priority: 100,
|
|
2503
|
-
preconditions:
|
|
2503
|
+
preconditions: rt,
|
|
2504
2504
|
staticParameters: {
|
|
2505
|
-
direction:
|
|
2505
|
+
direction: ve.DOWN
|
|
2506
2506
|
}
|
|
2507
|
-
},
|
|
2508
|
-
id:
|
|
2507
|
+
}, Ro = {
|
|
2508
|
+
id: nt.id,
|
|
2509
2509
|
description: "shortcut.sheet.drawing-move-up",
|
|
2510
2510
|
group: "4_sheet-drawing-view",
|
|
2511
|
-
binding:
|
|
2511
|
+
binding: xe.ARROW_UP,
|
|
2512
2512
|
priority: 100,
|
|
2513
|
-
preconditions:
|
|
2513
|
+
preconditions: rt,
|
|
2514
2514
|
staticParameters: {
|
|
2515
|
-
direction:
|
|
2515
|
+
direction: ve.UP
|
|
2516
2516
|
}
|
|
2517
|
-
},
|
|
2518
|
-
id:
|
|
2517
|
+
}, Do = {
|
|
2518
|
+
id: nt.id,
|
|
2519
2519
|
description: "shortcut.sheet.drawing-move-left",
|
|
2520
2520
|
group: "4_sheet-drawing-view",
|
|
2521
|
-
binding:
|
|
2521
|
+
binding: xe.ARROW_LEFT,
|
|
2522
2522
|
priority: 100,
|
|
2523
|
-
preconditions:
|
|
2523
|
+
preconditions: rt,
|
|
2524
2524
|
staticParameters: {
|
|
2525
|
-
direction:
|
|
2525
|
+
direction: ve.LEFT
|
|
2526
2526
|
}
|
|
2527
|
-
},
|
|
2528
|
-
id:
|
|
2527
|
+
}, Mo = {
|
|
2528
|
+
id: nt.id,
|
|
2529
2529
|
description: "shortcut.sheet.drawing-move-right",
|
|
2530
2530
|
group: "4_sheet-drawing-view",
|
|
2531
|
-
binding:
|
|
2531
|
+
binding: xe.ARROW_RIGHT,
|
|
2532
2532
|
priority: 100,
|
|
2533
|
-
preconditions:
|
|
2533
|
+
preconditions: rt,
|
|
2534
2534
|
staticParameters: {
|
|
2535
|
-
direction:
|
|
2535
|
+
direction: ve.RIGHT
|
|
2536
2536
|
}
|
|
2537
|
-
},
|
|
2538
|
-
id:
|
|
2537
|
+
}, yo = {
|
|
2538
|
+
id: Sr.id,
|
|
2539
2539
|
description: "shortcut.sheet.drawing-delete",
|
|
2540
2540
|
group: "4_sheet-drawing-view",
|
|
2541
2541
|
// when focusing on any other input tag do not trigger this shortcut
|
|
2542
|
-
preconditions:
|
|
2543
|
-
binding:
|
|
2544
|
-
mac:
|
|
2542
|
+
preconditions: rt,
|
|
2543
|
+
binding: xe.DELETE,
|
|
2544
|
+
mac: xe.BACKSPACE
|
|
2545
2545
|
};
|
|
2546
|
-
var
|
|
2547
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2546
|
+
var To = Object.defineProperty, Oo = Object.getOwnPropertyDescriptor, Eo = (i, e, n, t) => {
|
|
2547
|
+
for (var r = t > 1 ? void 0 : t ? Oo(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2548
2548
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2549
|
-
return t && r &&
|
|
2550
|
-
},
|
|
2551
|
-
let
|
|
2549
|
+
return t && r && To(e, n, r), r;
|
|
2550
|
+
}, Be = (i, e) => (n, t) => e(n, t, i);
|
|
2551
|
+
let Wt = class extends le {
|
|
2552
2552
|
constructor(i, e, n, t, r, s) {
|
|
2553
2553
|
super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._shortcutService = t, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
|
|
2554
2554
|
}
|
|
2555
2555
|
_initCustomComponents() {
|
|
2556
2556
|
const i = this._componentManager;
|
|
2557
|
-
this.disposeWithMe(i.register(
|
|
2557
|
+
this.disposeWithMe(i.register(Ir, vr)), this.disposeWithMe(i.register(dr, Io));
|
|
2558
2558
|
}
|
|
2559
2559
|
_initMenus() {
|
|
2560
|
-
this._menuManagerService.mergeMenu(
|
|
2560
|
+
this._menuManagerService.mergeMenu(Co);
|
|
2561
2561
|
}
|
|
2562
2562
|
_initCommands() {
|
|
2563
2563
|
[
|
|
2564
|
+
Xt,
|
|
2565
|
+
hn,
|
|
2566
|
+
kt,
|
|
2567
|
+
tt,
|
|
2564
2568
|
Gt,
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
et,
|
|
2568
|
-
Yt,
|
|
2569
|
-
ar,
|
|
2570
|
-
x,
|
|
2571
|
-
cr,
|
|
2572
|
-
dr,
|
|
2569
|
+
lr,
|
|
2570
|
+
L,
|
|
2573
2571
|
ur,
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2572
|
+
hr,
|
|
2573
|
+
fr,
|
|
2574
|
+
nt,
|
|
2575
|
+
Sr,
|
|
2576
|
+
gr
|
|
2577
2577
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
2578
2578
|
}
|
|
2579
2579
|
_initShortcuts() {
|
|
2580
2580
|
[
|
|
2581
2581
|
// sheet drawing shortcuts
|
|
2582
|
-
So,
|
|
2583
|
-
Io,
|
|
2584
|
-
Co,
|
|
2585
2582
|
bo,
|
|
2586
|
-
Ro
|
|
2583
|
+
Ro,
|
|
2584
|
+
Do,
|
|
2585
|
+
Mo,
|
|
2586
|
+
yo
|
|
2587
2587
|
].forEach((i) => {
|
|
2588
2588
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2589
2589
|
});
|
|
@@ -2592,63 +2592,67 @@ let Bt = class extends oe {
|
|
|
2592
2592
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
2593
2593
|
}
|
|
2594
2594
|
};
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
],
|
|
2603
|
-
var
|
|
2604
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2595
|
+
Wt = Eo([
|
|
2596
|
+
Be(0, N(Ni)),
|
|
2597
|
+
Be(1, ji),
|
|
2598
|
+
Be(2, k),
|
|
2599
|
+
Be(3, Bi),
|
|
2600
|
+
Be(4, oe),
|
|
2601
|
+
Be(5, N(ln))
|
|
2602
|
+
], Wt);
|
|
2603
|
+
var Po = Object.defineProperty, Uo = Object.getOwnPropertyDescriptor, Ao = (i, e, n, t) => {
|
|
2604
|
+
for (var r = t > 1 ? void 0 : t ? Uo(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2605
2605
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2606
|
-
return t && r &&
|
|
2607
|
-
},
|
|
2608
|
-
function
|
|
2609
|
-
const { scaleX: s, scaleY: o } = e.getAncestorScale(), c = e.getViewport(
|
|
2606
|
+
return t && r && Po(e, n, r), r;
|
|
2607
|
+
}, Re = (i, e) => (n, t) => e(n, t, i);
|
|
2608
|
+
function No(i, e, n, t, r) {
|
|
2609
|
+
const { scaleX: s, scaleY: o } = e.getAncestorScale(), c = e.getViewport($n.VIEW_MAIN), a = t.getFreeze(), { startColumn: g, startRow: d, xSplit: l, ySplit: h } = a, u = {
|
|
2610
2610
|
left: !0,
|
|
2611
|
+
// left means the left of pic is in a viewMainLeft
|
|
2611
2612
|
top: !0
|
|
2612
2613
|
};
|
|
2613
2614
|
if (!c)
|
|
2614
2615
|
return {
|
|
2615
2616
|
...i,
|
|
2616
|
-
absolute:
|
|
2617
|
+
absolute: u
|
|
2617
2618
|
};
|
|
2618
|
-
const { left:
|
|
2619
|
-
let { top:
|
|
2620
|
-
const { boundsOfViewArea:
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
(
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
),
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2619
|
+
const { left: m, right: p, top: f, bottom: w } = i;
|
|
2620
|
+
let { top: S, left: C, viewportScrollX: D, viewportScrollY: v } = c;
|
|
2621
|
+
const { boundsOfViewArea: b, scrollDirectionResponse: _ } = r || {}, { rowHeaderWidth: O, columnHeaderHeight: M } = n, y = {
|
|
2622
|
+
top: M,
|
|
2623
|
+
left: O
|
|
2624
|
+
};
|
|
2625
|
+
b && (Me.isDefine(y.top) && (y.top = b.top), Me.isDefine(y.left) && (y.left = b.left)), _ === "HORIZONTAL" && (v = 0), _ === "VERTICAL" && (D = 0);
|
|
2626
|
+
let T = 0, I = 0;
|
|
2627
|
+
const R = n.rowStartY(d - h) + M, E = n.colStartX(g - l) + O, B = n.rowStartY(d) + M, K = n.colStartX(g) + O;
|
|
2628
|
+
if (l === 0)
|
|
2629
|
+
u.left = !1, T = (m - D) * s, I = (p - D) * s;
|
|
2630
|
+
else {
|
|
2631
|
+
const G = m - (E - O), J = p - (E - O);
|
|
2632
|
+
p < K ? (T = G * s, I = J * s) : m <= K && p >= K ? (T = G * s, I = Math.max(C, (p - D) * s)) : m > K && (u.left = !1, T = Math.max((m - D) * s, C), I = Math.max((p - D) * s, C));
|
|
2633
|
+
}
|
|
2634
|
+
let Z = 0, Y = 0;
|
|
2635
|
+
if (h === 0)
|
|
2636
|
+
u.top = !1, Z = (f - v) * o, Y = (w - v) * o;
|
|
2637
|
+
else {
|
|
2638
|
+
const G = f - (R - M), J = w - (R - M);
|
|
2639
|
+
w < B ? (Z = G * o, Y = J * o) : f <= B && w >= B ? (Z = G * o, Y = Math.max(S, (w - v) * o)) : f > B && (u.top = !1, Z = Math.max((f - v) * o, S), Y = Math.max((w - v) * o, S));
|
|
2640
|
+
}
|
|
2641
|
+
return T = Math.max(T, y.left), Z = Math.max(Z, y.top), I = Math.max(I, y.left), Y = Math.max(Y, y.top), {
|
|
2642
|
+
left: T,
|
|
2643
|
+
right: I,
|
|
2644
|
+
top: Z,
|
|
2645
|
+
bottom: Y,
|
|
2646
|
+
absolute: u
|
|
2643
2647
|
};
|
|
2644
2648
|
}
|
|
2645
|
-
const
|
|
2649
|
+
const fe = (i, e, n, t, r) => {
|
|
2646
2650
|
const { scene: s } = e, { left: o, top: c, width: a, height: g, angle: d } = i, l = {
|
|
2647
2651
|
left: o,
|
|
2648
2652
|
right: o + a,
|
|
2649
2653
|
top: c,
|
|
2650
2654
|
bottom: c + g
|
|
2651
|
-
}, h =
|
|
2655
|
+
}, h = No(l, s, n, t, r), { scaleX: u, scaleY: m } = s.getAncestorScale();
|
|
2652
2656
|
return {
|
|
2653
2657
|
startX: h.left,
|
|
2654
2658
|
endX: h.right,
|
|
@@ -2660,28 +2664,28 @@ const ge = (i, e, n, t, r) => {
|
|
|
2660
2664
|
absolute: h.absolute
|
|
2661
2665
|
};
|
|
2662
2666
|
};
|
|
2663
|
-
let
|
|
2667
|
+
let $t = class extends le {
|
|
2664
2668
|
constructor(e, n, t, r, s, o, c) {
|
|
2665
2669
|
super();
|
|
2666
2670
|
/**
|
|
2667
2671
|
* for update dom container position when scrolling and zoom
|
|
2668
2672
|
*/
|
|
2669
|
-
|
|
2673
|
+
Q(this, "_domLayerMap", /* @__PURE__ */ new Map());
|
|
2670
2674
|
/**
|
|
2671
2675
|
* for update dom container position when scrolling and zoom
|
|
2672
2676
|
*/
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2677
|
+
Q(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
2678
|
+
Q(this, "_transformChange$", new Jt());
|
|
2679
|
+
Q(this, "transformChange$", this._transformChange$.asObservable());
|
|
2680
|
+
Q(this, "_add$", new Jt());
|
|
2681
|
+
Q(this, "add$", this._add$.asObservable());
|
|
2682
|
+
Q(this, "_remove$", new Jt());
|
|
2683
|
+
Q(this, "remove$", this._remove$.asObservable());
|
|
2684
|
+
Q(this, "_hooks", []);
|
|
2681
2685
|
this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = c, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
2682
2686
|
}
|
|
2683
2687
|
_bindScrollEvent() {
|
|
2684
|
-
this._lifecycleService.lifecycle$.pipe(
|
|
2688
|
+
this._lifecycleService.lifecycle$.pipe(Je((e) => e === Jr.Rendered), $i(1)).subscribe(() => {
|
|
2685
2689
|
this._scrollUpdateListener();
|
|
2686
2690
|
});
|
|
2687
2691
|
}
|
|
@@ -2718,18 +2722,18 @@ let Wt = class extends oe {
|
|
|
2718
2722
|
this.disposeWithMe(
|
|
2719
2723
|
this._drawingManagerService.add$.subscribe((e) => {
|
|
2720
2724
|
e.forEach((n) => {
|
|
2721
|
-
var
|
|
2722
|
-
const { unitId: t, subUnitId: r, drawingId: s } = n, o =
|
|
2725
|
+
var J, ce, q;
|
|
2726
|
+
const { unitId: t, subUnitId: r, drawingId: s } = n, o = V(this._univerInstanceService, { unitId: t, subUnitId: r }), c = this._drawingManagerService.getDrawingByParam(n), a = this._univerInstanceService.getUnit(t, H.UNIVER_SHEET);
|
|
2723
2727
|
if (!a)
|
|
2724
2728
|
return;
|
|
2725
2729
|
const g = a.getActiveSheet().getSheetId();
|
|
2726
2730
|
if (!c || !o)
|
|
2727
2731
|
return;
|
|
2728
|
-
const d = (
|
|
2732
|
+
const d = (J = this._renderManagerService.getRenderById(t)) == null ? void 0 : J.with(X).getSkeletonParam(r);
|
|
2729
2733
|
if (!d)
|
|
2730
2734
|
return;
|
|
2731
2735
|
const { transform: l, drawingType: h, data: u } = c;
|
|
2732
|
-
if (h !==
|
|
2736
|
+
if (h !== F.DRAWING_DOM && h !== F.DRAWING_CHART)
|
|
2733
2737
|
return;
|
|
2734
2738
|
const m = this._getSceneAndTransformerByDrawingSearch(t);
|
|
2735
2739
|
if (m == null)
|
|
@@ -2739,33 +2743,33 @@ let Wt = class extends oe {
|
|
|
2739
2743
|
return !0;
|
|
2740
2744
|
if (g !== r)
|
|
2741
2745
|
return;
|
|
2742
|
-
const { left: w, top: S, width:
|
|
2743
|
-
if (
|
|
2744
|
-
|
|
2746
|
+
const { left: w, top: S, width: C, height: D, angle: v, flipX: b, flipY: _, skewX: O, skewY: M } = l, y = Se({ unitId: t, subUnitId: r, drawingId: s }), T = p.getObject(y);
|
|
2747
|
+
if (T != null) {
|
|
2748
|
+
T.transformByState({ left: w, top: S, width: C, height: D, angle: v, flipX: b, flipY: _, skewX: O, skewY: M });
|
|
2745
2749
|
return;
|
|
2746
2750
|
}
|
|
2747
|
-
const
|
|
2751
|
+
const I = {
|
|
2748
2752
|
left: w,
|
|
2749
2753
|
top: S,
|
|
2750
|
-
width:
|
|
2754
|
+
width: C,
|
|
2751
2755
|
height: D,
|
|
2752
2756
|
zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
|
|
2753
|
-
}, R = h ===
|
|
2757
|
+
}, R = h === F.DRAWING_CHART;
|
|
2754
2758
|
if (R) {
|
|
2755
2759
|
const W = u ? u.backgroundColor : "white";
|
|
2756
|
-
|
|
2760
|
+
I.fill = W, I.rotateEnabled = !1, u && u.border && (I.stroke = u.border), I.paintFirst = "stroke", I.strokeWidth = 1, I.borderEnabled = !1, I.radius = 8;
|
|
2757
2761
|
}
|
|
2758
|
-
const
|
|
2759
|
-
R &&
|
|
2760
|
-
const
|
|
2761
|
-
dispose:
|
|
2762
|
-
rect:
|
|
2763
|
-
position$:
|
|
2762
|
+
const E = new je(y, I);
|
|
2763
|
+
R && E.setObjectType(Rn.CHART), p.addObject(E, Zt), c.allowTransform !== !1 && p.attachTransformerTo(E);
|
|
2764
|
+
const B = this._ensureMap(t, r), K = new wt(), Z = fe(E, m.renderUnit, d.skeleton, o.worksheet), Y = new He(Z), me = {
|
|
2765
|
+
dispose: K,
|
|
2766
|
+
rect: E,
|
|
2767
|
+
position$: Y,
|
|
2764
2768
|
unitId: t,
|
|
2765
2769
|
subUnitId: r
|
|
2766
2770
|
};
|
|
2767
2771
|
this._canvasFloatDomService.addFloatDom({
|
|
2768
|
-
position$:
|
|
2772
|
+
position$: Y,
|
|
2769
2773
|
id: s,
|
|
2770
2774
|
componentKey: c.componentKey,
|
|
2771
2775
|
onPointerDown: (W) => {
|
|
@@ -2780,27 +2784,27 @@ let Wt = class extends oe {
|
|
|
2780
2784
|
onWheel: (W) => {
|
|
2781
2785
|
f.dispatchEvent(new WheelEvent(W.type, W));
|
|
2782
2786
|
},
|
|
2783
|
-
props: (
|
|
2787
|
+
props: (q = (ce = B.get(s)) == null ? void 0 : ce.props) != null ? q : this._getFloatDomProps(s),
|
|
2784
2788
|
data: u,
|
|
2785
2789
|
unitId: t
|
|
2786
2790
|
});
|
|
2787
|
-
const
|
|
2788
|
-
const W =
|
|
2789
|
-
|
|
2791
|
+
const G = E.onTransformChange$.subscribeEvent(() => {
|
|
2792
|
+
const W = fe(E, m.renderUnit, d.skeleton, o.worksheet);
|
|
2793
|
+
Y.next(
|
|
2790
2794
|
W
|
|
2791
2795
|
);
|
|
2792
2796
|
});
|
|
2793
|
-
|
|
2797
|
+
K.add(() => {
|
|
2794
2798
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
2795
|
-
}),
|
|
2796
|
-
...
|
|
2799
|
+
}), G && K.add(G), this._domLayerInfoMap.set(s, me), B.set(s, {
|
|
2800
|
+
...B.get(s)
|
|
2797
2801
|
});
|
|
2798
2802
|
});
|
|
2799
2803
|
})
|
|
2800
2804
|
), this.disposeWithMe(
|
|
2801
2805
|
this._drawingManagerService.remove$.subscribe((e) => {
|
|
2802
2806
|
e.forEach((n) => {
|
|
2803
|
-
const { unitId: t, subUnitId: r, drawingId: s } = n, o =
|
|
2807
|
+
const { unitId: t, subUnitId: r, drawingId: s } = n, o = Se({ unitId: t, subUnitId: r, drawingId: s }), c = this._getSceneAndTransformerByDrawingSearch(t);
|
|
2804
2808
|
if (c == null)
|
|
2805
2809
|
return;
|
|
2806
2810
|
const { transformer: a, scene: g } = c, d = g.getObject(o);
|
|
@@ -2812,39 +2816,39 @@ let Wt = class extends oe {
|
|
|
2812
2816
|
_scrollUpdateListener() {
|
|
2813
2817
|
const e = (n, t) => {
|
|
2814
2818
|
var g;
|
|
2815
|
-
const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), c =
|
|
2819
|
+
const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), c = V(this._univerInstanceService, { unitId: n, subUnitId: t }), a = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(X).getSkeletonParam(t);
|
|
2816
2820
|
!r || !c || !a || o.forEach((d) => {
|
|
2817
2821
|
const l = this._domLayerInfoMap.get(d);
|
|
2818
2822
|
if (l) {
|
|
2819
|
-
const h =
|
|
2823
|
+
const h = fe(l.rect, r.renderUnit, a.skeleton, c.worksheet, l);
|
|
2820
2824
|
l.position$.next(h);
|
|
2821
2825
|
}
|
|
2822
2826
|
});
|
|
2823
2827
|
};
|
|
2824
2828
|
this.disposeWithMe(
|
|
2825
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
return t ? { render: t, unitId: n.getUnitId(), subUnitId: n.getSheetId() } : null;
|
|
2829
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(H.UNIVER_SHEET).pipe(
|
|
2830
|
+
Tn((n) => n ? n.activeSheet$ : On(null)),
|
|
2831
|
+
qe((n) => {
|
|
2832
|
+
if (!n) return null;
|
|
2833
|
+
const t = n.getUnitId(), r = this._renderManagerService.getRenderById(t);
|
|
2834
|
+
return r ? { render: r, unitId: t, subUnitId: n.getSheetId() } : null;
|
|
2832
2835
|
}),
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
(n) => Kr(n.render.scene.getViewport(jn.VIEW_MAIN).onScrollAfter$).pipe(Je(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
|
|
2836
|
+
Tn(
|
|
2837
|
+
(n) => n ? qr(n.render.scene.getViewport($n.VIEW_MAIN).onScrollAfter$).pipe(qe(() => ({ unitId: n.unitId, subUnitId: n.subUnitId }))) : On(null)
|
|
2836
2838
|
)
|
|
2837
|
-
).subscribe((
|
|
2838
|
-
|
|
2839
|
+
).subscribe((n) => {
|
|
2840
|
+
if (!n) return;
|
|
2841
|
+
const { unitId: t, subUnitId: r } = n;
|
|
2842
|
+
e(t, r);
|
|
2839
2843
|
})
|
|
2840
2844
|
), this.disposeWithMe(this._commandService.onCommandExecuted((n) => {
|
|
2841
2845
|
var t, r;
|
|
2842
|
-
if (n.id ===
|
|
2846
|
+
if (n.id === Mn.id) {
|
|
2843
2847
|
const s = n.params, { unitId: o } = s;
|
|
2844
2848
|
Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((a) => {
|
|
2845
2849
|
e(o, a);
|
|
2846
2850
|
});
|
|
2847
|
-
} else if (n.id ===
|
|
2851
|
+
} else if (n.id === qi.id) {
|
|
2848
2852
|
const { unitId: s, subUnitId: o } = n.params;
|
|
2849
2853
|
e(s, o);
|
|
2850
2854
|
}
|
|
@@ -2852,7 +2856,7 @@ let Wt = class extends oe {
|
|
|
2852
2856
|
}
|
|
2853
2857
|
_getPosition(e, n) {
|
|
2854
2858
|
var h;
|
|
2855
|
-
const { startX: t, endX: r, startY: s, endY: o } = e, c = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(
|
|
2859
|
+
const { startX: t, endX: r, startY: s, endY: o } = e, c = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(Ye);
|
|
2856
2860
|
if (c == null)
|
|
2857
2861
|
return;
|
|
2858
2862
|
const a = c.getCellWithCoordByOffset(t, s);
|
|
@@ -2882,7 +2886,7 @@ let Wt = class extends oe {
|
|
|
2882
2886
|
this._drawingManagerService.update$.subscribe((e) => {
|
|
2883
2887
|
e.forEach((n) => {
|
|
2884
2888
|
const t = this._drawingManagerService.getDrawingByParam(n);
|
|
2885
|
-
if (!t || t.drawingType !==
|
|
2889
|
+
if (!t || t.drawingType !== F.DRAWING_DOM && t.drawingType !== F.DRAWING_CHART)
|
|
2886
2890
|
return;
|
|
2887
2891
|
const r = {
|
|
2888
2892
|
...t.transform
|
|
@@ -2904,19 +2908,19 @@ let Wt = class extends oe {
|
|
|
2904
2908
|
updateFloatDomProps(e, n, t, r) {
|
|
2905
2909
|
const s = this._domLayerInfoMap.get(t), o = this._getSceneAndTransformerByDrawingSearch(e);
|
|
2906
2910
|
if (s && o) {
|
|
2907
|
-
const { scene: c } = o, a =
|
|
2908
|
-
g && g instanceof
|
|
2911
|
+
const { scene: c } = o, a = Se({ unitId: e, subUnitId: n, drawingId: t }), g = c.getObject(a);
|
|
2912
|
+
g && g instanceof je && g.setProps(r);
|
|
2909
2913
|
}
|
|
2910
2914
|
}
|
|
2911
2915
|
// CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
|
|
2912
2916
|
addFloatDomToPosition(e, n) {
|
|
2913
|
-
const t =
|
|
2917
|
+
const t = V(this._univerInstanceService, {
|
|
2914
2918
|
unitId: e.unitId,
|
|
2915
2919
|
subUnitId: e.subUnitId
|
|
2916
2920
|
});
|
|
2917
2921
|
if (!t)
|
|
2918
2922
|
throw new Error("cannot find current target!");
|
|
2919
|
-
const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: c, data: a, allowTransform: g = !0 } = e, d = n != null ? n :
|
|
2923
|
+
const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: c, data: a, allowTransform: g = !0 } = e, d = n != null ? n : zt(), l = this._getPosition(o, r);
|
|
2920
2924
|
if (l == null)
|
|
2921
2925
|
return;
|
|
2922
2926
|
this._ensureMap(r, s).set(d, e);
|
|
@@ -2924,7 +2928,7 @@ let Wt = class extends oe {
|
|
|
2924
2928
|
unitId: r,
|
|
2925
2929
|
subUnitId: s,
|
|
2926
2930
|
drawingId: d,
|
|
2927
|
-
drawingType: e.type ||
|
|
2931
|
+
drawingType: e.type || F.DRAWING_DOM,
|
|
2928
2932
|
componentKey: c,
|
|
2929
2933
|
sheetTransform: l,
|
|
2930
2934
|
transform: {
|
|
@@ -2936,7 +2940,7 @@ let Wt = class extends oe {
|
|
|
2936
2940
|
data: a,
|
|
2937
2941
|
allowTransform: g
|
|
2938
2942
|
};
|
|
2939
|
-
return this._commandService.executeCommand(
|
|
2943
|
+
return this._commandService.executeCommand(kt.id, {
|
|
2940
2944
|
unitId: r,
|
|
2941
2945
|
drawings: [u]
|
|
2942
2946
|
}), this._add$.next({ unitId: r, subUnitId: s, id: d }), {
|
|
@@ -2959,7 +2963,7 @@ let Wt = class extends oe {
|
|
|
2959
2963
|
if (!a)
|
|
2960
2964
|
return;
|
|
2961
2965
|
const g = this._sheetDrawingService.getBatchRemoveOp([a]), { redo: d, objects: l } = g;
|
|
2962
|
-
this._commandService.syncExecuteCommand(
|
|
2966
|
+
this._commandService.syncExecuteCommand(U.id, { unitId: r, subUnitId: s, op: d, objects: l, type: A.REMOVE });
|
|
2963
2967
|
}
|
|
2964
2968
|
}
|
|
2965
2969
|
addHook(e) {
|
|
@@ -2970,9 +2974,10 @@ let Wt = class extends oe {
|
|
|
2970
2974
|
}
|
|
2971
2975
|
};
|
|
2972
2976
|
}
|
|
2977
|
+
// eslint-disable-next-line max-lines-per-function, complexity
|
|
2973
2978
|
addFloatDomToRange(e, n, t, r) {
|
|
2974
|
-
var _,
|
|
2975
|
-
const s =
|
|
2979
|
+
var _, O, M, y, T;
|
|
2980
|
+
const s = V(this._univerInstanceService, {
|
|
2976
2981
|
unitId: n.unitId,
|
|
2977
2982
|
subUnitId: n.subUnitId
|
|
2978
2983
|
});
|
|
@@ -2982,17 +2987,17 @@ let Wt = class extends oe {
|
|
|
2982
2987
|
if (!a) return;
|
|
2983
2988
|
const g = this._renderManagerService.getRenderById(o);
|
|
2984
2989
|
if (!g) return;
|
|
2985
|
-
const d = (_ = this._renderManagerService.getRenderById(o)) == null ? void 0 : _.with(
|
|
2990
|
+
const d = (_ = this._renderManagerService.getRenderById(o)) == null ? void 0 : _.with(X).getWorksheetSkeleton(c);
|
|
2986
2991
|
if (!d) return;
|
|
2987
|
-
const { componentKey: l, data: h, allowTransform: u = !0 } = n, m = r != null ? r :
|
|
2992
|
+
const { componentKey: l, data: h, allowTransform: u = !0 } = n, m = r != null ? r : zt(), { position: p, position$: f } = this._createRangePositionObserver(e, g, d.skeleton), w = this._getPosition(p, o);
|
|
2988
2993
|
if (w == null)
|
|
2989
2994
|
return;
|
|
2990
2995
|
this._ensureMap(o, c).set(m, n);
|
|
2991
|
-
const
|
|
2996
|
+
const C = a.scene, { scaleX: D } = C.getAncestorScale(), v = Mt(p, t, D), b = {
|
|
2992
2997
|
unitId: o,
|
|
2993
2998
|
subUnitId: c,
|
|
2994
2999
|
drawingId: m,
|
|
2995
|
-
drawingType: n.type ||
|
|
3000
|
+
drawingType: n.type || F.DRAWING_DOM,
|
|
2996
3001
|
componentKey: l,
|
|
2997
3002
|
sheetTransform: w,
|
|
2998
3003
|
transform: {
|
|
@@ -3005,64 +3010,64 @@ let Wt = class extends oe {
|
|
|
3005
3010
|
allowTransform: u
|
|
3006
3011
|
};
|
|
3007
3012
|
{
|
|
3008
|
-
const { unitId:
|
|
3009
|
-
if (!
|
|
3013
|
+
const { unitId: I, subUnitId: R, drawingId: E } = b, B = V(this._univerInstanceService, { unitId: I, subUnitId: R }), K = b, Z = this._univerInstanceService.getUnit(I, H.UNIVER_SHEET);
|
|
3014
|
+
if (!Z)
|
|
3010
3015
|
return;
|
|
3011
|
-
const
|
|
3012
|
-
if (!
|
|
3016
|
+
const Y = Z.getActiveSheet().getSheetId();
|
|
3017
|
+
if (!K || !B)
|
|
3013
3018
|
return;
|
|
3014
|
-
const
|
|
3015
|
-
if (!
|
|
3019
|
+
const me = (O = this._renderManagerService.getRenderById(I)) == null ? void 0 : O.with(X);
|
|
3020
|
+
if (!me)
|
|
3016
3021
|
return;
|
|
3017
|
-
const
|
|
3018
|
-
if (!
|
|
3022
|
+
const G = me.getWorksheetSkeleton(R);
|
|
3023
|
+
if (!G)
|
|
3019
3024
|
return;
|
|
3020
|
-
const { transform:
|
|
3021
|
-
if (
|
|
3025
|
+
const { transform: J, drawingType: ce, data: q } = K;
|
|
3026
|
+
if (ce !== F.DRAWING_DOM && ce !== F.DRAWING_CHART)
|
|
3022
3027
|
return;
|
|
3023
|
-
const W = this._getSceneAndTransformerByDrawingSearch(
|
|
3028
|
+
const W = this._getSceneAndTransformerByDrawingSearch(I);
|
|
3024
3029
|
if (W == null)
|
|
3025
3030
|
return;
|
|
3026
|
-
const { scene:
|
|
3027
|
-
if (
|
|
3031
|
+
const { scene: ye, canvas: Te } = W;
|
|
3032
|
+
if (J == null || Y !== R)
|
|
3028
3033
|
return;
|
|
3029
|
-
const { left:
|
|
3030
|
-
if (
|
|
3031
|
-
|
|
3034
|
+
const { left: it, top: st, width: ot, height: at, angle: Vt, flipX: Ht, flipY: ct, skewX: dt, skewY: Oe } = J, lt = Se({ unitId: I, subUnitId: R, drawingId: E }), ue = ye.getObject(lt);
|
|
3035
|
+
if (ue != null) {
|
|
3036
|
+
ue.transformByState({ left: it, top: st, width: ot, height: at, angle: Vt, flipX: Ht, flipY: ct, skewX: dt, skewY: Oe });
|
|
3032
3037
|
return;
|
|
3033
3038
|
}
|
|
3034
|
-
const
|
|
3035
|
-
left:
|
|
3039
|
+
const re = {
|
|
3040
|
+
left: it,
|
|
3036
3041
|
// from floatDomParam.transform
|
|
3037
|
-
top:
|
|
3038
|
-
width:
|
|
3039
|
-
height:
|
|
3040
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
3041
|
-
},
|
|
3042
|
-
if (
|
|
3043
|
-
const j =
|
|
3044
|
-
|
|
3042
|
+
top: st,
|
|
3043
|
+
width: ot,
|
|
3044
|
+
height: at,
|
|
3045
|
+
zIndex: this._drawingManagerService.getDrawingOrder(I, R).length - 1
|
|
3046
|
+
}, Ee = ce === F.DRAWING_CHART;
|
|
3047
|
+
if (Ee) {
|
|
3048
|
+
const j = q ? q.backgroundColor : "white";
|
|
3049
|
+
re.fill = j, re.rotateEnabled = !1, q && q.border && (re.stroke = q.border), re.paintFirst = "stroke", re.strokeWidth = 1, re.borderEnabled = !1, re.radius = 8;
|
|
3045
3050
|
}
|
|
3046
|
-
const
|
|
3047
|
-
|
|
3048
|
-
const
|
|
3049
|
-
top:
|
|
3050
|
-
left:
|
|
3051
|
-
bottom:
|
|
3052
|
-
right:
|
|
3053
|
-
},
|
|
3054
|
-
dispose:
|
|
3055
|
-
rect:
|
|
3056
|
-
boundsOfViewArea:
|
|
3051
|
+
const de = new je(lt, re);
|
|
3052
|
+
Ee && de.setObjectType(Rn.CHART), ye.addObject(de, Zt), K.allowTransform !== !1 && ye.attachTransformerTo(de);
|
|
3053
|
+
const ke = this._ensureMap(I, R), he = new wt(), ut = ye.getMainViewport(), { rowHeaderWidth: Pe, columnHeaderHeight: Ge } = G.skeleton, ht = {
|
|
3054
|
+
top: Ge,
|
|
3055
|
+
left: Pe,
|
|
3056
|
+
bottom: ut.bottom,
|
|
3057
|
+
right: ut.right
|
|
3058
|
+
}, ge = {
|
|
3059
|
+
dispose: he,
|
|
3060
|
+
rect: de,
|
|
3061
|
+
boundsOfViewArea: ht,
|
|
3057
3062
|
domAnchor: t,
|
|
3058
|
-
unitId:
|
|
3063
|
+
unitId: I,
|
|
3059
3064
|
subUnitId: R
|
|
3060
|
-
},
|
|
3061
|
-
|
|
3062
|
-
let
|
|
3063
|
-
position$:
|
|
3064
|
-
id:
|
|
3065
|
-
componentKey:
|
|
3065
|
+
}, $ = fe(de, W.renderUnit, G.skeleton, B.worksheet, ge), Ue = new He($);
|
|
3066
|
+
ge.position$ = Ue;
|
|
3067
|
+
let Xe = {
|
|
3068
|
+
position$: Ue,
|
|
3069
|
+
id: E,
|
|
3070
|
+
componentKey: K.componentKey,
|
|
3066
3071
|
onPointerDown: () => {
|
|
3067
3072
|
},
|
|
3068
3073
|
onPointerMove: () => {
|
|
@@ -3070,60 +3075,60 @@ let Wt = class extends oe {
|
|
|
3070
3075
|
onPointerUp: () => {
|
|
3071
3076
|
},
|
|
3072
3077
|
onWheel: (j) => {
|
|
3073
|
-
|
|
3078
|
+
Te.dispatchEvent(new WheelEvent(j.type, j));
|
|
3074
3079
|
},
|
|
3075
|
-
props: (y = (M =
|
|
3076
|
-
data:
|
|
3077
|
-
unitId:
|
|
3080
|
+
props: (y = (M = ke.get(E)) == null ? void 0 : M.props) != null ? y : this._getFloatDomProps(E),
|
|
3081
|
+
data: q,
|
|
3082
|
+
unitId: I
|
|
3078
3083
|
};
|
|
3079
|
-
n.eventPassThrough && (
|
|
3080
|
-
...
|
|
3084
|
+
n.eventPassThrough && (Xe = {
|
|
3085
|
+
...Xe,
|
|
3081
3086
|
onPointerDown: (j) => {
|
|
3082
|
-
|
|
3087
|
+
Te.dispatchEvent(new PointerEvent(j.type, j));
|
|
3083
3088
|
},
|
|
3084
3089
|
onPointerMove: (j) => {
|
|
3085
|
-
|
|
3090
|
+
Te.dispatchEvent(new PointerEvent(j.type, j));
|
|
3086
3091
|
},
|
|
3087
3092
|
onPointerUp: (j) => {
|
|
3088
|
-
|
|
3093
|
+
Te.dispatchEvent(new PointerEvent(j.type, j));
|
|
3089
3094
|
}
|
|
3090
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
3091
|
-
var
|
|
3092
|
-
const
|
|
3095
|
+
}), this._canvasFloatDomService.addFloatDom(Xe), this.disposeWithMe(f.subscribe((j) => {
|
|
3096
|
+
var fn, mn, pn, wn;
|
|
3097
|
+
const gn = Mt({
|
|
3093
3098
|
rotate: 0,
|
|
3094
3099
|
startX: j.startX,
|
|
3095
3100
|
startY: j.startY,
|
|
3096
3101
|
endX: j.endX,
|
|
3097
3102
|
endY: j.endY,
|
|
3098
|
-
width: (
|
|
3099
|
-
height: (
|
|
3103
|
+
width: (fn = t.width) != null ? fn : j.width,
|
|
3104
|
+
height: (mn = t.height) != null ? mn : j.height,
|
|
3100
3105
|
absolute: {
|
|
3101
3106
|
left: p.absolute.left,
|
|
3102
3107
|
top: p.absolute.top
|
|
3103
3108
|
}
|
|
3104
|
-
}, t),
|
|
3105
|
-
left:
|
|
3106
|
-
top:
|
|
3107
|
-
width: (
|
|
3108
|
-
height: (
|
|
3109
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
3110
|
-
}),
|
|
3111
|
-
|
|
3109
|
+
}, t), Mr = Se({ unitId: I, subUnitId: R, drawingId: E }), yr = new je(Mr, {
|
|
3110
|
+
left: gn.startX,
|
|
3111
|
+
top: gn.startY,
|
|
3112
|
+
width: (pn = t.width) != null ? pn : j.width,
|
|
3113
|
+
height: (wn = t.height) != null ? wn : j.height,
|
|
3114
|
+
zIndex: this._drawingManagerService.getDrawingOrder(I, R).length - 1
|
|
3115
|
+
}), Tr = fe(yr, W.renderUnit, G.skeleton, B.worksheet, ge);
|
|
3116
|
+
Ue.next(Tr);
|
|
3112
3117
|
}));
|
|
3113
|
-
const Ve = (
|
|
3118
|
+
const Ve = (T = this._renderManagerService.getRenderById(I)) == null ? void 0 : T.with(X);
|
|
3114
3119
|
Ve == null || Ve.currentSkeleton$.subscribe((j) => {
|
|
3115
|
-
j &&
|
|
3120
|
+
j && G.sheetId !== j.sheetId && this._removeDom(m, !0);
|
|
3116
3121
|
});
|
|
3117
|
-
const
|
|
3118
|
-
const j =
|
|
3119
|
-
|
|
3122
|
+
const gt = de.onTransformChange$.subscribeEvent(() => {
|
|
3123
|
+
const j = fe(de, W.renderUnit, G.skeleton, B.worksheet, ge);
|
|
3124
|
+
Ue.next(
|
|
3120
3125
|
j
|
|
3121
3126
|
);
|
|
3122
3127
|
});
|
|
3123
|
-
|
|
3124
|
-
this._canvasFloatDomService.removeFloatDom(
|
|
3125
|
-
}),
|
|
3126
|
-
...
|
|
3128
|
+
he.add(() => {
|
|
3129
|
+
this._canvasFloatDomService.removeFloatDom(E);
|
|
3130
|
+
}), gt && he.add(gt), this._domLayerInfoMap.set(E, ge), ke.set(E, {
|
|
3131
|
+
...ke.get(E)
|
|
3127
3132
|
});
|
|
3128
3133
|
}
|
|
3129
3134
|
return {
|
|
@@ -3134,8 +3139,8 @@ let Wt = class extends oe {
|
|
|
3134
3139
|
};
|
|
3135
3140
|
}
|
|
3136
3141
|
addFloatDomToColumnHeader(e, n, t, r) {
|
|
3137
|
-
var v,
|
|
3138
|
-
const s =
|
|
3142
|
+
var v, b, _, O, M;
|
|
3143
|
+
const s = V(this._univerInstanceService, {
|
|
3139
3144
|
unitId: n.unitId,
|
|
3140
3145
|
subUnitId: n.subUnitId
|
|
3141
3146
|
});
|
|
@@ -3145,9 +3150,9 @@ let Wt = class extends oe {
|
|
|
3145
3150
|
if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
|
|
3146
3151
|
const g = this._renderManagerService.getRenderById(o);
|
|
3147
3152
|
if (!g) return;
|
|
3148
|
-
const d = (v = this._renderManagerService.getRenderById(o)) == null ? void 0 : v.with(
|
|
3153
|
+
const d = (v = this._renderManagerService.getRenderById(o)) == null ? void 0 : v.with(X).getWorksheetSkeleton(c);
|
|
3149
3154
|
if (!d) return;
|
|
3150
|
-
const { componentKey: l, data: h, allowTransform: u = !0 } = n, m = r != null ? r :
|
|
3155
|
+
const { componentKey: l, data: h, allowTransform: u = !0 } = n, m = r != null ? r : zt(), { position: p, position$: f } = this._createRangePositionObserver({
|
|
3151
3156
|
startRow: 0,
|
|
3152
3157
|
endRow: 0,
|
|
3153
3158
|
startColumn: e,
|
|
@@ -3162,7 +3167,7 @@ let Wt = class extends oe {
|
|
|
3162
3167
|
unitId: o,
|
|
3163
3168
|
subUnitId: c,
|
|
3164
3169
|
drawingId: m,
|
|
3165
|
-
drawingType: n.type ||
|
|
3170
|
+
drawingType: n.type || F.DRAWING_DOM,
|
|
3166
3171
|
componentKey: l,
|
|
3167
3172
|
sheetTransform: S,
|
|
3168
3173
|
transform: {
|
|
@@ -3175,30 +3180,30 @@ let Wt = class extends oe {
|
|
|
3175
3180
|
allowTransform: u
|
|
3176
3181
|
};
|
|
3177
3182
|
{
|
|
3178
|
-
const { unitId: y, subUnitId:
|
|
3179
|
-
if (!
|
|
3183
|
+
const { unitId: y, subUnitId: T, drawingId: I } = D, R = V(this._univerInstanceService, { unitId: y, subUnitId: T }), E = D, B = this._univerInstanceService.getUnit(y, H.UNIVER_SHEET);
|
|
3184
|
+
if (!B)
|
|
3180
3185
|
return;
|
|
3181
|
-
const
|
|
3182
|
-
if (!
|
|
3186
|
+
const K = B.getActiveSheet().getSheetId();
|
|
3187
|
+
if (!E || !R)
|
|
3183
3188
|
return;
|
|
3184
|
-
const
|
|
3185
|
-
if (!
|
|
3189
|
+
const Z = (b = this._renderManagerService.getRenderById(y)) == null ? void 0 : b.with(X);
|
|
3190
|
+
if (!Z)
|
|
3186
3191
|
return;
|
|
3187
|
-
const
|
|
3188
|
-
if (!
|
|
3192
|
+
const Y = Z.getWorksheetSkeleton(T);
|
|
3193
|
+
if (!Y)
|
|
3189
3194
|
return;
|
|
3190
|
-
const { transform:
|
|
3191
|
-
if (
|
|
3195
|
+
const { transform: me, data: G } = E, J = this._getSceneAndTransformerByDrawingSearch(y);
|
|
3196
|
+
if (J == null)
|
|
3192
3197
|
return;
|
|
3193
|
-
const { scene:
|
|
3194
|
-
if (
|
|
3198
|
+
const { scene: ce, canvas: q } = J;
|
|
3199
|
+
if (me == null || K !== T)
|
|
3195
3200
|
return;
|
|
3196
|
-
const { left: W, top:
|
|
3197
|
-
if (
|
|
3198
|
-
|
|
3201
|
+
const { left: W, top: ye, width: Te, height: it, angle: st, flipX: ot, flipY: at, skewX: Vt, skewY: Ht } = me, ct = Se({ unitId: y, subUnitId: T, drawingId: I }), dt = ce.getObject(ct);
|
|
3202
|
+
if (dt != null) {
|
|
3203
|
+
dt.transformByState({ left: W, top: ye, width: Te, height: it, angle: st, flipX: ot, flipY: at, skewX: Vt, skewY: Ht });
|
|
3199
3204
|
return;
|
|
3200
3205
|
}
|
|
3201
|
-
const
|
|
3206
|
+
const Oe = Mt({
|
|
3202
3207
|
rotate: 0,
|
|
3203
3208
|
startX: w.startX,
|
|
3204
3209
|
startY: 0,
|
|
@@ -3210,96 +3215,96 @@ let Wt = class extends oe {
|
|
|
3210
3215
|
left: p.absolute.left,
|
|
3211
3216
|
top: p.absolute.top
|
|
3212
3217
|
}
|
|
3213
|
-
}, t),
|
|
3214
|
-
left:
|
|
3215
|
-
top:
|
|
3216
|
-
width:
|
|
3217
|
-
height:
|
|
3218
|
-
zIndex: this._drawingManagerService.getDrawingOrder(y,
|
|
3219
|
-
},
|
|
3220
|
-
|
|
3221
|
-
const
|
|
3218
|
+
}, t), lt = {
|
|
3219
|
+
left: Oe.startX,
|
|
3220
|
+
top: Oe.startY,
|
|
3221
|
+
width: Oe.width,
|
|
3222
|
+
height: Oe.height,
|
|
3223
|
+
zIndex: this._drawingManagerService.getDrawingOrder(y, T).length - 1
|
|
3224
|
+
}, ue = new je(ct, lt);
|
|
3225
|
+
ce.addObject(ue, Zt), E.allowTransform !== !1 && ce.attachTransformerTo(ue);
|
|
3226
|
+
const re = this._ensureMap(y, T), Ee = new wt(), de = ce.getMainViewport(), ke = {
|
|
3222
3227
|
top: 0,
|
|
3223
3228
|
//viewMain.top,
|
|
3224
|
-
left:
|
|
3225
|
-
bottom:
|
|
3226
|
-
right:
|
|
3227
|
-
},
|
|
3228
|
-
dispose:
|
|
3229
|
-
rect:
|
|
3229
|
+
left: de.left,
|
|
3230
|
+
bottom: de.bottom,
|
|
3231
|
+
right: de.right
|
|
3232
|
+
}, he = {
|
|
3233
|
+
dispose: Ee,
|
|
3234
|
+
rect: ue,
|
|
3230
3235
|
// position$,
|
|
3231
3236
|
unitId: y,
|
|
3232
|
-
subUnitId:
|
|
3233
|
-
boundsOfViewArea:
|
|
3237
|
+
subUnitId: T,
|
|
3238
|
+
boundsOfViewArea: ke,
|
|
3234
3239
|
domAnchor: t,
|
|
3235
3240
|
scrollDirectionResponse: "HORIZONTAL"
|
|
3236
3241
|
/* HORIZONTAL */
|
|
3237
|
-
},
|
|
3238
|
-
|
|
3239
|
-
let
|
|
3240
|
-
position$:
|
|
3241
|
-
id:
|
|
3242
|
-
componentKey:
|
|
3242
|
+
}, ut = fe(ue, J.renderUnit, Y.skeleton, R.worksheet, he), Pe = new He(ut);
|
|
3243
|
+
he.position$ = Pe;
|
|
3244
|
+
let Ge = {
|
|
3245
|
+
position$: Pe,
|
|
3246
|
+
id: I,
|
|
3247
|
+
componentKey: E.componentKey,
|
|
3243
3248
|
onPointerDown: () => {
|
|
3244
3249
|
},
|
|
3245
3250
|
onPointerMove: () => {
|
|
3246
3251
|
},
|
|
3247
3252
|
onPointerUp: () => {
|
|
3248
3253
|
},
|
|
3249
|
-
onWheel: (
|
|
3250
|
-
|
|
3254
|
+
onWheel: ($) => {
|
|
3255
|
+
q.dispatchEvent(new WheelEvent($.type, $));
|
|
3251
3256
|
},
|
|
3252
|
-
props: (
|
|
3253
|
-
data:
|
|
3257
|
+
props: (O = (_ = re.get(I)) == null ? void 0 : _.props) != null ? O : this._getFloatDomProps(I),
|
|
3258
|
+
data: G,
|
|
3254
3259
|
unitId: y
|
|
3255
3260
|
};
|
|
3256
|
-
n.eventPassThrough && (
|
|
3257
|
-
...
|
|
3258
|
-
onPointerDown: (
|
|
3259
|
-
|
|
3261
|
+
n.eventPassThrough && (Ge = {
|
|
3262
|
+
...Ge,
|
|
3263
|
+
onPointerDown: ($) => {
|
|
3264
|
+
q.dispatchEvent(new PointerEvent($.type, $));
|
|
3260
3265
|
},
|
|
3261
|
-
onPointerMove: (
|
|
3262
|
-
|
|
3266
|
+
onPointerMove: ($) => {
|
|
3267
|
+
q.dispatchEvent(new PointerEvent($.type, $));
|
|
3263
3268
|
},
|
|
3264
|
-
onPointerUp: (
|
|
3265
|
-
|
|
3269
|
+
onPointerUp: ($) => {
|
|
3270
|
+
q.dispatchEvent(new PointerEvent($.type, $));
|
|
3266
3271
|
}
|
|
3267
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
3268
|
-
const
|
|
3269
|
-
const
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
+
}), this._canvasFloatDomService.addFloatDom(Ge);
|
|
3273
|
+
const ht = ue.onTransformChange$.subscribeEvent(() => {
|
|
3274
|
+
const $ = fe(ue, J.renderUnit, Y.skeleton, R.worksheet, he);
|
|
3275
|
+
Pe.next(
|
|
3276
|
+
$
|
|
3272
3277
|
);
|
|
3273
3278
|
});
|
|
3274
|
-
this.disposeWithMe(f.subscribe((
|
|
3275
|
-
const
|
|
3279
|
+
this.disposeWithMe(f.subscribe(($) => {
|
|
3280
|
+
const Ue = Mt({
|
|
3276
3281
|
rotate: 0,
|
|
3277
|
-
startX:
|
|
3282
|
+
startX: $.startX,
|
|
3278
3283
|
startY: 0,
|
|
3279
|
-
endX:
|
|
3280
|
-
endY:
|
|
3284
|
+
endX: $.endX,
|
|
3285
|
+
endY: $.endY,
|
|
3281
3286
|
width: t.width,
|
|
3282
3287
|
height: t.height,
|
|
3283
3288
|
absolute: {
|
|
3284
3289
|
left: p.absolute.left,
|
|
3285
3290
|
top: p.absolute.top
|
|
3286
3291
|
}
|
|
3287
|
-
}, t),
|
|
3288
|
-
left:
|
|
3292
|
+
}, t), Xe = Se({ unitId: y, subUnitId: T, drawingId: I }), Ve = new je(Xe, {
|
|
3293
|
+
left: Ue.startX,
|
|
3289
3294
|
top: 0,
|
|
3290
3295
|
width: t.width,
|
|
3291
3296
|
height: t.height,
|
|
3292
|
-
zIndex: this._drawingManagerService.getDrawingOrder(y,
|
|
3293
|
-
}),
|
|
3294
|
-
|
|
3297
|
+
zIndex: this._drawingManagerService.getDrawingOrder(y, T).length - 1
|
|
3298
|
+
}), gt = fe(Ve, J.renderUnit, Y.skeleton, R.worksheet, he);
|
|
3299
|
+
Pe.next(gt);
|
|
3295
3300
|
}));
|
|
3296
|
-
const
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
}),
|
|
3300
|
-
this._canvasFloatDomService.removeFloatDom(
|
|
3301
|
-
}),
|
|
3302
|
-
...
|
|
3301
|
+
const ge = (M = this._renderManagerService.getRenderById(y)) == null ? void 0 : M.with(X);
|
|
3302
|
+
ge == null || ge.currentSkeleton$.subscribe(($) => {
|
|
3303
|
+
$ && d.sheetId !== $.sheetId && this._removeDom(m, !0);
|
|
3304
|
+
}), Ee.add(() => {
|
|
3305
|
+
this._canvasFloatDomService.removeFloatDom(I);
|
|
3306
|
+
}), ht && Ee.add(ht), this._domLayerInfoMap.set(I, he), re.set(I, {
|
|
3307
|
+
...re.get(I)
|
|
3303
3308
|
});
|
|
3304
3309
|
}
|
|
3305
3310
|
return {
|
|
@@ -3324,13 +3329,13 @@ let Wt = class extends oe {
|
|
|
3324
3329
|
const o = Ze(r, s, t), c = new He(o), a = Ze(e.endRow, e.endColumn, t), g = new He(a), d = () => {
|
|
3325
3330
|
const f = Ze(r, s, t), w = Ze(e.endRow, e.endColumn, t);
|
|
3326
3331
|
c.next(f), g.next(w);
|
|
3327
|
-
}, l = new
|
|
3332
|
+
}, l = new wt();
|
|
3328
3333
|
l.add(n.engine.clientRect$.subscribe(() => d())), l.add(this._commandService.onCommandExecuted((f) => {
|
|
3329
|
-
if (f.id ===
|
|
3334
|
+
if (f.id === kn.id && f.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
|
|
3330
3335
|
d();
|
|
3331
3336
|
return;
|
|
3332
3337
|
}
|
|
3333
|
-
(
|
|
3338
|
+
(Qi.indexOf(f.id) > -1 || f.id === Mi.id || f.id === Mn.id) && d();
|
|
3334
3339
|
}));
|
|
3335
3340
|
const h = (f, w) => {
|
|
3336
3341
|
r = f, s = w, d();
|
|
@@ -3347,7 +3352,7 @@ let Wt = class extends oe {
|
|
|
3347
3352
|
endX: a.right,
|
|
3348
3353
|
endY: a.bottom
|
|
3349
3354
|
}), m = c.pipe(
|
|
3350
|
-
|
|
3355
|
+
qe((f) => {
|
|
3351
3356
|
const w = Ze(e.endRow, e.endColumn, t);
|
|
3352
3357
|
return {
|
|
3353
3358
|
rotate: 0,
|
|
@@ -3374,15 +3379,15 @@ let Wt = class extends oe {
|
|
|
3374
3379
|
};
|
|
3375
3380
|
}
|
|
3376
3381
|
};
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
],
|
|
3382
|
+
$t = Ao([
|
|
3383
|
+
Re(0, N(ne)),
|
|
3384
|
+
Re(1, Fe),
|
|
3385
|
+
Re(2, N(k)),
|
|
3386
|
+
Re(3, oe),
|
|
3387
|
+
Re(4, N(Wi)),
|
|
3388
|
+
Re(5, ae),
|
|
3389
|
+
Re(6, N(Zr))
|
|
3390
|
+
], $t);
|
|
3386
3391
|
function Ze(i, e, n) {
|
|
3387
3392
|
const t = n.getCellWithCoordByIndex(i, e), r = t.isMergedMainCell ? t.mergeInfo : t;
|
|
3388
3393
|
return {
|
|
@@ -3392,22 +3397,22 @@ function Ze(i, e, n) {
|
|
|
3392
3397
|
bottom: r.endY
|
|
3393
3398
|
};
|
|
3394
3399
|
}
|
|
3395
|
-
function
|
|
3400
|
+
function Mt(i, e, n) {
|
|
3396
3401
|
var g, d;
|
|
3397
3402
|
n = n != null ? n : 1;
|
|
3398
3403
|
const t = i.endX - i.startX, r = i.endY - i.startY, s = (g = e == null ? void 0 : e.width) != null ? g : t, o = (d = e == null ? void 0 : e.height) != null ? d : r;
|
|
3399
3404
|
let c = 0, a = 0;
|
|
3400
3405
|
if (e) {
|
|
3401
3406
|
if (e.horizonOffsetAlign === "right") {
|
|
3402
|
-
const l =
|
|
3407
|
+
const l = yt(e.marginX, t * n);
|
|
3403
3408
|
c = i.endX - l - s;
|
|
3404
3409
|
} else
|
|
3405
|
-
c = i.startX +
|
|
3410
|
+
c = i.startX + yt(e.marginX, t);
|
|
3406
3411
|
if (e.verticalOffsetAlign === "bottom") {
|
|
3407
|
-
const l =
|
|
3412
|
+
const l = yt(e.marginY, r * n);
|
|
3408
3413
|
a = i.endY - l - o;
|
|
3409
3414
|
} else
|
|
3410
|
-
a = i.startY +
|
|
3415
|
+
a = i.startY + yt(e.marginY, r);
|
|
3411
3416
|
}
|
|
3412
3417
|
return {
|
|
3413
3418
|
rotate: 0,
|
|
@@ -3423,93 +3428,93 @@ function Dt(i, e, n) {
|
|
|
3423
3428
|
}
|
|
3424
3429
|
};
|
|
3425
3430
|
}
|
|
3426
|
-
function
|
|
3431
|
+
function yt(i, e) {
|
|
3427
3432
|
if (i === void 0) return 0;
|
|
3428
3433
|
if (typeof i == "number") return i;
|
|
3429
3434
|
const n = Number.parseFloat(i);
|
|
3430
3435
|
return e * n / 100;
|
|
3431
3436
|
}
|
|
3432
|
-
var
|
|
3433
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
3437
|
+
var Rr = Object.defineProperty, jo = Object.getOwnPropertyDescriptor, Bo = (i, e, n) => e in i ? Rr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Wo = (i, e, n, t) => {
|
|
3438
|
+
for (var r = t > 1 ? void 0 : t ? jo(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
3434
3439
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
3435
|
-
return t && r &&
|
|
3436
|
-
},
|
|
3437
|
-
const
|
|
3438
|
-
let
|
|
3439
|
-
constructor(i =
|
|
3440
|
+
return t && r && Rr(e, n, r), r;
|
|
3441
|
+
}, en = (i, e) => (n, t) => e(n, t, i), Dr = (i, e, n) => Bo(i, typeof e != "symbol" ? e + "" : e, n);
|
|
3442
|
+
const $o = "SHEET_IMAGE_UI_PLUGIN";
|
|
3443
|
+
let xt = class extends ei {
|
|
3444
|
+
constructor(i = Pn, e, n, t) {
|
|
3440
3445
|
super(), this._config = i, this._injector = e, this._renderManagerService = n, this._configService = t;
|
|
3441
|
-
const { menu: r, ...s } =
|
|
3446
|
+
const { menu: r, ...s } = ti(
|
|
3442
3447
|
{},
|
|
3443
|
-
|
|
3448
|
+
Pn,
|
|
3444
3449
|
this._config
|
|
3445
3450
|
);
|
|
3446
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
3451
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(ss, s);
|
|
3447
3452
|
}
|
|
3448
3453
|
onStarting() {
|
|
3449
|
-
|
|
3454
|
+
ni(this._injector, [
|
|
3455
|
+
[$t],
|
|
3450
3456
|
[Wt],
|
|
3457
|
+
[Et],
|
|
3451
3458
|
[Bt],
|
|
3452
|
-
[Ot],
|
|
3453
3459
|
[jt],
|
|
3454
3460
|
[Nt],
|
|
3461
|
+
[Pt],
|
|
3455
3462
|
[At],
|
|
3456
|
-
[
|
|
3457
|
-
|
|
3458
|
-
[
|
|
3459
|
-
]), zt(this._injector, [
|
|
3460
|
-
[Wt]
|
|
3463
|
+
[Ut]
|
|
3464
|
+
]), Kt(this._injector, [
|
|
3465
|
+
[$t]
|
|
3461
3466
|
]);
|
|
3462
3467
|
}
|
|
3463
3468
|
onReady() {
|
|
3464
|
-
|
|
3465
|
-
[
|
|
3469
|
+
Kt(this._injector, [
|
|
3470
|
+
[Nt]
|
|
3466
3471
|
]);
|
|
3467
3472
|
}
|
|
3468
3473
|
onRendered() {
|
|
3469
|
-
this._registerRenderModules(),
|
|
3470
|
-
[Nt],
|
|
3474
|
+
this._registerRenderModules(), Kt(this._injector, [
|
|
3471
3475
|
[jt],
|
|
3472
3476
|
[Bt],
|
|
3473
|
-
[
|
|
3474
|
-
[
|
|
3475
|
-
[
|
|
3477
|
+
[Wt],
|
|
3478
|
+
[Pt],
|
|
3479
|
+
[At],
|
|
3480
|
+
[Ut]
|
|
3476
3481
|
]);
|
|
3477
3482
|
}
|
|
3478
3483
|
onSteady() {
|
|
3479
|
-
this._injector.get(
|
|
3484
|
+
this._injector.get(Et);
|
|
3480
3485
|
}
|
|
3481
3486
|
_registerRenderModules() {
|
|
3482
3487
|
[
|
|
3483
|
-
[
|
|
3484
|
-
[
|
|
3485
|
-
[
|
|
3488
|
+
[Qe],
|
|
3489
|
+
[cn],
|
|
3490
|
+
[on]
|
|
3486
3491
|
].forEach((i) => {
|
|
3487
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3492
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, i));
|
|
3488
3493
|
});
|
|
3489
3494
|
}
|
|
3490
3495
|
};
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
],
|
|
3496
|
+
Dr(xt, "type", H.UNIVER_SHEET);
|
|
3497
|
+
Dr(xt, "pluginName", $o);
|
|
3498
|
+
xt = Wo([
|
|
3499
|
+
Qr(ai, si, gi, pi),
|
|
3500
|
+
en(1, N(et)),
|
|
3501
|
+
en(2, ne),
|
|
3502
|
+
en(3, ri)
|
|
3503
|
+
], xt);
|
|
3499
3504
|
export {
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3505
|
+
L as ClearSheetDrawingTransformerOperation,
|
|
3506
|
+
Sr as DeleteDrawingsCommand,
|
|
3507
|
+
ur as EditSheetDrawingOperation,
|
|
3508
|
+
hr as GroupSheetDrawingCommand,
|
|
3509
|
+
Xt as InsertFloatImageCommand,
|
|
3510
|
+
kt as InsertSheetDrawingCommand,
|
|
3511
|
+
nt as MoveDrawingsCommand,
|
|
3512
|
+
tt as RemoveSheetDrawingCommand,
|
|
3513
|
+
Cr as SHEETS_IMAGE_MENU_ID,
|
|
3514
|
+
gr as SetDrawingArrangeCommand,
|
|
3515
|
+
Gt as SetSheetDrawingCommand,
|
|
3516
|
+
$t as SheetCanvasFloatDomManagerService,
|
|
3517
|
+
lr as SidebarSheetDrawingOperation,
|
|
3518
|
+
fr as UngroupSheetDrawingCommand,
|
|
3519
|
+
xt as UniverSheetsDrawingUIPlugin
|
|
3515
3520
|
};
|