@univerjs/sheets-drawing-ui 0.6.10-experimental.20250424-9e348ed → 0.6.10-experimental.20250427-89a0949
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +765 -830
- package/lib/index.css +1 -1
- package/lib/index.js +765 -830
- package/lib/types/views/printing-float-dom/index.d.ts +0 -6
- package/lib/umd/index.js +2 -2
- package/package.json +14 -14
package/lib/es/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var te = (i, t, e) =>
|
|
4
|
-
import { CommandType as J, ICommandService as G, IUndoRedoService as Ge, sequenceExecute as
|
|
5
|
-
import { DocDrawingController as
|
|
6
|
-
import { SetDrawingSelectedOperation as
|
|
7
|
-
import { ImageCropperObject as
|
|
8
|
-
import { IRenderManagerService as q, CURSOR_TYPE as
|
|
9
|
-
import { ISheetDrawingService as oe, DrawingApplyType as P, SetDrawingApplyMutation as U, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin 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 gs = "sheets-drawing-ui.config",
|
|
1
|
+
var jr = Object.defineProperty;
|
|
2
|
+
var $r = (i, t, e) => t in i ? jr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var te = (i, t, e) => $r(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { CommandType as J, ICommandService as G, IUndoRedoService as Ge, sequenceExecute as Vn, LocaleService as rt, IUniverInstanceService as Se, Inject as A, Injector as Xe, IContextService as Hn, RxDisposable as xr, UniverInstanceType as L, toDisposable as Lr, FOCUSING_COMMON_DRAWINGS as Fe, DrawingTypeEnum as W, Disposable as ie, ArrangeTypeEnum as wt, createDocumentModelWithStyle as Jt, ObjectRelativeFromV as Sn, ObjectRelativeFromH as In, WrapTextType as Cn, PositionedObjectLayoutType as Dn, BooleanNumber as bn, BuildTextUtils as qt, ImageSourceType as Rn, generateRandomId as Mt, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as et, DOCS_ZEN_EDITOR_UNIT_ID_KEY as xe, InterceptorEffectEnum as Fr, ObjectMatrix as Yr, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Gr, Tools as ye, IPermissionService as Xr, UserManagerService as Vr, LifecycleService as Hr, LifecycleStages as zr, DisposableCollection as _t, fromEventSubject as Kr, PRINT_CHART_COMPONENT_KEY as Zr, Rectangle as Jr, Direction as ve, FOCUSING_FX_BAR_EDITOR as qr, EDITOR_ACTIVATED as Qr, FOCUSING_PANEL_EDITOR as ei, DependentOn as ti, IConfigService as ni, Plugin as ri, merge as ii, registerDependencies as si, touchDependencies as Xt } from "@univerjs/core";
|
|
5
|
+
import { DocDrawingController as oi, UniverDocsDrawingPlugin as ai } from "@univerjs/docs-drawing";
|
|
6
|
+
import { SetDrawingSelectedOperation as jt, IImageIoService as zn, IDrawingManagerService as se, DRAWING_IMAGE_ALLOW_IMAGE_LIST as yn, DRAWING_IMAGE_COUNT_LIMIT as Mn, ImageUploadStatusType as Ne, DRAWING_IMAGE_ALLOW_SIZE as En, getImageSize as Vt, DRAWING_IMAGE_WIDTH_LIMIT as Tn, DRAWING_IMAGE_HEIGHT_LIMIT as On, ImageSourceType as ci, getDrawingShapeKeyByDrawingSearch as Ie, UniverDrawingPlugin as di } from "@univerjs/drawing";
|
|
7
|
+
import { ImageCropperObject as li, COMPONENT_IMAGE_POPUP_MENU as ui, OpenImageCropOperation as hi, ImageResetSizeOperation as gi, DrawingRenderService as Kn, DrawingCommonPanel as mi, UniverDrawingUIPlugin as fi } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as q, CURSOR_TYPE as pi, precisionTo as vt, transformObjectOutOfGroup as wi, getGroupState as _i, getCurrentTypeOfRenderer as dn, RENDER_CLASS_TYPE as ke, Rect as Be, ObjectType as Pn, DRAWING_OBJECT_LAYER_INDEX as Ht, SHEET_VIEWPORT_KEY as Zn } from "@univerjs/engine-render";
|
|
9
|
+
import { ISheetDrawingService as oe, DrawingApplyType as P, SetDrawingApplyMutation as U, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as vi } from "@univerjs/sheets-drawing";
|
|
10
|
+
import { SheetCanvasPopManagerService as Si, HoverManagerService as Ii, SheetSkeletonManagerService as V, convertPositionSheetOverGridToAbsolute as Ci, ISheetSelectionRenderService as Ve, attachRangeWithCoord as Jn, IEditorBridgeService as Di, IAutoFillService as bi, EditingRenderController as Ri, SetCellEditVisibleOperation as Un, PREDEFINED_HOOK_NAME as Le, COPY_TYPE as Ce, discreteRangeToRange as An, virtualizeDiscreteRanges as yi, ISheetClipboardService as Mi, SetZoomRatioOperation as Nn, SetScrollOperation as Ei, SheetPrintInterceptorService as Ti, getCurrentRangeDisable$ as Oi } from "@univerjs/sheets-ui";
|
|
11
|
+
import { ISidebarService as Pi, useDependency as Me, IUIPartsService as Ui, BuiltInUIPart as Ai, connectInjector as qn, ILocalFileService as Ni, IMessageService as ki, IDialogService as Bi, IClipboardInterfaceService as Wi, CanvasFloatDomService as ji, PrintFloatDomSingle as $i, ComponentManager as Qn, getMenuHiddenObservable as ln, MenuItemType as un, RibbonStartGroup as xi, KeyCode as Ye, IMenuManagerService as Li, IShortcutService as Fi } from "@univerjs/ui";
|
|
12
|
+
import { takeUntil as kn, throttleTime as Yi, combineLatest as St, switchMap as _e, EMPTY as me, tap as Bn, map as Ee, distinctUntilChanged as Wn, Subject as zt, filter as Gi, take as Xi, BehaviorSubject as $e, of as jn } from "rxjs";
|
|
13
|
+
import { SheetInterceptorService as $t, getSheetCommandTarget as ae, SheetsSelectionsService as hn, SetRangeValuesCommand as $n, INTERCEPTOR_POINT as Vi, InterceptCellContentPriority as Hi, WorkbookViewPermission as xn, WorksheetViewPermission as Ln, WorkbookEditablePermission as Qt, WorksheetEditPermission as en, SetFrozenMutation as zi, SetWorksheetRowAutoHeightMutation as Ki, COMMAND_LISTENER_SKELETON_CHANGE as Zi, InsertRowCommand as er, InsertColCommand as tr, RemoveRowCommand as nr, RemoveColCommand as rr, DeleteRangeMoveLeftCommand as ir, DeleteRangeMoveUpCommand as sr, InsertRangeMoveDownCommand as or, InsertRangeMoveRightCommand as ar, DeltaRowHeightCommand as tn, SetRowHeightCommand as nn, DeltaColumnWidthCommand as cr, SetColWidthCommand as dr, SetRowHiddenCommand as lr, SetSpecificRowsVisibleCommand as ur, SetSpecificColsVisibleCommand as hr, SetColHiddenCommand as gr, MoveColsCommand as mr, MoveRowsCommand as fr, MoveRangeCommand as pr, SetRowVisibleMutation as Ji, SetRowHiddenMutation as qi, SetColVisibleMutation as Qi, SetColHiddenMutation as es, SetWorksheetRowHeightMutation as ts, SetWorksheetColWidthMutation as ns, SetWorksheetActiveOperation as rs, RangeProtectionPermissionEditPoint as is } from "@univerjs/sheets";
|
|
14
|
+
import { jsx as K, jsxs as Et } from "react/jsx-runtime";
|
|
15
|
+
import ss, { useEffect as gn, useMemo as os, forwardRef as wr, useRef as as, createElement as _r, useState as rn } from "react";
|
|
16
|
+
import { docDrawingPositionToTransform as Fn, ReplaceSnapshotCommand as cs, InnerPasteCommand as ds } from "@univerjs/docs-ui";
|
|
17
|
+
import { MessageType as De, render as ls, unmount as us, clsx as It, RadioGroup as hs, Radio as Kt } from "@univerjs/design";
|
|
18
|
+
const gs = "sheets-drawing-ui.config", Yn = {}, F = {
|
|
19
19
|
id: "sheet.operation.clear-drawing-transformer",
|
|
20
20
|
type: J.MUTATION,
|
|
21
21
|
handler: (i, t) => {
|
|
@@ -25,20 +25,20 @@ const gs = "sheets-drawing-ui.config", Vn = {}, F = {
|
|
|
25
25
|
(s = (r = e.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
|
|
26
26
|
}), !0;
|
|
27
27
|
}
|
|
28
|
-
},
|
|
28
|
+
}, it = {
|
|
29
29
|
id: "sheet.command.remove-sheet-image",
|
|
30
30
|
type: J.COMMAND,
|
|
31
31
|
handler: (i, t) => {
|
|
32
32
|
var S, C, b;
|
|
33
|
-
const e = i.get(G), n = i.get(Ge), r = i.get(
|
|
33
|
+
const e = i.get(G), n = i.get(Ge), r = i.get($t), s = i.get(oe);
|
|
34
34
|
if (!t) return !1;
|
|
35
35
|
const { drawings: o } = t, a = [];
|
|
36
36
|
o.forEach((v) => {
|
|
37
37
|
const { unitId: D } = v;
|
|
38
38
|
a.push(D);
|
|
39
39
|
});
|
|
40
|
-
const c = s.getBatchRemoveOp(o), { unitId: u, subUnitId: d, undo: l, redo: g, objects: h } = c, f = r.onCommandExecute({ id:
|
|
41
|
-
return
|
|
40
|
+
const c = s.getBatchRemoveOp(o), { unitId: u, subUnitId: d, undo: l, redo: g, objects: h } = c, f = r.onCommandExecute({ id: it.id, params: t }), p = { id: U.id, params: { unitId: u, subUnitId: d, op: g, objects: h, type: P.REMOVE } }, m = { id: U.id, params: { unitId: u, subUnitId: d, op: l, objects: h, type: P.INSERT } };
|
|
41
|
+
return Vn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], e) ? (n.pushUndoRedo({
|
|
42
42
|
unitID: u,
|
|
43
43
|
undoMutations: [
|
|
44
44
|
...(C = f.preUndos) != null ? C : [],
|
|
@@ -54,19 +54,19 @@ const gs = "sheets-drawing-ui.config", Vn = {}, F = {
|
|
|
54
54
|
]
|
|
55
55
|
}), !0) : !1;
|
|
56
56
|
}
|
|
57
|
-
},
|
|
57
|
+
}, vr = "COMPONENT_SHEET_DRAWING_PANEL", Sr = {
|
|
58
58
|
id: "sidebar.operation.sheet-image",
|
|
59
59
|
type: J.COMMAND,
|
|
60
60
|
handler: async (i, t) => {
|
|
61
|
-
const e = i.get(
|
|
61
|
+
const e = i.get(Pi), n = i.get(rt), r = i.get(Se), s = i.get(G);
|
|
62
62
|
if (!ae(r)) return !1;
|
|
63
63
|
switch (t.value) {
|
|
64
64
|
case "open":
|
|
65
65
|
e.open({
|
|
66
66
|
header: { title: n.t("sheetImage.panel.title") },
|
|
67
|
-
children: { label:
|
|
67
|
+
children: { label: vr },
|
|
68
68
|
onClose: () => {
|
|
69
|
-
s.syncExecuteCommand(
|
|
69
|
+
s.syncExecuteCommand(jt.id, []);
|
|
70
70
|
},
|
|
71
71
|
width: 360
|
|
72
72
|
});
|
|
@@ -78,45 +78,45 @@ const gs = "sheets-drawing-ui.config", Vn = {}, F = {
|
|
|
78
78
|
}
|
|
79
79
|
return !0;
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, Ir = {
|
|
82
82
|
id: "sheet.operation.edit-sheet-image",
|
|
83
83
|
type: J.OPERATION,
|
|
84
84
|
handler: (i, t) => {
|
|
85
85
|
const e = i.get(G);
|
|
86
|
-
return t == null ? !1 : (e.syncExecuteCommand(
|
|
86
|
+
return t == null ? !1 : (e.syncExecuteCommand(jt.id, [t]), e.executeCommand(Sr.id, { value: "open" }), !0);
|
|
87
87
|
}
|
|
88
|
-
}, ms = "univer-upload-loading", fs = "univer-upload-loading-body", ps = "univer-upload-loading-body-animation", ws = "univer-upload-loading-body-text",
|
|
88
|
+
}, ms = "univer-upload-loading", fs = "univer-upload-loading-body", ps = "univer-upload-loading-body-animation", ws = "univer-upload-loading-body-text", Ct = {
|
|
89
89
|
uploadLoading: ms,
|
|
90
90
|
uploadLoadingBody: fs,
|
|
91
91
|
uploadLoadingBodyAnimation: ps,
|
|
92
92
|
uploadLoadingBodyText: ws
|
|
93
93
|
}, _s = () => {
|
|
94
|
-
const i =
|
|
95
|
-
return
|
|
94
|
+
const i = Me(zn), t = Me(rt), [e, n] = ss.useState(0);
|
|
95
|
+
return gn(() => {
|
|
96
96
|
const r = i.change$.subscribe((s) => {
|
|
97
97
|
n(s);
|
|
98
98
|
});
|
|
99
99
|
return () => {
|
|
100
100
|
r.unsubscribe();
|
|
101
101
|
};
|
|
102
|
-
}, [i]), /* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
102
|
+
}, [i]), /* @__PURE__ */ K("div", { style: { display: e > 0 ? "block" : "none" }, className: Ct.uploadLoading, children: /* @__PURE__ */ Et("div", { className: Ct.uploadLoadingBody, children: [
|
|
103
|
+
/* @__PURE__ */ K("div", { className: Ct.uploadLoadingBodyAnimation }),
|
|
104
|
+
/* @__PURE__ */ K("div", { className: Ct.uploadLoadingBodyText, children: `${t.t("uploadLoading.loading")}: ${e}` })
|
|
105
105
|
] }) });
|
|
106
106
|
};
|
|
107
107
|
var vs = Object.getOwnPropertyDescriptor, Ss = (i, t, e, n) => {
|
|
108
108
|
for (var r = n > 1 ? void 0 : n ? vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
109
109
|
(o = i[s]) && (r = o(r) || r);
|
|
110
110
|
return r;
|
|
111
|
-
},
|
|
112
|
-
let
|
|
111
|
+
}, fe = (i, t) => (e, n) => t(e, n, i);
|
|
112
|
+
let Tt = class extends xr {
|
|
113
113
|
constructor(t, e, n, r, s, o, a, c) {
|
|
114
114
|
super();
|
|
115
115
|
te(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
116
116
|
this._injector = t, this._drawingManagerService = e, this._canvasPopManagerService = n, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = a, this._commandService = c, this._init();
|
|
117
117
|
}
|
|
118
118
|
_init() {
|
|
119
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(L.UNIVER_SHEET).pipe(
|
|
119
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(L.UNIVER_SHEET).pipe(kn(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(L.UNIVER_SHEET).pipe(kn(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(L.UNIVER_SHEET).forEach((t) => this._create(t)), this._uiPartsService.registerComponent(Ai.CONTENT, () => qn(_s, this._injector));
|
|
120
120
|
}
|
|
121
121
|
_dispose(t) {
|
|
122
122
|
const e = t.getUnitId();
|
|
@@ -131,7 +131,7 @@ let Ot = class extends Fr {
|
|
|
131
131
|
_hasCropObject(t) {
|
|
132
132
|
const e = t.getAllObjectsByOrder();
|
|
133
133
|
for (const n of e)
|
|
134
|
-
if (n instanceof
|
|
134
|
+
if (n instanceof li)
|
|
135
135
|
return !0;
|
|
136
136
|
return !1;
|
|
137
137
|
}
|
|
@@ -145,9 +145,9 @@ let Ot = class extends Fr {
|
|
|
145
145
|
return;
|
|
146
146
|
let r;
|
|
147
147
|
this.disposeWithMe(
|
|
148
|
-
|
|
148
|
+
Lr(
|
|
149
149
|
n.createControl$.subscribe(() => {
|
|
150
|
-
if (this._contextService.setContextValue(
|
|
150
|
+
if (this._contextService.setContextValue(Fe, !0), this._hasCropObject(e))
|
|
151
151
|
return;
|
|
152
152
|
const o = n.getSelectedObjectMap();
|
|
153
153
|
if (o.size > 1) {
|
|
@@ -166,7 +166,7 @@ let Ot = class extends Fr {
|
|
|
166
166
|
r == null || r.dispose();
|
|
167
167
|
const p = this._canvasPopManagerService.getFeatureMenu(d, l, g, h);
|
|
168
168
|
r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
169
|
-
componentKey:
|
|
169
|
+
componentKey: ui,
|
|
170
170
|
direction: "horizontal",
|
|
171
171
|
offset: [2, 0],
|
|
172
172
|
extraProps: {
|
|
@@ -177,11 +177,11 @@ let Ot = class extends Fr {
|
|
|
177
177
|
)
|
|
178
178
|
), this.disposeWithMe(
|
|
179
179
|
n.clearControl$.subscribe(() => {
|
|
180
|
-
r == null || r.dispose(), this._contextService.setContextValue(
|
|
180
|
+
r == null || r.dispose(), this._contextService.setContextValue(Fe, !1), this._commandService.syncExecuteCommand(jt.id, []);
|
|
181
181
|
})
|
|
182
182
|
), this.disposeWithMe(
|
|
183
183
|
this._contextService.contextChanged$.subscribe((o) => {
|
|
184
|
-
o[
|
|
184
|
+
o[Fe] === !1 && (r == null || r.dispose());
|
|
185
185
|
})
|
|
186
186
|
), this.disposeWithMe(
|
|
187
187
|
n.changing$.subscribe(() => {
|
|
@@ -194,60 +194,60 @@ let Ot = class extends Fr {
|
|
|
194
194
|
{
|
|
195
195
|
label: "image-popup.edit",
|
|
196
196
|
index: 0,
|
|
197
|
-
commandId:
|
|
197
|
+
commandId: Ir.id,
|
|
198
198
|
commandParams: { unitId: t, subUnitId: e, drawingId: n },
|
|
199
199
|
disable: r === W.DRAWING_DOM
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
label: "image-popup.delete",
|
|
203
203
|
index: 1,
|
|
204
|
-
commandId:
|
|
204
|
+
commandId: it.id,
|
|
205
205
|
commandParams: { unitId: t, drawings: [{ unitId: t, subUnitId: e, drawingId: n }] },
|
|
206
206
|
disable: !1
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
209
|
label: "image-popup.crop",
|
|
210
210
|
index: 2,
|
|
211
|
-
commandId:
|
|
211
|
+
commandId: hi.id,
|
|
212
212
|
commandParams: { unitId: t, subUnitId: e, drawingId: n },
|
|
213
213
|
disable: r === W.DRAWING_DOM
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
216
|
label: "image-popup.reset",
|
|
217
217
|
index: 3,
|
|
218
|
-
commandId:
|
|
218
|
+
commandId: gi.id,
|
|
219
219
|
commandParams: [{ unitId: t, subUnitId: e, drawingId: n }],
|
|
220
220
|
disable: r === W.DRAWING_DOM
|
|
221
221
|
}
|
|
222
222
|
];
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
],
|
|
225
|
+
Tt = Ss([
|
|
226
|
+
fe(0, A(Xe)),
|
|
227
|
+
fe(1, se),
|
|
228
|
+
fe(2, A(Si)),
|
|
229
|
+
fe(3, q),
|
|
230
|
+
fe(4, Se),
|
|
231
|
+
fe(5, Hn),
|
|
232
|
+
fe(6, A(Ui)),
|
|
233
|
+
fe(7, G)
|
|
234
|
+
], Tt);
|
|
235
235
|
var Is = Object.getOwnPropertyDescriptor, Cs = (i, t, e, n) => {
|
|
236
236
|
for (var r = n > 1 ? void 0 : n ? Is(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
237
237
|
(o = i[s]) && (r = o(r) || r);
|
|
238
238
|
return r;
|
|
239
|
-
},
|
|
240
|
-
let
|
|
239
|
+
}, Dt = (i, t) => (e, n) => t(e, n, i);
|
|
240
|
+
let sn = class extends ie {
|
|
241
241
|
constructor(t, e, n, r, s) {
|
|
242
242
|
super();
|
|
243
243
|
te(this, "_isSetCursor", !1);
|
|
244
244
|
this._context = t, this._hoverManagerService = e, this._selectionsService = n, this._drawingRenderService = r, this._sheetSkeletonManagerService = s, this._initHover(), this._initImageClick();
|
|
245
245
|
}
|
|
246
246
|
_initHover() {
|
|
247
|
-
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(
|
|
247
|
+
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(Yi(33)).subscribe((t) => {
|
|
248
248
|
var n, r;
|
|
249
249
|
let e = [];
|
|
250
|
-
t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(
|
|
250
|
+
t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(pi.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
|
|
251
251
|
}));
|
|
252
252
|
}
|
|
253
253
|
_initImageClick() {
|
|
@@ -261,25 +261,25 @@ let an = class extends ie {
|
|
|
261
261
|
}));
|
|
262
262
|
}
|
|
263
263
|
};
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
],
|
|
270
|
-
function
|
|
264
|
+
sn = Cs([
|
|
265
|
+
Dt(1, A(Ii)),
|
|
266
|
+
Dt(2, A(hn)),
|
|
267
|
+
Dt(3, A(Kn)),
|
|
268
|
+
Dt(4, A(V))
|
|
269
|
+
], sn);
|
|
270
|
+
function z(i, t, e) {
|
|
271
271
|
const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: c = 0, skewY: u = 0 } = i, d = e.getCurrent();
|
|
272
272
|
if (d == null)
|
|
273
273
|
return;
|
|
274
|
-
const l =
|
|
274
|
+
const l = Ci(
|
|
275
275
|
d.unitId,
|
|
276
276
|
d.sheetId,
|
|
277
277
|
{ from: n, to: r },
|
|
278
278
|
e
|
|
279
279
|
);
|
|
280
280
|
let { left: g, top: h, width: f, height: p } = l;
|
|
281
|
-
const m = e.getCurrentSkeleton(),
|
|
282
|
-
return g + f >
|
|
281
|
+
const m = e.getCurrentSkeleton(), _ = m.rowHeaderWidth + m.columnTotalWidth, S = m.columnHeaderHeight + m.rowTotalHeight;
|
|
282
|
+
return g + f > _ && (g = _ - f), h + p > S && (h = S - p), {
|
|
283
283
|
flipY: s,
|
|
284
284
|
flipX: o,
|
|
285
285
|
angle: a,
|
|
@@ -297,17 +297,17 @@ function x(i, t) {
|
|
|
297
297
|
return;
|
|
298
298
|
const g = {
|
|
299
299
|
column: l.actualColumn,
|
|
300
|
-
columnOffset:
|
|
300
|
+
columnOffset: vt(e - l.startX, 1),
|
|
301
301
|
row: l.actualRow,
|
|
302
|
-
rowOffset:
|
|
302
|
+
rowOffset: vt(n - l.startY, 1)
|
|
303
303
|
}, h = t.getCellWithCoordByOffset(e + r, n + s);
|
|
304
304
|
if (h == null)
|
|
305
305
|
return;
|
|
306
306
|
const f = {
|
|
307
307
|
column: h.actualColumn,
|
|
308
|
-
columnOffset:
|
|
308
|
+
columnOffset: vt(e + r - h.startX, 1),
|
|
309
309
|
row: h.actualRow,
|
|
310
|
-
rowOffset:
|
|
310
|
+
rowOffset: vt(n + s - h.startY, 1)
|
|
311
311
|
};
|
|
312
312
|
return {
|
|
313
313
|
flipY: o,
|
|
@@ -323,8 +323,8 @@ var Ds = Object.getOwnPropertyDescriptor, bs = (i, t, e, n) => {
|
|
|
323
323
|
for (var r = n > 1 ? void 0 : n ? Ds(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
324
324
|
(o = i[s]) && (r = o(r) || r);
|
|
325
325
|
return r;
|
|
326
|
-
},
|
|
327
|
-
let
|
|
326
|
+
}, bt = (i, t) => (e, n) => t(e, n, i);
|
|
327
|
+
let on = class extends ie {
|
|
328
328
|
constructor(i, t, e, n, r) {
|
|
329
329
|
super(), this._context = i, this._sheetDrawingService = t, this._drawingManagerService = e, this._sheetSelectionRenderService = n, this._sheetSkeletonManagerService = r, this._init();
|
|
330
330
|
}
|
|
@@ -338,22 +338,22 @@ let cn = class extends ie {
|
|
|
338
338
|
const e = i[t];
|
|
339
339
|
for (const n in e.data) {
|
|
340
340
|
const r = e.data[n];
|
|
341
|
-
r.transform =
|
|
341
|
+
r.transform = z(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
345
345
|
}
|
|
346
346
|
};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
],
|
|
347
|
+
on = bs([
|
|
348
|
+
bt(1, oe),
|
|
349
|
+
bt(2, se),
|
|
350
|
+
bt(3, A(Ve)),
|
|
351
|
+
bt(4, A(V))
|
|
352
|
+
], on);
|
|
353
353
|
function Rs(i) {
|
|
354
354
|
const t = [];
|
|
355
355
|
return i.forEach((e) => {
|
|
356
|
-
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, c =
|
|
356
|
+
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, c = _i(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
357
357
|
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: p } = l;
|
|
358
358
|
return {
|
|
359
359
|
unitId: h,
|
|
@@ -386,7 +386,7 @@ function ys(i) {
|
|
|
386
386
|
if (c == null)
|
|
387
387
|
return;
|
|
388
388
|
const u = r.map((l) => {
|
|
389
|
-
const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m =
|
|
389
|
+
const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m = wi(g || {}, c, c.width || 0, c.height || 0);
|
|
390
390
|
return {
|
|
391
391
|
unitId: h,
|
|
392
392
|
subUnitId: f,
|
|
@@ -410,7 +410,7 @@ function ys(i) {
|
|
|
410
410
|
});
|
|
411
411
|
}), t;
|
|
412
412
|
}
|
|
413
|
-
const
|
|
413
|
+
const Cr = {
|
|
414
414
|
id: "sheet.command.group-sheet-image",
|
|
415
415
|
type: J.COMMAND,
|
|
416
416
|
handler: (i, t) => {
|
|
@@ -435,15 +435,15 @@ const br = {
|
|
|
435
435
|
]
|
|
436
436
|
}), !0) : !1;
|
|
437
437
|
}
|
|
438
|
-
},
|
|
438
|
+
}, xt = {
|
|
439
439
|
id: "sheet.command.insert-sheet-image",
|
|
440
440
|
type: J.COMMAND,
|
|
441
441
|
handler: (i, t) => {
|
|
442
442
|
var S, C, b;
|
|
443
|
-
const e = i.get(G), n = i.get(Ge), r = i.get(oe), s = i.get(
|
|
443
|
+
const e = i.get(G), n = i.get(Ge), r = i.get(oe), s = i.get($t);
|
|
444
444
|
if (!t) return !1;
|
|
445
|
-
const o = t.drawings, a = o.map((v) => v.unitId), c = r.getBatchAddOp(o), { unitId: u, subUnitId: d, undo: l, redo: g, objects: h } = c, f = s.onCommandExecute({ id:
|
|
446
|
-
return
|
|
445
|
+
const o = t.drawings, a = o.map((v) => v.unitId), c = r.getBatchAddOp(o), { unitId: u, subUnitId: d, undo: l, redo: g, objects: h } = c, f = s.onCommandExecute({ id: xt.id, params: t }), p = { id: U.id, params: { op: g, unitId: u, subUnitId: d, objects: h, type: P.INSERT } }, m = { id: U.id, params: { op: l, unitId: u, subUnitId: d, objects: h, type: P.REMOVE } };
|
|
446
|
+
return Vn([...(S = f.preRedos) != null ? S : [], p, ...f.redos], e) ? (n.pushUndoRedo({
|
|
447
447
|
unitID: u,
|
|
448
448
|
undoMutations: [
|
|
449
449
|
...(C = f.preUndos) != null ? C : [],
|
|
@@ -459,7 +459,7 @@ const br = {
|
|
|
459
459
|
]
|
|
460
460
|
}), !0) : !1;
|
|
461
461
|
}
|
|
462
|
-
},
|
|
462
|
+
}, Dr = {
|
|
463
463
|
id: "sheet.command.set-drawing-arrange",
|
|
464
464
|
type: J.COMMAND,
|
|
465
465
|
handler: (i, t) => {
|
|
@@ -467,7 +467,7 @@ const br = {
|
|
|
467
467
|
if (!t) return !1;
|
|
468
468
|
const r = i.get(oe), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: c } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
|
|
469
469
|
let d;
|
|
470
|
-
if (c ===
|
|
470
|
+
if (c === wt.forward ? d = r.getForwardDrawingsOp(u) : c === wt.backward ? d = r.getBackwardDrawingOp(u) : c === wt.front ? d = r.getFrontDrawingsOp(u) : c === wt.back && (d = r.getBackDrawingsOp(u)), d == null)
|
|
471
471
|
return !1;
|
|
472
472
|
const { objects: l, redo: g, undo: h } = d;
|
|
473
473
|
return e.syncExecuteCommand(U.id, { op: g, unitId: s, subUnitId: o, objects: l, type: P.ARRANGE }) ? (n.pushUndoRedo({
|
|
@@ -480,7 +480,7 @@ const br = {
|
|
|
480
480
|
]
|
|
481
481
|
}), !0) : !1;
|
|
482
482
|
}
|
|
483
|
-
},
|
|
483
|
+
}, Lt = {
|
|
484
484
|
id: "sheet.command.set-sheet-image",
|
|
485
485
|
type: J.COMMAND,
|
|
486
486
|
handler: (i, t) => {
|
|
@@ -499,7 +499,7 @@ const br = {
|
|
|
499
499
|
]
|
|
500
500
|
}), !0) : !1;
|
|
501
501
|
}
|
|
502
|
-
},
|
|
502
|
+
}, br = {
|
|
503
503
|
id: "sheet.command.ungroup-sheet-image",
|
|
504
504
|
type: J.COMMAND,
|
|
505
505
|
handler: (i, t) => {
|
|
@@ -534,21 +534,21 @@ function Ts(i, t, e) {
|
|
|
534
534
|
const n = e * Math.PI / 180, r = Math.abs(i * Math.cos(n)) + Math.abs(t * Math.sin(n)), s = Math.abs(i * Math.sin(n)) + Math.abs(t * Math.cos(n));
|
|
535
535
|
return { rotatedWidth: r, rotatedHeight: s };
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function an(i, t, e, n, r) {
|
|
538
538
|
var S;
|
|
539
539
|
const { rotatedHeight: s, rotatedWidth: o } = Ts(e, n, r), c = i.get(q).getRenderById(t.unitId);
|
|
540
540
|
if (!c)
|
|
541
541
|
return !1;
|
|
542
|
-
const d = (S = c.with(
|
|
542
|
+
const d = (S = c.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : S.skeleton;
|
|
543
543
|
if (d == null)
|
|
544
544
|
return !1;
|
|
545
|
-
const l = d.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(g, h * f)) / o,
|
|
545
|
+
const l = d.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(g, h * f)) / o, _ = !m || Number.isNaN(m) ? 1e-3 : m;
|
|
546
546
|
return {
|
|
547
|
-
width: e *
|
|
548
|
-
height: n *
|
|
547
|
+
width: e * _,
|
|
548
|
+
height: n * _
|
|
549
549
|
};
|
|
550
550
|
}
|
|
551
|
-
let
|
|
551
|
+
let tt = class extends ie {
|
|
552
552
|
constructor(t, e, n, r, s, o, a, c, u, d, l, g, h) {
|
|
553
553
|
super();
|
|
554
554
|
te(this, "_workbookSelections");
|
|
@@ -557,17 +557,17 @@ let nt = class extends ie {
|
|
|
557
557
|
async insertFloatImage() {
|
|
558
558
|
const t = await this._fileOpenerService.openFile({
|
|
559
559
|
multiple: !0,
|
|
560
|
-
accept:
|
|
560
|
+
accept: yn.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
561
561
|
}), e = t.length;
|
|
562
|
-
return e >
|
|
563
|
-
type:
|
|
564
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
562
|
+
return e > Mn ? (this._messageService.show({
|
|
563
|
+
type: De.Error,
|
|
564
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(Mn))
|
|
565
565
|
}), !1) : e === 0 ? !1 : (t.forEach(async (n) => await this.insertFloatImageByFile(n)), !0);
|
|
566
566
|
}
|
|
567
567
|
async insertCellImage() {
|
|
568
568
|
const e = (await this._fileOpenerService.openFile({
|
|
569
569
|
multiple: !1,
|
|
570
|
-
accept:
|
|
570
|
+
accept: yn.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
571
571
|
}))[0];
|
|
572
572
|
return e ? (await this._insertCellImage(e), !0) : !1;
|
|
573
573
|
}
|
|
@@ -581,70 +581,70 @@ let nt = class extends ie {
|
|
|
581
581
|
} catch (S) {
|
|
582
582
|
const C = S.message;
|
|
583
583
|
C === Ne.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
584
|
-
type:
|
|
585
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
584
|
+
type: De.Error,
|
|
585
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(En / (1024 * 1024)))
|
|
586
586
|
}) : C === Ne.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
587
|
-
type:
|
|
587
|
+
type: De.Error,
|
|
588
588
|
content: this._localeService.t("update-status.invalidImageType")
|
|
589
589
|
}) : C === Ne.ERROR_IMAGE && this._messageService.show({
|
|
590
|
-
type:
|
|
590
|
+
type: De.Error,
|
|
591
591
|
content: this._localeService.t("update-status.invalidImage")
|
|
592
592
|
});
|
|
593
593
|
}
|
|
594
594
|
if (e == null)
|
|
595
595
|
return;
|
|
596
|
-
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: c, base64Cache: u } = e, { width: d, height: l, image: g } = await
|
|
596
|
+
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: c, base64Cache: u } = e, { width: d, height: l, image: g } = await Vt(u || ""), { width: h, height: f } = this._context.scene;
|
|
597
597
|
this._imageIoService.addImageSourceCache(c, a, g);
|
|
598
598
|
let p = 1;
|
|
599
|
-
if (d >
|
|
600
|
-
const S =
|
|
599
|
+
if (d > Tn || l > On) {
|
|
600
|
+
const S = Tn / d, C = On / l;
|
|
601
601
|
p = Math.max(S, C);
|
|
602
602
|
}
|
|
603
603
|
const m = this._getImagePosition(d * p, l * p, h, f);
|
|
604
604
|
if (m == null)
|
|
605
605
|
return;
|
|
606
|
-
const
|
|
606
|
+
const _ = {
|
|
607
607
|
unitId: r,
|
|
608
608
|
subUnitId: s,
|
|
609
609
|
drawingId: o,
|
|
610
610
|
drawingType: W.DRAWING_IMAGE,
|
|
611
611
|
imageSourceType: a,
|
|
612
612
|
source: c,
|
|
613
|
-
transform:
|
|
613
|
+
transform: z(m, this._selectionRenderService, this._skeletonManagerService),
|
|
614
614
|
sheetTransform: m
|
|
615
615
|
};
|
|
616
|
-
return this._commandService.executeCommand(
|
|
616
|
+
return this._commandService.executeCommand(xt.id, {
|
|
617
617
|
unitId: r,
|
|
618
|
-
drawings: [
|
|
618
|
+
drawings: [_]
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
621
|
// eslint-disable-next-line max-lines-per-function
|
|
622
622
|
async _insertCellImage(t, e) {
|
|
623
|
-
var
|
|
623
|
+
var _, S;
|
|
624
624
|
let n;
|
|
625
625
|
try {
|
|
626
626
|
n = await this._imageIoService.saveImage(t);
|
|
627
627
|
} catch (C) {
|
|
628
628
|
const b = C.message;
|
|
629
629
|
b === Ne.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
630
|
-
type:
|
|
631
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
630
|
+
type: De.Error,
|
|
631
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(En / (1024 * 1024)))
|
|
632
632
|
}) : b === Ne.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
633
|
-
type:
|
|
633
|
+
type: De.Error,
|
|
634
634
|
content: this._localeService.t("update-status.invalidImageType")
|
|
635
635
|
}) : b === Ne.ERROR_IMAGE && this._messageService.show({
|
|
636
|
-
type:
|
|
636
|
+
type: De.Error,
|
|
637
637
|
content: this._localeService.t("update-status.invalidImage")
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
640
|
if (n == null)
|
|
641
641
|
return !1;
|
|
642
|
-
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: c, height: u, image: d } = await
|
|
642
|
+
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: c, height: u, image: d } = await Vt(a || "");
|
|
643
643
|
this._imageIoService.addImageSourceCache(o, s, d);
|
|
644
644
|
const l = this._workbookSelections.getCurrentLastSelection();
|
|
645
645
|
if (!l)
|
|
646
646
|
return !1;
|
|
647
|
-
const g =
|
|
647
|
+
const g = Jt("", {}), h = an(
|
|
648
648
|
this._injector,
|
|
649
649
|
{
|
|
650
650
|
unitId: this._context.unitId,
|
|
@@ -664,11 +664,11 @@ let nt = class extends ie {
|
|
|
664
664
|
height: h.height
|
|
665
665
|
},
|
|
666
666
|
positionH: {
|
|
667
|
-
relativeFrom:
|
|
667
|
+
relativeFrom: In.PAGE,
|
|
668
668
|
posOffset: 0
|
|
669
669
|
},
|
|
670
670
|
positionV: {
|
|
671
|
-
relativeFrom:
|
|
671
|
+
relativeFrom: Sn.PARAGRAPH,
|
|
672
672
|
posOffset: 0
|
|
673
673
|
},
|
|
674
674
|
angle: 0
|
|
@@ -679,19 +679,19 @@ let nt = class extends ie {
|
|
|
679
679
|
drawingType: W.DRAWING_IMAGE,
|
|
680
680
|
imageSourceType: s,
|
|
681
681
|
source: o,
|
|
682
|
-
transform:
|
|
682
|
+
transform: Fn(f),
|
|
683
683
|
docTransform: f,
|
|
684
|
-
behindDoc:
|
|
684
|
+
behindDoc: bn.FALSE,
|
|
685
685
|
title: "",
|
|
686
686
|
description: "",
|
|
687
|
-
layoutType:
|
|
687
|
+
layoutType: Dn.INLINE,
|
|
688
688
|
// Insert inline drawing by default.
|
|
689
|
-
wrapText:
|
|
689
|
+
wrapText: Cn.BOTH_SIDES,
|
|
690
690
|
distB: 0,
|
|
691
691
|
distL: 0,
|
|
692
692
|
distR: 0,
|
|
693
693
|
distT: 0
|
|
694
|
-
}, m =
|
|
694
|
+
}, m = qt.drawing.add({
|
|
695
695
|
documentDataModel: g,
|
|
696
696
|
drawings: [p],
|
|
697
697
|
selection: {
|
|
@@ -700,9 +700,9 @@ let nt = class extends ie {
|
|
|
700
700
|
endOffset: 0
|
|
701
701
|
}
|
|
702
702
|
});
|
|
703
|
-
return m ? (g.apply(m), this._commandService.syncExecuteCommand(
|
|
703
|
+
return m ? (g.apply(m), this._commandService.syncExecuteCommand($n.id, {
|
|
704
704
|
value: {
|
|
705
|
-
[(
|
|
705
|
+
[(_ = e == null ? void 0 : e.row) != null ? _ : l.primary.actualRow]: {
|
|
706
706
|
[(S = e == null ? void 0 : e.col) != null ? S : l.primary.actualColumn]: {
|
|
707
707
|
p: g.getSnapshot(),
|
|
708
708
|
t: 1
|
|
@@ -716,12 +716,12 @@ let nt = class extends ie {
|
|
|
716
716
|
// eslint-disable-next-line max-lines-per-function
|
|
717
717
|
async insertCellImageByUrl(t, e) {
|
|
718
718
|
var g, h;
|
|
719
|
-
const { width: n, height: r, image: s } = await
|
|
720
|
-
this._imageIoService.addImageSourceCache(t,
|
|
719
|
+
const { width: n, height: r, image: s } = await Vt(t || "");
|
|
720
|
+
this._imageIoService.addImageSourceCache(t, Rn.URL, s);
|
|
721
721
|
const o = this._workbookSelections.getCurrentLastSelection();
|
|
722
722
|
if (!o)
|
|
723
723
|
return !1;
|
|
724
|
-
const a =
|
|
724
|
+
const a = Jt("", {}), c = an(
|
|
725
725
|
this._injector,
|
|
726
726
|
{
|
|
727
727
|
unitId: this._context.unitId,
|
|
@@ -741,34 +741,34 @@ let nt = class extends ie {
|
|
|
741
741
|
height: c.height
|
|
742
742
|
},
|
|
743
743
|
positionH: {
|
|
744
|
-
relativeFrom:
|
|
744
|
+
relativeFrom: In.PAGE,
|
|
745
745
|
posOffset: 0
|
|
746
746
|
},
|
|
747
747
|
positionV: {
|
|
748
|
-
relativeFrom:
|
|
748
|
+
relativeFrom: Sn.PARAGRAPH,
|
|
749
749
|
posOffset: 0
|
|
750
750
|
},
|
|
751
751
|
angle: 0
|
|
752
752
|
}, d = {
|
|
753
753
|
unitId: a.getUnitId(),
|
|
754
754
|
subUnitId: a.getUnitId(),
|
|
755
|
-
drawingId:
|
|
755
|
+
drawingId: Mt(),
|
|
756
756
|
drawingType: W.DRAWING_IMAGE,
|
|
757
|
-
imageSourceType:
|
|
757
|
+
imageSourceType: Rn.URL,
|
|
758
758
|
source: t,
|
|
759
|
-
transform:
|
|
759
|
+
transform: Fn(u),
|
|
760
760
|
docTransform: u,
|
|
761
|
-
behindDoc:
|
|
761
|
+
behindDoc: bn.FALSE,
|
|
762
762
|
title: "",
|
|
763
763
|
description: "",
|
|
764
|
-
layoutType:
|
|
764
|
+
layoutType: Dn.INLINE,
|
|
765
765
|
// Insert inline drawing by default.
|
|
766
|
-
wrapText:
|
|
766
|
+
wrapText: Cn.BOTH_SIDES,
|
|
767
767
|
distB: 0,
|
|
768
768
|
distL: 0,
|
|
769
769
|
distR: 0,
|
|
770
770
|
distT: 0
|
|
771
|
-
}, l =
|
|
771
|
+
}, l = qt.drawing.add({
|
|
772
772
|
documentDataModel: a,
|
|
773
773
|
drawings: [d],
|
|
774
774
|
selection: {
|
|
@@ -777,7 +777,7 @@ let nt = class extends ie {
|
|
|
777
777
|
endOffset: 0
|
|
778
778
|
}
|
|
779
779
|
});
|
|
780
|
-
return l ? (a.apply(l), this._commandService.syncExecuteCommand(
|
|
780
|
+
return l ? (a.apply(l), this._commandService.syncExecuteCommand($n.id, {
|
|
781
781
|
value: {
|
|
782
782
|
[(g = e == null ? void 0 : e.row) != null ? g : o.primary.actualRow]: {
|
|
783
783
|
[(h = e == null ? void 0 : e.col) != null ? h : o.primary.actualColumn]: {
|
|
@@ -806,7 +806,7 @@ let nt = class extends ie {
|
|
|
806
806
|
endColumn: 0
|
|
807
807
|
};
|
|
808
808
|
s && s.length > 0 && (o = s[s.length - 1].range);
|
|
809
|
-
const a =
|
|
809
|
+
const a = Jn(this._skeletonManagerService.getCurrent().skeleton, o);
|
|
810
810
|
if (a == null)
|
|
811
811
|
return;
|
|
812
812
|
let { startColumn: c, startRow: u, startX: d, startY: l } = a, g = !1;
|
|
@@ -838,7 +838,7 @@ let nt = class extends ie {
|
|
|
838
838
|
_updateOrderListener() {
|
|
839
839
|
this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((t) => {
|
|
840
840
|
const { unitId: e, subUnitId: n, drawingIds: r, arrangeType: s } = t;
|
|
841
|
-
this._commandService.executeCommand(
|
|
841
|
+
this._commandService.executeCommand(Dr.id, {
|
|
842
842
|
unitId: e,
|
|
843
843
|
subUnitId: n,
|
|
844
844
|
drawingIds: r,
|
|
@@ -861,11 +861,11 @@ let nt = class extends ie {
|
|
|
861
861
|
return;
|
|
862
862
|
const l = {
|
|
863
863
|
...n,
|
|
864
|
-
transform: { ...u.transform, ...c, ...
|
|
864
|
+
transform: { ...u.transform, ...c, ...z(d, this._selectionRenderService, this._skeletonManagerService) },
|
|
865
865
|
sheetTransform: { ...d }
|
|
866
866
|
};
|
|
867
867
|
e.push(l);
|
|
868
|
-
}), e.length > 0 && this._commandService.executeCommand(
|
|
868
|
+
}), e.length > 0 && this._commandService.executeCommand(Lt.id, {
|
|
869
869
|
unitId: t[0].unitId,
|
|
870
870
|
drawings: e
|
|
871
871
|
}));
|
|
@@ -873,44 +873,44 @@ let nt = class extends ie {
|
|
|
873
873
|
}
|
|
874
874
|
_groupDrawingListener() {
|
|
875
875
|
this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((t) => {
|
|
876
|
-
this._commandService.executeCommand(
|
|
876
|
+
this._commandService.executeCommand(Cr.id, t);
|
|
877
877
|
const { unitId: e, subUnitId: n, drawingId: r } = t[0].parent;
|
|
878
|
-
this._commandService.syncExecuteCommand(
|
|
878
|
+
this._commandService.syncExecuteCommand(jt.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
|
|
879
879
|
})), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((t) => {
|
|
880
|
-
this._commandService.executeCommand(
|
|
880
|
+
this._commandService.executeCommand(br.id, t);
|
|
881
881
|
}));
|
|
882
882
|
}
|
|
883
883
|
_focusDrawingListener() {
|
|
884
884
|
this.disposeWithMe(
|
|
885
885
|
this._drawingManagerService.focus$.subscribe((t) => {
|
|
886
|
-
t == null || t.length === 0 ? (this._contextService.setContextValue(
|
|
886
|
+
t == null || t.length === 0 ? (this._contextService.setContextValue(Fe, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(Fe, !0), this._sheetDrawingService.focusDrawing(t));
|
|
887
887
|
})
|
|
888
888
|
);
|
|
889
889
|
}
|
|
890
890
|
};
|
|
891
|
-
|
|
892
|
-
ne(1, A(
|
|
891
|
+
tt = Es([
|
|
892
|
+
ne(1, A(V)),
|
|
893
893
|
ne(2, G),
|
|
894
|
-
ne(3,
|
|
895
|
-
ne(4,
|
|
896
|
-
ne(5,
|
|
894
|
+
ne(3, Ve),
|
|
895
|
+
ne(4, zn),
|
|
896
|
+
ne(5, Ni),
|
|
897
897
|
ne(6, oe),
|
|
898
898
|
ne(7, se),
|
|
899
|
-
ne(8,
|
|
900
|
-
ne(9,
|
|
901
|
-
ne(10, A(
|
|
902
|
-
ne(11, A(
|
|
903
|
-
ne(12, A(
|
|
904
|
-
],
|
|
899
|
+
ne(8, Hn),
|
|
900
|
+
ne(9, ki),
|
|
901
|
+
ne(10, A(rt)),
|
|
902
|
+
ne(11, A(hn)),
|
|
903
|
+
ne(12, A(Xe))
|
|
904
|
+
], tt);
|
|
905
905
|
var Os = Object.getOwnPropertyDescriptor, Ps = (i, t, e, n) => {
|
|
906
906
|
for (var r = n > 1 ? void 0 : n ? Os(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
907
907
|
(o = i[s]) && (r = o(r) || r);
|
|
908
908
|
return r;
|
|
909
909
|
}, We = (i, t) => (e, n) => t(e, n, i);
|
|
910
|
-
function
|
|
910
|
+
function Rr(i, t, e) {
|
|
911
911
|
var n, r, s, o;
|
|
912
912
|
if (((r = (n = e == null ? void 0 : e.p) == null ? void 0 : n.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = e.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
|
|
913
|
-
const a = e.p.drawings[e.p.drawingsOrder[0]], c =
|
|
913
|
+
const a = e.p.drawings[e.p.drawingsOrder[0]], c = an(
|
|
914
914
|
i,
|
|
915
915
|
{
|
|
916
916
|
unitId: t.unitId,
|
|
@@ -927,47 +927,47 @@ function Mr(i, t, e) {
|
|
|
927
927
|
}
|
|
928
928
|
return !1;
|
|
929
929
|
}
|
|
930
|
-
let
|
|
930
|
+
let Ot = class extends ie {
|
|
931
931
|
constructor(i, t, e, n, r, s) {
|
|
932
932
|
super(), this._commandService = i, this._sheetInterceptorService = t, this._injector = e, this._drawingManagerService = n, this._docDrawingController = r, this._editorBridgeService = s, this._handleInitEditor(), this._initCellContentInterceptor();
|
|
933
933
|
}
|
|
934
934
|
_handleInitEditor() {
|
|
935
935
|
this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
|
|
936
|
-
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(
|
|
936
|
+
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(et), this._docDrawingController.loadDrawingDataForUnit(et), this._drawingManagerService.initializeNotification(et)) : this._drawingManagerService.removeDrawingDataForUnit(et);
|
|
937
937
|
})), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
938
|
-
i.id === cs.id && i.params.unitId ===
|
|
938
|
+
i.id === cs.id && i.params.unitId === xe && (this._drawingManagerService.removeDrawingDataForUnit(xe), this._docDrawingController.loadDrawingDataForUnit(xe), this._drawingManagerService.initializeNotification(xe));
|
|
939
939
|
}));
|
|
940
940
|
}
|
|
941
941
|
_initCellContentInterceptor() {
|
|
942
942
|
this.disposeWithMe(
|
|
943
943
|
this._sheetInterceptorService.intercept(
|
|
944
|
-
|
|
944
|
+
Vi.CELL_CONTENT,
|
|
945
945
|
{
|
|
946
|
-
effect:
|
|
947
|
-
priority:
|
|
946
|
+
effect: Fr.Style,
|
|
947
|
+
priority: Hi.CELL_IMAGE,
|
|
948
948
|
handler: (i, t, e) => {
|
|
949
949
|
var n;
|
|
950
|
-
return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 },
|
|
950
|
+
return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, Rr(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
)
|
|
954
954
|
);
|
|
955
955
|
}
|
|
956
956
|
};
|
|
957
|
-
|
|
957
|
+
Ot = Ps([
|
|
958
958
|
We(0, G),
|
|
959
|
-
We(1, A(
|
|
960
|
-
We(2, A(
|
|
959
|
+
We(1, A($t)),
|
|
960
|
+
We(2, A(Xe)),
|
|
961
961
|
We(3, se),
|
|
962
|
-
We(4, A(
|
|
963
|
-
We(5, A(
|
|
964
|
-
],
|
|
962
|
+
We(4, A(oi)),
|
|
963
|
+
We(5, A(Di))
|
|
964
|
+
], Ot);
|
|
965
965
|
var Us = Object.getOwnPropertyDescriptor, As = (i, t, e, n) => {
|
|
966
966
|
for (var r = n > 1 ? void 0 : n ? Us(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
967
967
|
(o = i[s]) && (r = o(r) || r);
|
|
968
968
|
return r;
|
|
969
|
-
},
|
|
970
|
-
let
|
|
969
|
+
}, Gn = (i, t) => (e, n) => t(e, n, i);
|
|
970
|
+
let Pt = class extends ie {
|
|
971
971
|
constructor(i, t) {
|
|
972
972
|
super(), this._autoFillService = i, this._injector = t, this._initAutoFillHooks();
|
|
973
973
|
}
|
|
@@ -976,35 +976,35 @@ let Ut = class extends ie {
|
|
|
976
976
|
this._autoFillService.addHook({
|
|
977
977
|
id: "sheet-cell-image-autofill",
|
|
978
978
|
onBeforeSubmit: (i, t, e, n) => {
|
|
979
|
-
new
|
|
980
|
-
|
|
979
|
+
new Yr(n).forValue((r, s, o) => {
|
|
980
|
+
Rr(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
|
|
981
981
|
});
|
|
982
982
|
}
|
|
983
983
|
})
|
|
984
984
|
);
|
|
985
985
|
}
|
|
986
986
|
};
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
],
|
|
987
|
+
Pt = As([
|
|
988
|
+
Gn(0, A(bi)),
|
|
989
|
+
Gn(1, A(Xe))
|
|
990
|
+
], Pt);
|
|
991
991
|
var Ns = Object.getOwnPropertyDescriptor, ks = (i, t, e, n) => {
|
|
992
992
|
for (var r = n > 1 ? void 0 : n ? Ns(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
993
993
|
(o = i[s]) && (r = o(r) || r);
|
|
994
994
|
return r;
|
|
995
|
-
},
|
|
995
|
+
}, Ze = (i, t) => (e, n) => t(e, n, i);
|
|
996
996
|
const Bs = [
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
997
|
+
et,
|
|
998
|
+
Gr,
|
|
999
|
+
xe
|
|
1000
1000
|
];
|
|
1001
|
-
let
|
|
1001
|
+
let Ut = class extends ie {
|
|
1002
1002
|
constructor(i, t, e, n, r) {
|
|
1003
1003
|
super(), this._commandService = i, this._univerInstanceService = t, this._dialogService = e, this._renderManagerService = n, this._localeService = r, this._initDocImageCopyPasteHooks();
|
|
1004
1004
|
}
|
|
1005
1005
|
_setCellImage(i) {
|
|
1006
1006
|
var r;
|
|
1007
|
-
const t =
|
|
1007
|
+
const t = Jt("", {}), e = (r = dn(L.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(Ri), n = qt.drawing.add({
|
|
1008
1008
|
documentDataModel: t,
|
|
1009
1009
|
drawings: [i],
|
|
1010
1010
|
selection: {
|
|
@@ -1025,14 +1025,14 @@ let At = class extends ie {
|
|
|
1025
1025
|
return;
|
|
1026
1026
|
const o = s.getUnitId();
|
|
1027
1027
|
if (Bs.includes(o)) {
|
|
1028
|
-
if (o !==
|
|
1028
|
+
if (o !== xe) {
|
|
1029
1029
|
const a = () => {
|
|
1030
|
-
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(
|
|
1030
|
+
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(Un.id, {
|
|
1031
1031
|
visible: !1
|
|
1032
1032
|
});
|
|
1033
1033
|
};
|
|
1034
1034
|
((e = s.getBody()) == null ? void 0 : e.dataStream) === `\r
|
|
1035
|
-
` ? (this._commandService.syncExecuteCommand(
|
|
1035
|
+
` ? (this._commandService.syncExecuteCommand(Un.id, {
|
|
1036
1036
|
visible: !1
|
|
1037
1037
|
}), this._setCellImage(Object.values(r.drawings)[0])) : this._dialogService.open({
|
|
1038
1038
|
id: "sheet-cell-image-copy-paste",
|
|
@@ -1060,23 +1060,23 @@ let At = class extends ie {
|
|
|
1060
1060
|
);
|
|
1061
1061
|
}
|
|
1062
1062
|
};
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
],
|
|
1070
|
-
const
|
|
1063
|
+
Ut = ks([
|
|
1064
|
+
Ze(0, G),
|
|
1065
|
+
Ze(1, Se),
|
|
1066
|
+
Ze(2, Bi),
|
|
1067
|
+
Ze(3, q),
|
|
1068
|
+
Ze(4, A(rt))
|
|
1069
|
+
], Ut);
|
|
1070
|
+
const Ft = {
|
|
1071
1071
|
id: "sheet.command.insert-float-image",
|
|
1072
1072
|
type: J.COMMAND,
|
|
1073
1073
|
handler: async (i, t) => {
|
|
1074
1074
|
var o, a;
|
|
1075
|
-
const e = i.get(
|
|
1075
|
+
const e = i.get(Se), n = i.get(q), r = (o = dn(
|
|
1076
1076
|
L.UNIVER_SHEET,
|
|
1077
1077
|
e,
|
|
1078
1078
|
n
|
|
1079
|
-
)) == null ? void 0 : o.with(
|
|
1079
|
+
)) == null ? void 0 : o.with(tt);
|
|
1080
1080
|
if (!r)
|
|
1081
1081
|
return !1;
|
|
1082
1082
|
const s = t == null ? void 0 : t.files;
|
|
@@ -1086,33 +1086,33 @@ const Yt = {
|
|
|
1086
1086
|
} else
|
|
1087
1087
|
return (a = r.insertFloatImage()) != null ? a : !1;
|
|
1088
1088
|
}
|
|
1089
|
-
},
|
|
1089
|
+
}, mn = {
|
|
1090
1090
|
id: "sheet.command.insert-cell-image",
|
|
1091
1091
|
type: J.COMMAND,
|
|
1092
1092
|
handler: (i) => {
|
|
1093
1093
|
var n, r;
|
|
1094
|
-
const t = i.get(
|
|
1095
|
-
return (r = (n =
|
|
1094
|
+
const t = i.get(Se), e = i.get(q);
|
|
1095
|
+
return (r = (n = dn(
|
|
1096
1096
|
L.UNIVER_SHEET,
|
|
1097
1097
|
t,
|
|
1098
1098
|
e
|
|
1099
|
-
)) == null ? void 0 : n.with(
|
|
1099
|
+
)) == null ? void 0 : n.with(tt).insertCellImage()) != null ? r : !1;
|
|
1100
1100
|
}
|
|
1101
1101
|
};
|
|
1102
1102
|
var Ws = Object.getOwnPropertyDescriptor, js = (i, t, e, n) => {
|
|
1103
1103
|
for (var r = n > 1 ? void 0 : n ? Ws(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1104
1104
|
(o = i[s]) && (r = o(r) || r);
|
|
1105
1105
|
return r;
|
|
1106
|
-
},
|
|
1107
|
-
const
|
|
1106
|
+
}, Je = (i, t) => (e, n) => t(e, n, i);
|
|
1107
|
+
const yr = "image/png";
|
|
1108
1108
|
function $s(i) {
|
|
1109
1109
|
const t = i.split(","), e = atob(t[1]), n = e.length, r = new Uint8Array(n);
|
|
1110
1110
|
for (let s = 0; s < n; s++)
|
|
1111
1111
|
r[s] = e.charCodeAt(s);
|
|
1112
|
-
return new Blob([r], { type:
|
|
1112
|
+
return new Blob([r], { type: yr });
|
|
1113
1113
|
}
|
|
1114
1114
|
function xs(i) {
|
|
1115
|
-
const t = new ClipboardItem({ [
|
|
1115
|
+
const t = new ClipboardItem({ [yr]: $s(i) });
|
|
1116
1116
|
navigator.clipboard.write([t]).catch((e) => {
|
|
1117
1117
|
console.error("Could not copy image using clipboard API: ", e);
|
|
1118
1118
|
});
|
|
@@ -1127,13 +1127,13 @@ function Ls() {
|
|
|
1127
1127
|
e.blur(), document.body.removeChild(e), t instanceof HTMLElement && t.focus();
|
|
1128
1128
|
};
|
|
1129
1129
|
}
|
|
1130
|
-
const
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1130
|
+
const Xn = [
|
|
1131
|
+
Le.SPECIAL_PASTE_COL_WIDTH,
|
|
1132
|
+
Le.SPECIAL_PASTE_VALUE,
|
|
1133
|
+
Le.SPECIAL_PASTE_FORMAT,
|
|
1134
|
+
Le.SPECIAL_PASTE_FORMULA
|
|
1135
1135
|
];
|
|
1136
|
-
let
|
|
1136
|
+
let At = class extends ie {
|
|
1137
1137
|
constructor(t, e, n, r, s) {
|
|
1138
1138
|
super();
|
|
1139
1139
|
te(this, "_copyInfo");
|
|
@@ -1150,16 +1150,16 @@ let Nt = class extends ie {
|
|
|
1150
1150
|
const s = this._focusedDrawings;
|
|
1151
1151
|
if (s.length > 0) {
|
|
1152
1152
|
const [o] = s;
|
|
1153
|
-
if (r ===
|
|
1153
|
+
if (r === Ce.CUT) {
|
|
1154
1154
|
const c = {
|
|
1155
1155
|
unitId: t,
|
|
1156
1156
|
drawings: [o]
|
|
1157
1157
|
};
|
|
1158
|
-
this._commandService.executeCommand(
|
|
1158
|
+
this._commandService.executeCommand(it.id, c);
|
|
1159
1159
|
}
|
|
1160
1160
|
setTimeout(() => {
|
|
1161
1161
|
const c = Ls();
|
|
1162
|
-
o.drawingType === W.DRAWING_IMAGE && o.imageSourceType ===
|
|
1162
|
+
o.drawingType === W.DRAWING_IMAGE && o.imageSourceType === ci.BASE64 ? xs(o.source) : this._clipboardInterfaceService.writeText(""), c();
|
|
1163
1163
|
}, 200);
|
|
1164
1164
|
const a = {
|
|
1165
1165
|
unitId: o.unitId,
|
|
@@ -1175,14 +1175,14 @@ let Nt = class extends ie {
|
|
|
1175
1175
|
onPasteCells: (t, e, n, r) => {
|
|
1176
1176
|
if (!this._copyInfo)
|
|
1177
1177
|
return { redos: [], undos: [] };
|
|
1178
|
-
const { copyType: s =
|
|
1179
|
-
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: d, pasteRange: c }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o },
|
|
1178
|
+
const { copyType: s = Ce.COPY, pasteType: o } = r, { range: a } = t || {}, { range: c, unitId: u, subUnitId: d } = e;
|
|
1179
|
+
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: d, pasteRange: c }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, Ce.COPY);
|
|
1180
1180
|
},
|
|
1181
1181
|
onPastePlainText: (t, e) => ({ undos: [], redos: [] }),
|
|
1182
|
-
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1182
|
+
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: Le.DEFAULT_PASTE }, Ce.COPY) : { undos: [], redos: [] },
|
|
1183
1183
|
onPasteFiles: (t, e) => {
|
|
1184
1184
|
if (this._copyInfo)
|
|
1185
|
-
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1185
|
+
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: Le.DEFAULT_PASTE }, Ce.COPY);
|
|
1186
1186
|
{
|
|
1187
1187
|
const n = e.filter((r) => r.type.includes("image"));
|
|
1188
1188
|
if (n.length)
|
|
@@ -1190,7 +1190,7 @@ let Nt = class extends ie {
|
|
|
1190
1190
|
undos: [],
|
|
1191
1191
|
redos: [
|
|
1192
1192
|
{
|
|
1193
|
-
id:
|
|
1193
|
+
id: Ft.id,
|
|
1194
1194
|
params: { files: n }
|
|
1195
1195
|
}
|
|
1196
1196
|
]
|
|
@@ -1202,7 +1202,7 @@ let Nt = class extends ie {
|
|
|
1202
1202
|
}
|
|
1203
1203
|
_createDrawingsCopyInfoByRange(t, e, n) {
|
|
1204
1204
|
var g;
|
|
1205
|
-
const r = (g = this._renderManagerService.getRenderById(t)) == null ? void 0 : g.with(
|
|
1205
|
+
const r = (g = this._renderManagerService.getRenderById(t)) == null ? void 0 : g.with(V);
|
|
1206
1206
|
if (!r) return;
|
|
1207
1207
|
const s = r.attachRangeWithCoord(n);
|
|
1208
1208
|
if (!s)
|
|
@@ -1212,13 +1212,13 @@ let Nt = class extends ie {
|
|
|
1212
1212
|
const f = d[h], { transform: p } = f;
|
|
1213
1213
|
if (f.anchorType !== O.Both || !p)
|
|
1214
1214
|
return;
|
|
1215
|
-
const { left: m = 0, top:
|
|
1215
|
+
const { left: m = 0, top: _ = 0, width: S = 0, height: C = 0 } = p, { drawingStartX: b, drawingEndX: v, drawingStartY: D, drawingEndY: w } = {
|
|
1216
1216
|
drawingStartX: m,
|
|
1217
1217
|
drawingEndX: m + S,
|
|
1218
|
-
drawingStartY:
|
|
1219
|
-
drawingEndY:
|
|
1218
|
+
drawingStartY: _,
|
|
1219
|
+
drawingEndY: _ + C
|
|
1220
1220
|
};
|
|
1221
|
-
o <= b && v <= a && c <= D &&
|
|
1221
|
+
o <= b && v <= a && c <= D && w <= u && l.push(f);
|
|
1222
1222
|
}), l.length)
|
|
1223
1223
|
return {
|
|
1224
1224
|
copyRange: n,
|
|
@@ -1229,16 +1229,16 @@ let Nt = class extends ie {
|
|
|
1229
1229
|
}
|
|
1230
1230
|
_generateSingleDrawingPasteMutations(t, e) {
|
|
1231
1231
|
const { pasteType: n, pasteTo: r } = t;
|
|
1232
|
-
if (
|
|
1232
|
+
if (Xn.includes(n))
|
|
1233
1233
|
return { redos: [], undos: [] };
|
|
1234
|
-
const { unitId: s, subUnitId: o, range: a } = r, c = this._renderManagerService.getRenderById(s), u = c == null ? void 0 : c.with(
|
|
1234
|
+
const { unitId: s, subUnitId: o, range: a } = r, c = this._renderManagerService.getRenderById(s), u = c == null ? void 0 : c.with(V), d = c == null ? void 0 : c.with(Ve), l = this._copyInfo;
|
|
1235
1235
|
if (!u || !d)
|
|
1236
1236
|
return { redos: [], undos: [] };
|
|
1237
|
-
const { drawings: g } = l, h =
|
|
1237
|
+
const { drawings: g } = l, h = An(a);
|
|
1238
1238
|
return this._generateMutations(g, {
|
|
1239
1239
|
unitId: s,
|
|
1240
1240
|
subUnitId: o,
|
|
1241
|
-
isCut: e ===
|
|
1241
|
+
isCut: e === Ce.CUT,
|
|
1242
1242
|
getTransform: (f, p) => {
|
|
1243
1243
|
var S;
|
|
1244
1244
|
const m = u.attachRangeWithCoord({
|
|
@@ -1246,14 +1246,14 @@ let Nt = class extends ie {
|
|
|
1246
1246
|
endRow: h.endRow,
|
|
1247
1247
|
startColumn: h.startColumn,
|
|
1248
1248
|
endColumn: h.endColumn
|
|
1249
|
-
}),
|
|
1249
|
+
}), _ = {
|
|
1250
1250
|
...f,
|
|
1251
1251
|
left: m == null ? void 0 : m.startX,
|
|
1252
1252
|
top: m == null ? void 0 : m.startY
|
|
1253
1253
|
};
|
|
1254
1254
|
return {
|
|
1255
|
-
transform:
|
|
1256
|
-
sheetTransform: (S = x(
|
|
1255
|
+
transform: _,
|
|
1256
|
+
sheetTransform: (S = x(_, d)) != null ? S : p
|
|
1257
1257
|
};
|
|
1258
1258
|
}
|
|
1259
1259
|
});
|
|
@@ -1273,12 +1273,12 @@ let Nt = class extends ie {
|
|
|
1273
1273
|
...d,
|
|
1274
1274
|
unitId: n,
|
|
1275
1275
|
subUnitId: r,
|
|
1276
|
-
drawingId: o ? d.drawingId :
|
|
1276
|
+
drawingId: o ? d.drawingId : ye.generateRandomId(),
|
|
1277
1277
|
transform: h.transform,
|
|
1278
1278
|
sheetTransform: h.sheetTransform
|
|
1279
1279
|
};
|
|
1280
1280
|
if (o) {
|
|
1281
|
-
const { undo: p, redo: m, objects:
|
|
1281
|
+
const { undo: p, redo: m, objects: _ } = u.getBatchUpdateOp([f]);
|
|
1282
1282
|
a.push({
|
|
1283
1283
|
id: U.id,
|
|
1284
1284
|
params: {
|
|
@@ -1286,7 +1286,7 @@ let Nt = class extends ie {
|
|
|
1286
1286
|
subUnitId: r,
|
|
1287
1287
|
type: P.UPDATE,
|
|
1288
1288
|
op: m,
|
|
1289
|
-
objects:
|
|
1289
|
+
objects: _
|
|
1290
1290
|
}
|
|
1291
1291
|
}), c.push({
|
|
1292
1292
|
id: U.id,
|
|
@@ -1295,12 +1295,12 @@ let Nt = class extends ie {
|
|
|
1295
1295
|
subUnitId: r,
|
|
1296
1296
|
type: P.UPDATE,
|
|
1297
1297
|
op: p,
|
|
1298
|
-
objects:
|
|
1298
|
+
objects: _
|
|
1299
1299
|
}
|
|
1300
1300
|
});
|
|
1301
1301
|
} else {
|
|
1302
|
-
const { undo: p, redo: m, objects:
|
|
1303
|
-
a.push({ id: U.id, params: { op: m, unitId: n, subUnitId: r, objects:
|
|
1302
|
+
const { undo: p, redo: m, objects: _ } = u.getBatchAddOp([f]);
|
|
1303
|
+
a.push({ id: U.id, params: { op: m, unitId: n, subUnitId: r, objects: _, type: P.INSERT } }), c.push({ id: U.id, params: { op: p, unitId: n, subUnitId: r, objects: _, type: P.REMOVE } });
|
|
1304
1304
|
}
|
|
1305
1305
|
}), { redos: a, undos: c };
|
|
1306
1306
|
}
|
|
@@ -1316,18 +1316,18 @@ let Nt = class extends ie {
|
|
|
1316
1316
|
copyRange: a,
|
|
1317
1317
|
copyType: c
|
|
1318
1318
|
} = e;
|
|
1319
|
-
if (
|
|
1319
|
+
if (Xn.includes(s))
|
|
1320
1320
|
return { redos: [], undos: [] };
|
|
1321
|
-
const u = (M = this._renderManagerService.getRenderById(n)) == null ? void 0 : M.with(
|
|
1321
|
+
const u = (M = this._renderManagerService.getRenderById(n)) == null ? void 0 : M.with(V);
|
|
1322
1322
|
if (!u || !this._copyInfo)
|
|
1323
1323
|
return { redos: [], undos: [] };
|
|
1324
1324
|
const { drawings: d } = this._copyInfo;
|
|
1325
1325
|
if (!a)
|
|
1326
1326
|
return this._generateSingleDrawingPasteMutations({
|
|
1327
|
-
pasteTo: { unitId: n, subUnitId: r, range:
|
|
1327
|
+
pasteTo: { unitId: n, subUnitId: r, range: An(o) },
|
|
1328
1328
|
pasteType: s
|
|
1329
1329
|
}, c);
|
|
1330
|
-
const { ranges: [l, g], mapFunc: h } =
|
|
1330
|
+
const { ranges: [l, g], mapFunc: h } = yi([a, o]), { row: f, col: p } = h(l.startRow, l.startColumn), { row: m, col: _ } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
|
|
1331
1331
|
startRow: f,
|
|
1332
1332
|
endRow: f,
|
|
1333
1333
|
startColumn: p,
|
|
@@ -1335,12 +1335,12 @@ let Nt = class extends ie {
|
|
|
1335
1335
|
}), C = u.attachRangeWithCoord({
|
|
1336
1336
|
startRow: m,
|
|
1337
1337
|
endRow: m,
|
|
1338
|
-
startColumn:
|
|
1339
|
-
endColumn:
|
|
1338
|
+
startColumn: _,
|
|
1339
|
+
endColumn: _
|
|
1340
1340
|
});
|
|
1341
1341
|
if (!S || !C || !this._copyInfo)
|
|
1342
1342
|
return { redos: [], undos: [] };
|
|
1343
|
-
const b = C.startX - S.startX, v = C.startY - S.startY, D = m - f,
|
|
1343
|
+
const b = C.startX - S.startX, v = C.startY - S.startY, D = m - f, w = _ - p;
|
|
1344
1344
|
return this._generateMutations(d, {
|
|
1345
1345
|
unitId: n,
|
|
1346
1346
|
subUnitId: r,
|
|
@@ -1357,53 +1357,53 @@ let Nt = class extends ie {
|
|
|
1357
1357
|
to: {
|
|
1358
1358
|
...E.to,
|
|
1359
1359
|
row: E.to.row + D,
|
|
1360
|
-
column: E.to.column +
|
|
1360
|
+
column: E.to.column + w
|
|
1361
1361
|
},
|
|
1362
1362
|
from: {
|
|
1363
1363
|
...E.from,
|
|
1364
1364
|
row: E.from.row + D,
|
|
1365
|
-
column: E.from.column +
|
|
1365
|
+
column: E.from.column + w
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
1368
|
};
|
|
1369
1369
|
},
|
|
1370
|
-
isCut: c ===
|
|
1370
|
+
isCut: c === Ce.CUT
|
|
1371
1371
|
});
|
|
1372
1372
|
}
|
|
1373
1373
|
};
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
],
|
|
1374
|
+
At = js([
|
|
1375
|
+
Je(0, Mi),
|
|
1376
|
+
Je(1, q),
|
|
1377
|
+
Je(2, se),
|
|
1378
|
+
Je(3, Wi),
|
|
1379
|
+
Je(4, G)
|
|
1380
|
+
], At);
|
|
1381
1381
|
var Fs = Object.getOwnPropertyDescriptor, Ys = (i, t, e, n) => {
|
|
1382
1382
|
for (var r = n > 1 ? void 0 : n ? Fs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1383
1383
|
(o = i[s]) && (r = o(r) || r);
|
|
1384
1384
|
return r;
|
|
1385
|
-
},
|
|
1386
|
-
let
|
|
1385
|
+
}, qe = (i, t) => (e, n) => t(e, n, i);
|
|
1386
|
+
let Nt = class extends ie {
|
|
1387
1387
|
constructor(i, t, e, n, r) {
|
|
1388
1388
|
super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1389
1389
|
}
|
|
1390
1390
|
_initDrawingVisible() {
|
|
1391
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(L.UNIVER_SHEET), t = this._userManagerService.currentUser$, e =
|
|
1391
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(L.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = St([i, t]);
|
|
1392
1392
|
this.disposeWithMe(
|
|
1393
1393
|
e.pipe(
|
|
1394
|
-
|
|
1395
|
-
|
|
1394
|
+
_e(([n, r]) => n ? n.activeSheet$.pipe(
|
|
1395
|
+
Bn((s) => {
|
|
1396
1396
|
if (!s) {
|
|
1397
1397
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1398
1398
|
return;
|
|
1399
1399
|
}
|
|
1400
1400
|
const o = n.getUnitId(), a = s.getSheetId();
|
|
1401
1401
|
this._permissionService.composePermission([
|
|
1402
|
-
new
|
|
1403
|
-
new
|
|
1402
|
+
new xn(o).id,
|
|
1403
|
+
new Ln(o, a).id
|
|
1404
1404
|
]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(n, s);
|
|
1405
1405
|
})
|
|
1406
|
-
) : (this._drawingManagerService.setDrawingVisible(!1),
|
|
1406
|
+
) : (this._drawingManagerService.setDrawingVisible(!1), me))
|
|
1407
1407
|
).subscribe()
|
|
1408
1408
|
);
|
|
1409
1409
|
}
|
|
@@ -1417,22 +1417,22 @@ let kt = class extends ie {
|
|
|
1417
1417
|
});
|
|
1418
1418
|
}
|
|
1419
1419
|
_initDrawingEditable() {
|
|
1420
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(L.UNIVER_SHEET), t = this._userManagerService.currentUser$, e =
|
|
1420
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(L.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = St([i, t]);
|
|
1421
1421
|
this.disposeWithMe(
|
|
1422
1422
|
e.pipe(
|
|
1423
|
-
|
|
1424
|
-
|
|
1423
|
+
_e(([n, r]) => n ? n.activeSheet$.pipe(
|
|
1424
|
+
Bn((s) => {
|
|
1425
1425
|
if (!s) {
|
|
1426
1426
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1427
1427
|
return;
|
|
1428
1428
|
}
|
|
1429
1429
|
const o = n.getUnitId(), a = s.getSheetId();
|
|
1430
1430
|
this._permissionService.composePermission([
|
|
1431
|
-
new
|
|
1432
|
-
new
|
|
1431
|
+
new Qt(o).id,
|
|
1432
|
+
new en(o, a).id
|
|
1433
1433
|
]).every((u) => u.value) ? this._drawingManagerService.setDrawingEditable(!0) : this._handleDrawingEditableFalse(n, s);
|
|
1434
1434
|
})
|
|
1435
|
-
) : (this._drawingManagerService.setDrawingEditable(!1),
|
|
1435
|
+
) : (this._drawingManagerService.setDrawingEditable(!1), me))
|
|
1436
1436
|
).subscribe()
|
|
1437
1437
|
);
|
|
1438
1438
|
}
|
|
@@ -1448,21 +1448,21 @@ let kt = class extends ie {
|
|
|
1448
1448
|
_initViewPermissionChange() {
|
|
1449
1449
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(L.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1450
1450
|
this.disposeWithMe(
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1451
|
+
St([i, t]).pipe(
|
|
1452
|
+
_e(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1453
|
+
_e((r) => {
|
|
1454
1454
|
if (!r)
|
|
1455
|
-
return
|
|
1455
|
+
return me;
|
|
1456
1456
|
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), c = a == null ? void 0 : a.scene;
|
|
1457
1457
|
if (!c)
|
|
1458
|
-
return
|
|
1458
|
+
return me;
|
|
1459
1459
|
const u = c.getTransformerByCreate();
|
|
1460
1460
|
return this._permissionService.composePermission$([
|
|
1461
|
-
new
|
|
1462
|
-
new
|
|
1461
|
+
new xn(s).id,
|
|
1462
|
+
new Ln(s, o).id
|
|
1463
1463
|
]).pipe(
|
|
1464
1464
|
Ee((l) => l.every((g) => g.value)),
|
|
1465
|
-
|
|
1465
|
+
Wn()
|
|
1466
1466
|
).pipe(
|
|
1467
1467
|
Ee((l) => ({
|
|
1468
1468
|
permission: l,
|
|
@@ -1473,7 +1473,7 @@ let kt = class extends ie {
|
|
|
1473
1473
|
}))
|
|
1474
1474
|
);
|
|
1475
1475
|
})
|
|
1476
|
-
) :
|
|
1476
|
+
) : me)
|
|
1477
1477
|
).subscribe({
|
|
1478
1478
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1479
1479
|
this._drawingManagerService.setDrawingVisible(e);
|
|
@@ -1496,21 +1496,21 @@ let kt = class extends ie {
|
|
|
1496
1496
|
_initEditPermissionChange() {
|
|
1497
1497
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(L.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1498
1498
|
this.disposeWithMe(
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1499
|
+
St([i, t]).pipe(
|
|
1500
|
+
_e(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1501
|
+
_e((r) => {
|
|
1502
1502
|
if (!r)
|
|
1503
|
-
return
|
|
1503
|
+
return me;
|
|
1504
1504
|
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), c = a == null ? void 0 : a.scene;
|
|
1505
1505
|
if (!c)
|
|
1506
|
-
return
|
|
1506
|
+
return me;
|
|
1507
1507
|
const u = c.getTransformerByCreate();
|
|
1508
1508
|
return this._permissionService.composePermission$([
|
|
1509
|
-
new
|
|
1510
|
-
new
|
|
1509
|
+
new Qt(s).id,
|
|
1510
|
+
new en(s, o).id
|
|
1511
1511
|
]).pipe(
|
|
1512
1512
|
Ee((l) => l.every((g) => g.value)),
|
|
1513
|
-
|
|
1513
|
+
Wn()
|
|
1514
1514
|
).pipe(
|
|
1515
1515
|
Ee((l) => ({
|
|
1516
1516
|
permission: l,
|
|
@@ -1521,7 +1521,7 @@ let kt = class extends ie {
|
|
|
1521
1521
|
}))
|
|
1522
1522
|
);
|
|
1523
1523
|
})
|
|
1524
|
-
) :
|
|
1524
|
+
) : me)
|
|
1525
1525
|
).subscribe({
|
|
1526
1526
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1527
1527
|
this._drawingManagerService.setDrawingEditable(e);
|
|
@@ -1551,20 +1551,20 @@ let kt = class extends ie {
|
|
|
1551
1551
|
);
|
|
1552
1552
|
}
|
|
1553
1553
|
};
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
],
|
|
1561
|
-
var
|
|
1562
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1554
|
+
Nt = Ys([
|
|
1555
|
+
qe(0, se),
|
|
1556
|
+
qe(1, q),
|
|
1557
|
+
qe(2, Xr),
|
|
1558
|
+
qe(3, Se),
|
|
1559
|
+
qe(4, A(Vr))
|
|
1560
|
+
], Nt);
|
|
1561
|
+
var Gs = Object.getOwnPropertyDescriptor, Xs = (i, t, e, n) => {
|
|
1562
|
+
for (var r = n > 1 ? void 0 : n ? Gs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1563
1563
|
(o = i[s]) && (r = o(r) || r);
|
|
1564
1564
|
return r;
|
|
1565
|
-
},
|
|
1566
|
-
function
|
|
1567
|
-
const { scaleX: o, scaleY: a } = t.getAncestorScale(), c = t.getViewport(
|
|
1565
|
+
}, be = (i, t) => (e, n) => t(e, n, i);
|
|
1566
|
+
function Mr(i, t, e, n, r, s = !1) {
|
|
1567
|
+
const { scaleX: o, scaleY: a } = t.getAncestorScale(), c = t.getViewport(Zn.VIEW_MAIN), u = n.getFreeze(), { startColumn: d, startRow: l, xSplit: g, ySplit: h } = u, f = {
|
|
1568
1568
|
left: !0,
|
|
1569
1569
|
// left means the left of pic is in a viewMainLeft
|
|
1570
1570
|
top: !0
|
|
@@ -1574,32 +1574,32 @@ function Tr(i, t, e, n, r, s = !1) {
|
|
|
1574
1574
|
...i,
|
|
1575
1575
|
absolute: f
|
|
1576
1576
|
};
|
|
1577
|
-
const { left: p, right: m, top:
|
|
1577
|
+
const { left: p, right: m, top: _, bottom: S } = i;
|
|
1578
1578
|
let { top: C, left: b, viewportScrollX: v, viewportScrollY: D } = c;
|
|
1579
|
-
const { boundsOfViewArea:
|
|
1579
|
+
const { boundsOfViewArea: w, scrollDirectionResponse: M } = r || {}, { rowHeaderWidth: I, columnHeaderHeight: E } = e, T = {
|
|
1580
1580
|
top: s ? 0 : E,
|
|
1581
1581
|
left: s ? 0 : I
|
|
1582
1582
|
};
|
|
1583
|
-
|
|
1583
|
+
w && (ye.isDefine(T.top) && (T.top = w.top), ye.isDefine(T.left) && (T.left = w.left)), M === "HORIZONTAL" && (D = 0), M === "VERTICAL" && (v = 0);
|
|
1584
1584
|
let y = 0, R = 0;
|
|
1585
|
-
const N = e.rowStartY(l - h) + E, j = e.colStartX(d - g) + I, Q = e.rowStartY(l) + E,
|
|
1585
|
+
const N = e.rowStartY(l - h) + E, j = e.colStartX(d - g) + I, Q = e.rowStartY(l) + E, H = e.colStartX(d) + I;
|
|
1586
1586
|
if (g === 0)
|
|
1587
1587
|
f.left = !1, y = (p - v) * o, R = (m - v) * o;
|
|
1588
1588
|
else {
|
|
1589
1589
|
const k = p - (j - I), ce = m - (j - I);
|
|
1590
|
-
m <
|
|
1590
|
+
m < H ? (y = k * o, R = ce * o) : p <= H && m >= H ? (y = k * o, R = Math.max(b, (m - v) * o)) : p > H && (f.left = !1, y = Math.max((p - v) * o, b), R = Math.max((m - v) * o, b));
|
|
1591
1591
|
}
|
|
1592
|
-
let
|
|
1592
|
+
let X = 0, Y = 0;
|
|
1593
1593
|
if (h === 0)
|
|
1594
|
-
f.top = !1,
|
|
1594
|
+
f.top = !1, X = (_ - D) * a, Y = (S - D) * a;
|
|
1595
1595
|
else {
|
|
1596
|
-
const k =
|
|
1597
|
-
S < Q ? (
|
|
1596
|
+
const k = _ - (N - E), ce = S - (N - E);
|
|
1597
|
+
S < Q ? (X = k * a, Y = ce * a) : _ <= Q && S >= Q ? (X = k * a, Y = Math.max(C, (S - D) * a)) : _ > Q && (f.top = !1, X = Math.max((_ - D) * a, C), Y = Math.max((S - D) * a, C));
|
|
1598
1598
|
}
|
|
1599
|
-
return y = Math.max(y, T.left),
|
|
1599
|
+
return y = Math.max(y, T.left), X = Math.max(X, T.top), R = Math.max(R, T.left), Y = Math.max(Y, T.top), {
|
|
1600
1600
|
left: y,
|
|
1601
1601
|
right: R,
|
|
1602
|
-
top:
|
|
1602
|
+
top: X,
|
|
1603
1603
|
bottom: Y,
|
|
1604
1604
|
absolute: f
|
|
1605
1605
|
};
|
|
@@ -1610,7 +1610,7 @@ const ge = (i, t, e, n, r) => {
|
|
|
1610
1610
|
right: s + a,
|
|
1611
1611
|
top: o,
|
|
1612
1612
|
bottom: o + c
|
|
1613
|
-
}, l =
|
|
1613
|
+
}, l = Mr(d, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
|
|
1614
1614
|
return {
|
|
1615
1615
|
startX: l.left,
|
|
1616
1616
|
endX: l.right,
|
|
@@ -1622,23 +1622,23 @@ const ge = (i, t, e, n, r) => {
|
|
|
1622
1622
|
absolute: l.absolute
|
|
1623
1623
|
};
|
|
1624
1624
|
};
|
|
1625
|
-
let
|
|
1625
|
+
let nt = class extends ie {
|
|
1626
1626
|
constructor(t, e, n, r, s, o, a) {
|
|
1627
1627
|
super();
|
|
1628
1628
|
/**
|
|
1629
1629
|
* for update dom container position when scrolling and zoom
|
|
1630
1630
|
*/
|
|
1631
1631
|
te(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
1632
|
-
te(this, "_transformChange$", new
|
|
1632
|
+
te(this, "_transformChange$", new zt());
|
|
1633
1633
|
te(this, "transformChange$", this._transformChange$.asObservable());
|
|
1634
|
-
te(this, "_add$", new
|
|
1634
|
+
te(this, "_add$", new zt());
|
|
1635
1635
|
te(this, "add$", this._add$.asObservable());
|
|
1636
|
-
te(this, "_remove$", new
|
|
1636
|
+
te(this, "_remove$", new zt());
|
|
1637
1637
|
te(this, "remove$", this._remove$.asObservable());
|
|
1638
1638
|
this._renderManagerService = t, this._univerInstanceService = e, this._commandService = n, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
1639
1639
|
}
|
|
1640
1640
|
_bindScrollEvent() {
|
|
1641
|
-
this._lifecycleService.lifecycle$.pipe(Gi((t) => t ===
|
|
1641
|
+
this._lifecycleService.lifecycle$.pipe(Gi((t) => t === zr.Rendered), Xi(1)).subscribe(() => {
|
|
1642
1642
|
this._scrollUpdateListener();
|
|
1643
1643
|
});
|
|
1644
1644
|
}
|
|
@@ -1670,7 +1670,7 @@ let rt = class extends ie {
|
|
|
1670
1670
|
const u = c.getActiveSheet().getSheetId();
|
|
1671
1671
|
if (!a || !o)
|
|
1672
1672
|
return;
|
|
1673
|
-
const d = (Z = this._renderManagerService.getRenderById(n)) == null ? void 0 : Z.with(
|
|
1673
|
+
const d = (Z = this._renderManagerService.getRenderById(n)) == null ? void 0 : Z.with(V).getSkeletonParam(r);
|
|
1674
1674
|
if (!d)
|
|
1675
1675
|
return;
|
|
1676
1676
|
const { transform: l, drawingType: g, data: h } = a;
|
|
@@ -1684,13 +1684,13 @@ let rt = class extends ie {
|
|
|
1684
1684
|
return !0;
|
|
1685
1685
|
if (u !== r)
|
|
1686
1686
|
return;
|
|
1687
|
-
const { left:
|
|
1687
|
+
const { left: _, top: S, width: C, height: b, angle: v, flipX: D, flipY: w, skewX: M, skewY: I } = l, E = Ie({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(E);
|
|
1688
1688
|
if (T != null) {
|
|
1689
|
-
T.transformByState({ left:
|
|
1689
|
+
T.transformByState({ left: _, top: S, width: C, height: b, angle: v, flipX: D, flipY: w, skewX: M, skewY: I });
|
|
1690
1690
|
return;
|
|
1691
1691
|
}
|
|
1692
1692
|
const y = {
|
|
1693
|
-
left:
|
|
1693
|
+
left: _,
|
|
1694
1694
|
top: S,
|
|
1695
1695
|
width: C,
|
|
1696
1696
|
height: b,
|
|
@@ -1701,17 +1701,17 @@ let rt = class extends ie {
|
|
|
1701
1701
|
y.fill = k, h && h.border && (y.stroke = h.border), y.paintFirst = "stroke", y.strokeWidth = 1, y.borderEnabled = !1, y.radius = 8;
|
|
1702
1702
|
}
|
|
1703
1703
|
const N = new Be(E, y);
|
|
1704
|
-
R && N.setObjectType(
|
|
1705
|
-
const j = new
|
|
1704
|
+
R && N.setObjectType(Pn.CHART), p.addObject(N, Ht), a.allowTransform !== !1 && p.attachTransformerTo(N);
|
|
1705
|
+
const j = new _t(), Q = ge(N, f.renderUnit.scene, d.skeleton, o.worksheet), H = new $e(Q), X = {
|
|
1706
1706
|
dispose: j,
|
|
1707
1707
|
rect: N,
|
|
1708
|
-
position$:
|
|
1708
|
+
position$: H,
|
|
1709
1709
|
unitId: n,
|
|
1710
1710
|
subUnitId: r,
|
|
1711
1711
|
id: s
|
|
1712
1712
|
};
|
|
1713
1713
|
this._canvasFloatDomService.addFloatDom({
|
|
1714
|
-
position$:
|
|
1714
|
+
position$: H,
|
|
1715
1715
|
id: s,
|
|
1716
1716
|
componentKey: a.componentKey,
|
|
1717
1717
|
onPointerDown: (k) => {
|
|
@@ -1731,19 +1731,19 @@ let rt = class extends ie {
|
|
|
1731
1731
|
});
|
|
1732
1732
|
const Y = N.onTransformChange$.subscribeEvent(() => {
|
|
1733
1733
|
const k = ge(N, f.renderUnit.scene, d.skeleton, o.worksheet);
|
|
1734
|
-
|
|
1734
|
+
H.next(
|
|
1735
1735
|
k
|
|
1736
1736
|
);
|
|
1737
1737
|
});
|
|
1738
1738
|
j.add(() => {
|
|
1739
1739
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
1740
|
-
}), Y && j.add(Y), this._domLayerInfoMap.set(s,
|
|
1740
|
+
}), Y && j.add(Y), this._domLayerInfoMap.set(s, X);
|
|
1741
1741
|
});
|
|
1742
1742
|
})
|
|
1743
1743
|
), this.disposeWithMe(
|
|
1744
1744
|
this._drawingManagerService.remove$.subscribe((t) => {
|
|
1745
1745
|
t.forEach((e) => {
|
|
1746
|
-
const { unitId: n, subUnitId: r, drawingId: s } = e, o =
|
|
1746
|
+
const { unitId: n, subUnitId: r, drawingId: s } = e, o = Ie({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1747
1747
|
if (a == null)
|
|
1748
1748
|
return;
|
|
1749
1749
|
const { transformer: c, scene: u } = a, d = u.getObject(o);
|
|
@@ -1755,7 +1755,7 @@ let rt = class extends ie {
|
|
|
1755
1755
|
_scrollUpdateListener() {
|
|
1756
1756
|
const t = (e, n) => {
|
|
1757
1757
|
var c;
|
|
1758
|
-
const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = ae(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (c = this._renderManagerService.getRenderById(e)) == null ? void 0 : c.with(
|
|
1758
|
+
const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = ae(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (c = this._renderManagerService.getRenderById(e)) == null ? void 0 : c.with(V).getSkeletonParam(n);
|
|
1759
1759
|
!r || !o || !a || s.forEach((u) => {
|
|
1760
1760
|
const d = this._domLayerInfoMap.get(u);
|
|
1761
1761
|
if (d) {
|
|
@@ -1766,14 +1766,14 @@ let rt = class extends ie {
|
|
|
1766
1766
|
};
|
|
1767
1767
|
this.disposeWithMe(
|
|
1768
1768
|
this._univerInstanceService.getCurrentTypeOfUnit$(L.UNIVER_SHEET).pipe(
|
|
1769
|
-
|
|
1769
|
+
_e((e) => e ? e.activeSheet$ : jn(null)),
|
|
1770
1770
|
Ee((e) => {
|
|
1771
1771
|
if (!e) return null;
|
|
1772
1772
|
const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
|
|
1773
1773
|
return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
|
|
1774
1774
|
}),
|
|
1775
|
-
|
|
1776
|
-
(e) => e ?
|
|
1775
|
+
_e(
|
|
1776
|
+
(e) => e ? Kr(e.render.scene.getViewport(Zn.VIEW_MAIN).onScrollAfter$).pipe(Ee(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : jn(null)
|
|
1777
1777
|
)
|
|
1778
1778
|
).subscribe((e) => {
|
|
1779
1779
|
if (!e) return;
|
|
@@ -1781,12 +1781,12 @@ let rt = class extends ie {
|
|
|
1781
1781
|
t(n, r);
|
|
1782
1782
|
})
|
|
1783
1783
|
), this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
1784
|
-
if (e.id ===
|
|
1784
|
+
if (e.id === Nn.id) {
|
|
1785
1785
|
const n = e.params, { unitId: r } = n;
|
|
1786
1786
|
Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
|
|
1787
1787
|
t(r, o);
|
|
1788
1788
|
});
|
|
1789
|
-
} else if (e.id ===
|
|
1789
|
+
} else if (e.id === zi.id) {
|
|
1790
1790
|
const { unitId: n, subUnitId: r } = e.params;
|
|
1791
1791
|
t(n, r);
|
|
1792
1792
|
}
|
|
@@ -1794,7 +1794,7 @@ let rt = class extends ie {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
_getPosition(t, e) {
|
|
1796
1796
|
var g;
|
|
1797
|
-
const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(
|
|
1797
|
+
const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Ve);
|
|
1798
1798
|
if (a == null)
|
|
1799
1799
|
return;
|
|
1800
1800
|
const c = a.getCellWithCoordByOffset(n, s);
|
|
@@ -1846,7 +1846,7 @@ let rt = class extends ie {
|
|
|
1846
1846
|
updateFloatDomProps(t, e, n, r) {
|
|
1847
1847
|
const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1848
1848
|
if (s && o) {
|
|
1849
|
-
const { scene: a } = o, c =
|
|
1849
|
+
const { scene: a } = o, c = Ie({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(c);
|
|
1850
1850
|
u && u instanceof Be && u.setProps(r);
|
|
1851
1851
|
}
|
|
1852
1852
|
}
|
|
@@ -1858,7 +1858,7 @@ let rt = class extends ie {
|
|
|
1858
1858
|
});
|
|
1859
1859
|
if (!n)
|
|
1860
1860
|
throw new Error("cannot find current target!");
|
|
1861
|
-
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: c, allowTransform: u = !0 } = t, d = e != null ? e :
|
|
1861
|
+
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: c, allowTransform: u = !0 } = t, d = e != null ? e : Mt(), l = this._getPosition(o, r);
|
|
1862
1862
|
if (l == null)
|
|
1863
1863
|
return;
|
|
1864
1864
|
const g = {
|
|
@@ -1877,7 +1877,7 @@ let rt = class extends ie {
|
|
|
1877
1877
|
data: c,
|
|
1878
1878
|
allowTransform: u
|
|
1879
1879
|
};
|
|
1880
|
-
return this._commandService.executeCommand(
|
|
1880
|
+
return this._commandService.executeCommand(xt.id, {
|
|
1881
1881
|
unitId: r,
|
|
1882
1882
|
drawings: [g]
|
|
1883
1883
|
}), this._add$.next({ unitId: r, subUnitId: s, id: d }), {
|
|
@@ -1904,7 +1904,7 @@ let rt = class extends ie {
|
|
|
1904
1904
|
}
|
|
1905
1905
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
1906
1906
|
addFloatDomToRange(t, e, n, r) {
|
|
1907
|
-
var D,
|
|
1907
|
+
var D, w, M;
|
|
1908
1908
|
const s = ae(this._univerInstanceService, {
|
|
1909
1909
|
unitId: e.unitId,
|
|
1910
1910
|
subUnitId: e.subUnitId
|
|
@@ -1915,12 +1915,12 @@ let rt = class extends ie {
|
|
|
1915
1915
|
if (!c) return;
|
|
1916
1916
|
const u = this._renderManagerService.getRenderById(o);
|
|
1917
1917
|
if (!u) return;
|
|
1918
|
-
const d = (D = this._renderManagerService.getRenderById(o)) == null ? void 0 : D.with(
|
|
1918
|
+
const d = (D = this._renderManagerService.getRenderById(o)) == null ? void 0 : D.with(V).getWorksheetSkeleton(a);
|
|
1919
1919
|
if (!d) return;
|
|
1920
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r :
|
|
1920
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Mt(), { position: p, position$: m } = this._createRangePositionObserver(t, u, d.skeleton);
|
|
1921
1921
|
if (this._getPosition(p, o) == null)
|
|
1922
1922
|
return;
|
|
1923
|
-
const S = c.scene, { scaleX: C } = S.getAncestorScale(), b =
|
|
1923
|
+
const S = c.scene, { scaleX: C } = S.getAncestorScale(), b = Rt(p, n, C), v = {
|
|
1924
1924
|
unitId: o,
|
|
1925
1925
|
subUnitId: a,
|
|
1926
1926
|
drawingId: f,
|
|
@@ -1942,55 +1942,55 @@ let rt = class extends ie {
|
|
|
1942
1942
|
const j = N.getActiveSheet().getSheetId();
|
|
1943
1943
|
if (!R || !y)
|
|
1944
1944
|
return;
|
|
1945
|
-
const Q = (
|
|
1945
|
+
const Q = (w = this._renderManagerService.getRenderById(I)) == null ? void 0 : w.with(V);
|
|
1946
1946
|
if (!Q)
|
|
1947
1947
|
return;
|
|
1948
|
-
const
|
|
1949
|
-
if (!
|
|
1948
|
+
const H = Q.getWorksheetSkeleton(E);
|
|
1949
|
+
if (!H)
|
|
1950
1950
|
return;
|
|
1951
|
-
const { transform:
|
|
1951
|
+
const { transform: X, drawingType: Y, data: Z } = R;
|
|
1952
1952
|
if (Y !== W.DRAWING_DOM && Y !== W.DRAWING_CHART)
|
|
1953
1953
|
return;
|
|
1954
1954
|
const k = this._getSceneAndTransformerByDrawingSearch(I);
|
|
1955
1955
|
if (k == null)
|
|
1956
1956
|
return;
|
|
1957
1957
|
const { scene: ce, canvas: Te } = k;
|
|
1958
|
-
if (
|
|
1958
|
+
if (X == null || j !== E)
|
|
1959
1959
|
return;
|
|
1960
|
-
const { left:
|
|
1960
|
+
const { left: at, top: ct, width: dt, height: lt, angle: Yt, flipX: Gt, flipY: ut, skewX: ht, skewY: Oe } = X, gt = Ie({ unitId: I, subUnitId: E, drawingId: T }), de = ce.getObject(gt);
|
|
1961
1961
|
if (de != null) {
|
|
1962
|
-
de.transformByState({ left:
|
|
1962
|
+
de.transformByState({ left: at, top: ct, width: dt, height: lt, angle: Yt, flipX: Gt, flipY: ut, skewX: ht, skewY: Oe });
|
|
1963
1963
|
return;
|
|
1964
1964
|
}
|
|
1965
1965
|
const ee = {
|
|
1966
|
-
left:
|
|
1966
|
+
left: at,
|
|
1967
1967
|
// from floatDomParam.transform
|
|
1968
|
-
top:
|
|
1969
|
-
width:
|
|
1970
|
-
height:
|
|
1968
|
+
top: ct,
|
|
1969
|
+
width: dt,
|
|
1970
|
+
height: lt,
|
|
1971
1971
|
zIndex: this._drawingManagerService.getDrawingOrder(I, E).length - 1
|
|
1972
1972
|
}, Pe = Y === W.DRAWING_CHART;
|
|
1973
1973
|
if (Pe) {
|
|
1974
1974
|
const B = Z ? Z.backgroundColor : "white";
|
|
1975
1975
|
ee.fill = B, ee.rotateEnabled = !1, Z && Z.border && (ee.stroke = Z.border), ee.paintFirst = "stroke", ee.strokeWidth = 1, ee.borderEnabled = !1, ee.radius = 8;
|
|
1976
1976
|
}
|
|
1977
|
-
const le = new Be(
|
|
1978
|
-
Pe && le.setObjectType(
|
|
1979
|
-
const ue = new
|
|
1980
|
-
top:
|
|
1977
|
+
const le = new Be(gt, ee);
|
|
1978
|
+
Pe && le.setObjectType(Pn.CHART), ce.addObject(le, Ht), R.allowTransform !== !1 && ce.attachTransformerTo(le);
|
|
1979
|
+
const ue = new _t(), mt = ce.getMainViewport(), { rowHeaderWidth: Ue, columnHeaderHeight: He } = H.skeleton, ft = {
|
|
1980
|
+
top: He,
|
|
1981
1981
|
left: Ue,
|
|
1982
|
-
bottom:
|
|
1983
|
-
right:
|
|
1982
|
+
bottom: mt.bottom,
|
|
1983
|
+
right: mt.right
|
|
1984
1984
|
}, he = {
|
|
1985
1985
|
dispose: ue,
|
|
1986
1986
|
rect: le,
|
|
1987
|
-
boundsOfViewArea:
|
|
1987
|
+
boundsOfViewArea: ft,
|
|
1988
1988
|
domAnchor: n,
|
|
1989
1989
|
unitId: I,
|
|
1990
1990
|
subUnitId: E
|
|
1991
|
-
}, $ = ge(le, k.renderUnit.scene,
|
|
1991
|
+
}, $ = ge(le, k.renderUnit.scene, H.skeleton, y.worksheet, he), Ae = new $e($);
|
|
1992
1992
|
he.position$ = Ae;
|
|
1993
|
-
let
|
|
1993
|
+
let ze = {
|
|
1994
1994
|
position$: Ae,
|
|
1995
1995
|
id: T,
|
|
1996
1996
|
componentKey: R.componentKey,
|
|
@@ -2006,8 +2006,8 @@ let rt = class extends ie {
|
|
|
2006
2006
|
data: Z,
|
|
2007
2007
|
unitId: I
|
|
2008
2008
|
};
|
|
2009
|
-
e.eventPassThrough && (
|
|
2010
|
-
...
|
|
2009
|
+
e.eventPassThrough && (ze = {
|
|
2010
|
+
...ze,
|
|
2011
2011
|
onPointerDown: (B) => {
|
|
2012
2012
|
Te.dispatchEvent(new PointerEvent(B.type, B));
|
|
2013
2013
|
},
|
|
@@ -2017,41 +2017,41 @@ let rt = class extends ie {
|
|
|
2017
2017
|
onPointerUp: (B) => {
|
|
2018
2018
|
Te.dispatchEvent(new PointerEvent(B.type, B));
|
|
2019
2019
|
}
|
|
2020
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2021
|
-
var
|
|
2022
|
-
const
|
|
2020
|
+
}), this._canvasFloatDomService.addFloatDom(ze), this.disposeWithMe(m.subscribe((B) => {
|
|
2021
|
+
var pn, wn, _n, vn;
|
|
2022
|
+
const fn = Rt({
|
|
2023
2023
|
startX: B.startX,
|
|
2024
2024
|
startY: B.startY,
|
|
2025
2025
|
endX: B.endX,
|
|
2026
2026
|
endY: B.endY,
|
|
2027
|
-
width: (
|
|
2028
|
-
height: (
|
|
2027
|
+
width: (pn = n.width) != null ? pn : B.width,
|
|
2028
|
+
height: (wn = n.height) != null ? wn : B.height,
|
|
2029
2029
|
absolute: {
|
|
2030
2030
|
left: p.absolute.left,
|
|
2031
2031
|
top: p.absolute.top
|
|
2032
2032
|
}
|
|
2033
|
-
}, n),
|
|
2034
|
-
left:
|
|
2035
|
-
top:
|
|
2036
|
-
width: (
|
|
2037
|
-
height: (
|
|
2033
|
+
}, n), kr = Ie({ unitId: I, subUnitId: E, drawingId: T }), Br = new Be(kr, {
|
|
2034
|
+
left: fn.startX,
|
|
2035
|
+
top: fn.startY,
|
|
2036
|
+
width: (_n = n.width) != null ? _n : B.width,
|
|
2037
|
+
height: (vn = n.height) != null ? vn : B.height,
|
|
2038
2038
|
zIndex: this._drawingManagerService.getDrawingOrder(I, E).length - 1
|
|
2039
|
-
}),
|
|
2040
|
-
Ae.next(
|
|
2039
|
+
}), Wr = ge(Br, k.renderUnit.scene, H.skeleton, y.worksheet, he);
|
|
2040
|
+
Ae.next(Wr);
|
|
2041
2041
|
}));
|
|
2042
|
-
const
|
|
2043
|
-
|
|
2044
|
-
B &&
|
|
2042
|
+
const Ke = (M = this._renderManagerService.getRenderById(I)) == null ? void 0 : M.with(V);
|
|
2043
|
+
Ke == null || Ke.currentSkeleton$.subscribe((B) => {
|
|
2044
|
+
B && H.sheetId !== B.sheetId && this._removeDom(f, !0);
|
|
2045
2045
|
});
|
|
2046
|
-
const
|
|
2047
|
-
const B = ge(le, k.renderUnit.scene,
|
|
2046
|
+
const pt = le.onTransformChange$.subscribeEvent(() => {
|
|
2047
|
+
const B = ge(le, k.renderUnit.scene, H.skeleton, y.worksheet, he);
|
|
2048
2048
|
Ae.next(
|
|
2049
2049
|
B
|
|
2050
2050
|
);
|
|
2051
2051
|
});
|
|
2052
2052
|
ue.add(() => {
|
|
2053
2053
|
this._canvasFloatDomService.removeFloatDom(T);
|
|
2054
|
-
}),
|
|
2054
|
+
}), pt && ue.add(pt), this._domLayerInfoMap.set(T, he);
|
|
2055
2055
|
}
|
|
2056
2056
|
return {
|
|
2057
2057
|
id: f,
|
|
@@ -2073,15 +2073,15 @@ let rt = class extends ie {
|
|
|
2073
2073
|
if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
|
|
2074
2074
|
const u = this._renderManagerService.getRenderById(o);
|
|
2075
2075
|
if (!u) return;
|
|
2076
|
-
const d = (b = this._renderManagerService.getRenderById(o)) == null ? void 0 : b.with(
|
|
2076
|
+
const d = (b = this._renderManagerService.getRenderById(o)) == null ? void 0 : b.with(V).getWorksheetSkeleton(a);
|
|
2077
2077
|
if (!d) return;
|
|
2078
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r :
|
|
2078
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Mt(), { position: p, position$: m } = this._createRangePositionObserver({
|
|
2079
2079
|
startRow: 0,
|
|
2080
2080
|
endRow: 0,
|
|
2081
2081
|
startColumn: t,
|
|
2082
2082
|
endColumn: t
|
|
2083
|
-
}, u, d.skeleton),
|
|
2084
|
-
if (
|
|
2083
|
+
}, u, d.skeleton), _ = p;
|
|
2084
|
+
if (_.startY = 0, this._getPosition(p, o) == null)
|
|
2085
2085
|
return;
|
|
2086
2086
|
const C = {
|
|
2087
2087
|
unitId: o,
|
|
@@ -2090,40 +2090,40 @@ let rt = class extends ie {
|
|
|
2090
2090
|
drawingType: e.type || W.DRAWING_DOM,
|
|
2091
2091
|
componentKey: l,
|
|
2092
2092
|
transform: {
|
|
2093
|
-
left:
|
|
2094
|
-
top:
|
|
2095
|
-
width:
|
|
2096
|
-
height:
|
|
2093
|
+
left: _.startX,
|
|
2094
|
+
top: _.startY,
|
|
2095
|
+
width: _.width,
|
|
2096
|
+
height: _.height
|
|
2097
2097
|
},
|
|
2098
2098
|
data: g,
|
|
2099
2099
|
allowTransform: h
|
|
2100
2100
|
};
|
|
2101
2101
|
{
|
|
2102
|
-
const { unitId:
|
|
2102
|
+
const { unitId: w, subUnitId: M, drawingId: I } = C, E = ae(this._univerInstanceService, { unitId: w, subUnitId: M }), T = C, y = this._univerInstanceService.getUnit(w, L.UNIVER_SHEET);
|
|
2103
2103
|
if (!y)
|
|
2104
2104
|
return;
|
|
2105
2105
|
const R = y.getActiveSheet().getSheetId();
|
|
2106
2106
|
if (!T || !E)
|
|
2107
2107
|
return;
|
|
2108
|
-
const N = (v = this._renderManagerService.getRenderById(
|
|
2108
|
+
const N = (v = this._renderManagerService.getRenderById(w)) == null ? void 0 : v.with(V);
|
|
2109
2109
|
if (!N)
|
|
2110
2110
|
return;
|
|
2111
2111
|
const j = N.getWorksheetSkeleton(M);
|
|
2112
2112
|
if (!j)
|
|
2113
2113
|
return;
|
|
2114
|
-
const { transform: Q, data:
|
|
2115
|
-
if (
|
|
2114
|
+
const { transform: Q, data: H } = T, X = this._getSceneAndTransformerByDrawingSearch(w);
|
|
2115
|
+
if (X == null)
|
|
2116
2116
|
return;
|
|
2117
|
-
const { scene: Y, canvas: Z } =
|
|
2117
|
+
const { scene: Y, canvas: Z } = X;
|
|
2118
2118
|
if (Q == null || R !== M)
|
|
2119
2119
|
return;
|
|
2120
|
-
const { left: k, top: ce, width: Te, height:
|
|
2121
|
-
if (
|
|
2122
|
-
|
|
2120
|
+
const { left: k, top: ce, width: Te, height: at, angle: ct, flipX: dt, flipY: lt, skewX: Yt, skewY: Gt } = Q, ut = Ie({ unitId: w, subUnitId: M, drawingId: I }), ht = Y.getObject(ut);
|
|
2121
|
+
if (ht != null) {
|
|
2122
|
+
ht.transformByState({ left: k, top: ce, width: Te, height: at, angle: ct, flipX: dt, flipY: lt, skewX: Yt, skewY: Gt });
|
|
2123
2123
|
return;
|
|
2124
2124
|
}
|
|
2125
|
-
const Oe =
|
|
2126
|
-
startX:
|
|
2125
|
+
const Oe = Rt({
|
|
2126
|
+
startX: _.startX,
|
|
2127
2127
|
startY: 0,
|
|
2128
2128
|
endX: p.endX,
|
|
2129
2129
|
endY: p.endY,
|
|
@@ -2133,15 +2133,15 @@ let rt = class extends ie {
|
|
|
2133
2133
|
left: p.absolute.left,
|
|
2134
2134
|
top: p.absolute.top
|
|
2135
2135
|
}
|
|
2136
|
-
}, n),
|
|
2136
|
+
}, n), gt = {
|
|
2137
2137
|
left: Oe.startX,
|
|
2138
2138
|
top: Oe.startY,
|
|
2139
2139
|
width: Oe.width,
|
|
2140
2140
|
height: Oe.height,
|
|
2141
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2142
|
-
}, de = new Be(
|
|
2143
|
-
Y.addObject(de,
|
|
2144
|
-
const ee = new
|
|
2141
|
+
zIndex: this._drawingManagerService.getDrawingOrder(w, M).length - 1
|
|
2142
|
+
}, de = new Be(ut, gt);
|
|
2143
|
+
Y.addObject(de, Ht), T.allowTransform !== !1 && Y.attachTransformerTo(de);
|
|
2144
|
+
const ee = new _t(), Pe = Y.getMainViewport(), le = {
|
|
2145
2145
|
top: 0,
|
|
2146
2146
|
//viewMain.top,
|
|
2147
2147
|
left: Pe.left,
|
|
@@ -2151,15 +2151,15 @@ let rt = class extends ie {
|
|
|
2151
2151
|
dispose: ee,
|
|
2152
2152
|
rect: de,
|
|
2153
2153
|
// position$,
|
|
2154
|
-
unitId:
|
|
2154
|
+
unitId: w,
|
|
2155
2155
|
subUnitId: M,
|
|
2156
2156
|
boundsOfViewArea: le,
|
|
2157
2157
|
domAnchor: n,
|
|
2158
2158
|
scrollDirectionResponse: "HORIZONTAL"
|
|
2159
2159
|
/* HORIZONTAL */
|
|
2160
|
-
},
|
|
2160
|
+
}, mt = ge(de, X.renderUnit.scene, j.skeleton, E.worksheet, ue), Ue = new $e(mt);
|
|
2161
2161
|
ue.position$ = Ue;
|
|
2162
|
-
let
|
|
2162
|
+
let He = {
|
|
2163
2163
|
position$: Ue,
|
|
2164
2164
|
id: I,
|
|
2165
2165
|
componentKey: T.componentKey,
|
|
@@ -2172,11 +2172,11 @@ let rt = class extends ie {
|
|
|
2172
2172
|
onWheel: ($) => {
|
|
2173
2173
|
Z.dispatchEvent(new WheelEvent($.type, $));
|
|
2174
2174
|
},
|
|
2175
|
-
data:
|
|
2176
|
-
unitId:
|
|
2175
|
+
data: H,
|
|
2176
|
+
unitId: w
|
|
2177
2177
|
};
|
|
2178
|
-
e.eventPassThrough && (
|
|
2179
|
-
...
|
|
2178
|
+
e.eventPassThrough && (He = {
|
|
2179
|
+
...He,
|
|
2180
2180
|
onPointerDown: ($) => {
|
|
2181
2181
|
Z.dispatchEvent(new PointerEvent($.type, $));
|
|
2182
2182
|
},
|
|
@@ -2186,15 +2186,15 @@ let rt = class extends ie {
|
|
|
2186
2186
|
onPointerUp: ($) => {
|
|
2187
2187
|
Z.dispatchEvent(new PointerEvent($.type, $));
|
|
2188
2188
|
}
|
|
2189
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2190
|
-
const
|
|
2191
|
-
const $ = ge(de,
|
|
2189
|
+
}), this._canvasFloatDomService.addFloatDom(He);
|
|
2190
|
+
const ft = de.onTransformChange$.subscribeEvent(() => {
|
|
2191
|
+
const $ = ge(de, X.renderUnit.scene, j.skeleton, E.worksheet, ue);
|
|
2192
2192
|
Ue.next(
|
|
2193
2193
|
$
|
|
2194
2194
|
);
|
|
2195
2195
|
});
|
|
2196
2196
|
this.disposeWithMe(m.subscribe(($) => {
|
|
2197
|
-
const Ae =
|
|
2197
|
+
const Ae = Rt({
|
|
2198
2198
|
startX: $.startX,
|
|
2199
2199
|
startY: 0,
|
|
2200
2200
|
endX: $.endX,
|
|
@@ -2205,21 +2205,21 @@ let rt = class extends ie {
|
|
|
2205
2205
|
left: p.absolute.left,
|
|
2206
2206
|
top: p.absolute.top
|
|
2207
2207
|
}
|
|
2208
|
-
}, n),
|
|
2208
|
+
}, n), ze = Ie({ unitId: w, subUnitId: M, drawingId: I }), Ke = new Be(ze, {
|
|
2209
2209
|
left: Ae.startX,
|
|
2210
2210
|
top: 0,
|
|
2211
2211
|
width: n.width,
|
|
2212
2212
|
height: n.height,
|
|
2213
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2214
|
-
}),
|
|
2215
|
-
Ue.next(
|
|
2213
|
+
zIndex: this._drawingManagerService.getDrawingOrder(w, M).length - 1
|
|
2214
|
+
}), pt = ge(Ke, X.renderUnit.scene, j.skeleton, E.worksheet, ue);
|
|
2215
|
+
Ue.next(pt);
|
|
2216
2216
|
}));
|
|
2217
|
-
const he = (D = this._renderManagerService.getRenderById(
|
|
2217
|
+
const he = (D = this._renderManagerService.getRenderById(w)) == null ? void 0 : D.with(V);
|
|
2218
2218
|
he == null || he.currentSkeleton$.subscribe(($) => {
|
|
2219
2219
|
$ && d.sheetId !== $.sheetId && this._removeDom(f, !0);
|
|
2220
2220
|
}), ee.add(() => {
|
|
2221
2221
|
this._canvasFloatDomService.removeFloatDom(I);
|
|
2222
|
-
}),
|
|
2222
|
+
}), ft && ee.add(ft), this._domLayerInfoMap.set(I, ue);
|
|
2223
2223
|
}
|
|
2224
2224
|
return {
|
|
2225
2225
|
id: f,
|
|
@@ -2241,19 +2241,19 @@ let rt = class extends ie {
|
|
|
2241
2241
|
// eslint-disable-next-line max-lines-per-function
|
|
2242
2242
|
_createRangePositionObserver(t, e, n) {
|
|
2243
2243
|
let { startRow: r, startColumn: s } = t;
|
|
2244
|
-
const o =
|
|
2245
|
-
const m =
|
|
2246
|
-
a.next(m), u.next(
|
|
2247
|
-
}, l = new
|
|
2244
|
+
const o = Qe(r, s, n), a = new $e(o), c = Qe(t.endRow, t.endColumn, n), u = new $e(c), d = () => {
|
|
2245
|
+
const m = Qe(r, s, n), _ = Qe(t.endRow, t.endColumn, n);
|
|
2246
|
+
a.next(m), u.next(_);
|
|
2247
|
+
}, l = new _t();
|
|
2248
2248
|
l.add(e.engine.clientRect$.subscribe(() => d())), l.add(this._commandService.onCommandExecuted((m) => {
|
|
2249
|
-
if (m.id ===
|
|
2249
|
+
if (m.id === Ki.id && m.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
|
|
2250
2250
|
d();
|
|
2251
2251
|
return;
|
|
2252
2252
|
}
|
|
2253
|
-
(
|
|
2253
|
+
(Zi.indexOf(m.id) > -1 || m.id === Ei.id || m.id === Nn.id) && d();
|
|
2254
2254
|
}));
|
|
2255
|
-
const g = (m,
|
|
2256
|
-
r = m, s =
|
|
2255
|
+
const g = (m, _) => {
|
|
2256
|
+
r = m, s = _, d();
|
|
2257
2257
|
}, h = () => ({
|
|
2258
2258
|
rotate: 0,
|
|
2259
2259
|
width: c.right - o.left,
|
|
@@ -2268,19 +2268,19 @@ let rt = class extends ie {
|
|
|
2268
2268
|
endY: c.bottom
|
|
2269
2269
|
}), f = a.pipe(
|
|
2270
2270
|
Ee((m) => {
|
|
2271
|
-
const
|
|
2271
|
+
const _ = Qe(t.endRow, t.endColumn, n);
|
|
2272
2272
|
return {
|
|
2273
2273
|
rotate: 0,
|
|
2274
|
-
width:
|
|
2275
|
-
height:
|
|
2274
|
+
width: _.right - m.left,
|
|
2275
|
+
height: _.bottom - m.top,
|
|
2276
2276
|
absolute: {
|
|
2277
2277
|
left: !0,
|
|
2278
2278
|
top: !0
|
|
2279
2279
|
},
|
|
2280
2280
|
startX: m.left,
|
|
2281
2281
|
startY: m.top,
|
|
2282
|
-
endX:
|
|
2283
|
-
endY:
|
|
2282
|
+
endX: _.right,
|
|
2283
|
+
endY: _.bottom
|
|
2284
2284
|
};
|
|
2285
2285
|
})
|
|
2286
2286
|
), p = h();
|
|
@@ -2294,16 +2294,16 @@ let rt = class extends ie {
|
|
|
2294
2294
|
};
|
|
2295
2295
|
}
|
|
2296
2296
|
};
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
],
|
|
2306
|
-
function
|
|
2297
|
+
nt = Xs([
|
|
2298
|
+
be(0, A(q)),
|
|
2299
|
+
be(1, Se),
|
|
2300
|
+
be(2, A(G)),
|
|
2301
|
+
be(3, se),
|
|
2302
|
+
be(4, A(ji)),
|
|
2303
|
+
be(5, oe),
|
|
2304
|
+
be(6, A(Hr))
|
|
2305
|
+
], nt);
|
|
2306
|
+
function Qe(i, t, e) {
|
|
2307
2307
|
const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
|
|
2308
2308
|
return {
|
|
2309
2309
|
left: r.startX,
|
|
@@ -2312,22 +2312,22 @@ function et(i, t, e) {
|
|
|
2312
2312
|
bottom: r.endY
|
|
2313
2313
|
};
|
|
2314
2314
|
}
|
|
2315
|
-
function
|
|
2315
|
+
function Rt(i, t, e) {
|
|
2316
2316
|
var u, d;
|
|
2317
2317
|
e = e != null ? e : 1;
|
|
2318
2318
|
const n = i.endX - i.startX, r = i.endY - i.startY, s = (u = t == null ? void 0 : t.width) != null ? u : n, o = (d = t == null ? void 0 : t.height) != null ? d : r;
|
|
2319
2319
|
let a = 0, c = 0;
|
|
2320
2320
|
if (t) {
|
|
2321
2321
|
if (t.horizonOffsetAlign === "right") {
|
|
2322
|
-
const l =
|
|
2322
|
+
const l = yt(t.marginX, n * e);
|
|
2323
2323
|
a = i.endX - l - s;
|
|
2324
2324
|
} else
|
|
2325
|
-
a = i.startX +
|
|
2325
|
+
a = i.startX + yt(t.marginX, n);
|
|
2326
2326
|
if (t.verticalOffsetAlign === "bottom") {
|
|
2327
|
-
const l =
|
|
2327
|
+
const l = yt(t.marginY, r * e);
|
|
2328
2328
|
c = i.endY - l - o;
|
|
2329
2329
|
} else
|
|
2330
|
-
c = i.startY +
|
|
2330
|
+
c = i.startY + yt(t.marginY, r);
|
|
2331
2331
|
}
|
|
2332
2332
|
return {
|
|
2333
2333
|
rotate: 0,
|
|
@@ -2343,80 +2343,15 @@ function yt(i, t, e) {
|
|
|
2343
2343
|
}
|
|
2344
2344
|
};
|
|
2345
2345
|
}
|
|
2346
|
-
function
|
|
2346
|
+
function yt(i, t) {
|
|
2347
2347
|
if (i === void 0) return 0;
|
|
2348
2348
|
if (typeof i == "number") return i;
|
|
2349
2349
|
const e = Number.parseFloat(i);
|
|
2350
2350
|
return t * e / 100;
|
|
2351
2351
|
}
|
|
2352
|
-
const Vs =
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
data: t.data,
|
|
2356
|
-
...t.props
|
|
2357
|
-
}), [t.data, t.props]), g = {
|
|
2358
|
-
width: `${n.width - 4}px`,
|
|
2359
|
-
height: `${n.height - 4}px`,
|
|
2360
|
-
left: `${n.absolute.left ? 0 : "auto"}`,
|
|
2361
|
-
top: `${n.absolute.top ? 0 : "auto"}`,
|
|
2362
|
-
right: `${n.absolute.left ? "auto" : 0}`,
|
|
2363
|
-
bottom: `${n.absolute.top ? "auto" : 0}`
|
|
2364
|
-
};
|
|
2365
|
-
a.current = `rotate(${n.rotate}deg)`, c.current = n.startY, u.current = n.startX;
|
|
2366
|
-
const h = r.getUnit(t.unitId), f = sn(() => d ? /* @__PURE__ */ X(
|
|
2367
|
-
d,
|
|
2368
|
-
{
|
|
2369
|
-
...l,
|
|
2370
|
-
unitId: t.unitId,
|
|
2371
|
-
unit: h,
|
|
2372
|
-
floatDomId: t.id,
|
|
2373
|
-
context: {
|
|
2374
|
-
root: o
|
|
2375
|
-
}
|
|
2376
|
-
}
|
|
2377
|
-
) : null, [d, l]);
|
|
2378
|
-
return n ? /* @__PURE__ */ X(
|
|
2379
|
-
"div",
|
|
2380
|
-
{
|
|
2381
|
-
ref: s,
|
|
2382
|
-
className: "univer-z-10",
|
|
2383
|
-
style: {
|
|
2384
|
-
position: "absolute",
|
|
2385
|
-
top: c.current,
|
|
2386
|
-
left: u.current,
|
|
2387
|
-
width: Math.max(n.endX - n.startX - 2, 0),
|
|
2388
|
-
height: Math.max(n.endY - n.startY - 2, 0),
|
|
2389
|
-
transform: a.current,
|
|
2390
|
-
overflow: "hidden",
|
|
2391
|
-
transformOrigin: "center center"
|
|
2392
|
-
},
|
|
2393
|
-
onPointerMove: (w) => {
|
|
2394
|
-
t.onPointerMove(w.nativeEvent);
|
|
2395
|
-
},
|
|
2396
|
-
onPointerDown: (w) => {
|
|
2397
|
-
t.onPointerDown(w.nativeEvent);
|
|
2398
|
-
},
|
|
2399
|
-
onPointerUp: (w) => {
|
|
2400
|
-
t.onPointerUp(w.nativeEvent);
|
|
2401
|
-
},
|
|
2402
|
-
onWheel: (w) => {
|
|
2403
|
-
t.onWheel(w.nativeEvent);
|
|
2404
|
-
},
|
|
2405
|
-
children: /* @__PURE__ */ X(
|
|
2406
|
-
"div",
|
|
2407
|
-
{
|
|
2408
|
-
id: e,
|
|
2409
|
-
ref: o,
|
|
2410
|
-
className: "univer-overflow-hidden",
|
|
2411
|
-
style: { position: "absolute", ...g },
|
|
2412
|
-
children: f
|
|
2413
|
-
}
|
|
2414
|
-
)
|
|
2415
|
-
}
|
|
2416
|
-
) : null;
|
|
2417
|
-
}), Hs = (i) => {
|
|
2418
|
-
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = sn(() => t.map((o) => {
|
|
2419
|
-
const { width: a, height: c, angle: u, left: d, top: l } = o.transform, g = Tr(
|
|
2352
|
+
const Vs = (i) => {
|
|
2353
|
+
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = os(() => t.map((o) => {
|
|
2354
|
+
const { width: a, height: c, angle: u, left: d, top: l } = o.transform, g = Mr(
|
|
2420
2355
|
{
|
|
2421
2356
|
left: d != null ? d : 0,
|
|
2422
2357
|
right: (d != null ? d : 0) + (a != null ? a : 0),
|
|
@@ -2454,14 +2389,14 @@ const Vs = as((i) => {
|
|
|
2454
2389
|
};
|
|
2455
2390
|
return [o.drawingId, m];
|
|
2456
2391
|
}), [t, e, n, r]);
|
|
2457
|
-
return /* @__PURE__ */
|
|
2392
|
+
return /* @__PURE__ */ K("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ K($i, { layer: a, id: o, position: a.position }, o)) });
|
|
2458
2393
|
};
|
|
2459
|
-
var
|
|
2460
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2394
|
+
var Hs = Object.getOwnPropertyDescriptor, zs = (i, t, e, n) => {
|
|
2395
|
+
for (var r = n > 1 ? void 0 : n ? Hs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2461
2396
|
(o = i[s]) && (r = o(r) || r);
|
|
2462
2397
|
return r;
|
|
2463
|
-
},
|
|
2464
|
-
let
|
|
2398
|
+
}, Re = (i, t) => (e, n) => t(e, n, i);
|
|
2399
|
+
let kt = class extends ie {
|
|
2465
2400
|
constructor(i, t, e, n, r, s, o) {
|
|
2466
2401
|
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = t, this._drawingManagerService = e, this._renderManagerService = n, this._canvasFloatDomManagerService = r, this._componetManager = s, this._injector = o, this._initPrinting(), this._initPrintingDom();
|
|
2467
2402
|
}
|
|
@@ -2487,7 +2422,7 @@ let Bt = class extends ie {
|
|
|
2487
2422
|
const { unitId: n, subUnitId: r } = t, s = this._renderManagerService.getRenderById(n);
|
|
2488
2423
|
if (!s)
|
|
2489
2424
|
return e(i);
|
|
2490
|
-
const o = s.with(
|
|
2425
|
+
const o = s.with(V).getSkeletonParam(r);
|
|
2491
2426
|
if (!o)
|
|
2492
2427
|
return e(i);
|
|
2493
2428
|
const a = this._drawingManagerService.getDrawingDataForUnit(n), c = a == null ? void 0 : a[t.subUnitId];
|
|
@@ -2495,7 +2430,7 @@ let Bt = class extends ie {
|
|
|
2495
2430
|
return e(i);
|
|
2496
2431
|
const { scaleX: u, scaleY: d } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = c.order.map((h) => c.data[h]);
|
|
2497
2432
|
return g.length ? (g.forEach((h) => {
|
|
2498
|
-
if (!h.groupId && h.transform &&
|
|
2433
|
+
if (!h.groupId && h.transform && ye.isDefine(h.transform.left) && ye.isDefine(h.transform.top) && ye.isDefine(h.transform.width) && ye.isDefine(h.transform.height)) {
|
|
2499
2434
|
const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, d, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, d, { x: 0, y: 0 });
|
|
2500
2435
|
f.column < l.startColumn && (l.startColumn = f.column), f.row < l.startRow && (l.startRow = f.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
|
|
2501
2436
|
}
|
|
@@ -2517,14 +2452,14 @@ let Bt = class extends ie {
|
|
|
2517
2452
|
const d = o.data[u];
|
|
2518
2453
|
return d.drawingType === W.DRAWING_CHART ? {
|
|
2519
2454
|
...d,
|
|
2520
|
-
componentKey: this._componetManager.get(
|
|
2455
|
+
componentKey: this._componetManager.get(Zr)
|
|
2521
2456
|
} : d.drawingType === W.DRAWING_DOM ? {
|
|
2522
2457
|
...d,
|
|
2523
2458
|
componentKey: this._componetManager.get(d.componentKey)
|
|
2524
2459
|
} : null;
|
|
2525
|
-
}).filter(Boolean), c =
|
|
2460
|
+
}).filter(Boolean), c = qn(Vs, this._injector);
|
|
2526
2461
|
return ls(
|
|
2527
|
-
/* @__PURE__ */
|
|
2462
|
+
/* @__PURE__ */ K(c, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
|
|
2528
2463
|
t.root
|
|
2529
2464
|
), i == null || i.add(() => {
|
|
2530
2465
|
us(t.root);
|
|
@@ -2536,49 +2471,49 @@ let Bt = class extends ie {
|
|
|
2536
2471
|
);
|
|
2537
2472
|
}
|
|
2538
2473
|
};
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
],
|
|
2548
|
-
var
|
|
2549
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2474
|
+
kt = zs([
|
|
2475
|
+
Re(0, A(Ti)),
|
|
2476
|
+
Re(1, A(Kn)),
|
|
2477
|
+
Re(2, se),
|
|
2478
|
+
Re(3, q),
|
|
2479
|
+
Re(4, A(nt)),
|
|
2480
|
+
Re(5, A(Qn)),
|
|
2481
|
+
Re(6, A(Xe))
|
|
2482
|
+
], kt);
|
|
2483
|
+
var Ks = Object.getOwnPropertyDescriptor, Zs = (i, t, e, n) => {
|
|
2484
|
+
for (var r = n > 1 ? void 0 : n ? Ks(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2550
2485
|
(o = i[s]) && (r = o(r) || r);
|
|
2551
2486
|
return r;
|
|
2552
|
-
},
|
|
2553
|
-
const
|
|
2487
|
+
}, pe = (i, t) => (e, n) => t(e, n, i);
|
|
2488
|
+
const Js = [
|
|
2489
|
+
er.id,
|
|
2490
|
+
tr.id,
|
|
2554
2491
|
nr.id,
|
|
2555
2492
|
rr.id,
|
|
2556
2493
|
ir.id,
|
|
2557
2494
|
sr.id,
|
|
2558
2495
|
or.id,
|
|
2559
2496
|
ar.id,
|
|
2497
|
+
tn.id,
|
|
2498
|
+
nn.id,
|
|
2560
2499
|
cr.id,
|
|
2561
2500
|
dr.id,
|
|
2562
|
-
nn.id,
|
|
2563
|
-
rn.id,
|
|
2564
2501
|
lr.id,
|
|
2565
2502
|
ur.id,
|
|
2566
2503
|
hr.id,
|
|
2567
2504
|
gr.id,
|
|
2568
2505
|
mr.id,
|
|
2569
2506
|
fr.id,
|
|
2570
|
-
pr.id
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
], Qs = [
|
|
2507
|
+
pr.id
|
|
2508
|
+
], qs = [
|
|
2509
|
+
Ji.id,
|
|
2574
2510
|
qi.id,
|
|
2575
2511
|
Qi.id,
|
|
2576
2512
|
es.id,
|
|
2577
2513
|
ts.id,
|
|
2578
|
-
ns.id
|
|
2579
|
-
rs.id
|
|
2514
|
+
ns.id
|
|
2580
2515
|
];
|
|
2581
|
-
let
|
|
2516
|
+
let cn = class extends ie {
|
|
2582
2517
|
constructor(i, t, e, n, r, s, o, a, c) {
|
|
2583
2518
|
super(), this._context = i, this._renderManagerService = t, this._commandService = e, this._selectionRenderService = n, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService = c, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
|
|
2584
2519
|
}
|
|
@@ -2586,57 +2521,57 @@ let ln = class extends ie {
|
|
|
2586
2521
|
this.disposeWithMe(
|
|
2587
2522
|
this._sheetInterceptorService.interceptCommand({
|
|
2588
2523
|
getMutations: (i) => {
|
|
2589
|
-
if (!
|
|
2524
|
+
if (!Js.includes(i.id))
|
|
2590
2525
|
return { redos: [], undos: [] };
|
|
2591
2526
|
if (i.params == null)
|
|
2592
2527
|
return { redos: [], undos: [] };
|
|
2593
2528
|
const t = i.id;
|
|
2594
|
-
if (t ===
|
|
2529
|
+
if (t === er.id)
|
|
2595
2530
|
return this._moveRowInterceptor(i.params, "insert");
|
|
2596
|
-
if ([
|
|
2531
|
+
if ([mr.id, fr.id, pr.id].includes(t))
|
|
2597
2532
|
return this._moveRangeInterceptor(i.params);
|
|
2598
|
-
if (t ===
|
|
2533
|
+
if (t === tr.id)
|
|
2599
2534
|
return this._moveColInterceptor(i.params, "insert");
|
|
2600
|
-
if (t ===
|
|
2535
|
+
if (t === nr.id)
|
|
2601
2536
|
return this._moveRowInterceptor(i.params, "remove");
|
|
2602
|
-
if (t ===
|
|
2537
|
+
if (t === rr.id)
|
|
2603
2538
|
return this._moveColInterceptor(i.params, "remove");
|
|
2604
|
-
if (t ===
|
|
2539
|
+
if (t === ir.id) {
|
|
2605
2540
|
const { range: e } = i.params;
|
|
2606
2541
|
return this._getRangeMoveUndo(
|
|
2607
2542
|
e,
|
|
2608
2543
|
0
|
|
2609
2544
|
/* deleteLeft */
|
|
2610
2545
|
);
|
|
2611
|
-
} else if (t ===
|
|
2546
|
+
} else if (t === sr.id) {
|
|
2612
2547
|
const { range: e } = i.params;
|
|
2613
2548
|
return this._getRangeMoveUndo(
|
|
2614
2549
|
e,
|
|
2615
2550
|
1
|
|
2616
2551
|
/* deleteUp */
|
|
2617
2552
|
);
|
|
2618
|
-
} else if (t ===
|
|
2553
|
+
} else if (t === or.id) {
|
|
2619
2554
|
const { range: e } = i.params;
|
|
2620
2555
|
return this._getRangeMoveUndo(
|
|
2621
2556
|
e,
|
|
2622
2557
|
2
|
|
2623
2558
|
/* insertDown */
|
|
2624
2559
|
);
|
|
2625
|
-
} else if (t ===
|
|
2560
|
+
} else if (t === ar.id) {
|
|
2626
2561
|
const { range: e } = i.params;
|
|
2627
2562
|
return this._getRangeMoveUndo(
|
|
2628
2563
|
e,
|
|
2629
2564
|
3
|
|
2630
2565
|
/* insertRight */
|
|
2631
2566
|
);
|
|
2632
|
-
} else if (t ===
|
|
2567
|
+
} else if (t === lr.id || t === ur.id) {
|
|
2633
2568
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2634
2569
|
return this._getDrawingUndoForRowVisible(n, r, s);
|
|
2635
|
-
} else if (t ===
|
|
2570
|
+
} else if (t === hr.id || t === gr.id) {
|
|
2636
2571
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2637
2572
|
return this._getDrawingUndoForColVisible(n, r, s);
|
|
2638
|
-
} else if (t ===
|
|
2639
|
-
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t ===
|
|
2573
|
+
} else if (t === tn.id || t === nn.id || t === cr.id || t === dr.id) {
|
|
2574
|
+
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === tn.id || t === nn.id;
|
|
2640
2575
|
return this._getDrawingUndoForRowAndColSize(n, r, s, o);
|
|
2641
2576
|
}
|
|
2642
2577
|
return { redos: [], undos: [] };
|
|
@@ -2674,32 +2609,32 @@ let ln = class extends ie {
|
|
|
2674
2609
|
updateDrawings: n,
|
|
2675
2610
|
deleteDrawings: r
|
|
2676
2611
|
};
|
|
2677
|
-
const { startRow:
|
|
2612
|
+
const { startRow: _, endRow: S, startColumn: C, endColumn: b } = i;
|
|
2678
2613
|
let v = null, D = null;
|
|
2679
|
-
if (t === 0 && h >=
|
|
2614
|
+
if (t === 0 && h >= _ && p <= S)
|
|
2680
2615
|
if (f >= C && m <= b)
|
|
2681
2616
|
r.push({ unitId: c, subUnitId: u, drawingId: d });
|
|
2682
2617
|
else {
|
|
2683
|
-
const
|
|
2684
|
-
v =
|
|
2618
|
+
const w = this._shrinkCol(s, a, C, b, o);
|
|
2619
|
+
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
2685
2620
|
}
|
|
2686
2621
|
else if (t === 1 && f >= C && m <= b)
|
|
2687
|
-
if (h >=
|
|
2622
|
+
if (h >= _ && p <= S)
|
|
2688
2623
|
r.push({ unitId: c, subUnitId: u, drawingId: d });
|
|
2689
2624
|
else {
|
|
2690
|
-
const
|
|
2691
|
-
v =
|
|
2625
|
+
const w = this._shrinkRow(s, a, _, S, o);
|
|
2626
|
+
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
2692
2627
|
}
|
|
2693
2628
|
else if (t === 2) {
|
|
2694
|
-
const
|
|
2695
|
-
v =
|
|
2629
|
+
const w = this._expandRow(s, a, _, S, o);
|
|
2630
|
+
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
2696
2631
|
} else if (t === 3) {
|
|
2697
|
-
const
|
|
2698
|
-
v =
|
|
2632
|
+
const w = this._expandCol(s, a, C, b, o);
|
|
2633
|
+
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
2699
2634
|
}
|
|
2700
2635
|
if (v != null && D != null) {
|
|
2701
|
-
const
|
|
2702
|
-
n.push({ ...e, sheetTransform: v, transform:
|
|
2636
|
+
const w = z(v, this._selectionRenderService, this._skeletonManagerService);
|
|
2637
|
+
n.push({ ...e, sheetTransform: v, transform: w });
|
|
2703
2638
|
}
|
|
2704
2639
|
return { updateDrawings: n, deleteDrawings: r };
|
|
2705
2640
|
}
|
|
@@ -2718,9 +2653,9 @@ let ln = class extends ie {
|
|
|
2718
2653
|
if (f === O.None)
|
|
2719
2654
|
this._remainDrawingSize(h, r, l);
|
|
2720
2655
|
else {
|
|
2721
|
-
const { from: p, to: m } = g, { row:
|
|
2656
|
+
const { from: p, to: m } = g, { row: _, column: S } = p, { row: C, column: b } = m;
|
|
2722
2657
|
for (let v = 0; v < e.length; v++) {
|
|
2723
|
-
const D = e[v], { startRow:
|
|
2658
|
+
const D = e[v], { startRow: w, endRow: M, startColumn: I, endColumn: E } = D;
|
|
2724
2659
|
if (b < I)
|
|
2725
2660
|
continue;
|
|
2726
2661
|
if (f === O.Position) {
|
|
@@ -2812,15 +2747,15 @@ let ln = class extends ie {
|
|
|
2812
2747
|
if (f === O.None)
|
|
2813
2748
|
this._remainDrawingSize(h, r, l);
|
|
2814
2749
|
else {
|
|
2815
|
-
const { from: p, to: m } = g, { row:
|
|
2750
|
+
const { from: p, to: m } = g, { row: _, column: S } = p, { row: C, column: b } = m;
|
|
2816
2751
|
for (let v = 0; v < e.length; v++) {
|
|
2817
|
-
const D = e[v], { startRow:
|
|
2818
|
-
if (C <
|
|
2752
|
+
const D = e[v], { startRow: w, endRow: M, startColumn: I, endColumn: E } = D;
|
|
2753
|
+
if (C < w)
|
|
2819
2754
|
continue;
|
|
2820
2755
|
if (f === O.Position) {
|
|
2821
2756
|
let R = null, N = null;
|
|
2822
|
-
if (
|
|
2823
|
-
const j = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow:
|
|
2757
|
+
if (_ >= w && _ <= M) {
|
|
2758
|
+
const j = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: M });
|
|
2824
2759
|
if (j == null)
|
|
2825
2760
|
return;
|
|
2826
2761
|
N = { ...h, top: j.startY };
|
|
@@ -2832,11 +2767,11 @@ let ln = class extends ie {
|
|
|
2832
2767
|
this._remainDrawingSize(h, r, l);
|
|
2833
2768
|
continue;
|
|
2834
2769
|
}
|
|
2835
|
-
if (
|
|
2770
|
+
if (_ >= w && C <= M)
|
|
2836
2771
|
continue;
|
|
2837
2772
|
let T = null, y = null;
|
|
2838
|
-
if (
|
|
2839
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow:
|
|
2773
|
+
if (_ >= w && _ <= M) {
|
|
2774
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: M });
|
|
2840
2775
|
if (R == null)
|
|
2841
2776
|
return;
|
|
2842
2777
|
y = {
|
|
@@ -2844,8 +2779,8 @@ let ln = class extends ie {
|
|
|
2844
2779
|
top: (R == null ? void 0 : R.startY) || 0,
|
|
2845
2780
|
height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
|
|
2846
2781
|
};
|
|
2847
|
-
} else if (C >=
|
|
2848
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow:
|
|
2782
|
+
} else if (C >= w && C <= M) {
|
|
2783
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: C });
|
|
2849
2784
|
if (R == null)
|
|
2850
2785
|
return;
|
|
2851
2786
|
y = {
|
|
@@ -2853,7 +2788,7 @@ let ln = class extends ie {
|
|
|
2853
2788
|
top: R.startY - ((h == null ? void 0 : h.height) || 0)
|
|
2854
2789
|
};
|
|
2855
2790
|
} else {
|
|
2856
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow:
|
|
2791
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: M });
|
|
2857
2792
|
if (R == null)
|
|
2858
2793
|
return;
|
|
2859
2794
|
if (y = {
|
|
@@ -2893,19 +2828,19 @@ let ln = class extends ie {
|
|
|
2893
2828
|
this._remainDrawingSize(u, s, a);
|
|
2894
2829
|
else {
|
|
2895
2830
|
const { from: l, to: g } = c, { row: h, column: f } = l, { row: p, column: m } = g;
|
|
2896
|
-
for (let
|
|
2897
|
-
const S = e[
|
|
2831
|
+
for (let _ = 0; _ < e.length; _++) {
|
|
2832
|
+
const S = e[_], { startRow: C, endRow: b, startColumn: v, endColumn: D } = S;
|
|
2898
2833
|
if (p < C || m < v)
|
|
2899
2834
|
continue;
|
|
2900
2835
|
if (d === O.Position && (h <= C && p >= b || f <= v && m >= D)) {
|
|
2901
2836
|
this._remainDrawingSize(u, s, a);
|
|
2902
2837
|
continue;
|
|
2903
2838
|
}
|
|
2904
|
-
const
|
|
2905
|
-
if (
|
|
2839
|
+
const w = z({ ...c }, this._selectionRenderService, this._skeletonManagerService);
|
|
2840
|
+
if (w != null) {
|
|
2906
2841
|
s.push({
|
|
2907
2842
|
...a,
|
|
2908
|
-
transform:
|
|
2843
|
+
transform: w
|
|
2909
2844
|
});
|
|
2910
2845
|
break;
|
|
2911
2846
|
}
|
|
@@ -2930,10 +2865,10 @@ let ln = class extends ie {
|
|
|
2930
2865
|
const { toRange: t, fromRange: e } = i, n = ae(this._univerInstanceService);
|
|
2931
2866
|
if (!n)
|
|
2932
2867
|
return { redos: [], undos: [] };
|
|
2933
|
-
const { unitId: r, subUnitId: s } = n, o = (b = (C = this._renderManagerService.getRenderById(r)) == null ? void 0 : C.with(
|
|
2868
|
+
const { unitId: r, subUnitId: s } = n, o = (b = (C = this._renderManagerService.getRenderById(r)) == null ? void 0 : C.with(V)) == null ? void 0 : b.getCurrentSkeleton();
|
|
2934
2869
|
if (!o)
|
|
2935
2870
|
return { redos: [], undos: [] };
|
|
2936
|
-
const a =
|
|
2871
|
+
const a = Jn(o, e);
|
|
2937
2872
|
if (!a)
|
|
2938
2873
|
return { redos: [], undos: [] };
|
|
2939
2874
|
const { startX: c, endX: u, startY: d, endY: l } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
|
|
@@ -2941,10 +2876,10 @@ let ln = class extends ie {
|
|
|
2941
2876
|
const D = g[v];
|
|
2942
2877
|
if (D.anchorType !== O.Both)
|
|
2943
2878
|
return;
|
|
2944
|
-
const { transform:
|
|
2945
|
-
if (!
|
|
2879
|
+
const { transform: w } = D;
|
|
2880
|
+
if (!w)
|
|
2946
2881
|
return;
|
|
2947
|
-
const { left: M = 0, top: I = 0, width: E = 0, height: T = 0 } =
|
|
2882
|
+
const { left: M = 0, top: I = 0, width: E = 0, height: T = 0 } = w, { drawingStartX: y, drawingEndX: R, drawingStartY: N, drawingEndY: j } = {
|
|
2948
2883
|
drawingStartX: M,
|
|
2949
2884
|
drawingEndX: M + E,
|
|
2950
2885
|
drawingStartY: I,
|
|
@@ -2952,22 +2887,22 @@ let ln = class extends ie {
|
|
|
2952
2887
|
};
|
|
2953
2888
|
c <= y && R <= u && d <= N && j <= l && h.push(D);
|
|
2954
2889
|
});
|
|
2955
|
-
const f = [], p = [], m = t.startRow - e.startRow,
|
|
2956
|
-
const D = v.sheetTransform,
|
|
2957
|
-
to: { ...D.to, row: D.to.row + m, column: D.to.column +
|
|
2958
|
-
from: { ...D.from, row: D.from.row + m, column: D.from.column +
|
|
2959
|
-
}, M =
|
|
2890
|
+
const f = [], p = [], m = t.startRow - e.startRow, _ = t.startColumn - e.startColumn, S = h.map((v) => {
|
|
2891
|
+
const D = v.sheetTransform, w = {
|
|
2892
|
+
to: { ...D.to, row: D.to.row + m, column: D.to.column + _ },
|
|
2893
|
+
from: { ...D.from, row: D.from.row + m, column: D.from.column + _ }
|
|
2894
|
+
}, M = z(w, this._selectionRenderService, this._skeletonManagerService);
|
|
2960
2895
|
return {
|
|
2961
2896
|
unitId: r,
|
|
2962
2897
|
subUnitId: s,
|
|
2963
2898
|
drawingId: v.drawingId,
|
|
2964
2899
|
transform: M,
|
|
2965
|
-
sheetTransform:
|
|
2900
|
+
sheetTransform: w
|
|
2966
2901
|
};
|
|
2967
2902
|
});
|
|
2968
2903
|
if (S.length) {
|
|
2969
|
-
const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: D, redo:
|
|
2970
|
-
f.push({ id: U.id, params: { unitId: r, subUnitId: s, op:
|
|
2904
|
+
const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: D, redo: w, objects: M } = v;
|
|
2905
|
+
f.push({ id: U.id, params: { unitId: r, subUnitId: s, op: w, objects: M, type: P.UPDATE } }), p.push({ id: U.id, params: { unitId: r, subUnitId: s, op: D, objects: M, type: P.UPDATE } });
|
|
2971
2906
|
}
|
|
2972
2907
|
return { redos: f, undos: p };
|
|
2973
2908
|
}
|
|
@@ -2977,19 +2912,19 @@ let ln = class extends ie {
|
|
|
2977
2912
|
return { redos: [], undos: [] };
|
|
2978
2913
|
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow, c = [], u = [], d = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
|
|
2979
2914
|
if (Object.keys(d).forEach((h) => {
|
|
2980
|
-
const f = d[h], { sheetTransform: p, transform: m, anchorType:
|
|
2915
|
+
const f = d[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
|
|
2981
2916
|
if (p == null || m == null)
|
|
2982
2917
|
return;
|
|
2983
2918
|
let S, C;
|
|
2984
2919
|
if (t === "insert") {
|
|
2985
|
-
const v = this._expandRow(p, m, o, a,
|
|
2920
|
+
const v = this._expandRow(p, m, o, a, _);
|
|
2986
2921
|
S = v == null ? void 0 : v.newSheetTransform, C = v == null ? void 0 : v.newTransform;
|
|
2987
2922
|
} else {
|
|
2988
|
-
const { from: v, to: D } = p, { row:
|
|
2989
|
-
if (
|
|
2923
|
+
const { from: v, to: D } = p, { row: w } = v, { row: M } = D;
|
|
2924
|
+
if (_ === O.Both && w >= o && M <= a)
|
|
2990
2925
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2991
2926
|
else {
|
|
2992
|
-
const I = this._shrinkRow(p, m, o, a,
|
|
2927
|
+
const I = this._shrinkRow(p, m, o, a, _);
|
|
2993
2928
|
S = I == null ? void 0 : I.newSheetTransform, C = I == null ? void 0 : I.newTransform;
|
|
2994
2929
|
}
|
|
2995
2930
|
}
|
|
@@ -3018,19 +2953,19 @@ let ln = class extends ie {
|
|
|
3018
2953
|
return { redos: [], undos: [] };
|
|
3019
2954
|
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn, c = [], u = [], d = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
|
|
3020
2955
|
if (Object.keys(d).forEach((h) => {
|
|
3021
|
-
const f = d[h], { sheetTransform: p, transform: m, anchorType:
|
|
2956
|
+
const f = d[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
|
|
3022
2957
|
if (p == null || m == null)
|
|
3023
2958
|
return;
|
|
3024
2959
|
let S, C;
|
|
3025
2960
|
if (t === "insert") {
|
|
3026
|
-
const v = this._expandCol(p, m, o, a,
|
|
2961
|
+
const v = this._expandCol(p, m, o, a, _);
|
|
3027
2962
|
S = v == null ? void 0 : v.newSheetTransform, C = v == null ? void 0 : v.newTransform;
|
|
3028
2963
|
} else {
|
|
3029
|
-
const { from: v, to: D } = p, { column:
|
|
3030
|
-
if (
|
|
2964
|
+
const { from: v, to: D } = p, { column: w } = v, { column: M } = D;
|
|
2965
|
+
if (_ === O.Both && w >= o && M <= a)
|
|
3031
2966
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
3032
2967
|
else {
|
|
3033
|
-
const I = this._shrinkCol(p, m, o, a,
|
|
2968
|
+
const I = this._shrinkCol(p, m, o, a, _);
|
|
3034
2969
|
S = I == null ? void 0 : I.newSheetTransform, C = I == null ? void 0 : I.newTransform;
|
|
3035
2970
|
}
|
|
3036
2971
|
}
|
|
@@ -3068,7 +3003,7 @@ let ln = class extends ie {
|
|
|
3068
3003
|
d = {
|
|
3069
3004
|
from: { ...o },
|
|
3070
3005
|
to: { ...a, column: u + s }
|
|
3071
|
-
}, l =
|
|
3006
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
3072
3007
|
else
|
|
3073
3008
|
return {
|
|
3074
3009
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
@@ -3091,7 +3026,7 @@ let ln = class extends ie {
|
|
|
3091
3026
|
d = {
|
|
3092
3027
|
from: { ...o, column: c - s },
|
|
3093
3028
|
to: { ...a, column: u - s }
|
|
3094
|
-
}, l =
|
|
3029
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
3095
3030
|
else {
|
|
3096
3031
|
if (c >= e && u <= n)
|
|
3097
3032
|
return null;
|
|
@@ -3100,7 +3035,7 @@ let ln = class extends ie {
|
|
|
3100
3035
|
d = {
|
|
3101
3036
|
from: { ...o },
|
|
3102
3037
|
to: { ...a, column: u - s }
|
|
3103
|
-
}, l =
|
|
3038
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
3104
3039
|
else
|
|
3105
3040
|
return {
|
|
3106
3041
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
@@ -3128,7 +3063,7 @@ let ln = class extends ie {
|
|
|
3128
3063
|
d = {
|
|
3129
3064
|
from: { ...o },
|
|
3130
3065
|
to: { ...a, column: e - 1, columnOffset: g.endX - g.startX }
|
|
3131
|
-
}, l =
|
|
3066
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
3132
3067
|
}
|
|
3133
3068
|
}
|
|
3134
3069
|
return d != null && l != null ? {
|
|
@@ -3157,7 +3092,7 @@ let ln = class extends ie {
|
|
|
3157
3092
|
...a,
|
|
3158
3093
|
row: u + s
|
|
3159
3094
|
}
|
|
3160
|
-
}, l =
|
|
3095
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
3161
3096
|
else
|
|
3162
3097
|
return {
|
|
3163
3098
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
@@ -3180,7 +3115,7 @@ let ln = class extends ie {
|
|
|
3180
3115
|
d = {
|
|
3181
3116
|
from: { ...o, row: c - s },
|
|
3182
3117
|
to: { ...a, row: u - s }
|
|
3183
|
-
}, l =
|
|
3118
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
3184
3119
|
else {
|
|
3185
3120
|
if (c >= e && u <= n)
|
|
3186
3121
|
return null;
|
|
@@ -3189,7 +3124,7 @@ let ln = class extends ie {
|
|
|
3189
3124
|
d = {
|
|
3190
3125
|
from: { ...o },
|
|
3191
3126
|
to: { ...a, row: u - s }
|
|
3192
|
-
}, l =
|
|
3127
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
3193
3128
|
else
|
|
3194
3129
|
return {
|
|
3195
3130
|
newSheetTransform: x({ ...t }, this._selectionRenderService),
|
|
@@ -3212,7 +3147,7 @@ let ln = class extends ie {
|
|
|
3212
3147
|
d = {
|
|
3213
3148
|
from: { ...o },
|
|
3214
3149
|
to: { ...a, row: e - 1, rowOffset: g.endY - g.startY }
|
|
3215
|
-
}, l =
|
|
3150
|
+
}, l = z(d, this._selectionRenderService, this._skeletonManagerService);
|
|
3216
3151
|
}
|
|
3217
3152
|
}
|
|
3218
3153
|
return d != null && l != null ? {
|
|
@@ -3226,7 +3161,7 @@ let ln = class extends ie {
|
|
|
3226
3161
|
// but the skeleton changes like other render modules. These two signals are not equivalent.
|
|
3227
3162
|
// As a temp solution, I subscribed to activate$ here.
|
|
3228
3163
|
this._commandService.onCommandExecuted((i) => {
|
|
3229
|
-
if (i.id ===
|
|
3164
|
+
if (i.id === rs.id) {
|
|
3230
3165
|
const { unitId: t, subUnitId: e } = i.params;
|
|
3231
3166
|
this._updateDrawings(t, e);
|
|
3232
3167
|
}
|
|
@@ -3266,7 +3201,7 @@ let ln = class extends ie {
|
|
|
3266
3201
|
c != null && Object.keys(c).forEach((u) => {
|
|
3267
3202
|
if (s === i && a === t) {
|
|
3268
3203
|
const d = c[u];
|
|
3269
|
-
d.transform =
|
|
3204
|
+
d.transform = z(d.sheetTransform, this._selectionRenderService, this._skeletonManagerService), n.push(c[u]);
|
|
3270
3205
|
} else
|
|
3271
3206
|
r.push(c[u]);
|
|
3272
3207
|
});
|
|
@@ -3277,7 +3212,7 @@ let ln = class extends ie {
|
|
|
3277
3212
|
_sheetRefreshListener() {
|
|
3278
3213
|
this.disposeWithMe(
|
|
3279
3214
|
this._commandService.onCommandExecuted((i) => {
|
|
3280
|
-
|
|
3215
|
+
qs.includes(i.id) && requestIdleCallback(() => {
|
|
3281
3216
|
const t = i.params, { unitId: e, subUnitId: n, ranges: r } = t;
|
|
3282
3217
|
this._refreshDrawingTransform(e, n, r);
|
|
3283
3218
|
});
|
|
@@ -3292,8 +3227,8 @@ let ln = class extends ie {
|
|
|
3292
3227
|
return !0;
|
|
3293
3228
|
const { from: d, to: l } = a, { row: g, column: h } = d, { row: f, column: p } = l;
|
|
3294
3229
|
for (let m = 0; m < e.length; m++) {
|
|
3295
|
-
const
|
|
3296
|
-
if (
|
|
3230
|
+
const _ = e[m], { startRow: S, endRow: C, startColumn: b, endColumn: v } = _;
|
|
3231
|
+
if (Jr.intersects(
|
|
3297
3232
|
{
|
|
3298
3233
|
startRow: S,
|
|
3299
3234
|
endRow: C,
|
|
@@ -3307,13 +3242,13 @@ let ln = class extends ie {
|
|
|
3307
3242
|
endColumn: p
|
|
3308
3243
|
}
|
|
3309
3244
|
) || g > C || h > v) {
|
|
3310
|
-
const D = u === O.Position,
|
|
3245
|
+
const D = u === O.Position, w = z(a, this._selectionRenderService, this._skeletonManagerService);
|
|
3311
3246
|
r.push({
|
|
3312
3247
|
...o,
|
|
3313
3248
|
transform: {
|
|
3314
|
-
...
|
|
3315
|
-
width: D ? c == null ? void 0 : c.width :
|
|
3316
|
-
height: D ? c == null ? void 0 : c.height :
|
|
3249
|
+
...w,
|
|
3250
|
+
width: D ? c == null ? void 0 : c.width : w == null ? void 0 : w.width,
|
|
3251
|
+
height: D ? c == null ? void 0 : c.height : w == null ? void 0 : w.height
|
|
3317
3252
|
}
|
|
3318
3253
|
});
|
|
3319
3254
|
break;
|
|
@@ -3322,16 +3257,16 @@ let ln = class extends ie {
|
|
|
3322
3257
|
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(F.id, [i]));
|
|
3323
3258
|
}
|
|
3324
3259
|
};
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
],
|
|
3260
|
+
cn = Zs([
|
|
3261
|
+
pe(1, q),
|
|
3262
|
+
pe(2, G),
|
|
3263
|
+
pe(3, Ve),
|
|
3264
|
+
pe(4, A(V)),
|
|
3265
|
+
pe(5, A($t)),
|
|
3266
|
+
pe(6, oe),
|
|
3267
|
+
pe(7, se),
|
|
3268
|
+
pe(8, Se)
|
|
3269
|
+
], cn);
|
|
3335
3270
|
var re = function() {
|
|
3336
3271
|
return re = Object.assign || function(i) {
|
|
3337
3272
|
for (var t, e = 1, n = arguments.length; e < n; e++) {
|
|
@@ -3340,23 +3275,23 @@ var re = function() {
|
|
|
3340
3275
|
}
|
|
3341
3276
|
return i;
|
|
3342
3277
|
}, re.apply(this, arguments);
|
|
3343
|
-
},
|
|
3278
|
+
}, Qs = function(i, t) {
|
|
3344
3279
|
var e = {};
|
|
3345
3280
|
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && t.indexOf(n) < 0 && (e[n] = i[n]);
|
|
3346
3281
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
3347
3282
|
for (var r = 0, n = Object.getOwnPropertySymbols(i); r < n.length; r++)
|
|
3348
3283
|
t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (e[n[r]] = i[n[r]]);
|
|
3349
3284
|
return e;
|
|
3350
|
-
},
|
|
3351
|
-
var e = i.icon, n = i.id, r = i.className, s = i.extend, o =
|
|
3352
|
-
return
|
|
3285
|
+
}, Er = wr(function(i, t) {
|
|
3286
|
+
var e = i.icon, n = i.id, r = i.className, s = i.extend, o = Qs(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), c = as("_".concat(no()));
|
|
3287
|
+
return Tr(e, "".concat(n), { defIds: e.defIds, idSuffix: c.current }, re({ ref: t, className: a }, o), s);
|
|
3353
3288
|
});
|
|
3354
|
-
function
|
|
3355
|
-
return
|
|
3356
|
-
return
|
|
3289
|
+
function Tr(i, t, e, n, r) {
|
|
3290
|
+
return _r(i.tag, re(re({ key: t }, eo(i, e, r)), n), (to(i, e).children || []).map(function(s, o) {
|
|
3291
|
+
return Tr(s, "".concat(t, "-").concat(i.tag, "-").concat(o), e, void 0, r);
|
|
3357
3292
|
}));
|
|
3358
3293
|
}
|
|
3359
|
-
function
|
|
3294
|
+
function eo(i, t, e) {
|
|
3360
3295
|
var n = re({}, i.attrs);
|
|
3361
3296
|
e != null && e.colorChannel1 && n.fill === "colorChannel1" && (n.fill = e.colorChannel1), i.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(function(s) {
|
|
3362
3297
|
var o = s[0], a = s[1];
|
|
@@ -3368,25 +3303,25 @@ function to(i, t, e) {
|
|
|
3368
3303
|
typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
3369
3304
|
})), n;
|
|
3370
3305
|
}
|
|
3371
|
-
function
|
|
3306
|
+
function to(i, t) {
|
|
3372
3307
|
var e, n = t.defIds;
|
|
3373
3308
|
return !n || n.length === 0 ? i : i.tag === "defs" && (!((e = i.children) === null || e === void 0) && e.length) ? re(re({}, i), { children: i.children.map(function(r) {
|
|
3374
3309
|
return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? re(re({}, r), { attrs: re(re({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
|
|
3375
3310
|
}) }) : i;
|
|
3376
3311
|
}
|
|
3377
|
-
function
|
|
3312
|
+
function no() {
|
|
3378
3313
|
return Math.random().toString(36).substring(2, 8);
|
|
3379
3314
|
}
|
|
3380
|
-
|
|
3381
|
-
var
|
|
3382
|
-
return
|
|
3315
|
+
Er.displayName = "UniverIcon";
|
|
3316
|
+
var ro = { 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" } }] }, Or = wr(function(i, t) {
|
|
3317
|
+
return _r(Er, Object.assign({}, i, {
|
|
3383
3318
|
id: "add-image-single",
|
|
3384
3319
|
ref: t,
|
|
3385
|
-
icon:
|
|
3320
|
+
icon: ro
|
|
3386
3321
|
}));
|
|
3387
3322
|
});
|
|
3388
|
-
|
|
3389
|
-
const
|
|
3323
|
+
Or.displayName = "AddImageSingle";
|
|
3324
|
+
const Pr = {
|
|
3390
3325
|
id: "sheet.command.delete-drawing",
|
|
3391
3326
|
type: J.COMMAND,
|
|
3392
3327
|
handler: (i) => {
|
|
@@ -3402,16 +3337,16 @@ const Ar = {
|
|
|
3402
3337
|
drawingType: d
|
|
3403
3338
|
};
|
|
3404
3339
|
});
|
|
3405
|
-
return t.executeCommand(
|
|
3340
|
+
return t.executeCommand(it.id, {
|
|
3406
3341
|
unitId: r,
|
|
3407
3342
|
drawings: s
|
|
3408
3343
|
});
|
|
3409
3344
|
}
|
|
3410
|
-
},
|
|
3345
|
+
}, st = {
|
|
3411
3346
|
id: "sheet.command.move-drawing",
|
|
3412
3347
|
type: J.COMMAND,
|
|
3413
3348
|
handler: (i, t) => {
|
|
3414
|
-
const e = i.get(G), n = i.get(oe), r = i.get(
|
|
3349
|
+
const e = i.get(G), n = i.get(oe), r = i.get(Ve), { direction: s } = t, o = n.getFocusDrawings();
|
|
3415
3350
|
if (o.length === 0)
|
|
3416
3351
|
return !1;
|
|
3417
3352
|
const a = o[0].unitId, c = o.map((d) => {
|
|
@@ -3419,64 +3354,64 @@ const Ar = {
|
|
|
3419
3354
|
if (l == null)
|
|
3420
3355
|
return null;
|
|
3421
3356
|
const g = { ...l }, { left: h = 0, top: f = 0 } = l;
|
|
3422
|
-
return s ===
|
|
3357
|
+
return s === ve.UP ? g.top = f - 1 : s === ve.DOWN ? g.top = f + 1 : s === ve.LEFT ? g.left = h - 1 : s === ve.RIGHT && (g.left = h + 1), {
|
|
3423
3358
|
...d,
|
|
3424
3359
|
transform: g,
|
|
3425
3360
|
sheetTransform: x(g, r)
|
|
3426
3361
|
};
|
|
3427
3362
|
}).filter((d) => d != null);
|
|
3428
|
-
return e.syncExecuteCommand(
|
|
3363
|
+
return e.syncExecuteCommand(Lt.id, {
|
|
3429
3364
|
unitId: a,
|
|
3430
3365
|
drawings: c
|
|
3431
3366
|
}) ? (e.syncExecuteCommand(F.id, [a]), !0) : !1;
|
|
3432
3367
|
}
|
|
3433
|
-
},
|
|
3434
|
-
function
|
|
3368
|
+
}, Ur = "addition-and-subtraction-single", Ar = "sheet.menu.image";
|
|
3369
|
+
function io(i) {
|
|
3435
3370
|
return {
|
|
3436
|
-
id:
|
|
3437
|
-
type:
|
|
3438
|
-
icon:
|
|
3371
|
+
id: Ar,
|
|
3372
|
+
type: un.SUBITEMS,
|
|
3373
|
+
icon: Ur,
|
|
3439
3374
|
tooltip: "sheetImage.title",
|
|
3440
|
-
hidden$:
|
|
3441
|
-
disabled$:
|
|
3375
|
+
hidden$: ln(i, L.UNIVER_SHEET),
|
|
3376
|
+
disabled$: Oi(i, { workbookTypes: [Qt], worksheetTypes: [en], rangeTypes: [is] })
|
|
3442
3377
|
};
|
|
3443
3378
|
}
|
|
3444
|
-
function
|
|
3379
|
+
function so(i) {
|
|
3445
3380
|
return {
|
|
3446
|
-
id:
|
|
3381
|
+
id: Ft.id,
|
|
3447
3382
|
title: "sheetImage.upload.float",
|
|
3448
|
-
type:
|
|
3449
|
-
hidden$:
|
|
3383
|
+
type: un.BUTTON,
|
|
3384
|
+
hidden$: ln(i, L.UNIVER_SHEET)
|
|
3450
3385
|
};
|
|
3451
3386
|
}
|
|
3452
|
-
function
|
|
3387
|
+
function oo(i) {
|
|
3453
3388
|
return {
|
|
3454
|
-
id:
|
|
3389
|
+
id: mn.id,
|
|
3455
3390
|
title: "sheetImage.upload.cell",
|
|
3456
|
-
type:
|
|
3457
|
-
hidden$:
|
|
3391
|
+
type: un.BUTTON,
|
|
3392
|
+
hidden$: ln(i, L.UNIVER_SHEET)
|
|
3458
3393
|
};
|
|
3459
3394
|
}
|
|
3460
|
-
const
|
|
3461
|
-
imageCommonPanel:
|
|
3462
|
-
imageCommonPanelGrid:
|
|
3463
|
-
imageCommonPanelBorder:
|
|
3464
|
-
imageCommonPanelTitle:
|
|
3465
|
-
imageCommonPanelRow:
|
|
3466
|
-
imageCommonPanelColumn:
|
|
3467
|
-
},
|
|
3395
|
+
const ao = "univer-image-common-panel", co = "univer-image-common-panel-grid", lo = "univer-image-common-panel-border", uo = "univer-image-common-panel-title", ho = "univer-image-common-panel-row", go = "univer-image-common-panel-column", we = {
|
|
3396
|
+
imageCommonPanel: ao,
|
|
3397
|
+
imageCommonPanelGrid: co,
|
|
3398
|
+
imageCommonPanelBorder: lo,
|
|
3399
|
+
imageCommonPanelTitle: uo,
|
|
3400
|
+
imageCommonPanelRow: ho,
|
|
3401
|
+
imageCommonPanelColumn: go
|
|
3402
|
+
}, mo = (i) => {
|
|
3468
3403
|
var C;
|
|
3469
|
-
const t =
|
|
3404
|
+
const t = Me(G), e = Me(rt), n = Me(se), r = Me(q), { drawings: s } = i, o = s[0];
|
|
3470
3405
|
if (o == null)
|
|
3471
3406
|
return;
|
|
3472
3407
|
const { unitId: a } = o, c = r.getRenderById(a), u = c == null ? void 0 : c.scene;
|
|
3473
3408
|
if (u == null)
|
|
3474
3409
|
return;
|
|
3475
|
-
const d = u.getTransformerByCreate(), [l, g] =
|
|
3410
|
+
const d = u.getTransformerByCreate(), [l, g] = rn(!0), h = (C = o.anchorType) != null ? C : O.Position, [f, p] = rn(h);
|
|
3476
3411
|
function m(b, v) {
|
|
3477
3412
|
const D = [];
|
|
3478
|
-
return b.forEach((
|
|
3479
|
-
const { oKey: M } =
|
|
3413
|
+
return b.forEach((w) => {
|
|
3414
|
+
const { oKey: M } = w, I = v.getDrawingOKey(M);
|
|
3480
3415
|
if (I == null)
|
|
3481
3416
|
return D.push(null), !0;
|
|
3482
3417
|
const { unitId: E, subUnitId: T, drawingId: y, drawingType: R, anchorType: N, sheetTransform: j } = I;
|
|
@@ -3490,12 +3425,12 @@ const co = "univer-image-common-panel", lo = "univer-image-common-panel-grid", u
|
|
|
3490
3425
|
});
|
|
3491
3426
|
}), D;
|
|
3492
3427
|
}
|
|
3493
|
-
|
|
3428
|
+
gn(() => {
|
|
3494
3429
|
const b = d.clearControl$.subscribe((D) => {
|
|
3495
3430
|
D === !0 && g(!1);
|
|
3496
3431
|
}), v = d.changeStart$.subscribe((D) => {
|
|
3497
3432
|
var I;
|
|
3498
|
-
const { objects:
|
|
3433
|
+
const { objects: w } = D, M = m(w, n);
|
|
3499
3434
|
if (M.length === 0)
|
|
3500
3435
|
g(!1);
|
|
3501
3436
|
else if (M.length >= 1) {
|
|
@@ -3508,153 +3443,153 @@ const co = "univer-image-common-panel", lo = "univer-image-common-panel-grid", u
|
|
|
3508
3443
|
v.unsubscribe(), b.unsubscribe();
|
|
3509
3444
|
};
|
|
3510
3445
|
}, []);
|
|
3511
|
-
function
|
|
3446
|
+
function _(b) {
|
|
3512
3447
|
p(b);
|
|
3513
3448
|
const v = n.getFocusDrawings();
|
|
3514
3449
|
if (v.length === 0)
|
|
3515
3450
|
return;
|
|
3516
|
-
const D = v.map((
|
|
3517
|
-
unitId:
|
|
3518
|
-
subUnitId:
|
|
3519
|
-
drawingId:
|
|
3451
|
+
const D = v.map((w) => ({
|
|
3452
|
+
unitId: w.unitId,
|
|
3453
|
+
subUnitId: w.subUnitId,
|
|
3454
|
+
drawingId: w.drawingId,
|
|
3520
3455
|
anchorType: b
|
|
3521
3456
|
}));
|
|
3522
|
-
t.executeCommand(
|
|
3457
|
+
t.executeCommand(Lt.id, {
|
|
3523
3458
|
unitId: v[0].unitId,
|
|
3524
3459
|
drawings: D
|
|
3525
3460
|
});
|
|
3526
3461
|
}
|
|
3527
3462
|
const S = (b) => b ? "block" : "none";
|
|
3528
|
-
return /* @__PURE__ */
|
|
3529
|
-
/* @__PURE__ */
|
|
3530
|
-
/* @__PURE__ */
|
|
3531
|
-
/* @__PURE__ */
|
|
3532
|
-
/* @__PURE__ */
|
|
3533
|
-
/* @__PURE__ */
|
|
3463
|
+
return /* @__PURE__ */ Et("div", { className: It(we.imageCommonPanelGrid, we.imageCommonPanelBorder), style: { display: S(l) }, children: [
|
|
3464
|
+
/* @__PURE__ */ K("div", { className: we.imageCommonPanelRow, children: /* @__PURE__ */ K("div", { className: It(we.imageCommonPanelColumn, we.imageCommonPanelTitle), children: /* @__PURE__ */ K("div", { children: e.t("drawing-anchor.title") }) }) }),
|
|
3465
|
+
/* @__PURE__ */ K("div", { className: It(we.imageCommonPanelRow), children: /* @__PURE__ */ K("div", { className: It(we.imageCommonPanelColumn), children: /* @__PURE__ */ Et(hs, { value: f, onChange: _, direction: "vertical", children: [
|
|
3466
|
+
/* @__PURE__ */ K(Kt, { value: O.Both, children: e.t("drawing-anchor.both") }),
|
|
3467
|
+
/* @__PURE__ */ K(Kt, { value: O.Position, children: e.t("drawing-anchor.position") }),
|
|
3468
|
+
/* @__PURE__ */ K(Kt, { value: O.None, children: e.t("drawing-anchor.none") })
|
|
3534
3469
|
] }) }) })
|
|
3535
3470
|
] });
|
|
3536
|
-
},
|
|
3537
|
-
const i =
|
|
3538
|
-
return
|
|
3471
|
+
}, fo = () => {
|
|
3472
|
+
const i = Me(se), t = i.getFocusDrawings(), [e, n] = rn(t);
|
|
3473
|
+
return gn(() => {
|
|
3539
3474
|
const r = i.focus$.subscribe((s) => {
|
|
3540
3475
|
n(s);
|
|
3541
3476
|
});
|
|
3542
3477
|
return () => {
|
|
3543
3478
|
r.unsubscribe();
|
|
3544
3479
|
};
|
|
3545
|
-
}, []), !!(e != null && e.length) && /* @__PURE__ */
|
|
3546
|
-
/* @__PURE__ */
|
|
3547
|
-
/* @__PURE__ */
|
|
3480
|
+
}, []), !!(e != null && e.length) && /* @__PURE__ */ Et("div", { className: we.imageCommonPanel, children: [
|
|
3481
|
+
/* @__PURE__ */ K(mi, { drawings: e }),
|
|
3482
|
+
/* @__PURE__ */ K(mo, { drawings: e })
|
|
3548
3483
|
] });
|
|
3549
|
-
},
|
|
3550
|
-
[
|
|
3551
|
-
[
|
|
3484
|
+
}, po = {
|
|
3485
|
+
[xi.FORMULAS_INSERT]: {
|
|
3486
|
+
[Ar]: {
|
|
3552
3487
|
order: 3,
|
|
3553
|
-
menuItemFactory:
|
|
3554
|
-
[
|
|
3488
|
+
menuItemFactory: io,
|
|
3489
|
+
[Ft.id]: {
|
|
3555
3490
|
order: 0,
|
|
3556
|
-
menuItemFactory:
|
|
3491
|
+
menuItemFactory: so
|
|
3557
3492
|
},
|
|
3558
|
-
[
|
|
3493
|
+
[mn.id]: {
|
|
3559
3494
|
order: 1,
|
|
3560
|
-
menuItemFactory:
|
|
3495
|
+
menuItemFactory: oo
|
|
3561
3496
|
}
|
|
3562
3497
|
}
|
|
3563
3498
|
}
|
|
3564
3499
|
};
|
|
3565
|
-
function
|
|
3566
|
-
return !i.getContextValue(
|
|
3500
|
+
function ot(i) {
|
|
3501
|
+
return !i.getContextValue(qr) && !i.getContextValue(Qr) && !i.getContextValue(ei) && i.getContextValue(Fe);
|
|
3567
3502
|
}
|
|
3568
|
-
const
|
|
3569
|
-
id:
|
|
3503
|
+
const wo = {
|
|
3504
|
+
id: st.id,
|
|
3570
3505
|
description: "shortcut.drawing-move-down",
|
|
3571
3506
|
group: "4_drawing-view",
|
|
3572
|
-
binding:
|
|
3507
|
+
binding: Ye.ARROW_DOWN,
|
|
3573
3508
|
priority: 100,
|
|
3574
|
-
preconditions:
|
|
3509
|
+
preconditions: ot,
|
|
3575
3510
|
staticParameters: {
|
|
3576
|
-
direction:
|
|
3511
|
+
direction: ve.DOWN
|
|
3577
3512
|
}
|
|
3578
|
-
},
|
|
3579
|
-
id:
|
|
3513
|
+
}, _o = {
|
|
3514
|
+
id: st.id,
|
|
3580
3515
|
description: "shortcut.drawing-move-up",
|
|
3581
3516
|
group: "4_drawing-view",
|
|
3582
|
-
binding:
|
|
3517
|
+
binding: Ye.ARROW_UP,
|
|
3583
3518
|
priority: 100,
|
|
3584
|
-
preconditions:
|
|
3519
|
+
preconditions: ot,
|
|
3585
3520
|
staticParameters: {
|
|
3586
|
-
direction:
|
|
3521
|
+
direction: ve.UP
|
|
3587
3522
|
}
|
|
3588
|
-
},
|
|
3589
|
-
id:
|
|
3523
|
+
}, vo = {
|
|
3524
|
+
id: st.id,
|
|
3590
3525
|
description: "shortcut.drawing-move-left",
|
|
3591
3526
|
group: "4_drawing-view",
|
|
3592
|
-
binding:
|
|
3527
|
+
binding: Ye.ARROW_LEFT,
|
|
3593
3528
|
priority: 100,
|
|
3594
|
-
preconditions:
|
|
3529
|
+
preconditions: ot,
|
|
3595
3530
|
staticParameters: {
|
|
3596
|
-
direction:
|
|
3531
|
+
direction: ve.LEFT
|
|
3597
3532
|
}
|
|
3598
|
-
},
|
|
3599
|
-
id:
|
|
3533
|
+
}, So = {
|
|
3534
|
+
id: st.id,
|
|
3600
3535
|
description: "shortcut.drawing-move-right",
|
|
3601
3536
|
group: "4_drawing-view",
|
|
3602
|
-
binding:
|
|
3537
|
+
binding: Ye.ARROW_RIGHT,
|
|
3603
3538
|
priority: 100,
|
|
3604
|
-
preconditions:
|
|
3539
|
+
preconditions: ot,
|
|
3605
3540
|
staticParameters: {
|
|
3606
|
-
direction:
|
|
3541
|
+
direction: ve.RIGHT
|
|
3607
3542
|
}
|
|
3608
|
-
},
|
|
3609
|
-
id:
|
|
3543
|
+
}, Io = {
|
|
3544
|
+
id: Pr.id,
|
|
3610
3545
|
description: "shortcut.drawing-delete",
|
|
3611
3546
|
group: "4_drawing-view",
|
|
3612
3547
|
// when focusing on any other input tag do not trigger this shortcut
|
|
3613
|
-
preconditions:
|
|
3614
|
-
binding:
|
|
3615
|
-
mac:
|
|
3548
|
+
preconditions: ot,
|
|
3549
|
+
binding: Ye.DELETE,
|
|
3550
|
+
mac: Ye.BACKSPACE
|
|
3616
3551
|
};
|
|
3617
|
-
var
|
|
3618
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
3552
|
+
var Co = Object.getOwnPropertyDescriptor, Do = (i, t, e, n) => {
|
|
3553
|
+
for (var r = n > 1 ? void 0 : n ? Co(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3619
3554
|
(o = i[s]) && (r = o(r) || r);
|
|
3620
3555
|
return r;
|
|
3621
3556
|
}, je = (i, t) => (e, n) => t(e, n, i);
|
|
3622
|
-
let
|
|
3557
|
+
let Bt = class extends ie {
|
|
3623
3558
|
constructor(i, t, e, n, r, s) {
|
|
3624
3559
|
super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
|
|
3625
3560
|
}
|
|
3626
3561
|
_initCustomComponents() {
|
|
3627
3562
|
const i = this._componentManager;
|
|
3628
|
-
this.disposeWithMe(i.register(
|
|
3563
|
+
this.disposeWithMe(i.register(Ur, Or)), this.disposeWithMe(i.register(vr, fo));
|
|
3629
3564
|
}
|
|
3630
3565
|
_initMenus() {
|
|
3631
|
-
this._menuManagerService.mergeMenu(
|
|
3566
|
+
this._menuManagerService.mergeMenu(po);
|
|
3632
3567
|
}
|
|
3633
3568
|
_initCommands() {
|
|
3634
3569
|
[
|
|
3635
|
-
Yt,
|
|
3636
|
-
wn,
|
|
3637
|
-
Lt,
|
|
3638
|
-
st,
|
|
3639
3570
|
Ft,
|
|
3640
|
-
|
|
3571
|
+
mn,
|
|
3572
|
+
xt,
|
|
3573
|
+
it,
|
|
3574
|
+
Lt,
|
|
3575
|
+
Sr,
|
|
3641
3576
|
F,
|
|
3642
|
-
|
|
3577
|
+
Ir,
|
|
3578
|
+
Cr,
|
|
3643
3579
|
br,
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
Rr
|
|
3580
|
+
st,
|
|
3581
|
+
Pr,
|
|
3582
|
+
Dr
|
|
3648
3583
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
3649
3584
|
}
|
|
3650
3585
|
_initShortcuts() {
|
|
3651
3586
|
[
|
|
3652
3587
|
// sheet drawing shortcuts
|
|
3588
|
+
wo,
|
|
3653
3589
|
_o,
|
|
3654
3590
|
vo,
|
|
3655
3591
|
So,
|
|
3656
|
-
Io
|
|
3657
|
-
Co
|
|
3592
|
+
Io
|
|
3658
3593
|
].forEach((i) => {
|
|
3659
3594
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
3660
3595
|
});
|
|
@@ -3663,97 +3598,97 @@ let Wt = class extends ie {
|
|
|
3663
3598
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
3664
3599
|
}
|
|
3665
3600
|
};
|
|
3666
|
-
|
|
3667
|
-
je(0, A(
|
|
3668
|
-
je(1,
|
|
3601
|
+
Bt = Do([
|
|
3602
|
+
je(0, A(Qn)),
|
|
3603
|
+
je(1, Li),
|
|
3669
3604
|
je(2, G),
|
|
3670
|
-
je(3,
|
|
3605
|
+
je(3, Fi),
|
|
3671
3606
|
je(4, se),
|
|
3672
|
-
je(5, A(
|
|
3673
|
-
],
|
|
3674
|
-
var
|
|
3675
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
3607
|
+
je(5, A(hn))
|
|
3608
|
+
], Bt);
|
|
3609
|
+
var bo = Object.defineProperty, Ro = Object.getOwnPropertyDescriptor, yo = (i, t, e) => t in i ? bo(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Mo = (i, t, e, n) => {
|
|
3610
|
+
for (var r = n > 1 ? void 0 : n ? Ro(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3676
3611
|
(o = i[s]) && (r = o(r) || r);
|
|
3677
3612
|
return r;
|
|
3678
|
-
},
|
|
3679
|
-
const
|
|
3680
|
-
let
|
|
3681
|
-
constructor(i =
|
|
3613
|
+
}, Zt = (i, t) => (e, n) => t(e, n, i), Nr = (i, t, e) => yo(i, typeof t != "symbol" ? t + "" : t, e);
|
|
3614
|
+
const Eo = "SHEET_IMAGE_UI_PLUGIN";
|
|
3615
|
+
let Wt = class extends ri {
|
|
3616
|
+
constructor(i = Yn, t, e, n) {
|
|
3682
3617
|
super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
|
|
3683
|
-
const { menu: r, ...s } =
|
|
3618
|
+
const { menu: r, ...s } = ii(
|
|
3684
3619
|
{},
|
|
3685
|
-
|
|
3620
|
+
Yn,
|
|
3686
3621
|
this._config
|
|
3687
3622
|
);
|
|
3688
3623
|
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(gs, s);
|
|
3689
3624
|
}
|
|
3690
3625
|
onStarting() {
|
|
3691
|
-
|
|
3692
|
-
[
|
|
3693
|
-
[Wt],
|
|
3694
|
-
[Ot],
|
|
3626
|
+
si(this._injector, [
|
|
3627
|
+
[nt],
|
|
3695
3628
|
[Bt],
|
|
3629
|
+
[Tt],
|
|
3696
3630
|
[kt],
|
|
3697
3631
|
[Nt],
|
|
3632
|
+
[At],
|
|
3633
|
+
[Ot],
|
|
3698
3634
|
[Pt],
|
|
3699
|
-
[Ut]
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
[rt]
|
|
3635
|
+
[Ut]
|
|
3636
|
+
]), Xt(this._injector, [
|
|
3637
|
+
[nt]
|
|
3703
3638
|
]);
|
|
3704
3639
|
}
|
|
3705
3640
|
onReady() {
|
|
3706
|
-
|
|
3707
|
-
[
|
|
3708
|
-
[
|
|
3641
|
+
Xt(this._injector, [
|
|
3642
|
+
[At],
|
|
3643
|
+
[Ut]
|
|
3709
3644
|
]);
|
|
3710
3645
|
}
|
|
3711
3646
|
onRendered() {
|
|
3712
|
-
this._registerRenderModules(),
|
|
3647
|
+
this._registerRenderModules(), Xt(this._injector, [
|
|
3648
|
+
[Nt],
|
|
3713
3649
|
[kt],
|
|
3714
3650
|
[Bt],
|
|
3715
|
-
[
|
|
3716
|
-
[Pt]
|
|
3717
|
-
[Ut]
|
|
3651
|
+
[Ot],
|
|
3652
|
+
[Pt]
|
|
3718
3653
|
]);
|
|
3719
3654
|
}
|
|
3720
3655
|
onSteady() {
|
|
3721
|
-
this._injector.get(
|
|
3656
|
+
this._injector.get(Tt);
|
|
3722
3657
|
}
|
|
3723
3658
|
_registerRenderModules() {
|
|
3724
3659
|
[
|
|
3725
|
-
[
|
|
3726
|
-
[ln],
|
|
3660
|
+
[tt],
|
|
3727
3661
|
[cn],
|
|
3728
|
-
[
|
|
3662
|
+
[on],
|
|
3663
|
+
[sn]
|
|
3729
3664
|
].forEach((i) => {
|
|
3730
3665
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(L.UNIVER_SHEET, i));
|
|
3731
3666
|
});
|
|
3732
3667
|
}
|
|
3733
3668
|
};
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
],
|
|
3669
|
+
Nr(Wt, "type", L.UNIVER_SHEET);
|
|
3670
|
+
Nr(Wt, "pluginName", Eo);
|
|
3671
|
+
Wt = Mo([
|
|
3672
|
+
ti(di, ai, fi, vi),
|
|
3673
|
+
Zt(1, A(Xe)),
|
|
3674
|
+
Zt(2, q),
|
|
3675
|
+
Zt(3, ni)
|
|
3676
|
+
], Wt);
|
|
3742
3677
|
export {
|
|
3743
3678
|
F as ClearSheetDrawingTransformerOperation,
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3679
|
+
Pr as DeleteDrawingsCommand,
|
|
3680
|
+
Ir as EditSheetDrawingOperation,
|
|
3681
|
+
Cr as GroupSheetDrawingCommand,
|
|
3682
|
+
Ft as InsertFloatImageCommand,
|
|
3683
|
+
xt as InsertSheetDrawingCommand,
|
|
3684
|
+
st as MoveDrawingsCommand,
|
|
3685
|
+
it as RemoveSheetDrawingCommand,
|
|
3686
|
+
Ar as SHEETS_IMAGE_MENU_ID,
|
|
3687
|
+
Dr as SetDrawingArrangeCommand,
|
|
3688
|
+
Lt as SetSheetDrawingCommand,
|
|
3689
|
+
nt as SheetCanvasFloatDomManagerService,
|
|
3690
|
+
tt as SheetDrawingUpdateController,
|
|
3691
|
+
Sr as SidebarSheetDrawingOperation,
|
|
3692
|
+
br as UngroupSheetDrawingCommand,
|
|
3693
|
+
Wt as UniverSheetsDrawingUIPlugin
|
|
3759
3694
|
};
|