@univerjs/sheets-drawing-ui 0.5.0-nightly.202411111606 → 0.5.0-nightly.202411120616
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 +515 -508
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +1 -0
- package/lib/umd/index.js +2 -2
- package/package.json +10 -10
package/lib/es/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { IDrawingManagerService as
|
|
6
|
-
import { ImageCropperObject as
|
|
7
|
-
import { IRenderManagerService as J, precisionTo as ne, getGroupState as
|
|
8
|
-
import { ISheetDrawingService as
|
|
9
|
-
import { SheetCanvasPopManagerService as
|
|
10
|
-
import { ISidebarService as
|
|
11
|
-
import { takeUntil as
|
|
12
|
-
import { SheetInterceptorService as
|
|
13
|
-
import
|
|
14
|
-
import { MessageType as
|
|
15
|
-
const
|
|
1
|
+
var mn = Object.defineProperty;
|
|
2
|
+
var fn = (i, e, n) => e in i ? mn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var G = (i, e, n) => fn(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CommandType as X, ICommandService as W, IUndoRedoService as he, sequenceExecute as Ct, LocaleService as Ge, IUniverInstanceService as pe, useDependency as oe, Inject as x, Injector as Rt, IContextService as Dt, RxDisposable as pn, UniverInstanceType as k, connectInjector as wn, toDisposable as _n, FOCUSING_COMMON_DRAWINGS as fe, Disposable as re, Direction as te, FOCUSING_FX_BAR_EDITOR as vn, EDITOR_ACTIVATED as Sn, FOCUSING_PANEL_EDITOR as In, Tools as me, UserManagerService as Cn, IPermissionService as Rn, Rectangle as Dn, LifecycleService as Mn, LifecycleStages as bn, DisposableCollection as yn, fromEventSubject as On, generateRandomId as Pn, DependentOn as Tn, Plugin as En, registerDependencies as Un, touchDependencies as He, IConfigService as An } from "@univerjs/core";
|
|
5
|
+
import { IDrawingManagerService as z, IImageIoService as Mt, DrawingTypeEnum as V, ArrangeTypeEnum as Se, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Nn, DRAWING_IMAGE_COUNT_LIMIT as ft, ImageUploadStatusType as ze, DRAWING_IMAGE_ALLOW_SIZE as jn, getImageSize as xn, DRAWING_IMAGE_WIDTH_LIMIT as pt, DRAWING_IMAGE_HEIGHT_LIMIT as wt, getDrawingShapeKeyByDrawingSearch as Ke, UniverDrawingPlugin as Ln } from "@univerjs/drawing";
|
|
6
|
+
import { ImageCropperObject as $n, COMPONENT_IMAGE_POPUP_MENU as Bn, OpenImageCropOperation as Wn, ImageResetSizeOperation as Gn, DrawingCommonPanel as Vn, DrawingRenderService as kn, UniverDrawingUIPlugin as Yn } from "@univerjs/drawing-ui";
|
|
7
|
+
import { IRenderManagerService as J, precisionTo as ne, getGroupState as Fn, transformObjectOutOfGroup as Xn, RENDER_CLASS_TYPE as le, Rect as _t, ObjectType as Hn, DRAWING_OBJECT_LAYER_INDEX as zn, copyPointEvent as Kn, SHEET_VIEWPORT_KEY as Jn } from "@univerjs/engine-render";
|
|
8
|
+
import { ISheetDrawingService as Y, SetDrawingApplyMutation as P, DrawingApplyType as T, SheetDrawingAnchorType as y, UniverSheetsDrawingPlugin as Zn } from "@univerjs/sheets-drawing";
|
|
9
|
+
import { SheetCanvasPopManagerService as qn, attachRangeWithCoord as Ee, ISheetSelectionRenderService as we, SheetSkeletonManagerService as q, getCurrentRangeDisable$ as Qn, COPY_TYPE as vt, PREDEFINED_HOOK_NAME as Ie, virtualizeDiscreteRanges as er, ISheetClipboardService as tr, SheetPrintInterceptorService as nr, VIEWPORT_KEY as rr, SetZoomRatioOperation as ir } from "@univerjs/sheets-ui";
|
|
10
|
+
import { ISidebarService as sr, IUIPartsService as or, BuiltInUIPart as ar, ILocalFileService as cr, IMessageService as dr, MenuItemType as bt, getMenuHiddenObservable as yt, RibbonStartGroup as lr, KeyCode as ue, ComponentManager as ur, IMenuManagerService as hr, IShortcutService as gr, CanvasFloatDomService as mr } from "@univerjs/ui";
|
|
11
|
+
import { takeUntil as St, combineLatest as Ce, map as Ue, filter as ae, distinctUntilChanged as Re, Subject as Je, take as fr, BehaviorSubject as pr, switchMap as wr } from "rxjs";
|
|
12
|
+
import { SheetInterceptorService as ct, getSheetCommandTarget as ce, SheetsSelectionsService as _r, WorkbookEditablePermission as nt, WorksheetEditPermission as Te, RangeProtectionPermissionEditPoint as vr, WorkbookViewPermission as It, WorksheetViewPermission as Ze, InsertRowCommand as Ot, InsertColCommand as Pt, RemoveRowCommand as Tt, RemoveColCommand as Et, DeleteRangeMoveLeftCommand as Ut, DeleteRangeMoveUpCommand as At, InsertRangeMoveDownCommand as Nt, InsertRangeMoveRightCommand as jt, DeltaRowHeightCommand as rt, SetRowHeightCommand as it, DeltaColumnWidthCommand as xt, SetColWidthCommand as Lt, SetRowHiddenCommand as $t, SetSpecificRowsVisibleCommand as Bt, SetSpecificColsVisibleCommand as Wt, SetColHiddenCommand as Gt, MoveColsCommand as Vt, MoveRowsCommand as kt, MoveRangeCommand as Yt, SetRowVisibleMutation as Sr, SetRowHiddenMutation as Ir, SetColVisibleMutation as Cr, SetColHiddenMutation as Rr, SetWorksheetRowHeightMutation as Dr, SetWorksheetColWidthMutation as Mr, SetWorksheetActiveOperation as br, SetFrozenMutation as yr } from "@univerjs/sheets";
|
|
13
|
+
import Ft, { useEffect as dt, forwardRef as Xt, useRef as Or, createElement as Ht, useState as st } from "react";
|
|
14
|
+
import { MessageType as De, RadioGroup as Pr, Radio as qe } from "@univerjs/design";
|
|
15
|
+
const Tr = "sheets-drawing-ui.config", Er = {}, j = {
|
|
16
16
|
id: "sheet.operation.clear-drawing-transformer",
|
|
17
|
-
type:
|
|
17
|
+
type: X.MUTATION,
|
|
18
18
|
handler: (i, e) => {
|
|
19
19
|
const n = i.get(J);
|
|
20
20
|
return e.forEach((t) => {
|
|
@@ -22,20 +22,20 @@ const Or = "sheets-drawing-ui.config", Pr = {}, j = {
|
|
|
22
22
|
(s = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
|
|
23
23
|
}), !0;
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, Ve = {
|
|
26
26
|
id: "sheet.command.remove-sheet-image",
|
|
27
|
-
type:
|
|
27
|
+
type: X.COMMAND,
|
|
28
28
|
handler: (i, e) => {
|
|
29
29
|
var S, v, R;
|
|
30
|
-
const n = i.get(W), t = i.get(
|
|
30
|
+
const n = i.get(W), t = i.get(he), r = i.get(ct), s = i.get(Y);
|
|
31
31
|
if (!e) return !1;
|
|
32
32
|
const { drawings: o } = e, d = [];
|
|
33
33
|
o.forEach((_) => {
|
|
34
34
|
const { unitId: C } = _;
|
|
35
35
|
d.push(C);
|
|
36
36
|
});
|
|
37
|
-
const l = s.getBatchRemoveOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = r.onCommandExecute({ id:
|
|
38
|
-
return
|
|
37
|
+
const l = s.getBatchRemoveOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = r.onCommandExecute({ id: Ve.id, params: e }), f = { id: P.id, params: { unitId: g, subUnitId: c, op: h, objects: u, type: T.REMOVE } }, p = { id: P.id, params: { unitId: g, subUnitId: c, op: a, objects: u, type: T.INSERT } };
|
|
38
|
+
return Ct([...(S = m.preRedos) != null ? S : [], f, ...m.redos], n) ? (t.pushUndoRedo({
|
|
39
39
|
unitID: g,
|
|
40
40
|
undoMutations: [
|
|
41
41
|
...(v = m.preUndos) != null ? v : [],
|
|
@@ -51,17 +51,17 @@ const Or = "sheets-drawing-ui.config", Pr = {}, j = {
|
|
|
51
51
|
]
|
|
52
52
|
}), !0) : !1;
|
|
53
53
|
}
|
|
54
|
-
},
|
|
54
|
+
}, zt = "COMPONENT_SHEET_DRAWING_PANEL", Kt = {
|
|
55
55
|
id: "sidebar.operation.sheet-image",
|
|
56
|
-
type:
|
|
56
|
+
type: X.COMMAND,
|
|
57
57
|
handler: async (i, e) => {
|
|
58
|
-
const n = i.get(
|
|
58
|
+
const n = i.get(sr), t = i.get(Ge), r = i.get(pe), s = i.get(z);
|
|
59
59
|
if (!ce(r)) return !1;
|
|
60
60
|
switch (e.value) {
|
|
61
61
|
case "open":
|
|
62
62
|
n.open({
|
|
63
63
|
header: { title: t.t("sheetImage.panel.title") },
|
|
64
|
-
children: { label:
|
|
64
|
+
children: { label: zt },
|
|
65
65
|
onClose: () => {
|
|
66
66
|
s.focusDrawing(null);
|
|
67
67
|
},
|
|
@@ -75,15 +75,15 @@ const Or = "sheets-drawing-ui.config", Pr = {}, j = {
|
|
|
75
75
|
}
|
|
76
76
|
return !0;
|
|
77
77
|
}
|
|
78
|
-
},
|
|
78
|
+
}, Jt = {
|
|
79
79
|
id: "sheet.operation.edit-sheet-image",
|
|
80
|
-
type:
|
|
80
|
+
type: X.OPERATION,
|
|
81
81
|
handler: (i, e) => {
|
|
82
|
-
const n = i.get(
|
|
83
|
-
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(
|
|
82
|
+
const n = i.get(z), t = i.get(W);
|
|
83
|
+
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(Kt.id, { value: "open" }), !0);
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
var
|
|
86
|
+
var Zt = { exports: {} }, ke = {};
|
|
87
87
|
/**
|
|
88
88
|
* @license React
|
|
89
89
|
* react-jsx-runtime.production.min.js
|
|
@@ -93,52 +93,52 @@ var Jt = { exports: {} }, Ve = {};
|
|
|
93
93
|
* This source code is licensed under the MIT license found in the
|
|
94
94
|
* LICENSE file in the root directory of this source tree.
|
|
95
95
|
*/
|
|
96
|
-
var
|
|
97
|
-
function
|
|
96
|
+
var Ur = Ft, Ar = Symbol.for("react.element"), Nr = Symbol.for("react.fragment"), jr = Object.prototype.hasOwnProperty, xr = Ur.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Lr = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
97
|
+
function qt(i, e, n) {
|
|
98
98
|
var t, r = {}, s = null, o = null;
|
|
99
99
|
n !== void 0 && (s = "" + n), e.key !== void 0 && (s = "" + e.key), e.ref !== void 0 && (o = e.ref);
|
|
100
|
-
for (t in e)
|
|
100
|
+
for (t in e) jr.call(e, t) && !Lr.hasOwnProperty(t) && (r[t] = e[t]);
|
|
101
101
|
if (i && i.defaultProps) for (t in e = i.defaultProps, e) r[t] === void 0 && (r[t] = e[t]);
|
|
102
|
-
return { $$typeof:
|
|
102
|
+
return { $$typeof: Ar, type: i, key: s, ref: o, props: r, _owner: xr.current };
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
var $ =
|
|
109
|
-
const
|
|
110
|
-
uploadLoading:
|
|
111
|
-
uploadLoadingBody:
|
|
112
|
-
uploadLoadingBodyAnimation:
|
|
113
|
-
univerCircleAnimation:
|
|
114
|
-
uploadLoadingBodyText:
|
|
115
|
-
},
|
|
116
|
-
const i = oe(
|
|
117
|
-
return
|
|
104
|
+
ke.Fragment = Nr;
|
|
105
|
+
ke.jsx = qt;
|
|
106
|
+
ke.jsxs = qt;
|
|
107
|
+
Zt.exports = ke;
|
|
108
|
+
var $ = Zt.exports;
|
|
109
|
+
const $r = "univer-upload-loading", Br = "univer-upload-loading-body", Wr = "univer-upload-loading-body-animation", Gr = "univer-UniverCircleAnimation", Vr = "univer-upload-loading-body-text", Me = {
|
|
110
|
+
uploadLoading: $r,
|
|
111
|
+
uploadLoadingBody: Br,
|
|
112
|
+
uploadLoadingBodyAnimation: Wr,
|
|
113
|
+
univerCircleAnimation: Gr,
|
|
114
|
+
uploadLoadingBodyText: Vr
|
|
115
|
+
}, kr = () => {
|
|
116
|
+
const i = oe(Mt), e = oe(Ge), [n, t] = Ft.useState(0);
|
|
117
|
+
return dt(() => {
|
|
118
118
|
const r = i.change$.subscribe((s) => {
|
|
119
119
|
t(s);
|
|
120
120
|
});
|
|
121
121
|
return () => {
|
|
122
122
|
r.unsubscribe();
|
|
123
123
|
};
|
|
124
|
-
}, [i]), /* @__PURE__ */ $.jsx("div", { style: { display: n > 0 ? "block" : "none" }, className:
|
|
125
|
-
/* @__PURE__ */ $.jsx("div", { className:
|
|
126
|
-
/* @__PURE__ */ $.jsx("div", { className:
|
|
124
|
+
}, [i]), /* @__PURE__ */ $.jsx("div", { style: { display: n > 0 ? "block" : "none" }, className: Me.uploadLoading, children: /* @__PURE__ */ $.jsxs("div", { className: Me.uploadLoadingBody, children: [
|
|
125
|
+
/* @__PURE__ */ $.jsx("div", { className: Me.uploadLoadingBodyAnimation }),
|
|
126
|
+
/* @__PURE__ */ $.jsx("div", { className: Me.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${n}` })
|
|
127
127
|
] }) });
|
|
128
128
|
};
|
|
129
|
-
var
|
|
130
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
129
|
+
var Yr = Object.defineProperty, Fr = Object.getOwnPropertyDescriptor, Xr = (i, e, n, t) => {
|
|
130
|
+
for (var r = t > 1 ? void 0 : t ? Fr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
131
131
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
132
|
-
return t && r &&
|
|
132
|
+
return t && r && Yr(e, n, r), r;
|
|
133
133
|
}, ie = (i, e) => (n, t) => e(n, t, i);
|
|
134
|
-
let
|
|
134
|
+
let Ae = class extends pn {
|
|
135
135
|
constructor(e, n, t, r, s, o, d) {
|
|
136
136
|
super();
|
|
137
|
-
|
|
137
|
+
G(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
138
138
|
this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = d, this._init();
|
|
139
139
|
}
|
|
140
140
|
_init() {
|
|
141
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
141
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(St(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(k.UNIVER_SHEET).pipe(St(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(k.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(ar.CONTENT, () => wn(kr, this._injector));
|
|
142
142
|
}
|
|
143
143
|
_dispose(e) {
|
|
144
144
|
const n = e.getUnitId();
|
|
@@ -153,7 +153,7 @@ let Ue = class extends fn {
|
|
|
153
153
|
_hasCropObject(e) {
|
|
154
154
|
const n = e.getAllObjectsByOrder();
|
|
155
155
|
for (const t of n)
|
|
156
|
-
if (t instanceof
|
|
156
|
+
if (t instanceof $n)
|
|
157
157
|
return !0;
|
|
158
158
|
return !1;
|
|
159
159
|
}
|
|
@@ -167,9 +167,9 @@ let Ue = class extends fn {
|
|
|
167
167
|
return;
|
|
168
168
|
let r;
|
|
169
169
|
this.disposeWithMe(
|
|
170
|
-
|
|
170
|
+
_n(
|
|
171
171
|
t.createControl$.subscribe(() => {
|
|
172
|
-
if (this._contextService.setContextValue(
|
|
172
|
+
if (this._contextService.setContextValue(fe, !0), this._hasCropObject(n))
|
|
173
173
|
return;
|
|
174
174
|
const o = t.getSelectedObjectMap();
|
|
175
175
|
if (o.size > 1) {
|
|
@@ -184,7 +184,7 @@ let Ue = class extends fn {
|
|
|
184
184
|
return;
|
|
185
185
|
const { unitId: c, subUnitId: a, drawingId: h, drawingType: u } = g, m = g.data;
|
|
186
186
|
m && m.disablePopup || (r == null || r.dispose(), r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
|
|
187
|
-
componentKey:
|
|
187
|
+
componentKey: Bn,
|
|
188
188
|
direction: "horizontal",
|
|
189
189
|
offset: [2, 0],
|
|
190
190
|
extraProps: {
|
|
@@ -199,7 +199,7 @@ let Ue = class extends fn {
|
|
|
199
199
|
)
|
|
200
200
|
), this.disposeWithMe(
|
|
201
201
|
t.clearControl$.subscribe(() => {
|
|
202
|
-
r == null || r.dispose(), this._contextService.setContextValue(
|
|
202
|
+
r == null || r.dispose(), this._contextService.setContextValue(fe, !1), this._drawingManagerService.focusDrawing(null);
|
|
203
203
|
})
|
|
204
204
|
), this.disposeWithMe(
|
|
205
205
|
t.changing$.subscribe(() => {
|
|
@@ -212,45 +212,45 @@ let Ue = class extends fn {
|
|
|
212
212
|
{
|
|
213
213
|
label: "image-popup.edit",
|
|
214
214
|
index: 0,
|
|
215
|
-
commandId:
|
|
215
|
+
commandId: Jt.id,
|
|
216
216
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
217
|
-
disable: r ===
|
|
217
|
+
disable: r === V.DRAWING_DOM
|
|
218
218
|
},
|
|
219
219
|
{
|
|
220
220
|
label: "image-popup.delete",
|
|
221
221
|
index: 1,
|
|
222
|
-
commandId:
|
|
222
|
+
commandId: Ve.id,
|
|
223
223
|
commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
|
|
224
224
|
disable: !1
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
227
|
label: "image-popup.crop",
|
|
228
228
|
index: 2,
|
|
229
|
-
commandId:
|
|
229
|
+
commandId: Wn.id,
|
|
230
230
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
231
|
-
disable: r ===
|
|
231
|
+
disable: r === V.DRAWING_DOM
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
234
|
label: "image-popup.reset",
|
|
235
235
|
index: 3,
|
|
236
|
-
commandId:
|
|
236
|
+
commandId: Gn.id,
|
|
237
237
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
238
|
-
disable: r ===
|
|
238
|
+
disable: r === V.DRAWING_DOM
|
|
239
239
|
}
|
|
240
240
|
];
|
|
241
241
|
}
|
|
242
242
|
};
|
|
243
|
-
|
|
244
|
-
ie(0, x(
|
|
245
|
-
ie(1,
|
|
246
|
-
ie(2, x(
|
|
243
|
+
Ae = Xr([
|
|
244
|
+
ie(0, x(Rt)),
|
|
245
|
+
ie(1, z),
|
|
246
|
+
ie(2, x(qn)),
|
|
247
247
|
ie(3, J),
|
|
248
|
-
ie(4,
|
|
249
|
-
ie(5,
|
|
250
|
-
ie(6, x(
|
|
251
|
-
],
|
|
248
|
+
ie(4, pe),
|
|
249
|
+
ie(5, Dt),
|
|
250
|
+
ie(6, x(or))
|
|
251
|
+
], Ae);
|
|
252
252
|
function B(i, e, n) {
|
|
253
|
-
const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: d = 0, skewX: l = 0, skewY: g = 0 } = i, { column: c, columnOffset: a, row: h, rowOffset: u } = t, { column: m, columnOffset: f, row: p, rowOffset: I } = r, S = n.getCurrentSkeleton(), v =
|
|
253
|
+
const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: d = 0, skewX: l = 0, skewY: g = 0 } = i, { column: c, columnOffset: a, row: h, rowOffset: u } = t, { column: m, columnOffset: f, row: p, rowOffset: I } = r, S = n.getCurrentSkeleton(), v = Ee(S, {
|
|
254
254
|
startColumn: c,
|
|
255
255
|
endColumn: c,
|
|
256
256
|
startRow: h,
|
|
@@ -258,7 +258,7 @@ function B(i, e, n) {
|
|
|
258
258
|
});
|
|
259
259
|
if (v == null)
|
|
260
260
|
return;
|
|
261
|
-
const R =
|
|
261
|
+
const R = Ee(S, {
|
|
262
262
|
startColumn: m,
|
|
263
263
|
endColumn: m,
|
|
264
264
|
startRow: p,
|
|
@@ -310,12 +310,12 @@ function N(i, e) {
|
|
|
310
310
|
to: m
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
|
-
var
|
|
314
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
313
|
+
var Hr = Object.defineProperty, zr = Object.getOwnPropertyDescriptor, Kr = (i, e, n, t) => {
|
|
314
|
+
for (var r = t > 1 ? void 0 : t ? zr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
315
315
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
316
|
-
return t && r &&
|
|
317
|
-
},
|
|
318
|
-
let
|
|
316
|
+
return t && r && Hr(e, n, r), r;
|
|
317
|
+
}, be = (i, e) => (n, t) => e(n, t, i);
|
|
318
|
+
let ot = class extends re {
|
|
319
319
|
constructor(i, e, n, t, r) {
|
|
320
320
|
super(), this._context = i, this._sheetDrawingService = e, this._drawingManagerService = n, this._sheetSelectionRenderService = t, this._sheetSkeletonManagerService = r, this._init();
|
|
321
321
|
}
|
|
@@ -335,38 +335,38 @@ let st = class extends re {
|
|
|
335
335
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
],
|
|
344
|
-
var
|
|
345
|
-
return
|
|
338
|
+
ot = Kr([
|
|
339
|
+
be(1, Y),
|
|
340
|
+
be(2, z),
|
|
341
|
+
be(3, x(we)),
|
|
342
|
+
be(4, x(q))
|
|
343
|
+
], ot);
|
|
344
|
+
var F = function() {
|
|
345
|
+
return F = Object.assign || function(i) {
|
|
346
346
|
for (var e, n = 1, t = arguments.length; n < t; n++) {
|
|
347
347
|
e = arguments[n];
|
|
348
348
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
|
|
349
349
|
}
|
|
350
350
|
return i;
|
|
351
|
-
},
|
|
352
|
-
},
|
|
351
|
+
}, F.apply(this, arguments);
|
|
352
|
+
}, Jr = function(i, e) {
|
|
353
353
|
var n = {};
|
|
354
354
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
|
|
355
355
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
356
356
|
for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
|
|
357
357
|
e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
|
|
358
358
|
return n;
|
|
359
|
-
},
|
|
360
|
-
var n = i.icon, t = i.id, r = i.className, s = i.extend, o =
|
|
361
|
-
return
|
|
359
|
+
}, Qt = Xt(function(i, e) {
|
|
360
|
+
var n = i.icon, t = i.id, r = i.className, s = i.extend, o = Jr(i, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), l = Or("_".concat(Qr()));
|
|
361
|
+
return en(n, "".concat(t), { defIds: n.defIds, idSuffix: l.current }, F({ ref: e, className: d }, o), s);
|
|
362
362
|
});
|
|
363
|
-
function
|
|
364
|
-
return
|
|
365
|
-
return
|
|
363
|
+
function en(i, e, n, t, r) {
|
|
364
|
+
return Ht(i.tag, F(F({ key: e }, Zr(i, n, r)), t), (qr(i, n).children || []).map(function(s, o) {
|
|
365
|
+
return en(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
|
|
366
366
|
}));
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
var t =
|
|
368
|
+
function Zr(i, e, n) {
|
|
369
|
+
var t = F({}, i.attrs);
|
|
370
370
|
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
|
|
371
371
|
var r = e.defIds;
|
|
372
372
|
return !r || r.length === 0 || (i.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + e.idSuffix), Object.entries(t).forEach(function(s) {
|
|
@@ -374,29 +374,29 @@ function Kr(i, e, n) {
|
|
|
374
374
|
typeof d == "string" && (t[o] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
375
375
|
})), t;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function qr(i, e) {
|
|
378
378
|
var n, t = e.defIds;
|
|
379
|
-
return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ?
|
|
380
|
-
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ?
|
|
379
|
+
return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? F(F({}, i), { children: i.children.map(function(r) {
|
|
380
|
+
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? F(F({}, r), { attrs: F(F({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
381
381
|
}) }) : i;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function Qr() {
|
|
384
384
|
return Math.random().toString(36).substring(2, 8);
|
|
385
385
|
}
|
|
386
|
-
|
|
387
|
-
var
|
|
388
|
-
return
|
|
386
|
+
Qt.displayName = "UniverIcon";
|
|
387
|
+
var ei = { 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" } }] }, tn = Xt(function(i, e) {
|
|
388
|
+
return Ht(Qt, Object.assign({}, i, {
|
|
389
389
|
id: "add-image-single",
|
|
390
390
|
ref: e,
|
|
391
|
-
icon:
|
|
391
|
+
icon: ei
|
|
392
392
|
}));
|
|
393
393
|
});
|
|
394
|
-
|
|
395
|
-
const
|
|
394
|
+
tn.displayName = "AddImageSingle";
|
|
395
|
+
const nn = {
|
|
396
396
|
id: "sheet.command.delete-drawing",
|
|
397
|
-
type:
|
|
397
|
+
type: X.COMMAND,
|
|
398
398
|
handler: (i) => {
|
|
399
|
-
const e = i.get(W), t = i.get(
|
|
399
|
+
const e = i.get(W), t = i.get(Y).getFocusDrawings();
|
|
400
400
|
if (t.length === 0)
|
|
401
401
|
return !1;
|
|
402
402
|
const r = t[0].unitId, s = t.map((o) => {
|
|
@@ -408,16 +408,16 @@ const tn = {
|
|
|
408
408
|
drawingType: c
|
|
409
409
|
};
|
|
410
410
|
});
|
|
411
|
-
return e.executeCommand(
|
|
411
|
+
return e.executeCommand(Ve.id, {
|
|
412
412
|
unitId: r,
|
|
413
413
|
drawings: s
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
416
|
};
|
|
417
|
-
function
|
|
417
|
+
function ti(i) {
|
|
418
418
|
const e = [];
|
|
419
419
|
return i.forEach((n) => {
|
|
420
|
-
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d } = t, l =
|
|
420
|
+
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d } = t, l = Fn(0, 0, r.map((a) => a.transform || {})), g = r.map((a) => {
|
|
421
421
|
const h = a.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: m, drawingId: f } = a;
|
|
422
422
|
return {
|
|
423
423
|
unitId: u,
|
|
@@ -434,7 +434,7 @@ function Qr(i) {
|
|
|
434
434
|
unitId: s,
|
|
435
435
|
subUnitId: o,
|
|
436
436
|
drawingId: d,
|
|
437
|
-
drawingType:
|
|
437
|
+
drawingType: V.DRAWING_GROUP,
|
|
438
438
|
transform: l
|
|
439
439
|
};
|
|
440
440
|
e.push({
|
|
@@ -443,14 +443,14 @@ function Qr(i) {
|
|
|
443
443
|
});
|
|
444
444
|
}), e;
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function ni(i) {
|
|
447
447
|
const e = [];
|
|
448
448
|
return i.forEach((n) => {
|
|
449
449
|
const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d, transform: l = { width: 0, height: 0 } } = t;
|
|
450
450
|
if (l == null)
|
|
451
451
|
return;
|
|
452
452
|
const g = r.map((a) => {
|
|
453
|
-
const { transform: h } = a, { unitId: u, subUnitId: m, drawingId: f } = a, p =
|
|
453
|
+
const { transform: h } = a, { unitId: u, subUnitId: m, drawingId: f } = a, p = Xn(h || {}, l, l.width || 0, l.height || 0);
|
|
454
454
|
return {
|
|
455
455
|
unitId: u,
|
|
456
456
|
subUnitId: m,
|
|
@@ -462,7 +462,7 @@ function ei(i) {
|
|
|
462
462
|
unitId: s,
|
|
463
463
|
subUnitId: o,
|
|
464
464
|
drawingId: d,
|
|
465
|
-
drawingType:
|
|
465
|
+
drawingType: V.DRAWING_GROUP,
|
|
466
466
|
transform: {
|
|
467
467
|
left: 0,
|
|
468
468
|
top: 0
|
|
@@ -474,11 +474,11 @@ function ei(i) {
|
|
|
474
474
|
});
|
|
475
475
|
}), e;
|
|
476
476
|
}
|
|
477
|
-
const
|
|
477
|
+
const rn = {
|
|
478
478
|
id: "sheet.command.group-sheet-image",
|
|
479
|
-
type:
|
|
479
|
+
type: X.COMMAND,
|
|
480
480
|
handler: (i, e) => {
|
|
481
|
-
const n = i.get(W), t = i.get(
|
|
481
|
+
const n = i.get(W), t = i.get(he), r = i.get(Y);
|
|
482
482
|
if (!e) return !1;
|
|
483
483
|
const s = [];
|
|
484
484
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -490,7 +490,7 @@ const nn = {
|
|
|
490
490
|
return n.syncExecuteCommand(P.id, { op: c, unitId: d, subUnitId: l, objects: a, type: T.GROUP }) ? (t.pushUndoRedo({
|
|
491
491
|
unitID: d,
|
|
492
492
|
undoMutations: [
|
|
493
|
-
{ id: P.id, params: { op: g, unitId: d, subUnitId: l, objects:
|
|
493
|
+
{ id: P.id, params: { op: g, unitId: d, subUnitId: l, objects: ni(a), type: T.UNGROUP } },
|
|
494
494
|
{ id: j.id, params: s }
|
|
495
495
|
],
|
|
496
496
|
redoMutations: [
|
|
@@ -499,15 +499,15 @@ const nn = {
|
|
|
499
499
|
]
|
|
500
500
|
}), !0) : !1;
|
|
501
501
|
}
|
|
502
|
-
},
|
|
502
|
+
}, Ye = {
|
|
503
503
|
id: "sheet.command.insert-sheet-image",
|
|
504
|
-
type:
|
|
504
|
+
type: X.COMMAND,
|
|
505
505
|
handler: (i, e) => {
|
|
506
506
|
var S, v, R;
|
|
507
|
-
const n = i.get(W), t = i.get(
|
|
507
|
+
const n = i.get(W), t = i.get(he), r = i.get(Y), s = i.get(ct);
|
|
508
508
|
if (!e) return !1;
|
|
509
|
-
const o = e.drawings, d = o.map((_) => _.unitId), l = r.getBatchAddOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = s.onCommandExecute({ id:
|
|
510
|
-
return
|
|
509
|
+
const o = e.drawings, d = o.map((_) => _.unitId), l = r.getBatchAddOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = s.onCommandExecute({ id: Ye.id, params: e }), f = { id: P.id, params: { op: h, unitId: g, subUnitId: c, objects: u, type: T.INSERT } }, p = { id: P.id, params: { op: a, unitId: g, subUnitId: c, objects: u, type: T.REMOVE } };
|
|
510
|
+
return Ct([...(S = m.preRedos) != null ? S : [], f, ...m.redos], n) ? (t.pushUndoRedo({
|
|
511
511
|
unitID: g,
|
|
512
512
|
undoMutations: [
|
|
513
513
|
...(v = m.preUndos) != null ? v : [],
|
|
@@ -523,15 +523,15 @@ const nn = {
|
|
|
523
523
|
]
|
|
524
524
|
}), !0) : !1;
|
|
525
525
|
}
|
|
526
|
-
},
|
|
526
|
+
}, sn = {
|
|
527
527
|
id: "sheet.command.set-drawing-arrange",
|
|
528
|
-
type:
|
|
528
|
+
type: X.COMMAND,
|
|
529
529
|
handler: (i, e) => {
|
|
530
|
-
const n = i.get(W), t = i.get(
|
|
530
|
+
const n = i.get(W), t = i.get(he);
|
|
531
531
|
if (!e) return !1;
|
|
532
|
-
const r = i.get(
|
|
532
|
+
const r = i.get(Y), { unitId: s, subUnitId: o, drawingIds: d, arrangeType: l } = e, g = { unitId: s, subUnitId: o, drawingIds: d };
|
|
533
533
|
let c;
|
|
534
|
-
if (l ===
|
|
534
|
+
if (l === Se.forward ? c = r.getForwardDrawingsOp(g) : l === Se.backward ? c = r.getBackwardDrawingOp(g) : l === Se.front ? c = r.getFrontDrawingsOp(g) : l === Se.back && (c = r.getBackDrawingsOp(g)), c == null)
|
|
535
535
|
return !1;
|
|
536
536
|
const { objects: a, redo: h, undo: u } = c;
|
|
537
537
|
return n.syncExecuteCommand(P.id, { op: h, unitId: s, subUnitId: o, objects: a, type: T.ARRANGE }) ? (t.pushUndoRedo({
|
|
@@ -544,11 +544,11 @@ const nn = {
|
|
|
544
544
|
]
|
|
545
545
|
}), !0) : !1;
|
|
546
546
|
}
|
|
547
|
-
},
|
|
547
|
+
}, Fe = {
|
|
548
548
|
id: "sheet.command.set-sheet-image",
|
|
549
|
-
type:
|
|
549
|
+
type: X.COMMAND,
|
|
550
550
|
handler: (i, e) => {
|
|
551
|
-
const n = i.get(W), t = i.get(
|
|
551
|
+
const n = i.get(W), t = i.get(he), r = i.get(Y);
|
|
552
552
|
if (!e) return !1;
|
|
553
553
|
const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
|
|
554
554
|
return n.syncExecuteCommand(P.id, { unitId: d, subUnitId: l, op: c, objects: a, type: T.UPDATE }) ? (t.pushUndoRedo({
|
|
@@ -563,11 +563,11 @@ const nn = {
|
|
|
563
563
|
]
|
|
564
564
|
}), !0) : !1;
|
|
565
565
|
}
|
|
566
|
-
},
|
|
566
|
+
}, on = {
|
|
567
567
|
id: "sheet.command.ungroup-sheet-image",
|
|
568
|
-
type:
|
|
568
|
+
type: X.COMMAND,
|
|
569
569
|
handler: (i, e) => {
|
|
570
|
-
const n = i.get(W), t = i.get(
|
|
570
|
+
const n = i.get(W), t = i.get(he), r = i.get(Y);
|
|
571
571
|
if (!e) return !1;
|
|
572
572
|
const s = [];
|
|
573
573
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -579,7 +579,7 @@ const nn = {
|
|
|
579
579
|
return n.syncExecuteCommand(P.id, { op: c, unitId: d, subUnitId: l, objects: a, type: T.UNGROUP }) ? (t.pushUndoRedo({
|
|
580
580
|
unitID: d,
|
|
581
581
|
undoMutations: [
|
|
582
|
-
{ id: P.id, params: { op: g, unitId: d, subUnitId: l, objects:
|
|
582
|
+
{ id: P.id, params: { op: g, unitId: d, subUnitId: l, objects: ti(a), type: T.GROUP } },
|
|
583
583
|
{ id: j.id, params: s }
|
|
584
584
|
],
|
|
585
585
|
redoMutations: [
|
|
@@ -589,25 +589,25 @@ const nn = {
|
|
|
589
589
|
}), !0) : !1;
|
|
590
590
|
}
|
|
591
591
|
};
|
|
592
|
-
var
|
|
593
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
592
|
+
var ri = Object.defineProperty, ii = Object.getOwnPropertyDescriptor, si = (i, e, n, t) => {
|
|
593
|
+
for (var r = t > 1 ? void 0 : t ? ii(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
594
594
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
595
|
-
return t && r &&
|
|
596
|
-
},
|
|
597
|
-
let
|
|
595
|
+
return t && r && ri(e, n, r), r;
|
|
596
|
+
}, H = (i, e) => (n, t) => e(n, t, i);
|
|
597
|
+
let Ne = class extends re {
|
|
598
598
|
constructor(e, n, t, r, s, o, d, l, g, c, a, h) {
|
|
599
599
|
super();
|
|
600
|
-
|
|
600
|
+
G(this, "_workbookSelections");
|
|
601
601
|
this._context = e, this._skeletonManagerService = n, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = d, this._drawingManagerService = l, this._contextService = g, this._messageService = c, this._localeService = a, this._workbookSelections = h.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
|
|
602
602
|
}
|
|
603
603
|
async insertFloatImage() {
|
|
604
604
|
const e = await this._fileOpenerService.openFile({
|
|
605
605
|
multiple: !0,
|
|
606
|
-
accept:
|
|
606
|
+
accept: Nn.map((t) => `.${t.replace("image/", "")}`).join(",")
|
|
607
607
|
}), n = e.length;
|
|
608
|
-
return n >
|
|
609
|
-
type:
|
|
610
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
608
|
+
return n > ft ? (this._messageService.show({
|
|
609
|
+
type: De.Error,
|
|
610
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(ft))
|
|
611
611
|
}), !1) : n === 0 ? !1 : (e.forEach(async (t) => await this._insertFloatImage(t)), !0);
|
|
612
612
|
}
|
|
613
613
|
async _insertFloatImage(e) {
|
|
@@ -616,24 +616,24 @@ let Ae = class extends re {
|
|
|
616
616
|
n = await this._imageIoService.saveImage(e);
|
|
617
617
|
} catch (S) {
|
|
618
618
|
const v = S.message;
|
|
619
|
-
v ===
|
|
620
|
-
type:
|
|
621
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
622
|
-
}) : v ===
|
|
623
|
-
type:
|
|
619
|
+
v === ze.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
620
|
+
type: De.Error,
|
|
621
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(jn / (1024 * 1024)))
|
|
622
|
+
}) : v === ze.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
623
|
+
type: De.Error,
|
|
624
624
|
content: this._localeService.t("update-status.invalidImageType")
|
|
625
|
-
}) : v ===
|
|
626
|
-
type:
|
|
625
|
+
}) : v === ze.ERROR_IMAGE && this._messageService.show({
|
|
626
|
+
type: De.Error,
|
|
627
627
|
content: this._localeService.t("update-status.invalidImage")
|
|
628
628
|
});
|
|
629
629
|
}
|
|
630
630
|
if (n == null)
|
|
631
631
|
return;
|
|
632
|
-
const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: d, source: l, base64Cache: g } = n, { width: c, height: a, image: h } = await
|
|
632
|
+
const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: d, source: l, base64Cache: g } = n, { width: c, height: a, image: h } = await xn(g || ""), { width: u, height: m } = this._context.scene;
|
|
633
633
|
this._imageIoService.addImageSourceCache(l, d, h);
|
|
634
634
|
let f = 1;
|
|
635
|
-
if (c >
|
|
636
|
-
const S =
|
|
635
|
+
if (c > pt || a > wt) {
|
|
636
|
+
const S = pt / c, v = wt / a;
|
|
637
637
|
f = Math.max(S, v);
|
|
638
638
|
}
|
|
639
639
|
const p = this._getImagePosition(c * f, a * f, u, m);
|
|
@@ -643,13 +643,13 @@ let Ae = class extends re {
|
|
|
643
643
|
unitId: r,
|
|
644
644
|
subUnitId: s,
|
|
645
645
|
drawingId: o,
|
|
646
|
-
drawingType:
|
|
646
|
+
drawingType: V.DRAWING_IMAGE,
|
|
647
647
|
imageSourceType: d,
|
|
648
648
|
source: l,
|
|
649
649
|
transform: B(p, this._selectionRenderService, this._skeletonManagerService),
|
|
650
650
|
sheetTransform: p
|
|
651
651
|
};
|
|
652
|
-
this._commandService.executeCommand(
|
|
652
|
+
this._commandService.executeCommand(Ye.id, {
|
|
653
653
|
unitId: r,
|
|
654
654
|
drawings: [I]
|
|
655
655
|
});
|
|
@@ -670,7 +670,7 @@ let Ae = class extends re {
|
|
|
670
670
|
endColumn: 0
|
|
671
671
|
};
|
|
672
672
|
s && s.length > 0 && (o = s[s.length - 1].range);
|
|
673
|
-
const d =
|
|
673
|
+
const d = Ee(this._skeletonManagerService.getCurrent().skeleton, o);
|
|
674
674
|
if (d == null)
|
|
675
675
|
return;
|
|
676
676
|
let { startColumn: l, startRow: g, startX: c, startY: a } = d, h = !1;
|
|
@@ -702,7 +702,7 @@ let Ae = class extends re {
|
|
|
702
702
|
_updateOrderListener() {
|
|
703
703
|
this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
|
|
704
704
|
const { unitId: n, subUnitId: t, drawingIds: r, arrangeType: s } = e;
|
|
705
|
-
this._commandService.executeCommand(
|
|
705
|
+
this._commandService.executeCommand(sn.id, {
|
|
706
706
|
unitId: n,
|
|
707
707
|
subUnitId: t,
|
|
708
708
|
drawingIds: r,
|
|
@@ -729,7 +729,7 @@ let Ae = class extends re {
|
|
|
729
729
|
sheetTransform: { ...c }
|
|
730
730
|
};
|
|
731
731
|
n.push(a);
|
|
732
|
-
}), n.length > 0 && this._commandService.executeCommand(
|
|
732
|
+
}), n.length > 0 && this._commandService.executeCommand(Fe.id, {
|
|
733
733
|
unitId: e[0].unitId,
|
|
734
734
|
drawings: n
|
|
735
735
|
}));
|
|
@@ -737,46 +737,46 @@ let Ae = class extends re {
|
|
|
737
737
|
}
|
|
738
738
|
_groupDrawingListener() {
|
|
739
739
|
this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
|
|
740
|
-
this._commandService.executeCommand(
|
|
740
|
+
this._commandService.executeCommand(rn.id, e);
|
|
741
741
|
const { unitId: n, subUnitId: t, drawingId: r } = e[0].parent;
|
|
742
742
|
this._drawingManagerService.focusDrawing([{ unitId: n, subUnitId: t, drawingId: r }]);
|
|
743
743
|
}), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
|
|
744
|
-
this._commandService.executeCommand(
|
|
744
|
+
this._commandService.executeCommand(on.id, e);
|
|
745
745
|
});
|
|
746
746
|
}
|
|
747
747
|
_focusDrawingListener() {
|
|
748
748
|
this.disposeWithMe(
|
|
749
749
|
this._drawingManagerService.focus$.subscribe((e) => {
|
|
750
|
-
e == null || e.length === 0 ? (this._contextService.setContextValue(
|
|
750
|
+
e == null || e.length === 0 ? (this._contextService.setContextValue(fe, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(fe, !0), this._sheetDrawingService.focusDrawing(e));
|
|
751
751
|
})
|
|
752
752
|
);
|
|
753
753
|
}
|
|
754
754
|
};
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
],
|
|
768
|
-
const
|
|
755
|
+
Ne = si([
|
|
756
|
+
H(1, x(q)),
|
|
757
|
+
H(2, W),
|
|
758
|
+
H(3, we),
|
|
759
|
+
H(4, Mt),
|
|
760
|
+
H(5, cr),
|
|
761
|
+
H(6, Y),
|
|
762
|
+
H(7, z),
|
|
763
|
+
H(8, Dt),
|
|
764
|
+
H(9, dr),
|
|
765
|
+
H(10, x(Ge)),
|
|
766
|
+
H(11, x(_r))
|
|
767
|
+
], Ne);
|
|
768
|
+
const lt = {
|
|
769
769
|
id: "sheet.command.insert-float-image",
|
|
770
|
-
type:
|
|
770
|
+
type: X.COMMAND,
|
|
771
771
|
handler: (i) => {
|
|
772
772
|
var n, t;
|
|
773
|
-
return (t = (n = i.get(J).getCurrentTypeOfRenderer(
|
|
773
|
+
return (t = (n = i.get(J).getCurrentTypeOfRenderer(k.UNIVER_SHEET)) == null ? void 0 : n.with(Ne).insertFloatImage()) != null ? t : !1;
|
|
774
774
|
}
|
|
775
|
-
},
|
|
775
|
+
}, _e = {
|
|
776
776
|
id: "sheet.command.move-drawing",
|
|
777
|
-
type:
|
|
777
|
+
type: X.COMMAND,
|
|
778
778
|
handler: (i, e) => {
|
|
779
|
-
const n = i.get(W), t = i.get(
|
|
779
|
+
const n = i.get(W), t = i.get(Y), r = i.get(we), { direction: s } = e, o = t.getFocusDrawings();
|
|
780
780
|
if (o.length === 0)
|
|
781
781
|
return !1;
|
|
782
782
|
const d = o[0].unitId, l = o.map((c) => {
|
|
@@ -790,69 +790,69 @@ const dt = {
|
|
|
790
790
|
sheetTransform: N(h, r)
|
|
791
791
|
};
|
|
792
792
|
}).filter((c) => c != null);
|
|
793
|
-
return n.syncExecuteCommand(
|
|
793
|
+
return n.syncExecuteCommand(Fe.id, {
|
|
794
794
|
unitId: d,
|
|
795
795
|
drawings: l
|
|
796
796
|
}) ? (n.syncExecuteCommand(j.id, [d]), !0) : !1;
|
|
797
797
|
}
|
|
798
|
-
},
|
|
799
|
-
function
|
|
798
|
+
}, an = "addition-and-subtraction-single", cn = "sheet.menu.image";
|
|
799
|
+
function oi(i) {
|
|
800
800
|
return {
|
|
801
|
-
id:
|
|
802
|
-
type:
|
|
803
|
-
icon:
|
|
801
|
+
id: cn,
|
|
802
|
+
type: bt.SUBITEMS,
|
|
803
|
+
icon: an,
|
|
804
804
|
tooltip: "sheetImage.title",
|
|
805
|
-
hidden$:
|
|
806
|
-
disabled$:
|
|
805
|
+
hidden$: yt(i, k.UNIVER_SHEET),
|
|
806
|
+
disabled$: Qn(i, { workbookTypes: [nt], worksheetTypes: [Te], rangeTypes: [vr] })
|
|
807
807
|
};
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function ai(i) {
|
|
810
810
|
return {
|
|
811
|
-
id:
|
|
811
|
+
id: lt.id,
|
|
812
812
|
title: "sheetImage.upload.float",
|
|
813
|
-
type:
|
|
814
|
-
hidden$:
|
|
813
|
+
type: bt.BUTTON,
|
|
814
|
+
hidden$: yt(i, k.UNIVER_SHEET)
|
|
815
815
|
};
|
|
816
816
|
}
|
|
817
|
-
const
|
|
818
|
-
imageCommonPanel:
|
|
819
|
-
imageCommonPanelGrid:
|
|
820
|
-
imageCommonPanelBorder:
|
|
821
|
-
imageCommonPanelTitle:
|
|
822
|
-
imageCommonPanelSubtitle:
|
|
823
|
-
imageCommonPanelRow:
|
|
824
|
-
imageCommonPanelRowVertical:
|
|
825
|
-
imageCommonPanelColumn:
|
|
826
|
-
imageCommonPanelColumnCenter:
|
|
827
|
-
imageCommonPanelInline:
|
|
828
|
-
imageCommonPanelSpan2:
|
|
829
|
-
imageCommonPanelSpan3:
|
|
830
|
-
imageCommonPanelInput:
|
|
831
|
-
sheetImageMenu:
|
|
832
|
-
sheetImageMenuInput:
|
|
817
|
+
const ci = "univer-image-common-panel", di = "univer-image-common-panel-grid", li = "univer-image-common-panel-border", ui = "univer-image-common-panel-title", hi = "univer-image-common-panel-subtitle", gi = "univer-image-common-panel-row", mi = "univer-image-common-panel-row-vertical", fi = "univer-image-common-panel-column", pi = "univer-image-common-panel-column-center", wi = "univer-image-common-panel-inline", _i = "univer-image-common-panel-span2", vi = "univer-image-common-panel-span3", Si = "univer-image-common-panel-input", Ii = "univer-sheet-image-menu", Ci = "univer-sheet-image-menu-input", ee = {
|
|
818
|
+
imageCommonPanel: ci,
|
|
819
|
+
imageCommonPanelGrid: di,
|
|
820
|
+
imageCommonPanelBorder: li,
|
|
821
|
+
imageCommonPanelTitle: ui,
|
|
822
|
+
imageCommonPanelSubtitle: hi,
|
|
823
|
+
imageCommonPanelRow: gi,
|
|
824
|
+
imageCommonPanelRowVertical: mi,
|
|
825
|
+
imageCommonPanelColumn: fi,
|
|
826
|
+
imageCommonPanelColumnCenter: pi,
|
|
827
|
+
imageCommonPanelInline: wi,
|
|
828
|
+
imageCommonPanelSpan2: _i,
|
|
829
|
+
imageCommonPanelSpan3: vi,
|
|
830
|
+
imageCommonPanelInput: Si,
|
|
831
|
+
sheetImageMenu: Ii,
|
|
832
|
+
sheetImageMenuInput: Ci
|
|
833
833
|
};
|
|
834
|
-
function
|
|
834
|
+
function dn(i) {
|
|
835
835
|
var e, n, t = "";
|
|
836
836
|
if (typeof i == "string" || typeof i == "number") t += i;
|
|
837
837
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
838
838
|
var r = i.length;
|
|
839
|
-
for (e = 0; e < r; e++) i[e] && (n =
|
|
839
|
+
for (e = 0; e < r; e++) i[e] && (n = dn(i[e])) && (t && (t += " "), t += n);
|
|
840
840
|
} else for (n in i) i[n] && (t && (t += " "), t += n);
|
|
841
841
|
return t;
|
|
842
842
|
}
|
|
843
|
-
function
|
|
844
|
-
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e =
|
|
843
|
+
function ye() {
|
|
844
|
+
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = dn(i)) && (t && (t += " "), t += e);
|
|
845
845
|
return t;
|
|
846
846
|
}
|
|
847
|
-
const
|
|
847
|
+
const Ri = (i) => {
|
|
848
848
|
var v;
|
|
849
|
-
const e = oe(W), n = oe(
|
|
849
|
+
const e = oe(W), n = oe(Ge), t = oe(z), r = oe(J), { drawings: s } = i, o = s[0];
|
|
850
850
|
if (o == null)
|
|
851
851
|
return;
|
|
852
852
|
const { unitId: d } = o, l = r.getRenderById(d), g = l == null ? void 0 : l.scene;
|
|
853
853
|
if (g == null)
|
|
854
854
|
return;
|
|
855
|
-
const c = g.getTransformerByCreate(), [a, h] =
|
|
855
|
+
const c = g.getTransformerByCreate(), [a, h] = st(!0), u = (v = o.anchorType) != null ? v : y.Position, [m, f] = st(u);
|
|
856
856
|
function p(R, _) {
|
|
857
857
|
const C = [];
|
|
858
858
|
return R.forEach((w) => {
|
|
@@ -870,7 +870,7 @@ const Ii = (i) => {
|
|
|
870
870
|
});
|
|
871
871
|
}), C;
|
|
872
872
|
}
|
|
873
|
-
|
|
873
|
+
dt(() => {
|
|
874
874
|
const R = c.clearControl$.subscribe((C) => {
|
|
875
875
|
C === !0 && h(!1);
|
|
876
876
|
}), _ = c.changeStart$.subscribe((C) => {
|
|
@@ -899,23 +899,23 @@ const Ii = (i) => {
|
|
|
899
899
|
drawingId: w.drawingId,
|
|
900
900
|
anchorType: R
|
|
901
901
|
}));
|
|
902
|
-
e.executeCommand(
|
|
902
|
+
e.executeCommand(Fe.id, {
|
|
903
903
|
unitId: _[0].unitId,
|
|
904
904
|
drawings: C
|
|
905
905
|
});
|
|
906
906
|
}
|
|
907
907
|
const S = (R) => R ? "block" : "none";
|
|
908
|
-
return /* @__PURE__ */ $.jsxs("div", { className:
|
|
909
|
-
/* @__PURE__ */ $.jsx("div", { className: ee.imageCommonPanelRow, children: /* @__PURE__ */ $.jsx("div", { className:
|
|
910
|
-
/* @__PURE__ */ $.jsx("div", { className:
|
|
911
|
-
/* @__PURE__ */ $.jsx(
|
|
912
|
-
/* @__PURE__ */ $.jsx(
|
|
913
|
-
/* @__PURE__ */ $.jsx(
|
|
908
|
+
return /* @__PURE__ */ $.jsxs("div", { className: ye(ee.imageCommonPanelGrid, ee.imageCommonPanelBorder), style: { display: S(a) }, children: [
|
|
909
|
+
/* @__PURE__ */ $.jsx("div", { className: ee.imageCommonPanelRow, children: /* @__PURE__ */ $.jsx("div", { className: ye(ee.imageCommonPanelColumn, ee.imageCommonPanelTitle), children: /* @__PURE__ */ $.jsx("div", { children: n.t("drawing-anchor.title") }) }) }),
|
|
910
|
+
/* @__PURE__ */ $.jsx("div", { className: ye(ee.imageCommonPanelRow), children: /* @__PURE__ */ $.jsx("div", { className: ye(ee.imageCommonPanelColumn), children: /* @__PURE__ */ $.jsxs(Pr, { value: m, onChange: I, direction: "vertical", children: [
|
|
911
|
+
/* @__PURE__ */ $.jsx(qe, { value: y.Both, children: n.t("drawing-anchor.both") }),
|
|
912
|
+
/* @__PURE__ */ $.jsx(qe, { value: y.Position, children: n.t("drawing-anchor.position") }),
|
|
913
|
+
/* @__PURE__ */ $.jsx(qe, { value: y.None, children: n.t("drawing-anchor.none") })
|
|
914
914
|
] }) }) })
|
|
915
915
|
] });
|
|
916
|
-
},
|
|
917
|
-
const i = oe(
|
|
918
|
-
return
|
|
916
|
+
}, Di = () => {
|
|
917
|
+
const i = oe(z), e = i.getFocusDrawings(), [n, t] = st(e);
|
|
918
|
+
return dt(() => {
|
|
919
919
|
const r = i.focus$.subscribe((s) => {
|
|
920
920
|
t(s);
|
|
921
921
|
});
|
|
@@ -923,113 +923,113 @@ const Ii = (i) => {
|
|
|
923
923
|
r.unsubscribe();
|
|
924
924
|
};
|
|
925
925
|
}, []), !!(n != null && n.length) && /* @__PURE__ */ $.jsxs("div", { className: ee.imageCommonPanel, children: [
|
|
926
|
-
/* @__PURE__ */ $.jsx(
|
|
927
|
-
/* @__PURE__ */ $.jsx(
|
|
926
|
+
/* @__PURE__ */ $.jsx(Vn, { drawings: n }),
|
|
927
|
+
/* @__PURE__ */ $.jsx(Ri, { drawings: n })
|
|
928
928
|
] });
|
|
929
|
-
},
|
|
930
|
-
[
|
|
931
|
-
[
|
|
929
|
+
}, Mi = {
|
|
930
|
+
[lr.FORMULAS_INSERT]: {
|
|
931
|
+
[cn]: {
|
|
932
932
|
order: 3,
|
|
933
|
-
menuItemFactory:
|
|
934
|
-
[
|
|
933
|
+
menuItemFactory: oi,
|
|
934
|
+
[lt.id]: {
|
|
935
935
|
order: 0,
|
|
936
|
-
menuItemFactory:
|
|
936
|
+
menuItemFactory: ai
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
940
|
};
|
|
941
|
-
function
|
|
942
|
-
return !i.getContextValue(
|
|
941
|
+
function ve(i) {
|
|
942
|
+
return !i.getContextValue(vn) && !i.getContextValue(Sn) && !i.getContextValue(In) && i.getContextValue(fe);
|
|
943
943
|
}
|
|
944
|
-
const
|
|
945
|
-
id:
|
|
944
|
+
const bi = {
|
|
945
|
+
id: _e.id,
|
|
946
946
|
description: "shortcut.sheet.drawing-move-down",
|
|
947
947
|
group: "4_sheet-drawing-view",
|
|
948
|
-
binding:
|
|
948
|
+
binding: ue.ARROW_DOWN,
|
|
949
949
|
priority: 100,
|
|
950
|
-
preconditions:
|
|
950
|
+
preconditions: ve,
|
|
951
951
|
staticParameters: {
|
|
952
952
|
direction: te.DOWN
|
|
953
953
|
}
|
|
954
|
-
},
|
|
955
|
-
id:
|
|
954
|
+
}, yi = {
|
|
955
|
+
id: _e.id,
|
|
956
956
|
description: "shortcut.sheet.drawing-move-up",
|
|
957
957
|
group: "4_sheet-drawing-view",
|
|
958
|
-
binding:
|
|
958
|
+
binding: ue.ARROW_UP,
|
|
959
959
|
priority: 100,
|
|
960
|
-
preconditions:
|
|
960
|
+
preconditions: ve,
|
|
961
961
|
staticParameters: {
|
|
962
962
|
direction: te.UP
|
|
963
963
|
}
|
|
964
|
-
},
|
|
965
|
-
id:
|
|
964
|
+
}, Oi = {
|
|
965
|
+
id: _e.id,
|
|
966
966
|
description: "shortcut.sheet.drawing-move-left",
|
|
967
967
|
group: "4_sheet-drawing-view",
|
|
968
|
-
binding:
|
|
968
|
+
binding: ue.ARROW_LEFT,
|
|
969
969
|
priority: 100,
|
|
970
|
-
preconditions:
|
|
970
|
+
preconditions: ve,
|
|
971
971
|
staticParameters: {
|
|
972
972
|
direction: te.LEFT
|
|
973
973
|
}
|
|
974
|
-
},
|
|
975
|
-
id:
|
|
974
|
+
}, Pi = {
|
|
975
|
+
id: _e.id,
|
|
976
976
|
description: "shortcut.sheet.drawing-move-right",
|
|
977
977
|
group: "4_sheet-drawing-view",
|
|
978
|
-
binding:
|
|
978
|
+
binding: ue.ARROW_RIGHT,
|
|
979
979
|
priority: 100,
|
|
980
|
-
preconditions:
|
|
980
|
+
preconditions: ve,
|
|
981
981
|
staticParameters: {
|
|
982
982
|
direction: te.RIGHT
|
|
983
983
|
}
|
|
984
|
-
},
|
|
985
|
-
id:
|
|
984
|
+
}, Ti = {
|
|
985
|
+
id: nn.id,
|
|
986
986
|
description: "shortcut.sheet.drawing-delete",
|
|
987
987
|
group: "4_sheet-drawing-view",
|
|
988
988
|
// when focusing on any other input tag do not trigger this shortcut
|
|
989
|
-
preconditions:
|
|
990
|
-
binding:
|
|
991
|
-
mac:
|
|
989
|
+
preconditions: ve,
|
|
990
|
+
binding: ue.DELETE,
|
|
991
|
+
mac: ue.BACKSPACE
|
|
992
992
|
};
|
|
993
|
-
var
|
|
994
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
993
|
+
var Ei = Object.defineProperty, Ui = Object.getOwnPropertyDescriptor, Ai = (i, e, n, t) => {
|
|
994
|
+
for (var r = t > 1 ? void 0 : t ? Ui(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
995
995
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
996
|
-
return t && r &&
|
|
997
|
-
},
|
|
998
|
-
let
|
|
996
|
+
return t && r && Ei(e, n, r), r;
|
|
997
|
+
}, Oe = (i, e) => (n, t) => e(n, t, i);
|
|
998
|
+
let je = class extends re {
|
|
999
999
|
constructor(i, e, n, t) {
|
|
1000
1000
|
super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._shortcutService = t, this._init();
|
|
1001
1001
|
}
|
|
1002
1002
|
_initCustomComponents() {
|
|
1003
1003
|
const i = this._componentManager;
|
|
1004
|
-
this.disposeWithMe(i.register(
|
|
1004
|
+
this.disposeWithMe(i.register(an, tn)), this.disposeWithMe(i.register(zt, Di));
|
|
1005
1005
|
}
|
|
1006
1006
|
_initMenus() {
|
|
1007
|
-
this._menuManagerService.mergeMenu(
|
|
1007
|
+
this._menuManagerService.mergeMenu(Mi);
|
|
1008
1008
|
}
|
|
1009
1009
|
_initCommands() {
|
|
1010
1010
|
[
|
|
1011
|
-
|
|
1012
|
-
ke,
|
|
1013
|
-
Ge,
|
|
1011
|
+
lt,
|
|
1014
1012
|
Ye,
|
|
1015
|
-
|
|
1016
|
-
|
|
1013
|
+
Ve,
|
|
1014
|
+
Fe,
|
|
1017
1015
|
Kt,
|
|
1016
|
+
j,
|
|
1017
|
+
Jt,
|
|
1018
|
+
rn,
|
|
1019
|
+
on,
|
|
1020
|
+
_e,
|
|
1018
1021
|
nn,
|
|
1019
|
-
sn
|
|
1020
|
-
we,
|
|
1021
|
-
tn,
|
|
1022
|
-
rn
|
|
1022
|
+
sn
|
|
1023
1023
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
1024
1024
|
}
|
|
1025
1025
|
_initShortcuts() {
|
|
1026
1026
|
[
|
|
1027
1027
|
// sheet drawing shortcuts
|
|
1028
|
-
Di,
|
|
1029
|
-
Mi,
|
|
1030
1028
|
bi,
|
|
1031
1029
|
yi,
|
|
1032
|
-
Oi
|
|
1030
|
+
Oi,
|
|
1031
|
+
Pi,
|
|
1032
|
+
Ti
|
|
1033
1033
|
].forEach((i) => {
|
|
1034
1034
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
1035
1035
|
});
|
|
@@ -1038,21 +1038,21 @@ let Ne = class extends re {
|
|
|
1038
1038
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
1039
1039
|
}
|
|
1040
1040
|
};
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
],
|
|
1047
|
-
var
|
|
1048
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1041
|
+
je = Ai([
|
|
1042
|
+
Oe(0, x(ur)),
|
|
1043
|
+
Oe(1, hr),
|
|
1044
|
+
Oe(2, W),
|
|
1045
|
+
Oe(3, gr)
|
|
1046
|
+
], je);
|
|
1047
|
+
var Ni = Object.defineProperty, ji = Object.getOwnPropertyDescriptor, xi = (i, e, n, t) => {
|
|
1048
|
+
for (var r = t > 1 ? void 0 : t ? ji(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1049
1049
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1050
|
-
return t && r &&
|
|
1051
|
-
},
|
|
1052
|
-
let
|
|
1050
|
+
return t && r && Ni(e, n, r), r;
|
|
1051
|
+
}, Qe = (i, e) => (n, t) => e(n, t, i);
|
|
1052
|
+
let xe = class extends re {
|
|
1053
1053
|
constructor(e, n, t) {
|
|
1054
1054
|
super();
|
|
1055
|
-
|
|
1055
|
+
G(this, "_copyInfo");
|
|
1056
1056
|
this._sheetClipboardService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._initCopyPaste();
|
|
1057
1057
|
}
|
|
1058
1058
|
_initCopyPaste() {
|
|
@@ -1060,7 +1060,7 @@ let je = class extends re {
|
|
|
1060
1060
|
id: "SHEET_IMAGE_UI_PLUGIN",
|
|
1061
1061
|
onBeforeCopy: (e, n, t) => this._collect(e, n, t),
|
|
1062
1062
|
onPasteCells: (e, n, t, r) => {
|
|
1063
|
-
const { copyType: s =
|
|
1063
|
+
const { copyType: s = vt.COPY, pasteType: o } = r, { range: d } = e || {}, { range: l, unitId: g, subUnitId: c } = n;
|
|
1064
1064
|
return this._generateMutations(l, { copyType: s, pasteType: o, copyRange: d, unitId: g, subUnitId: c });
|
|
1065
1065
|
},
|
|
1066
1066
|
onPastePlainText: (e, n) => ({ undos: [], redos: [] })
|
|
@@ -1097,10 +1097,10 @@ let je = class extends re {
|
|
|
1097
1097
|
if (!this._copyInfo)
|
|
1098
1098
|
return { redos: [], undos: [] };
|
|
1099
1099
|
if ([
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1100
|
+
Ie.SPECIAL_PASTE_COL_WIDTH,
|
|
1101
|
+
Ie.SPECIAL_PASTE_VALUE,
|
|
1102
|
+
Ie.SPECIAL_PASTE_FORMAT,
|
|
1103
|
+
Ie.SPECIAL_PASTE_FORMULA
|
|
1104
1104
|
].includes(
|
|
1105
1105
|
n.pasteType
|
|
1106
1106
|
))
|
|
@@ -1108,7 +1108,7 @@ let je = class extends re {
|
|
|
1108
1108
|
const { copyRange: t } = n;
|
|
1109
1109
|
if (!t)
|
|
1110
1110
|
return { redos: [], undos: [] };
|
|
1111
|
-
const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [d, l], mapFunc: g } =
|
|
1111
|
+
const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [d, l], mapFunc: g } = er([t, e]), { row: c, col: a } = g(d.startRow, d.startColumn), { row: h, col: u } = g(l.startRow, l.startColumn), m = (b = this._renderManagerService.getRenderById(s)) == null ? void 0 : b.with(q);
|
|
1112
1112
|
if (!m)
|
|
1113
1113
|
return { redos: [], undos: [] };
|
|
1114
1114
|
const f = m.attachRangeWithCoord({
|
|
@@ -1124,7 +1124,7 @@ let je = class extends re {
|
|
|
1124
1124
|
});
|
|
1125
1125
|
if (!f || !p)
|
|
1126
1126
|
return { redos: [], undos: [] };
|
|
1127
|
-
const I = [], S = [], v = p.startX - f.startX, R = p.startY - f.startY, _ = h - c, C = u - a, w = n.copyType ===
|
|
1127
|
+
const I = [], S = [], v = p.startX - f.startX, R = p.startY - f.startY, _ = h - c, C = u - a, w = n.copyType === vt.CUT, { _sheetDrawingService: O } = this;
|
|
1128
1128
|
return r.forEach((A) => {
|
|
1129
1129
|
const { transform: E, sheetTransform: M } = A;
|
|
1130
1130
|
if (!E)
|
|
@@ -1133,7 +1133,7 @@ let je = class extends re {
|
|
|
1133
1133
|
...A,
|
|
1134
1134
|
unitId: s,
|
|
1135
1135
|
subUnitId: o,
|
|
1136
|
-
drawingId: w ? A.drawingId :
|
|
1136
|
+
drawingId: w ? A.drawingId : me.generateRandomId(),
|
|
1137
1137
|
transform: {
|
|
1138
1138
|
...E,
|
|
1139
1139
|
left: E.left + v,
|
|
@@ -1175,24 +1175,24 @@ let je = class extends re {
|
|
|
1175
1175
|
};
|
|
1176
1176
|
}
|
|
1177
1177
|
};
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
],
|
|
1183
|
-
var
|
|
1184
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1178
|
+
xe = xi([
|
|
1179
|
+
Qe(0, tr),
|
|
1180
|
+
Qe(1, J),
|
|
1181
|
+
Qe(2, Y)
|
|
1182
|
+
], xe);
|
|
1183
|
+
var Li = Object.defineProperty, $i = Object.getOwnPropertyDescriptor, Bi = (i, e, n, t) => {
|
|
1184
|
+
for (var r = t > 1 ? void 0 : t ? $i(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1185
1185
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1186
|
-
return t && r &&
|
|
1187
|
-
},
|
|
1188
|
-
let
|
|
1186
|
+
return t && r && Li(e, n, r), r;
|
|
1187
|
+
}, ge = (i, e) => (n, t) => e(n, t, i);
|
|
1188
|
+
let Le = class extends re {
|
|
1189
1189
|
constructor(i, e, n, t, r) {
|
|
1190
1190
|
super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1191
1191
|
}
|
|
1192
1192
|
_initDrawingVisible() {
|
|
1193
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1193
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET);
|
|
1194
1194
|
this.disposeWithMe(
|
|
1195
|
-
|
|
1195
|
+
Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1196
1196
|
if (!e) {
|
|
1197
1197
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1198
1198
|
return;
|
|
@@ -1203,7 +1203,7 @@ let xe = class extends re {
|
|
|
1203
1203
|
return;
|
|
1204
1204
|
}
|
|
1205
1205
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
1206
|
-
if (this._permissionService.composePermission([new
|
|
1206
|
+
if (this._permissionService.composePermission([new It(r).id, new Ze(r, s).id]).every((d) => d.value))
|
|
1207
1207
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
1208
1208
|
else {
|
|
1209
1209
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
@@ -1211,7 +1211,7 @@ let xe = class extends re {
|
|
|
1211
1211
|
if (h == null)
|
|
1212
1212
|
return;
|
|
1213
1213
|
h.getAllObjectsByOrder().forEach((m) => {
|
|
1214
|
-
m.classType ===
|
|
1214
|
+
m.classType === le.IMAGE && c.some((f) => m.oKey.includes(f.drawingId)) && h.removeObject(m);
|
|
1215
1215
|
});
|
|
1216
1216
|
}
|
|
1217
1217
|
});
|
|
@@ -1219,9 +1219,9 @@ let xe = class extends re {
|
|
|
1219
1219
|
);
|
|
1220
1220
|
}
|
|
1221
1221
|
_initDrawingEditable() {
|
|
1222
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1222
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET);
|
|
1223
1223
|
this.disposeWithMe(
|
|
1224
|
-
|
|
1224
|
+
Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1225
1225
|
if (!e) {
|
|
1226
1226
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1227
1227
|
return;
|
|
@@ -1232,7 +1232,7 @@ let xe = class extends re {
|
|
|
1232
1232
|
return;
|
|
1233
1233
|
}
|
|
1234
1234
|
const r = e.getUnitId(), s = t.getSheetId();
|
|
1235
|
-
if (this._permissionService.composePermission([new
|
|
1235
|
+
if (this._permissionService.composePermission([new nt(r).id, new Te(r, s).id]).every((d) => d.value))
|
|
1236
1236
|
this._drawingManagerService.setDrawingEditable(!0);
|
|
1237
1237
|
else {
|
|
1238
1238
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
@@ -1240,7 +1240,7 @@ let xe = class extends re {
|
|
|
1240
1240
|
if (h == null)
|
|
1241
1241
|
return;
|
|
1242
1242
|
h.getAllObjectsByOrder().forEach((m) => {
|
|
1243
|
-
m.classType ===
|
|
1243
|
+
m.classType === le.IMAGE && c.some((f) => m.oKey.includes(f.drawingId)) && h.detachTransformerFrom(m);
|
|
1244
1244
|
});
|
|
1245
1245
|
}
|
|
1246
1246
|
});
|
|
@@ -1248,9 +1248,9 @@ let xe = class extends re {
|
|
|
1248
1248
|
);
|
|
1249
1249
|
}
|
|
1250
1250
|
_initViewPermissionChange() {
|
|
1251
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1251
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET);
|
|
1252
1252
|
this.disposeWithMe(
|
|
1253
|
-
|
|
1253
|
+
Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1254
1254
|
e && e.activeSheet$.subscribe((t) => {
|
|
1255
1255
|
var a;
|
|
1256
1256
|
if (!t)
|
|
@@ -1260,21 +1260,21 @@ let xe = class extends re {
|
|
|
1260
1260
|
const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
|
|
1261
1261
|
if (l == null)
|
|
1262
1262
|
return;
|
|
1263
|
-
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new
|
|
1263
|
+
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new It(r).id, new Ze(r, s).id]).pipe(Ue((h) => h.every((u) => u.value)));
|
|
1264
1264
|
c == null || c.pipe(
|
|
1265
1265
|
ae((h) => h !== o),
|
|
1266
|
-
|
|
1266
|
+
Re()
|
|
1267
1267
|
).subscribe({
|
|
1268
1268
|
next: (h) => {
|
|
1269
1269
|
o = h, this._drawingManagerService.setDrawingVisible(h);
|
|
1270
1270
|
const u = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
|
|
1271
1271
|
h ? this._drawingManagerService.addNotification(f) : (u.forEach((p) => {
|
|
1272
|
-
p.classType ===
|
|
1272
|
+
p.classType === le.IMAGE && f.some((I) => p.oKey.includes(I.drawingId)) && l.removeObject(p);
|
|
1273
1273
|
}), g.clearSelectedObjects());
|
|
1274
1274
|
}
|
|
1275
|
-
}), (a = this._permissionService.getPermissionPoint$(new
|
|
1275
|
+
}), (a = this._permissionService.getPermissionPoint$(new Ze(r, s).id)) == null || a.pipe(
|
|
1276
1276
|
ae((h) => h.value !== o),
|
|
1277
|
-
|
|
1277
|
+
Re()
|
|
1278
1278
|
).subscribe({
|
|
1279
1279
|
complete: () => {
|
|
1280
1280
|
o = !0, this._drawingManagerService.setDrawingVisible(!0);
|
|
@@ -1287,9 +1287,9 @@ let xe = class extends re {
|
|
|
1287
1287
|
);
|
|
1288
1288
|
}
|
|
1289
1289
|
_initEditPermissionChange() {
|
|
1290
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1290
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET);
|
|
1291
1291
|
this.disposeWithMe(
|
|
1292
|
-
|
|
1292
|
+
Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1293
1293
|
e && e.activeSheet$.subscribe((t) => {
|
|
1294
1294
|
var a;
|
|
1295
1295
|
if (!t)
|
|
@@ -1299,23 +1299,23 @@ let xe = class extends re {
|
|
|
1299
1299
|
const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
|
|
1300
1300
|
if (l == null)
|
|
1301
1301
|
return;
|
|
1302
|
-
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new
|
|
1302
|
+
const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new nt(r).id, new Te(r, s).id]).pipe(Ue((h) => h.every((u) => u.value)));
|
|
1303
1303
|
c == null || c.pipe(
|
|
1304
1304
|
ae((h) => h !== o),
|
|
1305
|
-
|
|
1305
|
+
Re()
|
|
1306
1306
|
).subscribe({
|
|
1307
1307
|
next: (h) => {
|
|
1308
1308
|
o = h, this._drawingManagerService.setDrawingEditable(h);
|
|
1309
1309
|
const u = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
|
|
1310
1310
|
h ? (u.forEach((p) => {
|
|
1311
|
-
p.classType ===
|
|
1311
|
+
p.classType === le.IMAGE && f.some((I) => p.oKey.includes(I.drawingId)) && l.attachTransformerTo(p);
|
|
1312
1312
|
}), this._drawingManagerService.addNotification(f)) : (u.forEach((p) => {
|
|
1313
|
-
p.classType ===
|
|
1313
|
+
p.classType === le.IMAGE && f.some((I) => p.oKey.includes(I.drawingId)) && l.detachTransformerFrom(p);
|
|
1314
1314
|
}), g.clearSelectedObjects());
|
|
1315
1315
|
}
|
|
1316
|
-
}), (a = this._permissionService.getPermissionPoint$(new
|
|
1316
|
+
}), (a = this._permissionService.getPermissionPoint$(new Te(r, s).id)) == null || a.pipe(
|
|
1317
1317
|
ae((h) => h.value !== o),
|
|
1318
|
-
|
|
1318
|
+
Re()
|
|
1319
1319
|
).subscribe({
|
|
1320
1320
|
complete: () => {
|
|
1321
1321
|
o = !0;
|
|
@@ -1323,7 +1323,7 @@ let xe = class extends re {
|
|
|
1323
1323
|
if (I == null)
|
|
1324
1324
|
return;
|
|
1325
1325
|
this._drawingManagerService.setDrawingEditable(!0), I.getAllObjectsByOrder().forEach((v) => {
|
|
1326
|
-
v.classType ===
|
|
1326
|
+
v.classType === le.IMAGE && f.some((R) => v.oKey.includes(R.drawingId)) && I.detachTransformerFrom(v);
|
|
1327
1327
|
});
|
|
1328
1328
|
}
|
|
1329
1329
|
});
|
|
@@ -1332,19 +1332,19 @@ let xe = class extends re {
|
|
|
1332
1332
|
);
|
|
1333
1333
|
}
|
|
1334
1334
|
};
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
],
|
|
1342
|
-
var
|
|
1343
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1335
|
+
Le = Bi([
|
|
1336
|
+
ge(0, z),
|
|
1337
|
+
ge(1, J),
|
|
1338
|
+
ge(2, Rn),
|
|
1339
|
+
ge(3, pe),
|
|
1340
|
+
ge(4, x(Cn))
|
|
1341
|
+
], Le);
|
|
1342
|
+
var Wi = Object.defineProperty, Gi = Object.getOwnPropertyDescriptor, Vi = (i, e, n, t) => {
|
|
1343
|
+
for (var r = t > 1 ? void 0 : t ? Gi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1344
1344
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1345
|
-
return t && r &&
|
|
1346
|
-
},
|
|
1347
|
-
let
|
|
1345
|
+
return t && r && Wi(e, n, r), r;
|
|
1346
|
+
}, Pe = (i, e) => (n, t) => e(n, t, i);
|
|
1347
|
+
let $e = class extends re {
|
|
1348
1348
|
constructor(i, e, n, t) {
|
|
1349
1349
|
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
|
|
1350
1350
|
}
|
|
@@ -1375,9 +1375,9 @@ let Le = class extends re {
|
|
|
1375
1375
|
const d = this._drawingManagerService.getDrawingDataForUnit(t), l = d == null ? void 0 : d[e.subUnitId];
|
|
1376
1376
|
if (!l)
|
|
1377
1377
|
return n(i);
|
|
1378
|
-
const { scaleX: g, scaleY: c } = s.scene, a = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = l.order.map((u) => l.data[u]).filter((u) => u.drawingType !==
|
|
1378
|
+
const { scaleX: g, scaleY: c } = s.scene, a = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = l.order.map((u) => l.data[u]).filter((u) => u.drawingType !== V.DRAWING_DOM);
|
|
1379
1379
|
return h.length ? (h.forEach((u) => {
|
|
1380
|
-
if (!u.groupId && u.transform &&
|
|
1380
|
+
if (!u.groupId && u.transform && me.isDefine(u.transform.left) && me.isDefine(u.transform.top) && me.isDefine(u.transform.width) && me.isDefine(u.transform.height)) {
|
|
1381
1381
|
const m = o.skeleton.getCellPositionByOffset(u.transform.left, u.transform.top, g, c, { x: 0, y: 0 }), f = o.skeleton.getCellPositionByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, c, { x: 0, y: 0 });
|
|
1382
1382
|
m.column < a.startColumn && (a.startColumn = m.column), m.row < a.startRow && (a.startRow = m.row), a.endRow < f.row && (a.endRow = f.row), a.endColumn < f.column && (a.endColumn = f.column);
|
|
1383
1383
|
}
|
|
@@ -1388,19 +1388,18 @@ let Le = class extends re {
|
|
|
1388
1388
|
);
|
|
1389
1389
|
}
|
|
1390
1390
|
};
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
],
|
|
1397
|
-
var
|
|
1398
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1391
|
+
$e = Vi([
|
|
1392
|
+
Pe(0, x(nr)),
|
|
1393
|
+
Pe(1, x(kn)),
|
|
1394
|
+
Pe(2, z),
|
|
1395
|
+
Pe(3, J)
|
|
1396
|
+
], $e);
|
|
1397
|
+
var ki = Object.defineProperty, Yi = Object.getOwnPropertyDescriptor, Fi = (i, e, n, t) => {
|
|
1398
|
+
for (var r = t > 1 ? void 0 : t ? Yi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1399
1399
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
1400
|
-
return t && r &&
|
|
1400
|
+
return t && r && ki(e, n, r), r;
|
|
1401
1401
|
}, Q = (i, e) => (n, t) => e(n, t, i);
|
|
1402
|
-
const
|
|
1403
|
-
yt.id,
|
|
1402
|
+
const Xi = [
|
|
1404
1403
|
Ot.id,
|
|
1405
1404
|
Pt.id,
|
|
1406
1405
|
Tt.id,
|
|
@@ -1408,9 +1407,9 @@ const Yi = [
|
|
|
1408
1407
|
Ut.id,
|
|
1409
1408
|
At.id,
|
|
1410
1409
|
Nt.id,
|
|
1411
|
-
nt.id,
|
|
1412
|
-
rt.id,
|
|
1413
1410
|
jt.id,
|
|
1411
|
+
rt.id,
|
|
1412
|
+
it.id,
|
|
1414
1413
|
xt.id,
|
|
1415
1414
|
Lt.id,
|
|
1416
1415
|
$t.id,
|
|
@@ -1418,16 +1417,17 @@ const Yi = [
|
|
|
1418
1417
|
Wt.id,
|
|
1419
1418
|
Gt.id,
|
|
1420
1419
|
Vt.id,
|
|
1421
|
-
kt.id
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
vr.id,
|
|
1420
|
+
kt.id,
|
|
1421
|
+
Yt.id
|
|
1422
|
+
], Hi = [
|
|
1425
1423
|
Sr.id,
|
|
1426
1424
|
Ir.id,
|
|
1427
1425
|
Cr.id,
|
|
1428
|
-
Rr.id
|
|
1426
|
+
Rr.id,
|
|
1427
|
+
Dr.id,
|
|
1428
|
+
Mr.id
|
|
1429
1429
|
];
|
|
1430
|
-
let
|
|
1430
|
+
let at = class extends re {
|
|
1431
1431
|
constructor(i, e, n, t, r, s, o, d, l) {
|
|
1432
1432
|
super(), this._context = i, this._renderManagerService = e, this._commandService = n, this._selectionRenderService = t, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = d, this._univerInstanceService = l, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
|
|
1433
1433
|
}
|
|
@@ -1435,57 +1435,57 @@ let ot = class extends re {
|
|
|
1435
1435
|
this.disposeWithMe(
|
|
1436
1436
|
this._sheetInterceptorService.interceptCommand({
|
|
1437
1437
|
getMutations: (i) => {
|
|
1438
|
-
if (!
|
|
1438
|
+
if (!Xi.includes(i.id))
|
|
1439
1439
|
return { redos: [], undos: [] };
|
|
1440
1440
|
if (i.params == null)
|
|
1441
1441
|
return { redos: [], undos: [] };
|
|
1442
1442
|
const e = i.id;
|
|
1443
|
-
if (e ===
|
|
1443
|
+
if (e === Ot.id)
|
|
1444
1444
|
return this._moveRowInterceptor(i.params, "insert");
|
|
1445
|
-
if ([
|
|
1445
|
+
if ([Vt.id, kt.id, Yt.id].includes(e))
|
|
1446
1446
|
return this._moveRangeInterceptor(i.params);
|
|
1447
|
-
if (e === Ot.id)
|
|
1448
|
-
return this._moveColInterceptor(i.params, "insert");
|
|
1449
1447
|
if (e === Pt.id)
|
|
1450
|
-
return this.
|
|
1448
|
+
return this._moveColInterceptor(i.params, "insert");
|
|
1451
1449
|
if (e === Tt.id)
|
|
1450
|
+
return this._moveRowInterceptor(i.params, "remove");
|
|
1451
|
+
if (e === Et.id)
|
|
1452
1452
|
return this._moveColInterceptor(i.params, "remove");
|
|
1453
|
-
if (e ===
|
|
1453
|
+
if (e === Ut.id) {
|
|
1454
1454
|
const { range: n } = i.params;
|
|
1455
1455
|
return this._getRangeMoveUndo(
|
|
1456
1456
|
n,
|
|
1457
1457
|
0
|
|
1458
1458
|
/* deleteLeft */
|
|
1459
1459
|
);
|
|
1460
|
-
} else if (e ===
|
|
1460
|
+
} else if (e === At.id) {
|
|
1461
1461
|
const { range: n } = i.params;
|
|
1462
1462
|
return this._getRangeMoveUndo(
|
|
1463
1463
|
n,
|
|
1464
1464
|
1
|
|
1465
1465
|
/* deleteUp */
|
|
1466
1466
|
);
|
|
1467
|
-
} else if (e ===
|
|
1467
|
+
} else if (e === Nt.id) {
|
|
1468
1468
|
const { range: n } = i.params;
|
|
1469
1469
|
return this._getRangeMoveUndo(
|
|
1470
1470
|
n,
|
|
1471
1471
|
2
|
|
1472
1472
|
/* insertDown */
|
|
1473
1473
|
);
|
|
1474
|
-
} else if (e ===
|
|
1474
|
+
} else if (e === jt.id) {
|
|
1475
1475
|
const { range: n } = i.params;
|
|
1476
1476
|
return this._getRangeMoveUndo(
|
|
1477
1477
|
n,
|
|
1478
1478
|
3
|
|
1479
1479
|
/* insertRight */
|
|
1480
1480
|
);
|
|
1481
|
-
} else if (e ===
|
|
1481
|
+
} else if (e === $t.id || e === Bt.id) {
|
|
1482
1482
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1483
1483
|
return this._getDrawingUndoForRowVisible(t, r, s);
|
|
1484
|
-
} else if (e ===
|
|
1484
|
+
} else if (e === Wt.id || e === Gt.id) {
|
|
1485
1485
|
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
|
|
1486
1486
|
return this._getDrawingUndoForColVisible(t, r, s);
|
|
1487
|
-
} else if (e ===
|
|
1488
|
-
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e ===
|
|
1487
|
+
} else if (e === rt.id || e === it.id || e === xt.id || e === Lt.id) {
|
|
1488
|
+
const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === rt.id || e === it.id;
|
|
1489
1489
|
return this._getDrawingUndoForRowAndColSize(t, r, s, o);
|
|
1490
1490
|
}
|
|
1491
1491
|
return { redos: [], undos: [] };
|
|
@@ -1786,7 +1786,7 @@ let ot = class extends re {
|
|
|
1786
1786
|
const { unitId: r, subUnitId: s } = t, o = (R = (v = this._renderManagerService.getRenderById(r)) == null ? void 0 : v.with(q)) == null ? void 0 : R.getCurrentSkeleton();
|
|
1787
1787
|
if (!o)
|
|
1788
1788
|
return { redos: [], undos: [] };
|
|
1789
|
-
const d =
|
|
1789
|
+
const d = Ee(o, n);
|
|
1790
1790
|
if (!d)
|
|
1791
1791
|
return { redos: [], undos: [] };
|
|
1792
1792
|
const { startX: l, endX: g, startY: c, endY: a } = d, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
|
|
@@ -2076,7 +2076,7 @@ let ot = class extends re {
|
|
|
2076
2076
|
_commandListener() {
|
|
2077
2077
|
this.disposeWithMe(
|
|
2078
2078
|
this._commandService.onCommandExecuted((i) => {
|
|
2079
|
-
i.id ===
|
|
2079
|
+
i.id === br.id && setTimeout(() => {
|
|
2080
2080
|
const e = i.params, { unitId: n, subUnitId: t } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
|
|
2081
2081
|
Object.keys(r).forEach((d) => {
|
|
2082
2082
|
const l = r[d];
|
|
@@ -2098,7 +2098,7 @@ let ot = class extends re {
|
|
|
2098
2098
|
_sheetRefreshListener() {
|
|
2099
2099
|
this.disposeWithMe(
|
|
2100
2100
|
this._commandService.onCommandExecuted((i) => {
|
|
2101
|
-
|
|
2101
|
+
Hi.includes(i.id) && requestIdleCallback(() => {
|
|
2102
2102
|
const e = i.params, { unitId: n, subUnitId: t, ranges: r } = e;
|
|
2103
2103
|
this._refreshDrawingTransform(n, t, r);
|
|
2104
2104
|
});
|
|
@@ -2114,7 +2114,7 @@ let ot = class extends re {
|
|
|
2114
2114
|
const { from: c, to: a } = d, { row: h, column: u } = c, { row: m, column: f } = a;
|
|
2115
2115
|
for (let p = 0; p < n.length; p++) {
|
|
2116
2116
|
const I = n[p], { startRow: S, endRow: v, startColumn: R, endColumn: _ } = I;
|
|
2117
|
-
if (
|
|
2117
|
+
if (Dn.intersects(
|
|
2118
2118
|
{
|
|
2119
2119
|
startRow: S,
|
|
2120
2120
|
endRow: v,
|
|
@@ -2143,23 +2143,23 @@ let ot = class extends re {
|
|
|
2143
2143
|
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(j.id, [i]));
|
|
2144
2144
|
}
|
|
2145
2145
|
};
|
|
2146
|
-
|
|
2146
|
+
at = Fi([
|
|
2147
2147
|
Q(1, J),
|
|
2148
2148
|
Q(2, W),
|
|
2149
|
-
Q(3,
|
|
2149
|
+
Q(3, we),
|
|
2150
2150
|
Q(4, x(q)),
|
|
2151
|
-
Q(5, x(
|
|
2152
|
-
Q(6,
|
|
2153
|
-
Q(7,
|
|
2154
|
-
Q(8,
|
|
2155
|
-
],
|
|
2156
|
-
var
|
|
2157
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2151
|
+
Q(5, x(ct)),
|
|
2152
|
+
Q(6, Y),
|
|
2153
|
+
Q(7, z),
|
|
2154
|
+
Q(8, pe)
|
|
2155
|
+
], at);
|
|
2156
|
+
var zi = Object.defineProperty, Ki = Object.getOwnPropertyDescriptor, Ji = (i, e, n, t) => {
|
|
2157
|
+
for (var r = t > 1 ? void 0 : t ? Ki(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2158
2158
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2159
|
-
return t && r &&
|
|
2159
|
+
return t && r && zi(e, n, r), r;
|
|
2160
2160
|
}, se = (i, e) => (n, t) => e(n, t, i);
|
|
2161
|
-
function
|
|
2162
|
-
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(
|
|
2161
|
+
function Zi(i, e, n, t) {
|
|
2162
|
+
const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(Jn.VIEW_MAIN), d = {
|
|
2163
2163
|
left: !0,
|
|
2164
2164
|
top: !0
|
|
2165
2165
|
};
|
|
@@ -2192,13 +2192,13 @@ function Ki(i, e, n, t) {
|
|
|
2192
2192
|
absolute: d
|
|
2193
2193
|
};
|
|
2194
2194
|
}
|
|
2195
|
-
const
|
|
2195
|
+
const et = (i, e, n, t) => {
|
|
2196
2196
|
const { scene: r } = e, { left: s, top: o, width: d, height: l, angle: g } = i, c = {
|
|
2197
2197
|
left: s,
|
|
2198
2198
|
right: s + d,
|
|
2199
2199
|
top: o,
|
|
2200
2200
|
bottom: o + l
|
|
2201
|
-
}, a =
|
|
2201
|
+
}, a = Zi(c, r, n, t), { scaleX: h, scaleY: u } = r.getAncestorScale();
|
|
2202
2202
|
return {
|
|
2203
2203
|
startX: a.left,
|
|
2204
2204
|
endX: a.right,
|
|
@@ -2210,22 +2210,22 @@ const Qe = (i, e, n, t) => {
|
|
|
2210
2210
|
absolute: a.absolute
|
|
2211
2211
|
};
|
|
2212
2212
|
};
|
|
2213
|
-
let
|
|
2213
|
+
let Be = class extends re {
|
|
2214
2214
|
constructor(e, n, t, r, s, o, d) {
|
|
2215
2215
|
super();
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2216
|
+
G(this, "_domLayerMap", /* @__PURE__ */ new Map());
|
|
2217
|
+
G(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
2218
|
+
G(this, "_transformChange$", new Je());
|
|
2219
|
+
G(this, "transformChange$", this._transformChange$.asObservable());
|
|
2220
|
+
G(this, "_add$", new Je());
|
|
2221
|
+
G(this, "add$", this._add$.asObservable());
|
|
2222
|
+
G(this, "_remove$", new Je());
|
|
2223
|
+
G(this, "remove$", this._remove$.asObservable());
|
|
2224
|
+
G(this, "_hooks", []);
|
|
2225
2225
|
this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = d, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
2226
2226
|
}
|
|
2227
2227
|
_bindScrollEvent() {
|
|
2228
|
-
this._lifecycleService.lifecycle$.pipe(ae((e) => e ===
|
|
2228
|
+
this._lifecycleService.lifecycle$.pipe(ae((e) => e === bn.Rendered), fr(1)).subscribe(() => {
|
|
2229
2229
|
this._scrollUpdateListener();
|
|
2230
2230
|
});
|
|
2231
2231
|
}
|
|
@@ -2259,18 +2259,18 @@ let $e = class extends re {
|
|
|
2259
2259
|
// eslint-disable-next-line max-lines-per-function
|
|
2260
2260
|
this._drawingManagerService.add$.subscribe((e) => {
|
|
2261
2261
|
e.forEach((n) => {
|
|
2262
|
-
var
|
|
2262
|
+
var ht, gt, mt;
|
|
2263
2263
|
const { unitId: t, subUnitId: r, drawingId: s } = n, o = ce(this._univerInstanceService, { unitId: t, subUnitId: r }), d = this._drawingManagerService.getDrawingByParam(n), l = this._univerInstanceService.getUnit(t);
|
|
2264
2264
|
if (!l)
|
|
2265
2265
|
return;
|
|
2266
2266
|
const g = l.getActiveSheet().getSheetId();
|
|
2267
2267
|
if (!d || !o)
|
|
2268
2268
|
return;
|
|
2269
|
-
const c = (
|
|
2269
|
+
const c = (ht = this._renderManagerService.getRenderById(t)) == null ? void 0 : ht.with(q).getWorksheetSkeleton(r);
|
|
2270
2270
|
if (!c)
|
|
2271
2271
|
return;
|
|
2272
2272
|
const { transform: a, drawingType: h, data: u } = d;
|
|
2273
|
-
if (h !==
|
|
2273
|
+
if (h !== V.DRAWING_DOM && h !== V.DRAWING_CHART)
|
|
2274
2274
|
return;
|
|
2275
2275
|
const m = this._getSceneAndTransformerByDrawingSearch(t);
|
|
2276
2276
|
if (m == null)
|
|
@@ -2280,7 +2280,7 @@ let $e = class extends re {
|
|
|
2280
2280
|
return !0;
|
|
2281
2281
|
if (g !== r)
|
|
2282
2282
|
return;
|
|
2283
|
-
const { left: I, top: S, width: v, height: R, angle: _, flipX: C, flipY: w, skewX: O, skewY: b } = a, A =
|
|
2283
|
+
const { left: I, top: S, width: v, height: R, angle: _, flipX: C, flipY: w, skewX: O, skewY: b } = a, A = Ke({ unitId: t, subUnitId: r, drawingId: s }), E = f.getObject(A);
|
|
2284
2284
|
if (E != null) {
|
|
2285
2285
|
E.transformByState({ left: I, top: S, width: v, height: R, angle: _, flipX: C, flipY: w, skewX: O, skewY: b });
|
|
2286
2286
|
return;
|
|
@@ -2291,46 +2291,49 @@ let $e = class extends re {
|
|
|
2291
2291
|
width: v,
|
|
2292
2292
|
height: R,
|
|
2293
2293
|
zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
|
|
2294
|
-
}, D = h ===
|
|
2294
|
+
}, D = h === V.DRAWING_CHART;
|
|
2295
2295
|
D && (M.fill = "white", M.rotateEnabled = !1, u && u.border && (M.stroke = u.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8);
|
|
2296
|
-
const U = new
|
|
2297
|
-
D && U.setObjectType(
|
|
2298
|
-
const L = this._ensureMap(t, r), Z = new
|
|
2296
|
+
const U = new _t(A, M);
|
|
2297
|
+
D && U.setObjectType(Hn.CHART), f.addObject(U, zn), d.allowTransform !== !1 && f.attachTransformerTo(U);
|
|
2298
|
+
const L = this._ensureMap(t, r), Z = new yn(), hn = et(U, m.renderObject, c.skeleton, o.worksheet), Xe = new pr(hn), gn = {
|
|
2299
2299
|
dispose: Z,
|
|
2300
2300
|
rect: U,
|
|
2301
|
-
position$:
|
|
2301
|
+
position$: Xe,
|
|
2302
2302
|
unitId: t,
|
|
2303
2303
|
subUnitId: r
|
|
2304
2304
|
};
|
|
2305
2305
|
this._canvasFloatDomService.addFloatDom({
|
|
2306
|
-
position$:
|
|
2306
|
+
position$: Xe,
|
|
2307
2307
|
id: s,
|
|
2308
2308
|
componentKey: d.componentKey,
|
|
2309
|
-
onPointerDown: (
|
|
2310
|
-
|
|
2309
|
+
onPointerDown: (K) => {
|
|
2310
|
+
const de = this._createNewEvent(K);
|
|
2311
|
+
p.dispatchEvent(new PointerEvent(de.type, de));
|
|
2311
2312
|
},
|
|
2312
|
-
onPointerMove: (
|
|
2313
|
-
|
|
2313
|
+
onPointerMove: (K) => {
|
|
2314
|
+
const de = this._createNewEvent(K);
|
|
2315
|
+
p.dispatchEvent(de);
|
|
2314
2316
|
},
|
|
2315
|
-
onPointerUp: (
|
|
2316
|
-
|
|
2317
|
+
onPointerUp: (K) => {
|
|
2318
|
+
const de = this._createNewEvent(K);
|
|
2319
|
+
p.dispatchEvent(de);
|
|
2317
2320
|
},
|
|
2318
|
-
onWheel: (
|
|
2319
|
-
p.dispatchEvent(new WheelEvent(
|
|
2321
|
+
onWheel: (K) => {
|
|
2322
|
+
p.dispatchEvent(new WheelEvent(K.type, K));
|
|
2320
2323
|
},
|
|
2321
|
-
props: (
|
|
2324
|
+
props: (mt = (gt = L.get(s)) == null ? void 0 : gt.props) != null ? mt : this._getFloatDomProps(s),
|
|
2322
2325
|
data: u,
|
|
2323
2326
|
unitId: t
|
|
2324
2327
|
});
|
|
2325
|
-
const
|
|
2326
|
-
const
|
|
2327
|
-
|
|
2328
|
-
|
|
2328
|
+
const ut = U.onTransformChange$.subscribeEvent(() => {
|
|
2329
|
+
const K = et(U, m.renderObject, c.skeleton, o.worksheet);
|
|
2330
|
+
Xe.next(
|
|
2331
|
+
K
|
|
2329
2332
|
);
|
|
2330
2333
|
});
|
|
2331
2334
|
Z.add(() => {
|
|
2332
2335
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
2333
|
-
}),
|
|
2336
|
+
}), ut && Z.add(ut), this._domLayerInfoMap.set(s, gn), L.set(s, {
|
|
2334
2337
|
...L.get(s)
|
|
2335
2338
|
});
|
|
2336
2339
|
});
|
|
@@ -2338,7 +2341,7 @@ let $e = class extends re {
|
|
|
2338
2341
|
), this.disposeWithMe(
|
|
2339
2342
|
this._drawingManagerService.remove$.subscribe((e) => {
|
|
2340
2343
|
e.forEach((n) => {
|
|
2341
|
-
const { unitId: t, subUnitId: r, drawingId: s } = n, o =
|
|
2344
|
+
const { unitId: t, subUnitId: r, drawingId: s } = n, o = Ke({ unitId: t, subUnitId: r, drawingId: s }), d = this._getSceneAndTransformerByDrawingSearch(t);
|
|
2342
2345
|
if (d == null)
|
|
2343
2346
|
return;
|
|
2344
2347
|
const { transformer: l, scene: g } = d, c = g.getObject(o);
|
|
@@ -2347,6 +2350,10 @@ let $e = class extends re {
|
|
|
2347
2350
|
})
|
|
2348
2351
|
);
|
|
2349
2352
|
}
|
|
2353
|
+
_createNewEvent(e) {
|
|
2354
|
+
const n = Kn(e);
|
|
2355
|
+
return new PointerEvent(e.type, n);
|
|
2356
|
+
}
|
|
2350
2357
|
_scrollUpdateListener() {
|
|
2351
2358
|
const e = (n, t) => {
|
|
2352
2359
|
var g;
|
|
@@ -2354,33 +2361,33 @@ let $e = class extends re {
|
|
|
2354
2361
|
!r || !d || !l || o.forEach((c) => {
|
|
2355
2362
|
const a = this._domLayerInfoMap.get(c);
|
|
2356
2363
|
if (a) {
|
|
2357
|
-
const h =
|
|
2364
|
+
const h = et(a.rect, r.renderObject, l.skeleton, d.worksheet);
|
|
2358
2365
|
a.position$.next(h);
|
|
2359
2366
|
}
|
|
2360
2367
|
});
|
|
2361
2368
|
};
|
|
2362
2369
|
this.disposeWithMe(
|
|
2363
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2370
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(
|
|
2364
2371
|
ae((n) => !!n),
|
|
2365
|
-
|
|
2372
|
+
Ue((n) => {
|
|
2366
2373
|
const t = this._renderManagerService.getRenderById(n.getUnitId());
|
|
2367
2374
|
return t ? { render: t, unitId: n.getUnitId(), subUnitId: n.getActiveSheet().getSheetId() } : null;
|
|
2368
2375
|
}),
|
|
2369
2376
|
ae((n) => !!n),
|
|
2370
|
-
|
|
2371
|
-
(n) =>
|
|
2377
|
+
wr(
|
|
2378
|
+
(n) => On(n.render.scene.getViewport(rr.VIEW_MAIN).onScrollAfter$).pipe(Ue(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
|
|
2372
2379
|
)
|
|
2373
2380
|
).subscribe(({ unitId: n, subUnitId: t }) => {
|
|
2374
2381
|
e(n, t);
|
|
2375
2382
|
})
|
|
2376
2383
|
), this.disposeWithMe(this._commandService.onCommandExecuted((n) => {
|
|
2377
2384
|
var t, r;
|
|
2378
|
-
if (n.id ===
|
|
2385
|
+
if (n.id === ir.id) {
|
|
2379
2386
|
const s = n.params, { unitId: o } = s;
|
|
2380
2387
|
Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((l) => {
|
|
2381
2388
|
e(o, l);
|
|
2382
2389
|
});
|
|
2383
|
-
} else if (n.id ===
|
|
2390
|
+
} else if (n.id === yr.id) {
|
|
2384
2391
|
const { unitId: s, subUnitId: o } = n.params;
|
|
2385
2392
|
e(s, o);
|
|
2386
2393
|
}
|
|
@@ -2388,7 +2395,7 @@ let $e = class extends re {
|
|
|
2388
2395
|
}
|
|
2389
2396
|
_getPosition(e, n) {
|
|
2390
2397
|
var h;
|
|
2391
|
-
const { startX: t, endX: r, startY: s, endY: o } = e, d = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(
|
|
2398
|
+
const { startX: t, endX: r, startY: s, endY: o } = e, d = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(we);
|
|
2392
2399
|
if (d == null)
|
|
2393
2400
|
return;
|
|
2394
2401
|
const l = d.getSelectionCellByPosition(t, s);
|
|
@@ -2418,7 +2425,7 @@ let $e = class extends re {
|
|
|
2418
2425
|
this._drawingManagerService.update$.subscribe((e) => {
|
|
2419
2426
|
e.forEach((n) => {
|
|
2420
2427
|
const t = this._drawingManagerService.getDrawingByParam(n);
|
|
2421
|
-
if (!t || t.drawingType !==
|
|
2428
|
+
if (!t || t.drawingType !== V.DRAWING_DOM && t.drawingType !== V.DRAWING_CHART)
|
|
2422
2429
|
return;
|
|
2423
2430
|
const r = {
|
|
2424
2431
|
...t.transform
|
|
@@ -2440,8 +2447,8 @@ let $e = class extends re {
|
|
|
2440
2447
|
updateFloatDomProps(e, n, t, r) {
|
|
2441
2448
|
const s = this._domLayerInfoMap.get(t), o = this._getSceneAndTransformerByDrawingSearch(e);
|
|
2442
2449
|
if (s && o) {
|
|
2443
|
-
const { scene: d } = o, l =
|
|
2444
|
-
g && g instanceof
|
|
2450
|
+
const { scene: d } = o, l = Ke({ unitId: e, subUnitId: n, drawingId: t }), g = d.getObject(l);
|
|
2451
|
+
g && g instanceof _t && g.setProps(r);
|
|
2445
2452
|
}
|
|
2446
2453
|
}
|
|
2447
2454
|
addFloatDomToPosition(e, n) {
|
|
@@ -2451,7 +2458,7 @@ let $e = class extends re {
|
|
|
2451
2458
|
});
|
|
2452
2459
|
if (!t)
|
|
2453
2460
|
throw new Error("cannot find current target!");
|
|
2454
|
-
const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: d, data: l, allowTransform: g = !0 } = e, c = n != null ? n :
|
|
2461
|
+
const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: d, data: l, allowTransform: g = !0 } = e, c = n != null ? n : Pn(), a = this._getPosition(o, r);
|
|
2455
2462
|
if (a == null)
|
|
2456
2463
|
return;
|
|
2457
2464
|
this._ensureMap(r, s).set(c, e);
|
|
@@ -2459,7 +2466,7 @@ let $e = class extends re {
|
|
|
2459
2466
|
unitId: r,
|
|
2460
2467
|
subUnitId: s,
|
|
2461
2468
|
drawingId: c,
|
|
2462
|
-
drawingType: e.type ||
|
|
2469
|
+
drawingType: e.type || V.DRAWING_DOM,
|
|
2463
2470
|
componentKey: d,
|
|
2464
2471
|
sheetTransform: a,
|
|
2465
2472
|
transform: {
|
|
@@ -2471,7 +2478,7 @@ let $e = class extends re {
|
|
|
2471
2478
|
data: l,
|
|
2472
2479
|
allowTransform: g
|
|
2473
2480
|
};
|
|
2474
|
-
return this._commandService.executeCommand(
|
|
2481
|
+
return this._commandService.executeCommand(Ye.id, {
|
|
2475
2482
|
unitId: r,
|
|
2476
2483
|
drawings: [u]
|
|
2477
2484
|
}), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
|
|
@@ -2506,86 +2513,86 @@ let $e = class extends re {
|
|
|
2506
2513
|
};
|
|
2507
2514
|
}
|
|
2508
2515
|
};
|
|
2509
|
-
|
|
2516
|
+
Be = Ji([
|
|
2510
2517
|
se(0, x(J)),
|
|
2511
|
-
se(1,
|
|
2518
|
+
se(1, pe),
|
|
2512
2519
|
se(2, x(W)),
|
|
2513
|
-
se(3,
|
|
2514
|
-
se(4, x(
|
|
2515
|
-
se(5,
|
|
2516
|
-
se(6, x(
|
|
2517
|
-
],
|
|
2518
|
-
var
|
|
2519
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2520
|
+
se(3, z),
|
|
2521
|
+
se(4, x(mr)),
|
|
2522
|
+
se(5, Y),
|
|
2523
|
+
se(6, x(Mn))
|
|
2524
|
+
], Be);
|
|
2525
|
+
var ln = Object.defineProperty, qi = Object.getOwnPropertyDescriptor, Qi = (i, e, n) => e in i ? ln(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, es = (i, e, n, t) => {
|
|
2526
|
+
for (var r = t > 1 ? void 0 : t ? qi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2520
2527
|
(o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
|
|
2521
|
-
return t && r &&
|
|
2522
|
-
},
|
|
2523
|
-
const
|
|
2524
|
-
let
|
|
2525
|
-
constructor(i =
|
|
2528
|
+
return t && r && ln(e, n, r), r;
|
|
2529
|
+
}, tt = (i, e) => (n, t) => e(n, t, i), un = (i, e, n) => Qi(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2530
|
+
const ts = "SHEET_IMAGE_UI_PLUGIN";
|
|
2531
|
+
let We = class extends En {
|
|
2532
|
+
constructor(i = Er, e, n, t) {
|
|
2526
2533
|
super(), this._config = i, this._injector = e, this._renderManagerService = n, this._configService = t;
|
|
2527
2534
|
const { menu: r, ...s } = this._config;
|
|
2528
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
2535
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Tr, s);
|
|
2529
2536
|
}
|
|
2530
2537
|
onStarting() {
|
|
2531
|
-
|
|
2538
|
+
Un(this._injector, [
|
|
2539
|
+
[Be],
|
|
2540
|
+
[je],
|
|
2541
|
+
[Ae],
|
|
2532
2542
|
[$e],
|
|
2533
|
-
[Ne],
|
|
2534
|
-
[Ue],
|
|
2535
2543
|
[Le],
|
|
2536
|
-
[xe]
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
[$e]
|
|
2544
|
+
[xe]
|
|
2545
|
+
]), He(this._injector, [
|
|
2546
|
+
[Be]
|
|
2540
2547
|
]);
|
|
2541
2548
|
}
|
|
2542
2549
|
onReady() {
|
|
2543
|
-
|
|
2544
|
-
[
|
|
2550
|
+
He(this._injector, [
|
|
2551
|
+
[xe]
|
|
2545
2552
|
]);
|
|
2546
2553
|
}
|
|
2547
2554
|
onRendered() {
|
|
2548
|
-
this._registerRenderModules(),
|
|
2549
|
-
[xe],
|
|
2555
|
+
this._registerRenderModules(), He(this._injector, [
|
|
2550
2556
|
[Le],
|
|
2551
|
-
[
|
|
2557
|
+
[$e],
|
|
2558
|
+
[je]
|
|
2552
2559
|
]);
|
|
2553
2560
|
}
|
|
2554
2561
|
onSteady() {
|
|
2555
|
-
this._injector.get(
|
|
2562
|
+
this._injector.get(Ae);
|
|
2556
2563
|
}
|
|
2557
2564
|
_registerRenderModules() {
|
|
2558
2565
|
[
|
|
2559
|
-
[
|
|
2560
|
-
[
|
|
2561
|
-
[
|
|
2566
|
+
[Ne],
|
|
2567
|
+
[at],
|
|
2568
|
+
[ot]
|
|
2562
2569
|
].forEach((i) => {
|
|
2563
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
2570
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(k.UNIVER_SHEET, i));
|
|
2564
2571
|
});
|
|
2565
2572
|
}
|
|
2566
2573
|
};
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
],
|
|
2574
|
+
un(We, "type", k.UNIVER_SHEET);
|
|
2575
|
+
un(We, "pluginName", ts);
|
|
2576
|
+
We = es([
|
|
2577
|
+
Tn(Ln, Yn, Zn),
|
|
2578
|
+
tt(1, x(Rt)),
|
|
2579
|
+
tt(2, J),
|
|
2580
|
+
tt(3, An)
|
|
2581
|
+
], We);
|
|
2575
2582
|
export {
|
|
2576
2583
|
j as ClearSheetDrawingTransformerOperation,
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2584
|
+
nn as DeleteDrawingsCommand,
|
|
2585
|
+
Jt as EditSheetDrawingOperation,
|
|
2586
|
+
rn as GroupSheetDrawingCommand,
|
|
2587
|
+
cn as IMAGE_MENU_ID,
|
|
2588
|
+
lt as InsertFloatImageCommand,
|
|
2589
|
+
Ye as InsertSheetDrawingCommand,
|
|
2590
|
+
_e as MoveDrawingsCommand,
|
|
2591
|
+
Ve as RemoveSheetDrawingCommand,
|
|
2592
|
+
sn as SetDrawingArrangeCommand,
|
|
2593
|
+
Fe as SetSheetDrawingCommand,
|
|
2594
|
+
Be as SheetCanvasFloatDomManagerService,
|
|
2595
|
+
Kt as SidebarSheetDrawingOperation,
|
|
2596
|
+
on as UngroupSheetDrawingCommand,
|
|
2597
|
+
We as UniverSheetsDrawingUIPlugin
|
|
2591
2598
|
};
|